@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
@@ -3,16 +3,75 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; font-src 'self' data: https:; img-src 'self' data: blob: https: http: file:; connect-src 'self';">
6
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:*; style-src 'self' 'unsafe-inline' http://localhost:*; font-src 'self' data: https:; img-src 'self' data: blob: https: http: file:; connect-src 'self' ws://localhost:* http://localhost:*;">
7
7
  <title>ColaMD</title>
8
- <script type="module" crossorigin src="./assets/index-DW7LS8C1.js"></script>
9
- <link rel="stylesheet" crossorigin href="./assets/index-dyHEFYvY.css">
8
+ <style>
9
+ #menu-btn, #mobile-menu { display: none; }
10
+ </style>
11
+ <script type="module" crossorigin src="./assets/index-BX6JHKv6.js"></script>
12
+ <link rel="modulepreload" crossorigin href="./assets/preload-helper-tXtZnHb0.js">
13
+ <link rel="stylesheet" crossorigin href="./assets/index-CcwAgVRi.css">
10
14
  </head>
11
15
  <body>
12
16
  <div id="titlebar">
17
+ <button id="menu-btn" title="Menu">
18
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
19
+ <rect y="3" width="20" height="2" rx="1" fill="currentColor"/>
20
+ <rect y="9" width="20" height="2" rx="1" fill="currentColor"/>
21
+ <rect y="15" width="20" height="2" rx="1" fill="currentColor"/>
22
+ </svg>
23
+ </button>
13
24
  <div id="agent-dot"></div>
14
25
  <button id="slides-btn" title="Open as Slides">&#9654;</button>
15
26
  </div>
27
+ <nav id="mobile-menu">
28
+ <div id="menu-overlay"></div>
29
+ <div id="menu-panel">
30
+ <div id="menu-header">
31
+ <span id="menu-title">ColaMD</span>
32
+ <button id="menu-close-btn" title="Close">
33
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
34
+ <line x1="5" y1="5" x2="15" y2="15"/>
35
+ <line x1="15" y1="5" x2="5" y2="15"/>
36
+ </svg>
37
+ </button>
38
+ </div>
39
+ <div id="menu-body">
40
+ <div class="menu-section">
41
+ <div class="menu-section-title">File</div>
42
+ <button class="menu-item" data-action="new">New</button>
43
+ <button class="menu-item" data-action="open">Open...</button>
44
+ <button class="menu-item" data-action="save">Save</button>
45
+ <button class="menu-item" data-action="save-as">Save As...</button>
46
+ </div>
47
+ <div class="menu-section">
48
+ <div class="menu-section-title">Export</div>
49
+ <button class="menu-item" data-action="export-pdf">Export PDF</button>
50
+ <button class="menu-item" data-action="export-html">Export HTML</button>
51
+ <button class="menu-item" data-action="export-slides">Export Slides</button>
52
+ </div>
53
+ <div class="menu-section">
54
+ <div class="menu-section-title">Slides</div>
55
+ <button class="menu-item" data-action="new-slides">New Slides</button>
56
+ <button class="menu-item" data-action="open-as-slides">Open as Slides</button>
57
+ </div>
58
+ <div class="menu-section">
59
+ <div class="menu-section-title">Theme</div>
60
+ <div id="menu-theme-list"></div>
61
+ <button class="menu-item" data-action="import-theme">Import Theme...</button>
62
+ </div>
63
+ <div class="menu-section" id="menu-plugins-section" style="display:none">
64
+ <div class="menu-section-title">Plugins</div>
65
+ <div id="menu-plugin-list"></div>
66
+ </div>
67
+ <div class="menu-section">
68
+ <div class="menu-section-title">About</div>
69
+ <button class="menu-item" data-action="about">About ColaMD</button>
70
+ <button class="menu-item" data-action="exit">Exit</button>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </nav>
16
75
  <div id="editor"></div>
17
76
  <textarea id="source-editor" spellcheck="false"></textarea>
18
77
  </body>
@@ -0,0 +1,382 @@
1
+ # Release v1.5.1
2
+
3
+ **Release Date**: 2026-05-23
4
+ **Tag**: `v1.5.1`
5
+ **Previous Version**: [v1.5.0](https://github.com/byteuser1977/ColaMD-extend/releases/tag/v1.5.0)
6
+
7
+ ---
8
+
9
+ ## 🎉 Release Highlights
10
+
11
+ ### 🎨 Enhanced Theme System
12
+ Introducing **5 new themes** and a complete **theme development framework**:
13
+
14
+ - 📄 **Academic Paper Theme** — GB/T 7713 compliant academic paper formatting
15
+ - 🇨🇭 **Swiss Design Theme** — International Typographic Style with black-white-red color system
16
+ - 🎨 **Pixso Design Theme** — Modern design system styling
17
+ - 🌲 **Forest Ink Theme** — Warm paper base with forest green accents
18
+ - 📝 **Standardized Template** — Reference implementation for custom theme creation
19
+
20
+ ### 📱 Mobile Platform Support
21
+ Full **Android (.apk) + iOS (.ipa)** support via Capacitor 6:
22
+ - Native file picker integration
23
+ - Chinese IME optimization
24
+ - PDF export with native PrintManager
25
+ - Mobile-adapted responsive UI
26
+
27
+ ### 🔧 Refactored Export Pipeline
28
+ Completely rewritten PDF/HTML export system:
29
+ - Auto-extraction of current theme styles
30
+ - Plugin-injected export styles (no more hardcoded handling)
31
+ - Smart error recovery with dynamic plugin skipping
32
+ - Custom print style support for advanced use cases
33
+
34
+ ---
35
+
36
+ ## ✨ New Features
37
+
38
+ ### Themes (5 New)
39
+
40
+ | Theme | File | Description |
41
+ |-------|------|-------------|
42
+ | Academic Paper | [`academic-paper.css`](../themes/academic-paper.css) | GB/T 7713 compliant, SimHei/SimSun typography, three-line tables, print-optimized Mermaid |
43
+ | Academic Paper (PT) | [`academic-paper-pt.css`](../themes/academic-paper-pt.css) | Same as above but using pt units for specific print scenarios |
44
+ | Swiss Design | [`swiss-design.css`](../themes/swiss-design.css) | Black-white-red color system, geometric sans-serif fonts, grid-based layout |
45
+ | Pixso Design | [`pixso-design.css`](../themes/pixso-design.css) | Modern design system style |
46
+ | Forest Ink | [`forest-ink.css`](../themes/forest-ink.css) | Warm paper base, forest green ink text and accents |
47
+ | Template | [`template.css`](../themes/template.css) | Standardized reference implementation following v3.0 paradigm |
48
+
49
+ ### Theme Development Framework
50
+ - **Theme Paradigm Document** ([`theme-paradigm.md`](theme-paradigm.md)) — Complete CSS theme development specification (v3.2)
51
+ - Design principles: variable-driven, modular, semantic naming, AI-agent derivable
52
+ - 30+ verifiable rules (MUST / MUST NOT / SHOULD) with WCAG contrast formulas
53
+ - Print fidelity specifications: variable re-declaration, 12-category element coverage list
54
+ - px unit unification standard to ensure consistent PDF export font sizes
55
+
56
+ ### Mobile Platform
57
+ - **Android Platform** ([`mobile.css`](../src/renderer/mobile.css))
58
+ - Capacitor 6 integration for native APK builds
59
+ - File picker via `@capawesome/capacitor-file-picker`
60
+ - IME input method optimization for CJK languages
61
+ - Native PDF export using Android PrintManager
62
+ - **iOS Platform**
63
+ - Capacitor 6 integration for native IPA builds
64
+ - Full iOS support with WebView/WKWebView
65
+ - **Dual-platform Bridge** ([`capacitor-api.ts`](../src/renderer/capacitor-api.ts))
66
+ - Runtime auto-detection of Electron/Capacitor APIs
67
+ - Seamless code sharing between desktop and mobile
68
+
69
+ ### Documentation & Demo
70
+ - **Academic Paper Demo** ([`academic-demo.md`](academic-demo.md)) — Real-world academic paper with 8 Mermaid diagram groups
71
+ - **Inline SVG Guide** ([`demo.html`](demo.html)) — Best practices for SVG in Markdown
72
+ - **General Feature Demo** ([`demo.md`](demo.md)) — Complete feature showcase
73
+
74
+ ---
75
+
76
+ ## 🔧 Improvements
77
+
78
+ ### PDF Export Pipeline (Major Refactor)
79
+
80
+ #### Auto Theme Style Extraction
81
+ - Automatically extracts current theme styles when exporting
82
+ - Injects theme CSS into exported HTML/PDF documents
83
+ - Ensures visual consistency between editor preview and exported files
84
+
85
+ #### Unified Plugin Style Management
86
+ - Math plugin ([`math-plugin.ts`](../src/renderer/editor/plugins/math-plugin.ts)): Added clipboard/export/rendering style configuration fields
87
+ - Mermaid plugin ([`mermaid-plugin.ts`](../src/renderer/editor/plugins/mermaid-plugin.ts)): Added unified style configuration
88
+ - Replaced all hardcoded style handling with dynamic retrieval from plugin configuration
89
+ - Plugins now self-manage their export styles through configuration objects
90
+
91
+ #### Enhanced Error Recovery
92
+ - Dynamic plugin skipping during export (instead of hard-coded exclusions)
93
+ - Graceful degradation when individual plugins fail
94
+ - Better error logging and user feedback
95
+
96
+ #### Custom Theme Export Fix
97
+ - Fixed Chromium CSSOM serialization issues for custom themes
98
+ - Proper extraction of `@media print` rules from custom theme CSS
99
+ - Auto-injection of custom theme print styles into export HTML
100
+
101
+ ### Editor Core & Rendering
102
+ - Wrapped `getLiveHTML()` output in `<div id="write">` container for better structure
103
+ - Optimized rendering: only apply base element styles when not using custom themes
104
+ - Removed debug auto-open developer tools code from production build
105
+ - Optimized academic paper theme styles for better performance
106
+
107
+ ### Theme System Architecture
108
+ - **Modular Refactoring**: Split into `foundation.css` + `base/` built-in themes + `components/mermaid/` variable mapping + user theme directory
109
+ - **Mermaid Variable System**: 20 core CSS variables (`--mermaid-*`) auto-mapped to 22 chart type SVG selectors
110
+ - **Academic Paper Theme Refactoring**: All hardcoded colors → `var()` variables; all `pt` units → `px` even integers
111
+
112
+ ---
113
+
114
+ ## 🐛 Bug Fixes
115
+
116
+ ### TypeScript Type System (15 Errors Fixed)
117
+
118
+ | File | Issue | Fix |
119
+ |------|-------|-----|
120
+ | [`capacitor-api.ts`](../src/renderer/capacitor-api.ts) | `string \| null` type assignment error | Corrected type annotation |
121
+ | [`editor.ts`](../src/renderer/editor/editor.ts) | `remarkPluginsCtx` type mismatch | Fixed type compatibility |
122
+ | [`editor.ts`](../src/renderer/editor/editor.ts) | `rootEl` null check missing | Added null safety check |
123
+ | [`math-plugin.ts`](../src/renderer/editor/plugins/math-plugin.ts) | `$NodeSchema` type vs `$view` function | Resolved type conflict |
124
+ | [`mermaid-plugin.ts`](../src/renderer/editor/plugins/mermaid-plugin.ts) | Mermaid theme type issue | Fixed type definition |
125
+ | [`mermaid-plugin.ts`](../src/renderer/editor/plugins/mermaid-plugin.ts) | `$NodeSchema` type mismatch | Aligned type interfaces |
126
+ | [`main.ts`](../src/renderer/main.ts) | Missing Vite client types for `import.meta.glob` | Added type reference |
127
+ | [`main/index.ts`](src/main/index.ts) | Invalid `fs.createServer` import | Removed non-existent import |
128
+ | [`main/index.ts`](src/main/index.ts) | Invalid `PrintToPDFOptions.marginType` | Removed deprecated property |
129
+
130
+ **Project Configuration Updates**:
131
+ - Added `"composite": true` to [`tsconfig.main.json`](tsconfig.main.json), [`tsconfig.preload.json`](tsconfig.preload.json), [`tsconfig.renderer.json`](tsconfig.renderer.json) for proper project references
132
+
133
+ ### Mermaid Diagram Rendering
134
+
135
+ **Fixed in elegant + academic-paper themes**:
136
+ - ✅ Text offset problem resolved
137
+ - ✅ Variable name mismatch corrected
138
+ - ✅ Double border display issue fixed
139
+
140
+ **Mermaid Theme System Improvements**:
141
+ - Adjusted to Guizang warm color palette (cream background + brown tones)
142
+ - Font size optimized to 10.5pt for academic printing
143
+ - Added Typora compatible selectors (`.md-diagram-panel`)
144
+ - Added mobile responsive adaptation
145
+ - Unified text color and border styles across all themes
146
+
147
+ ### Theme Print Fidelity
148
+
149
+ **Critical Fix**: Completed `@media print` screen attribute mirrors for template and Swiss Design CSS:
150
+
151
+ Covered attributes:
152
+ - Font size (`font-size`)
153
+ - Line height (`line-height`)
154
+ - Font family (`font-family`)
155
+ - Borders (`border`, `border-*`)
156
+ - Spacing (`margin`, `padding`, `gap`)
157
+ - Letter spacing (`letter-spacing`)
158
+ - Word spacing (`word-spacing`)
159
+ - Text alignment (`text-align`)
160
+ - Background colors (`background`, `background-color`)
161
+ - And more...
162
+
163
+ **Result**: Screen preview now matches PDF export exactly.
164
+
165
+ **Custom Theme Export** ([`theme-manager.ts`](../src/renderer/editor/plugins/themes/theme-manager.ts)):
166
+ - Fixed CSS extraction logic to avoid Chromium CSSOM serialization issues
167
+ - Added automatic injection of custom theme print styles during export
168
+
169
+ ### Android Platform Fixes
170
+
171
+ #### Chinese IME (Input Method Editor)
172
+ - ✅ Removed `e.preventDefault()` in `beforeinput` event
173
+ - ✅ Enhanced ProseMirror editor IME composition event handling
174
+ - ✅ Applied `-webkit-user-modify: read-write-plaintext-only` for better CJK input experience
175
+
176
+ #### Intent File Opening
177
+ - ✅ Added `Intent.ACTION_VIEW` handling in `MainActivity`
178
+ - ✅ Supported `onNewIntent` for opening new files while app is running
179
+ - ✅ Implemented JavaScript bridge to pass file content to WebView
180
+
181
+ #### PDF Export on Android
182
+ - ✅ Replaced Capacitor Plugin bridge with `JavascriptInterface`
183
+ - ✅ Created `ColaMDNativeBridge` class for native `PrintManager` calls
184
+ - ✅ Added "Save as PDF" option
185
+ - ✅ Fixed pagination issues
186
+ - ✅ Fixed save button functionality
187
+ - ✅ Updated Mermaid version for mobile compatibility
188
+ - ✅ Resolved layer residue problems
189
+
190
+ ### Export Functionality Improvements
191
+
192
+ **PDF/HTML Export**:
193
+ - ✅ Refactored Mermaid rendering logic with export sync wait mechanism
194
+ - ✅ Supported real-time rendered content export (not just source code)
195
+ - ✅ Fixed default filename logic
196
+
197
+ **File Manager Open Mechanism**:
198
+ - ✅ Adopted pull model: JS actively calls Java `checkPendingFile()`
199
+ - ✅ Eliminated JS event injection timing issues
200
+ - ✅ Added init detection + setInterval polling dual guarantee
201
+
202
+ ### Mobile Adaptation
203
+ - ✅ Fixed missing `screen` type in media queries ([`mobile.css`](../src/renderer/mobile.css))
204
+
205
+ ### Plugin System
206
+ - ✅ Fixed plugin import errors
207
+ - ✅ Updated package versions
208
+ - ✅ Decoupled plugin system: reduced main.ts dependency on specific plugins
209
+
210
+ ---
211
+
212
+ ## ⚠️ Important Notices
213
+
214
+ ### 🚚 Theme Migration to Dedicated Repository
215
+
216
+ Starting from **v1.5.1**, **theme updates and maintenance have been migrated** to a dedicated repository:
217
+
218
+ 🔗 **[https://github.com/byteuser1977/ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes)**
219
+
220
+ **Why the migration?**
221
+ - ✅ Faster iteration and release cycles for theme-specific changes
222
+ - ✅ Community contributions and theme submissions welcome
223
+ - ✅ Independent versioning from core ColaMD application
224
+ - ✅ Focused issue tracking for theme-related problems
225
+
226
+ **What this means for you:**
227
+ - Themes included in **this release will remain available** for backward compatibility
228
+ - For the **latest versions and new themes**, check the dedicated repository
229
+ - Future theme enhancements will be released there first
230
+ - You can still use custom themes locally without any changes
231
+
232
+ ---
233
+
234
+ ## 📦 Installation & Upgrade
235
+
236
+ ### From Source
237
+
238
+ ```bash
239
+ # Clone the repository
240
+ git clone https://github.com/byteuser1977/ColaMD-extend.git
241
+ cd ColaMD-extend
242
+
243
+ # Checkout v1.5.1
244
+ git checkout v1.5.1
245
+
246
+ # Install dependencies
247
+ npm install
248
+
249
+ # Run development mode
250
+ npm run dev
251
+
252
+ # Build for production
253
+ npm run build
254
+ ```
255
+
256
+ ### Download Pre-built Binaries
257
+
258
+ Visit the [Releases](https://github.com/byteuser1977/ColaMD-extend/releases) page to download pre-built binaries for your platform:
259
+
260
+ - **macOS** (`.dmg`) — Intel + Apple Silicon
261
+ - **Windows** (`.exe`) — Installer + Portable
262
+ - **Linux** (`.AppImage`, `.deb`) — Universal + Debian/Ubuntu
263
+ - **Android** (`.apk`) — Via Capacitor 6
264
+ - **iOS** (`.ipa**) — Via Capacitor 6 (requires TestFlight/App Store distribution)
265
+
266
+ ### Using Custom Themes
267
+
268
+ ```bash
269
+ # Option 1: Place theme file manually
270
+ cp your-theme.css ~/.colamd/themes/
271
+
272
+ # Option 2: Import via ColaMD UI
273
+ # Open ColaMD → Theme → Import Theme → Select your .css file
274
+ ```
275
+
276
+ Available themes can be downloaded from the [`themes/`](../themes/) directory or the dedicated [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) repository.
277
+
278
+ ---
279
+
280
+ ## 🔄 Migration Guide (from v1.5.0)
281
+
282
+ ### For Desktop Users
283
+ No breaking changes. Simply update to v1.5.1:
284
+ - Your existing settings and themes are preserved
285
+ - New themes are automatically available after update
286
+ - No configuration changes required
287
+
288
+ ### For Mobile Users
289
+ If you were using beta releases:
290
+ - **Uninstall** the old beta version first
291
+ - **Install** v1.5.1 stable release
292
+ - Your data is preserved (stored in app sandbox)
293
+ - New features: Better IME support, improved PDF export, smoother UI
294
+
295
+ ### For Theme Developers
296
+ - Review the updated [`theme-paradigm.md`](theme-paradigm.md) document (v3.2)
297
+ - Use [`template.css`](../themes/template.css) as starting point
298
+ - Note the **px unit unification requirement** (no more pt/rem mixing)
299
+ - Consider submitting your theme to [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) repo
300
+
301
+ ---
302
+
303
+ ## 📊 Statistics
304
+
305
+ ### Code Changes
306
+ - **Files Changed**: 50+
307
+ - **Lines Added**: ~2,500+
308
+ - **Lines Modified**: ~800+
309
+ - **Lines Removed**: ~400+
310
+
311
+ ### Test Coverage
312
+ - TypeScript Type Errors Resolved: **15**
313
+ - Bug Fixes: **25+**
314
+ - New Features: **20+**
315
+ - Documentation Pages: **5**
316
+
317
+ ### Supported Platforms
318
+ - ✅ macOS (Intel + Apple Silicon)
319
+ - ✅ Windows (x64)
320
+ - ✅ Linux (x64, ARM64)
321
+ - ✅ Android (ARM64, ARMv7)
322
+ - ✅ iOS (ARM64)
323
+
324
+ ---
325
+
326
+ ## 🙏 Acknowledgments
327
+
328
+ ### Special Thanks To
329
+ - **Mermaid.js Team** — For the excellent diagram rendering library
330
+ - **KaTeX Team** — For the fast math typesetting engine
331
+ - **Capacitor Team** — For enabling cross-platform mobile support
332
+ - **Milkdown Team** — For the WYSIWYG Markdown editor framework
333
+ - **ProseMirror Team** — For the robust rich text editing foundation
334
+ - **Electron Team** — For the cross-platform desktop framework
335
+ - **Vite Team** — For the blazing-fast build toolchain
336
+ - **Testing Community** — Beta testers who provided valuable feedback on v1.5.1-beta.1 and v1.5.1-beta.2
337
+
338
+ ---
339
+
340
+ ## 📝 Changelog
341
+
342
+ For detailed change history, see [CHANGELOG.md](../CHANGELOG.md).
343
+
344
+ **Key changes since v1.5.0**:
345
+ - v1.5.1-beta.1: Initial mobile platform support, basic themes
346
+ - v1.5.1-beta.2: TypeScript fixes, Mermaid refactoring, enhanced themes
347
+ - v1.5.1 (stable): Complete documentation, PDF export refactor, production-ready
348
+
349
+ ---
350
+
351
+ ## 🔗 Links
352
+
353
+ - **Homepage**: [GitHub Repository](https://github.com/byteuser1977/ColaMD-extend)
354
+ - **Documentation**: [README.md](../README.md) | [README_CN.md](../README_CN.md)
355
+ - **Changelog**: [CHANGELOG.md](../CHANGELOG.md)
356
+ - **Theme Repository**: [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes)
357
+ - **Issue Tracker**: [GitHub Issues](https://github.com/byteuser1977/ColaMD-extend/issues)
358
+ - **Discussions**: [GitHub Discussions](https://github.com/byteuser1977/ColaMD-extend/discussions)
359
+
360
+ ---
361
+
362
+ ## 📜 License
363
+
364
+ This project is licensed under the **MIT License** — see the [LICENSE](LICENSE) file for details.
365
+
366
+ ---
367
+
368
+ ## 💬 Feedback & Support
369
+
370
+ Found a bug? Have a feature request? Want to contribute?
371
+
372
+ - 🐛 **Report Bugs**: [Open an Issue](https://github.com/byteuser1977/ColaMD-extend/issues/new?labels=bug)
373
+ - 💡 **Feature Requests**: [Open an Issue](https://github.com/byteuser1977/ColaMD-extend/issues/new?labels=enhancement)
374
+ - 📖 **Documentation Issues**: [Open an Issue](https://github.com/byteuser1977/ColaMD-extend/issues/new?labels=documentation)
375
+ - 💬 **Questions**: Start a [Discussion](https://github.com/byteuser1977/ColaMD-extend/discussions/new?category=q-a)
376
+ - 🔧 **Pull Contributions**: See [Contributing Guide](../CONTRIBUTING.md)
377
+
378
+ ---
379
+
380
+ **Thank you for using ColaMD! 🎉**
381
+
382
+ *Built with ❤️ by the ColaMD community*