@maketribe/ms-app 3.2.32 → 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 +60 -66
- 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 +22 -12
- package/dist/cjs/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/index.js +2 -0
- package/dist/cjs/components/basic/doc-editor/index.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 +215 -68
- package/dist/cjs/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/GridNode.js +39 -39
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/GridNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js +8 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js +32 -23
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js +33 -18
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js +8 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +14 -54
- package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js +4 -0
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +38 -33
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/utils.js +2 -2
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/utils.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js +16 -9
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/composables.js +11 -10
- 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 +15 -28
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/utils.js +3 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/utils.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/commands.js +6 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/commands.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +127 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +36 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +9 -4
- 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 +17 -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/components/basic/doc-editor/themes/doc-theme.css.js +1 -2
- package/dist/cjs/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +1 -10
- package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/components/article-list.vue.js +180 -48
- 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 +44 -22
- 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 +1 -11
- 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 +11 -6
- 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 +3 -5
- 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 +60 -66
- package/dist/esm/components/basic/doc-editor/core/element-block.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/core/index.js +15 -1
- 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 +33 -23
- package/dist/esm/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/index.js +3 -1
- package/dist/esm/components/basic/doc-editor/index.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 +216 -69
- package/dist/esm/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/GridNode.js +39 -39
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/GridNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js +8 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js +32 -23
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js +33 -18
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js +8 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +16 -56
- package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js +4 -0
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +31 -26
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/utils.js +2 -2
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/utils.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js +16 -9
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/composables.js +12 -11
- 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 +16 -29
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/utils.js +4 -2
- package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/utils.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/commands.js +6 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/commands.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +127 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +37 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +8 -3
- 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 +16 -3
- 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/components/basic/doc-editor/themes/doc-theme.css.js +1 -2
- package/dist/esm/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +1 -10
- package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/components/article-list.vue.js +181 -49
- 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 +45 -23
- 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 +1 -11
- 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 +11 -6
- 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 +3 -5
- 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 +19 -2
- package/dist/style/src/modules/cms/pages/cms-contents/components/article-list.scss +32 -3
- 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/element-block.d.ts +5 -13
- package/dist/types/components/basic/doc-editor/core/index.d.ts +8 -1
- 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/index.d.ts +2 -1
- package/dist/types/components/basic/doc-editor/plugins/GridPlugin/GridNode.d.ts +10 -5
- package/dist/types/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.d.ts +5 -1
- package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/composables.d.ts +4 -9
- package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/utils.d.ts +1 -1
- package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/commands.d.ts +5 -0
- package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/composables.d.ts +35 -0
- package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.d.ts +2 -0
- package/dist/types/components/basic/doc-editor/plugins/index.d.ts +2 -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 +4 -4
- package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor-options.d.ts +2 -2
- package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor.d.ts +4 -4
- package/package.json +22 -23
- package/dist/cjs/components/basic/doc-editor/core/utils.js +0 -42
- package/dist/cjs/components/basic/doc-editor/core/utils.js.map +0 -1
- 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/core/utils.js +0 -42
- package/dist/esm/components/basic/doc-editor/core/utils.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/core/utils.d.ts +0 -4
- 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,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,94 +1,88 @@
|
|
|
1
1
|
import { mergeRegister } from "@lexical/utils";
|
|
2
|
-
import { createCommand, CLICK_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { createCommand, CLICK_COMMAND, COMMAND_PRIORITY_LOW, SELECTION_CHANGE_COMMAND, $getSelection, $isNodeSelection, $createNodeSelection, $setSelection } from "lexical";
|
|
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";
|
|
6
14
|
const SELECTED_ELEMENTBLOCK_COMMAND = createCommand("SELECTED_ELEMENTBLOCK_COMMAND");
|
|
7
15
|
const REMOVE_ELEMENTBLOCK_COMMAND = createCommand("REMOVE_ELEMENTBLOCK_COMMAND");
|
|
8
16
|
const UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND = createCommand("UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND");
|
|
17
|
+
const clearSelection = (editor) => {
|
|
18
|
+
return new Promise((resolove) => {
|
|
19
|
+
editor.update(() => {
|
|
20
|
+
const selection = $getSelection();
|
|
21
|
+
if ($isNodeSelection(selection) && selection) {
|
|
22
|
+
selection.clear();
|
|
23
|
+
}
|
|
24
|
+
resolove(void 0);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const setSelected = (editor, selected, key) => {
|
|
29
|
+
return new Promise((resolove) => {
|
|
30
|
+
editor.update(() => {
|
|
31
|
+
let selection = $getSelection();
|
|
32
|
+
if (!$isNodeSelection(selection)) {
|
|
33
|
+
selection = $createNodeSelection();
|
|
34
|
+
$setSelection(selection);
|
|
35
|
+
}
|
|
36
|
+
if ($isNodeSelection(selection)) {
|
|
37
|
+
selection.add(unref(key));
|
|
38
|
+
}
|
|
39
|
+
resolove(void 0);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const setElementBlockSelection = async (editor, nodeKey) => {
|
|
44
|
+
await clearSelection(editor);
|
|
45
|
+
await setSelected(editor, true, nodeKey);
|
|
46
|
+
};
|
|
9
47
|
const useElementBlockSelection = (func, toolsbars) => {
|
|
10
48
|
const editor = useLexicalComposer();
|
|
11
|
-
const isSelected = ref(false);
|
|
12
|
-
const curSelectKey = ref(null);
|
|
13
|
-
const curSelectEl = ref(null);
|
|
14
|
-
const curSelectPos = ref(null);
|
|
15
|
-
const updateActiveBox = (el) => {
|
|
16
|
-
if (el) {
|
|
17
|
-
const selectRect = el.getBoundingClientRect();
|
|
18
|
-
curSelectPos.value = {
|
|
19
|
-
top: `${selectRect.y}px`,
|
|
20
|
-
left: `${selectRect.x}px`,
|
|
21
|
-
width: `${selectRect.width}px`,
|
|
22
|
-
height: `${selectRect.height}px`
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const updateActiveViewState = (el) => {
|
|
27
|
-
if (el) {
|
|
28
|
-
updateActiveBox(el);
|
|
29
|
-
editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND, {
|
|
30
|
-
element: curSelectEl.value,
|
|
31
|
-
toolsbars
|
|
32
|
-
});
|
|
33
|
-
} else {
|
|
34
|
-
curSelectEl.value = null;
|
|
35
|
-
curSelectKey.value = null;
|
|
36
|
-
curSelectPos.value = null;
|
|
37
|
-
editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND, null);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const setSelection = async (nodeKey, el) => {
|
|
41
|
-
if (isSelected.value) {
|
|
42
|
-
isSelected.value = false;
|
|
43
|
-
await clearSelection(editor);
|
|
44
|
-
}
|
|
45
|
-
await new Promise((reslove) => setTimeout(reslove, 10));
|
|
46
|
-
await setSelected(editor, true, nodeKey);
|
|
47
|
-
curSelectEl.value = el == null ? editor.getElementByKey(nodeKey) : el;
|
|
48
|
-
curSelectKey.value = nodeKey;
|
|
49
|
-
isSelected.value = isNodeSelected(editor, nodeKey);
|
|
50
|
-
setTimeout(() => updateActiveBox(curSelectEl.value), 500);
|
|
51
|
-
setTimeout(() => updateActiveBox(curSelectEl.value), 1e3);
|
|
52
|
-
};
|
|
53
|
-
watch(isSelected, (state) => {
|
|
54
|
-
if (state) {
|
|
55
|
-
updateActiveViewState(state ? curSelectEl.value : null);
|
|
56
|
-
} else {
|
|
57
|
-
updateActiveViewState(null);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
49
|
useMounted(() => {
|
|
61
50
|
return mergeRegister(
|
|
62
|
-
// 更新选中状态
|
|
63
|
-
editor.registerUpdateListener(() => {
|
|
64
|
-
isSelected.value = isNodeSelected(editor, curSelectKey.value);
|
|
65
|
-
setTimeout(() => updateActiveBox(curSelectEl.value), 10);
|
|
66
|
-
}),
|
|
67
51
|
// 点击选中
|
|
68
52
|
editor.registerCommand(CLICK_COMMAND, (event) => {
|
|
69
53
|
const el = func(event.target);
|
|
70
54
|
const nodeKey = el == null ? void 0 : el.getAttribute("node-key");
|
|
71
55
|
if (nodeKey != null) {
|
|
72
56
|
event.preventDefault();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
setElementBlockSelection(editor, nodeKey);
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}, COMMAND_PRIORITY_LOW),
|
|
62
|
+
// 选中的话
|
|
63
|
+
editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
|
|
64
|
+
const selection = $getSelection();
|
|
65
|
+
const node = $isNodeSelection(selection) ? selection == null ? void 0 : selection.getNodes()[0] : null;
|
|
66
|
+
const nodeKey = node == null ? void 0 : node.__key;
|
|
67
|
+
const el = nodeKey ? editor.getElementByKey(nodeKey) : null;
|
|
68
|
+
if (nodeKey && el && func(el)) {
|
|
69
|
+
editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND, {
|
|
70
|
+
nodeKey,
|
|
71
|
+
toolsbars
|
|
72
|
+
});
|
|
80
73
|
return true;
|
|
81
74
|
}
|
|
75
|
+
editor.dispatchCommand(SELECTED_ELEMENTBLOCK_COMMAND, null);
|
|
82
76
|
return false;
|
|
83
77
|
}, COMMAND_PRIORITY_LOW)
|
|
84
78
|
);
|
|
85
79
|
});
|
|
86
|
-
return { isSelected, setSelection, curSelectKey, curSelectPos };
|
|
87
80
|
};
|
|
88
81
|
export {
|
|
89
82
|
REMOVE_ELEMENTBLOCK_COMMAND,
|
|
90
83
|
SELECTED_ELEMENTBLOCK_COMMAND,
|
|
91
84
|
UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND,
|
|
85
|
+
setElementBlockSelection,
|
|
92
86
|
useElementBlockSelection
|
|
93
87
|
};
|
|
94
88
|
//# sourceMappingURL=element-block.js.map
|
|
@@ -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\nimport { COMMAND_PRIORITY_LOW,CLICK_COMMAND, LexicalCommand, createCommand,
|
|
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,6 +1,19 @@
|
|
|
1
1
|
import { ref, reactive } from "vue";
|
|
2
|
-
import { REMOVE_ELEMENTBLOCK_COMMAND, SELECTED_ELEMENTBLOCK_COMMAND, UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND, useElementBlockSelection } from "./element-block.js";
|
|
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";
|
|
3
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";
|
|
4
17
|
const DEVICE_VIEW_MODE = ref("pc");
|
|
5
18
|
const ToolbarExtendPlugins = reactive([]);
|
|
6
19
|
const registerDocEditorToolbarExtend = function(options) {
|
|
@@ -14,6 +27,7 @@ export {
|
|
|
14
27
|
ToolbarExtendPlugins,
|
|
15
28
|
UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND,
|
|
16
29
|
registerDocEditorToolbarExtend,
|
|
30
|
+
setElementBlockSelection,
|
|
17
31
|
useElementBlockSelection
|
|
18
32
|
};
|
|
19
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -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\nexport
|
|
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":";"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent } 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
|
+
import { useAutoLink } from "./shared.js";
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
matchers: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["change"],
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const editor = useLexicalComposer();
|
|
24
|
+
useAutoLink(editor, props.matchers, (url, prevUrl) => {
|
|
25
|
+
emit("change", {
|
|
26
|
+
url,
|
|
27
|
+
prevUrl
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
_sfc_main as default
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.vue2.js.map
|
package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue2.js","sources":["../../../../../../../../src/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { useLexicalComposer } from '../../composables'\r\nimport { type LinkMatcher, useAutoLink } from './shared'\r\n\r\nconst props = defineProps<{\r\n matchers: LinkMatcher[]\r\n}>()\r\n\r\nconst emit = defineEmits<{\r\n (e: 'change', value: { url: string | null, prevUrl: string | null }): void\r\n}>()\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nuseAutoLink(editor, props.matchers, (url: string | null, prevUrl: string | null) => {\r\n emit('change', {\r\n url,\r\n prevUrl,\r\n })\r\n})\r\n</script>\r\n\r\n<template />\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,UAAM,QAAQ;AAId,UAAM,OAAO;AAIb,UAAM,SAAS;AAEf,gBAAY,QAAQ,MAAM,UAAU,CAAC,KAAoB,YAA2B;AAClF,WAAK,UAAU;AAAA,QACb;AAAA,QACA;AAAA,MAAA,CACD;AAAA,IAAA,CACF;;;;;;"}
|