for-humanity 0.12.0 → 0.13.0
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 +29 -0
- package/README.md +16 -9
- package/dist/browser.js +16 -16
- package/dist/cli.css +2 -968
- package/dist/cli.js +92 -2318
- package/dist/config.js +1 -0
- package/dist/constant/copy.d.ts +100 -0
- package/dist/constant/site.d.ts +20 -0
- package/dist/constant/status.d.ts +19 -0
- package/dist/copy-C1uzvEnr.js +103 -0
- package/dist/group-path-XAThmzvC.js +10 -0
- package/dist/load-site-CbpLEhwu.js +2379 -0
- package/dist/logger-Dv1i9xSV.js +9 -0
- package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
- package/dist/mermaid/chunk--TN-qHgG.js +2 -0
- package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
- package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
- package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
- package/dist/mermaid/chunk-6HLei9i0.js +84 -0
- package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
- package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
- package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
- package/dist/mermaid/chunk-B--pNBQF.js +884 -0
- package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
- package/dist/mermaid/chunk-B58sEIY_.js +14 -0
- package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
- package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
- package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
- package/dist/mermaid/chunk-BKri0qr7.js +89 -0
- package/dist/mermaid/chunk-BL404pH5.js +26 -0
- package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
- package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
- package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
- package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
- package/dist/mermaid/chunk-BariMtWr.js +3020 -0
- package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
- package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
- package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
- package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
- package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
- package/dist/mermaid/chunk-BvVehae3.js +5069 -0
- package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
- package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
- package/dist/mermaid/chunk-CApNbSU9.js +6 -0
- package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
- package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
- package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
- package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
- package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
- package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
- package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
- package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
- package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
- package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
- package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
- package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
- package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
- package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
- package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
- package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
- package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
- package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
- package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
- package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
- package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
- package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
- package/dist/mermaid/chunk-CuYekbSv.js +2 -0
- package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
- package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
- package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
- package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
- package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
- package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
- package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
- package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
- package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
- package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
- package/dist/mermaid/chunk-DU69_VcF.js +363 -0
- package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
- package/dist/mermaid/chunk-DZe-4kde.js +20 -0
- package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
- package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
- package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
- package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
- package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
- package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
- package/dist/mermaid/chunk-DqGhppWe.js +2 -0
- package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
- package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
- package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
- package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
- package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
- package/dist/mermaid/chunk-KuPYb48V.js +275 -0
- package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
- package/dist/mermaid/chunk-MbInCS_6.js +28 -0
- package/dist/mermaid/chunk-MexOLyKV.js +355 -0
- package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
- package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
- package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
- package/dist/mermaid/chunk-TftHqGLg.js +490 -0
- package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
- package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
- package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
- package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
- package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
- package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
- package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
- package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
- package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
- package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
- package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
- package/dist/mermaid/chunk-yBz-vst0.js +976 -0
- package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
- package/dist/run-site-command-C80YoNOe.js +129 -0
- package/dist/site-config-bllORGpm.js +90 -0
- package/dist/site.js +1 -0
- package/dist/start-dev-server-C4_Lu1nZ.js +176 -0
- package/dist/to-change-queue-DbEnZGNK.js +34 -0
- package/dist/to-error-message-pF6_7wGK.js +16 -0
- package/dist/type/group-path.d.ts +7 -0
- package/dist/type/site-config.d.ts +57 -0
- package/package.json +34 -17
- package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
- package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
- package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
- package/src/component/widget/navigation/_constant/locale.ts +0 -9
- package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
- package/src/component/widget/navigation/_constant/navigation.ts +0 -9
- package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
- package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
- package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
- package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
- package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
- package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
- package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
- package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
- package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
- package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
- package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
- package/src/component/widget/navigation/_type/doc-group.ts +0 -24
- package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
- package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
- package/src/component/widget/navigation/_type/toc-group.ts +0 -39
- package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
- package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
- package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
- package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
- package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
- package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
- package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
- package/src/component/widget/navigation/wg-navigation.css +0 -282
- package/src/component/widget/navigation/wg-navigation.tsx +0 -420
- package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
- package/src/component/widget/prose/_constant/section.ts +0 -7
- package/src/component/widget/prose/_constant/status.ts +0 -9
- package/src/component/widget/prose/_function/has-block-content.ts +0 -30
- package/src/component/widget/prose/_function/rehype-head.ts +0 -31
- package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
- package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
- package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
- package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
- package/src/component/widget/prose/_function/remark-flow.ts +0 -26
- package/src/component/widget/prose/_function/remark-links.ts +0 -33
- package/src/component/widget/prose/_function/remark-parts.ts +0 -26
- package/src/component/widget/prose/_function/remark-status.ts +0 -59
- package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
- package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
- package/src/component/widget/prose/wg-prose.css +0 -484
- package/src/component/widget/prose/wg-prose.tsx +0 -43
- package/src/component/widget/shell/wg-shell.css +0 -63
- package/src/component/widget/shell/wg-shell.tsx +0 -88
- package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
- package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
- package/src/constant/asset.ts +0 -63
- package/src/constant/copy.ts +0 -133
- package/src/constant/doc.ts +0 -13
- package/src/constant/font.ts +0 -34
- package/src/constant/site.ts +0 -24
- package/src/constant/status.ts +0 -15
- package/src/entry/browser/browser.tsx +0 -22
- package/src/entry/cli/_constant/cli.ts +0 -19
- package/src/entry/cli/_constant/crawling.ts +0 -14
- package/src/entry/cli/_constant/snippet.ts +0 -21
- package/src/entry/cli/_function/create-app.tsx +0 -57
- package/src/entry/cli/_function/create-dev-app.ts +0 -87
- package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
- package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
- package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
- package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
- package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -91
- package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
- package/src/entry/cli/_function/read-docs.ts +0 -128
- package/src/entry/cli/_function/read-home.ts +0 -32
- package/src/entry/cli/_function/to-crawling-app.ts +0 -42
- package/src/entry/cli/cli.test.ts +0 -804
- package/src/entry/cli/cli.ts +0 -206
- package/src/env.d.ts +0 -6
- package/src/page/doc/pg-doc.tsx +0 -35
- package/src/page/home/pg-home.tsx +0 -40
- package/src/store/navigation/create-navigation-stores.test.ts +0 -74
- package/src/store/navigation/create-navigation-stores.ts +0 -59
- package/src/store/navigation/navigation-state.ts +0 -36
- package/src/store/navigation/navigation-storage.ts +0 -9
- package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
- package/src/style/base.css +0 -28
- package/src/style/token.css +0 -188
- package/src/type/doc-content.ts +0 -15
- package/src/type/doc-data.ts +0 -38
- package/src/type/doc-file-data.ts +0 -21
- package/src/type/doc-heading.ts +0 -17
- package/src/type/doc-outline.ts +0 -16
- package/src/type/doc-section.ts +0 -9
- package/src/type/doc.ts +0 -20
- package/src/type/group-path.ts +0 -7
- package/src/type/site-assets.ts +0 -25
- package/src/type/site-config.ts +0 -73
- package/src/type/vfile-data.d.ts +0 -10
- package/src/util/async/to-change-queue.test.ts +0 -58
- package/src/util/async/to-change-queue.ts +0 -43
- package/src/util/dom/find-hash-target.ts +0 -18
- package/src/util/dom/reveal-hash-target.ts +0 -15
- package/src/util/error/to-error-message.ts +0 -10
- package/src/util/file/to-asset-path.ts +0 -26
- package/src/util/font/to-font-css.test.ts +0 -41
- package/src/util/font/to-font-css.ts +0 -28
- package/src/util/mermaid/render-flow.js +0 -321
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { n as e } from "./chunk-BYzrzvCI.js";
|
|
2
|
+
import { o as t } from "./chunk-DpuxlyL_.js";
|
|
3
|
+
//#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-4EMNKR2T.mjs
|
|
4
|
+
var n = 5, r = 1e-5, i = 2, a = .6, o = 1e-6;
|
|
5
|
+
function s(e) {
|
|
6
|
+
let t = [];
|
|
7
|
+
for (let n = 0; n < e.length - 1; n++) t.push({
|
|
8
|
+
a: e[n],
|
|
9
|
+
b: e[n + 1]
|
|
10
|
+
});
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
e(s, "buildSegmentList");
|
|
14
|
+
function c(e, t, n, r) {
|
|
15
|
+
let i = t.x - e.x, a = t.y - e.y, s = r.x - n.x, c = r.y - n.y, l = i * c - a * s;
|
|
16
|
+
if (l === 0) return null;
|
|
17
|
+
let u = n.x - e.x, d = n.y - e.y, f = (u * c - d * s) / l, p = (u * a - d * i) / l;
|
|
18
|
+
return f <= o || f >= 1 - o || p <= o || p >= 1 - o ? null : {
|
|
19
|
+
point: {
|
|
20
|
+
x: e.x + f * i,
|
|
21
|
+
y: e.y + f * a
|
|
22
|
+
},
|
|
23
|
+
tA: f,
|
|
24
|
+
tB: p
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
e(c, "segmentIntersection");
|
|
28
|
+
function l(e) {
|
|
29
|
+
return Math.abs(e.b.x - e.a.x) >= Math.abs(e.b.y - e.a.y);
|
|
30
|
+
}
|
|
31
|
+
e(l, "isHorizontalSeg");
|
|
32
|
+
function u(e, t, r) {
|
|
33
|
+
if (e.curve !== "rounded") return !1;
|
|
34
|
+
let i = e.points, a = i[t], o = i[t + 1];
|
|
35
|
+
if (!a || !o) return !1;
|
|
36
|
+
let s = Math.hypot(o.x - a.x, o.y - a.y), c = r * s, l = t > 0 ? _(i[t - 1], a, o, n) : null;
|
|
37
|
+
if (l && c < l.cutLen) return !0;
|
|
38
|
+
let u = t + 2 < i.length ? _(a, o, i[t + 2], n) : null;
|
|
39
|
+
return u !== null && s - c < u.cutLen;
|
|
40
|
+
}
|
|
41
|
+
e(u, "crossingSitsInRoundedCorner");
|
|
42
|
+
function d(e) {
|
|
43
|
+
let t = [];
|
|
44
|
+
for (let n = 0; n < e.length; n++) {
|
|
45
|
+
let r = e[n], i = s(r.points);
|
|
46
|
+
for (let a = n + 1; a < e.length; a++) {
|
|
47
|
+
let n = e[a], o = s(n.points);
|
|
48
|
+
for (let [e, a] of i.entries()) for (let [i, s] of o.entries()) {
|
|
49
|
+
let o = c(a.a, a.b, s.a, s.b);
|
|
50
|
+
if (!o || u(r, e, o.tA) || u(n, i, o.tB)) continue;
|
|
51
|
+
let d = l(a);
|
|
52
|
+
d !== l(s) && d ? t.push({
|
|
53
|
+
jumpEdgeId: r.id,
|
|
54
|
+
otherEdgeId: n.id,
|
|
55
|
+
segIndex: e,
|
|
56
|
+
t: o.tA,
|
|
57
|
+
point: o.point
|
|
58
|
+
}) : t.push({
|
|
59
|
+
jumpEdgeId: n.id,
|
|
60
|
+
otherEdgeId: r.id,
|
|
61
|
+
segIndex: i,
|
|
62
|
+
t: o.tB,
|
|
63
|
+
point: o.point
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
e(d, "findEdgeIntersections");
|
|
71
|
+
function f(e) {
|
|
72
|
+
return `${Math.round(e * 1e3) / 1e3}`;
|
|
73
|
+
}
|
|
74
|
+
e(f, "fmt");
|
|
75
|
+
function p(e) {
|
|
76
|
+
return `${f(e.x)},${f(e.y)}`;
|
|
77
|
+
}
|
|
78
|
+
e(p, "pointToString");
|
|
79
|
+
function m(e) {
|
|
80
|
+
let t = e.b.x - e.a.x, n = e.b.y - e.a.y;
|
|
81
|
+
return Math.abs(t) >= Math.abs(n) ? +(t >= 0) : +(n >= 0);
|
|
82
|
+
}
|
|
83
|
+
e(m, "getArcSweepFlag");
|
|
84
|
+
function h(e, n) {
|
|
85
|
+
if (e.length < 2) return e.map((e) => ({ ...e }));
|
|
86
|
+
let r = e.map((e) => ({ ...e })), i = n.arrowTypeStart && t[n.arrowTypeStart];
|
|
87
|
+
if (i) {
|
|
88
|
+
let t = e[0], n = e[1], a = Math.atan2(n.y - t.y, n.x - t.x);
|
|
89
|
+
r[0].x = t.x + i * Math.cos(a), r[0].y = t.y + i * Math.sin(a);
|
|
90
|
+
}
|
|
91
|
+
let a = n.arrowTypeEnd && t[n.arrowTypeEnd];
|
|
92
|
+
if (a) {
|
|
93
|
+
let t = e.length, n = e[t - 2], i = e[t - 1], o = Math.atan2(i.y - n.y, i.x - n.x);
|
|
94
|
+
r[t - 1].x = i.x - a * Math.cos(o), r[t - 1].y = i.y - a * Math.sin(o);
|
|
95
|
+
}
|
|
96
|
+
return r;
|
|
97
|
+
}
|
|
98
|
+
e(h, "applyMarkerOffsets");
|
|
99
|
+
function g(e, t, n, r, i) {
|
|
100
|
+
let a = e.point.x, o = e.point.y, s = {
|
|
101
|
+
x: a - t * e.r,
|
|
102
|
+
y: o - n * e.r
|
|
103
|
+
}, c = {
|
|
104
|
+
x: a + t * e.r,
|
|
105
|
+
y: o + n * e.r
|
|
106
|
+
}, l = [`L${p(s)}`];
|
|
107
|
+
return i === "arc" ? l.push(`A${f(e.r)},${f(e.r)} 0 0 ${r} ${p(c)}`) : l.push(`M${p(c)}`), l;
|
|
108
|
+
}
|
|
109
|
+
e(g, "emitJump");
|
|
110
|
+
function _(e, t, n, i) {
|
|
111
|
+
let a = t.x - e.x, o = t.y - e.y, s = n.x - t.x, c = n.y - t.y, l = Math.hypot(a, o), u = Math.hypot(s, c);
|
|
112
|
+
if (l < r || u < r) return null;
|
|
113
|
+
let d = a / l, f = o / l, p = s / u, m = c / u, h = d * p + f * m, g = Math.acos(Math.max(-1, Math.min(1, h)));
|
|
114
|
+
if (g < r || Math.abs(Math.PI - g) < r) return null;
|
|
115
|
+
let _ = Math.min(i / Math.sin(g / 2), l / 2, u / 2);
|
|
116
|
+
return {
|
|
117
|
+
startX: t.x - d * _,
|
|
118
|
+
startY: t.y - f * _,
|
|
119
|
+
endX: t.x + p * _,
|
|
120
|
+
endY: t.y + m * _,
|
|
121
|
+
ctrlX: t.x,
|
|
122
|
+
ctrlY: t.y,
|
|
123
|
+
cutLen: _
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
e(_, "computeRoundedCorner");
|
|
127
|
+
function v(e, t, r) {
|
|
128
|
+
let o = e.points;
|
|
129
|
+
if (o.length < 2) return "";
|
|
130
|
+
let c = h(o, e), l = e.curve === "rounded", u = s(c), d = /* @__PURE__ */ new Map();
|
|
131
|
+
for (let e of t) {
|
|
132
|
+
let t = u[e.segIndex];
|
|
133
|
+
if (!t) continue;
|
|
134
|
+
let n = Math.hypot(t.b.x - t.a.x, t.b.y - t.a.y), i = d.get(e.segIndex) ?? [];
|
|
135
|
+
i.push({
|
|
136
|
+
t: e.t,
|
|
137
|
+
point: e.point,
|
|
138
|
+
d: e.t * n,
|
|
139
|
+
r: r.jumpRadius
|
|
140
|
+
}), d.set(e.segIndex, i);
|
|
141
|
+
}
|
|
142
|
+
let v = [`M${p(c[0])}`];
|
|
143
|
+
for (let e = 0; e < u.length; e++) {
|
|
144
|
+
let t = u[e], o = Math.hypot(t.b.x - t.a.x, t.b.y - t.a.y), s = o === 0 ? 0 : (t.b.x - t.a.x) / o, h = o === 0 ? 0 : (t.b.y - t.a.y) / o, y = m(t), b = 0;
|
|
145
|
+
if (l && e > 0) {
|
|
146
|
+
let t = _(c[e - 1], c[e], c[e + 1] ?? c[e], n);
|
|
147
|
+
t && (b = t.cutLen);
|
|
148
|
+
}
|
|
149
|
+
let x = o, S = null;
|
|
150
|
+
l && e < u.length - 1 && (S = _(c[e], c[e + 1], c[e + 2] ?? c[e + 1], n), S && (x = o - S.cutLen));
|
|
151
|
+
let C = r.jumpRadius * a, w = [...d.get(e) ?? []].sort((e, t) => e.t - t.t).filter((e) => {
|
|
152
|
+
let t = Math.min(e.d - b, x - e.d) - i;
|
|
153
|
+
return e.r = Math.min(e.r, t), e.r >= C;
|
|
154
|
+
});
|
|
155
|
+
for (let e = 0; e < w.length - 1; e++) {
|
|
156
|
+
let t = w[e + 1].d - w[e].d;
|
|
157
|
+
if (w[e].r + w[e + 1].r > t) {
|
|
158
|
+
let n = t / 2;
|
|
159
|
+
w[e].r = Math.min(w[e].r, n), w[e + 1].r = Math.min(w[e + 1].r, n);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
for (let e of w) e.r < C || v.push(...g(e, s, h, y, r.jumpStyle));
|
|
163
|
+
l && S ? (v.push(`L${f(S.startX)},${f(S.startY)}`), v.push(`Q${f(S.ctrlX)},${f(S.ctrlY)} ${f(S.endX)},${f(S.endY)}`)) : v.push(`L${p(t.b)}`);
|
|
164
|
+
}
|
|
165
|
+
return v.join(" ");
|
|
166
|
+
}
|
|
167
|
+
e(v, "rewriteEdgePath");
|
|
168
|
+
function y(e) {
|
|
169
|
+
return /^[\d\s+,.LMelm-]*$/.test(e);
|
|
170
|
+
}
|
|
171
|
+
e(y, "isStraightPath");
|
|
172
|
+
function b(e) {
|
|
173
|
+
return !e || e === "linear" || e === "rounded" || e === "step" || e === "stepBefore" || e === "stepAfter";
|
|
174
|
+
}
|
|
175
|
+
e(b, "curveSupportsLineHops");
|
|
176
|
+
function x(e) {
|
|
177
|
+
if (!e) return null;
|
|
178
|
+
try {
|
|
179
|
+
let t = typeof atob == "function" ? atob(e) : Buffer.from(e, "base64").toString(), n = JSON.parse(t);
|
|
180
|
+
if (!Array.isArray(n)) return null;
|
|
181
|
+
let r = [];
|
|
182
|
+
for (let e of n) e && typeof e.x == "number" && typeof e.y == "number" && r.push({
|
|
183
|
+
x: e.x,
|
|
184
|
+
y: e.y
|
|
185
|
+
});
|
|
186
|
+
return r.length >= 2 ? r : null;
|
|
187
|
+
} catch {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
e(x, "decodeDataPoints");
|
|
192
|
+
function S(e, t, n) {
|
|
193
|
+
if (!n.enabled) return;
|
|
194
|
+
let r = e.node();
|
|
195
|
+
if (!r) return;
|
|
196
|
+
let i = /* @__PURE__ */ new Map();
|
|
197
|
+
for (let e of t) i.set(e.id, e);
|
|
198
|
+
let a = /* @__PURE__ */ new Map();
|
|
199
|
+
for (let e of r.querySelectorAll("path[data-id]")) {
|
|
200
|
+
let t = e.getAttribute("data-id");
|
|
201
|
+
t !== null && !a.has(t) && a.set(t, e);
|
|
202
|
+
}
|
|
203
|
+
let o = [];
|
|
204
|
+
for (let e of t) {
|
|
205
|
+
let t = a.get(e.id);
|
|
206
|
+
if (!t) continue;
|
|
207
|
+
let n = x(t.getAttribute("data-points")) ?? e.points;
|
|
208
|
+
o.push({
|
|
209
|
+
...e,
|
|
210
|
+
points: n
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
let s = d(o);
|
|
214
|
+
if (s.length === 0) return;
|
|
215
|
+
let c = /* @__PURE__ */ new Map();
|
|
216
|
+
for (let e of s) {
|
|
217
|
+
let t = c.get(e.jumpEdgeId) ?? [];
|
|
218
|
+
t.push(e), c.set(e.jumpEdgeId, t);
|
|
219
|
+
}
|
|
220
|
+
for (let e of o) {
|
|
221
|
+
let t = c.get(e.id);
|
|
222
|
+
if (!t || t.length === 0) continue;
|
|
223
|
+
let r = i.get(e.id)?.curve;
|
|
224
|
+
if (r !== void 0 && !b(r)) continue;
|
|
225
|
+
let o = a.get(e.id);
|
|
226
|
+
if (!o || r === void 0 && !y(o.getAttribute("d") ?? "")) continue;
|
|
227
|
+
let s = o.getAttribute("style") ?? "", l = /stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s), u = l ? Number.parseFloat(l[1]) : null, d = l ? Number.parseFloat(l[2]) : null, f = v(e, t, n);
|
|
228
|
+
if (o.setAttribute("d", f), u !== null && d !== null && typeof o.getTotalLength == "function") {
|
|
229
|
+
let e = o.getTotalLength(), t = `0 ${u} ${Math.max(0, e - u - d)} ${d}`, n = s.replace(/stroke-dasharray\s*:[^;]*;?/g, `stroke-dasharray: ${t};`).replace(/;\s*;+/g, ";");
|
|
230
|
+
o.setAttribute("style", n);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
e(S, "applyLineJumpsToSvg");
|
|
235
|
+
//#endregion
|
|
236
|
+
export { S as t };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { m as e } from "./chunk-DVNvSFoz.js";
|
|
2
|
+
import { n as t } from "./chunk-BYzrzvCI.js";
|
|
3
|
+
import "./chunk-MFVRUoO0.js";
|
|
4
|
+
import "./chunk-B58sEIY_.js";
|
|
5
|
+
import { f as n, t as r } from "./chunk-DK9KqIXj.js";
|
|
6
|
+
import { n as i, r as a, t as o } from "./chunk-TftHqGLg.js";
|
|
7
|
+
import { t as s } from "./chunk-DGVDaXjx.js";
|
|
8
|
+
//#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-V4P3TTPT.mjs
|
|
9
|
+
var c = n().RailroadEbnf.parser.LangiumParser, l = /* @__PURE__ */ t((e) => {
|
|
10
|
+
let t = e.alternatives.map(u);
|
|
11
|
+
return t.length === 1 ? t[0] : {
|
|
12
|
+
type: "choice",
|
|
13
|
+
alternatives: t
|
|
14
|
+
};
|
|
15
|
+
}, "transformChoice"), u = /* @__PURE__ */ t((e) => {
|
|
16
|
+
let t = e.elements.map(p);
|
|
17
|
+
return t.length === 1 ? t[0] : {
|
|
18
|
+
type: "sequence",
|
|
19
|
+
elements: t
|
|
20
|
+
};
|
|
21
|
+
}, "transformSequence"), d = /* @__PURE__ */ t((e) => {
|
|
22
|
+
switch (e.$type) {
|
|
23
|
+
case "EbnfTerminal": return {
|
|
24
|
+
type: "terminal",
|
|
25
|
+
value: e.value
|
|
26
|
+
};
|
|
27
|
+
case "EbnfNonTerminal": return {
|
|
28
|
+
type: "nonterminal",
|
|
29
|
+
name: e.name
|
|
30
|
+
};
|
|
31
|
+
case "EbnfSpecial": return {
|
|
32
|
+
type: "special",
|
|
33
|
+
text: e.text
|
|
34
|
+
};
|
|
35
|
+
case "EbnfGroup": return l(e.element);
|
|
36
|
+
case "EbnfOptional": return {
|
|
37
|
+
type: "optional",
|
|
38
|
+
element: l(e.element)
|
|
39
|
+
};
|
|
40
|
+
case "EbnfRepetition": return {
|
|
41
|
+
type: "repetition",
|
|
42
|
+
element: l(e.element),
|
|
43
|
+
min: 0,
|
|
44
|
+
max: Infinity
|
|
45
|
+
};
|
|
46
|
+
default: throw Error(`Unsupported EBNF primary node: ${e.$type}`);
|
|
47
|
+
}
|
|
48
|
+
}, "transformPrimary"), f = /* @__PURE__ */ t((e, t) => {
|
|
49
|
+
switch (t.$type) {
|
|
50
|
+
case "EbnfOptionalPostfix": return {
|
|
51
|
+
type: "optional",
|
|
52
|
+
element: e
|
|
53
|
+
};
|
|
54
|
+
case "EbnfZeroOrMorePostfix": return {
|
|
55
|
+
type: "repetition",
|
|
56
|
+
element: e,
|
|
57
|
+
min: 0,
|
|
58
|
+
max: Infinity
|
|
59
|
+
};
|
|
60
|
+
case "EbnfOneOrMorePostfix": return {
|
|
61
|
+
type: "repetition",
|
|
62
|
+
element: e,
|
|
63
|
+
min: 1,
|
|
64
|
+
max: Infinity
|
|
65
|
+
};
|
|
66
|
+
case "EbnfExceptionPostfix": return {
|
|
67
|
+
type: "sequence",
|
|
68
|
+
elements: [
|
|
69
|
+
e,
|
|
70
|
+
{
|
|
71
|
+
type: "terminal",
|
|
72
|
+
value: "-"
|
|
73
|
+
},
|
|
74
|
+
d(t.except)
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
default: throw Error(`Unsupported EBNF postfix node: ${t.$type}`);
|
|
78
|
+
}
|
|
79
|
+
}, "transformPostfix"), p = /* @__PURE__ */ t((e) => e.postfixes.reduce((e, t) => f(e, t), d(e.base)), "transformTerm"), m = /* @__PURE__ */ t((e) => ({
|
|
80
|
+
name: e.name,
|
|
81
|
+
definition: l(e.definition)
|
|
82
|
+
}), "transformRule"), h = /* @__PURE__ */ t((e) => {
|
|
83
|
+
s(e, o), e.title && o.setTitle(e.title), e.rules.map((e) => o.addRule(m(e)));
|
|
84
|
+
}, "populateDb"), g = {
|
|
85
|
+
parser: {
|
|
86
|
+
parse: /* @__PURE__ */ t((t) => {
|
|
87
|
+
o.clear(), e.debug("[EBNF Parser] Starting Langium parse");
|
|
88
|
+
let n = c.parse(t);
|
|
89
|
+
if (n.lexerErrors.length > 0 || n.parserErrors.length > 0) throw new r(n);
|
|
90
|
+
let i = n.value;
|
|
91
|
+
e.debug("[EBNF Parser] Parsed rules:", i.rules.length), h(i), e.debug("[EBNF Parser] Parse complete");
|
|
92
|
+
}, "parse"),
|
|
93
|
+
parser: { yy: o }
|
|
94
|
+
},
|
|
95
|
+
db: o,
|
|
96
|
+
renderer: a,
|
|
97
|
+
styles: i
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { g as diagram };
|