From fa71fc01bff22f3a929a7760cb5d03f77e4a0eec Mon Sep 17 00:00:00 2001 From: Petyo Ivanov Date: Sat, 13 Jan 2024 10:46:40 +0200 Subject: [PATCH] fix: pasting images works Fixes #281 --- src/plugins/image/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/image/index.ts b/src/plugins/image/index.ts index f9c07625..ace11320 100644 --- a/src/plugins/image/index.ts +++ b/src/plugins/image/index.ts @@ -161,6 +161,7 @@ export const imageDialogState$ = Cell { const theUploadHandler = r.getValue(imageUploadHandler$) + console.log('theUploadHandler', theUploadHandler) return mergeRegister( editor?.registerCommand( INSERT_IMAGE_COMMAND, @@ -286,7 +287,11 @@ export const imagePlugin = realmPlugin<{ [addImportVisitor$]: [MdastImageVisitor, MdastHtmlImageVisitor, MdastJsxImageVisitor], [addLexicalNode$]: ImageNode, [addExportVisitor$]: LexicalImageVisitor, - [addComposerChild$]: params?.ImageDialog || ImageDialog + [addComposerChild$]: params?.ImageDialog || ImageDialog, + [imageUploadHandler$]: params?.imageUploadHandler || null, + [imageAutocompleteSuggestions$]: params?.imageAutocompleteSuggestions || [], + [disableImageResize$]: Boolean(params?.disableImageResize), + [imagePreviewHandler$]: params?.imagePreviewHandler || null }) },