@bytechain.cn/colamd 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/.trae/specs/optimize-theme-loading/checklist.md +20 -0
  2. package/.trae/specs/optimize-theme-loading/spec.md +103 -0
  3. package/.trae/specs/optimize-theme-loading/tasks.md +40 -0
  4. package/CHANGELOG.md +320 -0
  5. package/CLAUDE.md +56 -0
  6. package/README.md +498 -26
  7. package/README_CN.md +554 -27
  8. package/android/app/build/.npmkeep +0 -0
  9. package/android/app/build.gradle +76 -0
  10. package/android/app/capacitor.build.gradle +24 -0
  11. package/android/app/proguard-rules.pro +21 -0
  12. package/android/app/release.keystore +0 -0
  13. package/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
  14. package/android/app/src/main/AndroidManifest.xml +64 -0
  15. package/android/app/src/main/java/cn/bytechain/colamd/MainActivity.java +180 -0
  16. package/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  17. package/android/app/src/main/res/drawable/splash.png +0 -0
  18. package/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  19. package/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  20. package/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  21. package/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  22. package/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  23. package/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  24. package/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  25. package/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  26. package/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  27. package/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  28. package/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  29. package/android/app/src/main/res/layout/activity_main.xml +12 -0
  30. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  31. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  32. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  33. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  34. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  35. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  36. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  37. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  38. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  39. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  40. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  41. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  42. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  43. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  44. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  45. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  46. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  47. package/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
  48. package/android/app/src/main/res/values/strings.xml +7 -0
  49. package/android/app/src/main/res/values/styles.xml +22 -0
  50. package/android/app/src/main/res/xml/file_paths.xml +5 -0
  51. package/android/app/src/main/res/xml/network_security_config.xml +8 -0
  52. package/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
  53. package/android/build.gradle +29 -0
  54. package/android/capacitor.settings.gradle +21 -0
  55. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  56. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  57. package/android/gradle.properties +22 -0
  58. package/android/gradlew +248 -0
  59. package/android/gradlew.bat +92 -0
  60. package/android/settings.gradle +5 -0
  61. package/android/variables.gradle +16 -0
  62. package/capacitor.config.js +29 -0
  63. package/capacitor.config.ts +30 -0
  64. package/demo.md +191 -484
  65. package/dist/main/index.js +91 -51
  66. package/dist/preload/index.js +1 -1
  67. package/dist/renderer/assets/{arc-tTbbM8LO.js → arc-_lugyDzx.js} +1 -1
  68. package/dist/renderer/assets/{architectureDiagram-3BPJPVTR-CEgYow6c.js → architectureDiagram-3BPJPVTR-DDfP-F9D.js} +4 -3
  69. package/dist/renderer/assets/{blockDiagram-GPEHLZMM-LHyVtPwW.js → blockDiagram-GPEHLZMM-DOETUKma.js} +5 -4
  70. package/dist/renderer/assets/{c4Diagram-AAUBKEIU-C1P1eJrf.js → c4Diagram-AAUBKEIU-kAmLfVtk.js} +3 -2
  71. package/dist/renderer/assets/{channel-upve91Tq.js → channel-CD4vJFwr.js} +1 -1
  72. package/dist/renderer/assets/{chunk-2J33WTMH-lag2vhq9.js → chunk-2J33WTMH-DkVrgw4l.js} +1 -1
  73. package/dist/renderer/assets/{chunk-4BX2VUAB-BXJ8Ggh-.js → chunk-4BX2VUAB-JTZ-VKNX.js} +1 -1
  74. package/dist/renderer/assets/{chunk-55IACEB6-CiBpxRa1.js → chunk-55IACEB6-Di_O5box.js} +1 -1
  75. package/dist/renderer/assets/{chunk-727SXJPM-ODeKQFXC.js → chunk-727SXJPM-BgKvwR8w.js} +5 -5
  76. package/dist/renderer/assets/{chunk-AQP2D5EJ-BK7xJolB.js → chunk-AQP2D5EJ-DonSXCCQ.js} +3 -3
  77. package/dist/renderer/assets/{chunk-FMBD7UC4-BxpCZPtz.js → chunk-FMBD7UC4-CsV8Lmy6.js} +1 -1
  78. package/dist/renderer/assets/{chunk-ND2GUHAM-CqqaU9Ue.js → chunk-ND2GUHAM-C_-_dlq7.js} +1 -1
  79. package/dist/renderer/assets/{chunk-QZHKN3VN-Biq_K124.js → chunk-QZHKN3VN-aCmcDsfu.js} +1 -1
  80. package/dist/renderer/assets/{classDiagram-v2-Q7XG4LA2-Cq95X99o.js → classDiagram-4FO5ZUOK-nuHQLjzM.js} +7 -6
  81. package/dist/renderer/assets/{classDiagram-4FO5ZUOK-Cq95X99o.js → classDiagram-v2-Q7XG4LA2-nuHQLjzM.js} +7 -6
  82. package/dist/renderer/assets/{cose-bilkent-S5V4N54A-XasiD0bu.js → cose-bilkent-S5V4N54A-Di1_SXt9.js} +2 -1
  83. package/dist/renderer/assets/{dagre-BM42HDAG-Nq84Gfx4.js → dagre-BM42HDAG-CqOUIYsL.js} +4 -3
  84. package/dist/renderer/assets/{diagram-2AECGRRQ-DwuB1GWt.js → diagram-2AECGRRQ-F-fP19TC.js} +4 -3
  85. package/dist/renderer/assets/{diagram-5GNKFQAL-C2tgeI1h.js → diagram-5GNKFQAL-BD5XZc8G.js} +5 -4
  86. package/dist/renderer/assets/{diagram-KO2AKTUF-D5KzjNBc.js → diagram-KO2AKTUF-Qa3ZxA67.js} +4 -3
  87. package/dist/renderer/assets/{diagram-LMA3HP47-C12xHS1c.js → diagram-LMA3HP47-DqDnw2RA.js} +4 -3
  88. package/dist/renderer/assets/{diagram-OG6HWLK6-CnxI9oEa.js → diagram-OG6HWLK6-BH4Elzby.js} +5 -4
  89. package/dist/renderer/assets/{erDiagram-TEJ5UH35-D_uPaKwn.js → erDiagram-TEJ5UH35-CaKZCewa.js} +5 -4
  90. package/dist/renderer/assets/{flowDiagram-I6XJVG4X-B6q_1-tE.js → flowDiagram-I6XJVG4X-C8znUgyL.js} +7 -6
  91. package/dist/renderer/assets/{ganttDiagram-6RSMTGT7-CFo7ifF9.js → ganttDiagram-6RSMTGT7-DnRvbMnU.js} +3 -2
  92. package/dist/renderer/assets/{gitGraphDiagram-PVQCEYII-WSexHTnq.js → gitGraphDiagram-PVQCEYII-CZuRZzk4.js} +5 -4
  93. package/dist/renderer/assets/{graph-DyX_9f6d.js → graph-CYiEKt0j.js} +1 -1
  94. package/dist/renderer/assets/index-B4uDgADr.js +530 -0
  95. package/dist/renderer/assets/{index-DW7LS8C1.js → index-BX6JHKv6.js} +1430 -408
  96. package/dist/renderer/assets/index-CBcVpA3d.js +30 -0
  97. package/dist/renderer/assets/index-CGj1spkU.js +27 -0
  98. package/dist/renderer/assets/{index-dyHEFYvY.css → index-CcwAgVRi.css} +442 -400
  99. package/dist/renderer/assets/index-D4CPFkph.js +9 -0
  100. package/dist/renderer/assets/index-DxOzbfR-.js +110 -0
  101. package/dist/renderer/assets/index-Y89U1ptl.js +9 -0
  102. package/dist/renderer/assets/{infoDiagram-5YYISTIA-DaeJdLRq.js → infoDiagram-5YYISTIA-BlBUdqMb.js} +3 -2
  103. package/dist/renderer/assets/{ishikawaDiagram-YF4QCWOH-DDCZc35f.js → ishikawaDiagram-YF4QCWOH-TeVytCrP.js} +2 -1
  104. package/dist/renderer/assets/{journeyDiagram-JHISSGLW-BEdmpAgl.js → journeyDiagram-JHISSGLW-BLZa3jnX.js} +5 -4
  105. package/dist/renderer/assets/{kanban-definition-UN3LZRKU-BEFtQcFb.js → kanban-definition-UN3LZRKU-foVxWrJn.js} +3 -2
  106. package/dist/renderer/assets/{layout-CAJgQHdw.js → layout-DOAlFUVb.js} +2 -2
  107. package/dist/renderer/assets/{linear-B2ggJ8Am.js → linear-BMBn6kVq.js} +1 -1
  108. package/dist/renderer/assets/{mindmap-definition-RKZ34NQL-DSxVgHB5.js → mindmap-definition-RKZ34NQL-5pGeNCcp.js} +4 -3
  109. package/dist/renderer/assets/{pieDiagram-4H26LBE5-CwYoJBuL.js → pieDiagram-4H26LBE5-N9aAUxfr.js} +5 -4
  110. package/dist/renderer/assets/preload-helper-tXtZnHb0.js +88 -0
  111. package/dist/renderer/assets/{quadrantDiagram-W4KKPZXB-CST9Fvg9.js → quadrantDiagram-W4KKPZXB-BPxbtjga.js} +3 -2
  112. package/dist/renderer/assets/{requirementDiagram-4Y6WPE33-DtrH52jS.js → requirementDiagram-4Y6WPE33-CK1LrJyG.js} +4 -3
  113. package/dist/renderer/assets/{sankeyDiagram-5OEKKPKP-ca1tPzJ_.js → sankeyDiagram-5OEKKPKP-BNj7Sqii.js} +2 -1
  114. package/dist/renderer/assets/{sequenceDiagram-3UESZ5HK-Dfp1EJZ7.js → sequenceDiagram-3UESZ5HK-B-r7lNhI.js} +4 -3
  115. package/dist/renderer/assets/{stateDiagram-AJRCARHV-Bha2QoNB.js → stateDiagram-AJRCARHV-wrWE0MRa.js} +7 -6
  116. package/dist/renderer/assets/{stateDiagram-v2-BHNVJYJU-DWgFUYu1.js → stateDiagram-v2-BHNVJYJU-CE-Lqo2d.js} +5 -4
  117. package/dist/renderer/assets/{timeline-definition-PNZ67QCA-C3h_-OTj.js → timeline-definition-PNZ67QCA-BkeMGH4J.js} +3 -2
  118. package/dist/renderer/assets/{vennDiagram-CIIHVFJN-DFzjSrZi.js → vennDiagram-CIIHVFJN-BTxVzto3.js} +2 -1
  119. package/dist/renderer/assets/{wardley-L42UT6IY-Cx-VbqoS.js → wardley-L42UT6IY-b-_GPpqL.js} +1 -1
  120. package/dist/renderer/assets/{wardleyDiagram-YWT4CUSO-S2D9XqX6.js → wardleyDiagram-YWT4CUSO-D2r5dVGW.js} +4 -3
  121. package/dist/renderer/assets/web-BKE0SH0E.js +36 -0
  122. package/dist/renderer/assets/web-CBsFp24u.js +564 -0
  123. package/dist/renderer/assets/web-Dc8YgoHP.js +24 -0
  124. package/dist/renderer/assets/web-TfDzToU7.js +58 -0
  125. package/dist/renderer/assets/{xychartDiagram-2RQKCTM6-Cfxigbts.js → xychartDiagram-2RQKCTM6-BHQdINVc.js} +3 -2
  126. package/dist/renderer/index.html +62 -3
  127. package/docs/RELEASE_NOTES_v1.5.1.md +382 -0
  128. package/docs/academic-demo.md +567 -0
  129. package/docs/demo.html +748 -0
  130. package/docs/demo.md +546 -0
  131. package/docs/demo.pdf +0 -0
  132. package/docs/theme-paradigm.md +797 -0
  133. package/electron-builder.yml +7 -0
  134. package/electron.vite.config.js +31 -0
  135. package/electron.vite.config.ts +1 -1
  136. package/ios/App/App/AppDelegate.swift +49 -0
  137. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  138. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  139. package/ios/App/App/Assets.xcassets/Contents.json +6 -0
  140. package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  141. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  142. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  143. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  144. package/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  145. package/ios/App/App/Base.lproj/Main.storyboard +19 -0
  146. package/ios/App/App/Info.plist +49 -0
  147. package/ios/App/App.xcodeproj/project.pbxproj +408 -0
  148. package/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  149. package/ios/App/Podfile +28 -0
  150. package/package.json +23 -3
  151. package/resources/templates/slides/template-forest-ink.html +540 -0
  152. package/scripts/generate-icons.js +102 -0
  153. package/src/main/index.ts +106 -68
  154. package/src/preload/index.d.ts +51 -0
  155. package/src/preload/index.js +70 -0
  156. package/src/preload/index.ts +2 -2
  157. package/src/renderer/capacitor-api.ts +713 -0
  158. package/src/renderer/editor/editor.ts +102 -19
  159. package/src/renderer/editor/plugins/index.ts +42 -32
  160. package/src/renderer/editor/plugins/math-plugin.ts +9 -1
  161. package/src/renderer/editor/plugins/mermaid-plugin-custom.css +13 -398
  162. package/src/renderer/editor/plugins/mermaid-plugin.ts +72 -71
  163. package/src/renderer/editor/plugins/themes/base/dark.css +23 -0
  164. package/src/renderer/editor/plugins/themes/base/elegant.css +32 -0
  165. package/src/renderer/editor/plugins/themes/base/light.css +20 -0
  166. package/src/renderer/editor/plugins/themes/base/newsprint.css +27 -0
  167. package/src/renderer/editor/plugins/themes/components/mermaid/academic.css +43 -0
  168. package/src/renderer/editor/plugins/themes/components/mermaid/dark.css +20 -0
  169. package/src/renderer/editor/plugins/themes/components/mermaid/elegant.css +24 -0
  170. package/src/renderer/editor/plugins/themes/components/mermaid/light.css +21 -0
  171. package/src/renderer/editor/plugins/themes/components/mermaid/newsprint.css +26 -0
  172. package/src/renderer/editor/plugins/themes/components/mermaid/variables.css +592 -0
  173. package/src/renderer/editor/plugins/themes/foundation.css +143 -0
  174. package/src/renderer/editor/plugins/themes/theme-manager.ts +133 -0
  175. package/src/renderer/env.d.ts +4 -1
  176. package/src/renderer/index.html +59 -1
  177. package/src/renderer/main.ts +581 -109
  178. package/src/renderer/mobile.css +428 -0
  179. package/themes/README.md +20 -0
  180. package/themes/academic-paper-pt.css +1321 -0
  181. package/themes/academic-paper.css +1416 -0
  182. package/themes/elegant.css +14 -7
  183. package/themes/forest-ink.css +664 -0
  184. package/themes/pixso-design.css +1261 -0
  185. package/themes/swiss-design.css +596 -0
  186. package/themes/template.css +498 -0
  187. package/tsconfig.main.json +1 -0
  188. package/tsconfig.main.tsbuildinfo +1 -0
  189. package/tsconfig.preload.json +1 -0
  190. package/tsconfig.preload.tsbuildinfo +1 -0
  191. package/tsconfig.renderer.json +1 -0
  192. package/tsconfig.renderer.tsbuildinfo +1 -0
  193. package/tsconfig.tsbuildinfo +1 -0
  194. package/.trae/documents/fix-mermaid-colors-and-sankey.md +0 -50
  195. package/src/renderer/themes/theme-manager.ts +0 -40
  196. /package/src/renderer/{themes → editor/plugins/themes}/base.css +0 -0
@@ -5,6 +5,15 @@ const promises = require("fs/promises");
5
5
  const fs = require("fs");
6
6
  const http = require("http");
7
7
  const themesDir = path.join(electron.app.getPath("home"), ".colamd", "themes");
8
+ const BASE_PRINT_CSS = [
9
+ "html, body { height:auto !important; overflow:visible !important; -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }",
10
+ "#titlebar, #slides-btn, #agent-dot { display:none !important; }",
11
+ "#editor { height:auto !important; overflow:visible !important; }",
12
+ "#editor .ProseMirror { min-height:auto !important; }",
13
+ ".mermaid-error, .mermaid-loading { display:none !important; }",
14
+ "svg .error-icon, svg .error-text { display:none !important; }",
15
+ ".math-inline-raw, .math-block-raw, textarea.mermaid-source { display:none !important; }"
16
+ ].join("\n");
8
17
  function ensureThemesDir() {
9
18
  if (!fs.existsSync(themesDir)) {
10
19
  promises.mkdir(themesDir, { recursive: true }).catch(() => {
@@ -73,7 +82,7 @@ function suggestFileName(win, content) {
73
82
  }
74
83
  function stopWatching(state) {
75
84
  if (state.watcher) {
76
- state.watcher.close();
85
+ clearInterval(state.watcher);
77
86
  state.watcher = null;
78
87
  }
79
88
  if (state.agentCooldownTimer) {
@@ -111,24 +120,34 @@ function watchFile(win, state) {
111
120
  if (!state.filePath) return;
112
121
  stopWatching(state);
113
122
  const filePath = state.filePath;
114
- state.watcher = fs.watch(filePath, (eventType) => {
115
- if (eventType !== "change" || state.isInternalSave) return;
116
- const now = Date.now();
117
- const gap = now - state.lastExternalChange;
118
- state.lastExternalChange = now;
119
- if (gap > 0 && gap < 2e3) {
120
- transitionAgentState(win, state, "active");
121
- } else if (state.agentState === "active") {
122
- transitionAgentState(win, state, "active");
123
- }
124
- if (state.debounceTimer) clearTimeout(state.debounceTimer);
125
- state.debounceTimer = setTimeout(() => {
126
- promises.readFile(filePath, "utf-8").then((data) => {
127
- if (!win.isDestroyed()) win.webContents.send("file-changed", resolveImagePaths(data, filePath));
128
- }).catch(() => {
129
- });
130
- }, 100);
123
+ let lastMtime = 0;
124
+ promises.stat(filePath).then((s) => {
125
+ lastMtime = s.mtimeMs;
126
+ }).catch(() => {
131
127
  });
128
+ state.watcher = setInterval(() => {
129
+ if (state.isInternalSave) return;
130
+ promises.stat(filePath).then((s) => {
131
+ if (s.mtimeMs === lastMtime) return;
132
+ lastMtime = s.mtimeMs;
133
+ const now = Date.now();
134
+ const gap = now - state.lastExternalChange;
135
+ state.lastExternalChange = now;
136
+ if (gap > 0 && gap < 2e3) {
137
+ transitionAgentState(win, state, "active");
138
+ } else if (state.agentState === "active") {
139
+ transitionAgentState(win, state, "active");
140
+ }
141
+ if (state.debounceTimer) clearTimeout(state.debounceTimer);
142
+ state.debounceTimer = setTimeout(() => {
143
+ promises.readFile(filePath, "utf-8").then((data) => {
144
+ if (!win.isDestroyed()) win.webContents.send("file-changed", resolveImagePaths(data, filePath));
145
+ }).catch(() => {
146
+ });
147
+ }, 100);
148
+ }).catch(() => {
149
+ });
150
+ }, 500);
132
151
  }
133
152
  function resolveImagePaths(content, filePath) {
134
153
  const dir = path.dirname(filePath);
@@ -306,35 +325,39 @@ electron.ipcMain.handle("save-export-file", async (event, dataUrl, defaultName)
306
325
  return false;
307
326
  }
308
327
  });
309
- electron.ipcMain.handle("export-pdf", async (event) => {
328
+ electron.ipcMain.handle("export-pdf", async (event, printCSS) => {
310
329
  const win = getWinFromEvent(event);
311
330
  if (!win) return false;
331
+ const defaultName = (suggestFileName(win) || "colamd-print") + ".pdf";
312
332
  const result = await electron.dialog.showSaveDialog(win, {
313
- defaultPath: suggestFileName(win),
333
+ defaultPath: defaultName,
314
334
  filters: [{ name: "PDF", extensions: ["pdf"] }]
315
335
  });
316
336
  if (result.canceled || !result.filePath) return false;
317
337
  try {
318
- const cssKey = await win.webContents.insertCSS(
319
- "html, body { height: auto !important; overflow: visible !important; } #titlebar { display: none !important; } #editor { height: auto !important; overflow: visible !important; } #editor .ProseMirror { min-height: auto !important; } .mermaid-error { display: none !important; } .mermaid-loading { display: none !important; } svg .error-icon, svg .error-text { display: none !important; } .math-inline-raw, .math-block-raw, textarea.mermaid-source { display: none !important; }"
320
- );
321
- const pdfData = await win.webContents.printToPDF({
322
- marginType: 0,
323
- printBackground: true,
324
- pageSize: "A4"
325
- });
338
+ const cssKey = await win.webContents.insertCSS(BASE_PRINT_CSS + "\n" + (printCSS || ""));
339
+ await new Promise((r) => setTimeout(r, 200));
340
+ const pdfData = await Promise.race([
341
+ win.webContents.printToPDF({
342
+ printBackground: true,
343
+ pageSize: "A4"
344
+ }),
345
+ new Promise((_, reject) => setTimeout(() => reject(new Error("PDF timeout")), 3e4))
346
+ ]);
326
347
  await win.webContents.removeInsertedCSS(cssKey);
327
348
  await promises.writeFile(result.filePath, pdfData);
328
349
  return true;
329
- } catch {
350
+ } catch (e) {
351
+ console.error("[export-pdf] PDF export failed:", e);
330
352
  return false;
331
353
  }
332
354
  });
333
355
  electron.ipcMain.handle("export-html", async (event, htmlContent) => {
334
356
  const win = getWinFromEvent(event);
335
357
  if (!win) return false;
358
+ const defaultName = (suggestFileName(win) || "colamd-export") + ".html";
336
359
  const result = await electron.dialog.showSaveDialog(win, {
337
- defaultPath: suggestFileName(win),
360
+ defaultPath: defaultName,
338
361
  filters: [{ name: "HTML", extensions: ["html"] }]
339
362
  });
340
363
  if (result.canceled || !result.filePath) return false;
@@ -530,7 +553,8 @@ electron.ipcMain.handle("load-custom-theme", async (event) => {
530
553
  const destPath = path.join(themesDir, fileName);
531
554
  await promises.copyFile(srcPath, destPath);
532
555
  const css = await promises.readFile(destPath, "utf-8");
533
- buildMenu();
556
+ invalidateThemeCache();
557
+ await buildMenu();
534
558
  return { name: fileName, css };
535
559
  } catch {
536
560
  return null;
@@ -551,14 +575,32 @@ electron.ipcMain.handle("register-plugins", (_event, plugins) => {
551
575
  checked: p.enabled,
552
576
  click: () => sendToFocused("menu-toggle-plugin", p.id)
553
577
  }));
554
- buildMenu();
578
+ void buildMenu();
555
579
  return true;
556
580
  });
557
581
  electron.ipcMain.handle("sync-plugin-state", (_event, id, enabled) => {
558
582
  const item = pluginMenuItems.find((p) => p.id === id);
559
583
  if (item) item.checked = enabled;
560
- buildMenu();
584
+ void buildMenu();
561
585
  });
586
+ let cachedThemeFiles = [];
587
+ let themeFilesValid = false;
588
+ function invalidateThemeCache() {
589
+ themeFilesValid = false;
590
+ }
591
+ async function scanThemeFiles() {
592
+ try {
593
+ const files = await promises.readdir(themesDir);
594
+ cachedThemeFiles = files.filter((f) => f.endsWith(".css")).sort();
595
+ } catch {
596
+ cachedThemeFiles = [];
597
+ }
598
+ themeFilesValid = true;
599
+ }
600
+ async function getCachedThemeFiles() {
601
+ if (!themeFilesValid) await scanThemeFiles();
602
+ return cachedThemeFiles;
603
+ }
562
604
  function getFocusedWindow() {
563
605
  return electron.BrowserWindow.getFocusedWindow();
564
606
  }
@@ -566,25 +608,22 @@ function sendToFocused(channel, ...args) {
566
608
  const win = getFocusedWindow();
567
609
  if (win) win.webContents.send(channel, ...args);
568
610
  }
569
- function buildMenu() {
611
+ async function buildMenu() {
570
612
  const isMac = process.platform === "darwin";
571
613
  const customThemeItems = [];
572
- try {
573
- const files = fs.readdirSync(themesDir).filter((f) => f.endsWith(".css")).sort();
574
- for (const file of files) {
575
- customThemeItems.push({
576
- label: file.replace(/\.css$/, ""),
577
- click: async () => {
578
- try {
579
- const css = await promises.readFile(path.join(themesDir, file), "utf-8");
580
- sendToFocused("set-theme", `custom:${file}`);
581
- sendToFocused("set-custom-css", css);
582
- } catch {
583
- }
614
+ const files = await getCachedThemeFiles();
615
+ for (const file of files) {
616
+ customThemeItems.push({
617
+ label: file.replace(/\.css$/, ""),
618
+ click: async () => {
619
+ try {
620
+ const css = await promises.readFile(path.join(themesDir, file), "utf-8");
621
+ sendToFocused("set-theme", `custom:${file}`);
622
+ sendToFocused("set-custom-css", css);
623
+ } catch {
584
624
  }
585
- });
586
- }
587
- } catch {
625
+ }
626
+ });
588
627
  }
589
628
  const themeSubmenu = [
590
629
  { label: "Light", click: () => sendToFocused("set-theme", "light") },
@@ -702,9 +741,10 @@ function buildMenu() {
702
741
  ];
703
742
  electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate(template));
704
743
  }
705
- electron.app.whenReady().then(() => {
744
+ electron.app.whenReady().then(async () => {
706
745
  ensureThemesDir();
707
- buildMenu();
746
+ await scanThemeFiles();
747
+ await buildMenu();
708
748
  const args = process.argv.slice(electron.app.isPackaged ? 1 : 2);
709
749
  const fileArgs = args.filter((arg) => !arg.startsWith("-"));
710
750
  if (fileArgs.length > 0) {
@@ -5,7 +5,7 @@ electron.contextBridge.exposeInMainWorld("electronAPI", {
5
5
  openFilePath: (path) => electron.ipcRenderer.invoke("open-file-path", path),
6
6
  saveFile: (content) => electron.ipcRenderer.invoke("save-file", content),
7
7
  saveFileAs: (content) => electron.ipcRenderer.invoke("save-file-as", content),
8
- exportPDF: () => electron.ipcRenderer.invoke("export-pdf"),
8
+ exportPDF: (printCSS) => electron.ipcRenderer.invoke("export-pdf", printCSS),
9
9
  exportHTML: (html) => electron.ipcRenderer.invoke("export-html", html),
10
10
  exportSlides: (content) => electron.ipcRenderer.invoke("export-slides", content),
11
11
  newSlides: () => electron.ipcRenderer.invoke("new-slides"),
@@ -1,4 +1,4 @@
1
- import { a0 as withPath, a1 as halfPi, a2 as epsilon, a3 as tau, a4 as cos, a5 as sin, a6 as min, a7 as abs, a8 as pi, a9 as sqrt, aa as atan2, ab as constant, ac as asin, ad as acos, ae as max } from "./index-DW7LS8C1.js";
1
+ import { a0 as withPath, a1 as halfPi, a2 as epsilon, a3 as tau, a4 as cos, a5 as sin, a6 as min, a7 as abs, a8 as pi, a9 as sqrt, aa as atan2, ab as constant, ac as asin, ad as acos, ae as max } from "./index-BX6JHKv6.js";
2
2
  function arcInnerRadius(d) {
3
3
  return d.innerRadius;
4
4
  }
@@ -1,7 +1,8 @@
1
- import { b4 as getDefaultExportFromCjs, _ as __name, I as selectSvgElement, Y as setupGraphViewbox, l as log, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, c as getConfig2, aO as createText, b5 as getIconSVG, i as sanitizeText, d as select, x as getEdgeId, b6 as registerIconPacks, b7 as unknownIcon } from "./index-DW7LS8C1.js";
2
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
3
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { b4 as getDefaultExportFromCjs, _ as __name, I as selectSvgElement, Y as setupGraphViewbox, l as log, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, c as getConfig2, aO as createText, b5 as getIconSVG, i as sanitizeText, d as select, x as getEdgeId, b6 as registerIconPacks, b7 as unknownIcon } from "./index-BX6JHKv6.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
3
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
4
  import { c as cytoscape$1 } from "./cytoscape.esm-CpHeHM5e.js";
5
+ import "./preload-helper-tXtZnHb0.js";
5
6
  var cytoscapeFcose$1 = { exports: {} };
6
7
  var coseBase$1 = { exports: {} };
7
8
  var layoutBase$1 = { exports: {} };
@@ -1,7 +1,8 @@
1
- import { g as getIconStyles } from "./chunk-FMBD7UC4-BxpCZPtz.js";
2
- import { an as isPrimitive, ao as getTag, ap as isTypedArray, aq as arrayBufferTag, ar as dataViewTag, as as booleanTag, at as numberTag, au as stringTag, av as dateTag, aw as regexpTag, ax as symbolTag, ay as mapTag, az as setTag, aA as argumentsTag, aB as uint32ArrayTag, aC as uint16ArrayTag, aD as uint8ClampedArrayTag, aE as uint8ArrayTag, aF as objectTag, aG as int32ArrayTag, aH as int16ArrayTag, aI as int8ArrayTag, aJ as float64ArrayTag, aK as float32ArrayTag, aL as arrayTag, _ as __name, D as getConfig, d as select, e as configureSvgSize, l as log, z as clear, B as rgba, aM as getLineFunctionsWithOffset, R as line, S as curveBasis, c as getConfig2, O as getUrl, aN as getEffectiveHtmlLabels, aO as createText, aP as computeLabelTransform, aQ as getSubGraphTitleMargins, u as utils_default, k as common_default, aR as getStylesFromArray, i as sanitizeText, aS as decodeEntities, aT as configureLabelImages } from "./index-DW7LS8C1.js";
3
- import { G as Graph } from "./graph-DyX_9f6d.js";
4
- import { c as channel } from "./channel-upve91Tq.js";
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-CsV8Lmy6.js";
2
+ import { an as isPrimitive, ao as getTag, ap as isTypedArray, aq as arrayBufferTag, ar as dataViewTag, as as booleanTag, at as numberTag, au as stringTag, av as dateTag, aw as regexpTag, ax as symbolTag, ay as mapTag, az as setTag, aA as argumentsTag, aB as uint32ArrayTag, aC as uint16ArrayTag, aD as uint8ClampedArrayTag, aE as uint8ArrayTag, aF as objectTag, aG as int32ArrayTag, aH as int16ArrayTag, aI as int8ArrayTag, aJ as float64ArrayTag, aK as float32ArrayTag, aL as arrayTag, _ as __name, D as getConfig, d as select, e as configureSvgSize, l as log, z as clear, B as rgba, aM as getLineFunctionsWithOffset, R as line, S as curveBasis, c as getConfig2, O as getUrl, aN as getEffectiveHtmlLabels, aO as createText, aP as computeLabelTransform, aQ as getSubGraphTitleMargins, u as utils_default, k as common_default, aR as getStylesFromArray, i as sanitizeText, aS as decodeEntities, aT as configureLabelImages } from "./index-BX6JHKv6.js";
3
+ import { G as Graph } from "./graph-CYiEKt0j.js";
4
+ import { c as channel } from "./channel-CD4vJFwr.js";
5
+ import "./preload-helper-tXtZnHb0.js";
5
6
  function isArray(value) {
6
7
  return Array.isArray(value);
7
8
  }
@@ -1,5 +1,6 @@
1
- import { g as getNoteRect, d as drawRect } from "./chunk-ND2GUHAM-CqqaU9Ue.js";
2
- import { s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, d as select, l as log, e as configureSvgSize, f as assignWithDepth_default, h as calculateTextWidth, i as sanitizeText, j as distExports, w as wrapLabel, k as common_default, m as calculateTextHeight } from "./index-DW7LS8C1.js";
1
+ import { g as getNoteRect, d as drawRect } from "./chunk-ND2GUHAM-C_-_dlq7.js";
2
+ import { s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, d as select, l as log, e as configureSvgSize, f as assignWithDepth_default, h as calculateTextWidth, i as sanitizeText, j as distExports, w as wrapLabel, k as common_default, m as calculateTextHeight } from "./index-BX6JHKv6.js";
3
+ import "./preload-helper-tXtZnHb0.js";
3
4
  var parser = (function() {
4
5
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
5
6
  for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
@@ -1,4 +1,4 @@
1
- import { ai as Utils, aj as Color } from "./index-DW7LS8C1.js";
1
+ import { ai as Utils, aj as Color } from "./index-BX6JHKv6.js";
2
2
  const channel = (color, channel2) => {
3
3
  return Utils.lang.round(Color.parse(color)[channel2]);
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as __name, e as configureSvgSize, l as log } from "./index-DW7LS8C1.js";
1
+ import { _ as __name, e as configureSvgSize, l as log } from "./index-BX6JHKv6.js";
2
2
  var setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding, cssDiagram, useMaxWidth) => {
3
3
  svg.attr("class", cssDiagram);
4
4
  const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
@@ -1,4 +1,4 @@
1
- import { _ as __name } from "./index-DW7LS8C1.js";
1
+ import { _ as __name } from "./index-BX6JHKv6.js";
2
2
  function populateCommonDb(ast, db) {
3
3
  if (ast.accDescr) {
4
4
  db.setAccDescription?.(ast.accDescr);
@@ -1,4 +1,4 @@
1
- import { _ as __name, d as select } from "./index-DW7LS8C1.js";
1
+ import { _ as __name, d as select } from "./index-BX6JHKv6.js";
2
2
  var getDiagramElement = /* @__PURE__ */ __name((id, securityLevel) => {
3
3
  let sandboxElement;
4
4
  if (securityLevel === "sandbox") {
@@ -1,8 +1,8 @@
1
- import { g as getIconStyles } from "./chunk-FMBD7UC4-BxpCZPtz.js";
2
- import { c as createTooltip } from "./chunk-ND2GUHAM-CqqaU9Ue.js";
3
- import { g as getDiagramElement } from "./chunk-55IACEB6-CiBpxRa1.js";
4
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-lag2vhq9.js";
5
- import { _ as __name, l as log, c as getConfig2, o as getRegisteredLayoutAlgorithm, r as render, u as utils_default, d as select, y as purify, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, p as setDiagramTitle, q as getDiagramTitle, k as common_default, z as clear, x as getEdgeId, i as sanitizeText, Q as parseGenericTypes } from "./index-DW7LS8C1.js";
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-CsV8Lmy6.js";
2
+ import { c as createTooltip } from "./chunk-ND2GUHAM-C_-_dlq7.js";
3
+ import { g as getDiagramElement } from "./chunk-55IACEB6-Di_O5box.js";
4
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-DkVrgw4l.js";
5
+ import { _ as __name, l as log, c as getConfig2, o as getRegisteredLayoutAlgorithm, r as render, u as utils_default, d as select, y as purify, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, p as setDiagramTitle, q as getDiagramTitle, k as common_default, z as clear, x as getEdgeId, i as sanitizeText, Q as parseGenericTypes } from "./index-BX6JHKv6.js";
6
6
  var parser = (function() {
7
7
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
8
8
  for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
@@ -1,6 +1,6 @@
1
- import { g as getDiagramElement } from "./chunk-55IACEB6-CiBpxRa1.js";
2
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-lag2vhq9.js";
3
- import { _ as __name, l as log, c as getConfig2, r as render, u as utils_default, a as getAccTitle, b as setAccTitle, g as getAccDescription, s as setAccDescription, p as setDiagramTitle, q as getDiagramTitle, T as generateId, k as common_default, z as clear } from "./index-DW7LS8C1.js";
1
+ import { g as getDiagramElement } from "./chunk-55IACEB6-Di_O5box.js";
2
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-DkVrgw4l.js";
3
+ import { _ as __name, l as log, c as getConfig2, r as render, u as utils_default, a as getAccTitle, b as setAccTitle, g as getAccDescription, s as setAccDescription, p as setDiagramTitle, q as getDiagramTitle, T as generateId, k as common_default, z as clear } from "./index-BX6JHKv6.js";
4
4
  var parser = (function() {
5
5
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
6
6
  for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
@@ -1,4 +1,4 @@
1
- import { _ as __name } from "./index-DW7LS8C1.js";
1
+ import { _ as __name } from "./index-BX6JHKv6.js";
2
2
  var getIconStyles = /* @__PURE__ */ __name(() => `
3
3
  /* Font Awesome icon styling - consolidated */
4
4
  .label-icon {
@@ -1,4 +1,4 @@
1
- import { _ as __name, d as select, U as lineBreakRegex, j as distExports } from "./index-DW7LS8C1.js";
1
+ import { _ as __name, d as select, U as lineBreakRegex, j as distExports } from "./index-BX6JHKv6.js";
2
2
  var drawRect = /* @__PURE__ */ __name((element, rectData) => {
3
3
  const rectElement = element.append("rect");
4
4
  rectElement.attr("x", rectData.x);
@@ -1,4 +1,4 @@
1
- import { _ as __name } from "./index-DW7LS8C1.js";
1
+ import { _ as __name } from "./index-BX6JHKv6.js";
2
2
  var ImperativeState = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,9 +1,10 @@
1
- import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-ODeKQFXC.js";
2
- import { _ as __name } from "./index-DW7LS8C1.js";
3
- import "./chunk-FMBD7UC4-BxpCZPtz.js";
4
- import "./chunk-ND2GUHAM-CqqaU9Ue.js";
5
- import "./chunk-55IACEB6-CiBpxRa1.js";
6
- import "./chunk-2J33WTMH-lag2vhq9.js";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-BgKvwR8w.js";
2
+ import { _ as __name } from "./index-BX6JHKv6.js";
3
+ import "./chunk-FMBD7UC4-CsV8Lmy6.js";
4
+ import "./chunk-ND2GUHAM-C_-_dlq7.js";
5
+ import "./chunk-55IACEB6-Di_O5box.js";
6
+ import "./chunk-2J33WTMH-DkVrgw4l.js";
7
+ import "./preload-helper-tXtZnHb0.js";
7
8
  var diagram = {
8
9
  parser: classDiagram_default,
9
10
  get db() {
@@ -1,9 +1,10 @@
1
- import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-ODeKQFXC.js";
2
- import { _ as __name } from "./index-DW7LS8C1.js";
3
- import "./chunk-FMBD7UC4-BxpCZPtz.js";
4
- import "./chunk-ND2GUHAM-CqqaU9Ue.js";
5
- import "./chunk-55IACEB6-CiBpxRa1.js";
6
- import "./chunk-2J33WTMH-lag2vhq9.js";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-BgKvwR8w.js";
2
+ import { _ as __name } from "./index-BX6JHKv6.js";
3
+ import "./chunk-FMBD7UC4-CsV8Lmy6.js";
4
+ import "./chunk-ND2GUHAM-C_-_dlq7.js";
5
+ import "./chunk-55IACEB6-Di_O5box.js";
6
+ import "./chunk-2J33WTMH-DkVrgw4l.js";
7
+ import "./preload-helper-tXtZnHb0.js";
7
8
  var diagram = {
8
9
  parser: classDiagram_default,
9
10
  get db() {
@@ -1,5 +1,6 @@
1
- import { b4 as getDefaultExportFromCjs, _ as __name, l as log, d as select } from "./index-DW7LS8C1.js";
1
+ import { b4 as getDefaultExportFromCjs, _ as __name, l as log, d as select } from "./index-BX6JHKv6.js";
2
2
  import { c as cytoscape$1 } from "./cytoscape.esm-CpHeHM5e.js";
3
+ import "./preload-helper-tXtZnHb0.js";
3
4
  var cytoscapeCoseBilkent$1 = { exports: {} };
4
5
  var coseBase$1 = { exports: {} };
5
6
  var layoutBase$1 = { exports: {} };
@@ -1,6 +1,7 @@
1
- import { _ as __name, aV as markers_default, aW as clear2, aX as clear, aY as clear$1, l as log, c as getConfig2, aZ as updateNodeBounds, a_ as setNodeElem, ag as insertNode, aQ as getSubGraphTitleMargins, ah as positionNode, af as insertCluster, a$ as insertEdge, b0 as positionEdgeLabel, b1 as insertEdgeLabel } from "./index-DW7LS8C1.js";
2
- import { i as isUndefined, G as Graph } from "./graph-DyX_9f6d.js";
3
- import { b as baseClone, m as map, l as layout } from "./layout-CAJgQHdw.js";
1
+ import { _ as __name, aV as markers_default, aW as clear2, aX as clear, aY as clear$1, l as log, c as getConfig2, aZ as updateNodeBounds, a_ as setNodeElem, ag as insertNode, aQ as getSubGraphTitleMargins, ah as positionNode, af as insertCluster, a$ as insertEdge, b0 as positionEdgeLabel, b1 as insertEdgeLabel } from "./index-BX6JHKv6.js";
2
+ import { i as isUndefined, G as Graph } from "./graph-CYiEKt0j.js";
3
+ import { b as baseClone, m as map, l as layout } from "./layout-DOAlFUVb.js";
4
+ import "./preload-helper-tXtZnHb0.js";
4
5
  var CLONE_SYMBOLS_FLAG = 4;
5
6
  function clone(value) {
6
7
  return baseClone(value, CLONE_SYMBOLS_FLAG);
@@ -1,6 +1,7 @@
1
- import { s as setAccDescription, g as getAccDescription, q as getDiagramTitle, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, I as selectSvgElement, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, l as log, K as getThemeVariables3, e as configureSvgSize } from "./index-DW7LS8C1.js";
2
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
3
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { s as setAccDescription, g as getAccDescription, q as getDiagramTitle, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, I as selectSvgElement, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, l as log, K as getThemeVariables3, e as configureSvgSize } from "./index-BX6JHKv6.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
3
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
+ import "./preload-helper-tXtZnHb0.js";
4
5
  var defaultOptions = {
5
6
  showLegend: true,
6
7
  ticks: 5,
@@ -1,7 +1,8 @@
1
- import { p as setDiagramTitle, b as setAccTitle, s as setAccDescription, q as getDiagramTitle, g as getAccDescription, a as getAccTitle, _ as __name, F as cleanAndMerge, l as log, I as selectSvgElement, e as configureSvgSize, D as getConfig, z as clear, G as defaultConfig_default } from "./index-DW7LS8C1.js";
2
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
3
- import { I as ImperativeState } from "./chunk-QZHKN3VN-Biq_K124.js";
4
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { p as setDiagramTitle, b as setAccTitle, s as setAccDescription, q as getDiagramTitle, g as getAccDescription, a as getAccTitle, _ as __name, F as cleanAndMerge, l as log, I as selectSvgElement, e as configureSvgSize, D as getConfig, z as clear, G as defaultConfig_default } from "./index-BX6JHKv6.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
3
+ import { I as ImperativeState } from "./chunk-QZHKN3VN-aCmcDsfu.js";
4
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
5
+ import "./preload-helper-tXtZnHb0.js";
5
6
  var state = new ImperativeState(() => ({
6
7
  cnt: 1,
7
8
  stack: [
@@ -1,6 +1,7 @@
1
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
2
- import { q as getDiagramTitle, p as setDiagramTitle, s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, l as log, c as getConfig2, d as select, E as setupGraphViewbox2, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, i as sanitizeText, w as wrapLabel, ak as calculateTextDimensions } from "./index-DW7LS8C1.js";
3
- import { p as parse, i as isEmResetFrame } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
2
+ import { q as getDiagramTitle, p as setDiagramTitle, s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, l as log, c as getConfig2, d as select, E as setupGraphViewbox2, z as clear, F as cleanAndMerge, D as getConfig, G as defaultConfig_default, i as sanitizeText, w as wrapLabel, ak as calculateTextDimensions } from "./index-BX6JHKv6.js";
3
+ import { p as parse, i as isEmResetFrame } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
+ import "./preload-helper-tXtZnHb0.js";
4
5
  var PositionFrameKind = "position frame";
5
6
  var FramePositionedKind = "frame positioned";
6
7
  var PositionRelationKind = "position relation";
@@ -1,6 +1,7 @@
1
- import { _ as __name, F as cleanAndMerge, I as selectSvgElement, e as configureSvgSize, l as log, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, D as getConfig, G as defaultConfig_default, z as clear } from "./index-DW7LS8C1.js";
2
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
3
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { _ as __name, F as cleanAndMerge, I as selectSvgElement, e as configureSvgSize, l as log, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, D as getConfig, G as defaultConfig_default, z as clear } from "./index-BX6JHKv6.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
3
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
+ import "./preload-helper-tXtZnHb0.js";
4
5
  var DEFAULT_PACKET_CONFIG = defaultConfig_default.packet;
5
6
  var PacketDB = class {
6
7
  constructor() {
@@ -1,9 +1,10 @@
1
- import { _ as __name, K as getThemeVariables3, D as getConfig, F as cleanAndMerge, I as selectSvgElement, e as configureSvgSize, l as log, bd as styles2String, d as select, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, G as defaultConfig_default, be as isLabelStyle, z as clear } from "./index-DW7LS8C1.js";
2
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-lag2vhq9.js";
3
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
4
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { _ as __name, K as getThemeVariables3, D as getConfig, F as cleanAndMerge, I as selectSvgElement, e as configureSvgSize, l as log, bd as styles2String, d as select, b as setAccTitle, a as getAccTitle, p as setDiagramTitle, q as getDiagramTitle, g as getAccDescription, s as setAccDescription, G as defaultConfig_default, be as isLabelStyle, z as clear } from "./index-BX6JHKv6.js";
2
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-DkVrgw4l.js";
3
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
4
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
5
5
  import { b as format } from "./defaultLocale-B2RvLBDe.js";
6
6
  import { o as ordinal } from "./ordinal-DSZU4PqD.js";
7
+ import "./preload-helper-tXtZnHb0.js";
7
8
  import "./init-ZxktEp_H.js";
8
9
  function count(node) {
9
10
  var sum = 0, children = node.children, i = children && children.length;
@@ -1,7 +1,8 @@
1
- import { g as getDiagramElement } from "./chunk-55IACEB6-CiBpxRa1.js";
2
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-lag2vhq9.js";
3
- import { _ as __name, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, p as setDiagramTitle, q as getDiagramTitle, c as getConfig2, l as log, z as clear, x as getEdgeId, B as rgba, C as __export, o as getRegisteredLayoutAlgorithm, r as render, d as select, u as utils_default } from "./index-DW7LS8C1.js";
4
- import { c as channel } from "./channel-upve91Tq.js";
1
+ import { g as getDiagramElement } from "./chunk-55IACEB6-Di_O5box.js";
2
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-DkVrgw4l.js";
3
+ import { _ as __name, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, p as setDiagramTitle, q as getDiagramTitle, c as getConfig2, l as log, z as clear, x as getEdgeId, B as rgba, C as __export, o as getRegisteredLayoutAlgorithm, r as render, d as select, u as utils_default } from "./index-BX6JHKv6.js";
4
+ import { c as channel } from "./channel-CD4vJFwr.js";
5
+ import "./preload-helper-tXtZnHb0.js";
5
6
  var parser = (function() {
6
7
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
7
8
  for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
@@ -1,9 +1,10 @@
1
- import { g as getIconStyles } from "./chunk-FMBD7UC4-BxpCZPtz.js";
2
- import { _ as __name, n as setConfig2, l as log, c as getConfig2, o as getRegisteredLayoutAlgorithm, r as render, u as utils_default, b as setAccTitle, s as setAccDescription, p as setDiagramTitle, a as getAccTitle, g as getAccDescription, q as getDiagramTitle, k as common_default, t as load, J as JSON_SCHEMA, v as isValidShape, x as getEdgeId, d as select, y as purify, z as clear, A as defaultConfig2, B as rgba } from "./index-DW7LS8C1.js";
3
- import { c as createTooltip } from "./chunk-ND2GUHAM-CqqaU9Ue.js";
4
- import { g as getDiagramElement } from "./chunk-55IACEB6-CiBpxRa1.js";
5
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-lag2vhq9.js";
6
- import { c as channel } from "./channel-upve91Tq.js";
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-CsV8Lmy6.js";
2
+ import { _ as __name, n as setConfig2, l as log, c as getConfig2, o as getRegisteredLayoutAlgorithm, r as render, u as utils_default, b as setAccTitle, s as setAccDescription, p as setDiagramTitle, a as getAccTitle, g as getAccDescription, q as getDiagramTitle, k as common_default, t as load, J as JSON_SCHEMA, v as isValidShape, x as getEdgeId, d as select, y as purify, z as clear, A as defaultConfig2, B as rgba } from "./index-BX6JHKv6.js";
3
+ import { c as createTooltip } from "./chunk-ND2GUHAM-C_-_dlq7.js";
4
+ import { g as getDiagramElement } from "./chunk-55IACEB6-Di_O5box.js";
5
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-DkVrgw4l.js";
6
+ import { c as channel } from "./channel-CD4vJFwr.js";
7
+ import "./preload-helper-tXtZnHb0.js";
7
8
  var MERMAID_DOM_ID_PREFIX = "flowchart-";
8
9
  var FlowDB = class {
9
10
  // cspell:ignore funs
@@ -1,6 +1,7 @@
1
- import { bf as Rgb, bg as rgbConvert, bh as define, bi as extend, bj as Color, bk as nogamma, bl as hue, b4 as getDefaultExportFromCjs, g as getAccDescription, s as setAccDescription, q as getDiagramTitle, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, d as select, e as configureSvgSize, bm as dayjs2, l as log, k as common_default, j as distExports, z as clear, u as utils_default } from "./index-DW7LS8C1.js";
2
- import { b as bisector, t as tickStep, c as continuous, a as copy, l as linear } from "./linear-B2ggJ8Am.js";
1
+ import { bf as Rgb, bg as rgbConvert, bh as define, bi as extend, bj as Color, bk as nogamma, bl as hue, b4 as getDefaultExportFromCjs, g as getAccDescription, s as setAccDescription, q as getDiagramTitle, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, d as select, e as configureSvgSize, bm as dayjs2, l as log, k as common_default, j as distExports, z as clear, u as utils_default } from "./index-BX6JHKv6.js";
2
+ import { b as bisector, t as tickStep, c as continuous, a as copy, l as linear } from "./linear-BMBn6kVq.js";
3
3
  import { i as initRange } from "./init-ZxktEp_H.js";
4
+ import "./preload-helper-tXtZnHb0.js";
4
5
  import "./defaultLocale-B2RvLBDe.js";
5
6
  function max(values, valueof) {
6
7
  let max2;
@@ -1,7 +1,8 @@
1
- import { p as populateCommonDb } from "./chunk-4BX2VUAB-BXJ8Ggh-.js";
2
- import { I as ImperativeState } from "./chunk-QZHKN3VN-Biq_K124.js";
3
- import { q as getDiagramTitle, p as setDiagramTitle, s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, D as getConfig, l as log, d as select, c as getConfig2, u as utils_default, E as setupGraphViewbox2, z as clear, k as common_default, F as cleanAndMerge, G as defaultConfig_default, H as random } from "./index-DW7LS8C1.js";
4
- import { p as parse } from "./wardley-L42UT6IY-Cx-VbqoS.js";
1
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-JTZ-VKNX.js";
2
+ import { I as ImperativeState } from "./chunk-QZHKN3VN-aCmcDsfu.js";
3
+ import { q as getDiagramTitle, p as setDiagramTitle, s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, D as getConfig, l as log, d as select, c as getConfig2, u as utils_default, E as setupGraphViewbox2, z as clear, k as common_default, F as cleanAndMerge, G as defaultConfig_default, H as random } from "./index-BX6JHKv6.js";
4
+ import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
5
+ import "./preload-helper-tXtZnHb0.js";
5
6
  var commitType = {
6
7
  NORMAL: 0,
7
8
  REVERSE: 1,
@@ -1,4 +1,4 @@
1
- import { bt as isSymbol, bs as Symbol$1, bo as isObject, bq as baseGetTag, br as root, bp as isObjectLike, bu as freeGlobal } from "./index-DW7LS8C1.js";
1
+ import { bt as isSymbol, bs as Symbol$1, bo as isObject, bq as baseGetTag, br as root, bp as isObjectLike, bu as freeGlobal } from "./index-BX6JHKv6.js";
2
2
  function arrayMap(array, iteratee) {
3
3
  var index = -1, length = array == null ? 0 : array.length, result = Array(length);
4
4
  while (++index < length) {