@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.
Files changed (259) hide show
  1. package/es/config/editor.utils.es.js.map +1 -1
  2. package/es/config/i18n/en-us.es.js +2 -0
  3. package/es/config/i18n/en-us.es.js.map +1 -1
  4. package/es/config/i18n/zh-cn.es.js +2 -0
  5. package/es/config/i18n/zh-cn.es.js.map +1 -1
  6. package/es/config/index.es.js.map +1 -1
  7. package/es/core/fluent-editor.es.js.map +1 -1
  8. package/es/fluent-editor.es.js +17 -13
  9. package/es/fluent-editor.es.js.map +1 -1
  10. package/es/formats/soft-break.es.js.map +1 -1
  11. package/es/formats/video.es.js.map +1 -1
  12. package/es/index.es.js +4 -0
  13. package/es/index.es.js.map +1 -1
  14. package/es/modules/ai/constants.es.js.map +1 -1
  15. package/es/modules/ai/index.es.js +1 -1
  16. package/es/modules/ai/index.es.js.map +1 -1
  17. package/es/modules/collaborative-editing/awareness/awareness.es.js.map +1 -1
  18. package/es/modules/collaborative-editing/awareness/y-indexeddb.es.js.map +1 -1
  19. package/es/modules/collaborative-editing/collaborative-editing.es.js.map +1 -1
  20. package/es/modules/collaborative-editing/module.es.js.map +1 -1
  21. package/es/modules/collaborative-editing/provider/providerRegistry.es.js.map +1 -1
  22. package/es/modules/collaborative-editing/provider/webrtc.es.js.map +1 -1
  23. package/es/modules/collaborative-editing/provider/websocket.es.js.map +1 -1
  24. package/es/modules/counter.es.js.map +1 -1
  25. package/es/modules/custom-clipboard.es.js.map +1 -1
  26. package/es/modules/custom-image/actions/action.es.js.map +1 -1
  27. package/es/modules/custom-image/actions/custom-resize-action.es.js.map +1 -1
  28. package/es/modules/custom-image/actions/delete-action.es.js.map +1 -1
  29. package/es/modules/custom-image/actions/image-toolbar-buttons.es.js +1 -1
  30. package/es/modules/custom-image/actions/image-toolbar-buttons.es.js.map +1 -1
  31. package/es/modules/custom-image/actions/toolbar-action.es.js.map +1 -1
  32. package/es/modules/custom-image/actions/toolbar.es.js.map +1 -1
  33. package/es/modules/custom-image/blot-formatter.es.js.map +1 -1
  34. package/es/modules/custom-image/image.es.js.map +1 -1
  35. package/es/modules/custom-image/options.es.js.map +1 -1
  36. package/es/modules/custom-image/specs/blot-spec.es.js.map +1 -1
  37. package/es/modules/custom-image/specs/custom-image-spec.es.js.map +1 -1
  38. package/es/modules/custom-image/specs/image-spec.es.js.map +1 -1
  39. package/es/modules/custom-uploader.es.js.map +1 -1
  40. package/es/modules/divider.es.js.map +1 -1
  41. package/es/modules/emoji.es.js.map +1 -1
  42. package/es/modules/file/formats/file.es.js.map +1 -1
  43. package/es/modules/file/modules/file-bar.es.js.map +1 -1
  44. package/es/modules/file/modules/file-module.es.js.map +1 -1
  45. package/es/modules/flow-chart/config-utils.es.js +102 -0
  46. package/es/modules/flow-chart/config-utils.es.js.map +1 -0
  47. package/es/modules/flow-chart/formats/flow-chart-blot.es.js +369 -0
  48. package/es/modules/flow-chart/formats/flow-chart-blot.es.js.map +1 -0
  49. package/es/modules/flow-chart/i18n/en-us.es.js +30 -0
  50. package/es/modules/flow-chart/i18n/en-us.es.js.map +1 -0
  51. package/es/modules/flow-chart/i18n/index.es.js +12 -0
  52. package/es/modules/flow-chart/i18n/index.es.js.map +1 -0
  53. package/es/modules/flow-chart/i18n/zh-cn.es.js +30 -0
  54. package/es/modules/flow-chart/i18n/zh-cn.es.js.map +1 -0
  55. package/es/modules/flow-chart/icons.es.js +27 -0
  56. package/es/modules/flow-chart/icons.es.js.map +1 -0
  57. package/es/modules/flow-chart/index.es.js +45 -0
  58. package/es/modules/flow-chart/index.es.js.map +1 -0
  59. package/es/modules/flow-chart/modules/context-menu.es.js +184 -0
  60. package/es/modules/flow-chart/modules/context-menu.es.js.map +1 -0
  61. package/es/modules/flow-chart/modules/control-panel.es.js +286 -0
  62. package/es/modules/flow-chart/modules/control-panel.es.js.map +1 -0
  63. package/es/modules/flow-chart/modules/custom-resize-action.es.js +150 -0
  64. package/es/modules/flow-chart/modules/custom-resize-action.es.js.map +1 -0
  65. package/es/modules/flow-chart/style/flow-chart.css +185 -0
  66. package/es/modules/i18n.es.js.map +1 -1
  67. package/es/modules/index.es.js +4 -0
  68. package/es/modules/index.es.js.map +1 -1
  69. package/es/modules/link/formats/link.es.js.map +1 -1
  70. package/es/modules/link/modules/tooltip.es.js.map +1 -1
  71. package/es/modules/mathlive/formats.es.js.map +1 -1
  72. package/es/modules/mathlive/module.es.js.map +1 -1
  73. package/es/modules/mathlive/tooltip.es.js.map +1 -1
  74. package/es/modules/mention/mention-link.es.js.map +1 -1
  75. package/es/modules/mention/mention.es.js.map +1 -1
  76. package/es/modules/mind-map/config-utils.es.js +108 -0
  77. package/es/modules/mind-map/config-utils.es.js.map +1 -0
  78. package/es/modules/mind-map/formats/mind-map-blot.es.js +356 -0
  79. package/es/modules/mind-map/formats/mind-map-blot.es.js.map +1 -0
  80. package/es/modules/mind-map/i18n/en-us.es.js +29 -0
  81. package/es/modules/mind-map/i18n/en-us.es.js.map +1 -0
  82. package/es/modules/mind-map/i18n/index.es.js +12 -0
  83. package/es/modules/mind-map/i18n/index.es.js.map +1 -0
  84. package/es/modules/mind-map/i18n/zh-cn.es.js +29 -0
  85. package/es/modules/mind-map/i18n/zh-cn.es.js.map +1 -0
  86. package/es/modules/mind-map/icons.es.js +45 -0
  87. package/es/modules/mind-map/icons.es.js.map +1 -0
  88. package/es/modules/mind-map/index.es.js +56 -0
  89. package/es/modules/mind-map/index.es.js.map +1 -0
  90. package/es/modules/mind-map/modules/context-menu.es.js +128 -0
  91. package/es/modules/mind-map/modules/context-menu.es.js.map +1 -0
  92. package/es/modules/mind-map/modules/control-panel.es.js +424 -0
  93. package/es/modules/mind-map/modules/control-panel.es.js.map +1 -0
  94. package/es/modules/mind-map/modules/custom-resize-action.es.js +161 -0
  95. package/es/modules/mind-map/modules/custom-resize-action.es.js.map +1 -0
  96. package/es/modules/mind-map/style/mind-map.css +224 -0
  97. package/es/modules/shortcut-key/index.es.js +16 -0
  98. package/es/modules/shortcut-key/index.es.js.map +1 -1
  99. package/es/modules/syntax.es.js.map +1 -1
  100. package/es/modules/table-up/index.es.js.map +1 -1
  101. package/es/modules/toolbar/better-picker.es.js.map +1 -1
  102. package/es/modules/toolbar/better-toolbar.es.js.map +1 -1
  103. package/es/modules/toolbar/toolbar-tip.es.js.map +1 -1
  104. package/es/themes/snow.es.js.map +1 -1
  105. package/es/tools/format-painter.es.js.map +1 -1
  106. package/es/tools/fullscreen.es.js.map +1 -1
  107. package/es/tools/screenshot.es.js.map +1 -1
  108. package/es/ui/icons.config.es.js +4 -0
  109. package/es/ui/icons.config.es.js.map +1 -1
  110. package/es/ui/icons.es.js +4 -2
  111. package/es/ui/icons.es.js.map +1 -1
  112. package/es/utils/debounce.es.js.map +1 -1
  113. package/es/utils/image.es.js.map +1 -1
  114. package/es/utils/is.es.js.map +1 -1
  115. package/es/utils/method.es.js.map +1 -1
  116. package/es/utils/scroll-lock.es.js.map +1 -1
  117. package/lib/config/editor.utils.cjs.js.map +1 -1
  118. package/lib/config/i18n/en-us.cjs.js +2 -0
  119. package/lib/config/i18n/en-us.cjs.js.map +1 -1
  120. package/lib/config/i18n/zh-cn.cjs.js +2 -0
  121. package/lib/config/i18n/zh-cn.cjs.js.map +1 -1
  122. package/lib/config/index.cjs.js.map +1 -1
  123. package/lib/core/fluent-editor.cjs.js.map +1 -1
  124. package/lib/fluent-editor.cjs.js +23 -19
  125. package/lib/fluent-editor.cjs.js.map +1 -1
  126. package/lib/formats/soft-break.cjs.js.map +1 -1
  127. package/lib/formats/video.cjs.js.map +1 -1
  128. package/lib/index.cjs.js +9 -5
  129. package/lib/index.cjs.js.map +1 -1
  130. package/lib/modules/ai/constants.cjs.js.map +1 -1
  131. package/lib/modules/ai/index.cjs.js.map +1 -1
  132. package/lib/modules/collaborative-editing/awareness/awareness.cjs.js.map +1 -1
  133. package/lib/modules/collaborative-editing/awareness/y-indexeddb.cjs.js.map +1 -1
  134. package/lib/modules/collaborative-editing/collaborative-editing.cjs.js.map +1 -1
  135. package/lib/modules/collaborative-editing/module.cjs.js.map +1 -1
  136. package/lib/modules/collaborative-editing/provider/providerRegistry.cjs.js.map +1 -1
  137. package/lib/modules/collaborative-editing/provider/webrtc.cjs.js.map +1 -1
  138. package/lib/modules/collaborative-editing/provider/websocket.cjs.js.map +1 -1
  139. package/lib/modules/counter.cjs.js.map +1 -1
  140. package/lib/modules/custom-clipboard.cjs.js.map +1 -1
  141. package/lib/modules/custom-image/actions/action.cjs.js.map +1 -1
  142. package/lib/modules/custom-image/actions/custom-resize-action.cjs.js.map +1 -1
  143. package/lib/modules/custom-image/actions/delete-action.cjs.js.map +1 -1
  144. package/lib/modules/custom-image/actions/image-toolbar-buttons.cjs.js.map +1 -1
  145. package/lib/modules/custom-image/actions/toolbar-action.cjs.js.map +1 -1
  146. package/lib/modules/custom-image/actions/toolbar.cjs.js.map +1 -1
  147. package/lib/modules/custom-image/blot-formatter.cjs.js.map +1 -1
  148. package/lib/modules/custom-image/image.cjs.js.map +1 -1
  149. package/lib/modules/custom-image/options.cjs.js.map +1 -1
  150. package/lib/modules/custom-image/specs/blot-spec.cjs.js.map +1 -1
  151. package/lib/modules/custom-image/specs/custom-image-spec.cjs.js.map +1 -1
  152. package/lib/modules/custom-image/specs/image-spec.cjs.js.map +1 -1
  153. package/lib/modules/custom-uploader.cjs.js.map +1 -1
  154. package/lib/modules/divider.cjs.js.map +1 -1
  155. package/lib/modules/emoji.cjs.js.map +1 -1
  156. package/lib/modules/file/formats/file.cjs.js.map +1 -1
  157. package/lib/modules/file/modules/file-bar.cjs.js.map +1 -1
  158. package/lib/modules/file/modules/file-module.cjs.js.map +1 -1
  159. package/lib/modules/flow-chart/config-utils.cjs.js +102 -0
  160. package/lib/modules/flow-chart/config-utils.cjs.js.map +1 -0
  161. package/lib/modules/flow-chart/formats/flow-chart-blot.cjs.js +369 -0
  162. package/lib/modules/flow-chart/formats/flow-chart-blot.cjs.js.map +1 -0
  163. package/lib/modules/flow-chart/i18n/en-us.cjs.js +30 -0
  164. package/lib/modules/flow-chart/i18n/en-us.cjs.js.map +1 -0
  165. package/lib/modules/flow-chart/i18n/index.cjs.js +12 -0
  166. package/lib/modules/flow-chart/i18n/index.cjs.js.map +1 -0
  167. package/lib/modules/flow-chart/i18n/zh-cn.cjs.js +30 -0
  168. package/lib/modules/flow-chart/i18n/zh-cn.cjs.js.map +1 -0
  169. package/lib/modules/flow-chart/icons.cjs.js +27 -0
  170. package/lib/modules/flow-chart/icons.cjs.js.map +1 -0
  171. package/lib/modules/flow-chart/index.cjs.js +45 -0
  172. package/lib/modules/flow-chart/index.cjs.js.map +1 -0
  173. package/lib/modules/flow-chart/modules/context-menu.cjs.js +184 -0
  174. package/lib/modules/flow-chart/modules/context-menu.cjs.js.map +1 -0
  175. package/lib/modules/flow-chart/modules/control-panel.cjs.js +286 -0
  176. package/lib/modules/flow-chart/modules/control-panel.cjs.js.map +1 -0
  177. package/lib/modules/flow-chart/modules/custom-resize-action.cjs.js +150 -0
  178. package/lib/modules/flow-chart/modules/custom-resize-action.cjs.js.map +1 -0
  179. package/lib/modules/flow-chart/style/flow-chart.css +185 -0
  180. package/lib/modules/i18n.cjs.js.map +1 -1
  181. package/lib/modules/index.cjs.js +9 -5
  182. package/lib/modules/index.cjs.js.map +1 -1
  183. package/lib/modules/link/formats/link.cjs.js.map +1 -1
  184. package/lib/modules/link/modules/tooltip.cjs.js.map +1 -1
  185. package/lib/modules/mathlive/formats.cjs.js.map +1 -1
  186. package/lib/modules/mathlive/module.cjs.js.map +1 -1
  187. package/lib/modules/mathlive/tooltip.cjs.js.map +1 -1
  188. package/lib/modules/mention/mention-link.cjs.js.map +1 -1
  189. package/lib/modules/mention/mention.cjs.js.map +1 -1
  190. package/lib/modules/mind-map/config-utils.cjs.js +108 -0
  191. package/lib/modules/mind-map/config-utils.cjs.js.map +1 -0
  192. package/lib/modules/mind-map/formats/mind-map-blot.cjs.js +356 -0
  193. package/lib/modules/mind-map/formats/mind-map-blot.cjs.js.map +1 -0
  194. package/lib/modules/mind-map/i18n/en-us.cjs.js +29 -0
  195. package/lib/modules/mind-map/i18n/en-us.cjs.js.map +1 -0
  196. package/lib/modules/mind-map/i18n/index.cjs.js +12 -0
  197. package/lib/modules/mind-map/i18n/index.cjs.js.map +1 -0
  198. package/lib/modules/mind-map/i18n/zh-cn.cjs.js +29 -0
  199. package/lib/modules/mind-map/i18n/zh-cn.cjs.js.map +1 -0
  200. package/lib/modules/mind-map/icons.cjs.js +45 -0
  201. package/lib/modules/mind-map/icons.cjs.js.map +1 -0
  202. package/lib/modules/mind-map/index.cjs.js +56 -0
  203. package/lib/modules/mind-map/index.cjs.js.map +1 -0
  204. package/lib/modules/mind-map/modules/context-menu.cjs.js +128 -0
  205. package/lib/modules/mind-map/modules/context-menu.cjs.js.map +1 -0
  206. package/lib/modules/mind-map/modules/control-panel.cjs.js +424 -0
  207. package/lib/modules/mind-map/modules/control-panel.cjs.js.map +1 -0
  208. package/lib/modules/mind-map/modules/custom-resize-action.cjs.js +161 -0
  209. package/lib/modules/mind-map/modules/custom-resize-action.cjs.js.map +1 -0
  210. package/lib/modules/mind-map/style/mind-map.css +224 -0
  211. package/lib/modules/shortcut-key/index.cjs.js +16 -0
  212. package/lib/modules/shortcut-key/index.cjs.js.map +1 -1
  213. package/lib/modules/syntax.cjs.js.map +1 -1
  214. package/lib/modules/table-up/index.cjs.js.map +1 -1
  215. package/lib/modules/toolbar/better-picker.cjs.js.map +1 -1
  216. package/lib/modules/toolbar/better-toolbar.cjs.js.map +1 -1
  217. package/lib/modules/toolbar/toolbar-tip.cjs.js.map +1 -1
  218. package/lib/themes/snow.cjs.js.map +1 -1
  219. package/lib/tools/format-painter.cjs.js.map +1 -1
  220. package/lib/tools/fullscreen.cjs.js.map +1 -1
  221. package/lib/tools/screenshot.cjs.js.map +1 -1
  222. package/lib/ui/icons.cjs.js +3 -1
  223. package/lib/ui/icons.cjs.js.map +1 -1
  224. package/lib/ui/icons.config.cjs.js +4 -0
  225. package/lib/ui/icons.config.cjs.js.map +1 -1
  226. package/lib/utils/debounce.cjs.js.map +1 -1
  227. package/lib/utils/image.cjs.js.map +1 -1
  228. package/lib/utils/is.cjs.js.map +1 -1
  229. package/lib/utils/method.cjs.js.map +1 -1
  230. package/lib/utils/scroll-lock.cjs.js.map +1 -1
  231. package/package.json +5 -1
  232. package/style.css +3 -1
  233. package/types/config/i18n/en-us.d.ts +2 -0
  234. package/types/config/i18n/zh-cn.d.ts +2 -0
  235. package/types/config/types/editor-modules.interface.d.ts +4 -0
  236. package/types/modules/flow-chart/config-utils.d.ts +10 -0
  237. package/types/modules/flow-chart/formats/flow-chart-blot.d.ts +43 -0
  238. package/types/modules/flow-chart/i18n/en-us.d.ts +26 -0
  239. package/types/modules/flow-chart/i18n/index.d.ts +1 -0
  240. package/types/modules/flow-chart/i18n/zh-cn.d.ts +26 -0
  241. package/types/modules/flow-chart/icons.d.ts +12 -0
  242. package/types/modules/flow-chart/index.d.ts +10 -0
  243. package/types/modules/flow-chart/modules/context-menu.d.ts +3 -0
  244. package/types/modules/flow-chart/modules/control-panel.d.ts +3 -0
  245. package/types/modules/flow-chart/modules/custom-resize-action.d.ts +22 -0
  246. package/types/modules/flow-chart/options.d.ts +29 -0
  247. package/types/modules/index.d.ts +2 -0
  248. package/types/modules/mind-map/config-utils.d.ts +12 -0
  249. package/types/modules/mind-map/formats/mind-map-blot.d.ts +44 -0
  250. package/types/modules/mind-map/i18n/en-us.d.ts +25 -0
  251. package/types/modules/mind-map/i18n/index.d.ts +1 -0
  252. package/types/modules/mind-map/i18n/zh-cn.d.ts +25 -0
  253. package/types/modules/mind-map/icons.d.ts +21 -0
  254. package/types/modules/mind-map/index.d.ts +10 -0
  255. package/types/modules/mind-map/modules/context-menu.d.ts +3 -0
  256. package/types/modules/mind-map/modules/control-panel.d.ts +3 -0
  257. package/types/modules/mind-map/modules/custom-resize-action.d.ts +23 -0
  258. package/types/modules/mind-map/options.d.ts +26 -0
  259. package/types/ui/icons.config.d.ts +2 -0
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function getGridConfig(quill) {
4
+ var _a, _b, _c;
5
+ const defaultGrid = {
6
+ size: 20,
7
+ visible: true,
8
+ type: "dot",
9
+ config: {
10
+ color: "#ababab",
11
+ thickness: 1
12
+ }
13
+ };
14
+ const flowChartModule = (_a = quill == null ? void 0 : quill.options.modules) == null ? void 0 : _a["flow-chart"];
15
+ if (!flowChartModule || typeof flowChartModule !== "object") {
16
+ return defaultGrid;
17
+ }
18
+ if ("grid" in flowChartModule) {
19
+ const grid = flowChartModule.grid;
20
+ if (grid === false || grid === void 0) {
21
+ return null;
22
+ }
23
+ if (typeof grid === "object" && grid !== null) {
24
+ const typedGrid = grid;
25
+ const gridConfig = {
26
+ size: typedGrid.size || defaultGrid.size,
27
+ visible: typedGrid.visible !== void 0 ? typedGrid.visible : defaultGrid.visible,
28
+ type: typedGrid.type || defaultGrid.type,
29
+ config: {
30
+ color: ((_b = typedGrid.config) == null ? void 0 : _b.color) || defaultGrid.config.color,
31
+ thickness: ((_c = typedGrid.config) == null ? void 0 : _c.thickness) || defaultGrid.config.thickness
32
+ }
33
+ };
34
+ return gridConfig;
35
+ }
36
+ }
37
+ return defaultGrid;
38
+ }
39
+ function getBackgroundConfig(quill) {
40
+ var _a;
41
+ const flowChartModule = (_a = quill == null ? void 0 : quill.options.modules) == null ? void 0 : _a["flow-chart"];
42
+ if (!flowChartModule || typeof flowChartModule !== "object") {
43
+ return false;
44
+ }
45
+ if ("background" in flowChartModule) {
46
+ const background = flowChartModule.background;
47
+ if (background === false || background === void 0) {
48
+ return false;
49
+ }
50
+ if (typeof background === "object" && background !== null) {
51
+ const typedBackground = background;
52
+ const backgroundConfig = {};
53
+ if (typedBackground.color) {
54
+ backgroundConfig.backgroundColor = typedBackground.color;
55
+ }
56
+ if (typedBackground.image) {
57
+ backgroundConfig.backgroundImage = typedBackground.image;
58
+ }
59
+ if (typedBackground.repeat) {
60
+ backgroundConfig.backgroundRepeat = typedBackground.repeat;
61
+ }
62
+ if (typedBackground.position) {
63
+ backgroundConfig.backgroundPosition = typedBackground.position;
64
+ }
65
+ if (typedBackground.size) {
66
+ backgroundConfig.backgroundSize = typedBackground.size;
67
+ }
68
+ if (typedBackground.opacity) {
69
+ backgroundConfig.opacity = typedBackground.opacity;
70
+ }
71
+ return backgroundConfig;
72
+ }
73
+ }
74
+ return false;
75
+ }
76
+ function getResizeConfig(quill) {
77
+ var _a;
78
+ const flowChartModule = (_a = quill == null ? void 0 : quill.options.modules) == null ? void 0 : _a["flow-chart"];
79
+ if (!flowChartModule || typeof flowChartModule !== "object") {
80
+ return false;
81
+ }
82
+ if ("resize" in flowChartModule) {
83
+ const resize = flowChartModule.resize;
84
+ return resize === true;
85
+ }
86
+ return false;
87
+ }
88
+ function getAllConfigs(quill) {
89
+ var _a, _b;
90
+ const deps = (_b = (_a = quill == null ? void 0 : quill.options.modules) == null ? void 0 : _a["flow-chart"]) == null ? void 0 : _b.deps;
91
+ return {
92
+ gridConfig: getGridConfig(quill),
93
+ backgroundConfig: getBackgroundConfig(quill),
94
+ resizeConfig: getResizeConfig(quill),
95
+ deps
96
+ };
97
+ }
98
+ exports.getAllConfigs = getAllConfigs;
99
+ exports.getBackgroundConfig = getBackgroundConfig;
100
+ exports.getGridConfig = getGridConfig;
101
+ exports.getResizeConfig = getResizeConfig;
102
+ //# sourceMappingURL=config-utils.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-utils.cjs.js","sources":["../../../../src/modules/flow-chart/config-utils.ts"],"sourcesContent":["import type Quill from 'quill'\nimport type { BackgroundConfig, GridOptions } from './options'\n\nexport function getGridConfig(quill: Quill | null): any {\n const defaultGrid = {\n size: 20,\n visible: true,\n type: 'dot',\n config: {\n color: '#ababab',\n thickness: 1,\n },\n }\n\n const flowChartModule = quill?.options.modules?.['flow-chart']\n if (!flowChartModule || typeof flowChartModule !== 'object') {\n return defaultGrid\n }\n\n if ('grid' in flowChartModule) {\n const grid = flowChartModule.grid as GridOptions | boolean | undefined\n if (grid === false || grid === undefined) {\n return null\n }\n\n if (typeof grid === 'object' && grid !== null) {\n const typedGrid = grid as GridOptions\n const gridConfig = {\n size: typedGrid.size || defaultGrid.size,\n visible: typedGrid.visible !== undefined ? typedGrid.visible : defaultGrid.visible,\n type: typedGrid.type || defaultGrid.type,\n config: {\n color: typedGrid.config?.color || defaultGrid.config.color,\n thickness: typedGrid.config?.thickness || defaultGrid.config.thickness,\n },\n }\n\n return gridConfig\n }\n }\n\n return defaultGrid\n}\n\nexport function getBackgroundConfig(quill: Quill | null): false | object {\n const flowChartModule = quill?.options.modules?.['flow-chart']\n if (!flowChartModule || typeof flowChartModule !== 'object') {\n return false\n }\n if ('background' in flowChartModule) {\n const background = flowChartModule.background as BackgroundConfig | boolean | undefined\n\n if (background === false || background === undefined) {\n return false\n }\n if (typeof background === 'object' && background !== null) {\n const typedBackground = background as BackgroundConfig\n const backgroundConfig: any = {}\n\n if (typedBackground.color) {\n backgroundConfig.backgroundColor = typedBackground.color\n }\n if (typedBackground.image) {\n backgroundConfig.backgroundImage = typedBackground.image\n }\n if (typedBackground.repeat) {\n backgroundConfig.backgroundRepeat = typedBackground.repeat\n }\n if (typedBackground.position) {\n backgroundConfig.backgroundPosition = typedBackground.position\n }\n if (typedBackground.size) {\n backgroundConfig.backgroundSize = typedBackground.size\n }\n if (typedBackground.opacity) {\n backgroundConfig.opacity = typedBackground.opacity\n }\n return backgroundConfig\n }\n }\n return false\n}\n\nexport function getResizeConfig(quill: Quill | null): boolean {\n const flowChartModule = quill?.options.modules?.['flow-chart']\n if (!flowChartModule || typeof flowChartModule !== 'object') {\n return false\n }\n if ('resize' in flowChartModule) {\n const resize = (flowChartModule as any).resize as boolean | undefined\n return resize === true\n }\n return false\n}\n\nexport function getAllConfigs(quill: Quill | null): {\n gridConfig: any\n backgroundConfig: false | object\n resizeConfig: boolean\n deps?: any\n} {\n const deps = (quill?.options.modules?.['flow-chart'] as any)?.deps\n return {\n gridConfig: getGridConfig(quill),\n backgroundConfig: getBackgroundConfig(quill),\n resizeConfig: getResizeConfig(quill),\n deps,\n }\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAAc,OAA0B;;AACtD,QAAM,cAAc;AAAA,IAClB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EACb;AAGF,QAAM,mBAAkB,oCAAO,QAAQ,YAAf,mBAAyB;AACjD,MAAI,CAAC,mBAAmB,OAAO,oBAAoB,UAAU;AAC3D,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,iBAAiB;AAC7B,UAAM,OAAO,gBAAgB;AAC7B,QAAI,SAAS,SAAS,SAAS,QAAW;AACxC,aAAO;AAAA,IACT;AAEA,QAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC7C,YAAM,YAAY;AAClB,YAAM,aAAa;AAAA,QACjB,MAAM,UAAU,QAAQ,YAAY;AAAA,QACpC,SAAS,UAAU,YAAY,SAAY,UAAU,UAAU,YAAY;AAAA,QAC3E,MAAM,UAAU,QAAQ,YAAY;AAAA,QACpC,QAAQ;AAAA,UACN,SAAO,eAAU,WAAV,mBAAkB,UAAS,YAAY,OAAO;AAAA,UACrD,aAAW,eAAU,WAAV,mBAAkB,cAAa,YAAY,OAAO;AAAA,QAAA;AAAA,MAC/D;AAGF,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,oBAAoB,OAAqC;;AACvE,QAAM,mBAAkB,oCAAO,QAAQ,YAAf,mBAAyB;AACjD,MAAI,CAAC,mBAAmB,OAAO,oBAAoB,UAAU;AAC3D,WAAO;AAAA,EACT;AACA,MAAI,gBAAgB,iBAAiB;AACnC,UAAM,aAAa,gBAAgB;AAEnC,QAAI,eAAe,SAAS,eAAe,QAAW;AACpD,aAAO;AAAA,IACT;AACA,QAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACzD,YAAM,kBAAkB;AACxB,YAAM,mBAAwB,CAAA;AAE9B,UAAI,gBAAgB,OAAO;AACzB,yBAAiB,kBAAkB,gBAAgB;AAAA,MACrD;AACA,UAAI,gBAAgB,OAAO;AACzB,yBAAiB,kBAAkB,gBAAgB;AAAA,MACrD;AACA,UAAI,gBAAgB,QAAQ;AAC1B,yBAAiB,mBAAmB,gBAAgB;AAAA,MACtD;AACA,UAAI,gBAAgB,UAAU;AAC5B,yBAAiB,qBAAqB,gBAAgB;AAAA,MACxD;AACA,UAAI,gBAAgB,MAAM;AACxB,yBAAiB,iBAAiB,gBAAgB;AAAA,MACpD;AACA,UAAI,gBAAgB,SAAS;AAC3B,yBAAiB,UAAU,gBAAgB;AAAA,MAC7C;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,gBAAgB,OAA8B;;AAC5D,QAAM,mBAAkB,oCAAO,QAAQ,YAAf,mBAAyB;AACjD,MAAI,CAAC,mBAAmB,OAAO,oBAAoB,UAAU;AAC3D,WAAO;AAAA,EACT;AACA,MAAI,YAAY,iBAAiB;AAC/B,UAAM,SAAU,gBAAwB;AACxC,WAAO,WAAW;AAAA,EACpB;AACA,SAAO;AACT;AAEO,SAAS,cAAc,OAK5B;;AACA,QAAM,QAAQ,0CAAO,QAAQ,YAAf,mBAAyB,kBAAzB,mBAAgD;AAC9D,SAAO;AAAA,IACL,YAAY,cAAc,KAAK;AAAA,IAC/B,kBAAkB,oBAAoB,KAAK;AAAA,IAC3C,cAAc,gBAAgB,KAAK;AAAA,IACnC;AAAA,EAAA;AAEJ;;;;;"}
@@ -0,0 +1,369 @@
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.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
6
+ const Quill = require("quill");
7
+ const configUtils = require("../config-utils.cjs.js");
8
+ const icons = require("../icons.cjs.js");
9
+ const contextMenu = require("../modules/context-menu.cjs.js");
10
+ const controlPanel = require("../modules/control-panel.cjs.js");
11
+ const customResizeAction = require("../modules/custom-resize-action.cjs.js");
12
+ ;/* empty css */
13
+ const BlockEmbed = Quill.import("blots/embed");
14
+ const _FlowChartPlaceholderBlot = class _FlowChartPlaceholderBlot extends BlockEmbed {
15
+ constructor(scroll, domNode) {
16
+ super(scroll, domNode);
17
+ __publicField(this, "quill", null);
18
+ __publicField(this, "flowChart", null);
19
+ __publicField(this, "data");
20
+ __publicField(this, "contextMenu", null);
21
+ __publicField(this, "currentElement", null);
22
+ __publicField(this, "width", 100);
23
+ __publicField(this, "height", 500);
24
+ __publicField(this, "parentObserver", null);
25
+ __publicField(this, "nextPObserver", null);
26
+ const data = _FlowChartPlaceholderBlot.value(domNode);
27
+ this.width = data.width || 100;
28
+ this.height = data.height || 500;
29
+ this.domNode.style.width = `${this.width}${data.width ? "px" : "%"}`;
30
+ this.domNode.style.height = `${this.height}px`;
31
+ this.domNode.style.maxWidth = "100%";
32
+ this.domNode.style.border = "1px solid #e8e8e8";
33
+ this.domNode.setAttribute("contenteditable", "false");
34
+ this.data = _FlowChartPlaceholderBlot.value(this.domNode);
35
+ this.initFlowChart();
36
+ }
37
+ static value(domNode) {
38
+ const dataStr = JSON.parse(domNode.getAttribute("data-flow-chart"));
39
+ const value = dataStr.root ? dataStr.root : dataStr;
40
+ if (domNode.hasAttribute("width")) {
41
+ value.width = Number.parseInt(domNode.getAttribute("width"), 10);
42
+ }
43
+ if (domNode.hasAttribute("height")) {
44
+ value.height = Number.parseInt(domNode.getAttribute("height"), 10);
45
+ }
46
+ return dataStr.root ? dataStr.root : dataStr;
47
+ }
48
+ static create(value) {
49
+ const node = super.create();
50
+ if (value) {
51
+ node.setAttribute("data-flow-chart", JSON.stringify(value));
52
+ }
53
+ if (value.width) {
54
+ node.setAttribute("width", String(value.width));
55
+ node.style.width = `${value.width}%`;
56
+ }
57
+ if (value.height) {
58
+ node.setAttribute("height", String(value.height));
59
+ node.style.height = `${value.height}px`;
60
+ }
61
+ node.setAttribute("contenteditable", "false");
62
+ return node;
63
+ }
64
+ static findQuill(el) {
65
+ let cur = el;
66
+ while (cur) {
67
+ const q = cur.__quillInstance;
68
+ if (q) return q;
69
+ cur = cur.parentElement;
70
+ }
71
+ return null;
72
+ }
73
+ attach() {
74
+ super.attach();
75
+ this.quill = _FlowChartPlaceholderBlot.findQuill(this.domNode);
76
+ }
77
+ initFlowChart() {
78
+ if (this.domNode.isConnected) {
79
+ this.insertFlowChartEditor();
80
+ } else {
81
+ const observer = new MutationObserver(() => {
82
+ if (this.domNode.isConnected) {
83
+ this.insertFlowChartEditor();
84
+ observer.disconnect();
85
+ }
86
+ });
87
+ observer.observe(document.body, { childList: true, subtree: true });
88
+ }
89
+ }
90
+ insertFlowChartEditor() {
91
+ this.domNode.style.width = `${this.width}${this.data.width ? "px" : "%"}`;
92
+ this.domNode.style.height = `${this.height}px`;
93
+ this.updateAlignmentStyle();
94
+ this.observeParentAlignment();
95
+ const { gridConfig, backgroundConfig, resizeConfig, deps } = configUtils.getAllConfigs(this.quill);
96
+ const { LogicFlow, DndPanel, SelectionSelect, Snapshot } = deps || window;
97
+ this.flowChart = new LogicFlow({
98
+ container: this.domNode,
99
+ stopScrollGraph: true,
100
+ stopZoomGraph: true,
101
+ allowResize: true,
102
+ allowRotate: true,
103
+ editable: true,
104
+ preventDefaultDoubleClick: true,
105
+ preventDefault: true,
106
+ grid: gridConfig,
107
+ background: backgroundConfig,
108
+ plugins: [DndPanel, SelectionSelect, Snapshot]
109
+ });
110
+ this.flowChart.setPatternItems([
111
+ {
112
+ className: "lf-shape-dashed",
113
+ callback: () => {
114
+ this.flowChart.openSelectionSelect();
115
+ this.flowChart.once("selection:selected", () => {
116
+ this.flowChart.closeSelectionSelect();
117
+ });
118
+ }
119
+ },
120
+ {
121
+ type: "rect",
122
+ text: "矩形",
123
+ className: "lf-shape-rect"
124
+ },
125
+ {
126
+ type: "circle",
127
+ text: "圆形",
128
+ className: "lf-shape-circle"
129
+ },
130
+ {
131
+ type: "ellipse",
132
+ text: "椭圆",
133
+ className: "lf-shape-ellipse"
134
+ },
135
+ {
136
+ type: "diamond",
137
+ text: "菱形",
138
+ className: "lf-shape-diamond"
139
+ }
140
+ ]);
141
+ if (resizeConfig) {
142
+ new customResizeAction.FlowChartResizeAction(this);
143
+ }
144
+ controlPanel.createControlPanel(this, this.quill);
145
+ contextMenu.initContextMenu(this, this.quill);
146
+ this.observeOwnParentChange();
147
+ this.observeNextPElement();
148
+ this.addMouseHoverEvents();
149
+ this.flowChart.render(this.data);
150
+ this.flowChart.on("graph:updated", () => {
151
+ this.data = this.flowChart.getGraphData();
152
+ this.domNode.setAttribute("data-flow-chart", JSON.stringify(this.data));
153
+ });
154
+ this.flowChart.on("history:change", () => {
155
+ this.data = this.flowChart.getGraphData();
156
+ this.domNode.setAttribute("data-flow-chart", JSON.stringify(this.data));
157
+ });
158
+ this.flowChart.on("node:dbclick", this.handleNodeDblClick.bind(this));
159
+ this.flowChart.on("edge:dbclick", this.handleNodeDblClick.bind(this));
160
+ this.domNode.addEventListener("click", (e) => {
161
+ if (this.quill) {
162
+ const flowChartBlot = Quill.find(this.domNode);
163
+ const index = this.quill.getIndex(flowChartBlot);
164
+ if (index && typeof index === "number") {
165
+ this.quill.setSelection(index + 1, 0);
166
+ }
167
+ }
168
+ });
169
+ }
170
+ addMouseHoverEvents() {
171
+ this.domNode.addEventListener("mouseenter", () => {
172
+ this.showControlPanel();
173
+ });
174
+ this.domNode.addEventListener("mouseleave", () => {
175
+ var _a;
176
+ (_a = this.flowChart) == null ? void 0 : _a.clearSelectElements();
177
+ this.hideControlPanel();
178
+ });
179
+ }
180
+ getControlElements() {
181
+ const leftUpControl = this.domNode.querySelector(".lf-dndpanel");
182
+ const control = this.domNode.querySelector(".ql-flow-chart-control");
183
+ const panelStatusIcon = this.domNode.querySelector('[data-control-type="panel-status"]');
184
+ return { leftUpControl, control, panelStatusIcon };
185
+ }
186
+ showControlPanel() {
187
+ const { leftUpControl, control, panelStatusIcon } = this.getControlElements();
188
+ if (!leftUpControl || !control) return;
189
+ leftUpControl.style.display = "block";
190
+ control.style.display = "flex";
191
+ if (panelStatusIcon) {
192
+ const iconElement = panelStatusIcon.querySelector("i") || panelStatusIcon;
193
+ iconElement.innerHTML = icons.expandIcon;
194
+ }
195
+ }
196
+ hideControlPanel() {
197
+ const { leftUpControl, control, panelStatusIcon } = this.getControlElements();
198
+ if (!leftUpControl || !control) return;
199
+ leftUpControl.style.display = "none";
200
+ control.style.display = "none";
201
+ if (panelStatusIcon) {
202
+ const iconElement = panelStatusIcon.querySelector("i") || panelStatusIcon;
203
+ iconElement.innerHTML = icons.contractIcon;
204
+ }
205
+ }
206
+ observeOwnParentChange() {
207
+ let currentParent = this.domNode.parentElement;
208
+ const observer = new MutationObserver(() => {
209
+ if (this.domNode.parentElement !== currentParent) {
210
+ currentParent = this.domNode.parentElement;
211
+ this.observeParentAlignment();
212
+ }
213
+ });
214
+ observer.observe(document.body, {
215
+ attributes: false,
216
+ childList: true,
217
+ subtree: true
218
+ });
219
+ }
220
+ observeParentAlignment() {
221
+ if (this.parentObserver) {
222
+ this.parentObserver.disconnect();
223
+ }
224
+ const observer = new MutationObserver((mutations) => {
225
+ mutations.forEach((mutation) => {
226
+ if (mutation.attributeName === "class") {
227
+ this.updateAlignmentStyle();
228
+ }
229
+ });
230
+ });
231
+ this.parentObserver = observer;
232
+ const parent = this.domNode.parentElement;
233
+ if (parent) {
234
+ observer.observe(parent, {
235
+ attributes: true,
236
+ attributeFilter: ["class"]
237
+ });
238
+ this.updateAlignmentStyle();
239
+ }
240
+ }
241
+ updateAlignmentStyle() {
242
+ const parent = this.domNode.parentElement;
243
+ if (!parent) return;
244
+ this.domNode.style.margin = "";
245
+ this.domNode.style.display = "block";
246
+ if (parent.classList.contains("ql-align-center")) {
247
+ this.domNode.style.margin = "0 auto";
248
+ } else if (parent.classList.contains("ql-align-right")) {
249
+ this.domNode.style.marginLeft = "auto";
250
+ this.domNode.style.marginRight = "0";
251
+ } else {
252
+ this.domNode.style.marginLeft = "0";
253
+ this.domNode.style.marginRight = "auto";
254
+ }
255
+ }
256
+ observeNextPElement() {
257
+ if (this.nextPObserver) {
258
+ this.nextPObserver.disconnect();
259
+ }
260
+ const parentElement = this.domNode.parentElement;
261
+ if (!parentElement) {
262
+ return;
263
+ }
264
+ const trackedParentElement = parentElement;
265
+ const parentElementId = parentElement.getAttribute("id") || `flow-chart-parent-${Date.now()}`;
266
+ parentElement.setAttribute("id", parentElementId);
267
+ const observer = new MutationObserver(() => {
268
+ if (!document.contains(trackedParentElement)) {
269
+ const elementById = document.getElementById(parentElementId);
270
+ if (!elementById) {
271
+ this.remove();
272
+ observer.disconnect();
273
+ }
274
+ }
275
+ });
276
+ observer.observe(document.body, {
277
+ childList: true,
278
+ subtree: true
279
+ });
280
+ this.nextPObserver = observer;
281
+ }
282
+ // 处理节点双击事件
283
+ handleNodeDblClick(event) {
284
+ const { data, position, e } = event;
285
+ if (data && data.id) {
286
+ this.createEditInput(data, position, e);
287
+ }
288
+ }
289
+ // 创建编辑输入框
290
+ createEditInput(nodeData, position, e) {
291
+ var _a;
292
+ const input = document.createElement("textarea");
293
+ input.className = "ql-flow-chart-edit-input";
294
+ input.value = ((_a = nodeData.text) == null ? void 0 : _a.value) || "";
295
+ const autoResize = () => {
296
+ input.style.height = "auto";
297
+ input.style.height = `${input.scrollHeight}px`;
298
+ };
299
+ Object.assign(input.style, {
300
+ position: "absolute",
301
+ boxSizing: "border-box",
302
+ width: "100px",
303
+ height: "35px",
304
+ padding: "5px",
305
+ lineHeight: "1.2",
306
+ whiteSpace: "pre",
307
+ textAlign: "center",
308
+ background: "#fff",
309
+ border: "1px solid #edefed",
310
+ borderRadius: "3px",
311
+ outline: "none",
312
+ transform: "translate(-50%, -50%)",
313
+ resize: "none",
314
+ zIndex: "1000",
315
+ left: `${e.pageX}px`,
316
+ top: `${e.pageY}px`,
317
+ overflow: "hidden"
318
+ });
319
+ document.body.appendChild(input);
320
+ autoResize();
321
+ input.addEventListener("input", autoResize);
322
+ input.addEventListener("keydown", (e2) => {
323
+ if (e2.key === "Enter" && !e2.shiftKey) {
324
+ this.flowChart.updateText(nodeData.id, input.value);
325
+ autoResize();
326
+ }
327
+ });
328
+ input.focus();
329
+ this.flowChart.on("blank:mousedown", () => {
330
+ this.flowChart.updateText(nodeData.id, input.value);
331
+ input.remove();
332
+ });
333
+ this.flowChart.on("node:click", () => {
334
+ this.flowChart.updateText(nodeData.id, input.value);
335
+ input.remove();
336
+ });
337
+ this.flowChart.on("edge:click", () => {
338
+ this.flowChart.updateText(nodeData.id, input.value);
339
+ input.remove();
340
+ });
341
+ }
342
+ updateText(nodeId, text) {
343
+ this.flowChart.updateNode(nodeId, {
344
+ text: { value: text }
345
+ });
346
+ }
347
+ destroyFlowChart() {
348
+ if (this.flowChart) {
349
+ this.flowChart.destroy();
350
+ this.flowChart = null;
351
+ }
352
+ const editInputs = document.querySelectorAll(".ql-flow-chart-edit-input");
353
+ editInputs.forEach((input) => input.remove());
354
+ if (this.nextPObserver) {
355
+ this.nextPObserver.disconnect();
356
+ this.nextPObserver = null;
357
+ }
358
+ }
359
+ remove() {
360
+ this.destroyFlowChart();
361
+ super.remove();
362
+ }
363
+ };
364
+ __publicField(_FlowChartPlaceholderBlot, "blotName", "flow-chart");
365
+ __publicField(_FlowChartPlaceholderBlot, "tagName", "div");
366
+ __publicField(_FlowChartPlaceholderBlot, "className", "ql-flow-chart-item");
367
+ let FlowChartPlaceholderBlot = _FlowChartPlaceholderBlot;
368
+ exports.default = FlowChartPlaceholderBlot;
369
+ //# sourceMappingURL=flow-chart-blot.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-chart-blot.cjs.js","sources":["../../../../../src/modules/flow-chart/formats/flow-chart-blot.ts"],"sourcesContent":["import type { Root } from 'parchment'\nimport type { BlockEmbed as TypeBlockEmbed } from 'quill/blots/block'\nimport type FluentEditor from '../../../core/fluent-editor'\nimport Quill from 'quill'\nimport { getAllConfigs } from '../config-utils'\nimport { contractIcon, expandIcon } from '../icons'\nimport { initContextMenu } from '../modules/context-menu'\nimport { createControlPanel } from '../modules/control-panel'\nimport { FlowChartResizeAction } from '../modules/custom-resize-action'\nimport '../style/flow-chart.scss'\n\nconst BlockEmbed = Quill.import('blots/embed') as typeof TypeBlockEmbed\nclass FlowChartPlaceholderBlot extends BlockEmbed {\n static blotName = 'flow-chart'\n static tagName = 'div'\n static className = 'ql-flow-chart-item'\n quill: Quill | null = null\n flowChart: any | null = null\n data: any\n contextMenu: HTMLElement | null = null\n currentElement: any = null\n width: number = 100\n height: number = 500\n parentObserver: MutationObserver | null = null\n nextPObserver: MutationObserver | null = null\n\n constructor(scroll: Root, domNode: HTMLElement) {\n super(scroll, domNode)\n const data = FlowChartPlaceholderBlot.value(domNode)\n this.width = data.width || 100\n this.height = data.height || 500\n this.domNode.style.width = `${this.width}${data.width ? 'px' : '%'}`\n this.domNode.style.height = `${this.height}px`\n this.domNode.style.maxWidth = '100%'\n this.domNode.style.border = '1px solid #e8e8e8'\n this.domNode.setAttribute('contenteditable', 'false')\n this.data = FlowChartPlaceholderBlot.value(this.domNode)\n this.initFlowChart()\n }\n\n static value(domNode: HTMLElement): any {\n const dataStr = JSON.parse(domNode.getAttribute('data-flow-chart'))\n const value = dataStr.root ? dataStr.root : dataStr\n if (domNode.hasAttribute('width')) {\n value.width = Number.parseInt(domNode.getAttribute('width'), 10)\n }\n if (domNode.hasAttribute('height')) {\n value.height = Number.parseInt(domNode.getAttribute('height'), 10)\n }\n return dataStr.root ? dataStr.root : dataStr\n }\n\n static create(value: any): HTMLElement {\n const node = super.create() as HTMLElement\n if (value) {\n node.setAttribute('data-flow-chart', JSON.stringify(value))\n }\n if (value.width) {\n node.setAttribute('width', String(value.width))\n node.style.width = `${value.width}%`\n }\n if (value.height) {\n node.setAttribute('height', String(value.height))\n node.style.height = `${value.height}px`\n }\n node.setAttribute('contenteditable', 'false')\n return node\n }\n\n private static findQuill(el: HTMLElement): Quill | null {\n let cur: HTMLElement | null = el\n while (cur) {\n const q = (cur as any).__quillInstance\n if (q) return q\n cur = cur.parentElement\n }\n return null\n }\n\n attach() {\n super.attach()\n this.quill = FlowChartPlaceholderBlot.findQuill(this.domNode)\n }\n\n initFlowChart(): void {\n if (this.domNode.isConnected) {\n this.insertFlowChartEditor()\n }\n else {\n const observer = new MutationObserver(() => {\n if (this.domNode.isConnected) {\n this.insertFlowChartEditor()\n observer.disconnect()\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n }\n\n insertFlowChartEditor(): void {\n this.domNode.style.width = `${this.width}${this.data.width ? 'px' : '%'}`\n this.domNode.style.height = `${this.height}px`\n this.updateAlignmentStyle()\n this.observeParentAlignment()\n const { gridConfig, backgroundConfig, resizeConfig, deps } = getAllConfigs(this.quill)\n const { LogicFlow, DndPanel, SelectionSelect, Snapshot } = deps || window as any\n this.flowChart = new LogicFlow({\n container: this.domNode,\n stopScrollGraph: true,\n stopZoomGraph: true,\n allowResize: true,\n allowRotate: true,\n editable: true,\n preventDefaultDoubleClick: true,\n preventDefault: true,\n grid: gridConfig,\n background: backgroundConfig,\n plugins: [DndPanel, SelectionSelect, Snapshot],\n })\n this.flowChart.setPatternItems([\n {\n className: 'lf-shape-dashed',\n callback: () => {\n this.flowChart.openSelectionSelect()\n this.flowChart.once('selection:selected', () => {\n this.flowChart.closeSelectionSelect()\n })\n },\n },\n {\n type: 'rect',\n text: '矩形',\n className: 'lf-shape-rect',\n },\n {\n type: 'circle',\n text: '圆形',\n className: 'lf-shape-circle',\n },\n {\n type: 'ellipse',\n text: '椭圆',\n className: 'lf-shape-ellipse',\n },\n {\n type: 'diamond',\n text: '菱形',\n className: 'lf-shape-diamond',\n },\n ])\n if (resizeConfig) {\n new FlowChartResizeAction(this)\n }\n createControlPanel(this, this.quill as FluentEditor) // 创建控制面板\n initContextMenu(this, this.quill as FluentEditor) // 初始化右键菜单\n this.observeOwnParentChange()\n this.observeNextPElement()\n this.addMouseHoverEvents()\n this.flowChart.render(this.data)\n this.flowChart.on('graph:updated', () => {\n this.data = this.flowChart.getGraphData()\n this.domNode.setAttribute('data-flow-chart', JSON.stringify(this.data))\n })\n this.flowChart.on('history:change', () => {\n this.data = this.flowChart.getGraphData()\n this.domNode.setAttribute('data-flow-chart', JSON.stringify(this.data))\n })\n this.flowChart.on('node:dbclick', this.handleNodeDblClick.bind(this))\n this.flowChart.on('edge:dbclick', this.handleNodeDblClick.bind(this))\n this.domNode.addEventListener('click', (e) => {\n if (this.quill) {\n const flowChartBlot = Quill.find(this.domNode)\n const index = this.quill.getIndex(flowChartBlot as FlowChartPlaceholderBlot)\n if (index && typeof index === 'number') {\n this.quill.setSelection(index + 1, 0)\n }\n }\n })\n }\n\n addMouseHoverEvents(): void {\n this.domNode.addEventListener('mouseenter', () => {\n this.showControlPanel()\n })\n\n this.domNode.addEventListener('mouseleave', () => {\n this.flowChart?.clearSelectElements()\n this.hideControlPanel()\n })\n }\n\n getControlElements(): { leftUpControl: HTMLElement | null, control: HTMLElement | null, panelStatusIcon: HTMLElement | null } {\n const leftUpControl = this.domNode.querySelector('.lf-dndpanel') as HTMLElement | null\n const control = this.domNode.querySelector('.ql-flow-chart-control') as HTMLElement | null\n const panelStatusIcon = this.domNode.querySelector('[data-control-type=\"panel-status\"]') as HTMLElement | null\n return { leftUpControl, control, panelStatusIcon }\n }\n\n showControlPanel(): void {\n const { leftUpControl, control, panelStatusIcon } = this.getControlElements()\n if (!leftUpControl || !control) return\n\n leftUpControl.style.display = 'block'\n control.style.display = 'flex'\n if (panelStatusIcon) {\n const iconElement = panelStatusIcon.querySelector('i') || panelStatusIcon\n iconElement.innerHTML = expandIcon\n }\n }\n\n hideControlPanel(): void {\n const { leftUpControl, control, panelStatusIcon } = this.getControlElements()\n if (!leftUpControl || !control) return\n\n leftUpControl.style.display = 'none'\n control.style.display = 'none'\n if (panelStatusIcon) {\n const iconElement = panelStatusIcon.querySelector('i') || panelStatusIcon\n iconElement.innerHTML = contractIcon\n }\n }\n\n observeOwnParentChange(): void {\n let currentParent = this.domNode.parentElement\n const observer = new MutationObserver(() => {\n if (this.domNode.parentElement !== currentParent) {\n currentParent = this.domNode.parentElement\n this.observeParentAlignment()\n }\n })\n\n observer.observe(document.body, {\n attributes: false,\n childList: true,\n subtree: true,\n })\n }\n\n observeParentAlignment(): void {\n if (this.parentObserver) {\n this.parentObserver.disconnect()\n }\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === 'class') {\n this.updateAlignmentStyle()\n }\n })\n })\n\n this.parentObserver = observer\n\n const parent = this.domNode.parentElement\n if (parent) {\n observer.observe(parent, {\n attributes: true,\n attributeFilter: ['class'],\n })\n this.updateAlignmentStyle()\n }\n }\n\n updateAlignmentStyle(): void {\n const parent = this.domNode.parentElement\n if (!parent) return\n\n this.domNode.style.margin = ''\n this.domNode.style.display = 'block'\n\n if (parent.classList.contains('ql-align-center')) {\n this.domNode.style.margin = '0 auto'\n }\n else if (parent.classList.contains('ql-align-right')) {\n this.domNode.style.marginLeft = 'auto'\n this.domNode.style.marginRight = '0'\n }\n else {\n this.domNode.style.marginLeft = '0'\n this.domNode.style.marginRight = 'auto'\n }\n }\n\n observeNextPElement(): void {\n if (this.nextPObserver) {\n this.nextPObserver.disconnect()\n }\n\n const parentElement = this.domNode.parentElement\n if (!parentElement) {\n return\n }\n\n const trackedParentElement = parentElement\n\n const parentElementId = parentElement.getAttribute('id') || `flow-chart-parent-${Date.now()}`\n parentElement.setAttribute('id', parentElementId)\n\n const observer = new MutationObserver(() => {\n if (!document.contains(trackedParentElement)) {\n const elementById = document.getElementById(parentElementId)\n if (!elementById) {\n this.remove()\n observer.disconnect()\n }\n }\n })\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n })\n\n this.nextPObserver = observer\n }\n\n // 处理节点双击事件\n handleNodeDblClick(event: any) {\n const { data, position, e } = event\n if (data && data.id) {\n this.createEditInput(data, position, e)\n }\n }\n\n // 创建编辑输入框\n createEditInput(nodeData: any, position: any, e: any) {\n const input = document.createElement('textarea')\n input.className = 'ql-flow-chart-edit-input'\n input.value = nodeData.text?.value || ''\n const autoResize = () => {\n input.style.height = 'auto'\n input.style.height = `${input.scrollHeight}px`\n }\n Object.assign(input.style, {\n position: 'absolute',\n boxSizing: 'border-box',\n width: '100px',\n height: '35px',\n padding: '5px',\n lineHeight: '1.2',\n whiteSpace: 'pre',\n textAlign: 'center',\n background: '#fff',\n border: '1px solid #edefed',\n borderRadius: '3px',\n outline: 'none',\n transform: 'translate(-50%, -50%)',\n resize: 'none',\n zIndex: '1000',\n left: `${e.pageX}px`,\n top: `${e.pageY}px`,\n overflow: 'hidden',\n })\n document.body.appendChild(input)\n autoResize()\n input.addEventListener('input', autoResize)\n input.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n this.flowChart.updateText(nodeData.id, input.value)\n autoResize()\n }\n })\n input.focus()\n\n this.flowChart.on('blank:mousedown', () => {\n this.flowChart.updateText(nodeData.id, input.value)\n input.remove()\n })\n\n this.flowChart.on('node:click', () => {\n this.flowChart.updateText(nodeData.id, input.value)\n input.remove()\n })\n\n this.flowChart.on('edge:click', () => {\n this.flowChart.updateText(nodeData.id, input.value)\n input.remove()\n })\n }\n\n updateText(nodeId: string, text: string) {\n this.flowChart.updateNode(nodeId, {\n text: { value: text },\n })\n }\n\n destroyFlowChart() {\n if (this.flowChart) {\n this.flowChart.destroy()\n this.flowChart = null\n }\n const editInputs = document.querySelectorAll('.ql-flow-chart-edit-input')\n editInputs.forEach(input => input.remove())\n if (this.nextPObserver) {\n this.nextPObserver.disconnect()\n this.nextPObserver = null\n }\n }\n\n remove() {\n this.destroyFlowChart()\n super.remove()\n }\n}\n\nexport default FlowChartPlaceholderBlot\n"],"names":["getAllConfigs","FlowChartResizeAction","createControlPanel","initContextMenu","expandIcon","contractIcon","e"],"mappings":";;;;;;;;;;;;AAWA,MAAM,aAAa,MAAM,OAAO,aAAa;AAC7C,MAAM,4BAAN,MAAM,kCAAiC,WAAW;AAAA,EAchD,YAAY,QAAc,SAAsB;AAC9C,UAAM,QAAQ,OAAO;AAXvB,iCAAsB;AACtB,qCAAwB;AACxB;AACA,uCAAkC;AAClC,0CAAsB;AACtB,iCAAgB;AAChB,kCAAiB;AACjB,0CAA0C;AAC1C,yCAAyC;AAIvC,UAAM,OAAO,0BAAyB,MAAM,OAAO;AACnD,SAAK,QAAQ,KAAK,SAAS;AAC3B,SAAK,SAAS,KAAK,UAAU;AAC7B,SAAK,QAAQ,MAAM,QAAQ,GAAG,KAAK,KAAK,GAAG,KAAK,QAAQ,OAAO,GAAG;AAClE,SAAK,QAAQ,MAAM,SAAS,GAAG,KAAK,MAAM;AAC1C,SAAK,QAAQ,MAAM,WAAW;AAC9B,SAAK,QAAQ,MAAM,SAAS;AAC5B,SAAK,QAAQ,aAAa,mBAAmB,OAAO;AACpD,SAAK,OAAO,0BAAyB,MAAM,KAAK,OAAO;AACvD,SAAK,cAAA;AAAA,EACP;AAAA,EAEA,OAAO,MAAM,SAA2B;AACtC,UAAM,UAAU,KAAK,MAAM,QAAQ,aAAa,iBAAiB,CAAC;AAClE,UAAM,QAAQ,QAAQ,OAAO,QAAQ,OAAO;AAC5C,QAAI,QAAQ,aAAa,OAAO,GAAG;AACjC,YAAM,QAAQ,OAAO,SAAS,QAAQ,aAAa,OAAO,GAAG,EAAE;AAAA,IACjE;AACA,QAAI,QAAQ,aAAa,QAAQ,GAAG;AAClC,YAAM,SAAS,OAAO,SAAS,QAAQ,aAAa,QAAQ,GAAG,EAAE;A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,IAAI,MAAM,KAAK;AAClD,YAAM,OAAA;AAAA,IACR,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,QAAgB,MAAc;AACvC,SAAK,UAAU,WAAW,QAAQ;AAAA,MAChC,MAAM,EAAE,OAAO,KAAA;AAAA,IAAK,CACrB;AAAA,EACH;AAAA,EAEA,mBAAmB;AACjB,QAAI,KAAK,WAAW;AAClB,WAAK,UAAU,QAAA;AACf,WAAK,YAAY;AAAA,IACnB;AACA,UAAM,aAAa,SAAS,iBAAiB,2BAA2B;AACxE,eAAW,QAAQ,CAAA,UAAS,MAAM,OAAA,CAAQ;AAC1C,QAAI,KAAK,eAAe;AACtB,WAAK,cAAc,WAAA;AACnB,WAAK,gBAAgB;AAAA,IACvB;AAAA,EACF;AAAA,EAEA,SAAS;AACP,SAAK,iBAAA;AACL,UAAM,OAAA;AAAA,EACR;AACF;AAtYE,cADI,2BACG,YAAW;AAClB,cAFI,2BAEG,WAAU;AACjB,cAHI,2BAGG,aAAY;AAHrB,IAAM,2BAAN;;"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const FLOW_CHART_EN_US = {
4
+ "flowChart.controlPanel.export": "Export",
5
+ "flowChart.controlPanel.import": "Import",
6
+ "flowChart.controlPanel.setEdgeTypeTitle": "Set Edge Type",
7
+ "flowChart.dndPanel.selection": "Selection",
8
+ "flowChart.dndPanel.rectangle": "Rectangle",
9
+ "flowChart.dndPanel.circle": "Circle",
10
+ "flowChart.dndPanel.ellipse": "Ellipse",
11
+ "flowChart.dndPanel.diamond": "Diamond",
12
+ "flowChart.controlPanel.zoomOut": "Out",
13
+ "flowChart.controlPanel.zoomIn": "In",
14
+ "flowChart.controlPanel.fit": "Fit",
15
+ "flowChart.controlPanel.back": "Back",
16
+ "flowChart.controlPanel.forward": "Forward",
17
+ "flowChart.controlPanel.zoomOutTitle": "Zoom Out View",
18
+ "flowChart.controlPanel.zoomInTitle": "Zoom In View",
19
+ "flowChart.controlPanel.fitTitle": "Fit View Size",
20
+ "flowChart.controlPanel.backTitle": "Step Back",
21
+ "flowChart.controlPanel.forwardTitle": "Step Forward",
22
+ "flowChart.contextMenu.copy": "Copy",
23
+ "flowChart.contextMenu.deleteContent": "Delete",
24
+ "flowChart.contextMenu.deleteNode": "Delete Node",
25
+ "flowChart.contextMenu.deleteEdge": "Delete Edge",
26
+ "flowChart.controlPanel.panelStatusTitle": "Panel Status",
27
+ "flowChart.controlPanel.screenTypeTitle": "Screen Type"
28
+ };
29
+ exports.FLOW_CHART_EN_US = FLOW_CHART_EN_US;
30
+ //# sourceMappingURL=en-us.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-us.cjs.js","sources":["../../../../../src/modules/flow-chart/i18n/en-us.ts"],"sourcesContent":["export const FLOW_CHART_EN_US = {\n 'flowChart.controlPanel.export': 'Export',\n 'flowChart.controlPanel.import': 'Import',\n 'flowChart.controlPanel.setEdgeTypeTitle': 'Set Edge Type',\n 'flowChart.dndPanel.selection': 'Selection',\n 'flowChart.dndPanel.rectangle': 'Rectangle',\n 'flowChart.dndPanel.circle': 'Circle',\n 'flowChart.dndPanel.ellipse': 'Ellipse',\n 'flowChart.dndPanel.diamond': 'Diamond',\n 'flowChart.controlPanel.zoomOut': 'Out',\n 'flowChart.controlPanel.zoomIn': 'In',\n 'flowChart.controlPanel.fit': 'Fit',\n 'flowChart.controlPanel.back': 'Back',\n 'flowChart.controlPanel.forward': 'Forward',\n 'flowChart.controlPanel.zoomOutTitle': 'Zoom Out View',\n 'flowChart.controlPanel.zoomInTitle': 'Zoom In View',\n 'flowChart.controlPanel.fitTitle': 'Fit View Size',\n 'flowChart.controlPanel.backTitle': 'Step Back',\n 'flowChart.controlPanel.forwardTitle': 'Step Forward',\n 'flowChart.contextMenu.copy': 'Copy',\n 'flowChart.contextMenu.deleteContent': 'Delete',\n 'flowChart.contextMenu.deleteNode': 'Delete Node',\n 'flowChart.contextMenu.deleteEdge': 'Delete Edge',\n 'flowChart.controlPanel.panelStatusTitle': 'Panel Status',\n 'flowChart.controlPanel.screenTypeTitle': 'Screen Type',\n}\n"],"names":[],"mappings":";;AAAO,MAAM,mBAAmB;AAAA,EAC9B,iCAAiC;AAAA,EACjC,iCAAiC;AAAA,EACjC,2CAA2C;AAAA,EAC3C,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,8BAA8B;AAAA,EAC9B,kCAAkC;AAAA,EAClC,iCAAiC;AAAA,EACjC,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,kCAAkC;AAAA,EAClC,uCAAuC;AAAA,EACvC,sCAAsC;AAAA,EACtC,mCAAmC;AAAA,EACnC,oCAAoC;AAAA,EACpC,uCAAuC;AAAA,EACvC,8BAA8B;AAAA,EAC9B,uCAAuC;AAAA,EACvC,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,2CAA2C;AAAA,EAC3C,0CAA0C;AAC5C;;"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const enUs = require("./en-us.cjs.js");
4
+ const zhCn = require("./zh-cn.cjs.js");
5
+ function registerFlowChartI18N(I18N) {
6
+ I18N.register({
7
+ "en-US": enUs.FLOW_CHART_EN_US,
8
+ "zh-CN": zhCn.FLOW_CHART_ZH_CN
9
+ }, false);
10
+ }
11
+ exports.registerFlowChartI18N = registerFlowChartI18N;
12
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../../src/modules/flow-chart/i18n/index.ts"],"sourcesContent":["import { FLOW_CHART_EN_US } from './en-us'\nimport { FLOW_CHART_ZH_CN } from './zh-cn'\n\nexport function registerFlowChartI18N(I18N: any) {\n I18N.register({\n 'en-US': FLOW_CHART_EN_US,\n 'zh-CN': FLOW_CHART_ZH_CN,\n }, false)\n}\n"],"names":["FLOW_CHART_EN_US","FLOW_CHART_ZH_CN"],"mappings":";;;;AAGO,SAAS,sBAAsB,MAAW;AAC/C,OAAK,SAAS;AAAA,IACZ,SAASA,KAAAA;AAAAA,IACT,SAASC,KAAAA;AAAAA,EAAA,GACR,KAAK;AACV;;"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const FLOW_CHART_ZH_CN = {
4
+ "flowChart.controlPanel.export": "导出",
5
+ "flowChart.controlPanel.import": "导入",
6
+ "flowChart.controlPanel.setEdgeTypeTitle": "设置边类型",
7
+ "flowChart.dndPanel.selection": "选区",
8
+ "flowChart.dndPanel.rectangle": "矩形",
9
+ "flowChart.dndPanel.circle": "圆形",
10
+ "flowChart.dndPanel.ellipse": "椭圆",
11
+ "flowChart.dndPanel.diamond": "菱形",
12
+ "flowChart.controlPanel.zoomOut": "缩小",
13
+ "flowChart.controlPanel.zoomIn": "放大",
14
+ "flowChart.controlPanel.fit": "适应",
15
+ "flowChart.controlPanel.back": "上一步",
16
+ "flowChart.controlPanel.forward": "下一步",
17
+ "flowChart.controlPanel.zoomOutTitle": "缩小视图",
18
+ "flowChart.controlPanel.zoomInTitle": "放大视图",
19
+ "flowChart.controlPanel.fitTitle": "适应视图大小",
20
+ "flowChart.controlPanel.backTitle": "上一步",
21
+ "flowChart.controlPanel.forwardTitle": "下一步",
22
+ "flowChart.contextMenu.copy": "复制",
23
+ "flowChart.contextMenu.deleteContent": "删除",
24
+ "flowChart.contextMenu.deleteNode": "删除节点",
25
+ "flowChart.contextMenu.deleteEdge": "删除边",
26
+ "flowChart.controlPanel.panelStatusTitle": "面板状态",
27
+ "flowChart.controlPanel.screenTypeTitle": "屏幕类型"
28
+ };
29
+ exports.FLOW_CHART_ZH_CN = FLOW_CHART_ZH_CN;
30
+ //# sourceMappingURL=zh-cn.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-cn.cjs.js","sources":["../../../../../src/modules/flow-chart/i18n/zh-cn.ts"],"sourcesContent":["export const FLOW_CHART_ZH_CN = {\n 'flowChart.controlPanel.export': '导出',\n 'flowChart.controlPanel.import': '导入',\n 'flowChart.controlPanel.setEdgeTypeTitle': '设置边类型',\n 'flowChart.dndPanel.selection': '选区',\n 'flowChart.dndPanel.rectangle': '矩形',\n 'flowChart.dndPanel.circle': '圆形',\n 'flowChart.dndPanel.ellipse': '椭圆',\n 'flowChart.dndPanel.diamond': '菱形',\n 'flowChart.controlPanel.zoomOut': '缩小',\n 'flowChart.controlPanel.zoomIn': '放大',\n 'flowChart.controlPanel.fit': '适应',\n 'flowChart.controlPanel.back': '上一步',\n 'flowChart.controlPanel.forward': '下一步',\n 'flowChart.controlPanel.zoomOutTitle': '缩小视图',\n 'flowChart.controlPanel.zoomInTitle': '放大视图',\n 'flowChart.controlPanel.fitTitle': '适应视图大小',\n 'flowChart.controlPanel.backTitle': '上一步',\n 'flowChart.controlPanel.forwardTitle': '下一步',\n 'flowChart.contextMenu.copy': '复制',\n 'flowChart.contextMenu.deleteContent': '删除',\n 'flowChart.contextMenu.deleteNode': '删除节点',\n 'flowChart.contextMenu.deleteEdge': '删除边',\n 'flowChart.controlPanel.panelStatusTitle': '面板状态',\n 'flowChart.controlPanel.screenTypeTitle': '屏幕类型',\n}\n"],"names":[],"mappings":";;AAAO,MAAM,mBAAmB;AAAA,EAC9B,iCAAiC;AAAA,EACjC,iCAAiC;AAAA,EACjC,2CAA2C;AAAA,EAC3C,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,8BAA8B;AAAA,EAC9B,kCAAkC;AAAA,EAClC,iCAAiC;AAAA,EACjC,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,kCAAkC;AAAA,EAClC,uCAAuC;AAAA,EACvC,sCAAsC;AAAA,EACtC,mCAAmC;AAAA,EACnC,oCAAoC;AAAA,EACpC,uCAAuC;AAAA,EACvC,8BAA8B;AAAA,EAC9B,uCAAuC;AAAA,EACvC,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,2CAA2C;AAAA,EAC3C,0CAA0C;AAC5C;;"}