hexagon-editor 0.1.5 → 0.1.6
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 +24 -11
- package/dist/MarkdownEditor.vue.d.ts +28 -26
- package/dist/MarkdownEditor.vue.d.ts.map +1 -1
- package/dist/{MarkdownEditorLinkForm-C7CGgA83.js → MarkdownEditorLinkForm-B9dEX3WT.js} +1 -1
- package/dist/{base-Bnv2-Te4.js → base-BPdMUtQo.js} +141 -137
- package/dist/components/MarkdownEditorToolbar.vue.d.ts +4 -3
- package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -1
- package/dist/configure.d.ts +0 -2
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +11 -12
- package/dist/core/basic-editor-markdown.d.ts.map +1 -1
- package/dist/core/basic-editor-renderers.d.ts +6 -4
- package/dist/core/basic-editor-renderers.d.ts.map +1 -1
- package/dist/core/basic-editor-types.d.ts +2 -0
- package/dist/core/basic-editor-types.d.ts.map +1 -1
- package/dist/core/basic-editor.d.ts +1 -1
- package/dist/core/basic-editor.d.ts.map +1 -1
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core.js +28 -31
- package/dist/extensions.js +1 -1
- package/dist/forms/MarkdownEditorImageForm.vue.d.ts +2 -2
- package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -1
- package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +2 -2
- package/dist/forms/MarkdownEditorTextInput.vue.d.ts +2 -2
- package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/{full-C-o2lPBX.js → full-Da8esvj2.js} +1 -1
- package/dist/{full-specs-Cl-ODShc.js → full-specs-hXKoMF-0.js} +1 -1
- package/dist/index-D_CMntQU.js +3173 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3611 -1283
- package/dist/{markup-commands-B2NMfYHE.js → markup-commands-BYsx8ADT.js} +1989 -1963
- package/dist/presets.js +2 -2
- package/dist/public-types.d.ts +22 -0
- package/dist/public-types.d.ts.map +1 -1
- package/dist/renderer/MarkdownRenderer.vue.d.ts +2 -0
- package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -1
- package/dist/renderer/markdown.d.ts +2 -1
- package/dist/renderer/markdown.d.ts.map +1 -1
- package/dist/renderer.css +1 -1
- package/dist/renderer.js +142 -146
- package/package.json +106 -108
- package/dist/MarkdownEditorLinkForm.css +0 -1
- package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +0 -87
- package/dist/arc-y6UeoJpJ.js +0 -83
- package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +0 -4778
- package/dist/base.css +0 -1
- package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +0 -2419
- package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +0 -1577
- package/dist/channel-BwXGcavV.js +0 -5
- package/dist/chunk-2GRJ4B5K-O75udjPr.js +0 -68
- package/dist/chunk-2Q5K7J3B-CySL0lOA.js +0 -15
- package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +0 -1408
- package/dist/chunk-5VM5RSS4--it1VJIv.js +0 -19
- package/dist/chunk-6Q2QTUOP-DNiML-50.js +0 -664
- package/dist/chunk-GF5L2VYU-z7A-k0-V.js +0 -1533
- package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +0 -8
- package/dist/chunk-KBJHAD2P-D4R1VW0r.js +0 -19
- package/dist/chunk-RYQCIY6F-DmJAYxq8.js +0 -313
- package/dist/chunk-XXDRQBXY-CK913N-t.js +0 -8
- package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +0 -16
- package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +0 -16
- package/dist/core/optional-renderers.d.ts +0 -9
- package/dist/core/optional-renderers.d.ts.map +0 -1
- package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +0 -2608
- package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +0 -23766
- package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +0 -299
- package/dist/cytoscape.esm-3W4EOjxC.js +0 -18756
- package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +0 -340
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/diagram-7IWD3JNH-BrApu1hz.js +0 -350
- package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +0 -461
- package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +0 -142
- package/dist/diagram-Q27KOJAE-DWIltqIH.js +0 -528
- package/dist/diagram-UB23O5K3-B7z2Lj3K.js +0 -219
- package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +0 -109
- package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +0 -910
- package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +0 -1638
- package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +0 -2711
- package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +0 -815
- package/dist/graph-DAHC4kPm.js +0 -1545
- package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +0 -24
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +0 -621
- package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +0 -834
- package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +0 -724
- package/dist/katex-ByXcxnHy.js +0 -14436
- package/dist/katex-DoRnZ_sp.js +0 -11682
- package/dist/layout-DBbo_M5I.js +0 -1519
- package/dist/linear-BEdRfKba.js +0 -259
- package/dist/map-DRdzG8Ho.js +0 -224
- package/dist/markup-commands.css +0 -1
- package/dist/mermaid.core-CR0bA2Wa.js +0 -16496
- package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +0 -827
- package/dist/optional-renderers-BalvqqvY.js +0 -11
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +0 -95
- package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +0 -207
- package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +0 -1023
- package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +0 -77
- package/dist/renderer/mermaid-runtime.d.ts +0 -4
- package/dist/renderer/mermaid-runtime.d.ts.map +0 -1
- package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +0 -882
- package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +0 -847
- package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +0 -2888
- package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +0 -46
- package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +0 -263
- package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +0 -16
- package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +0 -5332
- package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +0 -13
- package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +0 -1055
- package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +0 -1578
- package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +0 -675
- package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +0 -1388
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { I as X } from "./chunk-2Q5K7J3B-CySL0lOA.js";
|
|
2
|
-
import { p as O } from "./chunk-JWPE2WC7-DAjx3Kjr.js";
|
|
3
|
-
import { n as G, b as Y, s as P, o as j, g as F, a as Z, _ as f, A, l as D, D as q, e as U, y as N, p as J, i as K, ai as Q, B as ee, aj as te } from "./mermaid.core-CR0bA2Wa.js";
|
|
4
|
-
import { p as ne } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
5
|
-
var E = /[─━│┃└┗├┣]/, S = /[└┗├┣]/, re = /[─━]/, V = /^[\s│┃]+$/, $ = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, k = /^\s*%%/, ie = " ";
|
|
6
|
-
function L(n) {
|
|
7
|
-
return n.some((e) => E.test(e));
|
|
8
|
-
}
|
|
9
|
-
f(L, "isBoxDrawingFormat");
|
|
10
|
-
function _(n) {
|
|
11
|
-
for (const e of n) {
|
|
12
|
-
const t = S.exec(e);
|
|
13
|
-
if (t?.index && t.index > 0)
|
|
14
|
-
return t.index;
|
|
15
|
-
}
|
|
16
|
-
return 4;
|
|
17
|
-
}
|
|
18
|
-
f(_, "inferSegmentWidth");
|
|
19
|
-
function M(n, e) {
|
|
20
|
-
return n.replace(/\bline\s+(\d+)\b/gi, (t, r) => {
|
|
21
|
-
const i = parseInt(r, 10), a = e.get(i);
|
|
22
|
-
return a ? `line ${a}` : t;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
f(M, "remapErrorLines");
|
|
26
|
-
function R(n) {
|
|
27
|
-
const e = n.split(`
|
|
28
|
-
`), t = /* @__PURE__ */ new Map();
|
|
29
|
-
let r = -1;
|
|
30
|
-
for (const [s, o] of e.entries())
|
|
31
|
-
if (o.trim() === "treeView-beta") {
|
|
32
|
-
r = s;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
if (r === -1)
|
|
36
|
-
return { text: n, lineMap: t };
|
|
37
|
-
const i = [];
|
|
38
|
-
for (let s = r + 1; s < e.length; s++) {
|
|
39
|
-
const o = e[s];
|
|
40
|
-
o.trim() === "" || k.test(o) || $.test(o) || V.test(o) || i.push(o.replace(/\t/g, " "));
|
|
41
|
-
}
|
|
42
|
-
if (!L(i))
|
|
43
|
-
return { text: n, lineMap: t };
|
|
44
|
-
const a = _(i), c = [];
|
|
45
|
-
let l = 0;
|
|
46
|
-
for (let s = 0; s <= r; s++)
|
|
47
|
-
c.push(e[s]), l++, t.set(l, s + 1);
|
|
48
|
-
for (let s = r + 1; s < e.length; s++) {
|
|
49
|
-
const o = e[s], h = o.trim(), p = s + 1;
|
|
50
|
-
if (h === "") {
|
|
51
|
-
c.push(o), l++, t.set(l, p);
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (k.test(o)) {
|
|
55
|
-
c.push(o), l++, t.set(l, p);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if ($.test(o)) {
|
|
59
|
-
c.push(o), l++, t.set(l, p);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
if (V.test(o))
|
|
63
|
-
continue;
|
|
64
|
-
const d = o.replace(/\t/g, " "), w = S.exec(d);
|
|
65
|
-
if (w?.index !== void 0) {
|
|
66
|
-
const g = w.index, m = Math.round(g / a) + 1;
|
|
67
|
-
let u = g + 1;
|
|
68
|
-
for (; u < d.length && re.test(d[u]); )
|
|
69
|
-
u++;
|
|
70
|
-
for (; u < d.length && d[u] === " "; )
|
|
71
|
-
u++;
|
|
72
|
-
const v = d.slice(u).trimEnd();
|
|
73
|
-
if (!v)
|
|
74
|
-
throw new Error(
|
|
75
|
-
`Line ${p}: Empty node — expected a filename or directory name after the box-drawing prefix`
|
|
76
|
-
);
|
|
77
|
-
const W = ie.repeat(m);
|
|
78
|
-
c.push(W + v), l++, t.set(l, p);
|
|
79
|
-
} else {
|
|
80
|
-
if (/^[\s─━│┃└┗├┣]+$/.test(d))
|
|
81
|
-
continue;
|
|
82
|
-
if (E.test(d))
|
|
83
|
-
c.push(o), l++, t.set(l, p);
|
|
84
|
-
else {
|
|
85
|
-
if (/^\s+/.test(d))
|
|
86
|
-
throw new Error(
|
|
87
|
-
`Line ${p}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`
|
|
88
|
-
);
|
|
89
|
-
c.push(o), l++, t.set(l, p);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return { text: c.join(`
|
|
94
|
-
`), lineMap: t };
|
|
95
|
-
}
|
|
96
|
-
f(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
|
-
})), oe = /* @__PURE__ */ f(() => {
|
|
109
|
-
x.reset(), J();
|
|
110
|
-
}, "clear"), se = /* @__PURE__ */ f(() => x.records.stack[0], "getRoot"), ae = /* @__PURE__ */ f(() => x.records.cnt, "getCount"), ce = ee.treeView, le = /* @__PURE__ */ f(() => A(ce, N().treeView), "getConfig"), de = /* @__PURE__ */ f((n, e, t, r, i, a) => {
|
|
111
|
-
for (; n <= x.records.stack[x.records.stack.length - 1].level; )
|
|
112
|
-
x.records.stack.pop();
|
|
113
|
-
const c = {
|
|
114
|
-
id: x.records.cnt++,
|
|
115
|
-
level: n,
|
|
116
|
-
name: e,
|
|
117
|
-
nodeType: t,
|
|
118
|
-
icon: i,
|
|
119
|
-
cssClass: r,
|
|
120
|
-
description: a,
|
|
121
|
-
children: []
|
|
122
|
-
};
|
|
123
|
-
x.records.stack[x.records.stack.length - 1].children.push(c), x.records.stack.push(c);
|
|
124
|
-
}, "addNode"), he = {
|
|
125
|
-
clear: oe,
|
|
126
|
-
addNode: de,
|
|
127
|
-
getRoot: se,
|
|
128
|
-
getCount: ae,
|
|
129
|
-
getConfig: le,
|
|
130
|
-
getAccTitle: Z,
|
|
131
|
-
getAccDescription: F,
|
|
132
|
-
getDiagramTitle: j,
|
|
133
|
-
setAccDescription: P,
|
|
134
|
-
setAccTitle: Y,
|
|
135
|
-
setDiagramTitle: G
|
|
136
|
-
}, I = he, pe = /* @__PURE__ */ f((n) => {
|
|
137
|
-
O(n, I);
|
|
138
|
-
for (const e of n.nodes) {
|
|
139
|
-
const t = typeof e.indent == "number" ? e.indent : 0;
|
|
140
|
-
let r = e.name;
|
|
141
|
-
const i = r.endsWith("/");
|
|
142
|
-
i && (r = r.slice(0, -1));
|
|
143
|
-
const a = i ? "directory" : "file", c = e.classAnnotation || void 0, l = e.iconAnnotation, s = l !== void 0 ? l || "none" : void 0, o = e.descAnnotation || void 0, h = o ? K(o, N()) : void 0;
|
|
144
|
-
I.addNode(t, r, a, c, s, h);
|
|
145
|
-
}
|
|
146
|
-
}, "populate"), fe = {
|
|
147
|
-
parse: /* @__PURE__ */ f(async (n) => {
|
|
148
|
-
const { text: e, lineMap: t } = R(n);
|
|
149
|
-
try {
|
|
150
|
-
const r = await ne("treeView", e);
|
|
151
|
-
D.debug(r), pe(r);
|
|
152
|
-
} catch (r) {
|
|
153
|
-
throw t.size > 0 && r instanceof Error && (r.message = M(r.message, t)), 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, e) {
|
|
170
|
-
const t = e?.filenameIcons?.[n];
|
|
171
|
-
if (t)
|
|
172
|
-
return t;
|
|
173
|
-
const r = n.lastIndexOf(".");
|
|
174
|
-
if (r > 0) {
|
|
175
|
-
const i = n.substring(r).toLowerCase(), a = e?.extensionIcons;
|
|
176
|
-
return a?.[i] ?? a?.[i.slice(1)];
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
f(H, "detectIcon");
|
|
180
|
-
function C(n, e) {
|
|
181
|
-
return n.includes(":") ? n : n in b.icons || !e ? `${b.prefix}:${n}` : `${e}:${n}`;
|
|
182
|
-
}
|
|
183
|
-
f(C, "qualifyIcon");
|
|
184
|
-
function B(n, e) {
|
|
185
|
-
if (n.icon !== "none") {
|
|
186
|
-
if (n.icon)
|
|
187
|
-
return C(n.icon, e.defaultIconPack);
|
|
188
|
-
if (e.showIcons) {
|
|
189
|
-
if (n.nodeType === "file") {
|
|
190
|
-
const t = H(n.name, e);
|
|
191
|
-
if (t === "none")
|
|
192
|
-
return;
|
|
193
|
-
if (t)
|
|
194
|
-
return C(t, e.defaultIconPack);
|
|
195
|
-
}
|
|
196
|
-
return `${b.prefix}:${n.nodeType === "directory" ? "folder" : "file"}`;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
f(B, "getNodeIcon");
|
|
201
|
-
te([
|
|
202
|
-
{
|
|
203
|
-
name: b.prefix,
|
|
204
|
-
icons: b
|
|
205
|
-
}
|
|
206
|
-
]);
|
|
207
|
-
var y = 14, ge = 4, ue = 16, z = /* @__PURE__ */ f((n, e) => `tv-icon-${n}-${e.replace(/[^\w-]/g, "-")}`, "iconSymbolId"), we = /* @__PURE__ */ f(async (n, e, t, r) => {
|
|
208
|
-
const i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ f((s) => {
|
|
209
|
-
const o = B(s, t);
|
|
210
|
-
o && i.add(o), s.children.forEach(a);
|
|
211
|
-
}, "collect");
|
|
212
|
-
if (a(e), i.size === 0)
|
|
213
|
-
return;
|
|
214
|
-
const c = await Promise.all(
|
|
215
|
-
[...i].map(async (s) => ({
|
|
216
|
-
icon: s,
|
|
217
|
-
svg: await Q(s, {
|
|
218
|
-
height: y,
|
|
219
|
-
width: y
|
|
220
|
-
})
|
|
221
|
-
}))
|
|
222
|
-
), l = n.append("defs");
|
|
223
|
-
for (const { icon: s, svg: o } of c)
|
|
224
|
-
l.append("g").attr("id", z(r, s)).html(o);
|
|
225
|
-
}, "injectIconDefs"), me = /* @__PURE__ */ f((n, e, t, r, i, a) => {
|
|
226
|
-
const c = r.append("g");
|
|
227
|
-
let l = "treeView-node-label";
|
|
228
|
-
t.nodeType === "directory" && (l += " treeView-node-dir"), t.cssClass && (l += ` ${t.cssClass}`);
|
|
229
|
-
const s = y + ge, o = B(t, i), h = o !== void 0;
|
|
230
|
-
o && c.append("use").attr("xlink:href", `#${z(a, o)}`).attr("x", n + i.paddingX).attr("y", e + i.paddingY).attr("class", "treeView-node-icon");
|
|
231
|
-
const p = c.append("text").text(t.name).attr("dominant-baseline", "middle").attr("class", l), { height: d, width: w } = p.node().getBBox(), g = d + i.paddingY * 2, m = n + i.paddingX + (h ? s : 0);
|
|
232
|
-
p.attr("x", m), p.attr("y", e + g / 2);
|
|
233
|
-
const u = m + w, v = w + i.paddingX * 2 + (h ? s : 0);
|
|
234
|
-
return t.BBox = { x: n, y: e, width: v, height: g }, t.cssClass?.split(/\s+/).includes("highlight") && c.insert("rect", ":first-child").attr("x", n).attr("y", e + 1).attr("width", 0).attr("height", g - 2).attr("rx", 3).attr("class", "treeView-highlight-bg"), { node: t, nodeGroup: c, labelRightEdge: u, centerY: e + g / 2 };
|
|
235
|
-
}, "positionLabel"), T = /* @__PURE__ */ f((n, e, t, r, i, a) => n.append("line").attr("x1", e).attr("y1", t).attr("x2", r).attr("y2", i).attr("stroke-width", a).attr("class", "treeView-node-line"), "positionLine"), xe = /* @__PURE__ */ f((n, e, t, r) => {
|
|
236
|
-
let i = 0, a = 0;
|
|
237
|
-
const c = [], l = /* @__PURE__ */ f((h, p, d, w) => {
|
|
238
|
-
const g = w * (d.rowIndent + d.paddingX), m = me(g, i, p, h, d, r);
|
|
239
|
-
c.push(m);
|
|
240
|
-
const { height: u, width: v } = p.BBox;
|
|
241
|
-
T(
|
|
242
|
-
h,
|
|
243
|
-
g - d.rowIndent,
|
|
244
|
-
i + u / 2,
|
|
245
|
-
g,
|
|
246
|
-
i + u / 2,
|
|
247
|
-
d.lineThickness
|
|
248
|
-
), a = Math.max(a, g + v), i += u;
|
|
249
|
-
}, "drawNode"), s = /* @__PURE__ */ f((h, p = 0) => {
|
|
250
|
-
l(n, h, t, p), h.children.forEach((m) => {
|
|
251
|
-
s(m, p + 1);
|
|
252
|
-
});
|
|
253
|
-
const { x: d, y: w, height: g } = h.BBox;
|
|
254
|
-
if (h.children.length) {
|
|
255
|
-
const { y: m, height: u } = h.children[h.children.length - 1].BBox;
|
|
256
|
-
T(
|
|
257
|
-
n,
|
|
258
|
-
d + t.paddingX,
|
|
259
|
-
w + g,
|
|
260
|
-
d + t.paddingX,
|
|
261
|
-
m + u / 2 + t.lineThickness / 2,
|
|
262
|
-
t.lineThickness
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
}, "processNode");
|
|
266
|
-
s(e);
|
|
267
|
-
const o = c.filter((h) => h.node.description);
|
|
268
|
-
if (o.length > 0) {
|
|
269
|
-
const p = Math.max(...c.map((d) => d.labelRightEdge)) + ue;
|
|
270
|
-
for (const d of o) {
|
|
271
|
-
const g = d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", p).attr("y", d.centerY).node().getBBox();
|
|
272
|
-
a = Math.max(a, p + g.width + t.paddingX);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
for (const h of c)
|
|
276
|
-
if (h.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
277
|
-
const p = h.nodeGroup.select(".treeView-highlight-bg");
|
|
278
|
-
if (!p.empty()) {
|
|
279
|
-
const d = a - h.node.BBox.x + 8;
|
|
280
|
-
p.attr("width", d), a = Math.max(a, h.node.BBox.x + d + 2);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return { totalHeight: i, totalWidth: a };
|
|
284
|
-
}, "drawTree"), ve = /* @__PURE__ */ f(async (n, e, t, r) => {
|
|
285
|
-
D.debug(`Rendering treeView diagram
|
|
286
|
-
` + n);
|
|
287
|
-
const i = r.db, a = i.getRoot(), c = i.getConfig(), l = q(e);
|
|
288
|
-
await we(l, a, c, e);
|
|
289
|
-
const s = l.append("g");
|
|
290
|
-
s.attr("class", "tree-view");
|
|
291
|
-
const { totalHeight: o, totalWidth: h } = xe(s, a, c, e);
|
|
292
|
-
l.attr("viewBox", `-${c.lineThickness / 2} 0 ${h} ${o}`), U(l, o, h, c.useMaxWidth);
|
|
293
|
-
}, "draw"), be = {
|
|
294
|
-
draw: ve
|
|
295
|
-
}, Ie = be, Ce = {
|
|
296
|
-
labelFontSize: "16px",
|
|
297
|
-
labelColor: "black",
|
|
298
|
-
lineColor: "black",
|
|
299
|
-
iconColor: "#546e7a",
|
|
300
|
-
descriptionColor: "#6a9955",
|
|
301
|
-
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
302
|
-
highlightStroke: "#ffc107"
|
|
303
|
-
}, ye = /* @__PURE__ */ f(({
|
|
304
|
-
treeView: n
|
|
305
|
-
}) => {
|
|
306
|
-
const {
|
|
307
|
-
labelFontSize: e,
|
|
308
|
-
labelColor: t,
|
|
309
|
-
lineColor: r,
|
|
310
|
-
iconColor: i,
|
|
311
|
-
descriptionColor: a,
|
|
312
|
-
highlightBg: c,
|
|
313
|
-
highlightStroke: l
|
|
314
|
-
} = A(Ce, n);
|
|
315
|
-
return `
|
|
316
|
-
.treeView-node-label {
|
|
317
|
-
font-size: ${e};
|
|
318
|
-
fill: ${t};
|
|
319
|
-
white-space: pre;
|
|
320
|
-
}
|
|
321
|
-
.treeView-node-dir {
|
|
322
|
-
font-weight: bold;
|
|
323
|
-
}
|
|
324
|
-
.treeView-node-line {
|
|
325
|
-
stroke: ${r};
|
|
326
|
-
}
|
|
327
|
-
.treeView-node-icon {
|
|
328
|
-
color: ${i};
|
|
329
|
-
}
|
|
330
|
-
.treeView-node-description {
|
|
331
|
-
font-size: ${e};
|
|
332
|
-
fill: ${a};
|
|
333
|
-
font-style: italic;
|
|
334
|
-
white-space: pre;
|
|
335
|
-
}
|
|
336
|
-
.treeView-highlight-bg {
|
|
337
|
-
fill: ${c};
|
|
338
|
-
stroke: ${l};
|
|
339
|
-
stroke-width: 1;
|
|
340
|
-
}
|
|
341
|
-
`;
|
|
342
|
-
}, "styles"), Be = ye, Ae = {
|
|
343
|
-
db: I,
|
|
344
|
-
renderer: Ie,
|
|
345
|
-
parser: fe,
|
|
346
|
-
styles: Be
|
|
347
|
-
};
|
|
348
|
-
export {
|
|
349
|
-
Ae as diagram
|
|
350
|
-
};
|