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,77 @@
|
|
|
1
|
+
import { Extension, mergeAttributes, Node } from '@tiptap/core'
|
|
2
|
+
|
|
3
|
+
import { columnsKeymap } from './keymap'
|
|
4
|
+
import { gridResizingPlugin } from './resize'
|
|
5
|
+
|
|
6
|
+
const Column = Node.create({
|
|
7
|
+
name: 'column',
|
|
8
|
+
group: 'block',
|
|
9
|
+
content: 'block+',
|
|
10
|
+
addAttributes() {
|
|
11
|
+
return {
|
|
12
|
+
colWidth: {
|
|
13
|
+
default: 200,
|
|
14
|
+
parseHTML: (element) => {
|
|
15
|
+
const width = element.style.width.replace('px', '')
|
|
16
|
+
return Number(width) || 200
|
|
17
|
+
},
|
|
18
|
+
renderHTML: (attributes) => {
|
|
19
|
+
const style = attributes.colWidth
|
|
20
|
+
? `width: ${attributes.colWidth}px;`
|
|
21
|
+
: ''
|
|
22
|
+
return { style }
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
parseHTML() {
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
tag: 'div.umo-node-column',
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
renderHTML({ HTMLAttributes }) {
|
|
35
|
+
return [
|
|
36
|
+
'div',
|
|
37
|
+
mergeAttributes(HTMLAttributes, { class: 'umo-node-column' }),
|
|
38
|
+
0,
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const ColumnContainer = Node.create({
|
|
44
|
+
name: 'columnContainer',
|
|
45
|
+
group: 'block',
|
|
46
|
+
content: 'column+',
|
|
47
|
+
parseHTML() {
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
tag: 'div.umo-node-column-container',
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
renderHTML({ HTMLAttributes }) {
|
|
55
|
+
return [
|
|
56
|
+
'div',
|
|
57
|
+
mergeAttributes(HTMLAttributes, {
|
|
58
|
+
class: 'umo-node-column-container',
|
|
59
|
+
}),
|
|
60
|
+
0,
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
export default Extension.create({
|
|
66
|
+
name: 'columns',
|
|
67
|
+
addExtensions() {
|
|
68
|
+
return [Column, ColumnContainer]
|
|
69
|
+
},
|
|
70
|
+
addCommands() {},
|
|
71
|
+
addProseMirrorPlugins() {
|
|
72
|
+
return [
|
|
73
|
+
gridResizingPlugin({ handleWidth: 2, columnMinWidth: 50 }),
|
|
74
|
+
columnsKeymap,
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chainCommands,
|
|
3
|
+
createParagraphNear,
|
|
4
|
+
newlineInCode,
|
|
5
|
+
splitBlock,
|
|
6
|
+
} from '@tiptap/pm/commands'
|
|
7
|
+
import { keymap } from '@tiptap/pm/keymap'
|
|
8
|
+
import { TextSelection } from '@tiptap/pm/state'
|
|
9
|
+
import { canSplit, liftTarget } from '@tiptap/pm/transform'
|
|
10
|
+
|
|
11
|
+
const findParentColumn = ($pos) => {
|
|
12
|
+
for (let { depth } = $pos; depth > 0; depth--) {
|
|
13
|
+
const node = $pos.node(depth)
|
|
14
|
+
if (node.type.name === 'column') {
|
|
15
|
+
return { node, depth }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const liftEmptyBlock = (state, dispatch) => {
|
|
22
|
+
const { $cursor } = state.selection
|
|
23
|
+
if (!$cursor || $cursor.parent.content.size) return false
|
|
24
|
+
if ('column' === $cursor.node($cursor.depth - 1).type.name) return false
|
|
25
|
+
if ($cursor.depth > 1 && $cursor.after() !== $cursor.end(-1)) {
|
|
26
|
+
const before = $cursor.before()
|
|
27
|
+
if (canSplit(state.doc, before)) {
|
|
28
|
+
if (dispatch) dispatch(state.tr.split(before).scrollIntoView())
|
|
29
|
+
return true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const range = $cursor.blockRange(),
|
|
33
|
+
target = range && liftTarget(range)
|
|
34
|
+
if (target === null) return false
|
|
35
|
+
if (dispatch) dispatch(state.tr.lift(range, target).scrollIntoView())
|
|
36
|
+
return true
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const columnsKeymap = keymap({
|
|
40
|
+
Enter: chainCommands(
|
|
41
|
+
newlineInCode,
|
|
42
|
+
createParagraphNear,
|
|
43
|
+
liftEmptyBlock,
|
|
44
|
+
splitBlock,
|
|
45
|
+
),
|
|
46
|
+
'Mod-a': (state, dispatch, view) => {
|
|
47
|
+
const { selection } = state
|
|
48
|
+
const { $from } = selection
|
|
49
|
+
const found = findParentColumn($from)
|
|
50
|
+
if (found) {
|
|
51
|
+
const { depth } = found
|
|
52
|
+
const start = $from.start(depth)
|
|
53
|
+
const end = $from.end(depth)
|
|
54
|
+
const tr = state.tr.setSelection(
|
|
55
|
+
TextSelection.create(state.doc, start, end),
|
|
56
|
+
)
|
|
57
|
+
if (dispatch) dispatch(tr)
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
60
|
+
return false
|
|
61
|
+
},
|
|
62
|
+
})
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Plugin } from '@tiptap/pm/state'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
handleGridDecorations,
|
|
5
|
+
handleMouseDown,
|
|
6
|
+
handleMouseLeave,
|
|
7
|
+
handleMouseMove,
|
|
8
|
+
handleMouseUp,
|
|
9
|
+
} from './dom'
|
|
10
|
+
import { GridResizeState, gridResizingPluginKey } from './state'
|
|
11
|
+
|
|
12
|
+
export const gridResizingPlugin = (options) => {
|
|
13
|
+
const handleWidth = options?.handleWidth ?? 2
|
|
14
|
+
const columnMinWidth = options?.columnMinWidth ?? 50
|
|
15
|
+
|
|
16
|
+
return new Plugin({
|
|
17
|
+
key: gridResizingPluginKey,
|
|
18
|
+
|
|
19
|
+
state: {
|
|
20
|
+
init: () => new GridResizeState(-1, false),
|
|
21
|
+
apply: (tr, prev) => {
|
|
22
|
+
return prev.apply(tr)
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
attributes: (state) => {
|
|
28
|
+
const pluginState = gridResizingPluginKey.getState(state)
|
|
29
|
+
if (pluginState && pluginState.activeHandle > -1) {
|
|
30
|
+
return { class: 'umo-node-column-resize-cursor' }
|
|
31
|
+
}
|
|
32
|
+
return {}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
// The main event handlers
|
|
36
|
+
handleDOMEvents: {
|
|
37
|
+
mousemove: (view, event) => {
|
|
38
|
+
return handleMouseMove(view, event, handleWidth)
|
|
39
|
+
},
|
|
40
|
+
mouseleave: (view) => {
|
|
41
|
+
return handleMouseLeave(view)
|
|
42
|
+
},
|
|
43
|
+
mousedown: (view, event) => {
|
|
44
|
+
return handleMouseDown(view, event, columnMinWidth)
|
|
45
|
+
},
|
|
46
|
+
mouseup: (view, event) => {
|
|
47
|
+
return handleMouseUp(view, event)
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
decorations: (state) => {
|
|
52
|
+
const pluginState = gridResizingPluginKey.getState(state)
|
|
53
|
+
if (!pluginState) return null
|
|
54
|
+
if (pluginState.activeHandle === -1) return null
|
|
55
|
+
|
|
56
|
+
return handleGridDecorations(state, pluginState.activeHandle)
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const columnNodes = () => {
|
|
2
|
+
return {
|
|
3
|
+
column: {
|
|
4
|
+
group: 'block',
|
|
5
|
+
content: 'block+',
|
|
6
|
+
attrs: {
|
|
7
|
+
colWidth: { default: 200 },
|
|
8
|
+
},
|
|
9
|
+
parseDOM: [
|
|
10
|
+
{
|
|
11
|
+
tag: 'div.umo-node-column',
|
|
12
|
+
getAttrs(dom) {
|
|
13
|
+
if (!(dom instanceof HTMLElement)) return false
|
|
14
|
+
const width = dom.style.width.replace('px', '') || 200
|
|
15
|
+
return {
|
|
16
|
+
colWidth: width,
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
toDOM(node) {
|
|
22
|
+
const { colWidth } = node.attrs
|
|
23
|
+
const style = colWidth ? `width: ${colWidth}px;` : ''
|
|
24
|
+
return [
|
|
25
|
+
'div',
|
|
26
|
+
{
|
|
27
|
+
class: 'umo-node-column',
|
|
28
|
+
style,
|
|
29
|
+
},
|
|
30
|
+
0,
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
columnContainer: {
|
|
35
|
+
group: 'block',
|
|
36
|
+
content: 'column+',
|
|
37
|
+
parseDOM: [
|
|
38
|
+
{
|
|
39
|
+
tag: 'div.umo-node-column-container',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
toDOM() {
|
|
43
|
+
return ['div', { class: 'umo-node-column-container' }, 0]
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PluginKey } from '@tiptap/pm/state'
|
|
2
|
+
|
|
3
|
+
export const gridResizingPluginKey = new PluginKey('gridResizingPlugin')
|
|
4
|
+
|
|
5
|
+
export class GridResizeState {
|
|
6
|
+
constructor(activeHandle, dragging) {
|
|
7
|
+
this.activeHandle = activeHandle
|
|
8
|
+
this.dragging = dragging
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
apply(tr) {
|
|
12
|
+
const action = tr.getMeta(gridResizingPluginKey)
|
|
13
|
+
if (!action) return this
|
|
14
|
+
|
|
15
|
+
if (typeof action.setHandle === 'number') {
|
|
16
|
+
return new GridResizeState(action.setHandle, false)
|
|
17
|
+
}
|
|
18
|
+
if (action.setDragging !== undefined) {
|
|
19
|
+
return new GridResizeState(this.activeHandle, action.setDragging)
|
|
20
|
+
}
|
|
21
|
+
if (this.activeHandle > -1 && tr.docChanged) {
|
|
22
|
+
// remap when doc changes
|
|
23
|
+
}
|
|
24
|
+
return this
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const findBoundaryPosition = (view, event, handleWidth) => {
|
|
2
|
+
const gridDOM = event
|
|
3
|
+
.composedPath()
|
|
4
|
+
.find((el) => el.classList?.contains('umo-node-column-container'))
|
|
5
|
+
if (!gridDOM) return -1
|
|
6
|
+
|
|
7
|
+
const children = Array.from(gridDOM.children).filter((el) =>
|
|
8
|
+
el.classList.contains('umo-node-column'),
|
|
9
|
+
)
|
|
10
|
+
for (let i = 0; i < children.length; i++) {
|
|
11
|
+
const colEl = children[i]
|
|
12
|
+
const rect = colEl.getBoundingClientRect()
|
|
13
|
+
if (
|
|
14
|
+
event.clientX >= rect.right - handleWidth - 2 &&
|
|
15
|
+
event.clientX <= rect.right + 10 + handleWidth
|
|
16
|
+
) {
|
|
17
|
+
const pos = view.posAtDOM(colEl, 0)
|
|
18
|
+
if (pos !== null) {
|
|
19
|
+
return pos
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return -1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const draggedWidth = (dragging, event, minWidth) => {
|
|
28
|
+
const offset = event.clientX - dragging.startX
|
|
29
|
+
return Math.max(minWidth, dragging.startWidth + offset)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const updateColumnNodeWidth = (view, pos, attrs, width) => {
|
|
33
|
+
view.dispatch(
|
|
34
|
+
view.state.tr.setNodeMarkup(pos, undefined, {
|
|
35
|
+
...attrs,
|
|
36
|
+
colWidth: width - 12 * 2,
|
|
37
|
+
}),
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const getColumnInfoAtPos = (view, boundaryPos) => {
|
|
42
|
+
const $pos = view.state.doc.resolve(boundaryPos)
|
|
43
|
+
const node = $pos.parent
|
|
44
|
+
if (!node || node.type.name !== 'column') return null
|
|
45
|
+
|
|
46
|
+
const dom = view.domAtPos($pos.pos)
|
|
47
|
+
if (!dom.node) return null
|
|
48
|
+
|
|
49
|
+
const columnEl =
|
|
50
|
+
dom.node instanceof HTMLElement ? dom.node : dom.node.childNodes[dom.offset]
|
|
51
|
+
|
|
52
|
+
const domWidth = columnEl.offsetWidth
|
|
53
|
+
|
|
54
|
+
return { $pos, node, columnEl, domWidth }
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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: 'datetime',
|
|
9
|
+
group: 'inline',
|
|
10
|
+
inline: true,
|
|
11
|
+
atom: true,
|
|
12
|
+
selectable: false,
|
|
13
|
+
|
|
14
|
+
addAttributes() {
|
|
15
|
+
return {
|
|
16
|
+
type: { default: 'datetime' },
|
|
17
|
+
date: { default: null },
|
|
18
|
+
text: { default: `[${t('insert.date')}]` },
|
|
19
|
+
format: { default: null },
|
|
20
|
+
withTime: { default: false },
|
|
21
|
+
capitalize: { default: false },
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
parseHTML() {
|
|
26
|
+
return [{ tag: 'span[data-type="datetime"]' }]
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
renderHTML({ HTMLAttributes }) {
|
|
30
|
+
return [
|
|
31
|
+
'span',
|
|
32
|
+
mergeAttributes(HTMLAttributes, { 'data-type': 'datetime' }),
|
|
33
|
+
HTMLAttributes.text,
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
addNodeView() {
|
|
38
|
+
return VueNodeViewRenderer(NodeView)
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
addCommands() {
|
|
42
|
+
return {
|
|
43
|
+
insertDatetime:
|
|
44
|
+
(options) =>
|
|
45
|
+
({ chain }) => {
|
|
46
|
+
return chain()
|
|
47
|
+
.insertContent({
|
|
48
|
+
type: this.name,
|
|
49
|
+
attrs: options,
|
|
50
|
+
})
|
|
51
|
+
.run()
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
})
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<node-view-wrapper as="span" class="umo-node-datetime">
|
|
3
|
+
<t-popup
|
|
4
|
+
v-model="popupVisible"
|
|
5
|
+
:attach="`${container} .umo-zoomable-container`"
|
|
6
|
+
trigger="click"
|
|
7
|
+
placement="bottom-start"
|
|
8
|
+
:disabled="
|
|
9
|
+
page.preview?.enabled ||
|
|
10
|
+
options.document?.readOnly ||
|
|
11
|
+
!editor?.isEditable
|
|
12
|
+
"
|
|
13
|
+
>
|
|
14
|
+
<span class="umo-node-datetime-text">
|
|
15
|
+
<icon name="date" class="umo-node-datetime-icon" />
|
|
16
|
+
<span>{{ attrs.text }}</span>
|
|
17
|
+
</span>
|
|
18
|
+
<template #content>
|
|
19
|
+
<t-date-picker-panel
|
|
20
|
+
:value="attrs.date"
|
|
21
|
+
:format="
|
|
22
|
+
attrs.format || `YYYY-MM-DD${attrs.withTime ? ' HH:mm:ss' : ''}`
|
|
23
|
+
"
|
|
24
|
+
:enable-time-picker="attrs.withTime"
|
|
25
|
+
:mode="attrs.format === 'YYYY年M月' ? 'month' : 'date'"
|
|
26
|
+
need-confirm
|
|
27
|
+
@change="datetimeChange"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
</t-popup>
|
|
31
|
+
</node-view-wrapper>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>import { computed as _computed, ref as _ref } from 'vue';
|
|
35
|
+
|
|
36
|
+
import { nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
|
37
|
+
|
|
38
|
+
import { inject } from 'vue';
|
|
39
|
+
const props = defineProps(nodeViewProps)
|
|
40
|
+
const attrs = _computed(() => props.node.attrs)
|
|
41
|
+
const { updateAttributes } = props
|
|
42
|
+
const container = inject('container')
|
|
43
|
+
const options = inject('options')
|
|
44
|
+
const page = inject('page')
|
|
45
|
+
let popupVisible = _ref(false)
|
|
46
|
+
|
|
47
|
+
const formatDateToChinese = (dateStr) => {
|
|
48
|
+
const replaceDigits = (num) => {
|
|
49
|
+
const digits = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九']
|
|
50
|
+
return num
|
|
51
|
+
.toString()
|
|
52
|
+
.split('')
|
|
53
|
+
.map((n) => digits[Number(n)])
|
|
54
|
+
.join('')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return dateStr.replace(/\d+/g, (match) => {
|
|
58
|
+
if (match.length === 4) {
|
|
59
|
+
// 年份
|
|
60
|
+
return replaceDigits(match)
|
|
61
|
+
}
|
|
62
|
+
if (match.length === 1) {
|
|
63
|
+
// 月份或日期
|
|
64
|
+
return replaceDigits(match)
|
|
65
|
+
}
|
|
66
|
+
if (match.length === 2) {
|
|
67
|
+
const num1 = match.charAt(0)
|
|
68
|
+
const num2 = match.charAt(1)
|
|
69
|
+
if (num1 === '0') {
|
|
70
|
+
return `${replaceDigits(num1)}十`
|
|
71
|
+
}
|
|
72
|
+
if (num1 === '1') {
|
|
73
|
+
return `十${replaceDigits(num2)}`
|
|
74
|
+
}
|
|
75
|
+
if (num2 === '0') {
|
|
76
|
+
return `${replaceDigits(num1)}十`
|
|
77
|
+
}
|
|
78
|
+
return `${replaceDigits(num1)}十${replaceDigits(num2)}`
|
|
79
|
+
}
|
|
80
|
+
return match // 其他情况不处理
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const datetimeChange = (value) => {
|
|
85
|
+
let selectDate = value
|
|
86
|
+
if (selectDate && attrs.value?.capitalize) {
|
|
87
|
+
selectDate = formatDateToChinese(value)
|
|
88
|
+
}
|
|
89
|
+
updateAttributes({ date: selectDate, text: selectDate })
|
|
90
|
+
popupVisible.value = false
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="less">
|
|
95
|
+
.umo-node-datetime {
|
|
96
|
+
margin: 0 0.2em;
|
|
97
|
+
background-color: transparent !important;
|
|
98
|
+
vertical-align: middle;
|
|
99
|
+
&-text {
|
|
100
|
+
box-decoration-break: clone;
|
|
101
|
+
margin: 0 0.2em;
|
|
102
|
+
border-radius: 0.2em;
|
|
103
|
+
cursor: default;
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
}
|
|
108
|
+
&-icon {
|
|
109
|
+
color: #ccc;
|
|
110
|
+
margin-right: 0.3em;
|
|
111
|
+
}
|
|
112
|
+
&:hover {
|
|
113
|
+
color: var(--umo-primary-color);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
此服务主要作用echarts相关的一些公共处理方法 主要用于基础模式
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// 基础模式下,对界面数据进行加工处理,根据第一列为空时不作为有效数据
|
|
6
|
+
export function calbaseConfigData(data) {
|
|
7
|
+
if (!data) {
|
|
8
|
+
return data
|
|
9
|
+
}
|
|
10
|
+
data = JSON.parse(JSON.stringify(data))
|
|
11
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
12
|
+
if (i === 0) {
|
|
13
|
+
continue
|
|
14
|
+
}
|
|
15
|
+
if (!data[i].A || data[i].A === '') {
|
|
16
|
+
data.splice(i, 1)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return data
|
|
20
|
+
}
|
|
21
|
+
// 计算配置 根据手工设置的配置信息和数据进行 Options 生成,此方法会逐步扩充
|
|
22
|
+
export function calbaseConfigOptions(data, config, options) {
|
|
23
|
+
// 声明的最终返回的options
|
|
24
|
+
let resOption = {}
|
|
25
|
+
if (!data || !config) {
|
|
26
|
+
return resOption
|
|
27
|
+
}
|
|
28
|
+
// 1.0 标题 title
|
|
29
|
+
if (config.titleText && config.titleText !== '') {
|
|
30
|
+
resOption.title = {}
|
|
31
|
+
resOption.title.text = config.titleText
|
|
32
|
+
resOption.title.left = config.titleleft || 'center' // 标题位置
|
|
33
|
+
}
|
|
34
|
+
// 2.0 图例位置 legend
|
|
35
|
+
let colNameList = []
|
|
36
|
+
function calbaseConfigOptionsInlegend() {
|
|
37
|
+
resOption.legend = {}
|
|
38
|
+
// 图例显示隐藏
|
|
39
|
+
resOption.legend.show = config.legend ? true : false
|
|
40
|
+
// 图例纵向位置
|
|
41
|
+
resOption.legend[config.legendlocation] = 10
|
|
42
|
+
// 图例横向位置
|
|
43
|
+
resOption.legend.left = config.legendleft
|
|
44
|
+
// 图例布局
|
|
45
|
+
resOption.legend.orient = config.legendorient
|
|
46
|
+
resOption.legend.data = []
|
|
47
|
+
// 目前只支持 26 个图例,图例名称为空时,不展示
|
|
48
|
+
const alphabet = Array.from({ length: 26 }, (_, i) =>
|
|
49
|
+
String.fromCharCode(i + 65),
|
|
50
|
+
)
|
|
51
|
+
colNameList = []
|
|
52
|
+
for (let i = 1; i < alphabet.length; i++) {
|
|
53
|
+
const curColName = alphabet[i]
|
|
54
|
+
if (!data[0][curColName] || data[0][curColName] === '') {
|
|
55
|
+
continue
|
|
56
|
+
}
|
|
57
|
+
resOption.legend.data.push(data[0][curColName])
|
|
58
|
+
colNameList.push(curColName) // 有那些列需要展示到系列中
|
|
59
|
+
if (config.seriesType === 'pie' && colNameList.length === 1) {
|
|
60
|
+
break
|
|
61
|
+
// 饼图只需要显示一个图例
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
calbaseConfigOptionsInlegend()
|
|
66
|
+
|
|
67
|
+
// 3.0 图例 yAxis xAxis series处理
|
|
68
|
+
function calbaseConfigOptionsInType() {
|
|
69
|
+
// y轴
|
|
70
|
+
if (config.seriesType === 'bar' || config.seriesType === 'line') {
|
|
71
|
+
resOption.yAxis = {
|
|
72
|
+
type: 'value',
|
|
73
|
+
}
|
|
74
|
+
resOption.xAxis = {}
|
|
75
|
+
resOption.xAxis.type = 'category'
|
|
76
|
+
resOption.xAxis.data = []
|
|
77
|
+
|
|
78
|
+
for (let i = 1; i < data.length; i++) {
|
|
79
|
+
resOption.xAxis.data.push(data[i]['A'])
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
resOption.series = []
|
|
84
|
+
|
|
85
|
+
for (let i = 0; i < colNameList.length; i++) {
|
|
86
|
+
const seriesdata = []
|
|
87
|
+
// 从第二行开始
|
|
88
|
+
for (let j = 1; j < data.length; j++) {
|
|
89
|
+
let _value = data[j][colNameList[i]]
|
|
90
|
+
if (isNaN(Number(_value))) {
|
|
91
|
+
_value = 0
|
|
92
|
+
} else _value = Number(_value)
|
|
93
|
+
if (config.seriesType === 'pie') {
|
|
94
|
+
seriesdata.push({ value: _value, name: data[j]['A'] })
|
|
95
|
+
} else {
|
|
96
|
+
seriesdata.push(_value)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
resOption.series.push({
|
|
100
|
+
name: resOption.legend.data[i],
|
|
101
|
+
type: config.seriesType,
|
|
102
|
+
data: seriesdata,
|
|
103
|
+
})
|
|
104
|
+
// 平滑折线
|
|
105
|
+
if (
|
|
106
|
+
config.smooth &&
|
|
107
|
+
resOption.series[resOption.series.length - 1].type === 'line'
|
|
108
|
+
) {
|
|
109
|
+
resOption.series[resOption.series.length - 1].smooth = true
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (config.seriesType === 'pie' && resOption.legend.data !== null) {
|
|
113
|
+
delete resOption.legend.data
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
calbaseConfigOptionsInType()
|
|
118
|
+
|
|
119
|
+
// 4.0 grid 属性设置
|
|
120
|
+
resOption.grid = {
|
|
121
|
+
left: '3%',
|
|
122
|
+
right: '4%',
|
|
123
|
+
top: 30,
|
|
124
|
+
bottom: 30,
|
|
125
|
+
containLabel: true,
|
|
126
|
+
}
|
|
127
|
+
if (resOption?.legend?.show) {
|
|
128
|
+
if (resOption?.legend?.bottom) {
|
|
129
|
+
resOption.grid.bottom = 60
|
|
130
|
+
} else {
|
|
131
|
+
resOption.grid.top = 60
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 9.0 自定义扩展,可以在外部自定义实现展示效果,扩展个性化样式
|
|
136
|
+
const newOptions = options.echarts?.onCustomSettings?.(data, config)
|
|
137
|
+
if (newOptions !== null && typeof newOptions === 'object') {
|
|
138
|
+
resOption = newOptions
|
|
139
|
+
}
|
|
140
|
+
// 10.0 返回值 必须JSON.parse(JSON.stringify( 一下,个别情况下echart不展示问题
|
|
141
|
+
return JSON.parse(JSON.stringify(resOption))
|
|
142
|
+
}
|