From 937de59c4e80a19369d94aa4e18984c1854b63d5 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 9 Feb 2026 19:45:33 +0545 Subject: [PATCH 1/3] fix(OUT-3049): added settings on image extension to support width and height attribute on resize --- .vscode/settings.json | 15 ++++++++- .../components/Editor/extensions/Image.ext.ts | 32 ++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 75bc7e2..67e26e4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,18 @@ "source.organizeImports": "never", "source.organizeImports.biome": "explicit", "source.fixAll.biome": "explicit" - } + }, + "workbench.tree.renderIndentGuides": "always", + "workbench.tree.indent": 10, + "editor.fontSize": 13, + "editor.fontFamily": "Fira Code", + "editor.lineHeight": 24, + "editor.fontLigatures": true, + "editor.formatOnPaste": true, + "editor.guides.bracketPairs": true, + "files.trimTrailingWhitespace": true, + + "editor.formatOnSave": true, + "window.zoomLevel": 0.5, + } diff --git a/src/features/editor/components/Editor/extensions/Image.ext.ts b/src/features/editor/components/Editor/extensions/Image.ext.ts index e45c27a..b253355 100644 --- a/src/features/editor/components/Editor/extensions/Image.ext.ts +++ b/src/features/editor/components/Editor/extensions/Image.ext.ts @@ -1,6 +1,36 @@ import Image from '@tiptap/extension-image' -export const ImageExt = Image.configure({ +export const ImageExt = Image.extend({ + addAttributes() { + return { + ...this.parent?.(), + width: { + default: null, + parseHTML: (element) => element.getAttribute('width'), + renderHTML: (attributes) => { + if (!attributes.width) { + return {} + } + return { + width: attributes.width, + } + }, + }, + height: { + default: null, + parseHTML: (element) => element.getAttribute('height'), + renderHTML: (attributes) => { + if (!attributes.height) { + return {} + } + return { + height: attributes.height, + } + }, + }, + } + }, +}).configure({ resize: { enabled: true, alwaysPreserveAspectRatio: true, From 0322a2e9de44ba656cbe0626a762bb3e4398e436 Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Mon, 9 Feb 2026 19:47:44 +0545 Subject: [PATCH 2/3] fix(OUT-3049): reverted settings.json --- .vscode/settings.json | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 67e26e4..75bc7e2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,18 +5,5 @@ "source.organizeImports": "never", "source.organizeImports.biome": "explicit", "source.fixAll.biome": "explicit" - }, - "workbench.tree.renderIndentGuides": "always", - "workbench.tree.indent": 10, - "editor.fontSize": 13, - "editor.fontFamily": "Fira Code", - "editor.lineHeight": 24, - "editor.fontLigatures": true, - "editor.formatOnPaste": true, - "editor.guides.bracketPairs": true, - "files.trimTrailingWhitespace": true, - - "editor.formatOnSave": true, - "window.zoomLevel": 0.5, - + } } From e7306b165835ae7a1e60a1effffc75e403d8013b Mon Sep 17 00:00:00 2001 From: arpandhakal Date: Tue, 10 Feb 2026 13:16:28 +0545 Subject: [PATCH 3/3] fix(OUT-3048): image src not updating in the content when upload is completed --- src/features/editor/hooks/useAppControls.tsx | 1 - src/features/editor/hooks/useFileHandlers.tsx | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/features/editor/hooks/useAppControls.tsx b/src/features/editor/hooks/useAppControls.tsx index dd89701..7ee7521 100644 --- a/src/features/editor/hooks/useAppControls.tsx +++ b/src/features/editor/hooks/useAppControls.tsx @@ -1,5 +1,4 @@ import { usePrimaryCta, useSecondaryCta } from '@app-bridge/hooks' -import { useEditorStore } from '@editor/stores/editorStore' import { useSettingsMutation } from '@settings/hooks/useSettingsMutation' import type { SettingsUpdateDto } from '@settings/lib/settings-actions.dto' import { useSettingsStore } from '@settings/providers/settings.provider' diff --git a/src/features/editor/hooks/useFileHandlers.tsx b/src/features/editor/hooks/useFileHandlers.tsx index b3476d2..26cc197 100644 --- a/src/features/editor/hooks/useFileHandlers.tsx +++ b/src/features/editor/hooks/useFileHandlers.tsx @@ -38,7 +38,19 @@ export const useFileHandlers = () => { } const signedUrl = await uploadFileToSupabase(file, token) - setContent(currentEditor.getHTML().replaceAll(fileReader.result as string, signedUrl)) + const { doc } = currentEditor.state + let imagePos: number | null = null + doc.descendants((node, pos) => { + if (node.type.name === 'image' && node.attrs.title === randId) { + imagePos = pos + return false //short circuit the search for image position. + } + }) + + if (imagePos !== null) { + currentEditor.chain().focus().setNodeSelection(imagePos).updateAttributes('image', { src: signedUrl }).run() + setContent(currentEditor.getHTML()) + } } }) }