lowcoder-comps 0.0.18 → 0.0.19

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 (78) hide show
  1. package/README.md +27 -0
  2. package/index.html +26 -0
  3. package/index.tsx +19 -0
  4. package/jest.config.js +6 -0
  5. package/package.json +3 -4
  6. package/src/__test__/allComp.test.tsx +61 -0
  7. package/src/app-env.d.ts +3 -0
  8. package/src/comps/calendarComp/calendarComp.tsx +443 -0
  9. package/src/comps/calendarComp/calendarConstants.tsx +898 -0
  10. package/src/comps/chartComp/chartComp.tsx +356 -0
  11. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  12. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  13. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +9 -0
  14. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  15. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  16. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  17. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  18. package/src/comps/chartComp/chartConstants.tsx +288 -0
  19. package/src/comps/chartComp/chartPropertyView.tsx +218 -0
  20. package/src/comps/chartComp/chartUtils.ts +291 -0
  21. package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
  22. package/src/comps/chartComp/reactEcharts/index.ts +21 -0
  23. package/src/comps/chartComp/reactEcharts/types.ts +76 -0
  24. package/src/comps/chartComp/seriesComp.tsx +119 -0
  25. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  26. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  27. package/src/comps/imageEditorComp/index.tsx +184 -0
  28. package/src/comps/mermaidComp/index.tsx +44 -0
  29. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  30. package/src/global.ts +1 -0
  31. package/src/i18n/comps/index.tsx +29 -0
  32. package/src/i18n/comps/locales/en.ts +150 -0
  33. package/src/i18n/comps/locales/enObj.tsx +198 -0
  34. package/src/i18n/comps/locales/index.ts +7 -0
  35. package/src/i18n/comps/locales/types.tsx +10 -0
  36. package/src/i18n/comps/locales/zh.ts +145 -0
  37. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  38. package/src/index.ts +11 -0
  39. package/tsconfig.json +22 -0
  40. package/vite.config.js +10 -0
  41. package/0d763a87.js +0 -798
  42. package/1813144f.js +0 -940
  43. package/2039ece8.js +0 -91
  44. package/256b619e.js +0 -92
  45. package/2ff2c7a6.js +0 -6
  46. package/372dc2a7.js +0 -365
  47. package/3b12eb0e.js +0 -2103
  48. package/3c0b160f.js +0 -236
  49. package/401f73a2.js +0 -1602
  50. package/4137766d.js +0 -86
  51. package/4728777d.js +0 -447
  52. package/4881ced8.js +0 -943
  53. package/50cdd04e.js +0 -823
  54. package/5a46ac81.js +0 -1118
  55. package/6737b605.js +0 -985
  56. package/6a3117df.js +0 -159
  57. package/6add348f.js +0 -2456
  58. package/7aa956be.js +0 -326
  59. package/80fe4e54.js +0 -24
  60. package/847d7b9d.js +0 -7
  61. package/8c3bb161.js +0 -18619
  62. package/8edfc14c.js +0 -1246
  63. package/a96f93b1.js +0 -1032
  64. package/b680d6c7.js +0 -70
  65. package/babb4d5d.js +0 -832
  66. package/bfa09fb0.js +0 -607
  67. package/c1008714.js +0 -275
  68. package/ca536ab8.js +0 -117238
  69. package/cb157d73.js +0 -849
  70. package/ce50b2ed.js +0 -2679
  71. package/d4fa84c2.js +0 -212
  72. package/d7fee54a.js +0 -451
  73. package/e1a22e9d.js +0 -34
  74. package/e1cbc8ec.js +0 -46688
  75. package/f9637058.js +0 -16
  76. package/fbeabd79.js +0 -793
  77. package/fc3693cc.js +0 -2827
  78. package/index.js +0 -5
package/d4fa84c2.js DELETED
@@ -1,212 +0,0 @@
1
- var B = (e, n, t) => new Promise((c, i) => {
2
- var r = (l) => {
3
- try {
4
- a(t.next(l));
5
- } catch (s) {
6
- i(s);
7
- }
8
- }, o = (l) => {
9
- try {
10
- a(t.throw(l));
11
- } catch (s) {
12
- i(s);
13
- }
14
- }, a = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(r, o);
15
- a((t = t.apply(e, n)).next());
16
- });
17
- import { p as X, d as M, s as Z, D as U, a as j, S as F, b as I, c as tt } from "./6737b605.js";
18
- import { G as et } from "./ce50b2ed.js";
19
- import { l as d, c as g, h as x, x as ot, i as st, j as w } from "./ca536ab8.js";
20
- import { r as nt } from "./372dc2a7.js";
21
- import "./cb157d73.js";
22
- import "./fc3693cc.js";
23
- import "./6a3117df.js";
24
- import "./e1a22e9d.js";
25
- import "./2ff2c7a6.js";
26
- import "./256b619e.js";
27
- const A = "rect", C = "rectWithTitle", ct = "start", it = "end", rt = "divider", lt = "roundedWithTitle", at = "note", dt = "noteGroup", u = "statediagram", Et = "state", St = `${u}-${Et}`, V = "transition", Tt = "note", pt = "note-edge", _t = `${V} ${pt}`, ut = `${u}-${Tt}`, Dt = "cluster", ft = `${u}-${Dt}`, bt = "cluster-alt", ht = `${u}-${bt}`, Y = "parent", W = "note", At = "state", N = "----", yt = `${N}${W}`, H = `${N}${Y}`, z = "fill:none", m = "fill: #333", q = "c", K = "text", J = "normal";
28
- let y = {}, T = 0;
29
- const gt = function(e) {
30
- const n = Object.keys(e);
31
- for (const t of n)
32
- e[t];
33
- }, $t = function(e, n) {
34
- d.trace("Extracting classes"), n.db.clear();
35
- try {
36
- return n.parser.parse(e), n.db.extract(n.db.getRootDocV2()), n.db.getClasses();
37
- } catch (t) {
38
- return t;
39
- }
40
- };
41
- function xt(e) {
42
- return e == null ? "" : e.classes ? e.classes.join(" ") : "";
43
- }
44
- function R(e = "", n = 0, t = "", c = N) {
45
- const i = t !== null && t.length > 0 ? `${c}${t}` : "";
46
- return `${At}-${e}${i}-${n}`;
47
- }
48
- const h = (e, n, t, c, i, r) => {
49
- const o = t.id, a = xt(c[o]);
50
- if (o !== "root") {
51
- let l = A;
52
- t.start === !0 && (l = ct), t.start === !1 && (l = it), t.type !== U && (l = t.type), y[o] || (y[o] = {
53
- id: o,
54
- shape: l,
55
- description: w.sanitizeText(o, g()),
56
- classes: `${a} ${St}`
57
- });
58
- const s = y[o];
59
- t.description && (Array.isArray(s.description) ? (s.shape = C, s.description.push(t.description)) : s.description.length > 0 ? (s.shape = C, s.description === o ? s.description = [t.description] : s.description = [s.description, t.description]) : (s.shape = A, s.description = t.description), s.description = w.sanitizeTextOrArray(s.description, g())), s.description.length === 1 && s.shape === C && (s.shape = A), !s.type && t.doc && (d.info("Setting cluster for ", o, G(t)), s.type = "group", s.dir = G(t), s.shape = t.type === j ? rt : lt, s.classes = s.classes + " " + ft + " " + (r ? ht : ""));
60
- const _ = {
61
- labelStyle: "",
62
- shape: s.shape,
63
- labelText: s.description,
64
- // typeof newNode.description === 'object'
65
- // ? newNode.description[0]
66
- // : newNode.description,
67
- classes: s.classes,
68
- style: "",
69
- //styles.style,
70
- id: o,
71
- dir: s.dir,
72
- domId: R(o, T),
73
- type: s.type,
74
- padding: 15
75
- //getConfig().flowchart.padding
76
- };
77
- if (_.centerLabel = !0, t.note) {
78
- const E = {
79
- labelStyle: "",
80
- shape: at,
81
- labelText: t.note.text,
82
- classes: ut,
83
- // useHtmlLabels: false,
84
- style: "",
85
- // styles.style,
86
- id: o + yt + "-" + T,
87
- domId: R(o, T, W),
88
- type: s.type,
89
- padding: 15
90
- //getConfig().flowchart.padding
91
- }, S = {
92
- labelStyle: "",
93
- shape: dt,
94
- labelText: t.note.text,
95
- classes: s.classes,
96
- style: "",
97
- // styles.style,
98
- id: o + H,
99
- domId: R(o, T, Y),
100
- type: "group",
101
- padding: 0
102
- //getConfig().flowchart.padding
103
- };
104
- T++;
105
- const D = o + H;
106
- e.setNode(D, S), e.setNode(E.id, E), e.setNode(o, _), e.setParent(o, D), e.setParent(E.id, D);
107
- let p = o, f = E.id;
108
- t.note.position === "left of" && (p = E.id, f = o), e.setEdge(p, f, {
109
- arrowhead: "none",
110
- arrowType: "",
111
- style: z,
112
- labelStyle: "",
113
- classes: _t,
114
- arrowheadStyle: m,
115
- labelpos: q,
116
- labelType: K,
117
- thickness: J
118
- });
119
- } else
120
- e.setNode(o, _);
121
- }
122
- n && n.id !== "root" && (d.trace("Setting node ", o, " to be child of its parent ", n.id), e.setParent(o, n.id)), t.doc && (d.trace("Adding nodes children "), Ct(e, t, t.doc, c, i, !r));
123
- }, Ct = (e, n, t, c, i, r) => {
124
- d.trace("items", t), t.forEach((o) => {
125
- switch (o.stmt) {
126
- case I:
127
- h(e, n, o, c, i, r);
128
- break;
129
- case U:
130
- h(e, n, o, c, i, r);
131
- break;
132
- case F:
133
- {
134
- h(e, n, o.state1, c, i, r), h(e, n, o.state2, c, i, r);
135
- const a = {
136
- id: "edge" + T,
137
- arrowhead: "normal",
138
- arrowTypeEnd: "arrow_barb",
139
- style: z,
140
- labelStyle: "",
141
- label: w.sanitizeText(o.description, g()),
142
- arrowheadStyle: m,
143
- labelpos: q,
144
- labelType: K,
145
- thickness: J,
146
- classes: V
147
- };
148
- e.setEdge(o.state1.id, o.state2.id, a, T), T++;
149
- }
150
- break;
151
- }
152
- });
153
- }, G = (e, n = tt) => {
154
- let t = n;
155
- if (e.doc)
156
- for (let c = 0; c < e.doc.length; c++) {
157
- const i = e.doc[c];
158
- i.stmt === "dir" && (t = i.value);
159
- }
160
- return t;
161
- }, Rt = function(e, n, t, c) {
162
- return B(this, null, function* () {
163
- d.info("Drawing state diagram (v2)", n), y = {}, c.db.getDirection();
164
- const { securityLevel: i, state: r } = g(), o = r.nodeSpacing || 50, a = r.rankSpacing || 50;
165
- d.info(c.db.getRootDocV2()), c.db.extract(c.db.getRootDocV2()), d.info(c.db.getRootDocV2());
166
- const l = c.db.getStates(), s = new et({
167
- multigraph: !0,
168
- compound: !0
169
- }).setGraph({
170
- rankdir: G(c.db.getRootDocV2()),
171
- nodesep: o,
172
- ranksep: a,
173
- marginx: 8,
174
- marginy: 8
175
- }).setDefaultEdgeLabel(function() {
176
- return {};
177
- });
178
- h(s, void 0, c.db.getRootDocV2(), l, c.db, !0);
179
- let _;
180
- i === "sandbox" && (_ = x("#i" + n));
181
- const E = i === "sandbox" ? x(_.nodes()[0].contentDocument.body) : x("body"), S = E.select(`[id="${n}"]`), D = E.select("#" + n + " g");
182
- yield nt(D, s, ["barb"], u, n);
183
- const p = 8;
184
- ot.insertTitle(S, "statediagramTitleText", r.titleTopMargin, c.db.getDiagramTitle());
185
- const f = S.node().getBBox(), L = f.width + p * 2, P = f.height + p * 2;
186
- S.attr("class", u);
187
- const k = S.node().getBBox();
188
- st(S, P, L, r.useMaxWidth);
189
- const v = `${k.x - p} ${k.y - p} ${L} ${P}`;
190
- d.debug(`viewBox ${v}`), S.attr("viewBox", v);
191
- const Q = document.querySelectorAll('[id="' + n + '"] .edgeLabel .label');
192
- for (const $ of Q) {
193
- const O = $.getBBox(), b = document.createElementNS("http://www.w3.org/2000/svg", A);
194
- b.setAttribute("rx", 0), b.setAttribute("ry", 0), b.setAttribute("width", O.width), b.setAttribute("height", O.height), $.insertBefore(b, $.firstChild);
195
- }
196
- });
197
- }, wt = {
198
- setConf: gt,
199
- getClasses: $t,
200
- draw: Rt
201
- }, Vt = {
202
- parser: X,
203
- db: M,
204
- renderer: wt,
205
- styles: Z,
206
- init: (e) => {
207
- e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute, M.clear();
208
- }
209
- };
210
- export {
211
- Vt as diagram
212
- };
package/d7fee54a.js DELETED
@@ -1,451 +0,0 @@
1
- var I = (e, l, s) => new Promise((a, i) => {
2
- var p = (c) => {
3
- try {
4
- o(s.next(c));
5
- } catch (r) {
6
- i(r);
7
- }
8
- }, f = (c) => {
9
- try {
10
- o(s.throw(c));
11
- } catch (r) {
12
- i(r);
13
- }
14
- }, o = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(p, f);
15
- o((s = s.apply(e, l)).next());
16
- });
17
- import { i as q, G as M } from "./ce50b2ed.js";
18
- import { _ as R, C as F, v as U, p as N, l as w, q as H, c as C, j as G, r as $, o as E, h as _, x as W, t as X, y as J } from "./ca536ab8.js";
19
- import { f as K } from "./5a46ac81.js";
20
- import { r as Q } from "./372dc2a7.js";
21
- import { s as Y } from "./847d7b9d.js";
22
- const Z = (e, l) => R.lang.round(F.parse(e)[l]), j = Z;
23
- function ue(e, l) {
24
- return !!e.children(l).length;
25
- }
26
- function we(e) {
27
- return L(e.v) + ":" + L(e.w) + ":" + L(e.name);
28
- }
29
- var O = /:/g;
30
- function L(e) {
31
- return e ? String(e).replace(O, "\\:") : "";
32
- }
33
- function ee(e, l) {
34
- l && e.attr("style", l);
35
- }
36
- function he(e, l, s) {
37
- l && e.attr("class", l).attr("class", s + " " + e.attr("class"));
38
- }
39
- function ye(e, l) {
40
- var s = l.graph();
41
- if (q(s)) {
42
- var a = s.transition;
43
- if (U(a))
44
- return a(e);
45
- }
46
- return e;
47
- }
48
- function te(e, l) {
49
- var s = e.append("foreignObject").attr("width", "100000"), a = s.append("xhtml:div");
50
- a.attr("xmlns", "http://www.w3.org/1999/xhtml");
51
- var i = l.label;
52
- switch (typeof i) {
53
- case "function":
54
- a.insert(i);
55
- break;
56
- case "object":
57
- a.insert(function() {
58
- return i;
59
- });
60
- break;
61
- default:
62
- a.html(i);
63
- }
64
- ee(a, l.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap");
65
- var p = a.node().getBoundingClientRect();
66
- return s.attr("width", p.width).attr("height", p.height), s;
67
- }
68
- const z = {}, re = function(e) {
69
- const l = Object.keys(e);
70
- for (const s of l)
71
- z[s] = e[s];
72
- }, P = function(e, l, s, a, i, p) {
73
- const f = a.select(`[id="${s}"]`);
74
- Object.keys(e).forEach(function(c) {
75
- const r = e[c];
76
- let g = "default";
77
- r.classes.length > 0 && (g = r.classes.join(" ")), g = g + " flowchart-label";
78
- const h = N(r.styles);
79
- let t = r.text !== void 0 ? r.text : r.id, d;
80
- if (w.info("vertex", r, r.labelType), r.labelType === "markdown")
81
- w.info("vertex", r, r.labelType);
82
- else if (H(C().flowchart.htmlLabels)) {
83
- const m = {
84
- label: t.replace(
85
- /fa[blrs]?:fa-[\w-]+/g,
86
- (k) => `<i class='${k.replace(":", " ")}'></i>`
87
- )
88
- };
89
- d = te(f, m).node(), d.parentNode.removeChild(d);
90
- } else {
91
- const m = i.createElementNS("http://www.w3.org/2000/svg", "text");
92
- m.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
93
- const k = t.split(G.lineBreakRegex);
94
- for (const T of k) {
95
- const v = i.createElementNS("http://www.w3.org/2000/svg", "tspan");
96
- v.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), v.setAttribute("dy", "1em"), v.setAttribute("x", "1"), v.textContent = T, m.appendChild(v);
97
- }
98
- d = m;
99
- }
100
- let b = 0, n = "";
101
- switch (r.type) {
102
- case "round":
103
- b = 5, n = "rect";
104
- break;
105
- case "square":
106
- n = "rect";
107
- break;
108
- case "diamond":
109
- n = "question";
110
- break;
111
- case "hexagon":
112
- n = "hexagon";
113
- break;
114
- case "odd":
115
- n = "rect_left_inv_arrow";
116
- break;
117
- case "lean_right":
118
- n = "lean_right";
119
- break;
120
- case "lean_left":
121
- n = "lean_left";
122
- break;
123
- case "trapezoid":
124
- n = "trapezoid";
125
- break;
126
- case "inv_trapezoid":
127
- n = "inv_trapezoid";
128
- break;
129
- case "odd_right":
130
- n = "rect_left_inv_arrow";
131
- break;
132
- case "circle":
133
- n = "circle";
134
- break;
135
- case "ellipse":
136
- n = "ellipse";
137
- break;
138
- case "stadium":
139
- n = "stadium";
140
- break;
141
- case "subroutine":
142
- n = "subroutine";
143
- break;
144
- case "cylinder":
145
- n = "cylinder";
146
- break;
147
- case "group":
148
- n = "rect";
149
- break;
150
- case "doublecircle":
151
- n = "doublecircle";
152
- break;
153
- default:
154
- n = "rect";
155
- }
156
- l.setNode(r.id, {
157
- labelStyle: h.labelStyle,
158
- shape: n,
159
- labelText: t,
160
- labelType: r.labelType,
161
- rx: b,
162
- ry: b,
163
- class: g,
164
- style: h.style,
165
- id: r.id,
166
- link: r.link,
167
- linkTarget: r.linkTarget,
168
- tooltip: p.db.getTooltip(r.id) || "",
169
- domId: p.db.lookUpDomId(r.id),
170
- haveCallback: r.haveCallback,
171
- width: r.type === "group" ? 500 : void 0,
172
- dir: r.dir,
173
- type: r.type,
174
- props: r.props,
175
- padding: C().flowchart.padding
176
- }), w.info("setNode", {
177
- labelStyle: h.labelStyle,
178
- labelType: r.labelType,
179
- shape: n,
180
- labelText: t,
181
- rx: b,
182
- ry: b,
183
- class: g,
184
- style: h.style,
185
- id: r.id,
186
- domId: p.db.lookUpDomId(r.id),
187
- width: r.type === "group" ? 500 : void 0,
188
- type: r.type,
189
- dir: r.dir,
190
- props: r.props,
191
- padding: C().flowchart.padding
192
- });
193
- });
194
- }, V = function(e, l, s) {
195
- w.info("abc78 edges = ", e);
196
- let a = 0, i = {}, p, f;
197
- if (e.defaultStyle !== void 0) {
198
- const o = N(e.defaultStyle);
199
- p = o.style, f = o.labelStyle;
200
- }
201
- e.forEach(function(o) {
202
- a++;
203
- const c = "L-" + o.start + "-" + o.end;
204
- i[c] === void 0 ? (i[c] = 0, w.info("abc78 new entry", c, i[c])) : (i[c]++, w.info("abc78 new entry", c, i[c]));
205
- let r = c + "-" + i[c];
206
- w.info("abc78 new link id to be used is", c, r, i[c]);
207
- const g = "LS-" + o.start, h = "LE-" + o.end, t = { style: "", labelStyle: "" };
208
- switch (t.minlen = o.length || 1, o.type === "arrow_open" ? t.arrowhead = "none" : t.arrowhead = "normal", t.arrowTypeStart = "arrow_open", t.arrowTypeEnd = "arrow_open", o.type) {
209
- case "double_arrow_cross":
210
- t.arrowTypeStart = "arrow_cross";
211
- case "arrow_cross":
212
- t.arrowTypeEnd = "arrow_cross";
213
- break;
214
- case "double_arrow_point":
215
- t.arrowTypeStart = "arrow_point";
216
- case "arrow_point":
217
- t.arrowTypeEnd = "arrow_point";
218
- break;
219
- case "double_arrow_circle":
220
- t.arrowTypeStart = "arrow_circle";
221
- case "arrow_circle":
222
- t.arrowTypeEnd = "arrow_circle";
223
- break;
224
- }
225
- let d = "", b = "";
226
- switch (o.stroke) {
227
- case "normal":
228
- d = "fill:none;", p !== void 0 && (d = p), f !== void 0 && (b = f), t.thickness = "normal", t.pattern = "solid";
229
- break;
230
- case "dotted":
231
- t.thickness = "normal", t.pattern = "dotted", t.style = "fill:none;stroke-width:2px;stroke-dasharray:3;";
232
- break;
233
- case "thick":
234
- t.thickness = "thick", t.pattern = "solid", t.style = "stroke-width: 3.5px;fill:none;";
235
- break;
236
- case "invisible":
237
- t.thickness = "invisible", t.pattern = "solid", t.style = "stroke-width: 0;fill:none;";
238
- break;
239
- }
240
- if (o.style !== void 0) {
241
- const n = N(o.style);
242
- d = n.style, b = n.labelStyle;
243
- }
244
- t.style = t.style += d, t.labelStyle = t.labelStyle += b, o.interpolate !== void 0 ? t.curve = $(o.interpolate, E) : e.defaultInterpolate !== void 0 ? t.curve = $(e.defaultInterpolate, E) : t.curve = $(z.curve, E), o.text === void 0 ? o.style !== void 0 && (t.arrowheadStyle = "fill: #333") : (t.arrowheadStyle = "fill: #333", t.labelpos = "c"), t.labelType = o.labelType, t.label = o.text.replace(G.lineBreakRegex, `
245
- `), o.style === void 0 && (t.style = t.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), t.labelStyle = t.labelStyle.replace("color:", "fill:"), t.id = r, t.classes = "flowchart-link " + g + " " + h, l.setEdge(o.start, o.end, t, a);
246
- });
247
- }, le = function(e, l) {
248
- w.info("Extracting classes"), l.db.clear();
249
- try {
250
- return l.parse(e), l.db.getClasses();
251
- } catch (s) {
252
- return;
253
- }
254
- }, ae = function(e, l, s, a) {
255
- return I(this, null, function* () {
256
- w.info("Drawing flowchart"), a.db.clear(), K.setGen("gen-2"), a.parser.parse(e);
257
- let i = a.db.getDirection();
258
- i === void 0 && (i = "TD");
259
- const { securityLevel: p, flowchart: f } = C(), o = f.nodeSpacing || 50, c = f.rankSpacing || 50;
260
- let r;
261
- p === "sandbox" && (r = _("#i" + l));
262
- const g = p === "sandbox" ? _(r.nodes()[0].contentDocument.body) : _("body"), h = p === "sandbox" ? r.nodes()[0].contentDocument : document, t = new M({
263
- multigraph: !0,
264
- compound: !0
265
- }).setGraph({
266
- rankdir: i,
267
- nodesep: o,
268
- ranksep: c,
269
- marginx: 0,
270
- marginy: 0
271
- }).setDefaultEdgeLabel(function() {
272
- return {};
273
- });
274
- let d;
275
- const b = a.db.getSubGraphs();
276
- w.info("Subgraphs - ", b);
277
- for (let u = b.length - 1; u >= 0; u--)
278
- d = b[u], w.info("Subgraph - ", d), a.db.addVertex(
279
- d.id,
280
- { text: d.title, type: d.labelType },
281
- "group",
282
- void 0,
283
- d.classes,
284
- d.dir
285
- );
286
- const n = a.db.getVertices(), m = a.db.getEdges();
287
- w.info("Edges", m);
288
- let k = 0;
289
- for (k = b.length - 1; k >= 0; k--) {
290
- d = b[k], Y("cluster").append("text");
291
- for (let u = 0; u < d.nodes.length; u++)
292
- w.info("Setting up subgraphs", d.nodes[u], d.id), t.setParent(d.nodes[u], d.id);
293
- }
294
- P(n, t, l, g, h, a), V(m, t);
295
- const T = g.select(`[id="${l}"]`), v = g.select("#" + l + " g");
296
- if (yield Q(v, t, ["point", "circle", "cross"], "flowchart", l), W.insertTitle(T, "flowchartTitleText", f.titleTopMargin, a.db.getDiagramTitle()), X(t, T, f.diagramPadding, f.useMaxWidth), a.db.indexNodes("subGraph" + k), !f.htmlLabels) {
297
- const u = h.querySelectorAll('[id="' + l + '"] .edgeLabel .label');
298
- for (const x of u) {
299
- const S = x.getBBox(), y = h.createElementNS("http://www.w3.org/2000/svg", "rect");
300
- y.setAttribute("rx", 0), y.setAttribute("ry", 0), y.setAttribute("width", S.width), y.setAttribute("height", S.height), x.insertBefore(y, x.firstChild);
301
- }
302
- }
303
- Object.keys(n).forEach(function(u) {
304
- const x = n[u];
305
- if (x.link) {
306
- const S = _("#" + l + ' [id="' + u + '"]');
307
- if (S) {
308
- const y = h.createElementNS("http://www.w3.org/2000/svg", "a");
309
- y.setAttributeNS("http://www.w3.org/2000/svg", "class", x.classes.join(" ")), y.setAttributeNS("http://www.w3.org/2000/svg", "href", x.link), y.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), p === "sandbox" ? y.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : x.linkTarget && y.setAttributeNS("http://www.w3.org/2000/svg", "target", x.linkTarget);
310
- const A = S.insert(function() {
311
- return y;
312
- }, ":first-child"), B = S.select(".label-container");
313
- B && A.append(function() {
314
- return B.node();
315
- });
316
- const D = S.select(".label");
317
- D && A.append(function() {
318
- return D.node();
319
- });
320
- }
321
- }
322
- });
323
- });
324
- }, ge = {
325
- setConf: re,
326
- addVertices: P,
327
- addEdges: V,
328
- getClasses: le,
329
- draw: ae
330
- }, oe = (e, l) => {
331
- const s = j, a = s(e, "r"), i = s(e, "g"), p = s(e, "b");
332
- return J(a, i, p, l);
333
- }, ne = (e) => `.label {
334
- font-family: ${e.fontFamily};
335
- color: ${e.nodeTextColor || e.textColor};
336
- }
337
- .cluster-label text {
338
- fill: ${e.titleColor};
339
- }
340
- .cluster-label span,p {
341
- color: ${e.titleColor};
342
- }
343
-
344
- .label text,span,p {
345
- fill: ${e.nodeTextColor || e.textColor};
346
- color: ${e.nodeTextColor || e.textColor};
347
- }
348
-
349
- .node rect,
350
- .node circle,
351
- .node ellipse,
352
- .node polygon,
353
- .node path {
354
- fill: ${e.mainBkg};
355
- stroke: ${e.nodeBorder};
356
- stroke-width: 1px;
357
- }
358
- .flowchart-label text {
359
- text-anchor: middle;
360
- }
361
- // .flowchart-label .text-outer-tspan {
362
- // text-anchor: middle;
363
- // }
364
- // .flowchart-label .text-inner-tspan {
365
- // text-anchor: start;
366
- // }
367
-
368
- .node .label {
369
- text-align: center;
370
- }
371
- .node.clickable {
372
- cursor: pointer;
373
- }
374
-
375
- .arrowheadPath {
376
- fill: ${e.arrowheadColor};
377
- }
378
-
379
- .edgePath .path {
380
- stroke: ${e.lineColor};
381
- stroke-width: 2.0px;
382
- }
383
-
384
- .flowchart-link {
385
- stroke: ${e.lineColor};
386
- fill: none;
387
- }
388
-
389
- .edgeLabel {
390
- background-color: ${e.edgeLabelBackground};
391
- rect {
392
- opacity: 0.5;
393
- background-color: ${e.edgeLabelBackground};
394
- fill: ${e.edgeLabelBackground};
395
- }
396
- text-align: center;
397
- }
398
-
399
- /* For html labels only */
400
- .labelBkg {
401
- background-color: ${oe(e.edgeLabelBackground, 0.5)};
402
- // background-color:
403
- }
404
-
405
- .cluster rect {
406
- fill: ${e.clusterBkg};
407
- stroke: ${e.clusterBorder};
408
- stroke-width: 1px;
409
- }
410
-
411
- .cluster text {
412
- fill: ${e.titleColor};
413
- }
414
-
415
- .cluster span,p {
416
- color: ${e.titleColor};
417
- }
418
- /* .cluster div {
419
- color: ${e.titleColor};
420
- } */
421
-
422
- div.mermaidTooltip {
423
- position: absolute;
424
- text-align: center;
425
- max-width: 200px;
426
- padding: 2px;
427
- font-family: ${e.fontFamily};
428
- font-size: 12px;
429
- background: ${e.tertiaryColor};
430
- border: 1px solid ${e.border2};
431
- border-radius: 2px;
432
- pointer-events: none;
433
- z-index: 100;
434
- }
435
-
436
- .flowchartTitleText {
437
- text-anchor: middle;
438
- font-size: 18px;
439
- fill: ${e.textColor};
440
- }
441
- `, ke = ne;
442
- export {
443
- ee as a,
444
- te as b,
445
- ye as c,
446
- he as d,
447
- we as e,
448
- ge as f,
449
- ke as g,
450
- ue as i
451
- };
package/e1a22e9d.js DELETED
@@ -1,34 +0,0 @@
1
- import { a as h } from "./2ff2c7a6.js";
2
- import { w as d, c as o } from "./256b619e.js";
3
- import { o as v } from "./ca536ab8.js";
4
- function w(t) {
5
- return t[0];
6
- }
7
- function b(t) {
8
- return t[1];
9
- }
10
- function P(t, u) {
11
- var s = o(!0), i = null, l = v, r = null, m = d(e);
12
- t = typeof t == "function" ? t : t === void 0 ? w : o(t), u = typeof u == "function" ? u : u === void 0 ? b : o(u);
13
- function e(n) {
14
- var f, g = (n = h(n)).length, p, c = !1, a;
15
- for (i == null && (r = l(a = m())), f = 0; f <= g; ++f)
16
- !(f < g && s(p = n[f], f, n)) === c && ((c = !c) ? r.lineStart() : r.lineEnd()), c && r.point(+t(p, f, n), +u(p, f, n));
17
- if (a)
18
- return r = null, a + "" || null;
19
- }
20
- return e.x = function(n) {
21
- return arguments.length ? (t = typeof n == "function" ? n : o(+n), e) : t;
22
- }, e.y = function(n) {
23
- return arguments.length ? (u = typeof n == "function" ? n : o(+n), e) : u;
24
- }, e.defined = function(n) {
25
- return arguments.length ? (s = typeof n == "function" ? n : o(!!n), e) : s;
26
- }, e.curve = function(n) {
27
- return arguments.length ? (l = n, i != null && (r = l(i)), e) : l;
28
- }, e.context = function(n) {
29
- return arguments.length ? (n == null ? i = r = null : r = l(i = n), e) : i;
30
- }, e;
31
- }
32
- export {
33
- P as l
34
- };