lowcoder-comps 0.0.21 → 0.0.22

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 (58) hide show
  1. package/029c585a.js +825 -0
  2. package/0f49842f.js +915 -0
  3. package/14c95def.js +2396 -0
  4. package/{8219433d.js → 14de54b2.js} +7120 -6939
  5. package/17b0984b.js +1116 -0
  6. package/{31b1cdd2.js → 1a4b39ab.js} +29 -30
  7. package/1e35aee7.js +932 -0
  8. package/{54511d22.js → 1f97d569.js} +73 -76
  9. package/3120eee5.js +1235 -0
  10. package/313e94fb.js +796 -0
  11. package/{b38c288b.js → 41a4677f.js} +10 -12
  12. package/{2768fdea.js → 48a69d01.js} +89 -97
  13. package/4a8006fe.js +2501 -0
  14. package/{a6e7fb9e.js → 585231df.js} +64 -71
  15. package/5e96f5d8.js +64 -0
  16. package/5f9be850.js +1055 -0
  17. package/{f576ac90.js → 6e0c66a6.js} +97 -109
  18. package/76d315c1.js +2192 -0
  19. package/{7c62ef63.js → 867cdd47.js} +1 -1
  20. package/{3bd738e9.js → 8a65542f.js} +58 -64
  21. package/913e1a65.js +804 -0
  22. package/92e85b65.js +65 -0
  23. package/97298a99.js +2966 -0
  24. package/{450c6bd6.js → a396e61e.js} +44 -44
  25. package/a6d42292.js +1284 -0
  26. package/afd2e4d5.js +86 -0
  27. package/be5f3226.js +768 -0
  28. package/{9f3281b9.js → bf75928a.js} +30053 -30574
  29. package/{ba44e76c.js → bfd01456.js} +4257 -4221
  30. package/c239ec69.js +1000 -0
  31. package/e731f493.js +502 -0
  32. package/ef3524ce.js +960 -0
  33. package/f5b4a4bc.js +365 -0
  34. package/{fb09e069.js → fa29410e.js} +598 -622
  35. package/fbc7bdd4.js +218 -0
  36. package/index.js +2 -2
  37. package/package.json +2 -2
  38. package/04ea1009.js +0 -985
  39. package/0a1968f4.js +0 -832
  40. package/3087113d.js +0 -1032
  41. package/39f71758.js +0 -849
  42. package/4d1cf087.js +0 -2679
  43. package/59cbb8ee.js +0 -2456
  44. package/62c916e0.js +0 -86
  45. package/74645131.js +0 -1246
  46. package/75095038.js +0 -159
  47. package/86a4a706.js +0 -1118
  48. package/88c87bf8.js +0 -943
  49. package/8d8e98a7.js +0 -365
  50. package/9200edf7.js +0 -70
  51. package/acdad8f2.js +0 -7
  52. package/cbee3d44.js +0 -607
  53. package/cc0f1351.js +0 -793
  54. package/e614be0d.js +0 -91
  55. package/f40ee59a.js +0 -940
  56. package/fc5c5300.js +0 -2103
  57. package/fe636892.js +0 -823
  58. package/fea654db.js +0 -2827
package/fbc7bdd4.js ADDED
@@ -0,0 +1,218 @@
1
+ import { p as G, d as S, s as A } from "./5f9be850.js";
2
+ import { c as v, l as y, h as B, i as W, F as $, z as M, G as I } from "./bf75928a.js";
3
+ import { G as O, l as P } from "./14c95def.js";
4
+ import { l as X } from "./867cdd47.js";
5
+ import "./2ff2c7a6.js";
6
+ import "./256b619e.js";
7
+ let H = 0;
8
+ const Y = function(i, a, t, o, p) {
9
+ const g = function(e) {
10
+ switch (e) {
11
+ case p.db.relationType.AGGREGATION:
12
+ return "aggregation";
13
+ case p.db.relationType.EXTENSION:
14
+ return "extension";
15
+ case p.db.relationType.COMPOSITION:
16
+ return "composition";
17
+ case p.db.relationType.DEPENDENCY:
18
+ return "dependency";
19
+ case p.db.relationType.LOLLIPOP:
20
+ return "lollipop";
21
+ }
22
+ };
23
+ a.points = a.points.filter((e) => !Number.isNaN(e.y));
24
+ const s = a.points, c = X().x(function(e) {
25
+ return e.x;
26
+ }).y(function(e) {
27
+ return e.y;
28
+ }).curve($), n = i.append("path").attr("d", c(s)).attr("id", "edge" + H).attr("class", "relation");
29
+ let r = "";
30
+ o.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr(
31
+ "marker-start",
32
+ "url(" + r + "#" + g(t.relation.type1) + "Start)"
33
+ ), t.relation.type2 !== "none" && n.attr(
34
+ "marker-end",
35
+ "url(" + r + "#" + g(t.relation.type2) + "End)"
36
+ );
37
+ let f, h;
38
+ const x = a.points.length;
39
+ let b = M.calcLabelPosition(a.points);
40
+ f = b.x, h = b.y;
41
+ let u, m, w, k;
42
+ if (x % 2 !== 0 && x > 1) {
43
+ let e = M.calcCardinalityPosition(
44
+ t.relation.type1 !== "none",
45
+ a.points,
46
+ a.points[0]
47
+ ), d = M.calcCardinalityPosition(
48
+ t.relation.type2 !== "none",
49
+ a.points,
50
+ a.points[x - 1]
51
+ );
52
+ y.debug("cardinality_1_point " + JSON.stringify(e)), y.debug("cardinality_2_point " + JSON.stringify(d)), u = e.x, m = e.y, w = d.x, k = d.y;
53
+ }
54
+ if (t.title !== void 0) {
55
+ const e = i.append("g").attr("class", "classLabel"), d = e.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
56
+ window.label = d;
57
+ const l = d.node().getBBox();
58
+ e.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
59
+ }
60
+ y.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", u).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", k).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), H++;
61
+ }, J = function(i, a, t, o) {
62
+ y.debug("Rendering class ", a, t);
63
+ const p = a.id, g = {
64
+ id: p,
65
+ label: a.id,
66
+ width: 0,
67
+ height: 0
68
+ }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
69
+ let c;
70
+ a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
71
+ let n = !0;
72
+ a.annotations.forEach(function(d) {
73
+ const l = c.append("tspan").text("«" + d + "»");
74
+ n || l.attr("dy", t.textHeight), n = !1;
75
+ });
76
+ let r = C(a);
77
+ const f = c.append("tspan").text(r).attr("class", "title");
78
+ n || f.attr("dy", t.textHeight);
79
+ const h = c.node().getBBox().height;
80
+ let x, b, u;
81
+ if (a.members.length > 0) {
82
+ x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
83
+ const d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
84
+ n = !0, a.members.forEach(function(l) {
85
+ _(d, l, n, t), n = !1;
86
+ }), b = d.node().getBBox();
87
+ }
88
+ if (a.methods.length > 0) {
89
+ u = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + b.height).attr("y2", t.padding + h + t.dividerMargin + b.height);
90
+ const d = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + b.height + t.textHeight).attr("fill", "white").attr("class", "classText");
91
+ n = !0, a.methods.forEach(function(l) {
92
+ _(d, l, n, t), n = !1;
93
+ });
94
+ }
95
+ const m = s.node().getBBox();
96
+ var w = " ";
97
+ a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
98
+ const e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
99
+ return c.node().childNodes.forEach(function(d) {
100
+ d.setAttribute("x", (e - d.getBBox().width) / 2);
101
+ }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), u && u.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
102
+ }, C = function(i) {
103
+ let a = i.id;
104
+ return i.type && (a += "<" + I(i.type) + ">"), a;
105
+ }, Z = function(i, a, t, o) {
106
+ y.debug("Rendering note ", a, t);
107
+ const p = a.id, g = {
108
+ id: p,
109
+ text: a.text,
110
+ width: 0,
111
+ height: 0
112
+ }, s = i.append("g").attr("id", p).attr("class", "classGroup");
113
+ let c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
114
+ const n = JSON.parse(`"${a.text}"`).split(`
115
+ `);
116
+ n.forEach(function(x) {
117
+ y.debug(`Adding line: ${x}`), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
118
+ });
119
+ const r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr(
120
+ "height",
121
+ r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
122
+ ).node().getBBox().width;
123
+ return c.node().childNodes.forEach(function(x) {
124
+ x.setAttribute("x", (h - x.getBBox().width) / 2);
125
+ }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
126
+ }, _ = function(i, a, t, o) {
127
+ const { displayText: p, cssStyle: g } = a.getDisplayDetails(), s = i.append("tspan").attr("x", o.padding).text(p);
128
+ g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
129
+ }, N = {
130
+ getClassTitleString: C,
131
+ drawClass: J,
132
+ drawEdge: Y,
133
+ drawNote: Z
134
+ };
135
+ let T = {};
136
+ const E = 20, L = function(i) {
137
+ const a = Object.entries(T).find((t) => t[1].label === i);
138
+ if (a)
139
+ return a[0];
140
+ }, R = function(i) {
141
+ i.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), i.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.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 18,7 L9,13 L14,7 L9,1 Z");
142
+ }, F = function(i, a, t, o) {
143
+ const p = v().class;
144
+ T = {}, y.info("Rendering diagram " + i);
145
+ const g = v().securityLevel;
146
+ let s;
147
+ g === "sandbox" && (s = B("#i" + a));
148
+ const c = g === "sandbox" ? B(s.nodes()[0].contentDocument.body) : B("body"), n = c.select(`[id='${a}']`);
149
+ R(n);
150
+ const r = new O({
151
+ multigraph: !0
152
+ });
153
+ r.setGraph({
154
+ isMultiGraph: !0
155
+ }), r.setDefaultEdgeLabel(function() {
156
+ return {};
157
+ });
158
+ const f = o.db.getClasses(), h = Object.keys(f);
159
+ for (const e of h) {
160
+ const d = f[e], l = N.drawClass(n, d, p, o);
161
+ T[l.id] = l, r.setNode(l.id, l), y.info("Org height: " + l.height);
162
+ }
163
+ o.db.getRelations().forEach(function(e) {
164
+ y.info(
165
+ "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)
166
+ ), r.setEdge(
167
+ L(e.id1),
168
+ L(e.id2),
169
+ {
170
+ relation: e
171
+ },
172
+ e.title || "DEFAULT"
173
+ );
174
+ }), o.db.getNotes().forEach(function(e) {
175
+ y.debug(`Adding note: ${JSON.stringify(e)}`);
176
+ const d = N.drawNote(n, e, p, o);
177
+ T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(
178
+ e.id,
179
+ L(e.class),
180
+ {
181
+ relation: {
182
+ id1: e.id,
183
+ id2: e.class,
184
+ relation: {
185
+ type1: "none",
186
+ type2: "none",
187
+ lineType: 10
188
+ }
189
+ }
190
+ },
191
+ "DEFAULT"
192
+ );
193
+ }), P(r), r.nodes().forEach(function(e) {
194
+ e !== void 0 && r.node(e) !== void 0 && (y.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr(
195
+ "transform",
196
+ "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
197
+ ));
198
+ }), r.edges().forEach(function(e) {
199
+ e !== void 0 && r.edge(e) !== void 0 && (y.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
200
+ });
201
+ const u = n.node().getBBox(), m = u.width + E * 2, w = u.height + E * 2;
202
+ W(n, w, m, p.useMaxWidth);
203
+ const k = `${u.x - E} ${u.y - E} ${m} ${w}`;
204
+ y.debug(`viewBox ${k}`), n.attr("viewBox", k);
205
+ }, z = {
206
+ draw: F
207
+ }, j = {
208
+ parser: G,
209
+ db: S,
210
+ renderer: z,
211
+ styles: A,
212
+ init: (i) => {
213
+ i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, S.clear();
214
+ }
215
+ };
216
+ export {
217
+ j as diagram
218
+ };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="lowcoder-comps-0.0.21",e.appendChild(document.createTextNode("")),document.head.appendChild(e)}}catch(c){console.error("vite-plugin-css-injected-by-js",c)}})();
2
- import { aO as f } from "./9f3281b9.js";
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="lowcoder-comps-0.0.22",e.appendChild(document.createTextNode("")),document.head.appendChild(e)}}catch(c){console.error("vite-plugin-css-injected-by-js",c)}})();
2
+ import { b6 as f } from "./bf75928a.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lowcoder-comps",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -62,7 +62,7 @@
62
62
  "entry": "index.js"
63
63
  },
64
64
  "scripts": {
65
- "start": "vite",
65
+ "start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
66
66
  "build": "yarn test && lowcoder-cli build",
67
67
  "build_only": "lowcoder-cli build",
68
68
  "build_publish": "lowcoder-cli build --publish",