@lobehub/editor 4.4.0 → 4.6.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/es/ReactSlashPlugin-DURF_w1Z.js +22911 -0
- package/es/index-BfKEHYDe.d.ts +889 -0
- package/es/index.d.ts +2826 -32
- package/es/index.js +7587 -65
- package/es/react.d.ts +335 -0
- package/es/react.js +1573 -0
- package/es/renderer.d.ts +110 -0
- package/es/renderer.js +1254 -0
- package/es/style-CFkese2R.js +999 -0
- package/es/style-Ub1LiKko.js +3005 -0
- package/package.json +38 -27
- package/es/common/canUseDOM.d.ts +0 -8
- package/es/common/canUseDOM.js +0 -9
- package/es/common/sys.d.ts +0 -19
- package/es/common/sys.js +0 -35
- package/es/const/hotkey.d.ts +0 -3
- package/es/const/hotkey.js +0 -63
- package/es/editor-kernel/data-source.d.ts +0 -11
- package/es/editor-kernel/data-source.js +0 -30
- package/es/editor-kernel/event.d.ts +0 -3
- package/es/editor-kernel/event.js +0 -11
- package/es/editor-kernel/index.d.ts +0 -12
- package/es/editor-kernel/index.js +0 -16
- package/es/editor-kernel/inode/helper.d.ts +0 -17
- package/es/editor-kernel/inode/helper.js +0 -89
- package/es/editor-kernel/inode/i-element-node.d.ts +0 -2
- package/es/editor-kernel/inode/i-element-node.js +0 -1
- package/es/editor-kernel/inode/i-node.d.ts +0 -2
- package/es/editor-kernel/inode/i-node.js +0 -1
- package/es/editor-kernel/inode/index.d.ts +0 -5
- package/es/editor-kernel/inode/index.js +0 -5
- package/es/editor-kernel/inode/paragraph-node.d.ts +0 -6
- package/es/editor-kernel/inode/paragraph-node.js +0 -1
- package/es/editor-kernel/inode/root-node.d.ts +0 -5
- package/es/editor-kernel/inode/root-node.js +0 -1
- package/es/editor-kernel/inode/text-node.d.ts +0 -5
- package/es/editor-kernel/inode/text-node.js +0 -1
- package/es/editor-kernel/kernel.d.ts +0 -107
- package/es/editor-kernel/kernel.js +0 -875
- package/es/editor-kernel/lexical/Lexical.dev.js +0 -3052
- package/es/editor-kernel/lexical/Lexical.dev.mjs +0 -15369
- package/es/editor-kernel/lexical/Lexical.js +0 -7634
- package/es/editor-kernel/lexical/Lexical.mjs +0 -7258
- package/es/editor-kernel/lexical/LexicalCommands.d.ts +0 -175
- package/es/editor-kernel/lexical/LexicalConstants.d.ts +0 -54
- package/es/editor-kernel/lexical/LexicalEditor.d.ts +0 -672
- package/es/editor-kernel/lexical/LexicalEditorState.d.ts +0 -39
- package/es/editor-kernel/lexical/LexicalEvents.d.ts +0 -22
- package/es/editor-kernel/lexical/LexicalGC.d.ts +0 -23
- package/es/editor-kernel/lexical/LexicalMutations.d.ts +0 -12
- package/es/editor-kernel/lexical/LexicalNode.d.ts +0 -689
- package/es/editor-kernel/lexical/LexicalNodeState.d.ts +0 -569
- package/es/editor-kernel/lexical/LexicalNormalization.d.ts +0 -11
- package/es/editor-kernel/lexical/LexicalReconciler.d.ts +0 -28
- package/es/editor-kernel/lexical/LexicalSelection.d.ts +0 -368
- package/es/editor-kernel/lexical/LexicalUpdateTags.d.ts +0 -67
- package/es/editor-kernel/lexical/LexicalUpdates.d.ts +0 -72
- package/es/editor-kernel/lexical/LexicalUtils.d.ts +0 -492
- package/es/editor-kernel/lexical/caret/LexicalCaret.d.ts +0 -635
- package/es/editor-kernel/lexical/caret/LexicalCaretUtils.d.ts +0 -224
- package/es/editor-kernel/lexical/extension-core/defineExtension.d.ts +0 -126
- package/es/editor-kernel/lexical/extension-core/index.d.ts +0 -38
- package/es/editor-kernel/lexical/extension-core/internal.d.ts +0 -32
- package/es/editor-kernel/lexical/extension-core/safeCast.d.ts +0 -15
- package/es/editor-kernel/lexical/extension-core/shallowMergeConfig.d.ts +0 -20
- package/es/editor-kernel/lexical/extension-core/types.d.ts +0 -371
- package/es/editor-kernel/lexical/index.d.ts +0 -368
- package/es/editor-kernel/lexical/nodes/ArtificialNode.d.ts +0 -16
- package/es/editor-kernel/lexical/nodes/LexicalDecoratorNode.d.ts +0 -32
- package/es/editor-kernel/lexical/nodes/LexicalElementNode.d.ts +0 -235
- package/es/editor-kernel/lexical/nodes/LexicalLineBreakNode.d.ts +0 -30
- package/es/editor-kernel/lexical/nodes/LexicalParagraphNode.d.ts +0 -39
- package/es/editor-kernel/lexical/nodes/LexicalRootNode.d.ts +0 -35
- package/es/editor-kernel/lexical/nodes/LexicalTabNode.d.ts +0 -30
- package/es/editor-kernel/lexical/nodes/LexicalTextNode.d.ts +0 -311
- package/es/editor-kernel/plugin.d.ts +0 -21
- package/es/editor-kernel/plugin.js +0 -90
- package/es/editor-kernel/react/LexicalErrorBoundary.d.ts +0 -13
- package/es/editor-kernel/react/LexicalErrorBoundary.js +0 -26
- package/es/editor-kernel/react/PortalAnchor.d.ts +0 -6
- package/es/editor-kernel/react/PortalAnchor.js +0 -12
- package/es/editor-kernel/react/PortalContainer.d.ts +0 -11
- package/es/editor-kernel/react/PortalContainer.js +0 -32
- package/es/editor-kernel/react/index.d.ts +0 -5
- package/es/editor-kernel/react/index.js +0 -5
- package/es/editor-kernel/react/react-context.d.ts +0 -10
- package/es/editor-kernel/react/react-context.js +0 -25
- package/es/editor-kernel/react/react-editor.d.ts +0 -15
- package/es/editor-kernel/react/react-editor.js +0 -52
- package/es/editor-kernel/react/useAnchor.d.ts +0 -1
- package/es/editor-kernel/react/useAnchor.js +0 -27
- package/es/editor-kernel/react/useDecorators.d.ts +0 -9
- package/es/editor-kernel/react/useDecorators.js +0 -80
- package/es/editor-kernel/react/useEditable.d.ts +0 -3
- package/es/editor-kernel/react/useEditable.js +0 -37
- package/es/editor-kernel/react/useLexicalEditor.d.ts +0 -2
- package/es/editor-kernel/react/useLexicalEditor.js +0 -31
- package/es/editor-kernel/react/useLexicalNodeSelection.d.ts +0 -17
- package/es/editor-kernel/react/useLexicalNodeSelection.js +0 -120
- package/es/editor-kernel/react/useTranslation.d.ts +0 -3
- package/es/editor-kernel/react/useTranslation.js +0 -19
- package/es/editor-kernel/types.d.ts +0 -0
- package/es/editor-kernel/types.js +0 -0
- package/es/editor-kernel/utils.d.ts +0 -41
- package/es/editor-kernel/utils.js +0 -167
- package/es/global.d.ts +0 -5
- package/es/locale/index.d.ts +0 -55
- package/es/locale/index.js +0 -54
- package/es/plugins/auto-complete/index.d.ts +0 -2
- package/es/plugins/auto-complete/index.js +0 -2
- package/es/plugins/auto-complete/node/placeholderNode.d.ts +0 -30
- package/es/plugins/auto-complete/node/placeholderNode.js +0 -171
- package/es/plugins/auto-complete/plugin/index.d.ts +0 -17
- package/es/plugins/auto-complete/plugin/index.js +0 -400
- package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts +0 -4
- package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.js +0 -33
- package/es/plugins/auto-complete/react/index.d.ts +0 -1
- package/es/plugins/auto-complete/react/index.js +0 -1
- package/es/plugins/auto-complete/react/style.d.ts +0 -4
- package/es/plugins/auto-complete/react/style.js +0 -10
- package/es/plugins/auto-complete/react/type.d.ts +0 -11
- package/es/plugins/auto-complete/react/type.js +0 -1
- package/es/plugins/code/command/index.d.ts +0 -3
- package/es/plugins/code/command/index.js +0 -48
- package/es/plugins/code/index.d.ts +0 -3
- package/es/plugins/code/index.js +0 -3
- package/es/plugins/code/node/code.d.ts +0 -21
- package/es/plugins/code/node/code.js +0 -167
- package/es/plugins/code/plugin/index.d.ts +0 -6
- package/es/plugins/code/plugin/index.js +0 -112
- package/es/plugins/code/plugin/registry.d.ts +0 -6
- package/es/plugins/code/plugin/registry.js +0 -59
- package/es/plugins/code/react/CodeReactPlugin.d.ts +0 -4
- package/es/plugins/code/react/CodeReactPlugin.js +0 -32
- package/es/plugins/code/react/index.d.ts +0 -1
- package/es/plugins/code/react/index.js +0 -1
- package/es/plugins/code/react/style.d.ts +0 -3
- package/es/plugins/code/react/style.js +0 -10
- package/es/plugins/code/react/type.d.ts +0 -4
- package/es/plugins/code/react/type.js +0 -1
- package/es/plugins/codeblock/command/index.d.ts +0 -17
- package/es/plugins/codeblock/command/index.js +0 -49
- package/es/plugins/codeblock/index.d.ts +0 -4
- package/es/plugins/codeblock/index.js +0 -4
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.d.ts +0 -25
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.js +0 -736
- package/es/plugins/codeblock/plugin/FacadeShiki.d.ts +0 -53
- package/es/plugins/codeblock/plugin/FacadeShiki.js +0 -380
- package/es/plugins/codeblock/plugin/index.d.ts +0 -13
- package/es/plugins/codeblock/plugin/index.js +0 -229
- package/es/plugins/codeblock/plugin/invariant.d.ts +0 -8
- package/es/plugins/codeblock/plugin/invariant.js +0 -17
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.d.ts +0 -4
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +0 -34
- package/es/plugins/codeblock/react/index.d.ts +0 -2
- package/es/plugins/codeblock/react/index.js +0 -1
- package/es/plugins/codeblock/react/style.d.ts +0 -4
- package/es/plugins/codeblock/react/style.js +0 -11
- package/es/plugins/codeblock/react/type.d.ts +0 -5
- package/es/plugins/codeblock/react/type.js +0 -1
- package/es/plugins/codeblock/utils/language.d.ts +0 -1
- package/es/plugins/codeblock/utils/language.js +0 -12
- package/es/plugins/codemirror-block/command/index.d.ts +0 -9
- package/es/plugins/codemirror-block/command/index.js +0 -92
- package/es/plugins/codemirror-block/index.d.ts +0 -3
- package/es/plugins/codemirror-block/index.js +0 -7
- package/es/plugins/codemirror-block/lib/index.d.ts +0 -63
- package/es/plugins/codemirror-block/lib/index.js +0 -146
- package/es/plugins/codemirror-block/lib/mode.d.ts +0 -25
- package/es/plugins/codemirror-block/lib/mode.js +0 -416
- package/es/plugins/codemirror-block/node/CodeMirrorNode.d.ts +0 -46
- package/es/plugins/codemirror-block/node/CodeMirrorNode.js +0 -343
- package/es/plugins/codemirror-block/plugin/index.d.ts +0 -8
- package/es/plugins/codemirror-block/plugin/index.js +0 -113
- package/es/plugins/codemirror-block/react/CodemirrorNode.d.ts +0 -10
- package/es/plugins/codemirror-block/react/CodemirrorNode.js +0 -345
- package/es/plugins/codemirror-block/react/ReactCodemirrorNode.d.ts +0 -4
- package/es/plugins/codemirror-block/react/ReactCodemirrorNode.js +0 -34
- package/es/plugins/codemirror-block/react/components/CopyButton.d.ts +0 -5
- package/es/plugins/codemirror-block/react/components/CopyButton.js +0 -35
- package/es/plugins/codemirror-block/react/components/LanguageSelect.d.ts +0 -8
- package/es/plugins/codemirror-block/react/components/LanguageSelect.js +0 -77
- package/es/plugins/codemirror-block/react/components/MoreOptions.d.ts +0 -16
- package/es/plugins/codemirror-block/react/components/MoreOptions.js +0 -79
- package/es/plugins/codemirror-block/react/components/Toolbar.d.ts +0 -16
- package/es/plugins/codemirror-block/react/components/Toolbar.js +0 -56
- package/es/plugins/codemirror-block/react/components/style.d.ts +0 -3
- package/es/plugins/codemirror-block/react/components/style.js +0 -9
- package/es/plugins/codemirror-block/react/index.d.ts +0 -1
- package/es/plugins/codemirror-block/react/index.js +0 -1
- package/es/plugins/codemirror-block/react/style.d.ts +0 -1
- package/es/plugins/codemirror-block/react/style.js +0 -8
- package/es/plugins/codemirror-block/react/theme.d.ts +0 -133
- package/es/plugins/codemirror-block/react/theme.js +0 -158
- package/es/plugins/codemirror-block/react/type.d.ts +0 -3
- package/es/plugins/codemirror-block/react/type.js +0 -1
- package/es/plugins/common/command/index.d.ts +0 -7
- package/es/plugins/common/command/index.js +0 -31
- package/es/plugins/common/data-source/json-data-source.d.ts +0 -7
- package/es/plugins/common/data-source/json-data-source.js +0 -219
- package/es/plugins/common/data-source/text-data-source.d.ts +0 -7
- package/es/plugins/common/data-source/text-data-source.js +0 -60
- package/es/plugins/common/index.d.ts +0 -4
- package/es/plugins/common/index.js +0 -4
- package/es/plugins/common/node/ElementDOMSlot.d.ts +0 -3
- package/es/plugins/common/node/ElementDOMSlot.js +0 -33
- package/es/plugins/common/node/cursor.d.ts +0 -14
- package/es/plugins/common/node/cursor.js +0 -332
- package/es/plugins/common/plugin/index.d.ts +0 -39
- package/es/plugins/common/plugin/index.js +0 -553
- package/es/plugins/common/plugin/mdReader.d.ts +0 -2
- package/es/plugins/common/plugin/mdReader.js +0 -84
- package/es/plugins/common/plugin/paste-handler.d.ts +0 -37
- package/es/plugins/common/plugin/paste-handler.js +0 -140
- package/es/plugins/common/plugin/register.d.ts +0 -10
- package/es/plugins/common/plugin/register.js +0 -407
- package/es/plugins/common/react/Placeholder/index.d.ts +0 -8
- package/es/plugins/common/react/Placeholder/index.js +0 -92
- package/es/plugins/common/react/Placeholder/style.d.ts +0 -4
- package/es/plugins/common/react/Placeholder/style.js +0 -12
- package/es/plugins/common/react/ReactEditorContent.d.ts +0 -4
- package/es/plugins/common/react/ReactEditorContent.js +0 -7
- package/es/plugins/common/react/ReactPlainText.d.ts +0 -4
- package/es/plugins/common/react/ReactPlainText.js +0 -239
- package/es/plugins/common/react/index.d.ts +0 -3
- package/es/plugins/common/react/index.js +0 -3
- package/es/plugins/common/react/style.d.ts +0 -23
- package/es/plugins/common/react/style.js +0 -41
- package/es/plugins/common/react/type.d.ts +0 -80
- package/es/plugins/common/react/type.js +0 -1
- package/es/plugins/common/utils/index.d.ts +0 -35
- package/es/plugins/common/utils/index.js +0 -198
- package/es/plugins/file/command/index.d.ts +0 -7
- package/es/plugins/file/command/index.js +0 -30
- package/es/plugins/file/index.d.ts +0 -3
- package/es/plugins/file/index.js +0 -3
- package/es/plugins/file/node/FileNode.d.ts +0 -36
- package/es/plugins/file/node/FileNode.js +0 -187
- package/es/plugins/file/plugin/index.d.ts +0 -14
- package/es/plugins/file/plugin/index.js +0 -164
- package/es/plugins/file/react/ReactFilePlugin.d.ts +0 -4
- package/es/plugins/file/react/ReactFilePlugin.js +0 -72
- package/es/plugins/file/react/components/ReactFile.d.ts +0 -10
- package/es/plugins/file/react/components/ReactFile.js +0 -64
- package/es/plugins/file/react/index.d.ts +0 -2
- package/es/plugins/file/react/index.js +0 -1
- package/es/plugins/file/react/style.d.ts +0 -3
- package/es/plugins/file/react/style.js +0 -11
- package/es/plugins/file/react/type.d.ts +0 -13
- package/es/plugins/file/react/type.js +0 -1
- package/es/plugins/file/utils/index.d.ts +0 -2
- package/es/plugins/file/utils/index.js +0 -45
- package/es/plugins/hr/command/index.d.ts +0 -3
- package/es/plugins/hr/command/index.js +0 -13
- package/es/plugins/hr/index.d.ts +0 -3
- package/es/plugins/hr/index.js +0 -3
- package/es/plugins/hr/node/HorizontalRuleNode.d.ts +0 -16
- package/es/plugins/hr/node/HorizontalRuleNode.js +0 -110
- package/es/plugins/hr/plugin/index.d.ts +0 -8
- package/es/plugins/hr/plugin/index.js +0 -98
- package/es/plugins/hr/react/ReactHRPlugin.d.ts +0 -4
- package/es/plugins/hr/react/ReactHRPlugin.js +0 -36
- package/es/plugins/hr/react/components/HRNode.d.ts +0 -10
- package/es/plugins/hr/react/components/HRNode.js +0 -44
- package/es/plugins/hr/react/index.d.ts +0 -2
- package/es/plugins/hr/react/index.js +0 -1
- package/es/plugins/hr/react/style.d.ts +0 -1
- package/es/plugins/hr/react/style.js +0 -8
- package/es/plugins/hr/react/type.d.ts +0 -3
- package/es/plugins/hr/react/type.js +0 -1
- package/es/plugins/image/command/index.d.ts +0 -10
- package/es/plugins/image/command/index.js +0 -60
- package/es/plugins/image/index.d.ts +0 -3
- package/es/plugins/image/index.js +0 -3
- package/es/plugins/image/node/basie-image-node.d.ts +0 -39
- package/es/plugins/image/node/basie-image-node.js +0 -131
- package/es/plugins/image/node/block-image-node.d.ts +0 -41
- package/es/plugins/image/node/block-image-node.js +0 -228
- package/es/plugins/image/node/image-node.d.ts +0 -39
- package/es/plugins/image/node/image-node.js +0 -212
- package/es/plugins/image/plugin/index.d.ts +0 -20
- package/es/plugins/image/plugin/index.js +0 -273
- package/es/plugins/image/react/ReactImagePlugin.d.ts +0 -4
- package/es/plugins/image/react/ReactImagePlugin.js +0 -57
- package/es/plugins/image/react/components/BrokenImage.d.ts +0 -3
- package/es/plugins/image/react/components/BrokenImage.js +0 -15
- package/es/plugins/image/react/components/Image.d.ts +0 -15
- package/es/plugins/image/react/components/Image.js +0 -265
- package/es/plugins/image/react/components/ImageEditPopover.d.ts +0 -17
- package/es/plugins/image/react/components/ImageEditPopover.js +0 -257
- package/es/plugins/image/react/components/LazyImage.d.ts +0 -15
- package/es/plugins/image/react/components/LazyImage.js +0 -109
- package/es/plugins/image/react/components/ResizeHandle.d.ts +0 -10
- package/es/plugins/image/react/components/ResizeHandle.js +0 -73
- package/es/plugins/image/react/components/style.d.ts +0 -10
- package/es/plugins/image/react/components/style.js +0 -17
- package/es/plugins/image/react/components/useSupenseImage.d.ts +0 -2
- package/es/plugins/image/react/components/useSupenseImage.js +0 -24
- package/es/plugins/image/react/index.d.ts +0 -2
- package/es/plugins/image/react/index.js +0 -1
- package/es/plugins/image/react/style.d.ts +0 -5
- package/es/plugins/image/react/style.js +0 -13
- package/es/plugins/image/react/type.d.ts +0 -20
- package/es/plugins/image/react/type.js +0 -1
- package/es/plugins/inode/index.d.ts +0 -3
- package/es/plugins/inode/index.js +0 -3
- package/es/plugins/inode/plugin/index.d.ts +0 -16
- package/es/plugins/inode/plugin/index.js +0 -49
- package/es/plugins/inode/react/index.d.ts +0 -3
- package/es/plugins/inode/react/index.js +0 -22
- package/es/plugins/inode/service/index.d.ts +0 -25
- package/es/plugins/inode/service/index.js +0 -49
- package/es/plugins/link/command/index.d.ts +0 -10
- package/es/plugins/link/command/index.js +0 -38
- package/es/plugins/link/index.d.ts +0 -4
- package/es/plugins/link/index.js +0 -4
- package/es/plugins/link/node/LinkNode.d.ts +0 -126
- package/es/plugins/link/node/LinkNode.js +0 -723
- package/es/plugins/link/plugin/index.d.ts +0 -12
- package/es/plugins/link/plugin/index.js +0 -157
- package/es/plugins/link/plugin/registry.d.ts +0 -9
- package/es/plugins/link/plugin/registry.js +0 -108
- package/es/plugins/link/react/ReactLinkPlugin.d.ts +0 -4
- package/es/plugins/link/react/ReactLinkPlugin.js +0 -64
- package/es/plugins/link/react/components/LinkEdit.d.ts +0 -12
- package/es/plugins/link/react/components/LinkEdit.js +0 -262
- package/es/plugins/link/react/components/LinkToolbar.d.ts +0 -8
- package/es/plugins/link/react/components/LinkToolbar.js +0 -183
- package/es/plugins/link/react/index.d.ts +0 -2
- package/es/plugins/link/react/index.js +0 -1
- package/es/plugins/link/react/style.d.ts +0 -6
- package/es/plugins/link/react/style.js +0 -14
- package/es/plugins/link/react/type.d.ts +0 -10
- package/es/plugins/link/react/type.js +0 -1
- package/es/plugins/link/service/i-link-service.d.ts +0 -11
- package/es/plugins/link/service/i-link-service.js +0 -46
- package/es/plugins/link/utils/index.d.ts +0 -9
- package/es/plugins/link/utils/index.js +0 -51
- package/es/plugins/link-highlight/command/index.d.ts +0 -3
- package/es/plugins/link-highlight/command/index.js +0 -48
- package/es/plugins/link-highlight/index.d.ts +0 -3
- package/es/plugins/link-highlight/index.js +0 -4
- package/es/plugins/link-highlight/node/link-highlight.d.ts +0 -25
- package/es/plugins/link-highlight/node/link-highlight.js +0 -179
- package/es/plugins/link-highlight/plugin/index.d.ts +0 -15
- package/es/plugins/link-highlight/plugin/index.js +0 -185
- package/es/plugins/link-highlight/plugin/registry.d.ts +0 -6
- package/es/plugins/link-highlight/plugin/registry.js +0 -61
- package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.d.ts +0 -4
- package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.js +0 -33
- package/es/plugins/link-highlight/react/index.d.ts +0 -1
- package/es/plugins/link-highlight/react/index.js +0 -1
- package/es/plugins/link-highlight/react/style.d.ts +0 -3
- package/es/plugins/link-highlight/react/style.js +0 -9
- package/es/plugins/link-highlight/react/type.d.ts +0 -13
- package/es/plugins/link-highlight/react/type.js +0 -1
- package/es/plugins/link-highlight/utils/index.d.ts +0 -17
- package/es/plugins/link-highlight/utils/index.js +0 -43
- package/es/plugins/list/command/index.d.ts +0 -2
- package/es/plugins/list/command/index.js +0 -2
- package/es/plugins/list/index.d.ts +0 -3
- package/es/plugins/list/index.js +0 -3
- package/es/plugins/list/plugin/checkList.d.ts +0 -3
- package/es/plugins/list/plugin/checkList.js +0 -167
- package/es/plugins/list/plugin/index.d.ts +0 -6
- package/es/plugins/list/plugin/index.js +0 -253
- package/es/plugins/list/plugin/registry.d.ts +0 -6
- package/es/plugins/list/plugin/registry.js +0 -98
- package/es/plugins/list/react/ReactListPlugin.d.ts +0 -4
- package/es/plugins/list/react/ReactListPlugin.js +0 -30
- package/es/plugins/list/react/index.d.ts +0 -2
- package/es/plugins/list/react/index.js +0 -1
- package/es/plugins/list/react/style.d.ts +0 -1
- package/es/plugins/list/react/style.js +0 -8
- package/es/plugins/list/react/type.d.ts +0 -4
- package/es/plugins/list/react/type.js +0 -1
- package/es/plugins/list/utils/index.d.ts +0 -5
- package/es/plugins/list/utils/index.js +0 -88
- package/es/plugins/litexml/command/diffCommand.d.ts +0 -13
- package/es/plugins/litexml/command/diffCommand.js +0 -119
- package/es/plugins/litexml/command/index.d.ts +0 -35
- package/es/plugins/litexml/command/index.js +0 -499
- package/es/plugins/litexml/data-source/litexml-data-source.d.ts +0 -62
- package/es/plugins/litexml/data-source/litexml-data-source.js +0 -459
- package/es/plugins/litexml/index.d.ts +0 -9
- package/es/plugins/litexml/index.js +0 -7
- package/es/plugins/litexml/node/DiffNode.d.ts +0 -27
- package/es/plugins/litexml/node/DiffNode.js +0 -164
- package/es/plugins/litexml/plugin/index.d.ts +0 -20
- package/es/plugins/litexml/plugin/index.js +0 -157
- package/es/plugins/litexml/react/DiffNodeToolbar/index.d.ts +0 -10
- package/es/plugins/litexml/react/DiffNodeToolbar/index.js +0 -62
- package/es/plugins/litexml/react/DiffNodeToolbar/style.d.ts +0 -6
- package/es/plugins/litexml/react/DiffNodeToolbar/style.js +0 -13
- package/es/plugins/litexml/react/hooks/useHasDiffNode.d.ts +0 -4
- package/es/plugins/litexml/react/hooks/useHasDiffNode.js +0 -70
- package/es/plugins/litexml/react/index.d.ts +0 -3
- package/es/plugins/litexml/react/index.js +0 -35
- package/es/plugins/litexml/react/style.d.ts +0 -1
- package/es/plugins/litexml/react/style.js +0 -8
- package/es/plugins/litexml/service/litexml-service.d.ts +0 -88
- package/es/plugins/litexml/service/litexml-service.js +0 -101
- package/es/plugins/litexml/utils/index.d.ts +0 -6
- package/es/plugins/litexml/utils/index.js +0 -87
- package/es/plugins/markdown/command/index.d.ts +0 -12
- package/es/plugins/markdown/command/index.js +0 -94
- package/es/plugins/markdown/data-source/markdown/parse.d.ts +0 -21
- package/es/plugins/markdown/data-source/markdown/parse.js +0 -244
- package/es/plugins/markdown/data-source/markdown/supersub.d.ts +0 -1
- package/es/plugins/markdown/data-source/markdown/supersub.js +0 -14
- package/es/plugins/markdown/data-source/markdown-data-source.d.ts +0 -14
- package/es/plugins/markdown/data-source/markdown-data-source.js +0 -248
- package/es/plugins/markdown/data-source/markdown-writer-context.d.ts +0 -16
- package/es/plugins/markdown/data-source/markdown-writer-context.js +0 -76
- package/es/plugins/markdown/index.d.ts +0 -8
- package/es/plugins/markdown/index.js +0 -7
- package/es/plugins/markdown/plugin/index.d.ts +0 -9
- package/es/plugins/markdown/plugin/index.js +0 -312
- package/es/plugins/markdown/react/index.d.ts +0 -3
- package/es/plugins/markdown/react/index.js +0 -72
- package/es/plugins/markdown/service/shortcut.d.ts +0 -90
- package/es/plugins/markdown/service/shortcut.js +0 -185
- package/es/plugins/markdown/service/transformers.d.ts +0 -60
- package/es/plugins/markdown/service/transformers.js +0 -298
- package/es/plugins/markdown/utils/detectLanguage.d.ts +0 -20
- package/es/plugins/markdown/utils/detectLanguage.js +0 -267
- package/es/plugins/markdown/utils/index.d.ts +0 -64
- package/es/plugins/markdown/utils/index.js +0 -223
- package/es/plugins/markdown/utils/logger.d.ts +0 -7
- package/es/plugins/markdown/utils/logger.js +0 -2
- package/es/plugins/markdown/utils/url-validator.d.ts +0 -4
- package/es/plugins/markdown/utils/url-validator.js +0 -6
- package/es/plugins/math/command/index.d.ts +0 -13
- package/es/plugins/math/command/index.js +0 -47
- package/es/plugins/math/index.d.ts +0 -3
- package/es/plugins/math/index.js +0 -3
- package/es/plugins/math/node/index.d.ts +0 -45
- package/es/plugins/math/node/index.js +0 -279
- package/es/plugins/math/plugin/index.d.ts +0 -11
- package/es/plugins/math/plugin/index.js +0 -166
- package/es/plugins/math/react/components/MathEditor.d.ts +0 -10
- package/es/plugins/math/react/components/MathEditor.js +0 -299
- package/es/plugins/math/react/components/MathEditorContainer.d.ts +0 -15
- package/es/plugins/math/react/components/MathEditorContainer.js +0 -112
- package/es/plugins/math/react/components/MathEditorContent.d.ts +0 -28
- package/es/plugins/math/react/components/MathEditorContent.js +0 -161
- package/es/plugins/math/react/components/MathInline.d.ts +0 -10
- package/es/plugins/math/react/components/MathInline.js +0 -136
- package/es/plugins/math/react/components/Placeholder.d.ts +0 -6
- package/es/plugins/math/react/components/Placeholder.js +0 -23
- package/es/plugins/math/react/index.d.ts +0 -3
- package/es/plugins/math/react/index.js +0 -41
- package/es/plugins/math/react/style.d.ts +0 -9
- package/es/plugins/math/react/style.js +0 -18
- package/es/plugins/math/react/type.d.ts +0 -13
- package/es/plugins/math/react/type.js +0 -1
- package/es/plugins/math/utils/index.d.ts +0 -13
- package/es/plugins/math/utils/index.js +0 -26
- package/es/plugins/mention/command/index.d.ts +0 -6
- package/es/plugins/mention/command/index.js +0 -20
- package/es/plugins/mention/index.d.ts +0 -4
- package/es/plugins/mention/index.js +0 -3
- package/es/plugins/mention/node/MentionNode.d.ts +0 -26
- package/es/plugins/mention/node/MentionNode.js +0 -153
- package/es/plugins/mention/plugin/index.d.ts +0 -14
- package/es/plugins/mention/plugin/index.js +0 -103
- package/es/plugins/mention/plugin/register.d.ts +0 -2
- package/es/plugins/mention/plugin/register.js +0 -46
- package/es/plugins/mention/react/ReactMentionPlugin.d.ts +0 -4
- package/es/plugins/mention/react/ReactMentionPlugin.js +0 -40
- package/es/plugins/mention/react/components/Mention.d.ts +0 -10
- package/es/plugins/mention/react/components/Mention.js +0 -40
- package/es/plugins/mention/react/index.d.ts +0 -2
- package/es/plugins/mention/react/index.js +0 -1
- package/es/plugins/mention/react/style.d.ts +0 -3
- package/es/plugins/mention/react/style.js +0 -11
- package/es/plugins/mention/react/type.d.ts +0 -8
- package/es/plugins/mention/react/type.js +0 -1
- package/es/plugins/slash/index.d.ts +0 -4
- package/es/plugins/slash/index.js +0 -3
- package/es/plugins/slash/plugin/index.d.ts +0 -23
- package/es/plugins/slash/plugin/index.js +0 -159
- package/es/plugins/slash/react/ReactSlashOption.d.ts +0 -4
- package/es/plugins/slash/react/ReactSlashOption.js +0 -7
- package/es/plugins/slash/react/ReactSlashPlugin.d.ts +0 -4
- package/es/plugins/slash/react/ReactSlashPlugin.js +0 -258
- package/es/plugins/slash/react/components/DefaultSlashMenu.d.ts +0 -5
- package/es/plugins/slash/react/components/DefaultSlashMenu.js +0 -141
- package/es/plugins/slash/react/components/SlashMenu.d.ts +0 -8
- package/es/plugins/slash/react/components/SlashMenu.js +0 -56
- package/es/plugins/slash/react/index.d.ts +0 -4
- package/es/plugins/slash/react/index.js +0 -3
- package/es/plugins/slash/react/style.d.ts +0 -1
- package/es/plugins/slash/react/style.js +0 -9
- package/es/plugins/slash/react/type.d.ts +0 -111
- package/es/plugins/slash/react/type.js +0 -1
- package/es/plugins/slash/react/utils.d.ts +0 -5
- package/es/plugins/slash/react/utils.js +0 -20
- package/es/plugins/slash/service/i-slash-service.d.ts +0 -61
- package/es/plugins/slash/service/i-slash-service.js +0 -91
- package/es/plugins/slash/utils/utils.d.ts +0 -38
- package/es/plugins/slash/utils/utils.js +0 -198
- package/es/plugins/table/command/index.d.ts +0 -13
- package/es/plugins/table/command/index.js +0 -73
- package/es/plugins/table/index.d.ts +0 -3
- package/es/plugins/table/index.js +0 -3
- package/es/plugins/table/node/index.d.ts +0 -2
- package/es/plugins/table/node/index.js +0 -16
- package/es/plugins/table/plugin/index.d.ts +0 -5
- package/es/plugins/table/plugin/index.js +0 -232
- package/es/plugins/table/react/TableActionMenu/ActionMenu.d.ts +0 -19
- package/es/plugins/table/react/TableActionMenu/ActionMenu.js +0 -285
- package/es/plugins/table/react/TableActionMenu/index.d.ts +0 -7
- package/es/plugins/table/react/TableActionMenu/index.js +0 -177
- package/es/plugins/table/react/TableActionMenu/style.d.ts +0 -4
- package/es/plugins/table/react/TableActionMenu/style.js +0 -10
- package/es/plugins/table/react/TableActionMenu/utils.d.ts +0 -9
- package/es/plugins/table/react/TableActionMenu/utils.js +0 -49
- package/es/plugins/table/react/TableHoverActions/index.d.ts +0 -6
- package/es/plugins/table/react/TableHoverActions/index.js +0 -249
- package/es/plugins/table/react/TableHoverActions/style.d.ts +0 -5
- package/es/plugins/table/react/TableHoverActions/style.js +0 -11
- package/es/plugins/table/react/TableHoverActions/utils.d.ts +0 -8
- package/es/plugins/table/react/TableHoverActions/utils.js +0 -43
- package/es/plugins/table/react/TableResize/index.d.ts +0 -10
- package/es/plugins/table/react/TableResize/index.js +0 -378
- package/es/plugins/table/react/TableResize/style.d.ts +0 -3
- package/es/plugins/table/react/TableResize/style.js +0 -10
- package/es/plugins/table/react/TableResize/utils.d.ts +0 -4
- package/es/plugins/table/react/TableResize/utils.js +0 -40
- package/es/plugins/table/react/hooks.d.ts +0 -1
- package/es/plugins/table/react/hooks.js +0 -22
- package/es/plugins/table/react/index.d.ts +0 -3
- package/es/plugins/table/react/index.js +0 -78
- package/es/plugins/table/react/style.d.ts +0 -1
- package/es/plugins/table/react/style.js +0 -8
- package/es/plugins/table/react/type.d.ts +0 -5
- package/es/plugins/table/react/type.js +0 -1
- package/es/plugins/table/utils/index.d.ts +0 -8
- package/es/plugins/table/utils/index.js +0 -83
- package/es/plugins/toolbar/command/index.d.ts +0 -8
- package/es/plugins/toolbar/command/index.js +0 -16
- package/es/plugins/toolbar/index.d.ts +0 -2
- package/es/plugins/toolbar/index.js +0 -2
- package/es/plugins/toolbar/react/index.d.ts +0 -3
- package/es/plugins/toolbar/react/index.js +0 -140
- package/es/plugins/toolbar/react/style.d.ts +0 -5
- package/es/plugins/toolbar/react/style.js +0 -12
- package/es/plugins/toolbar/react/type.d.ts +0 -5
- package/es/plugins/toolbar/react/type.js +0 -1
- package/es/plugins/toolbar/utils/getDOMRangeRect.d.ts +0 -8
- package/es/plugins/toolbar/utils/getDOMRangeRect.js +0 -21
- package/es/plugins/toolbar/utils/setFloatingElemPosition.d.ts +0 -1
- package/es/plugins/toolbar/utils/setFloatingElemPosition.js +0 -68
- package/es/plugins/upload/index.d.ts +0 -3
- package/es/plugins/upload/index.js +0 -3
- package/es/plugins/upload/plugin/index.d.ts +0 -4
- package/es/plugins/upload/plugin/index.js +0 -84
- package/es/plugins/upload/service/i-upload-service.d.ts +0 -15
- package/es/plugins/upload/service/i-upload-service.js +0 -115
- package/es/plugins/upload/utils/index.d.ts +0 -1
- package/es/plugins/upload/utils/index.js +0 -20
- package/es/plugins/virtual-block/index.d.ts +0 -2
- package/es/plugins/virtual-block/index.js +0 -2
- package/es/plugins/virtual-block/plugin/index.d.ts +0 -5
- package/es/plugins/virtual-block/plugin/index.js +0 -41
- package/es/plugins/virtual-block/plugin/register.d.ts +0 -6
- package/es/plugins/virtual-block/plugin/register.js +0 -274
- package/es/plugins/virtual-block/react/ReactVirtualBlock.d.ts +0 -3
- package/es/plugins/virtual-block/react/ReactVirtualBlock.js +0 -22
- package/es/plugins/virtual-block/react/index.d.ts +0 -1
- package/es/plugins/virtual-block/react/index.js +0 -1
- package/es/react/ChatInput/ChatInput.d.ts +0 -4
- package/es/react/ChatInput/ChatInput.js +0 -146
- package/es/react/ChatInput/index.d.ts +0 -2
- package/es/react/ChatInput/index.js +0 -2
- package/es/react/ChatInput/style.d.ts +0 -11
- package/es/react/ChatInput/style.js +0 -18
- package/es/react/ChatInput/type.d.ts +0 -28
- package/es/react/ChatInput/type.js +0 -1
- package/es/react/ChatInputActionBar/ChatInputActionBar.d.ts +0 -4
- package/es/react/ChatInputActionBar/ChatInputActionBar.js +0 -35
- package/es/react/ChatInputActionBar/index.d.ts +0 -2
- package/es/react/ChatInputActionBar/index.js +0 -2
- package/es/react/ChatInputActionBar/style.d.ts +0 -3
- package/es/react/ChatInputActionBar/style.js +0 -9
- package/es/react/ChatInputActionBar/type.d.ts +0 -6
- package/es/react/ChatInputActionBar/type.js +0 -1
- package/es/react/ChatInputActions/ChatInputActions.d.ts +0 -4
- package/es/react/ChatInputActions/ChatInputActions.js +0 -109
- package/es/react/ChatInputActions/components/ActionItem.d.ts +0 -13
- package/es/react/ChatInputActions/components/ActionItem.js +0 -65
- package/es/react/ChatInputActions/components/ActionRender.d.ts +0 -9
- package/es/react/ChatInputActions/components/ActionRender.js +0 -66
- package/es/react/ChatInputActions/components/CollapsedActions.d.ts +0 -4
- package/es/react/ChatInputActions/components/CollapsedActions.js +0 -78
- package/es/react/ChatInputActions/components/useDisplayActionCount.d.ts +0 -13
- package/es/react/ChatInputActions/components/useDisplayActionCount.js +0 -66
- package/es/react/ChatInputActions/index.d.ts +0 -2
- package/es/react/ChatInputActions/index.js +0 -1
- package/es/react/ChatInputActions/style.d.ts +0 -5
- package/es/react/ChatInputActions/style.js +0 -11
- package/es/react/ChatInputActions/type.d.ts +0 -40
- package/es/react/ChatInputActions/type.js +0 -1
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +0 -4
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +0 -93
- package/es/react/CodeLanguageSelect/index.d.ts +0 -2
- package/es/react/CodeLanguageSelect/index.js +0 -2
- package/es/react/CodeLanguageSelect/style.d.ts +0 -3
- package/es/react/CodeLanguageSelect/style.js +0 -9
- package/es/react/CodeLanguageSelect/type.d.ts +0 -2
- package/es/react/CodeLanguageSelect/type.js +0 -1
- package/es/react/Editor/Editor.d.ts +0 -4
- package/es/react/Editor/Editor.js +0 -149
- package/es/react/Editor/index.d.ts +0 -15
- package/es/react/Editor/index.js +0 -11
- package/es/react/Editor/type.d.ts +0 -51
- package/es/react/Editor/type.js +0 -1
- package/es/react/Editor/utils.d.ts +0 -2
- package/es/react/Editor/utils.js +0 -3
- package/es/react/EditorProvider/index.d.ts +0 -20
- package/es/react/EditorProvider/index.js +0 -25
- package/es/react/FloatActions/FloatActions.d.ts +0 -4
- package/es/react/FloatActions/FloatActions.js +0 -65
- package/es/react/FloatActions/components/ActionItem.d.ts +0 -12
- package/es/react/FloatActions/components/ActionItem.js +0 -64
- package/es/react/FloatActions/components/ActionRender.d.ts +0 -9
- package/es/react/FloatActions/components/ActionRender.js +0 -66
- package/es/react/FloatActions/components/CollapsedActions.d.ts +0 -4
- package/es/react/FloatActions/components/CollapsedActions.js +0 -78
- package/es/react/FloatActions/index.d.ts +0 -2
- package/es/react/FloatActions/index.js +0 -1
- package/es/react/FloatActions/style.d.ts +0 -5
- package/es/react/FloatActions/style.js +0 -11
- package/es/react/FloatActions/type.d.ts +0 -37
- package/es/react/FloatActions/type.js +0 -1
- package/es/react/FloatMenu/FloatMenu.d.ts +0 -4
- package/es/react/FloatMenu/FloatMenu.js +0 -48
- package/es/react/FloatMenu/index.d.ts +0 -2
- package/es/react/FloatMenu/index.js +0 -2
- package/es/react/FloatMenu/style.d.ts +0 -6
- package/es/react/FloatMenu/style.js +0 -13
- package/es/react/FloatMenu/type.d.ts +0 -21
- package/es/react/FloatMenu/type.js +0 -1
- package/es/react/SendButton/SendButton.d.ts +0 -4
- package/es/react/SendButton/SendButton.js +0 -121
- package/es/react/SendButton/components/SendIcon.d.ts +0 -7
- package/es/react/SendButton/components/SendIcon.js +0 -31
- package/es/react/SendButton/components/StopIcon.d.ts +0 -7
- package/es/react/SendButton/components/StopIcon.js +0 -58
- package/es/react/SendButton/index.d.ts +0 -2
- package/es/react/SendButton/index.js +0 -2
- package/es/react/SendButton/style.d.ts +0 -7
- package/es/react/SendButton/style.js +0 -15
- package/es/react/SendButton/type.d.ts +0 -8
- package/es/react/SendButton/type.js +0 -1
- package/es/react/SlashMenu/SlashMenu.d.ts +0 -4
- package/es/react/SlashMenu/SlashMenu.js +0 -58
- package/es/react/SlashMenu/index.d.ts +0 -2
- package/es/react/SlashMenu/index.js +0 -2
- package/es/react/SlashMenu/type.d.ts +0 -13
- package/es/react/SlashMenu/type.js +0 -1
- package/es/react/hooks/useEditor.d.ts +0 -2
- package/es/react/hooks/useEditor.js +0 -7
- package/es/react/hooks/useEditorState/index.d.ts +0 -68
- package/es/react/hooks/useEditorState/index.js +0 -488
- package/es/react/hooks/useEditorState/utils.d.ts +0 -4
- package/es/react/hooks/useEditorState/utils.js +0 -36
- package/es/react/hooks/useSize.d.ts +0 -13
- package/es/react/hooks/useSize.js +0 -77
- package/es/react/index.d.ts +0 -12
- package/es/react/index.js +0 -12
- package/es/renderer/LexicalDiff.d.ts +0 -22
- package/es/renderer/LexicalDiff.js +0 -116
- package/es/renderer/LexicalRenderer.d.ts +0 -3
- package/es/renderer/LexicalRenderer.js +0 -61
- package/es/renderer/diff/compute.d.ts +0 -3
- package/es/renderer/diff/compute.js +0 -510
- package/es/renderer/diff/style.d.ts +0 -13
- package/es/renderer/diff/style.js +0 -20
- package/es/renderer/diff/types.d.ts +0 -28
- package/es/renderer/diff/types.js +0 -1
- package/es/renderer/engine/render-builtin-node.d.ts +0 -2
- package/es/renderer/engine/render-builtin-node.js +0 -211
- package/es/renderer/engine/render-text-node.d.ts +0 -2
- package/es/renderer/engine/render-text-node.js +0 -52
- package/es/renderer/engine/render-tree.d.ts +0 -6
- package/es/renderer/engine/render-tree.js +0 -47
- package/es/renderer/engine/shiki.d.ts +0 -3
- package/es/renderer/engine/shiki.js +0 -183
- package/es/renderer/engine/utils.d.ts +0 -2
- package/es/renderer/engine/utils.js +0 -27
- package/es/renderer/index.d.ts +0 -8
- package/es/renderer/index.js +0 -5
- package/es/renderer/nodes/index.d.ts +0 -2
- package/es/renderer/nodes/index.js +0 -17
- package/es/renderer/renderers/codeblock.d.ts +0 -2
- package/es/renderer/renderers/codeblock.js +0 -162
- package/es/renderer/renderers/file.d.ts +0 -2
- package/es/renderer/renderers/file.js +0 -30
- package/es/renderer/renderers/horizontalrule.d.ts +0 -2
- package/es/renderer/renderers/horizontalrule.js +0 -15
- package/es/renderer/renderers/image.d.ts +0 -3
- package/es/renderer/renderers/image.js +0 -40
- package/es/renderer/renderers/index.d.ts +0 -2
- package/es/renderer/renderers/index.js +0 -9
- package/es/renderer/renderers/math.d.ts +0 -2
- package/es/renderer/renderers/math.js +0 -18
- package/es/renderer/renderers/mention.d.ts +0 -2
- package/es/renderer/renderers/mention.js +0 -13
- package/es/renderer/renderers/mermaid.d.ts +0 -2
- package/es/renderer/renderers/mermaid.js +0 -18
- package/es/renderer/style.d.ts +0 -14
- package/es/renderer/style.js +0 -48
- package/es/renderer/types.d.ts +0 -25
- package/es/renderer/types.js +0 -1
- package/es/types/global.d.ts +0 -88
- package/es/types/hotkey.d.ts +0 -72
- package/es/types/hotkey.js +0 -72
- package/es/types/index.d.ts +0 -2
- package/es/types/index.js +0 -2
- package/es/types/kernel.d.ts +0 -334
- package/es/types/kernel.js +0 -1
- package/es/types/locale.d.ts +0 -10
- package/es/types/locale.js +0 -1
- package/es/utils/debug.d.ts +0 -429
- package/es/utils/debug.js +0 -321
- package/es/utils/hotkey/isHotkeyMatch.d.ts +0 -1
- package/es/utils/hotkey/isHotkeyMatch.js +0 -9
- package/es/utils/hotkey/parseHotkeys.d.ts +0 -6
- package/es/utils/hotkey/parseHotkeys.js +0 -42
- package/es/utils/hotkey/registerHotkey.d.ts +0 -15
- package/es/utils/hotkey/registerHotkey.js +0 -32
- package/es/utils/scrollIntoView.d.ts +0 -5
- package/es/utils/scrollIntoView.js +0 -45
- package/es/utils/updatePosition.d.ts +0 -9
- package/es/utils/updatePosition.js +0 -27
- package/es/utils/url.d.ts +0 -15
- package/es/utils/url.js +0 -51
- package/react.d.ts +0 -1
- package/react.js +0 -1
- package/renderer.d.ts +0 -1
- package/renderer.js +0 -1
- package/scripts/patch-lexical.js +0 -39
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
import { $computeTableMapSkipCellCheck, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $isTableCellNode, $isTableRowNode, TableNode, getDOMCellFromTarget, getTableElement } from '@lexical/table';
|
|
13
|
-
import { calculateZoomLevel, mergeRegister } from '@lexical/utils';
|
|
14
|
-
import { cssVar, cx } from 'antd-style';
|
|
15
|
-
import { $getNearestNodeFromDOMNode, SKIP_SCROLL_INTO_VIEW_TAG, isHTMLElement } from 'lexical';
|
|
16
|
-
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
17
|
-
import { createPortal } from 'react-dom';
|
|
18
|
-
import { MIN_COLUMN_WIDTH, MIN_ROW_HEIGHT, styles } from "./style";
|
|
19
|
-
import { getCellColumnIndex, getCellNodeHeight } from "./utils";
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
-
export var TableCellResize = /*#__PURE__*/memo(function (_ref) {
|
|
24
|
-
var editor = _ref.editor,
|
|
25
|
-
eventEmitter = _ref.eventEmitter;
|
|
26
|
-
var targetRef = useRef(null);
|
|
27
|
-
var resizerRef = useRef(null);
|
|
28
|
-
// eslint-disable-next-line no-undef
|
|
29
|
-
var tableRectRef = useRef(null);
|
|
30
|
-
var _useState = useState(false),
|
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
hasTable = _useState2[0],
|
|
33
|
-
setHasTable = _useState2[1];
|
|
34
|
-
var pointerStartPosRef = useRef(null);
|
|
35
|
-
var _useState3 = useState(null),
|
|
36
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
-
pointerCurrentPos = _useState4[0],
|
|
38
|
-
updatePointerCurrentPos = _useState4[1];
|
|
39
|
-
var _useState5 = useState(null),
|
|
40
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
|
-
activeCell = _useState6[0],
|
|
42
|
-
updateActiveCell = _useState6[1];
|
|
43
|
-
var _useState7 = useState(null),
|
|
44
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
-
draggingDirection = _useState8[0],
|
|
46
|
-
updateDraggingDirection = _useState8[1];
|
|
47
|
-
var resetState = useCallback(function () {
|
|
48
|
-
updateActiveCell(null);
|
|
49
|
-
targetRef.current = null;
|
|
50
|
-
updateDraggingDirection(null);
|
|
51
|
-
pointerStartPosRef.current = null;
|
|
52
|
-
tableRectRef.current = null;
|
|
53
|
-
}, []);
|
|
54
|
-
useEffect(function () {
|
|
55
|
-
var tableKeys = new Set();
|
|
56
|
-
return mergeRegister(editor.registerMutationListener(TableNode, function (nodeMutations) {
|
|
57
|
-
var _iterator = _createForOfIteratorHelper(nodeMutations),
|
|
58
|
-
_step;
|
|
59
|
-
try {
|
|
60
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
61
|
-
var _step$value = _slicedToArray(_step.value, 2),
|
|
62
|
-
nodeKey = _step$value[0],
|
|
63
|
-
mutation = _step$value[1];
|
|
64
|
-
if (mutation === 'destroyed') {
|
|
65
|
-
tableKeys.delete(nodeKey);
|
|
66
|
-
} else {
|
|
67
|
-
tableKeys.add(nodeKey);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} catch (err) {
|
|
71
|
-
_iterator.e(err);
|
|
72
|
-
} finally {
|
|
73
|
-
_iterator.f();
|
|
74
|
-
}
|
|
75
|
-
setHasTable(tableKeys.size > 0);
|
|
76
|
-
}), editor.registerNodeTransform(TableNode, function (tableNode) {
|
|
77
|
-
if (tableNode.getColWidths()) {
|
|
78
|
-
return tableNode;
|
|
79
|
-
}
|
|
80
|
-
var numColumns = tableNode.getColumnCount();
|
|
81
|
-
var columnWidth = MIN_COLUMN_WIDTH;
|
|
82
|
-
|
|
83
|
-
// eslint-disable-next-line unicorn/no-new-array
|
|
84
|
-
tableNode.setColWidths(new Array(numColumns).fill(columnWidth));
|
|
85
|
-
return tableNode;
|
|
86
|
-
}));
|
|
87
|
-
}, [editor]);
|
|
88
|
-
useEffect(function () {
|
|
89
|
-
if (!hasTable) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
var onPointerMove = function onPointerMove(event) {
|
|
93
|
-
var target = event.target;
|
|
94
|
-
if (!isHTMLElement(target)) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (draggingDirection) {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
event.stopPropagation();
|
|
100
|
-
updatePointerCurrentPos({
|
|
101
|
-
x: event.clientX,
|
|
102
|
-
y: event.clientY
|
|
103
|
-
});
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (resizerRef.current && resizerRef.current.contains(target)) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (targetRef.current !== target) {
|
|
110
|
-
targetRef.current = target;
|
|
111
|
-
var cell = getDOMCellFromTarget(target);
|
|
112
|
-
if (cell && activeCell !== cell) {
|
|
113
|
-
editor.getEditorState().read(function () {
|
|
114
|
-
var tableCellNode = $getNearestNodeFromDOMNode(cell.elem);
|
|
115
|
-
if (!tableCellNode) {
|
|
116
|
-
throw new Error('TableCellResizer: Table cell node not found.');
|
|
117
|
-
}
|
|
118
|
-
var tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
119
|
-
var tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
120
|
-
if (!tableElement) {
|
|
121
|
-
throw new Error('TableCellResizer: Table element not found.');
|
|
122
|
-
}
|
|
123
|
-
targetRef.current = target;
|
|
124
|
-
tableRectRef.current = tableElement.getBoundingClientRect();
|
|
125
|
-
updateActiveCell(cell);
|
|
126
|
-
}, {
|
|
127
|
-
editor: editor
|
|
128
|
-
});
|
|
129
|
-
} else if (!cell) {
|
|
130
|
-
resetState();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
var onPointerDown = function onPointerDown(event) {
|
|
135
|
-
var isTouchEvent = event.pointerType === 'touch';
|
|
136
|
-
if (isTouchEvent) {
|
|
137
|
-
onPointerMove(event);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
var resizerContainer = resizerRef.current;
|
|
141
|
-
resizerContainer === null || resizerContainer === void 0 || resizerContainer.addEventListener('pointermove', onPointerMove, {
|
|
142
|
-
capture: true
|
|
143
|
-
});
|
|
144
|
-
var removeRootListener = editor.registerRootListener(function (rootElement, prevRootElement) {
|
|
145
|
-
prevRootElement === null || prevRootElement === void 0 || prevRootElement.removeEventListener('pointermove', onPointerMove);
|
|
146
|
-
prevRootElement === null || prevRootElement === void 0 || prevRootElement.removeEventListener('pointerdown', onPointerDown);
|
|
147
|
-
rootElement === null || rootElement === void 0 || rootElement.addEventListener('pointermove', onPointerMove);
|
|
148
|
-
rootElement === null || rootElement === void 0 || rootElement.addEventListener('pointerdown', onPointerDown);
|
|
149
|
-
});
|
|
150
|
-
return function () {
|
|
151
|
-
removeRootListener();
|
|
152
|
-
resizerContainer === null || resizerContainer === void 0 || resizerContainer.removeEventListener('pointermove', onPointerMove);
|
|
153
|
-
};
|
|
154
|
-
}, [activeCell, draggingDirection, editor, resetState, hasTable]);
|
|
155
|
-
var isHeightChanging = function isHeightChanging(direction) {
|
|
156
|
-
if (direction === 'bottom') {
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
return false;
|
|
160
|
-
};
|
|
161
|
-
var updateRowHeight = useCallback(function (heightChange) {
|
|
162
|
-
if (!activeCell) {
|
|
163
|
-
throw new Error('TableCellResizer: Expected active cell.');
|
|
164
|
-
}
|
|
165
|
-
editor.update(function () {
|
|
166
|
-
var tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
167
|
-
if (!$isTableCellNode(tableCellNode)) {
|
|
168
|
-
throw new Error('TableCellResizer: Table cell node not found.');
|
|
169
|
-
}
|
|
170
|
-
var tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
171
|
-
var baseRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
172
|
-
var tableRows = tableNode.getChildren();
|
|
173
|
-
|
|
174
|
-
// Determine if this is a full row merge by checking colspan
|
|
175
|
-
var isFullRowMerge = tableCellNode.getColSpan() === tableNode.getColumnCount();
|
|
176
|
-
|
|
177
|
-
// For full row merges, apply to first row. For partial merges, apply to last row
|
|
178
|
-
var tableRowIndex = isFullRowMerge ? baseRowIndex : baseRowIndex + tableCellNode.getRowSpan() - 1;
|
|
179
|
-
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
180
|
-
throw new Error('Expected table cell to be inside of table row.');
|
|
181
|
-
}
|
|
182
|
-
var tableRow = tableRows[tableRowIndex];
|
|
183
|
-
if (!$isTableRowNode(tableRow)) {
|
|
184
|
-
throw new Error('Expected table row');
|
|
185
|
-
}
|
|
186
|
-
var height = tableRow.getHeight();
|
|
187
|
-
if (height === undefined) {
|
|
188
|
-
var rowCells = tableRow.getChildren();
|
|
189
|
-
height = Math.min.apply(Math, _toConsumableArray(rowCells.map(
|
|
190
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
191
|
-
function (cell) {
|
|
192
|
-
var _getCellNodeHeight;
|
|
193
|
-
return (_getCellNodeHeight = getCellNodeHeight(cell, editor)) !== null && _getCellNodeHeight !== void 0 ? _getCellNodeHeight : Infinity;
|
|
194
|
-
})));
|
|
195
|
-
}
|
|
196
|
-
var newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);
|
|
197
|
-
tableRow.setHeight(newHeight);
|
|
198
|
-
eventEmitter.emit('table:resize', {
|
|
199
|
-
heightChange: heightChange,
|
|
200
|
-
newHeight: newHeight
|
|
201
|
-
});
|
|
202
|
-
}, {
|
|
203
|
-
tag: SKIP_SCROLL_INTO_VIEW_TAG
|
|
204
|
-
});
|
|
205
|
-
}, [activeCell, editor]);
|
|
206
|
-
var updateColumnWidth = useCallback(function (widthChange) {
|
|
207
|
-
if (!activeCell) {
|
|
208
|
-
throw new Error('TableCellResizer: Expected active cell.');
|
|
209
|
-
}
|
|
210
|
-
editor.update(function () {
|
|
211
|
-
var tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
212
|
-
if (!$isTableCellNode(tableCellNode)) {
|
|
213
|
-
throw new Error('TableCellResizer: Table cell node not found.');
|
|
214
|
-
}
|
|
215
|
-
var tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
216
|
-
var _$computeTableMapSkip = $computeTableMapSkipCellCheck(tableNode, null, null),
|
|
217
|
-
_$computeTableMapSkip2 = _slicedToArray(_$computeTableMapSkip, 1),
|
|
218
|
-
tableMap = _$computeTableMapSkip2[0];
|
|
219
|
-
var columnIndex = getCellColumnIndex(tableCellNode, tableMap);
|
|
220
|
-
if (columnIndex === undefined) {
|
|
221
|
-
throw new Error('TableCellResizer: Table column not found.');
|
|
222
|
-
}
|
|
223
|
-
var colWidths = tableNode.getColWidths();
|
|
224
|
-
if (!colWidths) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
var width = colWidths[columnIndex];
|
|
228
|
-
if (width === undefined) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
var newColWidths = _toConsumableArray(colWidths);
|
|
232
|
-
var newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);
|
|
233
|
-
newColWidths[columnIndex] = newWidth;
|
|
234
|
-
tableNode.setColWidths(newColWidths);
|
|
235
|
-
requestAnimationFrame(function () {
|
|
236
|
-
eventEmitter.emit('table:resize', {
|
|
237
|
-
newColWidths: newColWidths
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
}, {
|
|
241
|
-
tag: SKIP_SCROLL_INTO_VIEW_TAG
|
|
242
|
-
});
|
|
243
|
-
}, [activeCell, editor]);
|
|
244
|
-
var pointerUpHandler = useCallback(function (direction) {
|
|
245
|
-
var handler = function handler(event) {
|
|
246
|
-
event.preventDefault();
|
|
247
|
-
event.stopPropagation();
|
|
248
|
-
if (!activeCell) {
|
|
249
|
-
throw new Error('TableCellResizer: Expected active cell.');
|
|
250
|
-
}
|
|
251
|
-
if (pointerStartPosRef.current) {
|
|
252
|
-
var _pointerStartPosRef$c = pointerStartPosRef.current,
|
|
253
|
-
x = _pointerStartPosRef$c.x,
|
|
254
|
-
y = _pointerStartPosRef$c.y;
|
|
255
|
-
if (activeCell === null) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
var zoom = calculateZoomLevel(event.target);
|
|
259
|
-
if (isHeightChanging(direction)) {
|
|
260
|
-
var heightChange = (event.clientY - y) / zoom;
|
|
261
|
-
updateRowHeight(heightChange);
|
|
262
|
-
} else {
|
|
263
|
-
var widthChange = (event.clientX - x) / zoom;
|
|
264
|
-
updateColumnWidth(widthChange);
|
|
265
|
-
}
|
|
266
|
-
resetState();
|
|
267
|
-
if (typeof document !== 'undefined') {
|
|
268
|
-
document.removeEventListener('pointerup', handler);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
return handler;
|
|
273
|
-
}, [activeCell, resetState, updateColumnWidth, updateRowHeight]);
|
|
274
|
-
var toggleResize = useCallback(function (direction) {
|
|
275
|
-
return function (event) {
|
|
276
|
-
event.preventDefault();
|
|
277
|
-
event.stopPropagation();
|
|
278
|
-
if (!activeCell) {
|
|
279
|
-
throw new Error('TableCellResizer: Expected active cell.');
|
|
280
|
-
}
|
|
281
|
-
pointerStartPosRef.current = {
|
|
282
|
-
x: event.clientX,
|
|
283
|
-
y: event.clientY
|
|
284
|
-
};
|
|
285
|
-
updatePointerCurrentPos(pointerStartPosRef.current);
|
|
286
|
-
updateDraggingDirection(direction);
|
|
287
|
-
if (typeof document !== 'undefined') {
|
|
288
|
-
document.addEventListener('pointerup', pointerUpHandler(direction));
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}, [activeCell, pointerUpHandler]);
|
|
292
|
-
var getResizers = useCallback(function () {
|
|
293
|
-
if (activeCell) {
|
|
294
|
-
var _activeCell$elem$getB = activeCell.elem.getBoundingClientRect(),
|
|
295
|
-
height = _activeCell$elem$getB.height,
|
|
296
|
-
width = _activeCell$elem$getB.width,
|
|
297
|
-
top = _activeCell$elem$getB.top,
|
|
298
|
-
left = _activeCell$elem$getB.left;
|
|
299
|
-
var zoom = calculateZoomLevel(activeCell.elem);
|
|
300
|
-
var zoneWidth = 16; // Pixel width of the zone where you can drag the edge
|
|
301
|
-
|
|
302
|
-
// Default to 0 for server side
|
|
303
|
-
var scrollX = typeof window !== 'undefined' ? window.scrollX : 0;
|
|
304
|
-
var scrollY = typeof window !== 'undefined' ? window.scrollY : 0;
|
|
305
|
-
var _styles = {
|
|
306
|
-
bottom: {
|
|
307
|
-
backgroundColor: 'none',
|
|
308
|
-
cursor: 'row-resize',
|
|
309
|
-
height: "".concat(zoneWidth, "px"),
|
|
310
|
-
left: "".concat(scrollX + left, "px"),
|
|
311
|
-
top: "".concat(scrollY + top + height - zoneWidth / 2, "px"),
|
|
312
|
-
width: "".concat(width, "px")
|
|
313
|
-
},
|
|
314
|
-
right: {
|
|
315
|
-
backgroundColor: 'none',
|
|
316
|
-
cursor: 'col-resize',
|
|
317
|
-
height: "".concat(height, "px"),
|
|
318
|
-
left: "".concat(scrollX + left + width - zoneWidth / 2, "px"),
|
|
319
|
-
top: "".concat(scrollY + top, "px"),
|
|
320
|
-
width: "".concat(zoneWidth, "px")
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
var tableRect = tableRectRef.current;
|
|
324
|
-
if (draggingDirection && pointerCurrentPos && tableRect) {
|
|
325
|
-
if (isHeightChanging(draggingDirection)) {
|
|
326
|
-
_styles[draggingDirection].left = "".concat(scrollX + tableRect.left, "px");
|
|
327
|
-
_styles[draggingDirection].top = "".concat(scrollY + pointerCurrentPos.y / zoom, "px");
|
|
328
|
-
_styles[draggingDirection].height = '3px';
|
|
329
|
-
_styles[draggingDirection].width = "".concat(tableRect.width, "px");
|
|
330
|
-
} else {
|
|
331
|
-
_styles[draggingDirection].top = "".concat(scrollY + tableRect.top, "px");
|
|
332
|
-
_styles[draggingDirection].left = "".concat(scrollX + pointerCurrentPos.x / zoom, "px");
|
|
333
|
-
_styles[draggingDirection].width = '3px';
|
|
334
|
-
_styles[draggingDirection].height = "".concat(tableRect.height, "px");
|
|
335
|
-
}
|
|
336
|
-
_styles[draggingDirection].backgroundColor = cssVar.colorPrimary;
|
|
337
|
-
_styles[draggingDirection].mixBlendMode = 'unset';
|
|
338
|
-
}
|
|
339
|
-
return _styles;
|
|
340
|
-
}
|
|
341
|
-
return {
|
|
342
|
-
bottom: null,
|
|
343
|
-
left: null,
|
|
344
|
-
right: null,
|
|
345
|
-
top: null
|
|
346
|
-
};
|
|
347
|
-
}, [activeCell, draggingDirection, pointerCurrentPos]);
|
|
348
|
-
var resizerStyles = getResizers();
|
|
349
|
-
return /*#__PURE__*/_jsx("div", {
|
|
350
|
-
ref: resizerRef,
|
|
351
|
-
children: activeCell && /*#__PURE__*/_jsxs(_Fragment, {
|
|
352
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
353
|
-
className: cx(styles, 'TableCellResizer__resizer', 'TableCellResizer__ui'),
|
|
354
|
-
onPointerDown: toggleResize('right'),
|
|
355
|
-
style: resizerStyles.right || undefined
|
|
356
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
357
|
-
className: cx(styles, 'TableCellResizer__resizer', 'TableCellResizer__ui'),
|
|
358
|
-
onPointerDown: toggleResize('bottom'),
|
|
359
|
-
style: resizerStyles.bottom || undefined
|
|
360
|
-
})]
|
|
361
|
-
})
|
|
362
|
-
});
|
|
363
|
-
});
|
|
364
|
-
export default /*#__PURE__*/memo(function (_ref2) {
|
|
365
|
-
var editor = _ref2.editor,
|
|
366
|
-
eventEmitter = _ref2.eventEmitter;
|
|
367
|
-
// Don't render portal on server side
|
|
368
|
-
if (typeof document === 'undefined') {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// Mount to .ant-app if exists, otherwise document.body
|
|
373
|
-
var container = document.querySelector('.ant-app') || document.body;
|
|
374
|
-
return /*#__PURE__*/createPortal( /*#__PURE__*/_jsx(TableCellResize, {
|
|
375
|
-
editor: editor,
|
|
376
|
-
eventEmitter: eventEmitter
|
|
377
|
-
}), container);
|
|
378
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import { createStaticStyles } from 'antd-style';
|
|
4
|
-
export var MIN_ROW_HEIGHT = 33;
|
|
5
|
-
export var MIN_COLUMN_WIDTH = 92;
|
|
6
|
-
export var styles = createStaticStyles(function (_ref) {
|
|
7
|
-
var css = _ref.css,
|
|
8
|
-
cssVar = _ref.cssVar;
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n touch-action: none;\n position: absolute;\n z-index: 1;\n\n @media (pointer: coarse) {\n background-color: ", ";\n mix-blend-mode: color;\n }\n "])), cssVar.colorPrimary);
|
|
10
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TableCellNode, TableMapType } from '@lexical/table';
|
|
2
|
-
import { LexicalEditor } from 'lexical';
|
|
3
|
-
export declare const getCellColumnIndex: (tableCellNode: TableCellNode, tableMap: TableMapType) => number | undefined;
|
|
4
|
-
export declare const getCellNodeHeight: (cell: TableCellNode, activeEditor: LexicalEditor) => number | undefined;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
4
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
export var getCellColumnIndex = function getCellColumnIndex(tableCellNode, tableMap) {
|
|
9
|
-
var _iterator = _createForOfIteratorHelper(tableMap),
|
|
10
|
-
_step;
|
|
11
|
-
try {
|
|
12
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
13
|
-
var element = _step.value;
|
|
14
|
-
var _iterator2 = _createForOfIteratorHelper(element.entries()),
|
|
15
|
-
_step2;
|
|
16
|
-
try {
|
|
17
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
18
|
-
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
19
|
-
column = _step2$value[0],
|
|
20
|
-
element_ = _step2$value[1];
|
|
21
|
-
if (element_.cell === tableCellNode) {
|
|
22
|
-
return column;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
} catch (err) {
|
|
26
|
-
_iterator2.e(err);
|
|
27
|
-
} finally {
|
|
28
|
-
_iterator2.f();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
} catch (err) {
|
|
32
|
-
_iterator.e(err);
|
|
33
|
-
} finally {
|
|
34
|
-
_iterator.f();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export var getCellNodeHeight = function getCellNodeHeight(cell, activeEditor) {
|
|
38
|
-
var domCellNode = activeEditor.getElementByKey(cell.getKey());
|
|
39
|
-
return domCellNode === null || domCellNode === void 0 ? void 0 : domCellNode.clientHeight;
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useDebounce<T extends (...args: never[]) => void>(fn: T, ms: number, maxWait?: number): import("es-toolkit/compat").DebouncedFunc<(...args: Parameters<T>) => void>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
import { debounce } from 'es-toolkit/compat';
|
|
9
|
-
import { useMemo, useRef } from 'react';
|
|
10
|
-
export function useDebounce(fn, ms, maxWait) {
|
|
11
|
-
var funcRef = useRef(null);
|
|
12
|
-
funcRef.current = fn;
|
|
13
|
-
return useMemo(function () {
|
|
14
|
-
return debounce(function () {
|
|
15
|
-
if (funcRef.current) {
|
|
16
|
-
funcRef.current.apply(funcRef, arguments);
|
|
17
|
-
}
|
|
18
|
-
}, ms, {
|
|
19
|
-
maxWait: maxWait
|
|
20
|
-
});
|
|
21
|
-
}, [ms, maxWait]);
|
|
22
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
-
import { $findTableNode, $getElementForTableNode, $isTableSelection } from '@lexical/table';
|
|
10
|
-
import { cx } from 'antd-style';
|
|
11
|
-
import EventEmitter from 'eventemitter3';
|
|
12
|
-
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
13
|
-
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
14
|
-
import { useLexicalEditor } from "../../../editor-kernel/react";
|
|
15
|
-
import PortalAnchor from "../../../editor-kernel/react/PortalAnchor";
|
|
16
|
-
import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context";
|
|
17
|
-
import { TablePlugin } from "../plugin";
|
|
18
|
-
import { $updateDOMForSelection } from "../utils";
|
|
19
|
-
import TableActionMenuPlugin from "./TableActionMenu";
|
|
20
|
-
import TableHoverActionsPlugin from "./TableHoverActions";
|
|
21
|
-
import TableCellResizePlugin from "./TableResize";
|
|
22
|
-
import { styles } from "./style";
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
-
export var ReactTablePlugin = function ReactTablePlugin(_ref) {
|
|
27
|
-
var className = _ref.className,
|
|
28
|
-
locale = _ref.locale;
|
|
29
|
-
var _useLexicalComposerCo = useLexicalComposerContext(),
|
|
30
|
-
_useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
|
|
31
|
-
editor = _useLexicalComposerCo2[0];
|
|
32
|
-
var _useState = useState(null),
|
|
33
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
-
lexicalEditor = _useState2[0],
|
|
35
|
-
setLexicalEditor = _useState2[1];
|
|
36
|
-
var eventEmitter = useMemo(function () {
|
|
37
|
-
return new EventEmitter();
|
|
38
|
-
}, []);
|
|
39
|
-
useLayoutEffect(function () {
|
|
40
|
-
if (locale) {
|
|
41
|
-
editor.registerLocale(locale);
|
|
42
|
-
}
|
|
43
|
-
editor.registerPlugin(TablePlugin, {
|
|
44
|
-
theme: cx(styles, className)
|
|
45
|
-
});
|
|
46
|
-
}, []);
|
|
47
|
-
useLexicalEditor(function (editor) {
|
|
48
|
-
setLexicalEditor(editor);
|
|
49
|
-
editor.registerUpdateListener(function () {
|
|
50
|
-
editor.read(function () {
|
|
51
|
-
var selection = $getSelection();
|
|
52
|
-
if (!$isTableSelection(selection) && !$isRangeSelection(selection)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
var tableNode = $findTableNode(selection.anchor.getNode());
|
|
56
|
-
if (!tableNode) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
$updateDOMForSelection(editor, $getElementForTableNode(editor, tableNode), selection);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
return function () {
|
|
63
|
-
setLexicalEditor(null);
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
return lexicalEditor && /*#__PURE__*/_jsxs(_Fragment, {
|
|
67
|
-
children: [/*#__PURE__*/_jsx(TableCellResizePlugin, {
|
|
68
|
-
editor: lexicalEditor,
|
|
69
|
-
eventEmitter: eventEmitter
|
|
70
|
-
}), /*#__PURE__*/_jsxs(PortalAnchor, {
|
|
71
|
-
children: [/*#__PURE__*/_jsx(TableActionMenuPlugin, {
|
|
72
|
-
editor: lexicalEditor
|
|
73
|
-
}), /*#__PURE__*/_jsx(TableHoverActionsPlugin, {
|
|
74
|
-
editor: lexicalEditor
|
|
75
|
-
})]
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const styles: string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import { createStaticStyles } from 'antd-style';
|
|
4
|
-
export var styles = createStaticStyles(function (_ref) {
|
|
5
|
-
var css = _ref.css,
|
|
6
|
-
cssVar = _ref.cssVar;
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: auto;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em)\n calc(var(--lobe-markdown-margin-multiple) * 0.5em + 16px);\n\n .editor_table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n\n width: fit-content;\n\n text-align: start;\n text-indent: initial;\n text-wrap: pretty;\n word-break: auto-phrase;\n overflow-wrap: break-word;\n\n background: ", ";\n\n > tr:first-of-type {\n background: ", ";\n\n .editor_table_cell_header {\n font-weight: bold;\n }\n }\n }\n\n code {\n word-break: break-word;\n }\n\n .editor_table_cell_header {\n font-weight: normal;\n }\n\n .editor_table_cell {\n position: relative;\n\n overflow: auto;\n\n width: 75px;\n padding-block: 6px;\n padding-inline: 8px;\n border: 1px solid ", ";\n\n text-align: start;\n vertical-align: top;\n\n outline: none;\n }\n\n .editor_table_cell_selected {\n color: #000;\n background-color: ", ";\n caret-color: transparent;\n }\n "])), cssVar.colorFillQuaternary, cssVar.colorFillQuaternary, cssVar.colorFillSecondary, cssVar.yellow);
|
|
8
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TableDOMCell, TableSelection } from '@lexical/table';
|
|
2
|
-
import { TableDOMTable } from '@lexical/table/LexicalTableObserver';
|
|
3
|
-
import { LexicalEditor, LexicalNode, RangeSelection } from 'lexical';
|
|
4
|
-
export declare function $forEachTableCell(grid: TableDOMTable, cb: (cell: TableDOMCell, lexicalNode: LexicalNode, cords: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}) => void): void;
|
|
8
|
-
export declare function $updateDOMForSelection(editor: LexicalEditor, table: TableDOMTable, selection: TableSelection | RangeSelection | null): void;
|