for-humanity 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +16 -9
- package/dist/browser.js +14 -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-B-u5-jv0.js +2343 -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-cqCjpIlc.js +129 -0
- package/dist/site-config-bllORGpm.js +90 -0
- package/dist/site.js +1 -0
- package/dist/start-dev-server-x7Ja5uwv.js +184 -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,363 @@
|
|
|
1
|
+
import { m as e, p as t } from "./chunk-DVNvSFoz.js";
|
|
2
|
+
import { n } from "./chunk-BYzrzvCI.js";
|
|
3
|
+
import { b as r, g as i, w as a } from "./chunk-MFVRUoO0.js";
|
|
4
|
+
import { a as o, i as s, t as c } from "./chunk-Bok8z-Yo.js";
|
|
5
|
+
import { n as l } from "./chunk-_a9EZE1v.js";
|
|
6
|
+
import { s as u } from "./chunk-DBh1mIbK.js";
|
|
7
|
+
import { t as d } from "./chunk-BSej9Nhy.js";
|
|
8
|
+
import { i as f, n as p, t as m } from "./chunk-DORnIAsy.js";
|
|
9
|
+
import { n as h } from "./chunk-CLgRAtOz.js";
|
|
10
|
+
//#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HNE4Q36P.mjs
|
|
11
|
+
var g = /* @__PURE__ */ n(async (n, a) => {
|
|
12
|
+
let c = r(), { theme: p, themeVariables: m, handDrawnSeed: h } = c, { clusterBkg: g, clusterBorder: _, borderColorArray: v } = m, y = _, { labelStyles: b, nodeStyles: x, borderStyles: S, backgroundStyles: C } = s(a), w = n.insert("g").attr("class", "cluster swimlane " + (a.cssClasses || "")).attr("id", a.domId ?? a.id).attr("data-id", a.id).attr("data-et", "cluster").attr("data-look", a.look);
|
|
13
|
+
u(w, a.colorIndex, p, v);
|
|
14
|
+
let T = i(c.flowchart.htmlLabels), E = a.direction === "LR", D = w.insert("g").attr("class", "cluster-label swimlane-label"), O = await l(D, a.label, {
|
|
15
|
+
style: a.labelStyle,
|
|
16
|
+
useHtmlLabels: T,
|
|
17
|
+
isNode: !0,
|
|
18
|
+
width: a.width
|
|
19
|
+
}), k = O.getBBox();
|
|
20
|
+
if (T) {
|
|
21
|
+
let e = O.children[0], n = t(O);
|
|
22
|
+
k = e.getBoundingClientRect(), n.attr("width", k.width), n.attr("height", k.height);
|
|
23
|
+
}
|
|
24
|
+
let A = a.padding ?? 0, j = a.width <= k.width + A ? k.width + A : a.width;
|
|
25
|
+
a.diff = a.width <= k.width + A ? (j - a.width) / 2 - A : -A;
|
|
26
|
+
let M = a.height, N = a.y - M / 2, P = a.y + M / 2, F = a.x - j / 2, I = a.swimlaneContentTop === void 0 ? N + M / 3 : a.swimlaneContentTop, L = E ? 4 : 0, R = k.height + 2 * L, z, B;
|
|
27
|
+
if (E) {
|
|
28
|
+
let e = Math.max(R, k.height + 2 * L), t = F + e, n = Math.max(0, j - e);
|
|
29
|
+
if (a.look === "handDrawn") {
|
|
30
|
+
let r = d.svg(w), i = o(a, {
|
|
31
|
+
roughness: .7,
|
|
32
|
+
fill: g,
|
|
33
|
+
stroke: y,
|
|
34
|
+
seed: h
|
|
35
|
+
}), s = o(a, {
|
|
36
|
+
roughness: .7,
|
|
37
|
+
fill: "none",
|
|
38
|
+
stroke: y,
|
|
39
|
+
seed: h
|
|
40
|
+
}), c = r.rectangle(F, N, e, M, i);
|
|
41
|
+
z = w.insert(() => c, ":first-child").attr("class", "swimlane-title");
|
|
42
|
+
let l = r.rectangle(t, N, n, M, s);
|
|
43
|
+
B = w.insert(() => l, ":first-child").attr("class", "swimlane-body"), z.select("path:nth-child(2)").attr("style", S.join(";")), z.select("path").attr("style", C.join(";").replace("fill", "stroke"));
|
|
44
|
+
} else z = w.insert("rect", ":first-child"), B = w.insert("rect", ":first-child"), z.attr("class", "swimlane-title").attr("style", x).attr("x", F).attr("y", N).attr("width", e).attr("height", M).attr("fill", g).attr("stroke", y), B.attr("class", "swimlane-body").attr("style", x).attr("x", t).attr("y", N).attr("width", n).attr("height", M).attr("fill", "none").attr("stroke", y);
|
|
45
|
+
let r = F + e / 2, i = a.y;
|
|
46
|
+
D.attr("transform", `translate(${r}, ${i}) rotate(-90) translate(${-k.width / 2}, ${-k.height / 2})`);
|
|
47
|
+
} else {
|
|
48
|
+
let e = Math.max(0, I - N), t = Math.min(R, e), n = N + t, r = Math.max(0, P - n), i = a.x - j / 2;
|
|
49
|
+
if (a.look === "handDrawn") {
|
|
50
|
+
let e = d.svg(w), s = o(a, {
|
|
51
|
+
roughness: .7,
|
|
52
|
+
fill: g,
|
|
53
|
+
stroke: y,
|
|
54
|
+
fillWeight: 3,
|
|
55
|
+
seed: h
|
|
56
|
+
}), c = o(a, {
|
|
57
|
+
roughness: .7,
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: y,
|
|
60
|
+
seed: h
|
|
61
|
+
}), l = e.rectangle(i, N, j, t, s);
|
|
62
|
+
z = w.insert(() => l, ":first-child").attr("class", "swimlane-title");
|
|
63
|
+
let u = e.rectangle(i, n, j, r, c);
|
|
64
|
+
B = w.insert(() => u, ":first-child").attr("class", "swimlane-body"), z.select("path:nth-child(2)").attr("style", S.join(";")), z.select("path").attr("style", C.join(";").replace("fill", "stroke"));
|
|
65
|
+
} else z = w.insert("rect", ":first-child"), B = w.insert("rect", ":first-child"), z.attr("class", "swimlane-title").attr("style", x).attr("x", i).attr("y", N).attr("width", j).attr("height", t).attr("fill", g).attr("stroke", y), B.attr("class", "swimlane-body").attr("style", x).attr("x", i).attr("y", n).attr("width", j).attr("height", r).attr("fill", "none").attr("stroke", y);
|
|
66
|
+
let s = a.x - k.width / 2, c = N + (t - k.height) / 2;
|
|
67
|
+
D.attr("transform", `translate(${s}, ${c})`);
|
|
68
|
+
}
|
|
69
|
+
if (e.trace("Swimlane data ", a, JSON.stringify(a)), b) {
|
|
70
|
+
let e = D.select("span");
|
|
71
|
+
e && e.attr("style", b);
|
|
72
|
+
}
|
|
73
|
+
return a.offsetX = 0, a.width = j, a.height = M, a.offsetY = k.height - A / 2, a.intersect = function(e) {
|
|
74
|
+
return f(a, e);
|
|
75
|
+
}, {
|
|
76
|
+
cluster: w,
|
|
77
|
+
labelBBox: k
|
|
78
|
+
};
|
|
79
|
+
}, "swimlane"), _ = /* @__PURE__ */ n(async (n, i) => {
|
|
80
|
+
e.info("Creating subgraph rect for ", i.id, i);
|
|
81
|
+
let c = r(), { theme: g, themeVariables: _, handDrawnSeed: v } = c, { clusterBkg: y, clusterBorder: b, borderColorArray: x } = _, { labelStyles: S, nodeStyles: C, borderStyles: w, backgroundStyles: T } = s(i), E = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look);
|
|
82
|
+
u(E, i.colorIndex, g, x);
|
|
83
|
+
let D = a(c), O = E.insert("g").attr("class", "cluster-label "), k;
|
|
84
|
+
k = i.labelType === "markdown" ? await l(O, i.label, {
|
|
85
|
+
style: i.labelStyle,
|
|
86
|
+
useHtmlLabels: D,
|
|
87
|
+
isNode: !0,
|
|
88
|
+
width: i.width
|
|
89
|
+
}) : await m(O, i.label, i.labelStyle || "", !1, !0);
|
|
90
|
+
let A = k.getBBox();
|
|
91
|
+
if (a(c)) {
|
|
92
|
+
let e = k.children[0], n = t(k);
|
|
93
|
+
A = e.getBoundingClientRect(), n.attr("width", A.width), n.attr("height", A.height);
|
|
94
|
+
}
|
|
95
|
+
let j = i.width <= A.width + i.padding ? A.width + i.padding : i.width;
|
|
96
|
+
i.diff = i.width <= A.width + i.padding ? (j - i.width) / 2 - i.padding : -i.padding;
|
|
97
|
+
let M = i.height, N = i.x - j / 2, P = i.y - M / 2;
|
|
98
|
+
e.trace("Data ", i, JSON.stringify(i));
|
|
99
|
+
let F;
|
|
100
|
+
if (i.look === "handDrawn") {
|
|
101
|
+
let t = d.svg(E), n = o(i, {
|
|
102
|
+
roughness: .7,
|
|
103
|
+
fill: y,
|
|
104
|
+
stroke: b,
|
|
105
|
+
fillWeight: 3,
|
|
106
|
+
seed: v
|
|
107
|
+
}), r = t.path(p(N, P, j, M, 0), n);
|
|
108
|
+
F = E.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), F.select("path:nth-child(2)").attr("style", w.join(";")), F.select("path").attr("style", T.join(";").replace("fill", "stroke"));
|
|
109
|
+
} else F = E.insert("rect", ":first-child"), F.attr("style", C).attr("rx", i.rx).attr("ry", i.ry).attr("x", N).attr("y", P).attr("width", j).attr("height", M);
|
|
110
|
+
let { subGraphTitleTopMargin: I } = h(c);
|
|
111
|
+
if (O.attr("transform", `translate(${i.x - A.width / 2}, ${i.y - i.height / 2 + I})`), S) {
|
|
112
|
+
let e = O.select("span");
|
|
113
|
+
e && e.attr("style", S);
|
|
114
|
+
}
|
|
115
|
+
let L = F.node().getBBox();
|
|
116
|
+
return i.offsetX = 0, i.width = L.width, i.height = L.height, i.offsetY = A.height - i.padding / 2, i.intersect = function(e) {
|
|
117
|
+
return f(i, e);
|
|
118
|
+
}, {
|
|
119
|
+
cluster: E,
|
|
120
|
+
labelBBox: A
|
|
121
|
+
};
|
|
122
|
+
}, "rect"), v = /* @__PURE__ */ n((e, t) => {
|
|
123
|
+
let n = e.insert("g").attr("class", "note-cluster").attr("id", t.domId), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
124
|
+
r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
|
|
125
|
+
let o = r.node().getBBox();
|
|
126
|
+
return t.width = o.width, t.height = o.height, t.intersect = function(e) {
|
|
127
|
+
return f(t, e);
|
|
128
|
+
}, {
|
|
129
|
+
cluster: n,
|
|
130
|
+
labelBBox: {
|
|
131
|
+
width: 0,
|
|
132
|
+
height: 0
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}, "noteGroup"), y = /* @__PURE__ */ n(async (e, n) => {
|
|
136
|
+
let i = r(), { theme: o, themeVariables: s, handDrawnSeed: c } = i, { altBackground: l, borderColorArray: h, compositeBackground: g, compositeTitleBackground: _, nodeBorder: v } = s, y = e.insert("g").attr("class", n.cssClasses).attr("id", n.domId).attr("data-id", n.id).attr("data-look", n.look);
|
|
137
|
+
u(y, n.colorIndex, o, h);
|
|
138
|
+
let b = y.insert("g", ":first-child"), x = y.insert("g").attr("class", "cluster-label"), S = y.append("rect"), C = await m(x, n.label, n.labelStyle, void 0, !0), w = C.getBBox();
|
|
139
|
+
if (a(i)) {
|
|
140
|
+
let e = C.children[0], n = t(C);
|
|
141
|
+
w = e.getBoundingClientRect(), n.attr("width", w.width), n.attr("height", w.height);
|
|
142
|
+
}
|
|
143
|
+
let T = 0 * n.padding, E = T / 2, D = (n.width <= w.width + n.padding ? w.width + n.padding : n.width) + T;
|
|
144
|
+
n.diff = n.width <= w.width + n.padding ? (D - n.width) / 2 - n.padding : -n.padding;
|
|
145
|
+
let O = n.height + T, k = n.height + T - w.height - 6, A = n.x - D / 2, j = n.y - O / 2;
|
|
146
|
+
n.width = D;
|
|
147
|
+
let M = n.y - n.height / 2 - E + w.height + 2, N;
|
|
148
|
+
if (n.look === "handDrawn") {
|
|
149
|
+
let e = n.cssClasses.includes("statediagram-cluster-alt"), t = d.svg(y), r = n.rx || n.ry ? t.path(p(A, j, D, O, 10), {
|
|
150
|
+
roughness: .7,
|
|
151
|
+
fill: _,
|
|
152
|
+
fillStyle: "solid",
|
|
153
|
+
stroke: v,
|
|
154
|
+
seed: c
|
|
155
|
+
}) : t.rectangle(A, j, D, O, { seed: c });
|
|
156
|
+
N = y.insert(() => r, ":first-child");
|
|
157
|
+
let i = t.rectangle(A, M, D, k, {
|
|
158
|
+
fill: e ? l : g,
|
|
159
|
+
fillStyle: e ? "hachure" : "solid",
|
|
160
|
+
stroke: v,
|
|
161
|
+
seed: c
|
|
162
|
+
});
|
|
163
|
+
N = y.insert(() => r, ":first-child"), S = y.insert(() => i), N.attr("class", "outer"), S.attr("class", "inner");
|
|
164
|
+
} else N = b.insert("rect", ":first-child"), N.attr("class", "outer").attr("x", A).attr("y", j).attr("width", D).attr("height", O).attr("data-look", n.look), S.attr("class", "inner").attr("x", A).attr("y", M).attr("width", D).attr("height", k);
|
|
165
|
+
return x.attr("transform", `translate(${n.x - w.width / 2}, ${j + 1 - (a(i) ? 0 : 3)})`), n.height = N.node().getBBox().height, n.offsetX = 0, n.offsetY = w.height - n.padding / 2, n.labelBBox = w, n.intersect = function(e) {
|
|
166
|
+
return f(n, e);
|
|
167
|
+
}, {
|
|
168
|
+
cluster: y,
|
|
169
|
+
labelBBox: w
|
|
170
|
+
};
|
|
171
|
+
}, "roundedWithTitle"), b = /* @__PURE__ */ n(async (n, i) => {
|
|
172
|
+
e.info("Creating subgraph rect for ", i.id, i);
|
|
173
|
+
let c = r(), { themeVariables: u, handDrawnSeed: m } = c, { clusterBkg: g, clusterBorder: _ } = u, { labelStyles: v, nodeStyles: y, borderStyles: b, backgroundStyles: x } = s(i), S = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look), C = a(c), w = S.insert("g").attr("class", "cluster-label "), T = await l(w, i.label, {
|
|
174
|
+
style: i.labelStyle,
|
|
175
|
+
useHtmlLabels: C,
|
|
176
|
+
isNode: !0,
|
|
177
|
+
width: i.width
|
|
178
|
+
}), E = T.getBBox();
|
|
179
|
+
if (a(c)) {
|
|
180
|
+
let e = T.children[0], n = t(T);
|
|
181
|
+
E = e.getBoundingClientRect(), n.attr("width", E.width), n.attr("height", E.height);
|
|
182
|
+
}
|
|
183
|
+
let D = i.width <= E.width + i.padding ? E.width + i.padding : i.width;
|
|
184
|
+
i.diff = i.width <= E.width + i.padding ? (D - i.width) / 2 - i.padding : -i.padding;
|
|
185
|
+
let O = i.height, k = i.x - D / 2, A = i.y - O / 2;
|
|
186
|
+
e.trace("Data ", i, JSON.stringify(i));
|
|
187
|
+
let j;
|
|
188
|
+
if (i.look === "handDrawn") {
|
|
189
|
+
let t = d.svg(S), n = o(i, {
|
|
190
|
+
roughness: .7,
|
|
191
|
+
fill: g,
|
|
192
|
+
stroke: _,
|
|
193
|
+
fillWeight: 4,
|
|
194
|
+
seed: m
|
|
195
|
+
}), r = t.path(p(k, A, D, O, i.rx), n);
|
|
196
|
+
j = S.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), j.select("path:nth-child(2)").attr("style", b.join(";")), j.select("path").attr("style", x.join(";").replace("fill", "stroke"));
|
|
197
|
+
} else j = S.insert("rect", ":first-child"), j.attr("style", y).attr("rx", i.rx).attr("ry", i.ry).attr("x", k).attr("y", A).attr("width", D).attr("height", O);
|
|
198
|
+
let { subGraphTitleTopMargin: M } = h(c);
|
|
199
|
+
if (w.attr("transform", `translate(${i.x - E.width / 2}, ${i.y - i.height / 2 + M})`), v) {
|
|
200
|
+
let e = w.select("span");
|
|
201
|
+
e && e.attr("style", v);
|
|
202
|
+
}
|
|
203
|
+
let N = j.node().getBBox();
|
|
204
|
+
return i.offsetX = 0, i.width = N.width, i.height = N.height, i.offsetY = E.height - i.padding / 2, i.intersect = function(e) {
|
|
205
|
+
return f(i, e);
|
|
206
|
+
}, {
|
|
207
|
+
cluster: S,
|
|
208
|
+
labelBBox: E
|
|
209
|
+
};
|
|
210
|
+
}, "kanbanSection"), x = /* @__PURE__ */ n((e, t) => {
|
|
211
|
+
let { theme: n, themeVariables: i, handDrawnSeed: a } = r(), { altBackground: o, nodeBorder: s, borderColorArray: c } = i, l = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look);
|
|
212
|
+
u(l, t.colorIndex, n, c);
|
|
213
|
+
let p = l.insert("g", ":first-child"), m = 0 * t.padding, h = t.width + m;
|
|
214
|
+
t.diff = -t.padding;
|
|
215
|
+
let g = t.height + m, _ = t.x - h / 2, v = t.y - g / 2;
|
|
216
|
+
t.width = h;
|
|
217
|
+
let y;
|
|
218
|
+
if (t.look === "handDrawn") {
|
|
219
|
+
let e = d.svg(l).rectangle(_, v, h, g, {
|
|
220
|
+
fill: o ?? "#efefef",
|
|
221
|
+
fillStyle: "solid",
|
|
222
|
+
roughness: .5,
|
|
223
|
+
strokeLineDash: [5],
|
|
224
|
+
stroke: s,
|
|
225
|
+
seed: a
|
|
226
|
+
});
|
|
227
|
+
y = l.insert(() => e, ":first-child").attr("class", "divider");
|
|
228
|
+
} else {
|
|
229
|
+
y = p.insert("rect", ":first-child");
|
|
230
|
+
let e = "outer";
|
|
231
|
+
e = (t.look, "divider"), y.attr("class", e).attr("x", _).attr("y", v).attr("width", h).attr("height", g).attr("data-look", t.look);
|
|
232
|
+
}
|
|
233
|
+
return t.height = y.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
|
|
234
|
+
return f(t, e);
|
|
235
|
+
}, {
|
|
236
|
+
cluster: l,
|
|
237
|
+
labelBBox: {}
|
|
238
|
+
};
|
|
239
|
+
}, "divider"), S = /* @__PURE__ */ n(async (n, i, c) => {
|
|
240
|
+
e.info(`Creating ${c.cssClass} for `, i.id, i);
|
|
241
|
+
let g = r(), { theme: _, themeVariables: v, handDrawnSeed: y } = g, { borderColorArray: b } = v, { labelStyles: x, borderStyles: S } = s(i), C = n.insert("g").attr("class", "cluster " + c.cssClass + " " + i.cssClasses).attr("id", i.domId ?? i.id).attr("data-look", i.look);
|
|
242
|
+
u(C, i.colorIndex, _, b);
|
|
243
|
+
let w = a(g), T = C.insert("g").attr("class", "cluster-label"), E = {
|
|
244
|
+
width: 0,
|
|
245
|
+
height: 0
|
|
246
|
+
}, D = i.label?.trim();
|
|
247
|
+
if (D) {
|
|
248
|
+
let e;
|
|
249
|
+
if (e = i.labelType === "markdown" ? await l(T, i.label, {
|
|
250
|
+
style: i.labelStyle,
|
|
251
|
+
useHtmlLabels: w,
|
|
252
|
+
isNode: !0,
|
|
253
|
+
width: i.width
|
|
254
|
+
}) : await m(T, i.label, i.labelStyle || "", !1, !0), E = e.getBBox(), w) {
|
|
255
|
+
let n = e.children[0], r = t(e);
|
|
256
|
+
E = n.getBoundingClientRect(), r.attr("width", E.width), r.attr("height", E.height);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
let O = i.width <= E.width + i.padding ? E.width + i.padding : i.width;
|
|
260
|
+
i.diff = i.width <= E.width + i.padding ? (O - i.width) / 2 - i.padding : -i.padding;
|
|
261
|
+
let k = i.height, A = i.x - O / 2, j = i.y - k / 2, M;
|
|
262
|
+
if (i.look === "handDrawn") {
|
|
263
|
+
let e = d.svg(C), t = o(i, {
|
|
264
|
+
roughness: c.roughness,
|
|
265
|
+
fill: c.fill,
|
|
266
|
+
stroke: c.stroke,
|
|
267
|
+
strokeWidth: c.strokeWidth,
|
|
268
|
+
seed: y,
|
|
269
|
+
...c.fill === "none" ? { fillWeight: 0 } : { fillStyle: "solid" },
|
|
270
|
+
...c.strokeDash ? { strokeLineDash: c.strokeDash } : {}
|
|
271
|
+
}), n = e.path(p(A, j, O, k, c.rx), t);
|
|
272
|
+
M = C.insert(() => n, ":first-child"), M.select("path:nth-child(2)").attr("style", S.join(";"));
|
|
273
|
+
} else M = C.insert("rect", ":first-child"), M.attr("rx", c.rx).attr("ry", c.rx).attr("x", A).attr("y", j).attr("width", O).attr("height", k).attr("fill", c.fill).attr("stroke", c.stroke).attr("stroke-width", c.strokeWidth + "px"), c.strokeDash && M.attr("stroke-dasharray", c.strokeDash.join(", "));
|
|
274
|
+
if (D) {
|
|
275
|
+
let { subGraphTitleTopMargin: e } = h(g);
|
|
276
|
+
if (T.attr("transform", `translate(${i.x - E.width / 2}, ${i.y - i.height / 2 + e})`), x) {
|
|
277
|
+
let e = T.select("span");
|
|
278
|
+
e && e.attr("style", x);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
let N = M.node().getBBox();
|
|
282
|
+
return i.offsetX = 0, i.width = N.width, i.height = N.height, i.offsetY = E.height - i.padding / 2, i.intersect = function(e) {
|
|
283
|
+
return f(i, e);
|
|
284
|
+
}, {
|
|
285
|
+
cluster: C,
|
|
286
|
+
labelBBox: E
|
|
287
|
+
};
|
|
288
|
+
}, "createContainerGroup"), C = /* @__PURE__ */ n(async (e, t) => {
|
|
289
|
+
let { themeVariables: n } = r();
|
|
290
|
+
return S(e, t, {
|
|
291
|
+
cssClass: "flow-cluster",
|
|
292
|
+
rx: 10,
|
|
293
|
+
fill: "none",
|
|
294
|
+
stroke: n.flowContainerStroke || n.secondaryBorderColor,
|
|
295
|
+
strokeWidth: .75,
|
|
296
|
+
roughness: .7
|
|
297
|
+
});
|
|
298
|
+
}, "flowGroup"), w = /* @__PURE__ */ n((e, t) => {
|
|
299
|
+
let n = e.boundaryType || "rect", r = n === "package" ? 20 : e.padding, i = n === "package" ? t.height + 10 : 0, a = Math.max(e.width, t.width + r), o = n === "package" ? Math.max(e.height, i + e.padding * 2) : e.height, s = e.x - a / 2, c = e.y - o / 2;
|
|
300
|
+
return {
|
|
301
|
+
boundaryType: n,
|
|
302
|
+
width: a,
|
|
303
|
+
height: o,
|
|
304
|
+
x: s,
|
|
305
|
+
y: c,
|
|
306
|
+
bodyY: c + i,
|
|
307
|
+
bodyHeight: o - i,
|
|
308
|
+
tabHeight: i,
|
|
309
|
+
tabWidth: n === "package" ? Math.min(a, Math.max(80, t.width + 20)) : 0
|
|
310
|
+
};
|
|
311
|
+
}, "getUsecaseSystemBoundaryGeometry"), T = {
|
|
312
|
+
rect: _,
|
|
313
|
+
squareRect: _,
|
|
314
|
+
roundedWithTitle: y,
|
|
315
|
+
noteGroup: v,
|
|
316
|
+
divider: x,
|
|
317
|
+
kanbanSection: b,
|
|
318
|
+
flowGroup: C,
|
|
319
|
+
usecaseSystemBoundary: /* @__PURE__ */ n(async (n, i) => {
|
|
320
|
+
e.info("Creating usecase system boundary for ", i.id, i);
|
|
321
|
+
let p = r(), { theme: m, themeVariables: g, handDrawnSeed: _ } = p, { clusterBkg: v, clusterBorder: y, borderColorArray: b } = g, { labelStyles: x, nodeStyles: S } = s(i), { stylesMap: C } = c(i), T = i.boundaryType || "rect", E = n.insert("g").attr("class", `cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr("id", typeof i.domId == "string" ? i.domId : i.id).attr("data-boundary-type", T).attr("data-look", i.look);
|
|
322
|
+
u(E, i.colorIndex, m, b);
|
|
323
|
+
let D = a(p), O = E.insert("g").attr("class", "cluster-label system-boundary-title"), k = await l(O, i.label, {
|
|
324
|
+
style: x,
|
|
325
|
+
useHtmlLabels: D,
|
|
326
|
+
isNode: !0
|
|
327
|
+
}), A = k.getBBox();
|
|
328
|
+
if (D) {
|
|
329
|
+
let e = k.children[0], n = t(k);
|
|
330
|
+
A = e.getBoundingClientRect(), n.attr("width", A.width), n.attr("height", A.height);
|
|
331
|
+
}
|
|
332
|
+
let { width: j, height: M, x: N, y: P, bodyY: F, bodyHeight: I, tabHeight: L, tabWidth: R } = w(i, A);
|
|
333
|
+
i.diff = i.width <= A.width + i.padding ? (j - i.width) / 2 - i.padding : -i.padding;
|
|
334
|
+
let z = o(i, {
|
|
335
|
+
fill: C.get("fill") || v,
|
|
336
|
+
stroke: C.get("stroke") || y,
|
|
337
|
+
strokeWidth: C.get("stroke-width")?.replace("px", "") || 1,
|
|
338
|
+
seed: _
|
|
339
|
+
});
|
|
340
|
+
if (i.look === "handDrawn") {
|
|
341
|
+
let e = d.svg(E), t = e.rectangle(N, F, j, I, z);
|
|
342
|
+
if (E.insert(() => t, ":first-child").attr("class", "boundary-body label-container"), T === "package") {
|
|
343
|
+
let t = e.rectangle(N, P, R, L, z);
|
|
344
|
+
E.insert(() => t, ":first-child").attr("class", "boundary-tab system-boundary-package-tab label-container");
|
|
345
|
+
}
|
|
346
|
+
} else E.insert("rect", ":first-child").attr("class", "boundary-body label-container").attr("style", S).attr("x", N).attr("y", F).attr("width", j).attr("height", I), T === "package" && E.insert("rect", ":first-child").attr("class", "boundary-tab system-boundary-package-tab label-container").attr("style", S).attr("x", N).attr("y", P).attr("width", R).attr("height", L);
|
|
347
|
+
let { subGraphTitleTopMargin: B } = h(p);
|
|
348
|
+
return T === "package" ? O.attr("transform", `translate(${N + (R - A.width) / 2}, ${P + (L - A.height) / 2})`) : O.attr("transform", `translate(${i.x - A.width / 2}, ${P + B})`), x && (O.attr("style", x), O.select("span").attr("style", x)), i.offsetX = 0, i.width = j, i.height = M, i.offsetY = A.height - i.padding / 2, i.labelBBox = A, i.intersect = function(e) {
|
|
349
|
+
return f(i, e);
|
|
350
|
+
}, {
|
|
351
|
+
cluster: E,
|
|
352
|
+
labelBBox: A
|
|
353
|
+
};
|
|
354
|
+
}, "usecaseSystemBoundary"),
|
|
355
|
+
swimlane: g
|
|
356
|
+
}, E = /* @__PURE__ */ new Set(["noteGroup", "divider"]), D = /* @__PURE__ */ n((e) => !E.has(e ?? "rect"), "clusterPaintsTitle"), O = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ n(async (e, t) => {
|
|
357
|
+
let n = await T[t.shape || "rect"](e, t);
|
|
358
|
+
return O.set(t.id, n), n;
|
|
359
|
+
}, "insertCluster"), A = /* @__PURE__ */ n(() => {
|
|
360
|
+
O = /* @__PURE__ */ new Map();
|
|
361
|
+
}, "clear");
|
|
362
|
+
//#endregion
|
|
363
|
+
export { D as n, k as r, A as t };
|