@openbkn/workshop 0.2.2-rc.5 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -13
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +341 -218
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { _ as u, l as o, ak as Z, ad as I, al as ee, am as te, an as ne, ae as x, ac as se, ao as re, ap as D, aq as S, ar as k, c as ie, O as ae, as as oe, at as ce, au as le, av as ue, u as de } from "./mermaid.core-yQghUlIz.js";
|
|
2
|
+
import { G as R } from "./graph-CKJmgLki.js";
|
|
3
|
+
function T(e, { edgePathsClass: n = "edges edgePaths" } = {}) {
|
|
4
|
+
const t = e.insert("g").attr("class", "root"), r = t.insert("g").attr("class", "clusters"), s = t.insert("g").attr("class", n), i = t.insert("g").attr("class", "edgeLabels"), c = t.insert("g").attr("class", "nodes");
|
|
5
|
+
return { clusters: r, edgePaths: s, edgeLabels: i, nodes: c, rootGroups: t };
|
|
6
|
+
}
|
|
7
|
+
u(T, "createLayoutElementGroups");
|
|
8
|
+
async function P(e, n, t) {
|
|
9
|
+
if (n.label) {
|
|
10
|
+
const { shapeSvg: r, bbox: s } = await ue(
|
|
11
|
+
e,
|
|
12
|
+
t === void 0 ? n : { ...n, width: t }
|
|
13
|
+
);
|
|
14
|
+
n.labelBBox = { width: s.width, height: s.height }, r.remove();
|
|
15
|
+
} else
|
|
16
|
+
n.labelBBox = { width: 0, height: 0 };
|
|
17
|
+
}
|
|
18
|
+
u(P, "measureGroupLabel");
|
|
19
|
+
async function B(e, n, t) {
|
|
20
|
+
const r = await I(e, n, t), s = r.node()?.getBBox() ?? { width: 0, height: 0 };
|
|
21
|
+
return n.width = s.width, n.height = s.height, r;
|
|
22
|
+
}
|
|
23
|
+
u(B, "insertMeasuredNode");
|
|
24
|
+
function M(e, n, t) {
|
|
25
|
+
let r = e;
|
|
26
|
+
const s = /* @__PURE__ */ new Set();
|
|
27
|
+
for (; r; ) {
|
|
28
|
+
if (r.dir)
|
|
29
|
+
return r.dir;
|
|
30
|
+
if (!r.parentId || s.has(r.parentId))
|
|
31
|
+
break;
|
|
32
|
+
s.add(r.parentId), r = n.get(r.parentId);
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
}
|
|
36
|
+
u(M, "resolveNodeDir");
|
|
37
|
+
async function _(e, n, t = {}) {
|
|
38
|
+
const r = new R({
|
|
39
|
+
multigraph: !0,
|
|
40
|
+
compound: !0
|
|
41
|
+
}), s = [...n.edges], i = ie(), c = T(e), { edgeLabels: f, nodes: a } = c, g = /* @__PURE__ */ new Map(), h = new Map(n.nodes.map((d) => [d.id, d])), p = n.direction, w = e.node() != null;
|
|
42
|
+
await Promise.all(
|
|
43
|
+
n.nodes.map(async (d) => {
|
|
44
|
+
if (d.isGroup) {
|
|
45
|
+
if (w) {
|
|
46
|
+
const m = t.unwrapGroupLabels && d.labelType !== "markdown";
|
|
47
|
+
await P(a, d, m ? Number.POSITIVE_INFINITY : void 0);
|
|
48
|
+
}
|
|
49
|
+
r.setNode(d.id, { ...d });
|
|
50
|
+
} else {
|
|
51
|
+
if (w) {
|
|
52
|
+
const m = await B(a, d, {
|
|
53
|
+
config: i,
|
|
54
|
+
dir: M(d, h, p)
|
|
55
|
+
});
|
|
56
|
+
g.set(d.id, m);
|
|
57
|
+
}
|
|
58
|
+
r.setNode(d.id, { ...d });
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
for (const d of s)
|
|
63
|
+
w && D(d) && await k(f, d), r.setEdge(d.start, d.end, { ...d }, d.id), n.edges.some((E) => E.id === d.id) || n.edges.push(d);
|
|
64
|
+
if (globalThis.mermaidCaptureSizes) {
|
|
65
|
+
const { captureNodeSizes: d } = await import("./sizeCapture-INFHLROL-D3jlbt7h.js");
|
|
66
|
+
d(e, n);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
graph: r,
|
|
70
|
+
groups: c,
|
|
71
|
+
nodeElements: g
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
u(_, "createGraphWithElements");
|
|
75
|
+
var l = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ u(() => {
|
|
76
|
+
b.clear(), A.clear(), l.clear();
|
|
77
|
+
}, "clear"), v = /* @__PURE__ */ u((e, n) => {
|
|
78
|
+
const t = b.get(n) || [];
|
|
79
|
+
return o.trace("In isDescendant", n, " ", e, " = ", t.includes(e)), t.includes(e);
|
|
80
|
+
}, "isDescendant"), ge = /* @__PURE__ */ u((e, n) => {
|
|
81
|
+
const t = b.get(n) || [];
|
|
82
|
+
return o.info("Descendants of ", n, " is ", t), o.info("Edge is ", e), e.v === n || e.w === n ? !1 : t ? t.includes(e.v) || v(e.v, n) || v(e.w, n) || t.includes(e.w) : (o.debug("Tilt, ", n, ",not in descendants"), !1);
|
|
83
|
+
}, "edgeInCluster"), X = /* @__PURE__ */ u((e, n, t, r) => {
|
|
84
|
+
o.debug(
|
|
85
|
+
"Copying children of ",
|
|
86
|
+
e,
|
|
87
|
+
"root",
|
|
88
|
+
r,
|
|
89
|
+
"data",
|
|
90
|
+
n.node(e),
|
|
91
|
+
r
|
|
92
|
+
);
|
|
93
|
+
const s = n.children(e) || [];
|
|
94
|
+
e !== r && s.push(e), o.debug("Copying (nodes) clusterId", e, "nodes", s), s.forEach((i) => {
|
|
95
|
+
if (n.children(i).length > 0)
|
|
96
|
+
X(i, n, t, r);
|
|
97
|
+
else {
|
|
98
|
+
const c = n.node(i);
|
|
99
|
+
o.info("cp ", i, " to ", r, " with parent ", e), t.setNode(i, c), r !== n.parent(i) && (o.debug("Setting parent", i, n.parent(i)), t.setParent(i, n.parent(i))), e !== r && i !== e ? (o.debug("Setting parent", i, e), t.setParent(i, e)) : (o.info("In copy ", e, "root", r, "data", n.node(e), r), o.debug(
|
|
100
|
+
"Not Setting parent for node=",
|
|
101
|
+
i,
|
|
102
|
+
"cluster!==rootId",
|
|
103
|
+
e !== r,
|
|
104
|
+
"node!==clusterId",
|
|
105
|
+
i !== e
|
|
106
|
+
));
|
|
107
|
+
const f = n.edges(i);
|
|
108
|
+
o.debug("Copying Edges", f), f.forEach((a) => {
|
|
109
|
+
o.info("Edge", a);
|
|
110
|
+
const g = n.edge(a.v, a.w, a.name);
|
|
111
|
+
o.info("Edge data", g, r);
|
|
112
|
+
try {
|
|
113
|
+
ge(a, r) ? (o.info("Copying as ", a.v, a.w, g, a.name), t.setEdge(a.v, a.w, g, a.name), o.info("newGraph edges ", t.edges(), t.edge(t.edges()[0]))) : o.info(
|
|
114
|
+
"Skipping copy of edge ",
|
|
115
|
+
a.v,
|
|
116
|
+
"-->",
|
|
117
|
+
a.w,
|
|
118
|
+
" rootId: ",
|
|
119
|
+
r,
|
|
120
|
+
" clusterId:",
|
|
121
|
+
e
|
|
122
|
+
);
|
|
123
|
+
} catch (h) {
|
|
124
|
+
o.error(h);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
o.debug("Removing node", i), n.removeNode(i);
|
|
129
|
+
});
|
|
130
|
+
}, "copy"), G = /* @__PURE__ */ u((e, n) => {
|
|
131
|
+
const t = n.children(e);
|
|
132
|
+
let r = [...t];
|
|
133
|
+
for (const s of t)
|
|
134
|
+
A.set(s, e), r = [...r, ...G(s, n)];
|
|
135
|
+
return r;
|
|
136
|
+
}, "extractDescendants"), be = /* @__PURE__ */ u((e, n, t) => {
|
|
137
|
+
const r = e.edges().filter((a) => a.v === n || a.w === n), s = e.edges().filter((a) => a.v === t || a.w === t), i = r.map((a) => ({ v: a.v === n ? t : a.v, w: a.w === n ? n : a.w })), c = s.map((a) => ({ v: a.v, w: a.w }));
|
|
138
|
+
return i.filter((a) => c.some((g) => a.v === g.v && a.w === g.w));
|
|
139
|
+
}, "findCommonEdges"), C = /* @__PURE__ */ u((e, n, t) => {
|
|
140
|
+
const r = n.children(e);
|
|
141
|
+
if (o.trace("Searching children of id ", e, r), r.length < 1)
|
|
142
|
+
return e;
|
|
143
|
+
let s;
|
|
144
|
+
for (const i of r) {
|
|
145
|
+
const c = C(i, n, t), f = be(n, t, c);
|
|
146
|
+
if (c)
|
|
147
|
+
if (f.length > 0)
|
|
148
|
+
s = c;
|
|
149
|
+
else
|
|
150
|
+
return c;
|
|
151
|
+
}
|
|
152
|
+
return s;
|
|
153
|
+
}, "findNonClusterChild"), L = /* @__PURE__ */ u((e) => !l.has(e) || !l.get(e).externalConnections ? e : l.has(e) ? l.get(e).id : e, "getAnchorId"), Ce = /* @__PURE__ */ u((e, n) => {
|
|
154
|
+
if (!e || n > 10) {
|
|
155
|
+
o.debug("Opting out, no graph ");
|
|
156
|
+
return;
|
|
157
|
+
} else
|
|
158
|
+
o.debug("Opting in, graph ");
|
|
159
|
+
e.nodes().forEach(function(t) {
|
|
160
|
+
e.children(t).length > 0 && (o.debug(
|
|
161
|
+
"Cluster identified",
|
|
162
|
+
t,
|
|
163
|
+
" Replacement id in edges: ",
|
|
164
|
+
C(t, e, t)
|
|
165
|
+
), b.set(t, G(t, e)), l.set(t, { id: C(t, e, t), clusterData: e.node(t) }));
|
|
166
|
+
}), e.nodes().forEach(function(t) {
|
|
167
|
+
const r = e.children(t), s = e.edges();
|
|
168
|
+
r.length > 0 ? (o.debug("Cluster identified", t, b), s.forEach((i) => {
|
|
169
|
+
const c = v(i.v, t), f = v(i.w, t);
|
|
170
|
+
c ^ f && (o.debug("Edge: ", i, " leaves cluster ", t), o.debug("Descendants of XXX ", t, ": ", b.get(t)), l.get(t).externalConnections = !0);
|
|
171
|
+
})) : o.debug("Not a cluster ", t, b);
|
|
172
|
+
});
|
|
173
|
+
for (let t of l.keys()) {
|
|
174
|
+
const r = l.get(t).id, s = e.parent(r);
|
|
175
|
+
s !== t && l.has(s) && !l.get(s).externalConnections && (l.get(t).id = s);
|
|
176
|
+
const i = e.edges().some((c) => c.v === t);
|
|
177
|
+
if (r && l.get(t)?.externalConnections && i && $(e, r, t)) {
|
|
178
|
+
const c = he(e, t, e.parent(r));
|
|
179
|
+
c && (l.get(t).id = c);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
e.edges().forEach(function(t) {
|
|
183
|
+
const r = e.edge(t);
|
|
184
|
+
o.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(t)), o.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(e.edge(t)));
|
|
185
|
+
let s = t.v, i = t.w;
|
|
186
|
+
if (o.debug(
|
|
187
|
+
"Fix XXX",
|
|
188
|
+
l,
|
|
189
|
+
"ids:",
|
|
190
|
+
t.v,
|
|
191
|
+
t.w,
|
|
192
|
+
"Translating: ",
|
|
193
|
+
l.get(t.v),
|
|
194
|
+
" --- ",
|
|
195
|
+
l.get(t.w)
|
|
196
|
+
), l.get(t.v) || l.get(t.w)) {
|
|
197
|
+
if (o.debug("Fixing and trying - removing XXX", t.v, t.w, t.name), s = L(t.v), i = L(t.w), e.removeEdge(t.v, t.w, t.name), s !== t.v) {
|
|
198
|
+
const c = e.parent(s);
|
|
199
|
+
l.get(c).externalConnections = !0, r.fromCluster = t.v;
|
|
200
|
+
}
|
|
201
|
+
if (i !== t.w) {
|
|
202
|
+
const c = e.parent(i);
|
|
203
|
+
l.get(c).externalConnections = !0, r.toCluster = t.w;
|
|
204
|
+
}
|
|
205
|
+
o.debug("Fix Replacing with XXX", s, i, t.name), e.setEdge(s, i, r, t.name);
|
|
206
|
+
}
|
|
207
|
+
}), O(e, 0), o.trace(l);
|
|
208
|
+
}, "adjustClustersAndEdges"), O = /* @__PURE__ */ u((e, n) => {
|
|
209
|
+
if (n > 10) {
|
|
210
|
+
o.error("Bailing out");
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
let t = e.nodes(), r = !1;
|
|
214
|
+
for (const s of t) {
|
|
215
|
+
const i = e.children(s);
|
|
216
|
+
r = r || i.length > 0;
|
|
217
|
+
}
|
|
218
|
+
if (!r) {
|
|
219
|
+
o.debug("Done, no node has children", e.nodes());
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
o.debug("Nodes = ", t, n);
|
|
223
|
+
for (const s of t)
|
|
224
|
+
if (o.debug(
|
|
225
|
+
"Extracting node",
|
|
226
|
+
s,
|
|
227
|
+
l,
|
|
228
|
+
l.has(s) && !l.get(s).externalConnections,
|
|
229
|
+
!e.parent(s),
|
|
230
|
+
e.node(s),
|
|
231
|
+
e.children("D"),
|
|
232
|
+
" Depth ",
|
|
233
|
+
n
|
|
234
|
+
), !l.has(s))
|
|
235
|
+
o.debug("Not a cluster", s, n);
|
|
236
|
+
else if (!l.get(s).externalConnections && e.children(s) && e.children(s).length > 0) {
|
|
237
|
+
o.debug(
|
|
238
|
+
"Cluster without external connections, without a parent and with children",
|
|
239
|
+
s,
|
|
240
|
+
n
|
|
241
|
+
);
|
|
242
|
+
let c = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
243
|
+
l.get(s)?.clusterData?.dir && (c = l.get(s).clusterData.dir, o.debug("Fixing dir", l.get(s).clusterData.dir, c));
|
|
244
|
+
const f = new R({
|
|
245
|
+
multigraph: !0,
|
|
246
|
+
compound: !0
|
|
247
|
+
}).setGraph({
|
|
248
|
+
rankdir: c,
|
|
249
|
+
nodesep: 50,
|
|
250
|
+
ranksep: 50,
|
|
251
|
+
marginx: 8,
|
|
252
|
+
marginy: 8
|
|
253
|
+
}).setDefaultEdgeLabel(function() {
|
|
254
|
+
return {};
|
|
255
|
+
});
|
|
256
|
+
X(s, e, f, s), e.setNode(s, {
|
|
257
|
+
clusterNode: !0,
|
|
258
|
+
id: s,
|
|
259
|
+
clusterData: l.get(s).clusterData,
|
|
260
|
+
label: l.get(s).label,
|
|
261
|
+
graph: f
|
|
262
|
+
});
|
|
263
|
+
} else
|
|
264
|
+
o.debug(
|
|
265
|
+
"Cluster ** ",
|
|
266
|
+
s,
|
|
267
|
+
" **not meeting the criteria !externalConnections:",
|
|
268
|
+
!l.get(s).externalConnections,
|
|
269
|
+
" no parent: ",
|
|
270
|
+
!e.parent(s),
|
|
271
|
+
" children ",
|
|
272
|
+
e.children(s) && e.children(s).length > 0,
|
|
273
|
+
e.children("D"),
|
|
274
|
+
n
|
|
275
|
+
), o.debug(l);
|
|
276
|
+
t = e.nodes(), o.debug("New list of nodes", t);
|
|
277
|
+
for (const s of t) {
|
|
278
|
+
const i = e.node(s);
|
|
279
|
+
o.debug(" Now next level", s, i), i?.clusterNode && O(i.graph, n + 1);
|
|
280
|
+
}
|
|
281
|
+
}, "extractor"), F = /* @__PURE__ */ u((e, n) => {
|
|
282
|
+
if (n.length === 0)
|
|
283
|
+
return [];
|
|
284
|
+
let t = Object.assign([], n);
|
|
285
|
+
return n.forEach((r) => {
|
|
286
|
+
const s = e.children(r), i = F(e, s);
|
|
287
|
+
t = [...t, ...i];
|
|
288
|
+
}), t;
|
|
289
|
+
}, "sorter"), pe = /* @__PURE__ */ u((e) => F(e, e.children()), "sortNodesByHierarchy"), $ = /* @__PURE__ */ u((e, n, t) => {
|
|
290
|
+
let r = e.parent(n);
|
|
291
|
+
for (; r && r !== t; ) {
|
|
292
|
+
const s = l.get(r);
|
|
293
|
+
if (s && !s.externalConnections)
|
|
294
|
+
return !0;
|
|
295
|
+
r = e.parent(r);
|
|
296
|
+
}
|
|
297
|
+
return !1;
|
|
298
|
+
}, "isNodeInExtractableCluster"), he = /* @__PURE__ */ u((e, n, t) => {
|
|
299
|
+
const r = e.children(n) ?? [];
|
|
300
|
+
for (const s of r) {
|
|
301
|
+
if (s === t || v(s, t))
|
|
302
|
+
continue;
|
|
303
|
+
const i = C(s, e, n);
|
|
304
|
+
if (i && !$(e, i, n))
|
|
305
|
+
return i;
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}, "findSafeAnchorNode");
|
|
309
|
+
function we({
|
|
310
|
+
prepareLayout: e,
|
|
311
|
+
measureLayout: n,
|
|
312
|
+
runLayoutCore: t,
|
|
313
|
+
paintLayout: r,
|
|
314
|
+
afterPaint: s,
|
|
315
|
+
paintOptions: i
|
|
316
|
+
}) {
|
|
317
|
+
const c = n ?? H;
|
|
318
|
+
return /* @__PURE__ */ u(async function(a, g, h, p) {
|
|
319
|
+
const w = g.select("g");
|
|
320
|
+
(h?.insertMarkers ?? Z)(
|
|
321
|
+
w,
|
|
322
|
+
a.markers,
|
|
323
|
+
a.type,
|
|
324
|
+
a.diagramId
|
|
325
|
+
), j();
|
|
326
|
+
const d = {
|
|
327
|
+
element: w,
|
|
328
|
+
// root SVG <g>
|
|
329
|
+
helpers: h,
|
|
330
|
+
// Mermaid helper functions
|
|
331
|
+
options: p
|
|
332
|
+
// { algorithm: "elk.layered" }
|
|
333
|
+
};
|
|
334
|
+
d.preparedLayout = await e?.(a, d);
|
|
335
|
+
const m = await c(a, d), E = await t(a, d), N = {
|
|
336
|
+
...d,
|
|
337
|
+
measure: m
|
|
338
|
+
};
|
|
339
|
+
r ? await r(a, N, E) : await z(
|
|
340
|
+
a,
|
|
341
|
+
N,
|
|
342
|
+
i
|
|
343
|
+
), await s?.(a, N, E);
|
|
344
|
+
}, "render");
|
|
345
|
+
}
|
|
346
|
+
u(we, "createCommonLayoutRenderer");
|
|
347
|
+
function j() {
|
|
348
|
+
ee(), te(), ne(), fe();
|
|
349
|
+
}
|
|
350
|
+
u(j, "clearLayoutRenderState");
|
|
351
|
+
async function H(e, { element: n }, t) {
|
|
352
|
+
return await _(n, e, t);
|
|
353
|
+
}
|
|
354
|
+
u(H, "defaultMeasureLayout");
|
|
355
|
+
async function z(e, n, t = {}) {
|
|
356
|
+
const { measure: r } = n, { groups: s } = r;
|
|
357
|
+
for (const c of t.getNodes?.(e, n) ?? e.nodes)
|
|
358
|
+
t.skipNode?.(c, n) || await J(s, c, n, t);
|
|
359
|
+
const i = q(e.nodes);
|
|
360
|
+
for (const c of e.edges)
|
|
361
|
+
V(c, t) || await Y(s, c, i, e, t, n);
|
|
362
|
+
}
|
|
363
|
+
u(z, "paintLayoutData");
|
|
364
|
+
async function J(e, n, t, r) {
|
|
365
|
+
n.clusterNode ? x(n) : W(n, t, r) ? await se(e.clusters, n) : x(n);
|
|
366
|
+
}
|
|
367
|
+
u(J, "paintLayoutNode");
|
|
368
|
+
function W(e, n, t) {
|
|
369
|
+
return e.isGroup === !0 && (t.isCluster?.(e, n) ?? !0);
|
|
370
|
+
}
|
|
371
|
+
u(W, "shouldPaintAsCluster");
|
|
372
|
+
function q(e) {
|
|
373
|
+
const n = /* @__PURE__ */ new Map();
|
|
374
|
+
for (const t of e)
|
|
375
|
+
t?.id && n.set(t.id, t);
|
|
376
|
+
return n;
|
|
377
|
+
}
|
|
378
|
+
u(q, "buildNodeLookup");
|
|
379
|
+
function V(e, n) {
|
|
380
|
+
return e.isLayoutOnly || !!n.skipEdge?.(e);
|
|
381
|
+
}
|
|
382
|
+
u(V, "shouldSkipPaintEdge");
|
|
383
|
+
async function Y(e, n, t, r, s, i) {
|
|
384
|
+
const c = re(
|
|
385
|
+
e.edgePaths,
|
|
386
|
+
{ ...n },
|
|
387
|
+
s.clusterDb ?? /* @__PURE__ */ new Map(),
|
|
388
|
+
r.type,
|
|
389
|
+
y(n.start, n, t, i, s),
|
|
390
|
+
y(n.end, n, t, i, s),
|
|
391
|
+
r.diagramId,
|
|
392
|
+
K(n, s),
|
|
393
|
+
r.layoutAlgorithm
|
|
394
|
+
);
|
|
395
|
+
D(n) && (S.has(n.id) || await k(e.edgeLabels, n), Q(n, c));
|
|
396
|
+
}
|
|
397
|
+
u(Y, "paintLayoutEdge");
|
|
398
|
+
function y(e, n, t, r, s) {
|
|
399
|
+
return s.getEdgeNode?.(e, n, r) ?? (e ? t.get(e) ?? {} : {});
|
|
400
|
+
}
|
|
401
|
+
u(y, "getRenderedNode");
|
|
402
|
+
function K(e, n) {
|
|
403
|
+
return typeof n.skipIntersect == "function" ? n.skipIntersect(e) : n.skipIntersect ?? !1;
|
|
404
|
+
}
|
|
405
|
+
u(K, "shouldSkipIntersect");
|
|
406
|
+
function Q(e, n) {
|
|
407
|
+
const t = n?.updatedPath ?? n?.originalPath, r = ae(), { subGraphTitleTotalMargin: s } = oe({
|
|
408
|
+
flowchart: r.flowchart ?? {}
|
|
409
|
+
});
|
|
410
|
+
if (e.label) {
|
|
411
|
+
const i = S.get(e.id), { x: c, y: f } = ce(e, n);
|
|
412
|
+
i.attr("transform", `translate(${c}, ${f + s / 2})`);
|
|
413
|
+
}
|
|
414
|
+
for (const [i, c] of [
|
|
415
|
+
["startLeft", e.startLabelLeft],
|
|
416
|
+
["startRight", e.startLabelRight],
|
|
417
|
+
["endLeft", e.endLabelLeft],
|
|
418
|
+
["endRight", e.endLabelRight]
|
|
419
|
+
])
|
|
420
|
+
if (c) {
|
|
421
|
+
const { x: f, y: a } = U(e, i, t);
|
|
422
|
+
le.get(e.id)[i].attr("transform", `translate(${f}, ${a})`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
u(Q, "positionRenderedEdgeLabel");
|
|
426
|
+
var me = {
|
|
427
|
+
startLeft: "start_left",
|
|
428
|
+
startRight: "start_right",
|
|
429
|
+
endLeft: "end_left",
|
|
430
|
+
endRight: "end_right"
|
|
431
|
+
};
|
|
432
|
+
function U(e, n, t) {
|
|
433
|
+
const r = e.terminalLabelCenters?.[n];
|
|
434
|
+
if (r)
|
|
435
|
+
return { ...r };
|
|
436
|
+
if (!t)
|
|
437
|
+
return { x: e.x, y: e.y };
|
|
438
|
+
const s = n.startsWith("start") ? e.arrowTypeStart : e.arrowTypeEnd;
|
|
439
|
+
return de.calcTerminalLabelPosition(s ? 10 : 0, me[n], t);
|
|
440
|
+
}
|
|
441
|
+
u(U, "terminalLabelTranslate");
|
|
442
|
+
export {
|
|
443
|
+
Ce as a,
|
|
444
|
+
T as b,
|
|
445
|
+
we as c,
|
|
446
|
+
H as d,
|
|
447
|
+
l as e,
|
|
448
|
+
C as f,
|
|
449
|
+
B as i,
|
|
450
|
+
pe as s
|
|
451
|
+
};
|