@maketribe/ms-app 3.2.33 → 3.2.34
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/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue.js +74 -0
- package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/inject.js +5 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/inject.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/listenerManager.js +18 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/listenerManager.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js +31 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useDecorators.js +31 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useDecorators.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useHistory.js +15 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useHistory.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalComposer.js +17 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalComposer.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalTextEntity.js +16 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalTextEntity.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useList.js +48 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useList.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useMounted.js +14 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useMounted.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useRichTextSetup.js +16 -0
- package/dist/cjs/components/basic/doc-editor/core/composables/useRichTextSetup.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/element-block.js +12 -3
- package/dist/cjs/components/basic/doc-editor/core/element-block.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/core/index.js +14 -0
- package/dist/cjs/components/basic/doc-editor/core/index.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin/nodes/RichTextNode.js → core/nodes/RichElementNode.js} +81 -35
- package/dist/cjs/components/basic/doc-editor/core/nodes/RichElementNode.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js +42 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js +37 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js +176 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js +215 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js +75 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js +29 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js +77 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js +25 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.js +14 -3
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/ContentEditable.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js +24 -0
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.js +20 -9
- package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/index.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/editor.vue.js +19 -12
- package/dist/cjs/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/{plugins/nodes.js → nodes.js} +13 -11
- package/dist/cjs/components/basic/doc-editor/nodes.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js +5 -3
- package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js +13 -4
- package/dist/cjs/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +10 -2
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +23 -15
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/composables.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js +10 -2
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +12 -3
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +13 -3
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +8 -2
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js +10 -2
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +16 -4
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js +10 -2
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/themes/doc-editor-edit.css.js +1 -1
- package/dist/cjs/components/basic/doc-editor/themes/doc-editor-edit.css.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/components/article-list.vue.js +7 -5
- package/dist/cjs/modules/cms/pages/cms-contents/components/article-list.vue.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js +2 -2
- package/dist/cjs/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/components/part-info.vue.js +0 -3
- package/dist/cjs/modules/cms/pages/cms-contents/components/part-info.vue.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/index.vue2.js +9 -5
- package/dist/cjs/modules/cms/pages/cms-contents/index.vue2.js.map +1 -1
- package/dist/cjs/modules/ms/components/rich-text-editor/index.js.map +1 -1
- package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor-options.js +2 -4
- package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor-options.js.map +1 -1
- package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor.js +5 -4
- package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue.js +75 -0
- package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/inject.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/composables/inject.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/listenerManager.js +18 -0
- package/dist/esm/components/basic/doc-editor/core/composables/listenerManager.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js +31 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useDecorators.js +31 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useDecorators.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useHistory.js +15 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useHistory.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useLexicalComposer.js +17 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useLexicalComposer.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useLexicalTextEntity.js +16 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useLexicalTextEntity.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useList.js +48 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useList.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useMounted.js +14 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useMounted.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useRichTextSetup.js +16 -0
- package/dist/esm/components/basic/doc-editor/core/composables/useRichTextSetup.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/element-block.js +10 -1
- package/dist/esm/components/basic/doc-editor/core/element-block.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/core/index.js +14 -0
- package/dist/esm/components/basic/doc-editor/core/index.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin/nodes/RichTextNode.js → core/nodes/RichElementNode.js} +82 -36
- package/dist/esm/components/basic/doc-editor/core/nodes/RichElementNode.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js +43 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js +38 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js +176 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js +216 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js +76 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js +30 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js +78 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js +26 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.js +12 -1
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/ContentEditable.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js +25 -0
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.js +19 -8
- package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/index.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/editor.vue.js +31 -24
- package/dist/esm/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/{plugins/nodes.js → nodes.js} +13 -11
- package/dist/esm/components/basic/doc-editor/nodes.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js +5 -3
- package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js +12 -3
- package/dist/esm/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +9 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +14 -6
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/composables.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js +9 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +10 -1
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +12 -2
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +7 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js +9 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +13 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js +9 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/themes/doc-editor-edit.css.js +1 -1
- package/dist/esm/components/basic/doc-editor/themes/doc-editor-edit.css.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/components/article-list.vue.js +7 -5
- package/dist/esm/modules/cms/pages/cms-contents/components/article-list.vue.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js +2 -2
- package/dist/esm/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/components/part-info.vue.js +0 -3
- package/dist/esm/modules/cms/pages/cms-contents/components/part-info.vue.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/index.vue2.js +9 -5
- package/dist/esm/modules/cms/pages/cms-contents/index.vue2.js.map +1 -1
- package/dist/esm/modules/ms/components/rich-text-editor/index.js.map +1 -1
- package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor-options.js +2 -4
- package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor-options.js.map +1 -1
- package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor.js +5 -4
- package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/style/components/basic/doc-editor/index.css +1 -1
- package/dist/style/components/index.css +1 -1
- package/dist/style/index.css +2 -2
- package/dist/style/modules/cms/index.css +1 -1
- package/dist/style/modules/cms/pages/cms-contents/components/article-list.css +1 -1
- package/dist/style/modules/cms/pages/cms-contents/index.css +1 -1
- package/dist/style/modules/ms/components/rich-text-editor/index.css +1 -1
- package/dist/style/modules/ms/index.css +1 -1
- package/dist/style/src/components/basic/doc-editor/index.scss +3 -2
- package/dist/style/src/modules/cms/pages/cms-contents/components/article-list.scss +1 -0
- package/dist/style/src/modules/ms/components/rich-text-editor/index.scss +1 -1
- package/dist/types/components/basic/doc-editor/core/LexicalComposer.vue.d.ts +29 -0
- package/dist/types/components/basic/doc-editor/core/composables/index.d.ts +15 -0
- package/dist/types/components/basic/doc-editor/core/composables/inject.d.ts +1 -0
- package/dist/types/components/basic/doc-editor/core/composables/listenerManager.d.ts +1 -0
- package/dist/types/components/basic/doc-editor/core/composables/useCanShowPlaceholder.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useCharacterLimit.d.ts +9 -0
- package/dist/types/components/basic/doc-editor/core/composables/useDecorators.d.ts +4 -0
- package/dist/types/components/basic/doc-editor/core/composables/useEffect.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/core/composables/useHistory.d.ts +4 -0
- package/dist/types/components/basic/doc-editor/core/composables/useLexicalCommandsLog.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/core/composables/useLexicalComposer.d.ts +6 -0
- package/dist/types/components/basic/doc-editor/core/composables/useLexicalIsTextContentEmpty.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useLexicalNodeSelection.d.ts +7 -0
- package/dist/types/components/basic/doc-editor/core/composables/useLexicalTextEntity.d.ts +3 -0
- package/dist/types/components/basic/doc-editor/core/composables/useList.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useMounted.d.ts +4 -0
- package/dist/types/components/basic/doc-editor/core/composables/usePlainTextSetup.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useReactiveEditor.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useRichTextSetup.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/composables/useTableOfContents.d.ts +8 -0
- package/dist/types/components/basic/doc-editor/core/index.d.ts +8 -0
- package/dist/types/components/basic/doc-editor/core/nodes/RichElementNode.d.ts +46 -0
- package/dist/types/components/basic/doc-editor/core/nodes/index.d.ts +1 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.d.ts +15 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.d.ts +26 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.d.ts +14 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.d.ts +16 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.d.ts +15 -0
- package/dist/types/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/core/types.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/composables.d.ts +1 -1
- package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/composables.d.ts +1 -0
- package/dist/types/components/basic/doc-editor/plugins/index.d.ts +1 -3
- package/dist/types/components/data-model/data-table/views/table/index.d.ts +1 -1
- package/dist/types/components/data-model/data-table/views/table/table.d.ts +1 -1
- package/dist/types/components/data-model/data-table/views/tree/index.d.ts +1 -1
- package/dist/types/components/data-model/data-table/views/tree/tree.d.ts +1 -1
- package/dist/types/modules/ms/components/material-list/material-item.vue.d.ts +1 -1
- package/dist/types/modules/ms/components/rich-text-editor/index.d.ts +2 -2
- package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor-options.d.ts +1 -1
- package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/package.json +21 -22
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +0 -13
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/nodes.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +0 -14
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/nodes.js.map +0 -1
- package/dist/types/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.d.ts +0 -13
- package/dist/types/components/basic/doc-editor/plugins/VideoPlugin/VideoNode.d.ts +0 -23
- /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js +0 -0
- /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js.map +0 -0
- /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js +0 -0
- /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js.map +0 -0
- /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js +0 -0
- /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js.map +0 -0
- /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js +0 -0
- /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js.map +0 -0
- /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.d.ts +0 -0
- /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/DecoratedTeleports.d.ts +0 -0
- /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.d.ts +0 -0
- /package/dist/types/components/basic/doc-editor/{plugins/nodes.d.ts → nodes.d.ts} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
let handleClickAndPointerDownListenersCount = 0;
|
|
2
|
+
let handleClickAndPointerDownListenersUnregister;
|
|
3
|
+
function registerClickAndPointerListeners(register, unregister) {
|
|
4
|
+
if (handleClickAndPointerDownListenersCount++ === 0) {
|
|
5
|
+
register();
|
|
6
|
+
handleClickAndPointerDownListenersUnregister = unregister;
|
|
7
|
+
}
|
|
8
|
+
return () => {
|
|
9
|
+
if (--handleClickAndPointerDownListenersCount === 0) {
|
|
10
|
+
handleClickAndPointerDownListenersUnregister == null ? void 0 : handleClickAndPointerDownListenersUnregister();
|
|
11
|
+
handleClickAndPointerDownListenersUnregister = void 0;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
registerClickAndPointerListeners
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=listenerManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listenerManager.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/listenerManager.ts"],"sourcesContent":["let handleClickAndPointerDownListenersCount = 0\r\nlet handleClickAndPointerDownListenersUnregister: (() => void) | undefined\r\n\r\nexport function registerClickAndPointerListeners(register: () => void, unregister: () => void) {\r\n if (handleClickAndPointerDownListenersCount++ === 0) {\r\n register()\r\n handleClickAndPointerDownListenersUnregister = unregister\r\n }\r\n\r\n return () => {\r\n if (--handleClickAndPointerDownListenersCount === 0) {\r\n handleClickAndPointerDownListenersUnregister?.()\r\n handleClickAndPointerDownListenersUnregister = undefined\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":"AAAA,IAAI,0CAA0C;AAC9C,IAAI;AAEY,SAAA,iCAAiC,UAAsB,YAAwB;AAC7F,MAAI,8CAA8C,GAAG;AAC1C;AACsC,mDAAA;AAAA,EACjD;AAEA,SAAO,MAAM;AACP,QAAA,EAAE,4CAA4C,GAAG;AACJ;AACA,qDAAA;AAAA,IACjD;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref, readonly } from "vue";
|
|
2
|
+
import { $canShowPlaceholderCurry } from "@lexical/text";
|
|
3
|
+
import { mergeRegister } from "@lexical/utils";
|
|
4
|
+
import { useMounted } from "./useMounted.js";
|
|
5
|
+
function canShowPlaceholderFromCurrentEditorState(editor) {
|
|
6
|
+
const currentCanShowPlaceholder = editor.getEditorState().read($canShowPlaceholderCurry(editor.isComposing()));
|
|
7
|
+
return currentCanShowPlaceholder;
|
|
8
|
+
}
|
|
9
|
+
function useCanShowPlaceholder(editor) {
|
|
10
|
+
const initialState = editor.getEditorState().read($canShowPlaceholderCurry(editor.isComposing()));
|
|
11
|
+
const canShowPlaceholder = ref(initialState);
|
|
12
|
+
function resetCanShowPlaceholder() {
|
|
13
|
+
const currentCanShowPlaceholder = canShowPlaceholderFromCurrentEditorState(editor);
|
|
14
|
+
canShowPlaceholder.value = currentCanShowPlaceholder;
|
|
15
|
+
}
|
|
16
|
+
useMounted(() => {
|
|
17
|
+
return mergeRegister(
|
|
18
|
+
editor.registerUpdateListener(() => {
|
|
19
|
+
resetCanShowPlaceholder();
|
|
20
|
+
}),
|
|
21
|
+
editor.registerEditableListener(() => {
|
|
22
|
+
resetCanShowPlaceholder();
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
return readonly(canShowPlaceholder);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
useCanShowPlaceholder
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=useCanShowPlaceholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanShowPlaceholder.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useCanShowPlaceholder.ts"],"sourcesContent":["import { readonly, ref } from 'vue'\r\nimport { $canShowPlaceholderCurry } from '@lexical/text'\r\nimport type { LexicalEditor } from 'lexical'\r\nimport { mergeRegister } from '@lexical/utils'\r\nimport { useMounted } from './useMounted'\r\n\r\nfunction canShowPlaceholderFromCurrentEditorState(\r\n editor: LexicalEditor,\r\n): boolean {\r\n const currentCanShowPlaceholder = editor\r\n .getEditorState()\r\n .read($canShowPlaceholderCurry(editor.isComposing()))\r\n\r\n return currentCanShowPlaceholder\r\n}\r\n\r\nexport function useCanShowPlaceholder(editor: LexicalEditor) {\r\n const initialState = editor\r\n .getEditorState()\r\n .read($canShowPlaceholderCurry(editor.isComposing()))\r\n\r\n const canShowPlaceholder = ref(initialState)\r\n\r\n function resetCanShowPlaceholder() {\r\n const currentCanShowPlaceholder\r\n = canShowPlaceholderFromCurrentEditorState(editor)\r\n canShowPlaceholder.value = currentCanShowPlaceholder\r\n }\r\n\r\n useMounted(() => {\r\n return mergeRegister(\r\n editor.registerUpdateListener(() => {\r\n resetCanShowPlaceholder()\r\n }),\r\n editor.registerEditableListener(() => {\r\n resetCanShowPlaceholder()\r\n }),\r\n )\r\n })\r\n\r\n return readonly(canShowPlaceholder)\r\n}\r\n"],"names":[],"mappings":";;;;AAMA,SAAS,yCACP,QACS;AACH,QAAA,4BAA4B,OAC/B,iBACA,KAAK,yBAAyB,OAAO,YAAa,CAAA,CAAC;AAE/C,SAAA;AACT;AAEO,SAAS,sBAAsB,QAAuB;AACrD,QAAA,eAAe,OAClB,iBACA,KAAK,yBAAyB,OAAO,YAAa,CAAA,CAAC;AAEhD,QAAA,qBAAqB,IAAI,YAAY;AAE3C,WAAS,0BAA0B;AAC3B,UAAA,4BACJ,yCAAyC,MAAM;AACjD,uBAAmB,QAAQ;AAAA,EAC7B;AAEA,aAAW,MAAM;AACR,WAAA;AAAA,MACL,OAAO,uBAAuB,MAAM;AACV;MAAA,CACzB;AAAA,MACD,OAAO,yBAAyB,MAAM;AACZ;MAAA,CACzB;AAAA,IAAA;AAAA,EACH,CACD;AAED,SAAO,SAAS,kBAAkB;AACpC;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { shallowRef, computed, unref, h, Teleport } from "vue";
|
|
2
|
+
import { useMounted } from "./useMounted.js";
|
|
3
|
+
function useDecorators(editor) {
|
|
4
|
+
const decorators = shallowRef(editor.getDecorators());
|
|
5
|
+
useMounted(() => {
|
|
6
|
+
return editor.registerDecoratorListener((nextDecorators) => {
|
|
7
|
+
decorators.value = nextDecorators;
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
return computed(() => {
|
|
11
|
+
const decoratedTeleports = [];
|
|
12
|
+
const decoratorKeys = Object.keys(unref(decorators));
|
|
13
|
+
for (let i = 0; i < decoratorKeys.length; i++) {
|
|
14
|
+
const nodeKey = decoratorKeys[i];
|
|
15
|
+
const vueDecorator = decorators.value[nodeKey];
|
|
16
|
+
const element = editor.getElementByKey(nodeKey);
|
|
17
|
+
if (element !== null) {
|
|
18
|
+
decoratedTeleports.push(
|
|
19
|
+
h(Teleport, {
|
|
20
|
+
to: element
|
|
21
|
+
}, vueDecorator)
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return decoratedTeleports;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
useDecorators
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=useDecorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDecorators.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useDecorators.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\r\nimport type { DefineComponent } from 'vue'\r\nimport { Teleport, computed, h, shallowRef, unref } from 'vue'\r\nimport { useMounted } from './useMounted'\r\n\r\nexport function useDecorators(editor: LexicalEditor) {\r\n const decorators = shallowRef<Record<string, DefineComponent>>(editor.getDecorators())\r\n\r\n useMounted(() => {\r\n return editor.registerDecoratorListener((nextDecorators) => {\r\n decorators.value = nextDecorators as Record<string, DefineComponent>\r\n })\r\n })\r\n\r\n // Return decorators defined as Vue Teleports\r\n return computed(() => {\r\n const decoratedTeleports = []\r\n const decoratorKeys = Object.keys(unref(decorators))\r\n for (let i = 0; i < decoratorKeys.length; i++) {\r\n const nodeKey = decoratorKeys[i]\r\n const vueDecorator = decorators.value[nodeKey]\r\n const element = editor.getElementByKey(nodeKey)\r\n if (element !== null) {\r\n decoratedTeleports.push(\r\n h(Teleport, {\r\n to: element,\r\n }, vueDecorator),\r\n )\r\n }\r\n }\r\n\r\n return decoratedTeleports\r\n })\r\n}\r\n"],"names":[],"mappings":";;AAKO,SAAS,cAAc,QAAuB;AACnD,QAAM,aAAa,WAA4C,OAAO,cAAe,CAAA;AAErF,aAAW,MAAM;AACR,WAAA,OAAO,0BAA0B,CAAC,mBAAmB;AAC1D,iBAAW,QAAQ;AAAA,IAAA,CACpB;AAAA,EAAA,CACF;AAGD,SAAO,SAAS,MAAM;AACpB,UAAM,qBAAqB,CAAA;AAC3B,UAAM,gBAAgB,OAAO,KAAK,MAAM,UAAU,CAAC;AACnD,aAAS,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;AACvC,YAAA,UAAU,cAAc,CAAC;AACzB,YAAA,eAAe,WAAW,MAAM,OAAO;AACvC,YAAA,UAAU,OAAO,gBAAgB,OAAO;AAC9C,UAAI,YAAY,MAAM;AACD,2BAAA;AAAA,UACjB,EAAE,UAAU;AAAA,YACV,IAAI;AAAA,aACH,YAAY;AAAA,QAAA;AAAA,MAEnB;AAAA,IACF;AAEO,WAAA;AAAA,EAAA,CACR;AACH;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { computed, unref, watchEffect } from "vue";
|
|
2
|
+
import { createEmptyHistoryState, registerHistory } from "@lexical/history";
|
|
3
|
+
function useHistory(editor, externalHistoryState, delay) {
|
|
4
|
+
const historyState = computed(
|
|
5
|
+
() => unref(externalHistoryState) || createEmptyHistoryState()
|
|
6
|
+
);
|
|
7
|
+
watchEffect((onInvalidate) => {
|
|
8
|
+
const unregisterListener = registerHistory(unref(editor), historyState.value, unref(delay) || 1e3);
|
|
9
|
+
onInvalidate(unregisterListener);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
useHistory
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHistory.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useHistory.ts"],"sourcesContent":["import type { HistoryState } from '@lexical/history'\r\nimport type { LexicalEditor } from 'lexical'\r\nimport { type MaybeRef, computed, unref, watchEffect } from 'vue'\r\n\r\nimport { createEmptyHistoryState, registerHistory } from '@lexical/history'\r\n\r\nexport function useHistory(\r\n editor: MaybeRef<LexicalEditor>,\r\n externalHistoryState?: MaybeRef<HistoryState>,\r\n delay?: MaybeRef<number>,\r\n) {\r\n const historyState = computed<HistoryState>(\r\n () => unref(externalHistoryState) || createEmptyHistoryState(),\r\n )\r\n\r\n watchEffect((onInvalidate) => {\r\n const unregisterListener = registerHistory(unref(editor), historyState.value, unref(delay) || 1000)\r\n\r\n onInvalidate(unregisterListener)\r\n })\r\n}\r\n"],"names":[],"mappings":";;AAMgB,SAAA,WACd,QACA,sBACA,OACA;AACA,QAAM,eAAe;AAAA,IACnB,MAAM,MAAM,oBAAoB,KAAK,wBAAwB;AAAA,EAAA;AAG/D,cAAY,CAAC,iBAAiB;AACtB,UAAA,qBAAqB,gBAAgB,MAAM,MAAM,GAAG,aAAa,OAAO,MAAM,KAAK,KAAK,GAAI;AAElG,iBAAa,kBAAkB;AAAA,EAAA,CAChC;AACH;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
3
|
+
import { LexicalEditorProviderKey } from "./inject.js";
|
|
4
|
+
function useLexicalComposer() {
|
|
5
|
+
const editor = inject(LexicalEditorProviderKey);
|
|
6
|
+
if (!editor) {
|
|
7
|
+
invariant(
|
|
8
|
+
false,
|
|
9
|
+
"useLexicalComposer: cannot find a LexicalComposer"
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return editor;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
useLexicalComposer
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useLexicalComposer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLexicalComposer.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useLexicalComposer.ts"],"sourcesContent":["import { inject } from 'vue'\r\nimport invariant from 'tiny-invariant'\r\nimport type { LexicalEditor } from 'lexical'\r\nimport { LexicalEditorProviderKey } from './inject'\r\n\r\nexport function useLexicalComposer() {\r\n const editor = inject<LexicalEditor>(LexicalEditorProviderKey)\r\n\r\n if (!editor) {\r\n invariant(\r\n false,\r\n 'useLexicalComposer: cannot find a LexicalComposer',\r\n )\r\n }\r\n\r\n return editor\r\n}\r\n\r\n/**\r\n * @deprecated use `useLexicalComposer` instead\r\n */\r\nexport const useEditor = useLexicalComposer\r\n"],"names":[],"mappings":";;;AAKO,SAAS,qBAAqB;AAC7B,QAAA,SAAS,OAAsB,wBAAwB;AAE7D,MAAI,CAAC,QAAQ;AACX;AAAA,MACE;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAEO,SAAA;AACT;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerLexicalTextEntity } from "@lexical/text";
|
|
2
|
+
import { mergeRegister } from "@lexical/utils";
|
|
3
|
+
import { useLexicalComposer } from "./useLexicalComposer.js";
|
|
4
|
+
import { useMounted } from "./useMounted.js";
|
|
5
|
+
function useLexicalTextEntity(getMatch, targetNode, createNode) {
|
|
6
|
+
const editor = useLexicalComposer();
|
|
7
|
+
useMounted(() => {
|
|
8
|
+
return mergeRegister(
|
|
9
|
+
...registerLexicalTextEntity(editor, getMatch, targetNode, createNode)
|
|
10
|
+
);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
useLexicalTextEntity
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useLexicalTextEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLexicalTextEntity.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useLexicalTextEntity.ts"],"sourcesContent":["import type { EntityMatch } from '@lexical/text'\r\nimport type { Klass, TextNode } from 'lexical'\r\n\r\nimport { registerLexicalTextEntity } from '@lexical/text'\r\nimport { mergeRegister } from '@lexical/utils'\r\nimport { useLexicalComposer } from './useLexicalComposer'\r\nimport { useMounted } from './useMounted'\r\n\r\nexport function useLexicalTextEntity<T extends TextNode>(\r\n getMatch: (text: string) => null | EntityMatch,\r\n targetNode: Klass<T>,\r\n createNode: (textNode: TextNode) => T,\r\n): void {\r\n const editor = useLexicalComposer()\r\n\r\n useMounted(() => {\r\n return mergeRegister(\r\n ...registerLexicalTextEntity(editor, getMatch, targetNode, createNode),\r\n )\r\n })\r\n}\r\n"],"names":[],"mappings":";;;;AAQgB,SAAA,qBACd,UACA,YACA,YACM;AACN,QAAM,SAAS;AAEf,aAAW,MAAM;AACR,WAAA;AAAA,MACL,GAAG,0BAA0B,QAAQ,UAAU,YAAY,UAAU;AAAA,IAAA;AAAA,EACvE,CACD;AACH;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { INSERT_ORDERED_LIST_COMMAND, insertList, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, removeList, $handleListInsertParagraph } from "@lexical/list";
|
|
2
|
+
import { mergeRegister } from "@lexical/utils";
|
|
3
|
+
import { COMMAND_PRIORITY_LOW, INSERT_PARAGRAPH_COMMAND } from "lexical";
|
|
4
|
+
import { useMounted } from "./useMounted.js";
|
|
5
|
+
function useList(editor) {
|
|
6
|
+
useMounted(() => {
|
|
7
|
+
return mergeRegister(
|
|
8
|
+
editor.registerCommand(
|
|
9
|
+
INSERT_ORDERED_LIST_COMMAND,
|
|
10
|
+
() => {
|
|
11
|
+
insertList(editor, "number");
|
|
12
|
+
return true;
|
|
13
|
+
},
|
|
14
|
+
COMMAND_PRIORITY_LOW
|
|
15
|
+
),
|
|
16
|
+
editor.registerCommand(
|
|
17
|
+
INSERT_UNORDERED_LIST_COMMAND,
|
|
18
|
+
() => {
|
|
19
|
+
insertList(editor, "bullet");
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
COMMAND_PRIORITY_LOW
|
|
23
|
+
),
|
|
24
|
+
editor.registerCommand(
|
|
25
|
+
REMOVE_LIST_COMMAND,
|
|
26
|
+
() => {
|
|
27
|
+
removeList(editor);
|
|
28
|
+
return true;
|
|
29
|
+
},
|
|
30
|
+
COMMAND_PRIORITY_LOW
|
|
31
|
+
),
|
|
32
|
+
editor.registerCommand(
|
|
33
|
+
INSERT_PARAGRAPH_COMMAND,
|
|
34
|
+
() => {
|
|
35
|
+
const hasHandledInsertParagraph = $handleListInsertParagraph();
|
|
36
|
+
if (hasHandledInsertParagraph)
|
|
37
|
+
return true;
|
|
38
|
+
return false;
|
|
39
|
+
},
|
|
40
|
+
COMMAND_PRIORITY_LOW
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
useList
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useList.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useList.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\r\n\r\nimport {\r\n $handleListInsertParagraph,\r\n INSERT_ORDERED_LIST_COMMAND,\r\n INSERT_UNORDERED_LIST_COMMAND,\r\n REMOVE_LIST_COMMAND,\r\n insertList,\r\n removeList,\r\n} from '@lexical/list'\r\nimport { mergeRegister } from '@lexical/utils'\r\nimport {\r\n COMMAND_PRIORITY_LOW,\r\n INSERT_PARAGRAPH_COMMAND,\r\n} from 'lexical'\r\nimport { useMounted } from './useMounted'\r\n\r\nexport function useList(editor: LexicalEditor) {\r\n useMounted(() => {\r\n return mergeRegister(\r\n editor.registerCommand(\r\n INSERT_ORDERED_LIST_COMMAND,\r\n () => {\r\n insertList(editor, 'number')\r\n return true\r\n },\r\n COMMAND_PRIORITY_LOW,\r\n ),\r\n editor.registerCommand(\r\n INSERT_UNORDERED_LIST_COMMAND,\r\n () => {\r\n insertList(editor, 'bullet')\r\n return true\r\n },\r\n COMMAND_PRIORITY_LOW,\r\n ),\r\n editor.registerCommand(\r\n REMOVE_LIST_COMMAND,\r\n () => {\r\n removeList(editor)\r\n return true\r\n },\r\n COMMAND_PRIORITY_LOW,\r\n ),\r\n editor.registerCommand(\r\n INSERT_PARAGRAPH_COMMAND,\r\n () => {\r\n const hasHandledInsertParagraph = $handleListInsertParagraph()\r\n\r\n if (hasHandledInsertParagraph)\r\n return true\r\n\r\n return false\r\n },\r\n COMMAND_PRIORITY_LOW,\r\n ),\r\n )\r\n })\r\n}\r\n"],"names":[],"mappings":";;;;AAiBO,SAAS,QAAQ,QAAuB;AAC7C,aAAW,MAAM;AACR,WAAA;AAAA,MACL,OAAO;AAAA,QACL;AAAA,QACA,MAAM;AACJ,qBAAW,QAAQ,QAAQ;AACpB,iBAAA;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL;AAAA,QACA,MAAM;AACJ,qBAAW,QAAQ,QAAQ;AACpB,iBAAA;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL;AAAA,QACA,MAAM;AACJ,qBAAW,MAAM;AACV,iBAAA;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL;AAAA,QACA,MAAM;AACJ,gBAAM,4BAA4B;AAE9B,cAAA;AACK,mBAAA;AAEF,iBAAA;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,CACD;AACH;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { onMounted, onUnmounted } from "vue";
|
|
2
|
+
function useMounted(cb) {
|
|
3
|
+
let unregister;
|
|
4
|
+
onMounted(() => {
|
|
5
|
+
unregister = cb();
|
|
6
|
+
});
|
|
7
|
+
onUnmounted(() => {
|
|
8
|
+
unregister == null ? void 0 : unregister();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useMounted
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useMounted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMounted.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useMounted.ts"],"sourcesContent":["import { onMounted, onUnmounted } from 'vue'\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function useMounted(cb: () => undefined | (() => any)) {\r\n let unregister: (() => void) | undefined\r\n\r\n onMounted(() => {\r\n unregister = cb()\r\n })\r\n\r\n onUnmounted(() => {\r\n unregister?.()\r\n })\r\n}\r\n"],"names":[],"mappings":";AAKO,SAAS,WAAW,IAAmC;AACxD,MAAA;AAEJ,YAAU,MAAM;AACd,iBAAa,GAAG;AAAA,EAAA,CACjB;AAED,cAAY,MAAM;AACH;AAAA,EAAA,CACd;AACH;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerDragonSupport } from "@lexical/dragon";
|
|
2
|
+
import { registerRichText } from "@lexical/rich-text";
|
|
3
|
+
import { mergeRegister } from "@lexical/utils";
|
|
4
|
+
import { useMounted } from "./useMounted.js";
|
|
5
|
+
function useRichTextSetup(editor) {
|
|
6
|
+
useMounted(() => {
|
|
7
|
+
return mergeRegister(
|
|
8
|
+
registerRichText(editor),
|
|
9
|
+
registerDragonSupport(editor)
|
|
10
|
+
);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
useRichTextSetup
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useRichTextSetup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRichTextSetup.js","sources":["../../../../../../../src/components/basic/doc-editor/core/composables/useRichTextSetup.ts"],"sourcesContent":["import { registerDragonSupport } from '@lexical/dragon'\r\nimport { registerRichText } from '@lexical/rich-text'\r\nimport { mergeRegister } from '@lexical/utils'\r\nimport type { LexicalEditor } from 'lexical'\r\nimport { useMounted } from './useMounted'\r\n\r\nexport function useRichTextSetup(editor: LexicalEditor) {\r\n useMounted(() => {\r\n return mergeRegister(\r\n registerRichText(editor),\r\n registerDragonSupport(editor),\r\n )\r\n })\r\n}\r\n"],"names":[],"mappings":";;;;AAMO,SAAS,iBAAiB,QAAuB;AACtD,aAAW,MAAM;AACR,WAAA;AAAA,MACL,iBAAiB,MAAM;AAAA,MACvB,sBAAsB,MAAM;AAAA,IAAA;AAAA,EAC9B,CACD;AACH;"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { mergeRegister } from "@lexical/utils";
|
|
2
2
|
import { createCommand, CLICK_COMMAND, COMMAND_PRIORITY_LOW, SELECTION_CHANGE_COMMAND, $getSelection, $isNodeSelection, $createNodeSelection, $setSelection } from "lexical";
|
|
3
|
-
import { useLexicalComposer, useMounted } from "lexical-vue";
|
|
4
3
|
import { unref } from "vue";
|
|
4
|
+
import "@lexical/text";
|
|
5
|
+
import { useMounted } from "./composables/useMounted.js";
|
|
6
|
+
import "@lexical/overflow";
|
|
7
|
+
import "tiny-invariant";
|
|
8
|
+
import "@lexical/history";
|
|
9
|
+
import { useLexicalComposer } from "./composables/useLexicalComposer.js";
|
|
10
|
+
import "@lexical/list";
|
|
11
|
+
import "@lexical/dragon";
|
|
12
|
+
import "@lexical/plain-text";
|
|
13
|
+
import "@lexical/rich-text";
|
|
5
14
|
const SELECTED_ELEMENTBLOCK_COMMAND = createCommand("SELECTED_ELEMENTBLOCK_COMMAND");
|
|
6
15
|
const REMOVE_ELEMENTBLOCK_COMMAND = createCommand("REMOVE_ELEMENTBLOCK_COMMAND");
|
|
7
16
|
const UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND = createCommand("UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-block.js","sources":["../../../../../../src/components/basic/doc-editor/core/element-block.ts"],"sourcesContent":["\r\n\r\nimport { mergeRegister } from '@lexical/utils'\r\n\r\nimport {\r\n $createNodeSelection,\r\n $getNodeByKey,\r\n $getSelection,\r\n $isNodeSelection,\r\n $setSelection,\r\n COMMAND_PRIORITY_LOW,CLICK_COMMAND, LexicalCommand, createCommand, NodeKey, LexicalEditor,\r\n SELECTION_CHANGE_COMMAND\r\n} from 'lexical'\r\nimport { useLexicalComposer,useMounted } from '
|
|
1
|
+
{"version":3,"file":"element-block.js","sources":["../../../../../../src/components/basic/doc-editor/core/element-block.ts"],"sourcesContent":["\r\n\r\nimport { mergeRegister } from '@lexical/utils'\r\n\r\nimport {\r\n $createNodeSelection,\r\n $getNodeByKey,\r\n $getSelection,\r\n $isNodeSelection,\r\n $setSelection,\r\n COMMAND_PRIORITY_LOW,CLICK_COMMAND, LexicalCommand, createCommand, NodeKey, LexicalEditor,\r\n SELECTION_CHANGE_COMMAND\r\n} from 'lexical'\r\nimport { useLexicalComposer,useMounted } from './composables'\r\nimport { ref,watch,unref } from 'vue'\r\n\r\n/**\r\n * toolsbar的函数\r\n */\r\nexport type SelectElementBlockToolsbarFunction = (nodeKey?:NodeKey | string)=>Array<any>|null;\r\n\r\n/**\r\n * 元素抗选中类型\r\n */\r\nexport type SelectElementBlocktEventType = {\r\n nodeKey:NodeKey|string,\r\n toolsbars:Array<any>|SelectElementBlockToolsbarFunction\r\n}\r\n\r\n/**\r\n * 选中元素快\r\n */\r\nexport const SELECTED_ELEMENTBLOCK_COMMAND: LexicalCommand<SelectElementBlocktEventType|null> = createCommand('SELECTED_ELEMENTBLOCK_COMMAND')\r\n\r\n/**\r\n * 移除元素快\r\n */\r\nexport const REMOVE_ELEMENTBLOCK_COMMAND: LexicalCommand<undefined|null> = createCommand('REMOVE_ELEMENTBLOCK_COMMAND')\r\n\r\n/**\r\n * 更新模块工具条位置信息\r\n */\r\nexport const UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND: LexicalCommand<undefined|null> = createCommand('UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND')\r\n\r\n/**\r\n * 判断选中的方法\r\n */\r\nexport type SelectExistFunc = (el:HTMLElement)=>HTMLElement|null\r\n\r\n/**\r\n * 判断选中的方法\r\n */\r\nexport type ElementSelectionHandle = (el:HTMLElement)=>undefined\r\n\r\n\r\n\r\n// isNodeSelected \r\nconst isNodeSelected = function (editor: LexicalEditor, key: NodeKey): boolean {\r\n return editor.getEditorState().read(() => {\r\n const node = $getNodeByKey(key)\r\n if (node === null)\r\n return false\r\n return node.isSelected()\r\n })\r\n}\r\n\r\n// 取消选中\r\nconst clearSelection = (editor: LexicalEditor):Promise<undefined> => {\r\n return new Promise(resolove=>{\r\n editor.update(() => {\r\n const selection = $getSelection()\r\n if ($isNodeSelection(selection) && selection){\r\n selection.clear();\r\n }\r\n resolove(undefined)\r\n })\r\n })\r\n}\r\n\r\n// 设置选中\r\nconst setSelected = (editor: LexicalEditor,selected: boolean,key:string):Promise<undefined> => {\r\n\r\n return new Promise(resolove=>{\r\n editor.update(() => {\r\n let selection = $getSelection()\r\n \r\n if (!$isNodeSelection(selection)) {\r\n selection = $createNodeSelection()\r\n $setSelection(selection)\r\n }\r\n if ($isNodeSelection(selection)) {\r\n if (selected)\r\n selection.add(unref(key))\r\n else\r\n selection.delete(unref(key))\r\n }\r\n resolove(undefined)\r\n })\r\n })\r\n \r\n}\r\n\r\n// 设置选中\r\nexport const setElementBlockSelection = async (editor:LexicalEditor,nodeKey:string)=>{\r\n await clearSelection(editor);\r\n await setSelected(editor,true,nodeKey);\r\n}\r\n\r\n/**\r\n * 使用元素块选中\r\n */\r\nexport const useElementBlockSelection = (func:SelectExistFunc,toolsbars:Array<any>|SelectElementBlockToolsbarFunction)=>{\r\n\r\n const editor = useLexicalComposer()\r\n \r\n // 编辑器挂载\r\n useMounted(()=>{\r\n // 注册事件\r\n return mergeRegister(\r\n // 点击选中\r\n editor.registerCommand<MouseEvent>(CLICK_COMMAND,(event) => {\r\n \r\n const el = func(event.target as HTMLElement);\r\n const nodeKey = el?.getAttribute(\"node-key\");\r\n\r\n // 不为null的话则视为点击选中\r\n if(nodeKey != null){\r\n \r\n event.preventDefault();\r\n\r\n // 暂时不支持使用 shift 建 多选\r\n // if (!event.shiftKey) { \r\n // // 先取消\r\n // clearSelection(editor)\r\n // }\r\n setElementBlockSelection(editor,nodeKey);\r\n return true;\r\n }\r\n \r\n return false;\r\n }, COMMAND_PRIORITY_LOW),\r\n // 选中的话\r\n editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {\r\n const selection = $getSelection();\r\n const node = $isNodeSelection(selection) ? selection?.getNodes()[0] : null;\r\n const nodeKey = node?.__key;\r\n const el = nodeKey ? editor.getElementByKey(nodeKey) : null;\r\n\r\n if(nodeKey && el && func(el)){\r\n editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND,{ \r\n nodeKey:nodeKey, toolsbars:toolsbars\r\n });\r\n return true;\r\n }\r\n editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND,null);\r\n return false;\r\n },COMMAND_PRIORITY_LOW)\r\n )\r\n })\r\n\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCa,MAAA,gCAAmF,cAAc,+BAA+B;AAKhI,MAAA,8BAA8D,cAAc,6BAA6B;AAKzG,MAAA,0CAA0E,cAAc,yCAAyC;AAyB9I,MAAM,iBAAiB,CAAC,WAA6C;AAC5D,SAAA,IAAI,QAAQ,CAAU,aAAA;AAC3B,WAAO,OAAO,MAAM;AAClB,YAAM,YAAY;AACd,UAAA,iBAAiB,SAAS,KAAK,WAAU;AAC3C,kBAAU,MAAM;AAAA,MAClB;AACA,eAAS,MAAS;AAAA,IAAA,CACnB;AAAA,EAAA,CACF;AACH;AAGA,MAAM,cAAc,CAAC,QAAsB,UAAkB,QAAkC;AAEtF,SAAA,IAAI,QAAQ,CAAU,aAAA;AAC3B,WAAO,OAAO,MAAM;AAClB,UAAI,YAAY;AAEZ,UAAA,CAAC,iBAAiB,SAAS,GAAG;AAChC,oBAAY,qBAAqB;AACjC,sBAAc,SAAS;AAAA,MACzB;AACI,UAAA,iBAAiB,SAAS,GAAG;AAEnB,kBAAA,IAAI,MAAM,GAAG,CAAC;AAAA,MAG5B;AACA,eAAS,MAAS;AAAA,IAAA,CACnB;AAAA,EAAA,CACF;AAEH;AAGa,MAAA,2BAA2B,OAAO,QAAqB,YAAiB;AACnF,QAAM,eAAe,MAAM;AACrB,QAAA,YAAY,QAAO,MAAK,OAAO;AACvC;AAKa,MAAA,2BAA2B,CAAC,MAAqB,cAA0D;AAEtH,QAAM,SAAS;AAGf,aAAW,MAAI;AAEN,WAAA;AAAA;AAAA,MAEL,OAAO,gBAA4B,eAAc,CAAC,UAAU;AAEpD,cAAA,KAAK,KAAK,MAAM,MAAqB;AACrC,cAAA,UAAU,yBAAI,aAAa;AAGjC,YAAG,WAAW,MAAK;AAEjB,gBAAM,eAAe;AAOrB,mCAAyB,QAAO,OAAO;AAChC,iBAAA;AAAA,QACT;AAEO,eAAA;AAAA,SACN,oBAAoB;AAAA;AAAA,MAEvB,OAAO,gBAAgB,0BAA0B,MAAM;AACrD,cAAM,YAAY;AACZ,cAAA,OAAO,iBAAiB,SAAS,IAAI,uCAAW,WAAW,KAAK;AACtE,cAAM,UAAU,6BAAM;AACtB,cAAM,KAAK,UAAU,OAAO,gBAAgB,OAAO,IAAI;AAEvD,YAAG,WAAW,MAAM,KAAK,EAAE,GAAE;AAC3B,iBAAO,gBAAgB,+BAA8B;AAAA,YACnD;AAAA,YAAiB;AAAA,UAAA,CAClB;AACM,iBAAA;AAAA,QACT;AACO,eAAA,gBAAgB,+BAA8B,IAAI;AAClD,eAAA;AAAA,SACP,oBAAoB;AAAA,IAAA;AAAA,EACxB,CACD;AAEH;"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { ref, reactive } from "vue";
|
|
2
2
|
import { REMOVE_ELEMENTBLOCK_COMMAND, SELECTED_ELEMENTBLOCK_COMMAND, UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND, setElementBlockSelection, useElementBlockSelection } from "./element-block.js";
|
|
3
|
+
import "@lexical/text";
|
|
4
|
+
import "@lexical/utils";
|
|
5
|
+
import "@lexical/overflow";
|
|
6
|
+
import "lexical";
|
|
7
|
+
import "tiny-invariant";
|
|
8
|
+
import "@lexical/history";
|
|
9
|
+
import "@lexical/list";
|
|
10
|
+
import "@lexical/dragon";
|
|
11
|
+
import "@lexical/plain-text";
|
|
12
|
+
import "@lexical/rich-text";
|
|
13
|
+
import "@lexical/hashtag";
|
|
14
|
+
import "@lexical/link";
|
|
15
|
+
import "@lexical/html";
|
|
16
|
+
import "./plugins/LexicalRichTextPlugin/DecoratedTeleports.js";
|
|
3
17
|
const DEVICE_VIEW_MODE = ref("pc");
|
|
4
18
|
const ToolbarExtendPlugins = reactive([]);
|
|
5
19
|
const registerDocEditorToolbarExtend = function(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/basic/doc-editor/core/index.ts"],"sourcesContent":["\r\nimport { ref,reactive } from \"vue\"\r\nexport * from \"./element-block\"\r\n\r\n/**\r\n * 设备显示模式\r\n */\r\nexport const DEVICE_VIEW_MODE = ref<'pc' | 'mobile'>(\"pc\")\r\n\r\n/**\r\n * 工具条扩展\r\n */\r\nexport type ToolbarExtendPlugin = {\r\n icon: string;\r\n text:string,\r\n action:Function,\r\n sort:number\r\n};\r\n\r\n/**\r\n * 插入的插件列表\r\n */\r\nexport const ToolbarExtendPlugins = reactive<ToolbarExtendPlugin[]>([]);\r\n\r\n/**\r\n * 注册工具条的扩展\r\n * @param options \r\n */\r\nexport const registerDocEditorToolbarExtend = function(options:ToolbarExtendPlugin){\r\n ToolbarExtendPlugins.push(options);\r\n ToolbarExtendPlugins.sort((a,b)=>a.sort<b.sort ? 1:-1);\r\n}\r\n\r\n\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/basic/doc-editor/core/index.ts"],"sourcesContent":["\r\nimport { ref,reactive } from \"vue\"\r\n\r\nexport * from \"./element-block\"\r\n\r\nexport {\r\n default as LexicalAutoFocusPlugin,\r\n} from './plugins/LexicalAutoFocusPlugin.vue'\r\nexport {\r\n default as LexicalCheckListPlugin,\r\n} from './plugins/LexicalCheckListPlugin.vue'\r\nexport {\r\n default as LexicalHashtagPlugin,\r\n} from './plugins/LexicalHashtagPlugin.vue'\r\nexport {\r\n default as LexicalHistoryPlugin,\r\n} from './plugins/LexicalHistoryPlugin.vue'\r\nexport {\r\n default as LexicalLinkPlugin,\r\n} from './plugins/LexicalLinkPlugin.vue'\r\nexport {\r\n default as LexicalAutoLinkPlugin,\r\n} from './plugins/LexicalAutoLinkPlugin/index.vue'\r\nexport {\r\n default as LexicalListPlugin,\r\n} from './plugins/LexicalListPlugin.vue'\r\n\r\nexport {\r\n default as LexicalRichTextPlugin,\r\n} from './plugins/LexicalRichTextPlugin/index.vue'\r\n/**\r\n * 设备显示模式\r\n */\r\nexport const DEVICE_VIEW_MODE = ref<'pc' | 'mobile'>(\"pc\")\r\n\r\n/**\r\n * 工具条扩展\r\n */\r\nexport type ToolbarExtendPlugin = {\r\n icon: string;\r\n text:string,\r\n action:Function,\r\n sort:number\r\n};\r\n\r\n/**\r\n * 插入的插件列表\r\n */\r\nexport const ToolbarExtendPlugins = reactive<ToolbarExtendPlugin[]>([]);\r\n\r\n/**\r\n * 注册工具条的扩展\r\n * @param options \r\n */\r\nexport const registerDocEditorToolbarExtend = function(options:ToolbarExtendPlugin){\r\n ToolbarExtendPlugins.push(options);\r\n ToolbarExtendPlugins.sort((a,b)=>a.sort<b.sort ? 1:-1);\r\n}\r\n\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiCa,MAAA,mBAAmB,IAAqB,IAAI;AAe5C,MAAA,uBAAuB,SAAgC,EAAE;AAMzD,MAAA,iCAAiC,SAAS,SAA4B;AACjF,uBAAqB,KAAK,OAAO;AACZ,uBAAA,KAAK,CAAC,GAAE,MAAI,EAAE,OAAK,EAAE,OAAO,IAAE,EAAE;AACvD;"}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { ElementNode, $isTextNode } from "lexical";
|
|
5
|
+
class RichElementNode extends ElementNode {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param tagName
|
|
9
|
+
* @param className
|
|
10
|
+
* @param style
|
|
11
|
+
* @param key
|
|
12
|
+
*/
|
|
13
|
+
constructor(tagName, className, style, key) {
|
|
14
|
+
super(key);
|
|
15
|
+
__publicField(this, "__tagName");
|
|
16
|
+
__publicField(this, "__class");
|
|
17
|
+
__publicField(this, "__style");
|
|
18
|
+
this.__tagName = tagName, this.__class = className;
|
|
19
|
+
this.__style = style || "";
|
|
20
|
+
}
|
|
3
21
|
static getType() {
|
|
4
|
-
return "rich-
|
|
22
|
+
return "rich-element";
|
|
5
23
|
}
|
|
6
24
|
static clone(node) {
|
|
7
|
-
return new
|
|
25
|
+
return new RichElementNode(node.__tagName, node.__class, node.__style, node.__key);
|
|
8
26
|
}
|
|
9
27
|
static importJSON(serializedNode) {
|
|
10
|
-
return
|
|
28
|
+
return new RichElementNode(serializedNode.tag, serializedNode.class, serializedNode.style);
|
|
11
29
|
}
|
|
12
30
|
static importDOM() {
|
|
13
31
|
return {
|
|
32
|
+
div: $covertRichElementDOM,
|
|
33
|
+
section: $covertRichElementDOM,
|
|
14
34
|
b: () => ({
|
|
15
35
|
conversion: convertBringAttentionToElement,
|
|
16
36
|
priority: 4
|
|
@@ -53,24 +73,54 @@ class RichTextNode extends TextNode {
|
|
|
53
73
|
})
|
|
54
74
|
};
|
|
55
75
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
/**
|
|
77
|
+
* 导出JSON
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
59
80
|
exportJSON() {
|
|
60
81
|
return {
|
|
61
|
-
...super.exportJSON()
|
|
82
|
+
...super.exportJSON(),
|
|
83
|
+
type: this.getType(),
|
|
84
|
+
tag: this.__tagName,
|
|
85
|
+
class: this.__class,
|
|
86
|
+
style: this.__style,
|
|
87
|
+
version: 1
|
|
62
88
|
};
|
|
63
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* 导出DOM
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
exportDOM() {
|
|
95
|
+
const element = document.createElement(this.__tagName);
|
|
96
|
+
if (this.__class) {
|
|
97
|
+
element.setAttribute("class", this.__class);
|
|
98
|
+
}
|
|
99
|
+
if (this.__style) {
|
|
100
|
+
element.setAttribute("style", this.__style);
|
|
101
|
+
}
|
|
102
|
+
return { element };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 创建渲染DOM
|
|
106
|
+
* @param config
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
createDOM(config) {
|
|
110
|
+
return this.exportDOM().element;
|
|
111
|
+
}
|
|
64
112
|
}
|
|
65
|
-
|
|
66
|
-
const b = domNode;
|
|
67
|
-
const hasNormalFontWeight = b.style.fontWeight === "normal";
|
|
113
|
+
const $covertRichElementDOM = (domNode) => {
|
|
68
114
|
return {
|
|
69
|
-
|
|
70
|
-
|
|
115
|
+
conversion: () => {
|
|
116
|
+
return {
|
|
117
|
+
node: new RichElementNode(domNode.tagName, domNode.getAttribute("class"), domNode.getAttribute("style") || "")
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
priority: 3
|
|
71
121
|
};
|
|
72
|
-
}
|
|
73
|
-
|
|
122
|
+
};
|
|
123
|
+
const nodeNameToTextFormat = {
|
|
74
124
|
code: "code",
|
|
75
125
|
em: "italic",
|
|
76
126
|
i: "italic",
|
|
@@ -80,6 +130,14 @@ var nodeNameToTextFormat = {
|
|
|
80
130
|
sup: "superscript",
|
|
81
131
|
u: "underline"
|
|
82
132
|
};
|
|
133
|
+
function convertBringAttentionToElement(domNode) {
|
|
134
|
+
const b = domNode;
|
|
135
|
+
const hasNormalFontWeight = b.style.fontWeight === "normal";
|
|
136
|
+
return {
|
|
137
|
+
forChild: applyTextFormatFromStyle(b.style, hasNormalFontWeight ? void 0 : "bold", domNode),
|
|
138
|
+
node: null
|
|
139
|
+
};
|
|
140
|
+
}
|
|
83
141
|
function convertTextFormatElement(domNode) {
|
|
84
142
|
const format = nodeNameToTextFormat[domNode.nodeName.toLowerCase()];
|
|
85
143
|
if (format === void 0) {
|
|
@@ -88,7 +146,7 @@ function convertTextFormatElement(domNode) {
|
|
|
88
146
|
};
|
|
89
147
|
}
|
|
90
148
|
return {
|
|
91
|
-
forChild: applyTextFormatFromStyle(domNode.style, format),
|
|
149
|
+
forChild: applyTextFormatFromStyle(domNode.style, format, domNode),
|
|
92
150
|
node: null
|
|
93
151
|
};
|
|
94
152
|
}
|
|
@@ -96,11 +154,11 @@ function convertSpanElement(domNode) {
|
|
|
96
154
|
const span = domNode;
|
|
97
155
|
const style = span.style;
|
|
98
156
|
return {
|
|
99
|
-
forChild: applyTextFormatFromStyle(style, null),
|
|
157
|
+
forChild: applyTextFormatFromStyle(style, null, domNode),
|
|
100
158
|
node: null
|
|
101
159
|
};
|
|
102
160
|
}
|
|
103
|
-
function applyTextFormatFromStyle(style, shouldApply) {
|
|
161
|
+
function applyTextFormatFromStyle(style, shouldApply, domNode) {
|
|
104
162
|
const fontWeight = style.fontWeight;
|
|
105
163
|
const textDecoration = style.textDecoration.split(" ");
|
|
106
164
|
const hasBoldFontWeight = fontWeight === "700" || fontWeight === "bold";
|
|
@@ -133,26 +191,14 @@ function applyTextFormatFromStyle(style, shouldApply) {
|
|
|
133
191
|
if (shouldApply && !lexicalNode.hasFormat(shouldApply)) {
|
|
134
192
|
lexicalNode.toggleFormat(shouldApply);
|
|
135
193
|
}
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
if (style.fontSize) {
|
|
141
|
-
styleStr += `font-size:${style.fontSize};`;
|
|
142
|
-
}
|
|
143
|
-
if (style.fontFamily) {
|
|
144
|
-
styleStr += `font-family:${style.fontFamily};`;
|
|
145
|
-
}
|
|
146
|
-
if (style.backgroundColor) {
|
|
147
|
-
styleStr += `background-color:${style.backgroundColor};`;
|
|
148
|
-
}
|
|
149
|
-
if (styleStr) {
|
|
150
|
-
lexicalNode.setStyle(styleStr);
|
|
194
|
+
const inlineStyle = domNode.getAttribute("style");
|
|
195
|
+
if (inlineStyle) {
|
|
196
|
+
lexicalNode.setStyle(inlineStyle);
|
|
151
197
|
}
|
|
152
198
|
return lexicalNode;
|
|
153
199
|
};
|
|
154
200
|
}
|
|
155
201
|
export {
|
|
156
|
-
|
|
202
|
+
RichElementNode
|
|
157
203
|
};
|
|
158
|
-
//# sourceMappingURL=
|
|
204
|
+
//# sourceMappingURL=RichElementNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichElementNode.js","sources":["../../../../../../../src/components/basic/doc-editor/core/nodes/RichElementNode.ts"],"sourcesContent":["\r\n\r\n\r\n\r\n\r\nimport type { DOMConversionMap, SerializedElementNode, NodeKey, Spread, EditorConfig, DOMExportOutput, DOMConversion, LexicalNode } from 'lexical'\r\nimport { $isTextNode, ElementNode } from 'lexical'\r\n\r\n\r\n/**\r\n * 节点序列化 \r\n */\r\nexport type SerializedRichElementNode = Spread<{ tag: string, style?: string, class?: string | null }, SerializedElementNode>\r\n\r\n/**\r\n * 格子\r\n */\r\nexport class RichElementNode extends ElementNode {\r\n\r\n __tagName: string\r\n __class?: string | null | undefined\r\n __style: string\r\n\r\n static getType(): string { return \"rich-element\"; }\r\n\r\n static clone(node: RichElementNode): RichElementNode {\r\n return new RichElementNode(node.__tagName, node.__class, node.__style, node.__key)\r\n }\r\n\r\n static importJSON(serializedNode: SerializedRichElementNode): RichElementNode {\r\n return new RichElementNode(serializedNode.tag, serializedNode.class, serializedNode.style)\r\n }\r\n\r\n static importDOM(): DOMConversionMap | null {\r\n return {\r\n div: $covertRichElementDOM,\r\n section: $covertRichElementDOM,\r\n b: () => ({\r\n conversion: convertBringAttentionToElement,\r\n priority: 4\r\n }),\r\n code: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n em: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n i: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n s: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n span: () => ({\r\n conversion: convertSpanElement,\r\n priority: 4\r\n }),\r\n strong: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n sub: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n sup: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n }),\r\n u: () => ({\r\n conversion: convertTextFormatElement,\r\n priority: 4\r\n })\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param tagName \r\n * @param className \r\n * @param style \r\n * @param key \r\n */\r\n constructor(tagName: string, className?: string | null, style?: string, key?: NodeKey) {\r\n super(key)\r\n this.__tagName = tagName,\r\n this.__class = className;\r\n this.__style = style || \"\";\r\n }\r\n\r\n\r\n /**\r\n * 导出JSON\r\n * @returns \r\n */\r\n exportJSON(): SerializedRichElementNode {\r\n return {\r\n ...super.exportJSON(),\r\n type: this.getType(),\r\n tag: this.__tagName,\r\n class: this.__class,\r\n style: this.__style,\r\n version: 1\r\n }\r\n }\r\n\r\n /**\r\n * 导出DOM\r\n * @returns \r\n */\r\n exportDOM(): DOMExportOutput {\r\n\r\n const element = document.createElement(this.__tagName)\r\n\r\n if (this.__class) {\r\n element.setAttribute(\"class\", this.__class)\r\n }\r\n\r\n if (this.__style) {\r\n element.setAttribute(\"style\", this.__style)\r\n }\r\n\r\n return { element }\r\n }\r\n\r\n /**\r\n * 创建渲染DOM\r\n * @param config \r\n * @returns \r\n */\r\n createDOM(config: EditorConfig): HTMLElement {\r\n return this.exportDOM().element as HTMLElement;\r\n }\r\n\r\n}\r\n\r\n\r\n/**\r\n * 转换DOM\r\n * @param node \r\n * @returns \r\n */\r\nconst $covertRichElementDOM = (domNode: HTMLElement): DOMConversion<HTMLElement> | null => {\r\n return {\r\n conversion: () => {\r\n return {\r\n node: new RichElementNode(domNode.tagName, domNode.getAttribute(\"class\"), domNode.getAttribute(\"style\") || \"\")\r\n };\r\n },\r\n priority: 3\r\n };\r\n}\r\n\r\n\r\n\r\nconst nodeNameToTextFormat: any = {\r\n code: \"code\",\r\n em: \"italic\",\r\n i: \"italic\",\r\n s: \"strikethrough\",\r\n strong: \"bold\",\r\n sub: \"subscript\",\r\n sup: \"superscript\",\r\n u: \"underline\"\r\n};\r\n\r\nfunction convertBringAttentionToElement(domNode: HTMLElement) {\r\n const b = domNode;\r\n const hasNormalFontWeight = b.style.fontWeight === \"normal\";\r\n return {\r\n forChild: applyTextFormatFromStyle(b.style, hasNormalFontWeight ? void 0 : \"bold\", domNode),\r\n node: null\r\n };\r\n}\r\n\r\nfunction convertTextFormatElement(domNode: HTMLElement) {\r\n const format = nodeNameToTextFormat[domNode.nodeName.toLowerCase()];\r\n if (format === void 0) {\r\n return {\r\n node: null\r\n };\r\n }\r\n return {\r\n forChild: applyTextFormatFromStyle(domNode.style, format, domNode),\r\n node: null\r\n };\r\n}\r\n\r\nfunction convertSpanElement(domNode: HTMLElement) {\r\n const span = domNode;\r\n const style = span.style;\r\n return {\r\n forChild: applyTextFormatFromStyle(style, null, domNode),\r\n node: null\r\n };\r\n}\r\n\r\nfunction applyTextFormatFromStyle(style: any, shouldApply: any, domNode: HTMLElement) {\r\n const fontWeight = style.fontWeight;\r\n const textDecoration = style.textDecoration.split(\" \");\r\n const hasBoldFontWeight = fontWeight === \"700\" || fontWeight === \"bold\";\r\n const hasLinethroughTextDecoration = textDecoration.includes(\"line-through\");\r\n const hasItalicFontStyle = style.fontStyle === \"italic\";\r\n const hasUnderlineTextDecoration = textDecoration.includes(\"underline\");\r\n const verticalAlign = style.verticalAlign;\r\n\r\n return (lexicalNode: LexicalNode) => {\r\n\r\n if (!$isTextNode(lexicalNode)) {\r\n return lexicalNode;\r\n }\r\n\r\n if (hasBoldFontWeight && !lexicalNode.hasFormat(\"bold\")) {\r\n lexicalNode.toggleFormat(\"bold\");\r\n }\r\n if (hasLinethroughTextDecoration && !lexicalNode.hasFormat(\"strikethrough\")) {\r\n lexicalNode.toggleFormat(\"strikethrough\");\r\n }\r\n if (hasItalicFontStyle && !lexicalNode.hasFormat(\"italic\")) {\r\n lexicalNode.toggleFormat(\"italic\");\r\n }\r\n if (hasUnderlineTextDecoration && !lexicalNode.hasFormat(\"underline\")) {\r\n lexicalNode.toggleFormat(\"underline\");\r\n }\r\n if (verticalAlign === \"sub\" && !lexicalNode.hasFormat(\"subscript\")) {\r\n lexicalNode.toggleFormat(\"subscript\");\r\n }\r\n if (verticalAlign === \"super\" && !lexicalNode.hasFormat(\"superscript\")) {\r\n lexicalNode.toggleFormat(\"superscript\");\r\n }\r\n if (shouldApply && !lexicalNode.hasFormat(shouldApply)) {\r\n lexicalNode.toggleFormat(shouldApply);\r\n }\r\n\r\n // let styleStr = \"\";\r\n\r\n // if(style.color){\r\n // styleStr += `color:${style.color};`\r\n // }\r\n // if(style.fontSize){\r\n // styleStr += `font-size:${style.fontSize};`\r\n // }\r\n // if(style.fontFamily){\r\n // styleStr += `font-family:${style.fontFamily};`\r\n // }\r\n // if(style.backgroundColor){\r\n // styleStr += `background-color:${style.backgroundColor};`\r\n // }\r\n\r\n // 行内样式\r\n const inlineStyle = domNode.getAttribute(\"style\")\r\n if (inlineStyle) {\r\n lexicalNode.setStyle(inlineStyle);\r\n }\r\n\r\n return lexicalNode;\r\n };\r\n}\r\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent, onMounted, nextTick } from "vue";
|
|
2
|
+
import "@lexical/text";
|
|
3
|
+
import "@lexical/utils";
|
|
4
|
+
import "@lexical/overflow";
|
|
5
|
+
import "lexical";
|
|
6
|
+
import "tiny-invariant";
|
|
7
|
+
import "@lexical/history";
|
|
8
|
+
import { useLexicalComposer } from "../composables/useLexicalComposer.js";
|
|
9
|
+
import "@lexical/list";
|
|
10
|
+
import "@lexical/dragon";
|
|
11
|
+
import "@lexical/plain-text";
|
|
12
|
+
import "@lexical/rich-text";
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "LexicalAutoFocusPlugin",
|
|
15
|
+
props: {
|
|
16
|
+
defaultSelection: {}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const editor = useLexicalComposer();
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
nextTick(() => {
|
|
23
|
+
editor.focus(
|
|
24
|
+
() => {
|
|
25
|
+
const activeElement = document.activeElement;
|
|
26
|
+
const rootElement = editor.getRootElement();
|
|
27
|
+
if (rootElement !== null && (activeElement === null || !rootElement.contains(activeElement))) {
|
|
28
|
+
rootElement.focus({ preventScroll: true });
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{ defaultSelection: props.defaultSelection }
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
_sfc_main as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=LexicalAutoFocusPlugin.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LexicalAutoFocusPlugin.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { nextTick, onMounted } from 'vue'\r\nimport { useLexicalComposer } from '../composables'\r\n\r\nconst props = defineProps<{\r\n defaultSelection?: 'rootStart' | 'rootEnd'\r\n}>()\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nonMounted(() => {\r\n nextTick(() => {\r\n editor.focus(\r\n () => {\r\n // If we try and move selection to the same point with setBaseAndExtent, it won't\r\n // trigger a re-focus on the element. So in the case this occurs, we'll need to correct it.\r\n // Normally this is fine, Selection API !== Focus API, but fore the intents of the naming\r\n // of this plugin, which should preserve focus too.\r\n const activeElement = document.activeElement\r\n const rootElement = editor.getRootElement() as HTMLDivElement\r\n if (\r\n rootElement !== null\r\n && (activeElement === null || !rootElement.contains(activeElement))\r\n ) {\r\n // Note: preventScroll won't work in Webkit.\r\n rootElement.focus({ preventScroll: true })\r\n }\r\n },\r\n { defaultSelection: props.defaultSelection },\r\n )\r\n })\r\n})\r\n</script>\r\n\r\n<template />\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,UAAM,QAAQ;AAId,UAAM,SAAS;AAEf,cAAU,MAAM;AACd,eAAS,MAAM;AACN,eAAA;AAAA,UACL,MAAM;AAKJ,kBAAM,gBAAgB,SAAS;AACzB,kBAAA,cAAc,OAAO;AAEzB,gBAAA,gBAAgB,SACZ,kBAAkB,QAAQ,CAAC,YAAY,SAAS,aAAa,IACjE;AAEA,0BAAY,MAAM,EAAE,eAAe,KAAM,CAAA;AAAA,YAC3C;AAAA,UACF;AAAA,UACA,EAAE,kBAAkB,MAAM,iBAAiB;AAAA,QAAA;AAAA,MAC7C,CACD;AAAA,IAAA,CACF;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LexicalAutoFocusPlugin.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|