@bytechain.cn/colamd 1.5.1 → 1.5.2

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 (201) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +105 -38
  3. package/README_CN.md +121 -46
  4. package/dist/lib/colamd-renderer.js +193804 -0
  5. package/dist/lib/colamd-renderer.js.map +1 -0
  6. package/dist/lib/colamd.css +1810 -0
  7. package/dist/lib/editor/editor.d.ts +27 -0
  8. package/dist/lib/editor/html-view.d.ts +2 -0
  9. package/dist/lib/editor/lib.d.ts +49 -0
  10. package/dist/lib/editor/plugins/index.d.ts +56 -0
  11. package/dist/lib/editor/plugins/lib-entry.d.ts +10 -0
  12. package/dist/lib/editor/plugins/math-plugin.d.ts +9 -0
  13. package/dist/lib/editor/plugins/mermaid-plugin.d.ts +19 -0
  14. package/dist/lib/editor/plugins/themes/theme-manager.d.ts +30 -0
  15. package/dist/main/index.js +93 -32
  16. package/dist/preload/index.js +2 -1
  17. package/dist/renderer/assets/{arc-_lugyDzx.js → arc-CpIo2PoE.js} +1 -1
  18. package/dist/renderer/assets/{architectureDiagram-3BPJPVTR-DDfP-F9D.js → architectureDiagram-3BPJPVTR-T-4Cq0Bz.js} +2 -2
  19. package/dist/renderer/assets/{blockDiagram-GPEHLZMM-DOETUKma.js → blockDiagram-GPEHLZMM-C-SuR6eu.js} +4 -4
  20. package/dist/renderer/assets/{c4Diagram-AAUBKEIU-kAmLfVtk.js → c4Diagram-AAUBKEIU-PJp81cGm.js} +2 -2
  21. package/dist/renderer/assets/{channel-CD4vJFwr.js → channel-CtIHaaRI.js} +1 -1
  22. package/dist/renderer/assets/{chunk-2J33WTMH-DkVrgw4l.js → chunk-2J33WTMH-BrchfQL6.js} +1 -1
  23. package/dist/renderer/assets/{chunk-4BX2VUAB-JTZ-VKNX.js → chunk-4BX2VUAB-BCc3Ev_H.js} +1 -1
  24. package/dist/renderer/assets/{chunk-55IACEB6-Di_O5box.js → chunk-55IACEB6-B2M27HQo.js} +1 -1
  25. package/dist/renderer/assets/{chunk-727SXJPM-BgKvwR8w.js → chunk-727SXJPM-DXDHGECs.js} +5 -5
  26. package/dist/renderer/assets/{chunk-AQP2D5EJ-DonSXCCQ.js → chunk-AQP2D5EJ-BNb1lOQY.js} +3 -3
  27. package/dist/renderer/assets/{chunk-FMBD7UC4-CsV8Lmy6.js → chunk-FMBD7UC4-CzgfEH2z.js} +1 -1
  28. package/dist/renderer/assets/{chunk-ND2GUHAM-C_-_dlq7.js → chunk-ND2GUHAM-BUFT_yOe.js} +1 -1
  29. package/dist/renderer/assets/{chunk-QZHKN3VN-aCmcDsfu.js → chunk-QZHKN3VN-C-zV7oBi.js} +1 -1
  30. package/dist/renderer/assets/{classDiagram-v2-Q7XG4LA2-nuHQLjzM.js → classDiagram-4FO5ZUOK-CAyhGSvf.js} +6 -6
  31. package/dist/renderer/assets/{classDiagram-4FO5ZUOK-nuHQLjzM.js → classDiagram-v2-Q7XG4LA2-CAyhGSvf.js} +6 -6
  32. package/dist/renderer/assets/{cose-bilkent-S5V4N54A-Di1_SXt9.js → cose-bilkent-S5V4N54A-ldu81kCk.js} +1 -1
  33. package/dist/renderer/assets/{dagre-BM42HDAG-CqOUIYsL.js → dagre-BM42HDAG-NJgy8CTw.js} +3 -3
  34. package/dist/renderer/assets/{diagram-2AECGRRQ-F-fP19TC.js → diagram-2AECGRRQ-CuIcMpOn.js} +2 -2
  35. package/dist/renderer/assets/{diagram-5GNKFQAL-BD5XZc8G.js → diagram-5GNKFQAL-BJwFCroB.js} +3 -3
  36. package/dist/renderer/assets/{diagram-KO2AKTUF-Qa3ZxA67.js → diagram-KO2AKTUF-C7NgQ8ju.js} +2 -2
  37. package/dist/renderer/assets/{diagram-LMA3HP47-DqDnw2RA.js → diagram-LMA3HP47-B71v6MOq.js} +2 -2
  38. package/dist/renderer/assets/{diagram-OG6HWLK6-BH4Elzby.js → diagram-OG6HWLK6-D2ZxkrSe.js} +3 -3
  39. package/dist/renderer/assets/{erDiagram-TEJ5UH35-CaKZCewa.js → erDiagram-TEJ5UH35-4ToW0p3h.js} +4 -4
  40. package/dist/renderer/assets/{flowDiagram-I6XJVG4X-C8znUgyL.js → flowDiagram-I6XJVG4X-DBkZLqwn.js} +6 -6
  41. package/dist/renderer/assets/{ganttDiagram-6RSMTGT7-DnRvbMnU.js → ganttDiagram-6RSMTGT7-G3xD2VXj.js} +2 -2
  42. package/dist/renderer/assets/{gitGraphDiagram-PVQCEYII-CZuRZzk4.js → gitGraphDiagram-PVQCEYII-BcTNiFfg.js} +3 -3
  43. package/dist/renderer/assets/{graph-CYiEKt0j.js → graph--Vhl4p4D.js} +1 -1
  44. package/dist/renderer/assets/{index-BX6JHKv6.js → index-C63bU7CF.js} +400 -54
  45. package/dist/renderer/assets/{index-CcwAgVRi.css → index-D8nA981z.css} +12 -0
  46. package/dist/renderer/assets/{infoDiagram-5YYISTIA-BlBUdqMb.js → infoDiagram-5YYISTIA-DjKa7Yv-.js} +1 -1
  47. package/dist/renderer/assets/{ishikawaDiagram-YF4QCWOH-TeVytCrP.js → ishikawaDiagram-YF4QCWOH-xIWzW1pL.js} +1 -1
  48. package/dist/renderer/assets/{journeyDiagram-JHISSGLW-BLZa3jnX.js → journeyDiagram-JHISSGLW-DxMBkVOF.js} +4 -4
  49. package/dist/renderer/assets/{kanban-definition-UN3LZRKU-foVxWrJn.js → kanban-definition-UN3LZRKU-DqJeL6E1.js} +2 -2
  50. package/dist/renderer/assets/{layout-DOAlFUVb.js → layout-B3giiMoK.js} +2 -2
  51. package/dist/renderer/assets/{linear-BMBn6kVq.js → linear-Cqh3vVIf.js} +1 -1
  52. package/dist/renderer/assets/{mindmap-definition-RKZ34NQL-5pGeNCcp.js → mindmap-definition-RKZ34NQL-DUay02ma.js} +3 -3
  53. package/dist/renderer/assets/{pieDiagram-4H26LBE5-N9aAUxfr.js → pieDiagram-4H26LBE5-CVcfLtky.js} +3 -3
  54. package/dist/renderer/assets/{quadrantDiagram-W4KKPZXB-BPxbtjga.js → quadrantDiagram-W4KKPZXB-wDHffPOs.js} +2 -2
  55. package/dist/renderer/assets/{requirementDiagram-4Y6WPE33-CK1LrJyG.js → requirementDiagram-4Y6WPE33-C4pgGDGv.js} +3 -3
  56. package/dist/renderer/assets/{sankeyDiagram-5OEKKPKP-BNj7Sqii.js → sankeyDiagram-5OEKKPKP-Jsf0rRMo.js} +1 -1
  57. package/dist/renderer/assets/{sequenceDiagram-3UESZ5HK-B-r7lNhI.js → sequenceDiagram-3UESZ5HK-e6QS7gt8.js} +3 -3
  58. package/dist/renderer/assets/{stateDiagram-AJRCARHV-wrWE0MRa.js → stateDiagram-AJRCARHV-DgYKZzDq.js} +6 -6
  59. package/dist/renderer/assets/{stateDiagram-v2-BHNVJYJU-CE-Lqo2d.js → stateDiagram-v2-BHNVJYJU-CUdmd_50.js} +4 -4
  60. package/dist/renderer/assets/{timeline-definition-PNZ67QCA-BkeMGH4J.js → timeline-definition-PNZ67QCA-S12e1Mp_.js} +2 -2
  61. package/dist/renderer/assets/{vennDiagram-CIIHVFJN-BTxVzto3.js → vennDiagram-CIIHVFJN-CNDBG6A2.js} +1 -1
  62. package/dist/renderer/assets/{wardleyDiagram-YWT4CUSO-D2r5dVGW.js → wardleyDiagram-YWT4CUSO-CLlGQcof.js} +2 -2
  63. package/dist/renderer/assets/{xychartDiagram-2RQKCTM6-BHQdINVc.js → xychartDiagram-2RQKCTM6-CUtsHUQd.js} +2 -2
  64. package/dist/renderer/index.html +6 -2
  65. package/package.json +25 -1
  66. package/.github/workflows/release.yml +0 -66
  67. package/.trae/specs/optimize-theme-loading/checklist.md +0 -20
  68. package/.trae/specs/optimize-theme-loading/spec.md +0 -103
  69. package/.trae/specs/optimize-theme-loading/tasks.md +0 -40
  70. package/CLAUDE.md +0 -143
  71. package/android/app/build/.npmkeep +0 -0
  72. package/android/app/build.gradle +0 -76
  73. package/android/app/capacitor.build.gradle +0 -24
  74. package/android/app/proguard-rules.pro +0 -21
  75. package/android/app/release.keystore +0 -0
  76. package/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +0 -26
  77. package/android/app/src/main/AndroidManifest.xml +0 -64
  78. package/android/app/src/main/java/cn/bytechain/colamd/MainActivity.java +0 -180
  79. package/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -170
  80. package/android/app/src/main/res/drawable/splash.png +0 -0
  81. package/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  82. package/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  83. package/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  84. package/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  85. package/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  86. package/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  87. package/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  88. package/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  89. package/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  90. package/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  91. package/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
  92. package/android/app/src/main/res/layout/activity_main.xml +0 -12
  93. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  94. package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  95. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  96. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  97. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  98. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  99. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  100. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  101. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  102. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  103. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  104. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  105. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  106. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  107. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  108. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  109. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  110. package/android/app/src/main/res/values/ic_launcher_background.xml +0 -4
  111. package/android/app/src/main/res/values/strings.xml +0 -7
  112. package/android/app/src/main/res/values/styles.xml +0 -22
  113. package/android/app/src/main/res/xml/file_paths.xml +0 -5
  114. package/android/app/src/main/res/xml/network_security_config.xml +0 -8
  115. package/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +0 -18
  116. package/android/build.gradle +0 -29
  117. package/android/capacitor.settings.gradle +0 -21
  118. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  119. package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  120. package/android/gradle.properties +0 -22
  121. package/android/gradlew +0 -248
  122. package/android/gradlew.bat +0 -92
  123. package/android/settings.gradle +0 -5
  124. package/android/variables.gradle +0 -16
  125. package/capacitor.config.js +0 -29
  126. package/capacitor.config.ts +0 -30
  127. package/demo.md +0 -193
  128. package/docs/RELEASE_NOTES_v1.5.1.md +0 -382
  129. package/docs/academic-demo.md +0 -567
  130. package/docs/agent-diff-view.md +0 -48
  131. package/docs/demo.html +0 -748
  132. package/docs/demo.md +0 -546
  133. package/docs/demo.pdf +0 -0
  134. package/docs/theme-paradigm.md +0 -797
  135. package/electron-builder.yml +0 -64
  136. package/electron.vite.config.js +0 -31
  137. package/electron.vite.config.ts +0 -30
  138. package/ios/App/App/AppDelegate.swift +0 -49
  139. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  140. package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -14
  141. package/ios/App/App/Assets.xcassets/Contents.json +0 -6
  142. package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +0 -23
  143. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  144. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  145. package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  146. package/ios/App/App/Base.lproj/LaunchScreen.storyboard +0 -32
  147. package/ios/App/App/Base.lproj/Main.storyboard +0 -19
  148. package/ios/App/App/Info.plist +0 -49
  149. package/ios/App/App.xcodeproj/project.pbxproj +0 -408
  150. package/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  151. package/ios/App/Podfile +0 -28
  152. package/resources/entitlements.mac.plist +0 -12
  153. package/resources/icon.icns +0 -0
  154. package/resources/icon.png +0 -0
  155. package/resources/icon.svg +0 -23
  156. package/resources/templates/slides/icon.png +0 -0
  157. package/resources/templates/slides/slides-template.md +0 -74
  158. package/resources/templates/slides/template-forest-ink.html +0 -540
  159. package/resources/templates/slides/template.html +0 -535
  160. package/scripts/afterPack.js +0 -13
  161. package/scripts/generate-icons.js +0 -102
  162. package/src/main/index.ts +0 -919
  163. package/src/preload/index.d.ts +0 -51
  164. package/src/preload/index.js +0 -70
  165. package/src/preload/index.ts +0 -110
  166. package/src/renderer/capacitor-api.ts +0 -713
  167. package/src/renderer/editor/editor.ts +0 -287
  168. package/src/renderer/editor/html-view.ts +0 -15
  169. package/src/renderer/editor/plugins/index.ts +0 -86
  170. package/src/renderer/editor/plugins/math-plugin.ts +0 -305
  171. package/src/renderer/editor/plugins/mermaid-plugin-custom.css +0 -46
  172. package/src/renderer/editor/plugins/mermaid-plugin-dark.css +0 -428
  173. package/src/renderer/editor/plugins/mermaid-plugin-elegant.css +0 -443
  174. package/src/renderer/editor/plugins/mermaid-plugin-newsprint.css +0 -208
  175. package/src/renderer/editor/plugins/mermaid-plugin.css +0 -111
  176. package/src/renderer/editor/plugins/mermaid-plugin.ts +0 -680
  177. package/src/renderer/editor/plugins/themes/base/dark.css +0 -23
  178. package/src/renderer/editor/plugins/themes/base/elegant.css +0 -32
  179. package/src/renderer/editor/plugins/themes/base/light.css +0 -20
  180. package/src/renderer/editor/plugins/themes/base/newsprint.css +0 -27
  181. package/src/renderer/editor/plugins/themes/base.css +0 -509
  182. package/src/renderer/editor/plugins/themes/components/mermaid/academic.css +0 -43
  183. package/src/renderer/editor/plugins/themes/components/mermaid/dark.css +0 -20
  184. package/src/renderer/editor/plugins/themes/components/mermaid/elegant.css +0 -24
  185. package/src/renderer/editor/plugins/themes/components/mermaid/light.css +0 -21
  186. package/src/renderer/editor/plugins/themes/components/mermaid/newsprint.css +0 -26
  187. package/src/renderer/editor/plugins/themes/components/mermaid/variables.css +0 -592
  188. package/src/renderer/editor/plugins/themes/foundation.css +0 -143
  189. package/src/renderer/editor/plugins/themes/theme-manager.ts +0 -133
  190. package/src/renderer/env.d.ts +0 -10
  191. package/src/renderer/index.html +0 -76
  192. package/src/renderer/main.ts +0 -775
  193. package/src/renderer/mobile.css +0 -428
  194. package/tsconfig.json +0 -14
  195. package/tsconfig.main.json +0 -12
  196. package/tsconfig.main.tsbuildinfo +0 -1
  197. package/tsconfig.preload.json +0 -12
  198. package/tsconfig.preload.tsbuildinfo +0 -1
  199. package/tsconfig.renderer.json +0 -13
  200. package/tsconfig.renderer.tsbuildinfo +0 -1
  201. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,27 @@
1
+ import { Editor } from '@milkdown/kit/core';
2
+ import '@milkdown/kit/prose/view/style/prosemirror.css';
3
+ export interface CreateEditorOptions {
4
+ onChange?: (markdown: string) => void;
5
+ /** Callback for Ctrl/Cmd+click on links. If not provided, falls back to electronAPI/capacitorAPI. */
6
+ onExternalLink?: (href: string) => void;
7
+ }
8
+ /**
9
+ * Create a Milkdown editor with all registered plugins.
10
+ * This is the pure editor creation logic, separated from host-app wiring.
11
+ */
12
+ export declare function createMilkdownEditor(root: HTMLElement, options?: CreateEditorOptions): Promise<Editor>;
13
+ /**
14
+ * Create editor using element ID. Backward-compatible entry point for the Electron app.
15
+ */
16
+ export declare function createEditor(rootId: string, onChange?: (markdown: string) => void): Promise<Editor>;
17
+ export declare function getMarkdown(): string;
18
+ /**
19
+ * Get HTML by cloning the live rendered DOM.
20
+ * Unlike {@link getHTML} which uses DOMSerializer (creating fresh nodes with
21
+ * "Rendering..." placeholders), this captures the actual rendered SVGs
22
+ * from mermaid, KaTeX math, etc. Used for PDF/HTML export.
23
+ */
24
+ export declare function getLiveHTML(): string;
25
+ export declare function getHTML(): string;
26
+ export declare function setMarkdown(content: string): void;
27
+ export declare function togglePluginMode(nodeTypes: string[], mode: 'rendered' | 'raw'): void;
@@ -0,0 +1,2 @@
1
+ import type { NodeViewConstructor } from '@milkdown/kit/prose/view';
2
+ export declare const htmlView: import("@milkdown/utils").$View<import("@milkdown/utils").$Node, NodeViewConstructor>;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * ColaMD Renderer Library Entry Point
3
+ *
4
+ * Provides a standalone Milkdown editor for embedding in external applications
5
+ * (e.g., VSCode extension WebViews). No Electron/Capacitor dependencies.
6
+ *
7
+ * Usage:
8
+ * import { createColaMDEditor } from '@bytechain.cn/colamd/renderer'
9
+ * const handle = await createColaMDEditor({ rootId: 'editor', editable: false })
10
+ * handle.setMarkdown('# Hello')
11
+ * const html = handle.getLiveHTML()
12
+ */
13
+ import { Editor } from '@milkdown/kit/core';
14
+ import type { RendererPlugin } from './plugins';
15
+ import './plugins/lib-entry';
16
+ import './plugins/themes/base.css';
17
+ export type { RendererPlugin };
18
+ export interface ColaMDEditorOptions {
19
+ /** DOM element ID to attach the editor to */
20
+ rootId: string;
21
+ /** Initial theme name (light/dark/elegant/newsprint) */
22
+ theme?: string;
23
+ /** Whether the editor is editable. Default: true */
24
+ editable?: boolean;
25
+ /** Callback when content changes */
26
+ onChange?: (markdown: string) => void;
27
+ /** Callback for Ctrl/Cmd+click on links */
28
+ onExternalLink?: (href: string) => void;
29
+ }
30
+ export interface ColaMDEditorHandle {
31
+ editor: Editor;
32
+ setMarkdown(content: string): void;
33
+ getMarkdown(): string;
34
+ getHTML(): string;
35
+ getLiveHTML(): string;
36
+ /** 构建完整的独立 HTML 文档(含 CSS 变量、主题、插件样式),用于导出 */
37
+ buildExportHTML(): string;
38
+ applyTheme(name: string, customCSS?: string): void;
39
+ togglePlugin(id: string, enabled: boolean): void;
40
+ togglePluginMode(nodeTypes: string[], mode: 'rendered' | 'raw'): void;
41
+ ensureAllPluginsRendered(): Promise<void>;
42
+ getAllPlugins(): RendererPlugin[];
43
+ destroy(): void;
44
+ }
45
+ /**
46
+ * Create a ColaMD editor instance for embedding in external applications.
47
+ * This is the main library API — no Electron/Capacitor dependencies.
48
+ */
49
+ export declare function createColaMDEditor(options: ColaMDEditorOptions): Promise<ColaMDEditorHandle>;
@@ -0,0 +1,56 @@
1
+ import type { MilkdownPlugin } from '@milkdown/ctx';
2
+ import type { Plugin } from 'unified';
3
+ export interface ExportCapability {
4
+ label: string;
5
+ defaultName: string;
6
+ filter: {
7
+ name: string;
8
+ extensions: string[];
9
+ };
10
+ execute: (element: HTMLElement) => Promise<string | null>;
11
+ }
12
+ export interface RendererPlugin {
13
+ id: string;
14
+ name: string;
15
+ enabled: boolean;
16
+ remarkPlugin?: {
17
+ plugin: Plugin<any[], any>;
18
+ options?: any;
19
+ };
20
+ rehypePlugin?: Plugin<any[], any>;
21
+ onMount?: (...args: any[]) => any;
22
+ onBeforeMount?: (...args: any[]) => any;
23
+ onInit?: () => void;
24
+ onThemeChange?: (theme: string, customCSS?: string) => void;
25
+ css?: string;
26
+ nodeTypes?: string[];
27
+ exportCapabilities?: ExportCapability[];
28
+ renderStatus?: (container: HTMLElement) => Promise<{
29
+ ok: number;
30
+ fail: number;
31
+ total: number;
32
+ }>;
33
+ ensureRendered?: () => Promise<void>;
34
+ /** Selector→inline-style pairs applied during clipboard copy/cut */
35
+ clipboardStyles?: Record<string, string>;
36
+ /** CSS rules injected into HTML export (use var(--...) for theme colors) */
37
+ exportStyles?: string;
38
+ /** Selectors for raw-source textareas/inputs (blurred on save, removed on export) */
39
+ rawSelectors?: string[];
40
+ /** Selectors for loading/error placeholder elements (hidden during export) */
41
+ hideSelectors?: string[];
42
+ /** Selectors for elements needing computed background-color captured during clone */
43
+ bgCaptureSelectors?: string[];
44
+ }
45
+ export interface PluginModule {
46
+ info: RendererPlugin;
47
+ milkdownPlugins: MilkdownPlugin[];
48
+ }
49
+ export declare function registerPluginModule(m: PluginModule): void;
50
+ export declare function getAllPluginModules(): PluginModule[];
51
+ export declare function getAllPlugins(): RendererPlugin[];
52
+ export declare function findPluginBySelector(selector: string): RendererPlugin | undefined;
53
+ export declare function findExportCapabilities(className: string): ExportCapability[];
54
+ export declare function togglePlugin(id: string, enabled: boolean): void;
55
+ /** Build a CSS selector matching all export-capable plugin block elements */
56
+ export declare function getContextMenuSelector(): string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Library entry point for plugin registration.
3
+ * Explicitly imports all plugin modules to trigger their side-effect registration
4
+ * via registerPluginModule(). This replaces the import.meta.glob pattern in main.ts
5
+ * which only works in Vite's renderer build.
6
+ */
7
+ import './math-plugin';
8
+ import './mermaid-plugin';
9
+ export { getAllPluginModules, getAllPlugins, togglePlugin, registerPluginModule } from './index';
10
+ export type { RendererPlugin, PluginModule, ExportCapability } from './index';
@@ -0,0 +1,9 @@
1
+ import type { NodeViewConstructor } from '@milkdown/prose/view';
2
+ import type { RendererPlugin } from './index';
3
+ import 'katex/dist/katex.min.css';
4
+ declare const mathInlineSchema: import("@milkdown/utils").$NodeSchema<"math_inline">;
5
+ declare const mathInlineView: import("@milkdown/utils").$View<import("@milkdown/utils").$Node | import("@milkdown/utils").$Mark, NodeViewConstructor | import("prosemirror-view").MarkViewConstructor>;
6
+ declare const mathBlockSchema: import("@milkdown/utils").$NodeSchema<"math_block">;
7
+ declare const mathBlockView: import("@milkdown/utils").$View<import("@milkdown/utils").$Node | import("@milkdown/utils").$Mark, NodeViewConstructor | import("prosemirror-view").MarkViewConstructor>;
8
+ export declare const mathPlugin: RendererPlugin;
9
+ export { mathInlineSchema, mathBlockSchema, mathInlineView, mathBlockView };
@@ -0,0 +1,19 @@
1
+ import type { NodeViewConstructor } from '@milkdown/prose/view';
2
+ import type { Plugin } from 'unified';
3
+ import type { RendererPlugin } from './index';
4
+ import './mermaid-plugin.css';
5
+ import './mermaid-plugin-dark.css';
6
+ import './mermaid-plugin-elegant.css';
7
+ import './mermaid-plugin-newsprint.css';
8
+ import './mermaid-plugin-custom.css';
9
+ /**
10
+ * Wait for all currently pending mermaid render() calls to settle.
11
+ * Called before PDF/HTML export to ensure all diagrams are rendered.
12
+ */
13
+ export declare function awaitAllMermaidRenders(): Promise<void>;
14
+ declare const remarkMermaid: Plugin;
15
+ declare const mermaidBlockSchema: import("@milkdown/utils").$NodeSchema<"mermaid_block">;
16
+ declare const mermaidBlockInputRule: import("@milkdown/utils").$InputRule;
17
+ declare const mermaidBlockView: import("@milkdown/utils").$View<import("@milkdown/utils").$Node | import("@milkdown/utils").$Mark, NodeViewConstructor | import("prosemirror-view").MarkViewConstructor>;
18
+ export declare const mermaidPlugin: RendererPlugin;
19
+ export { mermaidBlockSchema, mermaidBlockInputRule, mermaidBlockView, remarkMermaid };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 缓存导入的自定义主题 CSS 和模版引用
3
+ * @param name 主题文件名(不含 custom: 前缀)
4
+ * @param css 自定义 CSS 内容
5
+ */
6
+ export declare function setCachedCustomTheme(name: string, css: string): void;
7
+ /**
8
+ * 获取已缓存的自定义主题信息
9
+ * @param name 主题文件名
10
+ */
11
+ export declare function getCachedCustomTheme(name: string): {
12
+ css: string;
13
+ template: string | null;
14
+ } | undefined;
15
+ /**
16
+ * 应用主题:内建主题添加对应 class,自定义主题注入 CSS 并叠加模版
17
+ * @param name 主题名称(light/dark/elegant/newsprint 或 custom:<name>)
18
+ * @param customCSS 自定义 CSS 内容(可选,导入时传入;切换时从缓存恢复)
19
+ */
20
+ export declare function applyTheme(name: string, customCSS?: string): void;
21
+ export declare function loadSavedTheme(): string;
22
+ /** 获取当前激活的自定义主题 CSS 内容;非自定义主题返回 null */
23
+ export declare function getActiveCustomThemeCSS(): string | null;
24
+ /**
25
+ * 从缓存的原始 CSS 文本中提取 @media print 规则块。
26
+ * 使用字符串括号计数而非 CSSOM 序列化,避免 Chromium 对嵌套 at-rule
27
+ *(如 @page 内的 @bottom-center)的序列化丢失问题。
28
+ * @returns 完整的 @media print { ... } 规则文本,无自定义主题或无 print 块返回 null
29
+ */
30
+ export declare function extractPrintCSSFromSheet(): string | null;
@@ -4,6 +4,60 @@ const path = require("path");
4
4
  const promises = require("fs/promises");
5
5
  const fs = require("fs");
6
6
  const http = require("http");
7
+ const en = {
8
+ app: { name: "ColaMD", title: "ColaMD" },
9
+ menu: { file: "File", edit: "Edit", view: "View", theme: "Theme", help: "Help", plugins: "Plugins", about: "About" },
10
+ fileMenu: { new: "New", newSlides: "New Slides...", open: "Open...", save: "Save", saveAs: "Save As...", exportPDF: "Export PDF...", exportHTML: "Export HTML...", exportSlides: "Export Slides...", openAsSlides: "Open as Slides", close: "Close", quit: "Quit" },
11
+ editMenu: { undo: "Undo", redo: "Redo", cut: "Cut", copy: "Copy", paste: "Paste", selectAll: "Select All" },
12
+ viewMenu: { resetZoom: "Actual Size", zoomIn: "Zoom In", zoomOut: "Zoom Out", toggleFullscreen: "Toggle Fullscreen" },
13
+ themeMenu: { light: "Light", dark: "Dark", elegant: "Elegant", newsprint: "Newsprint", importTheme: "Import Theme..." },
14
+ helpMenu: { about: "About ColaMD" }
15
+ };
16
+ const zhCN = {
17
+ app: { name: "ColaMD", title: "ColaMD" },
18
+ menu: { file: "文件", edit: "编辑", view: "视图", theme: "主题", help: "帮助", plugins: "插件", about: "关于" },
19
+ fileMenu: { new: "新建", newSlides: "新建幻灯片...", open: "打开...", save: "保存", saveAs: "另存为...", exportPDF: "导出 PDF...", exportHTML: "导出 HTML...", exportSlides: "导出幻灯片...", openAsSlides: "打开为幻灯片", close: "关闭", quit: "退出" },
20
+ editMenu: { undo: "撤销", redo: "重做", cut: "剪切", copy: "复制", paste: "粘贴", selectAll: "全选" },
21
+ viewMenu: { resetZoom: "实际大小", zoomIn: "放大", zoomOut: "缩小", toggleFullscreen: "切换全屏" },
22
+ themeMenu: { light: "浅色", dark: "深色", elegant: "优雅", newsprint: "新闻纸", importTheme: "导入主题..." },
23
+ helpMenu: { about: "关于 ColaMD" }
24
+ };
25
+ const localeMap = { "en": en, "zh-CN": zhCN };
26
+ let currentLocale = "en";
27
+ let initialized = false;
28
+ function detectDefaultLocale() {
29
+ try {
30
+ const locale = electron.app.getLocale();
31
+ if (locale.toLowerCase().startsWith("zh")) return "zh-CN";
32
+ } catch (e) {
33
+ console.warn("[i18n] Failed to detect system locale:", e);
34
+ }
35
+ return "en";
36
+ }
37
+ function initI18n() {
38
+ if (initialized) return;
39
+ currentLocale = detectDefaultLocale();
40
+ initialized = true;
41
+ console.log(`[i18n] Initialized with locale: ${currentLocale}`);
42
+ }
43
+ function getCurrentLocale() {
44
+ return currentLocale;
45
+ }
46
+ function setLocale(locale) {
47
+ if (currentLocale === locale) return false;
48
+ currentLocale = locale;
49
+ console.log(`[i18n] Locale changed to: ${currentLocale}`);
50
+ return true;
51
+ }
52
+ function t(key) {
53
+ const keys = key.split(".");
54
+ let value = localeMap[currentLocale];
55
+ for (const k of keys) {
56
+ if (value == null || typeof value !== "object") return key;
57
+ value = value[k];
58
+ }
59
+ return typeof value === "string" ? value : key;
60
+ }
7
61
  const themesDir = path.join(electron.app.getPath("home"), ".colamd", "themes");
8
62
  const BASE_PRINT_CSS = [
9
63
  "html, body { height:auto !important; overflow:visible !important; -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }",
@@ -583,6 +637,11 @@ electron.ipcMain.handle("sync-plugin-state", (_event, id, enabled) => {
583
637
  if (item) item.checked = enabled;
584
638
  void buildMenu();
585
639
  });
640
+ electron.ipcMain.handle("set-locale", (_event, locale) => {
641
+ const changed = setLocale(locale);
642
+ if (changed) void buildMenu();
643
+ return getCurrentLocale();
644
+ });
586
645
  let cachedThemeFiles = [];
587
646
  let themeFilesValid = false;
588
647
  function invalidateThemeCache() {
@@ -626,21 +685,21 @@ async function buildMenu() {
626
685
  });
627
686
  }
628
687
  const themeSubmenu = [
629
- { label: "Light", click: () => sendToFocused("set-theme", "light") },
630
- { label: "Dark", click: () => sendToFocused("set-theme", "dark") },
631
- { label: "Elegant", click: () => sendToFocused("set-theme", "elegant") },
632
- { label: "Newsprint", click: () => sendToFocused("set-theme", "newsprint") }
688
+ { label: t("themeMenu.light"), click: () => sendToFocused("set-theme", "light") },
689
+ { label: t("themeMenu.dark"), click: () => sendToFocused("set-theme", "dark") },
690
+ { label: t("themeMenu.elegant"), click: () => sendToFocused("set-theme", "elegant") },
691
+ { label: t("themeMenu.newsprint"), click: () => sendToFocused("set-theme", "newsprint") }
633
692
  ];
634
693
  if (customThemeItems.length > 0) {
635
694
  themeSubmenu.push({ type: "separator" }, ...customThemeItems);
636
695
  }
637
696
  themeSubmenu.push({ type: "separator" }, {
638
- label: "Import Theme...",
697
+ label: t("themeMenu.importTheme"),
639
698
  click: () => sendToFocused("menu-import-theme")
640
699
  });
641
700
  const template = [
642
701
  ...isMac ? [{
643
- label: "ColaMD",
702
+ label: t("app.name"),
644
703
  submenu: [
645
704
  { role: "about" },
646
705
  { type: "separator" },
@@ -652,49 +711,49 @@ async function buildMenu() {
652
711
  ]
653
712
  }] : [],
654
713
  {
655
- label: "File",
714
+ label: t("menu.file"),
656
715
  submenu: [
657
716
  {
658
- label: "New",
717
+ label: t("fileMenu.new"),
659
718
  accelerator: "CmdOrCtrl+N",
660
719
  click: () => createWindow()
661
720
  },
662
721
  {
663
- label: "New Slides...",
722
+ label: t("fileMenu.newSlides"),
664
723
  accelerator: "CmdOrCtrl+Shift+N",
665
724
  click: () => sendToFocused("menu-new-slides")
666
725
  },
667
726
  {
668
- label: "Open...",
727
+ label: t("fileMenu.open"),
669
728
  accelerator: "CmdOrCtrl+O",
670
729
  click: () => sendToFocused("menu-open")
671
730
  },
672
731
  { type: "separator" },
673
732
  {
674
- label: "Save",
733
+ label: t("fileMenu.save"),
675
734
  accelerator: "CmdOrCtrl+S",
676
735
  click: () => sendToFocused("menu-save")
677
736
  },
678
737
  {
679
- label: "Save As...",
738
+ label: t("fileMenu.saveAs"),
680
739
  accelerator: "CmdOrCtrl+Shift+S",
681
740
  click: () => sendToFocused("menu-save-as")
682
741
  },
683
742
  { type: "separator" },
684
743
  {
685
- label: "Export PDF...",
744
+ label: t("fileMenu.exportPDF"),
686
745
  click: () => sendToFocused("menu-export-pdf")
687
746
  },
688
747
  {
689
- label: "Export HTML...",
748
+ label: t("fileMenu.exportHTML"),
690
749
  click: () => sendToFocused("menu-export-html")
691
750
  },
692
751
  {
693
- label: "Export Slides...",
752
+ label: t("fileMenu.exportSlides"),
694
753
  click: () => sendToFocused("menu-export-slides")
695
754
  },
696
755
  {
697
- label: "Open as Slides",
756
+ label: t("fileMenu.openAsSlides"),
698
757
  accelerator: "CmdOrCtrl+Shift+P",
699
758
  click: () => sendToFocused("menu-open-as-slides")
700
759
  },
@@ -703,37 +762,38 @@ async function buildMenu() {
703
762
  ]
704
763
  },
705
764
  {
706
- label: "Edit",
765
+ label: t("menu.edit"),
707
766
  submenu: [
708
- { role: "undo" },
709
- { role: "redo" },
767
+ { label: t("editMenu.undo"), role: "undo" },
768
+ { label: t("editMenu.redo"), role: "redo" },
769
+ { type: "separator" },
770
+ { label: t("editMenu.cut"), role: "cut" },
771
+ { label: t("editMenu.copy"), role: "copy" },
772
+ { label: t("editMenu.paste"), role: "paste" },
710
773
  { type: "separator" },
711
- { role: "cut" },
712
- { role: "copy" },
713
- { role: "paste" },
714
- { role: "selectAll" }
774
+ { label: t("editMenu.selectAll"), role: "selectAll" }
715
775
  ]
716
776
  },
717
777
  {
718
- label: "View",
778
+ label: t("menu.view"),
719
779
  submenu: [
720
- { role: "resetZoom" },
721
- { role: "zoomIn" },
722
- { role: "zoomOut" },
780
+ { label: t("viewMenu.resetZoom"), role: "resetZoom", accelerator: "CmdOrCtrl+0" },
781
+ { label: t("viewMenu.zoomIn"), role: "zoomIn", accelerator: "CmdOrCtrl+Plus" },
782
+ { label: t("viewMenu.zoomOut"), role: "zoomOut", accelerator: "CmdOrCtrl+-" },
723
783
  { type: "separator" },
724
- { role: "togglefullscreen" },
725
- ...pluginMenuItems.length > 0 ? [{ type: "separator" }, { label: "Plugins", submenu: pluginMenuItems }] : []
784
+ { label: t("viewMenu.toggleFullscreen"), role: "togglefullscreen" },
785
+ ...pluginMenuItems.length > 0 ? [{ type: "separator" }, { label: t("menu.plugins"), submenu: pluginMenuItems }] : []
726
786
  ]
727
787
  },
728
788
  {
729
- label: "Theme",
789
+ label: t("menu.theme"),
730
790
  submenu: themeSubmenu
731
791
  },
732
792
  {
733
- label: "Help",
793
+ label: t("menu.help"),
734
794
  submenu: [
735
795
  {
736
- label: "About ColaMD",
796
+ label: t("helpMenu.about"),
737
797
  click: () => electron.shell.openExternal("https://github.com/marswaveai/colamd")
738
798
  }
739
799
  ]
@@ -742,6 +802,7 @@ async function buildMenu() {
742
802
  electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate(template));
743
803
  }
744
804
  electron.app.whenReady().then(async () => {
805
+ initI18n();
745
806
  ensureThemesDir();
746
807
  await scanThemeFiles();
747
808
  await buildMenu();
@@ -67,5 +67,6 @@ electron.contextBridge.exposeInMainWorld("electronAPI", {
67
67
  onMenuTogglePlugin: (callback) => {
68
68
  electron.ipcRenderer.on("menu-toggle-plugin", (_event, id) => callback(id));
69
69
  },
70
- exportFile: (dataUrl, defaultName) => electron.ipcRenderer.invoke("save-export-file", dataUrl, defaultName)
70
+ exportFile: (dataUrl, defaultName) => electron.ipcRenderer.invoke("save-export-file", dataUrl, defaultName),
71
+ setLocale: (locale) => electron.ipcRenderer.invoke("set-locale", locale)
71
72
  });
@@ -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-BX6JHKv6.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-C63bU7CF.js";
2
2
  function arcInnerRadius(d) {
3
3
  return d.innerRadius;
4
4
  }
@@ -1,5 +1,5 @@
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";
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-C63bU7CF.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-BCc3Ev_H.js";
3
3
  import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
4
  import { c as cytoscape$1 } from "./cytoscape.esm-CpHeHM5e.js";
5
5
  import "./preload-helper-tXtZnHb0.js";
@@ -1,7 +1,7 @@
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";
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-CzgfEH2z.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-C63bU7CF.js";
3
+ import { G as Graph } from "./graph--Vhl4p4D.js";
4
+ import { c as channel } from "./channel-CtIHaaRI.js";
5
5
  import "./preload-helper-tXtZnHb0.js";
6
6
  function isArray(value) {
7
7
  return Array.isArray(value);
@@ -1,5 +1,5 @@
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";
1
+ import { g as getNoteRect, d as drawRect } from "./chunk-ND2GUHAM-BUFT_yOe.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-C63bU7CF.js";
3
3
  import "./preload-helper-tXtZnHb0.js";
4
4
  var parser = (function() {
5
5
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
@@ -1,4 +1,4 @@
1
- import { ai as Utils, aj as Color } from "./index-BX6JHKv6.js";
1
+ import { ai as Utils, aj as Color } from "./index-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name, e as configureSvgSize, l as log } from "./index-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name } from "./index-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name, d as select } from "./index-C63bU7CF.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-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";
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-CzgfEH2z.js";
2
+ import { c as createTooltip } from "./chunk-ND2GUHAM-BUFT_yOe.js";
3
+ import { g as getDiagramElement } from "./chunk-55IACEB6-B2M27HQo.js";
4
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-BrchfQL6.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-C63bU7CF.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-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";
1
+ import { g as getDiagramElement } from "./chunk-55IACEB6-B2M27HQo.js";
2
+ import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-BrchfQL6.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-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name } from "./index-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name, d as select, U as lineBreakRegex, j as distExports } from "./index-C63bU7CF.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-BX6JHKv6.js";
1
+ import { _ as __name } from "./index-C63bU7CF.js";
2
2
  var ImperativeState = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,9 +1,9 @@
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";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-DXDHGECs.js";
2
+ import { _ as __name } from "./index-C63bU7CF.js";
3
+ import "./chunk-FMBD7UC4-CzgfEH2z.js";
4
+ import "./chunk-ND2GUHAM-BUFT_yOe.js";
5
+ import "./chunk-55IACEB6-B2M27HQo.js";
6
+ import "./chunk-2J33WTMH-BrchfQL6.js";
7
7
  import "./preload-helper-tXtZnHb0.js";
8
8
  var diagram = {
9
9
  parser: classDiagram_default,
@@ -1,9 +1,9 @@
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";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-DXDHGECs.js";
2
+ import { _ as __name } from "./index-C63bU7CF.js";
3
+ import "./chunk-FMBD7UC4-CzgfEH2z.js";
4
+ import "./chunk-ND2GUHAM-BUFT_yOe.js";
5
+ import "./chunk-55IACEB6-B2M27HQo.js";
6
+ import "./chunk-2J33WTMH-BrchfQL6.js";
7
7
  import "./preload-helper-tXtZnHb0.js";
8
8
  var diagram = {
9
9
  parser: classDiagram_default,
@@ -1,4 +1,4 @@
1
- import { b4 as getDefaultExportFromCjs, _ as __name, l as log, d as select } from "./index-BX6JHKv6.js";
1
+ import { b4 as getDefaultExportFromCjs, _ as __name, l as log, d as select } from "./index-C63bU7CF.js";
2
2
  import { c as cytoscape$1 } from "./cytoscape.esm-CpHeHM5e.js";
3
3
  import "./preload-helper-tXtZnHb0.js";
4
4
  var cytoscapeCoseBilkent$1 = { exports: {} };
@@ -1,6 +1,6 @@
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";
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-C63bU7CF.js";
2
+ import { i as isUndefined, G as Graph } from "./graph--Vhl4p4D.js";
3
+ import { b as baseClone, m as map, l as layout } from "./layout-B3giiMoK.js";
4
4
  import "./preload-helper-tXtZnHb0.js";
5
5
  var CLONE_SYMBOLS_FLAG = 4;
6
6
  function clone(value) {
@@ -1,5 +1,5 @@
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";
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-C63bU7CF.js";
2
+ import { p as populateCommonDb } from "./chunk-4BX2VUAB-BCc3Ev_H.js";
3
3
  import { p as parse } from "./wardley-L42UT6IY-b-_GPpqL.js";
4
4
  import "./preload-helper-tXtZnHb0.js";
5
5
  var defaultOptions = {