@bytechain.cn/colamd 1.5.1-beta.2 → 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.
- package/CHANGELOG.md +194 -162
- package/README.md +148 -5
- package/README_CN.md +163 -13
- package/dist/lib/colamd-renderer.js +193804 -0
- package/dist/lib/colamd-renderer.js.map +1 -0
- package/dist/lib/colamd.css +1810 -0
- package/dist/lib/editor/editor.d.ts +27 -0
- package/dist/lib/editor/html-view.d.ts +2 -0
- package/dist/lib/editor/lib.d.ts +49 -0
- package/dist/lib/editor/plugins/index.d.ts +56 -0
- package/dist/lib/editor/plugins/lib-entry.d.ts +10 -0
- package/dist/lib/editor/plugins/math-plugin.d.ts +9 -0
- package/dist/lib/editor/plugins/mermaid-plugin.d.ts +19 -0
- package/dist/lib/editor/plugins/themes/theme-manager.d.ts +30 -0
- package/dist/main/index.js +107 -37
- package/dist/preload/index.js +3 -2
- package/dist/renderer/assets/{arc-CPdeInCG.js → arc-CpIo2PoE.js} +1 -1
- package/dist/renderer/assets/{architectureDiagram-3BPJPVTR-BAbnaR9G.js → architectureDiagram-3BPJPVTR-T-4Cq0Bz.js} +2 -2
- package/dist/renderer/assets/{blockDiagram-GPEHLZMM-CYSWjnJg.js → blockDiagram-GPEHLZMM-C-SuR6eu.js} +4 -4
- package/dist/renderer/assets/{c4Diagram-AAUBKEIU-Rb1tstnr.js → c4Diagram-AAUBKEIU-PJp81cGm.js} +2 -2
- package/dist/renderer/assets/{channel-DpG2A6fE.js → channel-CtIHaaRI.js} +1 -1
- package/dist/renderer/assets/{chunk-2J33WTMH-DFc0Jxy_.js → chunk-2J33WTMH-BrchfQL6.js} +1 -1
- package/dist/renderer/assets/{chunk-4BX2VUAB-BhRxDTNn.js → chunk-4BX2VUAB-BCc3Ev_H.js} +1 -1
- package/dist/renderer/assets/{chunk-55IACEB6-DEgMVBk8.js → chunk-55IACEB6-B2M27HQo.js} +1 -1
- package/dist/renderer/assets/{chunk-727SXJPM-bjBIfiz8.js → chunk-727SXJPM-DXDHGECs.js} +5 -5
- package/dist/renderer/assets/{chunk-AQP2D5EJ-DwQMzTzD.js → chunk-AQP2D5EJ-BNb1lOQY.js} +3 -3
- package/dist/renderer/assets/{chunk-FMBD7UC4-CkphwJzs.js → chunk-FMBD7UC4-CzgfEH2z.js} +1 -1
- package/dist/renderer/assets/{chunk-ND2GUHAM-oU09z4y4.js → chunk-ND2GUHAM-BUFT_yOe.js} +1 -1
- package/dist/renderer/assets/{chunk-QZHKN3VN-rCbVuPBn.js → chunk-QZHKN3VN-C-zV7oBi.js} +1 -1
- package/dist/renderer/assets/{classDiagram-v2-Q7XG4LA2-DGS2faoM.js → classDiagram-4FO5ZUOK-CAyhGSvf.js} +6 -6
- package/dist/renderer/assets/{classDiagram-4FO5ZUOK-DGS2faoM.js → classDiagram-v2-Q7XG4LA2-CAyhGSvf.js} +6 -6
- package/dist/renderer/assets/{cose-bilkent-S5V4N54A-iqY6-EwA.js → cose-bilkent-S5V4N54A-ldu81kCk.js} +1 -1
- package/dist/renderer/assets/{dagre-BM42HDAG-5t3X5sDa.js → dagre-BM42HDAG-NJgy8CTw.js} +3 -3
- package/dist/renderer/assets/{diagram-2AECGRRQ-DzHiYDPh.js → diagram-2AECGRRQ-CuIcMpOn.js} +2 -2
- package/dist/renderer/assets/{diagram-5GNKFQAL-BiNv6Keq.js → diagram-5GNKFQAL-BJwFCroB.js} +3 -3
- package/dist/renderer/assets/{diagram-KO2AKTUF-ClzeDG6f.js → diagram-KO2AKTUF-C7NgQ8ju.js} +2 -2
- package/dist/renderer/assets/{diagram-LMA3HP47-CGkw7wII.js → diagram-LMA3HP47-B71v6MOq.js} +2 -2
- package/dist/renderer/assets/{diagram-OG6HWLK6-Dl-Hyk1_.js → diagram-OG6HWLK6-D2ZxkrSe.js} +3 -3
- package/dist/renderer/assets/{erDiagram-TEJ5UH35-BxUN79Qb.js → erDiagram-TEJ5UH35-4ToW0p3h.js} +4 -4
- package/dist/renderer/assets/{flowDiagram-I6XJVG4X-CzFk-KNI.js → flowDiagram-I6XJVG4X-DBkZLqwn.js} +6 -6
- package/dist/renderer/assets/{ganttDiagram-6RSMTGT7-C2xl6Igx.js → ganttDiagram-6RSMTGT7-G3xD2VXj.js} +2 -2
- package/dist/renderer/assets/{gitGraphDiagram-PVQCEYII-_fn7XCa7.js → gitGraphDiagram-PVQCEYII-BcTNiFfg.js} +3 -3
- package/dist/renderer/assets/{graph-CDoHYrHm.js → graph--Vhl4p4D.js} +1 -1
- package/dist/renderer/assets/{index-DAlXyxzt.js → index-C63bU7CF.js} +693 -162
- package/dist/renderer/assets/{index-CeFpoCKV.css → index-D8nA981z.css} +17 -6
- package/dist/renderer/assets/{infoDiagram-5YYISTIA-DL6XIxLz.js → infoDiagram-5YYISTIA-DjKa7Yv-.js} +1 -1
- package/dist/renderer/assets/{ishikawaDiagram-YF4QCWOH-BUZLjRo-.js → ishikawaDiagram-YF4QCWOH-xIWzW1pL.js} +1 -1
- package/dist/renderer/assets/{journeyDiagram-JHISSGLW-C4rH_mQM.js → journeyDiagram-JHISSGLW-DxMBkVOF.js} +4 -4
- package/dist/renderer/assets/{kanban-definition-UN3LZRKU-DRbrBcWV.js → kanban-definition-UN3LZRKU-DqJeL6E1.js} +2 -2
- package/dist/renderer/assets/{layout-DZl4n4qu.js → layout-B3giiMoK.js} +2 -2
- package/dist/renderer/assets/{linear-B0Krxg21.js → linear-Cqh3vVIf.js} +1 -1
- package/dist/renderer/assets/{mindmap-definition-RKZ34NQL-DdmPsWrn.js → mindmap-definition-RKZ34NQL-DUay02ma.js} +3 -3
- package/dist/renderer/assets/{pieDiagram-4H26LBE5-BPZLqwG0.js → pieDiagram-4H26LBE5-CVcfLtky.js} +3 -3
- package/dist/renderer/assets/{quadrantDiagram-W4KKPZXB-Dr-oWRk9.js → quadrantDiagram-W4KKPZXB-wDHffPOs.js} +2 -2
- package/dist/renderer/assets/{requirementDiagram-4Y6WPE33-B6QZd0lo.js → requirementDiagram-4Y6WPE33-C4pgGDGv.js} +3 -3
- package/dist/renderer/assets/{sankeyDiagram-5OEKKPKP-Cyl9ojEt.js → sankeyDiagram-5OEKKPKP-Jsf0rRMo.js} +1 -1
- package/dist/renderer/assets/{sequenceDiagram-3UESZ5HK-D48Yr9T6.js → sequenceDiagram-3UESZ5HK-e6QS7gt8.js} +3 -3
- package/dist/renderer/assets/{stateDiagram-AJRCARHV-qyb8ETsa.js → stateDiagram-AJRCARHV-DgYKZzDq.js} +6 -6
- package/dist/renderer/assets/{stateDiagram-v2-BHNVJYJU-DmDOyyrJ.js → stateDiagram-v2-BHNVJYJU-CUdmd_50.js} +4 -4
- package/dist/renderer/assets/{timeline-definition-PNZ67QCA-C-KQxTi1.js → timeline-definition-PNZ67QCA-S12e1Mp_.js} +2 -2
- package/dist/renderer/assets/{vennDiagram-CIIHVFJN-BdaZlnH-.js → vennDiagram-CIIHVFJN-CNDBG6A2.js} +1 -1
- package/dist/renderer/assets/{wardleyDiagram-YWT4CUSO-B2hBE-EE.js → wardleyDiagram-YWT4CUSO-CLlGQcof.js} +2 -2
- package/dist/renderer/assets/{xychartDiagram-2RQKCTM6-CSvswDTY.js → xychartDiagram-2RQKCTM6-CUtsHUQd.js} +2 -2
- package/dist/renderer/index.html +6 -2
- package/package.json +25 -1
- package/themes/README.md +18 -1
- package/themes/academic-paper-pt.css +1321 -0
- package/themes/academic-paper.css +192 -97
- package/.github/workflows/release.yml +0 -66
- package/.trae/specs/optimize-theme-loading/checklist.md +0 -20
- package/.trae/specs/optimize-theme-loading/spec.md +0 -103
- package/.trae/specs/optimize-theme-loading/tasks.md +0 -40
- package/CLAUDE.md +0 -143
- package/android/app/build/.npmkeep +0 -0
- package/android/app/build.gradle +0 -76
- package/android/app/capacitor.build.gradle +0 -24
- package/android/app/proguard-rules.pro +0 -21
- package/android/app/release.keystore +0 -0
- package/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +0 -26
- package/android/app/src/main/AndroidManifest.xml +0 -64
- package/android/app/src/main/java/cn/bytechain/colamd/MainActivity.java +0 -180
- package/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -170
- package/android/app/src/main/res/drawable/splash.png +0 -0
- package/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/android/app/src/main/res/layout/activity_main.xml +0 -12
- package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/values/ic_launcher_background.xml +0 -4
- package/android/app/src/main/res/values/strings.xml +0 -7
- package/android/app/src/main/res/values/styles.xml +0 -22
- package/android/app/src/main/res/xml/file_paths.xml +0 -5
- package/android/app/src/main/res/xml/network_security_config.xml +0 -8
- package/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +0 -18
- package/android/build.gradle +0 -29
- package/android/capacitor.settings.gradle +0 -21
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradle.properties +0 -22
- package/android/gradlew +0 -248
- package/android/gradlew.bat +0 -92
- package/android/settings.gradle +0 -5
- package/android/variables.gradle +0 -16
- package/bytechain.cn-colamd-1.5.1-beta.2.tgz +0 -0
- package/capacitor.config.js +0 -29
- package/capacitor.config.ts +0 -30
- package/demo.md +0 -193
- package/docs/academic-demo.md +0 -566
- package/docs/agent-diff-view.md +0 -48
- package/docs/demo.html +0 -748
- package/docs/demo.md +0 -546
- package/docs/demo.pdf +0 -0
- package/docs/theme-paradigm.md +0 -658
- package/electron-builder.yml +0 -64
- package/electron.vite.config.js +0 -31
- package/electron.vite.config.ts +0 -30
- package/ios/App/App/AppDelegate.swift +0 -49
- package/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
- package/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -14
- package/ios/App/App/Assets.xcassets/Contents.json +0 -6
- package/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +0 -23
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/ios/App/App/Base.lproj/LaunchScreen.storyboard +0 -32
- package/ios/App/App/Base.lproj/Main.storyboard +0 -19
- package/ios/App/App/Info.plist +0 -49
- package/ios/App/App.xcodeproj/project.pbxproj +0 -408
- package/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/App/Podfile +0 -28
- package/resources/entitlements.mac.plist +0 -12
- package/resources/icon.icns +0 -0
- package/resources/icon.png +0 -0
- package/resources/icon.svg +0 -23
- package/resources/templates/slides/icon.png +0 -0
- package/resources/templates/slides/slides-template.md +0 -74
- package/resources/templates/slides/template-forest-ink.html +0 -540
- package/resources/templates/slides/template.html +0 -535
- package/scripts/afterPack.js +0 -13
- package/scripts/generate-icons.js +0 -102
- package/src/main/index.ts +0 -905
- package/src/preload/index.d.ts +0 -51
- package/src/preload/index.js +0 -70
- package/src/preload/index.ts +0 -110
- package/src/renderer/capacitor-api.ts +0 -713
- package/src/renderer/editor/editor.ts +0 -287
- package/src/renderer/editor/html-view.ts +0 -15
- package/src/renderer/editor/plugins/index.ts +0 -68
- package/src/renderer/editor/plugins/math-plugin.ts +0 -297
- package/src/renderer/editor/plugins/mermaid-plugin-custom.css +0 -46
- package/src/renderer/editor/plugins/mermaid-plugin-dark.css +0 -428
- package/src/renderer/editor/plugins/mermaid-plugin-elegant.css +0 -443
- package/src/renderer/editor/plugins/mermaid-plugin-newsprint.css +0 -208
- package/src/renderer/editor/plugins/mermaid-plugin.css +0 -111
- package/src/renderer/editor/plugins/mermaid-plugin.ts +0 -670
- package/src/renderer/editor/plugins/themes/base/dark.css +0 -23
- package/src/renderer/editor/plugins/themes/base/elegant.css +0 -32
- package/src/renderer/editor/plugins/themes/base/light.css +0 -20
- package/src/renderer/editor/plugins/themes/base/newsprint.css +0 -27
- package/src/renderer/editor/plugins/themes/base.css +0 -509
- package/src/renderer/editor/plugins/themes/components/mermaid/academic.css +0 -43
- package/src/renderer/editor/plugins/themes/components/mermaid/dark.css +0 -20
- package/src/renderer/editor/plugins/themes/components/mermaid/elegant.css +0 -24
- package/src/renderer/editor/plugins/themes/components/mermaid/light.css +0 -21
- package/src/renderer/editor/plugins/themes/components/mermaid/newsprint.css +0 -26
- package/src/renderer/editor/plugins/themes/components/mermaid/variables.css +0 -592
- package/src/renderer/editor/plugins/themes/foundation.css +0 -143
- package/src/renderer/editor/plugins/themes/theme-manager.ts +0 -92
- package/src/renderer/env.d.ts +0 -10
- package/src/renderer/index.html +0 -76
- package/src/renderer/main.ts +0 -678
- package/src/renderer/mobile.css +0 -429
- package/tsconfig.json +0 -14
- package/tsconfig.main.json +0 -12
- package/tsconfig.main.tsbuildinfo +0 -1
- package/tsconfig.preload.json +0 -12
- package/tsconfig.preload.tsbuildinfo +0 -1
- package/tsconfig.renderer.json +0 -13
- package/tsconfig.renderer.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dagre-BM42HDAG-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dagre-BM42HDAG-NJgy8CTw.js","./graph--Vhl4p4D.js","./layout-B3giiMoK.js","./preload-helper-tXtZnHb0.js","./cose-bilkent-S5V4N54A-ldu81kCk.js","./cytoscape.esm-CpHeHM5e.js","./c4Diagram-AAUBKEIU-PJp81cGm.js","./chunk-ND2GUHAM-BUFT_yOe.js","./flowDiagram-I6XJVG4X-DBkZLqwn.js","./chunk-FMBD7UC4-CzgfEH2z.js","./chunk-55IACEB6-B2M27HQo.js","./chunk-2J33WTMH-BrchfQL6.js","./channel-CtIHaaRI.js","./erDiagram-TEJ5UH35-4ToW0p3h.js","./gitGraphDiagram-PVQCEYII-BcTNiFfg.js","./chunk-4BX2VUAB-BCc3Ev_H.js","./chunk-QZHKN3VN-C-zV7oBi.js","./wardley-L42UT6IY-b-_GPpqL.js","./ganttDiagram-6RSMTGT7-G3xD2VXj.js","./linear-Cqh3vVIf.js","./init-ZxktEp_H.js","./defaultLocale-B2RvLBDe.js","./infoDiagram-5YYISTIA-DjKa7Yv-.js","./pieDiagram-4H26LBE5-CVcfLtky.js","./arc-CpIo2PoE.js","./ordinal-DSZU4PqD.js","./quadrantDiagram-W4KKPZXB-wDHffPOs.js","./xychartDiagram-2RQKCTM6-CUtsHUQd.js","./requirementDiagram-4Y6WPE33-C4pgGDGv.js","./sequenceDiagram-3UESZ5HK-e6QS7gt8.js","./classDiagram-4FO5ZUOK-CAyhGSvf.js","./chunk-727SXJPM-DXDHGECs.js","./classDiagram-v2-Q7XG4LA2-CAyhGSvf.js","./stateDiagram-AJRCARHV-DgYKZzDq.js","./chunk-AQP2D5EJ-BNb1lOQY.js","./stateDiagram-v2-BHNVJYJU-CUdmd_50.js","./journeyDiagram-JHISSGLW-DxMBkVOF.js","./timeline-definition-PNZ67QCA-S12e1Mp_.js","./mindmap-definition-RKZ34NQL-DUay02ma.js","./kanban-definition-UN3LZRKU-DqJeL6E1.js","./sankeyDiagram-5OEKKPKP-Jsf0rRMo.js","./diagram-LMA3HP47-B71v6MOq.js","./diagram-2AECGRRQ-CuIcMpOn.js","./blockDiagram-GPEHLZMM-C-SuR6eu.js","./diagram-5GNKFQAL-BJwFCroB.js","./architectureDiagram-3BPJPVTR-T-4Cq0Bz.js","./diagram-KO2AKTUF-C7NgQ8ju.js","./ishikawaDiagram-YF4QCWOH-xIWzW1pL.js","./vennDiagram-CIIHVFJN-CNDBG6A2.js","./diagram-OG6HWLK6-D2ZxkrSe.js","./wardleyDiagram-YWT4CUSO-CLlGQcof.js","./index-CBcVpA3d.js","./index-B4uDgADr.js","./index-Y89U1ptl.js","./index-D4CPFkph.js","./index-DxOzbfR-.js","./index-CGj1spkU.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { _ as __vitePreload } from "./preload-helper-tXtZnHb0.js";
|
|
3
3
|
var ErrorCode = /* @__PURE__ */ (function(ErrorCode2) {
|
|
4
4
|
ErrorCode2["docTypeError"] = "docTypeError";
|
|
@@ -21875,6 +21875,9 @@ function togglePlugin(id33, enabled) {
|
|
|
21875
21875
|
const mod = modules.find((m2) => m2.info.id === id33);
|
|
21876
21876
|
if (mod) mod.info.enabled = enabled;
|
|
21877
21877
|
}
|
|
21878
|
+
function getContextMenuSelector() {
|
|
21879
|
+
return getAllPlugins().filter((p2) => p2.exportCapabilities && p2.exportCapabilities.length > 0).flatMap((p2) => (p2.nodeTypes || []).map((nt2) => "." + nt2.replace(/_/g, "-"))).join(", ");
|
|
21880
|
+
}
|
|
21878
21881
|
class ParseError extends Error {
|
|
21879
21882
|
// The underlying error message without any context added.
|
|
21880
21883
|
constructor(message, token2) {
|
|
@@ -37051,7 +37054,15 @@ const mathPlugin = {
|
|
|
37051
37054
|
name: "Math Rendering",
|
|
37052
37055
|
enabled: true,
|
|
37053
37056
|
remarkPlugin: { plugin: remarkMath, options: void 0 },
|
|
37054
|
-
nodeTypes: ["math_inline", "math_block"]
|
|
37057
|
+
nodeTypes: ["math_inline", "math_block"],
|
|
37058
|
+
clipboardStyles: {
|
|
37059
|
+
".math-inline": "display:inline;padding:2px 4px;border-radius:3px;background:rgba(175,184,193,0.2);",
|
|
37060
|
+
".math-block": "display:block;padding:16px;margin:1em 0;border-radius:6px;background:#f6f8fa;text-align:center;overflow-x:auto;"
|
|
37061
|
+
},
|
|
37062
|
+
exportStyles: `.math-inline{display:inline;padding:2px 4px;border-radius:3px;background:var(--code-bg)}
|
|
37063
|
+
.math-block{display:block;padding:16px;margin:1em 0;border-radius:6px;background:var(--code-block-bg);text-align:center;overflow-x:auto}`,
|
|
37064
|
+
rawSelectors: [".math-inline-raw", ".math-block-raw"],
|
|
37065
|
+
bgCaptureSelectors: [".math-inline", ".math-block"]
|
|
37055
37066
|
// TODO: KaTeX CSS 在 SVG foreignObject 中丢失,导致导出 PNG 二次内容/空白
|
|
37056
37067
|
// 后续需解决样式注入问题后重新启用
|
|
37057
37068
|
// exportCapabilities: [
|
|
@@ -53374,7 +53385,7 @@ var createText = /* @__PURE__ */ __name(async (el, text2 = "", {
|
|
|
53374
53385
|
return svgLabel;
|
|
53375
53386
|
}
|
|
53376
53387
|
}, "createText");
|
|
53377
|
-
function t(t2, e2, s2) {
|
|
53388
|
+
function t$1(t2, e2, s2) {
|
|
53378
53389
|
if (t2 && t2.length) {
|
|
53379
53390
|
const [n2, o2] = e2, a2 = Math.PI / 180 * s2, h2 = Math.cos(a2), r2 = Math.sin(a2);
|
|
53380
53391
|
for (const e3 of t2) {
|
|
@@ -53388,7 +53399,7 @@ function e(t2, e2) {
|
|
|
53388
53399
|
}
|
|
53389
53400
|
function s(s2, n2, o2, a2 = 1) {
|
|
53390
53401
|
const h2 = o2, r2 = Math.max(n2, 0.1), i2 = s2[0] && s2[0][0] && "number" == typeof s2[0][0] ? [s2] : s2, c2 = [0, 0];
|
|
53391
|
-
if (h2) for (const e2 of i2) t(e2, c2, h2);
|
|
53402
|
+
if (h2) for (const e2 of i2) t$1(e2, c2, h2);
|
|
53392
53403
|
const l4 = (function(t2, s3, n3) {
|
|
53393
53404
|
const o3 = [];
|
|
53394
53405
|
for (const s4 of t2) {
|
|
@@ -53428,10 +53439,10 @@ function s(s2, n2, o2, a2 = 1) {
|
|
|
53428
53439
|
return a3;
|
|
53429
53440
|
})(i2, r2, a2);
|
|
53430
53441
|
if (h2) {
|
|
53431
|
-
for (const e2 of i2) t(e2, c2, -h2);
|
|
53442
|
+
for (const e2 of i2) t$1(e2, c2, -h2);
|
|
53432
53443
|
!(function(e2, s3, n3) {
|
|
53433
53444
|
const o3 = [];
|
|
53434
|
-
e2.forEach(((t2) => o3.push(...t2))), t(o3, s3, n3);
|
|
53445
|
+
e2.forEach(((t2) => o3.push(...t2))), t$1(o3, s3, n3);
|
|
53435
53446
|
})(l4, c2, -h2);
|
|
53436
53447
|
}
|
|
53437
53448
|
return l4;
|
|
@@ -60938,12 +60949,12 @@ var registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => {
|
|
|
60938
60949
|
registerLayoutLoaders([
|
|
60939
60950
|
{
|
|
60940
60951
|
name: "dagre",
|
|
60941
|
-
loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-BM42HDAG-
|
|
60952
|
+
loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./dagre-BM42HDAG-NJgy8CTw.js"), true ? __vite__mapDeps([0,1,2,3]) : void 0, import.meta.url), "loader")
|
|
60942
60953
|
},
|
|
60943
60954
|
...[
|
|
60944
60955
|
{
|
|
60945
60956
|
name: "cose-bilkent",
|
|
60946
|
-
loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./cose-bilkent-S5V4N54A-
|
|
60957
|
+
loader: /* @__PURE__ */ __name(async () => await __vitePreload(() => import("./cose-bilkent-S5V4N54A-ldu81kCk.js"), true ? __vite__mapDeps([4,5,3]) : void 0, import.meta.url), "loader")
|
|
60947
60958
|
}
|
|
60948
60959
|
]
|
|
60949
60960
|
]);
|
|
@@ -61353,7 +61364,7 @@ var detector = /* @__PURE__ */ __name((txt) => {
|
|
|
61353
61364
|
}, "detector");
|
|
61354
61365
|
var loader = /* @__PURE__ */ __name(async () => {
|
|
61355
61366
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61356
|
-
const { diagram: diagram22 } = await import("./c4Diagram-AAUBKEIU-
|
|
61367
|
+
const { diagram: diagram22 } = await import("./c4Diagram-AAUBKEIU-PJp81cGm.js");
|
|
61357
61368
|
return { diagram: diagram22 };
|
|
61358
61369
|
}, true ? __vite__mapDeps([6,7,3]) : void 0, import.meta.url);
|
|
61359
61370
|
return { id: id$2, diagram: diagram2 };
|
|
@@ -61373,7 +61384,7 @@ var detector2 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61373
61384
|
}, "detector");
|
|
61374
61385
|
var loader2 = /* @__PURE__ */ __name(async () => {
|
|
61375
61386
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61376
|
-
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-
|
|
61387
|
+
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-DBkZLqwn.js");
|
|
61377
61388
|
return { diagram: diagram22 };
|
|
61378
61389
|
}, true ? __vite__mapDeps([8,9,7,10,11,12,3]) : void 0, import.meta.url);
|
|
61379
61390
|
return { id: id2, diagram: diagram2 };
|
|
@@ -61399,7 +61410,7 @@ var detector3 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61399
61410
|
}, "detector");
|
|
61400
61411
|
var loader3 = /* @__PURE__ */ __name(async () => {
|
|
61401
61412
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61402
|
-
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-
|
|
61413
|
+
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-DBkZLqwn.js");
|
|
61403
61414
|
return { diagram: diagram22 };
|
|
61404
61415
|
}, true ? __vite__mapDeps([8,9,7,10,11,12,3]) : void 0, import.meta.url);
|
|
61405
61416
|
return { id: id3, diagram: diagram2 };
|
|
@@ -61416,7 +61427,7 @@ var detector4 = /* @__PURE__ */ __name((txt) => {
|
|
|
61416
61427
|
}, "detector");
|
|
61417
61428
|
var loader4 = /* @__PURE__ */ __name(async () => {
|
|
61418
61429
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61419
|
-
const { diagram: diagram22 } = await import("./erDiagram-TEJ5UH35-
|
|
61430
|
+
const { diagram: diagram22 } = await import("./erDiagram-TEJ5UH35-4ToW0p3h.js");
|
|
61420
61431
|
return { diagram: diagram22 };
|
|
61421
61432
|
}, true ? __vite__mapDeps([13,10,11,12,3]) : void 0, import.meta.url);
|
|
61422
61433
|
return { id: id4, diagram: diagram2 };
|
|
@@ -61433,7 +61444,7 @@ var detector5 = /* @__PURE__ */ __name((txt) => {
|
|
|
61433
61444
|
}, "detector");
|
|
61434
61445
|
var loader5 = /* @__PURE__ */ __name(async () => {
|
|
61435
61446
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61436
|
-
const { diagram: diagram22 } = await import("./gitGraphDiagram-PVQCEYII-
|
|
61447
|
+
const { diagram: diagram22 } = await import("./gitGraphDiagram-PVQCEYII-BcTNiFfg.js");
|
|
61437
61448
|
return { diagram: diagram22 };
|
|
61438
61449
|
}, true ? __vite__mapDeps([14,15,16,17,3]) : void 0, import.meta.url);
|
|
61439
61450
|
return { id: id5, diagram: diagram2 };
|
|
@@ -61450,7 +61461,7 @@ var detector6 = /* @__PURE__ */ __name((txt) => {
|
|
|
61450
61461
|
}, "detector");
|
|
61451
61462
|
var loader6 = /* @__PURE__ */ __name(async () => {
|
|
61452
61463
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61453
|
-
const { diagram: diagram22 } = await import("./ganttDiagram-6RSMTGT7-
|
|
61464
|
+
const { diagram: diagram22 } = await import("./ganttDiagram-6RSMTGT7-G3xD2VXj.js");
|
|
61454
61465
|
return { diagram: diagram22 };
|
|
61455
61466
|
}, true ? __vite__mapDeps([18,19,20,21,3]) : void 0, import.meta.url);
|
|
61456
61467
|
return { id: id6, diagram: diagram2 };
|
|
@@ -61467,7 +61478,7 @@ var detector7 = /* @__PURE__ */ __name((txt) => {
|
|
|
61467
61478
|
}, "detector");
|
|
61468
61479
|
var loader7 = /* @__PURE__ */ __name(async () => {
|
|
61469
61480
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61470
|
-
const { diagram: diagram22 } = await import("./infoDiagram-5YYISTIA-
|
|
61481
|
+
const { diagram: diagram22 } = await import("./infoDiagram-5YYISTIA-DjKa7Yv-.js");
|
|
61471
61482
|
return { diagram: diagram22 };
|
|
61472
61483
|
}, true ? __vite__mapDeps([22,17,3]) : void 0, import.meta.url);
|
|
61473
61484
|
return { id: id7, diagram: diagram2 };
|
|
@@ -61483,7 +61494,7 @@ var detector8 = /* @__PURE__ */ __name((txt) => {
|
|
|
61483
61494
|
}, "detector");
|
|
61484
61495
|
var loader8 = /* @__PURE__ */ __name(async () => {
|
|
61485
61496
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61486
|
-
const { diagram: diagram22 } = await import("./pieDiagram-4H26LBE5-
|
|
61497
|
+
const { diagram: diagram22 } = await import("./pieDiagram-4H26LBE5-CVcfLtky.js");
|
|
61487
61498
|
return { diagram: diagram22 };
|
|
61488
61499
|
}, true ? __vite__mapDeps([23,15,17,3,24,25,20]) : void 0, import.meta.url);
|
|
61489
61500
|
return { id: id8, diagram: diagram2 };
|
|
@@ -61499,7 +61510,7 @@ var detector9 = /* @__PURE__ */ __name((txt) => {
|
|
|
61499
61510
|
}, "detector");
|
|
61500
61511
|
var loader9 = /* @__PURE__ */ __name(async () => {
|
|
61501
61512
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61502
|
-
const { diagram: diagram22 } = await import("./quadrantDiagram-W4KKPZXB-
|
|
61513
|
+
const { diagram: diagram22 } = await import("./quadrantDiagram-W4KKPZXB-wDHffPOs.js");
|
|
61503
61514
|
return { diagram: diagram22 };
|
|
61504
61515
|
}, true ? __vite__mapDeps([26,19,20,21,3]) : void 0, import.meta.url);
|
|
61505
61516
|
return { id: id9, diagram: diagram2 };
|
|
@@ -61516,7 +61527,7 @@ var detector10 = /* @__PURE__ */ __name((txt) => {
|
|
|
61516
61527
|
}, "detector");
|
|
61517
61528
|
var loader10 = /* @__PURE__ */ __name(async () => {
|
|
61518
61529
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61519
|
-
const { diagram: diagram22 } = await import("./xychartDiagram-2RQKCTM6-
|
|
61530
|
+
const { diagram: diagram22 } = await import("./xychartDiagram-2RQKCTM6-CUtsHUQd.js");
|
|
61520
61531
|
return { diagram: diagram22 };
|
|
61521
61532
|
}, true ? __vite__mapDeps([27,20,25,19,21,3]) : void 0, import.meta.url);
|
|
61522
61533
|
return { id: id10, diagram: diagram2 };
|
|
@@ -61533,7 +61544,7 @@ var detector11 = /* @__PURE__ */ __name((txt) => {
|
|
|
61533
61544
|
}, "detector");
|
|
61534
61545
|
var loader11 = /* @__PURE__ */ __name(async () => {
|
|
61535
61546
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61536
|
-
const { diagram: diagram22 } = await import("./requirementDiagram-4Y6WPE33-
|
|
61547
|
+
const { diagram: diagram22 } = await import("./requirementDiagram-4Y6WPE33-C4pgGDGv.js");
|
|
61537
61548
|
return { diagram: diagram22 };
|
|
61538
61549
|
}, true ? __vite__mapDeps([28,10,11,3]) : void 0, import.meta.url);
|
|
61539
61550
|
return { id: id11, diagram: diagram2 };
|
|
@@ -61550,7 +61561,7 @@ var detector12 = /* @__PURE__ */ __name((txt) => {
|
|
|
61550
61561
|
}, "detector");
|
|
61551
61562
|
var loader12 = /* @__PURE__ */ __name(async () => {
|
|
61552
61563
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61553
|
-
const { diagram: diagram22 } = await import("./sequenceDiagram-3UESZ5HK-
|
|
61564
|
+
const { diagram: diagram22 } = await import("./sequenceDiagram-3UESZ5HK-e6QS7gt8.js");
|
|
61554
61565
|
return { diagram: diagram22 };
|
|
61555
61566
|
}, true ? __vite__mapDeps([29,7,16,3]) : void 0, import.meta.url);
|
|
61556
61567
|
return { id: id12, diagram: diagram2 };
|
|
@@ -61570,7 +61581,7 @@ var detector13 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61570
61581
|
}, "detector");
|
|
61571
61582
|
var loader13 = /* @__PURE__ */ __name(async () => {
|
|
61572
61583
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61573
|
-
const { diagram: diagram22 } = await import("./classDiagram-4FO5ZUOK-
|
|
61584
|
+
const { diagram: diagram22 } = await import("./classDiagram-4FO5ZUOK-CAyhGSvf.js");
|
|
61574
61585
|
return { diagram: diagram22 };
|
|
61575
61586
|
}, true ? __vite__mapDeps([30,31,9,7,10,11,3]) : void 0, import.meta.url);
|
|
61576
61587
|
return { id: id13, diagram: diagram2 };
|
|
@@ -61590,7 +61601,7 @@ var detector14 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61590
61601
|
}, "detector");
|
|
61591
61602
|
var loader14 = /* @__PURE__ */ __name(async () => {
|
|
61592
61603
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61593
|
-
const { diagram: diagram22 } = await import("./classDiagram-v2-Q7XG4LA2-
|
|
61604
|
+
const { diagram: diagram22 } = await import("./classDiagram-v2-Q7XG4LA2-CAyhGSvf.js");
|
|
61594
61605
|
return { diagram: diagram22 };
|
|
61595
61606
|
}, true ? __vite__mapDeps([32,31,9,7,10,11,3]) : void 0, import.meta.url);
|
|
61596
61607
|
return { id: id14, diagram: diagram2 };
|
|
@@ -61610,7 +61621,7 @@ var detector15 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61610
61621
|
}, "detector");
|
|
61611
61622
|
var loader15 = /* @__PURE__ */ __name(async () => {
|
|
61612
61623
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61613
|
-
const { diagram: diagram22 } = await import("./stateDiagram-AJRCARHV-
|
|
61624
|
+
const { diagram: diagram22 } = await import("./stateDiagram-AJRCARHV-DgYKZzDq.js");
|
|
61614
61625
|
return { diagram: diagram22 };
|
|
61615
61626
|
}, true ? __vite__mapDeps([33,34,10,11,1,2,3]) : void 0, import.meta.url);
|
|
61616
61627
|
return { id: id15, diagram: diagram2 };
|
|
@@ -61633,7 +61644,7 @@ var detector16 = /* @__PURE__ */ __name((txt, config2) => {
|
|
|
61633
61644
|
}, "detector");
|
|
61634
61645
|
var loader16 = /* @__PURE__ */ __name(async () => {
|
|
61635
61646
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61636
|
-
const { diagram: diagram22 } = await import("./stateDiagram-v2-BHNVJYJU-
|
|
61647
|
+
const { diagram: diagram22 } = await import("./stateDiagram-v2-BHNVJYJU-CUdmd_50.js");
|
|
61637
61648
|
return { diagram: diagram22 };
|
|
61638
61649
|
}, true ? __vite__mapDeps([35,34,10,11,3]) : void 0, import.meta.url);
|
|
61639
61650
|
return { id: id16, diagram: diagram2 };
|
|
@@ -61650,7 +61661,7 @@ var detector17 = /* @__PURE__ */ __name((txt) => {
|
|
|
61650
61661
|
}, "detector");
|
|
61651
61662
|
var loader17 = /* @__PURE__ */ __name(async () => {
|
|
61652
61663
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61653
|
-
const { diagram: diagram22 } = await import("./journeyDiagram-JHISSGLW-
|
|
61664
|
+
const { diagram: diagram22 } = await import("./journeyDiagram-JHISSGLW-DxMBkVOF.js");
|
|
61654
61665
|
return { diagram: diagram22 };
|
|
61655
61666
|
}, true ? __vite__mapDeps([36,9,7,24,3]) : void 0, import.meta.url);
|
|
61656
61667
|
return { id: id17, diagram: diagram2 };
|
|
@@ -61720,7 +61731,7 @@ var detector18 = /* @__PURE__ */ __name((txt, config2 = {}) => {
|
|
|
61720
61731
|
}, "detector");
|
|
61721
61732
|
var loader18 = /* @__PURE__ */ __name(async () => {
|
|
61722
61733
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61723
|
-
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-
|
|
61734
|
+
const { diagram: diagram22 } = await import("./flowDiagram-I6XJVG4X-DBkZLqwn.js");
|
|
61724
61735
|
return { diagram: diagram22 };
|
|
61725
61736
|
}, true ? __vite__mapDeps([8,9,7,10,11,12,3]) : void 0, import.meta.url);
|
|
61726
61737
|
return { id: id18, diagram: diagram2 };
|
|
@@ -61737,7 +61748,7 @@ var detector19 = /* @__PURE__ */ __name((txt) => {
|
|
|
61737
61748
|
}, "detector");
|
|
61738
61749
|
var loader19 = /* @__PURE__ */ __name(async () => {
|
|
61739
61750
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61740
|
-
const { diagram: diagram22 } = await import("./timeline-definition-PNZ67QCA-
|
|
61751
|
+
const { diagram: diagram22 } = await import("./timeline-definition-PNZ67QCA-S12e1Mp_.js");
|
|
61741
61752
|
return { diagram: diagram22 };
|
|
61742
61753
|
}, true ? __vite__mapDeps([37,24,3]) : void 0, import.meta.url);
|
|
61743
61754
|
return { id: id19, diagram: diagram2 };
|
|
@@ -61754,7 +61765,7 @@ var detector20 = /* @__PURE__ */ __name((txt) => {
|
|
|
61754
61765
|
}, "detector");
|
|
61755
61766
|
var loader20 = /* @__PURE__ */ __name(async () => {
|
|
61756
61767
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61757
|
-
const { diagram: diagram22 } = await import("./mindmap-definition-RKZ34NQL-
|
|
61768
|
+
const { diagram: diagram22 } = await import("./mindmap-definition-RKZ34NQL-DUay02ma.js");
|
|
61758
61769
|
return { diagram: diagram22 };
|
|
61759
61770
|
}, true ? __vite__mapDeps([38,10,11,3]) : void 0, import.meta.url);
|
|
61760
61771
|
return { id: id20, diagram: diagram2 };
|
|
@@ -61771,7 +61782,7 @@ var detector21 = /* @__PURE__ */ __name((txt) => {
|
|
|
61771
61782
|
}, "detector");
|
|
61772
61783
|
var loader21 = /* @__PURE__ */ __name(async () => {
|
|
61773
61784
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61774
|
-
const { diagram: diagram22 } = await import("./kanban-definition-UN3LZRKU-
|
|
61785
|
+
const { diagram: diagram22 } = await import("./kanban-definition-UN3LZRKU-DqJeL6E1.js");
|
|
61775
61786
|
return { diagram: diagram22 };
|
|
61776
61787
|
}, true ? __vite__mapDeps([39,9,3]) : void 0, import.meta.url);
|
|
61777
61788
|
return { id: id21, diagram: diagram2 };
|
|
@@ -61788,7 +61799,7 @@ var detector22 = /* @__PURE__ */ __name((txt) => {
|
|
|
61788
61799
|
}, "detector");
|
|
61789
61800
|
var loader22 = /* @__PURE__ */ __name(async () => {
|
|
61790
61801
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61791
|
-
const { diagram: diagram22 } = await import("./sankeyDiagram-5OEKKPKP-
|
|
61802
|
+
const { diagram: diagram22 } = await import("./sankeyDiagram-5OEKKPKP-Jsf0rRMo.js");
|
|
61792
61803
|
return { diagram: diagram22 };
|
|
61793
61804
|
}, true ? __vite__mapDeps([40,25,20,3]) : void 0, import.meta.url);
|
|
61794
61805
|
return { id: id22, diagram: diagram2 };
|
|
@@ -61805,7 +61816,7 @@ var detector23 = /* @__PURE__ */ __name((txt) => {
|
|
|
61805
61816
|
}, "detector");
|
|
61806
61817
|
var loader23 = /* @__PURE__ */ __name(async () => {
|
|
61807
61818
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61808
|
-
const { diagram: diagram22 } = await import("./diagram-LMA3HP47-
|
|
61819
|
+
const { diagram: diagram22 } = await import("./diagram-LMA3HP47-B71v6MOq.js");
|
|
61809
61820
|
return { diagram: diagram22 };
|
|
61810
61821
|
}, true ? __vite__mapDeps([41,15,17,3]) : void 0, import.meta.url);
|
|
61811
61822
|
return { id: id23, diagram: diagram2 };
|
|
@@ -61821,7 +61832,7 @@ var detector24 = /* @__PURE__ */ __name((txt) => {
|
|
|
61821
61832
|
}, "detector");
|
|
61822
61833
|
var loader24 = /* @__PURE__ */ __name(async () => {
|
|
61823
61834
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61824
|
-
const { diagram: diagram22 } = await import("./diagram-2AECGRRQ-
|
|
61835
|
+
const { diagram: diagram22 } = await import("./diagram-2AECGRRQ-CuIcMpOn.js");
|
|
61825
61836
|
return { diagram: diagram22 };
|
|
61826
61837
|
}, true ? __vite__mapDeps([42,15,17,3]) : void 0, import.meta.url);
|
|
61827
61838
|
return { id: id24, diagram: diagram2 };
|
|
@@ -61837,7 +61848,7 @@ var detector25 = /* @__PURE__ */ __name((txt) => {
|
|
|
61837
61848
|
}, "detector");
|
|
61838
61849
|
var loader25 = /* @__PURE__ */ __name(async () => {
|
|
61839
61850
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61840
|
-
const { diagram: diagram22 } = await import("./blockDiagram-GPEHLZMM-
|
|
61851
|
+
const { diagram: diagram22 } = await import("./blockDiagram-GPEHLZMM-C-SuR6eu.js");
|
|
61841
61852
|
return { diagram: diagram22 };
|
|
61842
61853
|
}, true ? __vite__mapDeps([43,9,1,12,3]) : void 0, import.meta.url);
|
|
61843
61854
|
return { id: id25, diagram: diagram2 };
|
|
@@ -61854,7 +61865,7 @@ var detector26 = /* @__PURE__ */ __name((txt) => {
|
|
|
61854
61865
|
}, "detector");
|
|
61855
61866
|
var loader26 = /* @__PURE__ */ __name(async () => {
|
|
61856
61867
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61857
|
-
const { diagram: diagram22 } = await import("./diagram-5GNKFQAL-
|
|
61868
|
+
const { diagram: diagram22 } = await import("./diagram-5GNKFQAL-BJwFCroB.js");
|
|
61858
61869
|
return { diagram: diagram22 };
|
|
61859
61870
|
}, true ? __vite__mapDeps([44,15,16,17,3]) : void 0, import.meta.url);
|
|
61860
61871
|
return { id: id26, diagram: diagram2 };
|
|
@@ -61871,7 +61882,7 @@ var detector27 = /* @__PURE__ */ __name((txt) => {
|
|
|
61871
61882
|
}, "detector");
|
|
61872
61883
|
var loader27 = /* @__PURE__ */ __name(async () => {
|
|
61873
61884
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61874
|
-
const { diagram: diagram22 } = await import("./architectureDiagram-3BPJPVTR-
|
|
61885
|
+
const { diagram: diagram22 } = await import("./architectureDiagram-3BPJPVTR-T-4Cq0Bz.js");
|
|
61875
61886
|
return { diagram: diagram22 };
|
|
61876
61887
|
}, true ? __vite__mapDeps([45,15,17,3,5]) : void 0, import.meta.url);
|
|
61877
61888
|
return { id: id27, diagram: diagram2 };
|
|
@@ -61888,7 +61899,7 @@ var detector28 = /* @__PURE__ */ __name((txt) => {
|
|
|
61888
61899
|
}, "detector");
|
|
61889
61900
|
var loader28 = /* @__PURE__ */ __name(async () => {
|
|
61890
61901
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61891
|
-
const { diagram: diagram22 } = await import("./diagram-KO2AKTUF-
|
|
61902
|
+
const { diagram: diagram22 } = await import("./diagram-KO2AKTUF-C7NgQ8ju.js");
|
|
61892
61903
|
return { diagram: diagram22 };
|
|
61893
61904
|
}, true ? __vite__mapDeps([46,15,17,3]) : void 0, import.meta.url);
|
|
61894
61905
|
return { id: id28, diagram: diagram2 };
|
|
@@ -61905,7 +61916,7 @@ var detector29 = /* @__PURE__ */ __name((txt) => {
|
|
|
61905
61916
|
}, "detector");
|
|
61906
61917
|
var loader29 = /* @__PURE__ */ __name(async () => {
|
|
61907
61918
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61908
|
-
const { diagram: diagram22 } = await import("./ishikawaDiagram-YF4QCWOH-
|
|
61919
|
+
const { diagram: diagram22 } = await import("./ishikawaDiagram-YF4QCWOH-xIWzW1pL.js");
|
|
61909
61920
|
return { diagram: diagram22 };
|
|
61910
61921
|
}, true ? __vite__mapDeps([47,3]) : void 0, import.meta.url);
|
|
61911
61922
|
return { id: id29, diagram: diagram2 };
|
|
@@ -61921,7 +61932,7 @@ var detector30 = /* @__PURE__ */ __name((txt) => {
|
|
|
61921
61932
|
}, "detector");
|
|
61922
61933
|
var loader30 = /* @__PURE__ */ __name(async () => {
|
|
61923
61934
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61924
|
-
const { diagram: diagram22 } = await import("./vennDiagram-CIIHVFJN-
|
|
61935
|
+
const { diagram: diagram22 } = await import("./vennDiagram-CIIHVFJN-CNDBG6A2.js");
|
|
61925
61936
|
return { diagram: diagram22 };
|
|
61926
61937
|
}, true ? __vite__mapDeps([48,3]) : void 0, import.meta.url);
|
|
61927
61938
|
return { id: id30, diagram: diagram2 };
|
|
@@ -61938,7 +61949,7 @@ var detector31 = /* @__PURE__ */ __name((txt) => {
|
|
|
61938
61949
|
}, "detector");
|
|
61939
61950
|
var loader31 = /* @__PURE__ */ __name(async () => {
|
|
61940
61951
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61941
|
-
const { diagram: diagram22 } = await import("./diagram-OG6HWLK6-
|
|
61952
|
+
const { diagram: diagram22 } = await import("./diagram-OG6HWLK6-D2ZxkrSe.js");
|
|
61942
61953
|
return { diagram: diagram22 };
|
|
61943
61954
|
}, true ? __vite__mapDeps([49,11,15,17,3,21,25,20]) : void 0, import.meta.url);
|
|
61944
61955
|
return { id: id31, diagram: diagram2 };
|
|
@@ -61954,7 +61965,7 @@ var detector32 = /* @__PURE__ */ __name((text2) => {
|
|
|
61954
61965
|
}, "detector");
|
|
61955
61966
|
var loader32 = /* @__PURE__ */ __name(async () => {
|
|
61956
61967
|
const { diagram: diagram2 } = await __vitePreload(async () => {
|
|
61957
|
-
const { diagram: diagram22 } = await import("./wardleyDiagram-YWT4CUSO-
|
|
61968
|
+
const { diagram: diagram22 } = await import("./wardleyDiagram-YWT4CUSO-CLlGQcof.js");
|
|
61958
61969
|
return { diagram: diagram22 };
|
|
61959
61970
|
}, true ? __vite__mapDeps([50,15,17,3]) : void 0, import.meta.url);
|
|
61960
61971
|
return { id: id32, diagram: diagram2 };
|
|
@@ -63259,6 +63270,7 @@ function renderMermaidBlock(dom, node2, renderIdRef) {
|
|
|
63259
63270
|
}
|
|
63260
63271
|
dom.innerHTML = '<div class="mermaid-preview"><div class="mermaid-loading">Rendering...</div></div>';
|
|
63261
63272
|
const id33 = "mermaid-" + ++renderCounter;
|
|
63273
|
+
console.log("[ColaView] mermaid render id=", id33, "text=", JSON.stringify(text2.substring(0, 200)));
|
|
63262
63274
|
const renderPromise = mermaidLib.render(id33, text2).then((result) => {
|
|
63263
63275
|
if (currentRenderId !== renderIdRef.current) return;
|
|
63264
63276
|
const preview = dom.querySelector(".mermaid-preview");
|
|
@@ -63272,8 +63284,7 @@ function renderMermaidBlock(dom, node2, renderIdRef) {
|
|
|
63272
63284
|
if (currentRenderId !== renderIdRef.current) return;
|
|
63273
63285
|
const preview = dom.querySelector(".mermaid-preview");
|
|
63274
63286
|
if (preview) {
|
|
63275
|
-
|
|
63276
|
-
preview.innerHTML = '<div class="mermaid-error">Error: ' + msg + "</div>";
|
|
63287
|
+
preview.innerHTML = '<pre class="mermaid-error-source"><code>' + text2.replace(/&/g, "&").replace(/</g, "<") + "</code></pre>";
|
|
63277
63288
|
}
|
|
63278
63289
|
}).finally(() => {
|
|
63279
63290
|
pendingRenders.delete(renderPromise);
|
|
@@ -63363,6 +63374,16 @@ const mermaidPlugin = {
|
|
|
63363
63374
|
enabled: true,
|
|
63364
63375
|
remarkPlugin: { plugin: remarkMermaid, options: void 0 },
|
|
63365
63376
|
nodeTypes: ["mermaid_block"],
|
|
63377
|
+
clipboardStyles: {
|
|
63378
|
+
".mermaid-block": "display:block;padding:16px;margin:1em 0;border-radius:6px;background:#f6f8fa;border:1px solid #d0d7de;",
|
|
63379
|
+
".mermaid-preview svg": "max-width:100%;height:auto;"
|
|
63380
|
+
},
|
|
63381
|
+
exportStyles: `.mermaid-block{display:block;padding:16px;margin:1em 0;border-radius:6px;background:var(--mermaid-background,var(--bg-color));border:1px solid var(--border-color)}
|
|
63382
|
+
.mermaid-preview{display:flex;justify-content:center;align-items:center}
|
|
63383
|
+
.mermaid-preview svg{max-width:100%;height:auto}`,
|
|
63384
|
+
rawSelectors: ["textarea.mermaid-source"],
|
|
63385
|
+
hideSelectors: [".mermaid-loading", ".mermaid-error"],
|
|
63386
|
+
bgCaptureSelectors: [".mermaid-block"],
|
|
63366
63387
|
exportCapabilities: [
|
|
63367
63388
|
{
|
|
63368
63389
|
label: "Save Diagram as PNG",
|
|
@@ -71639,27 +71660,21 @@ function enhanceClipboard(e2) {
|
|
|
71639
71660
|
doc2.querySelectorAll("pre code").forEach((el) => {
|
|
71640
71661
|
el.setAttribute("style", "background:none;padding:0;font-size:.875em;line-height:1.6;font-family:Menlo,Monaco,monospace;");
|
|
71641
71662
|
});
|
|
71642
|
-
|
|
71643
|
-
|
|
71644
|
-
|
|
71645
|
-
|
|
71646
|
-
|
|
71647
|
-
|
|
71648
|
-
|
|
71649
|
-
|
|
71650
|
-
});
|
|
71651
|
-
doc2.querySelectorAll(".mermaid-preview svg").forEach((el) => {
|
|
71652
|
-
el.setAttribute("style", "max-width:100%;height:auto;");
|
|
71653
|
-
});
|
|
71663
|
+
for (const p2 of getAllPlugins()) {
|
|
71664
|
+
if (!p2.enabled || !p2.clipboardStyles) continue;
|
|
71665
|
+
for (const [selector2, style] of Object.entries(p2.clipboardStyles)) {
|
|
71666
|
+
doc2.querySelectorAll(selector2).forEach((el) => {
|
|
71667
|
+
el.setAttribute("style", style);
|
|
71668
|
+
});
|
|
71669
|
+
}
|
|
71670
|
+
}
|
|
71654
71671
|
e2.clipboardData?.setData("text/html", doc2.body.innerHTML);
|
|
71655
71672
|
}
|
|
71656
71673
|
const defaultContent = `# Welcome to ColaMD
|
|
71657
71674
|
|
|
71658
71675
|
Start typing here...
|
|
71659
71676
|
`;
|
|
71660
|
-
async function
|
|
71661
|
-
const root2 = document.getElementById(rootId);
|
|
71662
|
-
if (!root2) throw new Error(`Element #${rootId} not found`);
|
|
71677
|
+
async function createMilkdownEditor(root2, options = {}) {
|
|
71663
71678
|
const pluginModules = getAllPluginModules();
|
|
71664
71679
|
let builder = Editor.make().config((ctx) => {
|
|
71665
71680
|
ctx.set(rootCtx, root2);
|
|
@@ -71668,6 +71683,11 @@ async function createEditor(rootId, onChange) {
|
|
|
71668
71683
|
...pluginModules.map((m2) => m2.info.remarkPlugin),
|
|
71669
71684
|
{ plugin: remarkBreaks, options: void 0 }
|
|
71670
71685
|
]);
|
|
71686
|
+
if (options.onChange) {
|
|
71687
|
+
ctx.get(listenerCtx).markdownUpdated((_ctx, markdown) => {
|
|
71688
|
+
options.onChange(markdown);
|
|
71689
|
+
});
|
|
71690
|
+
}
|
|
71671
71691
|
}).use(commonmark).use(gfm).use(history).use(listener).use(clipboard).use(htmlView);
|
|
71672
71692
|
for (const mod of pluginModules) {
|
|
71673
71693
|
for (const p2 of mod.milkdownPlugins) {
|
|
@@ -71677,9 +71697,12 @@ async function createEditor(rootId, onChange) {
|
|
|
71677
71697
|
try {
|
|
71678
71698
|
editorInstance = await builder.create();
|
|
71679
71699
|
} catch (e2) {
|
|
71680
|
-
|
|
71681
|
-
|
|
71682
|
-
|
|
71700
|
+
const offendingModule = pluginModules.find(
|
|
71701
|
+
(m2) => m2.info.nodeTypes?.some((nt2) => e2?.message?.includes(nt2))
|
|
71702
|
+
);
|
|
71703
|
+
if (offendingModule) {
|
|
71704
|
+
console.warn("[editor] Milkdown context error, retrying without plugin:", offendingModule.info.id, e2.message);
|
|
71705
|
+
const filteredModules = pluginModules.filter((m2) => m2 !== offendingModule);
|
|
71683
71706
|
builder = Editor.make().config((ctx) => {
|
|
71684
71707
|
ctx.set(rootCtx, root2);
|
|
71685
71708
|
ctx.set(defaultValueCtx, defaultContent);
|
|
@@ -71687,6 +71710,9 @@ async function createEditor(rootId, onChange) {
|
|
|
71687
71710
|
...filteredModules.map((m2) => m2.info.remarkPlugin),
|
|
71688
71711
|
{ plugin: remarkBreaks, options: void 0 }
|
|
71689
71712
|
]);
|
|
71713
|
+
if (options.onChange) ctx.get(listenerCtx).markdownUpdated((_ctx, markdown) => {
|
|
71714
|
+
options.onChange(markdown);
|
|
71715
|
+
});
|
|
71690
71716
|
}).use(commonmark).use(gfm).use(history).use(listener).use(clipboard).use(htmlView);
|
|
71691
71717
|
for (const mod of filteredModules) {
|
|
71692
71718
|
for (const p2 of mod.milkdownPlugins) {
|
|
@@ -71704,7 +71730,7 @@ async function createEditor(rootId, onChange) {
|
|
|
71704
71730
|
const fixed = nvs.map((nv, i2) => {
|
|
71705
71731
|
if (nv[0] != null) return nv;
|
|
71706
71732
|
const viewFn = nv[1];
|
|
71707
|
-
const fallbackNames =
|
|
71733
|
+
const fallbackNames = pluginModules.flatMap((m2) => m2.info.nodeTypes || []);
|
|
71708
71734
|
const name = fallbackNames[i2 - 1];
|
|
71709
71735
|
if (name && schema2.nodes[name]) {
|
|
71710
71736
|
return [name, viewFn];
|
|
@@ -71733,12 +71759,21 @@ async function createEditor(rootId, onChange) {
|
|
|
71733
71759
|
const href = link2.getAttribute("href");
|
|
71734
71760
|
if (href) {
|
|
71735
71761
|
e2.preventDefault();
|
|
71736
|
-
|
|
71737
|
-
|
|
71762
|
+
if (options.onExternalLink) {
|
|
71763
|
+
options.onExternalLink(href);
|
|
71764
|
+
} else {
|
|
71765
|
+
window.electronAPI?.openExternal(href);
|
|
71766
|
+
window.capacitorAPI?.openExternal(href);
|
|
71767
|
+
}
|
|
71738
71768
|
}
|
|
71739
71769
|
});
|
|
71740
71770
|
return editorInstance;
|
|
71741
71771
|
}
|
|
71772
|
+
async function createEditor(rootId, onChange) {
|
|
71773
|
+
const root2 = document.getElementById(rootId);
|
|
71774
|
+
if (!root2) throw new Error(`Element #${rootId} not found`);
|
|
71775
|
+
return createMilkdownEditor(root2, { onChange });
|
|
71776
|
+
}
|
|
71742
71777
|
function getMarkdown() {
|
|
71743
71778
|
if (!editorInstance) return "";
|
|
71744
71779
|
let markdown = "";
|
|
@@ -71753,23 +71788,27 @@ function getLiveHTML() {
|
|
|
71753
71788
|
const editorDom = document.querySelector("#editor .ProseMirror");
|
|
71754
71789
|
if (!editorDom) return "";
|
|
71755
71790
|
const clone2 = editorDom.cloneNode(true);
|
|
71756
|
-
const
|
|
71757
|
-
|
|
71758
|
-
|
|
71759
|
-
|
|
71760
|
-
|
|
71761
|
-
|
|
71762
|
-
|
|
71763
|
-
|
|
71764
|
-
|
|
71765
|
-
|
|
71766
|
-
|
|
71767
|
-
|
|
71768
|
-
|
|
71791
|
+
const plugins2 = getAllPlugins().filter((p2) => p2.enabled);
|
|
71792
|
+
for (const p2 of plugins2) {
|
|
71793
|
+
if (!p2.bgCaptureSelectors) continue;
|
|
71794
|
+
for (const selector2 of p2.bgCaptureSelectors) {
|
|
71795
|
+
const originals = editorDom.querySelectorAll(selector2);
|
|
71796
|
+
const clones = clone2.querySelectorAll(selector2);
|
|
71797
|
+
originals.forEach((orig, i2) => {
|
|
71798
|
+
const val = getComputedStyle(orig).backgroundColor;
|
|
71799
|
+
if (val && clones[i2]) clones[i2].style.backgroundColor = val;
|
|
71800
|
+
});
|
|
71801
|
+
}
|
|
71802
|
+
}
|
|
71803
|
+
const rawSelectors = plugins2.flatMap((p2) => p2.rawSelectors || []);
|
|
71804
|
+
if (rawSelectors.length) {
|
|
71805
|
+
clone2.querySelectorAll(rawSelectors.join(",")).forEach((el) => el.remove());
|
|
71769
71806
|
}
|
|
71770
|
-
|
|
71771
|
-
|
|
71772
|
-
|
|
71807
|
+
const hideSelectors = plugins2.flatMap((p2) => p2.hideSelectors || []);
|
|
71808
|
+
if (hideSelectors.length) {
|
|
71809
|
+
clone2.querySelectorAll(hideSelectors.join(",")).forEach((el) => el.style.display = "none");
|
|
71810
|
+
}
|
|
71811
|
+
return `<div id="write">${clone2.innerHTML}</div>`;
|
|
71773
71812
|
}
|
|
71774
71813
|
function setMarkdown(content2) {
|
|
71775
71814
|
if (!editorInstance) return;
|
|
@@ -71837,6 +71876,34 @@ function applyTheme(name, customCSS) {
|
|
|
71837
71876
|
function loadSavedTheme() {
|
|
71838
71877
|
return localStorage.getItem("colamd-theme") || "elegant";
|
|
71839
71878
|
}
|
|
71879
|
+
function getActiveCustomThemeCSS() {
|
|
71880
|
+
const name = loadSavedTheme();
|
|
71881
|
+
if (name.startsWith("custom:")) {
|
|
71882
|
+
const key2 = name.slice(7);
|
|
71883
|
+
return customThemeCache.get(key2)?.css || null;
|
|
71884
|
+
}
|
|
71885
|
+
return null;
|
|
71886
|
+
}
|
|
71887
|
+
function extractPrintCSSFromSheet() {
|
|
71888
|
+
const name = loadSavedTheme();
|
|
71889
|
+
if (!name.startsWith("custom:")) return null;
|
|
71890
|
+
const key2 = name.slice(7);
|
|
71891
|
+
const cached = customThemeCache.get(key2);
|
|
71892
|
+
if (!cached) return null;
|
|
71893
|
+
const css = cached.css;
|
|
71894
|
+
const startIdx = css.indexOf("@media print");
|
|
71895
|
+
if (startIdx === -1) return null;
|
|
71896
|
+
const openBrace = css.indexOf("{", startIdx);
|
|
71897
|
+
if (openBrace === -1) return null;
|
|
71898
|
+
let depth = 1;
|
|
71899
|
+
let i2 = openBrace + 1;
|
|
71900
|
+
while (i2 < css.length && depth > 0) {
|
|
71901
|
+
if (css[i2] === "{") depth++;
|
|
71902
|
+
else if (css[i2] === "}") depth--;
|
|
71903
|
+
i2++;
|
|
71904
|
+
}
|
|
71905
|
+
return css.substring(startIdx, i2);
|
|
71906
|
+
}
|
|
71840
71907
|
const { Capacitor } = await __vitePreload(async () => {
|
|
71841
71908
|
const { Capacitor: Capacitor2 } = await import("./index-B4uDgADr.js");
|
|
71842
71909
|
return { Capacitor: Capacitor2 };
|
|
@@ -72403,10 +72470,238 @@ Edit this file in ColaMD and see your changes in real time.
|
|
|
72403
72470
|
} catch {
|
|
72404
72471
|
return false;
|
|
72405
72472
|
}
|
|
72473
|
+
},
|
|
72474
|
+
/**
|
|
72475
|
+
* 设置语言(移动端仅本地存储,无 Electron 菜单需要更新)
|
|
72476
|
+
*/
|
|
72477
|
+
async setLocale(locale) {
|
|
72478
|
+
try {
|
|
72479
|
+
localStorage.setItem("colamd-locale", locale);
|
|
72480
|
+
} catch {
|
|
72481
|
+
}
|
|
72482
|
+
return locale;
|
|
72406
72483
|
}
|
|
72407
72484
|
};
|
|
72408
72485
|
return api;
|
|
72409
72486
|
}
|
|
72487
|
+
const en = {
|
|
72488
|
+
app: {
|
|
72489
|
+
name: "ColaMD",
|
|
72490
|
+
title: "ColaMD"
|
|
72491
|
+
},
|
|
72492
|
+
menu: {
|
|
72493
|
+
file: "File",
|
|
72494
|
+
edit: "Edit",
|
|
72495
|
+
view: "View",
|
|
72496
|
+
theme: "Theme",
|
|
72497
|
+
help: "Help",
|
|
72498
|
+
plugins: "Plugins",
|
|
72499
|
+
about: "About"
|
|
72500
|
+
},
|
|
72501
|
+
fileMenu: {
|
|
72502
|
+
new: "New",
|
|
72503
|
+
newSlides: "New Slides...",
|
|
72504
|
+
open: "Open...",
|
|
72505
|
+
save: "Save",
|
|
72506
|
+
saveAs: "Save As...",
|
|
72507
|
+
exportPDF: "Export PDF...",
|
|
72508
|
+
exportHTML: "Export HTML...",
|
|
72509
|
+
exportSlides: "Export Slides...",
|
|
72510
|
+
openAsSlides: "Open as Slides",
|
|
72511
|
+
close: "Close",
|
|
72512
|
+
quit: "Quit"
|
|
72513
|
+
},
|
|
72514
|
+
editMenu: {
|
|
72515
|
+
undo: "Undo",
|
|
72516
|
+
redo: "Redo",
|
|
72517
|
+
cut: "Cut",
|
|
72518
|
+
copy: "Copy",
|
|
72519
|
+
paste: "Paste",
|
|
72520
|
+
selectAll: "Select All"
|
|
72521
|
+
},
|
|
72522
|
+
viewMenu: {
|
|
72523
|
+
resetZoom: "Actual Size",
|
|
72524
|
+
zoomIn: "Zoom In",
|
|
72525
|
+
zoomOut: "Zoom Out",
|
|
72526
|
+
toggleFullscreen: "Toggle Fullscreen"
|
|
72527
|
+
},
|
|
72528
|
+
themeMenu: {
|
|
72529
|
+
light: "Light",
|
|
72530
|
+
dark: "Dark",
|
|
72531
|
+
elegant: "Elegant",
|
|
72532
|
+
newsprint: "Newsprint",
|
|
72533
|
+
importTheme: "Import Theme..."
|
|
72534
|
+
},
|
|
72535
|
+
helpMenu: {
|
|
72536
|
+
about: "About ColaMD"
|
|
72537
|
+
},
|
|
72538
|
+
export: {
|
|
72539
|
+
export: "Export",
|
|
72540
|
+
exportPDF: "Export PDF",
|
|
72541
|
+
exportHTML: "Export HTML",
|
|
72542
|
+
exportSlides: "Export Slides"
|
|
72543
|
+
},
|
|
72544
|
+
slides: {
|
|
72545
|
+
slides: "Slides",
|
|
72546
|
+
newSlides: "New Slides",
|
|
72547
|
+
openAsSlides: "Open as Slides"
|
|
72548
|
+
},
|
|
72549
|
+
about: {
|
|
72550
|
+
about: "About",
|
|
72551
|
+
aboutApp: "About ColaMD",
|
|
72552
|
+
exit: "Exit"
|
|
72553
|
+
},
|
|
72554
|
+
toast: {
|
|
72555
|
+
saved: "Saved",
|
|
72556
|
+
saveFailed: "Save failed",
|
|
72557
|
+
saveCancelled: "Save cancelled or failed"
|
|
72558
|
+
},
|
|
72559
|
+
mobile: {
|
|
72560
|
+
menuTitle: "ColaMD",
|
|
72561
|
+
close: "Close"
|
|
72562
|
+
}
|
|
72563
|
+
};
|
|
72564
|
+
const zhCN = {
|
|
72565
|
+
app: {
|
|
72566
|
+
name: "ColaMD",
|
|
72567
|
+
title: "ColaMD"
|
|
72568
|
+
},
|
|
72569
|
+
menu: {
|
|
72570
|
+
file: "文件",
|
|
72571
|
+
edit: "编辑",
|
|
72572
|
+
view: "视图",
|
|
72573
|
+
theme: "主题",
|
|
72574
|
+
help: "帮助",
|
|
72575
|
+
plugins: "插件",
|
|
72576
|
+
about: "关于"
|
|
72577
|
+
},
|
|
72578
|
+
fileMenu: {
|
|
72579
|
+
new: "新建",
|
|
72580
|
+
newSlides: "新建幻灯片...",
|
|
72581
|
+
open: "打开...",
|
|
72582
|
+
save: "保存",
|
|
72583
|
+
saveAs: "另存为...",
|
|
72584
|
+
exportPDF: "导出 PDF...",
|
|
72585
|
+
exportHTML: "导出 HTML...",
|
|
72586
|
+
exportSlides: "导出幻灯片...",
|
|
72587
|
+
openAsSlides: "打开为幻灯片",
|
|
72588
|
+
close: "关闭",
|
|
72589
|
+
quit: "退出"
|
|
72590
|
+
},
|
|
72591
|
+
editMenu: {
|
|
72592
|
+
undo: "撤销",
|
|
72593
|
+
redo: "重做",
|
|
72594
|
+
cut: "剪切",
|
|
72595
|
+
copy: "复制",
|
|
72596
|
+
paste: "粘贴",
|
|
72597
|
+
selectAll: "全选"
|
|
72598
|
+
},
|
|
72599
|
+
viewMenu: {
|
|
72600
|
+
resetZoom: "实际大小",
|
|
72601
|
+
zoomIn: "放大",
|
|
72602
|
+
zoomOut: "缩小",
|
|
72603
|
+
toggleFullscreen: "切换全屏"
|
|
72604
|
+
},
|
|
72605
|
+
themeMenu: {
|
|
72606
|
+
light: "浅色",
|
|
72607
|
+
dark: "深色",
|
|
72608
|
+
elegant: "优雅",
|
|
72609
|
+
newsprint: "新闻纸",
|
|
72610
|
+
importTheme: "导入主题..."
|
|
72611
|
+
},
|
|
72612
|
+
helpMenu: {
|
|
72613
|
+
about: "关于 ColaMD"
|
|
72614
|
+
},
|
|
72615
|
+
export: {
|
|
72616
|
+
export: "导出",
|
|
72617
|
+
exportPDF: "导出 PDF",
|
|
72618
|
+
exportHTML: "导出 HTML",
|
|
72619
|
+
exportSlides: "导出幻灯片"
|
|
72620
|
+
},
|
|
72621
|
+
slides: {
|
|
72622
|
+
slides: "幻灯片",
|
|
72623
|
+
newSlides: "新建幻灯片",
|
|
72624
|
+
openAsSlides: "打开为幻灯片"
|
|
72625
|
+
},
|
|
72626
|
+
about: {
|
|
72627
|
+
about: "关于",
|
|
72628
|
+
aboutApp: "关于 ColaMD",
|
|
72629
|
+
exit: "退出"
|
|
72630
|
+
},
|
|
72631
|
+
toast: {
|
|
72632
|
+
saved: "已保存",
|
|
72633
|
+
saveFailed: "保存失败",
|
|
72634
|
+
saveCancelled: "已取消或保存失败"
|
|
72635
|
+
},
|
|
72636
|
+
mobile: {
|
|
72637
|
+
menuTitle: "ColaMD",
|
|
72638
|
+
close: "关闭"
|
|
72639
|
+
}
|
|
72640
|
+
};
|
|
72641
|
+
const localeMap = {
|
|
72642
|
+
"en": en,
|
|
72643
|
+
"zh-CN": zhCN
|
|
72644
|
+
};
|
|
72645
|
+
let currentLocale = detectDefaultLocale();
|
|
72646
|
+
const changeListeners = [];
|
|
72647
|
+
function detectDefaultLocale() {
|
|
72648
|
+
try {
|
|
72649
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
72650
|
+
const lang = navigator.language.toLowerCase();
|
|
72651
|
+
if (lang.startsWith("zh")) return "zh-CN";
|
|
72652
|
+
}
|
|
72653
|
+
if (typeof Intl !== "undefined") {
|
|
72654
|
+
const lang = Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();
|
|
72655
|
+
if (lang.startsWith("zh")) return "zh-CN";
|
|
72656
|
+
}
|
|
72657
|
+
} catch {
|
|
72658
|
+
}
|
|
72659
|
+
try {
|
|
72660
|
+
const stored = localStorage.getItem("colamd-locale");
|
|
72661
|
+
if (stored && (stored === "en" || stored === "zh-CN")) return stored;
|
|
72662
|
+
} catch {
|
|
72663
|
+
}
|
|
72664
|
+
return "en";
|
|
72665
|
+
}
|
|
72666
|
+
function getCurrentLocale() {
|
|
72667
|
+
return currentLocale;
|
|
72668
|
+
}
|
|
72669
|
+
function setLocale(locale) {
|
|
72670
|
+
if (currentLocale === locale) return;
|
|
72671
|
+
currentLocale = locale;
|
|
72672
|
+
try {
|
|
72673
|
+
localStorage.setItem("colamd-locale", locale);
|
|
72674
|
+
} catch {
|
|
72675
|
+
}
|
|
72676
|
+
if (typeof window !== "undefined" && window.electronAPI?.setLocale) {
|
|
72677
|
+
window.electronAPI.setLocale(locale).catch((e2) => {
|
|
72678
|
+
console.warn("[i18n] Failed to sync locale to main process:", e2);
|
|
72679
|
+
});
|
|
72680
|
+
}
|
|
72681
|
+
changeListeners.forEach((listener2) => listener2(locale));
|
|
72682
|
+
}
|
|
72683
|
+
function t(key2) {
|
|
72684
|
+
const keys2 = key2.split(".");
|
|
72685
|
+
let value = localeMap[currentLocale];
|
|
72686
|
+
for (const k2 of keys2) {
|
|
72687
|
+
if (value == null || typeof value !== "object") return key2;
|
|
72688
|
+
value = value[k2];
|
|
72689
|
+
}
|
|
72690
|
+
return typeof value === "string" ? value : key2;
|
|
72691
|
+
}
|
|
72692
|
+
function onLocaleChange(callback) {
|
|
72693
|
+
changeListeners.push(callback);
|
|
72694
|
+
return () => {
|
|
72695
|
+
const index2 = changeListeners.indexOf(callback);
|
|
72696
|
+
if (index2 > -1) changeListeners.splice(index2, 1);
|
|
72697
|
+
};
|
|
72698
|
+
}
|
|
72699
|
+
function getSupportedLocales() {
|
|
72700
|
+
return [
|
|
72701
|
+
{ code: "en", name: "English" },
|
|
72702
|
+
{ code: "zh-CN", name: "简体中文" }
|
|
72703
|
+
];
|
|
72704
|
+
}
|
|
72410
72705
|
function showToast(message, duration = 2e3) {
|
|
72411
72706
|
const existing = document.querySelector(".cola-toast");
|
|
72412
72707
|
if (existing) existing.remove();
|
|
@@ -72488,9 +72783,12 @@ function getContent() {
|
|
|
72488
72783
|
return getMarkdown();
|
|
72489
72784
|
}
|
|
72490
72785
|
function syncRawEdits() {
|
|
72491
|
-
|
|
72492
|
-
|
|
72493
|
-
|
|
72786
|
+
const selectors = getAllPlugins().filter((p2) => p2.enabled).flatMap((p2) => p2.rawSelectors || []).join(",");
|
|
72787
|
+
if (selectors) {
|
|
72788
|
+
document.querySelectorAll(selectors).forEach((el) => {
|
|
72789
|
+
if (el.matches(":focus")) el.blur();
|
|
72790
|
+
});
|
|
72791
|
+
}
|
|
72494
72792
|
}
|
|
72495
72793
|
function restoreRenderedMode(api) {
|
|
72496
72794
|
for (const p2 of getAllPlugins()) {
|
|
@@ -72553,6 +72851,9 @@ async function init() {
|
|
|
72553
72851
|
}
|
|
72554
72852
|
});
|
|
72555
72853
|
setupMobileMenu(api, savedTheme);
|
|
72854
|
+
onLocaleChange(() => {
|
|
72855
|
+
updateMobileMenuI18n();
|
|
72856
|
+
});
|
|
72556
72857
|
if (!window.electronAPI) {
|
|
72557
72858
|
setInterval(() => processPendingIntentFile(api), 3e3);
|
|
72558
72859
|
}
|
|
@@ -72586,7 +72887,16 @@ async function init() {
|
|
|
72586
72887
|
restoreRenderedMode(api);
|
|
72587
72888
|
await ensureAllPluginsRendered();
|
|
72588
72889
|
await new Promise((r2) => setTimeout(r2, 300));
|
|
72589
|
-
|
|
72890
|
+
const printCSS = extractPrintCSSFromSheet();
|
|
72891
|
+
let printStyleEl = null;
|
|
72892
|
+
if (printCSS) {
|
|
72893
|
+
printStyleEl = document.createElement("style");
|
|
72894
|
+
printStyleEl.textContent = printCSS;
|
|
72895
|
+
document.head.appendChild(printStyleEl);
|
|
72896
|
+
await new Promise((r2) => requestAnimationFrame(r2));
|
|
72897
|
+
}
|
|
72898
|
+
await api.exportPDF(printCSS || void 0);
|
|
72899
|
+
if (printStyleEl) printStyleEl.remove();
|
|
72590
72900
|
setTimeout(() => {
|
|
72591
72901
|
document.querySelectorAll(".mermaid-loading, .mermaid-error").forEach((el) => el.style.display = "none");
|
|
72592
72902
|
}, 1e3);
|
|
@@ -72596,58 +72906,7 @@ async function init() {
|
|
|
72596
72906
|
restoreRenderedMode(api);
|
|
72597
72907
|
await ensureAllPluginsRendered();
|
|
72598
72908
|
await new Promise((r2) => setTimeout(r2, 200));
|
|
72599
|
-
|
|
72600
|
-
const v2 = (name) => s2.getPropertyValue(name).trim();
|
|
72601
|
-
const bgColor = v2("--bg-color");
|
|
72602
|
-
const textColor = v2("--text-color");
|
|
72603
|
-
const textMuted = v2("--text-muted");
|
|
72604
|
-
const borderColor = v2("--border-color");
|
|
72605
|
-
const linkColor = v2("--link-color");
|
|
72606
|
-
const codeBg = v2("--code-bg");
|
|
72607
|
-
const codeBlockBg = v2("--code-block-bg");
|
|
72608
|
-
const codeBlockText = v2("--code-block-text") || textColor;
|
|
72609
|
-
const mermaidBg = v2("--mermaid-background") || bgColor;
|
|
72610
|
-
const blockquoteBorder = v2("--blockquote-border");
|
|
72611
|
-
const blockquoteBg = v2("--blockquote-bg") || "transparent";
|
|
72612
|
-
const tableHeaderBg = v2("--table-header-bg");
|
|
72613
|
-
const selectionBg = v2("--selection-bg");
|
|
72614
|
-
const editor = document.querySelector("#editor .ProseMirror");
|
|
72615
|
-
const fontFamily = editor ? getComputedStyle(editor).fontFamily : "-apple-system,BlinkMacSystemFont,sans-serif";
|
|
72616
|
-
const getElColor = (selector2, fallback) => {
|
|
72617
|
-
const el = document.querySelector(`#editor .ProseMirror ${selector2}`);
|
|
72618
|
-
return el ? getComputedStyle(el).color : fallback;
|
|
72619
|
-
};
|
|
72620
|
-
const strongColor = getElColor("strong", textColor);
|
|
72621
|
-
const codeColor = getElColor("code", textColor);
|
|
72622
|
-
const html2 = `<!DOCTYPE html>
|
|
72623
|
-
<html><head><meta charset="utf-8"><title>ColaMD Export</title>
|
|
72624
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.46/dist/katex.min.css">
|
|
72625
|
-
<style>
|
|
72626
|
-
body{max-width:780px;margin:40px auto;padding:20px;font-family:${fontFamily};line-height:1.75;background:${bgColor};color:${textColor}}
|
|
72627
|
-
h1{font-size:2em;font-weight:700;border-bottom:1px solid ${borderColor};padding-bottom:.3em}
|
|
72628
|
-
h2{font-size:1.5em;font-weight:600;border-bottom:1px solid ${borderColor};padding-bottom:.25em}
|
|
72629
|
-
h3{font-size:1.25em;font-weight:600}
|
|
72630
|
-
strong{color:${strongColor}}
|
|
72631
|
-
a{color:${linkColor};text-decoration:none}
|
|
72632
|
-
code{background:${codeBg};color:${codeColor};padding:2px 6px;border-radius:3px;font-size:.875em;font-family:'SF Mono','Fira Code',Menlo,monospace}
|
|
72633
|
-
pre{background:${codeBlockBg};color:${codeBlockText};padding:16px;border-radius:6px;overflow-x:auto;margin:1em 0}
|
|
72634
|
-
pre code{background:none;padding:0;color:inherit}
|
|
72635
|
-
blockquote{border-left:4px solid ${blockquoteBorder};background:${blockquoteBg};padding-left:16px;margin:1em 0;color:${textMuted}}
|
|
72636
|
-
table{border-collapse:collapse;width:100%;margin:1em 0}
|
|
72637
|
-
th,td{border:1px solid ${borderColor};padding:8px 12px}
|
|
72638
|
-
th{background:${tableHeaderBg};font-weight:600}
|
|
72639
|
-
hr{border:none;border-top:2px solid ${borderColor};margin:2em 0}
|
|
72640
|
-
img{max-width:100%}
|
|
72641
|
-
::selection{background:${selectionBg}}
|
|
72642
|
-
.math-inline{display:inline;padding:2px 4px;border-radius:3px;background:${mermaidBg}}
|
|
72643
|
-
.math-block{display:block;padding:16px;margin:1em 0;border-radius:6px;background:${mermaidBg};text-align:center;overflow-x:auto}
|
|
72644
|
-
.mermaid-block{display:block;padding:16px;margin:1em 0;border-radius:6px;background:${mermaidBg};border:1px solid ${borderColor}}
|
|
72645
|
-
.mermaid-preview{display:flex;justify-content:center;align-items:center}
|
|
72646
|
-
.mermaid-preview svg{max-width:100%;height:auto}
|
|
72647
|
-
.mermaid-preview svg .label text,.mermaid-preview svg .nodeLabel text,.mermaid-preview svg .state-title,.mermaid-preview svg .state-description,.mermaid-preview svg .pieTitleText,.mermaid-preview svg .titleText{transform:translateY(-2px)}.mermaid-preview svg .nodeLabel,.mermaid-preview svg .edgeLabel{display:inline-block;position:relative;top:-2px}
|
|
72648
|
-
</style>
|
|
72649
|
-
</head><body>${getLiveHTML()}</body></html>`;
|
|
72650
|
-
api.exportHTML(html2);
|
|
72909
|
+
api.exportHTML(buildExportHTML());
|
|
72651
72910
|
});
|
|
72652
72911
|
api.onNewFile(() => {
|
|
72653
72912
|
exitSourceMode();
|
|
@@ -72729,7 +72988,7 @@ img{max-width:100%}
|
|
|
72729
72988
|
}
|
|
72730
72989
|
document.addEventListener("contextmenu", (e2) => {
|
|
72731
72990
|
if (e2.target.matches('textarea, input, [contenteditable="true"]')) return;
|
|
72732
|
-
const target = e2.target.closest(
|
|
72991
|
+
const target = e2.target.closest(getContextMenuSelector());
|
|
72733
72992
|
if (!target) return;
|
|
72734
72993
|
const capabilities = findExportCapabilities(target.className);
|
|
72735
72994
|
if (!capabilities.length) return;
|
|
@@ -72767,6 +73026,86 @@ img{max-width:100%}
|
|
|
72767
73026
|
if (result) setContent(result.content);
|
|
72768
73027
|
});
|
|
72769
73028
|
}
|
|
73029
|
+
function updateMobileMenuI18n() {
|
|
73030
|
+
const menuTitle = document.getElementById("menu-title");
|
|
73031
|
+
if (menuTitle) menuTitle.textContent = t("mobile.menuTitle");
|
|
73032
|
+
const sectionTitles = {
|
|
73033
|
+
"File": "menu.file",
|
|
73034
|
+
"Export": "export.export",
|
|
73035
|
+
"Slides": "slides.slides",
|
|
73036
|
+
"Theme": "menu.theme",
|
|
73037
|
+
"Plugins": "menu.plugins",
|
|
73038
|
+
"About": "menu.about",
|
|
73039
|
+
"Language": "Language"
|
|
73040
|
+
};
|
|
73041
|
+
document.querySelectorAll(".menu-section-title").forEach((el) => {
|
|
73042
|
+
const text2 = el.textContent?.trim();
|
|
73043
|
+
if (text2 && sectionTitles[text2]) {
|
|
73044
|
+
el.textContent = t(sectionTitles[text2]);
|
|
73045
|
+
}
|
|
73046
|
+
});
|
|
73047
|
+
const buttonLabels = {
|
|
73048
|
+
"new": "fileMenu.new",
|
|
73049
|
+
"open": "fileMenu.open",
|
|
73050
|
+
"save": "fileMenu.save",
|
|
73051
|
+
"save-as": "fileMenu.saveAs",
|
|
73052
|
+
"export-pdf": "export.exportPDF",
|
|
73053
|
+
"export-html": "export.exportHTML",
|
|
73054
|
+
"export-slides": "export.exportSlides",
|
|
73055
|
+
"new-slides": "slides.newSlides",
|
|
73056
|
+
"open-as-slides": "slides.openAsSlides",
|
|
73057
|
+
"import-theme": "themeMenu.importTheme",
|
|
73058
|
+
"about": "about.aboutApp",
|
|
73059
|
+
"exit": "about.exit"
|
|
73060
|
+
};
|
|
73061
|
+
document.querySelectorAll(".menu-item").forEach((el) => {
|
|
73062
|
+
const action = el.dataset.action;
|
|
73063
|
+
if (action && buttonLabels[action]) {
|
|
73064
|
+
el.textContent = t(buttonLabels[action]);
|
|
73065
|
+
}
|
|
73066
|
+
});
|
|
73067
|
+
const themeListEl = document.getElementById("menu-theme-list");
|
|
73068
|
+
if (themeListEl) {
|
|
73069
|
+
const themes2 = [
|
|
73070
|
+
{ key: "light", label: t("themeMenu.light") },
|
|
73071
|
+
{ key: "dark", label: t("themeMenu.dark") },
|
|
73072
|
+
{ key: "elegant", label: t("themeMenu.elegant") },
|
|
73073
|
+
{ key: "newsprint", label: t("themeMenu.newsprint") }
|
|
73074
|
+
];
|
|
73075
|
+
themeListEl.innerHTML = themes2.map(
|
|
73076
|
+
(t2) => `<div class="menu-theme-item${t2.key === loadSavedTheme() ? " active" : ""}" data-theme="${t2.key}">${t2.label}</div>`
|
|
73077
|
+
).join("");
|
|
73078
|
+
themeListEl.querySelectorAll(".menu-theme-item").forEach((el) => {
|
|
73079
|
+
el.addEventListener("click", () => {
|
|
73080
|
+
const theme = el.dataset.theme;
|
|
73081
|
+
applyTheme(theme);
|
|
73082
|
+
for (const p2 of getAllPlugins()) p2.onThemeChange?.(theme);
|
|
73083
|
+
refreshThemeSensitivePlugins();
|
|
73084
|
+
themeListEl.querySelectorAll(".menu-theme-item").forEach((e2) => e2.classList.remove("active"));
|
|
73085
|
+
el.classList.add("active");
|
|
73086
|
+
});
|
|
73087
|
+
});
|
|
73088
|
+
}
|
|
73089
|
+
const languageListEl = document.getElementById("menu-language-list");
|
|
73090
|
+
if (languageListEl) {
|
|
73091
|
+
const locales = getSupportedLocales();
|
|
73092
|
+
const currentLocale2 = getCurrentLocale();
|
|
73093
|
+
languageListEl.innerHTML = locales.map(
|
|
73094
|
+
(l4) => `<div class="menu-theme-item${l4.code === currentLocale2 ? " active" : ""}" data-locale="${l4.code}">${l4.name}</div>`
|
|
73095
|
+
).join("");
|
|
73096
|
+
languageListEl.querySelectorAll(".menu-theme-item").forEach((el) => {
|
|
73097
|
+
el.addEventListener("click", () => {
|
|
73098
|
+
const locale = el.dataset.locale;
|
|
73099
|
+
if (locale) {
|
|
73100
|
+
setLocale(locale);
|
|
73101
|
+
updateMobileMenuI18n();
|
|
73102
|
+
languageListEl.querySelectorAll(".menu-theme-item").forEach((e2) => e2.classList.remove("active"));
|
|
73103
|
+
el.classList.add("active");
|
|
73104
|
+
}
|
|
73105
|
+
});
|
|
73106
|
+
});
|
|
73107
|
+
}
|
|
73108
|
+
}
|
|
72770
73109
|
function setupMobileMenu(api, currentTheme) {
|
|
72771
73110
|
const menuEl = document.getElementById("mobile-menu");
|
|
72772
73111
|
const menuBtn = document.getElementById("menu-btn");
|
|
@@ -72783,10 +73122,10 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72783
73122
|
closeBtn?.addEventListener("click", closeMenu);
|
|
72784
73123
|
overlay?.addEventListener("click", closeMenu);
|
|
72785
73124
|
const themes2 = [
|
|
72786
|
-
{ key: "light", label: "
|
|
72787
|
-
{ key: "dark", label: "
|
|
72788
|
-
{ key: "elegant", label: "
|
|
72789
|
-
{ key: "newsprint", label: "
|
|
73125
|
+
{ key: "light", label: t("themeMenu.light") },
|
|
73126
|
+
{ key: "dark", label: t("themeMenu.dark") },
|
|
73127
|
+
{ key: "elegant", label: t("themeMenu.elegant") },
|
|
73128
|
+
{ key: "newsprint", label: t("themeMenu.newsprint") }
|
|
72790
73129
|
];
|
|
72791
73130
|
const themeListEl = document.getElementById("menu-theme-list");
|
|
72792
73131
|
if (themeListEl) {
|
|
@@ -72828,6 +73167,26 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72828
73167
|
});
|
|
72829
73168
|
});
|
|
72830
73169
|
}
|
|
73170
|
+
const languageListEl = document.getElementById("menu-language-list");
|
|
73171
|
+
if (languageListEl) {
|
|
73172
|
+
const locales = getSupportedLocales();
|
|
73173
|
+
const currentLocale2 = getCurrentLocale();
|
|
73174
|
+
languageListEl.innerHTML = locales.map(
|
|
73175
|
+
(l4) => `<div class="menu-theme-item${l4.code === currentLocale2 ? " active" : ""}" data-locale="${l4.code}">${l4.name}</div>`
|
|
73176
|
+
).join("");
|
|
73177
|
+
languageListEl.querySelectorAll(".menu-theme-item").forEach((el) => {
|
|
73178
|
+
el.addEventListener("click", () => {
|
|
73179
|
+
const locale = el.dataset.locale;
|
|
73180
|
+
if (locale) {
|
|
73181
|
+
setLocale(locale);
|
|
73182
|
+
updateMobileMenuI18n();
|
|
73183
|
+
languageListEl.querySelectorAll(".menu-theme-item").forEach((e2) => e2.classList.remove("active"));
|
|
73184
|
+
el.classList.add("active");
|
|
73185
|
+
closeMenu();
|
|
73186
|
+
}
|
|
73187
|
+
});
|
|
73188
|
+
});
|
|
73189
|
+
}
|
|
72831
73190
|
menuEl.querySelectorAll(".menu-item").forEach((el) => {
|
|
72832
73191
|
el.addEventListener("click", async () => {
|
|
72833
73192
|
const action = el.dataset.action;
|
|
@@ -72848,10 +73207,10 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72848
73207
|
{
|
|
72849
73208
|
const ok2 = await api.saveFile(getContent());
|
|
72850
73209
|
if (ok2) {
|
|
72851
|
-
showToast("
|
|
73210
|
+
showToast(t("toast.saved"));
|
|
72852
73211
|
restoreRenderedMode(api);
|
|
72853
73212
|
} else {
|
|
72854
|
-
showToast("
|
|
73213
|
+
showToast(t("toast.saveFailed"));
|
|
72855
73214
|
}
|
|
72856
73215
|
}
|
|
72857
73216
|
break;
|
|
@@ -72860,10 +73219,10 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72860
73219
|
{
|
|
72861
73220
|
const ok2 = await api.saveFileAs(getContent());
|
|
72862
73221
|
if (ok2) {
|
|
72863
|
-
showToast("
|
|
73222
|
+
showToast(t("toast.saved"));
|
|
72864
73223
|
restoreRenderedMode(api);
|
|
72865
73224
|
} else {
|
|
72866
|
-
showToast("
|
|
73225
|
+
showToast(t("toast.saveCancelled"));
|
|
72867
73226
|
}
|
|
72868
73227
|
}
|
|
72869
73228
|
break;
|
|
@@ -72872,7 +73231,16 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72872
73231
|
restoreRenderedMode(api);
|
|
72873
73232
|
await ensureAllPluginsRendered();
|
|
72874
73233
|
await new Promise((r2) => setTimeout(r2, 300));
|
|
72875
|
-
|
|
73234
|
+
const printCSS = extractPrintCSSFromSheet();
|
|
73235
|
+
let printStyleEl = null;
|
|
73236
|
+
if (printCSS) {
|
|
73237
|
+
printStyleEl = document.createElement("style");
|
|
73238
|
+
printStyleEl.textContent = printCSS;
|
|
73239
|
+
document.head.appendChild(printStyleEl);
|
|
73240
|
+
await new Promise((r2) => requestAnimationFrame(r2));
|
|
73241
|
+
}
|
|
73242
|
+
await api.exportPDF(printCSS || void 0);
|
|
73243
|
+
if (printStyleEl) printStyleEl.remove();
|
|
72876
73244
|
setTimeout(() => {
|
|
72877
73245
|
document.querySelectorAll(".mermaid-loading, .mermaid-error").forEach((el2) => el2.style.display = "none");
|
|
72878
73246
|
}, 1e3);
|
|
@@ -72922,8 +73290,8 @@ function setupMobileMenu(api, currentTheme) {
|
|
|
72922
73290
|
});
|
|
72923
73291
|
}
|
|
72924
73292
|
function buildExportHTML() {
|
|
72925
|
-
const
|
|
72926
|
-
const v2 = (name) =>
|
|
73293
|
+
const bodyStyle = getComputedStyle(document.body);
|
|
73294
|
+
const v2 = (name) => bodyStyle.getPropertyValue(name).trim();
|
|
72927
73295
|
const bgColor = v2("--bg-color");
|
|
72928
73296
|
const textColor = v2("--text-color");
|
|
72929
73297
|
const textMuted = v2("--text-muted");
|
|
@@ -72932,27 +73300,80 @@ function buildExportHTML() {
|
|
|
72932
73300
|
const codeBg = v2("--code-bg");
|
|
72933
73301
|
const codeBlockBg = v2("--code-block-bg");
|
|
72934
73302
|
const codeBlockText = v2("--code-block-text") || textColor;
|
|
72935
|
-
const mermaidBg = v2("--mermaid-background") || bgColor;
|
|
72936
73303
|
const blockquoteBorder = v2("--blockquote-border");
|
|
72937
73304
|
const blockquoteBg = v2("--blockquote-bg") || "transparent";
|
|
72938
73305
|
const tableHeaderBg = v2("--table-header-bg");
|
|
72939
73306
|
const selectionBg = v2("--selection-bg");
|
|
72940
73307
|
const editor = document.querySelector("#editor .ProseMirror");
|
|
72941
|
-
const
|
|
73308
|
+
const editorStyle = editor ? getComputedStyle(editor) : bodyStyle;
|
|
73309
|
+
const fontFamily = editorStyle.fontFamily || "-apple-system,BlinkMacSystemFont,sans-serif";
|
|
73310
|
+
const bodyFontSize = editorStyle.fontSize || "16px";
|
|
73311
|
+
const bodyLineHeight = editorStyle.lineHeight || "1.75";
|
|
73312
|
+
const getElFontSize = (tag, fallback) => {
|
|
73313
|
+
const el = document.querySelector(`#editor .ProseMirror ${tag}`);
|
|
73314
|
+
return el ? getComputedStyle(el).fontSize : fallback;
|
|
73315
|
+
};
|
|
73316
|
+
const getElFontWeight = (tag, fallback) => {
|
|
73317
|
+
const el = document.querySelector(`#editor .ProseMirror ${tag}`);
|
|
73318
|
+
return el ? getComputedStyle(el).fontWeight : fallback;
|
|
73319
|
+
};
|
|
72942
73320
|
const getElColor = (selector2, fallback) => {
|
|
72943
73321
|
const el = document.querySelector(`#editor .ProseMirror ${selector2}`);
|
|
72944
73322
|
return el ? getComputedStyle(el).color : fallback;
|
|
72945
73323
|
};
|
|
72946
73324
|
const strongColor = getElColor("strong", textColor);
|
|
72947
73325
|
const codeColor = getElColor("code", textColor);
|
|
73326
|
+
const cssVarLines = collectExportCSSVariables(v2);
|
|
73327
|
+
let pluginCSS = "";
|
|
73328
|
+
for (const p2 of getAllPlugins()) {
|
|
73329
|
+
if (p2.enabled && p2.exportStyles) {
|
|
73330
|
+
pluginCSS += `
|
|
73331
|
+
/* === ${p2.name} === */
|
|
73332
|
+
${p2.exportStyles}
|
|
73333
|
+
`;
|
|
73334
|
+
}
|
|
73335
|
+
}
|
|
73336
|
+
let themeCSS = "";
|
|
73337
|
+
let bodyClass = "";
|
|
73338
|
+
if (document.body.classList.contains("theme-custom")) {
|
|
73339
|
+
bodyClass = "theme-custom";
|
|
73340
|
+
const customCSS = getActiveCustomThemeCSS();
|
|
73341
|
+
if (customCSS) {
|
|
73342
|
+
themeCSS += `
|
|
73343
|
+
/* === Custom Theme: ${loadSavedTheme()} === */
|
|
73344
|
+
${customCSS}
|
|
73345
|
+
`;
|
|
73346
|
+
}
|
|
73347
|
+
themeCSS += `
|
|
73348
|
+
/* === Mermaid Custom Text Styles === */
|
|
73349
|
+
${getMermaidCustomCSS()}
|
|
73350
|
+
`;
|
|
73351
|
+
} else {
|
|
73352
|
+
for (const cls of ["theme-light", "theme-dark", "theme-elegant", "theme-newsprint"]) {
|
|
73353
|
+
if (document.body.classList.contains(cls)) {
|
|
73354
|
+
bodyClass = cls;
|
|
73355
|
+
break;
|
|
73356
|
+
}
|
|
73357
|
+
}
|
|
73358
|
+
}
|
|
73359
|
+
const isCustomTheme = bodyClass === "theme-custom";
|
|
72948
73360
|
return `<!DOCTYPE html>
|
|
72949
73361
|
<html><head><meta charset="utf-8"><title>ColaMD Export</title>
|
|
72950
73362
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.46/dist/katex.min.css">
|
|
72951
73363
|
<style>
|
|
72952
|
-
|
|
72953
|
-
|
|
72954
|
-
|
|
72955
|
-
|
|
73364
|
+
:root {
|
|
73365
|
+
${cssVarLines}
|
|
73366
|
+
}
|
|
73367
|
+
${themeCSS}
|
|
73368
|
+
${pluginCSS}
|
|
73369
|
+
/* === Base Element Styles === */
|
|
73370
|
+
body{max-width:780px;margin:40px auto;padding:20px;font-size:${bodyFontSize};font-family:${fontFamily};line-height:${bodyLineHeight};background:${bgColor};color:${textColor}}
|
|
73371
|
+
${isCustomTheme ? "" : `h1{font-size:${getElFontSize("h1", "2em")};font-weight:${getElFontWeight("h1", "700")};border-bottom:1px solid ${borderColor};padding-bottom:.3em}
|
|
73372
|
+
h2{font-size:${getElFontSize("h2", "1.5em")};font-weight:${getElFontWeight("h2", "600")};border-bottom:1px solid ${borderColor};padding-bottom:.25em}
|
|
73373
|
+
h3{font-size:${getElFontSize("h3", "1.25em")};font-weight:${getElFontWeight("h3", "600")}}
|
|
73374
|
+
h4{font-size:${getElFontSize("h4", "1.1em")};font-weight:${getElFontWeight("h4", "600")}}
|
|
73375
|
+
h5{font-size:${getElFontSize("h5", "1em")};font-weight:${getElFontWeight("h5", "600")}}
|
|
73376
|
+
h6{font-size:${getElFontSize("h6", "0.9em")};font-weight:${getElFontWeight("h6", "600")}}
|
|
72956
73377
|
strong{color:${strongColor}}
|
|
72957
73378
|
a{color:${linkColor};text-decoration:none}
|
|
72958
73379
|
code{background:${codeBg};color:${codeColor};padding:2px 6px;border-radius:3px;font-size:.875em;font-family:'SF Mono','Fira Code',Menlo,monospace}
|
|
@@ -72962,18 +73383,128 @@ blockquote{border-left:4px solid ${blockquoteBorder};background:${blockquoteBg};
|
|
|
72962
73383
|
table{border-collapse:collapse;width:100%;margin:1em 0}
|
|
72963
73384
|
th,td{border:1px solid ${borderColor};padding:8px 12px}
|
|
72964
73385
|
th{background:${tableHeaderBg};font-weight:600}
|
|
72965
|
-
hr{border:none;border-top:2px solid ${borderColor};margin:2em 0}
|
|
73386
|
+
hr{border:none;border-top:2px solid ${borderColor};margin:2em 0}`}
|
|
72966
73387
|
img{max-width:100%}
|
|
72967
73388
|
::selection{background:${selectionBg}}
|
|
72968
|
-
|
|
72969
|
-
|
|
72970
|
-
.
|
|
72971
|
-
|
|
72972
|
-
|
|
72973
|
-
@page
|
|
72974
|
-
|
|
73389
|
+
${(() => {
|
|
73390
|
+
if (isCustomTheme) {
|
|
73391
|
+
console.log("[buildExportHTML] Custom theme — skipping hardcoded @page/@media print, using theme CSS rules");
|
|
73392
|
+
return "";
|
|
73393
|
+
}
|
|
73394
|
+
console.log("[buildExportHTML] Built-in theme — emitting hardcoded @page/@media print fallback");
|
|
73395
|
+
return `@page{margin:15mm;size:A4}
|
|
73396
|
+
@media print{body{max-width:none;margin:0;padding:20px}#editor{position:static!important;overflow:visible!important}}`;
|
|
73397
|
+
})()}
|
|
72975
73398
|
</style>
|
|
72976
|
-
</head><body>${getLiveHTML()}</body></html>`;
|
|
73399
|
+
</head><body class="${bodyClass}">${getLiveHTML()}</body></html>`;
|
|
73400
|
+
}
|
|
73401
|
+
function collectExportCSSVariables(v2) {
|
|
73402
|
+
const varNames = [
|
|
73403
|
+
"--seed-accent",
|
|
73404
|
+
"--seed-accent-light",
|
|
73405
|
+
"--seed-accent-dark",
|
|
73406
|
+
"--seed-surface",
|
|
73407
|
+
"--seed-panel",
|
|
73408
|
+
"--seed-panel-alt",
|
|
73409
|
+
"--seed-ink",
|
|
73410
|
+
"--seed-ink-muted",
|
|
73411
|
+
"--seed-ink-dim",
|
|
73412
|
+
"--seed-border",
|
|
73413
|
+
"--seed-border-strong",
|
|
73414
|
+
"--font-size-root",
|
|
73415
|
+
"--font-scale-h1",
|
|
73416
|
+
"--font-scale-h2",
|
|
73417
|
+
"--font-scale-h3",
|
|
73418
|
+
"--font-scale-h4",
|
|
73419
|
+
"--font-scale-h5",
|
|
73420
|
+
"--font-scale-h6",
|
|
73421
|
+
"--font-size-mermaid",
|
|
73422
|
+
"--line-height-body",
|
|
73423
|
+
"--line-height-heading",
|
|
73424
|
+
"--line-height-code",
|
|
73425
|
+
"--bg-color",
|
|
73426
|
+
"--text-color",
|
|
73427
|
+
"--heading-color",
|
|
73428
|
+
"--text-muted",
|
|
73429
|
+
"--text-dim",
|
|
73430
|
+
"--link-color",
|
|
73431
|
+
"--accent-color",
|
|
73432
|
+
"--accent-dark",
|
|
73433
|
+
"--accent-light",
|
|
73434
|
+
"--selection-bg",
|
|
73435
|
+
"--border-color",
|
|
73436
|
+
"--blockquote-border",
|
|
73437
|
+
"--hr-color",
|
|
73438
|
+
"--code-bg",
|
|
73439
|
+
"--code-color",
|
|
73440
|
+
"--code-block-bg",
|
|
73441
|
+
"--code-block-text",
|
|
73442
|
+
"--blockquote-bg",
|
|
73443
|
+
"--table-header-bg",
|
|
73444
|
+
"--table-header-text",
|
|
73445
|
+
"--table-border",
|
|
73446
|
+
"--scrollbar-thumb",
|
|
73447
|
+
"--scrollbar-thumb-hover",
|
|
73448
|
+
"--surface-color",
|
|
73449
|
+
"--surface-alt",
|
|
73450
|
+
"--mermaid-background",
|
|
73451
|
+
"--mermaid-border-color",
|
|
73452
|
+
"--mermaid-border-radius",
|
|
73453
|
+
"--mermaid-padding",
|
|
73454
|
+
"--mermaid-font-family",
|
|
73455
|
+
"--mermaid-font-size",
|
|
73456
|
+
"--mermaid-node-fill",
|
|
73457
|
+
"--mermaid-node-stroke",
|
|
73458
|
+
"--mermaid-node-stroke-width",
|
|
73459
|
+
"--mermaid-node-text",
|
|
73460
|
+
"--mermaid-edge-stroke",
|
|
73461
|
+
"--mermaid-edge-stroke-width",
|
|
73462
|
+
"--mermaid-cluster-fill",
|
|
73463
|
+
"--mermaid-cluster-stroke",
|
|
73464
|
+
"--mermaid-label-text",
|
|
73465
|
+
"--mermaid-edge-label-text",
|
|
73466
|
+
"--mermaid-edge-label-bg",
|
|
73467
|
+
"--mermaid-title-text",
|
|
73468
|
+
"--mermaid-axis-text",
|
|
73469
|
+
"--mermaid-highlight",
|
|
73470
|
+
"--mermaid-person-stroke",
|
|
73471
|
+
"--mermaid-person-fill",
|
|
73472
|
+
"--mermaid-label-offset-y",
|
|
73473
|
+
"--radius-sm",
|
|
73474
|
+
"--radius-md",
|
|
73475
|
+
"--radius-lg",
|
|
73476
|
+
"--content-width"
|
|
73477
|
+
];
|
|
73478
|
+
const lines = [];
|
|
73479
|
+
for (const name of varNames) {
|
|
73480
|
+
const val = v2(name);
|
|
73481
|
+
if (val) lines.push(` ${name}: ${val};`);
|
|
73482
|
+
}
|
|
73483
|
+
return lines.join("\n");
|
|
73484
|
+
}
|
|
73485
|
+
function getMermaidCustomCSS() {
|
|
73486
|
+
return `.theme-custom .mermaid-preview svg text {
|
|
73487
|
+
fill: var(--mermaid-text-color, var(--text-color)) !important;
|
|
73488
|
+
font-family: var(--mermaid-font-family, inherit) !important;
|
|
73489
|
+
font-size: var(--mermaid-font-size, 12px) !important;
|
|
73490
|
+
}
|
|
73491
|
+
.theme-custom .mermaid-preview svg foreignObject span {
|
|
73492
|
+
color: var(--mermaid-text-color, var(--text-color)) !important;
|
|
73493
|
+
font-family: var(--mermaid-font-family, inherit) !important;
|
|
73494
|
+
font-size: var(--mermaid-font-size, 14px) !important;
|
|
73495
|
+
}
|
|
73496
|
+
.theme-custom .mermaid-preview svg .person-man text { fill: #ffffff !important; }
|
|
73497
|
+
.theme-custom .mermaid-preview svg .person-man span { color: #ffffff !important; }
|
|
73498
|
+
.theme-custom .mermaid-preview svg .label text,
|
|
73499
|
+
.theme-custom .mermaid-preview svg .nodeLabel text,
|
|
73500
|
+
.theme-custom .mermaid-preview svg .state-title,
|
|
73501
|
+
.theme-custom .mermaid-preview svg .state-description,
|
|
73502
|
+
.theme-custom .mermaid-preview svg .pieTitleText,
|
|
73503
|
+
.theme-custom .mermaid-preview svg .titleText { transform: translateY(-3px) !important; }
|
|
73504
|
+
.theme-custom .mermaid-preview svg .xychart .axis text { transform: translateY(0) !important; }
|
|
73505
|
+
.theme-custom .mermaid-preview svg .nodeLabel,
|
|
73506
|
+
.theme-custom .mermaid-preview svg .edgeLabel { display: inline-block !important; position: relative !important; top: -3px !important; }
|
|
73507
|
+
`;
|
|
72977
73508
|
}
|
|
72978
73509
|
init().catch((e2) => console.error("ColaMD init failed:", e2));
|
|
72979
73510
|
export {
|