@multiplatform.one/rich-text 6.1.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/cjs/RichEditor.cjs +89 -9
- package/dist/cjs/RichEditor.native.js +444 -35
- package/dist/cjs/RichEditor.native.js.map +1 -1
- package/dist/cjs/RichTextEditor/index.cjs +20 -2
- package/dist/cjs/RichTextEditor/index.native.js +20 -2
- package/dist/cjs/RichTextEditor/index.native.js.map +1 -1
- package/dist/cjs/constants.cjs +52 -29
- package/dist/cjs/constants.native.js +59 -29
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/editor/BlockDragHandle.cjs +22 -7
- package/dist/cjs/editor/BlockDragHandle.native.js +41 -7
- package/dist/cjs/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/cjs/editor/SlashCommands.cjs +257 -294
- package/dist/cjs/editor/SlashCommands.native.js +320 -341
- package/dist/cjs/editor/SlashCommands.native.js.map +1 -1
- package/dist/cjs/editor/TentapEditor.native.js +59 -12
- package/dist/cjs/editor/TentapEditor.native.js.map +1 -1
- package/dist/cjs/editor/TiptapEditor.cjs +143 -240
- package/dist/cjs/editor/TiptapEditor.native.js +163 -289
- package/dist/cjs/editor/TiptapEditor.native.js.map +1 -1
- package/dist/cjs/editor/blockAnchor.cjs +43 -0
- package/dist/cjs/editor/blockAnchor.native.js +68 -0
- package/dist/cjs/editor/blockAnchor.native.js.map +1 -0
- package/dist/cjs/editor/capabilities.cjs +37 -0
- package/dist/cjs/editor/capabilities.native.js +41 -0
- package/dist/cjs/editor/capabilities.native.js.map +1 -0
- package/dist/cjs/editor/codeBlockPreview.cjs +230 -0
- package/dist/cjs/editor/codeBlockPreview.native.js +265 -0
- package/dist/cjs/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/cjs/editor/editorStyles.cjs +203 -34
- package/dist/cjs/editor/editorStyles.native.js +203 -34
- package/dist/cjs/editor/editorStyles.native.js.map +1 -1
- package/dist/cjs/editor/emoji.cjs +128 -0
- package/dist/cjs/editor/emoji.native.js +184 -0
- package/dist/cjs/editor/emoji.native.js.map +1 -0
- package/dist/cjs/editor/extensions.cjs +275 -0
- package/dist/cjs/editor/extensions.native.js +328 -0
- package/dist/cjs/editor/extensions.native.js.map +1 -0
- package/dist/cjs/editor/lazyKatex.cjs +78 -0
- package/dist/cjs/editor/lazyKatex.native.js +117 -0
- package/dist/cjs/editor/lazyKatex.native.js.map +1 -0
- package/dist/cjs/editor/markdown.cjs +216 -0
- package/dist/cjs/editor/markdown.native.js +278 -0
- package/dist/cjs/editor/markdown.native.js.map +1 -0
- package/dist/cjs/editor/mathematics.cjs +168 -0
- package/dist/cjs/editor/mathematics.native.js +202 -0
- package/dist/cjs/editor/mathematics.native.js.map +1 -0
- package/dist/cjs/editor/media.cjs +138 -0
- package/dist/cjs/editor/media.native.js +172 -0
- package/dist/cjs/editor/media.native.js.map +1 -0
- package/dist/cjs/editor/mentions.cjs +73 -0
- package/dist/cjs/editor/mentions.native.js +84 -0
- package/dist/cjs/editor/mentions.native.js.map +1 -0
- package/dist/cjs/editor/pasteCleanup.cjs +83 -0
- package/dist/cjs/editor/pasteCleanup.native.js +175 -0
- package/dist/cjs/editor/pasteCleanup.native.js.map +1 -0
- package/dist/cjs/editor/suggestionPopup.cjs +297 -0
- package/dist/cjs/editor/suggestionPopup.native.js +327 -0
- package/dist/cjs/editor/suggestionPopup.native.js.map +1 -0
- package/dist/cjs/index.cjs +5 -2
- package/dist/cjs/index.native.js +4 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/preview.cjs +263 -0
- package/dist/cjs/preview.native.js +294 -0
- package/dist/cjs/preview.native.js.map +1 -0
- package/dist/cjs/shared/t.cjs +53 -0
- package/dist/cjs/shared/t.native.js +56 -0
- package/dist/cjs/shared/t.native.js.map +1 -0
- package/dist/cjs/shared/url.cjs +35 -0
- package/dist/cjs/shared/url.native.js +38 -0
- package/dist/cjs/shared/url.native.js.map +1 -0
- package/dist/cjs/styled.cjs +13 -6
- package/dist/cjs/styled.native.js +13 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/toolbar/BubbleToolbar.cjs +19 -14
- package/dist/cjs/toolbar/BubbleToolbar.native.js +22 -15
- package/dist/cjs/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/cjs/toolbar/CodeBlockBubble.cjs +59 -23
- package/dist/cjs/toolbar/CodeBlockBubble.native.js +71 -25
- package/dist/cjs/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ColorPicker.cjs +19 -54
- package/dist/cjs/toolbar/ColorPicker.native.js +81 -179
- package/dist/cjs/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/FixedToolbar.cjs +39 -13
- package/dist/cjs/toolbar/FixedToolbar.native.js +46 -54
- package/dist/cjs/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/cjs/toolbar/HeadingPicker.cjs +32 -39
- package/dist/cjs/toolbar/HeadingPicker.native.js +61 -51
- package/dist/cjs/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/ImageBubble.cjs +20 -43
- package/dist/cjs/toolbar/ImageBubble.native.js +20 -43
- package/dist/cjs/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ImageDialog.cjs +5 -4
- package/dist/cjs/toolbar/ImageDialog.native.js +76 -65
- package/dist/cjs/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/cjs/toolbar/LinkBubble.cjs +23 -70
- package/dist/cjs/toolbar/LinkBubble.native.js +23 -70
- package/dist/cjs/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/LinkDialog.cjs +19 -18
- package/dist/cjs/toolbar/LinkDialog.native.js +86 -83
- package/dist/cjs/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/cjs/toolbar/ListPicker.cjs +32 -43
- package/dist/cjs/toolbar/ListPicker.native.js +43 -44
- package/dist/cjs/toolbar/ListPicker.native.js.map +1 -1
- package/dist/cjs/toolbar/MathBubble.cjs +159 -0
- package/dist/cjs/toolbar/MathBubble.native.js +169 -0
- package/dist/cjs/toolbar/MathBubble.native.js.map +1 -0
- package/dist/cjs/toolbar/MoreDropdown.cjs +54 -93
- package/dist/cjs/toolbar/MoreDropdown.native.js +80 -93
- package/dist/cjs/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/cjs/toolbar/StatusBar.cjs +19 -10
- package/dist/cjs/toolbar/StatusBar.native.js +19 -10
- package/dist/cjs/toolbar/StatusBar.native.js.map +1 -1
- package/dist/cjs/toolbar/TableBubble.cjs +91 -96
- package/dist/cjs/toolbar/TableBubble.native.js +90 -73
- package/dist/cjs/toolbar/TableBubble.native.js.map +1 -1
- package/dist/cjs/toolbar/ToolbarButton.cjs +86 -21
- package/dist/cjs/toolbar/ToolbarButton.native.js +14 -4
- package/dist/cjs/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/cjs/toolbar/icons.cjs +111 -468
- package/dist/cjs/toolbar/shortcuts.cjs +73 -24
- package/dist/cjs/toolbar/shortcuts.native.js +73 -24
- package/dist/cjs/toolbar/shortcuts.native.js.map +1 -1
- package/dist/cjs/toolbar/useHorizontalScroll.cjs +25 -5
- package/dist/cjs/toolbar/useHorizontalScroll.native.js +25 -5
- package/dist/cjs/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/cjs/toolbar/useRovingFocus.cjs +80 -0
- package/dist/cjs/toolbar/useRovingFocus.native.js +113 -0
- package/dist/cjs/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/RichEditor.mjs +90 -10
- package/dist/esm/RichEditor.mjs.map +1 -1
- package/dist/esm/RichEditor.native.js +447 -38
- package/dist/esm/RichEditor.native.js.map +1 -1
- package/dist/esm/RichTextEditor/index.mjs +20 -2
- package/dist/esm/RichTextEditor/index.mjs.map +1 -1
- package/dist/esm/RichTextEditor/index.native.js +20 -2
- package/dist/esm/RichTextEditor/index.native.js.map +1 -1
- package/dist/esm/constants.mjs +47 -29
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +54 -29
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/editor/BlockDragHandle.mjs +22 -7
- package/dist/esm/editor/BlockDragHandle.mjs.map +1 -1
- package/dist/esm/editor/BlockDragHandle.native.js +41 -7
- package/dist/esm/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/esm/editor/SlashCommands.mjs +258 -295
- package/dist/esm/editor/SlashCommands.mjs.map +1 -1
- package/dist/esm/editor/SlashCommands.native.js +321 -342
- package/dist/esm/editor/SlashCommands.native.js.map +1 -1
- package/dist/esm/editor/TentapEditor.native.js +60 -13
- package/dist/esm/editor/TentapEditor.native.js.map +1 -1
- package/dist/esm/editor/TiptapEditor.mjs +145 -231
- package/dist/esm/editor/TiptapEditor.mjs.map +1 -1
- package/dist/esm/editor/TiptapEditor.native.js +165 -280
- package/dist/esm/editor/TiptapEditor.native.js.map +1 -1
- package/dist/esm/editor/blockAnchor.mjs +18 -0
- package/dist/esm/editor/blockAnchor.mjs.map +1 -0
- package/dist/esm/editor/blockAnchor.native.js +40 -0
- package/dist/esm/editor/blockAnchor.native.js.map +1 -0
- package/dist/esm/editor/capabilities.mjs +10 -0
- package/dist/esm/editor/capabilities.mjs.map +1 -0
- package/dist/esm/editor/capabilities.native.js +11 -0
- package/dist/esm/editor/capabilities.native.js.map +1 -0
- package/dist/esm/editor/codeBlockPreview.mjs +190 -0
- package/dist/esm/editor/codeBlockPreview.mjs.map +1 -0
- package/dist/esm/editor/codeBlockPreview.native.js +222 -0
- package/dist/esm/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/esm/editor/editorStyles.mjs +203 -34
- package/dist/esm/editor/editorStyles.mjs.map +1 -1
- package/dist/esm/editor/editorStyles.native.js +203 -34
- package/dist/esm/editor/editorStyles.native.js.map +1 -1
- package/dist/esm/editor/emoji.mjs +88 -0
- package/dist/esm/editor/emoji.mjs.map +1 -0
- package/dist/esm/editor/emoji.native.js +141 -0
- package/dist/esm/editor/emoji.native.js.map +1 -0
- package/dist/esm/editor/extensions.mjs +236 -0
- package/dist/esm/editor/extensions.mjs.map +1 -0
- package/dist/esm/editor/extensions.native.js +286 -0
- package/dist/esm/editor/extensions.native.js.map +1 -0
- package/dist/esm/editor/lazyKatex.mjs +40 -0
- package/dist/esm/editor/lazyKatex.mjs.map +1 -0
- package/dist/esm/editor/lazyKatex.native.js +76 -0
- package/dist/esm/editor/lazyKatex.native.js.map +1 -0
- package/dist/esm/editor/markdown.mjs +179 -0
- package/dist/esm/editor/markdown.mjs.map +1 -0
- package/dist/esm/editor/markdown.native.js +238 -0
- package/dist/esm/editor/markdown.native.js.map +1 -0
- package/dist/esm/editor/mathematics.mjs +142 -0
- package/dist/esm/editor/mathematics.mjs.map +1 -0
- package/dist/esm/editor/mathematics.native.js +173 -0
- package/dist/esm/editor/mathematics.native.js.map +1 -0
- package/dist/esm/editor/media.mjs +113 -0
- package/dist/esm/editor/media.mjs.map +1 -0
- package/dist/esm/editor/media.native.js +144 -0
- package/dist/esm/editor/media.native.js.map +1 -0
- package/dist/esm/editor/mentions.mjs +37 -0
- package/dist/esm/editor/mentions.mjs.map +1 -0
- package/dist/esm/editor/mentions.native.js +45 -0
- package/dist/esm/editor/mentions.native.js.map +1 -0
- package/dist/esm/editor/pasteCleanup.mjs +57 -0
- package/dist/esm/editor/pasteCleanup.mjs.map +1 -0
- package/dist/esm/editor/pasteCleanup.native.js +146 -0
- package/dist/esm/editor/pasteCleanup.native.js.map +1 -0
- package/dist/esm/editor/suggestionPopup.mjs +268 -0
- package/dist/esm/editor/suggestionPopup.mjs.map +1 -0
- package/dist/esm/editor/suggestionPopup.native.js +295 -0
- package/dist/esm/editor/suggestionPopup.native.js.map +1 -0
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/preview.mjs +236 -0
- package/dist/esm/preview.mjs.map +1 -0
- package/dist/esm/preview.native.js +264 -0
- package/dist/esm/preview.native.js.map +1 -0
- package/dist/esm/shared/t.mjs +17 -0
- package/dist/esm/shared/t.mjs.map +1 -0
- package/dist/esm/shared/t.native.js +17 -0
- package/dist/esm/shared/t.native.js.map +1 -0
- package/dist/esm/shared/url.mjs +10 -0
- package/dist/esm/shared/url.mjs.map +1 -0
- package/dist/esm/shared/url.native.js +10 -0
- package/dist/esm/shared/url.native.js.map +1 -0
- package/dist/esm/styled.mjs +13 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +13 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.mjs +20 -15
- package/dist/esm/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.native.js +23 -16
- package/dist/esm/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/esm/toolbar/CodeBlockBubble.mjs +60 -24
- package/dist/esm/toolbar/CodeBlockBubble.mjs.map +1 -1
- package/dist/esm/toolbar/CodeBlockBubble.native.js +72 -26
- package/dist/esm/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ColorPicker.mjs +21 -56
- package/dist/esm/toolbar/ColorPicker.mjs.map +1 -1
- package/dist/esm/toolbar/ColorPicker.native.js +82 -180
- package/dist/esm/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/esm/toolbar/FixedToolbar.mjs +40 -14
- package/dist/esm/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/FixedToolbar.native.js +47 -55
- package/dist/esm/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/esm/toolbar/HeadingPicker.mjs +34 -41
- package/dist/esm/toolbar/HeadingPicker.mjs.map +1 -1
- package/dist/esm/toolbar/HeadingPicker.native.js +63 -53
- package/dist/esm/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/esm/toolbar/ImageBubble.mjs +20 -43
- package/dist/esm/toolbar/ImageBubble.mjs.map +1 -1
- package/dist/esm/toolbar/ImageBubble.native.js +20 -43
- package/dist/esm/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ImageDialog.mjs +5 -4
- package/dist/esm/toolbar/ImageDialog.mjs.map +1 -1
- package/dist/esm/toolbar/ImageDialog.native.js +75 -64
- package/dist/esm/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/esm/toolbar/LinkBubble.mjs +23 -70
- package/dist/esm/toolbar/LinkBubble.mjs.map +1 -1
- package/dist/esm/toolbar/LinkBubble.native.js +23 -70
- package/dist/esm/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/esm/toolbar/LinkDialog.mjs +17 -16
- package/dist/esm/toolbar/LinkDialog.mjs.map +1 -1
- package/dist/esm/toolbar/LinkDialog.native.js +84 -80
- package/dist/esm/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/esm/toolbar/ListPicker.mjs +33 -44
- package/dist/esm/toolbar/ListPicker.mjs.map +1 -1
- package/dist/esm/toolbar/ListPicker.native.js +44 -45
- package/dist/esm/toolbar/ListPicker.native.js.map +1 -1
- package/dist/esm/toolbar/MathBubble.mjs +134 -0
- package/dist/esm/toolbar/MathBubble.mjs.map +1 -0
- package/dist/esm/toolbar/MathBubble.native.js +141 -0
- package/dist/esm/toolbar/MathBubble.native.js.map +1 -0
- package/dist/esm/toolbar/MoreDropdown.mjs +53 -92
- package/dist/esm/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/esm/toolbar/MoreDropdown.native.js +79 -92
- package/dist/esm/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/esm/toolbar/StatusBar.mjs +19 -10
- package/dist/esm/toolbar/StatusBar.mjs.map +1 -1
- package/dist/esm/toolbar/StatusBar.native.js +19 -10
- package/dist/esm/toolbar/StatusBar.native.js.map +1 -1
- package/dist/esm/toolbar/TableBubble.mjs +91 -96
- package/dist/esm/toolbar/TableBubble.mjs.map +1 -1
- package/dist/esm/toolbar/TableBubble.native.js +90 -73
- package/dist/esm/toolbar/TableBubble.native.js.map +1 -1
- package/dist/esm/toolbar/ToolbarButton.mjs +87 -22
- package/dist/esm/toolbar/ToolbarButton.mjs.map +1 -1
- package/dist/esm/toolbar/ToolbarButton.native.js +14 -4
- package/dist/esm/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/esm/toolbar/icons.mjs +109 -469
- package/dist/esm/toolbar/icons.mjs.map +1 -1
- package/dist/esm/toolbar/shortcuts.mjs +73 -24
- package/dist/esm/toolbar/shortcuts.mjs.map +1 -1
- package/dist/esm/toolbar/shortcuts.native.js +73 -24
- package/dist/esm/toolbar/shortcuts.native.js.map +1 -1
- package/dist/esm/toolbar/useHorizontalScroll.mjs +25 -6
- package/dist/esm/toolbar/useHorizontalScroll.mjs.map +1 -1
- package/dist/esm/toolbar/useHorizontalScroll.native.js +25 -6
- package/dist/esm/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/esm/toolbar/useRovingFocus.mjs +55 -0
- package/dist/esm/toolbar/useRovingFocus.mjs.map +1 -0
- package/dist/esm/toolbar/useRovingFocus.native.js +85 -0
- package/dist/esm/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/jsx/RichEditor.mjs +90 -10
- package/dist/jsx/RichEditor.mjs.map +1 -1
- package/dist/jsx/RichEditor.native.js +444 -35
- package/dist/jsx/RichEditor.native.js.map +1 -1
- package/dist/jsx/RichTextEditor/index.mjs +20 -2
- package/dist/jsx/RichTextEditor/index.mjs.map +1 -1
- package/dist/jsx/RichTextEditor/index.native.js +20 -2
- package/dist/jsx/RichTextEditor/index.native.js.map +1 -1
- package/dist/jsx/constants.mjs +47 -29
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.js +59 -29
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/editor/BlockDragHandle.mjs +22 -7
- package/dist/jsx/editor/BlockDragHandle.mjs.map +1 -1
- package/dist/jsx/editor/BlockDragHandle.native.js +41 -7
- package/dist/jsx/editor/BlockDragHandle.native.js.map +1 -1
- package/dist/jsx/editor/SlashCommands.mjs +258 -295
- package/dist/jsx/editor/SlashCommands.mjs.map +1 -1
- package/dist/jsx/editor/SlashCommands.native.js +320 -341
- package/dist/jsx/editor/SlashCommands.native.js.map +1 -1
- package/dist/jsx/editor/TentapEditor.native.js +59 -12
- package/dist/jsx/editor/TentapEditor.native.js.map +1 -1
- package/dist/jsx/editor/TiptapEditor.mjs +145 -231
- package/dist/jsx/editor/TiptapEditor.mjs.map +1 -1
- package/dist/jsx/editor/TiptapEditor.native.js +163 -289
- package/dist/jsx/editor/TiptapEditor.native.js.map +1 -1
- package/dist/jsx/editor/blockAnchor.mjs +18 -0
- package/dist/jsx/editor/blockAnchor.mjs.map +1 -0
- package/dist/jsx/editor/blockAnchor.native.js +68 -0
- package/dist/jsx/editor/blockAnchor.native.js.map +1 -0
- package/dist/jsx/editor/capabilities.mjs +10 -0
- package/dist/jsx/editor/capabilities.mjs.map +1 -0
- package/dist/jsx/editor/capabilities.native.js +41 -0
- package/dist/jsx/editor/capabilities.native.js.map +1 -0
- package/dist/jsx/editor/codeBlockPreview.mjs +190 -0
- package/dist/jsx/editor/codeBlockPreview.mjs.map +1 -0
- package/dist/jsx/editor/codeBlockPreview.native.js +265 -0
- package/dist/jsx/editor/codeBlockPreview.native.js.map +1 -0
- package/dist/jsx/editor/editorStyles.mjs +203 -34
- package/dist/jsx/editor/editorStyles.mjs.map +1 -1
- package/dist/jsx/editor/editorStyles.native.js +203 -34
- package/dist/jsx/editor/editorStyles.native.js.map +1 -1
- package/dist/jsx/editor/emoji.mjs +88 -0
- package/dist/jsx/editor/emoji.mjs.map +1 -0
- package/dist/jsx/editor/emoji.native.js +184 -0
- package/dist/jsx/editor/emoji.native.js.map +1 -0
- package/dist/jsx/editor/extensions.mjs +236 -0
- package/dist/jsx/editor/extensions.mjs.map +1 -0
- package/dist/jsx/editor/extensions.native.js +328 -0
- package/dist/jsx/editor/extensions.native.js.map +1 -0
- package/dist/jsx/editor/lazyKatex.mjs +40 -0
- package/dist/jsx/editor/lazyKatex.mjs.map +1 -0
- package/dist/jsx/editor/lazyKatex.native.js +117 -0
- package/dist/jsx/editor/lazyKatex.native.js.map +1 -0
- package/dist/jsx/editor/markdown.mjs +179 -0
- package/dist/jsx/editor/markdown.mjs.map +1 -0
- package/dist/jsx/editor/markdown.native.js +278 -0
- package/dist/jsx/editor/markdown.native.js.map +1 -0
- package/dist/jsx/editor/mathematics.mjs +142 -0
- package/dist/jsx/editor/mathematics.mjs.map +1 -0
- package/dist/jsx/editor/mathematics.native.js +202 -0
- package/dist/jsx/editor/mathematics.native.js.map +1 -0
- package/dist/jsx/editor/media.mjs +113 -0
- package/dist/jsx/editor/media.mjs.map +1 -0
- package/dist/jsx/editor/media.native.js +172 -0
- package/dist/jsx/editor/media.native.js.map +1 -0
- package/dist/jsx/editor/mentions.mjs +37 -0
- package/dist/jsx/editor/mentions.mjs.map +1 -0
- package/dist/jsx/editor/mentions.native.js +84 -0
- package/dist/jsx/editor/mentions.native.js.map +1 -0
- package/dist/jsx/editor/pasteCleanup.mjs +57 -0
- package/dist/jsx/editor/pasteCleanup.mjs.map +1 -0
- package/dist/jsx/editor/pasteCleanup.native.js +175 -0
- package/dist/jsx/editor/pasteCleanup.native.js.map +1 -0
- package/dist/jsx/editor/suggestionPopup.mjs +268 -0
- package/dist/jsx/editor/suggestionPopup.mjs.map +1 -0
- package/dist/jsx/editor/suggestionPopup.native.js +327 -0
- package/dist/jsx/editor/suggestionPopup.native.js.map +1 -0
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +4 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/preview.mjs +236 -0
- package/dist/jsx/preview.mjs.map +1 -0
- package/dist/jsx/preview.native.js +294 -0
- package/dist/jsx/preview.native.js.map +1 -0
- package/dist/jsx/shared/t.mjs +17 -0
- package/dist/jsx/shared/t.mjs.map +1 -0
- package/dist/jsx/shared/t.native.js +56 -0
- package/dist/jsx/shared/t.native.js.map +1 -0
- package/dist/jsx/shared/url.mjs +10 -0
- package/dist/jsx/shared/url.mjs.map +1 -0
- package/dist/jsx/shared/url.native.js +38 -0
- package/dist/jsx/shared/url.native.js.map +1 -0
- package/dist/jsx/styled.mjs +13 -6
- package/dist/jsx/styled.mjs.map +1 -1
- package/dist/jsx/styled.native.js +13 -6
- package/dist/jsx/styled.native.js.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.mjs +20 -15
- package/dist/jsx/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.native.js +22 -15
- package/dist/jsx/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/jsx/toolbar/CodeBlockBubble.mjs +60 -24
- package/dist/jsx/toolbar/CodeBlockBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/CodeBlockBubble.native.js +71 -25
- package/dist/jsx/toolbar/CodeBlockBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ColorPicker.mjs +21 -56
- package/dist/jsx/toolbar/ColorPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/ColorPicker.native.js +81 -179
- package/dist/jsx/toolbar/ColorPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/FixedToolbar.mjs +40 -14
- package/dist/jsx/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/FixedToolbar.native.js +46 -54
- package/dist/jsx/toolbar/FixedToolbar.native.js.map +1 -1
- package/dist/jsx/toolbar/HeadingPicker.mjs +34 -41
- package/dist/jsx/toolbar/HeadingPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/HeadingPicker.native.js +61 -51
- package/dist/jsx/toolbar/HeadingPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/ImageBubble.mjs +20 -43
- package/dist/jsx/toolbar/ImageBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/ImageBubble.native.js +20 -43
- package/dist/jsx/toolbar/ImageBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ImageDialog.mjs +5 -4
- package/dist/jsx/toolbar/ImageDialog.mjs.map +1 -1
- package/dist/jsx/toolbar/ImageDialog.native.js +76 -65
- package/dist/jsx/toolbar/ImageDialog.native.js.map +1 -1
- package/dist/jsx/toolbar/LinkBubble.mjs +23 -70
- package/dist/jsx/toolbar/LinkBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/LinkBubble.native.js +23 -70
- package/dist/jsx/toolbar/LinkBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/LinkDialog.mjs +17 -16
- package/dist/jsx/toolbar/LinkDialog.mjs.map +1 -1
- package/dist/jsx/toolbar/LinkDialog.native.js +86 -83
- package/dist/jsx/toolbar/LinkDialog.native.js.map +1 -1
- package/dist/jsx/toolbar/ListPicker.mjs +33 -44
- package/dist/jsx/toolbar/ListPicker.mjs.map +1 -1
- package/dist/jsx/toolbar/ListPicker.native.js +43 -44
- package/dist/jsx/toolbar/ListPicker.native.js.map +1 -1
- package/dist/jsx/toolbar/MathBubble.mjs +134 -0
- package/dist/jsx/toolbar/MathBubble.mjs.map +1 -0
- package/dist/jsx/toolbar/MathBubble.native.js +169 -0
- package/dist/jsx/toolbar/MathBubble.native.js.map +1 -0
- package/dist/jsx/toolbar/MoreDropdown.mjs +53 -92
- package/dist/jsx/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/jsx/toolbar/MoreDropdown.native.js +80 -93
- package/dist/jsx/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/jsx/toolbar/StatusBar.mjs +19 -10
- package/dist/jsx/toolbar/StatusBar.mjs.map +1 -1
- package/dist/jsx/toolbar/StatusBar.native.js +19 -10
- package/dist/jsx/toolbar/StatusBar.native.js.map +1 -1
- package/dist/jsx/toolbar/TableBubble.mjs +91 -96
- package/dist/jsx/toolbar/TableBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/TableBubble.native.js +90 -73
- package/dist/jsx/toolbar/TableBubble.native.js.map +1 -1
- package/dist/jsx/toolbar/ToolbarButton.mjs +87 -22
- package/dist/jsx/toolbar/ToolbarButton.mjs.map +1 -1
- package/dist/jsx/toolbar/ToolbarButton.native.js +14 -4
- package/dist/jsx/toolbar/ToolbarButton.native.js.map +1 -1
- package/dist/jsx/toolbar/icons.mjs +109 -469
- package/dist/jsx/toolbar/icons.mjs.map +1 -1
- package/dist/jsx/toolbar/shortcuts.mjs +73 -24
- package/dist/jsx/toolbar/shortcuts.mjs.map +1 -1
- package/dist/jsx/toolbar/shortcuts.native.js +73 -24
- package/dist/jsx/toolbar/shortcuts.native.js.map +1 -1
- package/dist/jsx/toolbar/useHorizontalScroll.mjs +25 -6
- package/dist/jsx/toolbar/useHorizontalScroll.mjs.map +1 -1
- package/dist/jsx/toolbar/useHorizontalScroll.native.js +25 -5
- package/dist/jsx/toolbar/useHorizontalScroll.native.js.map +1 -1
- package/dist/jsx/toolbar/useRovingFocus.mjs +55 -0
- package/dist/jsx/toolbar/useRovingFocus.mjs.map +1 -0
- package/dist/jsx/toolbar/useRovingFocus.native.js +113 -0
- package/dist/jsx/toolbar/useRovingFocus.native.js.map +1 -0
- package/dist/jsx/types.mjs.map +1 -1
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +28 -13
- package/src/RichEditor.native.tsx +471 -49
- package/src/RichEditor.stories.tsx +190 -0
- package/src/RichEditor.tsx +126 -7
- package/src/RichTextEditor/index.tsx +54 -3
- package/src/RichTextEditor/richTextEditor.spec.tsx +11 -4
- package/src/constants.ts +86 -24
- package/src/editor/BlockDragHandle.ts +30 -5
- package/src/editor/SlashCommands.tsx +238 -293
- package/src/editor/TentapEditor.native.tsx +81 -17
- package/src/editor/TiptapEditor.tsx +202 -265
- package/src/editor/blockAnchor.spec.ts +70 -0
- package/src/editor/blockAnchor.ts +42 -0
- package/src/editor/capabilities.spec.ts +190 -0
- package/src/editor/capabilities.ts +76 -0
- package/src/editor/codeBlockPreview.spec.ts +144 -0
- package/src/editor/codeBlockPreview.ts +266 -0
- package/src/editor/css.d.ts +2 -0
- package/src/editor/details.spec.ts +48 -0
- package/src/editor/editorStyles.spec.ts +25 -0
- package/src/editor/editorStyles.ts +218 -34
- package/src/editor/emoji.spec.ts +88 -0
- package/src/editor/emoji.ts +147 -0
- package/src/editor/emojilib.d.ts +16 -0
- package/src/editor/extensions.ts +315 -0
- package/src/editor/lazyKatex.spec.ts +38 -0
- package/src/editor/lazyKatex.ts +68 -0
- package/src/editor/markdown.spec.ts +196 -0
- package/src/editor/markdown.ts +249 -0
- package/src/editor/mathematics.spec.ts +97 -0
- package/src/editor/mathematics.ts +179 -0
- package/src/editor/media.spec.ts +121 -0
- package/src/editor/media.ts +133 -0
- package/src/editor/mentions.spec.ts +41 -0
- package/src/editor/mentions.ts +55 -0
- package/src/editor/pasteCleanup.spec.ts +84 -0
- package/src/editor/pasteCleanup.ts +124 -0
- package/src/editor/suggestionPopup.spec.tsx +105 -0
- package/src/editor/suggestionPopup.tsx +414 -0
- package/src/editor/tiptapEditor.spec.tsx +15 -8
- package/src/exports.spec.ts +4 -2
- package/src/index.ts +10 -1
- package/src/integration.spec.tsx +38 -9
- package/src/preview.spec.ts +130 -0
- package/src/preview.ts +287 -0
- package/src/richEditor.spec.tsx +10 -3
- package/src/shared/t.ts +25 -0
- package/src/shared/url.ts +16 -0
- package/src/styled.ts +13 -6
- package/src/toolbar/BubbleToolbar.tsx +48 -33
- package/src/toolbar/CodeBlockBubble.tsx +66 -28
- package/src/toolbar/ColorPicker.native.tsx +126 -0
- package/src/toolbar/ColorPicker.tsx +23 -67
- package/src/toolbar/FixedToolbar.native.tsx +51 -51
- package/src/toolbar/FixedToolbar.tsx +73 -21
- package/src/toolbar/HeadingPicker.tsx +46 -38
- package/src/toolbar/ImageBubble.tsx +26 -44
- package/src/toolbar/ImageDialog.native.tsx +97 -0
- package/src/toolbar/ImageDialog.tsx +5 -4
- package/src/toolbar/LinkBubble.tsx +27 -64
- package/src/toolbar/LinkDialog.native.tsx +117 -0
- package/src/toolbar/LinkDialog.tsx +28 -24
- package/src/toolbar/ListPicker.tsx +47 -43
- package/src/toolbar/MathBubble.tsx +140 -0
- package/src/toolbar/MoreDropdown.tsx +79 -62
- package/src/toolbar/StatusBar.tsx +13 -8
- package/src/toolbar/TableBubble.tsx +136 -95
- package/src/toolbar/ToolbarButton.native.tsx +14 -4
- package/src/toolbar/ToolbarButton.tsx +98 -19
- package/src/toolbar/bubbleToolbar.spec.tsx +2 -1
- package/src/toolbar/fixedToolbar.spec.tsx +4 -2
- package/src/toolbar/icons.tsx +113 -323
- package/src/toolbar/shortcuts.ts +77 -24
- package/src/toolbar/toolbarPrimitives.spec.tsx +29 -1
- package/src/toolbar/toolbarSubComponents.spec.tsx +4 -2
- package/src/toolbar/useHorizontalScroll.spec.ts +67 -0
- package/src/toolbar/useHorizontalScroll.tsx +39 -12
- package/src/toolbar/useRovingFocus.spec.tsx +100 -0
- package/src/toolbar/useRovingFocus.ts +82 -0
- package/src/types.spec.ts +40 -1
- package/src/types.ts +56 -1
- package/types/RichEditor.d.ts +51 -0
- package/types/RichEditor.d.ts.map +1 -0
- package/types/RichEditor.native.d.ts +59 -0
- package/types/RichEditor.native.d.ts.map +1 -0
- package/types/RichTextEditor/index.d.ts +77 -0
- package/types/RichTextEditor/index.d.ts.map +1 -0
- package/types/constants.d.ts +49 -0
- package/types/constants.d.ts.map +1 -0
- package/types/context.d.ts +10 -0
- package/types/context.d.ts.map +1 -0
- package/types/editor/BlockDragHandle.d.ts +8 -0
- package/types/editor/BlockDragHandle.d.ts.map +1 -0
- package/types/editor/MarkdownPaste.d.ts +8 -0
- package/types/editor/MarkdownPaste.d.ts.map +1 -0
- package/types/editor/SlashCommands.d.ts +24 -0
- package/types/editor/SlashCommands.d.ts.map +1 -0
- package/types/editor/TentapEditor.native.d.ts +21 -0
- package/types/editor/TentapEditor.native.d.ts.map +1 -0
- package/types/editor/TiptapEditor.d.ts +24 -0
- package/types/editor/TiptapEditor.d.ts.map +1 -0
- package/types/editor/blockAnchor.d.ts +25 -0
- package/types/editor/blockAnchor.d.ts.map +1 -0
- package/types/editor/capabilities.d.ts +29 -0
- package/types/editor/capabilities.d.ts.map +1 -0
- package/types/editor/codeBlockPreview.d.ts +51 -0
- package/types/editor/codeBlockPreview.d.ts.map +1 -0
- package/types/editor/editorStyles.d.ts +25 -0
- package/types/editor/editorStyles.d.ts.map +1 -0
- package/types/editor/emoji.d.ts +45 -0
- package/types/editor/emoji.d.ts.map +1 -0
- package/types/editor/extensions.d.ts +41 -0
- package/types/editor/extensions.d.ts.map +1 -0
- package/types/editor/index.d.ts +11 -0
- package/types/editor/index.d.ts.map +1 -0
- package/types/editor/lazyKatex.d.ts +33 -0
- package/types/editor/lazyKatex.d.ts.map +1 -0
- package/types/editor/markdown.d.ts +24 -0
- package/types/editor/markdown.d.ts.map +1 -0
- package/types/editor/mathematics.d.ts +44 -0
- package/types/editor/mathematics.d.ts.map +1 -0
- package/types/editor/media.d.ts +32 -0
- package/types/editor/media.d.ts.map +1 -0
- package/types/editor/mentions.d.ts +15 -0
- package/types/editor/mentions.d.ts.map +1 -0
- package/types/editor/pasteCleanup.d.ts +24 -0
- package/types/editor/pasteCleanup.d.ts.map +1 -0
- package/types/editor/suggestionPopup.d.ts +113 -0
- package/types/editor/suggestionPopup.d.ts.map +1 -0
- package/types/editor/types.d.ts +80 -0
- package/types/editor/types.d.ts.map +1 -0
- package/types/editor/useEditorState.d.ts +19 -0
- package/types/editor/useEditorState.d.ts.map +1 -0
- package/types/index.d.ts +12 -0
- package/types/index.d.ts.map +1 -0
- package/types/preview.d.ts +44 -0
- package/types/preview.d.ts.map +1 -0
- package/types/shared/t.d.ts +10 -0
- package/types/shared/t.d.ts.map +1 -0
- package/types/shared/url.d.ts +9 -0
- package/types/shared/url.d.ts.map +1 -0
- package/types/styled.d.ts +40 -0
- package/types/styled.d.ts.map +1 -0
- package/types/toolbar/BubbleToolbar.d.ts +25 -0
- package/types/toolbar/BubbleToolbar.d.ts.map +1 -0
- package/types/toolbar/CodeBlockBubble.d.ts +10 -0
- package/types/toolbar/CodeBlockBubble.d.ts.map +1 -0
- package/types/toolbar/ColorPicker.d.ts +15 -0
- package/types/toolbar/ColorPicker.d.ts.map +1 -0
- package/types/toolbar/ColorPicker.native.d.ts +20 -0
- package/types/toolbar/ColorPicker.native.d.ts.map +1 -0
- package/types/toolbar/FixedToolbar.d.ts +34 -0
- package/types/toolbar/FixedToolbar.d.ts.map +1 -0
- package/types/toolbar/FixedToolbar.native.d.ts +30 -0
- package/types/toolbar/FixedToolbar.native.d.ts.map +1 -0
- package/types/toolbar/HeadingPicker.d.ts +14 -0
- package/types/toolbar/HeadingPicker.d.ts.map +1 -0
- package/types/toolbar/ImageBubble.d.ts +10 -0
- package/types/toolbar/ImageBubble.d.ts.map +1 -0
- package/types/toolbar/ImageDialog.d.ts +12 -0
- package/types/toolbar/ImageDialog.d.ts.map +1 -0
- package/types/toolbar/ImageDialog.native.d.ts +15 -0
- package/types/toolbar/ImageDialog.native.d.ts.map +1 -0
- package/types/toolbar/LinkBubble.d.ts +10 -0
- package/types/toolbar/LinkBubble.d.ts.map +1 -0
- package/types/toolbar/LinkDialog.d.ts +20 -0
- package/types/toolbar/LinkDialog.d.ts.map +1 -0
- package/types/toolbar/LinkDialog.native.d.ts +18 -0
- package/types/toolbar/LinkDialog.native.d.ts.map +1 -0
- package/types/toolbar/ListPicker.d.ts +14 -0
- package/types/toolbar/ListPicker.d.ts.map +1 -0
- package/types/toolbar/MathBubble.d.ts +11 -0
- package/types/toolbar/MathBubble.d.ts.map +1 -0
- package/types/toolbar/MoreDropdown.d.ts +15 -0
- package/types/toolbar/MoreDropdown.d.ts.map +1 -0
- package/types/toolbar/ResizeHandle.d.ts +11 -0
- package/types/toolbar/ResizeHandle.d.ts.map +1 -0
- package/types/toolbar/StatusBar.d.ts +11 -0
- package/types/toolbar/StatusBar.d.ts.map +1 -0
- package/types/toolbar/TableBubble.d.ts +13 -0
- package/types/toolbar/TableBubble.d.ts.map +1 -0
- package/types/toolbar/ToolbarButton.d.ts +35 -0
- package/types/toolbar/ToolbarButton.d.ts.map +1 -0
- package/types/toolbar/ToolbarButton.native.d.ts +30 -0
- package/types/toolbar/ToolbarButton.native.d.ts.map +1 -0
- package/types/toolbar/ToolbarGroup.d.ts +14 -0
- package/types/toolbar/ToolbarGroup.d.ts.map +1 -0
- package/types/toolbar/icons.d.ts +52 -0
- package/types/toolbar/icons.d.ts.map +1 -0
- package/types/toolbar/icons.native.d.ts +41 -0
- package/types/toolbar/icons.native.d.ts.map +1 -0
- package/types/toolbar/shortcuts.d.ts +34 -0
- package/types/toolbar/shortcuts.d.ts.map +1 -0
- package/types/toolbar/useHorizontalScroll.d.ts +43 -0
- package/types/toolbar/useHorizontalScroll.d.ts.map +1 -0
- package/types/toolbar/useRovingFocus.d.ts +10 -0
- package/types/toolbar/useRovingFocus.d.ts.map +1 -0
- package/types/types.d.ts +147 -0
- package/types/types.d.ts.map +1 -0
- package/dist/cjs/RichEditor.stories.cjs +0 -327
- package/dist/cjs/RichEditor.stories.native.js +0 -342
- package/dist/cjs/RichEditor.stories.native.js.map +0 -1
- package/dist/esm/RichEditor.stories.mjs +0 -291
- package/dist/esm/RichEditor.stories.mjs.map +0 -1
- package/dist/esm/RichEditor.stories.native.js +0 -303
- package/dist/esm/RichEditor.stories.native.js.map +0 -1
- package/dist/jsx/RichEditor.stories.mjs +0 -291
- package/dist/jsx/RichEditor.stories.mjs.map +0 -1
- package/dist/jsx/RichEditor.stories.native.js +0 -342
- package/dist/jsx/RichEditor.stories.native.js.map +0 -1
|
@@ -1,298 +1,310 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Extension } from "@tiptap/core";
|
|
3
|
-
import { ReactRenderer } from "@tiptap/react";
|
|
4
3
|
import Suggestion from "@tiptap/suggestion";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, {
|
|
33
|
-
title: "Heading 3",
|
|
34
|
-
description: "Small section heading",
|
|
35
|
-
icon: "H3",
|
|
36
|
-
command: function command3(param) {
|
|
37
|
-
var {
|
|
38
|
-
editor,
|
|
39
|
-
range
|
|
40
|
-
} = param;
|
|
41
|
-
return editor.chain().focus().deleteRange(range).setHeading({
|
|
42
|
-
level: 3
|
|
43
|
-
}).run();
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
title: "Bullet List",
|
|
47
|
-
description: "Unordered list with bullets",
|
|
48
|
-
icon: "\u2022",
|
|
49
|
-
command: function command4(param) {
|
|
50
|
-
var {
|
|
51
|
-
editor,
|
|
52
|
-
range
|
|
53
|
-
} = param;
|
|
54
|
-
return editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
title: "Numbered List",
|
|
58
|
-
description: "Ordered list with numbers",
|
|
59
|
-
icon: "1.",
|
|
60
|
-
command: function command5(param) {
|
|
61
|
-
var {
|
|
62
|
-
editor,
|
|
63
|
-
range
|
|
64
|
-
} = param;
|
|
65
|
-
return editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
title: "Task List",
|
|
69
|
-
description: "List with checkboxes",
|
|
70
|
-
icon: "\u2611",
|
|
71
|
-
command: function command6(param) {
|
|
72
|
-
var {
|
|
73
|
-
editor,
|
|
74
|
-
range
|
|
75
|
-
} = param;
|
|
76
|
-
return editor.chain().focus().deleteRange(range).toggleTaskList().run();
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
title: "Code Block",
|
|
80
|
-
description: "Fenced code with syntax highlighting",
|
|
81
|
-
icon: "<>",
|
|
82
|
-
command: function command7(param) {
|
|
83
|
-
var {
|
|
84
|
-
editor,
|
|
85
|
-
range
|
|
86
|
-
} = param;
|
|
87
|
-
return editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
title: "Blockquote",
|
|
91
|
-
description: "Quoted text block",
|
|
92
|
-
icon: "\u275D",
|
|
93
|
-
command: function command8(param) {
|
|
94
|
-
var {
|
|
95
|
-
editor,
|
|
96
|
-
range
|
|
97
|
-
} = param;
|
|
98
|
-
return editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
title: "Horizontal Rule",
|
|
102
|
-
description: "Visual divider line",
|
|
103
|
-
icon: "\u2014",
|
|
104
|
-
command: function command9(param) {
|
|
105
|
-
var {
|
|
106
|
-
editor,
|
|
107
|
-
range
|
|
108
|
-
} = param;
|
|
109
|
-
return editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
4
|
+
import { CaretCircleDownIcon, CodeIcon, FunctionIcon, ImageIcon, ListBulletsIcon, ListChecksIcon, ListNumbersIcon, MathOperationsIcon, MinusIcon, QuotesIcon, SmileyIcon, TableIcon, TextHOneIcon, TextHThreeIcon, TextHTwoIcon, TextTIcon, TreeStructureIcon } from "@phosphor-icons/react";
|
|
5
|
+
import { t } from "../shared/t.native.js";
|
|
6
|
+
import { createSuggestionRenderer, getSuggestionChrome } from "./suggestionPopup.native.js";
|
|
7
|
+
function insertImageFromSlash(editor, range) {
|
|
8
|
+
var _ref;
|
|
9
|
+
var _editor_storage_mediaUpload;
|
|
10
|
+
var handlers = (_ref = (_editor_storage_mediaUpload = editor.storage.mediaUpload) === null || _editor_storage_mediaUpload === void 0 ? void 0 : _editor_storage_mediaUpload.handlers) !== null && _ref !== void 0 ? _ref : {};
|
|
11
|
+
if (handlers.onImageUpload && typeof document !== "undefined") {
|
|
12
|
+
var input = document.createElement("input");
|
|
13
|
+
input.type = "file";
|
|
14
|
+
input.accept = "image/*";
|
|
15
|
+
input.onchange = async function () {
|
|
16
|
+
var _input_files;
|
|
17
|
+
var file = (_input_files = input.files) === null || _input_files === void 0 ? void 0 : _input_files[0];
|
|
18
|
+
if (!file) return;
|
|
19
|
+
try {
|
|
20
|
+
var src = await handlers.onImageUpload(file);
|
|
21
|
+
editor.chain().focus().deleteRange(range).setImage({
|
|
22
|
+
src,
|
|
23
|
+
alt: file.name.replace(/\.[a-z0-9]+$/i, "")
|
|
24
|
+
}).run();
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.warn("[rich-text] image upload failed:", err);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
input.click();
|
|
30
|
+
return;
|
|
110
31
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
command: function command10(param) {
|
|
116
|
-
var {
|
|
117
|
-
editor,
|
|
118
|
-
range
|
|
119
|
-
} = param;
|
|
120
|
-
return editor.chain().focus().deleteRange(range).insertTable({
|
|
121
|
-
rows: 3,
|
|
122
|
-
cols: 3,
|
|
123
|
-
withHeaderRow: true
|
|
32
|
+
var url = window.prompt(t("Image URL:"));
|
|
33
|
+
if (url) {
|
|
34
|
+
editor.chain().focus().deleteRange(range).setImage({
|
|
35
|
+
src: url
|
|
124
36
|
}).run();
|
|
125
37
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
38
|
+
}
|
|
39
|
+
var ICON_SIZE = 16;
|
|
40
|
+
function getSlashItems() {
|
|
41
|
+
return [{
|
|
42
|
+
id: "text",
|
|
43
|
+
title: t("Text"),
|
|
44
|
+
description: t("Plain paragraph text"),
|
|
45
|
+
icon: /* @__PURE__ */_jsx(TextTIcon, {
|
|
46
|
+
size: ICON_SIZE
|
|
47
|
+
}),
|
|
48
|
+
command: function command(param) {
|
|
49
|
+
var {
|
|
50
|
+
editor,
|
|
51
|
+
range
|
|
52
|
+
} = param;
|
|
53
|
+
return editor.chain().focus().deleteRange(range).setParagraph().run();
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
id: "heading1",
|
|
57
|
+
title: t("Heading 1"),
|
|
58
|
+
description: t("Large section heading"),
|
|
59
|
+
icon: /* @__PURE__ */_jsx(TextHOneIcon, {
|
|
60
|
+
size: ICON_SIZE
|
|
61
|
+
}),
|
|
62
|
+
command: function command(param) {
|
|
63
|
+
var {
|
|
64
|
+
editor,
|
|
65
|
+
range
|
|
66
|
+
} = param;
|
|
67
|
+
return editor.chain().focus().deleteRange(range).setHeading({
|
|
68
|
+
level: 1
|
|
139
69
|
}).run();
|
|
140
70
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
71
|
+
}, {
|
|
72
|
+
id: "heading2",
|
|
73
|
+
title: t("Heading 2"),
|
|
74
|
+
description: t("Medium section heading"),
|
|
75
|
+
icon: /* @__PURE__ */_jsx(TextHTwoIcon, {
|
|
76
|
+
size: ICON_SIZE
|
|
77
|
+
}),
|
|
78
|
+
command: function command(param) {
|
|
79
|
+
var {
|
|
80
|
+
editor,
|
|
81
|
+
range
|
|
82
|
+
} = param;
|
|
83
|
+
return editor.chain().focus().deleteRange(range).setHeading({
|
|
84
|
+
level: 2
|
|
85
|
+
}).run();
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
id: "heading3",
|
|
89
|
+
title: t("Heading 3"),
|
|
90
|
+
description: t("Small section heading"),
|
|
91
|
+
icon: /* @__PURE__ */_jsx(TextHThreeIcon, {
|
|
92
|
+
size: ICON_SIZE
|
|
93
|
+
}),
|
|
94
|
+
command: function command(param) {
|
|
95
|
+
var {
|
|
96
|
+
editor,
|
|
97
|
+
range
|
|
98
|
+
} = param;
|
|
99
|
+
return editor.chain().focus().deleteRange(range).setHeading({
|
|
100
|
+
level: 3
|
|
101
|
+
}).run();
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
id: "bulletList",
|
|
105
|
+
title: t("Bullet List"),
|
|
106
|
+
description: t("Unordered list with bullets"),
|
|
107
|
+
icon: /* @__PURE__ */_jsx(ListBulletsIcon, {
|
|
108
|
+
size: ICON_SIZE
|
|
109
|
+
}),
|
|
110
|
+
command: function command(param) {
|
|
111
|
+
var {
|
|
112
|
+
editor,
|
|
113
|
+
range
|
|
114
|
+
} = param;
|
|
115
|
+
return editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
id: "orderedList",
|
|
119
|
+
title: t("Numbered List"),
|
|
120
|
+
description: t("Ordered list with numbers"),
|
|
121
|
+
icon: /* @__PURE__ */_jsx(ListNumbersIcon, {
|
|
122
|
+
size: ICON_SIZE
|
|
123
|
+
}),
|
|
124
|
+
command: function command(param) {
|
|
125
|
+
var {
|
|
126
|
+
editor,
|
|
127
|
+
range
|
|
128
|
+
} = param;
|
|
129
|
+
return editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
id: "taskList",
|
|
133
|
+
title: t("Task List"),
|
|
134
|
+
description: t("List with checkboxes"),
|
|
135
|
+
icon: /* @__PURE__ */_jsx(ListChecksIcon, {
|
|
136
|
+
size: ICON_SIZE
|
|
137
|
+
}),
|
|
138
|
+
command: function command(param) {
|
|
139
|
+
var {
|
|
140
|
+
editor,
|
|
141
|
+
range
|
|
142
|
+
} = param;
|
|
143
|
+
return editor.chain().focus().deleteRange(range).toggleTaskList().run();
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
id: "codeBlock",
|
|
147
|
+
title: t("Code Block"),
|
|
148
|
+
description: t("Fenced code with syntax highlighting"),
|
|
149
|
+
icon: /* @__PURE__ */_jsx(CodeIcon, {
|
|
150
|
+
size: ICON_SIZE
|
|
151
|
+
}),
|
|
152
|
+
command: function command(param) {
|
|
153
|
+
var {
|
|
154
|
+
editor,
|
|
155
|
+
range
|
|
156
|
+
} = param;
|
|
157
|
+
return editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
id: "blockquote",
|
|
161
|
+
title: t("Blockquote"),
|
|
162
|
+
description: t("Quoted text block"),
|
|
163
|
+
icon: /* @__PURE__ */_jsx(QuotesIcon, {
|
|
164
|
+
size: ICON_SIZE
|
|
165
|
+
}),
|
|
166
|
+
command: function command(param) {
|
|
167
|
+
var {
|
|
168
|
+
editor,
|
|
169
|
+
range
|
|
170
|
+
} = param;
|
|
171
|
+
return editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
id: "horizontalRule",
|
|
175
|
+
title: t("Horizontal Rule"),
|
|
176
|
+
description: t("Visual divider line"),
|
|
177
|
+
icon: /* @__PURE__ */_jsx(MinusIcon, {
|
|
178
|
+
size: ICON_SIZE
|
|
179
|
+
}),
|
|
180
|
+
command: function command(param) {
|
|
181
|
+
var {
|
|
182
|
+
editor,
|
|
183
|
+
range
|
|
184
|
+
} = param;
|
|
185
|
+
return editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
id: "table",
|
|
189
|
+
title: t("Table"),
|
|
190
|
+
description: t("Insert a 3\xD73 table"),
|
|
191
|
+
icon: /* @__PURE__ */_jsx(TableIcon, {
|
|
192
|
+
size: ICON_SIZE
|
|
193
|
+
}),
|
|
194
|
+
command: function command(param) {
|
|
195
|
+
var {
|
|
196
|
+
editor,
|
|
197
|
+
range
|
|
198
|
+
} = param;
|
|
199
|
+
return editor.chain().focus().deleteRange(range).insertTable({
|
|
200
|
+
rows: 3,
|
|
201
|
+
cols: 3,
|
|
202
|
+
withHeaderRow: true
|
|
203
|
+
}).run();
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
id: "image",
|
|
207
|
+
title: t("Image"),
|
|
208
|
+
description: t("Upload or embed an image"),
|
|
209
|
+
icon: /* @__PURE__ */_jsx(ImageIcon, {
|
|
210
|
+
size: ICON_SIZE
|
|
211
|
+
}),
|
|
212
|
+
command: function command(param) {
|
|
213
|
+
var {
|
|
214
|
+
editor,
|
|
215
|
+
range
|
|
216
|
+
} = param;
|
|
217
|
+
return insertImageFromSlash(editor, range);
|
|
218
|
+
}
|
|
219
|
+
}, {
|
|
220
|
+
id: "mermaid",
|
|
221
|
+
title: t("Mermaid Diagram"),
|
|
222
|
+
description: t("Diagram code with live preview"),
|
|
223
|
+
icon: /* @__PURE__ */_jsx(TreeStructureIcon, {
|
|
224
|
+
size: ICON_SIZE
|
|
225
|
+
}),
|
|
226
|
+
command: function command(param) {
|
|
227
|
+
var {
|
|
228
|
+
editor,
|
|
229
|
+
range
|
|
230
|
+
} = param;
|
|
231
|
+
return editor.chain().focus().deleteRange(range).setCodeBlock({
|
|
232
|
+
language: "mermaid"
|
|
233
|
+
}).run();
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
id: "mathBlock",
|
|
237
|
+
title: t("Math Block"),
|
|
238
|
+
description: t("Display TeX math with live preview"),
|
|
239
|
+
icon: /* @__PURE__ */_jsx(MathOperationsIcon, {
|
|
240
|
+
size: ICON_SIZE
|
|
241
|
+
}),
|
|
242
|
+
command: function command(param) {
|
|
243
|
+
var {
|
|
244
|
+
editor,
|
|
245
|
+
range
|
|
246
|
+
} = param;
|
|
247
|
+
return editor.chain().focus().deleteRange(range).setCodeBlock({
|
|
248
|
+
language: "math"
|
|
249
|
+
}).run();
|
|
250
|
+
}
|
|
251
|
+
}, {
|
|
252
|
+
id: "inlineMath",
|
|
253
|
+
title: t("Inline Math"),
|
|
254
|
+
description: t("TeX formula in the text flow"),
|
|
255
|
+
icon: /* @__PURE__ */_jsx(FunctionIcon, {
|
|
256
|
+
size: ICON_SIZE
|
|
257
|
+
}),
|
|
258
|
+
command: function command(param) {
|
|
259
|
+
var {
|
|
260
|
+
editor,
|
|
261
|
+
range
|
|
262
|
+
} = param;
|
|
263
|
+
return editor.chain().focus().deleteRange(range).insertInlineMath().run();
|
|
264
|
+
}
|
|
265
|
+
}, {
|
|
266
|
+
id: "details",
|
|
267
|
+
title: t("Collapsible Section"),
|
|
268
|
+
description: t("Expandable details with a summary"),
|
|
269
|
+
icon: /* @__PURE__ */_jsx(CaretCircleDownIcon, {
|
|
270
|
+
size: ICON_SIZE
|
|
271
|
+
}),
|
|
272
|
+
// open: true so the freshly inserted section is expanded for typing
|
|
273
|
+
command: function command(param) {
|
|
274
|
+
var {
|
|
275
|
+
editor,
|
|
276
|
+
range
|
|
277
|
+
} = param;
|
|
278
|
+
return editor.chain().focus().deleteRange(range).setDetails().updateAttributes("details", {
|
|
279
|
+
open: true
|
|
280
|
+
}).run();
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
id: "emoji",
|
|
284
|
+
title: t("Emoji"),
|
|
285
|
+
description: t("Search emoji by name"),
|
|
286
|
+
icon: /* @__PURE__ */_jsx(SmileyIcon, {
|
|
287
|
+
size: ICON_SIZE
|
|
288
|
+
}),
|
|
289
|
+
// inserting ":" hands off to the emoji suggestion popup
|
|
290
|
+
command: function command(param) {
|
|
291
|
+
var {
|
|
292
|
+
editor,
|
|
293
|
+
range
|
|
294
|
+
} = param;
|
|
295
|
+
return editor.chain().focus().deleteRange(range).insertContent(":").run();
|
|
296
|
+
}
|
|
297
|
+
}];
|
|
298
|
+
}
|
|
292
299
|
var SlashCommands = Extension.create({
|
|
293
300
|
name: "slashCommands",
|
|
294
301
|
addOptions() {
|
|
295
302
|
return {
|
|
303
|
+
/**
|
|
304
|
+
* Item ids removed from the menu (capability gating — e.g. markdown
|
|
305
|
+
* capabilities exclude math/details, which GFM cannot express).
|
|
306
|
+
*/
|
|
307
|
+
excludeIds: [],
|
|
296
308
|
suggestion: {
|
|
297
309
|
char: "/",
|
|
298
310
|
startOfLine: false,
|
|
@@ -301,66 +313,25 @@ var SlashCommands = Extension.create({
|
|
|
301
313
|
query
|
|
302
314
|
} = param;
|
|
303
315
|
var q = query.toLowerCase();
|
|
304
|
-
return
|
|
316
|
+
return getSlashItems().filter(function (item) {
|
|
305
317
|
return item.title.toLowerCase().includes(q) || item.description.toLowerCase().includes(q);
|
|
306
318
|
});
|
|
307
319
|
},
|
|
308
|
-
render:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
clientRect
|
|
324
|
-
} = props;
|
|
325
|
-
if (clientRect) {
|
|
326
|
-
var rect = clientRect();
|
|
327
|
-
if (rect) {
|
|
328
|
-
popup.style.left = `${rect.left}px`;
|
|
329
|
-
popup.style.top = `${rect.bottom + 4}px`;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
onUpdate: function onUpdate(props) {
|
|
334
|
-
component === null || component === void 0 ? void 0 : component.updateProps(props);
|
|
335
|
-
if (popup && props.clientRect) {
|
|
336
|
-
var rect = props.clientRect();
|
|
337
|
-
if (rect) {
|
|
338
|
-
popup.style.left = `${rect.left}px`;
|
|
339
|
-
popup.style.top = `${rect.bottom + 4}px`;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
onKeyDown: function onKeyDown(props) {
|
|
344
|
-
var _ref;
|
|
345
|
-
var _component_ref;
|
|
346
|
-
if (props.event.key === "Escape") {
|
|
347
|
-
popup === null || popup === void 0 ? void 0 : popup.remove();
|
|
348
|
-
component === null || component === void 0 ? void 0 : component.destroy();
|
|
349
|
-
popup = null;
|
|
350
|
-
component = null;
|
|
351
|
-
return true;
|
|
352
|
-
}
|
|
353
|
-
return (_ref = component === null || component === void 0 ? void 0 : (_component_ref = component.ref) === null || _component_ref === void 0 ? void 0 : _component_ref.onKeyDown(props)) !== null && _ref !== void 0 ? _ref : false;
|
|
354
|
-
},
|
|
355
|
-
onExit: function onExit() {
|
|
356
|
-
popup === null || popup === void 0 ? void 0 : popup.remove();
|
|
357
|
-
component === null || component === void 0 ? void 0 : component.destroy();
|
|
358
|
-
popup = null;
|
|
359
|
-
component = null;
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
},
|
|
363
|
-
command: function command12(param) {
|
|
320
|
+
render: createSuggestionRenderer({
|
|
321
|
+
toRow: function toRow(item) {
|
|
322
|
+
return {
|
|
323
|
+
key: item.id,
|
|
324
|
+
title: item.title,
|
|
325
|
+
description: item.description,
|
|
326
|
+
icon: item.icon
|
|
327
|
+
};
|
|
328
|
+
},
|
|
329
|
+
getChrome: getSuggestionChrome,
|
|
330
|
+
getEmptyLabel: function getEmptyLabel() {
|
|
331
|
+
return t("No results");
|
|
332
|
+
}
|
|
333
|
+
}),
|
|
334
|
+
command: function command(param) {
|
|
364
335
|
var {
|
|
365
336
|
editor,
|
|
366
337
|
range,
|
|
@@ -375,9 +346,17 @@ var SlashCommands = Extension.create({
|
|
|
375
346
|
};
|
|
376
347
|
},
|
|
377
348
|
addProseMirrorPlugins() {
|
|
349
|
+
var _this = this;
|
|
350
|
+
var _this_options_excludeIds;
|
|
351
|
+
var excludeIds = (_this_options_excludeIds = this.options.excludeIds) !== null && _this_options_excludeIds !== void 0 ? _this_options_excludeIds : [];
|
|
378
352
|
return [Suggestion({
|
|
379
353
|
editor: this.editor,
|
|
380
|
-
...this.options.suggestion
|
|
354
|
+
...this.options.suggestion,
|
|
355
|
+
items: function items(args) {
|
|
356
|
+
return _this.options.suggestion.items(args).filter(function (item) {
|
|
357
|
+
return !excludeIds.includes(item.id);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
381
360
|
})];
|
|
382
361
|
}
|
|
383
362
|
});
|