@agilehub/agile-editor 1.2.0 → 1.4.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/LICENSE +8 -8
- package/README.md +225 -199
- package/dist/agile-editor.css +2 -1
- package/dist/agile-editor.js +54041 -44624
- package/dist/types/components/container/ai.vue.d.ts +7 -0
- package/dist/types/components/container/page.vue.d.ts +16 -0
- package/dist/types/components/container/print.vue.d.ts +3 -0
- package/dist/types/components/container/search-replace.vue.d.ts +3 -0
- package/dist/types/components/container/toc.vue.d.ts +7 -0
- package/dist/types/components/editor/audio-dialog.vue.d.ts +3 -0
- package/dist/types/components/editor/formula-dialog.vue.d.ts +3 -0
- package/dist/types/components/editor/gallery-dialog.vue.d.ts +3 -0
- package/dist/types/components/editor/index.vue.d.ts +16 -0
- package/dist/types/components/editor/timeline-dialog.vue.d.ts +3 -0
- package/dist/types/components/icon.vue.d.ts +32 -0
- package/dist/types/components/index.d.ts +21 -0
- package/dist/types/components/index.vue.d.ts +3750 -0
- package/dist/types/components/menus/block/common.vue.d.ts +28 -0
- package/dist/types/components/menus/block/index.vue.d.ts +3 -0
- package/dist/types/components/menus/block/node.vue.d.ts +28 -0
- package/dist/types/components/menus/bubble/ai.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/audio/edit.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/callout/background.vue.d.ts +7 -0
- package/dist/types/components/menus/bubble/callout/builtin.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/callout/emoji-remove.vue.d.ts +7 -0
- package/dist/types/components/menus/bubble/file/download.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/file/width.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/gallery.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/convert.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/crop.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/draggable.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/flip.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/open.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/preview.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/proportion.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/reset-all.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/reset.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/rotate.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/title.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/index.vue.d.ts +16 -0
- package/dist/types/components/menus/bubble/link/copy.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/link/open.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/link/unlink.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/math.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/menus.vue.d.ts +16 -0
- package/dist/types/components/menus/bubble/node/delete.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/node/duplicate.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/node/tofile.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/tag/background.vue.d.ts +7 -0
- package/dist/types/components/menus/bubble/tag/builtin.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/tag/color.vue.d.ts +7 -0
- package/dist/types/components/menus/bubble/tag/delete.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/tag/input.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/text-box/background.vue.d.ts +7 -0
- package/dist/types/components/menus/bubble/text-box/border.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/text-box/writing-mode.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/video/poster.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/webpage/clickable.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/webpage/open.vue.d.ts +3 -0
- package/dist/types/components/menus/button.vue.d.ts +193 -0
- package/dist/types/components/menus/color-icon.vue.d.ts +7 -0
- package/dist/types/components/menus/toolbar/base/align-center.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/align-distributed.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/align-dropdown.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/align-justify.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/align-left.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/align-right.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/background-color.vue.d.ts +37 -0
- package/dist/types/components/menus/toolbar/base/bold.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/bullet-list.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/clear-format.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/code.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/color.vue.d.ts +37 -0
- package/dist/types/components/menus/toolbar/base/font-family.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/font-size.vue.d.ts +15 -0
- package/dist/types/components/menus/toolbar/base/format-painter.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/heading.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/highlight.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/indent.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/italic.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/letter-spacing.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/line-height.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/margin.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/ordered-list.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/outdent.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/quote.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/redo.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/search-replace.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/select-all.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/strike.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/subscript.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/superscript.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/text-indent.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/underline.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/undo.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/base/word-wrap.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/audio.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/callout.vue.d.ts +15 -0
- package/dist/types/components/menus/toolbar/insert/code-block.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/columns.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/details.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/emoji.vue.d.ts +9 -0
- package/dist/types/components/menus/toolbar/insert/file.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/footnote.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/gallery.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/hard-break.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/hr.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/image-text.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/image.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/prompt.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/symbol.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/tag.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/template.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/text-box.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/timeline.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/video.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/insert/web-page.vue.d.ts +24 -0
- package/dist/types/components/menus/toolbar/table/add-column-after.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/add-column-before.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/add-row-after.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/add-row-before.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/border-cell.vue.d.ts +7 -0
- package/dist/types/components/menus/toolbar/table/border-color.vue.d.ts +7 -0
- package/dist/types/components/menus/toolbar/table/border.vue.d.ts +7 -0
- package/dist/types/components/menus/toolbar/table/caption.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/cells-align.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/cells-background.vue.d.ts +7 -0
- package/dist/types/components/menus/toolbar/table/delete-column.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/delete-row.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/delete.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/fix.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/insert.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/merge-cells.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/next-cell.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/preset-style.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/previous-cell.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/split-cell.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/toggle-header-cell.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/toggle-header-column.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/table/toggle-header-row.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/chinese-case.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/circle-text.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/float-left.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/float-right.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/formatting.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/import-docx.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/math.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/mind-map.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/nowrap.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/style-editor.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/fullscreen.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/page-settings.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/preview.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/reset.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/theme.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/toc.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/zoom-auto.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/zoom-original.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/view/zoom.vue.d.ts +3 -0
- package/dist/types/components/modal.vue.d.ts +15 -0
- package/dist/types/components/page-options.vue.d.ts +17 -0
- package/dist/types/components/picker/borderStyle.vue.d.ts +7 -0
- package/dist/types/components/picker/color.vue.d.ts +29 -0
- package/dist/types/components/statusbar/about.vue.d.ts +19 -0
- package/dist/types/components/statusbar/countdown.vue.d.ts +33 -0
- package/dist/types/components/statusbar/index.vue.d.ts +3 -0
- package/dist/types/components/statusbar/shortcuts.vue.d.ts +3 -0
- package/dist/types/components/toolbar/classic.vue.d.ts +70 -0
- package/dist/types/components/toolbar/index.vue.d.ts +21 -0
- package/dist/types/components/toolbar/ribbon.vue.d.ts +70 -0
- package/dist/types/components/toolbar/scrollable.vue.d.ts +15 -0
- package/dist/types/components/tooltip.vue.d.ts +23 -0
- package/dist/types/composables/copy.d.ts +1 -0
- package/dist/types/composables/dialog.d.ts +22 -0
- package/dist/types/composables/hotkeys.d.ts +9 -0
- package/dist/types/composables/i18n.d.ts +3604 -0
- package/dist/types/composables/isEmpty.d.ts +6 -0
- package/dist/types/composables/popup.d.ts +4 -0
- package/dist/types/composables/select.d.ts +3 -0
- package/dist/types/composables/state.d.ts +7 -0
- package/dist/types/extensions/audio/index.d.ts +35 -0
- package/dist/types/extensions/audio/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/audio/vtt.d.ts +6 -0
- package/dist/types/extensions/bookmark.d.ts +11 -0
- package/dist/types/extensions/break-marks.d.ts +2 -0
- package/dist/types/extensions/bubble-note.d.ts +3 -0
- package/dist/types/extensions/bullet-list.d.ts +2 -0
- package/dist/types/extensions/callout/index.d.ts +8 -0
- package/dist/types/extensions/callout/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/code-block/index.d.ts +2 -0
- package/dist/types/extensions/code-block/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/columns/dom.d.ts +6 -0
- package/dist/types/extensions/columns/index.d.ts +8 -0
- package/dist/types/extensions/columns/keymap.d.ts +2 -0
- package/dist/types/extensions/columns/resize.d.ts +8 -0
- package/dist/types/extensions/columns/schema.d.ts +31 -0
- package/dist/types/extensions/columns/state.d.ts +13 -0
- package/dist/types/extensions/columns/utils.d.ts +9 -0
- package/dist/types/extensions/custom-style.d.ts +8 -0
- package/dist/types/extensions/details/index.d.ts +1 -0
- package/dist/types/extensions/details/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/editor-html-serialization.d.ts +4 -0
- package/dist/types/extensions/element-style.d.ts +4 -0
- package/dist/types/extensions/file/index.d.ts +16 -0
- package/dist/types/extensions/file/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/file-handler.d.ts +12 -0
- package/dist/types/extensions/float.d.ts +8 -0
- package/dist/types/extensions/footnotes/footnote.d.ts +2 -0
- package/dist/types/extensions/footnotes/footnotes.d.ts +2 -0
- package/dist/types/extensions/footnotes/index.d.ts +9 -0
- package/dist/types/extensions/footnotes/reference.d.ts +8 -0
- package/dist/types/extensions/footnotes/rules.d.ts +8 -0
- package/dist/types/extensions/footnotes/utils.d.ts +3 -0
- package/dist/types/extensions/format-painter.d.ts +8 -0
- package/dist/types/extensions/gallery/index.d.ts +42 -0
- package/dist/types/extensions/gallery/node-view.vue.d.ts +94 -0
- package/dist/types/extensions/heading.d.ts +2 -0
- package/dist/types/extensions/horizontal-rule.d.ts +2 -0
- package/dist/types/extensions/iframe/index.d.ts +8 -0
- package/dist/types/extensions/iframe/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/image/index.d.ts +2 -0
- package/dist/types/extensions/image/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/image-cropper.d.ts +43 -0
- package/dist/types/extensions/image-text/index.d.ts +8 -0
- package/dist/types/extensions/image-text/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/indent.d.ts +14 -0
- package/dist/types/extensions/index.d.ts +18 -0
- package/dist/types/extensions/insert-newline.d.ts +8 -0
- package/dist/types/extensions/letter-spacing.d.ts +11 -0
- package/dist/types/extensions/line-height.d.ts +8 -0
- package/dist/types/extensions/list-item/index.d.ts +2 -0
- package/dist/types/extensions/list-item/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/list-item/utils.d.ts +111 -0
- package/dist/types/extensions/margin.d.ts +14 -0
- package/dist/types/extensions/math/index.d.ts +45 -0
- package/dist/types/extensions/math/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/node-align.d.ts +12 -0
- package/dist/types/extensions/node-select.d.ts +10 -0
- package/dist/types/extensions/office-paste/index.d.ts +8 -0
- package/dist/types/extensions/office-paste/transform/bookmark.d.ts +1 -0
- package/dist/types/extensions/office-paste/transform/excel.d.ts +1 -0
- package/dist/types/extensions/office-paste/transform/html-classes.d.ts +1 -0
- package/dist/types/extensions/office-paste/transform/line-number.d.ts +1 -0
- package/dist/types/extensions/office-paste/transform/list.d.ts +1 -0
- package/dist/types/extensions/office-paste/transform/style.d.ts +3 -0
- package/dist/types/extensions/office-paste/transform/toc.d.ts +1 -0
- package/dist/types/extensions/office-paste/utils.d.ts +35 -0
- package/dist/types/extensions/ordered-list.d.ts +2 -0
- package/dist/types/extensions/page-break.d.ts +14 -0
- package/dist/types/extensions/paragraph.d.ts +2 -0
- package/dist/types/extensions/prompt/index.d.ts +8 -0
- package/dist/types/extensions/prompt/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/search-replace.d.ts +25 -0
- package/dist/types/extensions/selection.d.ts +2 -0
- package/dist/types/extensions/table-row-resize.d.ts +4 -0
- package/dist/types/extensions/table.d.ts +26 -0
- package/dist/types/extensions/tag/index.d.ts +8 -0
- package/dist/types/extensions/tag/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/text-align.d.ts +2 -0
- package/dist/types/extensions/text-box/index.d.ts +8 -0
- package/dist/types/extensions/text-box/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/timeline/content.vue.d.ts +8 -0
- package/dist/types/extensions/timeline/index.d.ts +59 -0
- package/dist/types/extensions/timeline/model.d.ts +45 -0
- package/dist/types/extensions/timeline/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/tiptap-track-change-extension.d.ts +62 -0
- package/dist/types/extensions/type-writer.d.ts +9 -0
- package/dist/types/extensions/video/index.d.ts +8 -0
- package/dist/types/extensions/video/node-view.vue.d.ts +93 -0
- package/dist/types/extensions/word-wrap.d.ts +10 -0
- package/dist/types/i18n.d.ts +3591 -0
- package/dist/types/options/config/dicts.d.ts +59 -0
- package/dist/types/options/config/index.d.ts +194 -0
- package/dist/types/options/index.d.ts +4 -0
- package/dist/types/options/schema.d.ts +3 -0
- package/dist/types/utils/content-migration.d.ts +12 -0
- package/dist/types/utils/content-transform.d.ts +6 -0
- package/dist/types/utils/copyright.d.ts +4 -0
- package/dist/types/utils/diagram-editor.d.ts +25 -0
- package/dist/types/utils/document-formatting.d.ts +69 -0
- package/dist/types/utils/docx-json.d.ts +14 -0
- package/dist/types/utils/file-icon.d.ts +1 -0
- package/dist/types/utils/file.d.ts +82 -0
- package/dist/types/utils/history-record.d.ts +22 -0
- package/dist/types/utils/image-cropper.d.ts +53 -0
- package/dist/types/utils/image-source.d.ts +1 -0
- package/dist/types/utils/load-resource.d.ts +8 -0
- package/dist/types/utils/options.d.ts +7 -0
- package/dist/types/utils/page-dimensions.d.ts +29 -0
- package/dist/types/utils/player.d.ts +4 -0
- package/dist/types/utils/position.d.ts +5 -0
- package/dist/types/utils/selection.d.ts +3 -0
- package/dist/types/utils/short-id.d.ts +10 -0
- package/dist/types/utils/shortcut.d.ts +1 -0
- package/dist/types/utils/storage-migration.d.ts +5 -0
- package/dist/types/utils/svg-normalizer.d.ts +25 -0
- package/dist/types/utils/time-ago.d.ts +1 -0
- package/dist/types/utils/upload.d.ts +20 -0
- package/docs/FORMATTING_TEMPLATES.md +250 -0
- package/docs/README.md +40 -0
- package/docs/SECONDARY_DEVELOPMENT.md +795 -0
- package/docs/api.md +155 -0
- package/docs/architecture.md +133 -0
- package/docs/configuration.md +233 -0
- package/docs/custom-components.md +277 -0
- package/docs/development.md +85 -0
- package/docs/faq.md +98 -0
- package/docs/features.md +181 -0
- package/docs/menu-extension.md +276 -0
- package/package.json +84 -72
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class SvgBoundsNormalizer {
|
|
2
|
+
parseNumber(value: any): number;
|
|
3
|
+
getFallbackSize(svg: any): {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
createSvgElement(input: any): {
|
|
8
|
+
source: SVGElement;
|
|
9
|
+
working: Node;
|
|
10
|
+
};
|
|
11
|
+
applyLayout(target: any, { width, height, viewBox }: {
|
|
12
|
+
width: any;
|
|
13
|
+
height: any;
|
|
14
|
+
viewBox: any;
|
|
15
|
+
}): void;
|
|
16
|
+
normalize(input: any, options?: {
|
|
17
|
+
padding?: number;
|
|
18
|
+
mutate?: boolean;
|
|
19
|
+
}): {
|
|
20
|
+
svg: string;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const svgBoundsNormalizer: SvgBoundsNormalizer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const timeAgo: (date: any) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const getImageAccept: (options?: {
|
|
2
|
+
file?: {
|
|
3
|
+
allowedMimeTypes?: string[];
|
|
4
|
+
};
|
|
5
|
+
}) => string;
|
|
6
|
+
export declare const getImageMaxSize: (options?: {
|
|
7
|
+
file?: {
|
|
8
|
+
maxSize?: number;
|
|
9
|
+
};
|
|
10
|
+
}) => number;
|
|
11
|
+
export declare const validateImageFileSize: (file: any, maxSize?: number) => boolean;
|
|
12
|
+
export declare const buildImageUploadValue: (file: any, response: any, extra?: {}) => {
|
|
13
|
+
id: unknown;
|
|
14
|
+
url: any;
|
|
15
|
+
name: any;
|
|
16
|
+
type: any;
|
|
17
|
+
size: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const createImageFileFromDataUrl: (dataUrl: any, fileName?: string) => Promise<File>;
|
|
20
|
+
export declare const createImageFileFromSvg: (svg: any, fileName?: string, mimeType?: string) => File;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# 一键排版模板 JSON 与扩展指南
|
|
2
|
+
|
|
3
|
+
一键排版从外部传入模板数组,用户在“工具 → 一键排版”选择模板后,将模板中**明确声明**的规则应用到全文。仓库的 [示例模板](../dev/formatting-templates.json) 包含“标准中文文档”和“公文排版”;它们只在开发示例中导入,不会自动成为库使用方的模板。类型与校验实现见 [`document-formatting.ts`](../src/utils/document-formatting.ts)。
|
|
4
|
+
|
|
5
|
+
## 1. 最小模板与接入
|
|
6
|
+
|
|
7
|
+
模板文件的根节点是数组。每个模板必须包含 `id`、`name`、`description`、`rules` 四个字段;没有说明文字时,`description` 也要写为 `""`。
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
"id": "my-document",
|
|
13
|
+
"name": "我的版式",
|
|
14
|
+
"description": "设置正文和一级标题",
|
|
15
|
+
"rules": {
|
|
16
|
+
"paragraph": {
|
|
17
|
+
"fontFamily": "SimSun, serif",
|
|
18
|
+
"fontSize": "16px",
|
|
19
|
+
"lineHeight": 1.75,
|
|
20
|
+
"textIndent": "2em"
|
|
21
|
+
},
|
|
22
|
+
"heading": {
|
|
23
|
+
"1": { "fontSize": "28px", "textAlign": "center" }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
在 Vue 组件中通过 `formatting` 参数传入。`FormattingOptions`、`FormattingTemplate`、`FormattingStyle` 等类型从包入口导出。
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { AgileEditor, type FormattingOptions } from '@agilehub/agile-editor'
|
|
35
|
+
import templates from './formatting-templates.json'
|
|
36
|
+
|
|
37
|
+
const formatting: FormattingOptions = {
|
|
38
|
+
enabled: true,
|
|
39
|
+
defaultTemplateId: 'my-document',
|
|
40
|
+
templates,
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<AgileEditor :formatting="formatting" />
|
|
46
|
+
</template>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
也可在 `app.use(useAgileEditor, { formatting })` 中提供全局配置。组件上的同名配置优先;`templates` 数组整体替换,不与全局数组拼接。接口异步返回模板时,更新响应式 `formatting` 参数即可;仅更新模板不会自动修改文档。
|
|
50
|
+
|
|
51
|
+
### `FormattingOptions` 字段
|
|
52
|
+
|
|
53
|
+
| 字段 | TypeScript 类型 | 说明 |
|
|
54
|
+
| ------------------- | --------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
55
|
+
| `enabled` | `boolean`,可选 | 为 `false` 时隐藏一键排版入口;省略时显示。 |
|
|
56
|
+
| `defaultTemplateId` | `string`,可选 | 首次打开弹窗时优先选中的模板 `id`;找不到时选第一项。 |
|
|
57
|
+
| `templates` | `FormattingTemplate[]`,可选 | 可选模板数组;省略或为空时显示空状态。 |
|
|
58
|
+
| `adapters` | `Record<string, FormattingNodeAdapter>`,可选 | 自定义节点的 TypeScript 函数映射,键为 Tiptap 节点名;**函数不能写进 JSON**。 |
|
|
59
|
+
|
|
60
|
+
### `FormattingTemplate` 字段
|
|
61
|
+
|
|
62
|
+
| 字段 | TypeScript 类型 | 说明 |
|
|
63
|
+
| ------------- | --------------- | ------------------------------------------------------------- |
|
|
64
|
+
| `id` | `string`,必填 | 非空且在同一 `templates` 数组中唯一,用于默认选择和识别模板。 |
|
|
65
|
+
| `name` | `string`,必填 | 非空,显示在模板列表。 |
|
|
66
|
+
| `description` | `string`,必填 | 显示在模板列表,可为 `""`。 |
|
|
67
|
+
| `rules` | `object`,必填 | 规则对象,可为 `{}`;只识别下文列出的分类。 |
|
|
68
|
+
|
|
69
|
+
## 2. `rules` 支持的元素
|
|
70
|
+
|
|
71
|
+
所有 `rules` 子项都是可选的。**没有配置某个元素,就不格式化该元素;某个样式属性未配置,就不主动改写该属性。** 规则只修改版式,不修改文档文字、链接、图片/音视频资源或表格内容。
|
|
72
|
+
|
|
73
|
+
| JSON 路径 | 值类型 | 作用范围与说明 |
|
|
74
|
+
| ----------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `rules.paragraph` | `FormattingStyle` | 文档顶层的普通正文段落;空白的顶层光标占位段落保持原样。不会自动传播到列表、引用、表格或自定义容器内的段落。 |
|
|
76
|
+
| `rules.heading` | 对象,键为 `"1"`~`"6"` | 已有的 H1~H6 标题节点分别使用对应的 `FormattingStyle`。模板不会把普通段落转为标题,也不会生成标题编号。 |
|
|
77
|
+
| `rules.table` | `FormattingTableRule` | 表格本身的通用样式及表格专用字段,见第 4 节。 |
|
|
78
|
+
| `rules.image` | `FormattingImageRule` | 图片节点及行内图片的容器样式;`caption` 子规则设置图注,见第 5 节。 |
|
|
79
|
+
| `rules.audio` | `FormattingStyle` | 音频播放器外层样式,不修改音频地址和字幕。 |
|
|
80
|
+
| `rules.video` | `FormattingStyle` | 视频播放器外层样式,不修改视频地址和封面。 |
|
|
81
|
+
| `rules.contexts` | `Record<string, FormattingStyle>` | 按段落所在的祖先节点类型设置段落样式,如 `listItem`、`blockquote`、`callout`。最近的显式上下文规则优先;未配置的容器不继承顶层 `paragraph` 规则。 |
|
|
82
|
+
| `rules.nodes` | `Record<string, FormattingNodeRule>` | 按实际 Tiptap 节点名指定样式,支持自定义节点;还可通过 `custom` 向适配器传递业务数据,见第 6 节。 |
|
|
83
|
+
|
|
84
|
+
同一节点同时命中分类规则和 `nodes.<节点名>` 时,`nodes` 的同名样式属性优先。`nodes` 的键是编辑器 schema 中的节点名,例如 `bulletList`、`codeBlock`;不是 HTML 标签名。未注册的节点或无法应用该规则的节点会被跳过并提示。对于通用 CSS 样式,节点需要支持 `inlineStyle` 属性;自定义业务属性需要适配器。
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"id": "selected-elements",
|
|
89
|
+
"name": "只调整指定元素",
|
|
90
|
+
"description": "保留表格和媒体的原有样式",
|
|
91
|
+
"rules": {
|
|
92
|
+
"paragraph": { "fontSize": "16px" },
|
|
93
|
+
"heading": { "2": { "fontWeight": "bold" } },
|
|
94
|
+
"contexts": { "blockquote": { "lineHeight": 1.5 } },
|
|
95
|
+
"nodes": { "bulletList": { "marginTop": "8px" } }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
上例没有声明 H1、表格、图片或音视频规则,所以它们保持原样。
|
|
101
|
+
|
|
102
|
+
## 3. 通用样式 `FormattingStyle`
|
|
103
|
+
|
|
104
|
+
每个属性都是可选的,类型为 `string | number | null`。字符串或数字必须是该 CSS 属性可接受的值,例如 `"16px"`、`"2em"`、`1.75`;`null` 表示清除该属性已有的显式设置,回到继承样式或编辑器默认值。`null` **不是**“保持原样”;需要保持原样时请省略该属性。数值的单位应明确写在字符串中,除非该 CSS 属性接受无单位数字。
|
|
105
|
+
|
|
106
|
+
| 属性 | 含义 | 示例 |
|
|
107
|
+
| ----------------- | ------------------ | -------------------------------------------- |
|
|
108
|
+
| `fontFamily` | 字体族及回退字体 | `"FangSong, serif"` |
|
|
109
|
+
| `fontSize` | 字号 | `"16px"`、`"16pt"` |
|
|
110
|
+
| `fontWeight` | 字重 | `"normal"`、`"bold"`、`600` |
|
|
111
|
+
| `fontStyle` | 字体样式 | `"normal"`、`"italic"` |
|
|
112
|
+
| `color` | 文字颜色 | `"#222222"` |
|
|
113
|
+
| `backgroundColor` | 背景颜色 | `"#fff4cc"` |
|
|
114
|
+
| `letterSpacing` | 字间距 | `"0.5px"` |
|
|
115
|
+
| `lineHeight` | 行高 | `1.75`、`"28pt"` |
|
|
116
|
+
| `textAlign` | 文本水平对齐 | `"left"`、`"center"`、`"right"`、`"justify"` |
|
|
117
|
+
| `textIndent` | 首行缩进 | `"2em"`、`"0"` |
|
|
118
|
+
| `textDecoration` | 文本装饰 | `"underline"`、`"none"` |
|
|
119
|
+
| `marginTop` | 上外边距或段前间距 | `"12px"` |
|
|
120
|
+
| `marginBottom` | 下外边距或段后间距 | `"8px"` |
|
|
121
|
+
| `paddingTop` | 上内边距 | `"8px"` |
|
|
122
|
+
| `paddingRight` | 右内边距 | `"12px"` |
|
|
123
|
+
| `paddingBottom` | 下内边距 | `"8px"` |
|
|
124
|
+
| `paddingLeft` | 左内边距 | `"12px"` |
|
|
125
|
+
| `border` | 边框简写 | `"1px solid #cccccc"` |
|
|
126
|
+
| `borderColor` | 边框颜色 | `"#4472c4"` |
|
|
127
|
+
| `borderWidth` | 边框宽度 | `"1px"` |
|
|
128
|
+
| `borderStyle` | 边框线型 | `"solid"`、`"dashed"` |
|
|
129
|
+
| `borderRadius` | 圆角半径 | `"4px"` |
|
|
130
|
+
| `width` | 容器宽度 | `"400px"`、`"100%"` |
|
|
131
|
+
| `maxWidth` | 容器最大宽度 | `"100%"` |
|
|
132
|
+
| `minHeight` | 容器最小高度 | `"200px"` |
|
|
133
|
+
| `verticalAlign` | 垂直对齐 | `"middle"` |
|
|
134
|
+
|
|
135
|
+
这些字段是 CSS 版式规则,不等同于图片、视频或表格内部的固有尺寸。若声明的属性与已有文字格式冲突,明确声明的规则优先;未声明的版式字段不作为模板目标。字段名区分大小写,不能写 CSS 的连字符形式,例如应写 `fontSize`,不能写 `font-size`。
|
|
136
|
+
|
|
137
|
+
## 4. 表格专用字段 `FormattingTableRule`
|
|
138
|
+
|
|
139
|
+
`rules.table` 除通用样式外还接受以下字段:
|
|
140
|
+
|
|
141
|
+
| 字段 | 类型 | 说明 |
|
|
142
|
+
| ------------ | ----------------------- | --------------------------------------------------------------- |
|
|
143
|
+
| `preset` | 枚举字符串,可选 | 将选中的已有表格设置为指定预设样式;完整取值见下表。 |
|
|
144
|
+
| `themeColor` | `string`,可选 | 六位十六进制颜色,如 `"#4472c4"`,用于表格预设主题。 |
|
|
145
|
+
| `shading` | `string[]`,可选 | 底纹填充位置数组;`[]` 表示取消预设底纹,省略表示不改原有底纹。 |
|
|
146
|
+
| `cellText` | `FormattingStyle`,可选 | 表格单元格和表头单元格内的段落。 |
|
|
147
|
+
| `caption` | `FormattingStyle`,可选 | 表格原生 `<caption>` 标题节点中的文字。 |
|
|
148
|
+
|
|
149
|
+
`preset` 取值:
|
|
150
|
+
|
|
151
|
+
| 值 | 样式 | 值 | 样式 |
|
|
152
|
+
| ------------- | ------ | ------------- | -------- |
|
|
153
|
+
| `plain` | 无边框 | `horizontal` | 横线表 |
|
|
154
|
+
| `header-line` | 表头线 | `double-line` | 双线表 |
|
|
155
|
+
| `vertical` | 竖线表 | `grid` | 网格表 |
|
|
156
|
+
| `outline` | 外框表 | `header-grid` | 表头网格 |
|
|
157
|
+
| `banded` | 条纹表 | `bold-grid` | 加粗网格 |
|
|
158
|
+
| `columns` | 列条纹 | `three-line` | 三线表 |
|
|
159
|
+
|
|
160
|
+
`shading` 可包含 `first-row`(首行)、`first-column`(首列)、`alternate-row`(隔行)、`alternate-column`(隔列)、`last-row`(末行)、`last-column`(末列)。需要指定底纹颜色时同时设置 `themeColor`。明确设置 `preset` 会清除与预设冲突的旧边框和单元格底色覆盖;合并关系、行高、列宽及标题内容保留。
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"table": {
|
|
165
|
+
"preset": "three-line",
|
|
166
|
+
"themeColor": "#4472c4",
|
|
167
|
+
"shading": ["first-row", "alternate-row"],
|
|
168
|
+
"cellText": { "fontSize": "14px", "textIndent": "0" },
|
|
169
|
+
"caption": { "textAlign": "center", "fontWeight": "bold" }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
以上片段应放在模板的 `rules` 对象内。
|
|
175
|
+
|
|
176
|
+
## 5. 图片与媒体
|
|
177
|
+
|
|
178
|
+
`rules.image` 接受通用样式以及可选的 `caption: FormattingStyle`。`caption` 设置图片图注样式;图片地址、裁剪、旋转和原有媒体数据不因排版而替换。`rules.audio`、`rules.video` 只接受通用样式,用于播放器外层容器,例如 `maxWidth` 与上下间距,不修改音频字幕、视频封面或播放源。
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"image": {
|
|
183
|
+
"maxWidth": "100%",
|
|
184
|
+
"caption": { "fontSize": "14px", "textAlign": "center" }
|
|
185
|
+
},
|
|
186
|
+
"audio": { "maxWidth": "100%", "marginTop": "12px" },
|
|
187
|
+
"video": { "maxWidth": "100%", "marginBottom": "12px" }
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 6. 扩展自定义元素
|
|
192
|
+
|
|
193
|
+
模板 JSON 只保存数据;自定义 Tiptap 节点必须先注册到编辑器。扩展通常有两种方式:
|
|
194
|
+
|
|
195
|
+
1. 节点已有 `inlineStyle` 属性并能在 `renderHTML`、`parseHTML` 和 NodeView 中正确处理时,可直接使用 `rules.nodes.<节点名>` 的通用样式字段。
|
|
196
|
+
2. 需要修改业务属性时,在 `rules.nodes.<节点名>.custom` 放 JSON 数据,再通过 `formatting.adapters` 注册适配器。`custom` 的值必须是 JSON 对象,内部可包含字符串、有限数字、布尔值、`null`、数组或嵌套对象;具体业务字段含义由适配器检查。
|
|
197
|
+
|
|
198
|
+
下面假设业务侧已经注册名为 `businessCard` 的 Tiptap 节点,节点 schema 声明了 `accentColor` 属性,并能保存与重新解析该属性。
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
[
|
|
202
|
+
{
|
|
203
|
+
"id": "business-card",
|
|
204
|
+
"name": "业务卡片版式",
|
|
205
|
+
"description": "调整业务卡片强调色",
|
|
206
|
+
"rules": {
|
|
207
|
+
"nodes": {
|
|
208
|
+
"businessCard": {
|
|
209
|
+
"custom": { "accentColor": "#4472c4" }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
import type {
|
|
219
|
+
FormattingNodeAdapter,
|
|
220
|
+
FormattingOptions,
|
|
221
|
+
} from '@agilehub/agile-editor'
|
|
222
|
+
import templates from './formatting-templates.json'
|
|
223
|
+
|
|
224
|
+
const businessCardAdapter: FormattingNodeAdapter = ({ rule }) => {
|
|
225
|
+
const color = rule.custom?.accentColor
|
|
226
|
+
if (typeof color !== 'string' || !/^#[\da-f]{6}$/i.test(color)) {
|
|
227
|
+
throw new Error('businessCard.accentColor 必须是六位十六进制颜色')
|
|
228
|
+
}
|
|
229
|
+
return { attrs: { accentColor: color } }
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const formatting: FormattingOptions = {
|
|
233
|
+
templates,
|
|
234
|
+
adapters: { businessCard: businessCardAdapter },
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`attrs` 只能包含节点 schema 已声明的属性;适配器还可返回 `textStyle: FormattingStyle`,设置该节点**直属文字子节点**的行内样式。适配器应为同步且无副作用的函数,不直接修改节点、DOM 或发起编辑器事务。组件参数中的适配器优先于节点 `addStorage()` 提供的同名 `formatting` 适配器。只有文档中实际存在该节点且模板声明了对应 `nodes` 规则时,适配器才会被调用;因此 `custom` 的业务语义检查不能代替导入数据时的业务校验。完整节点开发步骤见[二次开发指南](./SECONDARY_DEVELOPMENT.md)。
|
|
239
|
+
|
|
240
|
+
## 7. 校验、应用与排查
|
|
241
|
+
|
|
242
|
+
点击“一键排版”时校验整份 `formatting` 配置及所有模板;应用前再次校验。错误会在弹窗内显示具体字段路径,且禁用应用按钮。例如把 `fontSize` 误写为 `fontSze` 时会看到:
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
模板数据不正确: formatting.templates[0].rules.paragraph.fontSze: unknown style field
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
校验覆盖必填字段缺失、重复 `id`、未知字段、错误类型、无效 CSS 值、非法表格预设与底纹值,以及 `custom` 内不合法的 JSON 值。字符串样式禁止分号、花括号、尖括号、`url(...)`、`expression(...)` 和 `!important`;在浏览器中还会用 `CSS.supports` 验证 CSS 属性值。自定义节点业务字段由适配器进一步校验。校验或适配器执行失败时,不会对文档提交部分修改。
|
|
249
|
+
|
|
250
|
+
排版是一次可撤销的编辑操作;再次应用相同模板且文档已符合规则时,不增加无效撤销记录。编辑器在分析大文档时会分批让出主线程;分析期间若文档变化、进入只读或关闭弹窗,将取消本次操作。页面尺寸、页边距、水印、精确分页、标题序号和公文版心不属于模板规则,需要分别处理。开发回归页为 `/editor-demo/checks/document-formatting.html`。
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Agile Editor 文档
|
|
2
|
+
|
|
3
|
+
README 只保留基础接入信息,本目录按使用场景组织详细文档。
|
|
4
|
+
|
|
5
|
+
## 推荐阅读顺序
|
|
6
|
+
|
|
7
|
+
1. [完整配置](./configuration.md):了解组件的全部常用配置、保存和文件上传。
|
|
8
|
+
2. [组件方法与事件](./api.md):通过组件 `ref` 操作文档和监听状态。
|
|
9
|
+
3. [功能说明](./features.md):了解 DOCX 导入、公式、播放器、图表和时间轴。
|
|
10
|
+
4. [菜单扩展](./menu-extension.md):在工具栏中添加自己的按钮。
|
|
11
|
+
5. [外部组件接入](./custom-components.md):把业务弹窗、面板和 Vue 组件接入编辑器。
|
|
12
|
+
|
|
13
|
+
准备开发新的文档节点或发布插件时,再阅读 [二次开发指南](./SECONDARY_DEVELOPMENT.md)。
|
|
14
|
+
|
|
15
|
+
## 文档索引
|
|
16
|
+
|
|
17
|
+
| 文档 | 适用场景 |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| [完整配置](./configuration.md) | 配置优先级、页面布局、保存、上传、删除 |
|
|
20
|
+
| [组件方法与事件](./api.md) | 方法签名、参数、事件和 Tiptap 实例 |
|
|
21
|
+
| [功能说明](./features.md) | DOCX、公式、播放器、图表、时间轴和排版 |
|
|
22
|
+
| [菜单扩展](./menu-extension.md) | 业务项目插槽按钮、源码菜单和一级菜单 |
|
|
23
|
+
| [外部组件接入](./custom-components.md) | 业务按钮、弹窗、面板、NodeView 和样式 |
|
|
24
|
+
| [二次开发指南](./SECONDARY_DEVELOPMENT.md) | 自定义 Tiptap 扩展和完整开发流程 |
|
|
25
|
+
| [本地开发](./development.md) | 环境、命令、构建和发布 |
|
|
26
|
+
| [架构与数据流](./architecture.md) | 目录结构、依赖注入、状态和缓存 |
|
|
27
|
+
| [一键排版模板](./FORMATTING_TEMPLATES.md) | 模板 JSON、样式规则和节点适配 |
|
|
28
|
+
| [常见问题](./faq.md) | 配置、保存、上传、菜单和样式排查 |
|
|
29
|
+
|
|
30
|
+
## 选择扩展方式
|
|
31
|
+
|
|
32
|
+
| 目标 | 推荐方式 | 是否需要修改本仓库 |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| 添加业务按钮 | `toolbar_*` 插槽 + 自己的 Vue 组件 | 否 |
|
|
35
|
+
| 打开业务弹窗或表单 | Vue 组件 + `created` 获取 Editor | 否 |
|
|
36
|
+
| 新增文档节点 | Tiptap Extension + NodeView | 业务扩展不需要;内置功能需要 |
|
|
37
|
+
| 修改内置菜单 | 修改 `classic.vue` 和 `ribbon.vue` | 是 |
|
|
38
|
+
| 新增一级工具栏菜单 | 修改配置、布局、语言和插槽 | 是 |
|
|
39
|
+
|
|
40
|
+
工具栏按钮负责界面和触发操作,Tiptap 扩展负责文档结构、命令和保存格式。注册扩展不会自动生成按钮,添加按钮也不会自动注册节点。
|