@maketribe/ms-app 3.2.22 → 3.2.23
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/editor.vue.js +25 -49
- package/dist/cjs/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin.vue.js +2 -25
- package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/DocHtmlBlockComponent.js +41 -61
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/DocHtmlBlockComponent.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue.js +64 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlEditDialog.js +49 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlEditDialog.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.js +49 -73
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.vue.js +13 -23
- package/dist/cjs/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/DocImageComponent.js +4 -27
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/DocImageComponent.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageEditPanel.js +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageEditPanel.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageTools.vue.js +2 -23
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageTools.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.js +5 -24
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +2 -22
- package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue.js +2 -23
- package/dist/cjs/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/{lexical-vue/components/LexicalContentEditable.vue.js → plugins/RichTextPlugin/ContentEditable.vue.js} +5 -18
- package/dist/{esm/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue.js.map → cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map} +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue2.js +4 -0
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue2.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +13 -0
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/{lexical-vue/components/LexicalRichTextPlugin.vue.js → plugins/RichTextPlugin/index.vue.js} +20 -26
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js +153 -0
- package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +1 -0
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +2 -22
- 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 +2 -23
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/InlineToolsPlugin.vue.js +2 -24
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/InlineToolsPlugin.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +16 -26
- 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 -24
- package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/plugins/nodes.js +12 -7
- package/dist/cjs/components/basic/doc-editor/plugins/nodes.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/themes/doc-editor.css.js +1 -1
- package/dist/cjs/components/basic/doc-editor/themes/doc-editor.css.js.map +1 -1
- package/dist/cjs/components/basic/doc-editor/themes/doc-theme.css.js +4 -8
- package/dist/cjs/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
- package/dist/cjs/components/data-model/data-filter-form/components/condition-date/condition-date-options.js +1 -1
- package/dist/cjs/components/data-model/data-filter-form/components/condition-date/condition-date-options.js.map +1 -1
- package/dist/cjs/modules/cms/dataviews/cms-articles/CmsArticlesTable.js +3 -3
- package/dist/cjs/modules/cms/dataviews/cms-articles/CmsArticlesTable.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +2 -2
- package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
- package/dist/cjs/modules/ms/dataviews/ms-material/ms-material-group/MsMaterialGroupForm.js +4 -0
- package/dist/cjs/modules/ms/dataviews/ms-material/ms-material-group/MsMaterialGroupForm.js.map +1 -1
- package/dist/cjs/modules/ms/dataviews/ms-member/MsMemberTable.js +1 -1
- package/dist/cjs/modules/ms/dataviews/ms-member/MsMemberTable.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/editor.vue.js +27 -51
- package/dist/esm/components/basic/doc-editor/editor.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin.vue.js +2 -25
- package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/DocHtmlBlockComponent.js +40 -60
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/DocHtmlBlockComponent.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue.js +65 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlBlockTools.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlEditDialog.js +49 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlEditDialog.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.js +51 -75
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.vue.js +12 -22
- package/dist/esm/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/DocImageComponent.js +1 -24
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/DocImageComponent.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageEditPanel.js +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageEditPanel.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageTools.vue.js +1 -22
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageTools.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.js +4 -23
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +1 -21
- package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue.js +1 -22
- package/dist/esm/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/{lexical-vue/components/LexicalContentEditable.vue.js → plugins/RichTextPlugin/ContentEditable.vue.js} +3 -16
- package/dist/{cjs/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue.js.map → esm/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map} +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue2.js +5 -0
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue2.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +14 -0
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/{lexical-vue/components/LexicalRichTextPlugin.vue.js → plugins/RichTextPlugin/index.vue.js} +18 -24
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js +153 -0
- package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +1 -0
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +1 -21
- 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 +1 -22
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/InlineToolsPlugin.vue.js +1 -23
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/InlineToolsPlugin.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +15 -25
- 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 -23
- package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/plugins/nodes.js +13 -8
- package/dist/esm/components/basic/doc-editor/plugins/nodes.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/themes/doc-editor.css.js +1 -1
- package/dist/esm/components/basic/doc-editor/themes/doc-editor.css.js.map +1 -1
- package/dist/esm/components/basic/doc-editor/themes/doc-theme.css.js +4 -8
- package/dist/esm/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
- package/dist/esm/components/data-model/data-filter-form/components/condition-date/condition-date-options.js +1 -1
- package/dist/esm/components/data-model/data-filter-form/components/condition-date/condition-date-options.js.map +1 -1
- package/dist/esm/modules/cms/dataviews/cms-articles/CmsArticlesTable.js +3 -3
- package/dist/esm/modules/cms/dataviews/cms-articles/CmsArticlesTable.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +2 -2
- package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
- package/dist/esm/modules/ms/dataviews/ms-material/ms-material-group/MsMaterialGroupForm.js +4 -0
- package/dist/esm/modules/ms/dataviews/ms-material/ms-material-group/MsMaterialGroupForm.js.map +1 -1
- package/dist/esm/modules/ms/dataviews/ms-member/MsMemberTable.js +1 -1
- package/dist/esm/modules/ms/dataviews/ms-member/MsMemberTable.js.map +1 -1
- package/dist/types/components/basic/doc-editor/plugins/HtmlBlockPlugin/DocHtmlBlockComponent.d.ts +6 -3
- package/dist/types/components/basic/doc-editor/plugins/HtmlBlockPlugin/HtmlEditDialog.d.ts +6 -0
- package/dist/types/components/basic/doc-editor/plugins/HtmlBlockPlugin/index.d.ts +18 -19
- package/dist/types/components/basic/doc-editor/plugins/ImagePlugin/index.d.ts +2 -1
- package/dist/types/components/basic/doc-editor/{lexical-vue/components/LexicalRichTextPlugin.vue.d.ts → plugins/RichTextPlugin/index.vue.d.ts} +12 -11
- package/dist/types/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.d.ts +12 -0
- package/dist/types/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.d.ts +22 -1
- package/dist/types/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.d.ts +22 -1
- package/dist/types/components/basic/doc-editor/plugins/VideoPlugin/VideoNode.d.ts +2 -2
- package/dist/types/components/basic/doc-editor/plugins/index.d.ts +9 -0
- package/dist/types/components/basic/doc-editor/plugins/nodes.d.ts +1 -1
- package/dist/types/components/data-model/data-filter-form/components/condition-date/condition-date-options.d.ts +1 -1
- package/dist/types/components/data-model/data-filter-form/components/condition-date/condition-date.d.ts +2 -2
- package/dist/types/components/data-model/data-filter-form/components/condition-date/index.d.ts +2 -2
- 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/dataviews/ms-material/ms-material-group/MsMaterialGroupForm.d.ts +1 -0
- package/package.json +25 -25
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/shared.js +0 -5
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/shared.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue2.js +0 -39
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/shared.js +0 -176
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/shared.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue2.js +0 -108
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue.js +0 -74
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue2.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue2.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalDecoratedTeleports.js +0 -26
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalDecoratedTeleports.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalDecoratorBlockNode.js +0 -36
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalDecoratorBlockNode.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue.js +0 -31
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue2.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalMenu/shared.js +0 -16
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalMenu/shared.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue2.js +0 -4
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue2.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js +0 -5
- package/dist/cjs/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/inject.js +0 -5
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/inject.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useCanShowPlaceholder.js +0 -31
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useCanShowPlaceholder.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useCollaborationContext.js +0 -29
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useCollaborationContext.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useDecorators.js +0 -31
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useDecorators.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useHistory.js +0 -15
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useHistory.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useLexicalComposer.js +0 -17
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useLexicalComposer.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useLexicalNodeSelection.js +0 -54
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useLexicalNodeSelection.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useMounted.js +0 -14
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useMounted.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useRichTextSetup.js +0 -16
- package/dist/cjs/components/basic/doc-editor/lexical-vue/composables/useRichTextSetup.js.map +0 -1
- package/dist/cjs/components/basic/doc-editor/plugins/index.vue.js +0 -23
- package/dist/cjs/components/basic/doc-editor/plugins/index.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/shared.js +0 -4
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/shared.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue2.js +0 -40
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/shared.js +0 -176
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/shared.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue2.js +0 -109
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue.js +0 -75
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue2.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue2.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalContentEditable.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalDecoratedTeleports.js +0 -27
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalDecoratedTeleports.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalDecoratorBlockNode.js +0 -36
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalDecoratorBlockNode.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue.js +0 -32
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue2.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalMenu/shared.js +0 -15
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalMenu/shared.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue2.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalRichTextPlugin.vue2.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js +0 -4
- package/dist/esm/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/inject.js +0 -5
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/inject.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useCanShowPlaceholder.js +0 -31
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useCanShowPlaceholder.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useCollaborationContext.js +0 -28
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useCollaborationContext.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useDecorators.js +0 -31
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useDecorators.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useHistory.js +0 -15
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useHistory.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useLexicalComposer.js +0 -17
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useLexicalComposer.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useLexicalNodeSelection.js +0 -54
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useLexicalNodeSelection.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useMounted.js +0 -14
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useMounted.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useRichTextSetup.js +0 -16
- package/dist/esm/components/basic/doc-editor/lexical-vue/composables/useRichTextSetup.js.map +0 -1
- package/dist/esm/components/basic/doc-editor/plugins/index.vue.js +0 -24
- package/dist/esm/components/basic/doc-editor/plugins/index.vue.js.map +0 -1
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/index.vue.d.ts +0 -36
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoEmbedPlugin/shared.d.ts +0 -21
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoFocusPlugin.vue.d.ts +0 -15
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/index.vue.d.ts +0 -26
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoLinkPlugin/shared.d.ts +0 -14
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalAutoScrollPlugin.vue.d.ts +0 -15
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalBlockWithAlignableContents.vue.d.ts +0 -31
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalCharacterLimitPlugin.vue.d.ts +0 -29
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalClearEditorPlugin.vue.d.ts +0 -6
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalClickableLinkPlugin.vue.d.ts +0 -29
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalCollaborationPlugin.vue.d.ts +0 -34
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalComposer.vue.d.ts +0 -31
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalContextMenuPlugin.vue.d.ts +0 -62
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalDecoratorBlockNode.d.ts +0 -16
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalHashtagPlugin.vue.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalHistoryPlugin.vue.d.ts +0 -16
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalLinkPlugin.vue.d.ts +0 -15
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalListPlugin.vue.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalMarkdownShortcutPlugin.vue.d.ts +0 -30
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalMenu/index.vue.d.ts +0 -55
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalMenu/shared.d.ts +0 -32
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalNodeMenuPlugin.vue.d.ts +0 -61
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalOnChangePlugin.vue.d.ts +0 -39
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalPlainTextPlugin.vue.d.ts +0 -12
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalTabIndentationPlugin.vue.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalTablePlugin.vue.d.ts +0 -39
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalTreeViewPlugin.vue.d.ts +0 -25
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/index.vue.d.ts +0 -59
- package/dist/types/components/basic/doc-editor/lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.d.ts +0 -21
- package/dist/types/components/basic/doc-editor/lexical-vue/components/index.d.ts +0 -32
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/index.d.ts +0 -16
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/inject.d.ts +0 -1
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/listenerManager.d.ts +0 -1
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useCanShowPlaceholder.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useCharacterLimit.d.ts +0 -9
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useCollaborationContext.d.ts +0 -1388
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useDecorators.d.ts +0 -4
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useEffect.d.ts +0 -5
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useHistory.d.ts +0 -4
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useLexicalCommandsLog.d.ts +0 -5
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useLexicalComposer.d.ts +0 -6
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useLexicalIsTextContentEmpty.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useLexicalNodeSelection.d.ts +0 -7
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useLexicalTextEntity.d.ts +0 -3
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useList.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useMounted.d.ts +0 -4
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/usePlainTextSetup.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useReactiveEditor.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useRichTextSetup.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useTableOfContents.d.ts +0 -8
- package/dist/types/components/basic/doc-editor/lexical-vue/composables/useYjsCollaboration.d.ts +0 -8
- package/dist/types/components/basic/doc-editor/lexical-vue/index.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/lexical-vue/types.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolba-back.vue.d.ts +0 -2
- package/dist/types/components/basic/doc-editor/plugins/index.vue.d.ts +0 -2
- /package/dist/cjs/components/basic/doc-editor/plugins/{index.vue2.js → RichTextPlugin/index.vue2.js} +0 -0
- /package/dist/cjs/components/basic/doc-editor/plugins/{index.vue2.js.map → RichTextPlugin/index.vue2.js.map} +0 -0
- /package/dist/esm/components/basic/doc-editor/plugins/{index.vue2.js → RichTextPlugin/index.vue2.js} +0 -0
- /package/dist/esm/components/basic/doc-editor/plugins/{index.vue2.js.map → RichTextPlugin/index.vue2.js.map} +0 -0
- /package/dist/types/components/basic/doc-editor/{lexical-vue/components/LexicalCheckListPlugin.vue.d.ts → plugins/HtmlBlockPlugin/HtmlBlockTools.vue.d.ts} +0 -0
- /package/dist/types/components/basic/doc-editor/{lexical-vue/components/LexicalContentEditable.vue.d.ts → plugins/RichTextPlugin/ContentEditable.vue.d.ts} +0 -0
- /package/dist/types/components/basic/doc-editor/{lexical-vue/components/LexicalDecoratedTeleports.d.ts → plugins/RichTextPlugin/DecoratedTeleports.d.ts} +0 -0
|
@@ -4,35 +4,13 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
6
|
const lexical = require("lexical");
|
|
7
|
+
const lexicalVue = require("lexical-vue");
|
|
7
8
|
const vue = require("vue");
|
|
8
|
-
require("@lexical/text");
|
|
9
|
-
require("@lexical/utils");
|
|
10
|
-
require("@lexical/overflow");
|
|
11
|
-
require("tiny-invariant");
|
|
12
|
-
require("@lexical/history");
|
|
13
|
-
require("@lexical/list");
|
|
14
|
-
require("@lexical/dragon");
|
|
15
|
-
require("@lexical/plain-text");
|
|
16
|
-
require("@lexical/rich-text");
|
|
17
|
-
require("@lexical/yjs");
|
|
18
|
-
require("yjs");
|
|
19
|
-
require("../../lexical-vue/components/LexicalDecoratedTeleports.js");
|
|
20
|
-
require("@lexical/html");
|
|
21
|
-
require("@lexical/link");
|
|
22
|
-
require("@lexical/mark");
|
|
23
|
-
require("@lexical/table");
|
|
24
|
-
require("@lexical/hashtag");
|
|
25
|
-
const LexicalDecoratorBlockNode = require("../../lexical-vue/components/LexicalDecoratorBlockNode.js");
|
|
26
|
-
require("@lexical/markdown");
|
|
27
|
-
require("../../lexical-vue/composables/useCollaborationContext.js");
|
|
28
|
-
require("../../lexical-vue/components/LexicalMenu/shared.js");
|
|
29
|
-
require("../../lexical-vue/components/LexicalAutoEmbedPlugin/shared.js");
|
|
30
|
-
require("../../lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js");
|
|
31
9
|
const DocImageComponent = require("./DocImageComponent.js");
|
|
32
10
|
const IMAGE_ATTRS_CHANGE = lexical.createCommand("IMAGE_ATTRS_CHANGE");
|
|
33
11
|
const REMOVE_IMAGE_COMMAND = lexical.createCommand("REMOVE_IMAGE_COMMAND");
|
|
34
12
|
const INSERT_IMAGE_COMMAND = lexical.createCommand("INSERT_IMAGE_COMMAND");
|
|
35
|
-
class ImageNode extends
|
|
13
|
+
class ImageNode extends lexicalVue.DecoratorBlockNode {
|
|
36
14
|
constructor(attrs, format, key) {
|
|
37
15
|
super(format, key);
|
|
38
16
|
__publicField(this, "__attrs");
|
|
@@ -135,6 +113,9 @@ class ImageNode extends LexicalDecoratorBlockNode.DecoratorBlockNode {
|
|
|
135
113
|
attrs: this.__attrs
|
|
136
114
|
});
|
|
137
115
|
}
|
|
116
|
+
isInline() {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
138
119
|
}
|
|
139
120
|
function $createImageNode(attrs) {
|
|
140
121
|
return new ImageNode(attrs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImagePlugin/index.ts"],"sourcesContent":["\r\nimport type {\r\n DOMConversionMap,\r\n DOMConversionOutput,\r\n DOMExportOutput,\r\n EditorConfig,\r\n ElementFormatType,\r\n LexicalEditor,\r\n LexicalNode,\r\n NodeKey,\r\n Spread,\r\n LexicalCommand\r\n} from 'lexical'\r\nimport { createCommand } from 'lexical'\r\nimport { DecoratorBlockNode,type SerializedDecoratorBlockNode } from '
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImagePlugin/index.ts"],"sourcesContent":["\r\nimport type {\r\n DOMConversionMap,\r\n DOMConversionOutput,\r\n DOMExportOutput,\r\n EditorConfig,\r\n ElementFormatType,\r\n LexicalEditor,\r\n LexicalNode,\r\n NodeKey,\r\n Spread,\r\n LexicalCommand\r\n} from 'lexical'\r\nimport { createCommand } from 'lexical'\r\nimport { DecoratorBlockNode,type SerializedDecoratorBlockNode } from 'lexical-vue'\r\nimport { h ,type Component} from 'vue'\r\nimport DocImageComponent from './DocImageComponent'\r\n\r\n/**\r\n * 图片属性类型\r\n */\r\nexport type ImageAttrs = {\r\n src:string,\r\n alt?:string,\r\n width?:string,\r\n height?:string,\r\n float?:string,\r\n maxWidth?:string,\r\n maxHeight?:string,\r\n margin?:string\r\n};\r\n\r\n/**\r\n * 图片属性数据\r\n */\r\nexport type ImageAttrData = { name:string, value:string|null|undefined }\r\n\r\n/**\r\n * 图片属性改变\r\n */\r\nexport const IMAGE_ATTRS_CHANGE: LexicalCommand<ImageAttrData> = createCommand('IMAGE_ATTRS_CHANGE')\r\n\r\n\r\n/**\r\n * 删除图片\r\n */\r\nexport const REMOVE_IMAGE_COMMAND: LexicalCommand<undefined|null> = createCommand('REMOVE_IMAGE_COMMAND')\r\n\r\n\r\n/**\r\n * 插入图片指令\r\n */\r\nexport const INSERT_IMAGE_COMMAND: LexicalCommand<ImageAttrs> = createCommand('INSERT_IMAGE_COMMAND')\r\n\r\n/**\r\n * 图片节点序列化\r\n */\r\nexport type SerializedImageNode = Spread<\r\n {\r\n attrs: ImageAttrs\r\n },\r\n SerializedDecoratorBlockNode\r\n>\r\n\r\n/**\r\n * 定义图片节点\r\n */\r\nexport class ImageNode extends DecoratorBlockNode {\r\n __attrs: ImageAttrs\r\n\r\n static getType(): string {\r\n return 'Image'\r\n }\r\n\r\n static clone(node: ImageNode): ImageNode {\r\n return new ImageNode(node.__attrs, node.__format, node.__key)\r\n }\r\n\r\n static importJSON(serializedNode: SerializedImageNode): ImageNode {\r\n const node = $createImageNode(serializedNode.attrs)\r\n node.setFormat(serializedNode.format)\r\n return node\r\n }\r\n\r\n constructor(attrs: ImageAttrs, format?: ElementFormatType, key?: NodeKey) {\r\n super(format, key)\r\n this.__attrs = attrs\r\n }\r\n\r\n exportJSON(): SerializedImageNode {\r\n\r\n return {\r\n ...super.exportJSON(),\r\n type: this.getType(),\r\n version: 1,\r\n attrs: this.__attrs,\r\n }\r\n }\r\n\r\n exportDOM(): DOMExportOutput {\r\n\r\n const element = document.createElement('img') \r\n\r\n element.setAttribute('src', this.__attrs.src) \r\n\r\n if(this.__attrs.alt != null){\r\n element.setAttribute('alt', this.__attrs.alt ?? \"\")\r\n }\r\n\r\n element.setAttribute(\"style\",this.getStyles().join(\";\"))\r\n \r\n return { element }\r\n }\r\n\r\n static importDOM(): DOMConversionMap | null {\r\n return {\r\n img: (dn: HTMLElement) => {\r\n return {\r\n conversion: (domNode: HTMLElement) => {\r\n const src = domNode.getAttribute('src');\r\n const alt = domNode.getAttribute('alt');\r\n return domNode.tagName.toLowerCase() == \"img\" && src != null ? { \r\n node:$createImageNode({\r\n src:src,\r\n alt:alt,\r\n width:domNode.style.width,\r\n height:domNode.style.height,\r\n maxWidth:domNode.style.maxWidth || \"100%\",\r\n maxHeight:domNode.style.maxHeight,\r\n margin:domNode.style.margin,\r\n float:domNode.style.float\r\n } as ImageAttrs) \r\n } : null;\r\n },\r\n priority: 0\r\n }\r\n },\r\n }\r\n }\r\n\r\n setFloat(pos?:string){\r\n this.__attrs.float = pos;\r\n }\r\n\r\n getStyles():string[]{\r\n\r\n const style : string[] = [];\r\n\r\n if(this.__attrs.width){\r\n style.push(\"width:\"+this.__attrs.width)\r\n }\r\n if(this.__attrs.height){\r\n style.push(\"height:\"+this.__attrs.height)\r\n }\r\n if(this.__attrs.float){\r\n style.push(\"float:\"+this.__attrs.float)\r\n }\r\n if(this.__attrs.maxWidth){\r\n style.push(\"max-width:\"+this.__attrs.maxWidth)\r\n }\r\n if(this.__attrs.maxHeight){\r\n style.push(\"max-height:\"+this.__attrs.maxHeight)\r\n }\r\n if(this.__attrs.float){\r\n style.push(\"float:\"+this.__attrs.float)\r\n }\r\n if(this.__attrs.margin){\r\n style.push(\"margin:\"+this.__attrs.margin)\r\n }\r\n\r\n return style\r\n }\r\n\r\n updateDOM(): false {\r\n return false\r\n }\r\n\r\n getTextContent(\r\n _includeInert?: boolean | undefined,\r\n _includeDirectionless?: false | undefined,\r\n ): string {\r\n return this.__attrs.src\r\n }\r\n\r\n decorate(_editor: LexicalEditor, config: EditorConfig): Component {\r\n const embedBlockTheme = config.theme.embedBlock || {}\r\n return h(DocImageComponent, {\r\n baseClass: embedBlockTheme.base || '',\r\n focusClass: embedBlockTheme.focus || '',\r\n format: this.__format,\r\n nodeKey: this.getKey(),\r\n attrs: this.__attrs\r\n })\r\n }\r\n isInline() {\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * 创建图片节点\r\n * @param src \r\n * @returns \r\n */\r\nexport function $createImageNode(attrs: ImageAttrs): ImageNode {\r\n return new ImageNode(attrs)\r\n}\r\n\r\n/**\r\n * 判断是否是图片节点\r\n * @param node \r\n * @returns \r\n */\r\nexport function $isImageNode(\r\n node: ImageNode | LexicalNode | null | undefined,\r\n): node is ImageNode {\r\n return node instanceof ImageNode\r\n}\r\n"],"names":["createCommand","DecoratorBlockNode","h"],"mappings":"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"}
|
|
@@ -3,27 +3,7 @@ const vue = require("vue");
|
|
|
3
3
|
const utils = require("@lexical/utils");
|
|
4
4
|
const lexical = require("lexical");
|
|
5
5
|
const richText = require("@lexical/rich-text");
|
|
6
|
-
require("
|
|
7
|
-
require("@lexical/overflow");
|
|
8
|
-
require("tiny-invariant");
|
|
9
|
-
require("@lexical/history");
|
|
10
|
-
const useLexicalComposer = require("../../lexical-vue/composables/useLexicalComposer.js");
|
|
11
|
-
require("@lexical/list");
|
|
12
|
-
require("@lexical/dragon");
|
|
13
|
-
require("@lexical/plain-text");
|
|
14
|
-
require("@lexical/yjs");
|
|
15
|
-
require("yjs");
|
|
16
|
-
require("../../lexical-vue/components/LexicalDecoratedTeleports.js");
|
|
17
|
-
require("@lexical/html");
|
|
18
|
-
require("@lexical/link");
|
|
19
|
-
require("@lexical/mark");
|
|
20
|
-
require("@lexical/table");
|
|
21
|
-
require("@lexical/hashtag");
|
|
22
|
-
require("@lexical/markdown");
|
|
23
|
-
require("../../lexical-vue/composables/useCollaborationContext.js");
|
|
24
|
-
require("../../lexical-vue/components/LexicalMenu/shared.js");
|
|
25
|
-
require("../../lexical-vue/components/LexicalAutoEmbedPlugin/shared.js");
|
|
26
|
-
require("../../lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js");
|
|
6
|
+
const lexicalVue = require("lexical-vue");
|
|
27
7
|
const index = require("./index.js");
|
|
28
8
|
const defines = require("../ToolbarPlugin/defines.js");
|
|
29
9
|
const ImageEditPanel = require("./ImageEditPanel.js");
|
|
@@ -37,7 +17,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
37
17
|
"image/gif",
|
|
38
18
|
"image/webp"
|
|
39
19
|
];
|
|
40
|
-
const editor =
|
|
20
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
41
21
|
vue.onMounted(() => {
|
|
42
22
|
if (!editor.hasNodes([index.ImageNode])) {
|
|
43
23
|
throw new Error("ImagePlugin: 图片节点未注册!");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImagePlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { $insertNodeToNearestRoot,mergeRegister,mediaFileReader,isMimeType } from '@lexical/utils'\r\nimport { COMMAND_PRIORITY_EDITOR,COMMAND_PRIORITY_LOW,$getSelection } from 'lexical'\r\nimport { DRAG_DROP_PASTE } from '@lexical/rich-text'\r\nimport { useLexicalComposer } from '
|
|
1
|
+
{"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImagePlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { $insertNodeToNearestRoot,mergeRegister,mediaFileReader,isMimeType } from '@lexical/utils'\r\nimport { COMMAND_PRIORITY_EDITOR,COMMAND_PRIORITY_LOW,$getSelection } from 'lexical'\r\nimport { DRAG_DROP_PASTE } from '@lexical/rich-text'\r\nimport { useLexicalComposer } from 'lexical-vue'\r\nimport { onMounted, onUnmounted } from 'vue'\r\nimport { INSERT_IMAGE_COMMAND,$createImageNode,ImageNode,type ImageAttrs } from './index'\r\nimport { RegisterToolbarExtend,type ToolbarExtendPlugin } from \"../ToolbarPlugin/defines\"\r\nimport { ShowImageEditPanel } from \"./ImageEditPanel\"\r\n\r\nconst ACCEPTABLE_IMAGE_TYPES = [\r\n 'image/',\r\n 'image/heic',\r\n 'image/heif',\r\n 'image/gif',\r\n 'image/webp',\r\n]\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nonMounted(() => {\r\n\r\n if (!editor.hasNodes([ImageNode])){\r\n throw new Error('ImagePlugin: 图片节点未注册!')\r\n }\r\n\r\n // 注册到工具条\r\n RegisterToolbarExtend({\r\n icon:\"Picture\",\r\n text:\"图片\",\r\n action:async ()=>{\r\n // 显示图片编辑面板\r\n ShowImageEditPanel({\r\n src:\"\", alt:\"\", width:\"\", height:\"\", maxWidth:\"100%\", maxHeight:\"\", margin:\"\"\r\n } as ImageAttrs).then((data:any)=>{\r\n editor.dispatchCommand(INSERT_IMAGE_COMMAND,data as ImageAttrs)\r\n });\r\n },\r\n sort:11\r\n } as ToolbarExtendPlugin)\r\n\r\n // 注册指令\r\n const unregister = mergeRegister(\r\n\r\n // 插入图片\r\n editor.registerCommand<ImageAttrs>(INSERT_IMAGE_COMMAND,(payload) => {\r\n $insertNodeToNearestRoot($createImageNode(payload))\r\n return true\r\n },COMMAND_PRIORITY_EDITOR),\r\n\r\n // 剪切板图片\r\n editor.registerCommand(DRAG_DROP_PASTE,(files) => {\r\n\r\n (async () => {\r\n\r\n const filesResult = await mediaFileReader(files, [ACCEPTABLE_IMAGE_TYPES].flatMap((x) => x))\r\n\r\n for (const {file, result} of filesResult) {\r\n\r\n if (isMimeType(file, ACCEPTABLE_IMAGE_TYPES)) {\r\n\r\n editor.dispatchCommand(INSERT_IMAGE_COMMAND, {\r\n src:result,\r\n alt:file.name,\r\n maxWidth:\":100%\"\r\n } as ImageAttrs)\r\n }\r\n }\r\n })()\r\n\r\n return true\r\n },COMMAND_PRIORITY_LOW)\r\n );\r\n\r\n onUnmounted(() => unregister())\r\n})\r\n</script>\r\n\r\n<template />\r\n"],"names":["useLexicalComposer","onMounted","ImageNode","RegisterToolbarExtend","ShowImageEditPanel","INSERT_IMAGE_COMMAND","mergeRegister","$insertNodeToNearestRoot","$createImageNode","COMMAND_PRIORITY_EDITOR","DRAG_DROP_PASTE","mediaFileReader","isMimeType","COMMAND_PRIORITY_LOW","onUnmounted"],"mappings":";;;;;;;;;;;;AAUA,UAAM,yBAAyB;AAAA,MAC7B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,UAAM,SAASA,WAAAA;AAEfC,QAAAA,UAAU,MAAM;AAEd,UAAI,CAAC,OAAO,SAAS,CAACC,MAAAA,SAAS,CAAC,GAAE;AAC1B,cAAA,IAAI,MAAM,uBAAuB;AAAA,MACzC;AAGsBC,oCAAA;AAAA,QACpB,MAAK;AAAA,QACL,MAAK;AAAA,QACL,QAAO,YAAU;AAEIC,4CAAA;AAAA,YACjB,KAAI;AAAA,YAAI,KAAI;AAAA,YAAI,OAAM;AAAA,YAAI,QAAO;AAAA,YAAI,UAAS;AAAA,YAAQ,WAAU;AAAA,YAAI,QAAO;AAAA,UAAA,CAC9D,EAAE,KAAK,CAAC,SAAW;AACzB,mBAAA,gBAAgBC,4BAAqB,IAAkB;AAAA,UAAA,CAC/D;AAAA,QACH;AAAA,QACA,MAAK;AAAA,MAAA,CACiB;AAGxB,YAAM,aAAaC,MAAA;AAAA;AAAA,QAGjB,OAAO,gBAA4BD,4BAAqB,CAAC,YAAY;AAC1CE,yCAAAC,MAAAA,iBAAiB,OAAO,CAAC;AAC3C,iBAAA;AAAA,WACPC,+BAAuB;AAAA;AAAA,QAGzB,OAAO,gBAAgBC,0BAAgB,CAAC,UAAU;AAEhD,WAAC,YAAY;AAEL,kBAAA,cAAc,MAAMC,sBAAgB,OAAO,CAAC,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE3F,uBAAW,EAAC,MAAM,OAAM,KAAK,aAAa;AAEpC,kBAAAC,MAAA,WAAW,MAAM,sBAAsB,GAAG;AAE5C,uBAAO,gBAAgBP,4BAAsB;AAAA,kBAC3C,KAAI;AAAA,kBACJ,KAAI,KAAK;AAAA,kBACT,UAAS;AAAA,gBAAA,CACI;AAAA,cACjB;AAAA,YACF;AAAA,UAAA;AAGK,iBAAA;AAAA,WACPQ,4BAAoB;AAAA,MAAA;AAGZC,sBAAA,MAAM,YAAY;AAAA,IAAA,CAC/B;;;;;;;"}
|
|
@@ -1,35 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
require("
|
|
3
|
+
const lexicalVue = require("lexical-vue");
|
|
4
4
|
const utils = require("@lexical/utils");
|
|
5
|
-
require("@lexical/overflow");
|
|
6
5
|
const lexical = require("lexical");
|
|
7
|
-
require("tiny-invariant");
|
|
8
|
-
require("@lexical/history");
|
|
9
|
-
const useLexicalComposer = require("../../lexical-vue/composables/useLexicalComposer.js");
|
|
10
|
-
require("@lexical/list");
|
|
11
|
-
require("@lexical/dragon");
|
|
12
|
-
require("@lexical/plain-text");
|
|
13
|
-
require("@lexical/rich-text");
|
|
14
|
-
require("@lexical/yjs");
|
|
15
|
-
require("yjs");
|
|
16
|
-
require("../../lexical-vue/components/LexicalDecoratedTeleports.js");
|
|
17
|
-
require("@lexical/html");
|
|
18
|
-
require("@lexical/link");
|
|
19
|
-
require("@lexical/mark");
|
|
20
|
-
require("@lexical/table");
|
|
21
|
-
require("@lexical/hashtag");
|
|
22
|
-
require("@lexical/markdown");
|
|
23
|
-
require("../../lexical-vue/composables/useCollaborationContext.js");
|
|
24
|
-
require("../../lexical-vue/components/LexicalMenu/shared.js");
|
|
25
|
-
require("../../lexical-vue/components/LexicalAutoEmbedPlugin/shared.js");
|
|
26
|
-
require("../../lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js");
|
|
27
6
|
const index = require("./index.js");
|
|
28
7
|
const defines = require("../ToolbarPlugin/defines.js");
|
|
29
8
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
30
9
|
__name: "index",
|
|
31
10
|
setup(__props) {
|
|
32
|
-
const editor =
|
|
11
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
33
12
|
vue.onMounted(() => {
|
|
34
13
|
if (!editor.hasNodes([index.ImageTextNode])) {
|
|
35
14
|
throw new Error("ImageTextPlugin: 图文节点未注册!");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { useLexicalComposer } from '
|
|
1
|
+
{"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/ImageTextPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { useLexicalComposer } from 'lexical-vue'\r\nimport { $insertNodeToNearestRoot,mergeRegister } from '@lexical/utils'\r\nimport { COMMAND_PRIORITY_EDITOR,COMMAND_PRIORITY_LOW,$getSelection,CLICK_COMMAND } from 'lexical'\r\n\r\nimport { onMounted, onUnmounted } from 'vue'\r\nimport { INSERT_IMAGETEXT_COMMAND,ImageTextNode,$createImageTextNode } from './index'\r\nimport { ImageAttrs } from '../ImagePlugin/index'\r\nimport { RegisterToolbarExtend,type ToolbarExtendPlugin } from \"../ToolbarPlugin/defines\"\r\n\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nonMounted(() => {\r\n\r\n if (!editor.hasNodes([ImageTextNode])){\r\n throw new Error('ImageTextPlugin: 图文节点未注册!')\r\n }\r\n \r\n // 注册到工具条\r\n RegisterToolbarExtend({\r\n icon:\"richtext-outline\",\r\n text:\"图文\",\r\n action:async ()=>{\r\n editor.dispatchCommand(INSERT_IMAGETEXT_COMMAND,{\r\n src:\"\",\r\n float:\"left\",\r\n width:\"200px\",\r\n margin:\"0 10px 10px 0\"\r\n })\r\n },\r\n sort:10\r\n } as ToolbarExtendPlugin)\r\n\r\n // 注册指令\r\n const unregister = mergeRegister(\r\n\r\n // 插入图片\r\n editor.registerCommand<ImageAttrs>(INSERT_IMAGETEXT_COMMAND,(payload) => {\r\n $insertNodeToNearestRoot($createImageTextNode(payload))\r\n return true\r\n },COMMAND_PRIORITY_EDITOR),\r\n // editor.registerCommand<MouseEvent>(CLICK_COMMAND,(event) => {\r\n\r\n // let dom = event.target as HTMLElement\r\n // let block = dom.parentElement\r\n\r\n // if(block?.classList.contains(ImageTextNode.getMakeClassName())){\r\n\r\n // event.preventDefault();\r\n // console.log(block);\r\n\r\n // // if (!event.shiftKey){ clearSelection() }\r\n \r\n // // setSelected(true)\r\n // // updateImageActiveBox();\r\n\r\n // return true\r\n // }\r\n\r\n // // if (event.target === selfElRef.value) {\r\n\r\n \r\n // // }\r\n // return false\r\n // },COMMAND_PRIORITY_LOW),\r\n );\r\n\r\n onUnmounted(() => unregister())\r\n})\r\n</script>\r\n\r\n<template />\r\n"],"names":["useLexicalComposer","onMounted","ImageTextNode","RegisterToolbarExtend","INSERT_IMAGETEXT_COMMAND","mergeRegister","$insertNodeToNearestRoot","$createImageTextNode","COMMAND_PRIORITY_EDITOR","onUnmounted"],"mappings":";;;;;;;;;;AAWA,UAAM,SAASA,WAAAA;AAEfC,QAAAA,UAAU,MAAM;AAEd,UAAI,CAAC,OAAO,SAAS,CAACC,MAAAA,aAAa,CAAC,GAAE;AAC9B,cAAA,IAAI,MAAM,2BAA2B;AAAA,MAC7C;AAGsBC,oCAAA;AAAA,QACpB,MAAK;AAAA,QACL,MAAK;AAAA,QACL,QAAO,YAAU;AACf,iBAAO,gBAAgBC,gCAAyB;AAAA,YAC9C,KAAI;AAAA,YACJ,OAAM;AAAA,YACN,OAAM;AAAA,YACN,QAAO;AAAA,UAAA,CACR;AAAA,QACH;AAAA,QACA,MAAK;AAAA,MAAA,CACiB;AAGxB,YAAM,aAAaC,MAAA;AAAA;AAAA,QAGjB,OAAO,gBAA4BD,gCAAyB,CAAC,YAAY;AAC9CE,yCAAAC,MAAAA,qBAAqB,OAAO,CAAC;AAC/C,iBAAA;AAAA,WACPC,+BAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAA;AA2BfC,sBAAA,MAAM,YAAY;AAAA,IAAA,CAC/B;;;;;;;"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
require("
|
|
4
|
-
require("@lexical/utils");
|
|
5
|
-
const useMounted = require("../composables/useMounted.js");
|
|
6
|
-
require("@lexical/overflow");
|
|
7
|
-
require("lexical");
|
|
8
|
-
require("tiny-invariant");
|
|
9
|
-
require("@lexical/history");
|
|
10
|
-
const useLexicalComposer = require("../composables/useLexicalComposer.js");
|
|
11
|
-
require("@lexical/list");
|
|
12
|
-
require("@lexical/dragon");
|
|
13
|
-
require("@lexical/plain-text");
|
|
14
|
-
require("@lexical/rich-text");
|
|
15
|
-
require("@lexical/yjs");
|
|
16
|
-
require("yjs");
|
|
3
|
+
const lexicalVue = require("lexical-vue");
|
|
17
4
|
const _hoisted_1 = ["id", "aria-activedescendant", "aria-autocomplete", "aria-controls", "aria-describedby", "aria-expanded", "aria-label", "aria-labelledby", "aria-multiline", "aria-owns", "aria-required", "autocapitalize", "autocomplete", "autocorrect", "contenteditable", "role", "spellcheck", "tabindex"];
|
|
18
5
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
19
|
-
__name: "
|
|
6
|
+
__name: "ContentEditable",
|
|
20
7
|
props: {
|
|
21
8
|
ariaActivedescendant: {},
|
|
22
9
|
ariaAutocomplete: {},
|
|
@@ -40,9 +27,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
27
|
},
|
|
41
28
|
setup(__props) {
|
|
42
29
|
const root = vue.ref(null);
|
|
43
|
-
const editor =
|
|
30
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
44
31
|
const editable = vue.ref(false);
|
|
45
|
-
|
|
32
|
+
lexicalVue.useMounted(() => {
|
|
46
33
|
if (root.value) {
|
|
47
34
|
editor.setRootElement(root.value);
|
|
48
35
|
editable.value = editor.isEditable();
|
|
@@ -79,4 +66,4 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
66
|
}
|
|
80
67
|
});
|
|
81
68
|
module.exports = _sfc_main;
|
|
82
|
-
//# sourceMappingURL=
|
|
69
|
+
//# sourceMappingURL=ContentEditable.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"ContentEditable.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport { useLexicalComposer,useMounted } from 'lexical-vue'\r\n\r\nwithDefaults(defineProps<{\r\n ariaActivedescendant?: string\r\n ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both'\r\n ariaControls?: string\r\n ariaDescribedby?: string\r\n ariaExpanded?: boolean\r\n ariaLabel?: string\r\n ariaLabelledby?: string\r\n ariaMultiline?: boolean\r\n ariaOwns?: string\r\n ariaRequired?: boolean\r\n autoCapitalize?: boolean\r\n autoComplete?: boolean\r\n autoCorrect?: boolean\r\n id?: string\r\n editable?: boolean\r\n role?: string\r\n spellcheck?: boolean\r\n tabindex?: number\r\n enableGrammarly?: boolean\r\n}>(), {\r\n role: 'textbox',\r\n spellcheck: true,\r\n})\r\nconst root = ref<HTMLElement | null>(null)\r\nconst editor = useLexicalComposer()\r\n\r\nconst editable = ref(false)\r\n\r\nuseMounted(() => {\r\n if (root.value) {\r\n editor.setRootElement(root.value as HTMLElement)\r\n editable.value = editor.isEditable()\r\n }\r\n\r\n return editor.registerEditableListener((currentIsEditable) => {\r\n editable.value = currentIsEditable\r\n })\r\n})\r\n</script>\r\n\r\n<template>\r\n <div\r\n :id=\"id\"\r\n ref=\"root\"\r\n class=\"mk-doc-editor-stage\"\r\n :aria-activedescendant=\"!editable ? undefined : ariaActivedescendant\"\r\n :aria-autocomplete=\"!editable ? undefined : ariaAutocomplete\"\r\n :aria-controls=\"!editable ? undefined : ariaControls\"\r\n :aria-describedby=\"ariaDescribedby\"\r\n :aria-expanded=\"!editable ? undefined : role === 'combobox' ? !!ariaExpanded ? ariaExpanded : undefined : undefined\"\r\n :aria-label=\"ariaLabel\"\r\n :aria-labelledby=\"ariaLabelledby\"\r\n :aria-multiline=\"ariaMultiline\"\r\n :aria-owns=\"!editable ? undefined : ariaOwns\"\r\n :aria-required=\"ariaRequired\"\r\n :autocapitalize=\"`${autoCapitalize}`\"\r\n :autocomplete=\"autoComplete\"\r\n :autocorrect=\"`${autoCorrect}`\"\r\n :contenteditable=\"editable\"\r\n :role=\"!editable ? undefined : role\"\r\n :spellcheck=\"spellcheck\"\r\n :tabindex=\"tabindex\">\r\n </div>\r\n</template>\r\n"],"names":["ref","useLexicalComposer","useMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BM,UAAA,OAAOA,QAAwB,IAAI;AACzC,UAAM,SAASC,WAAAA;AAET,UAAA,WAAWD,QAAI,KAAK;AAE1BE,eAAAA,WAAW,MAAM;AACf,UAAI,KAAK,OAAO;AACP,eAAA,eAAe,KAAK,KAAoB;AACtC,iBAAA,QAAQ,OAAO;MAC1B;AAEO,aAAA,OAAO,yBAAyB,CAAC,sBAAsB;AAC5D,iBAAS,QAAQ;AAAA,MAAA,CAClB;AAAA,IAAA,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue2.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentEditable.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const lexicalVue = require("lexical-vue");
|
|
4
|
+
const DecoratedTeleports = vue.defineComponent({
|
|
5
|
+
name: "LexicalDecoratedTeleports",
|
|
6
|
+
setup() {
|
|
7
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
8
|
+
const decorators = lexicalVue.useDecorators(editor);
|
|
9
|
+
return () => decorators.value;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
module.exports = DecoratedTeleports;
|
|
13
|
+
//# sourceMappingURL=DecoratedTeleports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecoratedTeleports.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.ts"],"sourcesContent":["import { defineComponent } from 'vue'\r\nimport { useLexicalComposer,useDecorators } from 'lexical-vue'\r\n\r\nexport default defineComponent({\r\n name: 'LexicalDecoratedTeleports',\r\n setup() {\r\n const editor = useLexicalComposer()\r\n const decorators = useDecorators(editor)\r\n\r\n return () => decorators.value\r\n },\r\n})\r\n"],"names":["defineComponent","useLexicalComposer","useDecorators"],"mappings":";;;AAGA,MAAA,qBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,QAAQ;AACN,UAAM,SAASC,WAAAA;AACT,UAAA,aAAaC,yBAAc,MAAM;AAEvC,WAAO,MAAM,WAAW;AAAA,EAC1B;AACF,CAAC;;"}
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
4
|
-
require("@lexical/overflow");
|
|
5
|
-
require("@lexical/text");
|
|
6
|
-
require("@lexical/utils");
|
|
3
|
+
const lexicalVue = require("lexical-vue");
|
|
7
4
|
const lexical = require("lexical");
|
|
8
|
-
require("tiny-invariant");
|
|
9
|
-
require("@lexical/history");
|
|
10
|
-
const useLexicalComposer = require("../composables/useLexicalComposer.js");
|
|
11
|
-
require("@lexical/list");
|
|
12
|
-
require("@lexical/dragon");
|
|
13
|
-
require("@lexical/plain-text");
|
|
14
|
-
const useRichTextSetup = require("../composables/useRichTextSetup.js");
|
|
15
|
-
require("@lexical/rich-text");
|
|
16
|
-
require("@lexical/yjs");
|
|
17
|
-
require("yjs");
|
|
18
|
-
const LexicalDecoratedTeleports = require("./LexicalDecoratedTeleports.js");
|
|
19
5
|
const html = require("@lexical/html");
|
|
6
|
+
const ContentEditable_vue_vue_type_script_setup_true_lang = require("./ContentEditable.vue.js");
|
|
7
|
+
const DecoratedTeleports = require("./DecoratedTeleports.js");
|
|
20
8
|
const _hoisted_1 = { class: "mk-doc-editor__stage__editable" };
|
|
9
|
+
const _hoisted_2 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "mk-doc-editor__stage__placeholder mk-doc__paragraph"
|
|
12
|
+
};
|
|
21
13
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22
|
-
__name: "
|
|
14
|
+
__name: "index",
|
|
23
15
|
props: {
|
|
24
|
-
content: { type: String, default: `` }
|
|
16
|
+
content: { type: String, default: `` },
|
|
17
|
+
placeholder: { type: String, default: `` }
|
|
25
18
|
},
|
|
26
|
-
emits: ["change"],
|
|
19
|
+
emits: ["change", "init"],
|
|
27
20
|
setup(__props, { emit: __emit }) {
|
|
28
21
|
const emit = __emit;
|
|
29
22
|
const props = __props;
|
|
30
|
-
const editor =
|
|
31
|
-
const canShowPlaceholder =
|
|
23
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
24
|
+
const canShowPlaceholder = lexicalVue.useCanShowPlaceholder(editor);
|
|
32
25
|
const parser = new DOMParser();
|
|
33
26
|
const htmlContent = vue.ref("");
|
|
34
27
|
const contentIsEmpty = vue.computed(() => htmlContent.value == `<p class="mk-doc__paragraph"><br></p>` || !htmlContent.value);
|
|
@@ -39,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
32
|
editor.update(() => {
|
|
40
33
|
var _a, _b;
|
|
41
34
|
if (html$1.trim()) {
|
|
42
|
-
nodes = html.$generateNodesFromDOM(editor, parser.parseFromString(html$1.trim(), "text/html"));
|
|
35
|
+
nodes = [...html.$generateNodesFromDOM(editor, parser.parseFromString(html$1.trim(), "text/html"))];
|
|
43
36
|
}
|
|
44
37
|
lexical.$selectAll();
|
|
45
38
|
if (nodes.length > 0) {
|
|
@@ -51,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
44
|
}
|
|
52
45
|
};
|
|
53
46
|
vue.onMounted(() => {
|
|
47
|
+
emit("init", editor);
|
|
54
48
|
vue.watch(() => props.content, setHtml, { immediate: true });
|
|
55
49
|
vue.watch(htmlContent, (value) => emit("change", value));
|
|
56
50
|
const unregisterMergeListener = editor.registerUpdateListener(({ editorState }) => {
|
|
@@ -60,15 +54,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
60
54
|
});
|
|
61
55
|
vue.onUnmounted(() => unregisterMergeListener());
|
|
62
56
|
});
|
|
63
|
-
|
|
57
|
+
lexicalVue.useRichTextSetup(editor);
|
|
64
58
|
return (_ctx, _cache) => {
|
|
65
59
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
66
|
-
vue.
|
|
67
|
-
vue.unref(canShowPlaceholder) && contentIsEmpty.value ? vue.
|
|
68
|
-
vue.createVNode(vue.unref(
|
|
60
|
+
vue.createVNode(ContentEditable_vue_vue_type_script_setup_true_lang),
|
|
61
|
+
vue.unref(canShowPlaceholder) && contentIsEmpty.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, vue.toDisplayString(props.placeholder), 1)) : vue.createCommentVNode("", true),
|
|
62
|
+
vue.createVNode(vue.unref(DecoratedTeleports))
|
|
69
63
|
]);
|
|
70
64
|
};
|
|
71
65
|
}
|
|
72
66
|
});
|
|
73
67
|
module.exports = _sfc_main;
|
|
74
|
-
//# sourceMappingURL=
|
|
68
|
+
//# sourceMappingURL=index.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/RichTextPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\n\r\nimport { ref,defineProps,computed,defineEmits,onMounted,onUnmounted,watch } from \"vue\"\r\nimport { useCanShowPlaceholder, useLexicalComposer, useRichTextSetup} from 'lexical-vue'\r\nimport { $getRoot, $getSelection ,$createRangeSelection,$selectAll } from 'lexical'\r\nimport { $generateHtmlFromNodes,$generateNodesFromDOM } from '@lexical/html'\r\nimport ContentEditable from \"./ContentEditable.vue\"\r\nimport DecoratedTeleports from \"./DecoratedTeleports\"\r\n\r\n// 事件\r\nconst emit = defineEmits([\"change\",\"init\"]);\r\n\r\n// 参数\r\nconst props = defineProps({\r\n content:{ type:String,default:`` },\r\n placeholder:{ type:String,default:`` }\r\n})\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nconst canShowPlaceholder = useCanShowPlaceholder(editor)\r\n\r\nconst parser = new DOMParser();\r\n\r\n// html 内容\r\nconst htmlContent = ref(\"\");\r\n\r\n// 空内容\r\nconst contentIsEmpty = computed(()=>htmlContent.value == `<p class=\"mk-doc__paragraph\"><br></p>` || !htmlContent.value);\r\n\r\n// 设置 HTML\r\nconst setHtml = (html : any)=>{\r\n\r\n // 内容不同则重置 \r\n if(htmlContent.value != html){\r\n\r\n let nodes : Array<any> = [];\r\n\r\n htmlContent.value = html;\r\n\r\n editor.update(()=>{\r\n\r\n if(html.trim()){\r\n \r\n // Once you have the DOM instance it's easy to generate LexicalNodes.\r\n nodes = [...$generateNodesFromDOM(editor,parser.parseFromString(html.trim(),\"text/html\"))];\r\n\r\n }\r\n // 设置权限替换\r\n $selectAll();\r\n\r\n if(nodes.length > 0){\r\n $getSelection()?.insertNodes(nodes);\r\n }\r\n else{\r\n $getSelection()?.insertText(\"\")\r\n }\r\n })\r\n }\r\n}\r\n\r\n\r\nonMounted(()=>{\r\n\r\n emit(\"init\",editor)\r\n \r\n // 初始化\r\n watch(()=>props.content,setHtml,{ immediate:true });\r\n\r\n // 监听内容变化\r\n watch(htmlContent,(value:any)=>emit('change',value));\r\n\r\n // 更新操作\r\n const unregisterMergeListener = editor.registerUpdateListener(({ editorState }) => {\r\n editorState.read(() => {\r\n htmlContent.value = $generateHtmlFromNodes(editor);\r\n })\r\n })\r\n\r\n // 取消\r\n onUnmounted(() => unregisterMergeListener());\r\n\r\n})\r\n\r\n// 使用富文本\r\nuseRichTextSetup(editor)\r\n\r\n</script>\r\n\r\n<template>\r\n <div class=\"mk-doc-editor__stage__editable\">\r\n <ContentEditable />\r\n <template v-if=\"canShowPlaceholder && contentIsEmpty\">\r\n <div class=\"mk-doc-editor__stage__placeholder mk-doc__paragraph\">\r\n {{props.placeholder}}\r\n </div>\r\n </template>\r\n <DecoratedTeleports />\r\n </div>\r\n\r\n</template>\r\n"],"names":["useLexicalComposer","useCanShowPlaceholder","ref","computed","html","$generateNodesFromDOM","$selectAll","$getSelection","onMounted","watch","$generateHtmlFromNodes","onUnmounted","useRichTextSetup"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,UAAM,OAAO;AAGb,UAAM,QAAQ;AAKd,UAAM,SAASA,WAAAA;AAET,UAAA,qBAAqBC,iCAAsB,MAAM;AAEjD,UAAA,SAAS,IAAI;AAGb,UAAA,cAAcC,QAAI,EAAE;AAGpB,UAAA,iBAAiBC,aAAS,MAAI,YAAY,SAAS,2CAA2C,CAAC,YAAY,KAAK;AAGhH,UAAA,UAAU,CAACC,WAAa;AAGvB,UAAA,YAAY,SAASA,QAAK;AAE3B,YAAI,QAAqB,CAAA;AAEzB,oBAAY,QAAQA;AAEpB,eAAO,OAAO,MAAI;;AAEb,cAAAA,OAAK,QAAO;AAGL,oBAAA,CAAC,GAAGC,2BAAsB,QAAO,OAAO,gBAAgBD,OAAK,KAAK,GAAE,WAAW,CAAC,CAAC;AAAA,UAE3F;AAEWE,kBAAAA;AAER,cAAA,MAAM,SAAS,GAAE;AACJC,wCAAA,MAAAA,mBAAG,YAAY;AAAA,UAAK,OAEhC;AACYA,wCAAA,MAAAA,mBAAG,WAAW;AAAA,UAC9B;AAAA,QAAA,CACD;AAAA,MACH;AAAA,IAAA;AAIJC,QAAAA,UAAU,MAAI;AAEZ,WAAK,QAAO,MAAM;AAGlBC,UAAA,MAAM,MAAI,MAAM,SAAQ,SAAQ,EAAE,WAAU,MAAM;AAGlDA,UAAA,MAAM,aAAY,CAAC,UAAY,KAAK,UAAS,KAAK,CAAC;AAGnD,YAAM,0BAA0B,OAAO,uBAAuB,CAAC,EAAE,kBAAkB;AACjF,oBAAY,KAAK,MAAM;AACT,sBAAA,QAAQC,4BAAuB,MAAM;AAAA,QAAA,CAClD;AAAA,MAAA,CACF;AAGWC,sBAAA,MAAM,yBAAyB;AAAA,IAAA,CAE5C;AAGDC,eAAA,iBAAiB,MAAM;;;;;;;;;;;"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const lexical = require("lexical");
|
|
4
|
+
class RichTextNode extends lexical.TextNode {
|
|
5
|
+
static getType() {
|
|
6
|
+
return "rich-text";
|
|
7
|
+
}
|
|
8
|
+
static clone(node) {
|
|
9
|
+
return new RichTextNode(node.__key);
|
|
10
|
+
}
|
|
11
|
+
static importJSON(serializedNode) {
|
|
12
|
+
return lexical.TextNode.importJSON(serializedNode);
|
|
13
|
+
}
|
|
14
|
+
static importDOM() {
|
|
15
|
+
return {
|
|
16
|
+
b: () => ({
|
|
17
|
+
conversion: convertBringAttentionToElement,
|
|
18
|
+
priority: 4
|
|
19
|
+
}),
|
|
20
|
+
code: () => ({
|
|
21
|
+
conversion: convertTextFormatElement,
|
|
22
|
+
priority: 4
|
|
23
|
+
}),
|
|
24
|
+
em: () => ({
|
|
25
|
+
conversion: convertTextFormatElement,
|
|
26
|
+
priority: 4
|
|
27
|
+
}),
|
|
28
|
+
i: () => ({
|
|
29
|
+
conversion: convertTextFormatElement,
|
|
30
|
+
priority: 4
|
|
31
|
+
}),
|
|
32
|
+
s: () => ({
|
|
33
|
+
conversion: convertTextFormatElement,
|
|
34
|
+
priority: 4
|
|
35
|
+
}),
|
|
36
|
+
span: () => ({
|
|
37
|
+
conversion: convertSpanElement,
|
|
38
|
+
priority: 4
|
|
39
|
+
}),
|
|
40
|
+
strong: () => ({
|
|
41
|
+
conversion: convertTextFormatElement,
|
|
42
|
+
priority: 4
|
|
43
|
+
}),
|
|
44
|
+
sub: () => ({
|
|
45
|
+
conversion: convertTextFormatElement,
|
|
46
|
+
priority: 4
|
|
47
|
+
}),
|
|
48
|
+
sup: () => ({
|
|
49
|
+
conversion: convertTextFormatElement,
|
|
50
|
+
priority: 4
|
|
51
|
+
}),
|
|
52
|
+
u: () => ({
|
|
53
|
+
conversion: convertTextFormatElement,
|
|
54
|
+
priority: 4
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
constructor(text, key) {
|
|
59
|
+
super(text, key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function convertBringAttentionToElement(domNode) {
|
|
63
|
+
const b = domNode;
|
|
64
|
+
const hasNormalFontWeight = b.style.fontWeight === "normal";
|
|
65
|
+
return {
|
|
66
|
+
forChild: applyTextFormatFromStyle(b.style, hasNormalFontWeight ? void 0 : "bold"),
|
|
67
|
+
node: null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var nodeNameToTextFormat = {
|
|
71
|
+
code: "code",
|
|
72
|
+
em: "italic",
|
|
73
|
+
i: "italic",
|
|
74
|
+
s: "strikethrough",
|
|
75
|
+
strong: "bold",
|
|
76
|
+
sub: "subscript",
|
|
77
|
+
sup: "superscript",
|
|
78
|
+
u: "underline"
|
|
79
|
+
};
|
|
80
|
+
function convertTextFormatElement(domNode) {
|
|
81
|
+
const format = nodeNameToTextFormat[domNode.nodeName.toLowerCase()];
|
|
82
|
+
if (format === void 0) {
|
|
83
|
+
return {
|
|
84
|
+
node: null
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
forChild: applyTextFormatFromStyle(domNode.style, format),
|
|
89
|
+
node: null
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function convertSpanElement(domNode) {
|
|
93
|
+
const span = domNode;
|
|
94
|
+
const style = span.style;
|
|
95
|
+
return {
|
|
96
|
+
forChild: applyTextFormatFromStyle(style, null),
|
|
97
|
+
node: null
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function applyTextFormatFromStyle(style, shouldApply) {
|
|
101
|
+
const fontWeight = style.fontWeight;
|
|
102
|
+
const textDecoration = style.textDecoration.split(" ");
|
|
103
|
+
const hasBoldFontWeight = fontWeight === "700" || fontWeight === "bold";
|
|
104
|
+
const hasLinethroughTextDecoration = textDecoration.includes("line-through");
|
|
105
|
+
const hasItalicFontStyle = style.fontStyle === "italic";
|
|
106
|
+
const hasUnderlineTextDecoration = textDecoration.includes("underline");
|
|
107
|
+
const verticalAlign = style.verticalAlign;
|
|
108
|
+
return (lexicalNode) => {
|
|
109
|
+
if (!lexical.$isTextNode(lexicalNode)) {
|
|
110
|
+
return lexicalNode;
|
|
111
|
+
}
|
|
112
|
+
let styleStr = "";
|
|
113
|
+
if (style.color) {
|
|
114
|
+
styleStr += `color:${style.color};`;
|
|
115
|
+
}
|
|
116
|
+
if (style.fontSize) {
|
|
117
|
+
styleStr += `font-size:${style.fontSize};`;
|
|
118
|
+
}
|
|
119
|
+
if (style.fontFamily) {
|
|
120
|
+
styleStr += `font-family:${style.fontFamily};`;
|
|
121
|
+
}
|
|
122
|
+
if (style.backgroundColor) {
|
|
123
|
+
styleStr += `background-color:${style.backgroundColor};`;
|
|
124
|
+
}
|
|
125
|
+
if (styleStr) {
|
|
126
|
+
lexicalNode.setStyle(styleStr);
|
|
127
|
+
}
|
|
128
|
+
if (hasBoldFontWeight && !lexicalNode.hasFormat("bold")) {
|
|
129
|
+
lexicalNode.toggleFormat("bold");
|
|
130
|
+
}
|
|
131
|
+
if (hasLinethroughTextDecoration && !lexicalNode.hasFormat("strikethrough")) {
|
|
132
|
+
lexicalNode.toggleFormat("strikethrough");
|
|
133
|
+
}
|
|
134
|
+
if (hasItalicFontStyle && !lexicalNode.hasFormat("italic")) {
|
|
135
|
+
lexicalNode.toggleFormat("italic");
|
|
136
|
+
}
|
|
137
|
+
if (hasUnderlineTextDecoration && !lexicalNode.hasFormat("underline")) {
|
|
138
|
+
lexicalNode.toggleFormat("underline");
|
|
139
|
+
}
|
|
140
|
+
if (verticalAlign === "sub" && !lexicalNode.hasFormat("subscript")) {
|
|
141
|
+
lexicalNode.toggleFormat("subscript");
|
|
142
|
+
}
|
|
143
|
+
if (verticalAlign === "super" && !lexicalNode.hasFormat("superscript")) {
|
|
144
|
+
lexicalNode.toggleFormat("superscript");
|
|
145
|
+
}
|
|
146
|
+
if (shouldApply && !lexicalNode.hasFormat(shouldApply)) {
|
|
147
|
+
lexicalNode.toggleFormat(shouldApply);
|
|
148
|
+
}
|
|
149
|
+
return lexicalNode;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
exports.RichTextNode = RichTextNode;
|
|
153
|
+
//# sourceMappingURL=RichTextNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextNode.js","sources":["../../../../../../../../src/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.ts"],"sourcesContent":["\r\n\r\nimport type { DOMConversionMap, LexicalCommand, LexicalNode, NodeKey, SerializedTextNode } from 'lexical'\r\nimport { $isTextNode,TextNode,$createTextNode } from 'lexical'\r\n\r\n/**\r\n * 富文本的文本节点\r\n */\r\nexport class RichTextNode extends TextNode{\r\n\r\n static getType(): string {\r\n return \"rich-text\";\r\n }\r\n\r\n static clone(node: RichTextNode): RichTextNode {\r\n return new RichTextNode(node.__key)\r\n }\r\n\r\n static importJSON(serializedNode: SerializedTextNode): TextNode {\r\n return TextNode.importJSON(serializedNode);\r\n }\r\n\r\n static importDOM(): DOMConversionMap | null {\r\n \r\n return {\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 constructor(text:string,key?: NodeKey) {\r\n super(text,key)\r\n }\r\n\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\"),\r\n node: null\r\n };\r\n}\r\n\r\nvar 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\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),\r\n node: null\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),\r\n node: null\r\n };\r\n}\r\n\r\nfunction applyTextFormatFromStyle(style:any, shouldApply:any) {\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 if (!$isTextNode(lexicalNode)) {\r\n return lexicalNode;\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 if(styleStr){\r\n lexicalNode.setStyle(styleStr);\r\n }\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 return lexicalNode;\r\n };\r\n}\r\n\r\n\r\n"],"names":["TextNode","$isTextNode"],"mappings":"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"}
|
|
@@ -4,27 +4,7 @@ const lexical = require("lexical");
|
|
|
4
4
|
const selection = require("@lexical/selection");
|
|
5
5
|
const richText = require("@lexical/rich-text");
|
|
6
6
|
const utils = require("@lexical/utils");
|
|
7
|
-
require("
|
|
8
|
-
require("@lexical/overflow");
|
|
9
|
-
require("tiny-invariant");
|
|
10
|
-
require("@lexical/history");
|
|
11
|
-
const useLexicalComposer = require("../../lexical-vue/composables/useLexicalComposer.js");
|
|
12
|
-
require("@lexical/list");
|
|
13
|
-
require("@lexical/dragon");
|
|
14
|
-
require("@lexical/plain-text");
|
|
15
|
-
require("@lexical/yjs");
|
|
16
|
-
require("yjs");
|
|
17
|
-
require("../../lexical-vue/components/LexicalDecoratedTeleports.js");
|
|
18
|
-
require("@lexical/html");
|
|
19
|
-
require("@lexical/link");
|
|
20
|
-
require("@lexical/mark");
|
|
21
|
-
require("@lexical/table");
|
|
22
|
-
require("@lexical/hashtag");
|
|
23
|
-
require("@lexical/markdown");
|
|
24
|
-
require("../../lexical-vue/composables/useCollaborationContext.js");
|
|
25
|
-
require("../../lexical-vue/components/LexicalMenu/shared.js");
|
|
26
|
-
require("../../lexical-vue/components/LexicalAutoEmbedPlugin/shared.js");
|
|
27
|
-
require("../../lexical-vue/components/LexicalTypeaheadMenuPlugin/shared.js");
|
|
7
|
+
const lexicalVue = require("lexical-vue");
|
|
28
8
|
const _hoisted_1 = {
|
|
29
9
|
key: 0,
|
|
30
10
|
class: "mk-doc-editor-toolbar-content-style-item text"
|
|
@@ -33,7 +13,7 @@ const _hoisted_2 = ["innerHTML"];
|
|
|
33
13
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
34
14
|
__name: "ContentStyleTool",
|
|
35
15
|
setup(__props) {
|
|
36
|
-
const editor =
|
|
16
|
+
const editor = lexicalVue.useLexicalComposer();
|
|
37
17
|
const CONTENT_TYPE_DEFINES = [
|
|
38
18
|
{ value: "paragraph", label: "正文" },
|
|
39
19
|
{ value: "h1", label: "标题 1" },
|