@life-exe/wiki-engine 0.1.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 (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +180 -0
  3. package/dist/analytics/index.d.ts +10 -0
  4. package/dist/chunks/abnfDiagram-VCTEODGH-DyAP6Aua.js +87 -0
  5. package/dist/chunks/arc-OroUeRL_.js +83 -0
  6. package/dist/chunks/architectureDiagram-5GKGNRK7-FjmrDCl4.js +4784 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ-BF3oIDlI.js +1416 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2-Cmdq0LZr.js +1511 -0
  9. package/dist/chunks/channel-Bdy1QZHo.js +5 -0
  10. package/dist/chunks/chunk-2Q5K7J3B-BwxRSEKd.js +15 -0
  11. package/dist/chunks/chunk-5VM5RSS4-BtHwUU4T.js +19 -0
  12. package/dist/chunks/chunk-F27PBJKO-DF4TGftR.js +68 -0
  13. package/dist/chunks/chunk-IMKFNOWR-DkBQ-1aV.js +1421 -0
  14. package/dist/chunks/chunk-JWPE2WC7-BIokdAUW.js +9 -0
  15. package/dist/chunks/chunk-POPQ4Y6H-CcjOsf9X.js +20 -0
  16. package/dist/chunks/chunk-SHT3W25Y-lYp5BdEg.js +1695 -0
  17. package/dist/chunks/chunk-SVP7TREG-DN-ravNt.js +664 -0
  18. package/dist/chunks/chunk-TICWLB2K-CtTJ0xaY.js +1534 -0
  19. package/dist/chunks/chunk-XXDRQBXY-BovkWFC0.js +8 -0
  20. package/dist/chunks/classDiagram-ZZMXUADV-CMYS0pHw.js +16 -0
  21. package/dist/chunks/classDiagram-v2-VYDZK3BY-CMYS0pHw.js +16 -0
  22. package/dist/chunks/common-BJ4q25wy.js +12633 -0
  23. package/dist/chunks/cose-bilkent-JH36ORCC-CaMqpJY7.js +2608 -0
  24. package/dist/chunks/cynefin-OW5HDTMX-Bzjecpt-.js +23853 -0
  25. package/dist/chunks/cynefinDiagram-5FMLGOSQ-C0NuKLt0.js +299 -0
  26. package/dist/chunks/cytoscape.esm-DmPrb1GM.js +18787 -0
  27. package/dist/chunks/dagre-GXQ25YYZ-Ds09_NdN.js +461 -0
  28. package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
  29. package/dist/chunks/diagram-S7CK7UJ4-IvSazk1O.js +349 -0
  30. package/dist/chunks/diagram-UQ7AKVKN-58epdx5V.js +223 -0
  31. package/dist/chunks/diagram-VSXAHHWV-BrzRGMeV.js +466 -0
  32. package/dist/chunks/diagram-VX7I27RA-DPL0Nw6d.js +530 -0
  33. package/dist/chunks/diagram-Z3DM3KII-8VWVu0I5.js +143 -0
  34. package/dist/chunks/ebnfDiagram-PWID7BFC-DeByR_ze.js +109 -0
  35. package/dist/chunks/erDiagram-RLTQ6QDP-C9uo9iE1.js +1060 -0
  36. package/dist/chunks/flowDiagram-HODETNUW-BpoY3OMp.js +7 -0
  37. package/dist/chunks/ganttDiagram-EL5Y4UJY-psdwnC-T.js +2711 -0
  38. package/dist/chunks/gitGraphDiagram-WWUBYQGX-vsDfkn_Q.js +828 -0
  39. package/dist/chunks/index-f7Uzykhj.js +38262 -0
  40. package/dist/chunks/infoDiagram-27XIBGKW-8K-eQZiU.js +24 -0
  41. package/dist/chunks/init-DjUOC4st.js +16 -0
  42. package/dist/chunks/ishikawaDiagram-5VMMS53U-CuqR1k5i.js +622 -0
  43. package/dist/chunks/journeyDiagram-3NMN7TZE-BPW1nmwZ.js +834 -0
  44. package/dist/chunks/kanban-definition-UXKFOSKX-iY6-d6jO.js +726 -0
  45. package/dist/chunks/katex-jHfnQmlp.js +11682 -0
  46. package/dist/chunks/layout-CgV9vOdp.js +1704 -0
  47. package/dist/chunks/linear-BzcaSMTS.js +259 -0
  48. package/dist/chunks/mindmap-definition-YA3MSWOX-CaLfHyv0.js +831 -0
  49. package/dist/chunks/ordinal-DfAQgscy.js +61 -0
  50. package/dist/chunks/pegDiagram-XKGWAZYB-6Y28VvVh.js +95 -0
  51. package/dist/chunks/pieDiagram-E7YTZNPT-OrjeRxhs.js +209 -0
  52. package/dist/chunks/quadrantDiagram-AXDQQJYC-rgw2lV2J.js +1025 -0
  53. package/dist/chunks/railroadDiagram-O6MQD6OU-D6QNO5r1.js +77 -0
  54. package/dist/chunks/requirementDiagram-BXWQKSXE-a8tNRSuE.js +884 -0
  55. package/dist/chunks/sankeyDiagram-P5KCCOFB-CdaC8rLw.js +847 -0
  56. package/dist/chunks/sequenceDiagram-WJ2MYXX4-CGLi38Hj.js +2898 -0
  57. package/dist/chunks/sizeCapture-INFHLROL-g5RJXnik.js +47 -0
  58. package/dist/chunks/stateDiagram-D77RDMKH-Cou0eVl1.js +262 -0
  59. package/dist/chunks/stateDiagram-v2-MP3YSRHH-BHQspnUg.js +16 -0
  60. package/dist/chunks/swimlanes-42K2YHIH-BU7S1WgJ.js +5239 -0
  61. package/dist/chunks/swimlanesDiagram-VR7AAH4N-BsEplbno.js +13 -0
  62. package/dist/chunks/timeline-definition-24CTP7MA-BB-IyxWL.js +1066 -0
  63. package/dist/chunks/vennDiagram-4TSXK5OY-BToYolPI.js +1585 -0
  64. package/dist/chunks/wardleyDiagram-VM6X3IG4-BgoueOw_.js +684 -0
  65. package/dist/chunks/xychartDiagram-S5SC5T6Z-CF0fWv-W.js +1492 -0
  66. package/dist/components/CodeBlock.d.ts +5 -0
  67. package/dist/components/CommunityLinks.d.ts +21 -0
  68. package/dist/components/CookieConsent.d.ts +2 -0
  69. package/dist/components/DocLinkCard.d.ts +6 -0
  70. package/dist/components/LecturePageView.d.ts +3 -0
  71. package/dist/components/MermaidDiagram.d.ts +3 -0
  72. package/dist/components/SearchPopup.d.ts +6 -0
  73. package/dist/components/WikiApp.d.ts +9 -0
  74. package/dist/components/WikiLayout.d.ts +2 -0
  75. package/dist/components/WikiPageView.d.ts +6 -0
  76. package/dist/components/ZoomableImage.d.ts +2 -0
  77. package/dist/context/LangContext.d.ts +2 -0
  78. package/dist/context/WikiContext.d.ts +18 -0
  79. package/dist/data.d.ts +8 -0
  80. package/dist/hooks/useLanguage.d.ts +4 -0
  81. package/dist/hooks/useTheme.d.ts +5 -0
  82. package/dist/hooks/useWiki.d.ts +2 -0
  83. package/dist/index.d.ts +24 -0
  84. package/dist/index.js +45 -0
  85. package/dist/languages/ue-cpp.d.ts +7 -0
  86. package/dist/languages/ue-cpp.js +21 -0
  87. package/dist/types.d.ts +119 -0
  88. package/dist/wiki-engine.css +1 -0
  89. package/package.json +76 -0
@@ -0,0 +1,47 @@
1
+ import { _ as n } from "./index-f7Uzykhj.js";
2
+ var p = 1;
3
+ function a() {
4
+ if (!(typeof globalThis > "u"))
5
+ return globalThis;
6
+ }
7
+ n(a, "getCaptureGlobal");
8
+ function m() {
9
+ var o;
10
+ return !!((o = a()) != null && o.mermaidCaptureSizes);
11
+ }
12
+ n(m, "shouldCaptureSizes");
13
+ function d() {
14
+ return typeof location > "u" ? "browser-dev" : `${location.pathname}${location.search}`;
15
+ }
16
+ n(d, "capturedFromLocation");
17
+ function s(o, r) {
18
+ const e = a();
19
+ if (!e)
20
+ return;
21
+ const t = r.node(), i = (t && "ownerSVGElement" in t ? t.ownerSVGElement : null) ?? t, c = (i == null ? void 0 : i.id) ?? "(unknown)";
22
+ e.mermaidCapturedSizes ?? (e.mermaidCapturedSizes = []);
23
+ const u = { svgId: c, sizes: o };
24
+ e.mermaidCapturedSizes.push(u), e.mermaidLastCapturedSizes = u;
25
+ }
26
+ n(s, "emitCapturedSizes");
27
+ function l(o, r) {
28
+ const e = [];
29
+ for (const t of r.nodes)
30
+ t.isGroup || e.push({ id: t.id, width: t.width ?? 0, height: t.height ?? 0 });
31
+ e.length !== 0 && s(
32
+ {
33
+ metadata: {
34
+ captureVersion: p,
35
+ capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
36
+ capturedFrom: d()
37
+ },
38
+ nodes: e
39
+ },
40
+ o
41
+ );
42
+ }
43
+ n(l, "captureNodeSizes");
44
+ export {
45
+ l as captureNodeSizes,
46
+ m as shouldCaptureSizes
47
+ };
@@ -0,0 +1,262 @@
1
+ import { s as R, a as W, S as N } from "./chunk-IMKFNOWR-DkBQ-1aV.js";
2
+ import { _ as f, c as t, j as T, l as S, d as P, T as U, k as z, U as _, V as C, Q as F, u as O } from "./index-f7Uzykhj.js";
3
+ import { l as J } from "./layout-CgV9vOdp.js";
4
+ 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) => {
5
+ 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();
6
+ 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;
7
+ }, "drawSimpleState"), I = /* @__PURE__ */ f((e, i) => {
8
+ const d = /* @__PURE__ */ f(function(o, m, y) {
9
+ const v = o.append("tspan").attr("x", 2 * t().state.padding).text(m);
10
+ y || v.attr("dy", t().state.textHeight);
11
+ }, "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, p = e.append("text").attr("x", t().state.padding).attr(
12
+ "y",
13
+ l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
14
+ ).attr("class", "state-description");
15
+ let a = !0, s = !0;
16
+ i.descriptions.forEach(function(o) {
17
+ a || (d(p, o, s), s = !1), a = !1;
18
+ });
19
+ const B = 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"), x = p.node().getBBox(), g = Math.max(x.width, n.width);
20
+ return B.attr("x2", g + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", g + 2 * t().state.padding).attr("height", x.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;
21
+ }, "drawDescrState"), $ = /* @__PURE__ */ f((e, i, d) => {
22
+ const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), p = 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), x = s.node().getBBox().width + n;
23
+ let g = Math.max(x, p);
24
+ g === p && (g = g + n);
25
+ let o;
26
+ const m = e.node().getBBox();
27
+ i.doc, o = a - c, x > p && (o = (p - g) / 2 + c), Math.abs(a - m.x) < c && x > p && (o = a - (x - p) / 2);
28
+ const y = 1 - t().state.textHeight;
29
+ return e.insert("rect", ":first-child").attr("x", o).attr("y", y).attr("class", d ? "alt-composit" : "composit").attr("width", g).attr(
30
+ "height",
31
+ m.height + t().state.textHeight + t().state.titleShift + 1
32
+ ).attr("rx", "0"), s.attr("x", o + c), x <= p && s.attr("x", a + (g - n) / 2 - x / 2 + c), e.insert("rect", ":first-child").attr("x", o).attr(
33
+ "y",
34
+ t().state.titleShift - t().state.textHeight - t().state.padding
35
+ ).attr("width", g).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", o).attr(
36
+ "y",
37
+ t().state.titleShift - t().state.textHeight - t().state.padding
38
+ ).attr("width", g).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
39
+ }, "addTitleAndBox"), j = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
40
+ "cx",
41
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
42
+ ).attr(
43
+ "cy",
44
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
45
+ ), 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"), q = /* @__PURE__ */ f((e, i) => {
46
+ let d = t().state.forkWidth, c = t().state.forkHeight;
47
+ if (i.parentId) {
48
+ let n = d;
49
+ d = c, c = n;
50
+ }
51
+ 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);
52
+ }, "drawForkJoinState"), Q = /* @__PURE__ */ f((e, i, d, c) => {
53
+ let n = 0;
54
+ const l = c.append("text");
55
+ l.style("text-anchor", "start"), l.attr("class", "noteText");
56
+ let p = e.replace(/\r\n/g, "<br/>");
57
+ p = p.replace(/\n/g, "<br/>");
58
+ const a = p.split(z.lineBreakRegex);
59
+ let s = 1.25 * t().state.noteMargin;
60
+ for (const B of a) {
61
+ const x = B.trim();
62
+ if (x.length > 0) {
63
+ const g = l.append("tspan");
64
+ if (g.text(x), s === 0) {
65
+ const o = g.node().getBBox();
66
+ s += o.height;
67
+ }
68
+ n += s, g.attr("x", i + t().state.noteMargin), g.attr("y", d + n + 1.25 * t().state.noteMargin);
69
+ }
70
+ }
71
+ return { textWidth: l.node().getBBox().width, textHeight: n };
72
+ }, "_drawLongText"), V = /* @__PURE__ */ f((e, i) => {
73
+ i.attr("class", "state-note");
74
+ const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = Q(e, 0, 0, c);
75
+ return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
76
+ }, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
77
+ const d = i.id, c = {
78
+ id: d,
79
+ label: i.id,
80
+ width: 0,
81
+ height: 0
82
+ }, n = e.append("g").attr("id", d).attr("class", "stateGroup");
83
+ i.type === "start" && X(n), i.type === "end" && j(n), (i.type === "fork" || i.type === "join") && q(n, i), i.type === "note" && V(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);
84
+ const l = n.node().getBBox();
85
+ return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
86
+ }, "drawState"), A = 0, Z = /* @__PURE__ */ f(function(e, i, d) {
87
+ const c = /* @__PURE__ */ f(function(s) {
88
+ switch (s) {
89
+ case N.relationType.AGGREGATION:
90
+ return "aggregation";
91
+ case N.relationType.EXTENSION:
92
+ return "extension";
93
+ case N.relationType.COMPOSITION:
94
+ return "composition";
95
+ case N.relationType.DEPENDENCY:
96
+ return "dependency";
97
+ }
98
+ }, "getRelationType");
99
+ i.points = i.points.filter((s) => !Number.isNaN(s.y));
100
+ const n = i.points, l = _().x(function(s) {
101
+ return s.x;
102
+ }).y(function(s) {
103
+ return s.y;
104
+ }).curve(C), p = e.append("path").attr("d", l(n)).attr("id", "edge" + A).attr("class", "transition");
105
+ let a = "";
106
+ if (t().state.arrowMarkerAbsolute && (a = F(!0)), p.attr(
107
+ "marker-end",
108
+ "url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
109
+ ), d.title !== void 0) {
110
+ const s = e.append("g").attr("class", "stateLabel"), { x: B, y: x } = O.calcLabelPosition(i.points), g = z.getRows(d.title);
111
+ let o = 0;
112
+ const m = [];
113
+ let y = 0, v = 0;
114
+ for (let u = 0; u <= g.length; u++) {
115
+ const h = s.append("text").attr("text-anchor", "middle").text(g[u]).attr("x", B).attr("y", x + o), w = h.node().getBBox();
116
+ y = Math.max(y, w.width), v = Math.min(v, w.x), S.info(w.x, B, x + o), o === 0 && (o = h.node().getBBox().height, S.info("Title height", o, x)), m.push(h);
117
+ }
118
+ let k = o * g.length;
119
+ if (g.length > 1) {
120
+ const u = (g.length - 1) * o * 0.5;
121
+ m.forEach((h, w) => h.attr("y", x + w * o - u)), k = o * g.length;
122
+ }
123
+ const r = s.node().getBBox();
124
+ s.insert("rect", ":first-child").attr("class", "box").attr("x", B - y / 2 - t().state.padding / 2).attr("y", x - k / 2 - t().state.padding / 2 - 3.5).attr("width", y + t().state.padding).attr("height", k + t().state.padding), S.info(r);
125
+ }
126
+ A++;
127
+ }, "drawEdge"), b, H = {}, K = /* @__PURE__ */ f(function() {
128
+ }, "setConf"), tt = /* @__PURE__ */ f(function(e) {
129
+ 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");
130
+ }, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
131
+ b = t().state;
132
+ const n = t().securityLevel;
133
+ let l;
134
+ n === "sandbox" && (l = T("#i" + i));
135
+ const p = n === "sandbox" ? T(l.nodes()[0].contentDocument.body) : T("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document;
136
+ S.debug("Rendering diagram " + e);
137
+ const s = p.select(`[id='${i}']`);
138
+ tt(s);
139
+ const B = c.db.getRootDoc(), x = s.append("g").attr("id", i + "-root");
140
+ G(B, x, void 0, !1, p, a, c);
141
+ const g = b.padding, o = s.node().getBBox(), m = o.width + g * 2, y = o.height + g * 2, v = m * 1.75;
142
+ P(s, y, v, b.useMaxWidth), s.attr(
143
+ "viewBox",
144
+ `${o.x - b.padding} ${o.y - b.padding} ` + m + " " + y
145
+ );
146
+ }, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), G = /* @__PURE__ */ f((e, i, d, c, n, l, p) => {
147
+ const a = new U({
148
+ compound: !0,
149
+ multigraph: !0
150
+ });
151
+ let s, B = !0;
152
+ for (s = 0; s < e.length; s++)
153
+ if (e[s].stmt === "relation") {
154
+ B = !1;
155
+ break;
156
+ }
157
+ d ? a.setGraph({
158
+ rankdir: "LR",
159
+ multigraph: !0,
160
+ compound: !0,
161
+ // acyclicer: 'greedy',
162
+ ranker: "tight-tree",
163
+ ranksep: B ? 1 : b.edgeLengthFactor,
164
+ nodeSep: B ? 1 : 50,
165
+ isMultiGraph: !0
166
+ // ranksep: 5,
167
+ // nodesep: 1
168
+ }) : a.setGraph({
169
+ rankdir: "TB",
170
+ multigraph: !0,
171
+ compound: !0,
172
+ // isCompound: true,
173
+ // acyclicer: 'greedy',
174
+ // ranker: 'longest-path'
175
+ ranksep: B ? 1 : b.edgeLengthFactor,
176
+ nodeSep: B ? 1 : 50,
177
+ ranker: "tight-tree",
178
+ // ranker: 'network-simplex'
179
+ isMultiGraph: !0
180
+ }), a.setDefaultEdgeLabel(function() {
181
+ return {};
182
+ });
183
+ const x = p.db.getStates(), g = p.db.getRelations(), o = Object.keys(x);
184
+ for (const r of o) {
185
+ const u = x[r];
186
+ d && (u.parentId = d);
187
+ let h;
188
+ if (u.doc) {
189
+ let w = i.append("g").attr("id", u.id).attr("class", "stateGroup");
190
+ h = G(u.doc, w, u.id, !c, n, l, p);
191
+ {
192
+ w = $(w, u, c);
193
+ let E = w.node().getBBox();
194
+ h.width = E.width, h.height = E.height + b.padding / 2, H[u.id] = { y: b.compositTitleSize };
195
+ }
196
+ } else
197
+ h = L(i, u, a);
198
+ if (u.note) {
199
+ const w = {
200
+ descriptions: [],
201
+ id: u.id + "-note",
202
+ note: u.note,
203
+ type: "note"
204
+ }, E = L(i, w, a);
205
+ u.note.position === "left of" ? (a.setNode(h.id + "-note", E), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", E)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
206
+ } else
207
+ a.setNode(h.id, h);
208
+ }
209
+ S.debug("Count=", a.nodeCount(), a);
210
+ let m = 0;
211
+ g.forEach(function(r) {
212
+ m++, S.debug("Setting edge", r), a.setEdge(
213
+ r.id1,
214
+ r.id2,
215
+ {
216
+ relation: r,
217
+ width: at(r.title),
218
+ height: b.labelHeight * z.getRows(r.title).length,
219
+ labelpos: "c"
220
+ },
221
+ "id" + m
222
+ );
223
+ }), J(a), S.debug("Graph after layout", a.nodes());
224
+ const y = i.node();
225
+ a.nodes().forEach(function(r) {
226
+ r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + y.id + " #" + r).attr(
227
+ "transform",
228
+ "translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (H[r] ? H[r].y : 0) - a.node(r).height / 2) + " )"
229
+ ), n.select("#" + y.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + y.id + " #" + r + " .divider").forEach((h) => {
230
+ const w = h.parentElement;
231
+ let E = 0, M = 0;
232
+ w && (w.parentElement && (E = w.parentElement.getBBox().width), M = parseInt(w.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", E - M - 8);
233
+ })) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
234
+ });
235
+ let v = y.getBBox();
236
+ a.edges().forEach(function(r) {
237
+ r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Z(i, a.edge(r), a.edge(r).relation));
238
+ }), v = y.getBBox();
239
+ const k = {
240
+ id: d || "root",
241
+ label: d || "root",
242
+ width: 0,
243
+ height: 0
244
+ };
245
+ return k.width = v.width + 2 * b.padding, k.height = v.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
246
+ }, "renderDoc"), it = {
247
+ setConf: K,
248
+ draw: et
249
+ }, dt = {
250
+ parser: W,
251
+ get db() {
252
+ return new N(1);
253
+ },
254
+ renderer: it,
255
+ styles: R,
256
+ init: /* @__PURE__ */ f((e) => {
257
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
258
+ }, "init")
259
+ };
260
+ export {
261
+ dt as diagram
262
+ };
@@ -0,0 +1,16 @@
1
+ import { s as a, b as t, a as r, S as s } from "./chunk-IMKFNOWR-DkBQ-1aV.js";
2
+ import { _ as i } from "./index-f7Uzykhj.js";
3
+ var _ = {
4
+ parser: r,
5
+ get db() {
6
+ return new s(2);
7
+ },
8
+ renderer: t,
9
+ styles: a,
10
+ init: /* @__PURE__ */ i((e) => {
11
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
12
+ }, "init")
13
+ };
14
+ export {
15
+ _ as diagram
16
+ };