bg-editor 0.0.7 → 0.0.9

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 (59) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/umo-editor.js +90031 -7
  3. package/package.json +21 -1
  4. package/dist/_baseUniq-CK68Es8H.js +0 -473
  5. package/dist/arc-cD-4ba7d.js +0 -84
  6. package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
  7. package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
  8. package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
  9. package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
  10. package/dist/channel-DjTSKqWx.js +0 -6
  11. package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
  12. package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
  13. package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
  14. package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
  15. package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
  16. package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
  17. package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
  18. package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
  19. package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
  20. package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
  21. package/dist/clone-CIrbb4_D.js +0 -9
  22. package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
  23. package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
  24. package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
  25. package/dist/defaultLocale-DEnRyJdC.js +0 -172
  26. package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
  27. package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
  28. package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
  29. package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
  30. package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
  31. package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
  32. package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
  33. package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
  34. package/dist/graph-CG-rVaun.js +0 -382
  35. package/dist/index-LPeu-5gp.js +0 -164788
  36. package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
  37. package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
  38. package/dist/init-Dbt-6wo9.js +0 -17
  39. package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
  40. package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
  41. package/dist/layout-C7pGfQvF.js +0 -1416
  42. package/dist/linear-CQdBpz9H.js +0 -260
  43. package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
  44. package/dist/min-D7xNMq31.js +0 -39
  45. package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
  46. package/dist/ordinal-mgyNSFm_.js +0 -62
  47. package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
  48. package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
  49. package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
  50. package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
  51. package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
  52. package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
  53. package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
  54. package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
  55. package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
  56. package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
  57. package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
  58. package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
  59. package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
@@ -1,264 +0,0 @@
1
- import "./style.css";
2
- import { s as G, a as W, S as N } from "./chunk-DI55MBZ5-DkOlwdzs.js";
3
- import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./index-LPeu-5gp.js";
4
- import { G as O } from "./graph-CG-rVaun.js";
5
- import { l as J } from "./layout-C7pGfQvF.js";
6
- var X = /* @__PURE__ */ f((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"), D = /* @__PURE__ */ f((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"), Y = /* @__PURE__ */ f((e, i) => {
7
- 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), c = d.node().getBBox();
8
- return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
9
- }, "drawSimpleState"), I = /* @__PURE__ */ f((e, i) => {
10
- const d = /* @__PURE__ */ f(function(g, B, m) {
11
- const E = g.append("tspan").attr("x", 2 * t().state.padding).text(B);
12
- m || E.attr("dy", t().state.textHeight);
13
- }, "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(), l = n.height, x = e.append("text").attr("x", t().state.padding).attr(
14
- "y",
15
- l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
16
- ).attr("class", "state-description");
17
- let a = !0, s = !0;
18
- i.descriptions.forEach(function(g) {
19
- a || (d(x, g, s), s = !1), a = !1;
20
- });
21
- const w = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + l + t().state.dividerMargin / 2).attr("y2", t().state.padding + l + t().state.dividerMargin / 2).attr("class", "descr-divider"), p = x.node().getBBox(), o = Math.max(p.width, n.width);
22
- return w.attr("x2", o + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", o + 2 * t().state.padding).attr("height", p.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;
23
- }, "drawDescrState"), $ = /* @__PURE__ */ f((e, i, d) => {
24
- const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), x = l.width, a = l.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;
25
- let o = Math.max(p, x);
26
- o === x && (o = o + n);
27
- let g;
28
- const B = e.node().getBBox();
29
- i.doc, g = a - c, p > x && (g = (x - o) / 2 + c), Math.abs(a - B.x) < c && p > x && (g = a - (p - x) / 2);
30
- const m = 1 - t().state.textHeight;
31
- return e.insert("rect", ":first-child").attr("x", g).attr("y", m).attr("class", d ? "alt-composit" : "composit").attr("width", o).attr(
32
- "height",
33
- B.height + t().state.textHeight + t().state.titleShift + 1
34
- ).attr("rx", "0"), s.attr("x", g + c), p <= x && s.attr("x", a + (o - n) / 2 - p / 2 + c), e.insert("rect", ":first-child").attr("x", g).attr(
35
- "y",
36
- t().state.titleShift - t().state.textHeight - t().state.padding
37
- ).attr("width", o).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", g).attr(
38
- "y",
39
- t().state.titleShift - t().state.textHeight - t().state.padding
40
- ).attr("width", o).attr("height", B.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
41
- }, "addTitleAndBox"), q = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
42
- "cx",
43
- t().state.padding + t().state.sizeUnit + t().state.miniPadding
44
- ).attr(
45
- "cy",
46
- t().state.padding + t().state.sizeUnit + t().state.miniPadding
47
- ), 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"), Z = /* @__PURE__ */ f((e, i) => {
48
- let d = t().state.forkWidth, c = t().state.forkHeight;
49
- if (i.parentId) {
50
- let n = d;
51
- d = c, c = n;
52
- }
53
- return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
54
- }, "drawForkJoinState"), j = /* @__PURE__ */ f((e, i, d, c) => {
55
- let n = 0;
56
- const l = c.append("text");
57
- l.style("text-anchor", "start"), l.attr("class", "noteText");
58
- let x = e.replace(/\r\n/g, "<br/>");
59
- x = x.replace(/\n/g, "<br/>");
60
- const a = x.split(z.lineBreakRegex);
61
- let s = 1.25 * t().state.noteMargin;
62
- for (const w of a) {
63
- const p = w.trim();
64
- if (p.length > 0) {
65
- const o = l.append("tspan");
66
- if (o.text(p), s === 0) {
67
- const g = o.node().getBBox();
68
- s += g.height;
69
- }
70
- n += s, o.attr("x", i + t().state.noteMargin), o.attr("y", d + n + 1.25 * t().state.noteMargin);
71
- }
72
- }
73
- return { textWidth: l.node().getBBox().width, textHeight: n };
74
- }, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => {
75
- i.attr("class", "state-note");
76
- const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = j(e, 0, 0, c);
77
- return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
78
- }, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
79
- const d = i.id, c = {
80
- id: d,
81
- label: i.id,
82
- width: 0,
83
- height: 0
84
- }, n = e.append("g").attr("id", d).attr("class", "stateGroup");
85
- i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") && Z(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && D(n), i.type === "default" && i.descriptions.length === 0 && Y(n, i), i.type === "default" && i.descriptions.length > 0 && I(n, i);
86
- const l = n.node().getBBox();
87
- return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
88
- }, "drawState"), R = 0, Q = /* @__PURE__ */ f(function(e, i, d) {
89
- const c = /* @__PURE__ */ f(function(s) {
90
- switch (s) {
91
- case N.relationType.AGGREGATION:
92
- return "aggregation";
93
- case N.relationType.EXTENSION:
94
- return "extension";
95
- case N.relationType.COMPOSITION:
96
- return "composition";
97
- case N.relationType.DEPENDENCY:
98
- return "dependency";
99
- }
100
- }, "getRelationType");
101
- i.points = i.points.filter((s) => !Number.isNaN(s.y));
102
- const n = i.points, l = _().x(function(s) {
103
- return s.x;
104
- }).y(function(s) {
105
- return s.y;
106
- }).curve(U), x = e.append("path").attr("d", l(n)).attr("id", "edge" + R).attr("class", "transition");
107
- let a = "";
108
- if (t().state.arrowMarkerAbsolute && (a = C(!0)), x.attr(
109
- "marker-end",
110
- "url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
111
- ), d.title !== void 0) {
112
- const s = e.append("g").attr("class", "stateLabel"), { x: w, y: p } = F.calcLabelPosition(i.points), o = z.getRows(d.title);
113
- let g = 0;
114
- const B = [];
115
- let m = 0, E = 0;
116
- for (let u = 0; u <= o.length; u++) {
117
- const h = s.append("text").attr("text-anchor", "middle").text(o[u]).attr("x", w).attr("y", p + g), y = h.node().getBBox();
118
- m = Math.max(m, y.width), E = Math.min(E, y.x), S.info(y.x, w, p + g), g === 0 && (g = h.node().getBBox().height, S.info("Title height", g, p)), B.push(h);
119
- }
120
- let k = g * o.length;
121
- if (o.length > 1) {
122
- const u = (o.length - 1) * g * 0.5;
123
- B.forEach((h, y) => h.attr("y", p + y * g - u)), k = g * o.length;
124
- }
125
- const r = s.node().getBBox();
126
- s.insert("rect", ":first-child").attr("class", "box").attr("x", w - m / 2 - t().state.padding / 2).attr("y", p - k / 2 - t().state.padding / 2 - 3.5).attr("width", m + t().state.padding).attr("height", k + t().state.padding), S.info(r);
127
- }
128
- R++;
129
- }, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {
130
- }, "setConf"), tt = /* @__PURE__ */ f(function(e) {
131
- 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");
132
- }, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
133
- b = t().state;
134
- const n = t().securityLevel;
135
- let l;
136
- n === "sandbox" && (l = H("#i" + i));
137
- const x = n === "sandbox" ? H(l.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document;
138
- S.debug("Rendering diagram " + e);
139
- const s = x.select(`[id='${i}']`);
140
- tt(s);
141
- const w = c.db.getRootDoc();
142
- A(w, s, void 0, !1, x, a, c);
143
- const p = b.padding, o = s.node().getBBox(), g = o.width + p * 2, B = o.height + p * 2, m = g * 1.75;
144
- P(s, B, m, b.useMaxWidth), s.attr(
145
- "viewBox",
146
- `${o.x - b.padding} ${o.y - b.padding} ` + g + " " + B
147
- );
148
- }, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), A = /* @__PURE__ */ f((e, i, d, c, n, l, x) => {
149
- const a = new O({
150
- compound: !0,
151
- multigraph: !0
152
- });
153
- let s, w = !0;
154
- for (s = 0; s < e.length; s++)
155
- if (e[s].stmt === "relation") {
156
- w = !1;
157
- break;
158
- }
159
- d ? a.setGraph({
160
- rankdir: "LR",
161
- multigraph: !0,
162
- compound: !0,
163
- // acyclicer: 'greedy',
164
- ranker: "tight-tree",
165
- ranksep: w ? 1 : b.edgeLengthFactor,
166
- nodeSep: w ? 1 : 50,
167
- isMultiGraph: !0
168
- // ranksep: 5,
169
- // nodesep: 1
170
- }) : a.setGraph({
171
- rankdir: "TB",
172
- multigraph: !0,
173
- compound: !0,
174
- // isCompound: true,
175
- // acyclicer: 'greedy',
176
- // ranker: 'longest-path'
177
- ranksep: w ? 1 : b.edgeLengthFactor,
178
- nodeSep: w ? 1 : 50,
179
- ranker: "tight-tree",
180
- // ranker: 'network-simplex'
181
- isMultiGraph: !0
182
- }), a.setDefaultEdgeLabel(function() {
183
- return {};
184
- });
185
- const p = x.db.getStates(), o = x.db.getRelations(), g = Object.keys(p);
186
- for (const r of g) {
187
- const u = p[r];
188
- d && (u.parentId = d);
189
- let h;
190
- if (u.doc) {
191
- let y = i.append("g").attr("id", u.id).attr("class", "stateGroup");
192
- h = A(u.doc, y, u.id, !c, n, l, x);
193
- {
194
- y = $(y, u, c);
195
- let v = y.node().getBBox();
196
- h.width = v.width, h.height = v.height + b.padding / 2, T[u.id] = { y: b.compositTitleSize };
197
- }
198
- } else
199
- h = L(i, u, a);
200
- if (u.note) {
201
- const y = {
202
- descriptions: [],
203
- id: u.id + "-note",
204
- note: u.note,
205
- type: "note"
206
- }, v = L(i, y, a);
207
- u.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");
208
- } else
209
- a.setNode(h.id, h);
210
- }
211
- S.debug("Count=", a.nodeCount(), a);
212
- let B = 0;
213
- o.forEach(function(r) {
214
- B++, S.debug("Setting edge", r), a.setEdge(
215
- r.id1,
216
- r.id2,
217
- {
218
- relation: r,
219
- width: at(r.title),
220
- height: b.labelHeight * z.getRows(r.title).length,
221
- labelpos: "c"
222
- },
223
- "id" + B
224
- );
225
- }), J(a), S.debug("Graph after layout", a.nodes());
226
- const m = i.node();
227
- a.nodes().forEach(function(r) {
228
- r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + m.id + " #" + r).attr(
229
- "transform",
230
- "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) + " )"
231
- ), n.select("#" + m.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + m.id + " #" + r + " .divider").forEach((h) => {
232
- const y = h.parentElement;
233
- let v = 0, M = 0;
234
- y && (y.parentElement && (v = y.parentElement.getBBox().width), M = parseInt(y.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", v - M - 8);
235
- })) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
236
- });
237
- let E = m.getBBox();
238
- a.edges().forEach(function(r) {
239
- r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation));
240
- }), E = m.getBBox();
241
- const k = {
242
- id: d || "root",
243
- label: d || "root",
244
- width: 0,
245
- height: 0
246
- };
247
- return k.width = E.width + 2 * b.padding, k.height = E.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
248
- }, "renderDoc"), it = {
249
- setConf: V,
250
- draw: et
251
- }, ct = {
252
- parser: W,
253
- get db() {
254
- return new N(1);
255
- },
256
- renderer: it,
257
- styles: G,
258
- init: /* @__PURE__ */ f((e) => {
259
- e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
260
- }, "init")
261
- };
262
- export {
263
- ct as diagram
264
- };
@@ -1,17 +0,0 @@
1
- import "./style.css";
2
- import { s as t, b as a, a as r, S as s } from "./chunk-DI55MBZ5-DkOlwdzs.js";
3
- import { _ as i } from "./index-LPeu-5gp.js";
4
- var _ = {
5
- parser: r,
6
- get db() {
7
- return new s(2);
8
- },
9
- renderer: a,
10
- styles: t,
11
- init: /* @__PURE__ */ i((e) => {
12
- e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
13
- }, "init")
14
- };
15
- export {
16
- _ as diagram
17
- };