@elmethis/core 1.0.0-alpha.135 → 1.0.0-alpha.136

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 (66) hide show
  1. package/dist/{Bash-5KqPZETT.js → Bash-BGUPOZp7.js} +1 -1
  2. package/dist/{Css-Br7IeFYI.js → Css-BCZOJ9TO.js} +1 -1
  3. package/dist/{Rust-TE1r2SD6.js → Rust-BwvKtYCc.js} +1 -1
  4. package/dist/_basePickBy-BjVOtBbf.js +152 -0
  5. package/dist/_baseUniq-DBXEmOed.js +583 -0
  6. package/dist/arc-CpOtc53l.js +83 -0
  7. package/dist/architecture-I3QFYML2-B3piHlUx.js +5 -0
  8. package/dist/architectureDiagram-UYN6MBPD-CIvqBNYd.js +4595 -0
  9. package/dist/blockDiagram-ZHA2E4KO-BJHIBwi6.js +2247 -0
  10. package/dist/c4Diagram-6F5ED5ID-DxXqw6e0.js +1581 -0
  11. package/dist/channel-BgZSmjvA.js +5 -0
  12. package/dist/chunk-5HRBRIJM-CvhBPtHu.js +24 -0
  13. package/dist/chunk-7U56Z5CX-CaWvnXle.js +1215 -0
  14. package/dist/chunk-ASOPGD6M-CQjrO8hd.js +64 -0
  15. package/dist/chunk-KFBOBJHC-DWru5GNu.js +15 -0
  16. package/dist/chunk-T2TOU4HS-DqpYO7rW.js +1303 -0
  17. package/dist/chunk-TMUBEWPD-LmMMNIqt.js +9 -0
  18. package/dist/classDiagram-LNE6IOMH-D5GoOZTJ.js +14 -0
  19. package/dist/classDiagram-v2-MQ7JQ4JX-D5GoOZTJ.js +14 -0
  20. package/dist/clone-DMQ2a__4.js +8 -0
  21. package/dist/{cobol-DZ3yq6J9.js → cobol-DMssKNmC.js} +1 -1
  22. package/dist/components/code/ElmMermaid.stories.d.ts +7 -0
  23. package/dist/components/code/ElmMermaid.vue.d.ts +8 -0
  24. package/dist/cytoscape.esm-CsRvAgYT.js +17639 -0
  25. package/dist/dagre-4EVJKHTY-C7YsHY3S.js +447 -0
  26. package/dist/diagram-QW4FP2JN-iDbrW_yI.js +126 -0
  27. package/dist/elmethis.js +36 -35
  28. package/dist/elmethis.umd.cjs +2272 -41
  29. package/dist/erDiagram-6RL3IURR-LYq0WEw3.js +937 -0
  30. package/dist/flowDiagram-7ASYPVHJ-DRPtjs2_.js +1484 -0
  31. package/dist/ganttDiagram-NTVNEXSI-C-hO_7Lp.js +2494 -0
  32. package/dist/gitGraph-YCYPL57B-BaVhg8eu.js +5 -0
  33. package/dist/gitGraphDiagram-NRZ2UAAF-u52k9qsq.js +712 -0
  34. package/dist/graph-CKV5wesZ.js +247 -0
  35. package/dist/{index-0D7NEPxZ.js → index-DQdUr-_f.js} +3548 -3436
  36. package/dist/index.d.ts +3 -2
  37. package/dist/info-46DW6VJ7-D5JUpHK_.js +5 -0
  38. package/dist/infoDiagram-A4XQUW5V-D5IcjWQu.js +22 -0
  39. package/dist/init-DjUOC4st.js +16 -0
  40. package/dist/journeyDiagram-G5WM74LC-XHcEaxXL.js +810 -0
  41. package/dist/kanban-definition-QRCXZQQD-BFgu8zXi.js +718 -0
  42. package/dist/layout-Cycesmdu.js +1324 -0
  43. package/dist/linear-CjRkwbhR.js +423 -0
  44. package/dist/mermaid-parser.core-CL_REaxY.js +12479 -0
  45. package/dist/mermaid.core-gtllNrzr.js +14852 -0
  46. package/dist/mindmap-definition-GWI6TPTV-yPOhYeCo.js +3220 -0
  47. package/dist/ordinal-DfAQgscy.js +61 -0
  48. package/dist/packet-W2GHVCYJ-D1drjM5q.js +5 -0
  49. package/dist/pie-BEWT4RHE-B2xFs62T.js +5 -0
  50. package/dist/pieDiagram-YF2LJOPJ-Cnvx0DvF.js +162 -0
  51. package/dist/quadrantDiagram-OS5C2QUG-DBWy6UVd.js +1024 -0
  52. package/dist/{razor-Dl6rcHmj.js → razor-CeqqNtyB.js} +1 -1
  53. package/dist/requirementDiagram-MIRIMTAZ-CfHcsBsO.js +768 -0
  54. package/dist/sankeyDiagram-Y46BX6SQ-C_60tCtv.js +805 -0
  55. package/dist/sass-eCUyDs9S.js +6 -0
  56. package/dist/scala-Cly-fENF.js +6 -0
  57. package/dist/sequenceDiagram-G6AWOVSC-XvgYpHvJ.js +2274 -0
  58. package/dist/stateDiagram-MAYHULR4-Bx48BKG3.js +268 -0
  59. package/dist/stateDiagram-v2-4JROLMXI-pDuBzVSZ.js +14 -0
  60. package/dist/swift-BAWqNR8A.js +6 -0
  61. package/dist/timeline-definition-U7ZMHBDA-EGhtku4S.js +804 -0
  62. package/dist/xychartDiagram-6QU3TZC5-B_OmutYz.js +1304 -0
  63. package/package.json +11 -10
  64. package/dist/sass-iCyS6eP9.js +0 -6
  65. package/dist/scala-BQHTnvwx.js +0 -6
  66. package/dist/swift-OL4r9IGP.js +0 -6
@@ -0,0 +1,61 @@
1
+ import { i as a } from "./init-DjUOC4st.js";
2
+ class o extends Map {
3
+ constructor(n, t = g) {
4
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
5
+ }
6
+ get(n) {
7
+ return super.get(c(this, n));
8
+ }
9
+ has(n) {
10
+ return super.has(c(this, n));
11
+ }
12
+ set(n, t) {
13
+ return super.set(l(this, n), t);
14
+ }
15
+ delete(n) {
16
+ return super.delete(p(this, n));
17
+ }
18
+ }
19
+ function c({ _intern: e, _key: n }, t) {
20
+ const r = n(t);
21
+ return e.has(r) ? e.get(r) : t;
22
+ }
23
+ function l({ _intern: e, _key: n }, t) {
24
+ const r = n(t);
25
+ return e.has(r) ? e.get(r) : (e.set(r, t), t);
26
+ }
27
+ function p({ _intern: e, _key: n }, t) {
28
+ const r = n(t);
29
+ return e.has(r) && (t = e.get(r), e.delete(r)), t;
30
+ }
31
+ function g(e) {
32
+ return e !== null && typeof e == "object" ? e.valueOf() : e;
33
+ }
34
+ const f = Symbol("implicit");
35
+ function h() {
36
+ var e = new o(), n = [], t = [], r = f;
37
+ function s(u) {
38
+ let i = e.get(u);
39
+ if (i === void 0) {
40
+ if (r !== f) return r;
41
+ e.set(u, i = n.push(u) - 1);
42
+ }
43
+ return t[i % t.length];
44
+ }
45
+ return s.domain = function(u) {
46
+ if (!arguments.length) return n.slice();
47
+ n = [], e = new o();
48
+ for (const i of u)
49
+ e.has(i) || e.set(i, n.push(i) - 1);
50
+ return s;
51
+ }, s.range = function(u) {
52
+ return arguments.length ? (t = Array.from(u), s) : t.slice();
53
+ }, s.unknown = function(u) {
54
+ return arguments.length ? (r = u, s) : r;
55
+ }, s.copy = function() {
56
+ return h(n, t).unknown(r);
57
+ }, a.apply(s, arguments), s;
58
+ }
59
+ export {
60
+ h as o
61
+ };
@@ -0,0 +1,5 @@
1
+ import { P as c, a as r } from "./mermaid-parser.core-CL_REaxY.js";
2
+ export {
3
+ c as PacketModule,
4
+ r as createPacketServices
5
+ };
@@ -0,0 +1,5 @@
1
+ import { b as a, d as i } from "./mermaid-parser.core-CL_REaxY.js";
2
+ export {
3
+ a as PieModule,
4
+ i as createPieServices
5
+ };
@@ -0,0 +1,162 @@
1
+ import { p as U } from "./chunk-TMUBEWPD-LmMMNIqt.js";
2
+ import { X as x, O as z, aF as j, D as q, q as X, r as Z, s as H, g as J, c as K, b as Q, _ as u, l as F, x as Y, d as tt, E as et, I as at, a5 as rt, k as nt } from "./mermaid.core-gtllNrzr.js";
3
+ import { p as it } from "./mermaid-parser.core-CL_REaxY.js";
4
+ import { d as N } from "./arc-CpOtc53l.js";
5
+ import { o as st } from "./ordinal-DfAQgscy.js";
6
+ function ot(t, a) {
7
+ return a < t ? -1 : a > t ? 1 : a >= t ? 0 : NaN;
8
+ }
9
+ function lt(t) {
10
+ return t;
11
+ }
12
+ function ct() {
13
+ var t = lt, a = ot, h = null, o = x(0), p = x(z), y = x(0);
14
+ function i(e) {
15
+ var r, l = (e = j(e)).length, g, A, m = 0, c = new Array(l), n = new Array(l), v = +o.apply(this, arguments), w = Math.min(z, Math.max(-z, p.apply(this, arguments) - v)), f, T = Math.min(Math.abs(w) / l, y.apply(this, arguments)), $ = T * (w < 0 ? -1 : 1), d;
16
+ for (r = 0; r < l; ++r)
17
+ (d = n[c[r] = r] = +t(e[r], r, e)) > 0 && (m += d);
18
+ for (a != null ? c.sort(function(S, D) {
19
+ return a(n[S], n[D]);
20
+ }) : h != null && c.sort(function(S, D) {
21
+ return h(e[S], e[D]);
22
+ }), r = 0, A = m ? (w - l * $) / m : 0; r < l; ++r, v = f)
23
+ g = c[r], d = n[g], f = v + (d > 0 ? d * A : 0) + $, n[g] = {
24
+ data: e[g],
25
+ index: r,
26
+ value: d,
27
+ startAngle: v,
28
+ endAngle: f,
29
+ padAngle: T
30
+ };
31
+ return n;
32
+ }
33
+ return i.value = function(e) {
34
+ return arguments.length ? (t = typeof e == "function" ? e : x(+e), i) : t;
35
+ }, i.sortValues = function(e) {
36
+ return arguments.length ? (a = e, h = null, i) : a;
37
+ }, i.sort = function(e) {
38
+ return arguments.length ? (h = e, a = null, i) : h;
39
+ }, i.startAngle = function(e) {
40
+ return arguments.length ? (o = typeof e == "function" ? e : x(+e), i) : o;
41
+ }, i.endAngle = function(e) {
42
+ return arguments.length ? (p = typeof e == "function" ? e : x(+e), i) : p;
43
+ }, i.padAngle = function(e) {
44
+ return arguments.length ? (y = typeof e == "function" ? e : x(+e), i) : y;
45
+ }, i;
46
+ }
47
+ var P = q.pie, G = {
48
+ sections: /* @__PURE__ */ new Map(),
49
+ showData: !1,
50
+ config: P
51
+ }, b = G.sections, O = G.showData, ut = structuredClone(P), pt = /* @__PURE__ */ u(() => structuredClone(ut), "getConfig"), gt = /* @__PURE__ */ u(() => {
52
+ b = /* @__PURE__ */ new Map(), O = G.showData, Y();
53
+ }, "clear"), dt = /* @__PURE__ */ u(({ label: t, value: a }) => {
54
+ b.has(t) || (b.set(t, a), F.debug(`added new section: ${t}, with value: ${a}`));
55
+ }, "addSection"), ft = /* @__PURE__ */ u(() => b, "getSections"), ht = /* @__PURE__ */ u((t) => {
56
+ O = t;
57
+ }, "setShowData"), mt = /* @__PURE__ */ u(() => O, "getShowData"), R = {
58
+ getConfig: pt,
59
+ clear: gt,
60
+ setDiagramTitle: X,
61
+ getDiagramTitle: Z,
62
+ setAccTitle: H,
63
+ getAccTitle: J,
64
+ setAccDescription: K,
65
+ getAccDescription: Q,
66
+ addSection: dt,
67
+ getSections: ft,
68
+ setShowData: ht,
69
+ getShowData: mt
70
+ }, vt = /* @__PURE__ */ u((t, a) => {
71
+ U(t, a), a.setShowData(t.showData), t.sections.map(a.addSection);
72
+ }, "populateDb"), St = {
73
+ parse: /* @__PURE__ */ u(async (t) => {
74
+ const a = await it("pie", t);
75
+ F.debug(a), vt(a, R);
76
+ }, "parse")
77
+ }, xt = /* @__PURE__ */ u((t) => `
78
+ .pieCircle{
79
+ stroke: ${t.pieStrokeColor};
80
+ stroke-width : ${t.pieStrokeWidth};
81
+ opacity : ${t.pieOpacity};
82
+ }
83
+ .pieOuterCircle{
84
+ stroke: ${t.pieOuterStrokeColor};
85
+ stroke-width: ${t.pieOuterStrokeWidth};
86
+ fill: none;
87
+ }
88
+ .pieTitleText {
89
+ text-anchor: middle;
90
+ font-size: ${t.pieTitleTextSize};
91
+ fill: ${t.pieTitleTextColor};
92
+ font-family: ${t.fontFamily};
93
+ }
94
+ .slice {
95
+ font-family: ${t.fontFamily};
96
+ fill: ${t.pieSectionTextColor};
97
+ font-size:${t.pieSectionTextSize};
98
+ // fill: white;
99
+ }
100
+ .legend text {
101
+ fill: ${t.pieLegendTextColor};
102
+ font-family: ${t.fontFamily};
103
+ font-size: ${t.pieLegendTextSize};
104
+ }
105
+ `, "getStyles"), yt = xt, At = /* @__PURE__ */ u((t) => {
106
+ const a = [...t.entries()].map((o) => ({
107
+ label: o[0],
108
+ value: o[1]
109
+ })).sort((o, p) => p.value - o.value);
110
+ return ct().value(
111
+ (o) => o.value
112
+ )(a);
113
+ }, "createPieArcs"), wt = /* @__PURE__ */ u((t, a, h, o) => {
114
+ F.debug(`rendering pie chart
115
+ ` + t);
116
+ const p = o.db, y = tt(), i = et(p.getConfig(), y.pie), e = 40, r = 18, l = 4, g = 450, A = g, m = at(a), c = m.append("g");
117
+ c.attr("transform", "translate(" + A / 2 + "," + g / 2 + ")");
118
+ const { themeVariables: n } = y;
119
+ let [v] = rt(n.pieOuterStrokeWidth);
120
+ v ?? (v = 2);
121
+ const w = i.textPosition, f = Math.min(A, g) / 2 - e, T = N().innerRadius(0).outerRadius(f), $ = N().innerRadius(f * w).outerRadius(f * w);
122
+ c.append("circle").attr("cx", 0).attr("cy", 0).attr("r", f + v / 2).attr("class", "pieOuterCircle");
123
+ const d = p.getSections(), S = At(d), D = [
124
+ n.pie1,
125
+ n.pie2,
126
+ n.pie3,
127
+ n.pie4,
128
+ n.pie5,
129
+ n.pie6,
130
+ n.pie7,
131
+ n.pie8,
132
+ n.pie9,
133
+ n.pie10,
134
+ n.pie11,
135
+ n.pie12
136
+ ], C = st(D);
137
+ c.selectAll("mySlices").data(S).enter().append("path").attr("d", T).attr("fill", (s) => C(s.data.label)).attr("class", "pieCircle");
138
+ let W = 0;
139
+ d.forEach((s) => {
140
+ W += s;
141
+ }), c.selectAll("mySlices").data(S).enter().append("text").text((s) => (s.data.value / W * 100).toFixed(0) + "%").attr("transform", (s) => "translate(" + $.centroid(s) + ")").style("text-anchor", "middle").attr("class", "slice"), c.append("text").text(p.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
142
+ const M = c.selectAll(".legend").data(C.domain()).enter().append("g").attr("class", "legend").attr("transform", (s, k) => {
143
+ const E = r + l, _ = E * C.domain().length / 2, B = 12 * r, V = k * E - _;
144
+ return "translate(" + B + "," + V + ")";
145
+ });
146
+ M.append("rect").attr("width", r).attr("height", r).style("fill", C).style("stroke", C), M.data(S).append("text").attr("x", r + l).attr("y", r - l).text((s) => {
147
+ const { label: k, value: E } = s.data;
148
+ return p.getShowData() ? `${k} [${E}]` : k;
149
+ });
150
+ const L = Math.max(
151
+ ...M.selectAll("text").nodes().map((s) => (s == null ? void 0 : s.getBoundingClientRect().width) ?? 0)
152
+ ), I = A + e + r + l + L;
153
+ m.attr("viewBox", `0 0 ${I} ${g}`), nt(m, g, I, i.useMaxWidth);
154
+ }, "draw"), Dt = { draw: wt }, bt = {
155
+ parser: St,
156
+ db: R,
157
+ renderer: Dt,
158
+ styles: yt
159
+ };
160
+ export {
161
+ bt as diagram
162
+ };