@zjlab-frontier/markdown 1.2.6 → 1.2.8

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 (93) hide show
  1. package/dist/_basePickBy-BKSBQzQ_.mjs +151 -0
  2. package/dist/_baseUniq-C5o5iO5w.mjs +614 -0
  3. package/dist/arc-CBfSUzPA.mjs +83 -0
  4. package/dist/architecture-U656AL7Q-BnMV_JKl.mjs +5 -0
  5. package/dist/architectureDiagram-VXUJARFQ-D2XPETMC.mjs +4661 -0
  6. package/dist/blockDiagram-VD42YOAC-DUECz_lY.mjs +2261 -0
  7. package/dist/{c4Diagram-c83219d4-DPiPzMng.mjs → c4Diagram-YG6GDRKO-CFmlTOHZ.mjs} +795 -794
  8. package/dist/{channel-DLtPd-ti.mjs → channel-Cn_QU-_B.mjs} +1 -1
  9. package/dist/chunk-4BX2VUAB-Ddlc-PTG.mjs +8 -0
  10. package/dist/chunk-55IACEB6-3bItwaWC.mjs +8 -0
  11. package/dist/chunk-B4BG7PRW-fzrbCD9m.mjs +1375 -0
  12. package/dist/chunk-DI55MBZ5-BsM6MitH.mjs +1370 -0
  13. package/dist/chunk-FMBD7UC4-D0L58RDY.mjs +19 -0
  14. package/dist/chunk-QN33PNHL-BRwIp2MO.mjs +19 -0
  15. package/dist/chunk-QZHKN3VN-3WK04u4j.mjs +15 -0
  16. package/dist/chunk-TZMSLE5B-QppC8KMb.mjs +64 -0
  17. package/dist/classDiagram-2ON5EDUG-DV1NEn5N.mjs +16 -0
  18. package/dist/classDiagram-v2-WZHVMYZB-DV1NEn5N.mjs +16 -0
  19. package/dist/{clone-Bekeo3TW.mjs → clone-BqweF2qi.mjs} +1 -1
  20. package/dist/cose-bilkent-S5V4N54A-v0swiza8.mjs +2608 -0
  21. package/dist/cytoscape.esm-MSgpKP8s.mjs +18721 -0
  22. package/dist/dagre-6UL2VRFP-BAviPdlZ.mjs +444 -0
  23. package/dist/defaultLocale-D7EN2tov.mjs +171 -0
  24. package/dist/diagram-PSM6KHXK-CfFtF0lE.mjs +531 -0
  25. package/dist/diagram-QEK2KX5R-CTU-B7VS.mjs +217 -0
  26. package/dist/diagram-S2PKOQOG-jCY9Tumq.mjs +142 -0
  27. package/dist/erDiagram-Q2GNP2WA-BcKQMz3F.mjs +841 -0
  28. package/dist/flowDiagram-NV44I4VS-udQXA0_8.mjs +1620 -0
  29. package/dist/ganttDiagram-JELNMOA3-Dk5PKr9Z.mjs +2670 -0
  30. package/dist/gitGraph-F6HP7TQM-DkwcvDhk.mjs +5 -0
  31. package/dist/gitGraphDiagram-NY62KEGX-DjJof2Hb.mjs +699 -0
  32. package/dist/graph-D-Tmz5vo.mjs +247 -0
  33. package/dist/{index-C3zgkbpi.mjs → index-CWsdn0Oh.mjs} +35928 -28717
  34. package/dist/index.es.js +4 -4
  35. package/dist/index.umd.js +1884 -1442
  36. package/dist/info-NVLQJR56-TpH_gM4H.mjs +5 -0
  37. package/dist/infoDiagram-WHAUD3N6-DrsD1lMt.mjs +24 -0
  38. package/dist/journeyDiagram-XKPGCS4Q-Cq5Y94aQ.mjs +834 -0
  39. package/dist/kanban-definition-3W4ZIXB7-BEiPA-13.mjs +719 -0
  40. package/dist/layout-QOTssOZa.mjs +1335 -0
  41. package/dist/linear-CCFzTlKw.mjs +259 -0
  42. package/dist/mermaid-parser.core-CSzOHvro.mjs +12966 -0
  43. package/dist/mindmap-definition-VGOIOE7T-ChH1RCzL.mjs +784 -0
  44. package/dist/packet-BFZMPI3H-RY9z3tXt.mjs +5 -0
  45. package/dist/pie-7BOR55EZ-DWSbWhsM.mjs +5 -0
  46. package/dist/pieDiagram-ADFJNKIX-CjvCGMnv.mjs +161 -0
  47. package/dist/quadrantDiagram-AYHSOK5B-yLMChKK1.mjs +1022 -0
  48. package/dist/radar-NHE76QYJ-DxZgeX1m.mjs +5 -0
  49. package/dist/requirementDiagram-UZGBJVZJ-D_Kv5PcV.mjs +850 -0
  50. package/dist/sankeyDiagram-TZEHDZUN-BT4gTtRH.mjs +810 -0
  51. package/dist/sequenceDiagram-WL72ISMW-CcZ0NGLk.mjs +2511 -0
  52. package/dist/stateDiagram-FKZM4ZOC-BpQhvfG2.mjs +263 -0
  53. package/dist/stateDiagram-v2-4FDKWEC3-X4ju2xD3.mjs +16 -0
  54. package/dist/timeline-definition-IT6M3QCI-mIpcHDXS.mjs +795 -0
  55. package/dist/treemap-KMMF4GRG-CTNebVlI.mjs +5 -0
  56. package/dist/{xychartDiagram-f5964ef8-fDv4mp1P.mjs → xychartDiagram-PRI3JC2R-DooouUUZ.mjs} +503 -445
  57. package/package.json +3 -3
  58. package/dist/Tableau10-D7jGxypv.mjs +0 -8
  59. package/dist/arc-DqrMsJeG.mjs +0 -84
  60. package/dist/array-CqVTtuYm.mjs +0 -6
  61. package/dist/blockDiagram-c4efeb88-B7Mcu3H_.mjs +0 -1221
  62. package/dist/classDiagram-beda092f-CRNvkLYf.mjs +0 -218
  63. package/dist/classDiagram-v2-2358418a-CUFy5DGQ.mjs +0 -200
  64. package/dist/createText-1719965b-BEXd6yNU.mjs +0 -2955
  65. package/dist/edges-96097737-CTds2HS2.mjs +0 -1088
  66. package/dist/erDiagram-0228fc6a-DdOqXYmJ.mjs +0 -929
  67. package/dist/flowDb-c6c81e3f-LkwBoeG_.mjs +0 -1126
  68. package/dist/flowDiagram-50d868cf-BlsvSXSO.mjs +0 -788
  69. package/dist/flowDiagram-v2-4f6560a1-KScjGHBx.mjs +0 -17
  70. package/dist/flowchart-elk-definition-6af322e1-mTna7kqR.mjs +0 -48146
  71. package/dist/ganttDiagram-a2739b55-B2o_UW9_.mjs +0 -2477
  72. package/dist/gitGraphDiagram-82fe8481-B6-VRPS0.mjs +0 -1264
  73. package/dist/graph-CSVeLFCJ.mjs +0 -847
  74. package/dist/index-5325376f-DsGv8AO4.mjs +0 -373
  75. package/dist/infoDiagram-8eee0895-Cx7V52QV.mjs +0 -319
  76. package/dist/journeyDiagram-c64418c1-C03IeVHa.mjs +0 -801
  77. package/dist/layout-DfnPfvJm.mjs +0 -1472
  78. package/dist/line-BwAWhs05.mjs +0 -33
  79. package/dist/linear-Ck_Qt8nI.mjs +0 -423
  80. package/dist/mindmap-definition-8da855dc-DdMLbjBy.mjs +0 -21922
  81. package/dist/path-DLwuMfdd.mjs +0 -84
  82. package/dist/pieDiagram-a8764435-BymSofHf.mjs +0 -500
  83. package/dist/quadrantDiagram-1e28029f-BXtW3eHp.mjs +0 -903
  84. package/dist/requirementDiagram-08caed73-DGBKyhE-.mjs +0 -767
  85. package/dist/sankeyDiagram-a04cb91d-BfUYRgG3.mjs +0 -802
  86. package/dist/sequenceDiagram-c5b8d532-Jj_1ttvV.mjs +0 -2234
  87. package/dist/stateDiagram-1ecb1508-CbSM9l6I.mjs +0 -266
  88. package/dist/stateDiagram-v2-c2b004d7-dS2KbqNc.mjs +0 -184
  89. package/dist/styles-b4e223ce-D01XEgS6.mjs +0 -1089
  90. package/dist/styles-ca3715f6-amZyw1GB.mjs +0 -960
  91. package/dist/styles-d45a18b0-GN33fYGn.mjs +0 -436
  92. package/dist/svgDrawCommon-b86b1483-BQvqkIEE.mjs +0 -64
  93. package/dist/timeline-definition-faaaa080-BjbyYT4p.mjs +0 -792
@@ -1,266 +0,0 @@
1
- import { s as P, d as N, p as W } from "./styles-ca3715f6-amZyw1GB.mjs";
2
- import { g as t, d as H, l as b, e as R, k as T, F as v, B as U } from "./index-C3zgkbpi.mjs";
3
- import { G as C } from "./graph-CSVeLFCJ.mjs";
4
- import { l as F } from "./layout-DfnPfvJm.mjs";
5
- import { l as $ } from "./line-BwAWhs05.mjs";
6
- const O = (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), X = (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), J = (e, i) => {
7
- const o = 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 = o.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), o;
9
- }, Y = (e, i) => {
10
- const o = function(l, m, w) {
11
- const E = l.append("tspan").attr("x", 2 * t().state.padding).text(m);
12
- w || E.attr("dy", t().state.textHeight);
13
- }, s = 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 = s.height, p = e.append("text").attr("x", t().state.padding).attr(
14
- "y",
15
- g + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
16
- ).attr("class", "state-description");
17
- let a = !0, r = !0;
18
- i.descriptions.forEach(function(l) {
19
- a || (o(p, l, r), r = !1), a = !1;
20
- });
21
- 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"), x = p.node().getBBox(), d = Math.max(x.width, s.width);
22
- return y.attr("x2", d + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", d + 2 * t().state.padding).attr("height", x.height + g + 2 * t().state.padding).attr("rx", t().state.radius), e;
23
- }, I = (e, i, o) => {
24
- const c = t().state.padding, s = 2 * t().state.padding, g = e.node().getBBox(), p = g.width, a = g.x, r = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), x = r.node().getBBox().width + s;
25
- let d = Math.max(x, p);
26
- d === p && (d = d + s);
27
- let l;
28
- const m = e.node().getBBox();
29
- i.doc, l = a - c, x > p && (l = (p - d) / 2 + c), Math.abs(a - m.x) < c && x > p && (l = a - (x - p) / 2);
30
- const w = 1 - t().state.textHeight;
31
- return e.insert("rect", ":first-child").attr("x", l).attr("y", w).attr("class", o ? "alt-composit" : "composit").attr("width", d).attr(
32
- "height",
33
- m.height + t().state.textHeight + t().state.titleShift + 1
34
- ).attr("rx", "0"), r.attr("x", l + c), x <= p && r.attr("x", a + (d - s) / 2 - x / 2 + c), e.insert("rect", ":first-child").attr("x", l).attr(
35
- "y",
36
- t().state.titleShift - t().state.textHeight - t().state.padding
37
- ).attr("width", d).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", l).attr(
38
- "y",
39
- t().state.titleShift - t().state.textHeight - t().state.padding
40
- ).attr("width", d).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
41
- }, _ = (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)), q = (e, i) => {
48
- let o = t().state.forkWidth, c = t().state.forkHeight;
49
- if (i.parentId) {
50
- let s = o;
51
- o = c, c = s;
52
- }
53
- return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", o).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
54
- }, Z = (e, i, o, c) => {
55
- let s = 0;
56
- const g = c.append("text");
57
- g.style("text-anchor", "start"), g.attr("class", "noteText");
58
- let p = e.replace(/\r\n/g, "<br/>");
59
- p = p.replace(/\n/g, "<br/>");
60
- const a = p.split(T.lineBreakRegex);
61
- let r = 1.25 * t().state.noteMargin;
62
- for (const y of a) {
63
- const x = y.trim();
64
- if (x.length > 0) {
65
- const d = g.append("tspan");
66
- if (d.text(x), r === 0) {
67
- const l = d.node().getBBox();
68
- r += l.height;
69
- }
70
- s += r, d.attr("x", i + t().state.noteMargin), d.attr("y", o + s + 1.25 * t().state.noteMargin);
71
- }
72
- }
73
- return { textWidth: g.node().getBBox().width, textHeight: s };
74
- }, K = (e, i) => {
75
- i.attr("class", "state-note");
76
- const o = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: s, textHeight: g } = Z(e, 0, 0, c);
77
- return o.attr("height", g + 2 * t().state.noteMargin), o.attr("width", s + t().state.noteMargin * 2), o;
78
- }, L = function(e, i) {
79
- const o = i.id, c = {
80
- id: o,
81
- label: i.id,
82
- width: 0,
83
- height: 0
84
- }, s = e.append("g").attr("id", o).attr("class", "stateGroup");
85
- i.type === "start" && O(s), i.type === "end" && _(s), (i.type === "fork" || i.type === "join") && q(s, i), i.type === "note" && K(i.note.text, s), i.type === "divider" && X(s), i.type === "default" && i.descriptions.length === 0 && J(s, i), i.type === "default" && i.descriptions.length > 0 && Y(s, i);
86
- const g = s.node().getBBox();
87
- return c.width = g.width + 2 * t().state.padding, c.height = g.height + 2 * t().state.padding, c;
88
- };
89
- let G = 0;
90
- const Q = function(e, i, o) {
91
- const c = function(r) {
92
- switch (r) {
93
- case N.relationType.AGGREGATION:
94
- return "aggregation";
95
- case N.relationType.EXTENSION:
96
- return "extension";
97
- case N.relationType.COMPOSITION:
98
- return "composition";
99
- case N.relationType.DEPENDENCY:
100
- return "dependency";
101
- }
102
- };
103
- i.points = i.points.filter((r) => !Number.isNaN(r.y));
104
- const s = i.points, g = $().x(function(r) {
105
- return r.x;
106
- }).y(function(r) {
107
- return r.y;
108
- }).curve(v), p = e.append("path").attr("d", g(s)).attr("id", "edge" + G).attr("class", "transition");
109
- let a = "";
110
- 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, "\\)")), p.attr(
111
- "marker-end",
112
- "url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
113
- ), o.title !== void 0) {
114
- const r = e.append("g").attr("class", "stateLabel"), { x: y, y: x } = U.calcLabelPosition(i.points), d = T.getRows(o.title);
115
- let l = 0;
116
- const m = [];
117
- let w = 0, E = 0;
118
- for (let u = 0; u <= d.length; u++) {
119
- const h = r.append("text").attr("text-anchor", "middle").text(d[u]).attr("x", y).attr("y", x + l), f = h.node().getBBox();
120
- w = Math.max(w, f.width), E = Math.min(E, f.x), b.info(f.x, y, x + l), l === 0 && (l = h.node().getBBox().height, b.info("Title height", l, x)), m.push(h);
121
- }
122
- let k = l * d.length;
123
- if (d.length > 1) {
124
- const u = (d.length - 1) * l * 0.5;
125
- m.forEach((h, f) => h.attr("y", x + f * l - u)), k = l * d.length;
126
- }
127
- const n = r.node().getBBox();
128
- r.insert("rect", ":first-child").attr("class", "box").attr("x", y - w / 2 - t().state.padding / 2).attr("y", x - k / 2 - t().state.padding / 2 - 3.5).attr("width", w + t().state.padding).attr("height", k + t().state.padding), b.info(n);
129
- }
130
- G++;
131
- };
132
- let B;
133
- const z = {}, V = function() {
134
- }, j = function(e) {
135
- 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");
136
- }, D = function(e, i, o, c) {
137
- B = t().state;
138
- const s = t().securityLevel;
139
- let g;
140
- s === "sandbox" && (g = H("#i" + i));
141
- const p = s === "sandbox" ? H(g.nodes()[0].contentDocument.body) : H("body"), a = s === "sandbox" ? g.nodes()[0].contentDocument : document;
142
- b.debug("Rendering diagram " + e);
143
- const r = p.select(`[id='${i}']`);
144
- j(r);
145
- const y = c.db.getRootDoc();
146
- A(y, r, void 0, !1, p, a, c);
147
- const x = B.padding, d = r.node().getBBox(), l = d.width + x * 2, m = d.height + x * 2, w = l * 1.75;
148
- R(r, m, w, B.useMaxWidth), r.attr(
149
- "viewBox",
150
- `${d.x - B.padding} ${d.y - B.padding} ` + l + " " + m
151
- );
152
- }, tt = (e) => e ? e.length * B.fontSizeFactor : 1, A = (e, i, o, c, s, g, p) => {
153
- const a = new C({
154
- compound: !0,
155
- multigraph: !0
156
- });
157
- let r, y = !0;
158
- for (r = 0; r < e.length; r++)
159
- if (e[r].stmt === "relation") {
160
- y = !1;
161
- break;
162
- }
163
- o ? a.setGraph({
164
- rankdir: "LR",
165
- multigraph: !0,
166
- compound: !0,
167
- // acyclicer: 'greedy',
168
- ranker: "tight-tree",
169
- ranksep: y ? 1 : B.edgeLengthFactor,
170
- nodeSep: y ? 1 : 50,
171
- isMultiGraph: !0
172
- // ranksep: 5,
173
- // nodesep: 1
174
- }) : a.setGraph({
175
- rankdir: "TB",
176
- multigraph: !0,
177
- compound: !0,
178
- // isCompound: true,
179
- // acyclicer: 'greedy',
180
- // ranker: 'longest-path'
181
- ranksep: y ? 1 : B.edgeLengthFactor,
182
- nodeSep: y ? 1 : 50,
183
- ranker: "tight-tree",
184
- // ranker: 'network-simplex'
185
- isMultiGraph: !0
186
- }), a.setDefaultEdgeLabel(function() {
187
- return {};
188
- }), p.db.extract(e);
189
- const x = p.db.getStates(), d = p.db.getRelations(), l = Object.keys(x);
190
- for (const n of l) {
191
- const u = x[n];
192
- o && (u.parentId = o);
193
- let h;
194
- if (u.doc) {
195
- let f = i.append("g").attr("id", u.id).attr("class", "stateGroup");
196
- h = A(u.doc, f, u.id, !c, s, g, p);
197
- {
198
- f = I(f, u, c);
199
- let S = f.node().getBBox();
200
- h.width = S.width, h.height = S.height + B.padding / 2, z[u.id] = { y: B.compositTitleSize };
201
- }
202
- } else
203
- h = L(i, u);
204
- if (u.note) {
205
- const f = {
206
- descriptions: [],
207
- id: u.id + "-note",
208
- note: u.note,
209
- type: "note"
210
- }, S = L(i, f);
211
- u.note.position === "left of" ? (a.setNode(h.id + "-note", S), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", S)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
212
- } else
213
- a.setNode(h.id, h);
214
- }
215
- b.debug("Count=", a.nodeCount(), a);
216
- let m = 0;
217
- d.forEach(function(n) {
218
- m++, b.debug("Setting edge", n), a.setEdge(
219
- n.id1,
220
- n.id2,
221
- {
222
- relation: n,
223
- width: tt(n.title),
224
- height: B.labelHeight * T.getRows(n.title).length,
225
- labelpos: "c"
226
- },
227
- "id" + m
228
- );
229
- }), F(a), b.debug("Graph after layout", a.nodes());
230
- const w = i.node();
231
- a.nodes().forEach(function(n) {
232
- n !== void 0 && a.node(n) !== void 0 ? (b.warn("Node " + n + ": " + JSON.stringify(a.node(n))), s.select("#" + w.id + " #" + n).attr(
233
- "transform",
234
- "translate(" + (a.node(n).x - a.node(n).width / 2) + "," + (a.node(n).y + (z[n] ? z[n].y : 0) - a.node(n).height / 2) + " )"
235
- ), s.select("#" + w.id + " #" + n).attr("data-x-shift", a.node(n).x - a.node(n).width / 2), g.querySelectorAll("#" + w.id + " #" + n + " .divider").forEach((h) => {
236
- const f = h.parentElement;
237
- let S = 0, M = 0;
238
- f && (f.parentElement && (S = f.parentElement.getBBox().width), M = parseInt(f.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", S - M - 8);
239
- })) : b.debug("No Node " + n + ": " + JSON.stringify(a.node(n)));
240
- });
241
- let E = w.getBBox();
242
- a.edges().forEach(function(n) {
243
- n !== void 0 && a.edge(n) !== void 0 && (b.debug("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(a.edge(n))), Q(i, a.edge(n), a.edge(n).relation));
244
- }), E = w.getBBox();
245
- const k = {
246
- id: o || "root",
247
- label: o || "root",
248
- width: 0,
249
- height: 0
250
- };
251
- return k.width = E.width + 2 * B.padding, k.height = E.height + 2 * B.padding, b.debug("Doc rendered", k, a), k;
252
- }, et = {
253
- setConf: V,
254
- draw: D
255
- }, ot = {
256
- parser: W,
257
- db: N,
258
- renderer: et,
259
- styles: P,
260
- init: (e) => {
261
- e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute, N.clear();
262
- }
263
- };
264
- export {
265
- ot as diagram
266
- };
@@ -1,184 +0,0 @@
1
- import { s as Q, d as B, p as X, D as Z, a as H, b as F, S as m, c as I } from "./styles-ca3715f6-amZyw1GB.mjs";
2
- import { G as tt } from "./graph-CSVeLFCJ.mjs";
3
- import { l as E, g, d as x, B as et, e as ot, k as w } from "./index-C3zgkbpi.mjs";
4
- import { r as st } from "./index-5325376f-DsGv8AO4.mjs";
5
- import "./layout-DfnPfvJm.mjs";
6
- const h = "rect", C = "rectWithTitle", nt = "start", ct = "end", it = "divider", rt = "roundedWithTitle", lt = "note", at = "noteGroup", p = "statediagram", dt = "state", Et = `${p}-${dt}`, U = "transition", St = "note", Tt = "note-edge", _t = `${U} ${Tt}`, pt = `${p}-${St}`, ut = "cluster", Dt = `${p}-${ut}`, bt = "cluster-alt", ft = `${p}-${bt}`, V = "parent", Y = "note", At = "state", N = "----", ht = `${N}${Y}`, M = `${N}${V}`, W = "fill:none", z = "fill: #333", q = "c", K = "text", j = "normal";
7
- let y = {}, d = 0;
8
- const yt = function(t) {
9
- const n = Object.keys(t);
10
- for (const e of n)
11
- t[e];
12
- }, gt = function(t, n) {
13
- return n.db.extract(n.db.getRootDocV2()), n.db.getClasses();
14
- };
15
- function $t(t) {
16
- return t == null ? "" : t.classes ? t.classes.join(" ") : "";
17
- }
18
- function R(t = "", n = 0, e = "", c = N) {
19
- const i = e !== null && e.length > 0 ? `${c}${e}` : "";
20
- return `${At}-${t}${i}-${n}`;
21
- }
22
- const A = (t, n, e, c, i, r) => {
23
- const o = e.id, u = $t(c[o]);
24
- if (o !== "root") {
25
- let T = h;
26
- e.start === !0 && (T = nt), e.start === !1 && (T = ct), e.type !== H && (T = e.type), y[o] || (y[o] = {
27
- id: o,
28
- shape: T,
29
- description: w.sanitizeText(o, g()),
30
- classes: `${u} ${Et}`
31
- });
32
- const s = y[o];
33
- e.description && (Array.isArray(s.description) ? (s.shape = C, s.description.push(e.description)) : s.description.length > 0 ? (s.shape = C, s.description === o ? s.description = [e.description] : s.description = [s.description, e.description]) : (s.shape = h, s.description = e.description), s.description = w.sanitizeTextOrArray(s.description, g())), s.description.length === 1 && s.shape === C && (s.shape = h), !s.type && e.doc && (E.info("Setting cluster for ", o, G(e)), s.type = "group", s.dir = G(e), s.shape = e.type === F ? it : rt, s.classes = s.classes + " " + Dt + " " + (r ? ft : ""));
34
- const _ = {
35
- labelStyle: "",
36
- shape: s.shape,
37
- labelText: s.description,
38
- // typeof newNode.description === 'object'
39
- // ? newNode.description[0]
40
- // : newNode.description,
41
- classes: s.classes,
42
- style: "",
43
- //styles.style,
44
- id: o,
45
- dir: s.dir,
46
- domId: R(o, d),
47
- type: s.type,
48
- padding: 15
49
- //getConfig().flowchart.padding
50
- };
51
- if (_.centerLabel = !0, e.note) {
52
- const l = {
53
- labelStyle: "",
54
- shape: lt,
55
- labelText: e.note.text,
56
- classes: pt,
57
- // useHtmlLabels: false,
58
- style: "",
59
- // styles.style,
60
- id: o + ht + "-" + d,
61
- domId: R(o, d, Y),
62
- type: s.type,
63
- padding: 15
64
- //getConfig().flowchart.padding
65
- }, a = {
66
- labelStyle: "",
67
- shape: at,
68
- labelText: e.note.text,
69
- classes: s.classes,
70
- style: "",
71
- // styles.style,
72
- id: o + M,
73
- domId: R(o, d, V),
74
- type: "group",
75
- padding: 0
76
- //getConfig().flowchart.padding
77
- };
78
- d++;
79
- const D = o + M;
80
- t.setNode(D, a), t.setNode(l.id, l), t.setNode(o, _), t.setParent(o, D), t.setParent(l.id, D);
81
- let S = o, b = l.id;
82
- e.note.position === "left of" && (S = l.id, b = o), t.setEdge(S, b, {
83
- arrowhead: "none",
84
- arrowType: "",
85
- style: W,
86
- labelStyle: "",
87
- classes: _t,
88
- arrowheadStyle: z,
89
- labelpos: q,
90
- labelType: K,
91
- thickness: j
92
- });
93
- } else
94
- t.setNode(o, _);
95
- }
96
- n && n.id !== "root" && (E.trace("Setting node ", o, " to be child of its parent ", n.id), t.setParent(o, n.id)), e.doc && (E.trace("Adding nodes children "), xt(t, e, e.doc, c, i, !r));
97
- }, xt = (t, n, e, c, i, r) => {
98
- E.trace("items", e), e.forEach((o) => {
99
- switch (o.stmt) {
100
- case I:
101
- A(t, n, o, c, i, r);
102
- break;
103
- case H:
104
- A(t, n, o, c, i, r);
105
- break;
106
- case m:
107
- {
108
- A(t, n, o.state1, c, i, r), A(t, n, o.state2, c, i, r);
109
- const u = {
110
- id: "edge" + d,
111
- arrowhead: "normal",
112
- arrowTypeEnd: "arrow_barb",
113
- style: W,
114
- labelStyle: "",
115
- label: w.sanitizeText(o.description, g()),
116
- arrowheadStyle: z,
117
- labelpos: q,
118
- labelType: K,
119
- thickness: j,
120
- classes: U
121
- };
122
- t.setEdge(o.state1.id, o.state2.id, u, d), d++;
123
- }
124
- break;
125
- }
126
- });
127
- }, G = (t, n = Z) => {
128
- let e = n;
129
- if (t.doc)
130
- for (let c = 0; c < t.doc.length; c++) {
131
- const i = t.doc[c];
132
- i.stmt === "dir" && (e = i.value);
133
- }
134
- return e;
135
- }, Ct = async function(t, n, e, c) {
136
- E.info("Drawing state diagram (v2)", n), y = {}, c.db.getDirection();
137
- const { securityLevel: i, state: r } = g(), o = r.nodeSpacing || 50, u = r.rankSpacing || 50;
138
- E.info(c.db.getRootDocV2()), c.db.extract(c.db.getRootDocV2()), E.info(c.db.getRootDocV2());
139
- const T = c.db.getStates(), s = new tt({
140
- multigraph: !0,
141
- compound: !0
142
- }).setGraph({
143
- rankdir: G(c.db.getRootDocV2()),
144
- nodesep: o,
145
- ranksep: u,
146
- marginx: 8,
147
- marginy: 8
148
- }).setDefaultEdgeLabel(function() {
149
- return {};
150
- });
151
- A(s, void 0, c.db.getRootDocV2(), T, c.db, !0);
152
- let _;
153
- i === "sandbox" && (_ = x("#i" + n));
154
- const l = i === "sandbox" ? x(_.nodes()[0].contentDocument.body) : x("body"), a = l.select(`[id="${n}"]`), D = l.select("#" + n + " g");
155
- await st(D, s, ["barb"], p, n);
156
- const S = 8;
157
- et.insertTitle(a, "statediagramTitleText", r.titleTopMargin, c.db.getDiagramTitle());
158
- const b = a.node().getBBox(), L = b.width + S * 2, P = b.height + S * 2;
159
- a.attr("class", p);
160
- const O = a.node().getBBox();
161
- ot(a, P, L, r.useMaxWidth);
162
- const k = `${O.x - S} ${O.y - S} ${L} ${P}`;
163
- E.debug(`viewBox ${k}`), a.attr("viewBox", k);
164
- const J = document.querySelectorAll('[id="' + n + '"] .edgeLabel .label');
165
- for (const $ of J) {
166
- const v = $.getBBox(), f = document.createElementNS("http://www.w3.org/2000/svg", h);
167
- f.setAttribute("rx", 0), f.setAttribute("ry", 0), f.setAttribute("width", v.width), f.setAttribute("height", v.height), $.insertBefore(f, $.firstChild);
168
- }
169
- }, Rt = {
170
- setConf: yt,
171
- getClasses: gt,
172
- draw: Ct
173
- }, Ot = {
174
- parser: X,
175
- db: B,
176
- renderer: Rt,
177
- styles: Q,
178
- init: (t) => {
179
- t.state || (t.state = {}), t.state.arrowMarkerAbsolute = t.arrowMarkerAbsolute, B.clear();
180
- }
181
- };
182
- export {
183
- Ot as diagram
184
- };