@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,346 @@
|
|
|
1
|
+
import { I as W } from "./chunk-2Q5K7J3B-rT4eU6_y.js";
|
|
2
|
+
import { p as X } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
3
|
+
import { v as z, b as G, s as Y, x as P, g as F, a as Z, _ as g, Q as N, l as A, T as j, d as q, O as E, D as U, j as Q, af as J, R as K, ag as ee } from "./mermaid.core-yQghUlIz.js";
|
|
4
|
+
import { p as te } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
5
|
+
var D = /[─━│┃└┗├┣]/, L = /[└┗├┣]/, ne = /[─━]/, T = /^[\s│┃]+$/, V = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, $ = /^\s*%%/, re = " ";
|
|
6
|
+
function _(n) {
|
|
7
|
+
return n.some((t) => D.test(t));
|
|
8
|
+
}
|
|
9
|
+
g(_, "isBoxDrawingFormat");
|
|
10
|
+
function M(n) {
|
|
11
|
+
for (const t of n) {
|
|
12
|
+
const e = L.exec(t);
|
|
13
|
+
if (e?.index && e.index > 0)
|
|
14
|
+
return e.index;
|
|
15
|
+
}
|
|
16
|
+
return 4;
|
|
17
|
+
}
|
|
18
|
+
g(M, "inferSegmentWidth");
|
|
19
|
+
function S(n, t) {
|
|
20
|
+
return n.replace(/\bline\s+(\d+)\b/gi, (e, r) => {
|
|
21
|
+
const s = parseInt(r, 10), i = t.get(s);
|
|
22
|
+
return i ? `line ${i}` : e;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
g(S, "remapErrorLines");
|
|
26
|
+
function R(n) {
|
|
27
|
+
const t = n.split(`
|
|
28
|
+
`), e = /* @__PURE__ */ new Map();
|
|
29
|
+
let r = -1;
|
|
30
|
+
for (const [p, c] of t.entries())
|
|
31
|
+
if (c.trim() === "treeView-beta") {
|
|
32
|
+
r = p;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
if (r === -1)
|
|
36
|
+
return { text: n, lineMap: e };
|
|
37
|
+
const s = [];
|
|
38
|
+
for (let p = r + 1; p < t.length; p++) {
|
|
39
|
+
const c = t[p];
|
|
40
|
+
c.trim() === "" || $.test(c) || V.test(c) || T.test(c) || s.push(c.replace(/\t/g, " "));
|
|
41
|
+
}
|
|
42
|
+
if (!_(s))
|
|
43
|
+
return { text: n, lineMap: e };
|
|
44
|
+
const i = M(s), o = [];
|
|
45
|
+
let a = 0;
|
|
46
|
+
for (let p = 0; p <= r; p++)
|
|
47
|
+
o.push(t[p]), a++, e.set(a, p + 1);
|
|
48
|
+
for (let p = r + 1; p < t.length; p++) {
|
|
49
|
+
const c = t[p], d = c.trim(), h = p + 1;
|
|
50
|
+
if (d === "") {
|
|
51
|
+
o.push(c), a++, e.set(a, h);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if ($.test(c)) {
|
|
55
|
+
o.push(c), a++, e.set(a, h);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (V.test(c)) {
|
|
59
|
+
o.push(c), a++, e.set(a, h);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (T.test(c))
|
|
63
|
+
continue;
|
|
64
|
+
const l = c.replace(/\t/g, " "), w = L.exec(l);
|
|
65
|
+
if (w?.index !== void 0) {
|
|
66
|
+
const f = w.index, m = Math.round(f / i) + 1;
|
|
67
|
+
let u = f + 1;
|
|
68
|
+
for (; u < l.length && ne.test(l[u]); )
|
|
69
|
+
u++;
|
|
70
|
+
for (; u < l.length && l[u] === " "; )
|
|
71
|
+
u++;
|
|
72
|
+
const v = l.slice(u).trimEnd();
|
|
73
|
+
if (!v)
|
|
74
|
+
throw new Error(
|
|
75
|
+
`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`
|
|
76
|
+
);
|
|
77
|
+
const O = re.repeat(m);
|
|
78
|
+
o.push(O + v), a++, e.set(a, h);
|
|
79
|
+
} else {
|
|
80
|
+
if (/^[\s─━│┃└┗├┣]+$/.test(l))
|
|
81
|
+
continue;
|
|
82
|
+
if (D.test(l))
|
|
83
|
+
o.push(c), a++, e.set(a, h);
|
|
84
|
+
else {
|
|
85
|
+
if (/^\s+/.test(l))
|
|
86
|
+
throw new Error(
|
|
87
|
+
`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`
|
|
88
|
+
);
|
|
89
|
+
o.push(c), a++, e.set(a, h);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return { text: o.join(`
|
|
94
|
+
`), lineMap: e };
|
|
95
|
+
}
|
|
96
|
+
g(R, "preprocessBoxDrawing");
|
|
97
|
+
var x = new W(() => ({
|
|
98
|
+
cnt: 1,
|
|
99
|
+
stack: [
|
|
100
|
+
{
|
|
101
|
+
id: 0,
|
|
102
|
+
level: -1,
|
|
103
|
+
name: "/",
|
|
104
|
+
nodeType: "directory",
|
|
105
|
+
children: []
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
})), ie = /* @__PURE__ */ g(() => {
|
|
109
|
+
x.reset(), U();
|
|
110
|
+
}, "clear"), oe = /* @__PURE__ */ g(() => x.records.stack[0], "getRoot"), se = /* @__PURE__ */ g(() => x.records.cnt, "getCount"), ae = K.treeView, ce = /* @__PURE__ */ g(() => N(ae, E().treeView), "getConfig"), le = /* @__PURE__ */ g((n, t, e, r, s, i) => {
|
|
111
|
+
for (; n <= x.records.stack[x.records.stack.length - 1].level; )
|
|
112
|
+
x.records.stack.pop();
|
|
113
|
+
const o = {
|
|
114
|
+
id: x.records.cnt++,
|
|
115
|
+
level: n,
|
|
116
|
+
name: t,
|
|
117
|
+
nodeType: e,
|
|
118
|
+
icon: s,
|
|
119
|
+
cssClass: r,
|
|
120
|
+
description: i,
|
|
121
|
+
children: []
|
|
122
|
+
};
|
|
123
|
+
x.records.stack[x.records.stack.length - 1].children.push(o), x.records.stack.push(o);
|
|
124
|
+
}, "addNode"), de = {
|
|
125
|
+
clear: ie,
|
|
126
|
+
addNode: le,
|
|
127
|
+
getRoot: oe,
|
|
128
|
+
getCount: se,
|
|
129
|
+
getConfig: ce,
|
|
130
|
+
getAccTitle: Z,
|
|
131
|
+
getAccDescription: F,
|
|
132
|
+
getDiagramTitle: P,
|
|
133
|
+
setAccDescription: Y,
|
|
134
|
+
setAccTitle: G,
|
|
135
|
+
setDiagramTitle: z
|
|
136
|
+
}, I = de, he = /* @__PURE__ */ g((n) => {
|
|
137
|
+
X(n, I);
|
|
138
|
+
for (const t of n.nodes) {
|
|
139
|
+
const e = typeof t.indent == "number" ? t.indent : 0;
|
|
140
|
+
let r = t.name;
|
|
141
|
+
const s = r.endsWith("/");
|
|
142
|
+
s && (r = r.slice(0, -1));
|
|
143
|
+
const i = s ? "directory" : "file", o = t.classAnnotation || void 0, a = t.iconAnnotation, p = a !== void 0 ? a || "none" : void 0, c = t.descAnnotation || void 0, d = c ? Q(c, E()) : void 0;
|
|
144
|
+
I.addNode(e, r, i, o, p, d);
|
|
145
|
+
}
|
|
146
|
+
}, "populate"), pe = {
|
|
147
|
+
parse: /* @__PURE__ */ g(async (n) => {
|
|
148
|
+
const { text: t, lineMap: e } = R(n);
|
|
149
|
+
try {
|
|
150
|
+
const r = await te("treeView", t);
|
|
151
|
+
A.debug(r), he(r);
|
|
152
|
+
} catch (r) {
|
|
153
|
+
throw e.size > 0 && r instanceof Error && (r.message = S(r.message, e)), r;
|
|
154
|
+
}
|
|
155
|
+
}, "parse")
|
|
156
|
+
}, b = {
|
|
157
|
+
prefix: "mermaid-treeview",
|
|
158
|
+
height: 24,
|
|
159
|
+
width: 24,
|
|
160
|
+
icons: {
|
|
161
|
+
folder: {
|
|
162
|
+
body: '<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'
|
|
163
|
+
},
|
|
164
|
+
file: {
|
|
165
|
+
body: '<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
function H(n, t) {
|
|
170
|
+
const e = t?.filenameIcons?.[n];
|
|
171
|
+
if (e)
|
|
172
|
+
return e;
|
|
173
|
+
const r = n.lastIndexOf(".");
|
|
174
|
+
if (r > 0) {
|
|
175
|
+
const s = n.substring(r).toLowerCase(), i = t?.extensionIcons;
|
|
176
|
+
return i?.[s] ?? i?.[s.slice(1)];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
g(H, "detectIcon");
|
|
180
|
+
function C(n, t) {
|
|
181
|
+
return n.includes(":") ? n : n in b.icons || !t ? `${b.prefix}:${n}` : `${t}:${n}`;
|
|
182
|
+
}
|
|
183
|
+
g(C, "qualifyIcon");
|
|
184
|
+
function B(n, t) {
|
|
185
|
+
if (n.icon !== "none") {
|
|
186
|
+
if (n.icon)
|
|
187
|
+
return C(n.icon, t.defaultIconPack);
|
|
188
|
+
if (t.showIcons) {
|
|
189
|
+
if (n.nodeType === "file") {
|
|
190
|
+
const e = H(n.name, t);
|
|
191
|
+
if (e === "none")
|
|
192
|
+
return;
|
|
193
|
+
if (e)
|
|
194
|
+
return C(e, t.defaultIconPack);
|
|
195
|
+
}
|
|
196
|
+
return `${b.prefix}:${n.nodeType === "directory" ? "folder" : "file"}`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
g(B, "getNodeIcon");
|
|
201
|
+
ee([
|
|
202
|
+
{
|
|
203
|
+
name: b.prefix,
|
|
204
|
+
icons: b
|
|
205
|
+
}
|
|
206
|
+
]);
|
|
207
|
+
var y = 14, ge = 4, fe = 16, ue = /* @__PURE__ */ g(async (n, t) => {
|
|
208
|
+
const e = [], r = /* @__PURE__ */ g((i) => {
|
|
209
|
+
const o = B(i, t);
|
|
210
|
+
o && e.push({ icon: o, node: i }), i.children.forEach(r);
|
|
211
|
+
}, "collect");
|
|
212
|
+
r(n);
|
|
213
|
+
const s = await Promise.all(
|
|
214
|
+
e.map(async ({ icon: i, node: o }) => ({
|
|
215
|
+
id: o.id,
|
|
216
|
+
svg: await J(i, {
|
|
217
|
+
height: y,
|
|
218
|
+
width: y
|
|
219
|
+
})
|
|
220
|
+
}))
|
|
221
|
+
);
|
|
222
|
+
return new Map(s.map(({ id: i, svg: o }) => [i, o]));
|
|
223
|
+
}, "resolveNodeIcons"), we = /* @__PURE__ */ g((n, t, e, r, s, i) => {
|
|
224
|
+
const o = r.append("g");
|
|
225
|
+
let a = "treeView-node-label";
|
|
226
|
+
e.nodeType === "directory" && (a += " treeView-node-dir"), e.cssClass && (a += ` ${e.cssClass}`);
|
|
227
|
+
const p = y + ge, c = B(e, s), d = c !== void 0;
|
|
228
|
+
c && o.append("g").attr("class", "treeView-node-icon").attr("transform", `translate(${n + s.paddingX}, ${t + s.paddingY})`).html(i.get(e.id) ?? "");
|
|
229
|
+
const h = o.append("text").text(e.name).attr("dominant-baseline", "middle").attr("class", a), { height: l, width: w } = h.node().getBBox(), f = l + s.paddingY * 2, m = n + s.paddingX + (d ? p : 0);
|
|
230
|
+
h.attr("x", m), h.attr("y", t + f / 2);
|
|
231
|
+
const u = m + w, v = w + s.paddingX * 2 + (d ? p : 0);
|
|
232
|
+
return e.BBox = { x: n, y: t, width: v, height: f }, e.cssClass?.split(/\s+/).includes("highlight") && o.insert("rect", ":first-child").attr("x", n).attr("y", t + 1).attr("width", 0).attr("height", f - 2).attr("rx", 3).attr("class", "treeView-highlight-bg"), { node: e, nodeGroup: o, labelRightEdge: u, centerY: t + f / 2 };
|
|
233
|
+
}, "positionLabel"), k = /* @__PURE__ */ g((n, t, e, r, s, i) => n.append("line").attr("x1", t).attr("y1", e).attr("x2", r).attr("y2", s).attr("stroke-width", i).attr("class", "treeView-node-line"), "positionLine"), me = /* @__PURE__ */ g((n, t, e, r) => {
|
|
234
|
+
let s = 0, i = 0;
|
|
235
|
+
const o = [], a = /* @__PURE__ */ g((d, h, l, w) => {
|
|
236
|
+
const f = w * (l.rowIndent + l.paddingX), m = we(f, s, h, d, l, r);
|
|
237
|
+
o.push(m);
|
|
238
|
+
const { height: u, width: v } = h.BBox;
|
|
239
|
+
k(
|
|
240
|
+
d,
|
|
241
|
+
f - l.rowIndent,
|
|
242
|
+
s + u / 2,
|
|
243
|
+
f,
|
|
244
|
+
s + u / 2,
|
|
245
|
+
l.lineThickness
|
|
246
|
+
), i = Math.max(i, f + v), s += u;
|
|
247
|
+
}, "drawNode"), p = /* @__PURE__ */ g((d, h = 0) => {
|
|
248
|
+
a(n, d, e, h), d.children.forEach((m) => {
|
|
249
|
+
p(m, h + 1);
|
|
250
|
+
});
|
|
251
|
+
const { x: l, y: w, height: f } = d.BBox;
|
|
252
|
+
if (d.children.length) {
|
|
253
|
+
const { y: m, height: u } = d.children[d.children.length - 1].BBox;
|
|
254
|
+
k(
|
|
255
|
+
n,
|
|
256
|
+
l + e.paddingX,
|
|
257
|
+
w + f,
|
|
258
|
+
l + e.paddingX,
|
|
259
|
+
m + u / 2 + e.lineThickness / 2,
|
|
260
|
+
e.lineThickness
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
}, "processNode");
|
|
264
|
+
p(t);
|
|
265
|
+
const c = o.filter((d) => d.node.description);
|
|
266
|
+
if (c.length > 0) {
|
|
267
|
+
const h = Math.max(...o.map((l) => l.labelRightEdge)) + fe;
|
|
268
|
+
for (const l of c) {
|
|
269
|
+
const f = l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", h).attr("y", l.centerY).node().getBBox();
|
|
270
|
+
i = Math.max(i, h + f.width + e.paddingX);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
for (const d of o)
|
|
274
|
+
if (d.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
275
|
+
const h = d.nodeGroup.select(".treeView-highlight-bg");
|
|
276
|
+
if (!h.empty()) {
|
|
277
|
+
const l = i - d.node.BBox.x + 8;
|
|
278
|
+
h.attr("width", l), i = Math.max(i, d.node.BBox.x + l + 2);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return { totalHeight: s, totalWidth: i };
|
|
282
|
+
}, "drawTree"), xe = /* @__PURE__ */ g(async (n, t, e, r) => {
|
|
283
|
+
A.debug(`Rendering treeView diagram
|
|
284
|
+
` + n);
|
|
285
|
+
const s = r.db, i = s.getRoot(), o = s.getConfig(), a = j(t), p = a.append("g");
|
|
286
|
+
p.attr("class", "tree-view");
|
|
287
|
+
const c = await ue(i, o), { totalHeight: d, totalWidth: h } = me(p, i, o, c);
|
|
288
|
+
a.attr("viewBox", `-${o.lineThickness / 2} 0 ${h} ${d}`), q(a, d, h, o.useMaxWidth);
|
|
289
|
+
}, "draw"), ve = {
|
|
290
|
+
draw: xe
|
|
291
|
+
}, be = ve, Ie = {
|
|
292
|
+
labelFontSize: "16px",
|
|
293
|
+
labelColor: "black",
|
|
294
|
+
lineColor: "black",
|
|
295
|
+
iconColor: "#546e7a",
|
|
296
|
+
descriptionColor: "#6a9955",
|
|
297
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
298
|
+
highlightStroke: "#ffc107"
|
|
299
|
+
}, Ce = /* @__PURE__ */ g(({
|
|
300
|
+
treeView: n
|
|
301
|
+
}) => {
|
|
302
|
+
const {
|
|
303
|
+
labelFontSize: t,
|
|
304
|
+
labelColor: e,
|
|
305
|
+
lineColor: r,
|
|
306
|
+
iconColor: s,
|
|
307
|
+
descriptionColor: i,
|
|
308
|
+
highlightBg: o,
|
|
309
|
+
highlightStroke: a
|
|
310
|
+
} = N(Ie, n);
|
|
311
|
+
return `
|
|
312
|
+
.treeView-node-label {
|
|
313
|
+
font-size: ${t};
|
|
314
|
+
fill: ${e};
|
|
315
|
+
white-space: pre;
|
|
316
|
+
}
|
|
317
|
+
.treeView-node-dir {
|
|
318
|
+
font-weight: bold;
|
|
319
|
+
}
|
|
320
|
+
.treeView-node-line {
|
|
321
|
+
stroke: ${r};
|
|
322
|
+
}
|
|
323
|
+
.treeView-node-icon {
|
|
324
|
+
color: ${s};
|
|
325
|
+
}
|
|
326
|
+
.treeView-node-description {
|
|
327
|
+
font-size: ${t};
|
|
328
|
+
fill: ${i};
|
|
329
|
+
font-style: italic;
|
|
330
|
+
white-space: pre;
|
|
331
|
+
}
|
|
332
|
+
.treeView-highlight-bg {
|
|
333
|
+
fill: ${o};
|
|
334
|
+
stroke: ${a};
|
|
335
|
+
stroke-width: 1;
|
|
336
|
+
}
|
|
337
|
+
`;
|
|
338
|
+
}, "styles"), ye = Ce, ke = {
|
|
339
|
+
db: I,
|
|
340
|
+
renderer: be,
|
|
341
|
+
parser: pe,
|
|
342
|
+
styles: ye
|
|
343
|
+
};
|
|
344
|
+
export {
|
|
345
|
+
ke as diagram
|
|
346
|
+
};
|