@agilehub/agile-editor 1.3.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 -44917
- 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,59 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
fonts: ({
|
|
3
|
+
label: {
|
|
4
|
+
en_US: string;
|
|
5
|
+
zh_CN: string;
|
|
6
|
+
};
|
|
7
|
+
value: string;
|
|
8
|
+
} | {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
})[];
|
|
12
|
+
colors: string[];
|
|
13
|
+
lineHeights: ({
|
|
14
|
+
label: {
|
|
15
|
+
en_US: string;
|
|
16
|
+
zh_CN: string;
|
|
17
|
+
};
|
|
18
|
+
value: number;
|
|
19
|
+
default?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
label: {
|
|
22
|
+
en_US: string;
|
|
23
|
+
zh_CN: string;
|
|
24
|
+
};
|
|
25
|
+
value: number;
|
|
26
|
+
default: boolean;
|
|
27
|
+
})[];
|
|
28
|
+
symbols: {
|
|
29
|
+
label: {
|
|
30
|
+
en_US: string;
|
|
31
|
+
zh_CN: string;
|
|
32
|
+
};
|
|
33
|
+
items: string;
|
|
34
|
+
}[];
|
|
35
|
+
emojis: {
|
|
36
|
+
label: {
|
|
37
|
+
en_US: string;
|
|
38
|
+
zh_CN: string;
|
|
39
|
+
};
|
|
40
|
+
items: string;
|
|
41
|
+
}[];
|
|
42
|
+
pageSizes: ({
|
|
43
|
+
label: string;
|
|
44
|
+
width: number;
|
|
45
|
+
default: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
label: string;
|
|
48
|
+
width: number;
|
|
49
|
+
default?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
label: {
|
|
52
|
+
zh_CN: string;
|
|
53
|
+
en_US: string;
|
|
54
|
+
};
|
|
55
|
+
width: number;
|
|
56
|
+
default?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
};
|
|
59
|
+
export default _default;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { FormattingOptions } from '../../utils/document-formatting';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
editorKey: string;
|
|
4
|
+
locale: string;
|
|
5
|
+
theme: string;
|
|
6
|
+
skin: string;
|
|
7
|
+
height: string;
|
|
8
|
+
fullscreenZIndex: number;
|
|
9
|
+
dicts: {
|
|
10
|
+
fonts: ({
|
|
11
|
+
label: {
|
|
12
|
+
en_US: string;
|
|
13
|
+
zh_CN: string;
|
|
14
|
+
};
|
|
15
|
+
value: string;
|
|
16
|
+
} | {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
})[];
|
|
20
|
+
colors: string[];
|
|
21
|
+
lineHeights: ({
|
|
22
|
+
label: {
|
|
23
|
+
en_US: string;
|
|
24
|
+
zh_CN: string;
|
|
25
|
+
};
|
|
26
|
+
value: number;
|
|
27
|
+
default?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
label: {
|
|
30
|
+
en_US: string;
|
|
31
|
+
zh_CN: string;
|
|
32
|
+
};
|
|
33
|
+
value: number;
|
|
34
|
+
default: boolean;
|
|
35
|
+
})[];
|
|
36
|
+
symbols: {
|
|
37
|
+
label: {
|
|
38
|
+
en_US: string;
|
|
39
|
+
zh_CN: string;
|
|
40
|
+
};
|
|
41
|
+
items: string;
|
|
42
|
+
}[];
|
|
43
|
+
emojis: {
|
|
44
|
+
label: {
|
|
45
|
+
en_US: string;
|
|
46
|
+
zh_CN: string;
|
|
47
|
+
};
|
|
48
|
+
items: string;
|
|
49
|
+
}[];
|
|
50
|
+
pageSizes: ({
|
|
51
|
+
label: string;
|
|
52
|
+
width: number;
|
|
53
|
+
default: boolean;
|
|
54
|
+
} | {
|
|
55
|
+
label: string;
|
|
56
|
+
width: number;
|
|
57
|
+
default?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
label: {
|
|
60
|
+
zh_CN: string;
|
|
61
|
+
en_US: string;
|
|
62
|
+
};
|
|
63
|
+
width: number;
|
|
64
|
+
default?: undefined;
|
|
65
|
+
})[];
|
|
66
|
+
};
|
|
67
|
+
toolbar: {
|
|
68
|
+
showSaveLabel: boolean;
|
|
69
|
+
defaultMode: string;
|
|
70
|
+
menus: string[];
|
|
71
|
+
};
|
|
72
|
+
page: {
|
|
73
|
+
layouts: string[];
|
|
74
|
+
maxWidth: number;
|
|
75
|
+
defaultMargin: {
|
|
76
|
+
left: number;
|
|
77
|
+
right: number;
|
|
78
|
+
top: number;
|
|
79
|
+
bottom: number;
|
|
80
|
+
};
|
|
81
|
+
defaultOrientation: string;
|
|
82
|
+
defaultBackground: string;
|
|
83
|
+
showBreakMarks: boolean;
|
|
84
|
+
showLineNumber: boolean;
|
|
85
|
+
showBookmark: boolean;
|
|
86
|
+
showToc: boolean;
|
|
87
|
+
showAI: boolean;
|
|
88
|
+
watermark: {
|
|
89
|
+
type: string;
|
|
90
|
+
alpha: number;
|
|
91
|
+
fontColor: string;
|
|
92
|
+
fontSize: number;
|
|
93
|
+
fontFamily: string;
|
|
94
|
+
fontWeight: string;
|
|
95
|
+
text: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
document: {
|
|
99
|
+
title: string;
|
|
100
|
+
content: string;
|
|
101
|
+
placeholder: {
|
|
102
|
+
en_US: string;
|
|
103
|
+
zh_CN: string;
|
|
104
|
+
};
|
|
105
|
+
structure: string;
|
|
106
|
+
enableSpellcheck: boolean;
|
|
107
|
+
enableMarkdown: boolean;
|
|
108
|
+
enableBubbleMenu: boolean;
|
|
109
|
+
enableBlockMenu: boolean;
|
|
110
|
+
enableNodeId: boolean;
|
|
111
|
+
readOnly: boolean;
|
|
112
|
+
autofocus: boolean;
|
|
113
|
+
characterLimit: number;
|
|
114
|
+
typographyRules: {};
|
|
115
|
+
editorProps: {};
|
|
116
|
+
parseOptions: {
|
|
117
|
+
preserveWhitespace: string;
|
|
118
|
+
};
|
|
119
|
+
autoSave: {
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
interval: number;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
echarts: {
|
|
125
|
+
mode: number;
|
|
126
|
+
renderImage: boolean;
|
|
127
|
+
onCustomSettings(): any;
|
|
128
|
+
};
|
|
129
|
+
webPages: ({
|
|
130
|
+
label: {
|
|
131
|
+
zh_CN: string;
|
|
132
|
+
en_US: string;
|
|
133
|
+
};
|
|
134
|
+
icon: string;
|
|
135
|
+
validate(url: any): boolean;
|
|
136
|
+
transformURL(url: any): any;
|
|
137
|
+
} | {
|
|
138
|
+
label: {
|
|
139
|
+
zh_CN: string;
|
|
140
|
+
en_US: string;
|
|
141
|
+
};
|
|
142
|
+
icon: string;
|
|
143
|
+
validate(url: any): any;
|
|
144
|
+
transformURL(url: any): string;
|
|
145
|
+
})[];
|
|
146
|
+
templates: any[];
|
|
147
|
+
formatting: FormattingOptions;
|
|
148
|
+
plantUml: {
|
|
149
|
+
serverURL: string;
|
|
150
|
+
};
|
|
151
|
+
shareUrl: string;
|
|
152
|
+
diagrams: {
|
|
153
|
+
domain: string;
|
|
154
|
+
params: {};
|
|
155
|
+
};
|
|
156
|
+
file: {
|
|
157
|
+
allowedMimeTypes: any[];
|
|
158
|
+
maxSize: number;
|
|
159
|
+
preview: {
|
|
160
|
+
extensions: string[];
|
|
161
|
+
url: string;
|
|
162
|
+
}[];
|
|
163
|
+
};
|
|
164
|
+
user: {};
|
|
165
|
+
users: any[];
|
|
166
|
+
extensions: any[];
|
|
167
|
+
disableExtensions: any[];
|
|
168
|
+
translations: {
|
|
169
|
+
en_US: {};
|
|
170
|
+
zh_CN: {};
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* 保存回调:接收内容、页面状态和文档状态;业务侧必须自行实现。
|
|
174
|
+
* 调用签名:onSave(content, page, document),content 包含 html、json、text。
|
|
175
|
+
* 注意必须为 async 函数,并返回非空字符串或含 status 的结果对象。
|
|
176
|
+
* @returns 保存结果,支持 status、message 和 showMessage。
|
|
177
|
+
*/
|
|
178
|
+
onSave(): Promise<unknown>;
|
|
179
|
+
/**
|
|
180
|
+
* 文件上传回调:由业务侧上传并返回持久化文件信息。
|
|
181
|
+
* @param file - 浏览器 File 对象;不要把临时 blob URL 当作持久地址。
|
|
182
|
+
* @returns 建议返回含 id、url、name、type、size 的文件信息。
|
|
183
|
+
* 使用方式:在配置中提供 async onFileUpload(file),返回上传后的资源地址。
|
|
184
|
+
*/
|
|
185
|
+
onFileUpload(file: any): Promise<unknown>;
|
|
186
|
+
/**
|
|
187
|
+
* 文件删除通知:业务侧负责决定是否删除服务端文件。
|
|
188
|
+
* 调用签名:onFileDelete(id, url, type),依次为资源 ID、地址和资源类型。
|
|
189
|
+
* 注意节点删除可能触发此回调,不能直接假设文件已无其他引用。
|
|
190
|
+
* @returns 无返回值。
|
|
191
|
+
*/
|
|
192
|
+
onFileDelete(): void;
|
|
193
|
+
};
|
|
194
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将旧版 HTML 中的 umo 类名、DOM 标识和 CSS 变量迁移为 agile 前缀。
|
|
3
|
+
* @param html - 需要兼容处理的 HTML 字符串。
|
|
4
|
+
* @returns 迁移后的 HTML;无旧前缀时原样返回。
|
|
5
|
+
*/
|
|
6
|
+
export declare const migrateLegacyHtml: (html: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 递归迁移 HTML 或 Tiptap JSON 文档中的旧版属性。
|
|
9
|
+
* @param content - 字符串、节点数组或节点对象。
|
|
10
|
+
* @returns 保持原有结构、仅替换旧前缀属性的新内容。
|
|
11
|
+
*/
|
|
12
|
+
export declare const migrateLegacyContent: (content: any) => any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare class DiagramEditor {
|
|
2
|
+
frame: HTMLIFrameElement | undefined;
|
|
3
|
+
container: string;
|
|
4
|
+
domain: string;
|
|
5
|
+
params: Record<string, string | number>;
|
|
6
|
+
xml: string | null;
|
|
7
|
+
format: string;
|
|
8
|
+
data: string | null;
|
|
9
|
+
constructor({ domain, params, container }: {
|
|
10
|
+
domain?: string;
|
|
11
|
+
params?: Record<string, string | number>;
|
|
12
|
+
container: string;
|
|
13
|
+
});
|
|
14
|
+
handleMessageEvent: (evt: any) => void;
|
|
15
|
+
edit(src: any): this;
|
|
16
|
+
createFrame(): HTMLIFrameElement;
|
|
17
|
+
postMessage(msg: any): void;
|
|
18
|
+
handleMessage(msg: any): void;
|
|
19
|
+
startEditing(data: any, format: any): void;
|
|
20
|
+
stopEditing(): void;
|
|
21
|
+
initializeEditor(): void;
|
|
22
|
+
configureEditor(): void;
|
|
23
|
+
exportData(data: any): any;
|
|
24
|
+
}
|
|
25
|
+
export default DiagramEditor;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type Node as PMNode } from '@tiptap/pm/model';
|
|
3
|
+
/** Only these presentation properties can be supplied by a JSON template. */
|
|
4
|
+
export declare const formattingProperties: readonly ["fontFamily", "fontSize", "fontWeight", "fontStyle", "color", "backgroundColor", "letterSpacing", "lineHeight", "textAlign", "textIndent", "textDecoration", "marginTop", "marginBottom", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "border", "borderColor", "borderWidth", "borderStyle", "borderRadius", "width", "maxWidth", "minHeight", "verticalAlign"];
|
|
5
|
+
export type FormattingStyle = Partial<Record<(typeof formattingProperties)[number], string | number | null>>;
|
|
6
|
+
export type FormattingJSONValue = string | number | boolean | null | FormattingJSONValue[] | {
|
|
7
|
+
[key: string]: FormattingJSONValue;
|
|
8
|
+
};
|
|
9
|
+
export interface FormattingNodeRule extends FormattingStyle {
|
|
10
|
+
/** Business-specific JSON, interpreted only by this node's adapter. */
|
|
11
|
+
custom?: Record<string, FormattingJSONValue>;
|
|
12
|
+
}
|
|
13
|
+
export interface FormattingAdapterResult {
|
|
14
|
+
/** Partial existing schema attributes, not replacement content. */
|
|
15
|
+
attrs?: Record<string, unknown>;
|
|
16
|
+
/** Explicit styles for this node's direct text children (if marks are allowed). */
|
|
17
|
+
textStyle?: FormattingStyle;
|
|
18
|
+
}
|
|
19
|
+
export type FormattingNodeAdapter = (context: {
|
|
20
|
+
node: PMNode;
|
|
21
|
+
rule: Readonly<FormattingNodeRule>;
|
|
22
|
+
}) => FormattingAdapterResult;
|
|
23
|
+
export interface FormattingTableRule extends FormattingStyle {
|
|
24
|
+
preset?: string;
|
|
25
|
+
themeColor?: string;
|
|
26
|
+
shading?: string[];
|
|
27
|
+
cellText?: FormattingStyle;
|
|
28
|
+
caption?: FormattingStyle;
|
|
29
|
+
}
|
|
30
|
+
export interface FormattingImageRule extends FormattingStyle {
|
|
31
|
+
caption?: FormattingStyle;
|
|
32
|
+
}
|
|
33
|
+
export interface FormattingTemplate {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
rules: {
|
|
38
|
+
paragraph?: FormattingStyle;
|
|
39
|
+
heading?: Partial<Record<1 | 2 | 3 | 4 | 5 | 6, FormattingStyle>>;
|
|
40
|
+
table?: FormattingTableRule;
|
|
41
|
+
image?: FormattingImageRule;
|
|
42
|
+
audio?: FormattingStyle;
|
|
43
|
+
video?: FormattingStyle;
|
|
44
|
+
/** Presentation of a registered node; unknown/unadapted nodes are reported. */
|
|
45
|
+
nodes?: Record<string, FormattingNodeRule>;
|
|
46
|
+
/** Paragraph styles within these ancestor node types, nearest ancestor wins. */
|
|
47
|
+
contexts?: Record<string, FormattingStyle>;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface FormattingOptions {
|
|
51
|
+
enabled?: boolean;
|
|
52
|
+
defaultTemplateId?: string;
|
|
53
|
+
templates?: FormattingTemplate[];
|
|
54
|
+
/** Component adapters override editor.storage[nodeType].formatting adapters. */
|
|
55
|
+
adapters?: Record<string, FormattingNodeAdapter>;
|
|
56
|
+
}
|
|
57
|
+
export declare class FormattingValidationError extends Error {
|
|
58
|
+
readonly path: string;
|
|
59
|
+
constructor(path: string, reason: string);
|
|
60
|
+
}
|
|
61
|
+
/** Validate before touching the document, including JSON loaded asynchronously. */
|
|
62
|
+
export declare function validateFormattingOptions(value: unknown): asserts value is FormattingOptions;
|
|
63
|
+
export declare class FormattingCancelled extends Error {
|
|
64
|
+
}
|
|
65
|
+
/** Plan against a snapshot, yield periodically, then commit only changed attributes/marks. */
|
|
66
|
+
export declare function applyFormattingTemplate(editor: Editor, template: FormattingTemplate, signal?: AbortSignal, adapters?: Record<string, FormattingNodeAdapter>): Promise<{
|
|
67
|
+
changed: number;
|
|
68
|
+
skipped: string[];
|
|
69
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HtmlJsonDocument } from '@agilehub/docx-converter';
|
|
2
|
+
type TiptapMark = {
|
|
3
|
+
type: string;
|
|
4
|
+
attrs?: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
type TiptapNode = {
|
|
7
|
+
type: string;
|
|
8
|
+
attrs?: Record<string, unknown>;
|
|
9
|
+
content?: TiptapNode[];
|
|
10
|
+
text?: string;
|
|
11
|
+
marks?: TiptapMark[];
|
|
12
|
+
};
|
|
13
|
+
export declare const convertDocxJsonToTiptap: (document: HtmlJsonDocument) => TiptapNode[];
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFileIconUrl: (filename: string) => string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const getFileExtname: (filename: any) => any;
|
|
2
|
+
export declare const getFileIcon: (filename: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* 通过浏览器图片对象读取本地图片原始尺寸。
|
|
5
|
+
* @param file - 待读取的图片文件。
|
|
6
|
+
* @returns 宽高对象;非图片或加载失败时宽高为 0,异常时返回 null。
|
|
7
|
+
*/
|
|
8
|
+
export declare const getImageDimensions: (file: any) => Promise<unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* 从图片地址异步读取原始尺寸,超时或加载失败时返回 null。
|
|
11
|
+
* @param src - 图片地址。
|
|
12
|
+
* @param timeoutMs - 最长等待时间(毫秒)。
|
|
13
|
+
* @returns 宽高对象或 null。
|
|
14
|
+
*/
|
|
15
|
+
export declare const getImageDimensionsFromUrl: (src: any, timeoutMs?: number) => Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* 将相对文件路径补全为资源服务器地址,绝对地址保持不变。
|
|
18
|
+
* @param url - 文件原始路径或地址。
|
|
19
|
+
* @param serverOptions - 资源服务器主机及 HTTPS 设置。
|
|
20
|
+
* @returns 可访问的资源地址;空输入返回空字符串。
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveFileAssetUrl: (url: any, serverOptions?: {
|
|
23
|
+
host?: string;
|
|
24
|
+
ssl?: boolean;
|
|
25
|
+
}) => any;
|
|
26
|
+
export declare const formatImageDimensionText: (width: any, height: any, unknownText?: string) => string;
|
|
27
|
+
export declare const buildCroppedImageFileName: (name: any, fallbackName?: string) => string;
|
|
28
|
+
export declare const dataURLToFile: (dataURL: any, name: any) => {
|
|
29
|
+
file: File;
|
|
30
|
+
filename: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const svgToDataURL: (svg: any) => string;
|
|
33
|
+
export declare const imageNodeTypes: Set<string>;
|
|
34
|
+
export declare const videoNodeTypes: Set<string>;
|
|
35
|
+
export declare const audioNodeTypes: Set<string>;
|
|
36
|
+
export declare const fileNodeTypes: Set<string>;
|
|
37
|
+
export declare const allFileNodeTypes: Set<string>;
|
|
38
|
+
export declare const srcAttrs: string[];
|
|
39
|
+
export declare const urlAttrs: string[];
|
|
40
|
+
export declare const fileSourceAttrs: string[];
|
|
41
|
+
export declare const fileDeleteDelay = 500;
|
|
42
|
+
export declare const fileSearchRange = 80;
|
|
43
|
+
export declare class FileNodeChecker {
|
|
44
|
+
/**
|
|
45
|
+
* 检查已删除的文件节点是否仍存在于当前文档,避免误删远端资源。
|
|
46
|
+
* @param editorState - 当前 ProseMirror 状态。
|
|
47
|
+
* @param fileNode - 待检查文件的 ID、来源地址和原位置。
|
|
48
|
+
* @param nodeTypes - 允许匹配的节点类型集合或数组。
|
|
49
|
+
* @param sourceAttrs - 需要比较的资源地址属性名。
|
|
50
|
+
* @param options - 邻近搜索位置、范围及是否允许全局扫描。
|
|
51
|
+
* @returns true 表示文档中仍存在同一文件节点。
|
|
52
|
+
*/
|
|
53
|
+
static hasSameNodeInDocument(editorState: any, fileNode: any, nodeTypes?: Set<string>, sourceAttrs?: string[], options?: {
|
|
54
|
+
position?: number;
|
|
55
|
+
searchRange?: number;
|
|
56
|
+
allowGlobalScan?: boolean;
|
|
57
|
+
}): boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 延迟通知调用方删除文件,执行前再次确认文档中已无对应节点。
|
|
61
|
+
* @param editor - 编辑器实例的 Ref。
|
|
62
|
+
* @param options - 编辑器配置的 Ref,包含 onFileDelete 回调。
|
|
63
|
+
* @param fileNode - 待删除节点的 ID、类型、地址及原位置。
|
|
64
|
+
* @param nodeTypes - 需要检查的文件节点类型。
|
|
65
|
+
* @param matchSourceAttrs - 查重时使用的地址属性。
|
|
66
|
+
* @param deleteSourceAttrs - 传给删除回调的地址属性。
|
|
67
|
+
* @param delay - 延迟删除时间(毫秒)。
|
|
68
|
+
* @param searchRange - 原位置周围的查重范围。
|
|
69
|
+
* @param deleteTypePrefix - 删除回调使用的资源类型前缀。
|
|
70
|
+
* @returns 无返回值;只读或节点仍存在时不触发删除。
|
|
71
|
+
*/
|
|
72
|
+
export declare const scheduleFileDelete: ({ editor, options, fileNode, nodeTypes, matchSourceAttrs, deleteSourceAttrs, delay, searchRange, deleteTypePrefix, }: {
|
|
73
|
+
editor: any;
|
|
74
|
+
options: any;
|
|
75
|
+
fileNode: any;
|
|
76
|
+
nodeTypes?: Set<string>;
|
|
77
|
+
matchSourceAttrs?: string[];
|
|
78
|
+
deleteSourceAttrs?: any;
|
|
79
|
+
delay?: number;
|
|
80
|
+
searchRange?: number;
|
|
81
|
+
deleteTypePrefix?: string;
|
|
82
|
+
}) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将编辑事务或页面配置变更加入统一的撤销栈。
|
|
3
|
+
* @param records - 保存 done、undone 和执行状态的响应式记录。
|
|
4
|
+
* @param stepType - 变更类型,editor 表示正文,其余为页面配置。
|
|
5
|
+
* @param data - 编辑器历史状态或页面配置的新旧值。
|
|
6
|
+
* @returns 无返回值;无有效变更时不写入记录。
|
|
7
|
+
*/
|
|
8
|
+
export declare const addHistory: (records: any, stepType: any, data: any) => void;
|
|
9
|
+
/**
|
|
10
|
+
* 取出最近一条记录并调用外部处理函数执行撤销。
|
|
11
|
+
* @param records - 响应式撤销/重做记录。
|
|
12
|
+
* @param method - 根据记录类型执行实际撤销的回调。
|
|
13
|
+
* @returns 无返回值;没有可撤销记录时直接退出。
|
|
14
|
+
*/
|
|
15
|
+
export declare const undoHistoryRecord: (records: any, method: any) => void;
|
|
16
|
+
/**
|
|
17
|
+
* 重放最近一次撤销的记录并恢复到已完成栈。
|
|
18
|
+
* @param records - 响应式撤销/重做记录。
|
|
19
|
+
* @param method - 根据记录类型执行实际重做的回调。
|
|
20
|
+
* @returns 无返回值;没有可重做记录时直接退出。
|
|
21
|
+
*/
|
|
22
|
+
export declare const redoHistoryRecord: (records: any, method: any) => void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Cropper from 'cropperjs';
|
|
2
|
+
export declare const DEFAULT_IMAGE_CROPPER_TEMPLATE = "\n <cropper-canvas>\n <cropper-image></cropper-image>\n <cropper-shade hidden></cropper-shade>\n <cropper-handle action=\"select\" plain></cropper-handle>\n <cropper-selection initial-coverage=\"1\" movable resizable outlined>\n <cropper-handle action=\"move\" theme-color=\"rgba(255, 255, 255, 0.35)\"></cropper-handle>\n <cropper-handle action=\"n-resize\"></cropper-handle>\n <cropper-handle action=\"e-resize\"></cropper-handle>\n <cropper-handle action=\"s-resize\"></cropper-handle>\n <cropper-handle action=\"w-resize\"></cropper-handle>\n <cropper-handle action=\"ne-resize\"></cropper-handle>\n <cropper-handle action=\"nw-resize\"></cropper-handle>\n <cropper-handle action=\"se-resize\"></cropper-handle>\n <cropper-handle action=\"sw-resize\"></cropper-handle>\n </cropper-selection>\n </cropper-canvas>\n";
|
|
3
|
+
export declare class ImageCropper {
|
|
4
|
+
template: string;
|
|
5
|
+
cropper: Cropper | null;
|
|
6
|
+
image: HTMLImageElement | null;
|
|
7
|
+
container: HTMLElement | null;
|
|
8
|
+
selection: any;
|
|
9
|
+
selectionChangeHandler: any;
|
|
10
|
+
constrainingSelection: boolean;
|
|
11
|
+
constructor(template?: string);
|
|
12
|
+
start({ image, container, template }?: {
|
|
13
|
+
image?: HTMLImageElement;
|
|
14
|
+
container?: HTMLElement;
|
|
15
|
+
template?: string;
|
|
16
|
+
}): Cropper;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
getSelection(): import("cropperjs").CropperSelection;
|
|
19
|
+
getSelectionSnapshot(selection?: import("cropperjs").CropperSelection): {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
getSelectionBounds(selection?: import("cropperjs").CropperSelection): {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
};
|
|
29
|
+
constrainSelectionSnapshot(snapshot: any, selection?: import("cropperjs").CropperSelection): {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
};
|
|
35
|
+
bindSelectionBounds(selection?: import("cropperjs").CropperSelection): void;
|
|
36
|
+
ready(initialSelection?: any): Promise<import("cropperjs").CropperSelection>;
|
|
37
|
+
isSelectionChanged(initialSelection: any, selection?: import("cropperjs").CropperSelection, threshold?: number): boolean;
|
|
38
|
+
getExportSize(selection?: import("cropperjs").CropperSelection, { fallbackWidth, fallbackHeight, fallbackImage }?: {
|
|
39
|
+
fallbackWidth?: number;
|
|
40
|
+
fallbackHeight?: number;
|
|
41
|
+
fallbackImage?: HTMLImageElement | null;
|
|
42
|
+
}): {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
exportSelection(selection?: import("cropperjs").CropperSelection, options?: {
|
|
47
|
+
width?: number;
|
|
48
|
+
height?: number;
|
|
49
|
+
fallbackWidth?: number;
|
|
50
|
+
fallbackHeight?: number;
|
|
51
|
+
fallbackImage?: HTMLImageElement | null;
|
|
52
|
+
}): Promise<HTMLCanvasElement>;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveImageSource: (source: string | null | undefined, encoding?: string | null, mimeType?: string | null) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源加载方法(支持 JS 和 CSS)
|
|
3
|
+
* @param {string} url - 资源地址
|
|
4
|
+
* @param {'script'|'css'} [type='script'] - 资源类型,'script' | 'css'(默认 'script')
|
|
5
|
+
* @param {string} [id=''] - 资源 ID
|
|
6
|
+
* @returns {Promise<void>} 加载成功 resolve,失败 reject
|
|
7
|
+
*/
|
|
8
|
+
export declare const loadResource: (url: any, type?: string, id?: string) => Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface PageDimensions {
|
|
2
|
+
layout: string;
|
|
3
|
+
maxWidth: number;
|
|
4
|
+
orientation: string;
|
|
5
|
+
size: {
|
|
6
|
+
width: number;
|
|
7
|
+
label?: string | {
|
|
8
|
+
zh_CN: string;
|
|
9
|
+
en_US: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
margin: {
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const MIN_PAGE_WIDTH = 360;
|
|
20
|
+
export declare const MAX_PAGE_WIDTH = 2560;
|
|
21
|
+
export declare const DEFAULT_PAGE_WIDTH = 1140;
|
|
22
|
+
/**
|
|
23
|
+
* 将外部传入的超限页面宽度恢复为 A4 默认宽度。
|
|
24
|
+
* @param width - 以 px 为单位的页面宽度。
|
|
25
|
+
* @returns 范围内的原值,或 A4 默认宽度 1140px。
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizePageWidth(width: number): number;
|
|
28
|
+
/** 校验以 px 为单位的页面尺寸和内边距;非法值抛错,无返回值。 */
|
|
29
|
+
export declare function validatePageDimensions(page: PageDimensions): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const isOutOfRange: (error: any) => boolean;
|
|
2
|
+
export declare const resolvePos: (doc: any, pos: any) => any;
|
|
3
|
+
export declare const safeNodePos: (getPos: any, state?: any) => number;
|
|
4
|
+
export declare const safeOffsetPos: (getPos: any, state?: any, offset?: number) => number;
|
|
5
|
+
export declare const selectNodePos: (editor: any, getPos: any) => any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 生成小写字母和数字 ID,默认 16 位,序列耗尽时降级为 UUID v4。
|
|
3
|
+
* @param length - 常规 ID 长度,必须为正安全整数;降级后返回带连字符的 36 位 UUID。
|
|
4
|
+
* @returns 当前模块实例内从未生成过的 ID,不修改文档已有 ID。
|
|
5
|
+
* @throws 长度非法时抛错;序列耗尽不抛错,也不重置起点重复生成。
|
|
6
|
+
* @注意 随机起点降低跨页面、跨进程的碰撞概率,但不提供跨实例的绝对唯一保证。
|
|
7
|
+
* 导入内容仍需由编辑器处理 ID 冲突;服务端全局唯一性需唯一索引和冲突重试。
|
|
8
|
+
* 序列可预测,不可用作密码、令牌或访问凭据。
|
|
9
|
+
*/
|
|
10
|
+
export declare const shortId: (length?: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getShortcut: (shortcut: any) => any;
|