bg-editor 0.0.1

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 (67) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +51 -0
  3. package/README.zh-CN.md +51 -0
  4. package/dist/_basePickBy-4kmg42pS.js +158 -0
  5. package/dist/_baseUniq-WOvvCHTI.js +621 -0
  6. package/dist/arc-wItjmL5I.js +90 -0
  7. package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
  8. package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
  9. package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
  10. package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
  11. package/dist/channel-Dah4F59k.js +12 -0
  12. package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
  13. package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
  14. package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
  15. package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
  16. package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
  17. package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
  18. package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
  19. package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
  20. package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
  21. package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
  22. package/dist/clone-C74UiRbr.js +15 -0
  23. package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
  24. package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
  25. package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
  26. package/dist/defaultLocale-DgmhL6Re.js +178 -0
  27. package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
  28. package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
  29. package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
  30. package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
  31. package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
  32. package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
  33. package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
  34. package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
  35. package/dist/graph-CnOTx4E0.js +254 -0
  36. package/dist/index-D6-Wf75-.js +122127 -0
  37. package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
  38. package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
  39. package/dist/init-d639unba.js +23 -0
  40. package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
  41. package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
  42. package/dist/layout-OXk4OSoz.js +1342 -0
  43. package/dist/linear-CO_vz87n.js +266 -0
  44. package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
  45. package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
  46. package/dist/ordinal-CofNqUw2.js +68 -0
  47. package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
  48. package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
  49. package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
  50. package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
  51. package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
  52. package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
  53. package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
  54. package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
  55. package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
  57. package/dist/style.css +1 -0
  58. package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
  59. package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
  60. package/dist/umo-editor.js +16 -0
  61. package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
  62. package/package.json +200 -0
  63. package/types/index.d.ts +277 -0
  64. package/types/src/components/index.d.ts +9 -0
  65. package/types/src/components/menus/button.vue.d.ts +583 -0
  66. package/types/src/components/modal.vue.d.ts +2 -0
  67. package/types/src/components/tooltip.vue.d.ts +27 -0
@@ -0,0 +1,451 @@
1
+ import "./style.css";
2
+ import { _ as w, ar as F, as as Y, at as _, au as H, l as r, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./index-D6-Wf75-.js";
3
+ import { G as B } from "./graph-CnOTx4E0.js";
4
+ import { l as I } from "./layout-OXk4OSoz.js";
5
+ import { i as b } from "./_baseUniq-WOvvCHTI.js";
6
+ import { c as L } from "./clone-C74UiRbr.js";
7
+ import { m as A } from "./_basePickBy-4kmg42pS.js";
8
+ /**
9
+ * @umoteam/editor 9.0.1
10
+ * @license MIT
11
+ * @author umodoc https://www.umodoc.com
12
+ * @see https://www.umodoc.com
13
+ **/
14
+ function h(e) {
15
+ var t = {
16
+ options: {
17
+ directed: e.isDirected(),
18
+ multigraph: e.isMultigraph(),
19
+ compound: e.isCompound()
20
+ },
21
+ nodes: ee(e),
22
+ edges: ne(e)
23
+ };
24
+ return b(e.graph()) || (t.value = L(e.graph())), t;
25
+ }
26
+ function ee(e) {
27
+ return A(e.nodes(), function(t) {
28
+ var n = e.node(t), a = e.parent(t), i = { v: t };
29
+ return b(n) || (i.value = n), b(a) || (i.parent = a), i;
30
+ });
31
+ }
32
+ function ne(e) {
33
+ return A(e.edges(), function(t) {
34
+ var n = e.edge(t), a = { v: t.v, w: t.w };
35
+ return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
36
+ });
37
+ }
38
+ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
39
+ p.clear(), J.clear(), d.clear();
40
+ }, "clear"), D = /* @__PURE__ */ w((e, t) => {
41
+ const n = p.get(t) || [];
42
+ return r.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
43
+ }, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
44
+ const n = p.get(t) || [];
45
+ return r.info("Descendants of ", t, " is ", n), r.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (r.debug("Tilt, ", t, ",not in descendants"), !1);
46
+ }, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
47
+ r.warn(
48
+ "Copying children of ",
49
+ e,
50
+ "root",
51
+ a,
52
+ "data",
53
+ t.node(e),
54
+ a
55
+ );
56
+ const i = t.children(e) || [];
57
+ e !== a && i.push(e), r.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach((o) => {
58
+ if (t.children(o).length > 0)
59
+ G(o, t, n, a);
60
+ else {
61
+ const l = t.node(o);
62
+ r.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (r.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (r.debug("Setting parent", o, e), n.setParent(o, e)) : (r.info("In copy ", e, "root", a, "data", t.node(e), a), r.debug(
63
+ "Not Setting parent for node=",
64
+ o,
65
+ "cluster!==rootId",
66
+ e !== a,
67
+ "node!==clusterId",
68
+ o !== e
69
+ ));
70
+ const u = t.edges(o);
71
+ r.debug("Copying Edges", u), u.forEach((c) => {
72
+ r.info("Edge", c);
73
+ const m = t.edge(c.v, c.w, c.name);
74
+ r.info("Edge data", m, a);
75
+ try {
76
+ se(c, a) ? (r.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), r.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : r.info(
77
+ "Skipping copy of edge ",
78
+ c.v,
79
+ "-->",
80
+ c.w,
81
+ " rootId: ",
82
+ a,
83
+ " clusterId:",
84
+ e
85
+ );
86
+ } catch (v) {
87
+ r.error(v);
88
+ }
89
+ });
90
+ }
91
+ r.debug("Removing node", o), t.removeNode(o);
92
+ });
93
+ }, "copy"), R = /* @__PURE__ */ w((e, t) => {
94
+ const n = t.children(e);
95
+ let a = [...n];
96
+ for (const i of n)
97
+ J.set(i, e), a = [...a, ...R(i, t)];
98
+ return a;
99
+ }, "extractDescendants"), re = /* @__PURE__ */ w((e, t, n) => {
100
+ const a = e.edges().filter((c) => c.v === t || c.w === t), i = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = i.map((c) => ({ v: c.v, w: c.w }));
101
+ return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
102
+ }, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
103
+ const a = t.children(e);
104
+ if (r.trace("Searching children of id ", e, a), a.length < 1)
105
+ return e;
106
+ let i;
107
+ for (const o of a) {
108
+ const l = C(o, t, n), u = re(t, n, l);
109
+ if (l)
110
+ if (u.length > 0)
111
+ i = l;
112
+ else
113
+ return l;
114
+ }
115
+ return i;
116
+ }, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), ie = /* @__PURE__ */ w((e, t) => {
117
+ if (!e || t > 10) {
118
+ r.debug("Opting out, no graph ");
119
+ return;
120
+ } else
121
+ r.debug("Opting in, graph ");
122
+ e.nodes().forEach(function(n) {
123
+ e.children(n).length > 0 && (r.warn(
124
+ "Cluster identified",
125
+ n,
126
+ " Replacement id in edges: ",
127
+ C(n, e, n)
128
+ ), p.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
129
+ }), e.nodes().forEach(function(n) {
130
+ const a = e.children(n), i = e.edges();
131
+ a.length > 0 ? (r.debug("Cluster identified", n, p), i.forEach((o) => {
132
+ const l = D(o.v, n), u = D(o.w, n);
133
+ l ^ u && (r.warn("Edge: ", o, " leaves cluster ", n), r.warn("Descendants of XXX ", n, ": ", p.get(n)), d.get(n).externalConnections = !0);
134
+ })) : r.debug("Not a cluster ", n, p);
135
+ });
136
+ for (let n of d.keys()) {
137
+ const a = d.get(n).id, i = e.parent(a);
138
+ i !== n && d.has(i) && !d.get(i).externalConnections && (d.get(n).id = i);
139
+ }
140
+ e.edges().forEach(function(n) {
141
+ const a = e.edge(n);
142
+ r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
143
+ let i = n.v, o = n.w;
144
+ if (r.warn(
145
+ "Fix XXX",
146
+ d,
147
+ "ids:",
148
+ n.v,
149
+ n.w,
150
+ "Translating: ",
151
+ d.get(n.v),
152
+ " --- ",
153
+ d.get(n.w)
154
+ ), d.get(n.v) || d.get(n.w)) {
155
+ if (r.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), i = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), i !== n.v) {
156
+ const l = e.parent(i);
157
+ d.get(l).externalConnections = !0, a.fromCluster = n.v;
158
+ }
159
+ if (o !== n.w) {
160
+ const l = e.parent(o);
161
+ d.get(l).externalConnections = !0, a.toCluster = n.w;
162
+ }
163
+ r.warn("Fix Replacing with XXX", i, o, n.name), e.setEdge(i, o, a, n.name);
164
+ }
165
+ }), r.warn("Adjusted Graph", h(e)), T(e, 0), r.trace(d);
166
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
167
+ if (r.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
168
+ r.error("Bailing out");
169
+ return;
170
+ }
171
+ let n = e.nodes(), a = !1;
172
+ for (const i of n) {
173
+ const o = e.children(i);
174
+ a = a || o.length > 0;
175
+ }
176
+ if (!a) {
177
+ r.debug("Done, no node has children", e.nodes());
178
+ return;
179
+ }
180
+ r.debug("Nodes = ", n, t);
181
+ for (const i of n)
182
+ if (r.debug(
183
+ "Extracting node",
184
+ i,
185
+ d,
186
+ d.has(i) && !d.get(i).externalConnections,
187
+ !e.parent(i),
188
+ e.node(i),
189
+ e.children("D"),
190
+ " Depth ",
191
+ t
192
+ ), !d.has(i))
193
+ r.debug("Not a cluster", i, t);
194
+ else if (!d.get(i).externalConnections && e.children(i) && e.children(i).length > 0) {
195
+ r.warn(
196
+ "Cluster without external connections, without a parent and with children",
197
+ i,
198
+ t
199
+ );
200
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
201
+ d.get(i)?.clusterData?.dir && (l = d.get(i).clusterData.dir, r.warn("Fixing dir", d.get(i).clusterData.dir, l));
202
+ const u = new B({
203
+ multigraph: !0,
204
+ compound: !0
205
+ }).setGraph({
206
+ rankdir: l,
207
+ nodesep: 50,
208
+ ranksep: 50,
209
+ marginx: 8,
210
+ marginy: 8
211
+ }).setDefaultEdgeLabel(function() {
212
+ return {};
213
+ });
214
+ r.warn("Old graph before copy", h(e)), G(i, e, u, i), e.setNode(i, {
215
+ clusterNode: !0,
216
+ id: i,
217
+ clusterData: d.get(i).clusterData,
218
+ label: d.get(i).label,
219
+ graph: u
220
+ }), r.warn("New graph after copy node: (", i, ")", h(u)), r.debug("Old graph after copy", h(e));
221
+ } else
222
+ r.warn(
223
+ "Cluster ** ",
224
+ i,
225
+ " **not meeting the criteria !externalConnections:",
226
+ !d.get(i).externalConnections,
227
+ " no parent: ",
228
+ !e.parent(i),
229
+ " children ",
230
+ e.children(i) && e.children(i).length > 0,
231
+ e.children("D"),
232
+ t
233
+ ), r.debug(d);
234
+ n = e.nodes(), r.warn("New list of nodes", n);
235
+ for (const i of n) {
236
+ const o = e.node(i);
237
+ r.warn(" Now next level", i, o), o?.clusterNode && T(o.graph, t + 1);
238
+ }
239
+ }, "extractor"), M = /* @__PURE__ */ w((e, t) => {
240
+ if (t.length === 0)
241
+ return [];
242
+ let n = Object.assign([], t);
243
+ return t.forEach((a) => {
244
+ const i = e.children(a), o = M(e, i);
245
+ n = [...n, ...o];
246
+ }), n;
247
+ }, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, i, o) => {
248
+ r.warn("Graph in recursive render:XAX", h(t), i);
249
+ const l = t.graph().rankdir;
250
+ r.trace("Dir in recursive render - dir:", l);
251
+ const u = e.insert("g").attr("class", "root");
252
+ t.nodes() ? r.info("Recursive render XXX", t.nodes()) : r.info("No nodes found for", t), t.edges().length > 0 && r.info("Recursive edges", t.edge(t.edges()[0]));
253
+ const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
254
+ await Promise.all(
255
+ t.nodes().map(async function(f) {
256
+ const s = t.node(f);
257
+ if (i !== void 0) {
258
+ const g = JSON.parse(JSON.stringify(i.clusterData));
259
+ r.trace(
260
+ `Setting data for parent cluster XXX
261
+ Node.id = `,
262
+ f,
263
+ `
264
+ data=`,
265
+ g.height,
266
+ `
267
+ Parent cluster`,
268
+ i.height
269
+ ), t.setNode(i.id, g), t.parent(f) || (r.trace("Setting parent", f, i.id), t.setParent(f, i.id, g));
270
+ }
271
+ if (r.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
272
+ r.info("Cluster identified XBX", f, s.width, t.node(f));
273
+ const { ranksep: g, nodesep: E } = t.graph();
274
+ s.graph.setGraph({
275
+ ...s.graph.graph(),
276
+ ranksep: g + 25,
277
+ nodesep: E
278
+ });
279
+ const N = await j(
280
+ X,
281
+ s.graph,
282
+ n,
283
+ a,
284
+ t.node(f),
285
+ o
286
+ ), x = N.elem;
287
+ z(s, x), s.diff = N.diff || 0, r.info(
288
+ "New compound node after recursive render XAX",
289
+ f,
290
+ "width",
291
+ // node,
292
+ s.width,
293
+ "height",
294
+ s.height
295
+ // node.x,
296
+ // node.y
297
+ ), U(x, s);
298
+ } else
299
+ t.children(f).length > 0 ? (r.trace(
300
+ "Cluster - the non recursive path XBX",
301
+ f,
302
+ s.id,
303
+ s,
304
+ s.width,
305
+ "Graph:",
306
+ t
307
+ ), r.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (r.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
308
+ })
309
+ ), await (/* @__PURE__ */ w(async () => {
310
+ const f = t.edges().map(async function(s) {
311
+ const g = t.edge(s.v, s.w, s.name);
312
+ r.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), r.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), r.info(
313
+ "Fix",
314
+ d,
315
+ "ids:",
316
+ s.v,
317
+ s.w,
318
+ "Translating: ",
319
+ d.get(s.v),
320
+ d.get(s.w)
321
+ ), await Z(v, g);
322
+ });
323
+ await Promise.all(f);
324
+ }, "processEdges"))(), r.info("Graph before layout:", JSON.stringify(h(t))), r.info("############################################# XXX"), r.info("### Layout ### XXX"), r.info("############################################# XXX"), I(t), r.info("Graph after layout:", JSON.stringify(h(t)));
325
+ let O = 0, { subGraphTitleTotalMargin: S } = q(o);
326
+ return await Promise.all(
327
+ oe(t).map(async function(f) {
328
+ const s = t.node(f);
329
+ if (r.info(
330
+ "Position XBX => " + f + ": (" + s.x,
331
+ "," + s.y,
332
+ ") width: ",
333
+ s.width,
334
+ " height: ",
335
+ s.height
336
+ ), s?.clusterNode)
337
+ s.y += S, r.info(
338
+ "A tainted cluster node XBX1",
339
+ f,
340
+ s.id,
341
+ s.width,
342
+ s.height,
343
+ s.x,
344
+ s.y,
345
+ t.parent(f)
346
+ ), d.get(s.id).node = s, P(s);
347
+ else if (t.children(f).length > 0) {
348
+ r.info(
349
+ "A pure cluster node XBX1",
350
+ f,
351
+ s.id,
352
+ s.x,
353
+ s.y,
354
+ s.width,
355
+ s.height,
356
+ t.parent(f)
357
+ ), s.height += S, t.node(s.parentId);
358
+ const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
359
+ r.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
360
+ } else {
361
+ const g = t.node(s.parentId);
362
+ s.y += S / 2, r.info(
363
+ "A regular node XBX1 - using the padding",
364
+ s.id,
365
+ "parent",
366
+ s.parentId,
367
+ s.width,
368
+ s.height,
369
+ s.x,
370
+ s.y,
371
+ "offsetY",
372
+ s.offsetY,
373
+ "parent",
374
+ g,
375
+ g?.offsetY,
376
+ s
377
+ ), P(s);
378
+ }
379
+ })
380
+ ), t.edges().forEach(function(f) {
381
+ const s = t.edge(f);
382
+ r.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
383
+ const g = t.node(f.v);
384
+ var E = t.node(f.w);
385
+ const N = Q(m, s, d, n, g, E, a);
386
+ W(s, N);
387
+ }), t.nodes().forEach(function(f) {
388
+ const s = t.node(f);
389
+ r.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
390
+ }), r.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
391
+ }, "recursiveRender"), we = /* @__PURE__ */ w(async (e, t) => {
392
+ const n = new B({
393
+ multigraph: !0,
394
+ compound: !0
395
+ }).setGraph({
396
+ rankdir: e.direction,
397
+ nodesep: e.config?.nodeSpacing || e.config?.flowchart?.nodeSpacing || e.nodeSpacing,
398
+ ranksep: e.config?.rankSpacing || e.config?.flowchart?.rankSpacing || e.rankSpacing,
399
+ marginx: 8,
400
+ marginy: 8
401
+ }).setDefaultEdgeLabel(function() {
402
+ return {};
403
+ }), a = t.select("g");
404
+ F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
405
+ n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
406
+ }), r.debug("Edges:", e.edges), e.edges.forEach((o) => {
407
+ if (o.start === o.end) {
408
+ const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
409
+ n.setNode(u, {
410
+ domId: u,
411
+ id: u,
412
+ parentId: m.parentId,
413
+ labelStyle: "",
414
+ label: "",
415
+ padding: 0,
416
+ shape: "labelRect",
417
+ // shape: 'rect',
418
+ style: "",
419
+ width: 10,
420
+ height: 10
421
+ }), n.setParent(u, m.parentId), n.setNode(c, {
422
+ domId: c,
423
+ id: c,
424
+ parentId: m.parentId,
425
+ labelStyle: "",
426
+ padding: 0,
427
+ // shape: 'rect',
428
+ shape: "labelRect",
429
+ label: "",
430
+ style: "",
431
+ width: 10,
432
+ height: 10
433
+ }), n.setParent(c, m.parentId);
434
+ const v = structuredClone(o), X = structuredClone(o), y = structuredClone(o);
435
+ v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", y.label = "", m.isGroup && (v.fromCluster = l, y.toCluster = l), y.id = l + "-cyclic-special-2", y.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, y, l + "-cyc<lic-special-2");
436
+ } else
437
+ n.setEdge(o.start, o.end, { ...o }, o.id);
438
+ }), r.warn("Graph at first:", JSON.stringify(h(n))), ie(n), r.warn("Graph after XAX:", JSON.stringify(h(n)));
439
+ const i = V();
440
+ await j(
441
+ a,
442
+ n,
443
+ e.type,
444
+ e.diagramId,
445
+ void 0,
446
+ i
447
+ );
448
+ }, "render");
449
+ export {
450
+ we as render
451
+ };
@@ -0,0 +1,178 @@
1
+ import "./style.css";
2
+ /**
3
+ * @umoteam/editor 9.0.1
4
+ * @license MIT
5
+ * @author umodoc https://www.umodoc.com
6
+ * @see https://www.umodoc.com
7
+ **/
8
+ function H(n) {
9
+ return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
10
+ }
11
+ function j(n, t) {
12
+ if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null;
13
+ var e, i = n.slice(0, e);
14
+ return [
15
+ i.length > 1 ? i[0] + i.slice(2) : i,
16
+ +n.slice(e + 1)
17
+ ];
18
+ }
19
+ function J(n) {
20
+ return n = j(Math.abs(n)), n ? n[1] : NaN;
21
+ }
22
+ function K(n, t) {
23
+ return function(e, i) {
24
+ for (var o = e.length, f = [], c = 0, u = n[0], b = 0; o > 0 && u > 0 && (b + u + 1 > i && (u = Math.max(1, i - b)), f.push(e.substring(o -= u, o + u)), !((b += u + 1) > i)); )
25
+ u = n[c = (c + 1) % n.length];
26
+ return f.reverse().join(t);
27
+ };
28
+ }
29
+ function Q(n) {
30
+ return function(t) {
31
+ return t.replace(/[0-9]/g, function(e) {
32
+ return n[+e];
33
+ });
34
+ };
35
+ }
36
+ var V = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
37
+ function N(n) {
38
+ if (!(t = V.exec(n))) throw new Error("invalid format: " + n);
39
+ var t;
40
+ return new $({
41
+ fill: t[1],
42
+ align: t[2],
43
+ sign: t[3],
44
+ symbol: t[4],
45
+ zero: t[5],
46
+ width: t[6],
47
+ comma: t[7],
48
+ precision: t[8] && t[8].slice(1),
49
+ trim: t[9],
50
+ type: t[10]
51
+ });
52
+ }
53
+ N.prototype = $.prototype;
54
+ function $(n) {
55
+ this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
56
+ }
57
+ $.prototype.toString = function() {
58
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
59
+ };
60
+ function W(n) {
61
+ n: for (var t = n.length, e = 1, i = -1, o; e < t; ++e)
62
+ switch (n[e]) {
63
+ case ".":
64
+ i = o = e;
65
+ break;
66
+ case "0":
67
+ i === 0 && (i = e), o = e;
68
+ break;
69
+ default:
70
+ if (!+n[e]) break n;
71
+ i > 0 && (i = 0);
72
+ break;
73
+ }
74
+ return i > 0 ? n.slice(0, i) + n.slice(o + 1) : n;
75
+ }
76
+ var U;
77
+ function _(n, t) {
78
+ var e = j(n, t);
79
+ if (!e) return n + "";
80
+ var i = e[0], o = e[1], f = o - (U = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = i.length;
81
+ return f === c ? i : f > c ? i + new Array(f - c + 1).join("0") : f > 0 ? i.slice(0, f) + "." + i.slice(f) : "0." + new Array(1 - f).join("0") + j(n, Math.max(0, t + f - 1))[0];
82
+ }
83
+ function G(n, t) {
84
+ var e = j(n, t);
85
+ if (!e) return n + "";
86
+ var i = e[0], o = e[1];
87
+ return o < 0 ? "0." + new Array(-o).join("0") + i : i.length > o + 1 ? i.slice(0, o + 1) + "." + i.slice(o + 1) : i + new Array(o - i.length + 2).join("0");
88
+ }
89
+ const I = {
90
+ "%": (n, t) => (n * 100).toFixed(t),
91
+ b: (n) => Math.round(n).toString(2),
92
+ c: (n) => n + "",
93
+ d: H,
94
+ e: (n, t) => n.toExponential(t),
95
+ f: (n, t) => n.toFixed(t),
96
+ g: (n, t) => n.toPrecision(t),
97
+ o: (n) => Math.round(n).toString(8),
98
+ p: (n, t) => G(n * 100, t),
99
+ r: G,
100
+ s: _,
101
+ X: (n) => Math.round(n).toString(16).toUpperCase(),
102
+ x: (n) => Math.round(n).toString(16)
103
+ };
104
+ function X(n) {
105
+ return n;
106
+ }
107
+ var O = Array.prototype.map, R = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
108
+ function v(n) {
109
+ var t = n.grouping === void 0 || n.thousands === void 0 ? X : K(O.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", i = n.currency === void 0 ? "" : n.currency[1] + "", o = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? X : Q(O.call(n.numerals, String)), c = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", b = n.nan === void 0 ? "NaN" : n.nan + "";
110
+ function F(a) {
111
+ a = N(a);
112
+ var x = a.fill, M = a.align, h = a.sign, w = a.symbol, l = a.zero, S = a.width, E = a.comma, g = a.precision, L = a.trim, d = a.type;
113
+ d === "n" ? (E = !0, d = "g") : I[d] || (g === void 0 && (g = 12), L = !0, d = "g"), (l || x === "0" && M === "=") && (l = !0, x = "0", M = "=");
114
+ var Z = w === "$" ? e : w === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", q = w === "$" ? i : /[%p]/.test(d) ? c : "", T = I[d], B = /[defgprs%]/.test(d);
115
+ g = g === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, g)) : Math.max(0, Math.min(20, g));
116
+ function C(r) {
117
+ var y = Z, m = q, p, D, k;
118
+ if (d === "c")
119
+ m = T(r) + m, r = "";
120
+ else {
121
+ r = +r;
122
+ var P = r < 0 || 1 / r < 0;
123
+ if (r = isNaN(r) ? b : T(Math.abs(r), g), L && (r = W(r)), P && +r == 0 && h !== "+" && (P = !1), y = (P ? h === "(" ? h : u : h === "-" || h === "(" ? "" : h) + y, m = (d === "s" ? R[8 + U / 3] : "") + m + (P && h === "(" ? ")" : ""), B) {
124
+ for (p = -1, D = r.length; ++p < D; )
125
+ if (k = r.charCodeAt(p), 48 > k || k > 57) {
126
+ m = (k === 46 ? o + r.slice(p + 1) : r.slice(p)) + m, r = r.slice(0, p);
127
+ break;
128
+ }
129
+ }
130
+ }
131
+ E && !l && (r = t(r, 1 / 0));
132
+ var z = y.length + r.length + m.length, s = z < S ? new Array(S - z + 1).join(x) : "";
133
+ switch (E && l && (r = t(s + r, s.length ? S - m.length : 1 / 0), s = ""), M) {
134
+ case "<":
135
+ r = y + r + m + s;
136
+ break;
137
+ case "=":
138
+ r = y + s + r + m;
139
+ break;
140
+ case "^":
141
+ r = s.slice(0, z = s.length >> 1) + y + r + m + s.slice(z);
142
+ break;
143
+ default:
144
+ r = s + y + r + m;
145
+ break;
146
+ }
147
+ return f(r);
148
+ }
149
+ return C.toString = function() {
150
+ return a + "";
151
+ }, C;
152
+ }
153
+ function Y(a, x) {
154
+ var M = F((a = N(a), a.type = "f", a)), h = Math.max(-8, Math.min(8, Math.floor(J(x) / 3))) * 3, w = Math.pow(10, -h), l = R[8 + h / 3];
155
+ return function(S) {
156
+ return M(w * S) + l;
157
+ };
158
+ }
159
+ return {
160
+ format: F,
161
+ formatPrefix: Y
162
+ };
163
+ }
164
+ var A, nn, tn;
165
+ rn({
166
+ thousands: ",",
167
+ grouping: [3],
168
+ currency: ["$", ""]
169
+ });
170
+ function rn(n) {
171
+ return A = v(n), nn = A.format, tn = A.formatPrefix, A;
172
+ }
173
+ export {
174
+ tn as a,
175
+ nn as b,
176
+ J as e,
177
+ N as f
178
+ };