@airalogy/aimd-recorder 1.17.0 → 1.18.0
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 +11 -10
- package/README.zh-CN.md +11 -10
- package/dist/AimdCodeField-BQUuM-EF.js +182 -0
- package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3922 -3829
- package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
- package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
- package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/arc-DS_ocYoe.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
- package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
- package/dist/channel-CtXnYrAk.js +5 -0
- package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
- package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
- package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
- package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
- package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
- package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
- package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
- package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
- package/dist/components.js +3279 -2216
- package/dist/composables.js +92 -68
- package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
- package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
- package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
- package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
- package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
- package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
- package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
- package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
- package/dist/graph-DdlKE625.js +1510 -0
- package/dist/index.js +104 -80
- package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
- package/dist/katex-DNob3HGn.js +11690 -0
- package/dist/layout-DDt0fz-M.js +1703 -0
- package/dist/linear-C-IAFdOt.js +259 -0
- package/dist/mermaid.core-CuZ3nINf.js +15940 -0
- package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
- package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
- package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
- package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
- package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-qA6gj4vz.js} +3035 -2254
- package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
- package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
- package/package.json +9 -8
- package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
- package/src/__tests__/markdown-field.test.ts +150 -1
- package/src/__tests__/markdown-note-field.test.ts +86 -3
- package/src/__tests__/recorder-assigner-control.test.ts +844 -0
- package/src/__tests__/recorder-editor.test.ts +17 -0
- package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
- package/src/__tests__/step-field.test.ts +47 -1
- package/src/__tests__/type-plugins.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +741 -1
- package/src/components/AimdCodeField.vue +24 -5
- package/src/components/AimdMarkdownField.vue +548 -11
- package/src/components/AimdMarkdownNoteField.vue +241 -30
- package/src/components/AimdRecorder.vue +1521 -95
- package/src/components/AimdRecorderEditor.vue +276 -8
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
- package/src/components/AimdStepCheckField.vue +82 -18
- package/src/components/AimdVarField.vue +694 -25
- package/src/components/AimdVarTableField.vue +283 -110
- package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
- package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
- package/src/components/recorderMilkdownPlugin.ts +14 -0
- package/src/composables/__tests__/useRecordState.test.ts +86 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
- package/src/composables/index.ts +27 -1
- package/src/composables/useAssignerRunner.ts +376 -0
- package/src/composables/useCodeBlockRendering.ts +51 -0
- package/src/composables/useFieldRendering.ts +32 -4
- package/src/composables/useMonacoAutoHeight.ts +127 -0
- package/src/composables/useRecordState.ts +22 -3
- package/src/composables/useVarHelpers.ts +377 -9
- package/src/index.ts +13 -0
- package/src/locales.ts +45 -0
- package/src/styles/aimd.css +151 -1
- package/src/type-plugins.ts +7 -0
- package/src/types.ts +93 -2
- package/dist/AimdCodeField-DC3DPvgc.js +0 -172
- package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
- package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { s as k, g as I, t as R, q as F, a as _, b as E, _ as l, L as D, A as z, H as y, F as C, I as G, l as P, a1 as W, e as B } from "./mermaid.core-CuZ3nINf.js";
|
|
2
|
+
import { p as H } from "./chunk-4BX2VUAB-DTmsQu5_.js";
|
|
3
|
+
import { p as V } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
4
|
+
var h = {
|
|
5
|
+
showLegend: !0,
|
|
6
|
+
ticks: 5,
|
|
7
|
+
max: null,
|
|
8
|
+
min: 0,
|
|
9
|
+
graticule: "circle"
|
|
10
|
+
}, w = {
|
|
11
|
+
axes: [],
|
|
12
|
+
curves: [],
|
|
13
|
+
options: h
|
|
14
|
+
}, x = structuredClone(w), j = G.radar, q = /* @__PURE__ */ l(() => y({
|
|
15
|
+
...j,
|
|
16
|
+
...C().radar
|
|
17
|
+
}), "getConfig"), b = /* @__PURE__ */ l(() => x.axes, "getAxes"), N = /* @__PURE__ */ l(() => x.curves, "getCurves"), U = /* @__PURE__ */ l(() => x.options, "getOptions"), X = /* @__PURE__ */ l((a) => {
|
|
18
|
+
x.axes = a.map((t) => ({
|
|
19
|
+
name: t.name,
|
|
20
|
+
label: t.label ?? t.name
|
|
21
|
+
}));
|
|
22
|
+
}, "setAxes"), Y = /* @__PURE__ */ l((a) => {
|
|
23
|
+
x.curves = a.map((t) => ({
|
|
24
|
+
name: t.name,
|
|
25
|
+
label: t.label ?? t.name,
|
|
26
|
+
entries: Z(t.entries)
|
|
27
|
+
}));
|
|
28
|
+
}, "setCurves"), Z = /* @__PURE__ */ l((a) => {
|
|
29
|
+
if (a[0].axis == null)
|
|
30
|
+
return a.map((e) => e.value);
|
|
31
|
+
const t = b();
|
|
32
|
+
if (t.length === 0)
|
|
33
|
+
throw new Error("Axes must be populated before curves for reference entries");
|
|
34
|
+
return t.map((e) => {
|
|
35
|
+
const r = a.find((s) => s.axis?.$refText === e.name);
|
|
36
|
+
if (r === void 0)
|
|
37
|
+
throw new Error("Missing entry for axis " + e.label);
|
|
38
|
+
return r.value;
|
|
39
|
+
});
|
|
40
|
+
}, "computeCurveEntries"), J = /* @__PURE__ */ l((a) => {
|
|
41
|
+
const t = a.reduce(
|
|
42
|
+
(e, r) => (e[r.name] = r, e),
|
|
43
|
+
{}
|
|
44
|
+
);
|
|
45
|
+
x.options = {
|
|
46
|
+
showLegend: t.showLegend?.value ?? h.showLegend,
|
|
47
|
+
ticks: t.ticks?.value ?? h.ticks,
|
|
48
|
+
max: t.max?.value ?? h.max,
|
|
49
|
+
min: t.min?.value ?? h.min,
|
|
50
|
+
graticule: t.graticule?.value ?? h.graticule
|
|
51
|
+
};
|
|
52
|
+
}, "setOptions"), K = /* @__PURE__ */ l(() => {
|
|
53
|
+
z(), x = structuredClone(w);
|
|
54
|
+
}, "clear"), $ = {
|
|
55
|
+
getAxes: b,
|
|
56
|
+
getCurves: N,
|
|
57
|
+
getOptions: U,
|
|
58
|
+
setAxes: X,
|
|
59
|
+
setCurves: Y,
|
|
60
|
+
setOptions: J,
|
|
61
|
+
getConfig: q,
|
|
62
|
+
clear: K,
|
|
63
|
+
setAccTitle: E,
|
|
64
|
+
getAccTitle: _,
|
|
65
|
+
setDiagramTitle: F,
|
|
66
|
+
getDiagramTitle: R,
|
|
67
|
+
getAccDescription: I,
|
|
68
|
+
setAccDescription: k
|
|
69
|
+
}, Q = /* @__PURE__ */ l((a) => {
|
|
70
|
+
H(a, $);
|
|
71
|
+
const { axes: t, curves: e, options: r } = a;
|
|
72
|
+
$.setAxes(t), $.setCurves(e), $.setOptions(r);
|
|
73
|
+
}, "populate"), tt = {
|
|
74
|
+
parse: /* @__PURE__ */ l(async (a) => {
|
|
75
|
+
const t = await V("radar", a);
|
|
76
|
+
P.debug(t), Q(t);
|
|
77
|
+
}, "parse")
|
|
78
|
+
}, et = /* @__PURE__ */ l((a, t, e, r) => {
|
|
79
|
+
const s = r.db, o = s.getAxes(), i = s.getCurves(), n = s.getOptions(), c = s.getConfig(), d = s.getDiagramTitle(), p = D(t), u = at(p, c), g = n.max ?? Math.max(...i.map((f) => Math.max(...f.entries))), m = n.min, v = Math.min(c.width, c.height) / 2;
|
|
80
|
+
rt(u, o, v, n.ticks, n.graticule), st(u, o, v, c), M(u, o, i, m, g, n.graticule, c), T(u, i, n.showLegend, c), u.append("text").attr("class", "radarTitle").text(d).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
|
|
81
|
+
}, "draw"), at = /* @__PURE__ */ l((a, t) => {
|
|
82
|
+
const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = {
|
|
83
|
+
x: t.marginLeft + t.width / 2,
|
|
84
|
+
y: t.marginTop + t.height / 2
|
|
85
|
+
};
|
|
86
|
+
return B(a, r, e, t.useMaxWidth ?? !0), a.attr("viewBox", `0 0 ${e} ${r}`), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);
|
|
87
|
+
}, "drawFrame"), rt = /* @__PURE__ */ l((a, t, e, r, s) => {
|
|
88
|
+
if (s === "circle")
|
|
89
|
+
for (let o = 0; o < r; o++) {
|
|
90
|
+
const i = e * (o + 1) / r;
|
|
91
|
+
a.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
92
|
+
}
|
|
93
|
+
else if (s === "polygon") {
|
|
94
|
+
const o = t.length;
|
|
95
|
+
for (let i = 0; i < r; i++) {
|
|
96
|
+
const n = e * (i + 1) / r, c = t.map((d, p) => {
|
|
97
|
+
const u = 2 * p * Math.PI / o - Math.PI / 2, g = n * Math.cos(u), m = n * Math.sin(u);
|
|
98
|
+
return `${g},${m}`;
|
|
99
|
+
}).join(" ");
|
|
100
|
+
a.append("polygon").attr("points", c).attr("class", "radarGraticule");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, "drawGraticule"), st = /* @__PURE__ */ l((a, t, e, r) => {
|
|
104
|
+
const s = t.length;
|
|
105
|
+
for (let o = 0; o < s; o++) {
|
|
106
|
+
const i = t[o].label, n = 2 * o * Math.PI / s - Math.PI / 2;
|
|
107
|
+
a.append("line").attr("x1", 0).attr("y1", 0).attr("x2", e * r.axisScaleFactor * Math.cos(n)).attr("y2", e * r.axisScaleFactor * Math.sin(n)).attr("class", "radarAxisLine"), a.append("text").text(i).attr("x", e * r.axisLabelFactor * Math.cos(n)).attr("y", e * r.axisLabelFactor * Math.sin(n)).attr("class", "radarAxisLabel");
|
|
108
|
+
}
|
|
109
|
+
}, "drawAxes");
|
|
110
|
+
function M(a, t, e, r, s, o, i) {
|
|
111
|
+
const n = t.length, c = Math.min(i.width, i.height) / 2;
|
|
112
|
+
e.forEach((d, p) => {
|
|
113
|
+
if (d.entries.length !== n)
|
|
114
|
+
return;
|
|
115
|
+
const u = d.entries.map((g, m) => {
|
|
116
|
+
const v = 2 * Math.PI * m / n - Math.PI / 2, f = A(g, r, s, c), S = f * Math.cos(v), O = f * Math.sin(v);
|
|
117
|
+
return { x: S, y: O };
|
|
118
|
+
});
|
|
119
|
+
o === "circle" ? a.append("path").attr("d", L(u, i.curveTension)).attr("class", `radarCurve-${p}`) : o === "polygon" && a.append("polygon").attr("points", u.map((g) => `${g.x},${g.y}`).join(" ")).attr("class", `radarCurve-${p}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
l(M, "drawCurves");
|
|
123
|
+
function A(a, t, e, r) {
|
|
124
|
+
const s = Math.min(Math.max(a, t), e);
|
|
125
|
+
return r * (s - t) / (e - t);
|
|
126
|
+
}
|
|
127
|
+
l(A, "relativeRadius");
|
|
128
|
+
function L(a, t) {
|
|
129
|
+
const e = a.length;
|
|
130
|
+
let r = `M${a[0].x},${a[0].y}`;
|
|
131
|
+
for (let s = 0; s < e; s++) {
|
|
132
|
+
const o = a[(s - 1 + e) % e], i = a[s], n = a[(s + 1) % e], c = a[(s + 2) % e], d = {
|
|
133
|
+
x: i.x + (n.x - o.x) * t,
|
|
134
|
+
y: i.y + (n.y - o.y) * t
|
|
135
|
+
}, p = {
|
|
136
|
+
x: n.x - (c.x - i.x) * t,
|
|
137
|
+
y: n.y - (c.y - i.y) * t
|
|
138
|
+
};
|
|
139
|
+
r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`;
|
|
140
|
+
}
|
|
141
|
+
return `${r} Z`;
|
|
142
|
+
}
|
|
143
|
+
l(L, "closedRoundCurve");
|
|
144
|
+
function T(a, t, e, r) {
|
|
145
|
+
if (!e)
|
|
146
|
+
return;
|
|
147
|
+
const s = (r.width / 2 + r.marginRight) * 3 / 4, o = -(r.height / 2 + r.marginTop) * 3 / 4, i = 20;
|
|
148
|
+
t.forEach((n, c) => {
|
|
149
|
+
const d = a.append("g").attr("transform", `translate(${s}, ${o + c * i})`);
|
|
150
|
+
d.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${c}`), d.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(n.label);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
l(T, "drawLegend");
|
|
154
|
+
var nt = { draw: et }, ot = /* @__PURE__ */ l((a, t) => {
|
|
155
|
+
let e = "";
|
|
156
|
+
for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) {
|
|
157
|
+
const s = a[`cScale${r}`];
|
|
158
|
+
e += `
|
|
159
|
+
.radarCurve-${r} {
|
|
160
|
+
color: ${s};
|
|
161
|
+
fill: ${s};
|
|
162
|
+
fill-opacity: ${t.curveOpacity};
|
|
163
|
+
stroke: ${s};
|
|
164
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
165
|
+
}
|
|
166
|
+
.radarLegendBox-${r} {
|
|
167
|
+
fill: ${s};
|
|
168
|
+
fill-opacity: ${t.curveOpacity};
|
|
169
|
+
stroke: ${s};
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
172
|
+
}
|
|
173
|
+
return e;
|
|
174
|
+
}, "genIndexStyles"), it = /* @__PURE__ */ l((a) => {
|
|
175
|
+
const t = W(), e = C(), r = y(t, e.themeVariables), s = y(r.radar, a);
|
|
176
|
+
return { themeVariables: r, radarOptions: s };
|
|
177
|
+
}, "buildRadarStyleOptions"), lt = /* @__PURE__ */ l(({ radar: a } = {}) => {
|
|
178
|
+
const { themeVariables: t, radarOptions: e } = it(a);
|
|
179
|
+
return `
|
|
180
|
+
.radarTitle {
|
|
181
|
+
font-size: ${t.fontSize};
|
|
182
|
+
color: ${t.titleColor};
|
|
183
|
+
dominant-baseline: hanging;
|
|
184
|
+
text-anchor: middle;
|
|
185
|
+
}
|
|
186
|
+
.radarAxisLine {
|
|
187
|
+
stroke: ${e.axisColor};
|
|
188
|
+
stroke-width: ${e.axisStrokeWidth};
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLabel {
|
|
191
|
+
dominant-baseline: middle;
|
|
192
|
+
text-anchor: middle;
|
|
193
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
194
|
+
color: ${e.axisColor};
|
|
195
|
+
}
|
|
196
|
+
.radarGraticule {
|
|
197
|
+
fill: ${e.graticuleColor};
|
|
198
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
199
|
+
stroke: ${e.graticuleColor};
|
|
200
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
201
|
+
}
|
|
202
|
+
.radarLegendText {
|
|
203
|
+
text-anchor: start;
|
|
204
|
+
font-size: ${e.legendFontSize}px;
|
|
205
|
+
dominant-baseline: hanging;
|
|
206
|
+
}
|
|
207
|
+
${ot(t, e)}
|
|
208
|
+
`;
|
|
209
|
+
}, "styles"), pt = {
|
|
210
|
+
parser: tt,
|
|
211
|
+
db: $,
|
|
212
|
+
renderer: nt,
|
|
213
|
+
styles: lt
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
pt as diagram
|
|
217
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { q as x, b as f, s as C, t as B, g as T, a as y, _ as s, H as u, l as k, L as V, e as _, F as N, A as S, I as A } from "./mermaid.core-CuZ3nINf.js";
|
|
2
|
+
import { p as D } from "./chunk-4BX2VUAB-DTmsQu5_.js";
|
|
3
|
+
import { I } from "./chunk-QZHKN3VN-Di5HEktz.js";
|
|
4
|
+
import { p as $ } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
5
|
+
var d = new I(() => ({
|
|
6
|
+
cnt: 1,
|
|
7
|
+
stack: [
|
|
8
|
+
{
|
|
9
|
+
id: 0,
|
|
10
|
+
level: -1,
|
|
11
|
+
name: "/",
|
|
12
|
+
children: []
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
})), H = /* @__PURE__ */ s(() => {
|
|
16
|
+
d.reset(), S();
|
|
17
|
+
}, "clear"), L = /* @__PURE__ */ s(() => d.records.stack[0], "getRoot"), X = /* @__PURE__ */ s(() => d.records.cnt, "getCount"), z = A.treeView, R = /* @__PURE__ */ s(() => u(z, N().treeView), "getConfig"), W = /* @__PURE__ */ s((e, t) => {
|
|
18
|
+
for (; e <= d.records.stack[d.records.stack.length - 1].level; )
|
|
19
|
+
d.records.stack.pop();
|
|
20
|
+
const a = {
|
|
21
|
+
id: d.records.cnt++,
|
|
22
|
+
level: e,
|
|
23
|
+
name: t,
|
|
24
|
+
children: []
|
|
25
|
+
};
|
|
26
|
+
d.records.stack[d.records.stack.length - 1].children.push(a), d.records.stack.push(a);
|
|
27
|
+
}, "addNode"), E = {
|
|
28
|
+
clear: H,
|
|
29
|
+
addNode: W,
|
|
30
|
+
getRoot: L,
|
|
31
|
+
getCount: X,
|
|
32
|
+
getConfig: R,
|
|
33
|
+
getAccTitle: y,
|
|
34
|
+
getAccDescription: T,
|
|
35
|
+
getDiagramTitle: B,
|
|
36
|
+
setAccDescription: C,
|
|
37
|
+
setAccTitle: f,
|
|
38
|
+
setDiagramTitle: x
|
|
39
|
+
}, m = E, F = /* @__PURE__ */ s((e) => {
|
|
40
|
+
D(e, m), e.nodes.map((t) => m.addNode(t.indent ? parseInt(t.indent) : 0, t.name));
|
|
41
|
+
}, "populate"), M = {
|
|
42
|
+
parse: /* @__PURE__ */ s(async (e) => {
|
|
43
|
+
const t = await $("treeView", e);
|
|
44
|
+
k.debug(t), F(t);
|
|
45
|
+
}, "parse")
|
|
46
|
+
}, Y = /* @__PURE__ */ s((e, t, a, n, o) => {
|
|
47
|
+
const c = n.append("text").text(a.name).attr("dominant-baseline", "middle").attr("class", "treeView-node-label"), { height: g, width: r } = c.node().getBBox(), l = g + o.paddingY * 2, i = r + o.paddingX * 2;
|
|
48
|
+
c.attr("x", e + o.paddingX), c.attr("y", t + l / 2), a.BBox = {
|
|
49
|
+
x: e,
|
|
50
|
+
y: t,
|
|
51
|
+
width: i,
|
|
52
|
+
height: l
|
|
53
|
+
};
|
|
54
|
+
}, "positionLabel"), b = /* @__PURE__ */ s((e, t, a, n, o, c) => e.append("line").attr("x1", t).attr("y1", a).attr("x2", n).attr("y2", o).attr("stroke-width", c).attr("class", "treeView-node-line"), "positionLine"), q = /* @__PURE__ */ s((e, t, a) => {
|
|
55
|
+
let n = 0, o = 0;
|
|
56
|
+
const c = /* @__PURE__ */ s((r, l, i, h) => {
|
|
57
|
+
const v = h * (i.rowIndent + i.paddingX);
|
|
58
|
+
Y(v, n, l, r, i);
|
|
59
|
+
const { height: p, width: w } = l.BBox;
|
|
60
|
+
b(
|
|
61
|
+
r,
|
|
62
|
+
v - i.rowIndent,
|
|
63
|
+
n + p / 2,
|
|
64
|
+
v,
|
|
65
|
+
n + p / 2,
|
|
66
|
+
i.lineThickness
|
|
67
|
+
), o = Math.max(o, v + w), n += p;
|
|
68
|
+
}, "drawNode"), g = /* @__PURE__ */ s((r, l = 0) => {
|
|
69
|
+
c(e, r, a, l), r.children.forEach((p) => {
|
|
70
|
+
g(p, l + 1);
|
|
71
|
+
});
|
|
72
|
+
const { x: i, y: h, height: v } = r.BBox;
|
|
73
|
+
if (r.children.length) {
|
|
74
|
+
const { y: p, height: w } = r.children[r.children.length - 1].BBox;
|
|
75
|
+
b(
|
|
76
|
+
e,
|
|
77
|
+
i + a.paddingX,
|
|
78
|
+
h + v,
|
|
79
|
+
i + a.paddingX,
|
|
80
|
+
p + w / 2 + a.lineThickness / 2,
|
|
81
|
+
a.lineThickness
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}, "processNode");
|
|
85
|
+
return g(t), { totalHeight: n, totalWidth: o };
|
|
86
|
+
}, "drawTree"), j = /* @__PURE__ */ s((e, t, a, n) => {
|
|
87
|
+
k.debug(`Rendering treeView diagram
|
|
88
|
+
` + e);
|
|
89
|
+
const o = n.db, c = o.getRoot(), g = o.getConfig(), r = V(t), l = r.append("g");
|
|
90
|
+
l.attr("class", "tree-view");
|
|
91
|
+
const { totalHeight: i, totalWidth: h } = q(l, c, g);
|
|
92
|
+
r.attr("viewBox", `-${g.lineThickness / 2} 0 ${h} ${i}`), _(r, i, h, g.useMaxWidth);
|
|
93
|
+
}, "draw"), G = {
|
|
94
|
+
draw: j
|
|
95
|
+
}, J = G, K = {
|
|
96
|
+
labelFontSize: "16px",
|
|
97
|
+
labelColor: "black",
|
|
98
|
+
lineColor: "black"
|
|
99
|
+
}, O = /* @__PURE__ */ s(({
|
|
100
|
+
treeView: e
|
|
101
|
+
}) => {
|
|
102
|
+
const { labelFontSize: t, labelColor: a, lineColor: n } = u(
|
|
103
|
+
K,
|
|
104
|
+
e
|
|
105
|
+
);
|
|
106
|
+
return `
|
|
107
|
+
.treeView-node-label {
|
|
108
|
+
font-size: ${t};
|
|
109
|
+
fill: ${a};
|
|
110
|
+
}
|
|
111
|
+
.treeView-node-line {
|
|
112
|
+
stroke: ${n};
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
}, "styles"), P = O, te = {
|
|
116
|
+
db: m,
|
|
117
|
+
renderer: J,
|
|
118
|
+
parser: M,
|
|
119
|
+
styles: P
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
te as diagram
|
|
123
|
+
};
|