diff --git a/packages/svelte-lexical/src/lib/components/toolbar/RedoButton.svelte b/packages/svelte-lexical/src/lib/components/toolbar/RedoButton.svelte index a22646f..6d5850c 100644 --- a/packages/svelte-lexical/src/lib/components/toolbar/RedoButton.svelte +++ b/packages/svelte-lexical/src/lib/components/toolbar/RedoButton.svelte @@ -20,7 +20,7 @@ // unregisters onDestroy through returned callback onMount(() => { - editor.registerCommand( + return editor.registerCommand( CAN_REDO_COMMAND, (payload) => { canRedo = payload; diff --git a/packages/svelte-lexical/src/lib/components/toolbar/StateStoreRichTextUpdator.svelte b/packages/svelte-lexical/src/lib/components/toolbar/StateStoreRichTextUpdator.svelte index 839e65c..289162e 100644 --- a/packages/svelte-lexical/src/lib/components/toolbar/StateStoreRichTextUpdator.svelte +++ b/packages/svelte-lexical/src/lib/components/toolbar/StateStoreRichTextUpdator.svelte @@ -139,7 +139,7 @@ // unregisters onDestory using returned callback onMount(() => { - mergeRegister( + return mergeRegister( editor.registerUpdateListener(({editorState}) => { editorState.read(() => { updateToolbar(); diff --git a/packages/svelte-lexical/src/lib/components/toolbar/UndoButton.svelte b/packages/svelte-lexical/src/lib/components/toolbar/UndoButton.svelte index 88da916..9ac4e7f 100644 --- a/packages/svelte-lexical/src/lib/components/toolbar/UndoButton.svelte +++ b/packages/svelte-lexical/src/lib/components/toolbar/UndoButton.svelte @@ -20,7 +20,7 @@ // unregisters onDestroy through returned callback onMount(() => { - editor.registerCommand( + return editor.registerCommand( CAN_UNDO_COMMAND, (payload) => { canUndo = payload; diff --git a/packages/svelte-lexical/src/lib/core/ContentEditable.svelte b/packages/svelte-lexical/src/lib/core/ContentEditable.svelte index 3006e80..05251b1 100644 --- a/packages/svelte-lexical/src/lib/core/ContentEditable.svelte +++ b/packages/svelte-lexical/src/lib/core/ContentEditable.svelte @@ -38,7 +38,7 @@ } isEditable = editor.isEditable(); - editor.registerEditableListener((currentIsEditable) => { + return editor.registerEditableListener((currentIsEditable) => { isEditable = currentIsEditable; }); }); diff --git a/packages/svelte-lexical/src/lib/core/plugins/HorizontalRulePlugin.svelte b/packages/svelte-lexical/src/lib/core/plugins/HorizontalRulePlugin.svelte index 89c1860..1973513 100644 --- a/packages/svelte-lexical/src/lib/core/plugins/HorizontalRulePlugin.svelte +++ b/packages/svelte-lexical/src/lib/core/plugins/HorizontalRulePlugin.svelte @@ -15,7 +15,7 @@ const editor = getEditor(); onMount(() => { - editor.registerCommand( + return editor.registerCommand( INSERT_HORIZONTAL_RULE_COMMAND, (type) => { const selection = getSelection(); diff --git a/packages/svelte-lexical/src/lib/core/plugins/MardownShortcut/MarkdownShortcutPlugin.svelte b/packages/svelte-lexical/src/lib/core/plugins/MardownShortcut/MarkdownShortcutPlugin.svelte index 22d9d30..486da4a 100644 --- a/packages/svelte-lexical/src/lib/core/plugins/MardownShortcut/MarkdownShortcutPlugin.svelte +++ b/packages/svelte-lexical/src/lib/core/plugins/MardownShortcut/MarkdownShortcutPlugin.svelte @@ -81,6 +81,6 @@ ]; onMount(() => { - registerMarkdownShortcuts(editor, TRANSFORMERS); + return registerMarkdownShortcuts(editor, TRANSFORMERS); });