@ucap-llm/ai-ui 1.1.6 → 1.1.7

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.
Files changed (55) hide show
  1. package/_basePickBy-7d00d05e.mjs +153 -0
  2. package/_baseUniq-1876be04.mjs +440 -0
  3. package/ai-ui.es.js +11 -78207
  4. package/ai-ui.umd.js +2701 -143
  5. package/arc-bb1e7b28.mjs +85 -0
  6. package/architecture-4AB2E3PP-26f07d27.mjs +10 -0
  7. package/architectureDiagram-IEHRJDOE-535e4958.mjs +4640 -0
  8. package/blockDiagram-JOT3LUYC-e5536854.mjs +2251 -0
  9. package/c4Diagram-VJAJSXHY-311741c3.mjs +1583 -0
  10. package/channel-5d097975.mjs +5 -0
  11. package/chunk-4BMEZGHF-55420838.mjs +9 -0
  12. package/chunk-A2AXSNBT-5f9de039.mjs +1373 -0
  13. package/chunk-AEK57VVT-bd6e836f.mjs +1416 -0
  14. package/chunk-D6G4REZN-69cf348a.mjs +64 -0
  15. package/chunk-RZ5BOZE2-ebe3985e.mjs +24 -0
  16. package/chunk-XZIHB7SX-ed9a9d65.mjs +15 -0
  17. package/classDiagram-GIVACNV2-4d61f06d.mjs +18 -0
  18. package/classDiagram-v2-COTLJTTW-4d61f06d.mjs +18 -0
  19. package/clone-44064c55.mjs +8 -0
  20. package/cytoscape.esm-bb479f88.mjs +18232 -0
  21. package/dagre-OKDRZEBW-0574359b.mjs +448 -0
  22. package/diagram-SSKATNLV-f4dd04b2.mjs +225 -0
  23. package/diagram-VNBRO52H-f77f925a.mjs +130 -0
  24. package/erDiagram-Q7BY3M3F-8213684f.mjs +843 -0
  25. package/flowDiagram-4HSFHLVR-1decdff6.mjs +1624 -0
  26. package/ganttDiagram-APWFNJXF-461381a5.mjs +2521 -0
  27. package/gitGraph-O2Q2CXLX-d961db16.mjs +10 -0
  28. package/gitGraphDiagram-7IBYFJ6S-be6c39c3.mjs +716 -0
  29. package/graph-7ba79f74.mjs +249 -0
  30. package/index-f5aac161.mjs +93487 -0
  31. package/info-4N47QTOZ-615527c9.mjs +10 -0
  32. package/infoDiagram-PH2N3AL5-064df479.mjs +26 -0
  33. package/init-f9637058.mjs +16 -0
  34. package/journeyDiagram-U35MCT3I-94c54b39.mjs +811 -0
  35. package/kanban-definition-NDS4AKOZ-58a05db1.mjs +720 -0
  36. package/katex-2e45926a.mjs +11700 -0
  37. package/layout-c953b0e7.mjs +1344 -0
  38. package/linear-3c81794f.mjs +447 -0
  39. package/mermaid-parser.core-7afd2b2f.mjs +12845 -0
  40. package/mindmap-definition-ALO5MXBD-60e68e28.mjs +3222 -0
  41. package/ordinal-980380c7.mjs +65 -0
  42. package/package.json +1 -1
  43. package/packet-KVYON367-4b5a305e.mjs +10 -0
  44. package/pie-R6RNRRYF-0f27d16d.mjs +10 -0
  45. package/pieDiagram-IB7DONF6-66cebf11.mjs +167 -0
  46. package/quadrantDiagram-7GDLP6J5-f2cbfc79.mjs +1027 -0
  47. package/radar-MK3ICKWK-9e1913d7.mjs +10 -0
  48. package/requirementDiagram-KVF5MWMF-36d316c2.mjs +853 -0
  49. package/sankeyDiagram-QLVOVGJD-76245efb.mjs +826 -0
  50. package/sequenceDiagram-X6HHIX6F-a0ec0021.mjs +2283 -0
  51. package/stateDiagram-DGXRK772-e6387816.mjs +274 -0
  52. package/stateDiagram-v2-YXO3MK2T-f011ada4.mjs +18 -0
  53. package/style.css +1 -1
  54. package/timeline-definition-BDJGKUSR-a62514a7.mjs +806 -0
  55. package/xychartDiagram-VJFVF3MP-1b807048.mjs +1306 -0
@@ -0,0 +1,274 @@
1
+ import { s as W, S as N, a as P } from "./chunk-AEK57VVT-bd6e836f.mjs";
2
+ import { _ as u, d as t, j as H, l as S, k as C, e as z, Q as U, R as F, u as O } from "./index-f5aac161.mjs";
3
+ import { G as J } from "./graph-7ba79f74.mjs";
4
+ import { l as X } from "./layout-c953b0e7.mjs";
5
+ import "./chunk-RZ5BOZE2-ebe3985e.mjs";
6
+ import "vue";
7
+ import "./_baseUniq-1876be04.mjs";
8
+ import "./_basePickBy-7d00d05e.mjs";
9
+ var L = {}, D = /* @__PURE__ */ u((e, i) => {
10
+ L[e] = i;
11
+ }, "set"), Y = /* @__PURE__ */ u((e) => L[e], "get"), A = /* @__PURE__ */ u(() => Object.keys(L), "keys"), I = /* @__PURE__ */ u(() => A().length, "size"), $ = {
12
+ get: Y,
13
+ set: D,
14
+ keys: A,
15
+ size: I
16
+ }, j = /* @__PURE__ */ u((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), q = /* @__PURE__ */ u((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Q = /* @__PURE__ */ u((e, i) => {
17
+ const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), o = d.node().getBBox();
18
+ return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", o.width + 2 * t().state.padding).attr("height", o.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
19
+ }, "drawSimpleState"), Z = /* @__PURE__ */ u((e, i) => {
20
+ const d = /* @__PURE__ */ u(function(l, B, m) {
21
+ const k = l.append("tspan").attr("x", 2 * t().state.padding).text(B);
22
+ m || k.attr("dy", t().state.textHeight);
23
+ }, "addTspan"), n = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 1.3 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), g = n.height, x = e.append("text").attr("x", t().state.padding).attr(
24
+ "y",
25
+ g + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
26
+ ).attr("class", "state-description");
27
+ let a = !0, s = !0;
28
+ i.descriptions.forEach(function(l) {
29
+ a || (d(x, l, s), s = !1), a = !1;
30
+ });
31
+ const y = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + g + t().state.dividerMargin / 2).attr("y2", t().state.padding + g + t().state.dividerMargin / 2).attr("class", "descr-divider"), p = x.node().getBBox(), c = Math.max(p.width, n.width);
32
+ return y.attr("x2", c + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c + 2 * t().state.padding).attr("height", p.height + g + 2 * t().state.padding).attr("rx", t().state.radius), e;
33
+ }, "drawDescrState"), K = /* @__PURE__ */ u((e, i, d) => {
34
+ const o = t().state.padding, n = 2 * t().state.padding, g = e.node().getBBox(), x = g.width, a = g.x, s = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), p = s.node().getBBox().width + n;
35
+ let c = Math.max(p, x);
36
+ c === x && (c = c + n);
37
+ let l;
38
+ const B = e.node().getBBox();
39
+ i.doc, l = a - o, p > x && (l = (x - c) / 2 + o), Math.abs(a - B.x) < o && p > x && (l = a - (p - x) / 2);
40
+ const m = 1 - t().state.textHeight;
41
+ return e.insert("rect", ":first-child").attr("x", l).attr("y", m).attr("class", d ? "alt-composit" : "composit").attr("width", c).attr(
42
+ "height",
43
+ B.height + t().state.textHeight + t().state.titleShift + 1
44
+ ).attr("rx", "0"), s.attr("x", l + o), p <= x && s.attr("x", a + (c - n) / 2 - p / 2 + o), e.insert("rect", ":first-child").attr("x", l).attr(
45
+ "y",
46
+ t().state.titleShift - t().state.textHeight - t().state.padding
47
+ ).attr("width", c).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", l).attr(
48
+ "y",
49
+ t().state.titleShift - t().state.textHeight - t().state.padding
50
+ ).attr("width", c).attr("height", B.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
51
+ }, "addTitleAndBox"), V = /* @__PURE__ */ u((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
52
+ "cx",
53
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
54
+ ).attr(
55
+ "cy",
56
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
57
+ ), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), tt = /* @__PURE__ */ u((e, i) => {
58
+ let d = t().state.forkWidth, o = t().state.forkHeight;
59
+ if (i.parentId) {
60
+ let n = d;
61
+ d = o, o = n;
62
+ }
63
+ return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", o).attr("x", t().state.padding).attr("y", t().state.padding);
64
+ }, "drawForkJoinState"), et = /* @__PURE__ */ u((e, i, d, o) => {
65
+ let n = 0;
66
+ const g = o.append("text");
67
+ g.style("text-anchor", "start"), g.attr("class", "noteText");
68
+ let x = e.replace(/\r\n/g, "<br/>");
69
+ x = x.replace(/\n/g, "<br/>");
70
+ const a = x.split(z.lineBreakRegex);
71
+ let s = 1.25 * t().state.noteMargin;
72
+ for (const y of a) {
73
+ const p = y.trim();
74
+ if (p.length > 0) {
75
+ const c = g.append("tspan");
76
+ if (c.text(p), s === 0) {
77
+ const l = c.node().getBBox();
78
+ s += l.height;
79
+ }
80
+ n += s, c.attr("x", i + t().state.noteMargin), c.attr("y", d + n + 1.25 * t().state.noteMargin);
81
+ }
82
+ }
83
+ return { textWidth: g.node().getBBox().width, textHeight: n };
84
+ }, "_drawLongText"), at = /* @__PURE__ */ u((e, i) => {
85
+ i.attr("class", "state-note");
86
+ const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), o = i.append("g"), { textWidth: n, textHeight: g } = et(e, 0, 0, o);
87
+ return d.attr("height", g + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
88
+ }, "drawNote"), R = /* @__PURE__ */ u(function(e, i) {
89
+ const d = i.id, o = {
90
+ id: d,
91
+ label: i.id,
92
+ width: 0,
93
+ height: 0
94
+ }, n = e.append("g").attr("id", d).attr("class", "stateGroup");
95
+ i.type === "start" && j(n), i.type === "end" && V(n), (i.type === "fork" || i.type === "join") && tt(n, i), i.type === "note" && at(i.note.text, n), i.type === "divider" && q(n), i.type === "default" && i.descriptions.length === 0 && Q(n, i), i.type === "default" && i.descriptions.length > 0 && Z(n, i);
96
+ const g = n.node().getBBox();
97
+ return o.width = g.width + 2 * t().state.padding, o.height = g.height + 2 * t().state.padding, $.set(d, o), o;
98
+ }, "drawState"), _ = 0, it = /* @__PURE__ */ u(function(e, i, d) {
99
+ const o = /* @__PURE__ */ u(function(s) {
100
+ switch (s) {
101
+ case N.relationType.AGGREGATION:
102
+ return "aggregation";
103
+ case N.relationType.EXTENSION:
104
+ return "extension";
105
+ case N.relationType.COMPOSITION:
106
+ return "composition";
107
+ case N.relationType.DEPENDENCY:
108
+ return "dependency";
109
+ }
110
+ }, "getRelationType");
111
+ i.points = i.points.filter((s) => !Number.isNaN(s.y));
112
+ const n = i.points, g = U().x(function(s) {
113
+ return s.x;
114
+ }).y(function(s) {
115
+ return s.y;
116
+ }).curve(F), x = e.append("path").attr("d", g(n)).attr("id", "edge" + _).attr("class", "transition");
117
+ let a = "";
118
+ if (t().state.arrowMarkerAbsolute && (a = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, a = a.replace(/\(/g, "\\("), a = a.replace(/\)/g, "\\)")), x.attr(
119
+ "marker-end",
120
+ "url(" + a + "#" + o(N.relationType.DEPENDENCY) + "End)"
121
+ ), d.title !== void 0) {
122
+ const s = e.append("g").attr("class", "stateLabel"), { x: y, y: p } = O.calcLabelPosition(i.points), c = z.getRows(d.title);
123
+ let l = 0;
124
+ const B = [];
125
+ let m = 0, k = 0;
126
+ for (let f = 0; f <= c.length; f++) {
127
+ const h = s.append("text").attr("text-anchor", "middle").text(c[f]).attr("x", y).attr("y", p + l), w = h.node().getBBox();
128
+ m = Math.max(m, w.width), k = Math.min(k, w.x), S.info(w.x, y, p + l), l === 0 && (l = h.node().getBBox().height, S.info("Title height", l, p)), B.push(h);
129
+ }
130
+ let E = l * c.length;
131
+ if (c.length > 1) {
132
+ const f = (c.length - 1) * l * 0.5;
133
+ B.forEach((h, w) => h.attr("y", p + w * l - f)), E = l * c.length;
134
+ }
135
+ const r = s.node().getBBox();
136
+ s.insert("rect", ":first-child").attr("class", "box").attr("x", y - m / 2 - t().state.padding / 2).attr("y", p - E / 2 - t().state.padding / 2 - 3.5).attr("width", m + t().state.padding).attr("height", E + t().state.padding), S.info(r);
137
+ }
138
+ _++;
139
+ }, "drawEdge"), b, T = {}, rt = /* @__PURE__ */ u(function() {
140
+ }, "setConf"), nt = /* @__PURE__ */ u(function(e) {
141
+ e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
142
+ }, "insertMarkers"), st = /* @__PURE__ */ u(function(e, i, d, o) {
143
+ b = t().state;
144
+ const n = t().securityLevel;
145
+ let g;
146
+ n === "sandbox" && (g = H("#i" + i));
147
+ const x = n === "sandbox" ? H(g.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? g.nodes()[0].contentDocument : document;
148
+ S.debug("Rendering diagram " + e);
149
+ const s = x.select(`[id='${i}']`);
150
+ nt(s);
151
+ const y = o.db.getRootDoc();
152
+ G(y, s, void 0, !1, x, a, o);
153
+ const p = b.padding, c = s.node().getBBox(), l = c.width + p * 2, B = c.height + p * 2, m = l * 1.75;
154
+ C(s, B, m, b.useMaxWidth), s.attr(
155
+ "viewBox",
156
+ `${c.x - b.padding} ${c.y - b.padding} ` + l + " " + B
157
+ );
158
+ }, "draw"), dt = /* @__PURE__ */ u((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), G = /* @__PURE__ */ u((e, i, d, o, n, g, x) => {
159
+ const a = new J({
160
+ compound: !0,
161
+ multigraph: !0
162
+ });
163
+ let s, y = !0;
164
+ for (s = 0; s < e.length; s++)
165
+ if (e[s].stmt === "relation") {
166
+ y = !1;
167
+ break;
168
+ }
169
+ d ? a.setGraph({
170
+ rankdir: "LR",
171
+ multigraph: !0,
172
+ compound: !0,
173
+ // acyclicer: 'greedy',
174
+ ranker: "tight-tree",
175
+ ranksep: y ? 1 : b.edgeLengthFactor,
176
+ nodeSep: y ? 1 : 50,
177
+ isMultiGraph: !0
178
+ // ranksep: 5,
179
+ // nodesep: 1
180
+ }) : a.setGraph({
181
+ rankdir: "TB",
182
+ multigraph: !0,
183
+ compound: !0,
184
+ // isCompound: true,
185
+ // acyclicer: 'greedy',
186
+ // ranker: 'longest-path'
187
+ ranksep: y ? 1 : b.edgeLengthFactor,
188
+ nodeSep: y ? 1 : 50,
189
+ ranker: "tight-tree",
190
+ // ranker: 'network-simplex'
191
+ isMultiGraph: !0
192
+ }), a.setDefaultEdgeLabel(function() {
193
+ return {};
194
+ });
195
+ const p = x.db.getStates(), c = x.db.getRelations(), l = Object.keys(p);
196
+ for (const r of l) {
197
+ const f = p[r];
198
+ d && (f.parentId = d);
199
+ let h;
200
+ if (f.doc) {
201
+ let w = i.append("g").attr("id", f.id).attr("class", "stateGroup");
202
+ h = G(f.doc, w, f.id, !o, n, g, x);
203
+ {
204
+ w = K(w, f, o);
205
+ let v = w.node().getBBox();
206
+ h.width = v.width, h.height = v.height + b.padding / 2, T[f.id] = { y: b.compositTitleSize };
207
+ }
208
+ } else
209
+ h = R(i, f, a);
210
+ if (f.note) {
211
+ const w = {
212
+ descriptions: [],
213
+ id: f.id + "-note",
214
+ note: f.note,
215
+ type: "note"
216
+ }, v = R(i, w, a);
217
+ f.note.position === "left of" ? (a.setNode(h.id + "-note", v), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", v)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
218
+ } else
219
+ a.setNode(h.id, h);
220
+ }
221
+ S.debug("Count=", a.nodeCount(), a);
222
+ let B = 0;
223
+ c.forEach(function(r) {
224
+ B++, S.debug("Setting edge", r), a.setEdge(
225
+ r.id1,
226
+ r.id2,
227
+ {
228
+ relation: r,
229
+ width: dt(r.title),
230
+ height: b.labelHeight * z.getRows(r.title).length,
231
+ labelpos: "c"
232
+ },
233
+ "id" + B
234
+ );
235
+ }), X(a), S.debug("Graph after layout", a.nodes());
236
+ const m = i.node();
237
+ a.nodes().forEach(function(r) {
238
+ r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + m.id + " #" + r).attr(
239
+ "transform",
240
+ "translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (T[r] ? T[r].y : 0) - a.node(r).height / 2) + " )"
241
+ ), n.select("#" + m.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), g.querySelectorAll("#" + m.id + " #" + r + " .divider").forEach((h) => {
242
+ const w = h.parentElement;
243
+ let v = 0, M = 0;
244
+ w && (w.parentElement && (v = w.parentElement.getBBox().width), M = parseInt(w.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", v - M - 8);
245
+ })) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
246
+ });
247
+ let k = m.getBBox();
248
+ a.edges().forEach(function(r) {
249
+ r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), it(i, a.edge(r), a.edge(r).relation));
250
+ }), k = m.getBBox();
251
+ const E = {
252
+ id: d || "root",
253
+ label: d || "root",
254
+ width: 0,
255
+ height: 0
256
+ };
257
+ return E.width = k.width + 2 * b.padding, E.height = k.height + 2 * b.padding, S.debug("Doc rendered", E, a), E;
258
+ }, "renderDoc"), ot = {
259
+ setConf: rt,
260
+ draw: st
261
+ }, wt = {
262
+ parser: W,
263
+ get db() {
264
+ return new N(1);
265
+ },
266
+ renderer: ot,
267
+ styles: P,
268
+ init: /* @__PURE__ */ u((e) => {
269
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
270
+ }, "init")
271
+ };
272
+ export {
273
+ wt as diagram
274
+ };
@@ -0,0 +1,18 @@
1
+ import { s as t, S as r, b as a, a as s } from "./chunk-AEK57VVT-bd6e836f.mjs";
2
+ import { _ as i } from "./index-f5aac161.mjs";
3
+ import "./chunk-RZ5BOZE2-ebe3985e.mjs";
4
+ import "vue";
5
+ var l = {
6
+ parser: t,
7
+ get db() {
8
+ return new r(2);
9
+ },
10
+ renderer: a,
11
+ styles: s,
12
+ init: /* @__PURE__ */ i((e) => {
13
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
14
+ }, "init")
15
+ };
16
+ export {
17
+ l as diagram
18
+ };