@lobehub/editor 1.0.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/LICENSE +21 -0
- package/README.md +635 -0
- package/es/common/canUseDOM.d.ts +8 -0
- package/es/common/canUseDOM.js +9 -0
- package/es/common/sys.d.ts +17 -0
- package/es/common/sys.js +30 -0
- package/es/editor-kernel/data-source.d.ts +8 -0
- package/es/editor-kernel/data-source.js +30 -0
- package/es/editor-kernel/event.d.ts +3 -0
- package/es/editor-kernel/event.js +11 -0
- package/es/editor-kernel/index.d.ts +11 -0
- package/es/editor-kernel/index.js +14 -0
- package/es/editor-kernel/inode/helper.d.ts +11 -0
- package/es/editor-kernel/inode/helper.js +48 -0
- package/es/editor-kernel/inode/i-element-node.d.ts +5 -0
- package/es/editor-kernel/inode/i-element-node.js +1 -0
- package/es/editor-kernel/inode/i-node.d.ts +6 -0
- package/es/editor-kernel/inode/i-node.js +1 -0
- package/es/editor-kernel/inode/index.d.ts +5 -0
- package/es/editor-kernel/inode/index.js +5 -0
- package/es/editor-kernel/inode/paragraph-node.d.ts +6 -0
- package/es/editor-kernel/inode/paragraph-node.js +1 -0
- package/es/editor-kernel/inode/root-node.d.ts +7 -0
- package/es/editor-kernel/inode/root-node.js +1 -0
- package/es/editor-kernel/inode/text-node.d.ts +12 -0
- package/es/editor-kernel/inode/text-node.js +1 -0
- package/es/editor-kernel/kernel.d.ts +46 -0
- package/es/editor-kernel/kernel.js +273 -0
- package/es/editor-kernel/plugin.d.ts +7 -0
- package/es/editor-kernel/plugin.js +54 -0
- package/es/editor-kernel/react/LexicalErrorBoundary.d.ts +13 -0
- package/es/editor-kernel/react/LexicalErrorBoundary.js +26 -0
- package/es/editor-kernel/react/index.d.ts +5 -0
- package/es/editor-kernel/react/index.js +5 -0
- package/es/editor-kernel/react/react-context.d.ts +10 -0
- package/es/editor-kernel/react/react-context.js +25 -0
- package/es/editor-kernel/react/react-editor.d.ts +12 -0
- package/es/editor-kernel/react/react-editor.js +57 -0
- package/es/editor-kernel/react/useDecorators.d.ts +9 -0
- package/es/editor-kernel/react/useDecorators.js +69 -0
- package/es/editor-kernel/react/useLexicalEditor.d.ts +2 -0
- package/es/editor-kernel/react/useLexicalEditor.js +31 -0
- package/es/editor-kernel/react/useLexicalNodeSelection.d.ts +17 -0
- package/es/editor-kernel/react/useLexicalNodeSelection.js +99 -0
- package/es/editor-kernel/react/useToolbarState.d.ts +31 -0
- package/es/editor-kernel/react/useToolbarState.js +302 -0
- package/es/editor-kernel/react/useTranslation.d.ts +3 -0
- package/es/editor-kernel/react/useTranslation.js +19 -0
- package/es/editor-kernel/types.d.ts +189 -0
- package/es/editor-kernel/types.js +1 -0
- package/es/editor-kernel/utils.d.ts +25 -0
- package/es/editor-kernel/utils.js +69 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +14 -0
- package/es/locale/index.d.ts +25 -0
- package/es/locale/index.js +24 -0
- package/es/plugins/codeblock/command/index.d.ts +20 -0
- package/es/plugins/codeblock/command/index.js +84 -0
- package/es/plugins/codeblock/index.d.ts +4 -0
- package/es/plugins/codeblock/index.js +4 -0
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.d.ts +24 -0
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.js +680 -0
- package/es/plugins/codeblock/plugin/FacadeShiki.d.ts +51 -0
- package/es/plugins/codeblock/plugin/FacadeShiki.js +348 -0
- package/es/plugins/codeblock/plugin/index.d.ts +18 -0
- package/es/plugins/codeblock/plugin/index.js +90 -0
- package/es/plugins/codeblock/plugin/invariant.d.ts +8 -0
- package/es/plugins/codeblock/plugin/invariant.js +17 -0
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.d.ts +4 -0
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +51 -0
- package/es/plugins/codeblock/react/index.d.ts +2 -0
- package/es/plugins/codeblock/react/index.js +1 -0
- package/es/plugins/codeblock/react/style.d.ts +6 -0
- package/es/plugins/codeblock/react/style.js +38 -0
- package/es/plugins/codeblock/react/type.d.ts +5 -0
- package/es/plugins/codeblock/react/type.js +1 -0
- package/es/plugins/codeblock/utils/language.d.ts +1 -0
- package/es/plugins/codeblock/utils/language.js +12 -0
- package/es/plugins/common/command/index.d.ts +7 -0
- package/es/plugins/common/command/index.js +31 -0
- package/es/plugins/common/data-source/json-data-source.d.ts +7 -0
- package/es/plugins/common/data-source/json-data-source.js +39 -0
- package/es/plugins/common/data-source/text-data-source.d.ts +6 -0
- package/es/plugins/common/data-source/text-data-source.js +54 -0
- package/es/plugins/common/index.d.ts +3 -0
- package/es/plugins/common/index.js +3 -0
- package/es/plugins/common/node/ElementDOMSlot.d.ts +5 -0
- package/es/plugins/common/node/ElementDOMSlot.js +59 -0
- package/es/plugins/common/node/LexicalLineBreakNode.d.ts +31 -0
- package/es/plugins/common/node/LexicalLineBreakNode.js +140 -0
- package/es/plugins/common/node/ParagraphNode.d.ts +7 -0
- package/es/plugins/common/node/ParagraphNode.js +47 -0
- package/es/plugins/common/plugin/index.d.ts +16 -0
- package/es/plugins/common/plugin/index.js +245 -0
- package/es/plugins/common/plugin/register.d.ts +4 -0
- package/es/plugins/common/plugin/register.js +230 -0
- package/es/plugins/common/react/Placeholder/index.d.ts +7 -0
- package/es/plugins/common/react/Placeholder/index.js +53 -0
- package/es/plugins/common/react/Placeholder/style.d.ts +4 -0
- package/es/plugins/common/react/Placeholder/style.js +12 -0
- package/es/plugins/common/react/ReactEditorContent.d.ts +4 -0
- package/es/plugins/common/react/ReactEditorContent.js +7 -0
- package/es/plugins/common/react/ReactPlainText.d.ts +4 -0
- package/es/plugins/common/react/ReactPlainText.js +100 -0
- package/es/plugins/common/react/index.d.ts +3 -0
- package/es/plugins/common/react/index.js +3 -0
- package/es/plugins/common/react/style.d.ts +18 -0
- package/es/plugins/common/react/style.js +38 -0
- package/es/plugins/common/react/type.d.ts +21 -0
- package/es/plugins/common/react/type.js +1 -0
- package/es/plugins/common/utils/index.d.ts +28 -0
- package/es/plugins/common/utils/index.js +96 -0
- package/es/plugins/file/command/index.d.ts +7 -0
- package/es/plugins/file/command/index.js +28 -0
- package/es/plugins/file/index.d.ts +3 -0
- package/es/plugins/file/index.js +3 -0
- package/es/plugins/file/node/FileNode.d.ts +36 -0
- package/es/plugins/file/node/FileNode.js +177 -0
- package/es/plugins/file/plugin/index.d.ts +14 -0
- package/es/plugins/file/plugin/index.js +116 -0
- package/es/plugins/file/react/ReactFilePlugin.d.ts +4 -0
- package/es/plugins/file/react/ReactFilePlugin.js +74 -0
- package/es/plugins/file/react/components/ReactFile.d.ts +10 -0
- package/es/plugins/file/react/components/ReactFile.js +65 -0
- package/es/plugins/file/react/index.d.ts +2 -0
- package/es/plugins/file/react/index.js +1 -0
- package/es/plugins/file/react/style.d.ts +3 -0
- package/es/plugins/file/react/style.js +11 -0
- package/es/plugins/file/react/type.d.ts +13 -0
- package/es/plugins/file/react/type.js +1 -0
- package/es/plugins/file/utils/index.d.ts +2 -0
- package/es/plugins/file/utils/index.js +45 -0
- package/es/plugins/hr/command/index.d.ts +3 -0
- package/es/plugins/hr/command/index.js +13 -0
- package/es/plugins/hr/index.d.ts +3 -0
- package/es/plugins/hr/index.js +3 -0
- package/es/plugins/hr/node/HorizontalRuleNode.d.ts +16 -0
- package/es/plugins/hr/node/HorizontalRuleNode.js +100 -0
- package/es/plugins/hr/plugin/index.d.ts +8 -0
- package/es/plugins/hr/plugin/index.js +70 -0
- package/es/plugins/hr/react/ReactHRPlugin.d.ts +4 -0
- package/es/plugins/hr/react/ReactHRPlugin.js +36 -0
- package/es/plugins/hr/react/components/HRNode.d.ts +10 -0
- package/es/plugins/hr/react/components/HRNode.js +45 -0
- package/es/plugins/hr/react/index.d.ts +2 -0
- package/es/plugins/hr/react/index.js +1 -0
- package/es/plugins/hr/react/style.d.ts +1 -0
- package/es/plugins/hr/react/style.js +8 -0
- package/es/plugins/hr/react/type.d.ts +3 -0
- package/es/plugins/hr/react/type.js +1 -0
- package/es/plugins/image/command/index.d.ts +8 -0
- package/es/plugins/image/command/index.js +46 -0
- package/es/plugins/image/index.d.ts +3 -0
- package/es/plugins/image/index.js +3 -0
- package/es/plugins/image/node/basie-image-node.d.ts +44 -0
- package/es/plugins/image/node/basie-image-node.js +151 -0
- package/es/plugins/image/node/image-node.d.ts +26 -0
- package/es/plugins/image/node/image-node.js +176 -0
- package/es/plugins/image/plugin/index.d.ts +13 -0
- package/es/plugins/image/plugin/index.js +74 -0
- package/es/plugins/image/react/ReactImagePlugin.d.ts +4 -0
- package/es/plugins/image/react/ReactImagePlugin.js +48 -0
- package/es/plugins/image/react/components/BrokenImage.d.ts +3 -0
- package/es/plugins/image/react/components/BrokenImage.js +18 -0
- package/es/plugins/image/react/components/Image.d.ts +7 -0
- package/es/plugins/image/react/components/Image.js +71 -0
- package/es/plugins/image/react/components/LazyImage.d.ts +8 -0
- package/es/plugins/image/react/components/LazyImage.js +99 -0
- package/es/plugins/image/react/components/useSupenseImage.d.ts +2 -0
- package/es/plugins/image/react/components/useSupenseImage.js +24 -0
- package/es/plugins/image/react/index.d.ts +2 -0
- package/es/plugins/image/react/index.js +1 -0
- package/es/plugins/image/react/style.d.ts +12 -0
- package/es/plugins/image/react/style.js +17 -0
- package/es/plugins/image/react/type.d.ts +6 -0
- package/es/plugins/image/react/type.js +1 -0
- package/es/plugins/link/command/index.d.ts +6 -0
- package/es/plugins/link/command/index.js +20 -0
- package/es/plugins/link/index.d.ts +3 -0
- package/es/plugins/link/index.js +3 -0
- package/es/plugins/link/node/LinkNode.d.ts +126 -0
- package/es/plugins/link/node/LinkNode.js +721 -0
- package/es/plugins/link/plugin/index.d.ts +8 -0
- package/es/plugins/link/plugin/index.js +94 -0
- package/es/plugins/link/react/ReactLinkPlugin.d.ts +4 -0
- package/es/plugins/link/react/ReactLinkPlugin.js +168 -0
- package/es/plugins/link/react/components/LinkEdit.d.ts +7 -0
- package/es/plugins/link/react/components/LinkEdit.js +138 -0
- package/es/plugins/link/react/components/Toolbar.d.ts +7 -0
- package/es/plugins/link/react/components/Toolbar.js +63 -0
- package/es/plugins/link/react/index.d.ts +2 -0
- package/es/plugins/link/react/index.js +1 -0
- package/es/plugins/link/react/style.d.ts +5 -0
- package/es/plugins/link/react/style.js +12 -0
- package/es/plugins/link/react/type.d.ts +9 -0
- package/es/plugins/link/react/type.js +1 -0
- package/es/plugins/link/utils/index.d.ts +4 -0
- package/es/plugins/link/utils/index.js +37 -0
- package/es/plugins/list/command/index.d.ts +1 -0
- package/es/plugins/list/command/index.js +1 -0
- package/es/plugins/list/index.d.ts +3 -0
- package/es/plugins/list/index.js +3 -0
- package/es/plugins/list/plugin/index.d.ts +5 -0
- package/es/plugins/list/plugin/index.js +193 -0
- package/es/plugins/list/react/ReactListPlugin.d.ts +4 -0
- package/es/plugins/list/react/ReactListPlugin.js +29 -0
- package/es/plugins/list/react/index.d.ts +2 -0
- package/es/plugins/list/react/index.js +1 -0
- package/es/plugins/list/react/style.d.ts +1 -0
- package/es/plugins/list/react/style.js +7 -0
- package/es/plugins/list/react/type.d.ts +3 -0
- package/es/plugins/list/react/type.js +1 -0
- package/es/plugins/list/utils/index.d.ts +5 -0
- package/es/plugins/list/utils/index.js +88 -0
- package/es/plugins/markdown/data-source/markdown-data-source.d.ts +10 -0
- package/es/plugins/markdown/data-source/markdown-data-source.js +64 -0
- package/es/plugins/markdown/data-source/markdown-writer-context.d.ts +12 -0
- package/es/plugins/markdown/data-source/markdown-writer-context.js +51 -0
- package/es/plugins/markdown/index.d.ts +2 -0
- package/es/plugins/markdown/index.js +2 -0
- package/es/plugins/markdown/plugin/index.d.ts +4 -0
- package/es/plugins/markdown/plugin/index.js +122 -0
- package/es/plugins/markdown/service/shortcut.d.ts +139 -0
- package/es/plugins/markdown/service/shortcut.js +401 -0
- package/es/plugins/markdown/utils/index.d.ts +12 -0
- package/es/plugins/markdown/utils/index.js +61 -0
- package/es/plugins/mention/command/index.d.ts +6 -0
- package/es/plugins/mention/command/index.js +19 -0
- package/es/plugins/mention/index.d.ts +3 -0
- package/es/plugins/mention/index.js +3 -0
- package/es/plugins/mention/node/MentionNode.d.ts +26 -0
- package/es/plugins/mention/node/MentionNode.js +143 -0
- package/es/plugins/mention/plugin/index.d.ts +11 -0
- package/es/plugins/mention/plugin/index.js +61 -0
- package/es/plugins/mention/plugin/register.d.ts +2 -0
- package/es/plugins/mention/plugin/register.js +46 -0
- package/es/plugins/mention/react/ReactMentionPlugin.d.ts +4 -0
- package/es/plugins/mention/react/ReactMentionPlugin.js +42 -0
- package/es/plugins/mention/react/components/Mention.d.ts +9 -0
- package/es/plugins/mention/react/components/Mention.js +39 -0
- package/es/plugins/mention/react/index.d.ts +2 -0
- package/es/plugins/mention/react/index.js +1 -0
- package/es/plugins/mention/react/style.d.ts +3 -0
- package/es/plugins/mention/react/style.js +11 -0
- package/es/plugins/mention/react/type.d.ts +8 -0
- package/es/plugins/mention/react/type.js +1 -0
- package/es/plugins/slash/index.d.ts +3 -0
- package/es/plugins/slash/index.js +3 -0
- package/es/plugins/slash/plugin/index.d.ts +23 -0
- package/es/plugins/slash/plugin/index.js +132 -0
- package/es/plugins/slash/react/ReactSlashOption.d.ts +4 -0
- package/es/plugins/slash/react/ReactSlashOption.js +7 -0
- package/es/plugins/slash/react/ReactSlashPlugin.d.ts +4 -0
- package/es/plugins/slash/react/ReactSlashPlugin.js +228 -0
- package/es/plugins/slash/react/components/SlashMenu.d.ts +8 -0
- package/es/plugins/slash/react/components/SlashMenu.js +72 -0
- package/es/plugins/slash/react/index.d.ts +4 -0
- package/es/plugins/slash/react/index.js +3 -0
- package/es/plugins/slash/react/style.d.ts +1 -0
- package/es/plugins/slash/react/style.js +9 -0
- package/es/plugins/slash/react/type.d.ts +82 -0
- package/es/plugins/slash/react/type.js +1 -0
- package/es/plugins/slash/react/utils.d.ts +5 -0
- package/es/plugins/slash/react/utils.js +20 -0
- package/es/plugins/slash/service/i-slash-service.d.ts +38 -0
- package/es/plugins/slash/service/i-slash-service.js +64 -0
- package/es/plugins/slash/utils/utils.d.ts +38 -0
- package/es/plugins/slash/utils/utils.js +192 -0
- package/es/plugins/table/command/index.d.ts +13 -0
- package/es/plugins/table/command/index.js +73 -0
- package/es/plugins/table/index.d.ts +3 -0
- package/es/plugins/table/index.js +3 -0
- package/es/plugins/table/node/index.d.ts +2 -0
- package/es/plugins/table/node/index.js +16 -0
- package/es/plugins/table/plugin/index.d.ts +5 -0
- package/es/plugins/table/plugin/index.js +85 -0
- package/es/plugins/table/react/TableActionMenu/index.d.ts +8 -0
- package/es/plugins/table/react/TableActionMenu/index.js +481 -0
- package/es/plugins/table/react/TableActionMenu/style.d.ts +1 -0
- package/es/plugins/table/react/TableActionMenu/style.js +7 -0
- package/es/plugins/table/react/TableActionMenu/utils.d.ts +9 -0
- package/es/plugins/table/react/TableActionMenu/utils.js +49 -0
- package/es/plugins/table/react/TableHoverActions/index.d.ts +7 -0
- package/es/plugins/table/react/TableHoverActions/index.js +268 -0
- package/es/plugins/table/react/TableHoverActions/style.d.ts +5 -0
- package/es/plugins/table/react/TableHoverActions/style.js +11 -0
- package/es/plugins/table/react/TableHoverActions/utils.d.ts +8 -0
- package/es/plugins/table/react/TableHoverActions/utils.js +43 -0
- package/es/plugins/table/react/TableResize/index.d.ts +10 -0
- package/es/plugins/table/react/TableResize/index.js +378 -0
- package/es/plugins/table/react/TableResize/style.d.ts +3 -0
- package/es/plugins/table/react/TableResize/style.js +10 -0
- package/es/plugins/table/react/TableResize/utils.d.ts +4 -0
- package/es/plugins/table/react/TableResize/utils.js +40 -0
- package/es/plugins/table/react/hooks.d.ts +1 -0
- package/es/plugins/table/react/hooks.js +22 -0
- package/es/plugins/table/react/index.d.ts +3 -0
- package/es/plugins/table/react/index.js +77 -0
- package/es/plugins/table/react/style.d.ts +1 -0
- package/es/plugins/table/react/style.js +8 -0
- package/es/plugins/table/react/type.d.ts +5 -0
- package/es/plugins/table/react/type.js +1 -0
- package/es/plugins/table/utils/index.d.ts +8 -0
- package/es/plugins/table/utils/index.js +83 -0
- package/es/plugins/upload/index.d.ts +3 -0
- package/es/plugins/upload/index.js +3 -0
- package/es/plugins/upload/plugin/index.d.ts +4 -0
- package/es/plugins/upload/plugin/index.js +82 -0
- package/es/plugins/upload/service/i-upload-service.d.ts +15 -0
- package/es/plugins/upload/service/i-upload-service.js +115 -0
- package/es/plugins/upload/utils/index.d.ts +1 -0
- package/es/plugins/upload/utils/index.js +20 -0
- package/es/react/ChatInput/ChatInput.d.ts +4 -0
- package/es/react/ChatInput/ChatInput.js +41 -0
- package/es/react/ChatInput/index.d.ts +2 -0
- package/es/react/ChatInput/index.js +2 -0
- package/es/react/ChatInput/style.d.ts +4 -0
- package/es/react/ChatInput/style.js +11 -0
- package/es/react/ChatInput/type.d.ts +10 -0
- package/es/react/ChatInput/type.js +1 -0
- package/es/react/ChatInputActionBar/ChatInputActionBar.d.ts +4 -0
- package/es/react/ChatInputActionBar/ChatInputActionBar.js +27 -0
- package/es/react/ChatInputActionBar/index.d.ts +2 -0
- package/es/react/ChatInputActionBar/index.js +2 -0
- package/es/react/ChatInputActionBar/style.d.ts +3 -0
- package/es/react/ChatInputActionBar/style.js +9 -0
- package/es/react/ChatInputActionBar/type.d.ts +7 -0
- package/es/react/ChatInputActionBar/type.js +1 -0
- package/es/react/ChatInputActions/ChatInputActions.d.ts +4 -0
- package/es/react/ChatInputActions/ChatInputActions.js +187 -0
- package/es/react/ChatInputActions/components/ChatInputActionsCollapse.d.ts +4 -0
- package/es/react/ChatInputActions/components/ChatInputActionsCollapse.js +97 -0
- package/es/react/ChatInputActions/index.d.ts +2 -0
- package/es/react/ChatInputActions/index.js +1 -0
- package/es/react/ChatInputActions/style.d.ts +4 -0
- package/es/react/ChatInputActions/style.js +10 -0
- package/es/react/ChatInputActions/type.d.ts +38 -0
- package/es/react/ChatInputActions/type.js +1 -0
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +4 -0
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +96 -0
- package/es/react/CodeLanguageSelect/index.d.ts +2 -0
- package/es/react/CodeLanguageSelect/index.js +2 -0
- package/es/react/CodeLanguageSelect/style.d.ts +3 -0
- package/es/react/CodeLanguageSelect/style.js +9 -0
- package/es/react/CodeLanguageSelect/type.d.ts +2 -0
- package/es/react/CodeLanguageSelect/type.js +1 -0
- package/es/react/Editor/Editor.d.ts +4 -0
- package/es/react/Editor/Editor.js +78 -0
- package/es/react/Editor/index.d.ts +14 -0
- package/es/react/Editor/index.js +10 -0
- package/es/react/Editor/type.d.ts +24 -0
- package/es/react/Editor/type.js +1 -0
- package/es/react/Editor/useEditor.d.ts +3 -0
- package/es/react/Editor/useEditor.js +4 -0
- package/es/react/Editor/utils.d.ts +2 -0
- package/es/react/Editor/utils.js +3 -0
- package/es/react/EditorProvider/index.d.ts +20 -0
- package/es/react/EditorProvider/index.js +25 -0
- package/es/react/SendButton/SendButton.d.ts +4 -0
- package/es/react/SendButton/SendButton.js +77 -0
- package/es/react/SendButton/components/SendIcon.d.ts +6 -0
- package/es/react/SendButton/components/SendIcon.js +32 -0
- package/es/react/SendButton/components/StopIcon.d.ts +6 -0
- package/es/react/SendButton/components/StopIcon.js +61 -0
- package/es/react/SendButton/index.d.ts +2 -0
- package/es/react/SendButton/index.js +2 -0
- package/es/react/SendButton/style.d.ts +6 -0
- package/es/react/SendButton/style.js +15 -0
- package/es/react/SendButton/type.d.ts +6 -0
- package/es/react/SendButton/type.js +1 -0
- package/es/react/SlashMenu/SlashMenu.d.ts +4 -0
- package/es/react/SlashMenu/SlashMenu.js +68 -0
- package/es/react/SlashMenu/index.d.ts +2 -0
- package/es/react/SlashMenu/index.js +2 -0
- package/es/react/SlashMenu/style.d.ts +4 -0
- package/es/react/SlashMenu/style.js +11 -0
- package/es/react/SlashMenu/type.d.ts +8 -0
- package/es/react/SlashMenu/type.js +1 -0
- package/es/react/index.d.ts +8 -0
- package/es/react/index.js +8 -0
- package/es/types/global.d.ts +20 -0
- package/es/types/index.d.ts +2 -0
- package/es/types/index.js +2 -0
- package/es/types/kernel.d.ts +180 -0
- package/es/types/kernel.js +1 -0
- package/es/types/locale.d.ts +10 -0
- package/es/types/locale.js +1 -0
- package/package.json +66 -0
- package/patches/lexical+0.33.1.patch +88 -0
- package/react.d.ts +1 -0
- package/react.js +1 -0
- package/scripts/patch-lexical-package-json.js +20 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization key type declaration, plugins can extend through declaration merging
|
|
3
|
+
*/
|
|
4
|
+
export type LocaleType = typeof import("../locale").default;
|
|
5
|
+
type FlattenKeys<T, Prefix extends string = ''> = {
|
|
6
|
+
[K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never;
|
|
7
|
+
}[keyof T & string];
|
|
8
|
+
export type TFunction = <TKey extends FlattenKeys<LocaleType>>(key: TKey, options?: Record<string, string | number>) => string;
|
|
9
|
+
export type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lobehub/editor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lobehub",
|
|
7
|
+
"editor",
|
|
8
|
+
"lexical"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/lobehub/lobe-editor",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/lobehub/lobe-editor/issues/new/choose"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/lobehub/lobe-editor.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "LobeHub <i@lobehub.com>",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"main": "es/index.js",
|
|
22
|
+
"module": "es/index.js",
|
|
23
|
+
"types": "es/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"es",
|
|
26
|
+
"react.d.ts",
|
|
27
|
+
"react.js",
|
|
28
|
+
"patches",
|
|
29
|
+
"scripts/patch-lexical-package-json.js"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@floating-ui/dom": "^1.7.3",
|
|
33
|
+
"@floating-ui/react": "^0.27.15",
|
|
34
|
+
"@lexical/code": "^0.34.0",
|
|
35
|
+
"@lexical/code-shiki": "^0.34.0",
|
|
36
|
+
"@lexical/dragon": "^0.34.0",
|
|
37
|
+
"@lexical/history": "^0.34.0",
|
|
38
|
+
"@lexical/link": "^0.34.0",
|
|
39
|
+
"@lexical/list": "^0.34.0",
|
|
40
|
+
"@lexical/rich-text": "^0.34.0",
|
|
41
|
+
"@lexical/selection": "^0.34.0",
|
|
42
|
+
"@lexical/table": "^0.34.0",
|
|
43
|
+
"@lexical/utils": "^0.34.0",
|
|
44
|
+
"@shikijs/core": "^3.9.2",
|
|
45
|
+
"@shikijs/engine-javascript": "^3.9.2",
|
|
46
|
+
"ahooks": "^3.9.3",
|
|
47
|
+
"antd-style": "^3.7.1",
|
|
48
|
+
"eventemitter3": "^5.0.1",
|
|
49
|
+
"framer-motion": "^12.23.12",
|
|
50
|
+
"fuse.js": "^7.1.0",
|
|
51
|
+
"lexical": "^0.34.0",
|
|
52
|
+
"lodash-es": "^4.17.21",
|
|
53
|
+
"lucide-react": "^0.536.0",
|
|
54
|
+
"polished": "^4.3.1",
|
|
55
|
+
"react-error-boundary": "^6.0.0",
|
|
56
|
+
"react-layout-kit": "^2.0.0",
|
|
57
|
+
"shiki": "^3.9.2",
|
|
58
|
+
"use-merge-value": "^1.2.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@lobehub/ui": "^2.0.0",
|
|
62
|
+
"antd": "^5.25.0",
|
|
63
|
+
"react": "^19.0.0",
|
|
64
|
+
"react-dom": "^19.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
diff --git a/node_modules/lexical/Lexical.dev.js b/node_modules/lexical/Lexical.dev.js
|
|
2
|
+
index f129fe0..4a6af35 100644
|
|
3
|
+
--- a/node_modules/lexical/Lexical.dev.js
|
|
4
|
+
+++ b/node_modules/lexical/Lexical.dev.js
|
|
5
|
+
@@ -13865,3 +13865,5 @@ exports.removeFromParent = removeFromParent;
|
|
6
|
+
exports.resetRandomKey = resetRandomKey;
|
|
7
|
+
exports.setDOMUnmanaged = setDOMUnmanaged;
|
|
8
|
+
exports.setNodeIndentFromDOM = setNodeIndentFromDOM;
|
|
9
|
+
+exports.EditorState = EditorState;
|
|
10
|
+
+exports.ElementDOMSlot = ElementDOMSlot;
|
|
11
|
+
diff --git a/node_modules/lexical/Lexical.dev.mjs b/node_modules/lexical/Lexical.dev.mjs
|
|
12
|
+
index ab18d70..28cb4ab 100644
|
|
13
|
+
--- a/node_modules/lexical/Lexical.dev.mjs
|
|
14
|
+
+++ b/node_modules/lexical/Lexical.dev.mjs
|
|
15
|
+
@@ -6,6 +6,8 @@
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
+import { EditorStateReadOptions } from "./Lexical.dev";
|
|
20
|
+
+
|
|
21
|
+
/**
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
@@ -13665,4 +13667,4 @@ function $splitAtPointCaretNext(pointCaret, {
|
|
25
|
+
return parentCaret;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
-export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $create, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, buildImportMap, createCommand, createEditor, createSharedNodeState, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM };
|
|
29
|
+
+export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $create, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, buildImportMap, createCommand, createEditor, createSharedNodeState, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM, EditorState, ElementDOMSlot };
|
|
30
|
+
diff --git a/node_modules/lexical/Lexical.js b/node_modules/lexical/Lexical.js
|
|
31
|
+
index d2e1194..d4d1894 100644
|
|
32
|
+
--- a/node_modules/lexical/Lexical.js
|
|
33
|
+
+++ b/node_modules/lexical/Lexical.js
|
|
34
|
+
@@ -7,5 +7,5 @@
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
'use strict'
|
|
38
|
+
-const Lexical = process.env.NODE_ENV !== 'production' ? require('./Lexical.dev.js') : require('./Lexical.prod.js');
|
|
39
|
+
+const Lexical = require('./Lexical.dev.js');
|
|
40
|
+
module.exports = Lexical;
|
|
41
|
+
|
|
42
|
+
diff --git a/node_modules/lexical/Lexical.mjs b/node_modules/lexical/Lexical.mjs
|
|
43
|
+
index a6b0b72..4ef410d 100644
|
|
44
|
+
--- a/node_modules/lexical/Lexical.mjs
|
|
45
|
+
+++ b/node_modules/lexical/Lexical.mjs
|
|
46
|
+
@@ -7,8 +7,7 @@
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
import * as modDev from './Lexical.dev.mjs';
|
|
50
|
+
-import * as modProd from './Lexical.prod.mjs';
|
|
51
|
+
-const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
52
|
+
+const mod = modDev;
|
|
53
|
+
export const $addUpdateTag = mod.$addUpdateTag;
|
|
54
|
+
export const $applyNodeReplacement = mod.$applyNodeReplacement;
|
|
55
|
+
export const $caretFromPoint = mod.$caretFromPoint;
|
|
56
|
+
diff --git a/node_modules/lexical/Lexical.node.mjs b/node_modules/lexical/Lexical.node.mjs
|
|
57
|
+
index 15045bc..e1e9480 100644
|
|
58
|
+
--- a/node_modules/lexical/Lexical.node.mjs
|
|
59
|
+
+++ b/node_modules/lexical/Lexical.node.mjs
|
|
60
|
+
@@ -205,3 +205,5 @@ export const removeFromParent = mod.removeFromParent;
|
|
61
|
+
export const resetRandomKey = mod.resetRandomKey;
|
|
62
|
+
export const setDOMUnmanaged = mod.setDOMUnmanaged;
|
|
63
|
+
export const setNodeIndentFromDOM = mod.setNodeIndentFromDOM;
|
|
64
|
+
+export const EditorState = mod.EditorState;
|
|
65
|
+
+export const ElementDOMSlot = mod.ElementDOMSlot;
|
|
66
|
+
diff --git a/node_modules/lexical/index.d.ts b/node_modules/lexical/index.d.ts
|
|
67
|
+
index 4d1c06d..d480555 100644
|
|
68
|
+
--- a/node_modules/lexical/index.d.ts
|
|
69
|
+
+++ b/node_modules/lexical/index.d.ts
|
|
70
|
+
@@ -12,7 +12,7 @@ export { BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND,
|
|
71
|
+
export { IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, NODE_STATE_KEY, TEXT_TYPE_TO_FORMAT, } from './LexicalConstants';
|
|
72
|
+
export type { CommandListener, CommandListenerPriority, CommandPayloadType, CreateEditorArgs, EditableListener, EditorConfig, EditorSetOptions, EditorThemeClasses, EditorThemeClassName, EditorUpdateOptions, HTMLConfig, Klass, KlassConstructor, LexicalCommand, LexicalEditor, LexicalNodeConfig, LexicalNodeReplacement, MutationListener, NodeMutation, RootListener, SerializedEditor, Spread, Transform, UpdateListener, UpdateListenerPayload, } from './LexicalEditor';
|
|
73
|
+
export { COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, createEditor, } from './LexicalEditor';
|
|
74
|
+
-export type { EditorState, EditorStateReadOptions, SerializedEditorState, } from './LexicalEditorState';
|
|
75
|
+
+export { EditorState, EditorStateReadOptions, SerializedEditorState, } from './LexicalEditorState';
|
|
76
|
+
export type { EventHandler } from './LexicalEvents';
|
|
77
|
+
export type { BaseStaticNodeConfig, DOMChildConversion, DOMConversion, DOMConversionFn, DOMConversionMap, DOMConversionOutput, DOMExportOutput, DOMExportOutputMap, LexicalExportJSON, LexicalNode, LexicalUpdateJSON, NodeKey, NodeMap, SerializedLexicalNode, StaticNodeConfig, StaticNodeConfigRecord, StaticNodeConfigValue, } from './LexicalNode';
|
|
78
|
+
export { buildImportMap } from './LexicalNode';
|
|
79
|
+
@@ -24,7 +24,8 @@ export { $parseSerializedNode, isCurrentlyReadOnlyMode } from './LexicalUpdates'
|
|
80
|
+
export { $addUpdateTag, $applyNodeReplacement, $cloneWithProperties, $copyNode, $create, $getAdjacentNode, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getRoot, $hasAncestor, $hasUpdateTag, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $onUpdate, $selectAll, $setCompositionKey, $setSelection, $splitNode, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, INTERNAL_$isBlock, isBlockDomNode, isDocumentFragment, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM, } from './LexicalUtils';
|
|
81
|
+
export { ArtificialNode__DO_NOT_USE } from './nodes/ArtificialNode';
|
|
82
|
+
export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';
|
|
83
|
+
-export type { ElementDOMSlot, ElementFormatType, SerializedElementNode, } from './nodes/LexicalElementNode';
|
|
84
|
+
+export type { ElementFormatType, SerializedElementNode, } from './nodes/LexicalElementNode';
|
|
85
|
+
+export { ElementDOMSlot } from './nodes/LexicalElementNode';
|
|
86
|
+
export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';
|
|
87
|
+
export type { SerializedLineBreakNode } from './nodes/LexicalLineBreakNode';
|
|
88
|
+
export { $createLineBreakNode, $isLineBreakNode, LineBreakNode, } from './nodes/LexicalLineBreakNode';
|
package/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './es/react';
|
package/react.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './es/react';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
|
|
4
|
+
// 定位 lexical 的 package.json 文件
|
|
5
|
+
const packageJsonPath = path.resolve(__dirname, '../node_modules/lexical/package.json');
|
|
6
|
+
|
|
7
|
+
// 读取 package.json
|
|
8
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
9
|
+
|
|
10
|
+
// 修改 package.json 的内容
|
|
11
|
+
const expt = packageJson.exports['.'];
|
|
12
|
+
Object.keys(expt).forEach((key) => {
|
|
13
|
+
const obj = expt[key];
|
|
14
|
+
obj.production = obj.development; // 将 development 指向 production
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// 写回修改后的 package.json
|
|
18
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
|
|
19
|
+
|
|
20
|
+
console.log('lexical package.json has been patched!');
|