@qwen-code/web-shell 0.27.1 → 0.27.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/NOTICES.txt +10721 -958
- package/dist/{PierreFilePreview-BT_JRIvF.js → PierreFilePreview-CVi_Wsf-.js} +1 -1
- package/dist/SpreadsheetPreview-CTyYrLmD.js +379 -0
- package/dist/{WorkspaceFileBrowser-G1yA2eBf.js → WorkspaceFileBrowser-DkQgnDFv.js} +2 -2
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/abnfDiagram-VCTEODGH-CQWhk3bg.js +87 -0
- package/dist/abnfDiagram-VCTEODGH-DXK3iWaN.js +87 -0
- package/dist/{agents-route-bkxyBAkN.js → agents-route-ZD8W2lTb.js} +2 -2
- package/dist/arc-BcP3aO-G.js +83 -0
- package/dist/arc-DkZAOzaU.js +83 -0
- package/dist/architectureDiagram-5GKGNRK7-DhcVEkLQ.js +4775 -0
- package/dist/architectureDiagram-5GKGNRK7-DusU8ybk.js +4776 -0
- package/dist/blockDiagram-NRAW4CY4-BMOuo5wl.js +1414 -0
- package/dist/blockDiagram-NRAW4CY4-YciA8-8I.js +1414 -0
- package/dist/c4Diagram-UCG6FXSJ-BJxpHO4v.js +1508 -0
- package/dist/c4Diagram-UCG6FXSJ-DNpq-cdF.js +1508 -0
- package/dist/channel-CfhQTpjX.js +5 -0
- package/dist/channel-QZAYPfF8.js +5 -0
- package/dist/chunk-2Q5K7J3B-EGbMOnEe.js +15 -0
- package/dist/chunk-2Q5K7J3B-mtpkChaF.js +15 -0
- package/dist/chunk-5VM5RSS4-CP4Q2W8n.js +19 -0
- package/dist/chunk-5VM5RSS4-CucJ3wyB.js +19 -0
- package/dist/chunk-F27PBJKO-CS9kzvAx.js +68 -0
- package/dist/chunk-F27PBJKO-Cfw_29T-.js +68 -0
- package/dist/chunk-G27WJ6UU-BZzmQ8FW.js +1408 -0
- package/dist/chunk-G27WJ6UU-DdeEiwmL.js +1408 -0
- package/dist/chunk-JWPE2WC7-BL_hjRLf.js +8 -0
- package/dist/chunk-JWPE2WC7-C03UDQBx.js +8 -0
- package/dist/chunk-LCL6LL3I-CNn3XyuL.js +1533 -0
- package/dist/chunk-LCL6LL3I-CR-IGGIM.js +1533 -0
- package/dist/chunk-POPQ4Y6H-BVQbxVHz.js +19 -0
- package/dist/chunk-POPQ4Y6H-UJK1fYGP.js +19 -0
- package/dist/chunk-SVP7TREG-B-E-xFG8.js +664 -0
- package/dist/chunk-SVP7TREG-BUmyTmov.js +664 -0
- package/dist/chunk-XXDRQBXY-BDcf4DQz.js +8 -0
- package/dist/chunk-XXDRQBXY-BHAq0mtL.js +8 -0
- package/dist/classDiagram-DTDB5LWJ-CVA3J-EH.js +16 -0
- package/dist/classDiagram-DTDB5LWJ-Dh121Rlt.js +16 -0
- package/dist/classDiagram-v2-JRS7N3AN-CVA3J-EH.js +16 -0
- package/dist/classDiagram-v2-JRS7N3AN-Dh121Rlt.js +16 -0
- package/dist/cose-bilkent-JH36ORCC-CLe0kcHa.js +2605 -0
- package/dist/cose-bilkent-JH36ORCC-DpMM48hA.js +2606 -0
- package/dist/cynefin-OW5HDTMX-CyO3b088.js +23750 -0
- package/dist/cynefinDiagram-5FMLGOSQ-C5xaWeuA.js +299 -0
- package/dist/cynefinDiagram-5FMLGOSQ-mLaK-3R3.js +299 -0
- package/dist/cytoscape.esm-DCrf4dL8.js +18782 -0
- package/dist/daemon-react-sdk.js +1 -1
- package/dist/dagre-3AP2YEHR-CmNFrtW9.js +456 -0
- package/dist/dagre-3AP2YEHR-zDm3fBQq.js +456 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-S7CK7UJ4-BQtgRcGU.js +346 -0
- package/dist/diagram-S7CK7UJ4-Clojnf04.js +346 -0
- package/dist/diagram-UQ7AKVKN-B3Ll3rB4.js +219 -0
- package/dist/diagram-UQ7AKVKN-CTn4O0fd.js +219 -0
- package/dist/diagram-VSXAHHWV-BeYXDVEh.js +463 -0
- package/dist/diagram-VSXAHHWV-mdxkNEZP.js +463 -0
- package/dist/diagram-VX7I27RA-C3bzQYLd.js +529 -0
- package/dist/diagram-VX7I27RA-DaPLIQOr.js +529 -0
- package/dist/diagram-Z3DM3KII-BImvaL3c.js +142 -0
- package/dist/diagram-Z3DM3KII-CkkdGhWO.js +142 -0
- package/dist/{docx-preview-BucJeYCm.js → docx-preview-BfV4m8Qp.js} +503 -506
- package/dist/ebnfDiagram-PWID7BFC-C8RUggbp.js +109 -0
- package/dist/ebnfDiagram-PWID7BFC-gJHJx-lt.js +109 -0
- package/dist/erDiagram-SSCWMZ5O-CKFzjLCd.js +1059 -0
- package/dist/erDiagram-SSCWMZ5O-DLJjXFG9.js +1059 -0
- package/dist/flowDiagram-A5DVABFB-BHAeEzG1.js +1689 -0
- package/dist/flowDiagram-A5DVABFB-BOdsfJ-4.js +1689 -0
- package/dist/ganttDiagram-EL5Y4UJY-CtL6LAbW.js +2703 -0
- package/dist/ganttDiagram-EL5Y4UJY-D0hNphpF.js +2704 -0
- package/dist/gitGraphDiagram-WWUBYQGX-8XcPnT4w.js +815 -0
- package/dist/gitGraphDiagram-WWUBYQGX-DxHtQ0ba.js +815 -0
- package/dist/{index-B6wNHUaX.js → index-BGsppGgG.js} +69284 -64504
- package/dist/index.js +3 -3
- package/dist/infoDiagram-RXCK75RN-B-Ds06LN.js +24 -0
- package/dist/infoDiagram-RXCK75RN-Dhirg4if.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-5VMMS53U-BJPKneVd.js +621 -0
- package/dist/ishikawaDiagram-5VMMS53U-CsttzTkq.js +621 -0
- package/dist/journeyDiagram-EYS64GPL-BBAEhOQ9.js +836 -0
- package/dist/journeyDiagram-EYS64GPL-DfXS6tI_.js +836 -0
- package/dist/kanban-definition-3QL26DDD-Bh1Jz01C.js +723 -0
- package/dist/kanban-definition-3QL26DDD-C8yOTG02.js +723 -0
- package/dist/layout-Dxab-q-T.js +1704 -0
- package/dist/layout-sTbo9v3C.js +1704 -0
- package/dist/linear-BhTDfwHZ.js +259 -0
- package/dist/linear-CjDL9r_e.js +259 -0
- package/dist/mermaid.core-CFV16zMl.js +19742 -0
- package/dist/mermaid.core-DBp8atac.js +19747 -0
- package/dist/mindmap-definition-FBJOCRG2-KPo1Z4it.js +826 -0
- package/dist/mindmap-definition-FBJOCRG2-vau9OLMK.js +826 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pegDiagram-XKGWAZYB-CFjH6RoO.js +95 -0
- package/dist/pegDiagram-XKGWAZYB-EeXt14MX.js +95 -0
- package/dist/pieDiagram-E7YTZNPT-CJa9GbCV.js +208 -0
- package/dist/pieDiagram-E7YTZNPT-JyO_8fWF.js +208 -0
- package/dist/quadrantDiagram-AXDQQJYC-B7tyPD89.js +1023 -0
- package/dist/quadrantDiagram-AXDQQJYC-G9wAekw0.js +1023 -0
- package/dist/railroadDiagram-O6MQD6OU-3-cuTnqH.js +77 -0
- package/dist/railroadDiagram-O6MQD6OU-SyM4QCMp.js +77 -0
- package/dist/requirementDiagram-EFPCY7ZU-BJal3W63.js +882 -0
- package/dist/requirementDiagram-EFPCY7ZU-bMW72Av_.js +882 -0
- package/dist/sankeyDiagram-P5KCCOFB-BKP8fccK.js +847 -0
- package/dist/sankeyDiagram-P5KCCOFB-C4KDi8Ty.js +847 -0
- package/dist/sequenceDiagram-WJ2MYXX4-DFvbPjPG.js +2888 -0
- package/dist/sequenceDiagram-WJ2MYXX4-DvgRoXFL.js +2888 -0
- package/dist/sizeCapture-X5ZJPWSS-DPkvpCxM.js +46 -0
- package/dist/sizeCapture-X5ZJPWSS-DU4nf5aV.js +46 -0
- package/dist/stateDiagram-HBIQ2CUA-CWp0mOcF.js +262 -0
- package/dist/stateDiagram-HBIQ2CUA-DkN3hNFV.js +262 -0
- package/dist/stateDiagram-v2-4QOOHH4V-Bh7H2ZBJ.js +16 -0
- package/dist/stateDiagram-v2-4QOOHH4V-DX-OvV9U.js +16 -0
- package/dist/sw.js +1 -1
- package/dist/swimlanes-XN3QIQJK-2s4fbN8J.js +5219 -0
- package/dist/swimlanes-XN3QIQJK-CI3ENZQA.js +5219 -0
- package/dist/swimlanesDiagram-VK2B7HYN-BEjeqDmx.js +13 -0
- package/dist/swimlanesDiagram-VK2B7HYN-DWJY6BGD.js +13 -0
- package/dist/timeline-definition-24CTP7MA-C_tZHri9.js +1057 -0
- package/dist/timeline-definition-24CTP7MA-DYXEracn.js +1057 -0
- package/dist/transcript.js +14564 -11549
- package/dist/types/App.d.ts +10 -1
- package/dist/types/components/ComposerUsageStats.d.ts +34 -0
- package/dist/types/components/WelcomeHeader.d.ts +8 -0
- package/dist/types/components/artifacts/tokenUsageTotals.d.ts +36 -0
- package/dist/types/components/channels/ChannelEditorDialog.d.ts +10 -1
- package/dist/types/components/channels/ChannelQrLogin.d.ts +13 -0
- package/dist/types/components/channels/WeixinLoginPanel.d.ts +17 -0
- package/dist/types/components/channels/channel-editor-state.d.ts +8 -1
- package/dist/types/components/channels/channel-platform.d.ts +2 -1
- package/dist/types/components/channels/weixin-auth-api.d.ts +32 -0
- package/dist/types/components/managed/ManagedRuntimeSkillsImporter.d.ts +10 -0
- package/dist/types/components/managed/ManagedSideQueryPanel.d.ts +5 -0
- package/dist/types/components/managed/WorkspaceBindingCreator.d.ts +26 -1
- package/dist/types/components/managed/generated/managed-agent-api.d.ts +605 -0
- package/dist/types/components/managed/java-managed-agent-client.d.ts +122 -1
- package/dist/types/components/managed/managed-agent-provider.d.ts +14 -1
- package/dist/types/components/managed/managed-diagnostics-messages.d.ts +14 -1
- package/dist/types/components/managed/managed-extension-install.d.ts +5 -2
- package/dist/types/components/managed/managed-extension-messages.d.ts +7 -0
- package/dist/types/components/managed/managed-extension-types.d.ts +4 -0
- package/dist/types/components/managed/managed-session-storage.d.ts +35 -0
- package/dist/types/components/managed/managed-side-query-command.d.ts +5 -0
- package/dist/types/components/managed/managed-side-query-types.d.ts +21 -0
- package/dist/types/components/managed/managed-side-query.test-fixtures.d.ts +3 -0
- package/dist/types/components/managed/use-managed-side-queries.d.ts +26 -0
- package/dist/types/customization.d.ts +31 -0
- package/dist/types/daemon/workspace/hooks/useDaemonChannels.d.ts +2 -1
- package/dist/types/daemon/workspace/types.d.ts +8 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/{useDaemonMidTurnInjected-tBzI77Ar.js → useDaemonMidTurnInjected-B7dPEdqk.js} +2040 -1825
- package/dist/vennDiagram-4TSXK5OY-Bi3e_aHN.js +1578 -0
- package/dist/vennDiagram-4TSXK5OY-DZCe1Ffi.js +1578 -0
- package/dist/wardleyDiagram-VM6X3IG4-BNV5jzew.js +675 -0
- package/dist/wardleyDiagram-VM6X3IG4-DqFJHRmt.js +675 -0
- package/dist/xychartDiagram-S5SC5T6Z-BVIJ86ch.js +1492 -0
- package/dist/xychartDiagram-S5SC5T6Z-J8xP-hcH.js +1492 -0
- package/package.json +19 -9
- package/dist/SpreadsheetPreview-d5XL70Ho.js +0 -379
- package/dist/types/components/artifacts/excel-preview-parser.d.ts +0 -5
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { I as X } from "./chunk-2Q5K7J3B-EGbMOnEe.js";
|
|
2
|
+
import { p as z } from "./chunk-JWPE2WC7-C03UDQBx.js";
|
|
3
|
+
import { n as O, b as G, s as Y, o as P, g as F, a as Z, _ as g, A as N, l as A, D as q, d as U, y as E, p as j, i as J, ak as K, B as Q, al as ee } from "./mermaid.core-DBp8atac.js";
|
|
4
|
+
import { p as te } from "./cynefin-OW5HDTMX-CyO3b088.js";
|
|
5
|
+
var D = /[─━│┃└┗├┣]/, L = /[└┗├┣]/, ne = /[─━]/, k = /^[\s│┃]+$/, T = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, V = /^\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() === "" || V.test(c) || T.test(c) || k.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 (V.test(c)) {
|
|
55
|
+
o.push(c), a++, e.set(a, h);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (T.test(c)) {
|
|
59
|
+
o.push(c), a++, e.set(a, h);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (k.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 W = re.repeat(m);
|
|
78
|
+
o.push(W + 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 X(() => ({
|
|
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(), j();
|
|
110
|
+
}, "clear"), oe = /* @__PURE__ */ g(() => x.records.stack[0], "getRoot"), se = /* @__PURE__ */ g(() => x.records.cnt, "getCount"), ae = Q.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: O
|
|
136
|
+
}, I = de, he = /* @__PURE__ */ g((n) => {
|
|
137
|
+
z(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 ? J(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 K(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"), $ = /* @__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
|
+
$(
|
|
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
|
+
$(
|
|
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 = q(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}`), U(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, $e = {
|
|
339
|
+
db: I,
|
|
340
|
+
renderer: be,
|
|
341
|
+
parser: pe,
|
|
342
|
+
styles: ye
|
|
343
|
+
};
|
|
344
|
+
export {
|
|
345
|
+
$e as diagram
|
|
346
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { I as X } from "./chunk-2Q5K7J3B-mtpkChaF.js";
|
|
2
|
+
import { p as z } from "./chunk-JWPE2WC7-BL_hjRLf.js";
|
|
3
|
+
import { p as O, b as G, s as Y, q as P, g as F, a as q, _ as g, D as N, l as A, G as Z, d as U, A as E, r as j, i as J, ak as K, E as Q, al as ee } from "./mermaid.core-CFV16zMl.js";
|
|
4
|
+
import { p as te } from "./cynefin-OW5HDTMX-CyO3b088.js";
|
|
5
|
+
var D = /[─━│┃└┗├┣]/, L = /[└┗├┣]/, ne = /[─━]/, k = /^[\s│┃]+$/, T = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, V = /^\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() === "" || V.test(c) || T.test(c) || k.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 (V.test(c)) {
|
|
55
|
+
o.push(c), a++, e.set(a, h);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (T.test(c)) {
|
|
59
|
+
o.push(c), a++, e.set(a, h);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (k.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 W = re.repeat(m);
|
|
78
|
+
o.push(W + 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 X(() => ({
|
|
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(), j();
|
|
110
|
+
}, "clear"), oe = /* @__PURE__ */ g(() => x.records.stack[0], "getRoot"), se = /* @__PURE__ */ g(() => x.records.cnt, "getCount"), ae = Q.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: q,
|
|
131
|
+
getAccDescription: F,
|
|
132
|
+
getDiagramTitle: P,
|
|
133
|
+
setAccDescription: Y,
|
|
134
|
+
setAccTitle: G,
|
|
135
|
+
setDiagramTitle: O
|
|
136
|
+
}, I = de, he = /* @__PURE__ */ g((n) => {
|
|
137
|
+
z(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 ? J(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 K(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"), $ = /* @__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
|
+
$(
|
|
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
|
+
$(
|
|
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 = Z(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}`), U(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, $e = {
|
|
339
|
+
db: I,
|
|
340
|
+
renderer: be,
|
|
341
|
+
parser: pe,
|
|
342
|
+
styles: ye
|
|
343
|
+
};
|
|
344
|
+
export {
|
|
345
|
+
$e as diagram
|
|
346
|
+
};
|