@metadev/daga-react 4.2.10 → 4.2.11
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.
- package/Changelog.md +7 -0
- package/index.js +2 -2
- package/index.mjs +1111 -1076
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as v, jsxs as M, Fragment as ro } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "d3";
|
|
3
|
-
import { debounceTime as ao, Subject as
|
|
3
|
+
import { debounceTime as ao, Subject as jt, merge as lo, map as co } from "rxjs";
|
|
4
4
|
import { createContext as Oe, useState as U, useContext as Ut, useRef as rt, useEffect as Ct, useMemo as ho } from "react";
|
|
5
|
-
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}),
|
|
6
|
-
const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Ie = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0],
|
|
7
|
-
const
|
|
8
|
-
switch (
|
|
5
|
+
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Zt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Zt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), qt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(qt || {});
|
|
6
|
+
const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Ie = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Jt = (s, t, e, a, l, r, i) => {
|
|
7
|
+
const n = (() => {
|
|
8
|
+
switch (r) {
|
|
9
9
|
case "start":
|
|
10
10
|
return a[0] + (s[0] - t[0]);
|
|
11
11
|
case "end":
|
|
@@ -33,7 +33,7 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
33
33
|
return Ie(s[1], e, l);
|
|
34
34
|
}
|
|
35
35
|
})();
|
|
36
|
-
return [
|
|
36
|
+
return [n, o];
|
|
37
37
|
}, He = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, go = (s, t) => (ut(
|
|
38
38
|
s[0][0],
|
|
39
39
|
t[0][0],
|
|
@@ -84,33 +84,33 @@ const fo = 20, uo = (s, t, e, a, l) => {
|
|
|
84
84
|
return `M ${t[0][0]} ${t[0][1]}`;
|
|
85
85
|
{
|
|
86
86
|
l = l || fo;
|
|
87
|
-
let
|
|
87
|
+
let r = "", i, n;
|
|
88
88
|
switch (s) {
|
|
89
89
|
case "straight":
|
|
90
|
-
|
|
90
|
+
r += `M ${t[0][0]} ${t[0][1]}`;
|
|
91
91
|
for (let o = 1; o < t.length; ++o)
|
|
92
|
-
|
|
92
|
+
r += ` L ${t[o][0]} ${t[o][1]}`;
|
|
93
93
|
break;
|
|
94
94
|
case "bezier":
|
|
95
|
-
i = e,
|
|
95
|
+
i = e, r += `M ${t[0][0]} ${t[0][1]}`;
|
|
96
96
|
for (let o = 1; o < t.length; ++o) {
|
|
97
97
|
if (o + 1 >= t.length)
|
|
98
98
|
switch (a) {
|
|
99
99
|
case g.Bottom:
|
|
100
|
-
|
|
100
|
+
n = g.Top;
|
|
101
101
|
break;
|
|
102
102
|
case g.Top:
|
|
103
|
-
|
|
103
|
+
n = g.Bottom;
|
|
104
104
|
break;
|
|
105
105
|
case g.Right:
|
|
106
|
-
|
|
106
|
+
n = g.Left;
|
|
107
107
|
break;
|
|
108
108
|
case g.Left:
|
|
109
|
-
|
|
109
|
+
n = g.Right;
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
else
|
|
113
|
-
Math.abs(t[o][0] - t[o - 1][0]) < Math.abs(t[o][1] - t[o - 1][1]) ? t[o][1] > t[o - 1][1] ?
|
|
113
|
+
Math.abs(t[o][0] - t[o - 1][0]) < Math.abs(t[o][1] - t[o - 1][1]) ? t[o][1] > t[o - 1][1] ? n = g.Bottom : n = g.Top : t[o][0] > t[o - 1][0] ? n = g.Right : n = g.Left;
|
|
114
114
|
if (i !== void 0) {
|
|
115
115
|
let d = "", c = "";
|
|
116
116
|
const h = (Math.abs(t[o][0] - t[o - 1][0]) + Math.abs(t[o][1] - t[o - 1][1])) / 2;
|
|
@@ -128,8 +128,8 @@ const fo = 20, uo = (s, t, e, a, l) => {
|
|
|
128
128
|
d = `${t[o - 1][0] - h} ${t[o - 1][1]}`;
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
132
|
-
switch (
|
|
131
|
+
if (n !== void 0) {
|
|
132
|
+
switch (n) {
|
|
133
133
|
case g.Top:
|
|
134
134
|
c = `${t[o][0]} ${t[o][1] + h}`;
|
|
135
135
|
break;
|
|
@@ -143,13 +143,13 @@ const fo = 20, uo = (s, t, e, a, l) => {
|
|
|
143
143
|
c = `${t[o][0] - h} ${t[o][1]}`;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
r += ` C ${d} ${c} ${t[o][0]} ${t[o][1]}`;
|
|
147
147
|
} else
|
|
148
|
-
|
|
149
|
-
} else if (
|
|
148
|
+
r += ` Q ${d} ${t[o][0]} ${t[o][1]}`;
|
|
149
|
+
} else if (n !== void 0) {
|
|
150
150
|
let d = "";
|
|
151
151
|
const c = (Math.abs(t[o][0] - t[o - 1][0]) + Math.abs(t[o][1] - t[o - 1][1])) / 2;
|
|
152
|
-
switch (
|
|
152
|
+
switch (n) {
|
|
153
153
|
case g.Top:
|
|
154
154
|
d = `${t[o][0]} ${t[o][1] + c}`;
|
|
155
155
|
break;
|
|
@@ -163,114 +163,114 @@ const fo = 20, uo = (s, t, e, a, l) => {
|
|
|
163
163
|
d = `${t[o][0] - c} ${t[o][1]}`;
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
r += ` Q ${d} ${t[o][0]} ${t[o][1]}`;
|
|
167
167
|
} else
|
|
168
|
-
|
|
169
|
-
i =
|
|
168
|
+
r += ` L ${t[o][0]} ${t[o][1]}`;
|
|
169
|
+
i = n;
|
|
170
170
|
}
|
|
171
171
|
break;
|
|
172
172
|
case "square":
|
|
173
|
-
i = e,
|
|
173
|
+
i = e, r += `M ${t[0][0]} ${t[0][1]}`;
|
|
174
174
|
for (let o = 1; o < t.length; ++o) {
|
|
175
175
|
if (o + 1 >= t.length)
|
|
176
176
|
switch (a) {
|
|
177
177
|
case g.Bottom:
|
|
178
|
-
|
|
178
|
+
n = g.Top;
|
|
179
179
|
break;
|
|
180
180
|
case g.Top:
|
|
181
|
-
|
|
181
|
+
n = g.Bottom;
|
|
182
182
|
break;
|
|
183
183
|
case g.Right:
|
|
184
|
-
|
|
184
|
+
n = g.Left;
|
|
185
185
|
break;
|
|
186
186
|
case g.Left:
|
|
187
|
-
|
|
187
|
+
n = g.Right;
|
|
188
188
|
break;
|
|
189
189
|
}
|
|
190
190
|
switch (i) {
|
|
191
191
|
case g.Bottom:
|
|
192
|
-
switch (
|
|
192
|
+
switch (n) {
|
|
193
193
|
case g.Bottom:
|
|
194
|
-
t[o][1] > t[o - 1][1] ? (t[o][0] !== t[o - 1][0] ? (
|
|
194
|
+
t[o][1] > t[o - 1][1] ? (t[o][0] !== t[o - 1][0] ? (r += ` V ${(t[o][1] + t[o - 1][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : r += ` V ${t[o][1]}`, i = n) : t[o][0] > t[o - 1][0] ? (r += ` V ${t[o - 1][1] + l}`, r += ` H ${Math.max(t[o - 1][0], t[o][0]) + l}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` V ${t[o - 1][1] + l}`, r += ` H ${Math.min(t[o - 1][0], t[o][0]) - l}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
195
195
|
break;
|
|
196
196
|
case g.Top:
|
|
197
|
-
|
|
197
|
+
r += ` V ${Math.max(t[o - 1][1], t[o][1]) + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`;
|
|
198
198
|
break;
|
|
199
199
|
case g.Left:
|
|
200
|
-
t[o][1] > t[o - 1][1] + l ? t[o][0] < t[o - 1][0] - l ? (
|
|
200
|
+
t[o][1] > t[o - 1][1] + l ? t[o][0] < t[o - 1][0] - l ? (r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : t[o][0] < t[o - 1][0] - l ? (r += ` V ${t[o - 1][1] + l}`, r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${t[o - 1][1] + l}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
201
201
|
break;
|
|
202
202
|
case g.Right:
|
|
203
|
-
t[o][1] > t[o - 1][1] + l ? t[o][0] > t[o - 1][0] + l ? (
|
|
203
|
+
t[o][1] > t[o - 1][1] + l ? t[o][0] > t[o - 1][0] + l ? (r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : t[o][0] > t[o - 1][0] + l ? (r += ` V ${t[o - 1][1] + l}`, r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${t[o - 1][1] + l}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
204
204
|
break;
|
|
205
205
|
default:
|
|
206
|
-
t[o][1] < t[o - 1][1] + l ? (
|
|
206
|
+
t[o][1] < t[o - 1][1] + l ? (r += ` V ${t[o - 1][1] + l}`, t[o][0] !== t[o - 1][0] && (r += ` H ${t[o][0]}`), r += ` V ${t[o][1]}`, i = g.Top) : (r += ` V ${t[o][1]}`, i = g.Bottom, t[o][0] !== t[o - 1][0] && (r += ` H ${t[o][0]}`, i = t[o][0] > t[o - 1][0] ? g.Right : g.Left));
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
209
209
|
break;
|
|
210
210
|
case g.Top:
|
|
211
|
-
switch (
|
|
211
|
+
switch (n) {
|
|
212
212
|
case g.Top:
|
|
213
|
-
t[o][1] < t[o - 1][1] ? (t[o][0] !== t[o - 1][0] ? (
|
|
213
|
+
t[o][1] < t[o - 1][1] ? (t[o][0] !== t[o - 1][0] ? (r += ` V ${(t[o][1] + t[o - 1][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : r += ` V ${t[o][1]}`, i = n) : t[o][0] < t[o - 1][0] ? (r += ` V ${t[o - 1][1] - l}`, r += ` H ${Math.min(t[o - 1][0], t[o][0]) - l}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` V ${t[o - 1][1] - l}`, r += ` H ${Math.max(t[o - 1][0], t[o][0]) + l}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
214
214
|
break;
|
|
215
215
|
case g.Bottom:
|
|
216
|
-
|
|
216
|
+
r += ` V ${Math.min(t[o - 1][1], t[o][1]) - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`;
|
|
217
217
|
break;
|
|
218
218
|
case g.Right:
|
|
219
|
-
t[o][1] < t[o - 1][1] - l ? t[o][0] > t[o - 1][0] + l ? (
|
|
219
|
+
t[o][1] < t[o - 1][1] - l ? t[o][0] > t[o - 1][0] + l ? (r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : t[o][0] > t[o - 1][0] + l ? (r += ` V ${t[o - 1][1] - l}`, r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${t[o - 1][1] - l}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
220
220
|
break;
|
|
221
221
|
case g.Left:
|
|
222
|
-
t[o][1] < t[o - 1][1] - l ? t[o][0] < t[o - 1][0] - l ? (
|
|
222
|
+
t[o][1] < t[o - 1][1] - l ? t[o][0] < t[o - 1][0] - l ? (r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : t[o][0] < t[o - 1][0] - l ? (r += ` V ${t[o - 1][1] - l}`, r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` V ${t[o - 1][1] - l}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
223
223
|
break;
|
|
224
224
|
default:
|
|
225
|
-
t[o][1] > t[o - 1][1] - l ? (
|
|
225
|
+
t[o][1] > t[o - 1][1] - l ? (r += ` V ${t[o - 1][1] - l}`, t[o][0] !== t[o - 1][0] && (r += ` H ${t[o][0]}`), r += ` V ${t[o][1]}`, i = g.Bottom) : (r += ` V ${t[o][1]}`, i = g.Top, t[o][0] !== t[o - 1][0] && (r += ` H ${t[o][0]}`, i = t[o][0] > t[o - 1][0] ? g.Right : g.Left));
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
break;
|
|
229
229
|
case g.Left:
|
|
230
|
-
switch (
|
|
230
|
+
switch (n) {
|
|
231
231
|
case g.Left:
|
|
232
|
-
t[o][0] < t[o - 1][0] ? (t[o][1] !== t[o - 1][1] ? (
|
|
232
|
+
t[o][0] < t[o - 1][0] ? (t[o][1] !== t[o - 1][1] ? (r += ` H ${(t[o][0] + t[o - 1][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : r += ` H ${t[o][0]}`, i = n) : t[o][1] < t[o - 1][1] ? (r += ` H ${t[o - 1][0] - l}`, r += ` V ${Math.min(t[o - 1][1], t[o][1]) - l}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` H ${t[o - 1][0] - l}`, r += ` V ${Math.max(t[o - 1][1], t[o][1]) + l}`, r += ` H ${t[o][0] + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
233
233
|
break;
|
|
234
234
|
case g.Right:
|
|
235
|
-
|
|
235
|
+
r += ` H ${Math.min(t[o - 1][0], t[o][0]) - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`;
|
|
236
236
|
break;
|
|
237
237
|
case g.Bottom:
|
|
238
|
-
t[o][0] < t[o - 1][0] - l ? t[o][1] > t[o - 1][1] + l ? (
|
|
238
|
+
t[o][0] < t[o - 1][0] - l ? t[o][1] > t[o - 1][1] + l ? (r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : t[o][1] > t[o - 1][1] + l ? (r += ` H ${t[o - 1][0] - l}`, r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${t[o - 1][0] - l}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
239
239
|
break;
|
|
240
240
|
case g.Top:
|
|
241
|
-
t[o][0] < t[o - 1][0] - l ? t[o][1] < t[o - 1][1] - l ? (
|
|
241
|
+
t[o][0] < t[o - 1][0] - l ? t[o][1] < t[o - 1][1] - l ? (r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : t[o][1] < t[o - 1][1] - l ? (r += ` H ${t[o - 1][0] - l}`, r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${t[o - 1][0] - l}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
242
242
|
break;
|
|
243
243
|
default:
|
|
244
|
-
t[o][0] > t[o - 1][0] - l ? (
|
|
244
|
+
t[o][0] > t[o - 1][0] - l ? (r += ` H ${t[o - 1][0] - l}`, t[o][1] !== t[o - 1][1] && (r += ` V ${t[o][1]}`), r += ` H ${t[o][0]}`, i = g.Right) : (r += ` H ${t[o][0]}`, i = g.Left, t[o][1] !== t[o - 1][1] && (r += ` V ${t[o][1]}`, i = t[o][1] > t[o - 1][1] ? g.Bottom : g.Top));
|
|
245
245
|
break;
|
|
246
246
|
}
|
|
247
247
|
break;
|
|
248
248
|
case g.Right:
|
|
249
|
-
switch (
|
|
249
|
+
switch (n) {
|
|
250
250
|
case g.Right:
|
|
251
|
-
t[o][0] > t[o - 1][0] ? (t[o][1] !== t[o - 1][1] ? (
|
|
251
|
+
t[o][0] > t[o - 1][0] ? (t[o][1] !== t[o - 1][1] ? (r += ` H ${(t[o][0] + t[o - 1][0]) / 2}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : r += ` H ${t[o][0]}`, i = n) : t[o][1] > t[o - 1][1] ? (r += ` H ${t[o - 1][0] + l}`, r += ` V ${Math.max(t[o - 1][1], t[o][1]) + l}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`) : (r += ` H ${t[o - 1][0] + l}`, r += ` V ${Math.min(t[o - 1][1], t[o][1]) - l}`, r += ` H ${t[o][0] - l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`);
|
|
252
252
|
break;
|
|
253
253
|
case g.Left:
|
|
254
|
-
|
|
254
|
+
r += ` H ${Math.max(t[o - 1][0], t[o][0]) + l}`, r += ` V ${t[o][1]}`, r += ` H ${t[o][0]}`;
|
|
255
255
|
break;
|
|
256
256
|
case g.Top:
|
|
257
|
-
t[o][0] > t[o - 1][0] + l ? t[o][1] < t[o - 1][1] - l ? (
|
|
257
|
+
t[o][0] > t[o - 1][0] + l ? t[o][1] < t[o - 1][1] - l ? (r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : t[o][1] < t[o - 1][1] - l ? (r += ` H ${t[o - 1][0] + l}`, r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${t[o - 1][0] + l}`, r += ` V ${t[o][1] + l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
258
258
|
break;
|
|
259
259
|
case g.Bottom:
|
|
260
|
-
t[o][0] > t[o - 1][0] + l ? t[o][1] > t[o - 1][1] + l ? (
|
|
260
|
+
t[o][0] > t[o - 1][0] + l ? t[o][1] > t[o - 1][1] + l ? (r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${(t[o - 1][0] + t[o][0]) / 2}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : t[o][1] > t[o - 1][1] + l ? (r += ` H ${t[o - 1][0] + l}`, r += ` V ${(t[o - 1][1] + t[o][1]) / 2}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`) : (r += ` H ${t[o - 1][0] + l}`, r += ` V ${t[o][1] - l}`, r += ` H ${t[o][0]}`, r += ` V ${t[o][1]}`);
|
|
261
261
|
break;
|
|
262
262
|
default:
|
|
263
|
-
t[o][0] < t[o - 1][0] + l ? (
|
|
263
|
+
t[o][0] < t[o - 1][0] + l ? (r += ` H ${t[o - 1][0] + l}`, t[o][1] !== t[o - 1][1] && (r += ` V ${t[o][1]}`), r += ` H ${t[o][0]}`, i = g.Left) : (r += ` H ${t[o][0]}`, i = g.Right, t[o][1] !== t[o - 1][1] && (r += ` V ${t[o][1]}`, i = t[o][1] > t[o - 1][1] ? g.Bottom : g.Top));
|
|
264
264
|
break;
|
|
265
265
|
}
|
|
266
266
|
break;
|
|
267
267
|
default:
|
|
268
|
-
t[o][0] !== t[o - 1][0] && (
|
|
268
|
+
t[o][0] !== t[o - 1][0] && (r += ` H ${t[o][0]}`, i = t[o][0] > t[o - 1][0] ? g.Right : g.Left), t[o][1] !== t[o - 1][1] && (r += ` V ${t[o][1]}`, i = t[o][1] > t[o - 1][1] ? g.Bottom : g.Top);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
|
-
return
|
|
273
|
+
return r;
|
|
274
274
|
}
|
|
275
275
|
}, pe = (s, t) => {
|
|
276
276
|
switch (s) {
|
|
@@ -304,7 +304,7 @@ const me = (s, t, e, a, l) => {
|
|
|
304
304
|
case "octagon":
|
|
305
305
|
return yo(t, e, a, l);
|
|
306
306
|
case "pill":
|
|
307
|
-
return
|
|
307
|
+
return Kt(t, e, a, l);
|
|
308
308
|
case "rectangle":
|
|
309
309
|
return Ae(t, e, a, l);
|
|
310
310
|
case "rhombus":
|
|
@@ -316,7 +316,7 @@ const me = (s, t, e, a, l) => {
|
|
|
316
316
|
default:
|
|
317
317
|
return Ae(t, e, a, l);
|
|
318
318
|
}
|
|
319
|
-
}, Ge = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, po = () => "Z", mo = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, vo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, yo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`,
|
|
319
|
+
}, Ge = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, po = () => "Z", mo = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, vo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, yo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, Kt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ge(s, t, e, a), Ae = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, bo = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, ko = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, wo = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
|
|
320
320
|
var L = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(L || {});
|
|
321
321
|
const So = (s) => Math.max(...s.split(`
|
|
322
322
|
`).map((t) => t.length)), Co = (s) => s.match(/\n/g)?.length || 0, W = [];
|
|
@@ -336,15 +336,16 @@ function Ao() {
|
|
|
336
336
|
return re(Io);
|
|
337
337
|
}
|
|
338
338
|
const xo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: xo };
|
|
339
|
-
function
|
|
340
|
-
if (xe.randomUUID && !s)
|
|
341
|
-
return xe.randomUUID();
|
|
339
|
+
function Lo(s, t, e) {
|
|
342
340
|
s = s || {};
|
|
343
341
|
const a = s.random ?? s.rng?.() ?? Ao();
|
|
344
342
|
if (a.length < 16)
|
|
345
343
|
throw new Error("Random bytes length must be >= 16");
|
|
346
344
|
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, $o(a);
|
|
347
345
|
}
|
|
346
|
+
function Le(s, t, e) {
|
|
347
|
+
return xe.randomUUID && !s ? xe.randomUUID() : Lo(s);
|
|
348
|
+
}
|
|
348
349
|
const Nt = (s) => {
|
|
349
350
|
if (typeof s != "object")
|
|
350
351
|
return s;
|
|
@@ -353,26 +354,26 @@ const Nt = (s) => {
|
|
|
353
354
|
typeof e[1] == "object" ? t[e[0]] = Nt(e[1]) : t[e[0]] = e[1];
|
|
354
355
|
return t;
|
|
355
356
|
}, st = (s) => {
|
|
356
|
-
const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s,
|
|
357
|
-
...
|
|
357
|
+
const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, r = l, i = {
|
|
358
|
+
...r,
|
|
358
359
|
...t
|
|
359
|
-
},
|
|
360
|
-
...
|
|
360
|
+
}, n = {
|
|
361
|
+
...r,
|
|
361
362
|
...e
|
|
362
363
|
}, o = {
|
|
363
|
-
...
|
|
364
|
+
...r,
|
|
364
365
|
...e,
|
|
365
366
|
...t,
|
|
366
367
|
...a
|
|
367
368
|
};
|
|
368
369
|
return {
|
|
369
|
-
defaultLook:
|
|
370
|
+
defaultLook: r,
|
|
370
371
|
selectedLook: i,
|
|
371
|
-
highlightedLook:
|
|
372
|
+
highlightedLook: n,
|
|
372
373
|
selectedAndHighlightedLook: o
|
|
373
374
|
};
|
|
374
375
|
};
|
|
375
|
-
class
|
|
376
|
+
class te {
|
|
376
377
|
constructor() {
|
|
377
378
|
this.entities = [], this.entityMap = {};
|
|
378
379
|
}
|
|
@@ -516,7 +517,7 @@ class It {
|
|
|
516
517
|
return this.model.canvas?.selectCanvasView()?.select(`[id='${ue(this.id)}']`);
|
|
517
518
|
}
|
|
518
519
|
}
|
|
519
|
-
class ft extends
|
|
520
|
+
class ft extends te {
|
|
520
521
|
all(t = !1) {
|
|
521
522
|
return t ? super.all() : super.filter((e) => !e.removed);
|
|
522
523
|
}
|
|
@@ -524,13 +525,13 @@ class ft extends Qt {
|
|
|
524
525
|
return e ? super.contains(t) : super.contains(t) && !this.entityMap[t].removed;
|
|
525
526
|
}
|
|
526
527
|
count(t, e = !1) {
|
|
527
|
-
return e ? super.count(t) : super.count((a, l,
|
|
528
|
+
return e ? super.count(t) : super.count((a, l, r) => t(a, l, r) && !a.removed);
|
|
528
529
|
}
|
|
529
530
|
filter(t, e = !1) {
|
|
530
|
-
return e ? super.filter(t) : super.filter((a, l,
|
|
531
|
+
return e ? super.filter(t) : super.filter((a, l, r) => t(a, l, r) && !a.removed);
|
|
531
532
|
}
|
|
532
533
|
find(t, e = !1) {
|
|
533
|
-
return e ? super.find(t) : super.find((a, l,
|
|
534
|
+
return e ? super.find(t) : super.find((a, l, r) => t(a, l, r) && !a.removed);
|
|
534
535
|
}
|
|
535
536
|
get(t, e = !1) {
|
|
536
537
|
return e ? super.get(t) : this.contains(t) ? super.get(t) : void 0;
|
|
@@ -554,13 +555,13 @@ class ft extends Qt {
|
|
|
554
555
|
yield e;
|
|
555
556
|
}
|
|
556
557
|
}
|
|
557
|
-
class
|
|
558
|
-
constructor(t, e, a, l,
|
|
559
|
-
this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic =
|
|
558
|
+
class Eo {
|
|
559
|
+
constructor(t, e, a, l, r, i, n) {
|
|
560
|
+
this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = r, this.editable = i, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
var T = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(T || {});
|
|
563
|
-
class
|
|
564
|
+
class ee {
|
|
564
565
|
constructor(t = []) {
|
|
565
566
|
this.propertyList = t, this.propertyMap = {};
|
|
566
567
|
for (const e of this.propertyList)
|
|
@@ -581,18 +582,18 @@ function kt(s, t) {
|
|
|
581
582
|
}
|
|
582
583
|
const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Fe = (s, t, e) => {
|
|
583
584
|
const a = {}, l = {};
|
|
584
|
-
for (const
|
|
585
|
-
if (e.propertySet.propertyMap[
|
|
585
|
+
for (const r in e.propertySet.propertyMap)
|
|
586
|
+
if (e.propertySet.propertyMap[r].type === T.Object) {
|
|
586
587
|
const i = Fe(
|
|
587
|
-
s[
|
|
588
|
-
t[
|
|
589
|
-
e.getSubValueSet(
|
|
588
|
+
s[r],
|
|
589
|
+
t[r],
|
|
590
|
+
e.getSubValueSet(r)
|
|
590
591
|
);
|
|
591
|
-
Object.keys(i[0]).length > 0 && Object.keys(i[1]).length > 0 && (a[
|
|
592
|
+
Object.keys(i[0]).length > 0 && Object.keys(i[1]).length > 0 && (a[r] = i[0], l[r] = i[1]);
|
|
592
593
|
} else
|
|
593
|
-
St(s[
|
|
594
|
+
St(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
|
|
594
595
|
return [a, l];
|
|
595
|
-
},
|
|
596
|
+
}, Mo = (s) => s != null && s.constructor === Object;
|
|
596
597
|
class yt {
|
|
597
598
|
constructor(t, e) {
|
|
598
599
|
this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
|
|
@@ -633,10 +634,10 @@ class yt {
|
|
|
633
634
|
if (typeof t == "string" && (this.rootElement[t] = e), Array.isArray(t) && t.length > 0) {
|
|
634
635
|
let a = this.rootElement;
|
|
635
636
|
for (let l = 0; l < t.length - 1; ++l) {
|
|
636
|
-
const
|
|
637
|
+
const r = t[l];
|
|
637
638
|
if (a == null)
|
|
638
639
|
return;
|
|
639
|
-
a = a[
|
|
640
|
+
a = a[r];
|
|
640
641
|
}
|
|
641
642
|
if (a == null)
|
|
642
643
|
return;
|
|
@@ -810,7 +811,7 @@ class yt {
|
|
|
810
811
|
* @returns The constructed ValueSet.
|
|
811
812
|
*/
|
|
812
813
|
constructSubValueSet(t) {
|
|
813
|
-
const e = this.propertySet.getProperty(t), a = new
|
|
814
|
+
const e = this.propertySet.getProperty(t), a = new ee(e.properties), l = new yt(a, this.rootElement);
|
|
814
815
|
return l.overwriteValues(
|
|
815
816
|
Nt(e.defaultValue)
|
|
816
817
|
), l;
|
|
@@ -885,7 +886,7 @@ class Ue {
|
|
|
885
886
|
this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
|
|
886
887
|
} else
|
|
887
888
|
this.defaultEndMarkerLook = null, this.selectedEndMarkerLook = null, this.highlightedEndMarkerLook = null, this.selectedAndHighlightedEndMarkerLook = null;
|
|
888
|
-
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new
|
|
889
|
+
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new ee(e.properties);
|
|
889
890
|
}
|
|
890
891
|
canStartFromType(t) {
|
|
891
892
|
return this.startTypes.indexOf(t) >= 0;
|
|
@@ -895,12 +896,12 @@ class Ue {
|
|
|
895
896
|
}
|
|
896
897
|
}
|
|
897
898
|
class dt extends It {
|
|
898
|
-
constructor(t, e, a, l,
|
|
899
|
-
if (t.connections.get(
|
|
900
|
-
throw new Error(`DiagramConnection with id "${
|
|
901
|
-
if (!
|
|
899
|
+
constructor(t, e, a, l, r) {
|
|
900
|
+
if (t.connections.get(r) !== void 0)
|
|
901
|
+
throw new Error(`DiagramConnection with id "${r}" already exists`);
|
|
902
|
+
if (!r)
|
|
902
903
|
throw new Error("DiagramConnection cannot have an empty or null id");
|
|
903
|
-
super(t,
|
|
904
|
+
super(t, r), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = e, this.valueSet = new yt(e.propertySet, this), this.originalData = {}, this.setStart(a), this.setEnd(l);
|
|
904
905
|
}
|
|
905
906
|
get type() {
|
|
906
907
|
return this._type;
|
|
@@ -1099,46 +1100,62 @@ class dt extends It {
|
|
|
1099
1100
|
tighten() {
|
|
1100
1101
|
const t = this.model.canvas?.allowConnectionLoops || !1, e = this.model.canvas?.allowSharingPorts !== !1, a = this.model.canvas?.allowSharingBothPorts || !1;
|
|
1101
1102
|
if (this.start?.rootElement && this.end) {
|
|
1102
|
-
const l = this.start.rootElement.ports.map((
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
]).sort((
|
|
1106
|
-
t: for (const
|
|
1107
|
-
if (!t &&
|
|
1103
|
+
const l = this.start.rootElement.ports.map((r) => [
|
|
1104
|
+
r,
|
|
1105
|
+
r.distanceTo(this.end.coords)
|
|
1106
|
+
]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
|
|
1107
|
+
t: for (const r of l) {
|
|
1108
|
+
if (!t && r === this.end || !r.allowsOutgoing || !e && (r.incomingConnections.filter(
|
|
1109
|
+
(i) => !i.removed && i !== this
|
|
1110
|
+
).length > 0 || r.outgoingConnections.filter(
|
|
1111
|
+
(i) => !i.removed && i !== this
|
|
1112
|
+
).length > 0))
|
|
1108
1113
|
continue t;
|
|
1109
1114
|
if (!a) {
|
|
1110
|
-
for (const i of
|
|
1115
|
+
for (const i of r.outgoingConnections.filter(
|
|
1116
|
+
(n) => !n.removed
|
|
1117
|
+
))
|
|
1111
1118
|
if (i !== this && i.end === this.end)
|
|
1112
1119
|
continue t;
|
|
1113
|
-
for (const i of
|
|
1120
|
+
for (const i of r.incomingConnections.filter(
|
|
1121
|
+
(n) => !n.removed
|
|
1122
|
+
))
|
|
1114
1123
|
if (i !== this && i.start === this.end)
|
|
1115
1124
|
continue t;
|
|
1116
1125
|
}
|
|
1117
|
-
if (
|
|
1126
|
+
if (r === this.start)
|
|
1118
1127
|
break t;
|
|
1119
|
-
this.setStart(
|
|
1128
|
+
this.setStart(r);
|
|
1120
1129
|
break t;
|
|
1121
1130
|
}
|
|
1122
1131
|
}
|
|
1123
1132
|
if (this.end?.rootElement && this.start) {
|
|
1124
|
-
const l = this.end.rootElement.ports.map((
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
]).sort((
|
|
1128
|
-
t: for (const
|
|
1129
|
-
if (!t &&
|
|
1133
|
+
const l = this.end.rootElement.ports.map((r) => [
|
|
1134
|
+
r,
|
|
1135
|
+
r.distanceTo(this.start.coords)
|
|
1136
|
+
]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
|
|
1137
|
+
t: for (const r of l) {
|
|
1138
|
+
if (!t && r === this.start || !r.allowsIncoming || !e && (r.incomingConnections.filter(
|
|
1139
|
+
(i) => !i.removed && i !== this
|
|
1140
|
+
).length > 0 || r.outgoingConnections.filter(
|
|
1141
|
+
(i) => !i.removed && i !== this
|
|
1142
|
+
).length > 0))
|
|
1130
1143
|
continue t;
|
|
1131
1144
|
if (!a) {
|
|
1132
|
-
for (const i of
|
|
1145
|
+
for (const i of r.incomingConnections.filter(
|
|
1146
|
+
(n) => !n.removed
|
|
1147
|
+
))
|
|
1133
1148
|
if (i !== this && i.start === this.start)
|
|
1134
1149
|
continue t;
|
|
1135
|
-
for (const i of
|
|
1150
|
+
for (const i of r.outgoingConnections.filter(
|
|
1151
|
+
(n) => !n.removed
|
|
1152
|
+
))
|
|
1136
1153
|
if (i !== this && i.end === this.start)
|
|
1137
1154
|
continue t;
|
|
1138
1155
|
}
|
|
1139
|
-
if (
|
|
1156
|
+
if (r === this.end)
|
|
1140
1157
|
break t;
|
|
1141
|
-
this.setEnd(
|
|
1158
|
+
this.setEnd(r);
|
|
1142
1159
|
break t;
|
|
1143
1160
|
}
|
|
1144
1161
|
}
|
|
@@ -1147,13 +1164,13 @@ class dt extends It {
|
|
|
1147
1164
|
return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
|
|
1148
1165
|
}
|
|
1149
1166
|
}
|
|
1150
|
-
class
|
|
1167
|
+
class To extends ft {
|
|
1151
1168
|
/**
|
|
1152
1169
|
* Instance a set of connections for the given model. This method is used internally.
|
|
1153
1170
|
* @private
|
|
1154
1171
|
*/
|
|
1155
1172
|
constructor(t) {
|
|
1156
|
-
super(), this.types = new
|
|
1173
|
+
super(), this.types = new te(), this.model = t;
|
|
1157
1174
|
}
|
|
1158
1175
|
/**
|
|
1159
1176
|
* Instance a new connection and add it to this set.
|
|
@@ -1165,20 +1182,20 @@ class Mo extends ft {
|
|
|
1165
1182
|
* @returns The instanced connection.
|
|
1166
1183
|
*/
|
|
1167
1184
|
new(t, e, a, l) {
|
|
1168
|
-
let
|
|
1185
|
+
let r;
|
|
1169
1186
|
if (t instanceof Ue)
|
|
1170
|
-
|
|
1187
|
+
r = t;
|
|
1171
1188
|
else {
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1189
|
+
const n = this.types.get(t);
|
|
1190
|
+
if (n === void 0)
|
|
1174
1191
|
throw new TypeError(
|
|
1175
1192
|
`Connection type with id '${t}' could not be found.`
|
|
1176
1193
|
);
|
|
1177
|
-
|
|
1194
|
+
r = n;
|
|
1178
1195
|
}
|
|
1179
1196
|
const i = new dt(
|
|
1180
1197
|
this.model,
|
|
1181
|
-
|
|
1198
|
+
r,
|
|
1182
1199
|
e,
|
|
1183
1200
|
a,
|
|
1184
1201
|
l
|
|
@@ -1200,17 +1217,17 @@ const V = {
|
|
|
1200
1217
|
selectedColor: "#000000",
|
|
1201
1218
|
backgroundColor: "#00000000",
|
|
1202
1219
|
horizontalAlign: Lt.Center,
|
|
1203
|
-
verticalAlign:
|
|
1220
|
+
verticalAlign: qt.Center,
|
|
1204
1221
|
orientation: g.Top,
|
|
1205
1222
|
fit: !1,
|
|
1206
1223
|
shrink: !0
|
|
1207
1224
|
};
|
|
1208
1225
|
class ht extends It {
|
|
1209
|
-
constructor(t, e, a, l,
|
|
1226
|
+
constructor(t, e, a, l, r, i, n, o, d, c, h, f, y, m, p, u) {
|
|
1210
1227
|
const k = `${e?.id}_field`;
|
|
1211
1228
|
if (t.fields.get(k) !== void 0)
|
|
1212
1229
|
throw new Error("DiagramField for rootElement already exists");
|
|
1213
|
-
if (super(t, k), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height =
|
|
1230
|
+
if (super(t, k), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.fontSize = i, this.fontFamily = n, this.color = o, this.selectedColor = d, this.horizontalAlign = c, this.verticalAlign = h, !isNaN(Number(f)))
|
|
1214
1231
|
this.orientation = Number(f);
|
|
1215
1232
|
else
|
|
1216
1233
|
switch (f) {
|
|
@@ -1262,7 +1279,7 @@ class ht extends It {
|
|
|
1262
1279
|
return this.rootElement?.getPriority() || Pt;
|
|
1263
1280
|
}
|
|
1264
1281
|
}
|
|
1265
|
-
class
|
|
1282
|
+
class No extends ft {
|
|
1266
1283
|
/**
|
|
1267
1284
|
* Instance a set of fields for the given model. This method is used internally.
|
|
1268
1285
|
* @private
|
|
@@ -1274,16 +1291,16 @@ class To extends ft {
|
|
|
1274
1291
|
* Instance a new field and add it to this set. This method is normally called when instancing an element with a field and it is rarely called by itself.
|
|
1275
1292
|
* @private
|
|
1276
1293
|
*/
|
|
1277
|
-
new(t, e, a, l,
|
|
1294
|
+
new(t, e, a, l, r, i, n, o, d, c, h, f, y, m, p) {
|
|
1278
1295
|
const u = new ht(
|
|
1279
1296
|
this.model,
|
|
1280
1297
|
t,
|
|
1281
1298
|
e,
|
|
1282
|
-
|
|
1299
|
+
n,
|
|
1283
1300
|
o,
|
|
1284
1301
|
a,
|
|
1285
1302
|
l,
|
|
1286
|
-
|
|
1303
|
+
r,
|
|
1287
1304
|
i,
|
|
1288
1305
|
d,
|
|
1289
1306
|
c,
|
|
@@ -1300,19 +1317,19 @@ class To extends ft {
|
|
|
1300
1317
|
e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
|
|
1301
1318
|
}
|
|
1302
1319
|
}
|
|
1303
|
-
const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Me = 1, Te = 1,
|
|
1304
|
-
class
|
|
1320
|
+
const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Me = 1, Te = 1, Po = 1, zo = 1;
|
|
1321
|
+
class Ro {
|
|
1305
1322
|
constructor(t) {
|
|
1306
1323
|
this.margin = t.margin || 0, this.defaultWidths = t.defaultWidths || null, this.defaultHeights = t.defaultHeights || null, this.minWidths = t.minWidths || null, this.minHeights = t.minHeights || null, this.sections = [];
|
|
1307
1324
|
for (const e of t.sections) {
|
|
1308
1325
|
const a = [];
|
|
1309
1326
|
this.sections.push(a);
|
|
1310
1327
|
for (const l of e)
|
|
1311
|
-
a.push(new
|
|
1328
|
+
a.push(new Vo(l));
|
|
1312
1329
|
}
|
|
1313
1330
|
}
|
|
1314
1331
|
}
|
|
1315
|
-
class
|
|
1332
|
+
class Vo {
|
|
1316
1333
|
constructor(t) {
|
|
1317
1334
|
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
|
|
1318
1335
|
const e = st(t.look || De);
|
|
@@ -1320,12 +1337,12 @@ class Ro {
|
|
|
1320
1337
|
}
|
|
1321
1338
|
}
|
|
1322
1339
|
class D extends It {
|
|
1323
|
-
constructor(t, e, a, l,
|
|
1340
|
+
constructor(t, e, a, l, r, i, n, o) {
|
|
1324
1341
|
if (t.sections.get(o) !== void 0)
|
|
1325
1342
|
throw new Error(`DiagramSection with id "${o}" already exists`);
|
|
1326
1343
|
if (!o)
|
|
1327
1344
|
throw new Error("DiagramSection cannot have an empty or null id");
|
|
1328
|
-
super(t, o), this.ports = [], this.decorators = [], this.node = e, this.indexXInNode = a, this.indexYInNode = l, this.coords =
|
|
1345
|
+
super(t, o), this.ports = [], this.decorators = [], this.node = e, this.indexXInNode = a, this.indexYInNode = l, this.coords = r, this.width = i, this.height = n;
|
|
1329
1346
|
}
|
|
1330
1347
|
/**
|
|
1331
1348
|
* Name of this section. Alias for this section's label's text.
|
|
@@ -1399,10 +1416,10 @@ class D extends It {
|
|
|
1399
1416
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
|
|
1400
1417
|
}
|
|
1401
1418
|
getMinWidth() {
|
|
1402
|
-
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] ||
|
|
1419
|
+
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || Po;
|
|
1403
1420
|
}
|
|
1404
1421
|
getMinHeight() {
|
|
1405
|
-
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] ||
|
|
1422
|
+
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || zo;
|
|
1406
1423
|
}
|
|
1407
1424
|
getPriority() {
|
|
1408
1425
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
|
|
@@ -1437,7 +1454,7 @@ class D extends It {
|
|
|
1437
1454
|
if (this.ports.length === 1)
|
|
1438
1455
|
return this.ports[1];
|
|
1439
1456
|
{
|
|
1440
|
-
const e = this.ports.map((
|
|
1457
|
+
const e = this.ports.map((r) => r.distanceTo(t)), a = e.indexOf(
|
|
1441
1458
|
Math.min(...e)
|
|
1442
1459
|
);
|
|
1443
1460
|
return this.ports[a];
|
|
@@ -1503,24 +1520,24 @@ class D extends It {
|
|
|
1503
1520
|
*/
|
|
1504
1521
|
stretch(t, e) {
|
|
1505
1522
|
const a = [this.coords[0], this.coords[0] + this.width], l = [this.coords[1], this.coords[1] + this.height];
|
|
1506
|
-
let
|
|
1523
|
+
let r, i;
|
|
1507
1524
|
switch (t) {
|
|
1508
1525
|
case g.Left:
|
|
1509
|
-
|
|
1526
|
+
r = [a[0] - e, a[1]], i = [l[0], l[1]], r[1] - r[0] < this.getMinWidth() && (r[0] = r[1] - this.getMinWidth());
|
|
1510
1527
|
break;
|
|
1511
1528
|
case g.Top:
|
|
1512
|
-
|
|
1529
|
+
r = [a[0], a[1]], i = [l[0] - e, l[1]], i[1] - i[0] < this.getMinHeight() && (i[0] = i[1] - this.getMinHeight());
|
|
1513
1530
|
break;
|
|
1514
1531
|
case g.Right:
|
|
1515
|
-
|
|
1532
|
+
r = [a[0], a[1] + e], i = [l[0], l[1]], r[1] - r[0] < this.getMinWidth() && (r[1] = r[0] + this.getMinWidth());
|
|
1516
1533
|
break;
|
|
1517
1534
|
case g.Bottom:
|
|
1518
|
-
|
|
1535
|
+
r = [a[0], a[1]], i = [l[0], l[1] + e], i[1] - i[0] < this.getMinHeight() && (i[1] = i[0] + this.getMinHeight());
|
|
1519
1536
|
break;
|
|
1520
1537
|
}
|
|
1521
1538
|
this.setGeometry({
|
|
1522
|
-
coords: [
|
|
1523
|
-
width:
|
|
1539
|
+
coords: [r[0], i[0]],
|
|
1540
|
+
width: r[1] - r[0],
|
|
1524
1541
|
height: i[1] - i[0]
|
|
1525
1542
|
});
|
|
1526
1543
|
}
|
|
@@ -1542,17 +1559,17 @@ class D extends It {
|
|
|
1542
1559
|
setGeometry(t) {
|
|
1543
1560
|
const e = [this.coords[0], this.coords[0] + this.width], a = [this.coords[1], this.coords[1] + this.height];
|
|
1544
1561
|
this.coords = [...t.coords], this.width = t.width, this.height = t.height;
|
|
1545
|
-
const l = [this.coords[0], this.coords[0] + this.width],
|
|
1546
|
-
for (const
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1562
|
+
const l = [this.coords[0], this.coords[0] + this.width], r = [this.coords[1], this.coords[1] + this.height];
|
|
1563
|
+
for (const n of this.ports)
|
|
1564
|
+
n.move(
|
|
1565
|
+
Jt(
|
|
1566
|
+
n.coords,
|
|
1550
1567
|
e,
|
|
1551
1568
|
a,
|
|
1552
1569
|
l,
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1570
|
+
r,
|
|
1571
|
+
n.anchorPointX,
|
|
1572
|
+
n.anchorPointY
|
|
1556
1573
|
)
|
|
1557
1574
|
);
|
|
1558
1575
|
const i = this.type;
|
|
@@ -1560,22 +1577,22 @@ class D extends It {
|
|
|
1560
1577
|
this.coords[0] + B(i?.label),
|
|
1561
1578
|
this.coords[1] + F(i?.label)
|
|
1562
1579
|
], this.label.width = this.width - B(i?.label) - ot(i?.label), this.label.height = this.height - F(i?.label) - K(i?.label), this.label.updateInView());
|
|
1563
|
-
for (const
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1580
|
+
for (const n of this.decorators)
|
|
1581
|
+
n.move(
|
|
1582
|
+
Jt(
|
|
1583
|
+
n.coords,
|
|
1567
1584
|
e,
|
|
1568
1585
|
a,
|
|
1569
1586
|
l,
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1587
|
+
r,
|
|
1588
|
+
n.anchorPointX,
|
|
1589
|
+
n.anchorPointY
|
|
1573
1590
|
)
|
|
1574
1591
|
);
|
|
1575
|
-
this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((
|
|
1592
|
+
this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((n) => n.tighten()), this.updateInView();
|
|
1576
1593
|
}
|
|
1577
1594
|
}
|
|
1578
|
-
class
|
|
1595
|
+
class Oo extends ft {
|
|
1579
1596
|
/**
|
|
1580
1597
|
* Instance a set of sections for the given model. This method is used internally.
|
|
1581
1598
|
* @private
|
|
@@ -1587,16 +1604,16 @@ class Vo extends ft {
|
|
|
1587
1604
|
* Instance a new section and add it to this set. This method is normally called when instancing an element with a section and it is rarely called by itself.
|
|
1588
1605
|
* @private
|
|
1589
1606
|
*/
|
|
1590
|
-
new(t, e, a, l,
|
|
1607
|
+
new(t, e, a, l, r, i, n) {
|
|
1591
1608
|
const o = new D(
|
|
1592
1609
|
this.model,
|
|
1593
1610
|
t,
|
|
1594
1611
|
e,
|
|
1595
1612
|
a,
|
|
1596
1613
|
l,
|
|
1597
|
-
|
|
1614
|
+
r,
|
|
1598
1615
|
i,
|
|
1599
|
-
|
|
1616
|
+
n
|
|
1600
1617
|
);
|
|
1601
1618
|
super.add(o), o.updateInView(), t.sections.push(o), t.updateInView();
|
|
1602
1619
|
const d = t.type.sectionGrid?.sections?.[a]?.[e]?.ports;
|
|
@@ -1739,9 +1756,9 @@ class Be {
|
|
|
1739
1756
|
...gt,
|
|
1740
1757
|
...t
|
|
1741
1758
|
};
|
|
1742
|
-
this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding =
|
|
1759
|
+
this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = _o(e), this.leftPadding = Go(e), this.rightPadding = Fo(e), this.topPadding = Uo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Ro(e.sectionGrid) : null;
|
|
1743
1760
|
const a = st(e.look);
|
|
1744
|
-
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new
|
|
1761
|
+
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new ee(t?.properties || []);
|
|
1745
1762
|
}
|
|
1746
1763
|
}
|
|
1747
1764
|
class z extends It {
|
|
@@ -1853,7 +1870,7 @@ class z extends It {
|
|
|
1853
1870
|
if (this.ports.length === 1)
|
|
1854
1871
|
return this.ports[1];
|
|
1855
1872
|
{
|
|
1856
|
-
const e = this.ports.map((
|
|
1873
|
+
const e = this.ports.map((r) => r.distanceTo(t)), a = e.indexOf(
|
|
1857
1874
|
Math.min(...e)
|
|
1858
1875
|
);
|
|
1859
1876
|
return this.ports[a];
|
|
@@ -1910,21 +1927,21 @@ class z extends It {
|
|
|
1910
1927
|
for (const l of a.incomingConnections) {
|
|
1911
1928
|
if (!t && l.removed)
|
|
1912
1929
|
continue;
|
|
1913
|
-
const
|
|
1914
|
-
if (
|
|
1915
|
-
if (!t &&
|
|
1930
|
+
const r = l.start?.getNode();
|
|
1931
|
+
if (r) {
|
|
1932
|
+
if (!t && r.removed)
|
|
1916
1933
|
continue;
|
|
1917
|
-
e.push(
|
|
1934
|
+
e.push(r);
|
|
1918
1935
|
}
|
|
1919
1936
|
}
|
|
1920
1937
|
for (const l of a.outgoingConnections) {
|
|
1921
1938
|
if (!t && l.removed)
|
|
1922
1939
|
continue;
|
|
1923
|
-
const
|
|
1924
|
-
if (
|
|
1925
|
-
if (!t &&
|
|
1940
|
+
const r = l.end?.getNode();
|
|
1941
|
+
if (r) {
|
|
1942
|
+
if (!t && r.removed)
|
|
1926
1943
|
continue;
|
|
1927
|
-
e.push(
|
|
1944
|
+
e.push(r);
|
|
1928
1945
|
}
|
|
1929
1946
|
}
|
|
1930
1947
|
}
|
|
@@ -1990,13 +2007,13 @@ class z extends It {
|
|
|
1990
2007
|
e,
|
|
1991
2008
|
a
|
|
1992
2009
|
) : this.stretch(g.Left, l));
|
|
1993
|
-
const
|
|
1994
|
-
|
|
2010
|
+
const r = this.coords[1] - t.coords[1] + this.type.topPadding;
|
|
2011
|
+
r >= 0 && (this.sections.length > 0 ? this.stretchSections(
|
|
1995
2012
|
g.Top,
|
|
1996
|
-
|
|
2013
|
+
r,
|
|
1997
2014
|
e,
|
|
1998
2015
|
a
|
|
1999
|
-
) : this.stretch(g.Top,
|
|
2016
|
+
) : this.stretch(g.Top, r));
|
|
2000
2017
|
const i = t.coords[0] + t.width - (this.coords[0] + this.width) + this.type.rightPadding;
|
|
2001
2018
|
i >= 0 && (this.sections.length > 0 ? this.stretchSections(
|
|
2002
2019
|
g.Right,
|
|
@@ -2004,13 +2021,13 @@ class z extends It {
|
|
|
2004
2021
|
e,
|
|
2005
2022
|
a
|
|
2006
2023
|
) : this.stretch(g.Right, i));
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2024
|
+
const n = t.coords[1] + t.height - (this.coords[1] + this.height) + this.type.bottomPadding;
|
|
2025
|
+
n >= 0 && (this.sections.length > 0 ? this.stretchSections(
|
|
2009
2026
|
g.Bottom,
|
|
2010
|
-
|
|
2027
|
+
n,
|
|
2011
2028
|
e,
|
|
2012
2029
|
a
|
|
2013
|
-
) : this.stretch(g.Bottom,
|
|
2030
|
+
) : this.stretch(g.Bottom, n)), this.parent && this.parent.fitToChild(this);
|
|
2014
2031
|
}
|
|
2015
2032
|
/**
|
|
2016
2033
|
* Change the coordinates of this node to the given coordinates and move its sections, ports and labels correspondingly.
|
|
@@ -2050,24 +2067,24 @@ class z extends It {
|
|
|
2050
2067
|
*/
|
|
2051
2068
|
stretch(t, e) {
|
|
2052
2069
|
const a = [this.coords[0], this.coords[0] + this.width], l = [this.coords[1], this.coords[1] + this.height];
|
|
2053
|
-
let
|
|
2070
|
+
let r, i;
|
|
2054
2071
|
switch (t) {
|
|
2055
2072
|
case g.Left:
|
|
2056
|
-
|
|
2073
|
+
r = [a[0] - e, a[1]], i = [l[0], l[1]], r[1] - r[0] < this.type.minWidth && (r[0] = r[1] - this.type.minWidth);
|
|
2057
2074
|
break;
|
|
2058
2075
|
case g.Top:
|
|
2059
|
-
|
|
2076
|
+
r = [a[0], a[1]], i = [l[0] - e, l[1]], i[1] - i[0] < this.type.minHeight && (i[0] = i[1] - this.type.minHeight);
|
|
2060
2077
|
break;
|
|
2061
2078
|
case g.Right:
|
|
2062
|
-
|
|
2079
|
+
r = [a[0], a[1] + e], i = [l[0], l[1]], r[1] - r[0] < this.type.minWidth && (r[1] = r[0] + this.type.minWidth);
|
|
2063
2080
|
break;
|
|
2064
2081
|
case g.Bottom:
|
|
2065
|
-
|
|
2082
|
+
r = [a[0], a[1]], i = [l[0], l[1] + e], i[1] - i[0] < this.type.minHeight && (i[1] = i[0] + this.type.minHeight);
|
|
2066
2083
|
break;
|
|
2067
2084
|
}
|
|
2068
2085
|
this.setGeometry({
|
|
2069
|
-
coords: [
|
|
2070
|
-
width:
|
|
2086
|
+
coords: [r[0], i[0]],
|
|
2087
|
+
width: r[1] - r[0],
|
|
2071
2088
|
height: i[1] - i[0],
|
|
2072
2089
|
// we ignore this.sections, the stretching of a node with sections is handled in the stretchSections method
|
|
2073
2090
|
sections: {},
|
|
@@ -2084,45 +2101,45 @@ class z extends It {
|
|
|
2084
2101
|
* @param indexY A section index.
|
|
2085
2102
|
*/
|
|
2086
2103
|
stretchSections(t, e, a, l) {
|
|
2087
|
-
let
|
|
2104
|
+
let r = Number.NEGATIVE_INFINITY;
|
|
2088
2105
|
switch (t) {
|
|
2089
2106
|
case g.Bottom:
|
|
2090
2107
|
for (const i of this.sections)
|
|
2091
|
-
i.indexYInNode === l && (
|
|
2092
|
-
|
|
2108
|
+
i.indexYInNode === l && (r = Math.max(
|
|
2109
|
+
r,
|
|
2093
2110
|
i.getMinHeight() - i.height
|
|
2094
2111
|
));
|
|
2095
|
-
e <
|
|
2112
|
+
e < r && (e = r);
|
|
2096
2113
|
for (const i of this.sections)
|
|
2097
2114
|
i.indexYInNode === l ? i.stretch(t, e) : i.indexYInNode > l && i.move([i.coords[0], i.coords[1] + e]);
|
|
2098
2115
|
break;
|
|
2099
2116
|
case g.Right:
|
|
2100
2117
|
for (const i of this.sections)
|
|
2101
|
-
i.indexXInNode === a && (
|
|
2102
|
-
|
|
2118
|
+
i.indexXInNode === a && (r = Math.max(
|
|
2119
|
+
r,
|
|
2103
2120
|
i.getMinWidth() - i.width
|
|
2104
2121
|
));
|
|
2105
|
-
e <
|
|
2122
|
+
e < r && (e = r);
|
|
2106
2123
|
for (const i of this.sections)
|
|
2107
2124
|
i.indexXInNode === a ? i.stretch(t, e) : i.indexXInNode > a && i.move([i.coords[0] + e, i.coords[1]]);
|
|
2108
2125
|
break;
|
|
2109
2126
|
case g.Top:
|
|
2110
2127
|
for (const i of this.sections)
|
|
2111
|
-
i.indexYInNode === l && (
|
|
2112
|
-
|
|
2128
|
+
i.indexYInNode === l && (r = Math.max(
|
|
2129
|
+
r,
|
|
2113
2130
|
i.getMinHeight() - i.height
|
|
2114
2131
|
));
|
|
2115
|
-
e <
|
|
2132
|
+
e < r && (e = r);
|
|
2116
2133
|
for (const i of this.sections)
|
|
2117
2134
|
i.indexYInNode === l ? i.stretch(t, e) : i.indexYInNode < l && i.move([i.coords[0], i.coords[1] - e]);
|
|
2118
2135
|
break;
|
|
2119
2136
|
case g.Left:
|
|
2120
2137
|
for (const i of this.sections)
|
|
2121
|
-
i.indexXInNode === a && (
|
|
2122
|
-
|
|
2138
|
+
i.indexXInNode === a && (r = Math.max(
|
|
2139
|
+
r,
|
|
2123
2140
|
i.getMinWidth() - i.width
|
|
2124
2141
|
));
|
|
2125
|
-
e <
|
|
2142
|
+
e < r && (e = r);
|
|
2126
2143
|
for (const i of this.sections)
|
|
2127
2144
|
i.indexXInNode === a ? i.stretch(t, e) : i.indexXInNode < a && i.move([i.coords[0] - e, i.coords[1]]);
|
|
2128
2145
|
break;
|
|
@@ -2156,23 +2173,23 @@ class z extends It {
|
|
|
2156
2173
|
this.raise();
|
|
2157
2174
|
const e = [this.coords[0], this.coords[0] + this.width], a = [this.coords[1], this.coords[1] + this.height];
|
|
2158
2175
|
this.coords = [...t.coords], this.width = t.width, this.height = t.height;
|
|
2159
|
-
const l = [this.coords[0], this.coords[0] + this.width],
|
|
2176
|
+
const l = [this.coords[0], this.coords[0] + this.width], r = [this.coords[1], this.coords[1] + this.height];
|
|
2160
2177
|
for (const i of this.children) {
|
|
2161
|
-
const
|
|
2162
|
-
|
|
2178
|
+
const n = t.children[i.id];
|
|
2179
|
+
n && i.setGeometry(n);
|
|
2163
2180
|
}
|
|
2164
2181
|
for (const i of this.sections) {
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2182
|
+
const n = t.sections[i.id];
|
|
2183
|
+
n && i.setGeometry(n);
|
|
2167
2184
|
}
|
|
2168
2185
|
for (const i of this.ports)
|
|
2169
2186
|
i.move(
|
|
2170
|
-
|
|
2187
|
+
Jt(
|
|
2171
2188
|
i.coords,
|
|
2172
2189
|
e,
|
|
2173
2190
|
a,
|
|
2174
2191
|
l,
|
|
2175
|
-
|
|
2192
|
+
r,
|
|
2176
2193
|
i.anchorPointX,
|
|
2177
2194
|
i.anchorPointY
|
|
2178
2195
|
)
|
|
@@ -2183,12 +2200,12 @@ class z extends It {
|
|
|
2183
2200
|
], this.label.width = this.width - B(this.type.label) - ot(this.type.label), this.label.height = this.height - F(this.type.label) - K(this.type.label), this.label.updateInView());
|
|
2184
2201
|
for (const i of this.decorators)
|
|
2185
2202
|
i.move(
|
|
2186
|
-
|
|
2203
|
+
Jt(
|
|
2187
2204
|
i.coords,
|
|
2188
2205
|
e,
|
|
2189
2206
|
a,
|
|
2190
2207
|
l,
|
|
2191
|
-
|
|
2208
|
+
r,
|
|
2192
2209
|
i.anchorPointX,
|
|
2193
2210
|
i.anchorPointY
|
|
2194
2211
|
)
|
|
@@ -2203,12 +2220,12 @@ class z extends It {
|
|
|
2203
2220
|
const e = this.type.sectionGrid?.margin || 0;
|
|
2204
2221
|
let a = 0;
|
|
2205
2222
|
const l = [...this.sections];
|
|
2206
|
-
for (const
|
|
2207
|
-
|
|
2208
|
-
for (const
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2223
|
+
for (const r of l)
|
|
2224
|
+
r.indexYInNode === t && (a = Math.max(a, r.width), this.model.sections.remove(r.id));
|
|
2225
|
+
for (const r of l)
|
|
2226
|
+
r.indexYInNode > t && (--r.indexYInNode, r.move([
|
|
2227
|
+
r.coords[0] - a - e,
|
|
2228
|
+
r.coords[1]
|
|
2212
2229
|
]));
|
|
2213
2230
|
this.stretch(g.Right, -e - a);
|
|
2214
2231
|
}
|
|
@@ -2220,12 +2237,12 @@ class z extends It {
|
|
|
2220
2237
|
const e = this.type.sectionGrid?.margin || 0;
|
|
2221
2238
|
let a = 0;
|
|
2222
2239
|
const l = [...this.sections];
|
|
2223
|
-
for (const
|
|
2224
|
-
|
|
2225
|
-
for (const
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2240
|
+
for (const r of l)
|
|
2241
|
+
r.indexXInNode === t && (a = Math.max(a, r.height), this.model.sections.remove(r.id));
|
|
2242
|
+
for (const r of l)
|
|
2243
|
+
r.indexYInNode > t && (--r.indexXInNode, r.move([
|
|
2244
|
+
r.coords[0],
|
|
2245
|
+
r.coords[1] - a - e
|
|
2229
2246
|
]));
|
|
2230
2247
|
this.stretch(g.Bottom, -e - a);
|
|
2231
2248
|
}
|
|
@@ -2237,29 +2254,29 @@ class z extends It {
|
|
|
2237
2254
|
const e = this.type.sectionGrid?.margin || 0;
|
|
2238
2255
|
let a = 0;
|
|
2239
2256
|
const l = [...this.sections];
|
|
2240
|
-
for (const
|
|
2241
|
-
if (
|
|
2242
|
-
a = Math.max(a,
|
|
2243
|
-
let i =
|
|
2257
|
+
for (const r of l)
|
|
2258
|
+
if (r.indexXInNode === t) {
|
|
2259
|
+
a = Math.max(a, r.width);
|
|
2260
|
+
let i = r.indexXInNode + 1;
|
|
2244
2261
|
for (; this.model.sections.get(
|
|
2245
|
-
`${
|
|
2262
|
+
`${r.id}_copy_${i}_${r.indexYInNode}`,
|
|
2246
2263
|
!0
|
|
2247
2264
|
) !== void 0; )
|
|
2248
2265
|
++i;
|
|
2249
2266
|
this.model.sections.new(
|
|
2250
2267
|
this,
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
[
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
`${
|
|
2268
|
+
r.indexXInNode + 1,
|
|
2269
|
+
r.indexYInNode,
|
|
2270
|
+
[r.coords[0] + r.width + e, r.coords[1]],
|
|
2271
|
+
r.width,
|
|
2272
|
+
r.height,
|
|
2273
|
+
`${r.id}_copy_${i}_${r.indexYInNode}`
|
|
2257
2274
|
);
|
|
2258
2275
|
}
|
|
2259
|
-
for (const
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2276
|
+
for (const r of l)
|
|
2277
|
+
r.indexXInNode > t && (++r.indexXInNode, r.move([
|
|
2278
|
+
r.coords[0] + a + e,
|
|
2279
|
+
r.coords[1]
|
|
2263
2280
|
]));
|
|
2264
2281
|
this.stretch(g.Right, e + a);
|
|
2265
2282
|
}
|
|
@@ -2271,40 +2288,40 @@ class z extends It {
|
|
|
2271
2288
|
const e = this.type.sectionGrid?.margin || 0;
|
|
2272
2289
|
let a = 0;
|
|
2273
2290
|
const l = [...this.sections];
|
|
2274
|
-
for (const
|
|
2275
|
-
if (
|
|
2276
|
-
a = Math.max(a,
|
|
2277
|
-
let i =
|
|
2291
|
+
for (const r of l)
|
|
2292
|
+
if (r.indexYInNode === t) {
|
|
2293
|
+
a = Math.max(a, r.height);
|
|
2294
|
+
let i = r.indexYInNode + 1;
|
|
2278
2295
|
for (; this.model.sections.get(
|
|
2279
|
-
`${
|
|
2296
|
+
`${r.id}_copy_${r.indexXInNode}_${i}`,
|
|
2280
2297
|
!0
|
|
2281
2298
|
) !== void 0; )
|
|
2282
2299
|
++i;
|
|
2283
2300
|
this.model.sections.new(
|
|
2284
2301
|
this,
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
[
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
`${
|
|
2302
|
+
r.indexXInNode,
|
|
2303
|
+
r.indexYInNode + 1,
|
|
2304
|
+
[r.coords[0], r.coords[1] + r.height + e],
|
|
2305
|
+
r.width,
|
|
2306
|
+
r.height,
|
|
2307
|
+
`${r.id}_copy_${r.indexXInNode}_${i}`
|
|
2291
2308
|
);
|
|
2292
2309
|
}
|
|
2293
|
-
for (const
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2310
|
+
for (const r of l)
|
|
2311
|
+
r.indexYInNode > t && (++r.indexYInNode, r.move([
|
|
2312
|
+
r.coords[0],
|
|
2313
|
+
r.coords[1] + a + e
|
|
2297
2314
|
]));
|
|
2298
2315
|
this.stretch(g.Bottom, e + a);
|
|
2299
2316
|
}
|
|
2300
2317
|
}
|
|
2301
|
-
class
|
|
2318
|
+
class Ho extends ft {
|
|
2302
2319
|
/**
|
|
2303
2320
|
* Instance a set of nodes for the given model. This method is used internally.
|
|
2304
2321
|
* @private
|
|
2305
2322
|
*/
|
|
2306
2323
|
constructor(t) {
|
|
2307
|
-
super(), this.types = new
|
|
2324
|
+
super(), this.types = new te(), this.model = t;
|
|
2308
2325
|
}
|
|
2309
2326
|
/**
|
|
2310
2327
|
* Instance a new node and add it to this set.
|
|
@@ -2324,41 +2341,41 @@ class Oo extends ft {
|
|
|
2324
2341
|
throw new TypeError(`Node type with id '${t}' could not be found.`);
|
|
2325
2342
|
l = i;
|
|
2326
2343
|
}
|
|
2327
|
-
const
|
|
2328
|
-
if (super.add(
|
|
2329
|
-
let i =
|
|
2330
|
-
for (let
|
|
2331
|
-
let o =
|
|
2332
|
-
for (let d = 0; d < l.sectionGrid.sections[
|
|
2344
|
+
const r = new z(this.model, l, e, a);
|
|
2345
|
+
if (super.add(r), r.updateInView(), l.sectionGrid !== null) {
|
|
2346
|
+
let i = r.coords[1] + (l.sectionGrid.margin || 0);
|
|
2347
|
+
for (let n = 0; n < l.sectionGrid.sections.length; ++n) {
|
|
2348
|
+
let o = r.coords[0] + (l.sectionGrid.margin || 0);
|
|
2349
|
+
for (let d = 0; d < l.sectionGrid.sections[n].length; ++d)
|
|
2333
2350
|
this.model.sections.new(
|
|
2334
|
-
n,
|
|
2335
|
-
d,
|
|
2336
2351
|
r,
|
|
2352
|
+
d,
|
|
2353
|
+
n,
|
|
2337
2354
|
[o, i],
|
|
2338
2355
|
l.sectionGrid.defaultWidths?.[d] || Me,
|
|
2339
|
-
l.sectionGrid.defaultHeights?.[
|
|
2340
|
-
`${
|
|
2356
|
+
l.sectionGrid.defaultHeights?.[n] || Te,
|
|
2357
|
+
`${r.id}_${n}_${d}`
|
|
2341
2358
|
), o += (l.sectionGrid.defaultWidths?.[d] || Me) + (l.sectionGrid.margin || 0);
|
|
2342
|
-
i += (l.sectionGrid.defaultHeights?.[
|
|
2359
|
+
i += (l.sectionGrid.defaultHeights?.[n] || Te) + (l.sectionGrid.margin || 0);
|
|
2343
2360
|
}
|
|
2344
2361
|
}
|
|
2345
2362
|
if (l.ports.length > 0)
|
|
2346
2363
|
for (let i = 0; i < l.ports.length; ++i) {
|
|
2347
|
-
const
|
|
2364
|
+
const n = l.ports[i], o = n.type !== void 0 ? this.model.ports.types.get(n.type) : void 0, d = this.model.ports.new(
|
|
2348
2365
|
o,
|
|
2349
|
-
|
|
2366
|
+
r,
|
|
2350
2367
|
[
|
|
2351
|
-
|
|
2352
|
-
|
|
2368
|
+
r.coords[0] + n.coords[0],
|
|
2369
|
+
r.coords[1] + n.coords[1]
|
|
2353
2370
|
],
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2371
|
+
n.connectionPoint !== void 0 ? [
|
|
2372
|
+
r.coords[0] + (n.connectionPoint[0] || 0),
|
|
2373
|
+
r.coords[1] + (n.connectionPoint[1] || 0)
|
|
2357
2374
|
] : void 0,
|
|
2358
|
-
|
|
2359
|
-
`${
|
|
2360
|
-
|
|
2361
|
-
|
|
2375
|
+
n.direction,
|
|
2376
|
+
`${r.id}_port_${i}`,
|
|
2377
|
+
n.anchorPointX || "floating",
|
|
2378
|
+
n.anchorPointY || "floating"
|
|
2362
2379
|
);
|
|
2363
2380
|
if (d.type?.label) {
|
|
2364
2381
|
const c = {
|
|
@@ -2409,17 +2426,17 @@ class Oo extends ft {
|
|
|
2409
2426
|
...l.label
|
|
2410
2427
|
};
|
|
2411
2428
|
this.model.fields.new(
|
|
2412
|
-
|
|
2429
|
+
r,
|
|
2413
2430
|
[
|
|
2414
|
-
|
|
2415
|
-
|
|
2431
|
+
r.coords[0] + B(i),
|
|
2432
|
+
r.coords[1] + F(i)
|
|
2416
2433
|
],
|
|
2417
2434
|
i.fontSize,
|
|
2418
2435
|
i.fontFamily,
|
|
2419
2436
|
i.color,
|
|
2420
2437
|
i.selectedColor,
|
|
2421
|
-
|
|
2422
|
-
|
|
2438
|
+
r.width - B(i) - ot(i),
|
|
2439
|
+
r.height - F(i) - K(i),
|
|
2423
2440
|
i.horizontalAlign,
|
|
2424
2441
|
i.verticalAlign,
|
|
2425
2442
|
i.orientation,
|
|
@@ -2431,23 +2448,23 @@ class Oo extends ft {
|
|
|
2431
2448
|
}
|
|
2432
2449
|
if (l.decorators.length > 0)
|
|
2433
2450
|
for (let i = 0; i < l.decorators.length; ++i) {
|
|
2434
|
-
const
|
|
2451
|
+
const n = l.decorators[i];
|
|
2435
2452
|
this.model.decorators.new(
|
|
2436
|
-
|
|
2453
|
+
r,
|
|
2437
2454
|
[
|
|
2438
|
-
|
|
2439
|
-
|
|
2455
|
+
r.coords[0] + n.coords[0],
|
|
2456
|
+
r.coords[1] + n.coords[1]
|
|
2440
2457
|
],
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
`${
|
|
2446
|
-
|
|
2447
|
-
|
|
2458
|
+
n.width,
|
|
2459
|
+
n.height,
|
|
2460
|
+
r.getPriority(),
|
|
2461
|
+
n.html,
|
|
2462
|
+
`${r.id}_decorator_${i}`,
|
|
2463
|
+
n.anchorPointX || "floating",
|
|
2464
|
+
n.anchorPointY || "floating"
|
|
2448
2465
|
);
|
|
2449
2466
|
}
|
|
2450
|
-
return
|
|
2467
|
+
return r.valueSet.resetValues(), r.model.canvas?.fitNodeInView(r.id), r;
|
|
2451
2468
|
}
|
|
2452
2469
|
remove(t) {
|
|
2453
2470
|
const e = this.get(t, !0);
|
|
@@ -2482,7 +2499,7 @@ const Ye = (s) => {
|
|
|
2482
2499
|
for (let e = 0; e < s.length; ++e)
|
|
2483
2500
|
e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
|
|
2484
2501
|
return s;
|
|
2485
|
-
},
|
|
2502
|
+
}, _o = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Go = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Fo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Uo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Xe = {
|
|
2486
2503
|
lookType: "shaped-look",
|
|
2487
2504
|
shape: Tt.Ellipse,
|
|
2488
2505
|
fillColor: "transparent",
|
|
@@ -2494,7 +2511,7 @@ const Ye = (s) => {
|
|
|
2494
2511
|
highlighted: {
|
|
2495
2512
|
fillColor: "rgba(0, 255, 255, 0.5)"
|
|
2496
2513
|
}
|
|
2497
|
-
},
|
|
2514
|
+
}, Wt = st(Xe), je = {
|
|
2498
2515
|
name: "",
|
|
2499
2516
|
label: null,
|
|
2500
2517
|
allowsOutgoing: !0,
|
|
@@ -2502,7 +2519,7 @@ const Ye = (s) => {
|
|
|
2502
2519
|
width: 24,
|
|
2503
2520
|
look: Xe
|
|
2504
2521
|
};
|
|
2505
|
-
class
|
|
2522
|
+
class Do {
|
|
2506
2523
|
constructor(t) {
|
|
2507
2524
|
const e = {
|
|
2508
2525
|
...je,
|
|
@@ -2514,12 +2531,12 @@ class Uo {
|
|
|
2514
2531
|
}
|
|
2515
2532
|
}
|
|
2516
2533
|
class bt extends It {
|
|
2517
|
-
constructor(t, e, a, l,
|
|
2518
|
-
if (t.ports.get(
|
|
2519
|
-
throw new Error(`DiagramPort with id "${
|
|
2520
|
-
if (!
|
|
2534
|
+
constructor(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
2535
|
+
if (t.ports.get(n) !== void 0)
|
|
2536
|
+
throw new Error(`DiagramPort with id "${n}" already exists`);
|
|
2537
|
+
if (!n)
|
|
2521
2538
|
throw new Error("DiagramPort cannot have an empty or null id");
|
|
2522
|
-
super(t,
|
|
2539
|
+
super(t, n), this.outgoingConnections = [], this.incomingConnections = [], this._type = e, this.rootElement = a, this.coords = l, this.connectionPoint = r || l, this.direction = i, this.anchorPointX = o, this.anchorPointY = d;
|
|
2523
2540
|
}
|
|
2524
2541
|
get type() {
|
|
2525
2542
|
return this._type;
|
|
@@ -2566,7 +2583,7 @@ class bt extends It {
|
|
|
2566
2583
|
* @private
|
|
2567
2584
|
*/
|
|
2568
2585
|
get look() {
|
|
2569
|
-
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type ||
|
|
2586
|
+
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || Wt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || Wt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || Wt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || Wt)?.defaultLook;
|
|
2570
2587
|
}
|
|
2571
2588
|
/**
|
|
2572
2589
|
* An alias for the `lookConfig` attribute.
|
|
@@ -2689,28 +2706,28 @@ class bt extends It {
|
|
|
2689
2706
|
return He(this.coords, t);
|
|
2690
2707
|
}
|
|
2691
2708
|
}
|
|
2692
|
-
class
|
|
2709
|
+
class Bo extends ft {
|
|
2693
2710
|
/**
|
|
2694
2711
|
* Instance a set of ports for the given model. This method is used internally.
|
|
2695
2712
|
* @private
|
|
2696
2713
|
*/
|
|
2697
2714
|
constructor(t) {
|
|
2698
|
-
super(), this.types = new
|
|
2715
|
+
super(), this.types = new te(), this.model = t;
|
|
2699
2716
|
}
|
|
2700
2717
|
/**
|
|
2701
2718
|
* Instance a new port and add it to this set. This method is normally called when instancing an element with a port and it is rarely called by itself.
|
|
2702
2719
|
* @private
|
|
2703
2720
|
*/
|
|
2704
|
-
new(t, e, a, l,
|
|
2721
|
+
new(t, e, a, l, r, i, n = "floating", o = "floating") {
|
|
2705
2722
|
const d = new bt(
|
|
2706
2723
|
this.model,
|
|
2707
2724
|
t,
|
|
2708
2725
|
e,
|
|
2709
2726
|
a,
|
|
2710
2727
|
l,
|
|
2711
|
-
n,
|
|
2712
|
-
i,
|
|
2713
2728
|
r,
|
|
2729
|
+
i,
|
|
2730
|
+
n,
|
|
2714
2731
|
o
|
|
2715
2732
|
);
|
|
2716
2733
|
return super.add(d), d.updateInView(), e !== void 0 && e.ports.push(d), d;
|
|
@@ -2742,17 +2759,17 @@ class We {
|
|
|
2742
2759
|
if (t.nodes.add(l), l.width = e.width, l.height = e.height, e.label) {
|
|
2743
2760
|
if (a.decorators)
|
|
2744
2761
|
for (let i = 0; i < a.decorators.length; ++i) {
|
|
2745
|
-
const
|
|
2762
|
+
const n = a.decorators[i];
|
|
2746
2763
|
t.decorators.new(
|
|
2747
2764
|
l,
|
|
2748
2765
|
[
|
|
2749
|
-
l.coords[0] +
|
|
2750
|
-
l.coords[1] +
|
|
2766
|
+
l.coords[0] + n.coords[0],
|
|
2767
|
+
l.coords[1] + n.coords[1]
|
|
2751
2768
|
],
|
|
2752
|
-
|
|
2753
|
-
|
|
2769
|
+
n.width,
|
|
2770
|
+
n.height,
|
|
2754
2771
|
l.getPriority(),
|
|
2755
|
-
|
|
2772
|
+
n.html,
|
|
2756
2773
|
`${l.id}_decorator_${i}`
|
|
2757
2774
|
);
|
|
2758
2775
|
}
|
|
@@ -2760,7 +2777,7 @@ class We {
|
|
|
2760
2777
|
const i = {
|
|
2761
2778
|
...V,
|
|
2762
2779
|
...a.label
|
|
2763
|
-
},
|
|
2780
|
+
}, n = new ht(
|
|
2764
2781
|
t,
|
|
2765
2782
|
l,
|
|
2766
2783
|
[
|
|
@@ -2781,15 +2798,15 @@ class We {
|
|
|
2781
2798
|
i.fit,
|
|
2782
2799
|
i.shrink
|
|
2783
2800
|
);
|
|
2784
|
-
|
|
2801
|
+
n.text = e.label, l.label = n, t.fields.add(n), n.updateInView();
|
|
2785
2802
|
}
|
|
2786
2803
|
}
|
|
2787
2804
|
for (const i of e.children || []) {
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2805
|
+
const n = this.importNode(t, i);
|
|
2806
|
+
n !== void 0 && (l.children?.push(n), n.parent = l);
|
|
2790
2807
|
}
|
|
2791
2808
|
for (const i of e.sections || []) {
|
|
2792
|
-
const
|
|
2809
|
+
const n = new D(
|
|
2793
2810
|
t,
|
|
2794
2811
|
l,
|
|
2795
2812
|
i.indexXInNode,
|
|
@@ -2799,19 +2816,19 @@ class We {
|
|
|
2799
2816
|
i.height,
|
|
2800
2817
|
i.id
|
|
2801
2818
|
);
|
|
2802
|
-
if (l.sections?.push(
|
|
2819
|
+
if (l.sections?.push(n), t.sections.add(n), i.label && a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
|
|
2803
2820
|
const d = {
|
|
2804
2821
|
...V,
|
|
2805
2822
|
...a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label
|
|
2806
2823
|
}, c = new ht(
|
|
2807
2824
|
t,
|
|
2808
|
-
|
|
2825
|
+
n,
|
|
2809
2826
|
[
|
|
2810
|
-
|
|
2811
|
-
|
|
2827
|
+
n.coords[0] + B(d),
|
|
2828
|
+
n.coords[1] + F(d)
|
|
2812
2829
|
],
|
|
2813
|
-
|
|
2814
|
-
|
|
2830
|
+
n.width - B(d) - ot(d),
|
|
2831
|
+
n.height - F(d) - K(d),
|
|
2815
2832
|
d.fontSize,
|
|
2816
2833
|
d.fontFamily,
|
|
2817
2834
|
d.color,
|
|
@@ -2824,20 +2841,20 @@ class We {
|
|
|
2824
2841
|
d.fit,
|
|
2825
2842
|
d.shrink
|
|
2826
2843
|
);
|
|
2827
|
-
c.text = i.label,
|
|
2844
|
+
c.text = i.label, n.label = c, t.fields.add(c), c.updateInView();
|
|
2828
2845
|
}
|
|
2829
2846
|
let o = 0;
|
|
2830
2847
|
for (const d of i.ports || []) {
|
|
2831
2848
|
const c = d.type !== void 0 ? t.ports.types.get(d.type) : void 0, h = new bt(
|
|
2832
2849
|
t,
|
|
2833
2850
|
c,
|
|
2834
|
-
|
|
2851
|
+
n,
|
|
2835
2852
|
d.coords,
|
|
2836
2853
|
d.connectionPoint || d.coords,
|
|
2837
2854
|
d.direction,
|
|
2838
2855
|
d.id
|
|
2839
2856
|
);
|
|
2840
|
-
if (
|
|
2857
|
+
if (n.ports.push(h), t.ports.add(h), d.label) {
|
|
2841
2858
|
if (a.ports.length > o && c?.label) {
|
|
2842
2859
|
const f = {
|
|
2843
2860
|
...V,
|
|
@@ -2891,16 +2908,16 @@ class We {
|
|
|
2891
2908
|
}
|
|
2892
2909
|
d.collabMeta && (h.selfRemoved = d.collabMeta.selfRemoved, h.selfRemovedTimestamp = d.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(h.label, d.collabMeta.label)), h.updateInView();
|
|
2893
2910
|
}
|
|
2894
|
-
i.collabMeta && (
|
|
2895
|
-
|
|
2911
|
+
i.collabMeta && (n.selfRemoved = i.collabMeta.selfRemoved, n.selfRemovedTimestamp = i.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(
|
|
2912
|
+
n.label,
|
|
2896
2913
|
i.collabMeta.label
|
|
2897
|
-
)),
|
|
2914
|
+
)), n.updateInView();
|
|
2898
2915
|
}
|
|
2899
|
-
let
|
|
2916
|
+
let r = 0;
|
|
2900
2917
|
for (const i of e.ports || []) {
|
|
2901
|
-
const
|
|
2918
|
+
const n = i.type !== void 0 ? t.ports.types.get(i.type) : void 0, o = new bt(
|
|
2902
2919
|
t,
|
|
2903
|
-
|
|
2920
|
+
n,
|
|
2904
2921
|
l,
|
|
2905
2922
|
i.coords,
|
|
2906
2923
|
i.connectionPoint || i.coords,
|
|
@@ -2908,10 +2925,10 @@ class We {
|
|
|
2908
2925
|
i.id
|
|
2909
2926
|
);
|
|
2910
2927
|
if (l.ports.push(o), t.ports.add(o), i.label) {
|
|
2911
|
-
if (a.ports.length >
|
|
2928
|
+
if (a.ports.length > r && n?.label) {
|
|
2912
2929
|
const d = {
|
|
2913
2930
|
...V,
|
|
2914
|
-
...
|
|
2931
|
+
...n?.label
|
|
2915
2932
|
};
|
|
2916
2933
|
let c;
|
|
2917
2934
|
switch (o.direction) {
|
|
@@ -2957,7 +2974,7 @@ class We {
|
|
|
2957
2974
|
);
|
|
2958
2975
|
h.text = i.label, o.label = h, t.fields.add(h), h.updateInView();
|
|
2959
2976
|
}
|
|
2960
|
-
++
|
|
2977
|
+
++r;
|
|
2961
2978
|
}
|
|
2962
2979
|
i.collabMeta && (o.selfRemoved = i.collabMeta.selfRemoved, o.selfRemovedTimestamp = i.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(o.label, i.collabMeta.label)), o.updateInView();
|
|
2963
2980
|
}
|
|
@@ -2983,9 +3000,9 @@ class We {
|
|
|
2983
3000
|
t && e && (t.selfRemoved = e.selfRemoved, t.selfRemovedTimestamp = e.selfRemovedTimestamp, t.textTimestamp = e.textTimestamp);
|
|
2984
3001
|
}
|
|
2985
3002
|
}
|
|
2986
|
-
class
|
|
2987
|
-
constructor(t, e, a, l,
|
|
2988
|
-
this.canvas = t, this.id = e, this.typeId = a, this.coords = l, this.parentId =
|
|
3003
|
+
class oe {
|
|
3004
|
+
constructor(t, e, a, l, r, i, n) {
|
|
3005
|
+
this.canvas = t, this.id = e, this.typeId = a, this.coords = l, this.parentId = r, this.label = i, this.values = n;
|
|
2989
3006
|
}
|
|
2990
3007
|
do() {
|
|
2991
3008
|
const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
|
|
@@ -3008,7 +3025,7 @@ class ee {
|
|
|
3008
3025
|
};
|
|
3009
3026
|
}
|
|
3010
3027
|
static deserialize(t, e) {
|
|
3011
|
-
return new
|
|
3028
|
+
return new oe(
|
|
3012
3029
|
t,
|
|
3013
3030
|
e.id,
|
|
3014
3031
|
e.typeId,
|
|
@@ -3020,8 +3037,8 @@ class ee {
|
|
|
3020
3037
|
}
|
|
3021
3038
|
}
|
|
3022
3039
|
class ke {
|
|
3023
|
-
constructor(t, e, a, l,
|
|
3024
|
-
this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex =
|
|
3040
|
+
constructor(t, e, a, l, r, i, n) {
|
|
3041
|
+
this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex = r, this.removeRowIndex = i, this.timestamp = n;
|
|
3025
3042
|
}
|
|
3026
3043
|
do() {
|
|
3027
3044
|
const t = this.canvas.model.nodes.get(this.nodeId);
|
|
@@ -3142,8 +3159,8 @@ class it {
|
|
|
3142
3159
|
}
|
|
3143
3160
|
}
|
|
3144
3161
|
class Ft {
|
|
3145
|
-
constructor(t, e, a, l,
|
|
3146
|
-
this.canvas = t, this.childId = e, this.parentId = a, this.childGeometry = l, this.timestamp =
|
|
3162
|
+
constructor(t, e, a, l, r) {
|
|
3163
|
+
this.canvas = t, this.childId = e, this.parentId = a, this.childGeometry = l, this.timestamp = r;
|
|
3147
3164
|
}
|
|
3148
3165
|
do() {
|
|
3149
3166
|
const t = this.canvas.model.nodes.get(this.childId, !0), e = this.parentId !== void 0 ? this.canvas.model.nodes.get(this.parentId, !0) : void 0;
|
|
@@ -3168,9 +3185,9 @@ class Ft {
|
|
|
3168
3185
|
);
|
|
3169
3186
|
}
|
|
3170
3187
|
}
|
|
3171
|
-
class
|
|
3172
|
-
constructor(t, e, a, l,
|
|
3173
|
-
this.canvas = t, this.id = e, this.typeId = a, this.startId = l, this.endId =
|
|
3188
|
+
class ie {
|
|
3189
|
+
constructor(t, e, a, l, r) {
|
|
3190
|
+
this.canvas = t, this.id = e, this.typeId = a, this.startId = l, this.endId = r;
|
|
3174
3191
|
}
|
|
3175
3192
|
do() {
|
|
3176
3193
|
const t = this.canvas.model.ports.get(this.startId, !0), e = this.canvas.model.ports.get(this.endId, !0);
|
|
@@ -3186,7 +3203,7 @@ class oe {
|
|
|
3186
3203
|
};
|
|
3187
3204
|
}
|
|
3188
3205
|
static deserialize(t, e) {
|
|
3189
|
-
return new
|
|
3206
|
+
return new ie(
|
|
3190
3207
|
t,
|
|
3191
3208
|
e.id,
|
|
3192
3209
|
e.typeId,
|
|
@@ -3248,8 +3265,8 @@ class Mt {
|
|
|
3248
3265
|
}
|
|
3249
3266
|
}
|
|
3250
3267
|
class at {
|
|
3251
|
-
constructor(t, e, a, l,
|
|
3252
|
-
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds =
|
|
3268
|
+
constructor(t, e, a, l, r, i, n, o) {
|
|
3269
|
+
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i, this.selfRemoved = n, this.timestamp = o;
|
|
3253
3270
|
}
|
|
3254
3271
|
doOne(t) {
|
|
3255
3272
|
t && kt(this.timestamp, t.selfRemovedTimestamp) && (t.selfRemoved = this.selfRemoved, t.selfRemovedTimestamp = this.timestamp);
|
|
@@ -3292,7 +3309,7 @@ class at {
|
|
|
3292
3309
|
);
|
|
3293
3310
|
}
|
|
3294
3311
|
}
|
|
3295
|
-
class
|
|
3312
|
+
class se {
|
|
3296
3313
|
constructor(t, e, a) {
|
|
3297
3314
|
this.canvas = t, this.nodes = e, this.connections = a;
|
|
3298
3315
|
}
|
|
@@ -3319,14 +3336,14 @@ class ie {
|
|
|
3319
3336
|
};
|
|
3320
3337
|
}
|
|
3321
3338
|
static deserialize(t, e) {
|
|
3322
|
-
return new
|
|
3339
|
+
return new se(
|
|
3323
3340
|
t,
|
|
3324
3341
|
e.nodes,
|
|
3325
3342
|
e.connections
|
|
3326
3343
|
);
|
|
3327
3344
|
}
|
|
3328
3345
|
}
|
|
3329
|
-
class
|
|
3346
|
+
class Yo {
|
|
3330
3347
|
constructor(t) {
|
|
3331
3348
|
this.isInRoom = !1, this.canvas = t, this.replicaId = Le();
|
|
3332
3349
|
}
|
|
@@ -3363,7 +3380,7 @@ class Bo {
|
|
|
3363
3380
|
t.timestamp[0]
|
|
3364
3381
|
)), t.type) {
|
|
3365
3382
|
case "addNode": {
|
|
3366
|
-
|
|
3383
|
+
oe.deserialize(this.canvas, t).do();
|
|
3367
3384
|
break;
|
|
3368
3385
|
}
|
|
3369
3386
|
case "addSection": {
|
|
@@ -3393,7 +3410,7 @@ class Bo {
|
|
|
3393
3410
|
break;
|
|
3394
3411
|
}
|
|
3395
3412
|
case "addConnection": {
|
|
3396
|
-
|
|
3413
|
+
ie.deserialize(
|
|
3397
3414
|
this.canvas,
|
|
3398
3415
|
t
|
|
3399
3416
|
).do();
|
|
@@ -3418,7 +3435,7 @@ class Bo {
|
|
|
3418
3435
|
break;
|
|
3419
3436
|
}
|
|
3420
3437
|
case "paste": {
|
|
3421
|
-
|
|
3438
|
+
se.deserialize(this.canvas, t).do();
|
|
3422
3439
|
break;
|
|
3423
3440
|
}
|
|
3424
3441
|
default:
|
|
@@ -3429,7 +3446,7 @@ class Bo {
|
|
|
3429
3446
|
}
|
|
3430
3447
|
}
|
|
3431
3448
|
}
|
|
3432
|
-
class
|
|
3449
|
+
class Xo {
|
|
3433
3450
|
constructor(t, e) {
|
|
3434
3451
|
this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
|
|
3435
3452
|
}
|
|
@@ -3482,12 +3499,12 @@ class Yo {
|
|
|
3482
3499
|
}
|
|
3483
3500
|
}
|
|
3484
3501
|
var w = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(w || {});
|
|
3485
|
-
class
|
|
3486
|
-
constructor(t, e, a, l,
|
|
3487
|
-
this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId =
|
|
3502
|
+
class jo {
|
|
3503
|
+
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3504
|
+
this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = r, this.fromAncestorGeometry = i, this.toAncestorGeometry = n, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
|
|
3488
3505
|
}
|
|
3489
3506
|
do() {
|
|
3490
|
-
const t = new
|
|
3507
|
+
const t = new oe(
|
|
3491
3508
|
this.canvas,
|
|
3492
3509
|
this.id,
|
|
3493
3510
|
this.type.id,
|
|
@@ -3579,8 +3596,8 @@ class ae {
|
|
|
3579
3596
|
}
|
|
3580
3597
|
}
|
|
3581
3598
|
class X {
|
|
3582
|
-
constructor(t, e, a, l,
|
|
3583
|
-
this.canvas = t, this.intent = e, this.nodeId = a, this.from = l, this.to =
|
|
3599
|
+
constructor(t, e, a, l, r, i, n, o) {
|
|
3600
|
+
this.canvas = t, this.intent = e, this.nodeId = a, this.from = l, this.to = r, this.ancestorId = i, this.fromAncestorGeometry = n, this.toAncestorGeometry = o;
|
|
3584
3601
|
}
|
|
3585
3602
|
do() {
|
|
3586
3603
|
const t = this.canvas.model.nodes.get(this.nodeId);
|
|
@@ -3640,9 +3657,9 @@ class X {
|
|
|
3640
3657
|
return t !== void 0;
|
|
3641
3658
|
}
|
|
3642
3659
|
}
|
|
3643
|
-
class
|
|
3644
|
-
constructor(t, e, a, l,
|
|
3645
|
-
this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry =
|
|
3660
|
+
class Wo {
|
|
3661
|
+
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3662
|
+
this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry = r, this.toChildGeometry = i, this.ancestorId = n, this.fromAncestorGeometry = o, this.toAncestorGeometry = d;
|
|
3646
3663
|
}
|
|
3647
3664
|
do() {
|
|
3648
3665
|
const t = this.canvas.model.nodes.get(this.childId), e = new Ft(
|
|
@@ -3691,7 +3708,7 @@ class le {
|
|
|
3691
3708
|
this.canvas = t, this.type = e, this.startId = a, this.endId = l, this.id = this.canvas.collabEngine.freshId();
|
|
3692
3709
|
}
|
|
3693
3710
|
do() {
|
|
3694
|
-
const t = new
|
|
3711
|
+
const t = new ie(
|
|
3695
3712
|
this.canvas,
|
|
3696
3713
|
this.id,
|
|
3697
3714
|
this.type.id,
|
|
@@ -3769,7 +3786,7 @@ class Ne {
|
|
|
3769
3786
|
return t !== void 0;
|
|
3770
3787
|
}
|
|
3771
3788
|
}
|
|
3772
|
-
class
|
|
3789
|
+
class Zo {
|
|
3773
3790
|
constructor(t, e, a, l) {
|
|
3774
3791
|
this.canvas = t, this.id = e, this.from = a, this.to = l;
|
|
3775
3792
|
}
|
|
@@ -3809,9 +3826,9 @@ class Wo {
|
|
|
3809
3826
|
return !e.rootElement.removed;
|
|
3810
3827
|
}
|
|
3811
3828
|
}
|
|
3812
|
-
class
|
|
3813
|
-
constructor(t, e, a, l,
|
|
3814
|
-
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds =
|
|
3829
|
+
class Ko {
|
|
3830
|
+
constructor(t, e, a, l, r, i) {
|
|
3831
|
+
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i;
|
|
3815
3832
|
}
|
|
3816
3833
|
do() {
|
|
3817
3834
|
const t = this.nodeIds.map((a) => this.canvas.model.nodes.get(a) !== void 0).includes(!0) || this.sectionIds.map(
|
|
@@ -3851,30 +3868,30 @@ class Zo {
|
|
|
3851
3868
|
return this.do();
|
|
3852
3869
|
}
|
|
3853
3870
|
}
|
|
3854
|
-
class
|
|
3871
|
+
class qo {
|
|
3855
3872
|
constructor(t, e, a, l) {
|
|
3856
3873
|
this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
|
|
3857
3874
|
}
|
|
3858
3875
|
do() {
|
|
3859
3876
|
const t = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
|
|
3860
|
-
for (const
|
|
3861
|
-
|
|
3877
|
+
for (const r of this.nodes)
|
|
3878
|
+
r.coords[0] < t[0] && (t[0] = r.coords[0]), r.coords[1] < t[1] && (t[1] = r.coords[1]);
|
|
3862
3879
|
const e = this.coords !== void 0 ? [this.coords[0] - t[0], this.coords[1] - t[1]] : void 0, a = {};
|
|
3863
|
-
for (const
|
|
3864
|
-
const i =
|
|
3865
|
-
if (a[i] =
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
]),
|
|
3869
|
-
for (const o of
|
|
3880
|
+
for (const r of this.nodes) {
|
|
3881
|
+
const i = r.id, n = this.canvas.collabEngine.freshId();
|
|
3882
|
+
if (a[i] = n, r.id = n, e && (r.coords = [
|
|
3883
|
+
r.coords[0] + e[0],
|
|
3884
|
+
r.coords[1] + e[1]
|
|
3885
|
+
]), r.sections)
|
|
3886
|
+
for (const o of r.sections) {
|
|
3870
3887
|
const d = o.id;
|
|
3871
|
-
if (o.id.includes(
|
|
3888
|
+
if (o.id.includes(r.id) ? o.id = o.id.replace(r.id, n) : o.id = this.canvas.collabEngine.freshId(), a[d] = o.id, e && (o.coords = [
|
|
3872
3889
|
o.coords[0] + e[0],
|
|
3873
3890
|
o.coords[1] + e[1]
|
|
3874
3891
|
]), o.ports)
|
|
3875
3892
|
for (const c of o.ports) {
|
|
3876
3893
|
const h = c.id;
|
|
3877
|
-
c.id.includes(
|
|
3894
|
+
c.id.includes(r.id) ? c.id = c.id.replace(r.id, n) : c.id = this.canvas.collabEngine.freshId(), a[h] = c.id, e && (c.coords = [
|
|
3878
3895
|
c.coords[0] + e[0],
|
|
3879
3896
|
c.coords[1] + e[1]
|
|
3880
3897
|
], c.connectionPoint && (c.connectionPoint = [
|
|
@@ -3883,10 +3900,10 @@ class Ko {
|
|
|
3883
3900
|
]));
|
|
3884
3901
|
}
|
|
3885
3902
|
}
|
|
3886
|
-
if (
|
|
3887
|
-
for (const o of
|
|
3903
|
+
if (r.ports)
|
|
3904
|
+
for (const o of r.ports) {
|
|
3888
3905
|
const d = o.id;
|
|
3889
|
-
o.id.includes(
|
|
3906
|
+
o.id.includes(r.id) ? o.id = o.id.replace(r.id, n) : o.id = this.canvas.collabEngine.freshId(), a[d] = o.id, e && (o.coords = [
|
|
3890
3907
|
o.coords[0] + e[0],
|
|
3891
3908
|
o.coords[1] + e[1]
|
|
3892
3909
|
], o.connectionPoint && (o.connectionPoint = [
|
|
@@ -3895,16 +3912,16 @@ class Ko {
|
|
|
3895
3912
|
]));
|
|
3896
3913
|
}
|
|
3897
3914
|
}
|
|
3898
|
-
for (const
|
|
3915
|
+
for (const r of this.connections) {
|
|
3899
3916
|
const i = this.canvas.collabEngine.freshId();
|
|
3900
|
-
if (a[
|
|
3901
|
-
for (let
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3917
|
+
if (a[r.id] = i, r.id = i, r.start = a[r.start] || r.start, r.end = a[r.end] || r.end, e)
|
|
3918
|
+
for (let n = 0; n < r.points.length; ++n)
|
|
3919
|
+
r.points[n] = [
|
|
3920
|
+
r.points[n][0] + e[0],
|
|
3921
|
+
r.points[n][1] + e[1]
|
|
3905
3922
|
];
|
|
3906
3923
|
}
|
|
3907
|
-
const l = new
|
|
3924
|
+
const l = new se(
|
|
3908
3925
|
this.canvas,
|
|
3909
3926
|
this.nodes,
|
|
3910
3927
|
this.connections
|
|
@@ -3942,7 +3959,7 @@ class Ko {
|
|
|
3942
3959
|
return this.canvas.collabEngine.doCollaboratively(e), t;
|
|
3943
3960
|
}
|
|
3944
3961
|
}
|
|
3945
|
-
class
|
|
3962
|
+
class Dt {
|
|
3946
3963
|
constructor(t) {
|
|
3947
3964
|
this.type = t, this.defaultPrevented = !1;
|
|
3948
3965
|
}
|
|
@@ -3950,8 +3967,21 @@ class se {
|
|
|
3950
3967
|
this.defaultPrevented = !0;
|
|
3951
3968
|
}
|
|
3952
3969
|
}
|
|
3953
|
-
var Ze = /* @__PURE__ */ ((s) => (s[s.
|
|
3954
|
-
class
|
|
3970
|
+
var Ze = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s))(Ze || {});
|
|
3971
|
+
class Jo extends Dt {
|
|
3972
|
+
/**
|
|
3973
|
+
* Create a diagram zoom event.
|
|
3974
|
+
*
|
|
3975
|
+
* @param coords .
|
|
3976
|
+
*/
|
|
3977
|
+
constructor(t, e) {
|
|
3978
|
+
super(
|
|
3979
|
+
0
|
|
3980
|
+
/* Zoom */
|
|
3981
|
+
), this.coords = t, this.zoom = e;
|
|
3982
|
+
}
|
|
3983
|
+
}
|
|
3984
|
+
class pt extends Dt {
|
|
3955
3985
|
/**
|
|
3956
3986
|
* Create a diagram double click event.
|
|
3957
3987
|
*
|
|
@@ -3961,12 +3991,12 @@ class pt extends se {
|
|
|
3961
3991
|
*/
|
|
3962
3992
|
constructor(t, e, a) {
|
|
3963
3993
|
super(
|
|
3964
|
-
|
|
3994
|
+
1
|
|
3965
3995
|
/* DoubleClick */
|
|
3966
3996
|
), this.cause = t, this.target = e, this.coords = a;
|
|
3967
3997
|
}
|
|
3968
3998
|
}
|
|
3969
|
-
class mt extends
|
|
3999
|
+
class mt extends Dt {
|
|
3970
4000
|
/**
|
|
3971
4001
|
* Create a diagram secondary click event.
|
|
3972
4002
|
*
|
|
@@ -3976,12 +4006,12 @@ class mt extends se {
|
|
|
3976
4006
|
*/
|
|
3977
4007
|
constructor(t, e, a) {
|
|
3978
4008
|
super(
|
|
3979
|
-
|
|
4009
|
+
2
|
|
3980
4010
|
/* SecondaryClick */
|
|
3981
4011
|
), this.cause = t, this.target = e, this.coords = a;
|
|
3982
4012
|
}
|
|
3983
4013
|
}
|
|
3984
|
-
class G extends
|
|
4014
|
+
class G extends Dt {
|
|
3985
4015
|
/**
|
|
3986
4016
|
* Create a diagram selection event.
|
|
3987
4017
|
*
|
|
@@ -3990,12 +4020,12 @@ class G extends se {
|
|
|
3990
4020
|
*/
|
|
3991
4021
|
constructor(t, e) {
|
|
3992
4022
|
super(
|
|
3993
|
-
|
|
4023
|
+
3
|
|
3994
4024
|
/* Selection */
|
|
3995
4025
|
), this.targets = t, this.selected = e;
|
|
3996
4026
|
}
|
|
3997
4027
|
}
|
|
3998
|
-
class Q extends
|
|
4028
|
+
class Q extends Dt {
|
|
3999
4029
|
/**
|
|
4000
4030
|
* Create a diagram highlight event.
|
|
4001
4031
|
*
|
|
@@ -4003,18 +4033,18 @@ class Q extends se {
|
|
|
4003
4033
|
*/
|
|
4004
4034
|
constructor(t) {
|
|
4005
4035
|
super(
|
|
4006
|
-
|
|
4036
|
+
4
|
|
4007
4037
|
/* Highlight */
|
|
4008
4038
|
), this.target = t;
|
|
4009
4039
|
}
|
|
4010
4040
|
}
|
|
4011
4041
|
class Ke extends It {
|
|
4012
|
-
constructor(t, e, a, l,
|
|
4042
|
+
constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
|
|
4013
4043
|
if (t.objects.get(o) !== void 0)
|
|
4014
4044
|
throw new Error(`DiagramDecorator with id "${o}" already exists`);
|
|
4015
4045
|
if (!o)
|
|
4016
4046
|
throw new Error("DiagramDecorator cannot have an empty or null id");
|
|
4017
|
-
super(t, o), this.rootElement = e, this.coords = a, this.width = l, this.height =
|
|
4047
|
+
super(t, o), this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.priority = i, this.html = n, this.anchorPointX = d, this.anchorPointY = c;
|
|
4018
4048
|
}
|
|
4019
4049
|
get removed() {
|
|
4020
4050
|
return this.selfRemoved || this.rootElement !== void 0 && this.rootElement.removed;
|
|
@@ -4037,7 +4067,7 @@ class Ke extends It {
|
|
|
4037
4067
|
return this.priority;
|
|
4038
4068
|
}
|
|
4039
4069
|
}
|
|
4040
|
-
class
|
|
4070
|
+
class Qo extends ft {
|
|
4041
4071
|
/**
|
|
4042
4072
|
* Instance a set of decorators for the given model. This method is used internally.
|
|
4043
4073
|
* @private
|
|
@@ -4056,16 +4086,16 @@ class qo extends ft {
|
|
|
4056
4086
|
* @param id The id of the decorator. Cannot be an empty string.
|
|
4057
4087
|
* @returns The instanced decorator.
|
|
4058
4088
|
*/
|
|
4059
|
-
new(t, e, a, l,
|
|
4089
|
+
new(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
4060
4090
|
const c = new Ke(
|
|
4061
4091
|
this.model,
|
|
4062
4092
|
t,
|
|
4063
4093
|
e,
|
|
4064
4094
|
a,
|
|
4065
4095
|
l,
|
|
4066
|
-
n,
|
|
4067
|
-
i,
|
|
4068
4096
|
r,
|
|
4097
|
+
i,
|
|
4098
|
+
n,
|
|
4069
4099
|
o,
|
|
4070
4100
|
d
|
|
4071
4101
|
);
|
|
@@ -4076,13 +4106,13 @@ class qo extends ft {
|
|
|
4076
4106
|
e && ((e.rootElement instanceof z || e.rootElement instanceof D) && Y(e.rootElement.decorators, e), super.remove(t), e.updateInView());
|
|
4077
4107
|
}
|
|
4078
4108
|
}
|
|
4079
|
-
class
|
|
4080
|
-
constructor(t, e, a, l,
|
|
4081
|
-
if (t.objects.get(
|
|
4082
|
-
throw new Error(`DiagramObject with id "${
|
|
4083
|
-
if (!
|
|
4109
|
+
class ti extends It {
|
|
4110
|
+
constructor(t, e, a, l, r, i, n) {
|
|
4111
|
+
if (t.objects.get(n) !== void 0)
|
|
4112
|
+
throw new Error(`DiagramObject with id "${n}" already exists`);
|
|
4113
|
+
if (!n)
|
|
4084
4114
|
throw new Error("DiagramObject cannot have an empty or null id");
|
|
4085
|
-
super(t,
|
|
4115
|
+
super(t, n), this.coords = e, this.width = a, this.height = l, this.priority = r, this.html = i;
|
|
4086
4116
|
}
|
|
4087
4117
|
get removed() {
|
|
4088
4118
|
return this.selfRemoved;
|
|
@@ -4105,7 +4135,7 @@ class Jo extends It {
|
|
|
4105
4135
|
return this.priority;
|
|
4106
4136
|
}
|
|
4107
4137
|
}
|
|
4108
|
-
class
|
|
4138
|
+
class ei extends ft {
|
|
4109
4139
|
/**
|
|
4110
4140
|
* Instance a set of objects for the given model. This method is used internally.
|
|
4111
4141
|
* @private
|
|
@@ -4124,17 +4154,17 @@ class Qo extends ft {
|
|
|
4124
4154
|
* @param id The id of the object. Cannot be an empty string.
|
|
4125
4155
|
* @returns The instanced object.
|
|
4126
4156
|
*/
|
|
4127
|
-
new(t, e, a, l,
|
|
4128
|
-
const
|
|
4157
|
+
new(t, e, a, l, r, i) {
|
|
4158
|
+
const n = new ti(
|
|
4129
4159
|
this.model,
|
|
4130
4160
|
t,
|
|
4131
4161
|
e,
|
|
4132
4162
|
a,
|
|
4133
4163
|
l,
|
|
4134
|
-
|
|
4164
|
+
r,
|
|
4135
4165
|
i
|
|
4136
4166
|
);
|
|
4137
|
-
return super.add(
|
|
4167
|
+
return super.add(n), n.updateInView(), n;
|
|
4138
4168
|
}
|
|
4139
4169
|
remove(t) {
|
|
4140
4170
|
const e = this.get(t, !0);
|
|
@@ -4142,8 +4172,8 @@ class Qo extends ft {
|
|
|
4142
4172
|
}
|
|
4143
4173
|
}
|
|
4144
4174
|
class qe {
|
|
4145
|
-
constructor(t, e, a, l,
|
|
4146
|
-
this.nodes = new
|
|
4175
|
+
constructor(t, e, a, l, r, i = []) {
|
|
4176
|
+
this.nodes = new Ho(this), this.sections = new Oo(this), this.ports = new Bo(this), this.connections = new To(this), this.fields = new No(this), this.objects = new ei(this), this.decorators = new Qo(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new ee(i), this);
|
|
4147
4177
|
}
|
|
4148
4178
|
/**
|
|
4149
4179
|
* Deletes everything in this diagram.
|
|
@@ -4153,7 +4183,7 @@ class qe {
|
|
|
4153
4183
|
this.canvas?.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), this.canvas?.updateModelInView();
|
|
4154
4184
|
}
|
|
4155
4185
|
}
|
|
4156
|
-
const vt = (s) => !!s.button, de = (s, t, e, a, l,
|
|
4186
|
+
const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
|
|
4157
4187
|
s,
|
|
4158
4188
|
[t, e],
|
|
4159
4189
|
a,
|
|
@@ -4162,8 +4192,8 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, n, i, r) => uo(
|
|
|
4162
4192
|
// reasonable value for the minimumDistanceBeforeTurn relative to the line width
|
|
4163
4193
|
10,
|
|
4164
4194
|
i || 0,
|
|
4165
|
-
|
|
4166
|
-
) *
|
|
4195
|
+
n || 0
|
|
4196
|
+
) * r
|
|
4167
4197
|
), S = (s) => {
|
|
4168
4198
|
s ? x.select("body").style("cursor", s) : x.select("body").style("cursor", L.Auto);
|
|
4169
4199
|
}, ct = (s) => s instanceof z ? s : s instanceof D ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof D || s.rootElement instanceof bt ? ct(s.rootElement) : s, ce = (s) => {
|
|
@@ -4241,7 +4271,7 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, n, i, r) => uo(
|
|
|
4241
4271
|
snap: !1,
|
|
4242
4272
|
spacing: 10,
|
|
4243
4273
|
thickness: 0.05
|
|
4244
|
-
},
|
|
4274
|
+
}, oi = (s, t, e) => {
|
|
4245
4275
|
const a = t.append("defs");
|
|
4246
4276
|
if (s.gridSize > 0 && isFinite(s.gridSize)) {
|
|
4247
4277
|
const l = a.append("pattern").attr("id", e).attr("x", -s.gridSize / 2).attr("y", -s.gridSize / 2).attr("width", s.gridSize).attr("height", s.gridSize).attr("patternUnits", "userSpaceOnUse");
|
|
@@ -4261,10 +4291,10 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, n, i, r) => uo(
|
|
|
4261
4291
|
}
|
|
4262
4292
|
t.select("rect").attr("fill", `url(#${e})`);
|
|
4263
4293
|
}
|
|
4264
|
-
}, ve = 96, j = 32, xt = ve + j,
|
|
4294
|
+
}, ve = 96, j = 32, xt = ve + j, ii = Math.PI / 4, si = 100, Pe = {
|
|
4265
4295
|
customButtons: []
|
|
4266
4296
|
};
|
|
4267
|
-
class
|
|
4297
|
+
class ni {
|
|
4268
4298
|
/**
|
|
4269
4299
|
* Constructs a context menu object.
|
|
4270
4300
|
* @public
|
|
@@ -4286,20 +4316,20 @@ class ii {
|
|
|
4286
4316
|
i.preventDefault(), this.close();
|
|
4287
4317
|
});
|
|
4288
4318
|
this.contextMenuContainer = l;
|
|
4289
|
-
const
|
|
4290
|
-
this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && this.canvas.canUserPerformAction(w.Remove) &&
|
|
4319
|
+
const r = [];
|
|
4320
|
+
this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && this.canvas.canUserPerformAction(w.Remove) && r.push({
|
|
4291
4321
|
name: "CUT",
|
|
4292
4322
|
imageClass: "daga-cut",
|
|
4293
4323
|
onPress: (i) => {
|
|
4294
4324
|
i.userSelection.cutToClipboard(), i.cancelAllUserActions();
|
|
4295
4325
|
}
|
|
4296
|
-
}), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) &&
|
|
4326
|
+
}), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && r.push({
|
|
4297
4327
|
name: "COPY",
|
|
4298
4328
|
imageClass: "daga-copy",
|
|
4299
4329
|
onPress: (i) => {
|
|
4300
4330
|
i.userSelection.copyToClipboard(), i.cancelAllUserActions();
|
|
4301
4331
|
}
|
|
4302
|
-
}), this.canvas.canUserPerformAction(w.Paste) &&
|
|
4332
|
+
}), this.canvas.canUserPerformAction(w.Paste) && r.push({
|
|
4303
4333
|
name: "PASTE",
|
|
4304
4334
|
imageClass: "daga-paste",
|
|
4305
4335
|
onPress: (i) => {
|
|
@@ -4307,7 +4337,7 @@ class ii {
|
|
|
4307
4337
|
i.getClosestGridPoint(a)
|
|
4308
4338
|
), i.cancelAllUserActions();
|
|
4309
4339
|
}
|
|
4310
|
-
}), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Remove) &&
|
|
4340
|
+
}), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Remove) && r.push({
|
|
4311
4341
|
name: "DELETE",
|
|
4312
4342
|
imageClass: "daga-delete",
|
|
4313
4343
|
onPress: (i) => {
|
|
@@ -4315,22 +4345,22 @@ class ii {
|
|
|
4315
4345
|
}
|
|
4316
4346
|
});
|
|
4317
4347
|
for (const i of this.config.customButtons || Pe.customButtons)
|
|
4318
|
-
(i.condition === void 0 || i.condition(this.canvas)) &&
|
|
4319
|
-
|
|
4348
|
+
(i.condition === void 0 || i.condition(this.canvas)) && r.push(i);
|
|
4349
|
+
r.length === 0 && r.push({
|
|
4320
4350
|
name: "NONE",
|
|
4321
4351
|
imageClass: "daga-cross",
|
|
4322
4352
|
onPress: void 0
|
|
4323
4353
|
});
|
|
4324
|
-
for (let i = 0; i <
|
|
4325
|
-
const
|
|
4354
|
+
for (let i = 0; i < r.length; ++i) {
|
|
4355
|
+
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ii, c = l.append("xhtml:div").attr(
|
|
4326
4356
|
"class",
|
|
4327
|
-
`daga-context-menu-button ${
|
|
4357
|
+
`daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
|
|
4328
4358
|
).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * j}px`).style("height", `${2 * j}px`).style("border-radius", `${j}px`).style("pointer-events", "auto").on($.Click, (h) => {
|
|
4329
4359
|
o && (h.preventDefault(), o(this.canvas));
|
|
4330
4360
|
}).on($.KeyDown, (h) => {
|
|
4331
4361
|
o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
|
|
4332
4362
|
});
|
|
4333
|
-
|
|
4363
|
+
n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(x.easeLinear).duration(si).tween("progress", () => (h) => {
|
|
4334
4364
|
const f = d * h;
|
|
4335
4365
|
return c.style(
|
|
4336
4366
|
"left",
|
|
@@ -4350,7 +4380,7 @@ class ii {
|
|
|
4350
4380
|
this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
|
|
4351
4381
|
}
|
|
4352
4382
|
}
|
|
4353
|
-
class
|
|
4383
|
+
class ri extends ft {
|
|
4354
4384
|
/**
|
|
4355
4385
|
* Constructs a user highlight object.
|
|
4356
4386
|
* @public
|
|
@@ -4404,13 +4434,13 @@ class si extends ft {
|
|
|
4404
4434
|
this.focus = void 0;
|
|
4405
4435
|
}
|
|
4406
4436
|
}
|
|
4407
|
-
const
|
|
4437
|
+
const ai = 1;
|
|
4408
4438
|
class Je {
|
|
4409
4439
|
export(t, e = !1) {
|
|
4410
4440
|
const a = {
|
|
4411
4441
|
name: t.name,
|
|
4412
4442
|
type: t.type,
|
|
4413
|
-
typeVersion:
|
|
4443
|
+
typeVersion: ai,
|
|
4414
4444
|
createdAt: t.createdAt,
|
|
4415
4445
|
updatedAt: t.updatedAt,
|
|
4416
4446
|
nodes: [],
|
|
@@ -4438,9 +4468,9 @@ class Je {
|
|
|
4438
4468
|
a.push(this.exportNode(i, e));
|
|
4439
4469
|
const l = [];
|
|
4440
4470
|
for (const i of t.sections) {
|
|
4441
|
-
const
|
|
4471
|
+
const n = [];
|
|
4442
4472
|
for (const o of i.ports)
|
|
4443
|
-
|
|
4473
|
+
n.push({
|
|
4444
4474
|
id: o.id,
|
|
4445
4475
|
type: o.type?.id,
|
|
4446
4476
|
coords: At(o.coords),
|
|
@@ -4458,7 +4488,7 @@ class Je {
|
|
|
4458
4488
|
});
|
|
4459
4489
|
l.push({
|
|
4460
4490
|
id: i.id,
|
|
4461
|
-
ports:
|
|
4491
|
+
ports: n,
|
|
4462
4492
|
label: i.label?.text || "",
|
|
4463
4493
|
indexXInNode: i.indexXInNode,
|
|
4464
4494
|
indexYInNode: i.indexYInNode,
|
|
@@ -4475,9 +4505,9 @@ class Je {
|
|
|
4475
4505
|
} : {}
|
|
4476
4506
|
});
|
|
4477
4507
|
}
|
|
4478
|
-
const
|
|
4508
|
+
const r = [];
|
|
4479
4509
|
for (const i of t.ports)
|
|
4480
|
-
|
|
4510
|
+
r.push({
|
|
4481
4511
|
id: i.id,
|
|
4482
4512
|
type: i.type?.id,
|
|
4483
4513
|
coords: At(i.coords),
|
|
@@ -4498,7 +4528,7 @@ class Je {
|
|
|
4498
4528
|
type: t.type.id,
|
|
4499
4529
|
children: a,
|
|
4500
4530
|
sections: l,
|
|
4501
|
-
ports:
|
|
4531
|
+
ports: r,
|
|
4502
4532
|
label: t.label?.text || "",
|
|
4503
4533
|
coords: At(t.coords),
|
|
4504
4534
|
width: t.width,
|
|
@@ -4548,8 +4578,8 @@ class Je {
|
|
|
4548
4578
|
} : {};
|
|
4549
4579
|
}
|
|
4550
4580
|
}
|
|
4551
|
-
const
|
|
4552
|
-
class
|
|
4581
|
+
const li = "Diagram properties";
|
|
4582
|
+
class di extends ft {
|
|
4553
4583
|
/**
|
|
4554
4584
|
* Constructs a user selection object.
|
|
4555
4585
|
* @public
|
|
@@ -4558,7 +4588,7 @@ class ai extends ft {
|
|
|
4558
4588
|
constructor(t, e) {
|
|
4559
4589
|
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(ao(2e3)).subscribe(() => {
|
|
4560
4590
|
this.makeUpdateValuesAction();
|
|
4561
|
-
}), console.log(e), this.diagramPropertiesText = e !== void 0 ? e :
|
|
4591
|
+
}), console.log(e), this.diagramPropertiesText = e !== void 0 ? e : li;
|
|
4562
4592
|
}
|
|
4563
4593
|
add(t) {
|
|
4564
4594
|
if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof dt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof D ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
|
|
@@ -4604,16 +4634,16 @@ class ai extends ft {
|
|
|
4604
4634
|
*/
|
|
4605
4635
|
removeFromModel() {
|
|
4606
4636
|
if (this.length > 0) {
|
|
4607
|
-
const t = [], e = [], a = [], l = [],
|
|
4608
|
-
for (const
|
|
4609
|
-
|
|
4610
|
-
const i = new
|
|
4637
|
+
const t = [], e = [], a = [], l = [], r = [];
|
|
4638
|
+
for (const n of this.all())
|
|
4639
|
+
n instanceof z ? t.push(n.id) : n instanceof D ? e.push(n.id) : n instanceof bt ? a.push(n.id) : n instanceof dt ? l.push(n.id) : n instanceof ht && r.push(n.id);
|
|
4640
|
+
const i = new Ko(
|
|
4611
4641
|
this.canvas,
|
|
4612
4642
|
t,
|
|
4613
4643
|
e,
|
|
4614
4644
|
a,
|
|
4615
4645
|
l,
|
|
4616
|
-
|
|
4646
|
+
r
|
|
4617
4647
|
);
|
|
4618
4648
|
i.do(), this.canvas.actionStack.add(i);
|
|
4619
4649
|
}
|
|
@@ -4647,7 +4677,7 @@ class ai extends ft {
|
|
|
4647
4677
|
const a = JSON.parse(e);
|
|
4648
4678
|
if (a.type !== "daga-user-selection")
|
|
4649
4679
|
return;
|
|
4650
|
-
const l = new
|
|
4680
|
+
const l = new qo(
|
|
4651
4681
|
this.canvas,
|
|
4652
4682
|
a.nodes,
|
|
4653
4683
|
a.connections,
|
|
@@ -4684,23 +4714,23 @@ class ai extends ft {
|
|
|
4684
4714
|
this.propertyEditorSelection?.valueSet.getValues()
|
|
4685
4715
|
))
|
|
4686
4716
|
return;
|
|
4687
|
-
const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l,
|
|
4717
|
+
const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Fe(
|
|
4688
4718
|
e,
|
|
4689
4719
|
a,
|
|
4690
4720
|
this.propertyEditorSelection?.valueSet
|
|
4691
|
-
), i = new
|
|
4721
|
+
), i = new Zo(
|
|
4692
4722
|
this.canvas,
|
|
4693
4723
|
t,
|
|
4694
4724
|
l,
|
|
4695
|
-
|
|
4725
|
+
r
|
|
4696
4726
|
);
|
|
4697
4727
|
i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
|
|
4698
4728
|
}
|
|
4699
4729
|
}
|
|
4700
|
-
const
|
|
4701
|
-
const a =
|
|
4702
|
-
return [i,
|
|
4703
|
-
},
|
|
4730
|
+
const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
4731
|
+
const a = ci(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
|
|
4732
|
+
return [i, n];
|
|
4733
|
+
}, hi = 12, H = 6, gi = 25, ge = "diagram-connection-unfinished", Qt = class Qt {
|
|
4704
4734
|
/**
|
|
4705
4735
|
* Constructs a canvas object.
|
|
4706
4736
|
* @public
|
|
@@ -4708,22 +4738,22 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4708
4738
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
4709
4739
|
*/
|
|
4710
4740
|
constructor(t, e) {
|
|
4711
|
-
if (this.backgroundPatternId = `daga-background-pattern-id-${
|
|
4741
|
+
if (this.backgroundPatternId = `daga-background-pattern-id-${Qt.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new qe(
|
|
4712
4742
|
this,
|
|
4713
4743
|
void 0,
|
|
4714
4744
|
e.name || "unnamed",
|
|
4715
4745
|
"",
|
|
4716
4746
|
e.type || "",
|
|
4717
4747
|
e.properties || []
|
|
4718
|
-
), this.userSelection = new
|
|
4748
|
+
), this.userSelection = new di(
|
|
4719
4749
|
this,
|
|
4720
4750
|
e.components?.propertyEditor?.title
|
|
4721
|
-
), this.userHighlight = new
|
|
4751
|
+
), this.userHighlight = new ri(
|
|
4722
4752
|
this,
|
|
4723
4753
|
e.canvas?.highlightSections !== !1
|
|
4724
|
-
), this.contextMenu = new
|
|
4754
|
+
), this.contextMenu = new ni(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Rt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Rt.spacing), this.gridThickness = Math.abs(
|
|
4725
4755
|
e.canvas?.grid?.thickness || Rt.thickness
|
|
4726
|
-
), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new
|
|
4756
|
+
), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Xo(this, gi), this.collabEngine = new Yo(this), e.nodeTypes)
|
|
4727
4757
|
for (const a of e.nodeTypes) {
|
|
4728
4758
|
const l = new Be({
|
|
4729
4759
|
...e.nodeTypeDefaults,
|
|
@@ -4733,7 +4763,7 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4733
4763
|
}
|
|
4734
4764
|
if (e.portTypes)
|
|
4735
4765
|
for (const a of e.portTypes) {
|
|
4736
|
-
const l = new
|
|
4766
|
+
const l = new Do({
|
|
4737
4767
|
...e.portTypeDefaults,
|
|
4738
4768
|
...a
|
|
4739
4769
|
});
|
|
@@ -4786,42 +4816,42 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4786
4816
|
l.preventDefault(), l.stopPropagation(), this.dragging = !1;
|
|
4787
4817
|
return;
|
|
4788
4818
|
}
|
|
4789
|
-
const
|
|
4790
|
-
this.diagramEvent$.next(
|
|
4819
|
+
const r = new mt(l, null);
|
|
4820
|
+
this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
|
|
4791
4821
|
}).on($.DoubleClick, (l) => {
|
|
4792
|
-
const
|
|
4793
|
-
this.diagramEvent$.next(
|
|
4822
|
+
const r = new pt(l, null);
|
|
4823
|
+
this.diagramEvent$.next(r);
|
|
4794
4824
|
}).on($.KeyDown, (l) => {
|
|
4795
4825
|
if (!l.ctrlKey && (l.key === Z.Delete || l.key === Z.Backspace) && this.canUserPerformAction(w.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
|
|
4796
4826
|
l.preventDefault();
|
|
4797
|
-
for (const
|
|
4798
|
-
this.userSelection.add(
|
|
4799
|
-
for (const
|
|
4800
|
-
this.userSelection.add(
|
|
4827
|
+
for (const r of this.model.nodes)
|
|
4828
|
+
this.userSelection.add(r);
|
|
4829
|
+
for (const r of this.model.connections)
|
|
4830
|
+
this.userSelection.add(r);
|
|
4801
4831
|
this.diagramEvent$.next(
|
|
4802
4832
|
new G(this.userSelection.all(), !0)
|
|
4803
4833
|
);
|
|
4804
4834
|
}
|
|
4805
4835
|
if (l.ctrlKey && l.key === "i") {
|
|
4806
4836
|
l.preventDefault();
|
|
4807
|
-
const
|
|
4808
|
-
for (const
|
|
4809
|
-
this.userSelection.toggle(
|
|
4810
|
-
for (const
|
|
4811
|
-
this.userSelection.toggle(
|
|
4812
|
-
|
|
4813
|
-
new G(
|
|
4837
|
+
const r = [], i = [];
|
|
4838
|
+
for (const n of this.model.nodes)
|
|
4839
|
+
this.userSelection.toggle(n), n.selected ? r.push(n) : i.push(n);
|
|
4840
|
+
for (const n of this.model.connections)
|
|
4841
|
+
this.userSelection.toggle(n), n.selected ? r.push(n) : i.push(n);
|
|
4842
|
+
r.length > 0 && this.diagramEvent$.next(
|
|
4843
|
+
new G(r, !0)
|
|
4814
4844
|
), i.length > 0 && this.diagramEvent$.next(
|
|
4815
4845
|
new G(i, !1)
|
|
4816
4846
|
);
|
|
4817
4847
|
}
|
|
4818
4848
|
if (l.ctrlKey && l.key === "c" && this.canUserPerformAction(w.Clipboard) && (l.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "x" && this.canUserPerformAction(w.Clipboard) && this.canUserPerformAction(w.Remove) && (l.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "v" && this.canUserPerformAction(w.Paste)) {
|
|
4819
4849
|
l.preventDefault();
|
|
4820
|
-
const
|
|
4850
|
+
const r = this.getCoordinatesOnScreen();
|
|
4821
4851
|
this.userSelection.pasteFromClipboard(
|
|
4822
4852
|
this.getClosestGridPoint([
|
|
4823
|
-
(
|
|
4824
|
-
(
|
|
4853
|
+
(r[0][0] + r[1][0]) / 2,
|
|
4854
|
+
(r[0][1] + r[1][1]) / 2
|
|
4825
4855
|
])
|
|
4826
4856
|
), this.cancelAllUserActions();
|
|
4827
4857
|
}
|
|
@@ -4838,18 +4868,23 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4838
4868
|
l.sourceEvent.type === $.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(L.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(L.ZoomOut)) : l.sourceEvent.type === $.MouseMove && S(L.AllScroll);
|
|
4839
4869
|
}
|
|
4840
4870
|
this.zoomTransform = l.transform;
|
|
4841
|
-
const
|
|
4842
|
-
this.selectCanvasElements().attr("transform",
|
|
4871
|
+
const r = l.transform.toString();
|
|
4872
|
+
this.selectCanvasElements().attr("transform", r), x.select(`#${this.backgroundPatternId}`).attr(
|
|
4843
4873
|
"patternTransform",
|
|
4844
|
-
|
|
4845
|
-
), this.contextMenu.close()
|
|
4874
|
+
r
|
|
4875
|
+
), this.contextMenu.close(), this.diagramEvent$.next(
|
|
4876
|
+
new Jo(
|
|
4877
|
+
[this.zoomTransform.x, this.zoomTransform.y],
|
|
4878
|
+
this.zoomTransform.k
|
|
4879
|
+
)
|
|
4880
|
+
);
|
|
4846
4881
|
}).on(fe.End, () => {
|
|
4847
4882
|
S();
|
|
4848
4883
|
})
|
|
4849
4884
|
), a.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on($.MouseMove, (l) => {
|
|
4850
4885
|
if (this.unfinishedConnection !== void 0) {
|
|
4851
|
-
const
|
|
4852
|
-
this.unfinishedConnection.endCoords =
|
|
4886
|
+
const r = this.getPointerLocationRelativeToCanvas(l);
|
|
4887
|
+
this.unfinishedConnection.endCoords = r;
|
|
4853
4888
|
}
|
|
4854
4889
|
}).on($.MouseOver, () => {
|
|
4855
4890
|
this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new Q(null)));
|
|
@@ -4869,7 +4904,7 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4869
4904
|
}).on(I.End, (l) => {
|
|
4870
4905
|
this.finishMultipleSelection(l);
|
|
4871
4906
|
})
|
|
4872
|
-
),
|
|
4907
|
+
), oi(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
|
|
4873
4908
|
}
|
|
4874
4909
|
getZoomLevel() {
|
|
4875
4910
|
return this.zoomTransform.k;
|
|
@@ -4893,10 +4928,10 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4893
4928
|
if (this.model.nodes.length > 0) {
|
|
4894
4929
|
const t = this.selectCanvasView().select("rect").node()?.getBBox(), e = this.model.nodes.all(), a = Math.min(...e.map((m) => m.coords[0])), l = Math.max(
|
|
4895
4930
|
...e.map((m) => m.coords[0] + m.width)
|
|
4896
|
-
),
|
|
4931
|
+
), r = (a + l) / 2, i = l - a, n = t.width, o = Math.min(...e.map((m) => m.coords[1])), d = Math.max(
|
|
4897
4932
|
...e.map((m) => m.coords[1] + m.height)
|
|
4898
|
-
), c = (o + d) / 2, h = d - o, f = t.height, y = Math.min(
|
|
4899
|
-
this.translateTo(
|
|
4933
|
+
), c = (o + d) / 2, h = d - o, f = t.height, y = Math.min(n / i, f / h, 1);
|
|
4934
|
+
this.translateTo(r, c), this.zoomTo(y);
|
|
4900
4935
|
}
|
|
4901
4936
|
}
|
|
4902
4937
|
getClosestGridPoint(t) {
|
|
@@ -4974,158 +5009,158 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4974
5009
|
(i) => `diagram-node${i.type.resizableX ? " resizable-x" : ""}${i.type.resizableY ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
|
|
4975
5010
|
);
|
|
4976
5011
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
4977
|
-
const
|
|
4978
|
-
a.remove(), l.on($.MouseOver, (i,
|
|
4979
|
-
this.dragging || (this.userHighlight.focusOn(
|
|
4980
|
-
}).on($.Click, (i,
|
|
5012
|
+
const r = l.merge(e);
|
|
5013
|
+
a.remove(), l.on($.MouseOver, (i, n) => {
|
|
5014
|
+
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
|
|
5015
|
+
}).on($.Click, (i, n) => {
|
|
4981
5016
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
4982
5017
|
const o = this.userSelection.all();
|
|
4983
5018
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
4984
5019
|
new G(o, !1)
|
|
4985
5020
|
);
|
|
4986
5021
|
}
|
|
4987
|
-
this.userSelection.toggle(
|
|
4988
|
-
}).on($.ContextMenu, (i,
|
|
5022
|
+
this.userSelection.toggle(n), this.diagramEvent$.next(new G([n], n.selected));
|
|
5023
|
+
}).on($.ContextMenu, (i, n) => {
|
|
4989
5024
|
if (this.dragging) {
|
|
4990
5025
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
4991
5026
|
return;
|
|
4992
5027
|
}
|
|
4993
|
-
const o = new mt(i,
|
|
4994
|
-
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(
|
|
4995
|
-
}).on($.DoubleClick, (i,
|
|
4996
|
-
const o = new pt(i,
|
|
5028
|
+
const o = new mt(i, n);
|
|
5029
|
+
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)), this.userSelection.add(n), this.diagramEvent$.next(new G([n], !0)), this.contextMenu.open(i));
|
|
5030
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5031
|
+
const o = new pt(i, n);
|
|
4997
5032
|
this.diagramEvent$.next(o);
|
|
4998
5033
|
}).call(
|
|
4999
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i,
|
|
5000
|
-
this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i,
|
|
5001
|
-
}).on(I.Drag, (i,
|
|
5002
|
-
this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i,
|
|
5003
|
-
}).on(I.End, (i,
|
|
5004
|
-
this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i,
|
|
5034
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
|
|
5035
|
+
this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, n);
|
|
5036
|
+
}).on(I.Drag, (i, n) => {
|
|
5037
|
+
this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, n);
|
|
5038
|
+
}).on(I.End, (i, n) => {
|
|
5039
|
+
this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, n), this.secondaryButton = !1;
|
|
5005
5040
|
})
|
|
5006
5041
|
), ce(
|
|
5007
5042
|
l
|
|
5008
|
-
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5009
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5010
|
-
}).on($.MouseOut, (i,
|
|
5011
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5043
|
+
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5044
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && S(L.EWResize);
|
|
5045
|
+
}).on($.MouseOut, (i, n) => {
|
|
5046
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && S();
|
|
5012
5047
|
}).call(
|
|
5013
|
-
x.drag().on(I.Start, (i,
|
|
5014
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5048
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5049
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed ? (S(L.EWResize), this.currentAction = new X(
|
|
5015
5050
|
this,
|
|
5016
5051
|
w.StretchNode,
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5052
|
+
n.id,
|
|
5053
|
+
n.getGeometry(),
|
|
5054
|
+
n.getGeometry()
|
|
5020
5055
|
)) : S(L.NotAllowed);
|
|
5021
|
-
}).on(I.Drag, (i,
|
|
5022
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5056
|
+
}).on(I.Drag, (i, n) => {
|
|
5057
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed) {
|
|
5023
5058
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5024
|
-
|
|
5059
|
+
n.stretch(g.Left, n.coords[0] - o[0]);
|
|
5025
5060
|
}
|
|
5026
|
-
}).on(I.End, (i,
|
|
5027
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5061
|
+
}).on(I.End, (i, n) => {
|
|
5062
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5028
5063
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5029
5064
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5030
|
-
o[0] -
|
|
5031
|
-
o[1] -
|
|
5032
|
-
]), o[0] +=
|
|
5065
|
+
o[0] - n.type.snapToGridOffset[0],
|
|
5066
|
+
o[1] - n.type.snapToGridOffset[1]
|
|
5067
|
+
]), o[0] += n.type.snapToGridOffset[0], o[1] += n.type.snapToGridOffset[1]), n.stretch(g.Left, n.coords[0] - o[0]), this.currentAction.to = n.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5033
5068
|
}
|
|
5034
5069
|
S();
|
|
5035
5070
|
})
|
|
5036
|
-
), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5037
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5038
|
-
}).on($.MouseOut, (i,
|
|
5039
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5071
|
+
), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5072
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && S(L.NSResize);
|
|
5073
|
+
}).on($.MouseOut, (i, n) => {
|
|
5074
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && S();
|
|
5040
5075
|
}).call(
|
|
5041
|
-
x.drag().on(I.Start, (i,
|
|
5042
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5076
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5077
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed ? (S(L.NSResize), this.currentAction = new X(
|
|
5043
5078
|
this,
|
|
5044
5079
|
w.StretchNode,
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5080
|
+
n.id,
|
|
5081
|
+
n.getGeometry(),
|
|
5082
|
+
n.getGeometry()
|
|
5048
5083
|
)) : S(L.NotAllowed);
|
|
5049
|
-
}).on(I.Drag, (i,
|
|
5050
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5084
|
+
}).on(I.Drag, (i, n) => {
|
|
5085
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed) {
|
|
5051
5086
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5052
|
-
|
|
5087
|
+
n.stretch(g.Top, n.coords[1] - o[1]);
|
|
5053
5088
|
}
|
|
5054
|
-
}).on(I.End, (i,
|
|
5055
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5089
|
+
}).on(I.End, (i, n) => {
|
|
5090
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5056
5091
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5057
5092
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5058
|
-
o[0] -
|
|
5059
|
-
o[1] -
|
|
5060
|
-
]), o[0] +=
|
|
5093
|
+
o[0] - n.type.snapToGridOffset[0],
|
|
5094
|
+
o[1] - n.type.snapToGridOffset[1]
|
|
5095
|
+
]), o[0] += n.type.snapToGridOffset[0], o[1] += n.type.snapToGridOffset[1]), n.stretch(g.Top, n.coords[1] - o[1]), this.currentAction.to = n.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5061
5096
|
}
|
|
5062
5097
|
S();
|
|
5063
5098
|
})
|
|
5064
|
-
), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5065
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5066
|
-
}).on($.MouseOut, (i,
|
|
5067
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5099
|
+
), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5100
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && S(L.EWResize);
|
|
5101
|
+
}).on($.MouseOut, (i, n) => {
|
|
5102
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && S();
|
|
5068
5103
|
}).call(
|
|
5069
|
-
x.drag().on(I.Start, (i,
|
|
5070
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5104
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5105
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed ? (S(L.EWResize), this.currentAction = new X(
|
|
5071
5106
|
this,
|
|
5072
5107
|
w.StretchNode,
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5108
|
+
n.id,
|
|
5109
|
+
n.getGeometry(),
|
|
5110
|
+
n.getGeometry()
|
|
5076
5111
|
)) : S(L.NotAllowed);
|
|
5077
|
-
}).on(I.Drag, (i,
|
|
5078
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5112
|
+
}).on(I.Drag, (i, n) => {
|
|
5113
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed) {
|
|
5079
5114
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5080
|
-
|
|
5115
|
+
n.stretch(g.Right, o[0] - (n.coords[0] + n.width));
|
|
5081
5116
|
}
|
|
5082
|
-
}).on(I.End, (i,
|
|
5083
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5117
|
+
}).on(I.End, (i, n) => {
|
|
5118
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableX && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5084
5119
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5085
5120
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5086
|
-
o[0] -
|
|
5087
|
-
o[1] -
|
|
5088
|
-
]), o[0] +=
|
|
5121
|
+
o[0] - n.type.snapToGridOffset[2],
|
|
5122
|
+
o[1] - n.type.snapToGridOffset[3]
|
|
5123
|
+
]), o[0] += n.type.snapToGridOffset[2], o[1] += n.type.snapToGridOffset[3]), n.stretch(g.Right, o[0] - (n.coords[0] + n.width)), this.currentAction.to = n.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5089
5124
|
}
|
|
5090
5125
|
S();
|
|
5091
5126
|
})
|
|
5092
|
-
), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5093
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5094
|
-
}).on($.MouseOut, (i,
|
|
5095
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5127
|
+
), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5128
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && S(L.NSResize);
|
|
5129
|
+
}).on($.MouseOut, (i, n) => {
|
|
5130
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && S();
|
|
5096
5131
|
}).call(
|
|
5097
|
-
x.drag().on(I.Start, (i,
|
|
5098
|
-
this.canUserPerformAction(w.StretchNode) &&
|
|
5132
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5133
|
+
this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed ? (S(L.NSResize), this.currentAction = new X(
|
|
5099
5134
|
this,
|
|
5100
5135
|
w.StretchNode,
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5136
|
+
n.id,
|
|
5137
|
+
n.getGeometry(),
|
|
5138
|
+
n.getGeometry()
|
|
5104
5139
|
)) : S(L.NotAllowed);
|
|
5105
|
-
}).on(I.Drag, (i,
|
|
5106
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5140
|
+
}).on(I.Drag, (i, n) => {
|
|
5141
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed) {
|
|
5107
5142
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5108
|
-
|
|
5143
|
+
n.stretch(
|
|
5109
5144
|
g.Bottom,
|
|
5110
|
-
o[1] - (
|
|
5145
|
+
o[1] - (n.coords[1] + n.height)
|
|
5111
5146
|
);
|
|
5112
5147
|
}
|
|
5113
|
-
}).on(I.End, (i,
|
|
5114
|
-
if (this.canUserPerformAction(w.StretchNode) &&
|
|
5148
|
+
}).on(I.End, (i, n) => {
|
|
5149
|
+
if (this.canUserPerformAction(w.StretchNode) && n.type.resizableY && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5115
5150
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5116
5151
|
this.snapToGrid && this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5117
|
-
o[0] -
|
|
5118
|
-
o[1] -
|
|
5119
|
-
]), o[0] +=
|
|
5152
|
+
o[0] - n.type.snapToGridOffset[2],
|
|
5153
|
+
o[1] - n.type.snapToGridOffset[3]
|
|
5154
|
+
]), o[0] += n.type.snapToGridOffset[2], o[1] += n.type.snapToGridOffset[3]), n.stretch(
|
|
5120
5155
|
g.Bottom,
|
|
5121
|
-
o[1] - (
|
|
5122
|
-
), this.currentAction.to =
|
|
5156
|
+
o[1] - (n.coords[1] + n.height)
|
|
5157
|
+
), this.currentAction.to = n.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5123
5158
|
}
|
|
5124
5159
|
S();
|
|
5125
5160
|
})
|
|
5126
|
-
),
|
|
5127
|
-
|
|
5128
|
-
),
|
|
5161
|
+
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5162
|
+
r
|
|
5163
|
+
), r.filter(".resizable-x").select("line.left-resizer").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
|
|
5129
5164
|
}
|
|
5130
5165
|
updateSectionsInView(...t) {
|
|
5131
5166
|
let e = this.selectCanvasElements().selectAll("g.diagram-section").data(
|
|
@@ -5139,208 +5174,208 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5139
5174
|
(i) => `diagram-section${i.getResizableX() ? " resizable-x" : ""}${i.getResizableY() ? " resizable-y" : ""} ${i.look?.lookType}`
|
|
5140
5175
|
);
|
|
5141
5176
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5142
|
-
const
|
|
5143
|
-
a.remove(), l.on($.MouseOver, (i,
|
|
5144
|
-
this.dragging || (this.userHighlight.focusOn(
|
|
5145
|
-
}).on($.Click, (i,
|
|
5177
|
+
const r = l.merge(e);
|
|
5178
|
+
a.remove(), l.on($.MouseOver, (i, n) => {
|
|
5179
|
+
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
|
|
5180
|
+
}).on($.Click, (i, n) => {
|
|
5146
5181
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
5147
5182
|
const d = this.userSelection.all();
|
|
5148
5183
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
5149
5184
|
new G(d, !1)
|
|
5150
5185
|
);
|
|
5151
5186
|
}
|
|
5152
|
-
const o = ct(
|
|
5187
|
+
const o = ct(n);
|
|
5153
5188
|
this.userSelection.toggle(o), this.diagramEvent$.next(
|
|
5154
5189
|
new G(
|
|
5155
5190
|
[o],
|
|
5156
5191
|
o.selected
|
|
5157
5192
|
)
|
|
5158
5193
|
);
|
|
5159
|
-
}).on($.ContextMenu, (i,
|
|
5194
|
+
}).on($.ContextMenu, (i, n) => {
|
|
5160
5195
|
if (this.dragging) {
|
|
5161
5196
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
5162
5197
|
return;
|
|
5163
5198
|
}
|
|
5164
|
-
const o = new mt(i,
|
|
5199
|
+
const o = new mt(i, n);
|
|
5165
5200
|
if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
|
|
5166
5201
|
i.preventDefault();
|
|
5167
|
-
const d = ct(
|
|
5202
|
+
const d = ct(n);
|
|
5168
5203
|
this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
|
|
5169
5204
|
new G([d], !0)
|
|
5170
5205
|
), this.contextMenu.open(i);
|
|
5171
5206
|
}
|
|
5172
|
-
}).on($.DoubleClick, (i,
|
|
5173
|
-
const o = new pt(i,
|
|
5207
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5208
|
+
const o = new pt(i, n);
|
|
5174
5209
|
this.diagramEvent$.next(o);
|
|
5175
5210
|
}).call(
|
|
5176
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i,
|
|
5211
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
|
|
5177
5212
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5178
5213
|
this.startMultipleSelection(i);
|
|
5179
5214
|
else {
|
|
5180
|
-
const o =
|
|
5215
|
+
const o = n?.node;
|
|
5181
5216
|
o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5182
5217
|
}
|
|
5183
|
-
}).on(I.Drag, (i,
|
|
5218
|
+
}).on(I.Drag, (i, n) => {
|
|
5184
5219
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5185
5220
|
this.continueMultipleSelection(i);
|
|
5186
5221
|
else {
|
|
5187
|
-
const o =
|
|
5222
|
+
const o = n?.node;
|
|
5188
5223
|
o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5189
5224
|
}
|
|
5190
|
-
}).on(I.End, (i,
|
|
5225
|
+
}).on(I.End, (i, n) => {
|
|
5191
5226
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5192
5227
|
this.finishMultipleSelection(i);
|
|
5193
5228
|
else {
|
|
5194
|
-
const o =
|
|
5229
|
+
const o = n?.node;
|
|
5195
5230
|
o ? this.finishMovingNode(i, o) : S();
|
|
5196
5231
|
}
|
|
5197
5232
|
this.secondaryButton = !1;
|
|
5198
5233
|
})
|
|
5199
5234
|
), ce(
|
|
5200
5235
|
l
|
|
5201
|
-
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5202
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5203
|
-
}).on($.MouseOut, (i,
|
|
5204
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5236
|
+
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5237
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
|
|
5238
|
+
}).on($.MouseOut, (i, n) => {
|
|
5239
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
|
|
5205
5240
|
}).call(
|
|
5206
|
-
x.drag().on(I.Start, (i,
|
|
5207
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5241
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5242
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
|
|
5208
5243
|
this,
|
|
5209
5244
|
w.StretchSection,
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5245
|
+
n.node.id,
|
|
5246
|
+
n.node.getGeometry(),
|
|
5247
|
+
n.node.getGeometry()
|
|
5213
5248
|
)) : S(L.NotAllowed);
|
|
5214
|
-
}).on(I.Drag, (i,
|
|
5215
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5249
|
+
}).on(I.Drag, (i, n) => {
|
|
5250
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
|
|
5216
5251
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5217
|
-
|
|
5252
|
+
n.node.stretchSections(
|
|
5218
5253
|
g.Left,
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5254
|
+
n.coords[0] - o[0],
|
|
5255
|
+
n.indexXInNode,
|
|
5256
|
+
n.indexYInNode
|
|
5222
5257
|
);
|
|
5223
5258
|
}
|
|
5224
|
-
}).on(I.End, (i,
|
|
5225
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5259
|
+
}).on(I.End, (i, n) => {
|
|
5260
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5226
5261
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5227
|
-
this.snapToGrid && (o = this.getClosestGridPoint(o)),
|
|
5262
|
+
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
5228
5263
|
g.Left,
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
), this.currentAction.to =
|
|
5264
|
+
n.coords[0] - o[0],
|
|
5265
|
+
n.indexXInNode,
|
|
5266
|
+
n.indexYInNode
|
|
5267
|
+
), this.currentAction.to = n.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5233
5268
|
}
|
|
5234
5269
|
S();
|
|
5235
5270
|
})
|
|
5236
|
-
), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5237
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5238
|
-
}).on($.MouseOut, (i,
|
|
5239
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5271
|
+
), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5272
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
|
|
5273
|
+
}).on($.MouseOut, (i, n) => {
|
|
5274
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
|
|
5240
5275
|
}).call(
|
|
5241
|
-
x.drag().on(I.Start, (i,
|
|
5242
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5276
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5277
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
|
|
5243
5278
|
this,
|
|
5244
5279
|
w.StretchSection,
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5280
|
+
n.node.id,
|
|
5281
|
+
n.node.getGeometry(),
|
|
5282
|
+
n.node.getGeometry()
|
|
5248
5283
|
)) : S(L.NotAllowed);
|
|
5249
|
-
}).on(I.Drag, (i,
|
|
5250
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5284
|
+
}).on(I.Drag, (i, n) => {
|
|
5285
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
|
|
5251
5286
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5252
|
-
|
|
5287
|
+
n.node.stretchSections(
|
|
5253
5288
|
g.Top,
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5289
|
+
n.coords[1] - o[1],
|
|
5290
|
+
n.indexXInNode,
|
|
5291
|
+
n.indexYInNode
|
|
5257
5292
|
);
|
|
5258
5293
|
}
|
|
5259
|
-
}).on(I.End, (i,
|
|
5260
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5294
|
+
}).on(I.End, (i, n) => {
|
|
5295
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5261
5296
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5262
|
-
this.snapToGrid && (o = this.getClosestGridPoint(o)),
|
|
5297
|
+
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
5263
5298
|
g.Top,
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
), this.currentAction.to =
|
|
5299
|
+
n.coords[1] - o[1],
|
|
5300
|
+
n.indexXInNode,
|
|
5301
|
+
n.indexYInNode
|
|
5302
|
+
), this.currentAction.to = n.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5268
5303
|
}
|
|
5269
5304
|
S();
|
|
5270
5305
|
})
|
|
5271
|
-
), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5272
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5273
|
-
}).on($.MouseOut, (i,
|
|
5274
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5306
|
+
), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5307
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
|
|
5308
|
+
}).on($.MouseOut, (i, n) => {
|
|
5309
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
|
|
5275
5310
|
}).call(
|
|
5276
|
-
x.drag().on(I.Start, (i,
|
|
5277
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5311
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5312
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
|
|
5278
5313
|
this,
|
|
5279
5314
|
w.StretchSection,
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5315
|
+
n.node.id,
|
|
5316
|
+
n.node.getGeometry(),
|
|
5317
|
+
n.node.getGeometry()
|
|
5283
5318
|
)) : S(L.NotAllowed);
|
|
5284
|
-
}).on(I.Drag, (i,
|
|
5285
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5319
|
+
}).on(I.Drag, (i, n) => {
|
|
5320
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
|
|
5286
5321
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5287
|
-
|
|
5322
|
+
n.node.stretchSections(
|
|
5288
5323
|
g.Right,
|
|
5289
|
-
o[0] - (
|
|
5290
|
-
|
|
5291
|
-
|
|
5324
|
+
o[0] - (n.coords[0] + n.width),
|
|
5325
|
+
n.indexXInNode,
|
|
5326
|
+
n.indexYInNode
|
|
5292
5327
|
);
|
|
5293
5328
|
}
|
|
5294
|
-
}).on(I.End, (i,
|
|
5295
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5329
|
+
}).on(I.End, (i, n) => {
|
|
5330
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5296
5331
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5297
|
-
this.snapToGrid && (o = this.getClosestGridPoint(o)),
|
|
5332
|
+
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
5298
5333
|
g.Right,
|
|
5299
|
-
o[0] - (
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
), this.currentAction.to =
|
|
5334
|
+
o[0] - (n.coords[0] + n.width),
|
|
5335
|
+
n.indexXInNode,
|
|
5336
|
+
n.indexYInNode
|
|
5337
|
+
), this.currentAction.to = n.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5303
5338
|
}
|
|
5304
5339
|
S();
|
|
5305
5340
|
})
|
|
5306
|
-
), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i,
|
|
5307
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5308
|
-
}).on($.MouseOut, (i,
|
|
5309
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5341
|
+
), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5342
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
|
|
5343
|
+
}).on($.MouseOut, (i, n) => {
|
|
5344
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
|
|
5310
5345
|
}).call(
|
|
5311
|
-
x.drag().on(I.Start, (i,
|
|
5312
|
-
this.canUserPerformAction(w.StretchSection) &&
|
|
5346
|
+
x.drag().on(I.Start, (i, n) => {
|
|
5347
|
+
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
|
|
5313
5348
|
this,
|
|
5314
5349
|
w.StretchSection,
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5350
|
+
n.node.id,
|
|
5351
|
+
n.node.getGeometry(),
|
|
5352
|
+
n.node.getGeometry()
|
|
5318
5353
|
)) : S(L.NotAllowed);
|
|
5319
|
-
}).on(I.Drag, (i,
|
|
5320
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5354
|
+
}).on(I.Drag, (i, n) => {
|
|
5355
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
|
|
5321
5356
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5322
|
-
|
|
5357
|
+
n.node.stretchSections(
|
|
5323
5358
|
g.Bottom,
|
|
5324
|
-
o[1] - (
|
|
5325
|
-
|
|
5326
|
-
|
|
5359
|
+
o[1] - (n.coords[1] + n.height),
|
|
5360
|
+
n.indexXInNode,
|
|
5361
|
+
n.indexYInNode
|
|
5327
5362
|
);
|
|
5328
5363
|
}
|
|
5329
|
-
}).on(I.End, (i,
|
|
5330
|
-
if (this.canUserPerformAction(w.StretchSection) &&
|
|
5364
|
+
}).on(I.End, (i, n) => {
|
|
5365
|
+
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5331
5366
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5332
|
-
this.snapToGrid && (o = this.getClosestGridPoint(o)),
|
|
5367
|
+
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
5333
5368
|
g.Bottom,
|
|
5334
|
-
o[1] - (
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
), this.currentAction.to =
|
|
5369
|
+
o[1] - (n.coords[1] + n.height),
|
|
5370
|
+
n.indexXInNode,
|
|
5371
|
+
n.indexYInNode
|
|
5372
|
+
), this.currentAction.to = n.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
|
|
5338
5373
|
}
|
|
5339
5374
|
S();
|
|
5340
5375
|
})
|
|
5341
|
-
),
|
|
5342
|
-
|
|
5343
|
-
),
|
|
5376
|
+
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5377
|
+
r
|
|
5378
|
+
), r.filter(".resizable-x").select("line.left-resizer").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
|
|
5344
5379
|
}
|
|
5345
5380
|
updatePortsInView(...t) {
|
|
5346
5381
|
let e = this.selectCanvasElements().selectAll("g.diagram-port").data(
|
|
@@ -5351,60 +5386,60 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5351
5386
|
);
|
|
5352
5387
|
const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", (i) => `diagram-port ${i.look.lookType}`);
|
|
5353
5388
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5354
|
-
const
|
|
5355
|
-
a.remove(), l.on($.MouseOver, (i,
|
|
5356
|
-
!this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(
|
|
5389
|
+
const r = l.merge(e);
|
|
5390
|
+
a.remove(), l.on($.MouseOver, (i, n) => {
|
|
5391
|
+
!this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n))), this.unfinishedConnection && (// can start at the starting port
|
|
5357
5392
|
this.unfinishedConnection.type.canStartFromType(
|
|
5358
5393
|
this.unfinishedConnection.start?.getNode()?.type?.id || ""
|
|
5359
5394
|
) && this.unfinishedConnection.start?.allowsOutgoing && // can end at the ending port
|
|
5360
5395
|
this.unfinishedConnection.type.canFinishOnType(
|
|
5361
|
-
|
|
5362
|
-
) &&
|
|
5396
|
+
n.getNode()?.type?.id || ""
|
|
5397
|
+
) && n.allowsIncoming || // can start at the ending port
|
|
5363
5398
|
this.unfinishedConnection.type.canStartFromType(
|
|
5364
|
-
|
|
5365
|
-
) &&
|
|
5399
|
+
n.getNode()?.type?.id || ""
|
|
5400
|
+
) && n.allowsOutgoing && // can end at the starting port
|
|
5366
5401
|
this.unfinishedConnection.type.canFinishOnType(
|
|
5367
5402
|
this.unfinishedConnection.start?.getNode()?.type?.id || ""
|
|
5368
5403
|
) && this.unfinishedConnection.start?.allowsIncoming || S(L.NoDrop));
|
|
5369
5404
|
}).on($.MouseOut, () => {
|
|
5370
5405
|
this.unfinishedConnection && S(L.Grabbing);
|
|
5371
|
-
}).on($.Click, (i,
|
|
5406
|
+
}).on($.Click, (i, n) => {
|
|
5372
5407
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
5373
5408
|
const d = this.userSelection.all();
|
|
5374
5409
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
5375
5410
|
new G(d, !1)
|
|
5376
5411
|
);
|
|
5377
5412
|
}
|
|
5378
|
-
const o = ct(
|
|
5413
|
+
const o = ct(n);
|
|
5379
5414
|
this.userSelection.toggle(o), this.diagramEvent$.next(
|
|
5380
5415
|
new G(
|
|
5381
5416
|
[o],
|
|
5382
5417
|
o.selected
|
|
5383
5418
|
)
|
|
5384
5419
|
);
|
|
5385
|
-
}).on($.ContextMenu, (i,
|
|
5420
|
+
}).on($.ContextMenu, (i, n) => {
|
|
5386
5421
|
if (this.dragging) {
|
|
5387
5422
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
5388
5423
|
return;
|
|
5389
5424
|
}
|
|
5390
|
-
const o = new mt(i,
|
|
5425
|
+
const o = new mt(i, n);
|
|
5391
5426
|
if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
|
|
5392
5427
|
i.preventDefault();
|
|
5393
|
-
const d = ct(
|
|
5428
|
+
const d = ct(n);
|
|
5394
5429
|
this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
|
|
5395
5430
|
new G([d], !0)
|
|
5396
5431
|
), this.contextMenu.open(i);
|
|
5397
5432
|
}
|
|
5398
|
-
}).on($.DoubleClick, (i,
|
|
5399
|
-
const o = new pt(i,
|
|
5433
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5434
|
+
const o = new pt(i, n);
|
|
5400
5435
|
this.diagramEvent$.next(o);
|
|
5401
5436
|
}).call(
|
|
5402
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i,
|
|
5403
|
-
this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(w.AddConnection) && (this.allowSharingPorts ||
|
|
5404
|
-
}).on(I.Drag, (i,
|
|
5437
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
|
|
5438
|
+
this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(w.AddConnection) && (this.allowSharingPorts || n.incomingConnections.filter((o) => !o.removed).length === 0 && n.outgoingConnections.filter((o) => !o.removed).length === 0) && !n.removed ? (S(L.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(L.NotAllowed);
|
|
5439
|
+
}).on(I.Drag, (i, n) => {
|
|
5405
5440
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5406
5441
|
this.continueMultipleSelection(i);
|
|
5407
|
-
else if (this.canUserPerformAction(w.AddConnection) && !
|
|
5442
|
+
else if (this.canUserPerformAction(w.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
|
|
5408
5443
|
const o = [i.x, i.y];
|
|
5409
5444
|
this.unfinishedConnectionTracer?.attr(
|
|
5410
5445
|
"d",
|
|
@@ -5443,11 +5478,11 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5443
5478
|
f && h < this.portHighlightRadius ? this.userHighlight.focusOn(f) : this.userHighlight.clear();
|
|
5444
5479
|
}
|
|
5445
5480
|
}
|
|
5446
|
-
}).on(I.End, (i,
|
|
5481
|
+
}).on(I.End, (i, n) => {
|
|
5447
5482
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5448
5483
|
this.finishMultipleSelection(i);
|
|
5449
5484
|
else {
|
|
5450
|
-
if (this.canUserPerformAction(w.AddConnection) && !
|
|
5485
|
+
if (this.canUserPerformAction(w.AddConnection) && !n.removed) {
|
|
5451
5486
|
this.unfinishedConnectionTracer?.remove();
|
|
5452
5487
|
const o = this.userHighlight.getFocus();
|
|
5453
5488
|
if (o instanceof bt)
|
|
@@ -5478,94 +5513,94 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5478
5513
|
})
|
|
5479
5514
|
), l.filter(".image-look").append("image"), ce(
|
|
5480
5515
|
l
|
|
5481
|
-
),
|
|
5516
|
+
), r.attr(
|
|
5482
5517
|
"transform",
|
|
5483
5518
|
(i) => `translate(${i.coords[0] - i.width / 2},${i.coords[1] - i.width / 2})`
|
|
5484
5519
|
).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5485
|
-
|
|
5520
|
+
r
|
|
5486
5521
|
);
|
|
5487
5522
|
}
|
|
5488
5523
|
updateConnectionsInView(...t) {
|
|
5489
5524
|
const e = this.model.connections.filter(
|
|
5490
|
-
(
|
|
5525
|
+
(n) => this.priorityThreshold !== void 0 ? n.getPriority() >= this.priorityThreshold : !0
|
|
5491
5526
|
);
|
|
5492
5527
|
this.unfinishedConnection && e.push(this.unfinishedConnection);
|
|
5493
|
-
let a = this.selectCanvasElements().selectAll("g.diagram-connection").data(e, (
|
|
5494
|
-
const l = a.exit(),
|
|
5495
|
-
t && t.length > 0 && (a = a.filter((
|
|
5496
|
-
const i =
|
|
5497
|
-
l.remove(),
|
|
5528
|
+
let a = this.selectCanvasElements().selectAll("g.diagram-connection").data(e, (n) => n.id);
|
|
5529
|
+
const l = a.exit(), r = a.enter().append("g").attr("id", (n) => n.id).attr("class", "diagram-connection");
|
|
5530
|
+
t && t.length > 0 && (a = a.filter((n) => t.includes(n.id)));
|
|
5531
|
+
const i = r.merge(a);
|
|
5532
|
+
l.remove(), r.on($.MouseOver, (n, o) => {
|
|
5498
5533
|
o.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)));
|
|
5499
|
-
}).on($.Click, (
|
|
5500
|
-
if (!
|
|
5534
|
+
}).on($.Click, (n, o) => {
|
|
5535
|
+
if (!n.ctrlKey && !n.shiftKey) {
|
|
5501
5536
|
const d = this.userSelection.all();
|
|
5502
5537
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
5503
5538
|
new G(d, !1)
|
|
5504
5539
|
);
|
|
5505
5540
|
}
|
|
5506
5541
|
this.userSelection.toggle(o), this.diagramEvent$.next(new G([o], o.selected));
|
|
5507
|
-
}).on($.ContextMenu, (
|
|
5542
|
+
}).on($.ContextMenu, (n, o) => {
|
|
5508
5543
|
if (this.dragging) {
|
|
5509
|
-
|
|
5544
|
+
n.preventDefault(), n.stopPropagation(), this.dragging = !1;
|
|
5510
5545
|
return;
|
|
5511
5546
|
}
|
|
5512
|
-
const d = new mt(
|
|
5513
|
-
this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (
|
|
5514
|
-
}).on($.DoubleClick, (
|
|
5515
|
-
const d = new pt(
|
|
5547
|
+
const d = new mt(n, o);
|
|
5548
|
+
this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)), this.userSelection.add(o), this.diagramEvent$.next(new G([o], !0)), this.contextMenu.open(n));
|
|
5549
|
+
}).on($.DoubleClick, (n, o) => {
|
|
5550
|
+
const d = new pt(n, o);
|
|
5516
5551
|
this.diagramEvent$.next(d);
|
|
5517
5552
|
}).call(
|
|
5518
|
-
x.drag().filter((
|
|
5519
|
-
this.startMultipleSelection(
|
|
5520
|
-
}).on(I.Drag, (
|
|
5521
|
-
this.continueMultipleSelection(
|
|
5522
|
-
}).on(I.End, (
|
|
5523
|
-
this.finishMultipleSelection(
|
|
5553
|
+
x.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(I.Start, (n) => {
|
|
5554
|
+
this.startMultipleSelection(n);
|
|
5555
|
+
}).on(I.Drag, (n) => {
|
|
5556
|
+
this.continueMultipleSelection(n);
|
|
5557
|
+
}).on(I.End, (n) => {
|
|
5558
|
+
this.finishMultipleSelection(n);
|
|
5524
5559
|
})
|
|
5525
|
-
),
|
|
5560
|
+
), r.append("path").attr("class", "diagram-connection-path"), r.append("path").attr("class", "diagram-connection-path-box"), r.append("marker").attr("id", (n) => `${n.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), r.append("marker").attr("id", (n) => `${n.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), r.append("g").attr("class", "diagram-connection-start-label"), r.select("g.diagram-connection-start-label").append("path"), r.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-middle-label"), r.select("g.diagram-connection-middle-label").append("path"), r.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-end-label"), r.select("g.diagram-connection-end-label").append("path"), r.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), i.attr("opacity", (n) => n.removed ? 0.5 : 1).select("path.diagram-connection-path").attr(
|
|
5526
5561
|
"d",
|
|
5527
|
-
(
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5562
|
+
(n) => de(
|
|
5563
|
+
n.look.shape || et.look.shape,
|
|
5564
|
+
n.startCoords,
|
|
5565
|
+
n.endCoords,
|
|
5566
|
+
n.startDirection,
|
|
5567
|
+
n.endDirection,
|
|
5568
|
+
n.type.defaultLook.thickness || et.look.thickness,
|
|
5569
|
+
n.type.defaultStartMarkerLook?.width,
|
|
5570
|
+
n.type.defaultEndMarkerLook?.width
|
|
5536
5571
|
)
|
|
5537
|
-
).attr("marker-start", (
|
|
5572
|
+
).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr(
|
|
5538
5573
|
"stroke",
|
|
5539
|
-
(
|
|
5540
|
-
).attr("stroke-width", (
|
|
5574
|
+
(n) => n.look.color || et.look.color
|
|
5575
|
+
).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
|
|
5541
5576
|
"stroke-dasharray",
|
|
5542
|
-
(
|
|
5543
|
-
|
|
5544
|
-
|
|
5577
|
+
(n) => pe(
|
|
5578
|
+
n.look.style || et.look.style,
|
|
5579
|
+
n.type.defaultLook.thickness || et.look.thickness
|
|
5545
5580
|
)
|
|
5546
5581
|
).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
|
|
5547
5582
|
"d",
|
|
5548
|
-
(
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5583
|
+
(n) => de(
|
|
5584
|
+
n.look.shape || et.look.shape,
|
|
5585
|
+
n.startCoords,
|
|
5586
|
+
n.endCoords,
|
|
5587
|
+
n.startDirection,
|
|
5588
|
+
n.endDirection,
|
|
5589
|
+
n.type.defaultLook.thickness || et.look.thickness,
|
|
5590
|
+
n.type.defaultStartMarkerLook?.width,
|
|
5591
|
+
n.type.defaultEndMarkerLook?.width
|
|
5557
5592
|
)
|
|
5558
5593
|
).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
|
|
5559
5594
|
"stroke-width",
|
|
5560
|
-
(
|
|
5595
|
+
(n) => `${(n.look.thickness || et.look.thickness) + hi}px`
|
|
5561
5596
|
).attr(
|
|
5562
5597
|
"stroke-dasharray",
|
|
5563
|
-
(
|
|
5564
|
-
|
|
5565
|
-
|
|
5598
|
+
(n) => pe(
|
|
5599
|
+
n.look.style || et.look.style,
|
|
5600
|
+
n.type.defaultLook.thickness || et.look.thickness
|
|
5566
5601
|
)
|
|
5567
|
-
).attr("fill", "none"), i.data().forEach((
|
|
5568
|
-
this.updateConnectionLabelsInView(
|
|
5602
|
+
).attr("fill", "none"), i.data().forEach((n) => {
|
|
5603
|
+
this.updateConnectionLabelsInView(n), this.updateConnectionMarkersInView(n);
|
|
5569
5604
|
});
|
|
5570
5605
|
}
|
|
5571
5606
|
updateFieldsInView(...t) {
|
|
@@ -5579,82 +5614,82 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5579
5614
|
);
|
|
5580
5615
|
const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-field");
|
|
5581
5616
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5582
|
-
const
|
|
5583
|
-
a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i,
|
|
5584
|
-
this.dragging || (this.userHighlight.focusOn(
|
|
5585
|
-
}).on($.Click, (i,
|
|
5617
|
+
const r = l.merge(e);
|
|
5618
|
+
a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
|
|
5619
|
+
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
|
|
5620
|
+
}).on($.Click, (i, n) => {
|
|
5586
5621
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
5587
5622
|
const d = this.userSelection.all();
|
|
5588
5623
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
5589
5624
|
new G(d, !1)
|
|
5590
5625
|
);
|
|
5591
5626
|
}
|
|
5592
|
-
const o = ct(
|
|
5627
|
+
const o = ct(n);
|
|
5593
5628
|
this.userSelection.toggle(o), this.diagramEvent$.next(
|
|
5594
5629
|
new G(
|
|
5595
5630
|
[o],
|
|
5596
5631
|
o.selected
|
|
5597
5632
|
)
|
|
5598
5633
|
);
|
|
5599
|
-
}).on($.ContextMenu, (i,
|
|
5634
|
+
}).on($.ContextMenu, (i, n) => {
|
|
5600
5635
|
if (this.dragging) {
|
|
5601
5636
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
5602
5637
|
return;
|
|
5603
5638
|
}
|
|
5604
|
-
const o = new mt(i,
|
|
5639
|
+
const o = new mt(i, n);
|
|
5605
5640
|
if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
|
|
5606
5641
|
i.preventDefault();
|
|
5607
|
-
const d = ct(
|
|
5642
|
+
const d = ct(n);
|
|
5608
5643
|
this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
|
|
5609
5644
|
new G([d], !0)
|
|
5610
5645
|
), this.contextMenu.open(i);
|
|
5611
5646
|
}
|
|
5612
|
-
}).on($.DoubleClick, (i,
|
|
5613
|
-
const o = new pt(i,
|
|
5614
|
-
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) &&
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5647
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5648
|
+
const o = new pt(i, n);
|
|
5649
|
+
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && n.editable && !n.removed && (this.currentAction = new Ne(this, n.id, n.text, ""), this.createInputField(
|
|
5650
|
+
n.text,
|
|
5651
|
+
n.coords,
|
|
5652
|
+
n.width,
|
|
5653
|
+
n.height,
|
|
5654
|
+
n.fontSize,
|
|
5655
|
+
n.fontFamily || V.fontFamily,
|
|
5656
|
+
n.orientation,
|
|
5622
5657
|
(d) => {
|
|
5623
5658
|
},
|
|
5624
5659
|
(d) => {
|
|
5625
|
-
|
|
5660
|
+
n.text = d, this.currentAction instanceof Ne && (this.currentAction.to = d, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
|
|
5626
5661
|
}
|
|
5627
5662
|
));
|
|
5628
5663
|
}).call(
|
|
5629
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i,
|
|
5664
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
|
|
5630
5665
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5631
5666
|
this.startMultipleSelection(i);
|
|
5632
5667
|
else {
|
|
5633
5668
|
let o;
|
|
5634
|
-
|
|
5669
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5635
5670
|
}
|
|
5636
|
-
}).on(I.Drag, (i,
|
|
5671
|
+
}).on(I.Drag, (i, n) => {
|
|
5637
5672
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5638
5673
|
this.continueMultipleSelection(i);
|
|
5639
5674
|
else {
|
|
5640
5675
|
let o;
|
|
5641
|
-
|
|
5676
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5642
5677
|
}
|
|
5643
|
-
}).on(I.End, (i,
|
|
5678
|
+
}).on(I.End, (i, n) => {
|
|
5644
5679
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5645
5680
|
this.finishMultipleSelection(i);
|
|
5646
5681
|
else {
|
|
5647
5682
|
let o;
|
|
5648
|
-
|
|
5683
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.finishMovingNode(i, o) : S();
|
|
5649
5684
|
}
|
|
5650
5685
|
this.secondaryButton = !1;
|
|
5651
5686
|
})
|
|
5652
|
-
).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"),
|
|
5687
|
+
).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), r.attr("x", 0).attr("y", 0).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1).select("div").style(
|
|
5653
5688
|
"justify-content",
|
|
5654
5689
|
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
|
|
5655
5690
|
).style(
|
|
5656
5691
|
"align-items",
|
|
5657
|
-
(i) => i.verticalAlign ===
|
|
5692
|
+
(i) => i.verticalAlign === qt.Center ? "center" : i.verticalAlign === qt.Bottom ? "end" : "start"
|
|
5658
5693
|
).select("p").style(
|
|
5659
5694
|
"max-width",
|
|
5660
5695
|
(i) => i.fit ? "default" : `${ze(i.width, i.height, i.orientation)[0]}px`
|
|
@@ -5684,15 +5719,15 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5684
5719
|
(i) => i.id
|
|
5685
5720
|
);
|
|
5686
5721
|
const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-object");
|
|
5687
|
-
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.ContextMenu, (i,
|
|
5722
|
+
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.ContextMenu, (i, n) => {
|
|
5688
5723
|
if (this.dragging) {
|
|
5689
5724
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
5690
5725
|
return;
|
|
5691
5726
|
}
|
|
5692
|
-
const o = new mt(i,
|
|
5727
|
+
const o = new mt(i, n);
|
|
5693
5728
|
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
|
|
5694
|
-
}).on($.DoubleClick, (i,
|
|
5695
|
-
const o = new pt(i,
|
|
5729
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5730
|
+
const o = new pt(i, n);
|
|
5696
5731
|
this.diagramEvent$.next(o);
|
|
5697
5732
|
}).call(
|
|
5698
5733
|
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i) => {
|
|
@@ -5714,17 +5749,17 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5714
5749
|
(i) => i.id
|
|
5715
5750
|
);
|
|
5716
5751
|
const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-decorator");
|
|
5717
|
-
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i,
|
|
5718
|
-
this.dragging || (this.userHighlight.focusOn(
|
|
5719
|
-
}).on($.Click, (i,
|
|
5752
|
+
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i, n) => {
|
|
5753
|
+
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
|
|
5754
|
+
}).on($.Click, (i, n) => {
|
|
5720
5755
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
5721
5756
|
const o = this.userSelection.all();
|
|
5722
5757
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
5723
5758
|
new G(o, !1)
|
|
5724
5759
|
);
|
|
5725
5760
|
}
|
|
5726
|
-
if (
|
|
5727
|
-
const o = ct(
|
|
5761
|
+
if (n.rootElement) {
|
|
5762
|
+
const o = ct(n.rootElement);
|
|
5728
5763
|
this.userSelection.toggle(o), this.diagramEvent$.next(
|
|
5729
5764
|
new G(
|
|
5730
5765
|
[o],
|
|
@@ -5732,45 +5767,45 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5732
5767
|
)
|
|
5733
5768
|
);
|
|
5734
5769
|
}
|
|
5735
|
-
}).on($.ContextMenu, (i,
|
|
5770
|
+
}).on($.ContextMenu, (i, n) => {
|
|
5736
5771
|
if (this.dragging) {
|
|
5737
5772
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
5738
5773
|
return;
|
|
5739
5774
|
}
|
|
5740
|
-
const o = new mt(i,
|
|
5741
|
-
if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) &&
|
|
5775
|
+
const o = new mt(i, n);
|
|
5776
|
+
if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && n.rootElement) {
|
|
5742
5777
|
i.preventDefault();
|
|
5743
|
-
const d = ct(
|
|
5778
|
+
const d = ct(n.rootElement);
|
|
5744
5779
|
this.userHighlight.focusOn(d), this.diagramEvent$.next(
|
|
5745
5780
|
new Q(d)
|
|
5746
5781
|
), this.userSelection.add(d), this.diagramEvent$.next(
|
|
5747
5782
|
new G([d], !0)
|
|
5748
5783
|
), this.contextMenu.open(i);
|
|
5749
5784
|
}
|
|
5750
|
-
}).on($.DoubleClick, (i,
|
|
5751
|
-
const o = new pt(i,
|
|
5785
|
+
}).on($.DoubleClick, (i, n) => {
|
|
5786
|
+
const o = new pt(i, n);
|
|
5752
5787
|
this.diagramEvent$.next(o);
|
|
5753
5788
|
}).call(
|
|
5754
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i,
|
|
5789
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
|
|
5755
5790
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5756
5791
|
this.startMultipleSelection(i);
|
|
5757
5792
|
else {
|
|
5758
5793
|
let o;
|
|
5759
|
-
|
|
5794
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5760
5795
|
}
|
|
5761
|
-
}).on(I.Drag, (i,
|
|
5796
|
+
}).on(I.Drag, (i, n) => {
|
|
5762
5797
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5763
5798
|
this.continueMultipleSelection(i);
|
|
5764
5799
|
else {
|
|
5765
5800
|
let o;
|
|
5766
|
-
|
|
5801
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5767
5802
|
}
|
|
5768
|
-
}).on(I.End, (i,
|
|
5803
|
+
}).on(I.End, (i, n) => {
|
|
5769
5804
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5770
5805
|
this.finishMultipleSelection(i);
|
|
5771
5806
|
else {
|
|
5772
5807
|
let o;
|
|
5773
|
-
|
|
5808
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof D && (o = n.rootElement.node), o ? this.finishMovingNode(i, o) : S();
|
|
5774
5809
|
}
|
|
5775
5810
|
this.secondaryButton = !1;
|
|
5776
5811
|
})
|
|
@@ -5779,21 +5814,21 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5779
5814
|
updateConnectionLabelsInView(t) {
|
|
5780
5815
|
const e = this.selectCanvasView().select(
|
|
5781
5816
|
`[id='${ue(t.id)}']`
|
|
5782
|
-
), l = e.select("path").node(),
|
|
5817
|
+
), l = e.select("path").node(), r = {
|
|
5783
5818
|
...V,
|
|
5784
5819
|
...t.type.label
|
|
5785
5820
|
};
|
|
5786
5821
|
if (l) {
|
|
5787
5822
|
const i = l.getTotalLength();
|
|
5788
|
-
let
|
|
5789
|
-
if (
|
|
5823
|
+
let n = 0, o = 0, d = 0, c = 0, h = 0, f = 0;
|
|
5824
|
+
if (r.backgroundColor === "#00000000") {
|
|
5790
5825
|
const u = t.endCoords[0] - t.startCoords[0], k = t.endCoords[1] - t.startCoords[1];
|
|
5791
5826
|
switch (t.startDirection) {
|
|
5792
5827
|
case g.Top:
|
|
5793
|
-
|
|
5828
|
+
n = u >= 0 ? -0.5 : 0.5, h = n;
|
|
5794
5829
|
break;
|
|
5795
5830
|
case g.Bottom:
|
|
5796
|
-
|
|
5831
|
+
n = u >= 0 ? -0.5 : 0.5, h = n;
|
|
5797
5832
|
break;
|
|
5798
5833
|
case g.Left:
|
|
5799
5834
|
o = k > 0 ? -0.5 : 0.5, f = o;
|
|
@@ -5802,7 +5837,7 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5802
5837
|
o = k > 0 ? -0.5 : 0.5, f = o;
|
|
5803
5838
|
break;
|
|
5804
5839
|
default:
|
|
5805
|
-
|
|
5840
|
+
n = 0.5, h = n, o = -0.5, f = o;
|
|
5806
5841
|
}
|
|
5807
5842
|
switch (t.endDirection) {
|
|
5808
5843
|
case g.Top:
|
|
@@ -5822,126 +5857,126 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5822
5857
|
}
|
|
5823
5858
|
Math.abs(u) >= Math.abs(k) ? (d = u > 0 ? -0.5 : 0.5, c = k > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = k > 0 ? -0.5 : 0.5);
|
|
5824
5859
|
}
|
|
5825
|
-
e.select("g.diagram-connection-start-label text").attr("x", 0).attr("y",
|
|
5860
|
+
e.select("g.diagram-connection-start-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
|
|
5826
5861
|
"fill",
|
|
5827
|
-
t.selected ?
|
|
5862
|
+
t.selected ? r.selectedColor : r.color
|
|
5828
5863
|
).style("font-kerning", "none").text(t.startLabel);
|
|
5829
5864
|
const y = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
|
|
5830
5865
|
if (y) {
|
|
5831
|
-
const u = t.startLabel ? y.width / this.zoomTransform.k + Ot(
|
|
5866
|
+
const u = t.startLabel ? y.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.startLabel ? y.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
|
|
5832
5867
|
let b;
|
|
5833
5868
|
switch (t.startDirection) {
|
|
5834
5869
|
case g.Left:
|
|
5835
5870
|
b = l.getPointAtLength(
|
|
5836
|
-
ot(
|
|
5871
|
+
ot(r) + u / 2
|
|
5837
5872
|
);
|
|
5838
5873
|
break;
|
|
5839
5874
|
case g.Right:
|
|
5840
5875
|
b = l.getPointAtLength(
|
|
5841
|
-
B(
|
|
5876
|
+
B(r) + u / 2
|
|
5842
5877
|
);
|
|
5843
5878
|
break;
|
|
5844
5879
|
case g.Top:
|
|
5845
5880
|
b = l.getPointAtLength(
|
|
5846
|
-
K(
|
|
5881
|
+
K(r) + u / 2
|
|
5847
5882
|
);
|
|
5848
5883
|
break;
|
|
5849
5884
|
case g.Bottom:
|
|
5850
5885
|
b = l.getPointAtLength(
|
|
5851
|
-
F(
|
|
5886
|
+
F(r) + u / 2
|
|
5852
5887
|
);
|
|
5853
5888
|
break;
|
|
5854
5889
|
default:
|
|
5855
5890
|
b = l.getPointAtLength(
|
|
5856
5891
|
Math.max(
|
|
5857
|
-
B(
|
|
5858
|
-
ot(
|
|
5859
|
-
F(
|
|
5860
|
-
K(
|
|
5892
|
+
B(r) + u / 2,
|
|
5893
|
+
ot(r) + u / 2,
|
|
5894
|
+
F(r) + k / 2,
|
|
5895
|
+
K(r) + k / 2
|
|
5861
5896
|
)
|
|
5862
5897
|
);
|
|
5863
5898
|
}
|
|
5864
5899
|
e.select("g.diagram-connection-start-label path").attr(
|
|
5865
5900
|
"d",
|
|
5866
|
-
|
|
5901
|
+
Kt(
|
|
5867
5902
|
-u / 2,
|
|
5868
5903
|
-k / 2,
|
|
5869
5904
|
u,
|
|
5870
5905
|
k
|
|
5871
5906
|
)
|
|
5872
|
-
).attr("fill",
|
|
5907
|
+
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
|
|
5873
5908
|
"transform",
|
|
5874
|
-
`translate(${b.x +
|
|
5909
|
+
`translate(${b.x + n * u},${b.y + o * k})`
|
|
5875
5910
|
);
|
|
5876
5911
|
}
|
|
5877
|
-
e.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y",
|
|
5912
|
+
e.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
|
|
5878
5913
|
"fill",
|
|
5879
|
-
t.selected ?
|
|
5914
|
+
t.selected ? r.selectedColor : r.color
|
|
5880
5915
|
).style("font-kerning", "none").text(t.middleLabel);
|
|
5881
5916
|
const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
|
|
5882
5917
|
if (m) {
|
|
5883
|
-
const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(
|
|
5918
|
+
const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, b = l.getPointAtLength(i / 2);
|
|
5884
5919
|
e.select("g.diagram-connection-middle-label path").attr(
|
|
5885
5920
|
"d",
|
|
5886
|
-
|
|
5921
|
+
Kt(
|
|
5887
5922
|
-u / 2,
|
|
5888
5923
|
-k / 2,
|
|
5889
5924
|
u,
|
|
5890
5925
|
k
|
|
5891
5926
|
)
|
|
5892
|
-
).attr("fill",
|
|
5927
|
+
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
|
|
5893
5928
|
"transform",
|
|
5894
5929
|
`translate(${b.x + d * u},${b.y + c * k})`
|
|
5895
5930
|
);
|
|
5896
5931
|
}
|
|
5897
|
-
e.select("g.diagram-connection-end-label text").attr("x", 0).attr("y",
|
|
5932
|
+
e.select("g.diagram-connection-end-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
|
|
5898
5933
|
"fill",
|
|
5899
|
-
t.selected ?
|
|
5934
|
+
t.selected ? r.selectedColor : r.color
|
|
5900
5935
|
).style("font-kerning", "none").text(t.endLabel);
|
|
5901
5936
|
const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
|
|
5902
5937
|
if (p) {
|
|
5903
|
-
const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(
|
|
5938
|
+
const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
|
|
5904
5939
|
let b;
|
|
5905
5940
|
switch (t.endDirection) {
|
|
5906
5941
|
case g.Left:
|
|
5907
5942
|
b = l.getPointAtLength(
|
|
5908
|
-
i - (ot(
|
|
5943
|
+
i - (ot(r) + u / 2)
|
|
5909
5944
|
);
|
|
5910
5945
|
break;
|
|
5911
5946
|
case g.Right:
|
|
5912
5947
|
b = l.getPointAtLength(
|
|
5913
|
-
i - (B(
|
|
5948
|
+
i - (B(r) + u / 2)
|
|
5914
5949
|
);
|
|
5915
5950
|
break;
|
|
5916
5951
|
case g.Top:
|
|
5917
5952
|
b = l.getPointAtLength(
|
|
5918
|
-
i - (K(
|
|
5953
|
+
i - (K(r) + u / 2)
|
|
5919
5954
|
);
|
|
5920
5955
|
break;
|
|
5921
5956
|
case g.Bottom:
|
|
5922
5957
|
b = l.getPointAtLength(
|
|
5923
|
-
i - (F(
|
|
5958
|
+
i - (F(r) + u / 2)
|
|
5924
5959
|
);
|
|
5925
5960
|
break;
|
|
5926
5961
|
default:
|
|
5927
5962
|
b = l.getPointAtLength(
|
|
5928
5963
|
i - Math.max(
|
|
5929
|
-
B(
|
|
5930
|
-
ot(
|
|
5931
|
-
F(
|
|
5932
|
-
K(
|
|
5964
|
+
B(r) + u / 2,
|
|
5965
|
+
ot(r) + u / 2,
|
|
5966
|
+
F(r) + k / 2,
|
|
5967
|
+
K(r) + k / 2
|
|
5933
5968
|
)
|
|
5934
5969
|
);
|
|
5935
5970
|
}
|
|
5936
5971
|
e.select("g.diagram-connection-end-label path").attr(
|
|
5937
5972
|
"d",
|
|
5938
|
-
|
|
5973
|
+
Kt(
|
|
5939
5974
|
-u / 2,
|
|
5940
5975
|
-k / 2,
|
|
5941
5976
|
u,
|
|
5942
5977
|
k
|
|
5943
5978
|
)
|
|
5944
|
-
).attr("fill",
|
|
5979
|
+
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
|
|
5945
5980
|
"transform",
|
|
5946
5981
|
`translate(${b.x + h * u},${b.y + f * k})`
|
|
5947
5982
|
);
|
|
@@ -5959,8 +5994,8 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5959
5994
|
if (!e)
|
|
5960
5995
|
return !1;
|
|
5961
5996
|
if (e.rootElement instanceof z || e.rootElement instanceof D) {
|
|
5962
|
-
const a = this.minimumSizeOfField(e), l = a[0] + B(e.rootElement.type?.label) + ot(e.rootElement.type?.label) - e.rootElement.width,
|
|
5963
|
-
return l <= 0 &&
|
|
5997
|
+
const a = this.minimumSizeOfField(e), l = a[0] + B(e.rootElement.type?.label) + ot(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + F(e.rootElement.type?.label) + K(e.rootElement.type?.label) - e.rootElement.height;
|
|
5998
|
+
return l <= 0 && r <= 0;
|
|
5964
5999
|
}
|
|
5965
6000
|
return !0;
|
|
5966
6001
|
}
|
|
@@ -5969,23 +6004,23 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5969
6004
|
if (a) {
|
|
5970
6005
|
if (a.rootElement instanceof z) {
|
|
5971
6006
|
const l = this.minimumSizeOfField(a);
|
|
5972
|
-
let
|
|
5973
|
-
this.snapToGrid && (
|
|
6007
|
+
let r = l[0] + B(a.rootElement.type.label) + ot(a.rootElement.type.label) - a.rootElement.width, i = l[1] + F(a.rootElement.type.label) + K(a.rootElement.type.label) - a.rootElement.height;
|
|
6008
|
+
this.snapToGrid && (r = Math.ceil(r / this.gridSize) * this.gridSize, i = Math.ceil(i / this.gridSize) * this.gridSize), a.rootElement.width + r < a.rootElement.type.minWidth && (r = a.rootElement.type.minWidth - a.rootElement.width), a.rootElement.height + i < a.rootElement.type.minHeight && (i = a.rootElement.type.minHeight - a.rootElement.height), (e !== !1 || r > 0) && a.rootElement.stretch(g.Right, r), (e !== !1 || i > 0) && a.rootElement.stretch(g.Bottom, i);
|
|
5974
6009
|
}
|
|
5975
6010
|
if (a.rootElement instanceof D) {
|
|
5976
6011
|
const l = this.minimumSizeOfField(a);
|
|
5977
|
-
let
|
|
6012
|
+
let r = l[0], i = l[1];
|
|
5978
6013
|
for (const c of a.rootElement.node?.sections || [])
|
|
5979
|
-
c.label && (c.indexXInNode === a.rootElement.indexXInNode && c.indexYInNode !== a.rootElement.indexYInNode ?
|
|
5980
|
-
|
|
6014
|
+
c.label && (c.indexXInNode === a.rootElement.indexXInNode && c.indexYInNode !== a.rootElement.indexYInNode ? r = Math.max(
|
|
6015
|
+
r,
|
|
5981
6016
|
this.minimumSizeOfField(c.label)[0]
|
|
5982
6017
|
) : c.indexXInNode !== a.rootElement.indexXInNode && c.indexYInNode === a.rootElement.indexYInNode && (i = Math.max(
|
|
5983
6018
|
i,
|
|
5984
6019
|
this.minimumSizeOfField(c.label)[1]
|
|
5985
6020
|
)));
|
|
5986
|
-
l[0] <
|
|
5987
|
-
const
|
|
5988
|
-
let o = l[0] + B(
|
|
6021
|
+
l[0] < r && (l[0] = r), l[1] < i && (l[1] = i);
|
|
6022
|
+
const n = a.rootElement.type;
|
|
6023
|
+
let o = l[0] + B(n?.label) + ot(n?.label) - a.rootElement.width, d = l[1] + F(n?.label) + K(n?.label) - a.rootElement.height;
|
|
5989
6024
|
this.snapToGrid && (o = Math.ceil(o / this.gridSize) * this.gridSize, d = Math.ceil(d / this.gridSize) * this.gridSize), a.rootElement.width + o < (a.rootElement.getMinWidth() || 0) && (o = (a.rootElement.getMinWidth() || 0) - a.rootElement.width), a.rootElement.height + d < (a.rootElement.getMinHeight() || 0) && (d = (a.rootElement.getMinHeight() || 0) - a.rootElement.height), (e || o > 0) && a.rootElement.node?.stretchSections(
|
|
5990
6025
|
g.Right,
|
|
5991
6026
|
o,
|
|
@@ -6003,19 +6038,19 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6003
6038
|
fitNodeInView(t, e = !0) {
|
|
6004
6039
|
const a = this.model.nodes.get(t);
|
|
6005
6040
|
if (a && a.sections.length > 0 && this.priorityThreshold) {
|
|
6006
|
-
let l = 0,
|
|
6041
|
+
let l = 0, r = 0;
|
|
6007
6042
|
for (const i of a.sections)
|
|
6008
6043
|
if (i.getPriority() >= this.priorityThreshold) {
|
|
6009
|
-
const
|
|
6044
|
+
const n = i.coords[0] + i.width - a.coords[0], o = i.coords[1] + i.height - a.coords[1];
|
|
6010
6045
|
l = Math.max(
|
|
6011
6046
|
l,
|
|
6012
|
-
|
|
6013
|
-
),
|
|
6014
|
-
|
|
6047
|
+
n
|
|
6048
|
+
), r = Math.max(
|
|
6049
|
+
r,
|
|
6015
6050
|
o
|
|
6016
6051
|
);
|
|
6017
6052
|
}
|
|
6018
|
-
l += a.type.sectionGrid?.margin || 0,
|
|
6053
|
+
l += a.type.sectionGrid?.margin || 0, r += a.type.sectionGrid?.margin || 0, (e || l > a.width) && a.stretch(g.Right, l - a.width), (e || r > a.height) && a.stretch(g.Bottom, r - a.height);
|
|
6019
6054
|
}
|
|
6020
6055
|
}
|
|
6021
6056
|
selectRoot() {
|
|
@@ -6067,12 +6102,12 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6067
6102
|
this.dropConnection();
|
|
6068
6103
|
return;
|
|
6069
6104
|
}
|
|
6070
|
-
if (!this.allowSharingPorts && (t.incomingConnections.length > 0 || t.outgoingConnections.length > 0)) {
|
|
6105
|
+
if (!this.allowSharingPorts && (t.incomingConnections.filter((e) => !e.removed).length > 0 || t.outgoingConnections.filter((e) => !e.removed).length > 0)) {
|
|
6071
6106
|
this.dropConnection();
|
|
6072
6107
|
return;
|
|
6073
6108
|
}
|
|
6074
6109
|
if (!this.allowSharingBothPorts && this.model.connections.find(
|
|
6075
|
-
(e) => e.start === this.unfinishedConnection?.start && e.end === t || e.end === this.unfinishedConnection?.start && e.start === t
|
|
6110
|
+
(e) => !e.removed && (e.start === this.unfinishedConnection?.start && e.end === t || e.end === this.unfinishedConnection?.start && e.start === t)
|
|
6076
6111
|
) !== void 0) {
|
|
6077
6112
|
this.dropConnection();
|
|
6078
6113
|
return;
|
|
@@ -6134,13 +6169,13 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6134
6169
|
canUserPerformAction(t) {
|
|
6135
6170
|
return this.userActions[t] !== !1;
|
|
6136
6171
|
}
|
|
6137
|
-
createInputField(t, e, a, l,
|
|
6172
|
+
createInputField(t, e, a, l, r, i, n, o, d) {
|
|
6138
6173
|
this.removeInputField();
|
|
6139
6174
|
const c = this.selectCanvasElements().append("foreignObject").attr("x", `${e[0]}px`).attr("y", `${e[1]}px`).attr("width", `${a}px`).attr("height", `${l}px`).style("box-sizing", "border-box").style("border", "1px solid");
|
|
6140
6175
|
this.inputFieldContainer = c;
|
|
6141
6176
|
const h = c.append("xhtml:textarea");
|
|
6142
6177
|
let f, y;
|
|
6143
|
-
h.text(t).style("box-sizing", "border-box").style("width", `${a}px`).style("height", `${l}px`).style("font-size", `${
|
|
6178
|
+
h.text(t).style("box-sizing", "border-box").style("width", `${a}px`).style("height", `${l}px`).style("font-size", `${r}px`).style("font-family", i).style("resize", "none").style("outline", 0).style("border", 0).style("margin", 0).style("padding", 0).on($.KeyDown, (p) => {
|
|
6144
6179
|
p.stopPropagation();
|
|
6145
6180
|
}).on($.KeyUp, (p) => {
|
|
6146
6181
|
if (p.stopPropagation(), p.key === Z.Escape) {
|
|
@@ -6239,24 +6274,24 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6239
6274
|
]) : e.move(l);
|
|
6240
6275
|
} else if (this.currentAction instanceof X) {
|
|
6241
6276
|
e.move(a);
|
|
6242
|
-
const
|
|
6277
|
+
const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
|
|
6243
6278
|
(o) => o.type.childrenTypes.includes(e.type.id)
|
|
6244
6279
|
), i = Ye(
|
|
6245
|
-
|
|
6246
|
-
),
|
|
6247
|
-
if (
|
|
6248
|
-
const o =
|
|
6280
|
+
r
|
|
6281
|
+
), n = i[i.length - 1];
|
|
6282
|
+
if (n !== e.parent && (e.type.canBeParentless || n !== void 0)) {
|
|
6283
|
+
const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Wo(
|
|
6249
6284
|
this,
|
|
6250
6285
|
e.id,
|
|
6251
6286
|
e.parent?.id,
|
|
6252
|
-
|
|
6287
|
+
n?.id,
|
|
6253
6288
|
d,
|
|
6254
6289
|
e.getGeometry(),
|
|
6255
6290
|
o?.id,
|
|
6256
6291
|
o?.getGeometry(e.id),
|
|
6257
6292
|
o?.getGeometry(e.id)
|
|
6258
6293
|
);
|
|
6259
|
-
e.parent?.removeChild(e),
|
|
6294
|
+
e.parent?.removeChild(e), n !== void 0 && n.addChild(e), c.toChildGeometry = e.getGeometry(e.id), c.toAncestorGeometry = o?.getGeometry(e.id), this.currentAction = c;
|
|
6260
6295
|
} else {
|
|
6261
6296
|
const o = e?.getLastAncestor();
|
|
6262
6297
|
this.currentAction.ancestorId = o?.id, this.currentAction.fromAncestorGeometry = o?.getGeometry(e.id), e.parent?.fitToChild(e), this.currentAction.to = e.getGeometry(e.id), this.currentAction.toAncestorGeometry = o?.getGeometry(
|
|
@@ -6303,8 +6338,8 @@ const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6303
6338
|
), S();
|
|
6304
6339
|
}
|
|
6305
6340
|
};
|
|
6306
|
-
|
|
6307
|
-
let ye =
|
|
6341
|
+
Qt.canvasCount = 0;
|
|
6342
|
+
let ye = Qt;
|
|
6308
6343
|
class Qe {
|
|
6309
6344
|
constructor() {
|
|
6310
6345
|
this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
|
|
@@ -6407,24 +6442,24 @@ class Qe {
|
|
|
6407
6442
|
return t;
|
|
6408
6443
|
const e = [...t];
|
|
6409
6444
|
for (let a = 1; ; ++a) {
|
|
6410
|
-
const l = a % 2 > 0 ? a : -a,
|
|
6411
|
-
for (let
|
|
6412
|
-
if (e[0] =
|
|
6445
|
+
const l = a % 2 > 0 ? a : -a, r = l > 0 ? 1 : -1, i = [e[0] + l, e[1] + l];
|
|
6446
|
+
for (let n = e[0]; n !== i[0] + r; n += r)
|
|
6447
|
+
if (e[0] = n, this.get(e) === void 0)
|
|
6413
6448
|
return e;
|
|
6414
|
-
for (let
|
|
6415
|
-
if (e[1] =
|
|
6449
|
+
for (let n = e[1]; n !== i[1] + r; n += r)
|
|
6450
|
+
if (e[1] = n, this.get(e) === void 0)
|
|
6416
6451
|
return e;
|
|
6417
6452
|
}
|
|
6418
6453
|
}
|
|
6419
6454
|
}
|
|
6420
|
-
class
|
|
6455
|
+
class fi {
|
|
6421
6456
|
constructor(t) {
|
|
6422
6457
|
this.gapSize = t;
|
|
6423
6458
|
}
|
|
6424
6459
|
apply(t) {
|
|
6425
6460
|
if (t.nodes.length === 0)
|
|
6426
6461
|
return t;
|
|
6427
|
-
const e = new Qe(), a = t.nodes.filter((
|
|
6462
|
+
const e = new Qe(), a = t.nodes.filter((n) => !n.parent);
|
|
6428
6463
|
for (; a.length > 0; )
|
|
6429
6464
|
to(
|
|
6430
6465
|
a[0],
|
|
@@ -6432,13 +6467,13 @@ class hi {
|
|
|
6432
6467
|
[0, 0],
|
|
6433
6468
|
a
|
|
6434
6469
|
);
|
|
6435
|
-
const l = Math.max(...t.nodes.map((
|
|
6436
|
-
for (let
|
|
6470
|
+
const l = Math.max(...t.nodes.map((n) => n.width)), r = Math.max(...t.nodes.map((n) => n.height)), i = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2;
|
|
6471
|
+
for (let n = e.minY(); n <= e.maxY(); ++n)
|
|
6437
6472
|
for (let o = e.minX(); o <= e.maxX(); ++o) {
|
|
6438
|
-
const d = e.get([o,
|
|
6473
|
+
const d = e.get([o, n]);
|
|
6439
6474
|
d !== void 0 && d.move([
|
|
6440
6475
|
o * (l + i),
|
|
6441
|
-
|
|
6476
|
+
n * (r + i)
|
|
6442
6477
|
]);
|
|
6443
6478
|
}
|
|
6444
6479
|
return t;
|
|
@@ -6447,24 +6482,24 @@ class hi {
|
|
|
6447
6482
|
const to = (s, t, e, a) => {
|
|
6448
6483
|
const l = t.getClosestEmptyCoordinate(e);
|
|
6449
6484
|
t.set(l, s), Y(a, s);
|
|
6450
|
-
for (const
|
|
6451
|
-
a.includes(
|
|
6452
|
-
|
|
6485
|
+
for (const r of s.getAdjacentNodes())
|
|
6486
|
+
a.includes(r) && to(
|
|
6487
|
+
r,
|
|
6453
6488
|
t,
|
|
6454
6489
|
l,
|
|
6455
6490
|
a
|
|
6456
6491
|
);
|
|
6457
6492
|
};
|
|
6458
|
-
class
|
|
6493
|
+
class ui {
|
|
6459
6494
|
constructor(t) {
|
|
6460
6495
|
this.gapSize = t;
|
|
6461
6496
|
}
|
|
6462
6497
|
apply(t) {
|
|
6463
6498
|
if (t.nodes.length === 0)
|
|
6464
6499
|
return t;
|
|
6465
|
-
const e = new Qe(), a = t.nodes.filter((c) => !c.parent), l = {},
|
|
6466
|
-
let i = [
|
|
6467
|
-
for (l[
|
|
6500
|
+
const e = new Qe(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
|
|
6501
|
+
let i = [r];
|
|
6502
|
+
for (l[r.id] = [0, 0]; a.length > 0; ) {
|
|
6468
6503
|
const c = [];
|
|
6469
6504
|
for (const h of i) {
|
|
6470
6505
|
e.set(
|
|
@@ -6484,12 +6519,12 @@ class gi {
|
|
|
6484
6519
|
i = [h], l[h.id] = e.getClosestEmptyCoordinate([0, 0]);
|
|
6485
6520
|
}
|
|
6486
6521
|
}
|
|
6487
|
-
const
|
|
6522
|
+
const n = Math.max(...t.nodes.map((c) => c.width)), o = Math.max(...t.nodes.map((c) => c.height)), d = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2;
|
|
6488
6523
|
for (let c = e.minY(); c <= e.maxY(); ++c)
|
|
6489
6524
|
for (let h = e.minX(); h <= e.maxX(); ++h) {
|
|
6490
6525
|
const f = e.get([h, c]);
|
|
6491
6526
|
f !== void 0 && f.move([
|
|
6492
|
-
h * (
|
|
6527
|
+
h * (n + d),
|
|
6493
6528
|
c * (o + d)
|
|
6494
6529
|
]);
|
|
6495
6530
|
}
|
|
@@ -6504,33 +6539,33 @@ class ne {
|
|
|
6504
6539
|
if (t.nodes.length === 0)
|
|
6505
6540
|
return t;
|
|
6506
6541
|
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2;
|
|
6507
|
-
let a = t.nodes.filter((
|
|
6542
|
+
let a = t.nodes.filter((n) => !n.parent);
|
|
6508
6543
|
const l = a[0];
|
|
6509
6544
|
Y(a, l);
|
|
6510
|
-
const
|
|
6545
|
+
const r = [[l]];
|
|
6511
6546
|
for (; a.length > 0; ) {
|
|
6512
|
-
const
|
|
6513
|
-
for (const d of
|
|
6547
|
+
const n = r[r.length - 1], o = [];
|
|
6548
|
+
for (const d of n) {
|
|
6514
6549
|
const c = d.getAdjacentNodes();
|
|
6515
6550
|
for (const h of c)
|
|
6516
6551
|
a.includes(h) && (Y(a, h), o.push(h));
|
|
6517
6552
|
}
|
|
6518
|
-
o.length > 0 ?
|
|
6553
|
+
o.length > 0 ? r.push(o) : (r.push(a), a = []);
|
|
6519
6554
|
}
|
|
6520
6555
|
let i = 0;
|
|
6521
|
-
for (const
|
|
6556
|
+
for (const n of r) {
|
|
6522
6557
|
let o = 0;
|
|
6523
|
-
for (const c of
|
|
6558
|
+
for (const c of n)
|
|
6524
6559
|
c.move([i, o]), o += e + c.height;
|
|
6525
|
-
const d = Math.max(...
|
|
6560
|
+
const d = Math.max(...n.map((c) => c.width));
|
|
6526
6561
|
i += e + d;
|
|
6527
6562
|
}
|
|
6528
|
-
for (const
|
|
6529
|
-
|
|
6563
|
+
for (const n of t.connections)
|
|
6564
|
+
n.tighten();
|
|
6530
6565
|
return t;
|
|
6531
6566
|
}
|
|
6532
6567
|
}
|
|
6533
|
-
class
|
|
6568
|
+
class pi {
|
|
6534
6569
|
constructor(t) {
|
|
6535
6570
|
this.gapSize = t;
|
|
6536
6571
|
}
|
|
@@ -6538,7 +6573,7 @@ class fi {
|
|
|
6538
6573
|
if (t.nodes.length === 0)
|
|
6539
6574
|
return t;
|
|
6540
6575
|
new ne(this.gapSize).apply(t);
|
|
6541
|
-
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = 0.99, l = 1,
|
|
6576
|
+
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = 0.99, l = 1, r = 0.1, i = 2e5, n = 0.5, o = 1, d = 2e-3;
|
|
6542
6577
|
let c = 100;
|
|
6543
6578
|
for (; c > l; ) {
|
|
6544
6579
|
c = c * a;
|
|
@@ -6561,7 +6596,7 @@ class fi {
|
|
|
6561
6596
|
f.coords,
|
|
6562
6597
|
m.coords
|
|
6563
6598
|
), b = [m.coords[0], m.coords[1]];
|
|
6564
|
-
if (y.includes(m) && k > 0 && (k > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (b[0] = b[0] - (u[0] - p[0]) *
|
|
6599
|
+
if (y.includes(m) && k > 0 && (k > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (b[0] = b[0] - (u[0] - p[0]) * r, b[1] = b[1] - (u[1] - p[1]) * r) : (b[0] = b[0] + (u[0] - p[0]) * n, b[1] = b[1] + (u[1] - p[1]) * n)), k > 0) {
|
|
6565
6600
|
const N = i / (k * k);
|
|
6566
6601
|
b[0] = b[0] + N * (u[0] - p[0]) / k, b[1] = b[1] + N * (u[1] - p[1]) / k;
|
|
6567
6602
|
} else
|
|
@@ -6583,22 +6618,22 @@ class fi {
|
|
|
6583
6618
|
return t;
|
|
6584
6619
|
}
|
|
6585
6620
|
}
|
|
6586
|
-
class
|
|
6621
|
+
class mi {
|
|
6587
6622
|
constructor(t) {
|
|
6588
6623
|
this.gapSize = t;
|
|
6589
6624
|
}
|
|
6590
6625
|
apply(t) {
|
|
6591
6626
|
if (t.nodes.length === 0)
|
|
6592
6627
|
return t;
|
|
6593
|
-
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = t.nodes.filter((
|
|
6594
|
-
a.sort((
|
|
6628
|
+
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = t.nodes.filter((r) => !r.parent);
|
|
6629
|
+
a.sort((r, i) => i.type.priority - r.type.priority);
|
|
6595
6630
|
let l = 0;
|
|
6596
|
-
for (const
|
|
6597
|
-
|
|
6631
|
+
for (const r of a)
|
|
6632
|
+
r.move([l, 0]), l += r.width + e;
|
|
6598
6633
|
return t;
|
|
6599
6634
|
}
|
|
6600
6635
|
}
|
|
6601
|
-
class
|
|
6636
|
+
class vi {
|
|
6602
6637
|
constructor(t) {
|
|
6603
6638
|
this.gapSize = t;
|
|
6604
6639
|
}
|
|
@@ -6612,27 +6647,27 @@ class pi {
|
|
|
6612
6647
|
);
|
|
6613
6648
|
if (e === a)
|
|
6614
6649
|
return new ne(this.gapSize).apply(t), t;
|
|
6615
|
-
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2,
|
|
6616
|
-
if (
|
|
6617
|
-
const c =
|
|
6618
|
-
|
|
6650
|
+
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, r = t.nodes.filter((c) => !c.parent), i = [], n = t.nodes.filter((c) => !c.parent).filter((c) => c.getPriority() >= e), o = [];
|
|
6651
|
+
if (n.length > 1) {
|
|
6652
|
+
const c = n[0];
|
|
6653
|
+
n.splice(0, 1), o.push(c);
|
|
6619
6654
|
const h = [c], f = [c];
|
|
6620
6655
|
for (; h.length > 0; ) {
|
|
6621
6656
|
const y = h[0];
|
|
6622
|
-
h.splice(0, 1),
|
|
6657
|
+
h.splice(0, 1), n.includes(y) && (o.push(y), Y(n, y));
|
|
6623
6658
|
const m = y.getAdjacentNodes();
|
|
6624
6659
|
for (const p of m)
|
|
6625
6660
|
f.includes(p) || (h.push(p), f.push(p));
|
|
6626
6661
|
}
|
|
6627
|
-
for (const y of
|
|
6662
|
+
for (const y of n)
|
|
6628
6663
|
o.push(y);
|
|
6629
6664
|
} else
|
|
6630
|
-
o.push(
|
|
6665
|
+
o.push(n[0]);
|
|
6631
6666
|
for (const c of o)
|
|
6632
|
-
Y(
|
|
6633
|
-
for (i.push([]),
|
|
6634
|
-
const c =
|
|
6635
|
-
|
|
6667
|
+
Y(r, c), i.push([c]);
|
|
6668
|
+
for (i.push([]), r.sort((c, h) => h.type.priority - c.type.priority); r.length > 0; ) {
|
|
6669
|
+
const c = r[0];
|
|
6670
|
+
r.splice(0, 1);
|
|
6636
6671
|
const h = [c], f = [c];
|
|
6637
6672
|
let y = !1;
|
|
6638
6673
|
for (; h.length > 0; ) {
|
|
@@ -6665,7 +6700,7 @@ class pi {
|
|
|
6665
6700
|
return t;
|
|
6666
6701
|
}
|
|
6667
6702
|
}
|
|
6668
|
-
class
|
|
6703
|
+
class yi {
|
|
6669
6704
|
constructor(t) {
|
|
6670
6705
|
this.gapSize = t;
|
|
6671
6706
|
}
|
|
@@ -6679,26 +6714,26 @@ class mi {
|
|
|
6679
6714
|
);
|
|
6680
6715
|
if (e === a)
|
|
6681
6716
|
return new ne(this.gapSize).apply(t), t;
|
|
6682
|
-
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2,
|
|
6683
|
-
for (;
|
|
6684
|
-
const c =
|
|
6685
|
-
|
|
6717
|
+
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, r = t.nodes.filter((c) => !c.parent).sort((c, h) => h.getPriority() - c.getPriority()), i = [];
|
|
6718
|
+
for (; r.length > 0; ) {
|
|
6719
|
+
const c = r[0];
|
|
6720
|
+
r.splice(0, 1);
|
|
6686
6721
|
const h = new Se(void 0, c);
|
|
6687
|
-
eo(h,
|
|
6722
|
+
eo(h, r), i.push(h);
|
|
6688
6723
|
}
|
|
6689
|
-
const
|
|
6724
|
+
const n = [];
|
|
6690
6725
|
for (const c of i)
|
|
6691
|
-
|
|
6726
|
+
n.push([c]), oo(c, n, n.length);
|
|
6692
6727
|
const o = Math.max(...t.nodes.map((c) => c.height));
|
|
6693
6728
|
let d = 0;
|
|
6694
|
-
for (let c = 0; c <
|
|
6729
|
+
for (let c = 0; c < n.length; ++c) {
|
|
6695
6730
|
let h = 0;
|
|
6696
|
-
for (let y = 0; y <
|
|
6697
|
-
const m =
|
|
6731
|
+
for (let y = 0; y < n[c].length; ++y) {
|
|
6732
|
+
const m = n[c][y];
|
|
6698
6733
|
m.node.move([d, h]), h += (l + o) * m.countBranchHeight();
|
|
6699
6734
|
}
|
|
6700
6735
|
const f = Math.max(
|
|
6701
|
-
...
|
|
6736
|
+
...n[c].map((y) => y.node.width)
|
|
6702
6737
|
);
|
|
6703
6738
|
d += l + f;
|
|
6704
6739
|
}
|
|
@@ -6743,32 +6778,32 @@ class Se {
|
|
|
6743
6778
|
}
|
|
6744
6779
|
}
|
|
6745
6780
|
}
|
|
6746
|
-
class
|
|
6781
|
+
class bi {
|
|
6747
6782
|
constructor(t) {
|
|
6748
6783
|
this.gapSize = t;
|
|
6749
6784
|
}
|
|
6750
6785
|
apply(t) {
|
|
6751
6786
|
if (t.nodes.length === 0)
|
|
6752
6787
|
return t;
|
|
6753
|
-
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = t.nodes.filter((
|
|
6754
|
-
a.sort((
|
|
6788
|
+
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = t.nodes.filter((r) => !r.parent);
|
|
6789
|
+
a.sort((r, i) => i.type.priority - r.type.priority);
|
|
6755
6790
|
let l = 0;
|
|
6756
|
-
for (const
|
|
6757
|
-
|
|
6791
|
+
for (const r of a)
|
|
6792
|
+
r.move([0, l]), l += r.height + e;
|
|
6758
6793
|
return t;
|
|
6759
6794
|
}
|
|
6760
6795
|
}
|
|
6761
6796
|
const Re = {
|
|
6762
|
-
adjacency: new
|
|
6797
|
+
adjacency: new fi(),
|
|
6763
6798
|
breadth: new ne(),
|
|
6764
|
-
"breadth-adjacency": new
|
|
6765
|
-
force: new
|
|
6766
|
-
horizontal: new
|
|
6767
|
-
priority: new
|
|
6768
|
-
tree: new
|
|
6769
|
-
vertical: new
|
|
6770
|
-
},
|
|
6771
|
-
class
|
|
6799
|
+
"breadth-adjacency": new ui(),
|
|
6800
|
+
force: new pi(),
|
|
6801
|
+
horizontal: new mi(),
|
|
6802
|
+
priority: new vi(),
|
|
6803
|
+
tree: new yi(),
|
|
6804
|
+
vertical: new bi()
|
|
6805
|
+
}, ki = Oe({}), $t = Oe({});
|
|
6806
|
+
class wi {
|
|
6772
6807
|
constructor(t, e) {
|
|
6773
6808
|
this.onTitleChange = t, this.onValueSetChange = e;
|
|
6774
6809
|
}
|
|
@@ -6793,9 +6828,9 @@ const Ce = ({
|
|
|
6793
6828
|
collapsableAdditionalSelector: e,
|
|
6794
6829
|
collapsed: a,
|
|
6795
6830
|
disabled: l,
|
|
6796
|
-
rule:
|
|
6831
|
+
rule: r,
|
|
6797
6832
|
collapsedValue: i,
|
|
6798
|
-
visibleValue:
|
|
6833
|
+
visibleValue: n,
|
|
6799
6834
|
onCollapse: o
|
|
6800
6835
|
}) => {
|
|
6801
6836
|
const [d, c] = U(a), h = () => {
|
|
@@ -6810,7 +6845,7 @@ const Ce = ({
|
|
|
6810
6845
|
if (!p) throw new Error("collapsableSelector is not a valid ref");
|
|
6811
6846
|
m = x.select(p.current), e && (m = m.select(e));
|
|
6812
6847
|
}
|
|
6813
|
-
m.style(
|
|
6848
|
+
m.style(r, y ? i : n);
|
|
6814
6849
|
}
|
|
6815
6850
|
}, f = () => {
|
|
6816
6851
|
switch (s) {
|
|
@@ -6832,7 +6867,7 @@ const Ce = ({
|
|
|
6832
6867
|
children: /* @__PURE__ */ v("div", { className: f() })
|
|
6833
6868
|
}
|
|
6834
6869
|
) });
|
|
6835
|
-
},
|
|
6870
|
+
}, Si = () => {
|
|
6836
6871
|
const s = Ut($t), t = rt(null), [e, a] = U([]);
|
|
6837
6872
|
lo(s.validatorChange$, s.diagramChange$).pipe(
|
|
6838
6873
|
co(() => l())
|
|
@@ -6840,19 +6875,19 @@ const Ce = ({
|
|
|
6840
6875
|
const l = () => {
|
|
6841
6876
|
a([]);
|
|
6842
6877
|
for (const i of s.validators) {
|
|
6843
|
-
const
|
|
6844
|
-
a(
|
|
6878
|
+
const n = i.validate(s.model);
|
|
6879
|
+
a(n);
|
|
6845
6880
|
}
|
|
6846
|
-
},
|
|
6881
|
+
}, r = (i) => {
|
|
6847
6882
|
if (i.elementId && (i.propertyNames === void 0 || i.propertyNames.length === 0)) {
|
|
6848
|
-
const
|
|
6849
|
-
|
|
6883
|
+
const n = s.model.nodes.get(i.elementId) || s.model.connections.get(i.elementId);
|
|
6884
|
+
n && s.userHighlight.add(n);
|
|
6850
6885
|
} else if (i.elementId && i.propertyNames !== void 0 && i.propertyNames.length > 0) {
|
|
6851
6886
|
s.userSelection.openInPropertyEditor(
|
|
6852
6887
|
s.model.nodes.get(i.elementId) || s.model.connections.get(i.elementId)
|
|
6853
6888
|
);
|
|
6854
|
-
const
|
|
6855
|
-
|
|
6889
|
+
const n = s.model.nodes.get(i.elementId) || s.model.connections.get(i.elementId);
|
|
6890
|
+
n && s.userHighlight.add(n), s.parentComponent?.propertyEditor?.highlightProperty(
|
|
6856
6891
|
...i.propertyNames
|
|
6857
6892
|
);
|
|
6858
6893
|
} else !i.elementId && i.propertyNames !== void 0 && i.propertyNames.length > 0 && (s.userSelection.openInPropertyEditor(), s.parentComponent?.propertyEditor?.highlightProperty(
|
|
@@ -6880,23 +6915,23 @@ const Ce = ({
|
|
|
6880
6915
|
}
|
|
6881
6916
|
) })
|
|
6882
6917
|
] }),
|
|
6883
|
-
e.length > 0 && /* @__PURE__ */ v("div", { className: "daga-error-panel", children: /* @__PURE__ */ v("ol", { children: e.map((i,
|
|
6918
|
+
e.length > 0 && /* @__PURE__ */ v("div", { className: "daga-error-panel", children: /* @__PURE__ */ v("ol", { children: e.map((i, n) => /* @__PURE__ */ v(
|
|
6884
6919
|
"li",
|
|
6885
6920
|
{
|
|
6886
|
-
onClick: () =>
|
|
6921
|
+
onClick: () => r(i),
|
|
6887
6922
|
dangerouslySetInnerHTML: { __html: i.message }
|
|
6888
6923
|
},
|
|
6889
|
-
|
|
6924
|
+
n
|
|
6890
6925
|
)) }) })
|
|
6891
6926
|
] }) });
|
|
6892
|
-
},
|
|
6927
|
+
}, Ci = 200, Ve = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), io = ({
|
|
6893
6928
|
disabled: s,
|
|
6894
6929
|
options: t,
|
|
6895
6930
|
value: e,
|
|
6896
6931
|
onChange: a
|
|
6897
6932
|
}) => {
|
|
6898
|
-
const l = rt(null), [
|
|
6899
|
-
let
|
|
6933
|
+
const l = rt(null), [r, i] = U("");
|
|
6934
|
+
let n;
|
|
6900
6935
|
const [o, d] = U([]), [c, h] = U([]), [f, y] = U([]), [m, p] = U([]), [u, k] = U(!1);
|
|
6901
6936
|
Ct(() => {
|
|
6902
6937
|
i(t.find((A) => St(A.key, e))?.label || "");
|
|
@@ -6905,34 +6940,34 @@ const Ce = ({
|
|
|
6905
6940
|
if (!s)
|
|
6906
6941
|
switch (A.key) {
|
|
6907
6942
|
case Z.PageDown:
|
|
6908
|
-
|
|
6943
|
+
n === void 0 ? (P(0), E(0)) : (P(n + 5), E(n)), A.preventDefault();
|
|
6909
6944
|
break;
|
|
6910
6945
|
case Z.ArrowDown:
|
|
6911
|
-
|
|
6946
|
+
n === void 0 ? (P(0), E(0)) : (P(n + 1), E(n)), A.preventDefault();
|
|
6912
6947
|
break;
|
|
6913
6948
|
case Z.PageUp:
|
|
6914
|
-
|
|
6949
|
+
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 5), E(n)), A.preventDefault();
|
|
6915
6950
|
break;
|
|
6916
6951
|
case Z.ArrowUp:
|
|
6917
|
-
|
|
6952
|
+
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)), A.preventDefault();
|
|
6918
6953
|
break;
|
|
6919
6954
|
case Z.Escape:
|
|
6920
6955
|
R(), A.preventDefault();
|
|
6921
6956
|
break;
|
|
6922
6957
|
case Z.Enter:
|
|
6923
|
-
O(t[
|
|
6958
|
+
O(t[n || 0]), A.preventDefault();
|
|
6924
6959
|
break;
|
|
6925
6960
|
default:
|
|
6926
6961
|
N();
|
|
6927
6962
|
}
|
|
6928
6963
|
}, N = () => {
|
|
6929
6964
|
if (!s) {
|
|
6930
|
-
const A = Ve(
|
|
6965
|
+
const A = Ve(r.trim());
|
|
6931
6966
|
d([]), h([]), y([]), p([]);
|
|
6932
6967
|
for (const _ of t) {
|
|
6933
6968
|
const q = Ve(_.label).indexOf(A);
|
|
6934
6969
|
if (q >= 0) {
|
|
6935
|
-
const
|
|
6970
|
+
const Bt = _.label.substring(0, q), J = _.label.substring(
|
|
6936
6971
|
q,
|
|
6937
6972
|
q + A.length
|
|
6938
6973
|
), wt = _.label.substring(
|
|
@@ -6940,7 +6975,7 @@ const Ce = ({
|
|
|
6940
6975
|
);
|
|
6941
6976
|
d((nt) => [...nt, _]), h((nt) => [
|
|
6942
6977
|
...nt,
|
|
6943
|
-
|
|
6978
|
+
Bt
|
|
6944
6979
|
]), y((nt) => [
|
|
6945
6980
|
...nt,
|
|
6946
6981
|
J
|
|
@@ -6956,21 +6991,21 @@ const Ce = ({
|
|
|
6956
6991
|
k(!1);
|
|
6957
6992
|
}, P = (A) => {
|
|
6958
6993
|
if (!s) {
|
|
6959
|
-
if (
|
|
6994
|
+
if (n = A, A === void 0)
|
|
6960
6995
|
return;
|
|
6961
|
-
A < 0 && (
|
|
6996
|
+
A < 0 && (n = 0), A >= t.length && (n = t.length - 1);
|
|
6962
6997
|
}
|
|
6963
6998
|
}, tt = () => {
|
|
6964
6999
|
setTimeout(() => {
|
|
6965
7000
|
R();
|
|
6966
|
-
},
|
|
7001
|
+
}, Ci);
|
|
6967
7002
|
}, E = (A) => {
|
|
6968
7003
|
const _ = l.current?.querySelectorAll("li")[A];
|
|
6969
7004
|
_ && _.scrollIntoView({ block: "center" });
|
|
6970
7005
|
}, C = () => {
|
|
6971
|
-
s || (i(""), k(!1),
|
|
7006
|
+
s || (i(""), k(!1), n = void 0);
|
|
6972
7007
|
}, O = (A) => {
|
|
6973
|
-
s || (i(A.label), k(!1),
|
|
7008
|
+
s || (i(A.label), k(!1), n = void 0, a(A.key));
|
|
6974
7009
|
};
|
|
6975
7010
|
return /* @__PURE__ */ M(
|
|
6976
7011
|
"div",
|
|
@@ -6982,7 +7017,7 @@ const Ce = ({
|
|
|
6982
7017
|
/* @__PURE__ */ v(
|
|
6983
7018
|
"input",
|
|
6984
7019
|
{
|
|
6985
|
-
value:
|
|
7020
|
+
value: r,
|
|
6986
7021
|
disabled: s,
|
|
6987
7022
|
onKeyUp: b,
|
|
6988
7023
|
onFocus: N,
|
|
@@ -6990,14 +7025,14 @@ const Ce = ({
|
|
|
6990
7025
|
onChange: (A) => i(A.target.value)
|
|
6991
7026
|
}
|
|
6992
7027
|
),
|
|
6993
|
-
|
|
7028
|
+
r !== "" && /* @__PURE__ */ v("button", { className: "daga-clear", onClick: C })
|
|
6994
7029
|
] }),
|
|
6995
7030
|
/* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ M("ul", { className: "daga-autocomplete-option-list", children: [
|
|
6996
7031
|
o.length === 0 && /* @__PURE__ */ v("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
|
|
6997
7032
|
o.map((A, _) => /* @__PURE__ */ M(
|
|
6998
7033
|
"li",
|
|
6999
7034
|
{
|
|
7000
|
-
className: `daga-autocomplete-option ${_ ===
|
|
7035
|
+
className: `daga-autocomplete-option ${_ === n ? "daga-focused" : ""}`,
|
|
7001
7036
|
onMouseMove: () => P(_),
|
|
7002
7037
|
onClick: () => O(A),
|
|
7003
7038
|
children: [
|
|
@@ -7012,16 +7047,16 @@ const Ce = ({
|
|
|
7012
7047
|
]
|
|
7013
7048
|
}
|
|
7014
7049
|
);
|
|
7015
|
-
},
|
|
7050
|
+
}, $i = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ii = ({
|
|
7016
7051
|
disabled: s,
|
|
7017
7052
|
allowRepeats: t,
|
|
7018
7053
|
options: e,
|
|
7019
7054
|
value: a,
|
|
7020
7055
|
onChange: l
|
|
7021
7056
|
}) => {
|
|
7022
|
-
const [
|
|
7057
|
+
const [r, i] = U(), [n, o] = U([]), [d, c] = U([]);
|
|
7023
7058
|
Ct(() => {
|
|
7024
|
-
const u = a.length === 0, k = a.map((b) =>
|
|
7059
|
+
const u = a.length === 0, k = a.map((b) => $i(e, b));
|
|
7025
7060
|
o(k), u && l(a), p();
|
|
7026
7061
|
}, [a, e]);
|
|
7027
7062
|
const h = (u) => {
|
|
@@ -7030,9 +7065,9 @@ const Ce = ({
|
|
|
7030
7065
|
return !0;
|
|
7031
7066
|
return !1;
|
|
7032
7067
|
}, f = (u) => {
|
|
7033
|
-
a.length > u && (a.splice(u, 1), o(
|
|
7068
|
+
a.length > u && (a.splice(u, 1), o(n.filter((k, b) => b !== u)), l(a), p());
|
|
7034
7069
|
}, y = () => {
|
|
7035
|
-
|
|
7070
|
+
r !== void 0 && (t || !h(r)) && (l(a.concat(r)), m());
|
|
7036
7071
|
}, m = () => {
|
|
7037
7072
|
i("");
|
|
7038
7073
|
}, p = () => {
|
|
@@ -7045,7 +7080,7 @@ const Ce = ({
|
|
|
7045
7080
|
};
|
|
7046
7081
|
return /* @__PURE__ */ M("div", { children: [
|
|
7047
7082
|
a.map((u, k) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
|
|
7048
|
-
/* @__PURE__ */ v("span", { className: "daga-input", children:
|
|
7083
|
+
/* @__PURE__ */ v("span", { className: "daga-input", children: n[k] }),
|
|
7049
7084
|
!s && /* @__PURE__ */ v(
|
|
7050
7085
|
"button",
|
|
7051
7086
|
{
|
|
@@ -7061,25 +7096,25 @@ const Ce = ({
|
|
|
7061
7096
|
{
|
|
7062
7097
|
disabled: s,
|
|
7063
7098
|
options: t ? e || [] : d || [],
|
|
7064
|
-
value:
|
|
7099
|
+
value: r,
|
|
7065
7100
|
onChange: i
|
|
7066
7101
|
}
|
|
7067
7102
|
) }),
|
|
7068
7103
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: y, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7069
7104
|
] })
|
|
7070
7105
|
] });
|
|
7071
|
-
},
|
|
7106
|
+
}, Ai = ({
|
|
7072
7107
|
disabled: s,
|
|
7073
7108
|
allowRepeats: t,
|
|
7074
7109
|
value: e,
|
|
7075
7110
|
onChange: a
|
|
7076
7111
|
}) => {
|
|
7077
|
-
const [l,
|
|
7112
|
+
const [l, r] = U(""), i = (f) => {
|
|
7078
7113
|
for (const y of f || [])
|
|
7079
7114
|
if (y === f)
|
|
7080
7115
|
return !0;
|
|
7081
7116
|
return !1;
|
|
7082
|
-
},
|
|
7117
|
+
}, n = (f) => {
|
|
7083
7118
|
e.length > f && a(e.filter((y, m) => m !== f));
|
|
7084
7119
|
}, o = (f, y, m) => {
|
|
7085
7120
|
const p = e.map(
|
|
@@ -7090,7 +7125,7 @@ const Ce = ({
|
|
|
7090
7125
|
const f = l.trim();
|
|
7091
7126
|
f !== "" && (t || !i(f)) && (a(e.concat(f)), c());
|
|
7092
7127
|
}, c = () => {
|
|
7093
|
-
|
|
7128
|
+
r("");
|
|
7094
7129
|
}, h = (f) => {
|
|
7095
7130
|
f.key === "Enter" && d();
|
|
7096
7131
|
};
|
|
@@ -7110,7 +7145,7 @@ const Ce = ({
|
|
|
7110
7145
|
"button",
|
|
7111
7146
|
{
|
|
7112
7147
|
className: "daga-property-button",
|
|
7113
|
-
onClick: () =>
|
|
7148
|
+
onClick: () => n(y),
|
|
7114
7149
|
children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
|
|
7115
7150
|
}
|
|
7116
7151
|
)
|
|
@@ -7123,7 +7158,7 @@ const Ce = ({
|
|
|
7123
7158
|
type: "text",
|
|
7124
7159
|
onKeyUp: h,
|
|
7125
7160
|
value: l,
|
|
7126
|
-
onChange: (f) =>
|
|
7161
|
+
onChange: (f) => r(f.target.value)
|
|
7127
7162
|
}
|
|
7128
7163
|
),
|
|
7129
7164
|
/* @__PURE__ */ v("button", { className: "daga-clear", onClick: c })
|
|
@@ -7131,12 +7166,12 @@ const Ce = ({
|
|
|
7131
7166
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7132
7167
|
] })
|
|
7133
7168
|
] });
|
|
7134
|
-
},
|
|
7169
|
+
}, xi = ({
|
|
7135
7170
|
disabled: s,
|
|
7136
7171
|
value: t,
|
|
7137
7172
|
onChange: e
|
|
7138
7173
|
}) => {
|
|
7139
|
-
const [a, l] = U(""), [
|
|
7174
|
+
const [a, l] = U(""), [r, i] = U(""), [n, o] = U({}), d = (u) => {
|
|
7140
7175
|
const k = {};
|
|
7141
7176
|
Object.keys(t).forEach((b) => {
|
|
7142
7177
|
b !== u && (k[b] = t[b]);
|
|
@@ -7167,7 +7202,7 @@ const Ce = ({
|
|
|
7167
7202
|
}), e(R);
|
|
7168
7203
|
}
|
|
7169
7204
|
}, f = () => {
|
|
7170
|
-
const u = a.trim(), k =
|
|
7205
|
+
const u = a.trim(), k = r.trim();
|
|
7171
7206
|
if (u !== "" && k !== "") {
|
|
7172
7207
|
const b = {};
|
|
7173
7208
|
Object.keys(t).forEach((N) => {
|
|
@@ -7190,7 +7225,7 @@ const Ce = ({
|
|
|
7190
7225
|
className: "daga-input",
|
|
7191
7226
|
type: "text",
|
|
7192
7227
|
disabled: s,
|
|
7193
|
-
value:
|
|
7228
|
+
value: n[u] ?? u,
|
|
7194
7229
|
onChange: (N) => c(u, N.target.value, "change"),
|
|
7195
7230
|
onBlur: (N) => c(u, N.target.value, "blur")
|
|
7196
7231
|
}
|
|
@@ -7235,7 +7270,7 @@ const Ce = ({
|
|
|
7235
7270
|
"input",
|
|
7236
7271
|
{
|
|
7237
7272
|
type: "text",
|
|
7238
|
-
value:
|
|
7273
|
+
value: r,
|
|
7239
7274
|
onKeyUp: p,
|
|
7240
7275
|
onChange: (u) => i(u.target.value),
|
|
7241
7276
|
onBlur: (u) => h(a, u.target.value, "blur")
|
|
@@ -7251,18 +7286,18 @@ const Ce = ({
|
|
|
7251
7286
|
onValueChange: t,
|
|
7252
7287
|
depth: e
|
|
7253
7288
|
}) => {
|
|
7254
|
-
const l = Ut($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0,
|
|
7289
|
+
const l = Ut($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
|
|
7255
7290
|
if (typeof o == "string")
|
|
7256
7291
|
return o;
|
|
7257
7292
|
if (o == null || isNaN(o.valueOf()))
|
|
7258
7293
|
return "";
|
|
7259
7294
|
const d = new Date(o), c = d.getTimezoneOffset();
|
|
7260
7295
|
return d.setMinutes(d.getMinutes() - c), d.toISOString().substring(0, 19);
|
|
7261
|
-
},
|
|
7296
|
+
}, n = (o) => new Date(o);
|
|
7262
7297
|
return /* @__PURE__ */ v("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ M(
|
|
7263
7298
|
"div",
|
|
7264
7299
|
{
|
|
7265
|
-
className: `daga-property ${
|
|
7300
|
+
className: `daga-property ${r(o.name)}`,
|
|
7266
7301
|
children: [
|
|
7267
7302
|
/* @__PURE__ */ v("p", { className: "daga-property-name", children: o.label || o.name }),
|
|
7268
7303
|
o.type === T.Text && /* @__PURE__ */ v(
|
|
@@ -7312,7 +7347,7 @@ const Ce = ({
|
|
|
7312
7347
|
onChange: (d) => t(
|
|
7313
7348
|
s,
|
|
7314
7349
|
o,
|
|
7315
|
-
|
|
7350
|
+
n(d.target.value)
|
|
7316
7351
|
)
|
|
7317
7352
|
}
|
|
7318
7353
|
),
|
|
@@ -7395,7 +7430,7 @@ const Ce = ({
|
|
|
7395
7430
|
}
|
|
7396
7431
|
) }),
|
|
7397
7432
|
(o.type === T.OptionList || o.type === T.OptionSet) && /* @__PURE__ */ v(
|
|
7398
|
-
|
|
7433
|
+
Ii,
|
|
7399
7434
|
{
|
|
7400
7435
|
disabled: o.editable === !1 || !l,
|
|
7401
7436
|
allowRepeats: o.type === T.OptionList,
|
|
@@ -7405,7 +7440,7 @@ const Ce = ({
|
|
|
7405
7440
|
}
|
|
7406
7441
|
),
|
|
7407
7442
|
(o.type === T.TextList || o.type === T.TextSet) && /* @__PURE__ */ v(
|
|
7408
|
-
|
|
7443
|
+
Ai,
|
|
7409
7444
|
{
|
|
7410
7445
|
disabled: o.editable === !1 || !l,
|
|
7411
7446
|
allowRepeats: o.type === T.TextList,
|
|
@@ -7414,7 +7449,7 @@ const Ce = ({
|
|
|
7414
7449
|
}
|
|
7415
7450
|
),
|
|
7416
7451
|
o.type === T.TextMap && /* @__PURE__ */ v(
|
|
7417
|
-
|
|
7452
|
+
xi,
|
|
7418
7453
|
{
|
|
7419
7454
|
disabled: o.editable === !1 || !l,
|
|
7420
7455
|
value: s?.getValue(o.name),
|
|
@@ -7434,7 +7469,7 @@ const Ce = ({
|
|
|
7434
7469
|
o.name
|
|
7435
7470
|
)) });
|
|
7436
7471
|
}, no = ({ valueSet: s, depth: t }) => {
|
|
7437
|
-
const e = Ut($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""),
|
|
7472
|
+
const e = Ut($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
|
|
7438
7473
|
for (const o of s?.displayedProperties || []) {
|
|
7439
7474
|
let d = 0, c = 0, h = 0;
|
|
7440
7475
|
const f = x.select(a.current).select(
|
|
@@ -7492,13 +7527,13 @@ const Ce = ({
|
|
|
7492
7527
|
);
|
|
7493
7528
|
}
|
|
7494
7529
|
return 0;
|
|
7495
|
-
},
|
|
7530
|
+
}, n = (o) => {
|
|
7496
7531
|
if (s === void 0)
|
|
7497
7532
|
return;
|
|
7498
7533
|
let d;
|
|
7499
|
-
o instanceof
|
|
7534
|
+
o instanceof Eo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
|
|
7500
7535
|
o.target?.value || ""
|
|
7501
|
-
) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d),
|
|
7536
|
+
) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
|
|
7502
7537
|
};
|
|
7503
7538
|
return /* @__PURE__ */ M("daga-property-settings", { ref: a, children: [
|
|
7504
7539
|
/* @__PURE__ */ v("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
|
|
@@ -7520,13 +7555,13 @@ const Ce = ({
|
|
|
7520
7555
|
"button",
|
|
7521
7556
|
{
|
|
7522
7557
|
className: "daga-property-button daga-hide-button",
|
|
7523
|
-
onClick: () =>
|
|
7558
|
+
onClick: () => n(o.name),
|
|
7524
7559
|
children: /* @__PURE__ */ v("div", { className: "daga-icon daga-hide-icon" })
|
|
7525
7560
|
}
|
|
7526
7561
|
)
|
|
7527
7562
|
] })
|
|
7528
7563
|
] }),
|
|
7529
|
-
o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children:
|
|
7564
|
+
o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Li(s?.getValue(o.name)) }),
|
|
7530
7565
|
o.type === T.Object && /* @__PURE__ */ v(
|
|
7531
7566
|
no,
|
|
7532
7567
|
{
|
|
@@ -7548,10 +7583,10 @@ const Ce = ({
|
|
|
7548
7583
|
o.name
|
|
7549
7584
|
))
|
|
7550
7585
|
] });
|
|
7551
|
-
},
|
|
7552
|
-
const
|
|
7586
|
+
}, Li = (s) => Array.isArray(s) ? s.join(", ") : Mo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, Ei = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
|
|
7587
|
+
const n = rt(null), [o, d] = U(!1), [c, h] = U(!1), f = () => x.select(n.current);
|
|
7553
7588
|
return Ct(() => {
|
|
7554
|
-
if (
|
|
7589
|
+
if (n.current)
|
|
7555
7590
|
switch (t) {
|
|
7556
7591
|
case g.Bottom:
|
|
7557
7592
|
case g.Top:
|
|
@@ -7565,16 +7600,16 @@ const Ce = ({
|
|
|
7565
7600
|
}, [e, t]), /* @__PURE__ */ v("daga-property-editor", { children: /* @__PURE__ */ M(
|
|
7566
7601
|
"div",
|
|
7567
7602
|
{
|
|
7568
|
-
ref:
|
|
7603
|
+
ref: n,
|
|
7569
7604
|
className: `daga-panel daga-bottom daga-${s} daga-${t}`,
|
|
7570
7605
|
children: [
|
|
7571
7606
|
/* @__PURE__ */ v(
|
|
7572
7607
|
Ce,
|
|
7573
7608
|
{
|
|
7574
|
-
disabled: !
|
|
7609
|
+
disabled: !r || !r.propertySet || !r.propertySet.hasProperties(),
|
|
7575
7610
|
collapsed: o,
|
|
7576
7611
|
direction: t,
|
|
7577
|
-
collapsableSelector:
|
|
7612
|
+
collapsableSelector: n,
|
|
7578
7613
|
collapsableAdditionalSelector: ".daga-panel-content",
|
|
7579
7614
|
rule: "display",
|
|
7580
7615
|
collapsedValue: "none",
|
|
@@ -7582,7 +7617,7 @@ const Ce = ({
|
|
|
7582
7617
|
onCollapse: d
|
|
7583
7618
|
}
|
|
7584
7619
|
),
|
|
7585
|
-
/* @__PURE__ */ v("div", { className: "daga-panel-content", children:
|
|
7620
|
+
/* @__PURE__ */ v("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ M("div", { children: [
|
|
7586
7621
|
l && /* @__PURE__ */ M("p", { className: "daga-title", children: [
|
|
7587
7622
|
l,
|
|
7588
7623
|
/* @__PURE__ */ v(
|
|
@@ -7602,23 +7637,23 @@ const Ce = ({
|
|
|
7602
7637
|
!c && /* @__PURE__ */ v(
|
|
7603
7638
|
so,
|
|
7604
7639
|
{
|
|
7605
|
-
valueSet:
|
|
7640
|
+
valueSet: r,
|
|
7606
7641
|
onValueChange: i,
|
|
7607
7642
|
depth: 0
|
|
7608
7643
|
}
|
|
7609
7644
|
),
|
|
7610
|
-
c && /* @__PURE__ */ v(no, { valueSet:
|
|
7645
|
+
c && /* @__PURE__ */ v(no, { valueSet: r, depth: 0 })
|
|
7611
7646
|
] }) })
|
|
7612
7647
|
]
|
|
7613
7648
|
}
|
|
7614
7649
|
) });
|
|
7615
|
-
},
|
|
7650
|
+
}, Mi = 6, Ti = (s) => {
|
|
7616
7651
|
const t = Ut($t), [e, a] = U(
|
|
7617
7652
|
s.currentPalette || s.palettes[0]
|
|
7618
|
-
), [l,
|
|
7653
|
+
), [l, r] = U(0), [i, n] = U(
|
|
7619
7654
|
void 0
|
|
7620
7655
|
), o = rt(null), d = (p) => {
|
|
7621
|
-
if (a(p), c().selectAll("*").remove(),
|
|
7656
|
+
if (a(p), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
|
|
7622
7657
|
for (const u of p.templates)
|
|
7623
7658
|
f(u);
|
|
7624
7659
|
}, c = () => x.select(o.current).select(".daga-palette-view"), h = (p) => {
|
|
@@ -7629,7 +7664,7 @@ const Ce = ({
|
|
|
7629
7664
|
u.on($.Change, () => {
|
|
7630
7665
|
i && c().selectAll(".daga-template-container.daga-in-category").remove();
|
|
7631
7666
|
const k = u.property("value");
|
|
7632
|
-
|
|
7667
|
+
n(k);
|
|
7633
7668
|
const b = p[k] || [];
|
|
7634
7669
|
for (const N of b)
|
|
7635
7670
|
f(N, "daga-in-category");
|
|
@@ -7671,7 +7706,7 @@ const Ce = ({
|
|
|
7671
7706
|
}).on(I.End, (O) => {
|
|
7672
7707
|
if (t.canUserPerformAction(w.AddNode)) {
|
|
7673
7708
|
if (S(L.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
|
|
7674
|
-
(
|
|
7709
|
+
(Xt) => !Xt.removed && Xt.type.id === p.id
|
|
7675
7710
|
) !== void 0)
|
|
7676
7711
|
return;
|
|
7677
7712
|
const A = t.getPointerLocationRelativeToScreen(O);
|
|
@@ -7698,19 +7733,19 @@ const Ce = ({
|
|
|
7698
7733
|
lt[0],
|
|
7699
7734
|
lt[1]
|
|
7700
7735
|
).filter(
|
|
7701
|
-
(
|
|
7736
|
+
(Xt) => Xt.type.childrenTypes.includes(p.id)
|
|
7702
7737
|
), wt = Ye(
|
|
7703
7738
|
J
|
|
7704
7739
|
), nt = wt[wt.length - 1];
|
|
7705
7740
|
if (!p.canBeParentless && nt === void 0)
|
|
7706
7741
|
return;
|
|
7707
|
-
const
|
|
7742
|
+
const Yt = nt?.getLastAncestor(), $e = new jo(
|
|
7708
7743
|
t,
|
|
7709
7744
|
p,
|
|
7710
7745
|
q,
|
|
7711
7746
|
nt?.id,
|
|
7712
|
-
|
|
7713
|
-
|
|
7747
|
+
Yt?.id,
|
|
7748
|
+
Yt?.getGeometry(),
|
|
7714
7749
|
void 0,
|
|
7715
7750
|
u.label,
|
|
7716
7751
|
u.values
|
|
@@ -7793,7 +7828,7 @@ const Ce = ({
|
|
|
7793
7828
|
)
|
|
7794
7829
|
).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && b.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && b.append("text").attr(
|
|
7795
7830
|
"transform",
|
|
7796
|
-
`translate(${u.width / 2},${u.height / 2 +
|
|
7831
|
+
`translate(${u.width / 2},${u.height / 2 + Mi})`
|
|
7797
7832
|
).attr("x", 0).attr("y", 0).attr("font-size", "20px").attr("text-anchor", "middle").attr("font-family", "'Wonder Unit Sans', sans-serif").attr("font-weight", 400).attr("fill", "#000000").attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
|
|
7798
7833
|
};
|
|
7799
7834
|
return Ct(() => {
|
|
@@ -7841,16 +7876,16 @@ const Ce = ({
|
|
|
7841
7876
|
]
|
|
7842
7877
|
}
|
|
7843
7878
|
) });
|
|
7844
|
-
},
|
|
7879
|
+
}, Ni = ({
|
|
7845
7880
|
location: s,
|
|
7846
7881
|
direction: t,
|
|
7847
7882
|
enableAction: e,
|
|
7848
7883
|
enableFilter: a,
|
|
7849
7884
|
enableLayout: l,
|
|
7850
|
-
enableSelection:
|
|
7885
|
+
enableSelection: r,
|
|
7851
7886
|
enableZoom: i
|
|
7852
7887
|
}) => {
|
|
7853
|
-
let
|
|
7888
|
+
let n = !1, o = !0, d = !1, c, h, f, y;
|
|
7854
7889
|
switch (t) {
|
|
7855
7890
|
case g.Bottom:
|
|
7856
7891
|
c = "height", h = "scaleY", f = "top", y = "bottom";
|
|
@@ -7878,8 +7913,8 @@ const Ce = ({
|
|
|
7878
7913
|
if (!d)
|
|
7879
7914
|
if (o) {
|
|
7880
7915
|
o = !1;
|
|
7881
|
-
const
|
|
7882
|
-
J.transition().duration(500).ease(x.easeLinear).style(c,
|
|
7916
|
+
const Yt = `${4 * J.selectChildren().size()}rem`;
|
|
7917
|
+
J.transition().duration(500).ease(x.easeLinear).style(c, Yt).style("transform", `${h}(1)`), setTimeout(() => {
|
|
7883
7918
|
d = !1;
|
|
7884
7919
|
}, 500);
|
|
7885
7920
|
} else
|
|
@@ -7895,12 +7930,12 @@ const Ce = ({
|
|
|
7895
7930
|
}, tt = () => {
|
|
7896
7931
|
b.layoutFormat && b.layoutFormat in Re && Re[b.layoutFormat].apply(b.model);
|
|
7897
7932
|
}, E = () => {
|
|
7898
|
-
|
|
7933
|
+
n = !n, x.select(
|
|
7899
7934
|
u.current
|
|
7900
|
-
).classed("daga-on",
|
|
7935
|
+
).classed("daga-on", n).classed("daga-off", !n);
|
|
7901
7936
|
const J = b.getPriorityThresholdOptions();
|
|
7902
7937
|
J && J.length >= 2 && b.setPriorityThreshold(
|
|
7903
|
-
J[
|
|
7938
|
+
J[n ? 1 : 0]
|
|
7904
7939
|
);
|
|
7905
7940
|
}, C = () => {
|
|
7906
7941
|
b.actionStack.undo();
|
|
@@ -7914,7 +7949,7 @@ const Ce = ({
|
|
|
7914
7949
|
b.userSelection.pasteFromClipboard();
|
|
7915
7950
|
}, q = () => {
|
|
7916
7951
|
b.userSelection.removeFromModel();
|
|
7917
|
-
},
|
|
7952
|
+
}, Bt = () => {
|
|
7918
7953
|
b.multipleSelectionOn = !0, x.select(
|
|
7919
7954
|
p.current
|
|
7920
7955
|
).classed("daga-on", !0).classed("daga-off", !1);
|
|
@@ -7935,26 +7970,26 @@ const Ce = ({
|
|
|
7935
7970
|
i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
|
|
7936
7971
|
e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
|
|
7937
7972
|
e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7973
|
+
r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: A, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
|
|
7974
|
+
r && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: _, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
|
|
7975
|
+
r && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${n ? "daga-on" : "daga-off"}`, onClick: Bt, ref: p, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
|
|
7976
|
+
r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
|
|
7977
|
+
r && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
|
|
7943
7978
|
l && b.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: tt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
|
|
7944
|
-
a && /* @__PURE__ */ v("button", { className: `daga-filter ${
|
|
7979
|
+
a && /* @__PURE__ */ v("button", { className: `daga-filter ${n ? "daga-on" : "daga-off"}`, onClick: E, ref: u, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
|
|
7945
7980
|
] }),
|
|
7946
7981
|
/* @__PURE__ */ v("button", { className: "daga-more-options", onClick: k, children: o ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
|
|
7947
7982
|
]
|
|
7948
7983
|
}
|
|
7949
7984
|
) });
|
|
7950
|
-
},
|
|
7985
|
+
}, Vi = ({
|
|
7951
7986
|
config: s,
|
|
7952
7987
|
model: t,
|
|
7953
7988
|
onCanvasCreated: e,
|
|
7954
7989
|
onDiagramEvent: a,
|
|
7955
7990
|
onModelChange: l
|
|
7956
7991
|
}) => {
|
|
7957
|
-
const
|
|
7992
|
+
const r = new We(), i = new Je(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = U(void 0), [y, m] = U(void 0), p = {
|
|
7958
7993
|
zoomIn: () => {
|
|
7959
7994
|
},
|
|
7960
7995
|
zoomOut: () => {
|
|
@@ -7972,7 +8007,7 @@ const Ce = ({
|
|
|
7972
8007
|
}, u = {
|
|
7973
8008
|
refreshPalette: () => {
|
|
7974
8009
|
}
|
|
7975
|
-
}, k = new
|
|
8010
|
+
}, k = new wi(
|
|
7976
8011
|
(E) => f(E),
|
|
7977
8012
|
(E) => m(E)
|
|
7978
8013
|
), b = {
|
|
@@ -7992,11 +8027,11 @@ const Ce = ({
|
|
|
7992
8027
|
);
|
|
7993
8028
|
};
|
|
7994
8029
|
Ct(() => {
|
|
7995
|
-
|
|
7996
|
-
}, [
|
|
7997
|
-
|
|
8030
|
+
n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
|
|
8031
|
+
}, [n.current]), ho(() => {
|
|
8032
|
+
n.current && (N(!0), P(n.current), e?.(R));
|
|
7998
8033
|
}, [s]), Ct(() => {
|
|
7999
|
-
t &&
|
|
8034
|
+
t && r.import(R.model, t);
|
|
8000
8035
|
}, [t]);
|
|
8001
8036
|
const tt = (E, C, O) => {
|
|
8002
8037
|
if (y !== void 0 && C.editable !== !1 && !St(E.getValue(C.name), O)) {
|
|
@@ -8008,13 +8043,13 @@ const Ce = ({
|
|
|
8008
8043
|
A.setValues(y.getValues()), A.rootElement = y.rootElement, k.valueSet = A, y.rootElement.valueSet = A, R.propertyEditorChanges$?.next();
|
|
8009
8044
|
}
|
|
8010
8045
|
};
|
|
8011
|
-
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(
|
|
8012
|
-
/* @__PURE__ */ v("div", { className: "daga-append-to", ref:
|
|
8046
|
+
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(ki.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
|
|
8047
|
+
/* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
|
|
8013
8048
|
/* @__PURE__ */ M($t.Provider, { value: R, children: [
|
|
8014
8049
|
s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8015
|
-
|
|
8050
|
+
Ni,
|
|
8016
8051
|
{
|
|
8017
|
-
location: s.components?.buttons?.location ||
|
|
8052
|
+
location: s.components?.buttons?.location || Zt.BottomRight,
|
|
8018
8053
|
direction: s.components?.buttons?.direction || g.Top,
|
|
8019
8054
|
enableAction: s.components?.buttons?.enableAction !== !1,
|
|
8020
8055
|
enableFilter: s.components?.buttons?.enableFilter === !0,
|
|
@@ -8024,9 +8059,9 @@ const Ce = ({
|
|
|
8024
8059
|
}
|
|
8025
8060
|
),
|
|
8026
8061
|
s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
|
|
8027
|
-
|
|
8062
|
+
Ti,
|
|
8028
8063
|
{
|
|
8029
|
-
location: s.components?.palette?.location ||
|
|
8064
|
+
location: s.components?.palette?.location || Zt.TopLeft,
|
|
8030
8065
|
direction: s.components?.palette?.direction || g.Bottom,
|
|
8031
8066
|
width: s.components?.palette?.width || "12rem",
|
|
8032
8067
|
height: s.components?.palette?.height,
|
|
@@ -8034,9 +8069,9 @@ const Ce = ({
|
|
|
8034
8069
|
}
|
|
8035
8070
|
),
|
|
8036
8071
|
s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8037
|
-
|
|
8072
|
+
Ei,
|
|
8038
8073
|
{
|
|
8039
|
-
location: s.components?.propertyEditor?.location ||
|
|
8074
|
+
location: s.components?.propertyEditor?.location || Zt.TopRight,
|
|
8040
8075
|
direction: s.components?.propertyEditor?.direction || g.Bottom,
|
|
8041
8076
|
width: s.components?.propertyEditor?.width || "24rem",
|
|
8042
8077
|
height: s.components?.propertyEditor?.height,
|
|
@@ -8045,10 +8080,10 @@ const Ce = ({
|
|
|
8045
8080
|
onValueChange: tt
|
|
8046
8081
|
}
|
|
8047
8082
|
),
|
|
8048
|
-
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8083
|
+
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(Si, {})
|
|
8049
8084
|
] })
|
|
8050
8085
|
] }) }) }) });
|
|
8051
8086
|
};
|
|
8052
8087
|
export {
|
|
8053
|
-
|
|
8088
|
+
Vi as DagaDiagram
|
|
8054
8089
|
};
|