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,13 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
switch (arguments.length) {
|
|
4
|
+
case 0: break;
|
|
5
|
+
case 1:
|
|
6
|
+
this.range(e);
|
|
7
|
+
break;
|
|
8
|
+
default: this.range(t).domain(e);
|
|
9
|
+
}
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as t };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { m as e } from "./chunk-DVNvSFoz.js";
|
|
2
|
+
import { n as t } from "./chunk-BYzrzvCI.js";
|
|
3
|
+
import { C as n, E as r, H as i, U as a, _ as o, a as s, c, f as l, q as u, v as d, y as f } from "./chunk-MFVRUoO0.js";
|
|
4
|
+
import { i as p } from "./chunk-K7Myuj2-.js";
|
|
5
|
+
import { t as m } from "./chunk-B58sEIY_.js";
|
|
6
|
+
import { n as h } from "./chunk-DK9KqIXj.js";
|
|
7
|
+
import { t as g } from "./chunk-DGVDaXjx.js";
|
|
8
|
+
//#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-RJA3I4VV.mjs
|
|
9
|
+
var _ = {
|
|
10
|
+
showLegend: !0,
|
|
11
|
+
ticks: 5,
|
|
12
|
+
max: null,
|
|
13
|
+
min: 0,
|
|
14
|
+
graticule: "circle"
|
|
15
|
+
}, v = 32, y = {
|
|
16
|
+
axes: [],
|
|
17
|
+
curves: [],
|
|
18
|
+
options: _
|
|
19
|
+
}, b = structuredClone(y), x = l.radar, S = /* @__PURE__ */ t(() => p({
|
|
20
|
+
...x,
|
|
21
|
+
...f().radar
|
|
22
|
+
}), "getConfig"), C = /* @__PURE__ */ t(() => b.axes, "getAxes"), w = /* @__PURE__ */ t(() => b.curves, "getCurves"), T = /* @__PURE__ */ t(() => b.options, "getOptions"), E = /* @__PURE__ */ t((e) => {
|
|
23
|
+
b.axes = e.map((e) => ({
|
|
24
|
+
name: e.name,
|
|
25
|
+
label: e.label ?? e.name
|
|
26
|
+
}));
|
|
27
|
+
}, "setAxes"), D = /* @__PURE__ */ t((e) => {
|
|
28
|
+
b.curves = e.map((e) => ({
|
|
29
|
+
name: e.name,
|
|
30
|
+
label: e.label ?? e.name,
|
|
31
|
+
entries: O(e.entries)
|
|
32
|
+
}));
|
|
33
|
+
}, "setCurves"), O = /* @__PURE__ */ t((e) => {
|
|
34
|
+
if (e[0].axis == null) return e.map((e) => e.value);
|
|
35
|
+
let t = C();
|
|
36
|
+
if (t.length === 0) throw Error("Axes must be populated before curves for reference entries");
|
|
37
|
+
return t.map((t) => {
|
|
38
|
+
let n = e.find((e) => e.axis?.$refText === t.name);
|
|
39
|
+
if (n === void 0) throw Error("Missing entry for axis " + t.label);
|
|
40
|
+
return n.value;
|
|
41
|
+
});
|
|
42
|
+
}, "computeCurveEntries"), k = {
|
|
43
|
+
getAxes: C,
|
|
44
|
+
getCurves: w,
|
|
45
|
+
getOptions: T,
|
|
46
|
+
setAxes: E,
|
|
47
|
+
setCurves: D,
|
|
48
|
+
setOptions: /* @__PURE__ */ t((t) => {
|
|
49
|
+
let n = t.reduce((e, t) => (e[t.name] = t, e), {});
|
|
50
|
+
b.options = {
|
|
51
|
+
showLegend: n.showLegend?.value ?? _.showLegend,
|
|
52
|
+
ticks: n.ticks?.value ?? _.ticks,
|
|
53
|
+
max: n.max?.value ?? _.max,
|
|
54
|
+
min: n.min?.value ?? _.min,
|
|
55
|
+
graticule: n.graticule?.value ?? _.graticule
|
|
56
|
+
}, b.options.ticks > v && (e.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`), b.options.ticks = v);
|
|
57
|
+
}, "setOptions"),
|
|
58
|
+
getConfig: S,
|
|
59
|
+
clear: /* @__PURE__ */ t(() => {
|
|
60
|
+
s(), b = structuredClone(y);
|
|
61
|
+
}, "clear"),
|
|
62
|
+
setAccTitle: a,
|
|
63
|
+
getAccTitle: d,
|
|
64
|
+
setDiagramTitle: u,
|
|
65
|
+
getDiagramTitle: n,
|
|
66
|
+
getAccDescription: o,
|
|
67
|
+
setAccDescription: i
|
|
68
|
+
}, A = /* @__PURE__ */ t((e) => {
|
|
69
|
+
g(e, k);
|
|
70
|
+
let { axes: t, curves: n, options: r } = e;
|
|
71
|
+
k.setAxes(t), k.setCurves(n), k.setOptions(r);
|
|
72
|
+
}, "populate"), j = { parse: /* @__PURE__ */ t(async (t) => {
|
|
73
|
+
let n = await h("radar", t);
|
|
74
|
+
e.debug(n), A(n);
|
|
75
|
+
}, "parse") }, M = /* @__PURE__ */ t((e, t, n, r) => {
|
|
76
|
+
let i = r.db, a = i.getAxes(), o = i.getCurves(), s = i.getOptions(), c = i.getConfig(), l = i.getDiagramTitle(), u = N(m(t), c), d = s.max ?? Math.max(...o.map((e) => Math.max(...e.entries))), f = s.min, p = Math.min(c.width, c.height) / 2;
|
|
77
|
+
P(u, a, p, s.ticks, s.graticule), F(u, a, p, c), I(u, a, o, f, d, s.graticule, c), z(u, o, s.showLegend, c), u.append("text").attr("class", "radarTitle").text(l).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
|
|
78
|
+
}, "draw"), N = /* @__PURE__ */ t((e, t) => {
|
|
79
|
+
let n = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, i = {
|
|
80
|
+
x: t.marginLeft + t.width / 2,
|
|
81
|
+
y: t.marginTop + t.height / 2
|
|
82
|
+
};
|
|
83
|
+
return c(e, r, n, t.useMaxWidth ?? !0), e.attr("viewBox", `0 0 ${n} ${r}`).attr("overflow", "visible"), e.append("g").attr("transform", `translate(${i.x}, ${i.y})`);
|
|
84
|
+
}, "drawFrame"), P = /* @__PURE__ */ t((e, t, n, r, i) => {
|
|
85
|
+
if (i === "circle") for (let t = 0; t < r; t++) {
|
|
86
|
+
let i = n * (t + 1) / r;
|
|
87
|
+
e.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
88
|
+
}
|
|
89
|
+
else if (i === "polygon") {
|
|
90
|
+
let i = t.length;
|
|
91
|
+
for (let a = 0; a < r; a++) {
|
|
92
|
+
let o = n * (a + 1) / r, s = t.map((e, t) => {
|
|
93
|
+
let n = 2 * t * Math.PI / i - Math.PI / 2;
|
|
94
|
+
return `${o * Math.cos(n)},${o * Math.sin(n)}`;
|
|
95
|
+
}).join(" ");
|
|
96
|
+
e.append("polygon").attr("points", s).attr("class", "radarGraticule");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, "drawGraticule"), F = /* @__PURE__ */ t((e, t, n, r) => {
|
|
100
|
+
let i = t.length;
|
|
101
|
+
for (let a = 0; a < i; a++) {
|
|
102
|
+
let o = t[a].label, s = 2 * a * Math.PI / i - Math.PI / 2, c = Math.cos(s), l = Math.sin(s);
|
|
103
|
+
e.append("line").attr("x1", 0).attr("y1", 0).attr("x2", n * r.axisScaleFactor * c).attr("y2", n * r.axisScaleFactor * l).attr("class", "radarAxisLine");
|
|
104
|
+
let u = c > .01 ? "start" : c < -.01 ? "end" : "middle", d = l > .01 ? "hanging" : l < -.01 ? "auto" : "central";
|
|
105
|
+
e.append("text").text(o).attr("x", n * r.axisLabelFactor * c + 4 * c).attr("y", n * r.axisLabelFactor * l + 4 * l).attr("text-anchor", u).attr("dominant-baseline", d).attr("class", "radarAxisLabel");
|
|
106
|
+
}
|
|
107
|
+
}, "drawAxes");
|
|
108
|
+
function I(e, t, n, r, i, a, o) {
|
|
109
|
+
let s = t.length, c = Math.min(o.width, o.height) / 2;
|
|
110
|
+
n.forEach((t, n) => {
|
|
111
|
+
if (t.entries.length !== s) return;
|
|
112
|
+
let l = t.entries.map((e, t) => {
|
|
113
|
+
let n = 2 * Math.PI * t / s - Math.PI / 2, a = L(e, r, i, c);
|
|
114
|
+
return {
|
|
115
|
+
x: a * Math.cos(n),
|
|
116
|
+
y: a * Math.sin(n)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
a === "circle" ? e.append("path").attr("d", R(l, o.curveTension)).attr("class", `radarCurve-${n}`) : a === "polygon" && e.append("polygon").attr("points", l.map((e) => `${e.x},${e.y}`).join(" ")).attr("class", `radarCurve-${n}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
t(I, "drawCurves");
|
|
123
|
+
function L(e, t, n, r) {
|
|
124
|
+
return r * (Math.min(Math.max(e, t), n) - t) / (n - t);
|
|
125
|
+
}
|
|
126
|
+
t(L, "relativeRadius");
|
|
127
|
+
function R(e, t) {
|
|
128
|
+
let n = e.length, r = `M${e[0].x},${e[0].y}`;
|
|
129
|
+
for (let i = 0; i < n; i++) {
|
|
130
|
+
let a = e[(i - 1 + n) % n], o = e[i], s = e[(i + 1) % n], c = e[(i + 2) % n], l = {
|
|
131
|
+
x: o.x + (s.x - a.x) * t,
|
|
132
|
+
y: o.y + (s.y - a.y) * t
|
|
133
|
+
}, u = {
|
|
134
|
+
x: s.x - (c.x - o.x) * t,
|
|
135
|
+
y: s.y - (c.y - o.y) * t
|
|
136
|
+
};
|
|
137
|
+
r += ` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`;
|
|
138
|
+
}
|
|
139
|
+
return `${r} Z`;
|
|
140
|
+
}
|
|
141
|
+
t(R, "closedRoundCurve");
|
|
142
|
+
function z(e, t, n, r) {
|
|
143
|
+
if (!n) return;
|
|
144
|
+
let i = (r.width / 2 + r.marginRight) * 3 / 4, a = -(r.height / 2 + r.marginTop) * 3 / 4;
|
|
145
|
+
t.forEach((t, n) => {
|
|
146
|
+
let r = e.append("g").attr("transform", `translate(${i}, ${a + n * 20})`);
|
|
147
|
+
r.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${n}`), r.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(t.label);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
t(z, "drawLegend");
|
|
151
|
+
var B = { draw: M }, V = /* @__PURE__ */ t((e, t) => {
|
|
152
|
+
let n = "";
|
|
153
|
+
for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) {
|
|
154
|
+
let i = e[`cScale${r}`];
|
|
155
|
+
n += `
|
|
156
|
+
.radarCurve-${r} {
|
|
157
|
+
color: ${i};
|
|
158
|
+
fill: ${i};
|
|
159
|
+
fill-opacity: ${t.curveOpacity};
|
|
160
|
+
stroke: ${i};
|
|
161
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
162
|
+
}
|
|
163
|
+
.radarLegendBox-${r} {
|
|
164
|
+
fill: ${i};
|
|
165
|
+
fill-opacity: ${t.curveOpacity};
|
|
166
|
+
stroke: ${i};
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
return n;
|
|
171
|
+
}, "genIndexStyles"), H = /* @__PURE__ */ t((e) => {
|
|
172
|
+
let t = r(), n = f(), i = p(t, n.themeVariables);
|
|
173
|
+
return {
|
|
174
|
+
themeVariables: i,
|
|
175
|
+
radarOptions: p(i.radar, e)
|
|
176
|
+
};
|
|
177
|
+
}, "buildRadarStyleOptions"), U = {
|
|
178
|
+
parser: j,
|
|
179
|
+
db: k,
|
|
180
|
+
renderer: B,
|
|
181
|
+
styles: /* @__PURE__ */ t(({ radar: e } = {}) => {
|
|
182
|
+
let { themeVariables: t, radarOptions: n } = H(e);
|
|
183
|
+
return `
|
|
184
|
+
.radarTitle {
|
|
185
|
+
font-size: ${t.fontSize};
|
|
186
|
+
color: ${t.titleColor};
|
|
187
|
+
dominant-baseline: hanging;
|
|
188
|
+
text-anchor: middle;
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLine {
|
|
191
|
+
stroke: ${n.axisColor};
|
|
192
|
+
stroke-width: ${n.axisStrokeWidth};
|
|
193
|
+
}
|
|
194
|
+
.radarAxisLabel {
|
|
195
|
+
font-size: ${n.axisLabelFontSize}px;
|
|
196
|
+
color: ${n.axisColor};
|
|
197
|
+
}
|
|
198
|
+
.radarGraticule {
|
|
199
|
+
fill: ${n.graticuleColor};
|
|
200
|
+
fill-opacity: ${n.graticuleOpacity};
|
|
201
|
+
stroke: ${n.graticuleColor};
|
|
202
|
+
stroke-width: ${n.graticuleStrokeWidth};
|
|
203
|
+
}
|
|
204
|
+
.radarLegendText {
|
|
205
|
+
text-anchor: start;
|
|
206
|
+
font-size: ${n.legendFontSize}px;
|
|
207
|
+
dominant-baseline: hanging;
|
|
208
|
+
}
|
|
209
|
+
${V(t, n)}
|
|
210
|
+
`;
|
|
211
|
+
}, "styles")
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
export { U as diagram };
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { m as e, p as t } from "./chunk-DVNvSFoz.js";
|
|
2
|
+
import { n } from "./chunk-BYzrzvCI.js";
|
|
3
|
+
import { C as r, H as i, U as a, X as o, _ as s, a as c, b as l, f as u, q as d, v as f, y as p, z as m } from "./chunk-MFVRUoO0.js";
|
|
4
|
+
import { i as h, t as ee, v as g } from "./chunk-K7Myuj2-.js";
|
|
5
|
+
import { T as te } from "./chunk-hM77LvCb.js";
|
|
6
|
+
import { n as ne } from "./chunk-DK9KqIXj.js";
|
|
7
|
+
import { t as re } from "./chunk-DGVDaXjx.js";
|
|
8
|
+
//#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-PFBEJUXE.mjs
|
|
9
|
+
var _ = "position frame", v = "frame positioned", y = "position relation", b = "relation positioned", ie = /* @__PURE__ */ n(function(t) {
|
|
10
|
+
e.debug("options str", t);
|
|
11
|
+
}, "setOptions"), ae = /* @__PURE__ */ n(function() {
|
|
12
|
+
return {};
|
|
13
|
+
}, "getOptions"), oe = /* @__PURE__ */ n(function() {
|
|
14
|
+
x(), c();
|
|
15
|
+
}, "clear");
|
|
16
|
+
function x() {
|
|
17
|
+
S = {};
|
|
18
|
+
}
|
|
19
|
+
n(x, "reset");
|
|
20
|
+
var se = u.eventmodeling, ce = /* @__PURE__ */ n(() => h({
|
|
21
|
+
...se,
|
|
22
|
+
...p().eventmodeling
|
|
23
|
+
}), "getConfig"), S = {};
|
|
24
|
+
function C() {
|
|
25
|
+
let t = le, { ast: n } = S, r = E();
|
|
26
|
+
if (!n) throw Error("No data for EventModel");
|
|
27
|
+
return n.frames.forEach((i, a) => {
|
|
28
|
+
let o = N(i, n.dataEntities, r);
|
|
29
|
+
t = q(t, {
|
|
30
|
+
$kind: _,
|
|
31
|
+
index: a,
|
|
32
|
+
frame: i,
|
|
33
|
+
textProps: o
|
|
34
|
+
});
|
|
35
|
+
let s;
|
|
36
|
+
B(i) ? (e.debug("source frame", i.sourceFrames), s = n.frames.filter((e) => i.sourceFrames.some((t) => t.$refText === e.name)), s.forEach((e) => {
|
|
37
|
+
t = q(t, {
|
|
38
|
+
$kind: y,
|
|
39
|
+
index: a,
|
|
40
|
+
frame: i,
|
|
41
|
+
sourceFrame: e
|
|
42
|
+
});
|
|
43
|
+
})) : t = q(t, {
|
|
44
|
+
$kind: y,
|
|
45
|
+
index: a,
|
|
46
|
+
frame: i
|
|
47
|
+
});
|
|
48
|
+
}), t = {
|
|
49
|
+
...t,
|
|
50
|
+
sortedSwimlanesArray: L(t.swimlanes)
|
|
51
|
+
}, t;
|
|
52
|
+
}
|
|
53
|
+
n(C, "getState");
|
|
54
|
+
function w(e) {
|
|
55
|
+
S.ast = void 0;
|
|
56
|
+
let t = /* @__PURE__ */ new Set();
|
|
57
|
+
for (let n of e.frames) {
|
|
58
|
+
if (t.has(n.name)) {
|
|
59
|
+
let e = n.$cstNode?.range.start.line, t = e === void 0 ? "" : ` on line ${e + 1}`;
|
|
60
|
+
throw Error(`Duplicate event modeling frame ID "${n.name}"${t}`);
|
|
61
|
+
}
|
|
62
|
+
t.add(n.name);
|
|
63
|
+
}
|
|
64
|
+
S.ast = e;
|
|
65
|
+
}
|
|
66
|
+
n(w, "setAst");
|
|
67
|
+
var T = {
|
|
68
|
+
swimlaneMinHeight: 70,
|
|
69
|
+
swimlanePadding: 15,
|
|
70
|
+
swimlaneGap: 10,
|
|
71
|
+
boxPadding: 10,
|
|
72
|
+
boxOverlap: 90,
|
|
73
|
+
boxDefaultY: 0,
|
|
74
|
+
boxMinWidth: 80,
|
|
75
|
+
boxMaxWidth: 450,
|
|
76
|
+
boxMinHeight: 80,
|
|
77
|
+
boxMaxHeight: 750,
|
|
78
|
+
contentStartX: 250,
|
|
79
|
+
textMaxWidth: 430,
|
|
80
|
+
boxTextFontWeight: "bold",
|
|
81
|
+
boxTextPadding: 10,
|
|
82
|
+
swimlaneTextFontWeight: "bold",
|
|
83
|
+
labelUiAutomation: "UI/Automation",
|
|
84
|
+
labelUiAutomationPrefix: "UI/A: ",
|
|
85
|
+
labelCommandReadModel: "Command/Read Model",
|
|
86
|
+
labelCommandReadModelPrefix: "C/RM: ",
|
|
87
|
+
labelEvents: "Events",
|
|
88
|
+
labelEventsPrefix: "Stream: "
|
|
89
|
+
};
|
|
90
|
+
function E() {
|
|
91
|
+
return T;
|
|
92
|
+
}
|
|
93
|
+
n(E, "getDiagramProps");
|
|
94
|
+
var le = {
|
|
95
|
+
boxes: [],
|
|
96
|
+
swimlanes: {},
|
|
97
|
+
relations: [],
|
|
98
|
+
maxR: 0,
|
|
99
|
+
sortedSwimlanesArray: []
|
|
100
|
+
};
|
|
101
|
+
function D(e) {
|
|
102
|
+
let t = e.split(".");
|
|
103
|
+
if (t.length === 2) return t[0];
|
|
104
|
+
}
|
|
105
|
+
n(D, "extractNamespace");
|
|
106
|
+
function O(e) {
|
|
107
|
+
let t = e.split(".");
|
|
108
|
+
return t.length === 2 ? t[1] : e;
|
|
109
|
+
}
|
|
110
|
+
n(O, "extractName");
|
|
111
|
+
function k(e, t) {
|
|
112
|
+
if (t && t.length !== 0) return Object.values(e).find((e) => e.namespace === t);
|
|
113
|
+
}
|
|
114
|
+
n(k, "findSwimlaneByNamespace");
|
|
115
|
+
function A(e, t, n) {
|
|
116
|
+
return Math.max(t, ...Object.keys(e).filter((e) => {
|
|
117
|
+
let r = Number.parseInt(e);
|
|
118
|
+
return r > t && r < n;
|
|
119
|
+
}).map((e) => Number.parseInt(e))) + 1;
|
|
120
|
+
}
|
|
121
|
+
n(A, "findNextAvailableIndex");
|
|
122
|
+
function j(e, t) {
|
|
123
|
+
let n = D(e.entityIdentifier), r = k(t, n);
|
|
124
|
+
switch (e.modelEntityType) {
|
|
125
|
+
case "ui":
|
|
126
|
+
case "pcr":
|
|
127
|
+
case "processor": return r ? {
|
|
128
|
+
index: r.index,
|
|
129
|
+
label: r.namespace || T.labelUiAutomation
|
|
130
|
+
} : n ? {
|
|
131
|
+
index: A(t, 0, 100),
|
|
132
|
+
label: T.labelUiAutomationPrefix + n
|
|
133
|
+
} : {
|
|
134
|
+
index: 0,
|
|
135
|
+
label: T.labelUiAutomation
|
|
136
|
+
};
|
|
137
|
+
case "rmo":
|
|
138
|
+
case "readmodel":
|
|
139
|
+
case "cmd":
|
|
140
|
+
case "command": return r ? {
|
|
141
|
+
index: r.index,
|
|
142
|
+
label: r.namespace || T.labelCommandReadModel
|
|
143
|
+
} : n ? {
|
|
144
|
+
index: A(t, 100, 200),
|
|
145
|
+
label: T.labelCommandReadModelPrefix + n
|
|
146
|
+
} : {
|
|
147
|
+
index: 100,
|
|
148
|
+
label: T.labelCommandReadModel
|
|
149
|
+
};
|
|
150
|
+
default: return r ? {
|
|
151
|
+
index: r.index,
|
|
152
|
+
label: r.namespace || T.labelEvents
|
|
153
|
+
} : n ? {
|
|
154
|
+
index: A(t, 200, 300),
|
|
155
|
+
label: T.labelEventsPrefix + n
|
|
156
|
+
} : {
|
|
157
|
+
index: 200,
|
|
158
|
+
label: T.labelEvents
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
n(j, "calculateSwimlaneProps");
|
|
163
|
+
function M(e) {
|
|
164
|
+
let { themeVariables: t } = p();
|
|
165
|
+
switch (e.modelEntityType) {
|
|
166
|
+
case "ui": return {
|
|
167
|
+
fill: t.emUiFill ?? "white",
|
|
168
|
+
stroke: t.emUiStroke ?? "#dbdada"
|
|
169
|
+
};
|
|
170
|
+
case "pcr":
|
|
171
|
+
case "processor": return {
|
|
172
|
+
fill: t.emProcessorFill ?? "#edb3f6",
|
|
173
|
+
stroke: t.emProcessorStroke ?? "#b88cbf"
|
|
174
|
+
};
|
|
175
|
+
case "rmo":
|
|
176
|
+
case "readmodel": return {
|
|
177
|
+
fill: t.emReadModelFill ?? "#d3f1a2",
|
|
178
|
+
stroke: t.emReadModelStroke ?? "#a3b732"
|
|
179
|
+
};
|
|
180
|
+
case "cmd":
|
|
181
|
+
case "command": return {
|
|
182
|
+
fill: t.emCommandFill ?? "#bcd6fe",
|
|
183
|
+
stroke: t.emCommandStroke ?? "#679ac3"
|
|
184
|
+
};
|
|
185
|
+
case "evt":
|
|
186
|
+
case "event": return {
|
|
187
|
+
fill: t.emEventFill ?? "#ffb778",
|
|
188
|
+
stroke: t.emEventStroke ?? "#c19a0f"
|
|
189
|
+
};
|
|
190
|
+
default: return {
|
|
191
|
+
fill: "red",
|
|
192
|
+
stroke: "black"
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
n(M, "calculateEntityVisualProps");
|
|
197
|
+
function N(t, n, r) {
|
|
198
|
+
let i = p(), a = m(O(t.entityIdentifier) ?? "", i), o, s = {
|
|
199
|
+
fontSize: 16,
|
|
200
|
+
fontWeight: 700,
|
|
201
|
+
fontFamily: "\"trebuchet ms\", verdana, arial, sans-serif",
|
|
202
|
+
joinWith: "<br/>"
|
|
203
|
+
}, c = `<b>${g(a, r.textMaxWidth, s)}</b>`;
|
|
204
|
+
if (t.dataInlineValue && (o = t.dataInlineValue, o = o.substring(o.indexOf("{") + 1), o = o.substring(0, o.lastIndexOf("}") - 1), o = m(o, i), o = g(o, r.textMaxWidth, s), o = o.replaceAll(" ", " ")), t.dataReference) {
|
|
205
|
+
let e = n.find((e) => e.name === t.dataReference?.$refText);
|
|
206
|
+
e && (o = e.dataBlockValue, o = o.substring(o.indexOf("{\n") + 2), o = o.substring(0, o.lastIndexOf("}") - 1), o = m(o, i), o = g(o, r.textMaxWidth, s), o = o.replaceAll(" ", " "), o += "<br/>");
|
|
207
|
+
}
|
|
208
|
+
let l = o !== void 0;
|
|
209
|
+
l && (c += `<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${o}</code>`);
|
|
210
|
+
let u = {
|
|
211
|
+
fontSize: s.fontSize,
|
|
212
|
+
fontWeight: s.fontWeight,
|
|
213
|
+
fontFamily: s.fontFamily
|
|
214
|
+
}, d = ee(c, u), f = l ? d.width / 3 : d.width, h = {
|
|
215
|
+
content: c,
|
|
216
|
+
width: f,
|
|
217
|
+
height: d.height
|
|
218
|
+
};
|
|
219
|
+
return e.debug(`[${t.name}] ${t.entityIdentifier} text`, h), h;
|
|
220
|
+
}
|
|
221
|
+
n(N, "calculateTextProps");
|
|
222
|
+
function P(e, t) {
|
|
223
|
+
let n = t, r = M(n.frame), i = {
|
|
224
|
+
width: n.textProps.width + 2 * T.boxTextPadding,
|
|
225
|
+
height: n.textProps.height + 2 * T.boxTextPadding
|
|
226
|
+
};
|
|
227
|
+
return [{
|
|
228
|
+
$kind: v,
|
|
229
|
+
frame: n.frame,
|
|
230
|
+
index: n.index,
|
|
231
|
+
visual: r,
|
|
232
|
+
dimension: i,
|
|
233
|
+
textProps: n.textProps
|
|
234
|
+
}];
|
|
235
|
+
}
|
|
236
|
+
n(P, "decidePositionFrame");
|
|
237
|
+
function F(e, t, n) {
|
|
238
|
+
return t === void 0 ? T.contentStartX : t.index === e.index && e.r ? e.r + T.boxPadding : n === void 0 ? T.contentStartX : n.r - T.boxOverlap + T.boxPadding;
|
|
239
|
+
}
|
|
240
|
+
n(F, "calculateX");
|
|
241
|
+
function I(e, t) {
|
|
242
|
+
let n = [...e.map((e) => e.r), t];
|
|
243
|
+
return Math.max(...n);
|
|
244
|
+
}
|
|
245
|
+
n(I, "calculateMaxRight");
|
|
246
|
+
function L(e) {
|
|
247
|
+
return Object.values(e).sort((e, t) => e.index - t.index);
|
|
248
|
+
}
|
|
249
|
+
n(L, "sortedSwimlanesArray");
|
|
250
|
+
function R(e, t) {
|
|
251
|
+
let n = t, r = j(n.frame, e.swimlanes), i;
|
|
252
|
+
i = r.index in e.swimlanes ? e.swimlanes[r.index] : {
|
|
253
|
+
index: r.index,
|
|
254
|
+
label: r.label,
|
|
255
|
+
r: 0,
|
|
256
|
+
y: r.index * T.swimlaneMinHeight + T.swimlaneGap,
|
|
257
|
+
height: T.swimlaneMinHeight,
|
|
258
|
+
maxHeight: T.swimlaneMinHeight
|
|
259
|
+
};
|
|
260
|
+
let a = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, o = e.previousSwimlaneNumber === void 0 ? void 0 : e.swimlanes[e.previousSwimlaneNumber], s = {
|
|
261
|
+
width: Math.max(T.boxMinWidth, Math.min(T.boxMaxWidth, n.dimension.width)) + 2 * T.boxPadding,
|
|
262
|
+
height: Math.max(T.boxMinHeight, Math.min(T.boxMaxHeight, n.dimension.height)) + 2 * T.boxPadding
|
|
263
|
+
}, c = F(i, o, a), l = c + s.width + T.boxPadding, u = I(Object.values(e.swimlanes), l);
|
|
264
|
+
i.r = c + s.width, i.maxHeight = Math.max(i.maxHeight, s.height), i.height = Math.max(T.swimlaneMinHeight, i.maxHeight) + 2 * T.swimlanePadding;
|
|
265
|
+
let d = {
|
|
266
|
+
x: c,
|
|
267
|
+
y: T.swimlanePadding + i.y,
|
|
268
|
+
r: l,
|
|
269
|
+
dimension: s,
|
|
270
|
+
leftSibling: !1,
|
|
271
|
+
swimlane: i,
|
|
272
|
+
visual: n.visual,
|
|
273
|
+
text: n.textProps.content,
|
|
274
|
+
frame: n.frame,
|
|
275
|
+
index: n.index
|
|
276
|
+
}, f = {
|
|
277
|
+
...e,
|
|
278
|
+
boxes: [...e.boxes, d],
|
|
279
|
+
swimlanes: {
|
|
280
|
+
...e.swimlanes,
|
|
281
|
+
[`${i.index}`]: i
|
|
282
|
+
},
|
|
283
|
+
previousSwimlaneNumber: r.index,
|
|
284
|
+
previousFrame: n.frame,
|
|
285
|
+
maxR: u
|
|
286
|
+
}, p = L(f.swimlanes);
|
|
287
|
+
p.length > 0 && (p[0].y = 0);
|
|
288
|
+
for (let e = 1; e < p.length; e++) {
|
|
289
|
+
let t = p[e], n = p[e - 1];
|
|
290
|
+
t.y = n.y + n.height + T.swimlaneGap;
|
|
291
|
+
}
|
|
292
|
+
return f;
|
|
293
|
+
}
|
|
294
|
+
n(R, "evolveFramePositioned");
|
|
295
|
+
function z(e, t) {
|
|
296
|
+
return e === 0 && t.sourceFrames.length === 0;
|
|
297
|
+
}
|
|
298
|
+
n(z, "isFirstFrame");
|
|
299
|
+
function B(e) {
|
|
300
|
+
return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
|
|
301
|
+
}
|
|
302
|
+
n(B, "hasSourceFrame");
|
|
303
|
+
function V(e, t) {
|
|
304
|
+
if (t != null) return e.find((e) => e.frame.name === t.name);
|
|
305
|
+
}
|
|
306
|
+
n(V, "findBoxByFrame");
|
|
307
|
+
function H(e, t, n) {
|
|
308
|
+
if (!(n < 0)) for (let r = n; r >= 0; r--) {
|
|
309
|
+
let n = e[r];
|
|
310
|
+
if (n.swimlane.index !== t) return n;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
n(H, "findBoxByLineIndex");
|
|
314
|
+
function U(e, t) {
|
|
315
|
+
let n = t;
|
|
316
|
+
if (z(n.index, n.frame)) return [];
|
|
317
|
+
let r = V(e.boxes, n.frame);
|
|
318
|
+
if (r === void 0) throw Error(`Target box not found for frame ${n.frame.name}`);
|
|
319
|
+
let i;
|
|
320
|
+
if (n.sourceFrame) i = V(e.boxes, n.sourceFrame);
|
|
321
|
+
else {
|
|
322
|
+
if (te(n.frame)) return [];
|
|
323
|
+
i = H(e.boxes, r.swimlane.index, n.index - 1);
|
|
324
|
+
}
|
|
325
|
+
return i === void 0 ? [] : [{
|
|
326
|
+
$kind: b,
|
|
327
|
+
frame: n.frame,
|
|
328
|
+
index: n.index,
|
|
329
|
+
sourceBox: i,
|
|
330
|
+
targetBox: r
|
|
331
|
+
}];
|
|
332
|
+
}
|
|
333
|
+
n(U, "decidePositionRelation");
|
|
334
|
+
function W(e, t) {
|
|
335
|
+
let n = t, r = {
|
|
336
|
+
visual: {
|
|
337
|
+
fill: "none",
|
|
338
|
+
stroke: "#000"
|
|
339
|
+
},
|
|
340
|
+
source: {
|
|
341
|
+
x: n.sourceBox.x,
|
|
342
|
+
y: n.sourceBox.y
|
|
343
|
+
},
|
|
344
|
+
target: {
|
|
345
|
+
x: n.targetBox.x,
|
|
346
|
+
y: n.targetBox.y
|
|
347
|
+
},
|
|
348
|
+
sourceBox: n.sourceBox,
|
|
349
|
+
targetBox: n.targetBox
|
|
350
|
+
};
|
|
351
|
+
return {
|
|
352
|
+
...e,
|
|
353
|
+
relations: [...e.relations, r]
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
n(W, "evolveRelationPositioned");
|
|
357
|
+
var ue = {
|
|
358
|
+
[_]: P,
|
|
359
|
+
[y]: U
|
|
360
|
+
}, de = {
|
|
361
|
+
[v]: R,
|
|
362
|
+
[b]: W
|
|
363
|
+
};
|
|
364
|
+
function G(t, n) {
|
|
365
|
+
let r = ue[n.$kind];
|
|
366
|
+
if (r == null) return [];
|
|
367
|
+
let i = r(t, n);
|
|
368
|
+
return e.debug("decided events", i), i;
|
|
369
|
+
}
|
|
370
|
+
n(G, "decide");
|
|
371
|
+
function K(t, n) {
|
|
372
|
+
let r = n.reduce((e, t) => {
|
|
373
|
+
let n = de[t.$kind];
|
|
374
|
+
return n == null ? e : n(e, t);
|
|
375
|
+
}, t);
|
|
376
|
+
return e.debug("evolve events", {
|
|
377
|
+
state: t,
|
|
378
|
+
newState: r,
|
|
379
|
+
events: n
|
|
380
|
+
}), r;
|
|
381
|
+
}
|
|
382
|
+
n(K, "evolve");
|
|
383
|
+
function q(e, t) {
|
|
384
|
+
return K(e, G(e, t));
|
|
385
|
+
}
|
|
386
|
+
n(q, "dispatch");
|
|
387
|
+
var J = {
|
|
388
|
+
getConfig: ce,
|
|
389
|
+
preserveCommentsWhenParsing: !0,
|
|
390
|
+
setOptions: ie,
|
|
391
|
+
getOptions: ae,
|
|
392
|
+
clear: oe,
|
|
393
|
+
setAccTitle: a,
|
|
394
|
+
getAccTitle: f,
|
|
395
|
+
getAccDescription: s,
|
|
396
|
+
setAccDescription: i,
|
|
397
|
+
setDiagramTitle: d,
|
|
398
|
+
getDiagramTitle: r,
|
|
399
|
+
setAst: w,
|
|
400
|
+
getDiagramProps: E,
|
|
401
|
+
getState: C
|
|
402
|
+
}, fe = { parse: /* @__PURE__ */ n(async (t) => {
|
|
403
|
+
let n = await ne("eventmodeling", t);
|
|
404
|
+
e.debug(n), J.setAst(n), re(n, J);
|
|
405
|
+
}, "parse") }, Y = l()?.eventmodeling;
|
|
406
|
+
function X(e, t) {
|
|
407
|
+
return (n) => {
|
|
408
|
+
let r = n.swimlane.y + t.swimlanePadding, i = e.append("g").attr("class", "em-box");
|
|
409
|
+
i.append("rect").attr("x", n.x).attr("y", r).attr("rx", "3").attr("width", n.dimension.width).attr("height", n.dimension.height).attr("stroke", n.visual.stroke).attr("fill", n.visual.fill), i.append("foreignObject").attr("x", n.x + t.boxPadding).attr("y", r + 10).attr("width", n.dimension.width - 2 * t.boxPadding).attr("height", n.dimension.height - 2 * t.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(n.text);
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
n(X, "renderD3Box");
|
|
413
|
+
function Z(e, t) {
|
|
414
|
+
return e > t;
|
|
415
|
+
}
|
|
416
|
+
n(Z, "dirUpwards");
|
|
417
|
+
function Q(t, n, r, i) {
|
|
418
|
+
return (a) => {
|
|
419
|
+
let o = a.sourceBox.swimlane.y + n.swimlanePadding, s = a.targetBox.swimlane.y + n.swimlanePadding, c = Z(o, s), l = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, u = a.targetBox.x + a.targetBox.dimension.width / 3, d, f;
|
|
420
|
+
e.debug(`rendering relation up=${c} for `, {
|
|
421
|
+
sourceBox: a.sourceBox,
|
|
422
|
+
targetBox: a.targetBox
|
|
423
|
+
}), c ? (d = o, f = s + a.targetBox.dimension.height) : (d = o + a.sourceBox.dimension.height, f = s);
|
|
424
|
+
let p = i.emRelationStroke ?? a.visual.stroke;
|
|
425
|
+
t.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", p).attr("stroke-width", "1").attr("marker-end", `url(#${r})`).attr("d", `M${l} ${d} L${u} ${f}`);
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
n(Q, "renderD3Relation");
|
|
429
|
+
function $(e, t, n, r) {
|
|
430
|
+
return (i) => {
|
|
431
|
+
let a = e.append("g").attr("class", "em-swimlane"), o = r.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", s = r.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
|
|
432
|
+
a.append("rect").attr("x", 0).attr("y", i.y).attr("rx", "3").attr("width", t + n.swimlanePadding).attr("height", i.height).attr("fill", o).attr("stroke", s), a.append("text").attr("font-weight", n.swimlaneTextFontWeight).attr("x", 30).attr("y", i.y + 30).text(i.label);
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
n($, "renderD3Swimlane");
|
|
436
|
+
var pe = {
|
|
437
|
+
parser: fe,
|
|
438
|
+
db: J,
|
|
439
|
+
renderer: { draw: /* @__PURE__ */ n(function(n, r, i, a) {
|
|
440
|
+
if (e.debug("in eventmodeling renderer", n + "\n", "id:", r, i), !Y) throw Error("EventModeling config not found");
|
|
441
|
+
let s = a.db, { themeVariables: c, eventmodeling: u } = l(), d = t(`[id="${r}"]`), f = s.getDiagramProps(), p = s.getState(), m = `em-arrowhead-${r}`, h = c.emArrowhead ?? "#000000";
|
|
442
|
+
p.sortedSwimlanesArray.forEach($(d, p.maxR, f, c)), p.boxes.forEach(X(d, f)), p.relations.forEach(Q(d, f, m, c)), d.append("defs").append("marker").attr("id", m).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", h), o(void 0, d, u?.padding ?? 30, u?.useMaxWidth);
|
|
443
|
+
}, "draw") },
|
|
444
|
+
styles: /* @__PURE__ */ n((e) => "", "getStyles")
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
447
|
+
export { pe as diagram };
|