@umami/shiso 1.12.0 → 1.13.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.
Files changed (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,368 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import { m as log, p as select_default } from "./src.js";
3
+ import { O as getUrl, c as configureSvgSize, s as common_default, x as getConfig2 } from "./chunk-DU6HZSFF.js";
4
+ import { et as basis_default, g as utils_default } from "./chunk-75Z2AOVW.js";
5
+ import { t as line_default } from "./line.js";
6
+ import "./chunk-PWAF6VOD.js";
7
+ import "./chunk-GMAD6QVW.js";
8
+ import "./chunk-P2QGCYS3.js";
9
+ import "./chunk-4HAMMTFA.js";
10
+ import "./chunk-GVQU2GXP.js";
11
+ import "./chunk-OSK3NFVY.js";
12
+ import { t as Graph } from "./graphlib.js";
13
+ import { t as layout } from "./dagre.js";
14
+ import "./chunk-F27PBJKO.js";
15
+ import "./chunk-XXDRQBXY.js";
16
+ import "./chunk-POPQ4Y6H.js";
17
+ import "./chunk-L3NEJ4N5.js";
18
+ import { i as styles_default, n as stateDiagram_default, t as StateDB } from "./chunk-IMKFNOWR.js";
19
+ import "./mermaid.core.js";
20
+
21
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-D77RDMKH.mjs
22
+ var drawStartState = /* @__PURE__ */ __name((g) => g.append("circle").attr("class", "start-state").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit), "drawStartState");
23
+ var drawDivider = /* @__PURE__ */ __name((g) => g.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig2().state.textHeight).attr("class", "divider").attr("x2", getConfig2().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider");
24
+ var drawSimpleState = /* @__PURE__ */ __name((g, stateDef) => {
25
+ const state = g.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id);
26
+ const classBox = state.node().getBBox();
27
+ g.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", classBox.width + 2 * getConfig2().state.padding).attr("height", classBox.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius);
28
+ return state;
29
+ }, "drawSimpleState");
30
+ var drawDescrState = /* @__PURE__ */ __name((g, stateDef) => {
31
+ const addTspan = /* @__PURE__ */ __name(function(textEl, txt, isFirst2) {
32
+ const tSpan = textEl.append("tspan").attr("x", 2 * getConfig2().state.padding).text(txt);
33
+ if (!isFirst2) tSpan.attr("dy", getConfig2().state.textHeight);
34
+ }, "addTspan");
35
+ const titleBox = g.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 1.3 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.descriptions[0]).node().getBBox();
36
+ const titleHeight = titleBox.height;
37
+ const description = g.append("text").attr("x", getConfig2().state.padding).attr("y", titleHeight + getConfig2().state.padding * .4 + getConfig2().state.dividerMargin + getConfig2().state.textHeight).attr("class", "state-description");
38
+ let isFirst = true;
39
+ let isSecond = true;
40
+ stateDef.descriptions.forEach(function(descr) {
41
+ if (!isFirst) {
42
+ addTspan(description, descr, isSecond);
43
+ isSecond = false;
44
+ }
45
+ isFirst = false;
46
+ });
47
+ const descrLine = g.append("line").attr("x1", getConfig2().state.padding).attr("y1", getConfig2().state.padding + titleHeight + getConfig2().state.dividerMargin / 2).attr("y2", getConfig2().state.padding + titleHeight + getConfig2().state.dividerMargin / 2).attr("class", "descr-divider");
48
+ const descrBox = description.node().getBBox();
49
+ const width = Math.max(descrBox.width, titleBox.width);
50
+ descrLine.attr("x2", width + 3 * getConfig2().state.padding);
51
+ g.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", width + 2 * getConfig2().state.padding).attr("height", descrBox.height + titleHeight + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius);
52
+ return g;
53
+ }, "drawDescrState");
54
+ var addTitleAndBox = /* @__PURE__ */ __name((g, stateDef, altBkg) => {
55
+ const pad = getConfig2().state.padding;
56
+ const dblPad = 2 * getConfig2().state.padding;
57
+ const orgBox = g.node().getBBox();
58
+ const orgWidth = orgBox.width;
59
+ const orgX = orgBox.x;
60
+ const title = g.append("text").attr("x", 0).attr("y", getConfig2().state.titleShift).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id);
61
+ const titleWidth = title.node().getBBox().width + dblPad;
62
+ let width = Math.max(titleWidth, orgWidth);
63
+ if (width === orgWidth) width = width + dblPad;
64
+ let startX;
65
+ const graphBox = g.node().getBBox();
66
+ if (stateDef.doc) {}
67
+ startX = orgX - pad;
68
+ if (titleWidth > orgWidth) startX = (orgWidth - width) / 2 + pad;
69
+ if (Math.abs(orgX - graphBox.x) < pad && titleWidth > orgWidth) startX = orgX - (titleWidth - orgWidth) / 2;
70
+ const lineY = 1 - getConfig2().state.textHeight;
71
+ g.insert("rect", ":first-child").attr("x", startX).attr("y", lineY).attr("class", altBkg ? "alt-composit" : "composit").attr("width", width).attr("height", graphBox.height + getConfig2().state.textHeight + getConfig2().state.titleShift + 1).attr("rx", "0");
72
+ title.attr("x", startX + pad);
73
+ if (titleWidth <= orgWidth) title.attr("x", orgX + (width - dblPad) / 2 - titleWidth / 2 + pad);
74
+ g.insert("rect", ":first-child").attr("x", startX).attr("y", getConfig2().state.titleShift - getConfig2().state.textHeight - getConfig2().state.padding).attr("width", width).attr("height", getConfig2().state.textHeight * 3).attr("rx", getConfig2().state.radius);
75
+ g.insert("rect", ":first-child").attr("x", startX).attr("y", getConfig2().state.titleShift - getConfig2().state.textHeight - getConfig2().state.padding).attr("width", width).attr("height", graphBox.height + 3 + 2 * getConfig2().state.textHeight).attr("rx", getConfig2().state.radius);
76
+ return g;
77
+ }, "addTitleAndBox");
78
+ var drawEndState = /* @__PURE__ */ __name((g) => {
79
+ g.append("circle").attr("class", "end-state-outer").attr("r", getConfig2().state.sizeUnit + getConfig2().state.miniPadding).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit + getConfig2().state.miniPadding).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit + getConfig2().state.miniPadding);
80
+ return g.append("circle").attr("class", "end-state-inner").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit + 2).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit + 2);
81
+ }, "drawEndState");
82
+ var drawForkJoinState = /* @__PURE__ */ __name((g, stateDef) => {
83
+ let width = getConfig2().state.forkWidth;
84
+ let height = getConfig2().state.forkHeight;
85
+ if (stateDef.parentId) {
86
+ let tmp = width;
87
+ width = height;
88
+ height = tmp;
89
+ }
90
+ return g.append("rect").style("stroke", "black").style("fill", "black").attr("width", width).attr("height", height).attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding);
91
+ }, "drawForkJoinState");
92
+ var _drawLongText = /* @__PURE__ */ __name((_text, x, y, g) => {
93
+ let textHeight = 0;
94
+ const textElem = g.append("text");
95
+ textElem.style("text-anchor", "start");
96
+ textElem.attr("class", "noteText");
97
+ let text = _text.replace(/\r\n/g, "<br/>");
98
+ text = text.replace(/\n/g, "<br/>");
99
+ const lines = text.split(common_default.lineBreakRegex);
100
+ let tHeight = 1.25 * getConfig2().state.noteMargin;
101
+ for (const line2 of lines) {
102
+ const txt = line2.trim();
103
+ if (txt.length > 0) {
104
+ const span = textElem.append("tspan");
105
+ span.text(txt);
106
+ if (tHeight === 0) {
107
+ const textBounds = span.node().getBBox();
108
+ tHeight += textBounds.height;
109
+ }
110
+ textHeight += tHeight;
111
+ span.attr("x", x + getConfig2().state.noteMargin);
112
+ span.attr("y", y + textHeight + 1.25 * getConfig2().state.noteMargin);
113
+ }
114
+ }
115
+ return {
116
+ textWidth: textElem.node().getBBox().width,
117
+ textHeight
118
+ };
119
+ }, "_drawLongText");
120
+ var drawNote = /* @__PURE__ */ __name((text, g) => {
121
+ g.attr("class", "state-note");
122
+ const note = g.append("rect").attr("x", 0).attr("y", getConfig2().state.padding);
123
+ const { textWidth, textHeight } = _drawLongText(text, 0, 0, g.append("g"));
124
+ note.attr("height", textHeight + 2 * getConfig2().state.noteMargin);
125
+ note.attr("width", textWidth + getConfig2().state.noteMargin * 2);
126
+ return note;
127
+ }, "drawNote");
128
+ var drawState = /* @__PURE__ */ __name(function(elem, stateDef) {
129
+ const id = stateDef.id;
130
+ const stateInfo = {
131
+ id,
132
+ label: stateDef.id,
133
+ width: 0,
134
+ height: 0
135
+ };
136
+ const g = elem.append("g").attr("id", id).attr("class", "stateGroup");
137
+ if (stateDef.type === "start") drawStartState(g);
138
+ if (stateDef.type === "end") drawEndState(g);
139
+ if (stateDef.type === "fork" || stateDef.type === "join") drawForkJoinState(g, stateDef);
140
+ if (stateDef.type === "note") drawNote(stateDef.note.text, g);
141
+ if (stateDef.type === "divider") drawDivider(g);
142
+ if (stateDef.type === "default" && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef);
143
+ if (stateDef.type === "default" && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);
144
+ const stateBox = g.node().getBBox();
145
+ stateInfo.width = stateBox.width + 2 * getConfig2().state.padding;
146
+ stateInfo.height = stateBox.height + 2 * getConfig2().state.padding;
147
+ return stateInfo;
148
+ }, "drawState");
149
+ var edgeCount = 0;
150
+ var drawEdge = /* @__PURE__ */ __name(function(elem, path, relation) {
151
+ const getRelationType = /* @__PURE__ */ __name(function(type) {
152
+ switch (type) {
153
+ case StateDB.relationType.AGGREGATION: return "aggregation";
154
+ case StateDB.relationType.EXTENSION: return "extension";
155
+ case StateDB.relationType.COMPOSITION: return "composition";
156
+ case StateDB.relationType.DEPENDENCY: return "dependency";
157
+ }
158
+ }, "getRelationType");
159
+ path.points = path.points.filter((p) => !Number.isNaN(p.y));
160
+ const lineData = path.points;
161
+ const lineFunction = line_default().x(function(d) {
162
+ return d.x;
163
+ }).y(function(d) {
164
+ return d.y;
165
+ }).curve(basis_default);
166
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "transition");
167
+ let url = "";
168
+ if (getConfig2().state.arrowMarkerAbsolute) url = getUrl(true);
169
+ svgPath.attr("marker-end", "url(" + url + "#" + getRelationType(StateDB.relationType.DEPENDENCY) + "End)");
170
+ if (relation.title !== void 0) {
171
+ const label = elem.append("g").attr("class", "stateLabel");
172
+ const { x, y } = utils_default.calcLabelPosition(path.points);
173
+ const rows = common_default.getRows(relation.title);
174
+ let titleHeight = 0;
175
+ const titleRows = [];
176
+ let maxWidth = 0;
177
+ let minX = 0;
178
+ for (let i = 0; i <= rows.length; i++) {
179
+ const title = label.append("text").attr("text-anchor", "middle").text(rows[i]).attr("x", x).attr("y", y + titleHeight);
180
+ const boundsTmp = title.node().getBBox();
181
+ maxWidth = Math.max(maxWidth, boundsTmp.width);
182
+ minX = Math.min(minX, boundsTmp.x);
183
+ log.info(boundsTmp.x, x, y + titleHeight);
184
+ if (titleHeight === 0) {
185
+ titleHeight = title.node().getBBox().height;
186
+ log.info("Title height", titleHeight, y);
187
+ }
188
+ titleRows.push(title);
189
+ }
190
+ let boxHeight = titleHeight * rows.length;
191
+ if (rows.length > 1) {
192
+ const heightAdj = (rows.length - 1) * titleHeight * .5;
193
+ titleRows.forEach((title, i) => title.attr("y", y + i * titleHeight - heightAdj));
194
+ boxHeight = titleHeight * rows.length;
195
+ }
196
+ const bounds = label.node().getBBox();
197
+ label.insert("rect", ":first-child").attr("class", "box").attr("x", x - maxWidth / 2 - getConfig2().state.padding / 2).attr("y", y - boxHeight / 2 - getConfig2().state.padding / 2 - 3.5).attr("width", maxWidth + getConfig2().state.padding).attr("height", boxHeight + getConfig2().state.padding);
198
+ log.info(bounds);
199
+ }
200
+ edgeCount++;
201
+ }, "drawEdge");
202
+ var conf;
203
+ var transformationLog = {};
204
+ var setConf = /* @__PURE__ */ __name(function() {}, "setConf");
205
+ var insertMarkers = /* @__PURE__ */ __name(function(elem) {
206
+ elem.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");
207
+ }, "insertMarkers");
208
+ var draw = /* @__PURE__ */ __name(function(text, id, _version, diagObj) {
209
+ conf = getConfig2().state;
210
+ const securityLevel = getConfig2().securityLevel;
211
+ let sandboxElement;
212
+ if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
213
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
214
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
215
+ log.debug("Rendering diagram " + text);
216
+ const diagram2 = root.select(`[id='${id}']`);
217
+ insertMarkers(diagram2);
218
+ renderDoc(diagObj.db.getRootDoc(), diagram2.append("g").attr("id", id + "-root"), void 0, false, root, doc, diagObj);
219
+ const padding = conf.padding;
220
+ const bounds = diagram2.node().getBBox();
221
+ const width = bounds.width + padding * 2;
222
+ const height = bounds.height + padding * 2;
223
+ const svgWidth = width * 1.75;
224
+ configureSvgSize(diagram2, height, svgWidth, conf.useMaxWidth);
225
+ diagram2.attr("viewBox", `${bounds.x - conf.padding} ${bounds.y - conf.padding} ` + width + " " + height);
226
+ }, "draw");
227
+ var getLabelWidth = /* @__PURE__ */ __name((text) => {
228
+ return text ? text.length * conf.fontSizeFactor : 1;
229
+ }, "getLabelWidth");
230
+ var renderDoc = /* @__PURE__ */ __name((doc, diagram2, parentId, altBkg, root, domDocument, diagObj) => {
231
+ const graph = new Graph({
232
+ compound: true,
233
+ multigraph: true
234
+ });
235
+ let i;
236
+ let edgeFreeDoc = true;
237
+ for (i = 0; i < doc.length; i++) if (doc[i].stmt === "relation") {
238
+ edgeFreeDoc = false;
239
+ break;
240
+ }
241
+ if (parentId) graph.setGraph({
242
+ rankdir: "LR",
243
+ multigraph: true,
244
+ compound: true,
245
+ ranker: "tight-tree",
246
+ ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
247
+ nodeSep: edgeFreeDoc ? 1 : 50,
248
+ isMultiGraph: true
249
+ });
250
+ else graph.setGraph({
251
+ rankdir: "TB",
252
+ multigraph: true,
253
+ compound: true,
254
+ ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
255
+ nodeSep: edgeFreeDoc ? 1 : 50,
256
+ ranker: "tight-tree",
257
+ isMultiGraph: true
258
+ });
259
+ graph.setDefaultEdgeLabel(function() {
260
+ return {};
261
+ });
262
+ const states = diagObj.db.getStates();
263
+ const relations = diagObj.db.getRelations();
264
+ const keys = Object.keys(states);
265
+ for (const key of keys) {
266
+ const stateDef = states[key];
267
+ if (parentId) stateDef.parentId = parentId;
268
+ let node;
269
+ if (stateDef.doc) {
270
+ let sub = diagram2.append("g").attr("id", stateDef.id).attr("class", "stateGroup");
271
+ node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg, root, domDocument, diagObj);
272
+ {
273
+ sub = addTitleAndBox(sub, stateDef, altBkg);
274
+ let boxBounds = sub.node().getBBox();
275
+ node.width = boxBounds.width;
276
+ node.height = boxBounds.height + conf.padding / 2;
277
+ transformationLog[stateDef.id] = { y: conf.compositTitleSize };
278
+ }
279
+ } else node = drawState(diagram2, stateDef, graph);
280
+ if (stateDef.note) {
281
+ const note = drawState(diagram2, {
282
+ descriptions: [],
283
+ id: stateDef.id + "-note",
284
+ note: stateDef.note,
285
+ type: "note"
286
+ }, graph);
287
+ if (stateDef.note.position === "left of") {
288
+ graph.setNode(node.id + "-note", note);
289
+ graph.setNode(node.id, node);
290
+ } else {
291
+ graph.setNode(node.id, node);
292
+ graph.setNode(node.id + "-note", note);
293
+ }
294
+ graph.setParent(node.id, node.id + "-group");
295
+ graph.setParent(node.id + "-note", node.id + "-group");
296
+ } else graph.setNode(node.id, node);
297
+ }
298
+ log.debug("Count=", graph.nodeCount(), graph);
299
+ let cnt = 0;
300
+ relations.forEach(function(relation) {
301
+ cnt++;
302
+ log.debug("Setting edge", relation);
303
+ graph.setEdge(relation.id1, relation.id2, {
304
+ relation,
305
+ width: getLabelWidth(relation.title),
306
+ height: conf.labelHeight * common_default.getRows(relation.title).length,
307
+ labelpos: "c"
308
+ }, "id" + cnt);
309
+ });
310
+ layout(graph);
311
+ log.debug("Graph after layout", graph.nodes());
312
+ const svgElem = diagram2.node();
313
+ graph.nodes().forEach(function(v) {
314
+ if (v !== void 0 && graph.node(v) !== void 0) {
315
+ log.warn("Node " + v + ": " + JSON.stringify(graph.node(v)));
316
+ root.select("#" + svgElem.id + " #" + v).attr("transform", "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + " )");
317
+ root.select("#" + svgElem.id + " #" + v).attr("data-x-shift", graph.node(v).x - graph.node(v).width / 2);
318
+ domDocument.querySelectorAll("#" + svgElem.id + " #" + v + " .divider").forEach((divider) => {
319
+ const parent = divider.parentElement;
320
+ let pWidth = 0;
321
+ let pShift = 0;
322
+ if (parent) {
323
+ if (parent.parentElement) pWidth = parent.parentElement.getBBox().width;
324
+ pShift = parseInt(parent.getAttribute("data-x-shift"), 10);
325
+ if (Number.isNaN(pShift)) pShift = 0;
326
+ }
327
+ divider.setAttribute("x1", 0 - pShift + 8);
328
+ divider.setAttribute("x2", pWidth - pShift - 8);
329
+ });
330
+ } else log.debug("No Node " + v + ": " + JSON.stringify(graph.node(v)));
331
+ });
332
+ let stateBox = svgElem.getBBox();
333
+ graph.edges().forEach(function(e) {
334
+ if (e !== void 0 && graph.edge(e) !== void 0) {
335
+ log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e)));
336
+ drawEdge(diagram2, graph.edge(e), graph.edge(e).relation);
337
+ }
338
+ });
339
+ stateBox = svgElem.getBBox();
340
+ const stateInfo = {
341
+ id: parentId ? parentId : "root",
342
+ label: parentId ? parentId : "root",
343
+ width: 0,
344
+ height: 0
345
+ };
346
+ stateInfo.width = stateBox.width + 2 * conf.padding;
347
+ stateInfo.height = stateBox.height + 2 * conf.padding;
348
+ log.debug("Doc rendered", stateInfo, graph);
349
+ return stateInfo;
350
+ }, "renderDoc");
351
+ var diagram = {
352
+ parser: stateDiagram_default,
353
+ get db() {
354
+ return new StateDB(1);
355
+ },
356
+ renderer: {
357
+ setConf,
358
+ draw
359
+ },
360
+ styles: styles_default,
361
+ init: /* @__PURE__ */ __name((cnf) => {
362
+ if (!cnf.state) cnf.state = {};
363
+ cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
364
+ }, "init")
365
+ };
366
+
367
+ //#endregion
368
+ export { diagram };
@@ -0,0 +1,33 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import "./src.js";
3
+ import "./chunk-DU6HZSFF.js";
4
+ import "./chunk-75Z2AOVW.js";
5
+ import "./chunk-PWAF6VOD.js";
6
+ import "./chunk-GMAD6QVW.js";
7
+ import "./chunk-P2QGCYS3.js";
8
+ import "./chunk-4HAMMTFA.js";
9
+ import "./chunk-GVQU2GXP.js";
10
+ import "./chunk-OSK3NFVY.js";
11
+ import "./chunk-F27PBJKO.js";
12
+ import "./chunk-XXDRQBXY.js";
13
+ import "./chunk-POPQ4Y6H.js";
14
+ import "./chunk-L3NEJ4N5.js";
15
+ import { i as styles_default, n as stateDiagram_default, r as stateRenderer_v3_unified_default, t as StateDB } from "./chunk-IMKFNOWR.js";
16
+ import "./mermaid.core.js";
17
+
18
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-MP3YSRHH.mjs
19
+ var diagram = {
20
+ parser: stateDiagram_default,
21
+ get db() {
22
+ return new StateDB(2);
23
+ },
24
+ renderer: stateRenderer_v3_unified_default,
25
+ styles: styles_default,
26
+ init: /* @__PURE__ */ __name((cnf) => {
27
+ if (!cnf.state) cnf.state = {};
28
+ cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
29
+ }, "init")
30
+ };
31
+
32
+ //#endregion
33
+ export { diagram };