@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,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all) __defProp(target, name, {
|
|
@@ -21,15 +19,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
19
|
}
|
|
22
20
|
return to;
|
|
23
21
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
23
|
value: true
|
|
35
24
|
}), mod);
|
|
@@ -41,220 +30,29 @@ module.exports = __toCommonJS(TiptapEditor_exports);
|
|
|
41
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
31
|
var import_react = require("react");
|
|
43
32
|
var import_react2 = require("@tiptap/react");
|
|
44
|
-
var import_core = require("@tiptap/core");
|
|
45
|
-
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
46
|
-
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
47
|
-
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
48
|
-
var import_extension_color = require("@tiptap/extension-color");
|
|
49
|
-
var import_extension_text_style = require("@tiptap/extension-text-style");
|
|
50
|
-
var import_extension_highlight = require("@tiptap/extension-highlight");
|
|
51
|
-
var import_extension_subscript = require("@tiptap/extension-subscript");
|
|
52
|
-
var import_extension_superscript = require("@tiptap/extension-superscript");
|
|
53
|
-
var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"));
|
|
54
|
-
var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"));
|
|
55
|
-
var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
56
|
-
var import_extension_code_block_lowlight = __toESM(require("@tiptap/extension-code-block-lowlight"));
|
|
57
|
-
var import_extension_typography = __toESM(require("@tiptap/extension-typography"));
|
|
58
|
-
var import_extension_character_count = __toESM(require("@tiptap/extension-character-count"));
|
|
59
|
-
var import_extension_table = require("@tiptap/extension-table");
|
|
60
|
-
var import_extension_table_row = require("@tiptap/extension-table-row");
|
|
61
|
-
var import_extension_table_header = require("@tiptap/extension-table-header");
|
|
62
|
-
var import_extension_table_cell = require("@tiptap/extension-table-cell");
|
|
63
|
-
var import_lowlight = require("lowlight");
|
|
64
|
-
var import_turndown = __toESM(require("turndown"));
|
|
65
|
-
var import_marked = require("marked");
|
|
66
33
|
var import_tamagui = require("tamagui");
|
|
67
34
|
var import_constants = require("@tamagui/constants");
|
|
35
|
+
var import_theme = require("@multiplatform.one/theme");
|
|
36
|
+
var import_forms = require("@multiplatform.one/forms");
|
|
68
37
|
var import_types = require("../types.native.js");
|
|
69
38
|
var import_context = require("../context.native.js");
|
|
39
|
+
var import_t = require("../shared/t.native.js");
|
|
70
40
|
var import_editorStyles = require("./editorStyles.native.js");
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
41
|
+
var import_extensions = require("./extensions.native.js");
|
|
42
|
+
var import_capabilities = require("./capabilities.native.js");
|
|
43
|
+
var import_mentions = require("./mentions.native.js");
|
|
44
|
+
var import_codeBlockPreview = require("./codeBlockPreview.native.js");
|
|
45
|
+
var import_markdown = require("./markdown.native.js");
|
|
46
|
+
var import_pasteCleanup = require("./pasteCleanup.native.js");
|
|
47
|
+
var import_suggestionPopup = require("./suggestionPopup.native.js");
|
|
74
48
|
var import_useEditorState = require("./useEditorState.native.js");
|
|
75
49
|
var import_BubbleToolbar = require("../toolbar/BubbleToolbar.native.js");
|
|
76
50
|
var import_LinkBubble = require("../toolbar/LinkBubble.native.js");
|
|
77
51
|
var import_CodeBlockBubble = require("../toolbar/CodeBlockBubble.native.js");
|
|
78
52
|
var import_ImageBubble = require("../toolbar/ImageBubble.native.js");
|
|
79
53
|
var import_TableBubble = require("../toolbar/TableBubble.native.js");
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
headingStyle: "atx",
|
|
83
|
-
codeBlockStyle: "fenced"
|
|
84
|
-
});
|
|
85
|
-
var CodeBlockTabIndent = import_core.Extension.create({
|
|
86
|
-
name: "codeBlockTabIndent",
|
|
87
|
-
addKeyboardShortcuts() {
|
|
88
|
-
return {
|
|
89
|
-
Tab: function Tab(param) {
|
|
90
|
-
var {
|
|
91
|
-
editor
|
|
92
|
-
} = param;
|
|
93
|
-
if (!editor.isActive("codeBlock")) return false;
|
|
94
|
-
var {
|
|
95
|
-
state,
|
|
96
|
-
dispatch
|
|
97
|
-
} = editor.view;
|
|
98
|
-
var {
|
|
99
|
-
from,
|
|
100
|
-
to
|
|
101
|
-
} = state.selection;
|
|
102
|
-
if (from === to) {
|
|
103
|
-
dispatch(state.tr.insertText(" ", from, to));
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
var doc = state.doc;
|
|
107
|
-
var lines = [];
|
|
108
|
-
doc.nodesBetween(from, to, function (node, pos) {
|
|
109
|
-
if (node.isTextblock) {
|
|
110
|
-
lines.push({
|
|
111
|
-
start: pos + 1
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
if (lines.length === 0) {
|
|
116
|
-
dispatch(state.tr.insertText(" ", from, to));
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
var tr = state.tr;
|
|
120
|
-
var offset = 0;
|
|
121
|
-
var _iteratorNormalCompletion = true,
|
|
122
|
-
_didIteratorError = false,
|
|
123
|
-
_iteratorError = void 0;
|
|
124
|
-
try {
|
|
125
|
-
for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
126
|
-
var line = _step.value;
|
|
127
|
-
var lineStart = line.start + offset;
|
|
128
|
-
tr = tr.insertText(" ", lineStart);
|
|
129
|
-
offset += 2;
|
|
130
|
-
}
|
|
131
|
-
} catch (err) {
|
|
132
|
-
_didIteratorError = true;
|
|
133
|
-
_iteratorError = err;
|
|
134
|
-
} finally {
|
|
135
|
-
try {
|
|
136
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
137
|
-
_iterator.return();
|
|
138
|
-
}
|
|
139
|
-
} finally {
|
|
140
|
-
if (_didIteratorError) {
|
|
141
|
-
throw _iteratorError;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
dispatch(tr);
|
|
146
|
-
return true;
|
|
147
|
-
},
|
|
148
|
-
"Shift-Tab": function (param) {
|
|
149
|
-
var {
|
|
150
|
-
editor
|
|
151
|
-
} = param;
|
|
152
|
-
if (!editor.isActive("codeBlock")) return false;
|
|
153
|
-
var {
|
|
154
|
-
state,
|
|
155
|
-
dispatch
|
|
156
|
-
} = editor.view;
|
|
157
|
-
var {
|
|
158
|
-
from,
|
|
159
|
-
to,
|
|
160
|
-
$from
|
|
161
|
-
} = state.selection;
|
|
162
|
-
if (from === to) {
|
|
163
|
-
var _text_match;
|
|
164
|
-
var lineStart = from - $from.parentOffset;
|
|
165
|
-
var text = state.doc.textBetween(lineStart, from);
|
|
166
|
-
var leadingSpaces = (_text_match = text.match(/^ {1,2}/)) === null || _text_match === void 0 ? void 0 : _text_match[0];
|
|
167
|
-
if (leadingSpaces) {
|
|
168
|
-
dispatch(state.tr.delete(lineStart, lineStart + leadingSpaces.length));
|
|
169
|
-
}
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
var doc = state.doc;
|
|
173
|
-
var tr = state.tr;
|
|
174
|
-
var offset = 0;
|
|
175
|
-
doc.nodesBetween(from, to, function (node, pos) {
|
|
176
|
-
if (node.isTextblock) {
|
|
177
|
-
var _text_match2;
|
|
178
|
-
var lineStart2 = pos + 1 + offset;
|
|
179
|
-
var text2 = tr.doc.textBetween(lineStart2, Math.min(lineStart2 + node.content.size, tr.doc.content.size));
|
|
180
|
-
var leadingSpaces2 = (_text_match2 = text2.match(/^ {1,2}/)) === null || _text_match2 === void 0 ? void 0 : _text_match2[0];
|
|
181
|
-
if (leadingSpaces2) {
|
|
182
|
-
tr = tr.delete(lineStart2, lineStart2 + leadingSpaces2.length);
|
|
183
|
-
offset -= leadingSpaces2.length;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
dispatch(tr);
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
var ParagraphEnterKeys = import_core.Extension.create({
|
|
194
|
-
name: "paragraphEnterKeys",
|
|
195
|
-
priority: 1e3,
|
|
196
|
-
addKeyboardShortcuts() {
|
|
197
|
-
return {
|
|
198
|
-
"Shift-Enter": function (param) {
|
|
199
|
-
var {
|
|
200
|
-
editor
|
|
201
|
-
} = param;
|
|
202
|
-
return editor.commands.first([function () {
|
|
203
|
-
return editor.commands.newlineInCode();
|
|
204
|
-
}, function () {
|
|
205
|
-
return editor.commands.splitListItem("listItem");
|
|
206
|
-
}, function () {
|
|
207
|
-
return editor.commands.createParagraphNear();
|
|
208
|
-
}, function () {
|
|
209
|
-
return editor.commands.liftEmptyBlock();
|
|
210
|
-
}, function () {
|
|
211
|
-
return editor.commands.splitBlock();
|
|
212
|
-
}]);
|
|
213
|
-
},
|
|
214
|
-
"Mod-Enter": function (param) {
|
|
215
|
-
var {
|
|
216
|
-
editor
|
|
217
|
-
} = param;
|
|
218
|
-
return editor.commands.first([function () {
|
|
219
|
-
return editor.commands.newlineInCode();
|
|
220
|
-
}, function () {
|
|
221
|
-
return editor.commands.createParagraphNear();
|
|
222
|
-
}, function () {
|
|
223
|
-
return editor.commands.liftEmptyBlock();
|
|
224
|
-
}, function () {
|
|
225
|
-
return editor.commands.splitBlock();
|
|
226
|
-
}]);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
var ListItemKeys = import_core.Extension.create({
|
|
232
|
-
name: "listItemKeys",
|
|
233
|
-
addKeyboardShortcuts() {
|
|
234
|
-
return {
|
|
235
|
-
Tab: function Tab(param) {
|
|
236
|
-
var {
|
|
237
|
-
editor
|
|
238
|
-
} = param;
|
|
239
|
-
if (editor.isActive("codeBlock")) return false;
|
|
240
|
-
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
241
|
-
return editor.commands.sinkListItem("listItem") || editor.commands.sinkListItem("taskItem");
|
|
242
|
-
}
|
|
243
|
-
return false;
|
|
244
|
-
},
|
|
245
|
-
"Shift-Tab": function (param) {
|
|
246
|
-
var {
|
|
247
|
-
editor
|
|
248
|
-
} = param;
|
|
249
|
-
if (editor.isActive("codeBlock")) return false;
|
|
250
|
-
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
251
|
-
return editor.commands.liftListItem("listItem") || editor.commands.liftListItem("taskItem");
|
|
252
|
-
}
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
});
|
|
54
|
+
var import_MathBubble = require("../toolbar/MathBubble.native.js");
|
|
55
|
+
var MOTION_MS = 120;
|
|
258
56
|
var EditorContainer = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
259
57
|
name: "TiptapEditorContainer",
|
|
260
58
|
flex: 1,
|
|
@@ -263,9 +61,10 @@ var EditorContainer = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
|
263
61
|
});
|
|
264
62
|
var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, import_react.forwardRef)(function (param, ref) {
|
|
265
63
|
var {
|
|
64
|
+
capabilities = "full",
|
|
266
65
|
initialContent = "",
|
|
267
66
|
initialJSON,
|
|
268
|
-
placeholder
|
|
67
|
+
placeholder: placeholderProp,
|
|
269
68
|
editable = true,
|
|
270
69
|
autoFocus = false,
|
|
271
70
|
onChange,
|
|
@@ -278,9 +77,14 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
278
77
|
showBubbleToolbar = false,
|
|
279
78
|
bodyFontFamily,
|
|
280
79
|
headingFontFamily,
|
|
281
|
-
editorMode = "richtext"
|
|
80
|
+
editorMode = "richtext",
|
|
81
|
+
fullscreen = false,
|
|
82
|
+
onImageUpload,
|
|
83
|
+
onFileUpload,
|
|
84
|
+
mentions
|
|
282
85
|
} = param;
|
|
283
86
|
var _ctx = import_context.RichEditorContext.useStyledContext();
|
|
87
|
+
var placeholder = placeholderProp !== null && placeholderProp !== void 0 ? placeholderProp : (0, import_t.t)("Start writing...");
|
|
284
88
|
var internalRef = (0, import_react.useRef)(null);
|
|
285
89
|
var stateRafRef = (0, import_react.useRef)(0);
|
|
286
90
|
var changeRafRef = (0, import_react.useRef)(0);
|
|
@@ -288,60 +92,53 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
288
92
|
var onChangeRef = (0, import_react.useRef)(onChange);
|
|
289
93
|
var [markdownSource, setMarkdownSource] = (0, import_react.useState)("");
|
|
290
94
|
var prevModeRef = (0, import_react.useRef)(editorMode);
|
|
95
|
+
var theme = (0, import_tamagui.useTheme)();
|
|
96
|
+
var themeName = (0, import_tamagui.useThemeName)();
|
|
97
|
+
var {
|
|
98
|
+
knobProps
|
|
99
|
+
} = (0, import_theme.useResolvedKnobs)();
|
|
100
|
+
var motionMs = knobProps.transition !== void 0 ? MOTION_MS : 0;
|
|
101
|
+
var scopeClass = `rt-scope-${(0, import_react.useId)().replace(/[^a-zA-Z0-9-]/g, "")}`;
|
|
102
|
+
var mentionsRef = (0, import_react.useRef)(mentions);
|
|
103
|
+
mentionsRef.current = mentions;
|
|
104
|
+
var [mentionExtension] = (0, import_react.useState)(function () {
|
|
105
|
+
return mentions ? (0, import_mentions.createMentionExtension)({
|
|
106
|
+
trigger: mentions.trigger,
|
|
107
|
+
items: function items(query) {
|
|
108
|
+
var _ref;
|
|
109
|
+
var _mentionsRef_current;
|
|
110
|
+
return (_ref = (_mentionsRef_current = mentionsRef.current) === null || _mentionsRef_current === void 0 ? void 0 : _mentionsRef_current.items(query)) !== null && _ref !== void 0 ? _ref : [];
|
|
111
|
+
}
|
|
112
|
+
}) : null;
|
|
113
|
+
});
|
|
291
114
|
(0, import_react.useEffect)(function () {
|
|
292
115
|
onStateChangeRef.current = onStateChange;
|
|
293
116
|
onChangeRef.current = onChange;
|
|
294
117
|
});
|
|
118
|
+
var [extensions] = (0, import_react.useState)(function () {
|
|
119
|
+
return (0, import_extensions.buildEditorExtensions)({
|
|
120
|
+
capabilities,
|
|
121
|
+
placeholder,
|
|
122
|
+
mentionExtension
|
|
123
|
+
});
|
|
124
|
+
});
|
|
295
125
|
var editor = (0, import_react2.useEditor)({
|
|
296
|
-
extensions
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
HTMLAttributes: {
|
|
300
|
-
dir: "auto"
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
paragraph: {
|
|
304
|
-
HTMLAttributes: {
|
|
305
|
-
dir: "auto"
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
link: {
|
|
309
|
-
openOnClick: false,
|
|
310
|
-
HTMLAttributes: {
|
|
311
|
-
rel: "noopener noreferrer",
|
|
312
|
-
target: "_blank"
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
bulletList: {
|
|
316
|
-
keepMarks: true
|
|
317
|
-
},
|
|
318
|
-
orderedList: {
|
|
319
|
-
keepMarks: true
|
|
320
|
-
},
|
|
321
|
-
codeBlock: false,
|
|
322
|
-
hardBreak: false
|
|
323
|
-
}), import_extension_code_block_lowlight.default.configure({
|
|
324
|
-
lowlight,
|
|
325
|
-
exitOnTripleEnter: true,
|
|
326
|
-
exitOnArrowDown: false
|
|
327
|
-
}), ParagraphEnterKeys, CodeBlockTabIndent, ListItemKeys, import_extension_typography.default, import_extension_character_count.default, import_SlashCommands.SlashCommands, import_MarkdownPaste.MarkdownPaste, import_BlockDragHandle.BlockDragHandle, import_extension_table.Table.configure({
|
|
328
|
-
resizable: true
|
|
329
|
-
}), import_extension_table_row.TableRow, import_extension_table_header.TableHeader, import_extension_table_cell.TableCell, import_extension_placeholder.default.configure({
|
|
330
|
-
placeholder
|
|
331
|
-
}), import_extension_text_align.default.configure({
|
|
332
|
-
types: ["heading", "paragraph"],
|
|
333
|
-
defaultAlignment: "left"
|
|
334
|
-
}), import_extension_text_style.TextStyle, import_extension_color.Color, import_extension_highlight.Highlight.configure({
|
|
335
|
-
multicolor: true
|
|
336
|
-
}), import_extension_subscript.Subscript, import_extension_superscript.Superscript, import_extension_task_list.default, import_extension_task_item.default.configure({
|
|
337
|
-
nested: true
|
|
338
|
-
}), import_extension_image.default.configure({
|
|
339
|
-
inline: true,
|
|
340
|
-
allowBase64: true
|
|
341
|
-
})],
|
|
342
|
-
content: initialJSON || initialContent,
|
|
126
|
+
extensions,
|
|
127
|
+
// In markdown capabilities the incoming string IS markdown
|
|
128
|
+
content: initialJSON || (capabilities === "markdown" ? (0, import_markdown.markdownToHtml)(initialContent) : initialContent),
|
|
343
129
|
editable,
|
|
344
130
|
autofocus: autoFocus,
|
|
131
|
+
// No htmlFor target exists for the contenteditable — name it directly
|
|
132
|
+
// (axe aria-input-field-name); placeholder doubles as the name.
|
|
133
|
+
editorProps: {
|
|
134
|
+
attributes: {
|
|
135
|
+
role: "textbox",
|
|
136
|
+
"aria-multiline": "true",
|
|
137
|
+
"aria-label": placeholder || (0, import_t.t)("Rich text editor")
|
|
138
|
+
},
|
|
139
|
+
// Strip Google Docs / Word clipboard junk before ProseMirror parses
|
|
140
|
+
transformPastedHTML: import_pasteCleanup.cleanPastedHtml
|
|
141
|
+
},
|
|
345
142
|
injectCSS: false,
|
|
346
143
|
immediatelyRender: false,
|
|
347
144
|
shouldRerenderOnTransaction: false,
|
|
@@ -354,7 +151,7 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
354
151
|
var _onChangeRef_current;
|
|
355
152
|
var html = editor2.getHTML();
|
|
356
153
|
var json = editor2.getJSON();
|
|
357
|
-
(_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, html, json);
|
|
154
|
+
(_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, capabilities === "markdown" ? (0, import_markdown.htmlToMarkdown)(html) : html, json);
|
|
358
155
|
});
|
|
359
156
|
},
|
|
360
157
|
onTransaction: function onTransaction(param2) {
|
|
@@ -374,30 +171,63 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
374
171
|
return onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
375
172
|
}
|
|
376
173
|
});
|
|
174
|
+
(0, import_react.useEffect)(function () {
|
|
175
|
+
if (!editor) return;
|
|
176
|
+
editor.storage.mediaUpload.handlers = {
|
|
177
|
+
onImageUpload,
|
|
178
|
+
onFileUpload
|
|
179
|
+
};
|
|
180
|
+
}, [editor, onImageUpload, onFileUpload]);
|
|
181
|
+
(0, import_react.useEffect)(function () {
|
|
182
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
|
|
183
|
+
var _getTokens_radius_radiusToken, _getTokens_radius, _getTokens_space_rowPadToken, _getTokens_space, _theme_shadow2, _theme_shadow1, _theme_background, _theme_borderColor, _theme_color4, _theme_color3, _theme_color12, _theme_color11;
|
|
184
|
+
if (!editor) return;
|
|
185
|
+
var radiusToken = (0, import_forms.clampRadiusForLargeComponent)(knobProps.borderRadius.borderRadius, 4);
|
|
186
|
+
var radiusValue = typeof radiusToken === "number" ? radiusToken : (_ref = (_getTokens_radius = (0, import_tamagui.getTokens)().radius) === null || _getTokens_radius === void 0 ? void 0 : (_getTokens_radius_radiusToken = _getTokens_radius[radiusToken]) === null || _getTokens_radius_radiusToken === void 0 ? void 0 : _getTokens_radius_radiusToken.val) !== null && _ref !== void 0 ? _ref : import_suggestionPopup.fallbackSuggestionChrome.radius;
|
|
187
|
+
var rowPadToken = import_theme.menuRowFrame.paddingHorizontal;
|
|
188
|
+
var rowPaddingX = (_ref1 = (_getTokens_space = (0, import_tamagui.getTokens)().space) === null || _getTokens_space === void 0 ? void 0 : (_getTokens_space_rowPadToken = _getTokens_space[rowPadToken]) === null || _getTokens_space_rowPadToken === void 0 ? void 0 : _getTokens_space_rowPadToken.val) !== null && _ref1 !== void 0 ? _ref1 : import_suggestionPopup.fallbackSuggestionChrome.rowPaddingX;
|
|
189
|
+
var shadowMain = (_theme_shadow2 = theme.shadow2) === null || _theme_shadow2 === void 0 ? void 0 : _theme_shadow2.val;
|
|
190
|
+
var shadowSoft = (_theme_shadow1 = theme.shadow1) === null || _theme_shadow1 === void 0 ? void 0 : _theme_shadow1.val;
|
|
191
|
+
var chrome = {
|
|
192
|
+
background: (_ref2 = (_theme_background = theme.background) === null || _theme_background === void 0 ? void 0 : _theme_background.val) !== null && _ref2 !== void 0 ? _ref2 : import_suggestionPopup.fallbackSuggestionChrome.background,
|
|
193
|
+
borderColor: (_ref3 = (_theme_borderColor = theme.borderColor) === null || _theme_borderColor === void 0 ? void 0 : _theme_borderColor.val) !== null && _ref3 !== void 0 ? _ref3 : import_suggestionPopup.fallbackSuggestionChrome.borderColor,
|
|
194
|
+
activeBackground: (_ref4 = (_theme_color4 = theme.color4) === null || _theme_color4 === void 0 ? void 0 : _theme_color4.val) !== null && _ref4 !== void 0 ? _ref4 : import_suggestionPopup.fallbackSuggestionChrome.activeBackground,
|
|
195
|
+
iconTileBackground: (_ref5 = (_theme_color3 = theme.color3) === null || _theme_color3 === void 0 ? void 0 : _theme_color3.val) !== null && _ref5 !== void 0 ? _ref5 : import_suggestionPopup.fallbackSuggestionChrome.iconTileBackground,
|
|
196
|
+
titleColor: (_ref6 = (_theme_color12 = theme.color12) === null || _theme_color12 === void 0 ? void 0 : _theme_color12.val) !== null && _ref6 !== void 0 ? _ref6 : import_suggestionPopup.fallbackSuggestionChrome.titleColor,
|
|
197
|
+
descriptionColor: (_ref7 = (_theme_color11 = theme.color11) === null || _theme_color11 === void 0 ? void 0 : _theme_color11.val) !== null && _ref7 !== void 0 ? _ref7 : import_suggestionPopup.fallbackSuggestionChrome.descriptionColor,
|
|
198
|
+
radius: typeof radiusValue === "number" ? radiusValue : import_suggestionPopup.fallbackSuggestionChrome.radius,
|
|
199
|
+
shadow: shadowMain && shadowSoft ? `0px 8px 28px ${shadowMain}, 0px 2px 6px ${shadowSoft}` : import_suggestionPopup.fallbackSuggestionChrome.shadow,
|
|
200
|
+
motionMs,
|
|
201
|
+
rowPaddingX: typeof rowPaddingX === "number" ? rowPaddingX : import_suggestionPopup.fallbackSuggestionChrome.rowPaddingX
|
|
202
|
+
};
|
|
203
|
+
editor.storage.suggestionChrome.value = chrome;
|
|
204
|
+
}, [editor, theme, knobProps.borderRadius.borderRadius, motionMs]);
|
|
205
|
+
(0, import_react.useEffect)(function () {
|
|
206
|
+
if (!editor) return;
|
|
207
|
+
(0, import_codeBlockPreview.setPreviewChrome)(editor, {
|
|
208
|
+
scheme: String(themeName).startsWith("dark") ? "dark" : "light",
|
|
209
|
+
fontFamily: bodyFontFamily
|
|
210
|
+
});
|
|
211
|
+
}, [editor, themeName, bodyFontFamily]);
|
|
377
212
|
(0, import_react.useEffect)(function () {
|
|
378
213
|
if (!editor) return;
|
|
379
214
|
if (prevModeRef.current === editorMode) return;
|
|
380
215
|
prevModeRef.current = editorMode;
|
|
381
216
|
if (editorMode === "markdown") {
|
|
382
|
-
setMarkdownSource(
|
|
217
|
+
setMarkdownSource((0, import_markdown.htmlToMarkdown)(editor.getHTML()));
|
|
383
218
|
} else {
|
|
384
|
-
|
|
385
|
-
async: false
|
|
386
|
-
});
|
|
387
|
-
editor.commands.setContent(html);
|
|
219
|
+
editor.commands.setContent((0, import_markdown.markdownToHtml)(markdownSource));
|
|
388
220
|
}
|
|
389
221
|
}, [editorMode, editor, markdownSource]);
|
|
390
222
|
var handleMarkdownChange = (0, import_react.useCallback)(function (e) {
|
|
391
223
|
var _onChangeRef_current;
|
|
392
224
|
var md = e.target.value;
|
|
393
225
|
setMarkdownSource(md);
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
});
|
|
397
|
-
(_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, html, null);
|
|
398
|
-
}, []);
|
|
226
|
+
(_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, capabilities === "markdown" ? md : (0, import_markdown.markdownToHtml)(md), null);
|
|
227
|
+
}, [capabilities]);
|
|
399
228
|
var executeCommand = (0, import_react.useCallback)(function (command, payload) {
|
|
400
229
|
if (!editor) return;
|
|
230
|
+
if (!(0, import_capabilities.isCommandInCapabilities)(command, capabilities)) return;
|
|
401
231
|
var chain = editor.chain().focus();
|
|
402
232
|
switch (command) {
|
|
403
233
|
case "bold":
|
|
@@ -479,11 +309,25 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
479
309
|
break;
|
|
480
310
|
case "link":
|
|
481
311
|
if (payload === null || payload === void 0 ? void 0 : payload.href) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
312
|
+
if (editor.state.selection.empty && !editor.isActive("link")) {
|
|
313
|
+
var _payload_text;
|
|
314
|
+
chain.insertContent({
|
|
315
|
+
type: "text",
|
|
316
|
+
text: (_payload_text = payload.text) !== null && _payload_text !== void 0 ? _payload_text : payload.href,
|
|
317
|
+
marks: [{
|
|
318
|
+
type: "link",
|
|
319
|
+
attrs: {
|
|
320
|
+
href: payload.href
|
|
321
|
+
}
|
|
322
|
+
}]
|
|
323
|
+
}).run();
|
|
324
|
+
} else {
|
|
325
|
+
chain.extendMarkRange("link").setLink({
|
|
326
|
+
href: payload.href
|
|
327
|
+
}).run();
|
|
328
|
+
}
|
|
485
329
|
} else {
|
|
486
|
-
chain.unsetLink().run();
|
|
330
|
+
chain.extendMarkRange("link").unsetLink().run();
|
|
487
331
|
}
|
|
488
332
|
break;
|
|
489
333
|
case "undo":
|
|
@@ -578,12 +422,22 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
578
422
|
getJSON: function getJSON() {
|
|
579
423
|
return (editor === null || editor === void 0 ? void 0 : editor.getJSON()) || null;
|
|
580
424
|
},
|
|
425
|
+
getMarkdown: function getMarkdown() {
|
|
426
|
+
return (0, import_markdown.htmlToMarkdown)((editor === null || editor === void 0 ? void 0 : editor.getHTML()) || "");
|
|
427
|
+
},
|
|
581
428
|
setHTML: function setHTML(html) {
|
|
582
429
|
return editor === null || editor === void 0 ? void 0 : editor.commands.setContent(html);
|
|
583
430
|
},
|
|
584
431
|
setJSON: function setJSON(json) {
|
|
585
432
|
return editor === null || editor === void 0 ? void 0 : editor.commands.setContent(json);
|
|
586
433
|
},
|
|
434
|
+
// External value sync (not a user edit): emitUpdate false so the
|
|
435
|
+
// host's own set does not echo back through onChange.
|
|
436
|
+
setMarkdown: function setMarkdown(markdown) {
|
|
437
|
+
return editor === null || editor === void 0 ? void 0 : editor.commands.setContent((0, import_markdown.markdownToHtml)(markdown), {
|
|
438
|
+
emitUpdate: false
|
|
439
|
+
});
|
|
440
|
+
},
|
|
587
441
|
focus: function focus() {
|
|
588
442
|
return editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
589
443
|
},
|
|
@@ -601,21 +455,26 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
601
455
|
minHeight,
|
|
602
456
|
maxHeight,
|
|
603
457
|
bodyFontFamily,
|
|
604
|
-
headingFontFamily
|
|
458
|
+
headingFontFamily,
|
|
459
|
+
fullscreen,
|
|
460
|
+
motionMs,
|
|
461
|
+
scopeClass
|
|
605
462
|
});
|
|
606
|
-
}, [minHeight, maxHeight, bodyFontFamily, headingFontFamily]);
|
|
463
|
+
}, [minHeight, maxHeight, bodyFontFamily, headingFontFamily, fullscreen, motionMs, scopeClass]);
|
|
607
464
|
if (editorMode === "markdown") {
|
|
608
465
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(EditorContainer, {
|
|
609
|
-
minHeight,
|
|
610
|
-
maxHeight,
|
|
466
|
+
minHeight: fullscreen ? 0 : minHeight,
|
|
467
|
+
maxHeight: fullscreen ? void 0 : maxHeight,
|
|
611
468
|
overflow: "hidden",
|
|
612
469
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)("textarea", {
|
|
613
470
|
value: markdownSource,
|
|
614
471
|
onChange: handleMarkdownChange,
|
|
472
|
+
"aria-label": (0, import_t.t)("Markdown source"),
|
|
615
473
|
style: {
|
|
616
474
|
width: "100%",
|
|
617
|
-
minHeight,
|
|
618
|
-
maxHeight: maxHeight || void 0,
|
|
475
|
+
minHeight: fullscreen ? 0 : minHeight,
|
|
476
|
+
maxHeight: fullscreen ? void 0 : maxHeight || void 0,
|
|
477
|
+
flex: fullscreen ? "1 1 0%" : void 0,
|
|
619
478
|
padding: "12px 12px 12px 16px",
|
|
620
479
|
border: "none",
|
|
621
480
|
outline: "none",
|
|
@@ -633,8 +492,9 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
633
492
|
});
|
|
634
493
|
}
|
|
635
494
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(EditorContainer, {
|
|
636
|
-
|
|
637
|
-
|
|
495
|
+
className: scopeClass,
|
|
496
|
+
minHeight: fullscreen ? 0 : minHeight,
|
|
497
|
+
maxHeight: fullscreen ? void 0 : maxHeight,
|
|
638
498
|
overflow: "hidden",
|
|
639
499
|
children: [import_constants.isWeb && /* @__PURE__ */(0, import_jsx_runtime.jsx)("style", {
|
|
640
500
|
children: editorCSS
|
|
@@ -642,7 +502,8 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
642
502
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_BubbleToolbar.BubbleToolbar, {
|
|
643
503
|
editor,
|
|
644
504
|
editorRef: internalRef,
|
|
645
|
-
state: import_types.defaultEditorState
|
|
505
|
+
state: import_types.defaultEditorState,
|
|
506
|
+
capabilities
|
|
646
507
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_LinkBubble.LinkBubble, {
|
|
647
508
|
editor
|
|
648
509
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_CodeBlockBubble.CodeBlockBubble, {
|
|
@@ -650,10 +511,23 @@ var TiptapEditor = /* @__PURE__ */(0, import_react.memo)(/* @__PURE__ */(0, impo
|
|
|
650
511
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ImageBubble.ImageBubble, {
|
|
651
512
|
editor
|
|
652
513
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_TableBubble.TableBubble, {
|
|
653
|
-
editor
|
|
514
|
+
editor,
|
|
515
|
+
capabilities
|
|
654
516
|
})]
|
|
655
|
-
}),
|
|
517
|
+
}),
|
|
518
|
+
/* Always mounted (unlike the optional bubbles): it is the ONLY
|
|
519
|
+
edit path for inline math atoms — without it a typed `$x$`
|
|
520
|
+
node would be a dead end. Markdown capabilities have no inline
|
|
521
|
+
math node, so the bubble has nothing to edit and stays out. */
|
|
522
|
+
editable && capabilities !== "markdown" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_MathBubble.MathBubble, {
|
|
656
523
|
editor
|
|
524
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.EditorContent, {
|
|
525
|
+
editor,
|
|
526
|
+
style: fullscreen ? {
|
|
527
|
+
flex: "1 1 0%",
|
|
528
|
+
minHeight: 0,
|
|
529
|
+
overflowY: "auto"
|
|
530
|
+
} : void 0
|
|
657
531
|
})]
|
|
658
532
|
});
|
|
659
533
|
}));
|