diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index a4dd886b..652b4382 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -1287,5 +1287,7 @@ "Analytics / tracker": "Analytics / tracker", "Injected verbatim into the
of PUBLIC SHARE pages only (same-origin). For analytics snippets (Google Analytics, Yandex.Metrika, etc.). Admin only.": "Injected verbatim into the of PUBLIC SHARE pages only (same-origin). For analytics snippets (Google Analytics, Yandex.Metrika, etc.). Admin only.", "Go to login page": "Go to login page", - "Move to space": "Move to space" + "Move to space": "Move to space", + "Float left (wrap text)": "Float left (wrap text)", + "Float right (wrap text)": "Float right (wrap text)" } diff --git a/apps/client/public/locales/ru-RU/translation.json b/apps/client/public/locales/ru-RU/translation.json index ca14b406..f403854e 100644 --- a/apps/client/public/locales/ru-RU/translation.json +++ b/apps/client/public/locales/ru-RU/translation.json @@ -1137,5 +1137,7 @@ "Create subpage of {{name}}": "Создать подстраницу для {{name}}", "Dictation language": "Язык диктовки", "Auto-detect": "Автоопределение", - "Spoken language hint sent to the transcription model. Auto-detect lets the model decide.": "Подсказка языка речи для модели транскрипции. «Автоопределение» оставляет выбор за моделью." + "Spoken language hint sent to the transcription model. Auto-detect lets the model decide.": "Подсказка языка речи для модели транскрипции. «Автоопределение» оставляет выбор за моделью.", + "Float left (wrap text)": "Обтекание слева", + "Float right (wrap text)": "Обтекание справа" } diff --git a/apps/client/src/features/editor/components/image/image-menu.tsx b/apps/client/src/features/editor/components/image/image-menu.tsx index 179deda1..e328090b 100644 --- a/apps/client/src/features/editor/components/image/image-menu.tsx +++ b/apps/client/src/features/editor/components/image/image-menu.tsx @@ -13,6 +13,8 @@ import { IconLayoutAlignCenter, IconLayoutAlignLeft, IconLayoutAlignRight, + IconFloatLeft, + IconFloatRight, IconDownload, IconRefresh, IconTrash, @@ -41,6 +43,8 @@ export function ImageMenu({ editor }: EditorMenuProps) { isAlignLeft: ctx.editor.isActive("image", { align: "left" }), isAlignCenter: ctx.editor.isActive("image", { align: "center" }), isAlignRight: ctx.editor.isActive("image", { align: "right" }), + isFloatLeft: ctx.editor.isActive("image", { align: "floatLeft" }), + isFloatRight: ctx.editor.isActive("image", { align: "floatRight" }), src: imageAttrs?.src || null, alt: imageAttrs?.alt || "", }; @@ -104,6 +108,22 @@ export function ImageMenu({ editor }: EditorMenuProps) { .run(); }, [editor]); + const alignImageFloatLeft = useCallback(() => { + editor + .chain() + .focus(undefined, { scrollIntoView: false }) + .setImageAlign("floatLeft") + .run(); + }, [editor]); + + const alignImageFloatRight = useCallback(() => { + editor + .chain() + .focus(undefined, { scrollIntoView: false }) + .setImageAlign("floatRight") + .run(); + }, [editor]); + const handleDownload = useCallback(() => { if (!editorState?.src) return; const url = getFileUrl(editorState.src); @@ -201,6 +221,30 @@ export function ImageMenu({ editor }: EditorMenuProps) { +