mio-previewer 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -0
  3. package/README.zh-CN.md +206 -0
  4. package/dist/MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js +4562 -0
  5. package/dist/MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs +16 -0
  6. package/dist/_basePickBy-CZxbwAvt.cjs +1 -0
  7. package/dist/_basePickBy-nvL1-X4h.js +151 -0
  8. package/dist/_baseUniq-Cwhfu1XM.js +614 -0
  9. package/dist/_baseUniq-DunUk-cd.cjs +1 -0
  10. package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
  11. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  12. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  13. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  14. package/dist/arc-C9I4pYLv.js +83 -0
  15. package/dist/arc-fCflz0gB.cjs +1 -0
  16. package/dist/architecture-O4VJ6CD3-D00QJU0o.js +5 -0
  17. package/dist/architecture-O4VJ6CD3-dKuizgWO.cjs +1 -0
  18. package/dist/architectureDiagram-VXUJARFQ-DQ-YD3RX.cjs +36 -0
  19. package/dist/architectureDiagram-VXUJARFQ-VWr1UuPv.js +4662 -0
  20. package/dist/assets/parser.worker-67NQKZt5.js +16 -0
  21. package/dist/blockDiagram-VD42YOAC-DuC96I2Q.js +2261 -0
  22. package/dist/blockDiagram-VD42YOAC-EC2x5LwN.cjs +122 -0
  23. package/dist/c4Diagram-YG6GDRKO-Dm5d0BWL.cjs +10 -0
  24. package/dist/c4Diagram-YG6GDRKO-OB8wIuF8.js +1580 -0
  25. package/dist/channel-C-uR528Z.js +5 -0
  26. package/dist/channel-YfH5CBV-.cjs +1 -0
  27. package/dist/chunk-4BX2VUAB-3Liht_XN.cjs +1 -0
  28. package/dist/chunk-4BX2VUAB-j8LeaMvy.js +8 -0
  29. package/dist/chunk-55IACEB6-Dm3mi3ha.cjs +1 -0
  30. package/dist/chunk-55IACEB6-IYAIzfR4.js +8 -0
  31. package/dist/chunk-B4BG7PRW-CpqTB0S5.cjs +165 -0
  32. package/dist/chunk-B4BG7PRW-DB5df3Iz.js +1375 -0
  33. package/dist/chunk-DI55MBZ5-BoFZpvY3.js +1370 -0
  34. package/dist/chunk-DI55MBZ5-wqsoqtNw.cjs +220 -0
  35. package/dist/chunk-FMBD7UC4-BZS_4hun.cjs +15 -0
  36. package/dist/chunk-FMBD7UC4-CdmoYYnM.js +19 -0
  37. package/dist/chunk-QN33PNHL-BuyP9RXS.js +19 -0
  38. package/dist/chunk-QN33PNHL-CHI_-zix.cjs +1 -0
  39. package/dist/chunk-QZHKN3VN-15dJyQk0.js +15 -0
  40. package/dist/chunk-QZHKN3VN-DfH9qQ3T.cjs +1 -0
  41. package/dist/chunk-TZMSLE5B-BgFWf03M.js +64 -0
  42. package/dist/chunk-TZMSLE5B-qIo1h7Gz.cjs +1 -0
  43. package/dist/classDiagram-2ON5EDUG-BQz3UzKi.js +16 -0
  44. package/dist/classDiagram-2ON5EDUG-CZWeacVd.cjs +1 -0
  45. package/dist/classDiagram-v2-WZHVMYZB-BQz3UzKi.js +16 -0
  46. package/dist/classDiagram-v2-WZHVMYZB-CZWeacVd.cjs +1 -0
  47. package/dist/clone-ByeQKKoW.cjs +1 -0
  48. package/dist/clone-D6h_cwF4.js +8 -0
  49. package/dist/cose-bilkent-S5V4N54A-5dO3qpr4.cjs +1 -0
  50. package/dist/cose-bilkent-S5V4N54A-D2q7jBXB.js +2609 -0
  51. package/dist/cytoscape.esm-DHF7mANN.cjs +331 -0
  52. package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
  53. package/dist/dagre-6UL2VRFP-Cfh4UdSr.js +444 -0
  54. package/dist/dagre-6UL2VRFP-DS2Ki9Dv.cjs +4 -0
  55. package/dist/defaultLocale-D7EN2tov.js +171 -0
  56. package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
  57. package/dist/diagram-PSM6KHXK-BZDEX43o.js +531 -0
  58. package/dist/diagram-PSM6KHXK-CTsP6f2a.cjs +24 -0
  59. package/dist/diagram-QEK2KX5R-BDKMNi97.cjs +43 -0
  60. package/dist/diagram-QEK2KX5R-Dda_FEDc.js +217 -0
  61. package/dist/diagram-S2PKOQOG-CmfsKOvs.cjs +24 -0
  62. package/dist/diagram-S2PKOQOG-Cnw4b7LB.js +142 -0
  63. package/dist/entries/md.cjs.js +1 -0
  64. package/dist/entries/md.es.js +5 -0
  65. package/dist/entries/plugin-alert.cjs.js +1 -0
  66. package/dist/entries/plugin-alert.es.js +27 -0
  67. package/dist/entries/plugin-codeblock.cjs.js +9 -0
  68. package/dist/entries/plugin-codeblock.es.js +3441 -0
  69. package/dist/entries/plugin-emoji.cjs.js +1 -0
  70. package/dist/entries/plugin-emoji.es.js +28 -0
  71. package/dist/entries/plugin-katex.cjs.js +1 -0
  72. package/dist/entries/plugin-katex.es.js +92 -0
  73. package/dist/entries/plugin-mermaid.cjs.js +1 -0
  74. package/dist/entries/plugin-mermaid.es.js +4 -0
  75. package/dist/erDiagram-Q2GNP2WA-DE4JLeNF.cjs +60 -0
  76. package/dist/erDiagram-Q2GNP2WA-qAdA8fbE.js +841 -0
  77. package/dist/favicon.ico +0 -0
  78. package/dist/flowDiagram-NV44I4VS-C7YBx4JP.js +1620 -0
  79. package/dist/flowDiagram-NV44I4VS-j3dB-fjF.cjs +162 -0
  80. package/dist/ganttDiagram-LVOFAZNH-BL-Yjadx.js +2506 -0
  81. package/dist/ganttDiagram-LVOFAZNH-CBhzET57.cjs +267 -0
  82. package/dist/gitGraph-ZV4HHKMB-Dr9sn7R3.js +5 -0
  83. package/dist/gitGraph-ZV4HHKMB-DyXW77WY.cjs +1 -0
  84. package/dist/gitGraphDiagram-NY62KEGX-DDklxVnY.cjs +65 -0
  85. package/dist/gitGraphDiagram-NY62KEGX-DFn7h5BH.js +699 -0
  86. package/dist/graph-CHoeKkVR.cjs +1 -0
  87. package/dist/graph-DiGqaw_6.js +247 -0
  88. package/dist/info-63CPKGFF-BGxbI0Qv.cjs +1 -0
  89. package/dist/info-63CPKGFF-xflgSxfH.js +5 -0
  90. package/dist/infoDiagram-F6ZHWCRC-DOtGa28U.js +24 -0
  91. package/dist/infoDiagram-F6ZHWCRC-Duylo4r7.cjs +2 -0
  92. package/dist/init-CHZsXQcr.cjs +1 -0
  93. package/dist/init-DjUOC4st.js +16 -0
  94. package/dist/journeyDiagram-XKPGCS4Q-bJncB3oe.js +834 -0
  95. package/dist/journeyDiagram-XKPGCS4Q-h-CtcfbS.cjs +139 -0
  96. package/dist/kanban-definition-3W4ZIXB7-C3y0C_bw.cjs +89 -0
  97. package/dist/kanban-definition-3W4ZIXB7-nMPCi8GW.js +719 -0
  98. package/dist/katex-CmGeg_OO.js +11692 -0
  99. package/dist/katex-DEiiRhcn.cjs +261 -0
  100. package/dist/layout-BG4AbhIW.cjs +1 -0
  101. package/dist/layout-CHaNS4g6.js +1324 -0
  102. package/dist/linear-Bqd4C_Yb.cjs +1 -0
  103. package/dist/linear-CPFNaVnw.js +259 -0
  104. package/dist/mermaid-parser.core-CR8Rcyps.cjs +128 -0
  105. package/dist/mermaid-parser.core-CkQKh-yb.js +12966 -0
  106. package/dist/mindmap-definition-VGOIOE7T-C63AEIdU.js +784 -0
  107. package/dist/mindmap-definition-VGOIOE7T-CHI9UFtA.cjs +68 -0
  108. package/dist/mio-previewer.cjs.js +3 -0
  109. package/dist/mio-previewer.css +1 -0
  110. package/dist/mio-previewer.es.js +25 -0
  111. package/dist/ordinal-CagbB1m8.cjs +1 -0
  112. package/dist/ordinal-DfAQgscy.js +61 -0
  113. package/dist/packet-HUATNLJX-BeAGxpDF.cjs +1 -0
  114. package/dist/packet-HUATNLJX-dnmrn2-l.js +5 -0
  115. package/dist/parser.worker.js +21 -0
  116. package/dist/pie-WTHONI2E-BKoHQt0i.js +5 -0
  117. package/dist/pie-WTHONI2E-BifrFKgo.cjs +1 -0
  118. package/dist/pieDiagram-ADFJNKIX-B9OONHi_.cjs +30 -0
  119. package/dist/pieDiagram-ADFJNKIX-CEMFAt9B.js +161 -0
  120. package/dist/plugin-mermaid-FTki7cN8.cjs +255 -0
  121. package/dist/plugin-mermaid-y4lbJ7sL.js +15369 -0
  122. package/dist/quadrantDiagram-AYHSOK5B-DobvzsAU.js +1022 -0
  123. package/dist/quadrantDiagram-AYHSOK5B-DqXDgyBD.cjs +7 -0
  124. package/dist/radar-NJJJXTRR-BPN19Spv.cjs +1 -0
  125. package/dist/radar-NJJJXTRR-Bj9rI8mr.js +5 -0
  126. package/dist/requirementDiagram-UZGBJVZJ-CVbmNF7M.cjs +64 -0
  127. package/dist/requirementDiagram-UZGBJVZJ-M-MPvTnX.js +850 -0
  128. package/dist/sankeyDiagram-TZEHDZUN-C-ESiLJA.cjs +10 -0
  129. package/dist/sankeyDiagram-TZEHDZUN-Czsin99f.js +810 -0
  130. package/dist/sequenceDiagram-WL72ISMW-BJByNQsK.js +2511 -0
  131. package/dist/sequenceDiagram-WL72ISMW-DApIQwP-.cjs +145 -0
  132. package/dist/stateDiagram-FKZM4ZOC-BuKL2w66.cjs +1 -0
  133. package/dist/stateDiagram-FKZM4ZOC-jAiBDhVn.js +263 -0
  134. package/dist/stateDiagram-v2-4FDKWEC3-Ct5PFxdd.cjs +1 -0
  135. package/dist/stateDiagram-v2-4FDKWEC3-umSVoFht.js +16 -0
  136. package/dist/timeline-definition-IT6M3QCI-BfAvK0gf.cjs +61 -0
  137. package/dist/timeline-definition-IT6M3QCI-I--lBLTi.js +795 -0
  138. package/dist/treemap-75Q7IDZK-DNt-zuL8.cjs +1 -0
  139. package/dist/treemap-75Q7IDZK-bjql9DgL.js +5 -0
  140. package/dist/types/entries/md.d.ts +3 -0
  141. package/dist/types/entries/plugin-alert.d.ts +1 -0
  142. package/dist/types/entries/plugin-codeblock.d.ts +1 -0
  143. package/dist/types/entries/plugin-emoji.d.ts +1 -0
  144. package/dist/types/entries/plugin-katex.d.ts +1 -0
  145. package/dist/types/entries/plugin-mermaid.d.ts +1 -0
  146. package/dist/types/helpers/containerHelpers.d.ts +47 -0
  147. package/dist/types/helpers/index.d.ts +4 -0
  148. package/dist/types/index.d.ts +5 -0
  149. package/dist/types/main-plugin-demo.d.ts +1 -0
  150. package/dist/types/main.d.ts +1 -0
  151. package/dist/types/plugins/AlertPlugin.d.ts +16 -0
  152. package/dist/types/plugins/CodeBlockPlugin.d.ts +9 -0
  153. package/dist/types/plugins/EmojiPlugin.d.ts +11 -0
  154. package/dist/types/plugins/katexPlugin.d.ts +8 -0
  155. package/dist/types/plugins/mermaidPlugin.d.ts +13 -0
  156. package/dist/types/types.d.ts +77 -0
  157. package/dist/xychartDiagram-PRI3JC2R-BN9e47xe.cjs +7 -0
  158. package/dist/xychartDiagram-PRI3JC2R-XrOK_egj.js +1340 -0
  159. package/package.json +114 -0
@@ -0,0 +1,217 @@
1
+ import { _ as l, s as k, g as R, q as E, p as F, a as I, b as _, H as D, y as G, D as f, E as C, F as P, l as z, K as H } from "./plugin-mermaid-y4lbJ7sL.js";
2
+ import { p as V } from "./chunk-4BX2VUAB-j8LeaMvy.js";
3
+ import { p as W } from "./mermaid-parser.core-CkQKh-yb.js";
4
+ var x = {
5
+ showLegend: !0,
6
+ ticks: 5,
7
+ max: null,
8
+ min: 0,
9
+ graticule: "circle"
10
+ }, w = {
11
+ axes: [],
12
+ curves: [],
13
+ options: x
14
+ }, h = structuredClone(w), B = P.radar, j = /* @__PURE__ */ l(() => f({
15
+ ...B,
16
+ ...C().radar
17
+ }), "getConfig"), b = /* @__PURE__ */ l(() => h.axes, "getAxes"), q = /* @__PURE__ */ l(() => h.curves, "getCurves"), K = /* @__PURE__ */ l(() => h.options, "getOptions"), N = /* @__PURE__ */ l((a) => {
18
+ h.axes = a.map((t) => ({
19
+ name: t.name,
20
+ label: t.label ?? t.name
21
+ }));
22
+ }, "setAxes"), U = /* @__PURE__ */ l((a) => {
23
+ h.curves = a.map((t) => ({
24
+ name: t.name,
25
+ label: t.label ?? t.name,
26
+ entries: X(t.entries)
27
+ }));
28
+ }, "setCurves"), X = /* @__PURE__ */ l((a) => {
29
+ if (a[0].axis == null)
30
+ return a.map((e) => e.value);
31
+ const t = b();
32
+ if (t.length === 0)
33
+ throw new Error("Axes must be populated before curves for reference entries");
34
+ return t.map((e) => {
35
+ const r = a.find((s) => s.axis?.$refText === e.name);
36
+ if (r === void 0)
37
+ throw new Error("Missing entry for axis " + e.label);
38
+ return r.value;
39
+ });
40
+ }, "computeCurveEntries"), Y = /* @__PURE__ */ l((a) => {
41
+ const t = a.reduce(
42
+ (e, r) => (e[r.name] = r, e),
43
+ {}
44
+ );
45
+ h.options = {
46
+ showLegend: t.showLegend?.value ?? x.showLegend,
47
+ ticks: t.ticks?.value ?? x.ticks,
48
+ max: t.max?.value ?? x.max,
49
+ min: t.min?.value ?? x.min,
50
+ graticule: t.graticule?.value ?? x.graticule
51
+ };
52
+ }, "setOptions"), Z = /* @__PURE__ */ l(() => {
53
+ G(), h = structuredClone(w);
54
+ }, "clear"), $ = {
55
+ getAxes: b,
56
+ getCurves: q,
57
+ getOptions: K,
58
+ setAxes: N,
59
+ setCurves: U,
60
+ setOptions: Y,
61
+ getConfig: j,
62
+ clear: Z,
63
+ setAccTitle: _,
64
+ getAccTitle: I,
65
+ setDiagramTitle: F,
66
+ getDiagramTitle: E,
67
+ getAccDescription: R,
68
+ setAccDescription: k
69
+ }, J = /* @__PURE__ */ l((a) => {
70
+ V(a, $);
71
+ const { axes: t, curves: e, options: r } = a;
72
+ $.setAxes(t), $.setCurves(e), $.setOptions(r);
73
+ }, "populate"), Q = {
74
+ parse: /* @__PURE__ */ l(async (a) => {
75
+ const t = await W("radar", a);
76
+ z.debug(t), J(t);
77
+ }, "parse")
78
+ }, tt = /* @__PURE__ */ l((a, t, e, r) => {
79
+ const s = r.db, o = s.getAxes(), i = s.getCurves(), n = s.getOptions(), c = s.getConfig(), d = s.getDiagramTitle(), p = D(t), u = et(p, c), g = n.max ?? Math.max(...i.map((y) => Math.max(...y.entries))), m = n.min, v = Math.min(c.width, c.height) / 2;
80
+ at(u, o, v, n.ticks, n.graticule), rt(u, o, v, c), M(u, o, i, m, g, n.graticule, c), T(u, i, n.showLegend, c), u.append("text").attr("class", "radarTitle").text(d).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
81
+ }, "draw"), et = /* @__PURE__ */ l((a, t) => {
82
+ const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = {
83
+ x: t.marginLeft + t.width / 2,
84
+ y: t.marginTop + t.height / 2
85
+ };
86
+ return a.attr("viewbox", `0 0 ${e} ${r}`).attr("width", e).attr("height", r), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);
87
+ }, "drawFrame"), at = /* @__PURE__ */ l((a, t, e, r, s) => {
88
+ if (s === "circle")
89
+ for (let o = 0; o < r; o++) {
90
+ const i = e * (o + 1) / r;
91
+ a.append("circle").attr("r", i).attr("class", "radarGraticule");
92
+ }
93
+ else if (s === "polygon") {
94
+ const o = t.length;
95
+ for (let i = 0; i < r; i++) {
96
+ const n = e * (i + 1) / r, c = t.map((d, p) => {
97
+ const u = 2 * p * Math.PI / o - Math.PI / 2, g = n * Math.cos(u), m = n * Math.sin(u);
98
+ return `${g},${m}`;
99
+ }).join(" ");
100
+ a.append("polygon").attr("points", c).attr("class", "radarGraticule");
101
+ }
102
+ }
103
+ }, "drawGraticule"), rt = /* @__PURE__ */ l((a, t, e, r) => {
104
+ const s = t.length;
105
+ for (let o = 0; o < s; o++) {
106
+ const i = t[o].label, n = 2 * o * Math.PI / s - Math.PI / 2;
107
+ a.append("line").attr("x1", 0).attr("y1", 0).attr("x2", e * r.axisScaleFactor * Math.cos(n)).attr("y2", e * r.axisScaleFactor * Math.sin(n)).attr("class", "radarAxisLine"), a.append("text").text(i).attr("x", e * r.axisLabelFactor * Math.cos(n)).attr("y", e * r.axisLabelFactor * Math.sin(n)).attr("class", "radarAxisLabel");
108
+ }
109
+ }, "drawAxes");
110
+ function M(a, t, e, r, s, o, i) {
111
+ const n = t.length, c = Math.min(i.width, i.height) / 2;
112
+ e.forEach((d, p) => {
113
+ if (d.entries.length !== n)
114
+ return;
115
+ const u = d.entries.map((g, m) => {
116
+ const v = 2 * Math.PI * m / n - Math.PI / 2, y = A(g, r, s, c), O = y * Math.cos(v), S = y * Math.sin(v);
117
+ return { x: O, y: S };
118
+ });
119
+ o === "circle" ? a.append("path").attr("d", L(u, i.curveTension)).attr("class", `radarCurve-${p}`) : o === "polygon" && a.append("polygon").attr("points", u.map((g) => `${g.x},${g.y}`).join(" ")).attr("class", `radarCurve-${p}`);
120
+ });
121
+ }
122
+ l(M, "drawCurves");
123
+ function A(a, t, e, r) {
124
+ const s = Math.min(Math.max(a, t), e);
125
+ return r * (s - t) / (e - t);
126
+ }
127
+ l(A, "relativeRadius");
128
+ function L(a, t) {
129
+ const e = a.length;
130
+ let r = `M${a[0].x},${a[0].y}`;
131
+ for (let s = 0; s < e; s++) {
132
+ const o = a[(s - 1 + e) % e], i = a[s], n = a[(s + 1) % e], c = a[(s + 2) % e], d = {
133
+ x: i.x + (n.x - o.x) * t,
134
+ y: i.y + (n.y - o.y) * t
135
+ }, p = {
136
+ x: n.x - (c.x - i.x) * t,
137
+ y: n.y - (c.y - i.y) * t
138
+ };
139
+ r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`;
140
+ }
141
+ return `${r} Z`;
142
+ }
143
+ l(L, "closedRoundCurve");
144
+ function T(a, t, e, r) {
145
+ if (!e)
146
+ return;
147
+ const s = (r.width / 2 + r.marginRight) * 3 / 4, o = -(r.height / 2 + r.marginTop) * 3 / 4, i = 20;
148
+ t.forEach((n, c) => {
149
+ const d = a.append("g").attr("transform", `translate(${s}, ${o + c * i})`);
150
+ d.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${c}`), d.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(n.label);
151
+ });
152
+ }
153
+ l(T, "drawLegend");
154
+ var st = { draw: tt }, nt = /* @__PURE__ */ l((a, t) => {
155
+ let e = "";
156
+ for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) {
157
+ const s = a[`cScale${r}`];
158
+ e += `
159
+ .radarCurve-${r} {
160
+ color: ${s};
161
+ fill: ${s};
162
+ fill-opacity: ${t.curveOpacity};
163
+ stroke: ${s};
164
+ stroke-width: ${t.curveStrokeWidth};
165
+ }
166
+ .radarLegendBox-${r} {
167
+ fill: ${s};
168
+ fill-opacity: ${t.curveOpacity};
169
+ stroke: ${s};
170
+ }
171
+ `;
172
+ }
173
+ return e;
174
+ }, "genIndexStyles"), ot = /* @__PURE__ */ l((a) => {
175
+ const t = H(), e = C(), r = f(t, e.themeVariables), s = f(r.radar, a);
176
+ return { themeVariables: r, radarOptions: s };
177
+ }, "buildRadarStyleOptions"), it = /* @__PURE__ */ l(({ radar: a } = {}) => {
178
+ const { themeVariables: t, radarOptions: e } = ot(a);
179
+ return `
180
+ .radarTitle {
181
+ font-size: ${t.fontSize};
182
+ color: ${t.titleColor};
183
+ dominant-baseline: hanging;
184
+ text-anchor: middle;
185
+ }
186
+ .radarAxisLine {
187
+ stroke: ${e.axisColor};
188
+ stroke-width: ${e.axisStrokeWidth};
189
+ }
190
+ .radarAxisLabel {
191
+ dominant-baseline: middle;
192
+ text-anchor: middle;
193
+ font-size: ${e.axisLabelFontSize}px;
194
+ color: ${e.axisColor};
195
+ }
196
+ .radarGraticule {
197
+ fill: ${e.graticuleColor};
198
+ fill-opacity: ${e.graticuleOpacity};
199
+ stroke: ${e.graticuleColor};
200
+ stroke-width: ${e.graticuleStrokeWidth};
201
+ }
202
+ .radarLegendText {
203
+ text-anchor: start;
204
+ font-size: ${e.legendFontSize}px;
205
+ dominant-baseline: hanging;
206
+ }
207
+ ${nt(t, e)}
208
+ `;
209
+ }, "styles"), ut = {
210
+ parser: Q,
211
+ db: $,
212
+ renderer: st,
213
+ styles: it
214
+ };
215
+ export {
216
+ ut as diagram
217
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./plugin-mermaid-FTki7cN8.cjs"),x=require("./chunk-4BX2VUAB-3Liht_XN.cjs"),B=require("./mermaid-parser.core-CR8Rcyps.cjs");var $=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...$,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{x.populateCommonDb(e,t);let i=-1,o=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??=i+1,r!==i+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${i+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??=r+(p??1)-1,p??=n-r+1,i=n,a.log.debug(`Packet block ${r} - ${i} with label ${d}`);o.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(o.push(g),g.end+1===l*c&&(t.pushWord(o),o=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(o)},"populate"),S=a.__name((e,t,i)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*i)return[e,void 0];const o=t*i-1,l=t*i;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{const t=await B.parse("packet",e),i=w.parser?.yy;if(!(i instanceof m))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.log.debug(t),_(t,i)},"parse")},P=a.__name((e,t,i,o)=>{const l=o.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,y]of g.entries())T(u,y,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),T=a.__name((e,t,i,{rowHeight:o,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=i*(o+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",o).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:P},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},"styles"),E={parser:w,get db(){return new m},renderer:D,styles:z};exports.diagram=E;
@@ -0,0 +1,142 @@
1
+ import { _ as b, D as m, H as B, e as C, l as w, b as S, a as D, p as T, q as E, g as F, s as P, E as z, F as A, y as W } from "./plugin-mermaid-y4lbJ7sL.js";
2
+ import { p as _ } from "./chunk-4BX2VUAB-j8LeaMvy.js";
3
+ import { p as N } from "./mermaid-parser.core-CkQKh-yb.js";
4
+ var L = A.packet, u, v = (u = class {
5
+ constructor() {
6
+ this.packet = [], this.setAccTitle = S, this.getAccTitle = D, this.setDiagramTitle = T, this.getDiagramTitle = E, this.getAccDescription = F, this.setAccDescription = P;
7
+ }
8
+ getConfig() {
9
+ const t = m({
10
+ ...L,
11
+ ...z().packet
12
+ });
13
+ return t.showBits && (t.paddingY += 10), t;
14
+ }
15
+ getPacket() {
16
+ return this.packet;
17
+ }
18
+ pushWord(t) {
19
+ t.length > 0 && this.packet.push(t);
20
+ }
21
+ clear() {
22
+ W(), this.packet = [];
23
+ }
24
+ }, b(u, "PacketDB"), u), M = 1e4, Y = /* @__PURE__ */ b((e, t) => {
25
+ _(e, t);
26
+ let r = -1, s = [], n = 1;
27
+ const { bitsPerRow: l } = t.getConfig();
28
+ for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
29
+ if (a !== void 0 && i !== void 0 && i < a)
30
+ throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
31
+ if (a ??= r + 1, a !== r + 1)
32
+ throw new Error(
33
+ `Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${r + 1}.`
34
+ );
35
+ if (d === 0)
36
+ throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
37
+ for (i ??= a + (d ?? 1) - 1, d ??= i - a + 1, r = i, w.debug(`Packet block ${a} - ${r} with label ${c}`); s.length <= l + 1 && t.getPacket().length < M; ) {
38
+ const [p, o] = H({ start: a, end: i, bits: d, label: c }, n, l);
39
+ if (s.push(p), p.end + 1 === n * l && (t.pushWord(s), s = [], n++), !o)
40
+ break;
41
+ ({ start: a, end: i, bits: d, label: c } = o);
42
+ }
43
+ }
44
+ t.pushWord(s);
45
+ }, "populate"), H = /* @__PURE__ */ b((e, t, r) => {
46
+ if (e.start === void 0)
47
+ throw new Error("start should have been set during first phase");
48
+ if (e.end === void 0)
49
+ throw new Error("end should have been set during first phase");
50
+ if (e.start > e.end)
51
+ throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
52
+ if (e.end + 1 <= t * r)
53
+ return [e, void 0];
54
+ const s = t * r - 1, n = t * r;
55
+ return [
56
+ {
57
+ start: e.start,
58
+ end: s,
59
+ label: e.label,
60
+ bits: s - e.start
61
+ },
62
+ {
63
+ start: n,
64
+ end: e.end,
65
+ label: e.label,
66
+ bits: e.end - n
67
+ }
68
+ ];
69
+ }, "getNextFittingBlock"), x = {
70
+ // @ts-expect-error - PacketDB is not assignable to DiagramDB
71
+ parser: { yy: void 0 },
72
+ parse: /* @__PURE__ */ b(async (e) => {
73
+ const t = await N("packet", e), r = x.parser?.yy;
74
+ if (!(r instanceof v))
75
+ throw new Error(
76
+ "parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
77
+ );
78
+ w.debug(t), Y(t, r);
79
+ }, "parse")
80
+ }, I = /* @__PURE__ */ b((e, t, r, s) => {
81
+ const n = s.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = B(t);
82
+ f.attr("viewbox", `0 0 ${k} ${g}`), C(f, g, k, l.useMaxWidth);
83
+ for (const [y, $] of p.entries())
84
+ O(f, $, y, l);
85
+ f.append("text").text(o).attr("x", k / 2).attr("y", g - h / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
86
+ }, "draw"), O = /* @__PURE__ */ b((e, t, r, { rowHeight: s, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
87
+ const c = e.append("g"), p = r * (s + l) + l;
88
+ for (const o of t) {
89
+ const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
90
+ if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
91
+ continue;
92
+ const k = o.end === o.start, f = p - 2;
93
+ c.append("text").attr("x", h + (k ? g / 2 : 0)).attr("y", f).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(o.start), k || c.append("text").attr("x", h + g).attr("y", f).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(o.end);
94
+ }
95
+ }, "drawWord"), j = { draw: I }, q = {
96
+ byteFontSize: "10px",
97
+ startByteColor: "black",
98
+ endByteColor: "black",
99
+ labelColor: "black",
100
+ labelFontSize: "12px",
101
+ titleColor: "black",
102
+ titleFontSize: "14px",
103
+ blockStrokeColor: "black",
104
+ blockStrokeWidth: "1",
105
+ blockFillColor: "#efefef"
106
+ }, G = /* @__PURE__ */ b(({ packet: e } = {}) => {
107
+ const t = m(q, e);
108
+ return `
109
+ .packetByte {
110
+ font-size: ${t.byteFontSize};
111
+ }
112
+ .packetByte.start {
113
+ fill: ${t.startByteColor};
114
+ }
115
+ .packetByte.end {
116
+ fill: ${t.endByteColor};
117
+ }
118
+ .packetLabel {
119
+ fill: ${t.labelColor};
120
+ font-size: ${t.labelFontSize};
121
+ }
122
+ .packetTitle {
123
+ fill: ${t.titleColor};
124
+ font-size: ${t.titleFontSize};
125
+ }
126
+ .packetBlock {
127
+ stroke: ${t.blockStrokeColor};
128
+ stroke-width: ${t.blockStrokeWidth};
129
+ fill: ${t.blockFillColor};
130
+ }
131
+ `;
132
+ }, "styles"), X = {
133
+ parser: x,
134
+ get db() {
135
+ return new v();
136
+ },
137
+ renderer: j,
138
+ styles: G
139
+ };
140
+ export {
141
+ X as diagram
142
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs");exports.MdRenderer=e._sfc_main;exports.default=e._sfc_main;
@@ -0,0 +1,5 @@
1
+ import { _ as e } from "../MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js";
2
+ export {
3
+ e as MdRenderer,
4
+ e as default
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={name:"alert",priority:50,test:e=>!!(e.type==="tag"&&e.name==="div"&&e.attribs?.class?.includes("alert")),render:(e,a,i)=>{const t=e.attribs?.["data-type"]||"info",r={info:"#0ea5e9",warning:"#f59e0b",error:"#ef4444",success:"#10b981"},s=r[t]||r.info;return i("div",{class:`custom-alert alert-${t}`,style:{padding:"12px 16px",borderLeft:`4px solid ${s}`,backgroundColor:`${s}15`,margin:"8px 0",borderRadius:"4px",fontFamily:"system-ui, -apple-system, sans-serif"}},a())}};exports.AlertPlugin=o;
@@ -0,0 +1,27 @@
1
+ const i = {
2
+ name: "alert",
3
+ priority: 50,
4
+ test: (r) => !!(r.type === "tag" && r.name === "div" && r.attribs?.class?.includes("alert")),
5
+ render: (r, a, o) => {
6
+ const t = r.attribs?.["data-type"] || "info", e = {
7
+ info: "#0ea5e9",
8
+ warning: "#f59e0b",
9
+ error: "#ef4444",
10
+ success: "#10b981"
11
+ }, s = e[t] || e.info;
12
+ return o("div", {
13
+ class: `custom-alert alert-${t}`,
14
+ style: {
15
+ padding: "12px 16px",
16
+ borderLeft: `4px solid ${s}`,
17
+ backgroundColor: `${s}15`,
18
+ margin: "8px 0",
19
+ borderRadius: "4px",
20
+ fontFamily: "system-ui, -apple-system, sans-serif"
21
+ }
22
+ }, a());
23
+ }
24
+ };
25
+ export {
26
+ i as AlertPlugin
27
+ };