@opentiny/fluent-editor 4.0.0-alpha.10 → 4.0.0-alpha.11
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/es/config/editor.utils.es.js.map +1 -1
- package/es/config/i18n/en-us.es.js +2 -0
- package/es/config/i18n/en-us.es.js.map +1 -1
- package/es/config/i18n/zh-cn.es.js +2 -0
- package/es/config/i18n/zh-cn.es.js.map +1 -1
- package/es/config/index.es.js.map +1 -1
- package/es/core/fluent-editor.es.js.map +1 -1
- package/es/fluent-editor.es.js +17 -13
- package/es/fluent-editor.es.js.map +1 -1
- package/es/formats/soft-break.es.js.map +1 -1
- package/es/formats/video.es.js.map +1 -1
- package/es/index.es.js +4 -0
- package/es/index.es.js.map +1 -1
- package/es/modules/ai/constants.es.js.map +1 -1
- package/es/modules/ai/index.es.js +1 -1
- package/es/modules/ai/index.es.js.map +1 -1
- package/es/modules/collaborative-editing/awareness/awareness.es.js.map +1 -1
- package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js.map +1 -1
- package/es/modules/collaborative-editing/collaborative-editing.es.js.map +1 -1
- package/es/modules/collaborative-editing/module.es.js.map +1 -1
- package/es/modules/collaborative-editing/provider/providerRegistry.es.js.map +1 -1
- package/es/modules/collaborative-editing/provider/webrtc.es.js.map +1 -1
- package/es/modules/collaborative-editing/provider/websocket.es.js.map +1 -1
- package/es/modules/counter.es.js.map +1 -1
- package/es/modules/custom-clipboard.es.js.map +1 -1
- package/es/modules/custom-image/actions/action.es.js.map +1 -1
- package/es/modules/custom-image/actions/custom-resize-action.es.js.map +1 -1
- package/es/modules/custom-image/actions/delete-action.es.js.map +1 -1
- package/es/modules/custom-image/actions/image-toolbar-buttons.es.js +1 -1
- package/es/modules/custom-image/actions/image-toolbar-buttons.es.js.map +1 -1
- package/es/modules/custom-image/actions/toolbar-action.es.js.map +1 -1
- package/es/modules/custom-image/actions/toolbar.es.js.map +1 -1
- package/es/modules/custom-image/blot-formatter.es.js.map +1 -1
- package/es/modules/custom-image/image.es.js.map +1 -1
- package/es/modules/custom-image/options.es.js.map +1 -1
- package/es/modules/custom-image/specs/blot-spec.es.js.map +1 -1
- package/es/modules/custom-image/specs/custom-image-spec.es.js.map +1 -1
- package/es/modules/custom-image/specs/image-spec.es.js.map +1 -1
- package/es/modules/custom-uploader.es.js.map +1 -1
- package/es/modules/divider.es.js.map +1 -1
- package/es/modules/emoji.es.js.map +1 -1
- package/es/modules/file/formats/file.es.js.map +1 -1
- package/es/modules/file/modules/file-bar.es.js.map +1 -1
- package/es/modules/file/modules/file-module.es.js.map +1 -1
- package/es/modules/flow-chart/config-utils.es.js +102 -0
- package/es/modules/flow-chart/config-utils.es.js.map +1 -0
- package/es/modules/flow-chart/formats/flow-chart-blot.es.js +369 -0
- package/es/modules/flow-chart/formats/flow-chart-blot.es.js.map +1 -0
- package/es/modules/flow-chart/i18n/en-us.es.js +30 -0
- package/es/modules/flow-chart/i18n/en-us.es.js.map +1 -0
- package/es/modules/flow-chart/i18n/index.es.js +12 -0
- package/es/modules/flow-chart/i18n/index.es.js.map +1 -0
- package/es/modules/flow-chart/i18n/zh-cn.es.js +30 -0
- package/es/modules/flow-chart/i18n/zh-cn.es.js.map +1 -0
- package/es/modules/flow-chart/icons.es.js +27 -0
- package/es/modules/flow-chart/icons.es.js.map +1 -0
- package/es/modules/flow-chart/index.es.js +45 -0
- package/es/modules/flow-chart/index.es.js.map +1 -0
- package/es/modules/flow-chart/modules/context-menu.es.js +184 -0
- package/es/modules/flow-chart/modules/context-menu.es.js.map +1 -0
- package/es/modules/flow-chart/modules/control-panel.es.js +286 -0
- package/es/modules/flow-chart/modules/control-panel.es.js.map +1 -0
- package/es/modules/flow-chart/modules/custom-resize-action.es.js +150 -0
- package/es/modules/flow-chart/modules/custom-resize-action.es.js.map +1 -0
- package/es/modules/flow-chart/style/flow-chart.css +185 -0
- package/es/modules/i18n.es.js.map +1 -1
- package/es/modules/index.es.js +4 -0
- package/es/modules/index.es.js.map +1 -1
- package/es/modules/link/formats/link.es.js.map +1 -1
- package/es/modules/link/modules/tooltip.es.js.map +1 -1
- package/es/modules/mathlive/formats.es.js.map +1 -1
- package/es/modules/mathlive/module.es.js.map +1 -1
- package/es/modules/mathlive/tooltip.es.js.map +1 -1
- package/es/modules/mention/mention-link.es.js.map +1 -1
- package/es/modules/mention/mention.es.js.map +1 -1
- package/es/modules/mind-map/config-utils.es.js +108 -0
- package/es/modules/mind-map/config-utils.es.js.map +1 -0
- package/es/modules/mind-map/formats/mind-map-blot.es.js +356 -0
- package/es/modules/mind-map/formats/mind-map-blot.es.js.map +1 -0
- package/es/modules/mind-map/i18n/en-us.es.js +29 -0
- package/es/modules/mind-map/i18n/en-us.es.js.map +1 -0
- package/es/modules/mind-map/i18n/index.es.js +12 -0
- package/es/modules/mind-map/i18n/index.es.js.map +1 -0
- package/es/modules/mind-map/i18n/zh-cn.es.js +29 -0
- package/es/modules/mind-map/i18n/zh-cn.es.js.map +1 -0
- package/es/modules/mind-map/icons.es.js +45 -0
- package/es/modules/mind-map/icons.es.js.map +1 -0
- package/es/modules/mind-map/index.es.js +56 -0
- package/es/modules/mind-map/index.es.js.map +1 -0
- package/es/modules/mind-map/modules/context-menu.es.js +128 -0
- package/es/modules/mind-map/modules/context-menu.es.js.map +1 -0
- package/es/modules/mind-map/modules/control-panel.es.js +424 -0
- package/es/modules/mind-map/modules/control-panel.es.js.map +1 -0
- package/es/modules/mind-map/modules/custom-resize-action.es.js +161 -0
- package/es/modules/mind-map/modules/custom-resize-action.es.js.map +1 -0
- package/es/modules/mind-map/style/mind-map.css +224 -0
- package/es/modules/shortcut-key/index.es.js +16 -0
- package/es/modules/shortcut-key/index.es.js.map +1 -1
- package/es/modules/syntax.es.js.map +1 -1
- package/es/modules/table-up/index.es.js.map +1 -1
- package/es/modules/toolbar/better-picker.es.js.map +1 -1
- package/es/modules/toolbar/better-toolbar.es.js.map +1 -1
- package/es/modules/toolbar/toolbar-tip.es.js.map +1 -1
- package/es/themes/snow.es.js.map +1 -1
- package/es/tools/format-painter.es.js.map +1 -1
- package/es/tools/fullscreen.es.js.map +1 -1
- package/es/tools/screenshot.es.js.map +1 -1
- package/es/ui/icons.config.es.js +4 -0
- package/es/ui/icons.config.es.js.map +1 -1
- package/es/ui/icons.es.js +4 -2
- package/es/ui/icons.es.js.map +1 -1
- package/es/utils/debounce.es.js.map +1 -1
- package/es/utils/image.es.js.map +1 -1
- package/es/utils/is.es.js.map +1 -1
- package/es/utils/method.es.js.map +1 -1
- package/es/utils/scroll-lock.es.js.map +1 -1
- package/lib/config/editor.utils.cjs.js.map +1 -1
- package/lib/config/i18n/en-us.cjs.js +2 -0
- package/lib/config/i18n/en-us.cjs.js.map +1 -1
- package/lib/config/i18n/zh-cn.cjs.js +2 -0
- package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
- package/lib/config/index.cjs.js.map +1 -1
- package/lib/core/fluent-editor.cjs.js.map +1 -1
- package/lib/fluent-editor.cjs.js +23 -19
- package/lib/fluent-editor.cjs.js.map +1 -1
- package/lib/formats/soft-break.cjs.js.map +1 -1
- package/lib/formats/video.cjs.js.map +1 -1
- package/lib/index.cjs.js +9 -5
- package/lib/index.cjs.js.map +1 -1
- package/lib/modules/ai/constants.cjs.js.map +1 -1
- package/lib/modules/ai/index.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/awareness/awareness.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/collaborative-editing.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/module.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/provider/webrtc.cjs.js.map +1 -1
- package/lib/modules/collaborative-editing/provider/websocket.cjs.js.map +1 -1
- package/lib/modules/counter.cjs.js.map +1 -1
- package/lib/modules/custom-clipboard.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/action.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/custom-resize-action.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/delete-action.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/toolbar-action.cjs.js.map +1 -1
- package/lib/modules/custom-image/actions/toolbar.cjs.js.map +1 -1
- package/lib/modules/custom-image/blot-formatter.cjs.js.map +1 -1
- package/lib/modules/custom-image/image.cjs.js.map +1 -1
- package/lib/modules/custom-image/options.cjs.js.map +1 -1
- package/lib/modules/custom-image/specs/blot-spec.cjs.js.map +1 -1
- package/lib/modules/custom-image/specs/custom-image-spec.cjs.js.map +1 -1
- package/lib/modules/custom-image/specs/image-spec.cjs.js.map +1 -1
- package/lib/modules/custom-uploader.cjs.js.map +1 -1
- package/lib/modules/divider.cjs.js.map +1 -1
- package/lib/modules/emoji.cjs.js.map +1 -1
- package/lib/modules/file/formats/file.cjs.js.map +1 -1
- package/lib/modules/file/modules/file-bar.cjs.js.map +1 -1
- package/lib/modules/file/modules/file-module.cjs.js.map +1 -1
- package/lib/modules/flow-chart/config-utils.cjs.js +102 -0
- package/lib/modules/flow-chart/config-utils.cjs.js.map +1 -0
- package/lib/modules/flow-chart/formats/flow-chart-blot.cjs.js +369 -0
- package/lib/modules/flow-chart/formats/flow-chart-blot.cjs.js.map +1 -0
- package/lib/modules/flow-chart/i18n/en-us.cjs.js +30 -0
- package/lib/modules/flow-chart/i18n/en-us.cjs.js.map +1 -0
- package/lib/modules/flow-chart/i18n/index.cjs.js +12 -0
- package/lib/modules/flow-chart/i18n/index.cjs.js.map +1 -0
- package/lib/modules/flow-chart/i18n/zh-cn.cjs.js +30 -0
- package/lib/modules/flow-chart/i18n/zh-cn.cjs.js.map +1 -0
- package/lib/modules/flow-chart/icons.cjs.js +27 -0
- package/lib/modules/flow-chart/icons.cjs.js.map +1 -0
- package/lib/modules/flow-chart/index.cjs.js +45 -0
- package/lib/modules/flow-chart/index.cjs.js.map +1 -0
- package/lib/modules/flow-chart/modules/context-menu.cjs.js +184 -0
- package/lib/modules/flow-chart/modules/context-menu.cjs.js.map +1 -0
- package/lib/modules/flow-chart/modules/control-panel.cjs.js +286 -0
- package/lib/modules/flow-chart/modules/control-panel.cjs.js.map +1 -0
- package/lib/modules/flow-chart/modules/custom-resize-action.cjs.js +150 -0
- package/lib/modules/flow-chart/modules/custom-resize-action.cjs.js.map +1 -0
- package/lib/modules/flow-chart/style/flow-chart.css +185 -0
- package/lib/modules/i18n.cjs.js.map +1 -1
- package/lib/modules/index.cjs.js +9 -5
- package/lib/modules/index.cjs.js.map +1 -1
- package/lib/modules/link/formats/link.cjs.js.map +1 -1
- package/lib/modules/link/modules/tooltip.cjs.js.map +1 -1
- package/lib/modules/mathlive/formats.cjs.js.map +1 -1
- package/lib/modules/mathlive/module.cjs.js.map +1 -1
- package/lib/modules/mathlive/tooltip.cjs.js.map +1 -1
- package/lib/modules/mention/mention-link.cjs.js.map +1 -1
- package/lib/modules/mention/mention.cjs.js.map +1 -1
- package/lib/modules/mind-map/config-utils.cjs.js +108 -0
- package/lib/modules/mind-map/config-utils.cjs.js.map +1 -0
- package/lib/modules/mind-map/formats/mind-map-blot.cjs.js +356 -0
- package/lib/modules/mind-map/formats/mind-map-blot.cjs.js.map +1 -0
- package/lib/modules/mind-map/i18n/en-us.cjs.js +29 -0
- package/lib/modules/mind-map/i18n/en-us.cjs.js.map +1 -0
- package/lib/modules/mind-map/i18n/index.cjs.js +12 -0
- package/lib/modules/mind-map/i18n/index.cjs.js.map +1 -0
- package/lib/modules/mind-map/i18n/zh-cn.cjs.js +29 -0
- package/lib/modules/mind-map/i18n/zh-cn.cjs.js.map +1 -0
- package/lib/modules/mind-map/icons.cjs.js +45 -0
- package/lib/modules/mind-map/icons.cjs.js.map +1 -0
- package/lib/modules/mind-map/index.cjs.js +56 -0
- package/lib/modules/mind-map/index.cjs.js.map +1 -0
- package/lib/modules/mind-map/modules/context-menu.cjs.js +128 -0
- package/lib/modules/mind-map/modules/context-menu.cjs.js.map +1 -0
- package/lib/modules/mind-map/modules/control-panel.cjs.js +424 -0
- package/lib/modules/mind-map/modules/control-panel.cjs.js.map +1 -0
- package/lib/modules/mind-map/modules/custom-resize-action.cjs.js +161 -0
- package/lib/modules/mind-map/modules/custom-resize-action.cjs.js.map +1 -0
- package/lib/modules/mind-map/style/mind-map.css +224 -0
- package/lib/modules/shortcut-key/index.cjs.js +16 -0
- package/lib/modules/shortcut-key/index.cjs.js.map +1 -1
- package/lib/modules/syntax.cjs.js.map +1 -1
- package/lib/modules/table-up/index.cjs.js.map +1 -1
- package/lib/modules/toolbar/better-picker.cjs.js.map +1 -1
- package/lib/modules/toolbar/better-toolbar.cjs.js.map +1 -1
- package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -1
- package/lib/themes/snow.cjs.js.map +1 -1
- package/lib/tools/format-painter.cjs.js.map +1 -1
- package/lib/tools/fullscreen.cjs.js.map +1 -1
- package/lib/tools/screenshot.cjs.js.map +1 -1
- package/lib/ui/icons.cjs.js +3 -1
- package/lib/ui/icons.cjs.js.map +1 -1
- package/lib/ui/icons.config.cjs.js +4 -0
- package/lib/ui/icons.config.cjs.js.map +1 -1
- package/lib/utils/debounce.cjs.js.map +1 -1
- package/lib/utils/image.cjs.js.map +1 -1
- package/lib/utils/is.cjs.js.map +1 -1
- package/lib/utils/method.cjs.js.map +1 -1
- package/lib/utils/scroll-lock.cjs.js.map +1 -1
- package/package.json +5 -1
- package/style.css +3 -1
- package/types/config/i18n/en-us.d.ts +2 -0
- package/types/config/i18n/zh-cn.d.ts +2 -0
- package/types/config/types/editor-modules.interface.d.ts +4 -0
- package/types/modules/flow-chart/config-utils.d.ts +10 -0
- package/types/modules/flow-chart/formats/flow-chart-blot.d.ts +43 -0
- package/types/modules/flow-chart/i18n/en-us.d.ts +26 -0
- package/types/modules/flow-chart/i18n/index.d.ts +1 -0
- package/types/modules/flow-chart/i18n/zh-cn.d.ts +26 -0
- package/types/modules/flow-chart/icons.d.ts +12 -0
- package/types/modules/flow-chart/index.d.ts +10 -0
- package/types/modules/flow-chart/modules/context-menu.d.ts +3 -0
- package/types/modules/flow-chart/modules/control-panel.d.ts +3 -0
- package/types/modules/flow-chart/modules/custom-resize-action.d.ts +22 -0
- package/types/modules/flow-chart/options.d.ts +29 -0
- package/types/modules/index.d.ts +2 -0
- package/types/modules/mind-map/config-utils.d.ts +12 -0
- package/types/modules/mind-map/formats/mind-map-blot.d.ts +44 -0
- package/types/modules/mind-map/i18n/en-us.d.ts +25 -0
- package/types/modules/mind-map/i18n/index.d.ts +1 -0
- package/types/modules/mind-map/i18n/zh-cn.d.ts +25 -0
- package/types/modules/mind-map/icons.d.ts +21 -0
- package/types/modules/mind-map/index.d.ts +10 -0
- package/types/modules/mind-map/modules/context-menu.d.ts +3 -0
- package/types/modules/mind-map/modules/control-panel.d.ts +3 -0
- package/types/modules/mind-map/modules/custom-resize-action.d.ts +23 -0
- package/types/modules/mind-map/options.d.ts +26 -0
- package/types/ui/icons.config.d.ts +2 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const backIcon = `<svg t="1761403103969" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4781" width="20" height="20"><path d="M995.648 459.296C684.448 281.568 406.08 318.656 171.232 567.904L32 416v384h352l-160.736-175.328c211.168-227.072 452.192-259.776 734.304-98.688a38.4 38.4 0 0 0 38.08-66.688z" p-id="4782" fill="#2c2c2c" data-spm-anchor-id="a313x.collections_detail.0.i0.26dd3a81klL5t6" class="selected"></path></svg>`;
|
|
4
|
+
const forwardIcon = `<svg t="1761403135994" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5138" width="20" height="20"><path d="M860.992 558.912C627.904 317.536 352.384 283.648 44.8 459.296a38.4 38.4 0 1 0 38.08 66.688c278.432-159.008 516.896-129.408 726.08 89.696L640 800h352V416l-131.008 142.912z" p-id="5139"></path></svg>`;
|
|
5
|
+
const zoomOutIcon = `<svg t="1761403245796" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8340" width="20" height="20"><path d="M170.666667 469.333333h682.666666v85.333334H170.666667z" fill="#2c2c2c" p-id="8341" data-spm-anchor-id="a313x.collections_detail.0.i0.466d3a81c91yTh" class="selected"></path></svg>`;
|
|
6
|
+
const zoomInIcon = `<svg t="1761403317929" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8601" width="20" height="20"><path d="M469.333333 469.333333V170.666667h85.333334v298.666666h298.666666v85.333334h-298.666666v298.666666h-85.333334v-298.666666H170.666667v-85.333334h298.666666z" fill="#2c2c2c" p-id="8602" data-spm-anchor-id="a313x.collections_detail.0.i3.466d3a81c91yTh" class="selected"></path></svg>`;
|
|
7
|
+
const fitIcon = `<svg t="1761403396579" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5306" width="20" height="20"><path d="M921.6 64c20.48 0 38.4 17.92 38.4 38.4v819.2c0 20.48-17.92 38.4-38.4 38.4H102.4c-20.48 0-38.4-17.92-38.4-38.4V102.4c0-20.48 17.92-38.4 38.4-38.4h819.2z m-38.4 76.8H140.8v742.4h742.4V140.8z m-640 478.72c17.92 0 33.28 15.36 33.28 33.28v94.72H371.2c17.92 0 33.28 15.36 33.28 33.28s-15.36 33.28-33.28 33.28h-128a33.92 33.92 0 0 1-33.28-33.28v-128c0-17.92 15.36-33.28 33.28-33.28z m537.6 0c17.92 0 33.28 15.36 33.28 33.28v128c0 17.92-15.36 33.28-33.28 33.28h-128a33.92 33.92 0 0 1-33.28-33.28c0-17.92 15.36-33.28 33.28-33.28h94.72V652.8c0-17.92 15.36-33.28 33.28-33.28z m0-409.6c17.92 0 33.28 15.36 33.28 33.28v128c0 17.92-15.36 33.28-33.28 33.28a33.92 33.92 0 0 1-33.28-33.28V276.48H652.8a33.92 33.92 0 0 1-33.28-33.28c0-17.92 15.36-33.28 33.28-33.28h128z m-409.6 0c17.92 0 33.28 15.36 33.28 33.28s-15.36 33.28-33.28 33.28H276.48V371.2c0 17.92-15.36 33.28-33.28 33.28a33.92 33.92 0 0 1-33.28-33.28v-128c0-17.92 15.36-33.28 33.28-33.28h128z" fill="#2c2c2c" p-id="5307" data-spm-anchor-id="a313x.search_index.0.i0.4ac53a81alttUW" class="selected"></path></svg>`;
|
|
8
|
+
const screenTypeIcon = `<svg t="1761452295156" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1999" width="20" height="20"><path d="M163.2 94.08a48 48 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m145.28 279.04a48 48 0 0 0 67.84 0 48 48 0 0 0 0-67.84L308.48 373.12z m-213.12-211.2l213.12 211.2 67.84-67.84-213.12-211.2-67.84 67.84zM95.36 859.52a48 48 0 0 0 67.84 68.48l-67.84-68.48z m280.96-142.72a48 48 0 0 0-67.84-68.48l67.84 68.48z m-213.12 211.2l213.12-211.2-67.84-68.48-213.12 211.2 67.84 68.48zM863.36 928a48 48 0 0 0 67.84-67.84l-67.84 67.84z m-143.36-279.04a47.36 47.36 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m211.2 211.2l-211.2-211.2-67.84 67.84 211.2 211.2 67.84-67.84zM929.28 161.92a48 48 0 0 0 0-67.84 49.28 49.28 0 0 0-68.48 0l68.48 67.84z m-279.68 143.36a48 48 0 0 0 0 67.84 49.28 49.28 0 0 0 68.48 0l-68.48-67.84z m211.2-211.2l-211.2 211.2 68.48 67.84 211.2-211.2-68.48-67.84z" fill="#2c2c2c" p-id="2000" data-spm-anchor-id="a313x.collections_detail.0.i1.6af43a81bnfxmJ" class="selected"></path><path d="M704 80a48 48 0 0 0 0 96v-96zM896 128h48a48.64 48.64 0 0 0-48-48V128z m-48 192a48 48 0 0 0 96 0zM704 176h192v-96h-192v96zM849.28 128v192h96V128zM945.28 704a48 48 0 0 0-96 0zM896 896v48a48.64 48.64 0 0 0 48-48z m-192-48a48 48 0 0 0 0 96v-96zM849.28 704v192h96v-192z m46.72 144h-192v96h192v-96zM320 944a48 48 0 0 0 0-96v96zM128 896h-46.72a48 48 0 0 0 48 48V896z m48-192a48 48 0 0 0-96 0zM320 848H128v96h192v-96zM177.28 896v-192h-96v192zM81.28 320a48 48 0 0 0 96 0zM128 128v-48a48 48 0 0 0-46.72 48z m192 48a48 48 0 0 0 0-96v96zM177.28 320V128h-96v192zM128 176h192v-96H128v96z" fill="#2c2c2c" p-id="2001" data-spm-anchor-id="a313x.collections_detail.0.i0.6af43a81bnfxmJ" class="selected"></path></svg>`;
|
|
9
|
+
const screenReduceIcon = `<svg t="1761452375205" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2267" data-spm-anchor-id="a313x.collections_detail.0.i9.6af43a81bnfxmJ" width="20" height="20"><path d="M308.48 373.12a48 48 0 0 0 67.84 0 48 48 0 0 0 0-67.84L308.48 373.12zM163.2 94.08a48 48 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m213.12 211.2l-213.12-211.2-67.84 67.84 213.12 211.2 67.84-67.84zM720 650.88a48 48 0 1 0-67.84 67.84l67.84-67.84z m143.36 279.04a48 48 0 0 0 67.84-67.84l-67.84 67.84z m-211.2-211.2l211.2 211.2 67.84-67.84-211.2-211.2-67.84 67.84zM652.16 305.28a48 48 0 1 0 67.84 67.84l-67.84-67.84z m279.04-143.36a48 48 0 0 0-67.84-67.84l67.84 67.84z m-211.2 211.2l211.2-211.2-67.84-67.84-211.2 211.2 67.84 67.84z" fill="#2c2c2c" p-id="2268" data-spm-anchor-id="a313x.collections_detail.0.i4.6af43a81bnfxmJ" class="selected"></path><path d="M875.52 387.2a48 48 0 0 0 0-96v96z m-192-48h-48a48.64 48.64 0 0 0 48 48V339.2z m48-192a48 48 0 1 0-96 0z m144 144h-192v96h192v-96z m-144 48v-192h-96v192zM640 874.88a48 48 0 0 0 96 0z m48-192v-48a47.36 47.36 0 0 0-48 48z m192 48a48 48 0 0 0 0-96v96z m-144 144v-192H640v192z m-48-144h192v-96h-192v96zM376.32 718.72a48 48 0 0 0 0-67.84 48 48 0 0 0-67.84 0l67.84 67.84z m-280.96 143.36a48 48 0 0 0 0 67.84 48 48 0 0 0 67.84 0l-67.84-67.84z m213.12-211.2l-213.12 211.2 67.84 67.84 213.12-211.2-67.84-67.84zM150.4 634.88a48 48 0 1 0 0 96v-96z" fill="#2c2c2c" p-id="2269" data-spm-anchor-id="a313x.collections_detail.0.i5.6af43a81bnfxmJ" class="selected"></path><path d="M342.4 682.88h48a47.36 47.36 0 0 0-48-48v48zM294.4 874.88a48 48 0 0 0 96 0zM150.4 730.88h192v-96h-192v96z" fill="#2c2c2c" p-id="2270" data-spm-anchor-id="a313x.collections_detail.0.i8.6af43a81bnfxmJ" class="selected"></path><path d="M294.4 682.88v192h96v-192H294.4zM390.4 147.2a48 48 0 0 0-96 0z m-48 192v48a48 48 0 0 0 48-48z m-192-48a48 48 0 0 0 0 96v-96zM294.4 147.2v192h96v-192z m48 144h-192v96h192v-96z" fill="#2c2c2c" p-id="2271" data-spm-anchor-id="a313x.collections_detail.0.i6.6af43a81bnfxmJ" class="selected"></path></svg>`;
|
|
10
|
+
const contractIcon = `<svg t="1761655211386" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1193" width="20" height="20"><path d="M325.504 148.992a32.256 32.256 0 0 0-8.96 22.016 28.8 28.8 0 0 0 8.96 20.992L637.44 512l-312 320a28.8 28.8 0 0 0 0 41.984 28.8 28.8 0 0 0 20.992 8.96 30.592 30.592 0 0 0 20.992-7.936l331.008-340.992a29.952 29.952 0 0 0 8.96-22.016 29.952 29.952 0 0 0-8.96-22.016L367.488 148.992a30.592 30.592 0 0 0-20.992-8 30.592 30.592 0 0 0-20.992 8z" fill="#2c2c2c" p-id="1194" data-spm-anchor-id="a313x.manage_type_mylikes.0.i5.38213a81adgpe6" class="selected"></path></svg>`;
|
|
11
|
+
const expandIcon = `<svg t="1761655175337" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="972" data-spm-anchor-id="a313x.manage_type_mylikes.0.i0.38213a81adgpe6" width="20" height="20"><path d="M656.512 148.992L325.504 489.984a29.376 29.376 0 0 0-8.96 21.504c0 8.32 2.944 15.808 8.96 22.464l331.008 341.056a30.592 30.592 0 0 0 20.992 7.936 28.8 28.8 0 0 0 20.992-8.96 28.8 28.8 0 0 0 8.96-20.992 28.8 28.8 0 0 0-8.96-20.992L386.496 512l312-320a28.8 28.8 0 0 0 8.96-20.992 28.8 28.8 0 0 0-8.96-20.992 28.8 28.8 0 0 0-20.992-8.96 30.592 30.592 0 0 0-20.992 7.936z" fill="#2c2c2c" p-id="973" data-spm-anchor-id="a313x.manage_type_mylikes.0.i1.38213a81adgpe6" class="selected"></path></svg>`;
|
|
12
|
+
const polyLineIcon = `<svg t="1761572159464" class="icon" viewBox="0 0 1536 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8186" width="20" height="20"><path d="M1536 998.4H593.92v-921.6H0v-51.2h645.12v921.6H1536z" p-id="8187" fill="#2c2c2c" data-spm-anchor-id="a313x.search_index.0.i0.2bc03a810V44kl" class="selected"></path></svg>`;
|
|
13
|
+
const bezierIcon = `<svg t="1761570981381" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2048" data-spm-anchor-id="a313x.collections_detail.0.i0.189b3a81Nmah5F" width="20" height="20"><path d="M310.1 863.9c-124 0-218-4.2-219.3-4.3-12.7-0.6-22.5-11.3-21.9-24 0.6-12.7 11.5-22.6 24-21.9 193.3 8.8 714.8 12.7 805.6-74.1 8.5-8.1 9.5-14.1 9.5-18 0-15-16.7-48.1-128.7-101.8C696.2 580.2 586.1 541 479.6 503 241.6 418 107 366.7 107 300.4c0-43.3 43.6-96.5 383.5-123.4 180-14.3 362.3-14.4 364.1-14.4 12.7 0 22.9 10.3 22.9 22.9s-10.3 22.9-22.9 22.9c-1.8 0-182.5 0.2-360.7 14.3-337.1 26.8-341 77.2-341 77.7 0 0.9 1.1 21.4 96 64.9 65.3 29.9 153.2 61.3 246.2 94.5 277.1 98.9 458.8 170.6 458.8 262.1 0 18.9-8 36.1-23.7 51.1-53.8 51.4-207.7 80.4-470.5 88.7-52 1.6-102.9 2.2-149.6 2.2z" fill="#2c2c2c" p-id="2049" data-spm-anchor-id="a313x.collections_detail.0.i1.189b3a81Nmah5F" class="selected"></path></svg>`;
|
|
14
|
+
const lineIcon = `<svg t="1761571015001" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2261" width="20" height="20"><path d="M89.4 959c-5.9 0-11.8-2.3-16.3-6.8-9-9-9-23.7 0-32.7L918.3 74.2c9-9 23.7-9 32.7 0 9 9 9 23.7 0 32.7L105.7 952.2c-4.5 4.5-10.4 6.8-16.3 6.8z" fill="#2c2c2c" p-id="2262" data-spm-anchor-id="a313x.collections_detail.0.i6.189b3a81Nmah5F" class="selected"></path></svg>`;
|
|
15
|
+
exports.backIcon = backIcon;
|
|
16
|
+
exports.bezierIcon = bezierIcon;
|
|
17
|
+
exports.contractIcon = contractIcon;
|
|
18
|
+
exports.expandIcon = expandIcon;
|
|
19
|
+
exports.fitIcon = fitIcon;
|
|
20
|
+
exports.forwardIcon = forwardIcon;
|
|
21
|
+
exports.lineIcon = lineIcon;
|
|
22
|
+
exports.polyLineIcon = polyLineIcon;
|
|
23
|
+
exports.screenReduceIcon = screenReduceIcon;
|
|
24
|
+
exports.screenTypeIcon = screenTypeIcon;
|
|
25
|
+
exports.zoomInIcon = zoomInIcon;
|
|
26
|
+
exports.zoomOutIcon = zoomOutIcon;
|
|
27
|
+
//# sourceMappingURL=icons.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.cjs.js","sources":["../../../../src/modules/flow-chart/icons.ts"],"sourcesContent":["export const backIcon = `<svg t=\"1761403103969\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"4781\" width=\"20\" height=\"20\"><path d=\"M995.648 459.296C684.448 281.568 406.08 318.656 171.232 567.904L32 416v384h352l-160.736-175.328c211.168-227.072 452.192-259.776 734.304-98.688a38.4 38.4 0 0 0 38.08-66.688z\" p-id=\"4782\" fill=\"#2c2c2c\" data-spm-anchor-id=\"a313x.collections_detail.0.i0.26dd3a81klL5t6\" class=\"selected\"></path></svg>`\nexport const forwardIcon = `<svg t=\"1761403135994\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5138\" width=\"20\" height=\"20\"><path d=\"M860.992 558.912C627.904 317.536 352.384 283.648 44.8 459.296a38.4 38.4 0 1 0 38.08 66.688c278.432-159.008 516.896-129.408 726.08 89.696L640 800h352V416l-131.008 142.912z\" p-id=\"5139\"></path></svg>`\nexport const zoomOutIcon = `<svg t=\"1761403245796\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8340\" width=\"20\" height=\"20\"><path d=\"M170.666667 469.333333h682.666666v85.333334H170.666667z\" fill=\"#2c2c2c\" p-id=\"8341\" data-spm-anchor-id=\"a313x.collections_detail.0.i0.466d3a81c91yTh\" class=\"selected\"></path></svg>`\nexport const zoomInIcon = `<svg t=\"1761403317929\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8601\" width=\"20\" height=\"20\"><path d=\"M469.333333 469.333333V170.666667h85.333334v298.666666h298.666666v85.333334h-298.666666v298.666666h-85.333334v-298.666666H170.666667v-85.333334h298.666666z\" fill=\"#2c2c2c\" p-id=\"8602\" data-spm-anchor-id=\"a313x.collections_detail.0.i3.466d3a81c91yTh\" class=\"selected\"></path></svg>`\nexport const fitIcon = `<svg t=\"1761403396579\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5306\" width=\"20\" height=\"20\"><path d=\"M921.6 64c20.48 0 38.4 17.92 38.4 38.4v819.2c0 20.48-17.92 38.4-38.4 38.4H102.4c-20.48 0-38.4-17.92-38.4-38.4V102.4c0-20.48 17.92-38.4 38.4-38.4h819.2z m-38.4 76.8H140.8v742.4h742.4V140.8z m-640 478.72c17.92 0 33.28 15.36 33.28 33.28v94.72H371.2c17.92 0 33.28 15.36 33.28 33.28s-15.36 33.28-33.28 33.28h-128a33.92 33.92 0 0 1-33.28-33.28v-128c0-17.92 15.36-33.28 33.28-33.28z m537.6 0c17.92 0 33.28 15.36 33.28 33.28v128c0 17.92-15.36 33.28-33.28 33.28h-128a33.92 33.92 0 0 1-33.28-33.28c0-17.92 15.36-33.28 33.28-33.28h94.72V652.8c0-17.92 15.36-33.28 33.28-33.28z m0-409.6c17.92 0 33.28 15.36 33.28 33.28v128c0 17.92-15.36 33.28-33.28 33.28a33.92 33.92 0 0 1-33.28-33.28V276.48H652.8a33.92 33.92 0 0 1-33.28-33.28c0-17.92 15.36-33.28 33.28-33.28h128z m-409.6 0c17.92 0 33.28 15.36 33.28 33.28s-15.36 33.28-33.28 33.28H276.48V371.2c0 17.92-15.36 33.28-33.28 33.28a33.92 33.92 0 0 1-33.28-33.28v-128c0-17.92 15.36-33.28 33.28-33.28h128z\" fill=\"#2c2c2c\" p-id=\"5307\" data-spm-anchor-id=\"a313x.search_index.0.i0.4ac53a81alttUW\" class=\"selected\"></path></svg>`\nexport const screenTypeIcon = `<svg t=\"1761452295156\" class=\"icon\" viewBox=\"0 0 1026 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"1999\" width=\"20\" height=\"20\"><path d=\"M163.2 94.08a48 48 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m145.28 279.04a48 48 0 0 0 67.84 0 48 48 0 0 0 0-67.84L308.48 373.12z m-213.12-211.2l213.12 211.2 67.84-67.84-213.12-211.2-67.84 67.84zM95.36 859.52a48 48 0 0 0 67.84 68.48l-67.84-68.48z m280.96-142.72a48 48 0 0 0-67.84-68.48l67.84 68.48z m-213.12 211.2l213.12-211.2-67.84-68.48-213.12 211.2 67.84 68.48zM863.36 928a48 48 0 0 0 67.84-67.84l-67.84 67.84z m-143.36-279.04a47.36 47.36 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m211.2 211.2l-211.2-211.2-67.84 67.84 211.2 211.2 67.84-67.84zM929.28 161.92a48 48 0 0 0 0-67.84 49.28 49.28 0 0 0-68.48 0l68.48 67.84z m-279.68 143.36a48 48 0 0 0 0 67.84 49.28 49.28 0 0 0 68.48 0l-68.48-67.84z m211.2-211.2l-211.2 211.2 68.48 67.84 211.2-211.2-68.48-67.84z\" fill=\"#2c2c2c\" p-id=\"2000\" data-spm-anchor-id=\"a313x.collections_detail.0.i1.6af43a81bnfxmJ\" class=\"selected\"></path><path d=\"M704 80a48 48 0 0 0 0 96v-96zM896 128h48a48.64 48.64 0 0 0-48-48V128z m-48 192a48 48 0 0 0 96 0zM704 176h192v-96h-192v96zM849.28 128v192h96V128zM945.28 704a48 48 0 0 0-96 0zM896 896v48a48.64 48.64 0 0 0 48-48z m-192-48a48 48 0 0 0 0 96v-96zM849.28 704v192h96v-192z m46.72 144h-192v96h192v-96zM320 944a48 48 0 0 0 0-96v96zM128 896h-46.72a48 48 0 0 0 48 48V896z m48-192a48 48 0 0 0-96 0zM320 848H128v96h192v-96zM177.28 896v-192h-96v192zM81.28 320a48 48 0 0 0 96 0zM128 128v-48a48 48 0 0 0-46.72 48z m192 48a48 48 0 0 0 0-96v96zM177.28 320V128h-96v192zM128 176h192v-96H128v96z\" fill=\"#2c2c2c\" p-id=\"2001\" data-spm-anchor-id=\"a313x.collections_detail.0.i0.6af43a81bnfxmJ\" class=\"selected\"></path></svg>`\nexport const screenReduceIcon = `<svg t=\"1761452375205\" class=\"icon\" viewBox=\"0 0 1026 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2267\" data-spm-anchor-id=\"a313x.collections_detail.0.i9.6af43a81bnfxmJ\" width=\"20\" height=\"20\"><path d=\"M308.48 373.12a48 48 0 0 0 67.84 0 48 48 0 0 0 0-67.84L308.48 373.12zM163.2 94.08a48 48 0 0 0-67.84 0 48 48 0 0 0 0 67.84l67.84-67.84z m213.12 211.2l-213.12-211.2-67.84 67.84 213.12 211.2 67.84-67.84zM720 650.88a48 48 0 1 0-67.84 67.84l67.84-67.84z m143.36 279.04a48 48 0 0 0 67.84-67.84l-67.84 67.84z m-211.2-211.2l211.2 211.2 67.84-67.84-211.2-211.2-67.84 67.84zM652.16 305.28a48 48 0 1 0 67.84 67.84l-67.84-67.84z m279.04-143.36a48 48 0 0 0-67.84-67.84l67.84 67.84z m-211.2 211.2l211.2-211.2-67.84-67.84-211.2 211.2 67.84 67.84z\" fill=\"#2c2c2c\" p-id=\"2268\" data-spm-anchor-id=\"a313x.collections_detail.0.i4.6af43a81bnfxmJ\" class=\"selected\"></path><path d=\"M875.52 387.2a48 48 0 0 0 0-96v96z m-192-48h-48a48.64 48.64 0 0 0 48 48V339.2z m48-192a48 48 0 1 0-96 0z m144 144h-192v96h192v-96z m-144 48v-192h-96v192zM640 874.88a48 48 0 0 0 96 0z m48-192v-48a47.36 47.36 0 0 0-48 48z m192 48a48 48 0 0 0 0-96v96z m-144 144v-192H640v192z m-48-144h192v-96h-192v96zM376.32 718.72a48 48 0 0 0 0-67.84 48 48 0 0 0-67.84 0l67.84 67.84z m-280.96 143.36a48 48 0 0 0 0 67.84 48 48 0 0 0 67.84 0l-67.84-67.84z m213.12-211.2l-213.12 211.2 67.84 67.84 213.12-211.2-67.84-67.84zM150.4 634.88a48 48 0 1 0 0 96v-96z\" fill=\"#2c2c2c\" p-id=\"2269\" data-spm-anchor-id=\"a313x.collections_detail.0.i5.6af43a81bnfxmJ\" class=\"selected\"></path><path d=\"M342.4 682.88h48a47.36 47.36 0 0 0-48-48v48zM294.4 874.88a48 48 0 0 0 96 0zM150.4 730.88h192v-96h-192v96z\" fill=\"#2c2c2c\" p-id=\"2270\" data-spm-anchor-id=\"a313x.collections_detail.0.i8.6af43a81bnfxmJ\" class=\"selected\"></path><path d=\"M294.4 682.88v192h96v-192H294.4zM390.4 147.2a48 48 0 0 0-96 0z m-48 192v48a48 48 0 0 0 48-48z m-192-48a48 48 0 0 0 0 96v-96zM294.4 147.2v192h96v-192z m48 144h-192v96h192v-96z\" fill=\"#2c2c2c\" p-id=\"2271\" data-spm-anchor-id=\"a313x.collections_detail.0.i6.6af43a81bnfxmJ\" class=\"selected\"></path></svg>`\nexport const contractIcon = `<svg t=\"1761655211386\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"1193\" width=\"20\" height=\"20\"><path d=\"M325.504 148.992a32.256 32.256 0 0 0-8.96 22.016 28.8 28.8 0 0 0 8.96 20.992L637.44 512l-312 320a28.8 28.8 0 0 0 0 41.984 28.8 28.8 0 0 0 20.992 8.96 30.592 30.592 0 0 0 20.992-7.936l331.008-340.992a29.952 29.952 0 0 0 8.96-22.016 29.952 29.952 0 0 0-8.96-22.016L367.488 148.992a30.592 30.592 0 0 0-20.992-8 30.592 30.592 0 0 0-20.992 8z\" fill=\"#2c2c2c\" p-id=\"1194\" data-spm-anchor-id=\"a313x.manage_type_mylikes.0.i5.38213a81adgpe6\" class=\"selected\"></path></svg>`\nexport const expandIcon = `<svg t=\"1761655175337\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"972\" data-spm-anchor-id=\"a313x.manage_type_mylikes.0.i0.38213a81adgpe6\" width=\"20\" height=\"20\"><path d=\"M656.512 148.992L325.504 489.984a29.376 29.376 0 0 0-8.96 21.504c0 8.32 2.944 15.808 8.96 22.464l331.008 341.056a30.592 30.592 0 0 0 20.992 7.936 28.8 28.8 0 0 0 20.992-8.96 28.8 28.8 0 0 0 8.96-20.992 28.8 28.8 0 0 0-8.96-20.992L386.496 512l312-320a28.8 28.8 0 0 0 8.96-20.992 28.8 28.8 0 0 0-8.96-20.992 28.8 28.8 0 0 0-20.992-8.96 30.592 30.592 0 0 0-20.992 7.936z\" fill=\"#2c2c2c\" p-id=\"973\" data-spm-anchor-id=\"a313x.manage_type_mylikes.0.i1.38213a81adgpe6\" class=\"selected\"></path></svg>`\nexport const polyLineIcon = `<svg t=\"1761572159464\" class=\"icon\" viewBox=\"0 0 1536 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8186\" width=\"20\" height=\"20\"><path d=\"M1536 998.4H593.92v-921.6H0v-51.2h645.12v921.6H1536z\" p-id=\"8187\" fill=\"#2c2c2c\" data-spm-anchor-id=\"a313x.search_index.0.i0.2bc03a810V44kl\" class=\"selected\"></path></svg>`\nexport const bezierIcon = `<svg t=\"1761570981381\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2048\" data-spm-anchor-id=\"a313x.collections_detail.0.i0.189b3a81Nmah5F\" width=\"20\" height=\"20\"><path d=\"M310.1 863.9c-124 0-218-4.2-219.3-4.3-12.7-0.6-22.5-11.3-21.9-24 0.6-12.7 11.5-22.6 24-21.9 193.3 8.8 714.8 12.7 805.6-74.1 8.5-8.1 9.5-14.1 9.5-18 0-15-16.7-48.1-128.7-101.8C696.2 580.2 586.1 541 479.6 503 241.6 418 107 366.7 107 300.4c0-43.3 43.6-96.5 383.5-123.4 180-14.3 362.3-14.4 364.1-14.4 12.7 0 22.9 10.3 22.9 22.9s-10.3 22.9-22.9 22.9c-1.8 0-182.5 0.2-360.7 14.3-337.1 26.8-341 77.2-341 77.7 0 0.9 1.1 21.4 96 64.9 65.3 29.9 153.2 61.3 246.2 94.5 277.1 98.9 458.8 170.6 458.8 262.1 0 18.9-8 36.1-23.7 51.1-53.8 51.4-207.7 80.4-470.5 88.7-52 1.6-102.9 2.2-149.6 2.2z\" fill=\"#2c2c2c\" p-id=\"2049\" data-spm-anchor-id=\"a313x.collections_detail.0.i1.189b3a81Nmah5F\" class=\"selected\"></path></svg>`\nexport const lineIcon = `<svg t=\"1761571015001\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2261\" width=\"20\" height=\"20\"><path d=\"M89.4 959c-5.9 0-11.8-2.3-16.3-6.8-9-9-9-23.7 0-32.7L918.3 74.2c9-9 23.7-9 32.7 0 9 9 9 23.7 0 32.7L105.7 952.2c-4.5 4.5-10.4 6.8-16.3 6.8z\" fill=\"#2c2c2c\" p-id=\"2262\" data-spm-anchor-id=\"a313x.collections_detail.0.i6.189b3a81Nmah5F\" class=\"selected\"></path></svg>`\n"],"names":[],"mappings":";;AAAO,MAAM,WAAW;AACjB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,UAAU;AAChB,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,WAAW;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
+
const Quill = require("quill");
|
|
7
|
+
const flowChartBlot = require("./formats/flow-chart-blot.cjs.js");
|
|
8
|
+
class FlowChartModule {
|
|
9
|
+
constructor(quill, options) {
|
|
10
|
+
__publicField(this, "quill");
|
|
11
|
+
__publicField(this, "toolbar");
|
|
12
|
+
__publicField(this, "options");
|
|
13
|
+
quill.container.__quillInstance = quill;
|
|
14
|
+
this.quill = quill;
|
|
15
|
+
this.options = options;
|
|
16
|
+
this.toolbar = quill.getModule("toolbar");
|
|
17
|
+
if (this.toolbar) {
|
|
18
|
+
this.toolbar.addHandler("flow-chart", () => {
|
|
19
|
+
this.insertFlowChartEditor();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
static register() {
|
|
24
|
+
Quill.register("formats/flow-chart", flowChartBlot.default, true);
|
|
25
|
+
}
|
|
26
|
+
insertFlowChartEditor() {
|
|
27
|
+
const range = this.quill.getSelection();
|
|
28
|
+
if (range) {
|
|
29
|
+
const defaultData = {
|
|
30
|
+
nodes: [
|
|
31
|
+
{ id: "node1", type: "rect", x: 100, y: 150, text: "开始" },
|
|
32
|
+
{ id: "node2", type: "rect", x: 300, y: 150, text: "结束" }
|
|
33
|
+
],
|
|
34
|
+
edges: [
|
|
35
|
+
{ id: "edge1", sourceNodeId: "node1", targetNodeId: "node2", type: "polyline" }
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
this.quill.insertText(range.index, "\n", "user");
|
|
39
|
+
this.quill.insertEmbed(range.index + 1, "flow-chart", defaultData, "user");
|
|
40
|
+
this.quill.insertText(range.index + 2, "\n", "user");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.FlowChartModule = FlowChartModule;
|
|
45
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/modules/flow-chart/index.ts"],"sourcesContent":["import type Quill from 'quill'\nimport type { FlowChartOptions } from './options'\nimport Quills from 'quill'\nimport FlowChartPlaceholderBlot from './formats/flow-chart-blot'\n\nexport class FlowChartModule {\n quill: Quill\n toolbar: any\n options: FlowChartOptions\n\n static register() {\n Quills.register('formats/flow-chart', FlowChartPlaceholderBlot, true)\n }\n\n constructor(quill: Quill, options: any) {\n (quill.container as any).__quillInstance = quill\n this.quill = quill\n this.options = options\n this.toolbar = quill.getModule('toolbar')\n if (this.toolbar) {\n this.toolbar.addHandler('flow-chart', () => {\n this.insertFlowChartEditor()\n })\n }\n }\n\n public insertFlowChartEditor(): void {\n const range = this.quill.getSelection()\n if (range) {\n const defaultData = {\n nodes: [\n { id: 'node1', type: 'rect', x: 100, y: 150, text: '开始' },\n { id: 'node2', type: 'rect', x: 300, y: 150, text: '结束' },\n ],\n edges: [\n { id: 'edge1', sourceNodeId: 'node1', targetNodeId: 'node2', type: 'polyline' },\n ],\n }\n this.quill.insertText(range.index, '\\n', 'user')\n this.quill.insertEmbed(range.index + 1, 'flow-chart', defaultData, 'user')\n this.quill.insertText(range.index + 2, '\\n', 'user')\n }\n }\n}\n"],"names":["Quills","FlowChartPlaceholderBlot"],"mappings":";;;;;;;AAKO,MAAM,gBAAgB;AAAA,EAS3B,YAAY,OAAc,SAAc;AARxC;AACA;AACA;AAOG,UAAM,UAAkB,kBAAkB;AAC3C,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,UAAU,MAAM,UAAU,SAAS;AACxC,QAAI,KAAK,SAAS;AAChB,WAAK,QAAQ,WAAW,cAAc,MAAM;AAC1C,aAAK,sBAAA;AAAA,MACP,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAdA,OAAO,WAAW;AAChBA,UAAO,SAAS,sBAAsBC,cAAAA,SAA0B,IAAI;AAAA,EACtE;AAAA,EAcO,wBAA8B;AACnC,UAAM,QAAQ,KAAK,MAAM,aAAA;AACzB,QAAI,OAAO;AACT,YAAM,cAAc;AAAA,QAClB,OAAO;AAAA,UACL,EAAE,IAAI,SAAS,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,MAAM,KAAA;AAAA,UACnD,EAAE,IAAI,SAAS,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,MAAM,KAAA;AAAA,QAAK;AAAA,QAE1D,OAAO;AAAA,UACL,EAAE,IAAI,SAAS,cAAc,SAAS,cAAc,SAAS,MAAM,WAAA;AAAA,QAAW;AAAA,MAChF;AAEF,WAAK,MAAM,WAAW,MAAM,OAAO,MAAM,MAAM;AAC/C,WAAK,MAAM,YAAY,MAAM,QAAQ,GAAG,cAAc,aAAa,MAAM;AACzE,WAAK,MAAM,WAAW,MAAM,QAAQ,GAAG,MAAM,MAAM;AAAA,IACrD;AAAA,EACF;AACF;;"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
+
require("../../../config/index.cjs.js");
|
|
7
|
+
const i18n = require("../../i18n.cjs.js");
|
|
8
|
+
const index = require("../i18n/index.cjs.js");
|
|
9
|
+
const editor_config = require("../../../config/editor.config.cjs.js");
|
|
10
|
+
class FlowChartContextMenuHandler {
|
|
11
|
+
constructor(quill, blot) {
|
|
12
|
+
__publicField(this, "texts");
|
|
13
|
+
__publicField(this, "lang");
|
|
14
|
+
this.quill = quill;
|
|
15
|
+
this.blot = blot;
|
|
16
|
+
const i18nModule = this.quill.getModule("i18n");
|
|
17
|
+
index.registerFlowChartI18N(i18n.I18N);
|
|
18
|
+
this.lang = i18nModule.options.lang;
|
|
19
|
+
this.texts = this.resolveTexts();
|
|
20
|
+
this.quill.emitter.on(editor_config.CHANGE_LANGUAGE_EVENT, (lang) => {
|
|
21
|
+
this.lang = lang;
|
|
22
|
+
this.texts = this.resolveTexts();
|
|
23
|
+
this.updateContextMenuItems();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getText(key) {
|
|
27
|
+
return this.texts[key];
|
|
28
|
+
}
|
|
29
|
+
resolveTexts() {
|
|
30
|
+
return {
|
|
31
|
+
copy: i18n.I18N.parserText("flowChart.contextMenu.copy", this.lang),
|
|
32
|
+
cut: i18n.I18N.parserText("flowChart.contextMenu.cut", this.lang),
|
|
33
|
+
paste: i18n.I18N.parserText("flowChart.contextMenu.paste", this.lang),
|
|
34
|
+
deleteContent: i18n.I18N.parserText("flowChart.contextMenu.deleteContent", this.lang),
|
|
35
|
+
deleteNode: i18n.I18N.parserText("flowChart.contextMenu.deleteNode", this.lang),
|
|
36
|
+
deleteEdge: i18n.I18N.parserText("flowChart.contextMenu.deleteEdge", this.lang)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
updateContextMenuItems() {
|
|
40
|
+
if (!this.blot.contextMenu) return;
|
|
41
|
+
const menuItems = this.blot.contextMenu.querySelectorAll(".ql-flow-chart-context-menu-item");
|
|
42
|
+
if (menuItems.length > 0) {
|
|
43
|
+
Array.from(menuItems).forEach((item) => {
|
|
44
|
+
const text = item.getAttribute("data-text-key");
|
|
45
|
+
if (text && this.texts[text]) {
|
|
46
|
+
item.textContent = this.texts[text];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const contextMenuHandlers = /* @__PURE__ */ new WeakMap();
|
|
53
|
+
function initContextMenu(blot, quill) {
|
|
54
|
+
blot.contextMenu = document.createElement("div");
|
|
55
|
+
blot.contextMenu.className = "ql-flow-chart-context-menu";
|
|
56
|
+
blot.contextMenu.style.position = "fixed";
|
|
57
|
+
blot.contextMenu.style.background = "white";
|
|
58
|
+
blot.contextMenu.style.borderRadius = "4px";
|
|
59
|
+
blot.contextMenu.style.boxShadow = "0 2px 10px rgba(0,0,0,0.1)";
|
|
60
|
+
blot.contextMenu.style.padding = "5px 0";
|
|
61
|
+
blot.contextMenu.style.zIndex = "1000";
|
|
62
|
+
blot.contextMenu.style.display = "block";
|
|
63
|
+
blot.contextMenu.style.visibility = "visible";
|
|
64
|
+
blot.contextMenu.style.opacity = "1";
|
|
65
|
+
blot.contextMenu.style.width = "120px";
|
|
66
|
+
blot.contextMenu.style.height = "auto";
|
|
67
|
+
blot.domNode.appendChild(blot.contextMenu);
|
|
68
|
+
const handler = new FlowChartContextMenuHandler(quill, blot);
|
|
69
|
+
contextMenuHandlers.set(blot, handler);
|
|
70
|
+
if (blot.flowChart) {
|
|
71
|
+
blot.flowChart.on("node:contextmenu", (event) => {
|
|
72
|
+
const { data, e } = event;
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
blot.currentElement = { type: "node", data };
|
|
76
|
+
showNodeContextMenu(blot, handler, e.clientX, e.clientY);
|
|
77
|
+
});
|
|
78
|
+
blot.flowChart.on("edge:contextmenu", (event) => {
|
|
79
|
+
const { data, e } = event;
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
blot.currentElement = { type: "edge", data };
|
|
83
|
+
showEdgeContextMenu(blot, handler, e.clientX, e.clientY);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const hideMenu = () => {
|
|
87
|
+
if (blot.contextMenu) {
|
|
88
|
+
blot.contextMenu.style.display = "none";
|
|
89
|
+
blot.currentElement = null;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
blot.flowChart.on("blank:click", hideMenu);
|
|
93
|
+
document.addEventListener("click", (e) => {
|
|
94
|
+
if (blot.contextMenu && !blot.contextMenu.contains(e.target)) {
|
|
95
|
+
hideMenu();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function showNodeContextMenu(blot, handler, x, y) {
|
|
100
|
+
clearContextMenu(blot);
|
|
101
|
+
addContextMenuItem(blot, handler.getText("copy"), "copy", () => handleCopy(blot));
|
|
102
|
+
addContextMenuItem(blot, handler.getText("deleteContent"), "deleteContent", () => handleDeleteContent(blot));
|
|
103
|
+
addContextMenuItem(blot, handler.getText("deleteNode"), "deleteNode", () => handleDeleteNode(blot));
|
|
104
|
+
showContextMenu(blot, x, y);
|
|
105
|
+
}
|
|
106
|
+
function showEdgeContextMenu(blot, handler, x, y) {
|
|
107
|
+
clearContextMenu(blot);
|
|
108
|
+
addContextMenuItem(blot, handler.getText("deleteContent"), "deleteContent", () => handleDeleteContent(blot));
|
|
109
|
+
addContextMenuItem(blot, handler.getText("deleteEdge"), "deleteEdge", () => handleDeleteEdge(blot));
|
|
110
|
+
showContextMenu(blot, x, y);
|
|
111
|
+
}
|
|
112
|
+
function clearContextMenu(blot) {
|
|
113
|
+
if (blot.contextMenu) {
|
|
114
|
+
blot.contextMenu.innerHTML = "";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function showContextMenu(blot, x, y) {
|
|
118
|
+
if (blot.contextMenu) {
|
|
119
|
+
blot.contextMenu.style.display = "block";
|
|
120
|
+
blot.contextMenu.style.left = `${x}px`;
|
|
121
|
+
blot.contextMenu.style.top = `${y}px`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function addContextMenuItem(blot, text, textKey, onClick) {
|
|
125
|
+
const item = document.createElement("div");
|
|
126
|
+
item.className = "ql-flow-chart-context-menu-item";
|
|
127
|
+
item.textContent = text;
|
|
128
|
+
item.setAttribute("data-text-key", textKey);
|
|
129
|
+
item.style.padding = "5px 15px";
|
|
130
|
+
item.style.cursor = "pointer";
|
|
131
|
+
item.style.whiteSpace = "nowrap";
|
|
132
|
+
item.addEventListener("click", onClick);
|
|
133
|
+
item.addEventListener("mouseenter", () => {
|
|
134
|
+
item.style.background = "#f5f5f5";
|
|
135
|
+
});
|
|
136
|
+
item.addEventListener("mouseleave", () => {
|
|
137
|
+
item.style.background = "white";
|
|
138
|
+
});
|
|
139
|
+
blot.contextMenu.appendChild(item);
|
|
140
|
+
}
|
|
141
|
+
function handleCopy(blot) {
|
|
142
|
+
if (blot.currentElement && blot.currentElement.type === "node") {
|
|
143
|
+
const nodeId = blot.currentElement.data.id;
|
|
144
|
+
blot.flowChart.cloneNode(nodeId);
|
|
145
|
+
}
|
|
146
|
+
hideContextMenu(blot);
|
|
147
|
+
}
|
|
148
|
+
function handleDeleteContent(blot) {
|
|
149
|
+
if (blot.currentElement) {
|
|
150
|
+
if (blot.currentElement.type === "node") {
|
|
151
|
+
const node = blot.currentElement.data;
|
|
152
|
+
blot.flowChart.updateText(node.id, "");
|
|
153
|
+
} else if (blot.currentElement.type === "edge") {
|
|
154
|
+
const edge = blot.currentElement.data;
|
|
155
|
+
blot.flowChart.updateText(edge.id, "");
|
|
156
|
+
}
|
|
157
|
+
blot.data = blot.flowChart.getGraphData();
|
|
158
|
+
blot.domNode.setAttribute("data-flow-chart", JSON.stringify(blot.data));
|
|
159
|
+
}
|
|
160
|
+
hideContextMenu(blot);
|
|
161
|
+
}
|
|
162
|
+
function handleDeleteNode(blot) {
|
|
163
|
+
if (blot.currentElement && blot.currentElement.type === "node") {
|
|
164
|
+
blot.flowChart.deleteNode(blot.currentElement.data.id);
|
|
165
|
+
blot.data = blot.flowChart.getGraphData();
|
|
166
|
+
blot.domNode.setAttribute("data-flow-chart", JSON.stringify(blot.data));
|
|
167
|
+
}
|
|
168
|
+
hideContextMenu(blot);
|
|
169
|
+
}
|
|
170
|
+
function handleDeleteEdge(blot) {
|
|
171
|
+
if (blot.currentElement && blot.currentElement.type === "edge") {
|
|
172
|
+
blot.flowChart.deleteEdge(blot.currentElement.data.id);
|
|
173
|
+
blot.data = blot.flowChart.getGraphData();
|
|
174
|
+
blot.domNode.setAttribute("data-flow-chart", JSON.stringify(blot.data));
|
|
175
|
+
}
|
|
176
|
+
hideContextMenu(blot);
|
|
177
|
+
}
|
|
178
|
+
function hideContextMenu(blot) {
|
|
179
|
+
if (blot.contextMenu) {
|
|
180
|
+
blot.contextMenu.style.display = "none";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.initContextMenu = initContextMenu;
|
|
184
|
+
//# sourceMappingURL=context-menu.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.cjs.js","sources":["../../../../../src/modules/flow-chart/modules/context-menu.ts"],"sourcesContent":["import type FluentEditor from '../../../core/fluent-editor'\nimport type FlowChartPlaceholderBlot from '../formats/flow-chart-blot'\nimport { CHANGE_LANGUAGE_EVENT } from '../../../config'\nimport { I18N } from '../../../modules/i18n'\nimport { registerFlowChartI18N } from '../i18n/index'\n\nclass FlowChartContextMenuHandler {\n private texts: Record<string, string>\n private lang: string\n getText(key: keyof Record<string, string>): string {\n return this.texts[key]\n }\n\n constructor(private quill: FluentEditor, private blot: FlowChartPlaceholderBlot) {\n const i18nModule = this.quill.getModule('i18n') as I18N\n registerFlowChartI18N(I18N)\n this.lang = i18nModule.options.lang\n this.texts = this.resolveTexts()\n this.quill.emitter.on(CHANGE_LANGUAGE_EVENT, (lang: string) => {\n this.lang = lang\n this.texts = this.resolveTexts()\n this.updateContextMenuItems()\n })\n }\n\n resolveTexts() {\n return {\n copy: I18N.parserText('flowChart.contextMenu.copy', this.lang),\n cut: I18N.parserText('flowChart.contextMenu.cut', this.lang),\n paste: I18N.parserText('flowChart.contextMenu.paste', this.lang),\n deleteContent: I18N.parserText('flowChart.contextMenu.deleteContent', this.lang),\n deleteNode: I18N.parserText('flowChart.contextMenu.deleteNode', this.lang),\n deleteEdge: I18N.parserText('flowChart.contextMenu.deleteEdge', this.lang),\n }\n }\n\n updateContextMenuItems() {\n if (!this.blot.contextMenu) return\n\n const menuItems = this.blot.contextMenu.querySelectorAll('.ql-flow-chart-context-menu-item')\n if (menuItems.length > 0) {\n Array.from(menuItems).forEach((item) => {\n const text = item.getAttribute('data-text-key')\n if (text && this.texts[text as keyof Record<string, string>]) {\n item.textContent = this.texts[text as keyof Record<string, string>]\n }\n })\n }\n }\n}\n\nconst contextMenuHandlers = new WeakMap<FlowChartPlaceholderBlot, FlowChartContextMenuHandler>()\n\nexport function initContextMenu(blot: FlowChartPlaceholderBlot, quill: FluentEditor): void {\n blot.contextMenu = document.createElement('div')\n blot.contextMenu.className = 'ql-flow-chart-context-menu'\n blot.contextMenu.style.position = 'fixed'\n blot.contextMenu.style.background = 'white'\n blot.contextMenu.style.borderRadius = '4px'\n blot.contextMenu.style.boxShadow = '0 2px 10px rgba(0,0,0,0.1)'\n blot.contextMenu.style.padding = '5px 0'\n blot.contextMenu.style.zIndex = '1000'\n blot.contextMenu.style.display = 'block'\n blot.contextMenu.style.visibility = 'visible'\n blot.contextMenu.style.opacity = '1'\n blot.contextMenu.style.width = '120px'\n blot.contextMenu.style.height = 'auto'\n blot.domNode.appendChild(blot.contextMenu)\n\n const handler = new FlowChartContextMenuHandler(quill, blot)\n contextMenuHandlers.set(blot, handler)\n\n if (blot.flowChart) {\n blot.flowChart.on('node:contextmenu', (event: any) => {\n const { data, e } = event\n e.preventDefault()\n e.stopPropagation()\n blot.currentElement = { type: 'node', data }\n showNodeContextMenu(blot, handler, e.clientX, e.clientY)\n })\n\n blot.flowChart.on('edge:contextmenu', (event: any) => {\n const { data, e } = event\n e.preventDefault()\n e.stopPropagation()\n blot.currentElement = { type: 'edge', data }\n showEdgeContextMenu(blot, handler, e.clientX, e.clientY)\n })\n }\n\n const hideMenu = () => {\n if (blot.contextMenu) {\n blot.contextMenu.style.display = 'none'\n blot.currentElement = null\n }\n }\n\n blot.flowChart.on('blank:click', hideMenu)\n document.addEventListener('click', (e) => {\n if (blot.contextMenu && !blot.contextMenu.contains(e.target as Node)) {\n hideMenu()\n }\n })\n}\n\nfunction showNodeContextMenu(blot: FlowChartPlaceholderBlot, handler: FlowChartContextMenuHandler, x: number, y: number): void {\n clearContextMenu(blot)\n\n addContextMenuItem(blot, handler.getText('copy'), 'copy', () => handleCopy(blot))\n addContextMenuItem(blot, handler.getText('deleteContent'), 'deleteContent', () => handleDeleteContent(blot))\n addContextMenuItem(blot, handler.getText('deleteNode'), 'deleteNode', () => handleDeleteNode(blot))\n\n showContextMenu(blot, x, y)\n}\n\nfunction showEdgeContextMenu(blot: FlowChartPlaceholderBlot, handler: FlowChartContextMenuHandler, x: number, y: number): void {\n clearContextMenu(blot)\n\n addContextMenuItem(blot, handler.getText('deleteContent'), 'deleteContent', () => handleDeleteContent(blot))\n addContextMenuItem(blot, handler.getText('deleteEdge'), 'deleteEdge', () => handleDeleteEdge(blot))\n\n showContextMenu(blot, x, y)\n}\n\nfunction clearContextMenu(blot: FlowChartPlaceholderBlot): void {\n if (blot.contextMenu) {\n blot.contextMenu.innerHTML = ''\n }\n}\n\nfunction showContextMenu(blot: FlowChartPlaceholderBlot, x: number, y: number): void {\n if (blot.contextMenu) {\n blot.contextMenu.style.display = 'block'\n blot.contextMenu.style.left = `${x}px`\n blot.contextMenu.style.top = `${y}px`\n }\n}\n\nfunction addContextMenuItem(blot: FlowChartPlaceholderBlot, text: string, textKey: string, onClick: () => void): void {\n const item = document.createElement('div')\n item.className = 'ql-flow-chart-context-menu-item'\n item.textContent = text\n item.setAttribute('data-text-key', textKey)\n item.style.padding = '5px 15px'\n item.style.cursor = 'pointer'\n item.style.whiteSpace = 'nowrap'\n item.addEventListener('click', onClick)\n item.addEventListener('mouseenter', () => {\n item.style.background = '#f5f5f5'\n })\n item.addEventListener('mouseleave', () => {\n item.style.background = 'white'\n })\n blot.contextMenu!.appendChild(item)\n}\n\nfunction handleCopy(blot: FlowChartPlaceholderBlot): void {\n if (blot.currentElement && blot.currentElement.type === 'node') {\n const nodeId = blot.currentElement.data.id\n blot.flowChart.cloneNode(nodeId)\n }\n hideContextMenu(blot)\n}\n\nfunction handleDeleteContent(blot: FlowChartPlaceholderBlot): void {\n if (blot.currentElement) {\n if (blot.currentElement.type === 'node') {\n const node = blot.currentElement.data\n blot.flowChart.updateText(node.id, '')\n }\n else if (blot.currentElement.type === 'edge') {\n const edge = blot.currentElement.data\n blot.flowChart.updateText(edge.id, '')\n }\n blot.data = blot.flowChart.getGraphData()\n blot.domNode.setAttribute('data-flow-chart', JSON.stringify(blot.data))\n }\n hideContextMenu(blot)\n}\n\nfunction handleDeleteNode(blot: FlowChartPlaceholderBlot): void {\n if (blot.currentElement && blot.currentElement.type === 'node') {\n blot.flowChart.deleteNode(blot.currentElement.data.id)\n blot.data = blot.flowChart.getGraphData()\n blot.domNode.setAttribute('data-flow-chart', JSON.stringify(blot.data))\n }\n hideContextMenu(blot)\n}\n\nfunction handleDeleteEdge(blot: FlowChartPlaceholderBlot): void {\n if (blot.currentElement && blot.currentElement.type === 'edge') {\n blot.flowChart.deleteEdge(blot.currentElement.data.id)\n blot.data = blot.flowChart.getGraphData()\n blot.domNode.setAttribute('data-flow-chart', JSON.stringify(blot.data))\n }\n hideContextMenu(blot)\n}\n\nfunction hideContextMenu(blot: FlowChartPlaceholderBlot): void {\n if (blot.contextMenu) {\n blot.contextMenu.style.display = 'none'\n }\n}\n"],"names":["registerFlowChartI18N","I18N","CHANGE_LANGUAGE_EVENT"],"mappings":"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"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
+
require("../../../config/index.cjs.js");
|
|
7
|
+
const i18n = require("../../i18n.cjs.js");
|
|
8
|
+
const index = require("../i18n/index.cjs.js");
|
|
9
|
+
const icons = require("../icons.cjs.js");
|
|
10
|
+
const editor_config = require("../../../config/editor.config.cjs.js");
|
|
11
|
+
class FlowChartControlPanelHandler {
|
|
12
|
+
constructor(quill, blot) {
|
|
13
|
+
__publicField(this, "texts");
|
|
14
|
+
__publicField(this, "lang");
|
|
15
|
+
this.quill = quill;
|
|
16
|
+
this.blot = blot;
|
|
17
|
+
const i18nModule = this.quill.getModule("i18n");
|
|
18
|
+
index.registerFlowChartI18N(i18n.I18N);
|
|
19
|
+
this.lang = i18nModule.options.lang;
|
|
20
|
+
this.texts = this.resolveTexts();
|
|
21
|
+
this.quill.emitter.on(editor_config.CHANGE_LANGUAGE_EVENT, (lang) => {
|
|
22
|
+
this.lang = lang;
|
|
23
|
+
this.texts = this.resolveTexts();
|
|
24
|
+
this.updateControlPanelTexts();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
getText(key) {
|
|
28
|
+
return this.texts[key];
|
|
29
|
+
}
|
|
30
|
+
resolveTexts() {
|
|
31
|
+
return {
|
|
32
|
+
exportTitle: i18n.I18N.parserText("flowChart.controlPanel.exportTitle", this.lang),
|
|
33
|
+
zoomOutTitle: i18n.I18N.parserText("flowChart.controlPanel.zoomOutTitle", this.lang),
|
|
34
|
+
zoomInTitle: i18n.I18N.parserText("flowChart.controlPanel.zoomInTitle", this.lang),
|
|
35
|
+
fitTitle: i18n.I18N.parserText("flowChart.controlPanel.fitTitle", this.lang),
|
|
36
|
+
backTitle: i18n.I18N.parserText("flowChart.controlPanel.backTitle", this.lang),
|
|
37
|
+
forwardTitle: i18n.I18N.parserText("flowChart.controlPanel.forwardTitle", this.lang),
|
|
38
|
+
setEdgeTypeTitle: i18n.I18N.parserText("flowChart.controlPanel.setEdgeTypeTitle", this.lang),
|
|
39
|
+
panelStatusTitle: i18n.I18N.parserText("flowChart.controlPanel.panelStatusTitle", this.lang),
|
|
40
|
+
screenTypeTitle: i18n.I18N.parserText("flowChart.controlPanel.screenTypeTitle", this.lang)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
updateControlPanelTexts() {
|
|
44
|
+
const controlItems = this.blot.domNode.querySelectorAll(".ql-flow-chart-control-item");
|
|
45
|
+
const controlItemMap = {
|
|
46
|
+
"zoom-out": "zoomOutTitle",
|
|
47
|
+
"zoom-in": "zoomInTitle",
|
|
48
|
+
"fit": "fitTitle",
|
|
49
|
+
"back": "backTitle",
|
|
50
|
+
"forward": "forwardTitle",
|
|
51
|
+
"set-edge-type": "setEdgeTypeTitle",
|
|
52
|
+
"panel-status": "panelStatusTitle",
|
|
53
|
+
"screen-type": "screenTypeTitle"
|
|
54
|
+
};
|
|
55
|
+
controlItems.forEach((item) => {
|
|
56
|
+
const controlType = item.dataset.controlType;
|
|
57
|
+
if (controlType && controlItemMap[controlType] && this.texts[controlItemMap[controlType]]) {
|
|
58
|
+
item.title = this.texts[controlItemMap[controlType]];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const controlPanelHandlers = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
const DISABLED_OPACITY = "0.5";
|
|
65
|
+
const ENABLED_OPACITY = "1";
|
|
66
|
+
function createControlPanel(blot, quill) {
|
|
67
|
+
const controlPanel = document.createElement("div");
|
|
68
|
+
controlPanel.className = "ql-flow-chart-control";
|
|
69
|
+
const controlRightUpPanel = document.createElement("div");
|
|
70
|
+
controlRightUpPanel.className = "ql-flow-chart-right-up-control";
|
|
71
|
+
const handler = new FlowChartControlPanelHandler(quill, blot);
|
|
72
|
+
controlPanelHandlers.set(blot, handler);
|
|
73
|
+
const zoomOutBtn = createControlItem("zoom-out", handler.getText("zoomOutTitle"), () => handleZoomOut(blot));
|
|
74
|
+
const zoomInBtn = createControlItem("zoom-in", handler.getText("zoomInTitle"), () => handleZoomIn(blot));
|
|
75
|
+
const resetBtn = createControlItem("fit", handler.getText("fitTitle"), () => handleResetZoom(blot));
|
|
76
|
+
const backBtn = createControlItem("back", handler.getText("backTitle"), () => handleUndo(blot));
|
|
77
|
+
const forwardBtn = createControlItem("forward", handler.getText("forwardTitle"), () => handleRedo(blot));
|
|
78
|
+
const setEdgeTypeBtn = createControlItem("set-edge-type", handler.getText("setEdgeTypeTitle"), () => handleSetEdgeType(blot));
|
|
79
|
+
const panelStatusBtn = createControlItem("panel-status", handler.getText("panelStatusTitle"));
|
|
80
|
+
const screenTypeBtn = createControlItem("screen-type", handler.getText("screenTypeTitle"), () => handleScreenTypeBtn(blot));
|
|
81
|
+
const updateButtonState = (historyData) => {
|
|
82
|
+
if (!historyData.data) {
|
|
83
|
+
backBtn.style.opacity = DISABLED_OPACITY;
|
|
84
|
+
backBtn.style.cursor = "not-allowed";
|
|
85
|
+
forwardBtn.style.opacity = DISABLED_OPACITY;
|
|
86
|
+
forwardBtn.style.cursor = "not-allowed";
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const isUndoAvailable = historyData.data.undoAble || historyData.data.undos.length < 0;
|
|
90
|
+
const isRedoAvailable = historyData.data.redoAble || historyData.data.redos.length > 0;
|
|
91
|
+
if (backBtn) {
|
|
92
|
+
backBtn.style.opacity = isUndoAvailable ? ENABLED_OPACITY : DISABLED_OPACITY;
|
|
93
|
+
backBtn.style.cursor = isUndoAvailable ? "pointer" : "not-allowed";
|
|
94
|
+
}
|
|
95
|
+
if (forwardBtn) {
|
|
96
|
+
forwardBtn.style.opacity = isRedoAvailable ? ENABLED_OPACITY : DISABLED_OPACITY;
|
|
97
|
+
forwardBtn.style.cursor = isRedoAvailable ? "pointer" : "not-allowed";
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
updateButtonState(blot.flowChart.history);
|
|
101
|
+
blot.flowChart.on("history:change", (data) => {
|
|
102
|
+
updateButtonState(data);
|
|
103
|
+
});
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
const controlLeftUpPanel = blot.domNode.querySelector(".lf-dndpanel");
|
|
106
|
+
controlLeftUpPanel.append(setEdgeTypeBtn);
|
|
107
|
+
}, 0);
|
|
108
|
+
controlRightUpPanel.append(panelStatusBtn);
|
|
109
|
+
blot.domNode.appendChild(controlRightUpPanel);
|
|
110
|
+
controlPanel.append(zoomOutBtn, zoomInBtn, resetBtn, screenTypeBtn, backBtn, forwardBtn);
|
|
111
|
+
blot.domNode.appendChild(controlPanel);
|
|
112
|
+
}
|
|
113
|
+
function handleUndo(blot) {
|
|
114
|
+
if (blot.flowChart) {
|
|
115
|
+
blot.flowChart.undo();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function handleRedo(blot) {
|
|
119
|
+
if (blot.flowChart) {
|
|
120
|
+
blot.flowChart.redo();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function handleZoomIn(blot) {
|
|
124
|
+
if (blot.flowChart) {
|
|
125
|
+
blot.flowChart.zoom(true);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function handleZoomOut(blot) {
|
|
129
|
+
if (blot.flowChart) {
|
|
130
|
+
blot.flowChart.zoom(false);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function handleResetZoom(blot) {
|
|
134
|
+
if (blot.flowChart) {
|
|
135
|
+
blot.flowChart.resetZoom();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function createControlItem(iconClass, title, onClick, disabled = false) {
|
|
139
|
+
const controlItem = document.createElement("div");
|
|
140
|
+
controlItem.className = "ql-flow-chart-control-item";
|
|
141
|
+
controlItem.title = title;
|
|
142
|
+
controlItem.dataset.controlType = iconClass;
|
|
143
|
+
controlItem.style.cursor = disabled ? "not-allowed" : "pointer";
|
|
144
|
+
const iconMap = {
|
|
145
|
+
"back": icons.backIcon,
|
|
146
|
+
"forward": icons.forwardIcon,
|
|
147
|
+
"zoom-out": icons.zoomOutIcon,
|
|
148
|
+
"zoom-in": icons.zoomInIcon,
|
|
149
|
+
"fit": icons.fitIcon,
|
|
150
|
+
"screen-type": icons.screenTypeIcon,
|
|
151
|
+
"panel-status": icons.contractIcon,
|
|
152
|
+
"set-edge-type": icons.lineIcon
|
|
153
|
+
};
|
|
154
|
+
const icon = document.createElement("i");
|
|
155
|
+
icon.innerHTML = iconMap[iconClass] || "";
|
|
156
|
+
controlItem.appendChild(icon);
|
|
157
|
+
if (!disabled) {
|
|
158
|
+
controlItem.addEventListener("click", onClick);
|
|
159
|
+
}
|
|
160
|
+
return controlItem;
|
|
161
|
+
}
|
|
162
|
+
function handleSetEdgeType(blot) {
|
|
163
|
+
const controlLeftUpPanel = blot.domNode.querySelector(".lf-dndpanel");
|
|
164
|
+
if (!controlLeftUpPanel) return;
|
|
165
|
+
let edgeTypePanel = controlLeftUpPanel.querySelector(".ql-flow-chart-edge-panel");
|
|
166
|
+
if (!edgeTypePanel) {
|
|
167
|
+
edgeTypePanel = document.createElement("div");
|
|
168
|
+
edgeTypePanel.className = "ql-flow-chart-edge-panel";
|
|
169
|
+
edgeTypePanel.style.display = "flex";
|
|
170
|
+
edgeTypePanel.style.justifyContent = "space-around";
|
|
171
|
+
edgeTypePanel.style.flexWrap = "nowrap";
|
|
172
|
+
edgeTypePanel.style.width = "auto";
|
|
173
|
+
edgeTypePanel.style.minWidth = "100%";
|
|
174
|
+
edgeTypePanel.style.padding = "8px";
|
|
175
|
+
edgeTypePanel.style.boxSizing = "border-box";
|
|
176
|
+
edgeTypePanel.style.position = "absolute";
|
|
177
|
+
edgeTypePanel.style.top = "170px";
|
|
178
|
+
controlLeftUpPanel.appendChild(edgeTypePanel);
|
|
179
|
+
const edgeTypes = [
|
|
180
|
+
{
|
|
181
|
+
name: "line",
|
|
182
|
+
displayName: "直线",
|
|
183
|
+
icon: icons.lineIcon
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "polyline",
|
|
187
|
+
displayName: "折线",
|
|
188
|
+
icon: icons.polyLineIcon
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "bezier",
|
|
192
|
+
displayName: "贝塞尔曲线",
|
|
193
|
+
icon: icons.bezierIcon
|
|
194
|
+
}
|
|
195
|
+
];
|
|
196
|
+
edgeTypes.forEach((edgeType) => {
|
|
197
|
+
const edgeItem = document.createElement("div");
|
|
198
|
+
edgeItem.className = "ql-flow-chart-edge-item";
|
|
199
|
+
edgeItem.style.padding = "8px";
|
|
200
|
+
edgeItem.style.cursor = "pointer";
|
|
201
|
+
edgeItem.style.textAlign = "center";
|
|
202
|
+
const edgeIcon = document.createElement("div");
|
|
203
|
+
edgeIcon.className = `ql-flow-chart-edge-type-icon`;
|
|
204
|
+
edgeIcon.style.width = "24px";
|
|
205
|
+
edgeIcon.style.height = "24px";
|
|
206
|
+
edgeIcon.style.margin = "0 auto";
|
|
207
|
+
if (edgeType.icon) {
|
|
208
|
+
edgeIcon.innerHTML = edgeType.icon;
|
|
209
|
+
}
|
|
210
|
+
edgeItem.appendChild(edgeIcon);
|
|
211
|
+
edgeItem.addEventListener("click", () => {
|
|
212
|
+
const { edges = [] } = blot.flowChart.getSelectElements();
|
|
213
|
+
if (edges.length > 0) {
|
|
214
|
+
edges.forEach((edge) => {
|
|
215
|
+
blot.flowChart.changeEdgeType(edge.id, edgeType.name);
|
|
216
|
+
});
|
|
217
|
+
blot.data = blot.flowChart.getGraphData();
|
|
218
|
+
blot.domNode.setAttribute("data-flow-chart", JSON.stringify(blot.data));
|
|
219
|
+
}
|
|
220
|
+
edgeTypePanel.style.display = "none";
|
|
221
|
+
});
|
|
222
|
+
edgeTypePanel.appendChild(edgeItem);
|
|
223
|
+
});
|
|
224
|
+
} else {
|
|
225
|
+
edgeTypePanel.style.display = "flex";
|
|
226
|
+
edgeTypePanel.style.justifyContent = "space-around";
|
|
227
|
+
edgeTypePanel.style.flexWrap = "nowrap";
|
|
228
|
+
}
|
|
229
|
+
const handleOutsideClick = (e) => {
|
|
230
|
+
let setEdgeTypeBtn = null;
|
|
231
|
+
const controlItems = controlLeftUpPanel.querySelectorAll(".ql-flow-chart-control-item");
|
|
232
|
+
controlItems.forEach((item) => {
|
|
233
|
+
const iconEl = item.querySelector("i");
|
|
234
|
+
if (iconEl && iconEl.className.includes("set-edge-type")) {
|
|
235
|
+
setEdgeTypeBtn = item;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
if (!edgeTypePanel.contains(e.target) && (!setEdgeTypeBtn || !setEdgeTypeBtn.contains(e.target))) {
|
|
239
|
+
edgeTypePanel.style.display = "none";
|
|
240
|
+
document.removeEventListener("click", handleOutsideClick);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
document.removeEventListener("click", handleOutsideClick);
|
|
244
|
+
setTimeout(() => {
|
|
245
|
+
document.addEventListener("click", handleOutsideClick);
|
|
246
|
+
}, 0);
|
|
247
|
+
}
|
|
248
|
+
function handleScreenTypeBtn(blot) {
|
|
249
|
+
const screenTypeBtn = blot.domNode.querySelector('[data-control-type="screen-type"]');
|
|
250
|
+
if (!screenTypeBtn || !blot.domNode) return;
|
|
251
|
+
const flowChartContainer = blot.domNode;
|
|
252
|
+
const isFullscreen = flowChartContainer.style.position === "fixed";
|
|
253
|
+
if (isFullscreen) {
|
|
254
|
+
const originalPosition = flowChartContainer.getAttribute("data-original-position");
|
|
255
|
+
const originalWidth = flowChartContainer.getAttribute("data-original-width");
|
|
256
|
+
const originalHeight = flowChartContainer.getAttribute("data-original-height");
|
|
257
|
+
if (originalWidth && originalHeight) {
|
|
258
|
+
flowChartContainer.style.position = originalPosition;
|
|
259
|
+
flowChartContainer.style.width = originalWidth;
|
|
260
|
+
flowChartContainer.style.height = originalHeight;
|
|
261
|
+
flowChartContainer.style.zIndex = "0";
|
|
262
|
+
}
|
|
263
|
+
const iconElement = screenTypeBtn.querySelector("i");
|
|
264
|
+
if (iconElement) {
|
|
265
|
+
iconElement.innerHTML = icons.screenTypeIcon;
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
flowChartContainer.setAttribute("data-original-position", flowChartContainer.style.position || "");
|
|
269
|
+
flowChartContainer.setAttribute("data-original-width", flowChartContainer.style.width || "");
|
|
270
|
+
flowChartContainer.setAttribute("data-original-height", flowChartContainer.style.height || "");
|
|
271
|
+
flowChartContainer.style.position = "fixed";
|
|
272
|
+
flowChartContainer.style.top = "0";
|
|
273
|
+
flowChartContainer.style.left = "0";
|
|
274
|
+
flowChartContainer.style.width = "100vw";
|
|
275
|
+
flowChartContainer.style.height = "100vh";
|
|
276
|
+
flowChartContainer.style.zIndex = "100";
|
|
277
|
+
const iconElement = screenTypeBtn.querySelector("i");
|
|
278
|
+
if (iconElement) {
|
|
279
|
+
iconElement.innerHTML = icons.screenReduceIcon;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
blot.flowChart.resize();
|
|
283
|
+
blot.flowChart.translateCenter();
|
|
284
|
+
}
|
|
285
|
+
exports.createControlPanel = createControlPanel;
|
|
286
|
+
//# sourceMappingURL=control-panel.cjs.js.map
|