@yiyi_zhang/reactflow-ui 0.3.0 → 0.5.0-beta.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 +61 -22
- package/dist/AiWorkflowIDE.d.ts +217 -0
- package/dist/WorkflowIDE.d.ts +22 -3
- package/dist/ai-BJwQZcGK.js +15168 -0
- package/dist/ai.d.ts +30 -0
- package/dist/arc-BUGZGgtu.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-ZcgvTwSO.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-DtVtOBbH.js +2418 -0
- package/dist/c4Diagram-AAUBKEIU-tBS5Rcvm.js +1577 -0
- package/dist/channel-CURI9jmI.js +5 -0
- package/dist/chunk-2J33WTMH-D7gashNz.js +19 -0
- package/dist/chunk-4BX2VUAB-DE3VjyiZ.js +8 -0
- package/dist/chunk-55IACEB6-GYZ_m2MY.js +8 -0
- package/dist/chunk-727SXJPM-D4WVyvOg.js +1528 -0
- package/dist/chunk-AQP2D5EJ-Os2Uwqya.js +1387 -0
- package/dist/chunk-FMBD7UC4-B3CSVzS4.js +19 -0
- package/dist/chunk-ND2GUHAM-CNj_s1aK.js +68 -0
- package/dist/chunk-QZHKN3VN-DoV8iUKo.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-Dr9C18x4.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Dr9C18x4.js +16 -0
- package/dist/components/AiNative/AgentTimeline.d.ts +18 -0
- package/dist/components/AiNative/AiCommandCenter.d.ts +40 -0
- package/dist/components/AiNative/AiConfigPanel.d.ts +9 -0
- package/dist/components/AiNative/BusinessCanvas.d.ts +15 -0
- package/dist/components/AiNative/CanvasPreview.d.ts +16 -0
- package/dist/components/AiNative/ClarificationCard.d.ts +9 -0
- package/dist/components/AiNative/FailureSummaryCard.d.ts +20 -0
- package/dist/components/AiNative/LibraryPanel.d.ts +9 -0
- package/dist/components/AiNative/MermaidBlock.d.ts +6 -0
- package/dist/components/AiNative/PlanCard.d.ts +15 -0
- package/dist/components/AiNative/ProposalPreviewCard.d.ts +21 -0
- package/dist/components/AiNative/RecommendationCard.d.ts +10 -0
- package/dist/components/AiNative/RepairCard.d.ts +17 -0
- package/dist/components/AiNative/ReviewBar.d.ts +21 -0
- package/dist/components/AiNative/WorkflowRunCard.d.ts +14 -0
- package/dist/components/Controls/ModeSlider.d.ts +2 -0
- package/dist/components/ExecutionSummaryPanel.d.ts +4 -0
- package/dist/components/WorkflowRunPanel.d.ts +12 -0
- package/dist/components/nodes/NodeWrapper.d.ts +2 -1
- package/dist/cose-bilkent-S5V4N54A-CgQlI-io.js +2609 -0
- package/dist/cytoscape.esm-kVAWcYoG.js +18755 -0
- package/dist/dagre-BM42HDAG-CFMIuOmS.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-C5jZp2YX.js +217 -0
- package/dist/diagram-5GNKFQAL-DRUVcHpp.js +123 -0
- package/dist/diagram-KO2AKTUF-BOl4aaej.js +461 -0
- package/dist/diagram-LMA3HP47-ZeckPR2Q.js +142 -0
- package/dist/diagram-OG6HWLK6-qUWeLfa-.js +528 -0
- package/dist/erDiagram-TEJ5UH35-Bw_CWS13.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-D3xEvQA-.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-D8GvenY3.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-BWrN_HOm.js +815 -0
- package/dist/graph-BRoPeNF3.js +1545 -0
- package/dist/hooks/useNodeExecution.d.ts +1 -1
- package/dist/hooks/useNodeLayout.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/infoDiagram-5YYISTIA-Da8FG5tB.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Bg2_mKEc.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-sFIxGfua.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-CGmopzHd.js +724 -0
- package/dist/katex-DoRnZ_sp.js +11682 -0
- package/dist/layout-D9EpM4Fg.js +1728 -0
- package/dist/linear-BA49eco4.js +259 -0
- package/dist/mermaid.core-XSpZEAKP.js +16137 -0
- package/dist/mindmap-definition-RKZ34NQL-Bqf76QGB.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-hHiP8HzL.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-DSccwH8B.js +1024 -0
- package/dist/reactflow-ui-ai.es.js +12 -0
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +8198 -7039
- package/dist/reactflow-ui.umd.js +52 -17
- package/dist/requirementDiagram-4Y6WPE33-DIpyoYZ_.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-DsaPqq8D.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-BNg7orie.js +2891 -0
- package/dist/services/ai/agentRunner.d.ts +51 -0
- package/dist/services/ai/contextEngine.d.ts +83 -0
- package/dist/services/ai/draftPersistence.d.ts +22 -0
- package/dist/services/ai/errorMessages.d.ts +16 -0
- package/dist/services/ai/intentClassifier.d.ts +17 -0
- package/dist/services/ai/protocolAdapter.d.ts +114 -0
- package/dist/services/ai/ruleEngine.d.ts +57 -0
- package/dist/services/ai/schemaRegistry.d.ts +51 -0
- package/dist/services/ai/systemPrompt.d.ts +30 -0
- package/dist/services/ai/toolDefs.d.ts +9 -0
- package/dist/services/ai/toolExecutor.d.ts +83 -0
- package/dist/services/ai/toolRegistry.d.ts +38 -0
- package/dist/services/ai/transport.d.ts +58 -0
- package/dist/services/aiService.d.ts +27 -5
- package/dist/stateDiagram-AJRCARHV-Rv1mSmnJ.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-BME16k02.js +16 -0
- package/dist/store/aiStore.d.ts +199 -0
- package/dist/store/ideStoresContext.d.ts +39 -0
- package/dist/store/libraryStore.d.ts +25 -0
- package/dist/timeline-definition-PNZ67QCA-CmmzdVk-.js +1055 -0
- package/dist/types/aiEvents.d.ts +38 -0
- package/dist/types/conductor.d.ts +23 -2
- package/dist/types/workflow.d.ts +36 -0
- package/dist/types/workflowLibrary.d.ts +27 -0
- package/dist/utils/executionAnalyzer.d.ts +32 -0
- package/dist/utils/nodeMeta.d.ts +6 -0
- package/dist/utils/proposalPreview.d.ts +19 -0
- package/dist/utils/taskTypeMeta.d.ts +18 -0
- package/dist/utils/workflowToMermaid.d.ts +7 -0
- package/dist/vennDiagram-CIIHVFJN-BQt00w9Q.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-LZpiODGN.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-BpJlv_mc.js +1342 -0
- package/package.json +14 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { _ as l, s as k, g as I, q as R, p as F, a as _, b as D, I as E, z, F as y, D as C, G, l as P, K as W, e as B } from "./mermaid.core-XSpZEAKP.js";
|
|
2
|
+
import { p as V } from "./chunk-4BX2VUAB-DE3VjyiZ.js";
|
|
3
|
+
import { p as H } 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"), K = /* @__PURE__ */ l(() => x.curves, "getCurves"), N = /* @__PURE__ */ l(() => x.options, "getOptions"), U = /* @__PURE__ */ l((a) => {
|
|
18
|
+
x.axes = a.map((t) => ({
|
|
19
|
+
name: t.name,
|
|
20
|
+
label: t.label ?? t.name
|
|
21
|
+
}));
|
|
22
|
+
}, "setAxes"), X = /* @__PURE__ */ l((a) => {
|
|
23
|
+
x.curves = a.map((t) => ({
|
|
24
|
+
name: t.name,
|
|
25
|
+
label: t.label ?? t.name,
|
|
26
|
+
entries: Y(t.entries)
|
|
27
|
+
}));
|
|
28
|
+
}, "setCurves"), Y = /* @__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"), Z = /* @__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"), J = /* @__PURE__ */ l(() => {
|
|
53
|
+
z(), x = structuredClone(w);
|
|
54
|
+
}, "clear"), $ = {
|
|
55
|
+
getAxes: b,
|
|
56
|
+
getCurves: K,
|
|
57
|
+
getOptions: N,
|
|
58
|
+
setAxes: U,
|
|
59
|
+
setCurves: X,
|
|
60
|
+
setOptions: Z,
|
|
61
|
+
getConfig: q,
|
|
62
|
+
clear: J,
|
|
63
|
+
setAccTitle: D,
|
|
64
|
+
getAccTitle: _,
|
|
65
|
+
setDiagramTitle: F,
|
|
66
|
+
getDiagramTitle: R,
|
|
67
|
+
getAccDescription: I,
|
|
68
|
+
setAccDescription: k
|
|
69
|
+
}, Q = /* @__PURE__ */ l((a) => {
|
|
70
|
+
V(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 H("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 = E(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 { _ as s, p as x, b as f, s as C, q as B, g as T, a as y, F as u, l as k, I as V, e as _, D, z as N, G as S } from "./mermaid.core-XSpZEAKP.js";
|
|
2
|
+
import { p as I } from "./chunk-4BX2VUAB-DE3VjyiZ.js";
|
|
3
|
+
import { I as $ } from "./chunk-QZHKN3VN-DoV8iUKo.js";
|
|
4
|
+
import { p as z } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
5
|
+
var d = new $(() => ({
|
|
6
|
+
cnt: 1,
|
|
7
|
+
stack: [
|
|
8
|
+
{
|
|
9
|
+
id: 0,
|
|
10
|
+
level: -1,
|
|
11
|
+
name: "/",
|
|
12
|
+
children: []
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
})), A = /* @__PURE__ */ s(() => {
|
|
16
|
+
d.reset(), N();
|
|
17
|
+
}, "clear"), X = /* @__PURE__ */ s(() => d.records.stack[0], "getRoot"), H = /* @__PURE__ */ s(() => d.records.cnt, "getCount"), L = S.treeView, R = /* @__PURE__ */ s(() => u(L, D().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: A,
|
|
29
|
+
addNode: W,
|
|
30
|
+
getRoot: X,
|
|
31
|
+
getCount: H,
|
|
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
|
+
I(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 z("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"), G = /* @__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"), j = {
|
|
94
|
+
draw: G
|
|
95
|
+
}, J = j, 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
|
+
};
|