adtec-core-package 3.0.0 → 3.0.1
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/auto-imports.d.ts +299 -0
- package/package.json +94 -49
- package/prebuilt/umo-editor/favicon.ico +0 -0
- package/prebuilt/umo-editor/umo-editor.css +1 -0
- package/prebuilt/umo-editor/umo-editor.js +85998 -0
- package/prebuilt/umo-editor/umo-editor.js.map +1 -0
- package/scripts/build-umo.mjs +47 -0
- package/scripts/generate-umo-entry.mjs +81 -0
- package/scripts/inject-umo-composable-imports.mjs +66 -0
- package/scripts/patch-es-drager-vue35.mjs +68 -0
- package/scripts/patch-tiptap-vue3.mjs +117 -0
- package/scripts/prepare-umo-source.mjs +122 -0
- package/src/components/RichTextEditor/RichTextEditor.vue +566 -398
- package/src/components/RichTextEditor/installUmoEditorApp.ts +31 -0
- package/src/components/RichTextEditor/richTextHtmlUtils.ts +151 -17
- package/src/components/RichTextEditor/umo-editor.d.ts +9 -0
- package/src/components/editor-main/src/assets/icons/align-center.svg +1 -0
- package/src/components/editor-main/src/assets/icons/align-distributed.svg +1 -0
- package/src/components/editor-main/src/assets/icons/align-justify.svg +1 -0
- package/src/components/editor-main/src/assets/icons/align-left.svg +1 -0
- package/src/components/editor-main/src/assets/icons/align-right.svg +1 -0
- package/src/components/editor-main/src/assets/icons/arrow-down.svg +1 -0
- package/src/components/editor-main/src/assets/icons/audio.svg +1 -0
- package/src/components/editor-main/src/assets/icons/auto-width.svg +1 -0
- package/src/components/editor-main/src/assets/icons/background-color.svg +1 -0
- package/src/components/editor-main/src/assets/icons/barcode.svg +1 -0
- package/src/components/editor-main/src/assets/icons/block-add.svg +1 -0
- package/src/components/editor-main/src/assets/icons/block-menu.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bold.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bookmark.svg +10 -0
- package/src/components/editor-main/src/assets/icons/border-none.svg +1 -0
- package/src/components/editor-main/src/assets/icons/border.svg +1 -0
- package/src/components/editor-main/src/assets/icons/break-marks.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bullet-list-2.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bullet-list-circle.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bullet-list-disc.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bullet-list-square.svg +1 -0
- package/src/components/editor-main/src/assets/icons/bullet-list.svg +1 -0
- package/src/components/editor-main/src/assets/icons/callout.svg +1 -0
- package/src/components/editor-main/src/assets/icons/check.svg +1 -0
- package/src/components/editor-main/src/assets/icons/checkbox.svg +1 -0
- package/src/components/editor-main/src/assets/icons/chinese-case.svg +1 -0
- package/src/components/editor-main/src/assets/icons/clear-cache.svg +1 -0
- package/src/components/editor-main/src/assets/icons/clear-format.svg +1 -0
- package/src/components/editor-main/src/assets/icons/clickable.svg +1 -0
- package/src/components/editor-main/src/assets/icons/close.svg +1 -0
- package/src/components/editor-main/src/assets/icons/code-block.svg +1 -0
- package/src/components/editor-main/src/assets/icons/code-line-number.svg +1 -0
- package/src/components/editor-main/src/assets/icons/code-word-wrap.svg +1 -0
- package/src/components/editor-main/src/assets/icons/code.svg +1 -0
- package/src/components/editor-main/src/assets/icons/color.svg +1 -0
- package/src/components/editor-main/src/assets/icons/columns.svg +1 -0
- package/src/components/editor-main/src/assets/icons/copy.svg +1 -0
- package/src/components/editor-main/src/assets/icons/copyright.svg +1 -0
- package/src/components/editor-main/src/assets/icons/date.svg +1 -0
- package/src/components/editor-main/src/assets/icons/details.svg +1 -0
- package/src/components/editor-main/src/assets/icons/diagrams.svg +1 -0
- package/src/components/editor-main/src/assets/icons/download.svg +1 -0
- package/src/components/editor-main/src/assets/icons/echarts.svg +1 -0
- package/src/components/editor-main/src/assets/icons/edit.svg +1 -0
- package/src/components/editor-main/src/assets/icons/embed.svg +1 -0
- package/src/components/editor-main/src/assets/icons/emoji.svg +1 -0
- package/src/components/editor-main/src/assets/icons/equal-proportion.svg +1 -0
- package/src/components/editor-main/src/assets/icons/exit.svg +1 -0
- package/src/components/editor-main/src/assets/icons/expand-down.svg +1 -0
- package/src/components/editor-main/src/assets/icons/file-view.svg +1 -0
- package/src/components/editor-main/src/assets/icons/file.svg +1 -0
- package/src/components/editor-main/src/assets/icons/font-size-decrease.svg +1 -0
- package/src/components/editor-main/src/assets/icons/font-size-increase.svg +1 -0
- package/src/components/editor-main/src/assets/icons/footnote.svg +1 -0
- package/src/components/editor-main/src/assets/icons/format-painter.svg +1 -0
- package/src/components/editor-main/src/assets/icons/format.svg +1 -0
- package/src/components/editor-main/src/assets/icons/full-screen-exit.svg +1 -0
- package/src/components/editor-main/src/assets/icons/full-screen.svg +1 -0
- package/src/components/editor-main/src/assets/icons/hand-drawn.svg +1 -0
- package/src/components/editor-main/src/assets/icons/hard-break.svg +1 -0
- package/src/components/editor-main/src/assets/icons/heading.svg +1 -0
- package/src/components/editor-main/src/assets/icons/help.svg +1 -0
- package/src/components/editor-main/src/assets/icons/hide-toolbar.svg +1 -0
- package/src/components/editor-main/src/assets/icons/highlight.svg +1 -0
- package/src/components/editor-main/src/assets/icons/hr.svg +1 -0
- package/src/components/editor-main/src/assets/icons/html5.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-draggable.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-failed.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-flip.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-inline.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-preview.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-remove-background.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-reset.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image-rotate.svg +1 -0
- package/src/components/editor-main/src/assets/icons/image.svg +1 -0
- package/src/components/editor-main/src/assets/icons/indent.svg +1 -0
- package/src/components/editor-main/src/assets/icons/italic.svg +1 -0
- package/src/components/editor-main/src/assets/icons/laser-pointer.svg +1 -0
- package/src/components/editor-main/src/assets/icons/layout-page.svg +1 -0
- package/src/components/editor-main/src/assets/icons/layout-web.svg +1 -0
- package/src/components/editor-main/src/assets/icons/letter-spacing.svg +1 -0
- package/src/components/editor-main/src/assets/icons/line-height.svg +1 -0
- package/src/components/editor-main/src/assets/icons/line-number.svg +1 -0
- package/src/components/editor-main/src/assets/icons/link.svg +1 -0
- package/src/components/editor-main/src/assets/icons/loading.svg +1 -0
- package/src/components/editor-main/src/assets/icons/locale.svg +1 -0
- package/src/components/editor-main/src/assets/icons/margin.svg +1 -0
- package/src/components/editor-main/src/assets/icons/markdown.svg +1 -0
- package/src/components/editor-main/src/assets/icons/math.svg +1 -0
- package/src/components/editor-main/src/assets/icons/mention.svg +1 -0
- package/src/components/editor-main/src/assets/icons/menu.svg +1 -0
- package/src/components/editor-main/src/assets/icons/mermaid.svg +1 -0
- package/src/components/editor-main/src/assets/icons/mind-map.svg +1 -0
- package/src/components/editor-main/src/assets/icons/minus.svg +1 -0
- package/src/components/editor-main/src/assets/icons/new-window.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-add.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-clear-format.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-copy.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-cut.svg +2 -0
- package/src/components/editor-main/src/assets/icons/node-delete-2.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-delete.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-duplicate.svg +1 -0
- package/src/components/editor-main/src/assets/icons/node-switch.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-2.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-decimal-leading-zero.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-decimal.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-lower-latin.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-lower-roman.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-simp-chinese-formal.svg +12 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-trad-chinese-informal.svg +12 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-upper-latin.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list-upper-roman.svg +1 -0
- package/src/components/editor-main/src/assets/icons/ordered-list.svg +1 -0
- package/src/components/editor-main/src/assets/icons/outdent.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-background.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-break.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-footer.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-header.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-margin.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-orientation.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page-size.svg +1 -0
- package/src/components/editor-main/src/assets/icons/page.svg +1 -0
- package/src/components/editor-main/src/assets/icons/palette-color.svg +1 -0
- package/src/components/editor-main/src/assets/icons/paragraph.svg +1 -0
- package/src/components/editor-main/src/assets/icons/pdf.svg +1 -0
- package/src/components/editor-main/src/assets/icons/plus.svg +1 -0
- package/src/components/editor-main/src/assets/icons/preview.svg +1 -0
- package/src/components/editor-main/src/assets/icons/print.svg +1 -0
- package/src/components/editor-main/src/assets/icons/qrcode.svg +1 -0
- package/src/components/editor-main/src/assets/icons/quote.svg +1 -0
- package/src/components/editor-main/src/assets/icons/redo.svg +1 -0
- package/src/components/editor-main/src/assets/icons/register.js +47 -0
- package/src/components/editor-main/src/assets/icons/reload.svg +1 -0
- package/src/components/editor-main/src/assets/icons/remove.svg +1 -0
- package/src/components/editor-main/src/assets/icons/reply.svg +1 -0
- package/src/components/editor-main/src/assets/icons/search-replace.svg +1 -0
- package/src/components/editor-main/src/assets/icons/select-all.svg +1 -0
- package/src/components/editor-main/src/assets/icons/selected.svg +1 -0
- package/src/components/editor-main/src/assets/icons/setting.svg +1 -0
- package/src/components/editor-main/src/assets/icons/share.svg +1 -0
- package/src/components/editor-main/src/assets/icons/shortcut.svg +1 -0
- package/src/components/editor-main/src/assets/icons/signature.svg +1 -0
- package/src/components/editor-main/src/assets/icons/skin.svg +1 -0
- package/src/components/editor-main/src/assets/icons/spellcheck.svg +1 -0
- package/src/components/editor-main/src/assets/icons/strike.svg +1 -0
- package/src/components/editor-main/src/assets/icons/subscript.svg +1 -0
- package/src/components/editor-main/src/assets/icons/superscript.svg +1 -0
- package/src/components/editor-main/src/assets/icons/symbol.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-add-column-after.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-add-column-before.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-add-row-after.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-add-row-before.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-cells-align.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-cells-background.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-delete-column.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-delete-row.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-delete.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-fix.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-header-cell.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-header-column.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-header-row.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-merge-cell.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-next-cell.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-previous-cell.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table-split-cell.svg +1 -0
- package/src/components/editor-main/src/assets/icons/table.svg +1 -0
- package/src/components/editor-main/src/assets/icons/tag.svg +1 -0
- package/src/components/editor-main/src/assets/icons/task-list-2.svg +1 -0
- package/src/components/editor-main/src/assets/icons/task-list.svg +1 -0
- package/src/components/editor-main/src/assets/icons/template.svg +1 -0
- package/src/components/editor-main/src/assets/icons/text-box.svg +1 -0
- package/src/components/editor-main/src/assets/icons/text.svg +1 -0
- package/src/components/editor-main/src/assets/icons/theme.svg +1 -0
- package/src/components/editor-main/src/assets/icons/time.svg +1 -0
- package/src/components/editor-main/src/assets/icons/toc.svg +1 -0
- package/src/components/editor-main/src/assets/icons/toolbar-classic.svg +1 -0
- package/src/components/editor-main/src/assets/icons/toolbar-ribbon.svg +1 -0
- package/src/components/editor-main/src/assets/icons/toolbar-source.svg +1 -0
- package/src/components/editor-main/src/assets/icons/underline.svg +1 -0
- package/src/components/editor-main/src/assets/icons/undo.svg +1 -0
- package/src/components/editor-main/src/assets/icons/unlink.svg +1 -0
- package/src/components/editor-main/src/assets/icons/video.svg +1 -0
- package/src/components/editor-main/src/assets/icons/view.svg +1 -0
- package/src/components/editor-main/src/assets/icons/watermark.svg +1 -0
- package/src/components/editor-main/src/assets/icons/web-page.svg +1 -0
- package/src/components/editor-main/src/assets/icons/word-wrap.svg +1 -0
- package/src/components/editor-main/src/assets/icons/word.svg +1 -0
- package/src/components/editor-main/src/assets/icons/writing-mode.svg +1 -0
- package/src/components/editor-main/src/assets/icons/zoom-1.svg +1 -0
- package/src/components/editor-main/src/assets/icons/zoom-auto.svg +1 -0
- package/src/components/editor-main/src/assets/icons/zoom.svg +1 -0
- package/src/components/editor-main/src/assets/images/avatar.svg +1 -0
- package/src/components/editor-main/src/assets/images/format-painter.svg +1 -0
- package/src/components/editor-main/src/assets/images/laser-pointer.svg +1 -0
- package/src/components/editor-main/src/assets/images/logo.svg +1 -0
- package/src/components/editor-main/src/assets/images/watermark-compact.png +0 -0
- package/src/components/editor-main/src/assets/images/watermark-spacious.png +0 -0
- package/src/components/editor-main/src/assets/styles/_mixins.less +150 -0
- package/src/components/editor-main/src/assets/styles/_variables.less +97 -0
- package/src/components/editor-main/src/assets/styles/drager.less +123 -0
- package/src/components/editor-main/src/assets/styles/editor.less +917 -0
- package/src/components/editor-main/src/assets/styles/index.less +19 -0
- package/src/components/editor-main/src/assets/styles/plyr.less +26 -0
- package/src/components/editor-main/src/assets/styles/tdesign.less +341 -0
- package/src/components/editor-main/src/components/container/page.vue +392 -0
- package/src/components/editor-main/src/components/container/print.vue +191 -0
- package/src/components/editor-main/src/components/container/search-replace.vue +264 -0
- package/src/components/editor-main/src/components/container/toc.vue +260 -0
- package/src/components/editor-main/src/components/editor/index.vue +213 -0
- package/src/components/editor-main/src/components/icon.vue +43 -0
- package/src/components/editor-main/src/components/index.js +22 -0
- package/src/components/editor-main/src/components/index.vue +1396 -0
- package/src/components/editor-main/src/components/menus/block/common.vue +127 -0
- package/src/components/editor-main/src/components/menus/block/index.vue +217 -0
- package/src/components/editor-main/src/components/menus/block/node.vue +183 -0
- package/src/components/editor-main/src/components/menus/bubble/callout/background.vue +39 -0
- package/src/components/editor-main/src/components/menus/bubble/callout/builtin.vue +90 -0
- package/src/components/editor-main/src/components/menus/bubble/callout/emoji-remove.vue +28 -0
- package/src/components/editor-main/src/components/menus/bubble/file/download.vue +30 -0
- package/src/components/editor-main/src/components/menus/bubble/file/width.vue +22 -0
- package/src/components/editor-main/src/components/menus/bubble/image/convert.vue +63 -0
- package/src/components/editor-main/src/components/menus/bubble/image/edit.vue +32 -0
- package/src/components/editor-main/src/components/menus/bubble/image/open.vue +27 -0
- package/src/components/editor-main/src/components/menus/bubble/image/preview.vue +24 -0
- package/src/components/editor-main/src/components/menus/bubble/image/proportion.vue +34 -0
- package/src/components/editor-main/src/components/menus/bubble/index.vue +55 -0
- package/src/components/editor-main/src/components/menus/bubble/link/copy.vue +29 -0
- package/src/components/editor-main/src/components/menus/bubble/link/open.vue +27 -0
- package/src/components/editor-main/src/components/menus/bubble/link/unlink.vue +19 -0
- package/src/components/editor-main/src/components/menus/bubble/math.vue +36 -0
- package/src/components/editor-main/src/components/menus/bubble/menus.vue +209 -0
- package/src/components/editor-main/src/components/menus/bubble/node/delete.vue +15 -0
- package/src/components/editor-main/src/components/menus/bubble/node/duplicate.vue +40 -0
- package/src/components/editor-main/src/components/menus/bubble/node/tofile.vue +31 -0
- package/src/components/editor-main/src/components/menus/bubble/tag/background.vue +36 -0
- package/src/components/editor-main/src/components/menus/bubble/tag/builtin.vue +88 -0
- package/src/components/editor-main/src/components/menus/bubble/tag/color.vue +36 -0
- package/src/components/editor-main/src/components/menus/bubble/tag/delete.vue +14 -0
- package/src/components/editor-main/src/components/menus/bubble/tag/input.vue +63 -0
- package/src/components/editor-main/src/components/menus/bubble/text-box/background.vue +37 -0
- package/src/components/editor-main/src/components/menus/bubble/text-box/border.vue +186 -0
- package/src/components/editor-main/src/components/menus/bubble/text-box/writing-mode.vue +42 -0
- package/src/components/editor-main/src/components/menus/bubble/webpage/clickable.vue +31 -0
- package/src/components/editor-main/src/components/menus/bubble/webpage/open.vue +29 -0
- package/src/components/editor-main/src/components/menus/button.vue +630 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-center.vue +33 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-distributed.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-dropdown.vue +56 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-justify.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-left.vue +32 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/align-right.vue +33 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/background-color.vue +72 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/bold.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/bullet-list.vue +110 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/clear-format.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/code.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/color.vue +75 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/font-family.vue +528 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/font-size.vue +163 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/format-painter.vue +27 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/heading.vue +322 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/highlight.vue +127 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/indent.vue +17 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/italic.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/letter-spacing.vue +113 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/line-height.vue +40 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/margin.vue +118 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/markdown.vue +50 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/ordered-list.vue +184 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/outdent.vue +17 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/print.vue +19 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/quote.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/redo.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/search-replace.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/select-all.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/strike.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/subscript.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/superscript.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/task-list.vue +47 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/underline.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/undo.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/base/word-wrap.vue +47 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/embed.vue +67 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/html.vue +27 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/image.vue +66 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/pdf.vue +8 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/share.vue +63 -0
- package/src/components/editor-main/src/components/menus/toolbar/export/text.vue +32 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/audio.vue +23 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/bookmark.vue +206 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/callout.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/chinese-date.vue +112 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/code-block.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/columns.vue +97 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/details.vue +34 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/emoji.vue +103 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/file.vue +23 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/footnote.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/hard-break.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/hr.vue +141 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/image.vue +84 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/link.vue +121 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/mention.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/option-box.vue +324 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/symbol.vue +88 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/tag.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/template.vue +76 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/text-box.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/toc.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/video.vue +23 -0
- package/src/components/editor-main/src/components/menus/toolbar/insert/web-page.vue +173 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/background.vue +138 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/break-marks.vue +26 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/break.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/footer.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/header.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/line-number.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/margin.vue +17 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/orientation.vue +63 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/size.vue +67 -0
- package/src/components/editor-main/src/components/menus/toolbar/page/watermark.vue +200 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/add-column-after.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/add-column-before.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/add-row-after.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/add-row-before.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/border-color.vue +35 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/cells-align.vue +41 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/cells-background.vue +32 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/delete-column.vue +44 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/delete-row.vue +44 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/delete.vue +40 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/fix.vue +17 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/insert.vue +137 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/merge-cells.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/next-cell.vue +21 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/previous-cell.vue +21 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/split-cell.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/toggle-header-cell.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/toggle-header-column.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/table/toggle-header-row.vue +20 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/barcode.vue +441 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/chinese-case.vue +135 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/diagrams.vue +141 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/echarts.vue +718 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/math.vue +339 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/mermaid.vue +293 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/mind-map.vue +7 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/qrcode.vue +293 -0
- package/src/components/editor-main/src/components/menus/toolbar/tools/signature.vue +208 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/fullscreen.vue +17 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/locale.vue +40 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/page.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/preview.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/skin.vue +43 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/theme.vue +41 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/toc.vue +15 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/web.vue +16 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/zoom-auto.vue +27 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/zoom-original.vue +18 -0
- package/src/components/editor-main/src/components/menus/toolbar/view/zoom.vue +35 -0
- package/src/components/editor-main/src/components/modal.vue +22 -0
- package/src/components/editor-main/src/components/page-options.vue +392 -0
- package/src/components/editor-main/src/components/picker/color.vue +208 -0
- package/src/components/editor-main/src/components/statusbar/about.vue +37 -0
- package/src/components/editor-main/src/components/statusbar/countdown.vue +273 -0
- package/src/components/editor-main/src/components/statusbar/index.vue +753 -0
- package/src/components/editor-main/src/components/statusbar/shortcuts.vue +313 -0
- package/src/components/editor-main/src/components/toolbar/classic.vue +325 -0
- package/src/components/editor-main/src/components/toolbar/index.vue +369 -0
- package/src/components/editor-main/src/components/toolbar/ribbon.vue +398 -0
- package/src/components/editor-main/src/components/toolbar/scrollable.vue +205 -0
- package/src/components/editor-main/src/components/tooltip.vue +23 -0
- package/src/components/editor-main/src/composables/copy.js +24 -0
- package/src/components/editor-main/src/composables/dialog.js +25 -0
- package/src/components/editor-main/src/composables/hotkeys.js +14 -0
- package/src/components/editor-main/src/composables/i18n.js +19 -0
- package/src/components/editor-main/src/composables/popup.js +11 -0
- package/src/components/editor-main/src/composables/select.js +13 -0
- package/src/components/editor-main/src/composables/state.js +30 -0
- package/src/components/editor-main/src/composables/toolbarSelection.js +68 -0
- package/src/components/editor-main/src/extensions/audio/index.js +59 -0
- package/src/components/editor-main/src/extensions/audio/node-view.vue +141 -0
- package/src/components/editor-main/src/extensions/bookmark.js +110 -0
- package/src/components/editor-main/src/extensions/break-marks.js +19 -0
- package/src/components/editor-main/src/extensions/bullet-list.js +21 -0
- package/src/components/editor-main/src/extensions/callout/index.js +128 -0
- package/src/components/editor-main/src/extensions/callout/node-view.vue +130 -0
- package/src/components/editor-main/src/extensions/code-block/index.js +32 -0
- package/src/components/editor-main/src/extensions/code-block/node-view.vue +399 -0
- package/src/components/editor-main/src/extensions/columns/dom.js +142 -0
- package/src/components/editor-main/src/extensions/columns/index.js +77 -0
- package/src/components/editor-main/src/extensions/columns/keymap.js +62 -0
- package/src/components/editor-main/src/extensions/columns/resize.js +60 -0
- package/src/components/editor-main/src/extensions/columns/schema.js +47 -0
- package/src/components/editor-main/src/extensions/columns/state.js +26 -0
- package/src/components/editor-main/src/extensions/columns/utils.js +55 -0
- package/src/components/editor-main/src/extensions/datetime/index.js +55 -0
- package/src/components/editor-main/src/extensions/datetime/node-view.vue +116 -0
- package/src/components/editor-main/src/extensions/echarts/cal-service.js +142 -0
- package/src/components/editor-main/src/extensions/echarts/index.js +115 -0
- package/src/components/editor-main/src/extensions/echarts/node-view.vue +220 -0
- package/src/components/editor-main/src/extensions/file/index.js +254 -0
- package/src/components/editor-main/src/extensions/file/node-view.vue +333 -0
- package/src/components/editor-main/src/extensions/file-handler.js +93 -0
- package/src/components/editor-main/src/extensions/foonotes/footnote.js +152 -0
- package/src/components/editor-main/src/extensions/foonotes/footnotes.js +41 -0
- package/src/components/editor-main/src/extensions/foonotes/index.js +7 -0
- package/src/components/editor-main/src/extensions/foonotes/reference.js +211 -0
- package/src/components/editor-main/src/extensions/foonotes/rules.js +103 -0
- package/src/components/editor-main/src/extensions/foonotes/utils.js +171 -0
- package/src/components/editor-main/src/extensions/format-painter.js +104 -0
- package/src/components/editor-main/src/extensions/horizontal-rule.js +93 -0
- package/src/components/editor-main/src/extensions/iframe/index.js +54 -0
- package/src/components/editor-main/src/extensions/iframe/node-view.vue +106 -0
- package/src/components/editor-main/src/extensions/image/image-resizer.vue +349 -0
- package/src/components/editor-main/src/extensions/image/index.js +216 -0
- package/src/components/editor-main/src/extensions/image/node-view.vue +592 -0
- package/src/components/editor-main/src/extensions/indent.js +226 -0
- package/src/components/editor-main/src/extensions/index.js +341 -0
- package/src/components/editor-main/src/extensions/letter-spacing.js +66 -0
- package/src/components/editor-main/src/extensions/line-height.js +147 -0
- package/src/components/editor-main/src/extensions/margin.js +266 -0
- package/src/components/editor-main/src/extensions/mention/index.js +33 -0
- package/src/components/editor-main/src/extensions/mention/mentions.vue +180 -0
- package/src/components/editor-main/src/extensions/mention/suggestion.js +90 -0
- package/src/components/editor-main/src/extensions/node-align.js +164 -0
- package/src/components/editor-main/src/extensions/node-select.js +51 -0
- package/src/components/editor-main/src/extensions/office-paste/index.js +70 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/bookmark.js +17 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/excel.js +85 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/html-classes.js +9 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/line-number.js +10 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/list.js +148 -0
- package/src/components/editor-main/src/extensions/office-paste/transform/style.js +24 -0
- package/src/components/editor-main/src/extensions/office-paste/utils.js +120 -0
- package/src/components/editor-main/src/extensions/option-box/index.js +77 -0
- package/src/components/editor-main/src/extensions/option-box/node-view.vue +194 -0
- package/src/components/editor-main/src/extensions/ordered-list.js +36 -0
- package/src/components/editor-main/src/extensions/page-break.js +42 -0
- package/src/components/editor-main/src/extensions/search-replace.js +304 -0
- package/src/components/editor-main/src/extensions/selection.js +38 -0
- package/src/components/editor-main/src/extensions/table.js +65 -0
- package/src/components/editor-main/src/extensions/tag/index.js +47 -0
- package/src/components/editor-main/src/extensions/tag/node-view.vue +51 -0
- package/src/components/editor-main/src/extensions/text-align.js +44 -0
- package/src/components/editor-main/src/extensions/text-box/index.js +78 -0
- package/src/components/editor-main/src/extensions/text-box/node-view.vue +141 -0
- package/src/components/editor-main/src/extensions/toc/index.js +48 -0
- package/src/components/editor-main/src/extensions/toc/node-view.vue +159 -0
- package/src/components/editor-main/src/extensions/type-writer.js +256 -0
- package/src/components/editor-main/src/extensions/video/index.js +65 -0
- package/src/components/editor-main/src/extensions/video/node-view.vue +211 -0
- package/src/components/editor-main/src/extensions/word-wrap.js +94 -0
- package/src/components/editor-main/src/i18n.js +15 -0
- package/src/components/editor-main/src/locales/bo.json +707 -0
- package/src/components/editor-main/src/locales/en-US.json +802 -0
- package/src/components/editor-main/src/locales/it-IT.json +721 -0
- package/src/components/editor-main/src/locales/ru-RU.json +779 -0
- package/src/components/editor-main/src/locales/zh-CN.json +804 -0
- package/src/components/editor-main/src/options/config/dicts.js +369 -0
- package/src/components/editor-main/src/options/config/index.js +203 -0
- package/src/components/editor-main/src/options/index.js +7 -0
- package/src/components/editor-main/src/options/schema.js +732 -0
- package/src/components/editor-main/src/utils/content-transform.js +12 -0
- package/src/components/editor-main/src/utils/copyright.js +4 -0
- package/src/components/editor-main/src/utils/diagram-editor.js +153 -0
- package/src/components/editor-main/src/utils/editor-scroll.js +75 -0
- package/src/components/editor-main/src/utils/file.js +177 -0
- package/src/components/editor-main/src/utils/history-record.js +135 -0
- package/src/components/editor-main/src/utils/load-resource.js +45 -0
- package/src/components/editor-main/src/utils/options.js +25 -0
- package/src/components/editor-main/src/utils/player.js +91 -0
- package/src/components/editor-main/src/utils/selection.js +39 -0
- package/src/components/editor-main/src/utils/short-id.js +4 -0
- package/src/components/editor-main/src/utils/shortcut.js +17 -0
- package/src/components/editor-main/src/utils/time-ago.js +8 -0
- package/src/components/editor-main/umo-build-entry.js +570 -0
- package/src/css/elementUI/col.scss +10 -2
- package/src/css/elementUI/mixins/_col.scss +10 -2
- package/vite/highlightJsLibVirtual.ts +98 -0
- package/vite/projectRoot.ts +17 -0
- package/vite/tiptapUmoResolve.ts +140 -0
- package/vite/tiptapVueRendererFix.ts +171 -0
- package/vite/umoCjsVirtual.ts +192 -0
- package/vite/umoIntegration.js +611 -0
- package/vite/umoIntegration.ts +56 -0
- package/vite/yjsPeerResolve.ts +100 -0
- package/vite.config.ts +8 -0
- package/vite.config.umo.ts +82 -0
- package/src/components/RichTextEditor/UmoRichTextEditor.vue +0 -257
- package/src/types/umoteam-editor.d.ts +0 -8
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Table } from '@tiptap/extension-table'
|
|
2
|
+
import { TableCell } from '@tiptap/extension-table/cell'
|
|
3
|
+
import { TableHeader } from '@tiptap/extension-table/header'
|
|
4
|
+
import { TableRow } from '@tiptap/extension-table/row'
|
|
5
|
+
|
|
6
|
+
// 扩展表格能力
|
|
7
|
+
const CustomTable = Table.extend({
|
|
8
|
+
addOptions() {
|
|
9
|
+
return {
|
|
10
|
+
...this.parent?.(),
|
|
11
|
+
HTMLAttributes: {
|
|
12
|
+
class: 'umo-node-table',
|
|
13
|
+
},
|
|
14
|
+
allowTableNodeSelection: true,
|
|
15
|
+
resizable: true,
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
// 扩展单元格
|
|
21
|
+
const TableCellOptions = {
|
|
22
|
+
addAttributes() {
|
|
23
|
+
return {
|
|
24
|
+
...this.parent?.(),
|
|
25
|
+
align: {
|
|
26
|
+
default: null,
|
|
27
|
+
parseHTML: (element) => element.getAttribute('align') || null,
|
|
28
|
+
renderHTML: ({ align }) => ({ align }),
|
|
29
|
+
},
|
|
30
|
+
background: {
|
|
31
|
+
default: null,
|
|
32
|
+
parseHTML: (element) => {
|
|
33
|
+
const style = element.getAttribute('style') || ''
|
|
34
|
+
const match = style.match(/background(?:-color)?:\s*([^;]+)/i)
|
|
35
|
+
return match ? match[1].trim() : null
|
|
36
|
+
},
|
|
37
|
+
renderHTML: ({ background }) => {
|
|
38
|
+
return background ? { style: `background-color: ${background}` } : {}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
color: {
|
|
42
|
+
default: null,
|
|
43
|
+
parseHTML: (element) => {
|
|
44
|
+
const style = element.getAttribute('style') || ''
|
|
45
|
+
const match = style.match(/(?<!background-)color:\s*([^;]+)/i)
|
|
46
|
+
if (style.includes('background-color')) return null
|
|
47
|
+
return match ? match[1].trim() : null
|
|
48
|
+
},
|
|
49
|
+
renderHTML: ({ color }) => {
|
|
50
|
+
return color ? { style: `color: ${color}` } : {}
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const CustomTableHeader = TableHeader.extend(TableCellOptions)
|
|
58
|
+
const CustomTableCell = TableCell.extend(TableCellOptions)
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
CustomTable as Table,
|
|
62
|
+
CustomTableCell as TableCell,
|
|
63
|
+
CustomTableHeader as TableHeader,
|
|
64
|
+
TableRow,
|
|
65
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { t } from '../../composables/i18n.js';
|
|
2
|
+
import { mergeAttributes, Node } from '@tiptap/core'
|
|
3
|
+
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
|
4
|
+
|
|
5
|
+
import NodeView from './node-view.vue'
|
|
6
|
+
|
|
7
|
+
export default Node.create({
|
|
8
|
+
name: 'tag',
|
|
9
|
+
group: 'inline',
|
|
10
|
+
inline: true,
|
|
11
|
+
atom: true,
|
|
12
|
+
addAttributes() {
|
|
13
|
+
return {
|
|
14
|
+
type: { default: 'default' },
|
|
15
|
+
text: { default: t('bubbleMenu.tag.content') },
|
|
16
|
+
color: { default: '#999' },
|
|
17
|
+
backgroundColor: { default: 'rgba(0, 0, 0, 0.05)' },
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
parseHTML() {
|
|
21
|
+
return [{ tag: 'span[data-type="tag"]' }]
|
|
22
|
+
},
|
|
23
|
+
renderHTML({ HTMLAttributes }) {
|
|
24
|
+
return [
|
|
25
|
+
'span',
|
|
26
|
+
mergeAttributes(HTMLAttributes, { 'data-type': 'tag' }),
|
|
27
|
+
HTMLAttributes.text,
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
addNodeView() {
|
|
31
|
+
return VueNodeViewRenderer(NodeView)
|
|
32
|
+
},
|
|
33
|
+
addCommands() {
|
|
34
|
+
return {
|
|
35
|
+
insertTag:
|
|
36
|
+
(options) =>
|
|
37
|
+
({ chain }) => {
|
|
38
|
+
return chain()
|
|
39
|
+
.insertContent({
|
|
40
|
+
type: this.name,
|
|
41
|
+
attrs: options,
|
|
42
|
+
})
|
|
43
|
+
.run()
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<node-view-wrapper
|
|
3
|
+
as="span"
|
|
4
|
+
class="umo-node-tag"
|
|
5
|
+
@click.capture="editor?.commands.setNodeSelection(getPos())"
|
|
6
|
+
>
|
|
7
|
+
<span
|
|
8
|
+
class="umo-node-tag-text"
|
|
9
|
+
:style="{
|
|
10
|
+
color: attrs.color,
|
|
11
|
+
backgroundColor: attrs.backgroundColor,
|
|
12
|
+
cursor:
|
|
13
|
+
!options.document?.readOnly || editor.isEditable
|
|
14
|
+
? 'pointer'
|
|
15
|
+
: 'default',
|
|
16
|
+
}"
|
|
17
|
+
v-text="attrs.text"
|
|
18
|
+
></span>
|
|
19
|
+
</node-view-wrapper>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>import { computed as _computed } from 'vue';
|
|
23
|
+
|
|
24
|
+
import { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
import { inject } from 'vue';
|
|
28
|
+
const props = defineProps(nodeViewProps)
|
|
29
|
+
const attrs = _computed(() => props.node.attrs)
|
|
30
|
+
const options = inject('options')
|
|
31
|
+
const editor = inject('editor')
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style lang="less">
|
|
35
|
+
.umo-node-tag {
|
|
36
|
+
margin: 0 0.2em;
|
|
37
|
+
background-color: transparent !important;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
transform: translateY(-0.05em);
|
|
41
|
+
&-text {
|
|
42
|
+
border-radius: 0.2em;
|
|
43
|
+
padding: 0.1em 0.4em;
|
|
44
|
+
font-size: 0.9em;
|
|
45
|
+
margin: 0 0.2em;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import TextAlign from '@tiptap/extension-text-align'
|
|
2
|
+
|
|
3
|
+
export default TextAlign.extend({
|
|
4
|
+
addOptions() {
|
|
5
|
+
return {
|
|
6
|
+
...this.parent?.(),
|
|
7
|
+
types: ['heading', 'paragraph'],
|
|
8
|
+
alignments: ['left', 'center', 'right', 'justify', 'distributed'],
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
addGlobalAttributes() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
types: this.options.types,
|
|
15
|
+
attributes: {
|
|
16
|
+
textAlign: {
|
|
17
|
+
default: this.options.defaultAlignment,
|
|
18
|
+
parseHTML: (element) => {
|
|
19
|
+
if (element.style.textAlignLast) {
|
|
20
|
+
return 'distributed'
|
|
21
|
+
}
|
|
22
|
+
return element.style.textAlign || this.options.defaultAlignment
|
|
23
|
+
},
|
|
24
|
+
renderHTML: (attributes) => {
|
|
25
|
+
if (attributes.textAlign === this.options.defaultAlignment) {
|
|
26
|
+
return {}
|
|
27
|
+
}
|
|
28
|
+
if (attributes.textAlign === 'distributed') {
|
|
29
|
+
return { style: 'text-align-last: justify' }
|
|
30
|
+
}
|
|
31
|
+
return { style: `text-align: ${attributes.textAlign}` }
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
addKeyboardShortcuts() {
|
|
39
|
+
return {
|
|
40
|
+
...this.parent?.(),
|
|
41
|
+
'Mod-Shift-d': () => this.editor.commands.setTextAlign('distributed'),
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from '@tiptap/core'
|
|
2
|
+
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
|
3
|
+
|
|
4
|
+
import NodeView from './node-view.vue'
|
|
5
|
+
|
|
6
|
+
export default Node.create({
|
|
7
|
+
name: 'textBox',
|
|
8
|
+
group: 'block',
|
|
9
|
+
content: 'inline*',
|
|
10
|
+
draggable: false,
|
|
11
|
+
addAttributes() {
|
|
12
|
+
return {
|
|
13
|
+
vnode: {
|
|
14
|
+
default: true,
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
default: 200,
|
|
18
|
+
},
|
|
19
|
+
height: {
|
|
20
|
+
default: 30,
|
|
21
|
+
},
|
|
22
|
+
angle: {
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
left: {
|
|
26
|
+
default: 0,
|
|
27
|
+
},
|
|
28
|
+
top: {
|
|
29
|
+
default: 0,
|
|
30
|
+
},
|
|
31
|
+
rotatable: {
|
|
32
|
+
default: true,
|
|
33
|
+
},
|
|
34
|
+
borderWidth: {
|
|
35
|
+
default: 1,
|
|
36
|
+
},
|
|
37
|
+
borderColor: {
|
|
38
|
+
default: '#000',
|
|
39
|
+
},
|
|
40
|
+
borderStyle: {
|
|
41
|
+
default: 'solid',
|
|
42
|
+
},
|
|
43
|
+
backgroundColor: {
|
|
44
|
+
default: 'transparent',
|
|
45
|
+
},
|
|
46
|
+
writingMode: {
|
|
47
|
+
default: 'horizontal-tb',
|
|
48
|
+
parseHTML: (element) => {
|
|
49
|
+
return element.style.writingMode || this.options.writingMode
|
|
50
|
+
},
|
|
51
|
+
renderHTML: ({ writingMode }) => {
|
|
52
|
+
return { style: `writing-mode: ${writingMode}` }
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
parseHTML() {
|
|
58
|
+
return [{ tag: 'text-box' }]
|
|
59
|
+
},
|
|
60
|
+
renderHTML({ HTMLAttributes }) {
|
|
61
|
+
return ['text-box', mergeAttributes(HTMLAttributes), 0]
|
|
62
|
+
},
|
|
63
|
+
addNodeView() {
|
|
64
|
+
return VueNodeViewRenderer(NodeView)
|
|
65
|
+
},
|
|
66
|
+
addCommands() {
|
|
67
|
+
return {
|
|
68
|
+
setTextBox:
|
|
69
|
+
(options) =>
|
|
70
|
+
({ commands }) => {
|
|
71
|
+
return commands.insertContent({
|
|
72
|
+
type: this.name,
|
|
73
|
+
attrs: options,
|
|
74
|
+
})
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
})
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<node-view-wrapper
|
|
3
|
+
:id="attrs.id"
|
|
4
|
+
ref="containerRef"
|
|
5
|
+
class="umo-node-view umo-floating-node"
|
|
6
|
+
:style="{
|
|
7
|
+
zIndex: 90,
|
|
8
|
+
'--umo-textbox-border-color': attrs.borderColor,
|
|
9
|
+
'--umo-textbox-border-width': attrs.borderWidth + 'px',
|
|
10
|
+
'--umo-textbox-border-style': attrs.borderStyle,
|
|
11
|
+
'--umo-textbox-background-color': attrs.backgroundColor,
|
|
12
|
+
}"
|
|
13
|
+
>
|
|
14
|
+
<div class="umo-node-container umo-node-text-box">
|
|
15
|
+
<drager
|
|
16
|
+
class="is-draggable"
|
|
17
|
+
:style="{
|
|
18
|
+
cursor: !options.document?.readOnly
|
|
19
|
+
? 'inherit'
|
|
20
|
+
: 'default !important',
|
|
21
|
+
}"
|
|
22
|
+
:selected="selected"
|
|
23
|
+
:disabled="disabled || options?.document?.readOnly"
|
|
24
|
+
:rotatable="true"
|
|
25
|
+
:boundary="false"
|
|
26
|
+
:angle="attrs.angle"
|
|
27
|
+
:width="attrs.width"
|
|
28
|
+
:height="attrs.height"
|
|
29
|
+
:left="attrs.left"
|
|
30
|
+
:top="attrs.top"
|
|
31
|
+
:min-width="14"
|
|
32
|
+
:min-height="14"
|
|
33
|
+
:title="t('node.textBox.tip')"
|
|
34
|
+
@rotate="onRotate"
|
|
35
|
+
@resize="onResize"
|
|
36
|
+
@drag="onDrag"
|
|
37
|
+
@blur="disabled = false"
|
|
38
|
+
@click="selected = true"
|
|
39
|
+
@dblclick="editTextBox"
|
|
40
|
+
>
|
|
41
|
+
<node-view-content
|
|
42
|
+
ref="contentRef"
|
|
43
|
+
class="umo-node-text-box-content"
|
|
44
|
+
:style="{ writingMode: attrs.writingMode }"
|
|
45
|
+
/>
|
|
46
|
+
</drager>
|
|
47
|
+
</div>
|
|
48
|
+
</node-view-wrapper>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import { t } from '../../composables/i18n.js';
|
|
53
|
+
import { computed as _computed, ref as _ref } from 'vue';
|
|
54
|
+
|
|
55
|
+
import { NodeViewContent, nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
|
56
|
+
import Drager from 'es-drager'
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
import { inject, ref } from 'vue';
|
|
60
|
+
import { onClickOutside } from '@vueuse/core';
|
|
61
|
+
const props = defineProps(nodeViewProps)
|
|
62
|
+
const attrs = _computed(() => props.node.attrs)
|
|
63
|
+
const { updateAttributes } = props
|
|
64
|
+
|
|
65
|
+
const options = inject('options')
|
|
66
|
+
|
|
67
|
+
const containerRef = ref(null)
|
|
68
|
+
const contentRef = _ref(null)
|
|
69
|
+
let selected = _ref(false)
|
|
70
|
+
let disabled = _ref(false)
|
|
71
|
+
|
|
72
|
+
const onRotate = ({ angle }) => {
|
|
73
|
+
updateAttributes({ angle })
|
|
74
|
+
}
|
|
75
|
+
const onResize = ({ width, height }) => {
|
|
76
|
+
updateAttributes({ width, height })
|
|
77
|
+
}
|
|
78
|
+
const onDrag = ({ left, top }) => {
|
|
79
|
+
updateAttributes({ left, top })
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
onClickOutside(containerRef, () => {
|
|
83
|
+
selected.value = false
|
|
84
|
+
disabled.value = false
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const editTextBox = () => {
|
|
88
|
+
disabled.value = true
|
|
89
|
+
const range = document.createRange()
|
|
90
|
+
range.selectNodeContents(contentRef.value.$el)
|
|
91
|
+
const election = window.getSelection()
|
|
92
|
+
if (election) {
|
|
93
|
+
election.removeAllRanges()
|
|
94
|
+
election.addRange(range)
|
|
95
|
+
}
|
|
96
|
+
contentRef.value.$el.focus()
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="less">
|
|
101
|
+
.umo-node-view {
|
|
102
|
+
.umo-node-text-box {
|
|
103
|
+
position: absolute;
|
|
104
|
+
.es-drager {
|
|
105
|
+
user-select: text !important;
|
|
106
|
+
cursor: default !important;
|
|
107
|
+
z-index: 90 !important;
|
|
108
|
+
background-color: var(--umo-textbox-background-color);
|
|
109
|
+
&.dragging {
|
|
110
|
+
caret-color: transparent;
|
|
111
|
+
}
|
|
112
|
+
&.disabled {
|
|
113
|
+
outline: none;
|
|
114
|
+
&:after {
|
|
115
|
+
display: none !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
&.selected {
|
|
119
|
+
.umo-node-text-box-content {
|
|
120
|
+
outline: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
&.disabled.selected {
|
|
124
|
+
.umo-node-text-box-content {
|
|
125
|
+
outline: var(--umo-textbox-border-style)
|
|
126
|
+
var(--umo-textbox-border-width) var(--umo-textbox-border-color);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
.umo-node-text-box-content {
|
|
131
|
+
outline: var(--umo-textbox-border-style) var(--umo-textbox-border-width)
|
|
132
|
+
var(--umo-textbox-border-color);
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 100%;
|
|
135
|
+
padding: 5px;
|
|
136
|
+
box-sizing: border-box;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mergeAttributes, Node } from '@tiptap/core'
|
|
2
|
+
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
|
3
|
+
|
|
4
|
+
import NodeView from './node-view.vue'
|
|
5
|
+
|
|
6
|
+
export default Node.create({
|
|
7
|
+
name: 'toc',
|
|
8
|
+
group: 'block',
|
|
9
|
+
atom: true,
|
|
10
|
+
addAttributes() {
|
|
11
|
+
return {
|
|
12
|
+
vnode: {
|
|
13
|
+
default: true,
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
parseHTML() {
|
|
18
|
+
return [{ tag: 'toc' }]
|
|
19
|
+
},
|
|
20
|
+
renderHTML({ HTMLAttributes }) {
|
|
21
|
+
return ['toc', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]
|
|
22
|
+
},
|
|
23
|
+
addNodeView() {
|
|
24
|
+
return VueNodeViewRenderer(NodeView)
|
|
25
|
+
},
|
|
26
|
+
addGlobalAttributes() {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
types: ['heading'],
|
|
30
|
+
attributes: {},
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
addCommands() {
|
|
35
|
+
return {
|
|
36
|
+
addTableOfContents:
|
|
37
|
+
(options) =>
|
|
38
|
+
({ chain }) => {
|
|
39
|
+
return chain()
|
|
40
|
+
.insertContent({
|
|
41
|
+
type: this.name,
|
|
42
|
+
attrs: options,
|
|
43
|
+
})
|
|
44
|
+
.run()
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
})
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<node-view-wrapper
|
|
3
|
+
:id="node.attrs.id"
|
|
4
|
+
class="umo-node-view"
|
|
5
|
+
@click.capture="editor?.commands.setNodeSelection(getPos())"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="umo-node-container umo-hover-shadow umo-select-outline umo-node-toc"
|
|
9
|
+
>
|
|
10
|
+
<p class="umo-node-toc-head" v-text="t('toc.title')"></p>
|
|
11
|
+
<div class="umo-node-toc-body">
|
|
12
|
+
<t-tree
|
|
13
|
+
class="umo-toc-tree"
|
|
14
|
+
:data="tocTreeData"
|
|
15
|
+
:keys="{
|
|
16
|
+
label: 'textContent',
|
|
17
|
+
value: 'id',
|
|
18
|
+
}"
|
|
19
|
+
:empty="t('toc.empty')"
|
|
20
|
+
:transition="false"
|
|
21
|
+
activable
|
|
22
|
+
hover
|
|
23
|
+
expand-all
|
|
24
|
+
line
|
|
25
|
+
@active="headingActive"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</node-view-wrapper>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import { t } from '../../composables/i18n.js';
|
|
34
|
+
import { ref as _ref } from 'vue';
|
|
35
|
+
|
|
36
|
+
import { TextSelection } from '@tiptap/pm/state'
|
|
37
|
+
import { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
import { inject, watch } from 'vue';
|
|
41
|
+
defineProps(nodeViewProps)
|
|
42
|
+
|
|
43
|
+
const container = inject('container')
|
|
44
|
+
const editor = inject('editor')
|
|
45
|
+
|
|
46
|
+
defineEmits(['close'])
|
|
47
|
+
|
|
48
|
+
// 最终可视化数据
|
|
49
|
+
let tocTreeData = _ref([])
|
|
50
|
+
let watchTreeData = [] // 可视化监听数据
|
|
51
|
+
const buildTocTree = (tocArray) => {
|
|
52
|
+
const root = []
|
|
53
|
+
const stack = []
|
|
54
|
+
for (const item of tocArray) {
|
|
55
|
+
const node = {
|
|
56
|
+
textContent: item.textContent,
|
|
57
|
+
level: item.originalLevel,
|
|
58
|
+
id: item.id,
|
|
59
|
+
actived: false,
|
|
60
|
+
children: [],
|
|
61
|
+
}
|
|
62
|
+
while (
|
|
63
|
+
stack.length > 0 &&
|
|
64
|
+
stack[stack.length - 1].level >= item.originalLevel
|
|
65
|
+
) {
|
|
66
|
+
stack.pop()
|
|
67
|
+
}
|
|
68
|
+
if (stack.length === 0) {
|
|
69
|
+
root.push(node)
|
|
70
|
+
} else {
|
|
71
|
+
stack[stack.length - 1].children.push(node)
|
|
72
|
+
}
|
|
73
|
+
stack.push(node)
|
|
74
|
+
}
|
|
75
|
+
return root
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
watch(
|
|
79
|
+
() => editor.value?.storage.tableOfContents.content,
|
|
80
|
+
(toc) => {
|
|
81
|
+
// 每次都监听 但不是每次发生变化,重复赋值导致toc数据双击生效
|
|
82
|
+
const curTocTreeData = buildTocTree(toc)
|
|
83
|
+
if (JSON.stringify(watchTreeData) !== JSON.stringify(curTocTreeData)) {
|
|
84
|
+
watchTreeData = curTocTreeData
|
|
85
|
+
tocTreeData.value = JSON.parse(JSON.stringify(curTocTreeData))
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{ immediate: true },
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
const headingActive = (value) => {
|
|
92
|
+
if (!editor.value) {
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
const nodeElement = editor.value.view.dom.querySelector(
|
|
96
|
+
`[data-toc-id="${value[0]}"]`,
|
|
97
|
+
)
|
|
98
|
+
const pageContainer = document.querySelector(
|
|
99
|
+
`${container} .umo-zoomable-container`,
|
|
100
|
+
)
|
|
101
|
+
const pageHeader = pageContainer?.querySelector('.umo-page-node-header')
|
|
102
|
+
pageContainer.scrollTo({
|
|
103
|
+
top: nodeElement.offsetTop + (pageHeader?.offsetHeight || 0),
|
|
104
|
+
})
|
|
105
|
+
const pos = editor.value.view.posAtDOM(nodeElement, 0)
|
|
106
|
+
const { tr } = editor.value.view.state
|
|
107
|
+
tr.setSelection(new TextSelection.create(tr.doc, pos))
|
|
108
|
+
editor.value.view.dispatch(tr)
|
|
109
|
+
editor.value.view.focus()
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style lang="less">
|
|
114
|
+
.umo-node-view {
|
|
115
|
+
.umo-node-toc {
|
|
116
|
+
padding: 44px 24px 24px 10px;
|
|
117
|
+
position: relative;
|
|
118
|
+
outline: solid 1px var(--umo-content-node-border);
|
|
119
|
+
border-radius: var(--umo-content-node-radius);
|
|
120
|
+
background-color: #fff;
|
|
121
|
+
width: 100%;
|
|
122
|
+
&-head {
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
margin: 0;
|
|
125
|
+
position: absolute;
|
|
126
|
+
top: 0;
|
|
127
|
+
left: 24px;
|
|
128
|
+
padding: 0.25em 0.5em;
|
|
129
|
+
border-bottom-left-radius: 3px;
|
|
130
|
+
border-bottom-right-radius: 3px;
|
|
131
|
+
background: rgba(black, 0.05);
|
|
132
|
+
color: var(--umo-primary-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&-body {
|
|
136
|
+
--td-bg-color-container-hover: rgba(0, 0, 0, 0.05);
|
|
137
|
+
--td-text-color-primary: #222;
|
|
138
|
+
--td-border-level-1-color: #ddd;
|
|
139
|
+
--td-brand-color-light: rgba(0, 0, 0, 0.05);
|
|
140
|
+
.umo-tree__label {
|
|
141
|
+
margin-left: 0 !important;
|
|
142
|
+
padding: 5px;
|
|
143
|
+
&:hover {
|
|
144
|
+
color: var(--umo-primary-color);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
.umo-tree__empty {
|
|
148
|
+
height: 40px;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
color: #999;
|
|
154
|
+
margin-bottom: 15px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</style>
|