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,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="embed"
|
|
4
|
+
:text="t('export.embed.text')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="dialogVisible = true"
|
|
7
|
+
/>
|
|
8
|
+
<modal
|
|
9
|
+
:visible="dialogVisible"
|
|
10
|
+
width="460px"
|
|
11
|
+
:confirm-btn="t('export.embed.copy')"
|
|
12
|
+
@confirm="copyEmbed"
|
|
13
|
+
@close="dialogVisible = false"
|
|
14
|
+
>
|
|
15
|
+
<template #header>
|
|
16
|
+
<icon name="embed" />
|
|
17
|
+
{{ t('export.embed.title') }}
|
|
18
|
+
</template>
|
|
19
|
+
<div class="umo-embed-container">
|
|
20
|
+
<div class="umo-embed-tip" v-text="t('export.embed.tip')"></div>
|
|
21
|
+
<t-textarea
|
|
22
|
+
class="umo-embed-textarea"
|
|
23
|
+
:value="embedValue"
|
|
24
|
+
readonly
|
|
25
|
+
autosize
|
|
26
|
+
></t-textarea>
|
|
27
|
+
</div>
|
|
28
|
+
</modal>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
import { t } from '../../../../composables/i18n.js';
|
|
33
|
+
import { ref as _ref } from 'vue';
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
import { inject, computed } from 'vue';
|
|
37
|
+
const options = inject('options')
|
|
38
|
+
const container = inject('container')
|
|
39
|
+
let dialogVisible = _ref(false)
|
|
40
|
+
|
|
41
|
+
const embedValue = computed(() => {
|
|
42
|
+
return `<iframe src="${options.value.shareUrl}" width="100%" height="720px" frameborder="0" allowfullscreen="true"></iframe>`
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const copyEmbed = () => {
|
|
46
|
+
useCopy(embedValue, t('export.embed.copied'), container)
|
|
47
|
+
dialogVisible.value = false
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="less" scoped>
|
|
52
|
+
.umo-embed-container {
|
|
53
|
+
padding: 2px;
|
|
54
|
+
.umo-embed-tip {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: var(--umo-text-color-light);
|
|
57
|
+
margin-bottom: 6px;
|
|
58
|
+
line-height: 1.4;
|
|
59
|
+
}
|
|
60
|
+
.umo-embed-textarea {
|
|
61
|
+
:deep(textarea) {
|
|
62
|
+
word-break: break-all;
|
|
63
|
+
word-wrap: break-word;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button ico="html5" text="HTML" huge @menu-click="saveHtmlFile" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { t } from '../../../../composables/i18n.js';
|
|
7
|
+
|
|
8
|
+
import { saveAs } from 'file-saver'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
import { inject } from 'vue';
|
|
12
|
+
const editor = inject('editor')
|
|
13
|
+
const options = inject('options')
|
|
14
|
+
|
|
15
|
+
const saveHtmlFile = () => {
|
|
16
|
+
if (!editor.value) {
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
const blob = new Blob([editor.value.getHTML()], {
|
|
20
|
+
type: 'text/html;charset=utf-8',
|
|
21
|
+
})
|
|
22
|
+
const { title } = options.value.document
|
|
23
|
+
const filename =
|
|
24
|
+
title !== '' ? options.value.document?.title : t('document.untitled')
|
|
25
|
+
saveAs(blob, `${filename}.html`)
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="image"
|
|
4
|
+
:text="t('export.image.text')"
|
|
5
|
+
menu-type="dropdown"
|
|
6
|
+
huge
|
|
7
|
+
:select-options="formats"
|
|
8
|
+
@click="saveImage"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { t } from '../../../../composables/i18n.js';
|
|
14
|
+
|
|
15
|
+
import { useAlert } from '../../../../composables/dialog.js';
|
|
16
|
+
|
|
17
|
+
import domtoimage from 'dom-to-image-more'
|
|
18
|
+
import { saveAs } from 'file-saver'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
import { inject, nextTick } from 'vue';
|
|
22
|
+
const { toBlob } = domtoimage
|
|
23
|
+
const container = inject('container')
|
|
24
|
+
const exportFile = inject('exportFile')
|
|
25
|
+
const page = inject('page')
|
|
26
|
+
const options = inject('options')
|
|
27
|
+
|
|
28
|
+
const formats = [
|
|
29
|
+
{ content: t('export.image.png'), value: 'png' },
|
|
30
|
+
{ content: t('export.image.jpg'), value: 'jpg' },
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
const saveImage = async ({ content, value }) => {
|
|
34
|
+
if (!content) {
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
const { zoomLevel } = page.value
|
|
38
|
+
exportFile.value.image = true
|
|
39
|
+
try {
|
|
40
|
+
page.value.zoomLevel = 100
|
|
41
|
+
await nextTick()
|
|
42
|
+
const node = document.querySelector(`${container} .umo-page-content`)
|
|
43
|
+
const blob = await toBlob(node, { scale: devicePixelRatio })
|
|
44
|
+
const { title } = options.value.document
|
|
45
|
+
const filename =
|
|
46
|
+
title !== '' ? options.value?.document?.title : t('document.untitled')
|
|
47
|
+
saveAs(
|
|
48
|
+
blob,
|
|
49
|
+
`${filename}${devicePixelRatio > 1 ? `@${devicePixelRatio}x` : ''}.${value}`,
|
|
50
|
+
)
|
|
51
|
+
} catch {
|
|
52
|
+
const dialog = useAlert({
|
|
53
|
+
attach: container,
|
|
54
|
+
theme: 'warning',
|
|
55
|
+
header: t('export.image.error.title'),
|
|
56
|
+
body: t('export.image.error.message'),
|
|
57
|
+
onConfirm() {
|
|
58
|
+
dialog.destroy()
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
} finally {
|
|
62
|
+
page.value.zoomLevel = zoomLevel
|
|
63
|
+
exportFile.value.image = false
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="share"
|
|
4
|
+
:text="t('export.share.text')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="dialogVisible = true"
|
|
7
|
+
/>
|
|
8
|
+
<modal
|
|
9
|
+
:visible="dialogVisible"
|
|
10
|
+
width="420px"
|
|
11
|
+
:confirm-btn="t('export.share.copy')"
|
|
12
|
+
@confirm="copyLink"
|
|
13
|
+
@close="dialogVisible = false"
|
|
14
|
+
>
|
|
15
|
+
<template #header>
|
|
16
|
+
<icon name="share" />
|
|
17
|
+
{{ t('export.share.text') }}
|
|
18
|
+
</template>
|
|
19
|
+
<div class="umo-share-container">
|
|
20
|
+
<div class="umo-share-tip" v-text="t('export.share.tip')"></div>
|
|
21
|
+
<t-textarea
|
|
22
|
+
class="umo-share-textarea"
|
|
23
|
+
:value="options.shareUrl"
|
|
24
|
+
readonly
|
|
25
|
+
autosize
|
|
26
|
+
></t-textarea>
|
|
27
|
+
</div>
|
|
28
|
+
</modal>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
import { t } from '../../../../composables/i18n.js';
|
|
33
|
+
import { ref as _ref } from 'vue';
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
import { inject } from 'vue';
|
|
37
|
+
const options = inject('options')
|
|
38
|
+
const container = inject('container')
|
|
39
|
+
let dialogVisible = _ref(false)
|
|
40
|
+
|
|
41
|
+
const copyLink = () => {
|
|
42
|
+
useCopy(options.value.shareUrl, t('export.share.copied'), container)
|
|
43
|
+
dialogVisible.value = false
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="less" scoped>
|
|
48
|
+
.umo-share-container {
|
|
49
|
+
padding: 2px;
|
|
50
|
+
.umo-share-tip {
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
color: var(--umo-text-color-light);
|
|
53
|
+
margin-bottom: 6px;
|
|
54
|
+
line-height: 1.4;
|
|
55
|
+
}
|
|
56
|
+
.umo-share-textarea {
|
|
57
|
+
:deep(textarea) {
|
|
58
|
+
word-break: break-all;
|
|
59
|
+
word-wrap: break-word;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="text"
|
|
4
|
+
:text="t('export.text')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="saveTextFile"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { t } from '../../../../composables/i18n.js';
|
|
12
|
+
|
|
13
|
+
import { saveAs } from 'file-saver'
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import { inject } from 'vue';
|
|
17
|
+
const editor = inject('editor')
|
|
18
|
+
const options = inject('options')
|
|
19
|
+
|
|
20
|
+
const saveTextFile = () => {
|
|
21
|
+
if (!editor.value) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
const blob = new Blob([editor.value.getText()], {
|
|
25
|
+
type: 'text/plain;charset=utf-8',
|
|
26
|
+
})
|
|
27
|
+
const { title } = options.value.document
|
|
28
|
+
const filename =
|
|
29
|
+
title !== '' ? options.value?.document?.title : t('document.untitled')
|
|
30
|
+
saveAs(blob, `${filename}.txt`)
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="audio"
|
|
4
|
+
:text="t('insert.audio')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="
|
|
7
|
+
editor
|
|
8
|
+
?.chain()
|
|
9
|
+
.focus()
|
|
10
|
+
.selectFiles('audio', container, uploadFileMap)
|
|
11
|
+
.run()
|
|
12
|
+
"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { t } from '../../../../composables/i18n.js';
|
|
18
|
+
import { inject } from 'vue';
|
|
19
|
+
|
|
20
|
+
const container = inject('container')
|
|
21
|
+
const editor = inject('editor')
|
|
22
|
+
const uploadFileMap = inject('uploadFileMap')
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="bookmark"
|
|
4
|
+
:text="t('insert.bookmark.text')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="dialogVisible = true"
|
|
7
|
+
/>
|
|
8
|
+
<modal
|
|
9
|
+
:visible="dialogVisible"
|
|
10
|
+
width="420px"
|
|
11
|
+
draggable
|
|
12
|
+
destroy-on-close
|
|
13
|
+
:confirm-btn="t('insert.bookmark.ok')"
|
|
14
|
+
@confirm="insertBookmark"
|
|
15
|
+
@close="dialogVisible = false"
|
|
16
|
+
>
|
|
17
|
+
<template #header>
|
|
18
|
+
<icon name="bookmark" />
|
|
19
|
+
{{ t('insert.bookmark.set') }}
|
|
20
|
+
</template>
|
|
21
|
+
<div class="umo-bookmark-container">
|
|
22
|
+
<t-form label-align="top" colon>
|
|
23
|
+
<t-form-item
|
|
24
|
+
:label="t('insert.bookmark.textName')"
|
|
25
|
+
style="margin-bottom: 10px"
|
|
26
|
+
>
|
|
27
|
+
<t-input
|
|
28
|
+
v-model.trim="bookmarkText"
|
|
29
|
+
status="default"
|
|
30
|
+
:maxcharacter="30"
|
|
31
|
+
:placeholder="t('insert.bookmark.placeholder')"
|
|
32
|
+
clearable
|
|
33
|
+
/>
|
|
34
|
+
</t-form-item>
|
|
35
|
+
<t-form-item class="bookmark-list">
|
|
36
|
+
<t-table
|
|
37
|
+
row-key="bookmarkRowId"
|
|
38
|
+
height="250"
|
|
39
|
+
:data="bookmarkData"
|
|
40
|
+
:columns="bookmarkColumns"
|
|
41
|
+
:active-row-type="'single'"
|
|
42
|
+
lazy-load
|
|
43
|
+
@active-change="onActiveChange"
|
|
44
|
+
>
|
|
45
|
+
<template #operation="{ row }">
|
|
46
|
+
<tooltip :content="t('insert.bookmark.delete')">
|
|
47
|
+
<t-button
|
|
48
|
+
size="small"
|
|
49
|
+
shape="square"
|
|
50
|
+
variant="text"
|
|
51
|
+
@click="rowDelete(row)"
|
|
52
|
+
><icon name="node-delete"
|
|
53
|
+
/></t-button>
|
|
54
|
+
</tooltip>
|
|
55
|
+
</template>
|
|
56
|
+
</t-table>
|
|
57
|
+
</t-form-item>
|
|
58
|
+
<t-form-item>
|
|
59
|
+
<t-checkbox v-model="page.showBookmark">{{
|
|
60
|
+
t('insert.bookmark.show')
|
|
61
|
+
}}</t-checkbox>
|
|
62
|
+
</t-form-item>
|
|
63
|
+
</t-form>
|
|
64
|
+
</div>
|
|
65
|
+
</modal>
|
|
66
|
+
</template>
|
|
67
|
+
<script setup>
|
|
68
|
+
import { t } from '../../../../composables/i18n.js';
|
|
69
|
+
|
|
70
|
+
import { useAlert } from '../../../../composables/dialog.js';
|
|
71
|
+
import { ref as _ref } from 'vue';
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
import { inject, watch } from 'vue';
|
|
75
|
+
const container = inject('container')
|
|
76
|
+
const editor = inject('editor')
|
|
77
|
+
const page = inject('page')
|
|
78
|
+
|
|
79
|
+
// 弹窗口显示隐藏 true显示 默认隐藏
|
|
80
|
+
let dialogVisible = _ref(false)
|
|
81
|
+
// 书签名称
|
|
82
|
+
let bookmarkText = _ref('')
|
|
83
|
+
// 书签数据
|
|
84
|
+
let bookmarkData = []
|
|
85
|
+
// 书签表格显示列
|
|
86
|
+
const bookmarkColumns = [
|
|
87
|
+
{
|
|
88
|
+
colKey: 'bookmarkRowName',
|
|
89
|
+
title: t('insert.bookmark.textName'), // '书签名称',
|
|
90
|
+
ellipsis: false,
|
|
91
|
+
align: 'left',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
colKey: 'operation',
|
|
95
|
+
title: t('insert.bookmark.actions'), // '操作',
|
|
96
|
+
width: 70,
|
|
97
|
+
fixed: 'right',
|
|
98
|
+
align: 'center',
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
// 书签插入
|
|
103
|
+
const insertBookmark = () => {
|
|
104
|
+
// 书签名称不为空时不处理
|
|
105
|
+
if (bookmarkText.value) {
|
|
106
|
+
let existbmName = ''
|
|
107
|
+
if (bookmarkData.length > 0) {
|
|
108
|
+
for (const item of bookmarkData) {
|
|
109
|
+
if (item.bookmarkRowName === bookmarkText.value) {
|
|
110
|
+
existbmName = item.bookmarkRowName
|
|
111
|
+
break
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// 存在-1
|
|
116
|
+
if (!existbmName) {
|
|
117
|
+
if (editor.value?.commands.setBookmark({ bookmarkName: bookmarkText.value })) {
|
|
118
|
+
dialogVisible.value = false
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
if (editor.value?.commands.focusBookmark(existbmName)) {
|
|
122
|
+
dialogVisible.value = false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
const dialog = useAlert({
|
|
127
|
+
attach: container,
|
|
128
|
+
theme: 'warning',
|
|
129
|
+
header: t('insert.bookmark.text'),
|
|
130
|
+
body: t('insert.bookmark.emptyError'),
|
|
131
|
+
onConfirm() {
|
|
132
|
+
dialog.destroy()
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const onActiveChange = (highlightRowKeys, ctx) => {
|
|
138
|
+
// 重置文档
|
|
139
|
+
bookmarkText.value = ctx.currentRowData?.bookmarkRowName
|
|
140
|
+
}
|
|
141
|
+
// 这个方法本来也想封装到addCommands 中,但经过多次验证,每次都会有一个额外的事务异常
|
|
142
|
+
const rowDelete = (row) => {
|
|
143
|
+
const element = editor.value?.view.dom.querySelector(
|
|
144
|
+
`bookmark[bookmarkName="${row.bookmarkRowName}"]`,
|
|
145
|
+
)
|
|
146
|
+
if (element) {
|
|
147
|
+
const pos = editor.value?.view.posAtDOM(element, 0)
|
|
148
|
+
const { tr } = editor.value?.view.state || {}
|
|
149
|
+
if (tr) {
|
|
150
|
+
const marks = editor.value?.view.state.doc.resolve(pos + 1)?.marks()
|
|
151
|
+
if (marks !== null && marks.length > 0) {
|
|
152
|
+
for (const mark of marks) {
|
|
153
|
+
if (mark.type.name === 'bookmark') {
|
|
154
|
+
editor.value?.view.dispatch(
|
|
155
|
+
tr.removeMark(pos, pos + element.outerText.length, mark),
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
editor.value?.view.dispatch(
|
|
161
|
+
tr.removeMark(pos, pos + element.outerText.length),
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
dialogVisible.value = false
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const getCurWordAllBookmark = () => {
|
|
169
|
+
try {
|
|
170
|
+
bookmarkText.value = ''
|
|
171
|
+
editor.value?.commands.getAllBookmarks((data) => {
|
|
172
|
+
bookmarkData = data
|
|
173
|
+
})
|
|
174
|
+
} catch (e) {
|
|
175
|
+
dialogVisible.value = false
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
watch(
|
|
179
|
+
() => dialogVisible.value,
|
|
180
|
+
() => {
|
|
181
|
+
if (dialogVisible.value) {
|
|
182
|
+
getCurWordAllBookmark()
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
)
|
|
186
|
+
</script>
|
|
187
|
+
|
|
188
|
+
<style lang="less" scoped>
|
|
189
|
+
.bookmark-list {
|
|
190
|
+
border: solid 1px var(--umo-border-color-dark);
|
|
191
|
+
border-radius: var(--umo-radius);
|
|
192
|
+
margin-bottom: 5px;
|
|
193
|
+
overflow: hidden;
|
|
194
|
+
:deep(table) {
|
|
195
|
+
th,
|
|
196
|
+
td,
|
|
197
|
+
tr {
|
|
198
|
+
border: none !important;
|
|
199
|
+
padding: 4px 10px;
|
|
200
|
+
}
|
|
201
|
+
th {
|
|
202
|
+
border-bottom: solid 1px var(--umo-border-color) !important;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="callout"
|
|
4
|
+
:text="t('insert.callout')"
|
|
5
|
+
huge
|
|
6
|
+
@menu-click="editor?.chain().focus().insertCallout().run()"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { t } from '../../../../composables/i18n.js';
|
|
12
|
+
import { inject } from 'vue';
|
|
13
|
+
|
|
14
|
+
const editor = inject('editor')
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="date"
|
|
4
|
+
:text="t('insert.date')"
|
|
5
|
+
menu-type="dropdown"
|
|
6
|
+
huge
|
|
7
|
+
:select-options="options"
|
|
8
|
+
@click="insertDate"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { t } from '../../../../composables/i18n.js';
|
|
14
|
+
import { useDateFormat, useNow } from '@vueuse/core';
|
|
15
|
+
import { inject } from 'vue';
|
|
16
|
+
|
|
17
|
+
// 月份
|
|
18
|
+
const formDate = (format) => useDateFormat(useNow(), format).value
|
|
19
|
+
|
|
20
|
+
const formatDateToChinese = (dateStr) => {
|
|
21
|
+
const replaceDigits = (num) => {
|
|
22
|
+
const digits = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九']
|
|
23
|
+
return num
|
|
24
|
+
.toString()
|
|
25
|
+
.split('')
|
|
26
|
+
.map((n) => digits[Number(n)])
|
|
27
|
+
.join('')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return dateStr.replace(/\d+/g, (match) => {
|
|
31
|
+
if (match.length === 4) {
|
|
32
|
+
// 年份
|
|
33
|
+
return replaceDigits(match)
|
|
34
|
+
}
|
|
35
|
+
if (match.length === 1) {
|
|
36
|
+
// 月份或日期
|
|
37
|
+
return replaceDigits(match)
|
|
38
|
+
}
|
|
39
|
+
if (match.length === 2) {
|
|
40
|
+
const num1 = match.charAt(0)
|
|
41
|
+
const num2 = match.charAt(1)
|
|
42
|
+
if (num1 === '0') {
|
|
43
|
+
return `${replaceDigits(num1)}十`
|
|
44
|
+
}
|
|
45
|
+
if (num1 === '1') {
|
|
46
|
+
return `十${replaceDigits(num2)}`
|
|
47
|
+
}
|
|
48
|
+
if (num2 === '0') {
|
|
49
|
+
return `${replaceDigits(num1)}十`
|
|
50
|
+
}
|
|
51
|
+
return `${replaceDigits(num1)}十${replaceDigits(num2)}`
|
|
52
|
+
}
|
|
53
|
+
return match // 其他情况不处理
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const options = [
|
|
58
|
+
{ content: '自定义日期', format: 'YYYY-M-D', capitalize: false },
|
|
59
|
+
{
|
|
60
|
+
content: '自定义时间',
|
|
61
|
+
value: 'withTime',
|
|
62
|
+
format: 'YYYY-M-D HH:mm:ss',
|
|
63
|
+
capitalize: false,
|
|
64
|
+
divider: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
content: formDate('YYYY年M月D日'),
|
|
68
|
+
format: 'YYYY年M月D日',
|
|
69
|
+
capitalize: false,
|
|
70
|
+
},
|
|
71
|
+
{ content: formDate('YYYY-M-D'), format: 'YYYY-M-D', capitalize: false },
|
|
72
|
+
{ content: formDate('YYYY/M/D'), format: 'YYYY/M/D', capitalize: false },
|
|
73
|
+
{ content: formDate('YYYY.M.D'), format: 'YYYY.M.D', capitalize: false },
|
|
74
|
+
{ content: formDate('YYYY年M月'), format: 'YYYY年M月', capitalize: false },
|
|
75
|
+
{
|
|
76
|
+
content: formDate('YYYY年M月D日 HH:mm:ss'),
|
|
77
|
+
value: 'withTime',
|
|
78
|
+
format: 'YYYY年M月D日 HH:mm:ss',
|
|
79
|
+
capitalize: false,
|
|
80
|
+
divider: true,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
content: formatDateToChinese(formDate('YYYY年M月D日')),
|
|
84
|
+
format: 'YYYY年M月D日',
|
|
85
|
+
capitalize: true,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
content: formatDateToChinese(formDate('YYYY年M月')),
|
|
89
|
+
format: 'YYYY年M月',
|
|
90
|
+
capitalize: true,
|
|
91
|
+
},
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
const editor = inject('editor')
|
|
95
|
+
|
|
96
|
+
const insertDate = ({ content, format, capitalize, value }) => {
|
|
97
|
+
if (!content) {
|
|
98
|
+
return
|
|
99
|
+
}
|
|
100
|
+
editor.value
|
|
101
|
+
?.chain()
|
|
102
|
+
.insertDatetime({
|
|
103
|
+
text: content.includes('自定义') ? `[${content}]` : content,
|
|
104
|
+
date: formDate(format), // formDate('YYYY-MM-DD HH:mm:ss'),
|
|
105
|
+
withTime: value === 'withTime',
|
|
106
|
+
format,
|
|
107
|
+
capitalize,
|
|
108
|
+
})
|
|
109
|
+
.focus()
|
|
110
|
+
.run()
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<menus-button
|
|
3
|
+
ico="code-block"
|
|
4
|
+
:text="t('insert.codeBlock')"
|
|
5
|
+
shortcut="Ctrl+Alt+C"
|
|
6
|
+
huge
|
|
7
|
+
@menu-click="editor?.chain().focus().setCodeBlock().run()"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { t } from '../../../../composables/i18n.js';
|
|
13
|
+
import { inject } from 'vue';
|
|
14
|
+
|
|
15
|
+
const editor = inject('editor')
|
|
16
|
+
</script>
|