@metadev/daga-react 4.2.13 → 4.2.14
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 +6 -0
- package/index.js +2 -2
- package/index.mjs +927 -865
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as v, jsxs as
|
|
1
|
+
import { jsx as v, jsxs as T, Fragment as ho } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "d3";
|
|
3
|
-
import { debounceTime as
|
|
4
|
-
import { createContext as
|
|
5
|
-
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}),
|
|
6
|
-
const
|
|
3
|
+
import { debounceTime as go, Subject as Wt, merge as fo, map as uo } from "rxjs";
|
|
4
|
+
import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as Ct, useMemo as po } from "react";
|
|
5
|
+
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), Jt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Jt || {});
|
|
6
|
+
const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Le = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Qt = (s, t, e, a, l, r, i) => {
|
|
7
7
|
const n = (() => {
|
|
8
8
|
switch (r) {
|
|
9
9
|
case "start":
|
|
@@ -11,11 +11,11 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
11
11
|
case "end":
|
|
12
12
|
return a[1] - (t[1] - s[0]);
|
|
13
13
|
case "middle": {
|
|
14
|
-
const d = (t[0] + t[1]) / 2, c = (a[0] + a[1]) / 2, h = t[1] - t[0], f = a[1] - a[0],
|
|
15
|
-
return c +
|
|
14
|
+
const d = (t[0] + t[1]) / 2, c = (a[0] + a[1]) / 2, h = t[1] - t[0], f = a[1] - a[0], b = (s[0] - d) / h;
|
|
15
|
+
return c + b * f;
|
|
16
16
|
}
|
|
17
17
|
default:
|
|
18
|
-
return
|
|
18
|
+
return Le(s[0], t, a);
|
|
19
19
|
}
|
|
20
20
|
})(), o = (() => {
|
|
21
21
|
switch (i) {
|
|
@@ -24,15 +24,15 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
24
24
|
case "end":
|
|
25
25
|
return l[1] - (e[1] - s[1]);
|
|
26
26
|
case "middle": {
|
|
27
|
-
const d = (e[0] + e[1]) / 2, c = (l[0] + l[1]) / 2, h = e[1] - e[0], f = l[1] - l[0],
|
|
28
|
-
return c +
|
|
27
|
+
const d = (e[0] + e[1]) / 2, c = (l[0] + l[1]) / 2, h = e[1] - e[0], f = l[1] - l[0], b = (s[1] - d) / h;
|
|
28
|
+
return c + b * f;
|
|
29
29
|
}
|
|
30
30
|
default:
|
|
31
|
-
return
|
|
31
|
+
return Le(s[1], e, l);
|
|
32
32
|
}
|
|
33
33
|
})();
|
|
34
34
|
return [n, o];
|
|
35
|
-
},
|
|
35
|
+
}, Ue = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, mo = (s, t) => (ut(
|
|
36
36
|
s[0][0],
|
|
37
37
|
t[0][0],
|
|
38
38
|
t[1][0]
|
|
@@ -65,10 +65,10 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
65
65
|
s[1][1],
|
|
66
66
|
s[0][1]
|
|
67
67
|
));
|
|
68
|
-
var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(Z || {}),
|
|
69
|
-
const
|
|
70
|
-
var
|
|
71
|
-
const
|
|
68
|
+
var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(Z || {}), A = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(A || {}), ue = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(ue || {});
|
|
69
|
+
const pe = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
|
|
70
|
+
var De = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(De || {}), Se = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Se || {});
|
|
71
|
+
const vo = 20, yo = (s, t, e, a, l) => {
|
|
72
72
|
if (typeof s == "function")
|
|
73
73
|
return s(
|
|
74
74
|
t,
|
|
@@ -81,7 +81,7 @@ const uo = 20, po = (s, t, e, a, l) => {
|
|
|
81
81
|
if (t.length === 1)
|
|
82
82
|
return `M ${t[0][0]} ${t[0][1]}`;
|
|
83
83
|
{
|
|
84
|
-
l = l ||
|
|
84
|
+
l = l || vo;
|
|
85
85
|
let r = "", i, n;
|
|
86
86
|
switch (s) {
|
|
87
87
|
case "straight":
|
|
@@ -270,7 +270,7 @@ const uo = 20, po = (s, t, e, a, l) => {
|
|
|
270
270
|
}
|
|
271
271
|
return r;
|
|
272
272
|
}
|
|
273
|
-
},
|
|
273
|
+
}, me = (s, t) => {
|
|
274
274
|
switch (s) {
|
|
275
275
|
case "dotted":
|
|
276
276
|
return `${t}`;
|
|
@@ -281,67 +281,67 @@ const uo = 20, po = (s, t, e, a, l) => {
|
|
|
281
281
|
default:
|
|
282
282
|
return "none";
|
|
283
283
|
}
|
|
284
|
-
},
|
|
284
|
+
}, B = (s, t) => {
|
|
285
285
|
const e = s.indexOf(t);
|
|
286
286
|
return e >= 0 && s.splice(e, 1), s;
|
|
287
287
|
};
|
|
288
|
-
var
|
|
289
|
-
const
|
|
288
|
+
var Mt = /* @__PURE__ */ ((s) => (s.Ellipse = "ellipse", s.Empty = "empty", s.Folder = "folder", s.Hexagon = "hexagon", s.Octagon = "octagon", s.Pill = "pill", s.Rectangle = "rectangle", s.Rhombus = "rhombus", s.RoundedRectangle = "rounded-rectangle", s.StickyNote = "sticky-note", s))(Mt || {});
|
|
289
|
+
const ve = (s, t, e, a, l) => {
|
|
290
290
|
if (typeof s == "function")
|
|
291
291
|
return s(t, e, a, l);
|
|
292
292
|
switch (s) {
|
|
293
293
|
case "ellipse":
|
|
294
|
-
return
|
|
294
|
+
return Ye(t, e, a, l);
|
|
295
295
|
case "empty":
|
|
296
|
-
return
|
|
296
|
+
return bo();
|
|
297
297
|
case "folder":
|
|
298
|
-
return
|
|
298
|
+
return ko(t, e, a, l);
|
|
299
299
|
case "hexagon":
|
|
300
|
-
return
|
|
300
|
+
return wo(t, e, a, l);
|
|
301
301
|
case "octagon":
|
|
302
|
-
return
|
|
302
|
+
return So(t, e, a, l);
|
|
303
303
|
case "pill":
|
|
304
|
-
return
|
|
304
|
+
return qt(t, e, a, l);
|
|
305
305
|
case "rectangle":
|
|
306
|
-
return
|
|
306
|
+
return Ee(t, e, a, l);
|
|
307
307
|
case "rhombus":
|
|
308
|
-
return
|
|
308
|
+
return Co(t, e, a, l);
|
|
309
309
|
case "rounded-rectangle":
|
|
310
|
-
return
|
|
310
|
+
return $o(t, e, a, l);
|
|
311
311
|
case "sticky-note":
|
|
312
|
-
return
|
|
312
|
+
return Ao(t, e, a, l);
|
|
313
313
|
default:
|
|
314
|
-
return
|
|
314
|
+
return Ee(t, e, a, l);
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, Ye = (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`, bo = () => "Z", ko = (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`, wo = (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`, So = (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`, qt = (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` : Ye(s, t, e, a), Ee = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, Co = (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`, $o = (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`, Ao = (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`;
|
|
317
317
|
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 || {});
|
|
318
|
-
const
|
|
319
|
-
`).map((t) => t.length)),
|
|
318
|
+
const Io = (s) => Math.max(...s.split(`
|
|
319
|
+
`).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, W = [];
|
|
320
320
|
for (let s = 0; s < 256; ++s)
|
|
321
321
|
W.push((s + 256).toString(16).slice(1));
|
|
322
|
-
function
|
|
322
|
+
function Lo(s, t = 0) {
|
|
323
323
|
return (W[s[t + 0]] + W[s[t + 1]] + W[s[t + 2]] + W[s[t + 3]] + "-" + W[s[t + 4]] + W[s[t + 5]] + "-" + W[s[t + 6]] + W[s[t + 7]] + "-" + W[s[t + 8]] + W[s[t + 9]] + "-" + W[s[t + 10]] + W[s[t + 11]] + W[s[t + 12]] + W[s[t + 13]] + W[s[t + 14]] + W[s[t + 15]]).toLowerCase();
|
|
324
324
|
}
|
|
325
|
-
let
|
|
326
|
-
const
|
|
327
|
-
function
|
|
328
|
-
if (!
|
|
325
|
+
let ae;
|
|
326
|
+
const Eo = new Uint8Array(16);
|
|
327
|
+
function To() {
|
|
328
|
+
if (!ae) {
|
|
329
329
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
330
330
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
331
|
-
|
|
331
|
+
ae = crypto.getRandomValues.bind(crypto);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return ae(Eo);
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
function
|
|
335
|
+
const Mo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Te = { randomUUID: Mo };
|
|
336
|
+
function No(s, t, e) {
|
|
337
337
|
s = s || {};
|
|
338
|
-
const a = s.random ?? s.rng?.() ??
|
|
338
|
+
const a = s.random ?? s.rng?.() ?? To();
|
|
339
339
|
if (a.length < 16)
|
|
340
340
|
throw new Error("Random bytes length must be >= 16");
|
|
341
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
341
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Lo(a);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
return
|
|
343
|
+
function Me(s, t, e) {
|
|
344
|
+
return Te.randomUUID && !s ? Te.randomUUID() : No(s);
|
|
345
345
|
}
|
|
346
346
|
const Nt = (s) => {
|
|
347
347
|
if (typeof s != "object")
|
|
@@ -370,7 +370,7 @@ const Nt = (s) => {
|
|
|
370
370
|
selectedAndHighlightedLook: o
|
|
371
371
|
};
|
|
372
372
|
};
|
|
373
|
-
class
|
|
373
|
+
class ee {
|
|
374
374
|
constructor() {
|
|
375
375
|
this.entities = [], this.entityMap = {};
|
|
376
376
|
}
|
|
@@ -463,7 +463,7 @@ class te {
|
|
|
463
463
|
*/
|
|
464
464
|
remove(t) {
|
|
465
465
|
const e = this.get(t);
|
|
466
|
-
e !== void 0 && (delete this.entityMap[t],
|
|
466
|
+
e !== void 0 && (delete this.entityMap[t], B(this.entities, e));
|
|
467
467
|
}
|
|
468
468
|
/**
|
|
469
469
|
* Gets the number of entities in this set.
|
|
@@ -482,7 +482,7 @@ class te {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
const Pt = 0;
|
|
485
|
-
class
|
|
485
|
+
class At {
|
|
486
486
|
constructor(t, e) {
|
|
487
487
|
this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
|
|
488
488
|
}
|
|
@@ -511,10 +511,10 @@ class It {
|
|
|
511
511
|
* @private
|
|
512
512
|
*/
|
|
513
513
|
select() {
|
|
514
|
-
return this.model.canvas?.selectCanvasView()?.select(`[id='${
|
|
514
|
+
return this.model.canvas?.selectCanvasView()?.select(`[id='${pe(this.id)}']`);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
class ft extends
|
|
517
|
+
class ft extends ee {
|
|
518
518
|
all(t = !1) {
|
|
519
519
|
return t ? super.all() : super.filter((e) => !e.removed);
|
|
520
520
|
}
|
|
@@ -538,7 +538,7 @@ class ft extends te {
|
|
|
538
538
|
}
|
|
539
539
|
remove(t) {
|
|
540
540
|
const e = this.get(t, !0);
|
|
541
|
-
e !== void 0 && (delete this.entityMap[t],
|
|
541
|
+
e !== void 0 && (delete this.entityMap[t], B(this.entities, e));
|
|
542
542
|
}
|
|
543
543
|
size(t = !1) {
|
|
544
544
|
return t ? super.size() : super.filter((e) => !e.removed).length;
|
|
@@ -552,13 +552,13 @@ class ft extends te {
|
|
|
552
552
|
yield e;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
class
|
|
555
|
+
class Po {
|
|
556
556
|
constructor(t, e, a, l, r, i, n) {
|
|
557
557
|
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;
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
var
|
|
561
|
-
class
|
|
560
|
+
var M = /* @__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))(M || {});
|
|
561
|
+
class oe {
|
|
562
562
|
constructor(t = []) {
|
|
563
563
|
this.propertyList = t, this.propertyMap = {};
|
|
564
564
|
for (const e of this.propertyList)
|
|
@@ -577,11 +577,11 @@ class ee {
|
|
|
577
577
|
function kt(s, t) {
|
|
578
578
|
return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
|
|
579
579
|
}
|
|
580
|
-
const
|
|
580
|
+
const Ne = (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), Be = (s, t, e) => {
|
|
581
581
|
const a = {}, l = {};
|
|
582
582
|
for (const r in e.propertySet.propertyMap)
|
|
583
|
-
if (e.propertySet.propertyMap[r].type ===
|
|
584
|
-
const i =
|
|
583
|
+
if (e.propertySet.propertyMap[r].type === M.Object) {
|
|
584
|
+
const i = Be(
|
|
585
585
|
s[r],
|
|
586
586
|
t[r],
|
|
587
587
|
e.getSubValueSet(r)
|
|
@@ -590,7 +590,7 @@ const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0
|
|
|
590
590
|
} else
|
|
591
591
|
St(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
|
|
592
592
|
return [a, l];
|
|
593
|
-
},
|
|
593
|
+
}, zo = (s) => s != null && s.constructor === Object;
|
|
594
594
|
class yt {
|
|
595
595
|
constructor(t, e) {
|
|
596
596
|
this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
|
|
@@ -652,7 +652,7 @@ class yt {
|
|
|
652
652
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
653
653
|
getValue(t) {
|
|
654
654
|
const e = this.propertySet.getProperty(t)?.rootAttribute;
|
|
655
|
-
return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type ===
|
|
655
|
+
return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].getValues() : this.values[t];
|
|
656
656
|
}
|
|
657
657
|
/**
|
|
658
658
|
* Obtains all the values in the set.
|
|
@@ -662,7 +662,7 @@ class yt {
|
|
|
662
662
|
getValues() {
|
|
663
663
|
const t = {};
|
|
664
664
|
for (const e in this.propertySet.propertyMap)
|
|
665
|
-
this.propertySet.getProperty(e).type ===
|
|
665
|
+
this.propertySet.getProperty(e).type === M.Object ? t[e] = this.valueSets[e].getValues() : t[e] = this.getValue(e);
|
|
666
666
|
return t;
|
|
667
667
|
}
|
|
668
668
|
/**
|
|
@@ -673,7 +673,7 @@ class yt {
|
|
|
673
673
|
getValuesForKeys(t) {
|
|
674
674
|
const e = {};
|
|
675
675
|
for (const a in t)
|
|
676
|
-
this.propertySet.getProperty(a).type ===
|
|
676
|
+
this.propertySet.getProperty(a).type === M.Object ? e[a] = this.valueSets[a].getValuesForKeys(
|
|
677
677
|
t[a]
|
|
678
678
|
) : e[a] = this.getValue(a);
|
|
679
679
|
return e;
|
|
@@ -686,7 +686,7 @@ class yt {
|
|
|
686
686
|
getTimestamps() {
|
|
687
687
|
const t = {};
|
|
688
688
|
for (const e in this.propertySet.propertyMap)
|
|
689
|
-
if (this.propertySet.getProperty(e).type ===
|
|
689
|
+
if (this.propertySet.getProperty(e).type === M.Object)
|
|
690
690
|
t[e] = this.valueSets[e].getTimestamps();
|
|
691
691
|
else {
|
|
692
692
|
const l = this.ownTimestamps[e];
|
|
@@ -702,7 +702,7 @@ class yt {
|
|
|
702
702
|
*/
|
|
703
703
|
hasValue(t) {
|
|
704
704
|
const e = this.getValue(t);
|
|
705
|
-
return !
|
|
705
|
+
return !Ne(e);
|
|
706
706
|
}
|
|
707
707
|
/**
|
|
708
708
|
* Checks if the value under the key is not empty or the default value.
|
|
@@ -712,7 +712,7 @@ class yt {
|
|
|
712
712
|
*/
|
|
713
713
|
hasSetValue(t) {
|
|
714
714
|
const e = this.getValue(t), a = this.propertySet.getProperty(t);
|
|
715
|
-
return a && a.type ===
|
|
715
|
+
return a && a.type === M.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !St(e, a?.defaultValue);
|
|
716
716
|
}
|
|
717
717
|
/**
|
|
718
718
|
* Checks if any of the values in the set are not empty or the default value.
|
|
@@ -734,7 +734,7 @@ class yt {
|
|
|
734
734
|
setValue(t, e) {
|
|
735
735
|
const a = this.propertySet.getProperty(t);
|
|
736
736
|
if (a) {
|
|
737
|
-
a.type ===
|
|
737
|
+
a.type === M.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, St(e, a.defaultValue) || this.displayProperty(a));
|
|
738
738
|
const l = a.rootAttribute;
|
|
739
739
|
l != null && this.setRootElementValue(l, e);
|
|
740
740
|
}
|
|
@@ -747,7 +747,7 @@ class yt {
|
|
|
747
747
|
setValues(t) {
|
|
748
748
|
this.resetValues();
|
|
749
749
|
for (const e in t)
|
|
750
|
-
this.propertySet.getProperty(e).type ===
|
|
750
|
+
this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setValues(
|
|
751
751
|
t[e]
|
|
752
752
|
) : this.setValue(e, t[e]);
|
|
753
753
|
}
|
|
@@ -759,7 +759,7 @@ class yt {
|
|
|
759
759
|
setTimestamps(t) {
|
|
760
760
|
this.ownTimestamps = {};
|
|
761
761
|
for (const e in t)
|
|
762
|
-
this.propertySet.getProperty(e).type ===
|
|
762
|
+
this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setTimestamps(
|
|
763
763
|
t[e]
|
|
764
764
|
) : this.ownTimestamps[e] = t[e];
|
|
765
765
|
}
|
|
@@ -770,7 +770,7 @@ class yt {
|
|
|
770
770
|
*/
|
|
771
771
|
overwriteValues(t) {
|
|
772
772
|
for (const e in t)
|
|
773
|
-
this.propertySet.getProperty(e).type ===
|
|
773
|
+
this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].overwriteValues(
|
|
774
774
|
t[e]
|
|
775
775
|
) : this.setValue(e, t[e]);
|
|
776
776
|
}
|
|
@@ -781,7 +781,7 @@ class yt {
|
|
|
781
781
|
*/
|
|
782
782
|
overwriteValuesLww(t, e) {
|
|
783
783
|
for (const a in t)
|
|
784
|
-
this.propertySet.getProperty(a).type ===
|
|
784
|
+
this.propertySet.getProperty(a).type === M.Object ? this.valueSets[a].overwriteValuesLww(
|
|
785
785
|
t[a],
|
|
786
786
|
e
|
|
787
787
|
) : kt(e, this.ownTimestamps[a]) && (this.setValue(a, t[a]), this.ownTimestamps[a] = e);
|
|
@@ -795,7 +795,7 @@ class yt {
|
|
|
795
795
|
this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
|
|
796
796
|
for (const t in this.propertySet.propertyMap) {
|
|
797
797
|
const e = this.propertySet.getProperty(t), a = e.rootAttribute;
|
|
798
|
-
e.type ===
|
|
798
|
+
e.type === M.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Nt(e.defaultValue), a != null && e.defaultValue !== void 0 && !St(
|
|
799
799
|
this.getRootElementValue(a),
|
|
800
800
|
e.defaultValue
|
|
801
801
|
) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
|
|
@@ -808,7 +808,7 @@ class yt {
|
|
|
808
808
|
* @returns The constructed ValueSet.
|
|
809
809
|
*/
|
|
810
810
|
constructSubValueSet(t) {
|
|
811
|
-
const e = this.propertySet.getProperty(t), a = new
|
|
811
|
+
const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new yt(a, this.rootElement);
|
|
812
812
|
return l.overwriteValues(
|
|
813
813
|
Nt(e.defaultValue)
|
|
814
814
|
), l;
|
|
@@ -828,7 +828,7 @@ class yt {
|
|
|
828
828
|
* @param property A property.
|
|
829
829
|
*/
|
|
830
830
|
displayProperty(t) {
|
|
831
|
-
this.displayedProperties.includes(t) || (this.displayedProperties.push(t),
|
|
831
|
+
this.displayedProperties.includes(t) || (this.displayedProperties.push(t), B(this.hiddenProperties, t));
|
|
832
832
|
}
|
|
833
833
|
/**
|
|
834
834
|
* Moves the given property to the list of hidden properties.
|
|
@@ -836,7 +836,7 @@ class yt {
|
|
|
836
836
|
* @param property A property.
|
|
837
837
|
*/
|
|
838
838
|
hideProperty(t) {
|
|
839
|
-
this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t),
|
|
839
|
+
this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), B(this.displayedProperties, t));
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
const et = {
|
|
@@ -846,8 +846,8 @@ const et = {
|
|
|
846
846
|
lookType: "connection-look",
|
|
847
847
|
color: "#000000",
|
|
848
848
|
thickness: 1,
|
|
849
|
-
shape:
|
|
850
|
-
style:
|
|
849
|
+
shape: De.Straight,
|
|
850
|
+
style: Se.Solid,
|
|
851
851
|
selected: {
|
|
852
852
|
color: "#AA00AA"
|
|
853
853
|
},
|
|
@@ -861,7 +861,7 @@ const et = {
|
|
|
861
861
|
endTypes: [],
|
|
862
862
|
properties: []
|
|
863
863
|
};
|
|
864
|
-
class
|
|
864
|
+
class Xe {
|
|
865
865
|
constructor(t) {
|
|
866
866
|
const e = {
|
|
867
867
|
...et,
|
|
@@ -883,7 +883,7 @@ class De {
|
|
|
883
883
|
this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
|
|
884
884
|
} else
|
|
885
885
|
this.defaultEndMarkerLook = null, this.selectedEndMarkerLook = null, this.highlightedEndMarkerLook = null, this.selectedAndHighlightedEndMarkerLook = null;
|
|
886
|
-
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new
|
|
886
|
+
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new oe(e.properties);
|
|
887
887
|
}
|
|
888
888
|
canStartFromType(t) {
|
|
889
889
|
return this.startTypes.indexOf(t) >= 0;
|
|
@@ -892,7 +892,7 @@ class De {
|
|
|
892
892
|
return this.endTypes.indexOf(t) >= 0;
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
class dt extends
|
|
895
|
+
class dt extends At {
|
|
896
896
|
constructor(t, e, a, l, r) {
|
|
897
897
|
if (t.connections.get(r) !== void 0)
|
|
898
898
|
throw new Error(`DiagramConnection with id "${r}" already exists`);
|
|
@@ -1078,7 +1078,7 @@ class dt extends It {
|
|
|
1078
1078
|
* @param start A port.
|
|
1079
1079
|
*/
|
|
1080
1080
|
setStart(t) {
|
|
1081
|
-
this.start !== t ? (this.start !== void 0 &&
|
|
1081
|
+
this.start !== t ? (this.start !== void 0 && B(this.start.outgoingConnections, this), this.start = t, t !== void 0 && (t.outgoingConnections.push(this), this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0])) : (this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0]), this.updateInView();
|
|
1082
1082
|
}
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Set the end of this connection to the given port or reset this connection's ending port if `undefined`.
|
|
@@ -1087,7 +1087,7 @@ class dt extends It {
|
|
|
1087
1087
|
* @param end A port.
|
|
1088
1088
|
*/
|
|
1089
1089
|
setEnd(t) {
|
|
1090
|
-
this.end !== t ? (this.end !== void 0 &&
|
|
1090
|
+
this.end !== t ? (this.end !== void 0 && B(this.end.incomingConnections, this), this.end = t, t !== void 0 && (t.incomingConnections.push(this), this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0])) : (this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0]), this.updateInView();
|
|
1091
1091
|
}
|
|
1092
1092
|
/**
|
|
1093
1093
|
* Reassign the start and end ports of this connection to ports with less distance between them that have the same root element.
|
|
@@ -1161,13 +1161,13 @@ class dt extends It {
|
|
|
1161
1161
|
return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
|
-
class
|
|
1164
|
+
class Ro extends ft {
|
|
1165
1165
|
/**
|
|
1166
1166
|
* Instance a set of connections for the given model. This method is used internally.
|
|
1167
1167
|
* @private
|
|
1168
1168
|
*/
|
|
1169
1169
|
constructor(t) {
|
|
1170
|
-
super(), this.types = new
|
|
1170
|
+
super(), this.types = new ee(), this.model = t;
|
|
1171
1171
|
}
|
|
1172
1172
|
/**
|
|
1173
1173
|
* Instance a new connection and add it to this set.
|
|
@@ -1180,7 +1180,7 @@ class No extends ft {
|
|
|
1180
1180
|
*/
|
|
1181
1181
|
new(t, e, a, l) {
|
|
1182
1182
|
let r;
|
|
1183
|
-
if (t instanceof
|
|
1183
|
+
if (t instanceof Xe)
|
|
1184
1184
|
r = t;
|
|
1185
1185
|
else {
|
|
1186
1186
|
const n = this.types.get(t);
|
|
@@ -1201,10 +1201,10 @@ class No extends ft {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
remove(t) {
|
|
1203
1203
|
const e = this.get(t, !0);
|
|
1204
|
-
e && (
|
|
1204
|
+
e && (B(e.start?.outgoingConnections || [], e), B(e.end?.incomingConnections || [], e), super.remove(t), e.updateInView());
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
|
-
const
|
|
1207
|
+
const V = {
|
|
1208
1208
|
editable: !0,
|
|
1209
1209
|
fontSize: 0,
|
|
1210
1210
|
margin: 0,
|
|
@@ -1214,17 +1214,17 @@ const R = {
|
|
|
1214
1214
|
selectedColor: "#000000",
|
|
1215
1215
|
backgroundColor: "#00000000",
|
|
1216
1216
|
horizontalAlign: Lt.Center,
|
|
1217
|
-
verticalAlign:
|
|
1217
|
+
verticalAlign: Jt.Center,
|
|
1218
1218
|
orientation: g.Top,
|
|
1219
1219
|
fit: !1,
|
|
1220
1220
|
shrink: !0
|
|
1221
1221
|
};
|
|
1222
|
-
class ht extends
|
|
1223
|
-
constructor(t, e, a, l, r, i, n, o, d, c, h, f,
|
|
1224
|
-
const
|
|
1225
|
-
if (t.fields.get(
|
|
1222
|
+
class ht extends At {
|
|
1223
|
+
constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p, u) {
|
|
1224
|
+
const y = `${e?.id}_field`;
|
|
1225
|
+
if (t.fields.get(y) !== void 0)
|
|
1226
1226
|
throw new Error("DiagramField for rootElement already exists");
|
|
1227
|
-
if (super(t,
|
|
1227
|
+
if (super(t, y), 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)))
|
|
1228
1228
|
this.orientation = Number(f);
|
|
1229
1229
|
else
|
|
1230
1230
|
switch (f) {
|
|
@@ -1243,7 +1243,7 @@ class ht extends It {
|
|
|
1243
1243
|
default:
|
|
1244
1244
|
this.orientation = 0;
|
|
1245
1245
|
}
|
|
1246
|
-
this.defaultText =
|
|
1246
|
+
this.defaultText = b, this._text = b, this.editable = m, this.fit = p, this.shrink = u;
|
|
1247
1247
|
}
|
|
1248
1248
|
/**
|
|
1249
1249
|
* Text contents of this field.
|
|
@@ -1276,7 +1276,7 @@ class ht extends It {
|
|
|
1276
1276
|
return this.rootElement?.getPriority() || Pt;
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
class
|
|
1279
|
+
class Vo extends ft {
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Instance a set of fields for the given model. This method is used internally.
|
|
1282
1282
|
* @private
|
|
@@ -1288,7 +1288,7 @@ class Po extends ft {
|
|
|
1288
1288
|
* 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.
|
|
1289
1289
|
* @private
|
|
1290
1290
|
*/
|
|
1291
|
-
new(t, e, a, l, r, i, n, o, d, c, h, f,
|
|
1291
|
+
new(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p) {
|
|
1292
1292
|
const u = new ht(
|
|
1293
1293
|
this.model,
|
|
1294
1294
|
t,
|
|
@@ -1303,7 +1303,7 @@ class Po extends ft {
|
|
|
1303
1303
|
c,
|
|
1304
1304
|
h,
|
|
1305
1305
|
f,
|
|
1306
|
-
|
|
1306
|
+
b,
|
|
1307
1307
|
m,
|
|
1308
1308
|
p
|
|
1309
1309
|
);
|
|
@@ -1314,26 +1314,28 @@ class Po extends ft {
|
|
|
1314
1314
|
e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
|
-
const K = (s) => s?.margin === null || s?.margin === void 0 ?
|
|
1318
|
-
|
|
1317
|
+
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]), Y = (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]), U = (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]);
|
|
1318
|
+
var Gt = /* @__PURE__ */ ((s) => (s[s.OnlyWhenSelected = 0] = "OnlyWhenSelected", s))(Gt || {});
|
|
1319
|
+
const Pe = 1, ze = 1, Oo = 1, Ho = 1;
|
|
1320
|
+
class _o {
|
|
1319
1321
|
constructor(t) {
|
|
1320
1322
|
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 = [];
|
|
1321
1323
|
for (const e of t.sections) {
|
|
1322
1324
|
const a = [];
|
|
1323
1325
|
this.sections.push(a);
|
|
1324
1326
|
for (const l of e)
|
|
1325
|
-
a.push(new
|
|
1327
|
+
a.push(new Go(l));
|
|
1326
1328
|
}
|
|
1327
1329
|
}
|
|
1328
1330
|
}
|
|
1329
|
-
class
|
|
1331
|
+
class Go {
|
|
1330
1332
|
constructor(t) {
|
|
1331
1333
|
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
|
|
1332
|
-
const e = st(t.look ||
|
|
1334
|
+
const e = st(t.look || je);
|
|
1333
1335
|
this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
|
|
1334
1336
|
}
|
|
1335
1337
|
}
|
|
1336
|
-
class
|
|
1338
|
+
class F extends At {
|
|
1337
1339
|
constructor(t, e, a, l, r, i, n, o) {
|
|
1338
1340
|
if (t.sections.get(o) !== void 0)
|
|
1339
1341
|
throw new Error(`DiagramSection with id "${o}" already exists`);
|
|
@@ -1413,10 +1415,10 @@ class D extends It {
|
|
|
1413
1415
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
|
|
1414
1416
|
}
|
|
1415
1417
|
getMinWidth() {
|
|
1416
|
-
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] ||
|
|
1418
|
+
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || Oo;
|
|
1417
1419
|
}
|
|
1418
1420
|
getMinHeight() {
|
|
1419
|
-
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] ||
|
|
1421
|
+
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Ho;
|
|
1420
1422
|
}
|
|
1421
1423
|
getPriority() {
|
|
1422
1424
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
|
|
@@ -1429,7 +1431,7 @@ class D extends It {
|
|
|
1429
1431
|
*/
|
|
1430
1432
|
getResizableX() {
|
|
1431
1433
|
const t = this.type;
|
|
1432
|
-
return t?.resizableX !== void 0 ? t.resizableX : this.node?.
|
|
1434
|
+
return t?.resizableX !== void 0 ? t.resizableX === Gt.OnlyWhenSelected ? this.selected : t.resizableX : this.node?.getResizableX() || !1;
|
|
1433
1435
|
}
|
|
1434
1436
|
/**
|
|
1435
1437
|
* Returns whether this section can be resized vertically.
|
|
@@ -1439,7 +1441,7 @@ class D extends It {
|
|
|
1439
1441
|
*/
|
|
1440
1442
|
getResizableY() {
|
|
1441
1443
|
const t = this.type;
|
|
1442
|
-
return t?.resizableY !== void 0 ? t.resizableY : this.node?.
|
|
1444
|
+
return t?.resizableY !== void 0 ? t.resizableY === Gt.OnlyWhenSelected ? this.selected : t.resizableY : this.node?.getResizableY() || !1;
|
|
1443
1445
|
}
|
|
1444
1446
|
/**
|
|
1445
1447
|
* Get the port of this section which is closest to the given coordinates.
|
|
@@ -1559,7 +1561,7 @@ class D extends It {
|
|
|
1559
1561
|
const l = [this.coords[0], this.coords[0] + this.width], r = [this.coords[1], this.coords[1] + this.height];
|
|
1560
1562
|
for (const n of this.ports)
|
|
1561
1563
|
n.move(
|
|
1562
|
-
|
|
1564
|
+
Qt(
|
|
1563
1565
|
n.coords,
|
|
1564
1566
|
e,
|
|
1565
1567
|
a,
|
|
@@ -1571,12 +1573,12 @@ class D extends It {
|
|
|
1571
1573
|
);
|
|
1572
1574
|
const i = this.type;
|
|
1573
1575
|
this.label && (this.label.coords = [
|
|
1574
|
-
this.coords[0] +
|
|
1575
|
-
this.coords[1] +
|
|
1576
|
-
], this.label.width = this.width -
|
|
1576
|
+
this.coords[0] + Y(i?.label),
|
|
1577
|
+
this.coords[1] + U(i?.label)
|
|
1578
|
+
], this.label.width = this.width - Y(i?.label) - ot(i?.label), this.label.height = this.height - U(i?.label) - K(i?.label), this.label.updateInView());
|
|
1577
1579
|
for (const n of this.decorators)
|
|
1578
1580
|
n.move(
|
|
1579
|
-
|
|
1581
|
+
Qt(
|
|
1580
1582
|
n.coords,
|
|
1581
1583
|
e,
|
|
1582
1584
|
a,
|
|
@@ -1589,7 +1591,7 @@ class D extends It {
|
|
|
1589
1591
|
this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((n) => n.tighten()), this.updateInView();
|
|
1590
1592
|
}
|
|
1591
1593
|
}
|
|
1592
|
-
class
|
|
1594
|
+
class Fo extends ft {
|
|
1593
1595
|
/**
|
|
1594
1596
|
* Instance a set of sections for the given model. This method is used internally.
|
|
1595
1597
|
* @private
|
|
@@ -1602,7 +1604,7 @@ class Ho extends ft {
|
|
|
1602
1604
|
* @private
|
|
1603
1605
|
*/
|
|
1604
1606
|
new(t, e, a, l, r, i, n) {
|
|
1605
|
-
const o = new
|
|
1607
|
+
const o = new F(
|
|
1606
1608
|
this.model,
|
|
1607
1609
|
t,
|
|
1608
1610
|
e,
|
|
@@ -1616,7 +1618,7 @@ class Ho extends ft {
|
|
|
1616
1618
|
const d = t.type.sectionGrid?.sections?.[a]?.[e]?.ports;
|
|
1617
1619
|
if (d && d.length > 0)
|
|
1618
1620
|
for (let h = 0; h < d.length; ++h) {
|
|
1619
|
-
const f = d[h],
|
|
1621
|
+
const f = d[h], b = this.model.ports.new(
|
|
1620
1622
|
f.type !== void 0 ? this.model.ports.types.get(f.type) : void 0,
|
|
1621
1623
|
o,
|
|
1622
1624
|
[
|
|
@@ -1632,33 +1634,33 @@ class Ho extends ft {
|
|
|
1632
1634
|
f.anchorPointX || "floating",
|
|
1633
1635
|
f.anchorPointY || "floating"
|
|
1634
1636
|
);
|
|
1635
|
-
if (
|
|
1637
|
+
if (b.type?.label) {
|
|
1636
1638
|
const m = {
|
|
1637
|
-
...
|
|
1638
|
-
...
|
|
1639
|
-
}, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) +
|
|
1640
|
-
let
|
|
1641
|
-
switch (
|
|
1639
|
+
...V,
|
|
1640
|
+
...b.type?.label
|
|
1641
|
+
}, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
|
|
1642
|
+
let y;
|
|
1643
|
+
switch (b.direction) {
|
|
1642
1644
|
case g.Bottom:
|
|
1643
1645
|
case g.Left:
|
|
1644
1646
|
case g.Right:
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1647
|
+
y = [
|
|
1648
|
+
b.coords[0] - p / 2,
|
|
1649
|
+
b.coords[1] - u - K(m)
|
|
1648
1650
|
];
|
|
1649
1651
|
break;
|
|
1650
1652
|
case g.Top:
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1653
|
+
y = [
|
|
1654
|
+
b.coords[0] - p / 2,
|
|
1655
|
+
b.coords[1] + U(m)
|
|
1654
1656
|
];
|
|
1655
1657
|
break;
|
|
1656
1658
|
default:
|
|
1657
|
-
|
|
1659
|
+
y = b.coords;
|
|
1658
1660
|
}
|
|
1659
1661
|
this.model.fields.new(
|
|
1662
|
+
b,
|
|
1660
1663
|
y,
|
|
1661
|
-
k,
|
|
1662
1664
|
m.fontSize,
|
|
1663
1665
|
m.fontFamily,
|
|
1664
1666
|
m.color,
|
|
@@ -1678,21 +1680,21 @@ class Ho extends ft {
|
|
|
1678
1680
|
const c = t.type.sectionGrid?.sections?.[a]?.[e]?.label;
|
|
1679
1681
|
if (c) {
|
|
1680
1682
|
const h = {
|
|
1681
|
-
...
|
|
1683
|
+
...V,
|
|
1682
1684
|
...c
|
|
1683
1685
|
};
|
|
1684
1686
|
this.model.fields.new(
|
|
1685
1687
|
o,
|
|
1686
1688
|
[
|
|
1687
|
-
o.coords[0] +
|
|
1688
|
-
o.coords[1] +
|
|
1689
|
+
o.coords[0] + Y(h),
|
|
1690
|
+
o.coords[1] + U(h)
|
|
1689
1691
|
],
|
|
1690
1692
|
h.fontSize,
|
|
1691
1693
|
h.fontFamily,
|
|
1692
1694
|
h.color,
|
|
1693
1695
|
h.selectedColor,
|
|
1694
|
-
o.width -
|
|
1695
|
-
o.height -
|
|
1696
|
+
o.width - Y(h) - ot(h),
|
|
1697
|
+
o.height - U(h) - K(h),
|
|
1696
1698
|
h.horizontalAlign,
|
|
1697
1699
|
h.verticalAlign,
|
|
1698
1700
|
h.orientation,
|
|
@@ -1709,13 +1711,13 @@ class Ho extends ft {
|
|
|
1709
1711
|
if (e) {
|
|
1710
1712
|
for (; e.ports.length > 0; )
|
|
1711
1713
|
this.model.ports.remove(e.ports[0].id);
|
|
1712
|
-
e.label && this.model.fields.remove(e.label.id), e.node &&
|
|
1714
|
+
e.label && this.model.fields.remove(e.label.id), e.node && B(e.node.sections, e), super.remove(t), e.updateInView();
|
|
1713
1715
|
}
|
|
1714
1716
|
}
|
|
1715
1717
|
}
|
|
1716
|
-
const
|
|
1718
|
+
const je = {
|
|
1717
1719
|
lookType: "shaped-look",
|
|
1718
|
-
shape:
|
|
1720
|
+
shape: Mt.Rectangle,
|
|
1719
1721
|
fillColor: "#FFFFFF",
|
|
1720
1722
|
borderColor: "#000000",
|
|
1721
1723
|
borderThickness: 1,
|
|
@@ -1740,25 +1742,25 @@ const Be = {
|
|
|
1740
1742
|
ports: [],
|
|
1741
1743
|
decorators: [],
|
|
1742
1744
|
sectionGrid: null,
|
|
1743
|
-
look:
|
|
1745
|
+
look: je,
|
|
1744
1746
|
isUnique: !1,
|
|
1745
1747
|
canBeParentless: !0,
|
|
1746
1748
|
childrenTypes: [],
|
|
1747
1749
|
priority: Pt,
|
|
1748
1750
|
properties: []
|
|
1749
1751
|
};
|
|
1750
|
-
class
|
|
1752
|
+
class We {
|
|
1751
1753
|
constructor(t) {
|
|
1752
1754
|
const e = {
|
|
1753
1755
|
...gt,
|
|
1754
1756
|
...t
|
|
1755
1757
|
};
|
|
1756
|
-
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 =
|
|
1758
|
+
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 = Do(e), this.leftPadding = Yo(e), this.rightPadding = Bo(e), this.topPadding = Xo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new _o(e.sectionGrid) : null;
|
|
1757
1759
|
const a = st(e.look);
|
|
1758
|
-
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
|
|
1760
|
+
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 oe(t?.properties || []);
|
|
1759
1761
|
}
|
|
1760
1762
|
}
|
|
1761
|
-
class z extends
|
|
1763
|
+
class z extends At {
|
|
1762
1764
|
constructor(t, e, a = [0, 0], l) {
|
|
1763
1765
|
if (t.nodes.get(l) !== void 0)
|
|
1764
1766
|
throw new Error(`DiagramNode with id "${l}" already exists`);
|
|
@@ -1857,6 +1859,22 @@ class z extends It {
|
|
|
1857
1859
|
getPriority() {
|
|
1858
1860
|
return this.type.priority;
|
|
1859
1861
|
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Returns whether this node can be resized horizontally.
|
|
1864
|
+
* @public
|
|
1865
|
+
*/
|
|
1866
|
+
getResizableX() {
|
|
1867
|
+
const t = this.type.resizableX;
|
|
1868
|
+
return t === Gt.OnlyWhenSelected ? this.selected : t;
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Returns whether this node can be resized vertically.
|
|
1872
|
+
* @public
|
|
1873
|
+
*/
|
|
1874
|
+
getResizableY() {
|
|
1875
|
+
const t = this.type.resizableY;
|
|
1876
|
+
return t === Gt.OnlyWhenSelected ? this.selected : t;
|
|
1877
|
+
}
|
|
1860
1878
|
/**
|
|
1861
1879
|
* Get the port of this node which is closest to the given coordinates.
|
|
1862
1880
|
* @param coords A point in the diagram.
|
|
@@ -1990,7 +2008,7 @@ class z extends It {
|
|
|
1990
2008
|
a || this.children.indexOf(t) >= 0 || (this.fitToChild(t), this.children.push(t), t.parent = this, t.raise());
|
|
1991
2009
|
}
|
|
1992
2010
|
removeChild(t) {
|
|
1993
|
-
|
|
2011
|
+
B(this.children, t), t.parent = void 0;
|
|
1994
2012
|
}
|
|
1995
2013
|
fitToChild(t) {
|
|
1996
2014
|
const e = Math.max(
|
|
@@ -2181,7 +2199,7 @@ class z extends It {
|
|
|
2181
2199
|
}
|
|
2182
2200
|
for (const i of this.ports)
|
|
2183
2201
|
i.move(
|
|
2184
|
-
|
|
2202
|
+
Qt(
|
|
2185
2203
|
i.coords,
|
|
2186
2204
|
e,
|
|
2187
2205
|
a,
|
|
@@ -2192,12 +2210,12 @@ class z extends It {
|
|
|
2192
2210
|
)
|
|
2193
2211
|
);
|
|
2194
2212
|
this.label && (this.label.coords = [
|
|
2195
|
-
this.coords[0] +
|
|
2196
|
-
this.coords[1] +
|
|
2197
|
-
], this.label.width = this.width -
|
|
2213
|
+
this.coords[0] + Y(this.type.label),
|
|
2214
|
+
this.coords[1] + U(this.type.label)
|
|
2215
|
+
], this.label.width = this.width - Y(this.type.label) - ot(this.type.label), this.label.height = this.height - U(this.type.label) - K(this.type.label), this.label.updateInView());
|
|
2198
2216
|
for (const i of this.decorators)
|
|
2199
2217
|
i.move(
|
|
2200
|
-
|
|
2218
|
+
Qt(
|
|
2201
2219
|
i.coords,
|
|
2202
2220
|
e,
|
|
2203
2221
|
a,
|
|
@@ -2312,13 +2330,13 @@ class z extends It {
|
|
|
2312
2330
|
this.stretch(g.Bottom, e + a);
|
|
2313
2331
|
}
|
|
2314
2332
|
}
|
|
2315
|
-
class
|
|
2333
|
+
class Uo extends ft {
|
|
2316
2334
|
/**
|
|
2317
2335
|
* Instance a set of nodes for the given model. This method is used internally.
|
|
2318
2336
|
* @private
|
|
2319
2337
|
*/
|
|
2320
2338
|
constructor(t) {
|
|
2321
|
-
super(), this.types = new
|
|
2339
|
+
super(), this.types = new ee(), this.model = t;
|
|
2322
2340
|
}
|
|
2323
2341
|
/**
|
|
2324
2342
|
* Instance a new node and add it to this set.
|
|
@@ -2330,7 +2348,7 @@ class _o extends ft {
|
|
|
2330
2348
|
*/
|
|
2331
2349
|
new(t, e, a) {
|
|
2332
2350
|
let l;
|
|
2333
|
-
if (t instanceof
|
|
2351
|
+
if (t instanceof We)
|
|
2334
2352
|
l = t;
|
|
2335
2353
|
else {
|
|
2336
2354
|
const i = this.types.get(t);
|
|
@@ -2349,11 +2367,11 @@ class _o extends ft {
|
|
|
2349
2367
|
d,
|
|
2350
2368
|
n,
|
|
2351
2369
|
[o, i],
|
|
2352
|
-
l.sectionGrid.defaultWidths?.[d] ||
|
|
2353
|
-
l.sectionGrid.defaultHeights?.[n] ||
|
|
2370
|
+
l.sectionGrid.defaultWidths?.[d] || Pe,
|
|
2371
|
+
l.sectionGrid.defaultHeights?.[n] || ze,
|
|
2354
2372
|
`${r.id}_${n}_${d}`
|
|
2355
|
-
), o += (l.sectionGrid.defaultWidths?.[d] ||
|
|
2356
|
-
i += (l.sectionGrid.defaultHeights?.[n] ||
|
|
2373
|
+
), o += (l.sectionGrid.defaultWidths?.[d] || Pe) + (l.sectionGrid.margin || 0);
|
|
2374
|
+
i += (l.sectionGrid.defaultHeights?.[n] || ze) + (l.sectionGrid.margin || 0);
|
|
2357
2375
|
}
|
|
2358
2376
|
}
|
|
2359
2377
|
if (l.ports.length > 0)
|
|
@@ -2376,31 +2394,31 @@ class _o extends ft {
|
|
|
2376
2394
|
);
|
|
2377
2395
|
if (d.type?.label) {
|
|
2378
2396
|
const c = {
|
|
2379
|
-
...
|
|
2397
|
+
...V,
|
|
2380
2398
|
...d.type?.label
|
|
2381
|
-
}, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) +
|
|
2382
|
-
let
|
|
2399
|
+
}, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) + Vt(c);
|
|
2400
|
+
let b;
|
|
2383
2401
|
switch (d.direction) {
|
|
2384
2402
|
case g.Bottom:
|
|
2385
2403
|
case g.Left:
|
|
2386
2404
|
case g.Right:
|
|
2387
|
-
|
|
2405
|
+
b = [
|
|
2388
2406
|
d.coords[0] - h / 2,
|
|
2389
2407
|
d.coords[1] - f - K(c)
|
|
2390
2408
|
];
|
|
2391
2409
|
break;
|
|
2392
2410
|
case g.Top:
|
|
2393
|
-
|
|
2411
|
+
b = [
|
|
2394
2412
|
d.coords[0] - h / 2,
|
|
2395
|
-
d.coords[1] +
|
|
2413
|
+
d.coords[1] + U(c)
|
|
2396
2414
|
];
|
|
2397
2415
|
break;
|
|
2398
2416
|
default:
|
|
2399
|
-
|
|
2417
|
+
b = d.coords;
|
|
2400
2418
|
}
|
|
2401
2419
|
this.model.fields.new(
|
|
2402
2420
|
d,
|
|
2403
|
-
|
|
2421
|
+
b,
|
|
2404
2422
|
c.fontSize,
|
|
2405
2423
|
c.fontFamily,
|
|
2406
2424
|
c.color,
|
|
@@ -2419,21 +2437,21 @@ class _o extends ft {
|
|
|
2419
2437
|
}
|
|
2420
2438
|
if (l.label) {
|
|
2421
2439
|
const i = {
|
|
2422
|
-
...
|
|
2440
|
+
...V,
|
|
2423
2441
|
...l.label
|
|
2424
2442
|
};
|
|
2425
2443
|
this.model.fields.new(
|
|
2426
2444
|
r,
|
|
2427
2445
|
[
|
|
2428
|
-
r.coords[0] +
|
|
2429
|
-
r.coords[1] +
|
|
2446
|
+
r.coords[0] + Y(i),
|
|
2447
|
+
r.coords[1] + U(i)
|
|
2430
2448
|
],
|
|
2431
2449
|
i.fontSize,
|
|
2432
2450
|
i.fontFamily,
|
|
2433
2451
|
i.color,
|
|
2434
2452
|
i.selectedColor,
|
|
2435
|
-
r.width -
|
|
2436
|
-
r.height -
|
|
2453
|
+
r.width - Y(i) - ot(i),
|
|
2454
|
+
r.height - U(i) - K(i),
|
|
2437
2455
|
i.horizontalAlign,
|
|
2438
2456
|
i.verticalAlign,
|
|
2439
2457
|
i.orientation,
|
|
@@ -2466,7 +2484,7 @@ class _o extends ft {
|
|
|
2466
2484
|
remove(t) {
|
|
2467
2485
|
const e = this.get(t, !0);
|
|
2468
2486
|
if (e) {
|
|
2469
|
-
for (e.parent &&
|
|
2487
|
+
for (e.parent && B(e.parent.children, e); e.children.length > 0; )
|
|
2470
2488
|
this.model.nodes.remove(e.children[0].id);
|
|
2471
2489
|
for (; e.sections.length > 0; )
|
|
2472
2490
|
this.model.sections.remove(e.sections[0].id);
|
|
@@ -2491,14 +2509,14 @@ class _o extends ft {
|
|
|
2491
2509
|
return a;
|
|
2492
2510
|
}
|
|
2493
2511
|
}
|
|
2494
|
-
const
|
|
2512
|
+
const Ze = (s) => {
|
|
2495
2513
|
for (let t = 0; t < s.length; ++t)
|
|
2496
2514
|
for (let e = 0; e < s.length; ++e)
|
|
2497
2515
|
e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
|
|
2498
2516
|
return s;
|
|
2499
|
-
},
|
|
2517
|
+
}, Do = (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]), Yo = (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], Bo = (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]), Xo = (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]), Ke = {
|
|
2500
2518
|
lookType: "shaped-look",
|
|
2501
|
-
shape:
|
|
2519
|
+
shape: Mt.Ellipse,
|
|
2502
2520
|
fillColor: "transparent",
|
|
2503
2521
|
borderColor: "transparent",
|
|
2504
2522
|
borderThickness: 0,
|
|
@@ -2508,18 +2526,18 @@ const Xe = (s) => {
|
|
|
2508
2526
|
highlighted: {
|
|
2509
2527
|
fillColor: "rgba(0, 255, 255, 0.5)"
|
|
2510
2528
|
}
|
|
2511
|
-
},
|
|
2529
|
+
}, Zt = st(Ke), qe = {
|
|
2512
2530
|
name: "",
|
|
2513
2531
|
label: null,
|
|
2514
2532
|
allowsOutgoing: !0,
|
|
2515
2533
|
allowsIncoming: !0,
|
|
2516
2534
|
width: 24,
|
|
2517
|
-
look:
|
|
2535
|
+
look: Ke
|
|
2518
2536
|
};
|
|
2519
|
-
class
|
|
2537
|
+
class jo {
|
|
2520
2538
|
constructor(t) {
|
|
2521
2539
|
const e = {
|
|
2522
|
-
...
|
|
2540
|
+
...qe,
|
|
2523
2541
|
...t
|
|
2524
2542
|
};
|
|
2525
2543
|
this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
|
|
@@ -2527,7 +2545,7 @@ class Bo {
|
|
|
2527
2545
|
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook;
|
|
2528
2546
|
}
|
|
2529
2547
|
}
|
|
2530
|
-
class bt extends
|
|
2548
|
+
class bt extends At {
|
|
2531
2549
|
constructor(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
2532
2550
|
if (t.ports.get(n) !== void 0)
|
|
2533
2551
|
throw new Error(`DiagramPort with id "${n}" already exists`);
|
|
@@ -2580,7 +2598,7 @@ class bt extends It {
|
|
|
2580
2598
|
* @private
|
|
2581
2599
|
*/
|
|
2582
2600
|
get look() {
|
|
2583
|
-
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type ||
|
|
2601
|
+
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || Zt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || Zt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || Zt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || Zt)?.defaultLook;
|
|
2584
2602
|
}
|
|
2585
2603
|
/**
|
|
2586
2604
|
* An alias for the `lookConfig` attribute.
|
|
@@ -2627,7 +2645,7 @@ class bt extends It {
|
|
|
2627
2645
|
* @private
|
|
2628
2646
|
*/
|
|
2629
2647
|
get width() {
|
|
2630
|
-
return this.type?.width ||
|
|
2648
|
+
return this.type?.width || qe.width;
|
|
2631
2649
|
}
|
|
2632
2650
|
/**
|
|
2633
2651
|
* Current height of this port. Same as the width.
|
|
@@ -2673,7 +2691,7 @@ class bt extends It {
|
|
|
2673
2691
|
getNode() {
|
|
2674
2692
|
if (this.rootElement instanceof z)
|
|
2675
2693
|
return this.rootElement;
|
|
2676
|
-
if (this.rootElement instanceof
|
|
2694
|
+
if (this.rootElement instanceof F)
|
|
2677
2695
|
return this.rootElement.node;
|
|
2678
2696
|
}
|
|
2679
2697
|
getPriority() {
|
|
@@ -2700,16 +2718,16 @@ class bt extends It {
|
|
|
2700
2718
|
]), this.updateInView();
|
|
2701
2719
|
}
|
|
2702
2720
|
distanceTo(t) {
|
|
2703
|
-
return
|
|
2721
|
+
return Ue(this.coords, t);
|
|
2704
2722
|
}
|
|
2705
2723
|
}
|
|
2706
|
-
class
|
|
2724
|
+
class Wo extends ft {
|
|
2707
2725
|
/**
|
|
2708
2726
|
* Instance a set of ports for the given model. This method is used internally.
|
|
2709
2727
|
* @private
|
|
2710
2728
|
*/
|
|
2711
2729
|
constructor(t) {
|
|
2712
|
-
super(), this.types = new
|
|
2730
|
+
super(), this.types = new ee(), this.model = t;
|
|
2713
2731
|
}
|
|
2714
2732
|
/**
|
|
2715
2733
|
* 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.
|
|
@@ -2736,11 +2754,11 @@ class Yo extends ft {
|
|
|
2736
2754
|
this.model.connections.remove(e.outgoingConnections[0].id);
|
|
2737
2755
|
for (; e.incomingConnections.length > 0; )
|
|
2738
2756
|
this.model.connections.remove(e.incomingConnections[0].id);
|
|
2739
|
-
e.label && this.model.fields.remove(e.label.id), (e.rootElement instanceof z || e.rootElement instanceof
|
|
2757
|
+
e.label && this.model.fields.remove(e.label.id), (e.rootElement instanceof z || e.rootElement instanceof F) && B(e.rootElement.ports, e), super.remove(t), e.updateInView();
|
|
2740
2758
|
}
|
|
2741
2759
|
}
|
|
2742
2760
|
}
|
|
2743
|
-
class
|
|
2761
|
+
class Je {
|
|
2744
2762
|
import(t, e) {
|
|
2745
2763
|
t.clear(), e.id && (t.id = e.id), t.name = e.name, t.description = e.description, t.type = e.type, t.createdAt = new Date(e.createdAt), t.updatedAt = new Date(e.updatedAt);
|
|
2746
2764
|
for (const a of e.nodes || [])
|
|
@@ -2772,17 +2790,17 @@ class Ze {
|
|
|
2772
2790
|
}
|
|
2773
2791
|
if (a.label) {
|
|
2774
2792
|
const i = {
|
|
2775
|
-
...
|
|
2793
|
+
...V,
|
|
2776
2794
|
...a.label
|
|
2777
2795
|
}, n = new ht(
|
|
2778
2796
|
t,
|
|
2779
2797
|
l,
|
|
2780
2798
|
[
|
|
2781
|
-
l.coords[0] +
|
|
2782
|
-
l.coords[1] +
|
|
2799
|
+
l.coords[0] + Y(i),
|
|
2800
|
+
l.coords[1] + U(i)
|
|
2783
2801
|
],
|
|
2784
|
-
l.width -
|
|
2785
|
-
l.height -
|
|
2802
|
+
l.width - Y(i) - ot(i),
|
|
2803
|
+
l.height - U(i) - K(i),
|
|
2786
2804
|
i.fontSize,
|
|
2787
2805
|
i.fontFamily,
|
|
2788
2806
|
i.color,
|
|
@@ -2803,7 +2821,7 @@ class Ze {
|
|
|
2803
2821
|
n !== void 0 && (l.children?.push(n), n.parent = l);
|
|
2804
2822
|
}
|
|
2805
2823
|
for (const i of e.sections || []) {
|
|
2806
|
-
const n = new
|
|
2824
|
+
const n = new F(
|
|
2807
2825
|
t,
|
|
2808
2826
|
l,
|
|
2809
2827
|
i.indexXInNode,
|
|
@@ -2815,17 +2833,17 @@ class Ze {
|
|
|
2815
2833
|
);
|
|
2816
2834
|
if (l.sections?.push(n), t.sections.add(n), i.label && a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
|
|
2817
2835
|
const d = {
|
|
2818
|
-
...
|
|
2836
|
+
...V,
|
|
2819
2837
|
...a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label
|
|
2820
2838
|
}, c = new ht(
|
|
2821
2839
|
t,
|
|
2822
2840
|
n,
|
|
2823
2841
|
[
|
|
2824
|
-
n.coords[0] +
|
|
2825
|
-
n.coords[1] +
|
|
2842
|
+
n.coords[0] + Y(d),
|
|
2843
|
+
n.coords[1] + U(d)
|
|
2826
2844
|
],
|
|
2827
|
-
n.width -
|
|
2828
|
-
n.height -
|
|
2845
|
+
n.width - Y(d) - ot(d),
|
|
2846
|
+
n.height - U(d) - K(d),
|
|
2829
2847
|
d.fontSize,
|
|
2830
2848
|
d.fontFamily,
|
|
2831
2849
|
d.color,
|
|
@@ -2854,37 +2872,37 @@ class Ze {
|
|
|
2854
2872
|
if (n.ports.push(h), t.ports.add(h), d.label) {
|
|
2855
2873
|
if (a.ports.length > o && c?.label) {
|
|
2856
2874
|
const f = {
|
|
2857
|
-
...
|
|
2875
|
+
...V,
|
|
2858
2876
|
...c?.label
|
|
2859
2877
|
};
|
|
2860
|
-
let
|
|
2878
|
+
let b;
|
|
2861
2879
|
switch (h.direction) {
|
|
2862
2880
|
case g.Top:
|
|
2863
2881
|
case g.Left:
|
|
2864
|
-
|
|
2882
|
+
b = [
|
|
2865
2883
|
h.coords[0] - f.fontSize,
|
|
2866
2884
|
h.coords[1] - f.fontSize
|
|
2867
2885
|
];
|
|
2868
2886
|
break;
|
|
2869
2887
|
case g.Bottom:
|
|
2870
|
-
|
|
2888
|
+
b = [
|
|
2871
2889
|
h.coords[0] - f.fontSize,
|
|
2872
2890
|
h.coords[1] + f.fontSize
|
|
2873
2891
|
];
|
|
2874
2892
|
break;
|
|
2875
2893
|
case g.Right:
|
|
2876
|
-
|
|
2894
|
+
b = [
|
|
2877
2895
|
h.coords[0] + f.fontSize,
|
|
2878
2896
|
h.coords[1] - f.fontSize
|
|
2879
2897
|
];
|
|
2880
2898
|
break;
|
|
2881
2899
|
default:
|
|
2882
|
-
|
|
2900
|
+
b = h.coords;
|
|
2883
2901
|
}
|
|
2884
2902
|
const m = new ht(
|
|
2885
2903
|
t,
|
|
2886
2904
|
h,
|
|
2887
|
-
|
|
2905
|
+
b,
|
|
2888
2906
|
f.fontSize,
|
|
2889
2907
|
f.fontSize,
|
|
2890
2908
|
f.fontSize,
|
|
@@ -2924,7 +2942,7 @@ class Ze {
|
|
|
2924
2942
|
if (l.ports.push(o), t.ports.add(o), i.label) {
|
|
2925
2943
|
if (a.ports.length > r && n?.label) {
|
|
2926
2944
|
const d = {
|
|
2927
|
-
...
|
|
2945
|
+
...V,
|
|
2928
2946
|
...n?.label
|
|
2929
2947
|
};
|
|
2930
2948
|
let c;
|
|
@@ -2997,7 +3015,7 @@ class Ze {
|
|
|
2997
3015
|
t && e && (t.selfRemoved = e.selfRemoved, t.selfRemovedTimestamp = e.selfRemovedTimestamp, t.textTimestamp = e.textTimestamp);
|
|
2998
3016
|
}
|
|
2999
3017
|
}
|
|
3000
|
-
class
|
|
3018
|
+
class ie {
|
|
3001
3019
|
constructor(t, e, a, l, r, i, n) {
|
|
3002
3020
|
this.canvas = t, this.id = e, this.typeId = a, this.coords = l, this.parentId = r, this.label = i, this.values = n;
|
|
3003
3021
|
}
|
|
@@ -3022,7 +3040,7 @@ class oe {
|
|
|
3022
3040
|
};
|
|
3023
3041
|
}
|
|
3024
3042
|
static deserialize(t, e) {
|
|
3025
|
-
return new
|
|
3043
|
+
return new ie(
|
|
3026
3044
|
t,
|
|
3027
3045
|
e.id,
|
|
3028
3046
|
e.typeId,
|
|
@@ -3033,7 +3051,7 @@ class oe {
|
|
|
3033
3051
|
);
|
|
3034
3052
|
}
|
|
3035
3053
|
}
|
|
3036
|
-
class
|
|
3054
|
+
class Ce {
|
|
3037
3055
|
constructor(t, e, a, l, r, i, n) {
|
|
3038
3056
|
this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex = r, this.removeRowIndex = i, this.timestamp = n;
|
|
3039
3057
|
}
|
|
@@ -3053,7 +3071,7 @@ class ke {
|
|
|
3053
3071
|
};
|
|
3054
3072
|
}
|
|
3055
3073
|
static deserialize(t, e) {
|
|
3056
|
-
return new
|
|
3074
|
+
return new Ce(
|
|
3057
3075
|
t,
|
|
3058
3076
|
e.nodeId,
|
|
3059
3077
|
e.copyColumnIndex,
|
|
@@ -3064,7 +3082,7 @@ class ke {
|
|
|
3064
3082
|
);
|
|
3065
3083
|
}
|
|
3066
3084
|
}
|
|
3067
|
-
class
|
|
3085
|
+
class $e {
|
|
3068
3086
|
constructor(t, e, a) {
|
|
3069
3087
|
this.canvas = t, this.to = e, this.timestamp = a;
|
|
3070
3088
|
}
|
|
@@ -3085,14 +3103,14 @@ class we {
|
|
|
3085
3103
|
};
|
|
3086
3104
|
}
|
|
3087
3105
|
static deserialize(t, e) {
|
|
3088
|
-
return new
|
|
3106
|
+
return new $e(
|
|
3089
3107
|
t,
|
|
3090
3108
|
e.to,
|
|
3091
3109
|
e.timestamp
|
|
3092
3110
|
);
|
|
3093
3111
|
}
|
|
3094
3112
|
}
|
|
3095
|
-
class
|
|
3113
|
+
class Ft {
|
|
3096
3114
|
constructor(t, e, a, l) {
|
|
3097
3115
|
this.canvas = t, this.nodeIds = e, this.delta = a, this.timestamp = l;
|
|
3098
3116
|
}
|
|
@@ -3114,7 +3132,7 @@ class Gt {
|
|
|
3114
3132
|
};
|
|
3115
3133
|
}
|
|
3116
3134
|
static deserialize(t, e) {
|
|
3117
|
-
return new
|
|
3135
|
+
return new Ft(
|
|
3118
3136
|
t,
|
|
3119
3137
|
e.nodeIds,
|
|
3120
3138
|
e.delta,
|
|
@@ -3155,7 +3173,7 @@ class it {
|
|
|
3155
3173
|
);
|
|
3156
3174
|
}
|
|
3157
3175
|
}
|
|
3158
|
-
class
|
|
3176
|
+
class Ut {
|
|
3159
3177
|
constructor(t, e, a, l, r) {
|
|
3160
3178
|
this.canvas = t, this.childId = e, this.parentId = a, this.childGeometry = l, this.timestamp = r;
|
|
3161
3179
|
}
|
|
@@ -3173,7 +3191,7 @@ class Ft {
|
|
|
3173
3191
|
};
|
|
3174
3192
|
}
|
|
3175
3193
|
static deserialize(t, e) {
|
|
3176
|
-
return new
|
|
3194
|
+
return new Ut(
|
|
3177
3195
|
t,
|
|
3178
3196
|
e.childId,
|
|
3179
3197
|
e.parentId,
|
|
@@ -3182,7 +3200,7 @@ class Ft {
|
|
|
3182
3200
|
);
|
|
3183
3201
|
}
|
|
3184
3202
|
}
|
|
3185
|
-
class
|
|
3203
|
+
class se {
|
|
3186
3204
|
constructor(t, e, a, l, r) {
|
|
3187
3205
|
this.canvas = t, this.id = e, this.typeId = a, this.startId = l, this.endId = r;
|
|
3188
3206
|
}
|
|
@@ -3200,7 +3218,7 @@ class ie {
|
|
|
3200
3218
|
};
|
|
3201
3219
|
}
|
|
3202
3220
|
static deserialize(t, e) {
|
|
3203
|
-
return new
|
|
3221
|
+
return new se(
|
|
3204
3222
|
t,
|
|
3205
3223
|
e.id,
|
|
3206
3224
|
e.typeId,
|
|
@@ -3234,7 +3252,7 @@ class Et {
|
|
|
3234
3252
|
);
|
|
3235
3253
|
}
|
|
3236
3254
|
}
|
|
3237
|
-
class
|
|
3255
|
+
class Tt {
|
|
3238
3256
|
constructor(t, e, a, l) {
|
|
3239
3257
|
this.canvas = t, this.id = e, this.to = a, this.timestamp = l;
|
|
3240
3258
|
}
|
|
@@ -3253,7 +3271,7 @@ class Mt {
|
|
|
3253
3271
|
};
|
|
3254
3272
|
}
|
|
3255
3273
|
static deserialize(t, e) {
|
|
3256
|
-
return new
|
|
3274
|
+
return new Tt(
|
|
3257
3275
|
t,
|
|
3258
3276
|
e.id,
|
|
3259
3277
|
e.to,
|
|
@@ -3306,12 +3324,12 @@ class at {
|
|
|
3306
3324
|
);
|
|
3307
3325
|
}
|
|
3308
3326
|
}
|
|
3309
|
-
class
|
|
3327
|
+
class ne {
|
|
3310
3328
|
constructor(t, e, a) {
|
|
3311
3329
|
this.canvas = t, this.nodes = e, this.connections = a;
|
|
3312
3330
|
}
|
|
3313
3331
|
do() {
|
|
3314
|
-
const t = new
|
|
3332
|
+
const t = new Je();
|
|
3315
3333
|
this.canvas.userSelection.clear();
|
|
3316
3334
|
for (const e of this.nodes) {
|
|
3317
3335
|
const a = t.importNode(this.canvas.model, e);
|
|
@@ -3333,16 +3351,16 @@ class se {
|
|
|
3333
3351
|
};
|
|
3334
3352
|
}
|
|
3335
3353
|
static deserialize(t, e) {
|
|
3336
|
-
return new
|
|
3354
|
+
return new ne(
|
|
3337
3355
|
t,
|
|
3338
3356
|
e.nodes,
|
|
3339
3357
|
e.connections
|
|
3340
3358
|
);
|
|
3341
3359
|
}
|
|
3342
3360
|
}
|
|
3343
|
-
class
|
|
3361
|
+
class Zo {
|
|
3344
3362
|
constructor(t) {
|
|
3345
|
-
this.isInRoom = !1, this.canvas = t, this.replicaId =
|
|
3363
|
+
this.isInRoom = !1, this.canvas = t, this.replicaId = Me();
|
|
3346
3364
|
}
|
|
3347
3365
|
/**
|
|
3348
3366
|
* Returns a fresh timestamp, suitable for use by new CollabActions.
|
|
@@ -3354,7 +3372,7 @@ class Xo {
|
|
|
3354
3372
|
* Returns a fresh unique ID, suitable for use by new CollabActions.
|
|
3355
3373
|
*/
|
|
3356
3374
|
freshId() {
|
|
3357
|
-
return "id" +
|
|
3375
|
+
return "id" + Me();
|
|
3358
3376
|
}
|
|
3359
3377
|
/**
|
|
3360
3378
|
* Performs the action - immediately locally, and eventually for remote collaborators.
|
|
@@ -3377,22 +3395,22 @@ class Xo {
|
|
|
3377
3395
|
t.timestamp[0]
|
|
3378
3396
|
)), t.type) {
|
|
3379
3397
|
case "addNode": {
|
|
3380
|
-
|
|
3398
|
+
ie.deserialize(this.canvas, t).do();
|
|
3381
3399
|
break;
|
|
3382
3400
|
}
|
|
3383
3401
|
case "addSection": {
|
|
3384
|
-
|
|
3402
|
+
Ce.deserialize(this.canvas, t).do();
|
|
3385
3403
|
break;
|
|
3386
3404
|
}
|
|
3387
3405
|
case "applyLayout": {
|
|
3388
|
-
|
|
3406
|
+
$e.deserialize(
|
|
3389
3407
|
this.canvas,
|
|
3390
3408
|
t
|
|
3391
3409
|
).do();
|
|
3392
3410
|
break;
|
|
3393
3411
|
}
|
|
3394
3412
|
case "move": {
|
|
3395
|
-
|
|
3413
|
+
Ft.deserialize(this.canvas, t).do();
|
|
3396
3414
|
break;
|
|
3397
3415
|
}
|
|
3398
3416
|
case "setGeometry": {
|
|
@@ -3403,11 +3421,11 @@ class Xo {
|
|
|
3403
3421
|
break;
|
|
3404
3422
|
}
|
|
3405
3423
|
case "setParent": {
|
|
3406
|
-
|
|
3424
|
+
Ut.deserialize(this.canvas, t).do();
|
|
3407
3425
|
break;
|
|
3408
3426
|
}
|
|
3409
3427
|
case "addConnection": {
|
|
3410
|
-
|
|
3428
|
+
se.deserialize(
|
|
3411
3429
|
this.canvas,
|
|
3412
3430
|
t
|
|
3413
3431
|
).do();
|
|
@@ -3418,7 +3436,7 @@ class Xo {
|
|
|
3418
3436
|
break;
|
|
3419
3437
|
}
|
|
3420
3438
|
case "updateValues": {
|
|
3421
|
-
|
|
3439
|
+
Tt.deserialize(
|
|
3422
3440
|
this.canvas,
|
|
3423
3441
|
t
|
|
3424
3442
|
).do();
|
|
@@ -3432,7 +3450,7 @@ class Xo {
|
|
|
3432
3450
|
break;
|
|
3433
3451
|
}
|
|
3434
3452
|
case "paste": {
|
|
3435
|
-
|
|
3453
|
+
ne.deserialize(this.canvas, t).do();
|
|
3436
3454
|
break;
|
|
3437
3455
|
}
|
|
3438
3456
|
default:
|
|
@@ -3443,7 +3461,7 @@ class Xo {
|
|
|
3443
3461
|
}
|
|
3444
3462
|
}
|
|
3445
3463
|
}
|
|
3446
|
-
class
|
|
3464
|
+
class Ko {
|
|
3447
3465
|
constructor(t, e) {
|
|
3448
3466
|
this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
|
|
3449
3467
|
}
|
|
@@ -3496,12 +3514,12 @@ class jo {
|
|
|
3496
3514
|
}
|
|
3497
3515
|
}
|
|
3498
3516
|
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 || {});
|
|
3499
|
-
class
|
|
3517
|
+
class qo {
|
|
3500
3518
|
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3501
3519
|
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();
|
|
3502
3520
|
}
|
|
3503
3521
|
do() {
|
|
3504
|
-
const t = new
|
|
3522
|
+
const t = new ie(
|
|
3505
3523
|
this.canvas,
|
|
3506
3524
|
this.id,
|
|
3507
3525
|
this.type.id,
|
|
@@ -3566,12 +3584,12 @@ class Wo {
|
|
|
3566
3584
|
return t === void 0;
|
|
3567
3585
|
}
|
|
3568
3586
|
}
|
|
3569
|
-
class
|
|
3587
|
+
class le {
|
|
3570
3588
|
constructor(t, e, a) {
|
|
3571
3589
|
this.canvas = t, this.nodeIds = e, this.delta = a;
|
|
3572
3590
|
}
|
|
3573
3591
|
do() {
|
|
3574
|
-
const t = new
|
|
3592
|
+
const t = new Ft(
|
|
3575
3593
|
this.canvas,
|
|
3576
3594
|
this.nodeIds,
|
|
3577
3595
|
this.delta,
|
|
@@ -3580,7 +3598,7 @@ class ae {
|
|
|
3580
3598
|
return this.canvas.collabEngine.doCollaboratively(t), this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) && (this.delta[0] !== 0 || this.delta[1] !== 0);
|
|
3581
3599
|
}
|
|
3582
3600
|
undo() {
|
|
3583
|
-
const t = new
|
|
3601
|
+
const t = new Ft(
|
|
3584
3602
|
this.canvas,
|
|
3585
3603
|
this.nodeIds,
|
|
3586
3604
|
[-this.delta[0], -this.delta[1]],
|
|
@@ -3654,12 +3672,12 @@ class X {
|
|
|
3654
3672
|
return t !== void 0;
|
|
3655
3673
|
}
|
|
3656
3674
|
}
|
|
3657
|
-
class
|
|
3675
|
+
class Jo {
|
|
3658
3676
|
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3659
3677
|
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;
|
|
3660
3678
|
}
|
|
3661
3679
|
do() {
|
|
3662
|
-
const t = this.canvas.model.nodes.get(this.childId), e = new
|
|
3680
|
+
const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
|
|
3663
3681
|
this.canvas,
|
|
3664
3682
|
this.childId,
|
|
3665
3683
|
this.toParentId,
|
|
@@ -3678,7 +3696,7 @@ class Zo {
|
|
|
3678
3696
|
return t !== void 0;
|
|
3679
3697
|
}
|
|
3680
3698
|
undo() {
|
|
3681
|
-
const t = this.canvas.model.nodes.get(this.childId), e = new
|
|
3699
|
+
const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
|
|
3682
3700
|
this.canvas,
|
|
3683
3701
|
this.childId,
|
|
3684
3702
|
this.fromParentId,
|
|
@@ -3700,12 +3718,12 @@ class Zo {
|
|
|
3700
3718
|
return this.do();
|
|
3701
3719
|
}
|
|
3702
3720
|
}
|
|
3703
|
-
class
|
|
3721
|
+
class de {
|
|
3704
3722
|
constructor(t, e, a, l) {
|
|
3705
3723
|
this.canvas = t, this.type = e, this.startId = a, this.endId = l, this.id = this.canvas.collabEngine.freshId();
|
|
3706
3724
|
}
|
|
3707
3725
|
do() {
|
|
3708
|
-
const t = new
|
|
3726
|
+
const t = new se(
|
|
3709
3727
|
this.canvas,
|
|
3710
3728
|
this.id,
|
|
3711
3729
|
this.type.id,
|
|
@@ -3741,7 +3759,7 @@ class le {
|
|
|
3741
3759
|
return this.canvas.collabEngine.doCollaboratively(e), t === void 0;
|
|
3742
3760
|
}
|
|
3743
3761
|
}
|
|
3744
|
-
class
|
|
3762
|
+
class Re {
|
|
3745
3763
|
constructor(t, e, a, l) {
|
|
3746
3764
|
this.canvas = t, this.fieldId = e, this.from = a, this.to = l;
|
|
3747
3765
|
}
|
|
@@ -3783,12 +3801,12 @@ class Ne {
|
|
|
3783
3801
|
return t !== void 0;
|
|
3784
3802
|
}
|
|
3785
3803
|
}
|
|
3786
|
-
class
|
|
3804
|
+
class Qo {
|
|
3787
3805
|
constructor(t, e, a, l) {
|
|
3788
3806
|
this.canvas = t, this.id = e, this.from = a, this.to = l;
|
|
3789
3807
|
}
|
|
3790
3808
|
do() {
|
|
3791
|
-
const t = new
|
|
3809
|
+
const t = new Tt(
|
|
3792
3810
|
this.canvas,
|
|
3793
3811
|
this.id,
|
|
3794
3812
|
this.to,
|
|
@@ -3797,7 +3815,7 @@ class Ko {
|
|
|
3797
3815
|
return this.canvas.collabEngine.doCollaboratively(t), !0;
|
|
3798
3816
|
}
|
|
3799
3817
|
undo() {
|
|
3800
|
-
const t = new
|
|
3818
|
+
const t = new Tt(
|
|
3801
3819
|
this.canvas,
|
|
3802
3820
|
this.id,
|
|
3803
3821
|
this.from,
|
|
@@ -3810,7 +3828,7 @@ class Ko {
|
|
|
3810
3828
|
return !e.rootElement.removed;
|
|
3811
3829
|
}
|
|
3812
3830
|
redo() {
|
|
3813
|
-
const t = new
|
|
3831
|
+
const t = new Tt(
|
|
3814
3832
|
this.canvas,
|
|
3815
3833
|
this.id,
|
|
3816
3834
|
this.to,
|
|
@@ -3823,7 +3841,7 @@ class Ko {
|
|
|
3823
3841
|
return !e.rootElement.removed;
|
|
3824
3842
|
}
|
|
3825
3843
|
}
|
|
3826
|
-
class
|
|
3844
|
+
class ti {
|
|
3827
3845
|
constructor(t, e, a, l, r, i) {
|
|
3828
3846
|
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i;
|
|
3829
3847
|
}
|
|
@@ -3865,7 +3883,7 @@ class qo {
|
|
|
3865
3883
|
return this.do();
|
|
3866
3884
|
}
|
|
3867
3885
|
}
|
|
3868
|
-
class
|
|
3886
|
+
class ei {
|
|
3869
3887
|
constructor(t, e, a, l) {
|
|
3870
3888
|
this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
|
|
3871
3889
|
}
|
|
@@ -3918,7 +3936,7 @@ class Jo {
|
|
|
3918
3936
|
r.points[n][1] + e[1]
|
|
3919
3937
|
];
|
|
3920
3938
|
}
|
|
3921
|
-
const l = new
|
|
3939
|
+
const l = new ne(
|
|
3922
3940
|
this.canvas,
|
|
3923
3941
|
this.nodes,
|
|
3924
3942
|
this.connections
|
|
@@ -3956,7 +3974,7 @@ class Jo {
|
|
|
3956
3974
|
return this.canvas.collabEngine.doCollaboratively(e), t;
|
|
3957
3975
|
}
|
|
3958
3976
|
}
|
|
3959
|
-
class
|
|
3977
|
+
class Yt {
|
|
3960
3978
|
constructor(t) {
|
|
3961
3979
|
this.type = t, this.defaultPrevented = !1;
|
|
3962
3980
|
}
|
|
@@ -3964,8 +3982,8 @@ class Dt {
|
|
|
3964
3982
|
this.defaultPrevented = !0;
|
|
3965
3983
|
}
|
|
3966
3984
|
}
|
|
3967
|
-
var
|
|
3968
|
-
class
|
|
3985
|
+
var Qe = /* @__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))(Qe || {});
|
|
3986
|
+
class oi extends Yt {
|
|
3969
3987
|
/**
|
|
3970
3988
|
* Create a diagram zoom event.
|
|
3971
3989
|
*
|
|
@@ -3978,7 +3996,7 @@ class Qo extends Dt {
|
|
|
3978
3996
|
), this.coords = t, this.zoom = e;
|
|
3979
3997
|
}
|
|
3980
3998
|
}
|
|
3981
|
-
class pt extends
|
|
3999
|
+
class pt extends Yt {
|
|
3982
4000
|
/**
|
|
3983
4001
|
* Create a diagram double click event.
|
|
3984
4002
|
*
|
|
@@ -3993,7 +4011,7 @@ class pt extends Dt {
|
|
|
3993
4011
|
), this.cause = t, this.target = e, this.coords = a;
|
|
3994
4012
|
}
|
|
3995
4013
|
}
|
|
3996
|
-
class mt extends
|
|
4014
|
+
class mt extends Yt {
|
|
3997
4015
|
/**
|
|
3998
4016
|
* Create a diagram secondary click event.
|
|
3999
4017
|
*
|
|
@@ -4008,7 +4026,7 @@ class mt extends Dt {
|
|
|
4008
4026
|
), this.cause = t, this.target = e, this.coords = a;
|
|
4009
4027
|
}
|
|
4010
4028
|
}
|
|
4011
|
-
class G extends
|
|
4029
|
+
class G extends Yt {
|
|
4012
4030
|
/**
|
|
4013
4031
|
* Create a diagram selection event.
|
|
4014
4032
|
*
|
|
@@ -4022,7 +4040,7 @@ class G extends Dt {
|
|
|
4022
4040
|
), this.targets = t, this.selected = e;
|
|
4023
4041
|
}
|
|
4024
4042
|
}
|
|
4025
|
-
class Q extends
|
|
4043
|
+
class Q extends Yt {
|
|
4026
4044
|
/**
|
|
4027
4045
|
* Create a diagram highlight event.
|
|
4028
4046
|
*
|
|
@@ -4035,7 +4053,7 @@ class Q extends Dt {
|
|
|
4035
4053
|
), this.target = t;
|
|
4036
4054
|
}
|
|
4037
4055
|
}
|
|
4038
|
-
class
|
|
4056
|
+
class to extends At {
|
|
4039
4057
|
constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
|
|
4040
4058
|
if (t.objects.get(o) !== void 0)
|
|
4041
4059
|
throw new Error(`DiagramDecorator with id "${o}" already exists`);
|
|
@@ -4064,7 +4082,7 @@ class qe extends It {
|
|
|
4064
4082
|
return this.priority;
|
|
4065
4083
|
}
|
|
4066
4084
|
}
|
|
4067
|
-
class
|
|
4085
|
+
class ii extends ft {
|
|
4068
4086
|
/**
|
|
4069
4087
|
* Instance a set of decorators for the given model. This method is used internally.
|
|
4070
4088
|
* @private
|
|
@@ -4084,7 +4102,7 @@ class ti extends ft {
|
|
|
4084
4102
|
* @returns The instanced decorator.
|
|
4085
4103
|
*/
|
|
4086
4104
|
new(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
4087
|
-
const c = new
|
|
4105
|
+
const c = new to(
|
|
4088
4106
|
this.model,
|
|
4089
4107
|
t,
|
|
4090
4108
|
e,
|
|
@@ -4100,10 +4118,10 @@ class ti extends ft {
|
|
|
4100
4118
|
}
|
|
4101
4119
|
remove(t) {
|
|
4102
4120
|
const e = this.get(t, !0);
|
|
4103
|
-
e && ((e.rootElement instanceof z || e.rootElement instanceof
|
|
4121
|
+
e && ((e.rootElement instanceof z || e.rootElement instanceof F) && B(e.rootElement.decorators, e), super.remove(t), e.updateInView());
|
|
4104
4122
|
}
|
|
4105
4123
|
}
|
|
4106
|
-
class
|
|
4124
|
+
class si extends At {
|
|
4107
4125
|
constructor(t, e, a, l, r, i, n) {
|
|
4108
4126
|
if (t.objects.get(n) !== void 0)
|
|
4109
4127
|
throw new Error(`DiagramObject with id "${n}" already exists`);
|
|
@@ -4132,7 +4150,7 @@ class ei extends It {
|
|
|
4132
4150
|
return this.priority;
|
|
4133
4151
|
}
|
|
4134
4152
|
}
|
|
4135
|
-
class
|
|
4153
|
+
class ni extends ft {
|
|
4136
4154
|
/**
|
|
4137
4155
|
* Instance a set of objects for the given model. This method is used internally.
|
|
4138
4156
|
* @private
|
|
@@ -4152,7 +4170,7 @@ class oi extends ft {
|
|
|
4152
4170
|
* @returns The instanced object.
|
|
4153
4171
|
*/
|
|
4154
4172
|
new(t, e, a, l, r, i) {
|
|
4155
|
-
const n = new
|
|
4173
|
+
const n = new si(
|
|
4156
4174
|
this.model,
|
|
4157
4175
|
t,
|
|
4158
4176
|
e,
|
|
@@ -4168,9 +4186,9 @@ class oi extends ft {
|
|
|
4168
4186
|
e && (super.remove(t), e.updateInView());
|
|
4169
4187
|
}
|
|
4170
4188
|
}
|
|
4171
|
-
class
|
|
4189
|
+
class eo {
|
|
4172
4190
|
constructor(t, e, a, l, r, i = []) {
|
|
4173
|
-
this.nodes = new
|
|
4191
|
+
this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new Wo(this), this.connections = new Ro(this), this.fields = new Vo(this), this.objects = new ni(this), this.decorators = new ii(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 oe(i), this);
|
|
4174
4192
|
}
|
|
4175
4193
|
/**
|
|
4176
4194
|
* Deletes everything in this diagram.
|
|
@@ -4180,7 +4198,7 @@ class Je {
|
|
|
4180
4198
|
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();
|
|
4181
4199
|
}
|
|
4182
4200
|
}
|
|
4183
|
-
const vt = (s) => !!s.button,
|
|
4201
|
+
const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
|
|
4184
4202
|
s,
|
|
4185
4203
|
[t, e],
|
|
4186
4204
|
a,
|
|
@@ -4193,18 +4211,38 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
|
|
|
4193
4211
|
) * r
|
|
4194
4212
|
), S = (s) => {
|
|
4195
4213
|
s ? x.select("body").style("cursor", s) : x.select("body").style("cursor", L.Auto);
|
|
4196
|
-
}, ct = (s) => s instanceof z ? s : s instanceof
|
|
4214
|
+
}, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof bt ? ct(s.rootElement) : s, ye = (s) => {
|
|
4215
|
+
if (s instanceof z)
|
|
4216
|
+
return s.type.resizableX !== !1;
|
|
4217
|
+
if (s instanceof F) {
|
|
4218
|
+
if (s.type !== void 0)
|
|
4219
|
+
return s.type.resizableX !== !1;
|
|
4220
|
+
if (s.node !== void 0)
|
|
4221
|
+
return ye(s.node);
|
|
4222
|
+
}
|
|
4223
|
+
return !1;
|
|
4224
|
+
}, be = (s) => {
|
|
4225
|
+
if (s instanceof z)
|
|
4226
|
+
return s.type.resizableY !== !1;
|
|
4227
|
+
if (s instanceof F) {
|
|
4228
|
+
if (s.type !== void 0)
|
|
4229
|
+
return s.type.resizableY !== !1;
|
|
4230
|
+
if (s.node !== void 0)
|
|
4231
|
+
return be(s.node);
|
|
4232
|
+
}
|
|
4233
|
+
return !1;
|
|
4234
|
+
}, he = (s) => {
|
|
4197
4235
|
s.filter(".shaped-look").append("path"), s.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
|
|
4198
4236
|
}, zt = {
|
|
4199
4237
|
fillColor: "#FFFFFF",
|
|
4200
4238
|
borderColor: "#000000",
|
|
4201
4239
|
borderThickness: 1,
|
|
4202
|
-
borderStyle:
|
|
4203
|
-
},
|
|
4240
|
+
borderStyle: Se.Solid
|
|
4241
|
+
}, ge = (s) => {
|
|
4204
4242
|
s.filter(".shaped-look").select("path").attr(
|
|
4205
4243
|
"d",
|
|
4206
|
-
(t) =>
|
|
4207
|
-
t.look.shape ||
|
|
4244
|
+
(t) => ve(
|
|
4245
|
+
t.look.shape || Mt.Rectangle,
|
|
4208
4246
|
0,
|
|
4209
4247
|
0,
|
|
4210
4248
|
t.width,
|
|
@@ -4221,7 +4259,7 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
|
|
|
4221
4259
|
(t) => `${t.look.borderThickness || zt.borderThickness}px`
|
|
4222
4260
|
).attr(
|
|
4223
4261
|
"stroke-dasharray",
|
|
4224
|
-
(t) =>
|
|
4262
|
+
(t) => me(
|
|
4225
4263
|
t.look.borderStyle || zt.borderStyle,
|
|
4226
4264
|
t.type?.defaultLook?.borderThickness || t.look?.borderThickness || zt.borderThickness
|
|
4227
4265
|
)
|
|
@@ -4262,13 +4300,13 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
|
|
|
4262
4300
|
"href",
|
|
4263
4301
|
(t) => t.look.backgroundImageBottomRight
|
|
4264
4302
|
);
|
|
4265
|
-
},
|
|
4303
|
+
}, Rt = {
|
|
4266
4304
|
style: "dots",
|
|
4267
4305
|
color: "rgba(0, 0, 0, 0.1)",
|
|
4268
4306
|
snap: !1,
|
|
4269
4307
|
spacing: 10,
|
|
4270
4308
|
thickness: 0.05
|
|
4271
|
-
},
|
|
4309
|
+
}, ri = (s, t, e) => {
|
|
4272
4310
|
const a = t.append("defs");
|
|
4273
4311
|
if (s.gridSize > 0 && isFinite(s.gridSize)) {
|
|
4274
4312
|
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");
|
|
@@ -4288,17 +4326,17 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
|
|
|
4288
4326
|
}
|
|
4289
4327
|
t.select("rect").attr("fill", `url(#${e})`);
|
|
4290
4328
|
}
|
|
4291
|
-
},
|
|
4329
|
+
}, ke = 96, j = 32, xt = ke + j, ai = Math.PI / 4, li = 100, Ve = {
|
|
4292
4330
|
customButtons: []
|
|
4293
4331
|
};
|
|
4294
|
-
class
|
|
4332
|
+
class di {
|
|
4295
4333
|
/**
|
|
4296
4334
|
* Constructs a context menu object.
|
|
4297
4335
|
* @public
|
|
4298
4336
|
* @param canvas A canvas.
|
|
4299
4337
|
*/
|
|
4300
4338
|
constructor(t, e) {
|
|
4301
|
-
this.canvas = t, this.config = e ||
|
|
4339
|
+
this.canvas = t, this.config = e || Ve;
|
|
4302
4340
|
}
|
|
4303
4341
|
/**
|
|
4304
4342
|
* Opens the context menu at the location determined by the given mouse event.
|
|
@@ -4341,7 +4379,7 @@ class ri {
|
|
|
4341
4379
|
i.userSelection.removeFromModel(), i.cancelAllUserActions();
|
|
4342
4380
|
}
|
|
4343
4381
|
});
|
|
4344
|
-
for (const i of this.config.customButtons ||
|
|
4382
|
+
for (const i of this.config.customButtons || Ve.customButtons)
|
|
4345
4383
|
(i.condition === void 0 || i.condition(this.canvas)) && r.push(i);
|
|
4346
4384
|
r.length === 0 && r.push({
|
|
4347
4385
|
name: "NONE",
|
|
@@ -4349,7 +4387,7 @@ class ri {
|
|
|
4349
4387
|
onPress: void 0
|
|
4350
4388
|
});
|
|
4351
4389
|
for (let i = 0; i < r.length; ++i) {
|
|
4352
|
-
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) *
|
|
4390
|
+
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ai, c = l.append("xhtml:div").attr(
|
|
4353
4391
|
"class",
|
|
4354
4392
|
`daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
|
|
4355
4393
|
).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) => {
|
|
@@ -4357,14 +4395,14 @@ class ri {
|
|
|
4357
4395
|
}).on($.KeyDown, (h) => {
|
|
4358
4396
|
o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
|
|
4359
4397
|
});
|
|
4360
|
-
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(
|
|
4398
|
+
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(li).tween("progress", () => (h) => {
|
|
4361
4399
|
const f = d * h;
|
|
4362
4400
|
return c.style(
|
|
4363
4401
|
"left",
|
|
4364
|
-
`${Math.sin(f) *
|
|
4402
|
+
`${Math.sin(f) * ke - j + xt}px`
|
|
4365
4403
|
).style(
|
|
4366
4404
|
"top",
|
|
4367
|
-
`${-Math.cos(f) *
|
|
4405
|
+
`${-Math.cos(f) * ke - j + xt}px`
|
|
4368
4406
|
);
|
|
4369
4407
|
});
|
|
4370
4408
|
}
|
|
@@ -4377,7 +4415,7 @@ class ri {
|
|
|
4377
4415
|
this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
|
|
4378
4416
|
}
|
|
4379
4417
|
}
|
|
4380
|
-
class
|
|
4418
|
+
class ci extends ft {
|
|
4381
4419
|
/**
|
|
4382
4420
|
* Constructs a user highlight object.
|
|
4383
4421
|
* @public
|
|
@@ -4399,7 +4437,7 @@ class ai extends ft {
|
|
|
4399
4437
|
* @param element
|
|
4400
4438
|
*/
|
|
4401
4439
|
focusOn(t) {
|
|
4402
|
-
this.clear(), this.focus = t, (t instanceof ht || t instanceof
|
|
4440
|
+
this.clear(), this.focus = t, (t instanceof ht || t instanceof to) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
|
|
4403
4441
|
}
|
|
4404
4442
|
add(t) {
|
|
4405
4443
|
if (super.add(t), t instanceof z) {
|
|
@@ -4413,7 +4451,7 @@ class ai extends ft {
|
|
|
4413
4451
|
for (const e of t.ports)
|
|
4414
4452
|
super.add(e), this.canvas.updatePortsInView(e.id);
|
|
4415
4453
|
t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updateNodesInView(t.id);
|
|
4416
|
-
} else if (t instanceof
|
|
4454
|
+
} else if (t instanceof F)
|
|
4417
4455
|
if (!this.highlightSections && t.node)
|
|
4418
4456
|
this.add(t.node);
|
|
4419
4457
|
else {
|
|
@@ -4431,13 +4469,13 @@ class ai extends ft {
|
|
|
4431
4469
|
this.focus = void 0;
|
|
4432
4470
|
}
|
|
4433
4471
|
}
|
|
4434
|
-
const
|
|
4435
|
-
class
|
|
4472
|
+
const hi = 1;
|
|
4473
|
+
class oo {
|
|
4436
4474
|
export(t, e = !1) {
|
|
4437
4475
|
const a = {
|
|
4438
4476
|
name: t.name,
|
|
4439
4477
|
type: t.type,
|
|
4440
|
-
typeVersion:
|
|
4478
|
+
typeVersion: hi,
|
|
4441
4479
|
createdAt: t.createdAt,
|
|
4442
4480
|
updatedAt: t.updatedAt,
|
|
4443
4481
|
nodes: [],
|
|
@@ -4470,8 +4508,8 @@ class Qe {
|
|
|
4470
4508
|
n.push({
|
|
4471
4509
|
id: o.id,
|
|
4472
4510
|
type: o.type?.id,
|
|
4473
|
-
coords:
|
|
4474
|
-
connectionPoint:
|
|
4511
|
+
coords: It(o.coords),
|
|
4512
|
+
connectionPoint: It(o.connectionPoint || o.coords),
|
|
4475
4513
|
direction: o.direction,
|
|
4476
4514
|
label: o.label?.text || "",
|
|
4477
4515
|
...e ? {
|
|
@@ -4489,7 +4527,7 @@ class Qe {
|
|
|
4489
4527
|
label: i.label?.text || "",
|
|
4490
4528
|
indexXInNode: i.indexXInNode,
|
|
4491
4529
|
indexYInNode: i.indexYInNode,
|
|
4492
|
-
coords:
|
|
4530
|
+
coords: It(i.coords),
|
|
4493
4531
|
width: i.width,
|
|
4494
4532
|
height: i.height,
|
|
4495
4533
|
...e ? {
|
|
@@ -4507,8 +4545,8 @@ class Qe {
|
|
|
4507
4545
|
r.push({
|
|
4508
4546
|
id: i.id,
|
|
4509
4547
|
type: i.type?.id,
|
|
4510
|
-
coords:
|
|
4511
|
-
connectionPoint:
|
|
4548
|
+
coords: It(i.coords),
|
|
4549
|
+
connectionPoint: It(i.connectionPoint || i.coords),
|
|
4512
4550
|
direction: i.direction,
|
|
4513
4551
|
label: i.label?.text || "",
|
|
4514
4552
|
...e ? {
|
|
@@ -4527,7 +4565,7 @@ class Qe {
|
|
|
4527
4565
|
sections: l,
|
|
4528
4566
|
ports: r,
|
|
4529
4567
|
label: t.label?.text || "",
|
|
4530
|
-
coords:
|
|
4568
|
+
coords: It(t.coords),
|
|
4531
4569
|
width: t.width,
|
|
4532
4570
|
height: t.height,
|
|
4533
4571
|
data: t.valueSet.getValues(),
|
|
@@ -4575,20 +4613,20 @@ class Qe {
|
|
|
4575
4613
|
} : {};
|
|
4576
4614
|
}
|
|
4577
4615
|
}
|
|
4578
|
-
const
|
|
4579
|
-
class
|
|
4616
|
+
const gi = "Diagram properties";
|
|
4617
|
+
class fi extends ft {
|
|
4580
4618
|
/**
|
|
4581
4619
|
* Constructs a user selection object.
|
|
4582
4620
|
* @public
|
|
4583
4621
|
* @param canvas A canvas.
|
|
4584
4622
|
*/
|
|
4585
4623
|
constructor(t, e) {
|
|
4586
|
-
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(
|
|
4624
|
+
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(go(2e3)).subscribe(() => {
|
|
4587
4625
|
this.makeUpdateValuesAction();
|
|
4588
|
-
}), this.diagramPropertiesText = e !== void 0 ? e :
|
|
4626
|
+
}), this.diagramPropertiesText = e !== void 0 ? e : gi;
|
|
4589
4627
|
}
|
|
4590
4628
|
add(t) {
|
|
4591
|
-
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
|
|
4629
|
+
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 F ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
|
|
4592
4630
|
for (const e of t.sections)
|
|
4593
4631
|
super.add(e), e.updateInView();
|
|
4594
4632
|
}
|
|
@@ -4633,8 +4671,8 @@ class ci extends ft {
|
|
|
4633
4671
|
if (this.length > 0) {
|
|
4634
4672
|
const t = [], e = [], a = [], l = [], r = [];
|
|
4635
4673
|
for (const n of this.all())
|
|
4636
|
-
n instanceof z ? t.push(n.id) : n instanceof
|
|
4637
|
-
const i = new
|
|
4674
|
+
n instanceof z ? t.push(n.id) : n instanceof F ? 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);
|
|
4675
|
+
const i = new ti(
|
|
4638
4676
|
this.canvas,
|
|
4639
4677
|
t,
|
|
4640
4678
|
e,
|
|
@@ -4650,7 +4688,7 @@ class ci extends ft {
|
|
|
4650
4688
|
* @public
|
|
4651
4689
|
*/
|
|
4652
4690
|
copyToClipboard() {
|
|
4653
|
-
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new
|
|
4691
|
+
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new oo();
|
|
4654
4692
|
for (const a of this.all())
|
|
4655
4693
|
a instanceof z && t.nodes.push(e.exportNode(a, !1)), a instanceof dt && t.connections.push(
|
|
4656
4694
|
e.exportConnection(a, !1)
|
|
@@ -4674,7 +4712,7 @@ class ci extends ft {
|
|
|
4674
4712
|
const a = JSON.parse(e);
|
|
4675
4713
|
if (a.type !== "daga-user-selection")
|
|
4676
4714
|
return;
|
|
4677
|
-
const l = new
|
|
4715
|
+
const l = new ei(
|
|
4678
4716
|
this.canvas,
|
|
4679
4717
|
a.nodes,
|
|
4680
4718
|
a.connections,
|
|
@@ -4705,17 +4743,17 @@ class ci extends ft {
|
|
|
4705
4743
|
makeUpdateValuesAction() {
|
|
4706
4744
|
if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
|
|
4707
4745
|
return;
|
|
4708
|
-
const t = this.propertyEditorSelection instanceof
|
|
4746
|
+
const t = this.propertyEditorSelection instanceof eo ? void 0 : this.propertyEditorSelection.id;
|
|
4709
4747
|
if (St(
|
|
4710
4748
|
this.propertyEditorValues,
|
|
4711
4749
|
this.propertyEditorSelection?.valueSet.getValues()
|
|
4712
4750
|
))
|
|
4713
4751
|
return;
|
|
4714
|
-
const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] =
|
|
4752
|
+
const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
|
|
4715
4753
|
e,
|
|
4716
4754
|
a,
|
|
4717
4755
|
this.propertyEditorSelection?.valueSet
|
|
4718
|
-
), i = new
|
|
4756
|
+
), i = new Qo(
|
|
4719
4757
|
this.canvas,
|
|
4720
4758
|
t,
|
|
4721
4759
|
l,
|
|
@@ -4724,10 +4762,10 @@ class ci extends ft {
|
|
|
4724
4762
|
i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
|
|
4725
4763
|
}
|
|
4726
4764
|
}
|
|
4727
|
-
const
|
|
4728
|
-
const a =
|
|
4765
|
+
const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
4766
|
+
const a = ui(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);
|
|
4729
4767
|
return [i, n];
|
|
4730
|
-
},
|
|
4768
|
+
}, pi = (s) => /^((?!chrome|android).)*safari/i.test(s), He = pi(navigator.userAgent), mi = 12, H = 6, vi = 25, fe = "diagram-connection-unfinished", te = class te {
|
|
4731
4769
|
/**
|
|
4732
4770
|
* Constructs a canvas object.
|
|
4733
4771
|
* @public
|
|
@@ -4735,24 +4773,24 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4735
4773
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
4736
4774
|
*/
|
|
4737
4775
|
constructor(t, e) {
|
|
4738
|
-
if (this.backgroundPatternId = `daga-background-pattern-id-${
|
|
4776
|
+
if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Wt(), this.diagramChange$ = new Wt(), this.diagramEvent$ = new Wt(), this.propertyEditorChanges$ = new Wt(), this.parentComponent = t, this.model = new eo(
|
|
4739
4777
|
this,
|
|
4740
4778
|
void 0,
|
|
4741
4779
|
e.name || "unnamed",
|
|
4742
4780
|
"",
|
|
4743
4781
|
e.type || "",
|
|
4744
4782
|
e.properties || []
|
|
4745
|
-
), this.userSelection = new
|
|
4783
|
+
), this.userSelection = new fi(
|
|
4746
4784
|
this,
|
|
4747
4785
|
e.components?.propertyEditor?.title
|
|
4748
|
-
), this.userHighlight = new
|
|
4786
|
+
), this.userHighlight = new ci(
|
|
4749
4787
|
this,
|
|
4750
4788
|
e.canvas?.highlightSections !== !1
|
|
4751
|
-
), this.contextMenu = new
|
|
4752
|
-
e.canvas?.grid?.thickness ||
|
|
4753
|
-
), this.gridColor = e.canvas?.grid?.color ||
|
|
4789
|
+
), this.contextMenu = new di(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(
|
|
4790
|
+
e.canvas?.grid?.thickness || Rt.thickness
|
|
4791
|
+
), 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 Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
|
|
4754
4792
|
for (const a of e.nodeTypes) {
|
|
4755
|
-
const l = new
|
|
4793
|
+
const l = new We({
|
|
4756
4794
|
...e.nodeTypeDefaults,
|
|
4757
4795
|
...a
|
|
4758
4796
|
});
|
|
@@ -4760,7 +4798,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4760
4798
|
}
|
|
4761
4799
|
if (e.portTypes)
|
|
4762
4800
|
for (const a of e.portTypes) {
|
|
4763
|
-
const l = new
|
|
4801
|
+
const l = new jo({
|
|
4764
4802
|
...e.portTypeDefaults,
|
|
4765
4803
|
...a
|
|
4766
4804
|
});
|
|
@@ -4768,7 +4806,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4768
4806
|
}
|
|
4769
4807
|
if (e.connectionTypes) {
|
|
4770
4808
|
for (const a of e.connectionTypes) {
|
|
4771
|
-
const l = new
|
|
4809
|
+
const l = new Xe({
|
|
4772
4810
|
...e.connectionTypeDefaults,
|
|
4773
4811
|
...a
|
|
4774
4812
|
});
|
|
@@ -4789,7 +4827,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4789
4827
|
this.validators.push(t), this.validatorChange$.next();
|
|
4790
4828
|
}
|
|
4791
4829
|
removeValidator(t) {
|
|
4792
|
-
|
|
4830
|
+
B(this.validators, t), this.validatorChange$.next();
|
|
4793
4831
|
}
|
|
4794
4832
|
getPriorityThresholdOptions() {
|
|
4795
4833
|
return this.priorityThresholds;
|
|
@@ -4856,7 +4894,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4856
4894
|
});
|
|
4857
4895
|
const a = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
|
|
4858
4896
|
a.call(
|
|
4859
|
-
this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(
|
|
4897
|
+
this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(ue.Zoom, (l) => {
|
|
4860
4898
|
if (l.sourceEvent) {
|
|
4861
4899
|
if (!this.canUserPerformAction(w.Zoom)) {
|
|
4862
4900
|
S(L.NotAllowed);
|
|
@@ -4869,13 +4907,13 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4869
4907
|
this.selectCanvasElements().attr("transform", r), x.select(`#${this.backgroundPatternId}`).attr(
|
|
4870
4908
|
"patternTransform",
|
|
4871
4909
|
r
|
|
4872
|
-
),
|
|
4873
|
-
new
|
|
4910
|
+
), He && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
|
|
4911
|
+
new oi(
|
|
4874
4912
|
[this.zoomTransform.x, this.zoomTransform.y],
|
|
4875
4913
|
this.zoomTransform.k
|
|
4876
4914
|
)
|
|
4877
4915
|
);
|
|
4878
|
-
}).on(
|
|
4916
|
+
}).on(ue.End, () => {
|
|
4879
4917
|
S();
|
|
4880
4918
|
})
|
|
4881
4919
|
), 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) => {
|
|
@@ -4894,14 +4932,14 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4894
4932
|
}
|
|
4895
4933
|
this.userSelection.openInPropertyEditor(this.model);
|
|
4896
4934
|
}).call(
|
|
4897
|
-
x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(
|
|
4935
|
+
x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
|
|
4898
4936
|
this.startMultipleSelection(l);
|
|
4899
|
-
}).on(
|
|
4937
|
+
}).on(A.Drag, (l) => {
|
|
4900
4938
|
this.continueMultipleSelection(l);
|
|
4901
|
-
}).on(
|
|
4939
|
+
}).on(A.End, (l) => {
|
|
4902
4940
|
this.finishMultipleSelection(l);
|
|
4903
4941
|
})
|
|
4904
|
-
),
|
|
4942
|
+
), ri(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
|
|
4905
4943
|
}
|
|
4906
4944
|
getZoomLevel() {
|
|
4907
4945
|
return this.zoomTransform.k;
|
|
@@ -4913,7 +4951,11 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4913
4951
|
isNaN(t) || this.zoomBehavior.scaleTo(this.selectCanvasView(), t);
|
|
4914
4952
|
}
|
|
4915
4953
|
getViewCoordinates() {
|
|
4916
|
-
|
|
4954
|
+
const t = this.selectCanvasView()?.select("rect")?.node()?.getBBox();
|
|
4955
|
+
return [
|
|
4956
|
+
((t.width + t.x) / 2 - this.zoomTransform.x) / this.zoomTransform.k,
|
|
4957
|
+
((t.height + t.y) / 2 - this.zoomTransform.y) / this.zoomTransform.k
|
|
4958
|
+
];
|
|
4917
4959
|
}
|
|
4918
4960
|
translateBy(t, e) {
|
|
4919
4961
|
!isNaN(t) && !isNaN(e) && this.zoomBehavior.translateBy(this.selectCanvasView(), t, e);
|
|
@@ -4921,14 +4963,34 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
4921
4963
|
translateTo(t, e) {
|
|
4922
4964
|
!isNaN(t) && !isNaN(e) && this.zoomBehavior.translateTo(this.selectCanvasView(), t, e);
|
|
4923
4965
|
}
|
|
4924
|
-
|
|
4966
|
+
zoomAndPanTo(t, e, a, l) {
|
|
4967
|
+
if (!l || l <= 0) {
|
|
4968
|
+
this.zoomBehavior.scaleTo(this.selectCanvasView(), a), this.zoomBehavior.translateTo(this.selectCanvasView(), t, e);
|
|
4969
|
+
return;
|
|
4970
|
+
}
|
|
4971
|
+
this.zoomBehavior.interpolate(x.interpolate);
|
|
4972
|
+
const [r, i] = this.getViewCoordinates(), n = this.getZoomLevel(), o = t, d = e, c = a;
|
|
4973
|
+
this.selectCanvasElements().transition().duration(l).ease(x.easeCubicInOut).tween("progress", () => (h) => {
|
|
4974
|
+
const f = h * (o - r) + r, b = h * (d - i) + i, m = h * (c - n) + n;
|
|
4975
|
+
this.zoomBehavior.scaleTo(this.selectCanvasView(), m), this.zoomBehavior.translateTo(
|
|
4976
|
+
this.selectCanvasView(),
|
|
4977
|
+
f,
|
|
4978
|
+
b
|
|
4979
|
+
);
|
|
4980
|
+
});
|
|
4981
|
+
}
|
|
4982
|
+
center(t, e, a) {
|
|
4925
4983
|
if (this.model.nodes.length > 0) {
|
|
4926
|
-
const
|
|
4927
|
-
...
|
|
4928
|
-
),
|
|
4929
|
-
...
|
|
4930
|
-
),
|
|
4931
|
-
|
|
4984
|
+
const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((y) => this.model.nodes.get(y)).filter((y) => !!y) || this.model.nodes.all(), i = Math.min(...r.map((y) => y.coords[0])), n = Math.max(
|
|
4985
|
+
...r.map((y) => y.coords[0] + y.width)
|
|
4986
|
+
), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((y) => y.coords[1])), f = Math.max(
|
|
4987
|
+
...r.map((y) => y.coords[1] + y.height)
|
|
4988
|
+
), b = (h + f) / 2, m = f - h, p = l.height, u = Math.min(
|
|
4989
|
+
c / d,
|
|
4990
|
+
p / m,
|
|
4991
|
+
e !== void 0 ? e : 1
|
|
4992
|
+
);
|
|
4993
|
+
this.zoomAndPanTo(o, b, u, a);
|
|
4932
4994
|
}
|
|
4933
4995
|
}
|
|
4934
4996
|
getClosestGridPoint(t) {
|
|
@@ -5003,7 +5065,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5003
5065
|
);
|
|
5004
5066
|
const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
|
|
5005
5067
|
"class",
|
|
5006
|
-
(i) => `diagram-node${i
|
|
5068
|
+
(i) => `diagram-node${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
|
|
5007
5069
|
);
|
|
5008
5070
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5009
5071
|
const r = l.merge(e);
|
|
@@ -5028,35 +5090,35 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5028
5090
|
const o = new pt(i, n);
|
|
5029
5091
|
this.diagramEvent$.next(o);
|
|
5030
5092
|
}).call(
|
|
5031
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5093
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5032
5094
|
this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, n);
|
|
5033
|
-
}).on(
|
|
5095
|
+
}).on(A.Drag, (i, n) => {
|
|
5034
5096
|
this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, n);
|
|
5035
|
-
}).on(
|
|
5097
|
+
}).on(A.End, (i, n) => {
|
|
5036
5098
|
this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, n), this.secondaryButton = !1;
|
|
5037
5099
|
})
|
|
5038
|
-
),
|
|
5100
|
+
), he(
|
|
5039
5101
|
l
|
|
5040
5102
|
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5041
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5103
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
|
|
5042
5104
|
}).on($.MouseOut, (i, n) => {
|
|
5043
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5105
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
|
|
5044
5106
|
}).call(
|
|
5045
|
-
x.drag().on(
|
|
5046
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5107
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5108
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
|
|
5047
5109
|
this,
|
|
5048
5110
|
w.StretchNode,
|
|
5049
5111
|
n.id,
|
|
5050
5112
|
n.getGeometry(),
|
|
5051
5113
|
n.getGeometry()
|
|
5052
5114
|
)) : S(L.NotAllowed);
|
|
5053
|
-
}).on(
|
|
5054
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5115
|
+
}).on(A.Drag, (i, n) => {
|
|
5116
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
|
|
5055
5117
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5056
5118
|
n.stretch(g.Left, n.coords[0] - o[0]);
|
|
5057
5119
|
}
|
|
5058
|
-
}).on(
|
|
5059
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5120
|
+
}).on(A.End, (i, n) => {
|
|
5121
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5060
5122
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5061
5123
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5062
5124
|
o[0] - n.type.snapToGridOffset[0],
|
|
@@ -5066,25 +5128,25 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5066
5128
|
S();
|
|
5067
5129
|
})
|
|
5068
5130
|
), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5069
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5131
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
|
|
5070
5132
|
}).on($.MouseOut, (i, n) => {
|
|
5071
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5133
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
|
|
5072
5134
|
}).call(
|
|
5073
|
-
x.drag().on(
|
|
5074
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5135
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5136
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
|
|
5075
5137
|
this,
|
|
5076
5138
|
w.StretchNode,
|
|
5077
5139
|
n.id,
|
|
5078
5140
|
n.getGeometry(),
|
|
5079
5141
|
n.getGeometry()
|
|
5080
5142
|
)) : S(L.NotAllowed);
|
|
5081
|
-
}).on(
|
|
5082
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5143
|
+
}).on(A.Drag, (i, n) => {
|
|
5144
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
|
|
5083
5145
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5084
5146
|
n.stretch(g.Top, n.coords[1] - o[1]);
|
|
5085
5147
|
}
|
|
5086
|
-
}).on(
|
|
5087
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5148
|
+
}).on(A.End, (i, n) => {
|
|
5149
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5088
5150
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5089
5151
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5090
5152
|
o[0] - n.type.snapToGridOffset[0],
|
|
@@ -5094,25 +5156,25 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5094
5156
|
S();
|
|
5095
5157
|
})
|
|
5096
5158
|
), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5097
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5159
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
|
|
5098
5160
|
}).on($.MouseOut, (i, n) => {
|
|
5099
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5161
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
|
|
5100
5162
|
}).call(
|
|
5101
|
-
x.drag().on(
|
|
5102
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5163
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5164
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
|
|
5103
5165
|
this,
|
|
5104
5166
|
w.StretchNode,
|
|
5105
5167
|
n.id,
|
|
5106
5168
|
n.getGeometry(),
|
|
5107
5169
|
n.getGeometry()
|
|
5108
5170
|
)) : S(L.NotAllowed);
|
|
5109
|
-
}).on(
|
|
5110
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5171
|
+
}).on(A.Drag, (i, n) => {
|
|
5172
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
|
|
5111
5173
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5112
5174
|
n.stretch(g.Right, o[0] - (n.coords[0] + n.width));
|
|
5113
5175
|
}
|
|
5114
|
-
}).on(
|
|
5115
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5176
|
+
}).on(A.End, (i, n) => {
|
|
5177
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5116
5178
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5117
5179
|
this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5118
5180
|
o[0] - n.type.snapToGridOffset[2],
|
|
@@ -5122,28 +5184,28 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5122
5184
|
S();
|
|
5123
5185
|
})
|
|
5124
5186
|
), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5125
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5187
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
|
|
5126
5188
|
}).on($.MouseOut, (i, n) => {
|
|
5127
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5189
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
|
|
5128
5190
|
}).call(
|
|
5129
|
-
x.drag().on(
|
|
5130
|
-
this.canUserPerformAction(w.StretchNode) && n.
|
|
5191
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5192
|
+
this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
|
|
5131
5193
|
this,
|
|
5132
5194
|
w.StretchNode,
|
|
5133
5195
|
n.id,
|
|
5134
5196
|
n.getGeometry(),
|
|
5135
5197
|
n.getGeometry()
|
|
5136
5198
|
)) : S(L.NotAllowed);
|
|
5137
|
-
}).on(
|
|
5138
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5199
|
+
}).on(A.Drag, (i, n) => {
|
|
5200
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
|
|
5139
5201
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5140
5202
|
n.stretch(
|
|
5141
5203
|
g.Bottom,
|
|
5142
5204
|
o[1] - (n.coords[1] + n.height)
|
|
5143
5205
|
);
|
|
5144
5206
|
}
|
|
5145
|
-
}).on(
|
|
5146
|
-
if (this.canUserPerformAction(w.StretchNode) && n.
|
|
5207
|
+
}).on(A.End, (i, n) => {
|
|
5208
|
+
if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
|
|
5147
5209
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5148
5210
|
this.snapToGrid && this.snapToGrid && (o = this.getClosestGridPoint([
|
|
5149
5211
|
o[0] - n.type.snapToGridOffset[2],
|
|
@@ -5155,9 +5217,9 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5155
5217
|
}
|
|
5156
5218
|
S();
|
|
5157
5219
|
})
|
|
5158
|
-
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5220
|
+
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
|
|
5159
5221
|
r
|
|
5160
|
-
), 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);
|
|
5222
|
+
), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").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").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
|
|
5161
5223
|
}
|
|
5162
5224
|
updateSectionsInView(...t) {
|
|
5163
5225
|
let e = this.selectCanvasElements().selectAll("g.diagram-section").data(
|
|
@@ -5168,7 +5230,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5168
5230
|
);
|
|
5169
5231
|
const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
|
|
5170
5232
|
"class",
|
|
5171
|
-
(i) => `diagram-section${i
|
|
5233
|
+
(i) => `diagram-section${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.look?.lookType}`
|
|
5172
5234
|
);
|
|
5173
5235
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5174
5236
|
const r = l.merge(e);
|
|
@@ -5205,21 +5267,21 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5205
5267
|
const o = new pt(i, n);
|
|
5206
5268
|
this.diagramEvent$.next(o);
|
|
5207
5269
|
}).call(
|
|
5208
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5270
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5209
5271
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5210
5272
|
this.startMultipleSelection(i);
|
|
5211
5273
|
else {
|
|
5212
5274
|
const o = n?.node;
|
|
5213
5275
|
o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5214
5276
|
}
|
|
5215
|
-
}).on(
|
|
5277
|
+
}).on(A.Drag, (i, n) => {
|
|
5216
5278
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5217
5279
|
this.continueMultipleSelection(i);
|
|
5218
5280
|
else {
|
|
5219
5281
|
const o = n?.node;
|
|
5220
5282
|
o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5221
5283
|
}
|
|
5222
|
-
}).on(
|
|
5284
|
+
}).on(A.End, (i, n) => {
|
|
5223
5285
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5224
5286
|
this.finishMultipleSelection(i);
|
|
5225
5287
|
else {
|
|
@@ -5228,14 +5290,14 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5228
5290
|
}
|
|
5229
5291
|
this.secondaryButton = !1;
|
|
5230
5292
|
})
|
|
5231
|
-
),
|
|
5293
|
+
), he(
|
|
5232
5294
|
l
|
|
5233
5295
|
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
|
|
5234
5296
|
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
|
|
5235
5297
|
}).on($.MouseOut, (i, n) => {
|
|
5236
5298
|
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
|
|
5237
5299
|
}).call(
|
|
5238
|
-
x.drag().on(
|
|
5300
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5239
5301
|
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
|
|
5240
5302
|
this,
|
|
5241
5303
|
w.StretchSection,
|
|
@@ -5243,7 +5305,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5243
5305
|
n.node.getGeometry(),
|
|
5244
5306
|
n.node.getGeometry()
|
|
5245
5307
|
)) : S(L.NotAllowed);
|
|
5246
|
-
}).on(
|
|
5308
|
+
}).on(A.Drag, (i, n) => {
|
|
5247
5309
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
|
|
5248
5310
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5249
5311
|
n.node.stretchSections(
|
|
@@ -5253,7 +5315,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5253
5315
|
n.indexYInNode
|
|
5254
5316
|
);
|
|
5255
5317
|
}
|
|
5256
|
-
}).on(
|
|
5318
|
+
}).on(A.End, (i, n) => {
|
|
5257
5319
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5258
5320
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5259
5321
|
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
@@ -5270,7 +5332,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5270
5332
|
}).on($.MouseOut, (i, n) => {
|
|
5271
5333
|
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
|
|
5272
5334
|
}).call(
|
|
5273
|
-
x.drag().on(
|
|
5335
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5274
5336
|
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
|
|
5275
5337
|
this,
|
|
5276
5338
|
w.StretchSection,
|
|
@@ -5278,7 +5340,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5278
5340
|
n.node.getGeometry(),
|
|
5279
5341
|
n.node.getGeometry()
|
|
5280
5342
|
)) : S(L.NotAllowed);
|
|
5281
|
-
}).on(
|
|
5343
|
+
}).on(A.Drag, (i, n) => {
|
|
5282
5344
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
|
|
5283
5345
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5284
5346
|
n.node.stretchSections(
|
|
@@ -5288,7 +5350,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5288
5350
|
n.indexYInNode
|
|
5289
5351
|
);
|
|
5290
5352
|
}
|
|
5291
|
-
}).on(
|
|
5353
|
+
}).on(A.End, (i, n) => {
|
|
5292
5354
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5293
5355
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5294
5356
|
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
@@ -5305,7 +5367,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5305
5367
|
}).on($.MouseOut, (i, n) => {
|
|
5306
5368
|
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
|
|
5307
5369
|
}).call(
|
|
5308
|
-
x.drag().on(
|
|
5370
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5309
5371
|
this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
|
|
5310
5372
|
this,
|
|
5311
5373
|
w.StretchSection,
|
|
@@ -5313,7 +5375,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5313
5375
|
n.node.getGeometry(),
|
|
5314
5376
|
n.node.getGeometry()
|
|
5315
5377
|
)) : S(L.NotAllowed);
|
|
5316
|
-
}).on(
|
|
5378
|
+
}).on(A.Drag, (i, n) => {
|
|
5317
5379
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
|
|
5318
5380
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5319
5381
|
n.node.stretchSections(
|
|
@@ -5323,7 +5385,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5323
5385
|
n.indexYInNode
|
|
5324
5386
|
);
|
|
5325
5387
|
}
|
|
5326
|
-
}).on(
|
|
5388
|
+
}).on(A.End, (i, n) => {
|
|
5327
5389
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5328
5390
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5329
5391
|
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
@@ -5340,7 +5402,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5340
5402
|
}).on($.MouseOut, (i, n) => {
|
|
5341
5403
|
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
|
|
5342
5404
|
}).call(
|
|
5343
|
-
x.drag().on(
|
|
5405
|
+
x.drag().on(A.Start, (i, n) => {
|
|
5344
5406
|
this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
|
|
5345
5407
|
this,
|
|
5346
5408
|
w.StretchSection,
|
|
@@ -5348,7 +5410,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5348
5410
|
n.node.getGeometry(),
|
|
5349
5411
|
n.node.getGeometry()
|
|
5350
5412
|
)) : S(L.NotAllowed);
|
|
5351
|
-
}).on(
|
|
5413
|
+
}).on(A.Drag, (i, n) => {
|
|
5352
5414
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
|
|
5353
5415
|
const o = this.getPointerLocationRelativeToCanvas(i);
|
|
5354
5416
|
n.node.stretchSections(
|
|
@@ -5358,7 +5420,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5358
5420
|
n.indexYInNode
|
|
5359
5421
|
);
|
|
5360
5422
|
}
|
|
5361
|
-
}).on(
|
|
5423
|
+
}).on(A.End, (i, n) => {
|
|
5362
5424
|
if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
|
|
5363
5425
|
let o = this.getPointerLocationRelativeToCanvas(i);
|
|
5364
5426
|
this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
|
|
@@ -5370,9 +5432,9 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5370
5432
|
}
|
|
5371
5433
|
S();
|
|
5372
5434
|
})
|
|
5373
|
-
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5435
|
+
), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
|
|
5374
5436
|
r
|
|
5375
|
-
), 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);
|
|
5437
|
+
), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").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").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
|
|
5376
5438
|
}
|
|
5377
5439
|
updatePortsInView(...t) {
|
|
5378
5440
|
let e = this.selectCanvasElements().selectAll("g.diagram-port").data(
|
|
@@ -5431,16 +5493,16 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5431
5493
|
const o = new pt(i, n);
|
|
5432
5494
|
this.diagramEvent$.next(o);
|
|
5433
5495
|
}).call(
|
|
5434
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5496
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5435
5497
|
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);
|
|
5436
|
-
}).on(
|
|
5498
|
+
}).on(A.Drag, (i, n) => {
|
|
5437
5499
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5438
5500
|
this.continueMultipleSelection(i);
|
|
5439
5501
|
else if (this.canUserPerformAction(w.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
|
|
5440
5502
|
const o = [i.x, i.y];
|
|
5441
5503
|
this.unfinishedConnectionTracer?.attr(
|
|
5442
5504
|
"d",
|
|
5443
|
-
|
|
5505
|
+
ce(
|
|
5444
5506
|
this.unfinishedConnection.look.shape || et.look.shape,
|
|
5445
5507
|
this.unfinishedConnection.startCoords,
|
|
5446
5508
|
o,
|
|
@@ -5465,17 +5527,17 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5465
5527
|
];
|
|
5466
5528
|
} else
|
|
5467
5529
|
this.unfinishedConnection.endCoords = o;
|
|
5468
|
-
if (this.updateConnectionsInView(
|
|
5530
|
+
if (this.updateConnectionsInView(fe), this.model.ports.length > 0) {
|
|
5469
5531
|
const c = this.getPointerLocationRelativeToCanvas(i);
|
|
5470
5532
|
let h = Number.POSITIVE_INFINITY, f;
|
|
5471
|
-
for (const
|
|
5472
|
-
const m =
|
|
5473
|
-
m < h && (h = m, f =
|
|
5533
|
+
for (const b of this.model.ports) {
|
|
5534
|
+
const m = b.distanceTo(c);
|
|
5535
|
+
m < h && (h = m, f = b);
|
|
5474
5536
|
}
|
|
5475
5537
|
f && h < this.portHighlightRadius ? this.userHighlight.focusOn(f) : this.userHighlight.clear();
|
|
5476
5538
|
}
|
|
5477
5539
|
}
|
|
5478
|
-
}).on(
|
|
5540
|
+
}).on(A.End, (i, n) => {
|
|
5479
5541
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5480
5542
|
this.finishMultipleSelection(i);
|
|
5481
5543
|
else {
|
|
@@ -5486,11 +5548,11 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5486
5548
|
this.finishConnection(o);
|
|
5487
5549
|
else if (o instanceof ht && o.rootElement instanceof bt)
|
|
5488
5550
|
this.finishConnection(o.rootElement);
|
|
5489
|
-
else if (o instanceof z || o instanceof
|
|
5551
|
+
else if (o instanceof z || o instanceof F || o instanceof ht) {
|
|
5490
5552
|
let d;
|
|
5491
|
-
if (o instanceof z || o instanceof
|
|
5553
|
+
if (o instanceof z || o instanceof F)
|
|
5492
5554
|
d = o;
|
|
5493
|
-
else if (o.rootElement instanceof z || o.rootElement instanceof
|
|
5555
|
+
else if (o.rootElement instanceof z || o.rootElement instanceof F)
|
|
5494
5556
|
d = o.rootElement;
|
|
5495
5557
|
else {
|
|
5496
5558
|
this.dropConnection();
|
|
@@ -5508,12 +5570,12 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5508
5570
|
}
|
|
5509
5571
|
this.secondaryButton = !1;
|
|
5510
5572
|
})
|
|
5511
|
-
), l.filter(".image-look").append("image"),
|
|
5573
|
+
), l.filter(".image-look").append("image"), he(
|
|
5512
5574
|
l
|
|
5513
5575
|
), r.attr(
|
|
5514
5576
|
"transform",
|
|
5515
5577
|
(i) => `translate(${i.coords[0] - i.width / 2},${i.coords[1] - i.width / 2})`
|
|
5516
|
-
).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5578
|
+
).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
|
|
5517
5579
|
r
|
|
5518
5580
|
);
|
|
5519
5581
|
}
|
|
@@ -5547,16 +5609,16 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5547
5609
|
const d = new pt(n, o);
|
|
5548
5610
|
this.diagramEvent$.next(d);
|
|
5549
5611
|
}).call(
|
|
5550
|
-
x.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(
|
|
5612
|
+
x.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
|
|
5551
5613
|
this.startMultipleSelection(n);
|
|
5552
|
-
}).on(
|
|
5614
|
+
}).on(A.Drag, (n) => {
|
|
5553
5615
|
this.continueMultipleSelection(n);
|
|
5554
|
-
}).on(
|
|
5616
|
+
}).on(A.End, (n) => {
|
|
5555
5617
|
this.finishMultipleSelection(n);
|
|
5556
5618
|
})
|
|
5557
5619
|
), 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(
|
|
5558
5620
|
"d",
|
|
5559
|
-
(n) =>
|
|
5621
|
+
(n) => ce(
|
|
5560
5622
|
n.look.shape || et.look.shape,
|
|
5561
5623
|
n.startCoords,
|
|
5562
5624
|
n.endCoords,
|
|
@@ -5571,13 +5633,13 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5571
5633
|
(n) => n.look.color || et.look.color
|
|
5572
5634
|
).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
|
|
5573
5635
|
"stroke-dasharray",
|
|
5574
|
-
(n) =>
|
|
5636
|
+
(n) => me(
|
|
5575
5637
|
n.look.style || et.look.style,
|
|
5576
5638
|
n.type.defaultLook.thickness || et.look.thickness
|
|
5577
5639
|
)
|
|
5578
5640
|
).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
|
|
5579
5641
|
"d",
|
|
5580
|
-
(n) =>
|
|
5642
|
+
(n) => ce(
|
|
5581
5643
|
n.look.shape || et.look.shape,
|
|
5582
5644
|
n.startCoords,
|
|
5583
5645
|
n.endCoords,
|
|
@@ -5589,10 +5651,10 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5589
5651
|
)
|
|
5590
5652
|
).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
|
|
5591
5653
|
"stroke-width",
|
|
5592
|
-
(n) => `${(n.look.thickness || et.look.thickness) +
|
|
5654
|
+
(n) => `${(n.look.thickness || et.look.thickness) + mi}px`
|
|
5593
5655
|
).attr(
|
|
5594
5656
|
"stroke-dasharray",
|
|
5595
|
-
(n) =>
|
|
5657
|
+
(n) => me(
|
|
5596
5658
|
n.look.style || et.look.style,
|
|
5597
5659
|
n.type.defaultLook.thickness || et.look.thickness
|
|
5598
5660
|
)
|
|
@@ -5643,41 +5705,41 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5643
5705
|
}
|
|
5644
5706
|
}).on($.DoubleClick, (i, n) => {
|
|
5645
5707
|
const o = new pt(i, n);
|
|
5646
|
-
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && n.editable && !n.removed && (this.currentAction = new
|
|
5708
|
+
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.createInputField(
|
|
5647
5709
|
n.text,
|
|
5648
5710
|
n.coords,
|
|
5649
5711
|
n.width,
|
|
5650
5712
|
n.height,
|
|
5651
5713
|
n.fontSize,
|
|
5652
|
-
n.fontFamily ||
|
|
5714
|
+
n.fontFamily || V.fontFamily,
|
|
5653
5715
|
n.orientation,
|
|
5654
5716
|
(d) => {
|
|
5655
5717
|
},
|
|
5656
5718
|
(d) => {
|
|
5657
|
-
n.text = d, this.currentAction instanceof
|
|
5719
|
+
n.text = d, this.currentAction instanceof Re && (this.currentAction.to = d, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
|
|
5658
5720
|
}
|
|
5659
5721
|
));
|
|
5660
5722
|
}).call(
|
|
5661
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5723
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5662
5724
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5663
5725
|
this.startMultipleSelection(i);
|
|
5664
5726
|
else {
|
|
5665
5727
|
let o;
|
|
5666
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5728
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5667
5729
|
}
|
|
5668
|
-
}).on(
|
|
5730
|
+
}).on(A.Drag, (i, n) => {
|
|
5669
5731
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5670
5732
|
this.continueMultipleSelection(i);
|
|
5671
5733
|
else {
|
|
5672
5734
|
let o;
|
|
5673
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5735
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5674
5736
|
}
|
|
5675
|
-
}).on(
|
|
5737
|
+
}).on(A.End, (i, n) => {
|
|
5676
5738
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5677
5739
|
this.finishMultipleSelection(i);
|
|
5678
5740
|
else {
|
|
5679
5741
|
let o;
|
|
5680
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5742
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.finishMovingNode(i, o) : S();
|
|
5681
5743
|
}
|
|
5682
5744
|
this.secondaryButton = !1;
|
|
5683
5745
|
})
|
|
@@ -5686,13 +5748,13 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5686
5748
|
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
|
|
5687
5749
|
).style(
|
|
5688
5750
|
"align-items",
|
|
5689
|
-
(i) => i.verticalAlign ===
|
|
5751
|
+
(i) => i.verticalAlign === Jt.Center ? "center" : i.verticalAlign === Jt.Bottom ? "end" : "start"
|
|
5690
5752
|
).select("p").style(
|
|
5691
5753
|
"max-width",
|
|
5692
|
-
(i) => i.fit ? "default" : `${
|
|
5754
|
+
(i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[0]}px`
|
|
5693
5755
|
).style(
|
|
5694
5756
|
"max-height",
|
|
5695
|
-
(i) => i.fit ? "default" : `${
|
|
5757
|
+
(i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[1]}px`
|
|
5696
5758
|
).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
|
|
5697
5759
|
"text-align",
|
|
5698
5760
|
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "end" : "start"
|
|
@@ -5704,7 +5766,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5704
5766
|
(i) => i.selected ? i.selectedColor || "#000000" : i.color || "#000000"
|
|
5705
5767
|
).html(
|
|
5706
5768
|
(i) => i.text.replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>")
|
|
5707
|
-
),
|
|
5769
|
+
), He) {
|
|
5708
5770
|
const i = this.zoomTransform.k;
|
|
5709
5771
|
r.attr("width", (n) => `${n.width * i}px`).attr("height", (n) => `${n.height * i}px`).select("div").style("position", "absolute").style(
|
|
5710
5772
|
"left",
|
|
@@ -5734,11 +5796,11 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5734
5796
|
const o = new pt(i, n);
|
|
5735
5797
|
this.diagramEvent$.next(o);
|
|
5736
5798
|
}).call(
|
|
5737
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5799
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
|
|
5738
5800
|
(this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(i);
|
|
5739
|
-
}).on(
|
|
5801
|
+
}).on(A.Drag, (i) => {
|
|
5740
5802
|
(this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(i);
|
|
5741
|
-
}).on(
|
|
5803
|
+
}).on(A.End, (i) => {
|
|
5742
5804
|
(this.multipleSelectionOn || this.secondaryButton) && this.finishMultipleSelection(i);
|
|
5743
5805
|
})
|
|
5744
5806
|
);
|
|
@@ -5788,26 +5850,26 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5788
5850
|
const o = new pt(i, n);
|
|
5789
5851
|
this.diagramEvent$.next(o);
|
|
5790
5852
|
}).call(
|
|
5791
|
-
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(
|
|
5853
|
+
x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5792
5854
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5793
5855
|
this.startMultipleSelection(i);
|
|
5794
5856
|
else {
|
|
5795
5857
|
let o;
|
|
5796
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5858
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
|
|
5797
5859
|
}
|
|
5798
|
-
}).on(
|
|
5860
|
+
}).on(A.Drag, (i, n) => {
|
|
5799
5861
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5800
5862
|
this.continueMultipleSelection(i);
|
|
5801
5863
|
else {
|
|
5802
5864
|
let o;
|
|
5803
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5865
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
|
|
5804
5866
|
}
|
|
5805
|
-
}).on(
|
|
5867
|
+
}).on(A.End, (i, n) => {
|
|
5806
5868
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
5807
5869
|
this.finishMultipleSelection(i);
|
|
5808
5870
|
else {
|
|
5809
5871
|
let o;
|
|
5810
|
-
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof
|
|
5872
|
+
n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.finishMovingNode(i, o) : S();
|
|
5811
5873
|
}
|
|
5812
5874
|
this.secondaryButton = !1;
|
|
5813
5875
|
})
|
|
@@ -5815,16 +5877,16 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5815
5877
|
}
|
|
5816
5878
|
updateConnectionLabelsInView(t) {
|
|
5817
5879
|
const e = this.selectCanvasView().select(
|
|
5818
|
-
`[id='${
|
|
5880
|
+
`[id='${pe(t.id)}']`
|
|
5819
5881
|
), l = e.select("path").node(), r = {
|
|
5820
|
-
...
|
|
5882
|
+
...V,
|
|
5821
5883
|
...t.type.label
|
|
5822
5884
|
};
|
|
5823
5885
|
if (l) {
|
|
5824
5886
|
const i = l.getTotalLength();
|
|
5825
5887
|
let n = 0, o = 0, d = 0, c = 0, h = 0, f = 0;
|
|
5826
5888
|
if (r.backgroundColor === "#00000000") {
|
|
5827
|
-
const u = t.endCoords[0] - t.startCoords[0],
|
|
5889
|
+
const u = t.endCoords[0] - t.startCoords[0], y = t.endCoords[1] - t.startCoords[1];
|
|
5828
5890
|
switch (t.startDirection) {
|
|
5829
5891
|
case g.Top:
|
|
5830
5892
|
n = u >= 0 ? -0.5 : 0.5, h = n;
|
|
@@ -5833,10 +5895,10 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5833
5895
|
n = u >= 0 ? -0.5 : 0.5, h = n;
|
|
5834
5896
|
break;
|
|
5835
5897
|
case g.Left:
|
|
5836
|
-
o =
|
|
5898
|
+
o = y > 0 ? -0.5 : 0.5, f = o;
|
|
5837
5899
|
break;
|
|
5838
5900
|
case g.Right:
|
|
5839
|
-
o =
|
|
5901
|
+
o = y > 0 ? -0.5 : 0.5, f = o;
|
|
5840
5902
|
break;
|
|
5841
5903
|
default:
|
|
5842
5904
|
n = 0.5, h = n, o = -0.5, f = o;
|
|
@@ -5849,66 +5911,66 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5849
5911
|
h = u >= 0 ? 0.5 : -0.5;
|
|
5850
5912
|
break;
|
|
5851
5913
|
case g.Left:
|
|
5852
|
-
f =
|
|
5914
|
+
f = y > 0 ? 0.5 : -0.5;
|
|
5853
5915
|
break;
|
|
5854
5916
|
case g.Right:
|
|
5855
|
-
f =
|
|
5917
|
+
f = y > 0 ? 0.5 : -0.5;
|
|
5856
5918
|
break;
|
|
5857
5919
|
default:
|
|
5858
5920
|
h = 0.5, f = -0.5;
|
|
5859
5921
|
}
|
|
5860
|
-
Math.abs(u) >= Math.abs(
|
|
5922
|
+
Math.abs(u) >= Math.abs(y) ? (d = u > 0 ? -0.5 : 0.5, c = y > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = y > 0 ? -0.5 : 0.5);
|
|
5861
5923
|
}
|
|
5862
5924
|
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(
|
|
5863
5925
|
"fill",
|
|
5864
5926
|
t.selected ? r.selectedColor : r.color
|
|
5865
5927
|
).style("font-kerning", "none").text(t.startLabel);
|
|
5866
|
-
const
|
|
5867
|
-
if (
|
|
5868
|
-
const u = t.startLabel ?
|
|
5869
|
-
let
|
|
5928
|
+
const b = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
|
|
5929
|
+
if (b) {
|
|
5930
|
+
const u = t.startLabel ? b.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.startLabel ? b.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
|
|
5931
|
+
let k;
|
|
5870
5932
|
switch (t.startDirection) {
|
|
5871
5933
|
case g.Left:
|
|
5872
|
-
|
|
5934
|
+
k = l.getPointAtLength(
|
|
5873
5935
|
ot(r) + u / 2
|
|
5874
5936
|
);
|
|
5875
5937
|
break;
|
|
5876
5938
|
case g.Right:
|
|
5877
|
-
|
|
5878
|
-
|
|
5939
|
+
k = l.getPointAtLength(
|
|
5940
|
+
Y(r) + u / 2
|
|
5879
5941
|
);
|
|
5880
5942
|
break;
|
|
5881
5943
|
case g.Top:
|
|
5882
|
-
|
|
5944
|
+
k = l.getPointAtLength(
|
|
5883
5945
|
K(r) + u / 2
|
|
5884
5946
|
);
|
|
5885
5947
|
break;
|
|
5886
5948
|
case g.Bottom:
|
|
5887
|
-
|
|
5888
|
-
|
|
5949
|
+
k = l.getPointAtLength(
|
|
5950
|
+
U(r) + u / 2
|
|
5889
5951
|
);
|
|
5890
5952
|
break;
|
|
5891
5953
|
default:
|
|
5892
|
-
|
|
5954
|
+
k = l.getPointAtLength(
|
|
5893
5955
|
Math.max(
|
|
5894
|
-
|
|
5956
|
+
Y(r) + u / 2,
|
|
5895
5957
|
ot(r) + u / 2,
|
|
5896
|
-
|
|
5897
|
-
K(r) +
|
|
5958
|
+
U(r) + y / 2,
|
|
5959
|
+
K(r) + y / 2
|
|
5898
5960
|
)
|
|
5899
5961
|
);
|
|
5900
5962
|
}
|
|
5901
5963
|
e.select("g.diagram-connection-start-label path").attr(
|
|
5902
5964
|
"d",
|
|
5903
|
-
|
|
5965
|
+
qt(
|
|
5904
5966
|
-u / 2,
|
|
5905
|
-
-
|
|
5967
|
+
-y / 2,
|
|
5906
5968
|
u,
|
|
5907
|
-
|
|
5969
|
+
y
|
|
5908
5970
|
)
|
|
5909
5971
|
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
|
|
5910
5972
|
"transform",
|
|
5911
|
-
`translate(${
|
|
5973
|
+
`translate(${k.x + n * u},${k.y + o * y})`
|
|
5912
5974
|
);
|
|
5913
5975
|
}
|
|
5914
5976
|
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(
|
|
@@ -5917,18 +5979,18 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5917
5979
|
).style("font-kerning", "none").text(t.middleLabel);
|
|
5918
5980
|
const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
|
|
5919
5981
|
if (m) {
|
|
5920
|
-
const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0,
|
|
5982
|
+
const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, k = l.getPointAtLength(i / 2);
|
|
5921
5983
|
e.select("g.diagram-connection-middle-label path").attr(
|
|
5922
5984
|
"d",
|
|
5923
|
-
|
|
5985
|
+
qt(
|
|
5924
5986
|
-u / 2,
|
|
5925
|
-
-
|
|
5987
|
+
-y / 2,
|
|
5926
5988
|
u,
|
|
5927
|
-
|
|
5989
|
+
y
|
|
5928
5990
|
)
|
|
5929
5991
|
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
|
|
5930
5992
|
"transform",
|
|
5931
|
-
`translate(${
|
|
5993
|
+
`translate(${k.x + d * u},${k.y + c * y})`
|
|
5932
5994
|
);
|
|
5933
5995
|
}
|
|
5934
5996
|
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(
|
|
@@ -5937,57 +5999,57 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5937
5999
|
).style("font-kerning", "none").text(t.endLabel);
|
|
5938
6000
|
const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
|
|
5939
6001
|
if (p) {
|
|
5940
|
-
const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0,
|
|
5941
|
-
let
|
|
6002
|
+
const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
|
|
6003
|
+
let k;
|
|
5942
6004
|
switch (t.endDirection) {
|
|
5943
6005
|
case g.Left:
|
|
5944
|
-
|
|
6006
|
+
k = l.getPointAtLength(
|
|
5945
6007
|
i - (ot(r) + u / 2)
|
|
5946
6008
|
);
|
|
5947
6009
|
break;
|
|
5948
6010
|
case g.Right:
|
|
5949
|
-
|
|
5950
|
-
i - (
|
|
6011
|
+
k = l.getPointAtLength(
|
|
6012
|
+
i - (Y(r) + u / 2)
|
|
5951
6013
|
);
|
|
5952
6014
|
break;
|
|
5953
6015
|
case g.Top:
|
|
5954
|
-
|
|
6016
|
+
k = l.getPointAtLength(
|
|
5955
6017
|
i - (K(r) + u / 2)
|
|
5956
6018
|
);
|
|
5957
6019
|
break;
|
|
5958
6020
|
case g.Bottom:
|
|
5959
|
-
|
|
5960
|
-
i - (
|
|
6021
|
+
k = l.getPointAtLength(
|
|
6022
|
+
i - (U(r) + u / 2)
|
|
5961
6023
|
);
|
|
5962
6024
|
break;
|
|
5963
6025
|
default:
|
|
5964
|
-
|
|
6026
|
+
k = l.getPointAtLength(
|
|
5965
6027
|
i - Math.max(
|
|
5966
|
-
|
|
6028
|
+
Y(r) + u / 2,
|
|
5967
6029
|
ot(r) + u / 2,
|
|
5968
|
-
|
|
5969
|
-
K(r) +
|
|
6030
|
+
U(r) + y / 2,
|
|
6031
|
+
K(r) + y / 2
|
|
5970
6032
|
)
|
|
5971
6033
|
);
|
|
5972
6034
|
}
|
|
5973
6035
|
e.select("g.diagram-connection-end-label path").attr(
|
|
5974
6036
|
"d",
|
|
5975
|
-
|
|
6037
|
+
qt(
|
|
5976
6038
|
-u / 2,
|
|
5977
|
-
-
|
|
6039
|
+
-y / 2,
|
|
5978
6040
|
u,
|
|
5979
|
-
|
|
6041
|
+
y
|
|
5980
6042
|
)
|
|
5981
6043
|
).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
|
|
5982
6044
|
"transform",
|
|
5983
|
-
`translate(${
|
|
6045
|
+
`translate(${k.x + h * u},${k.y + f * y})`
|
|
5984
6046
|
);
|
|
5985
6047
|
}
|
|
5986
6048
|
}
|
|
5987
6049
|
}
|
|
5988
6050
|
updateConnectionMarkersInView(t) {
|
|
5989
6051
|
const e = this.selectCanvasView().select(
|
|
5990
|
-
`[id='${
|
|
6052
|
+
`[id='${pe(t.id)}']`
|
|
5991
6053
|
), a = e.select("marker.diagram-connection-start-marker"), l = e.select("marker.diagram-connection-end-marker");
|
|
5992
6054
|
t.startMarkerLook !== null ? a.attr("orient", "auto-start-reverse").attr("markerWidth", t.startMarkerLook.width).attr("markerHeight", t.startMarkerLook.height).attr("refX", t.startMarkerLook.refX).attr("refY", t.startMarkerLook.refY).select("image").attr("href", t.startMarkerLook.image).attr("width", t.startMarkerLook.width).attr("height", t.startMarkerLook.height) : a.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0), t.endMarkerLook !== null ? l.attr("orient", "auto-start-reverse").attr("markerWidth", t.endMarkerLook.width).attr("markerHeight", t.endMarkerLook.height).attr("refX", t.endMarkerLook.refX).attr("refY", t.endMarkerLook.refY).select("image").attr("href", t.endMarkerLook.image).attr("width", t.endMarkerLook.width).attr("height", t.endMarkerLook.height) : l.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0);
|
|
5993
6055
|
}
|
|
@@ -5995,8 +6057,8 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
5995
6057
|
const e = this.model.fields.get(t);
|
|
5996
6058
|
if (!e)
|
|
5997
6059
|
return !1;
|
|
5998
|
-
if (e.rootElement instanceof z || e.rootElement instanceof
|
|
5999
|
-
const a = this.minimumSizeOfField(e), l = a[0] +
|
|
6060
|
+
if (e.rootElement instanceof z || e.rootElement instanceof F) {
|
|
6061
|
+
const a = this.minimumSizeOfField(e), l = a[0] + Y(e.rootElement.type?.label) + ot(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + U(e.rootElement.type?.label) + K(e.rootElement.type?.label) - e.rootElement.height;
|
|
6000
6062
|
return l <= 0 && r <= 0;
|
|
6001
6063
|
}
|
|
6002
6064
|
return !0;
|
|
@@ -6006,10 +6068,10 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6006
6068
|
if (a) {
|
|
6007
6069
|
if (a.rootElement instanceof z) {
|
|
6008
6070
|
const l = this.minimumSizeOfField(a);
|
|
6009
|
-
let r = l[0] +
|
|
6071
|
+
let r = l[0] + Y(a.rootElement.type.label) + ot(a.rootElement.type.label) - a.rootElement.width, i = l[1] + U(a.rootElement.type.label) + K(a.rootElement.type.label) - a.rootElement.height;
|
|
6010
6072
|
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);
|
|
6011
6073
|
}
|
|
6012
|
-
if (a.rootElement instanceof
|
|
6074
|
+
if (a.rootElement instanceof F) {
|
|
6013
6075
|
const l = this.minimumSizeOfField(a);
|
|
6014
6076
|
let r = l[0], i = l[1];
|
|
6015
6077
|
for (const c of a.rootElement.node?.sections || [])
|
|
@@ -6022,7 +6084,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6022
6084
|
)));
|
|
6023
6085
|
l[0] < r && (l[0] = r), l[1] < i && (l[1] = i);
|
|
6024
6086
|
const n = a.rootElement.type;
|
|
6025
|
-
let o = l[0] +
|
|
6087
|
+
let o = l[0] + Y(n?.label) + ot(n?.label) - a.rootElement.width, d = l[1] + U(n?.label) + K(n?.label) - a.rootElement.height;
|
|
6026
6088
|
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(
|
|
6027
6089
|
g.Right,
|
|
6028
6090
|
o,
|
|
@@ -6080,7 +6142,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6080
6142
|
this.connectionType,
|
|
6081
6143
|
t,
|
|
6082
6144
|
void 0,
|
|
6083
|
-
|
|
6145
|
+
fe
|
|
6084
6146
|
);
|
|
6085
6147
|
else if (this.inferConnectionType) {
|
|
6086
6148
|
let e = this.model.connections.types.all().find(
|
|
@@ -6093,7 +6155,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6093
6155
|
e,
|
|
6094
6156
|
t,
|
|
6095
6157
|
void 0,
|
|
6096
|
-
|
|
6158
|
+
fe
|
|
6097
6159
|
));
|
|
6098
6160
|
}
|
|
6099
6161
|
}
|
|
@@ -6119,7 +6181,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6119
6181
|
) && this.unfinishedConnection?.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(
|
|
6120
6182
|
t.getNode()?.type?.id || ""
|
|
6121
6183
|
) && t.allowsIncoming) {
|
|
6122
|
-
const e = new
|
|
6184
|
+
const e = new de(
|
|
6123
6185
|
this,
|
|
6124
6186
|
this.unfinishedConnection.type,
|
|
6125
6187
|
this.unfinishedConnection.start?.id,
|
|
@@ -6131,7 +6193,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6131
6193
|
) && this.unfinishedConnection?.start?.allowsIncoming && this.unfinishedConnection.type.canStartFromType(
|
|
6132
6194
|
t.getNode()?.type?.id || ""
|
|
6133
6195
|
) && t.allowsOutgoing) {
|
|
6134
|
-
const e = new
|
|
6196
|
+
const e = new de(
|
|
6135
6197
|
this,
|
|
6136
6198
|
this.unfinishedConnection.type,
|
|
6137
6199
|
t.id,
|
|
@@ -6149,7 +6211,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6149
6211
|
this.unfinishedConnection?.start?.getNode()?.type?.id || ""
|
|
6150
6212
|
) && this.unfinishedConnection?.start?.allowsIncoming && l.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing
|
|
6151
6213
|
), a = !0), e !== void 0) {
|
|
6152
|
-
const l = new
|
|
6214
|
+
const l = new de(
|
|
6153
6215
|
this,
|
|
6154
6216
|
e,
|
|
6155
6217
|
a ? t.id : this.unfinishedConnection.start?.id,
|
|
@@ -6176,7 +6238,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6176
6238
|
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");
|
|
6177
6239
|
this.inputFieldContainer = c;
|
|
6178
6240
|
const h = c.append("xhtml:textarea");
|
|
6179
|
-
let f,
|
|
6241
|
+
let f, b;
|
|
6180
6242
|
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) => {
|
|
6181
6243
|
p.stopPropagation();
|
|
6182
6244
|
}).on($.KeyUp, (p) => {
|
|
@@ -6186,9 +6248,9 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6186
6248
|
}
|
|
6187
6249
|
}).on($.Input, () => {
|
|
6188
6250
|
const p = h.property("value");
|
|
6189
|
-
h.attr("cols",
|
|
6190
|
-
const u = Math.max(f, a),
|
|
6191
|
-
c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${
|
|
6251
|
+
h.attr("cols", Io(p) + 1), h.attr("rows", xo(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, b = h.property("scrollHeight") + 1;
|
|
6252
|
+
const u = Math.max(f, a), y = Math.max(b, l);
|
|
6253
|
+
c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${y}px`), h.style("height", `${y}px`), o && o(p);
|
|
6192
6254
|
}).on($.Click, (p) => {
|
|
6193
6255
|
p.stopPropagation();
|
|
6194
6256
|
}).on($.FocusOut, () => {
|
|
@@ -6217,7 +6279,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6217
6279
|
startMovingNode(t, e) {
|
|
6218
6280
|
if (this.canUserPerformAction(w.MoveNode) && !e.removed)
|
|
6219
6281
|
if (S(L.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
|
|
6220
|
-
this.currentAction = new
|
|
6282
|
+
this.currentAction = new le(
|
|
6221
6283
|
this,
|
|
6222
6284
|
this.userSelection.filter((a) => a instanceof z).map((a) => a.id),
|
|
6223
6285
|
e.coords
|
|
@@ -6242,7 +6304,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6242
6304
|
* Method to call to continue the moving of a node triggered by a user drag event.
|
|
6243
6305
|
*/
|
|
6244
6306
|
continueMovingNode(t, e) {
|
|
6245
|
-
if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof
|
|
6307
|
+
if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof le || this.currentAction instanceof X) && !e.removed) {
|
|
6246
6308
|
const a = [
|
|
6247
6309
|
t.x - e.width / 2,
|
|
6248
6310
|
t.y - e.height / 2
|
|
@@ -6265,7 +6327,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6265
6327
|
if (this.snapToGrid && (a = this.getClosestGridPoint([
|
|
6266
6328
|
a[0] - e.type.snapToGridOffset[0],
|
|
6267
6329
|
a[1] - e.type.snapToGridOffset[1]
|
|
6268
|
-
]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof
|
|
6330
|
+
]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof le) {
|
|
6269
6331
|
const l = this.currentAction.delta;
|
|
6270
6332
|
this.currentAction.delta = [
|
|
6271
6333
|
a[0] - l[0],
|
|
@@ -6278,11 +6340,11 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6278
6340
|
e.move(a);
|
|
6279
6341
|
const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
|
|
6280
6342
|
(o) => o.type.childrenTypes.includes(e.type.id)
|
|
6281
|
-
), i =
|
|
6343
|
+
), i = Ze(
|
|
6282
6344
|
r
|
|
6283
6345
|
), n = i[i.length - 1];
|
|
6284
6346
|
if (n !== e.parent && (e.type.canBeParentless || n !== void 0)) {
|
|
6285
|
-
const o = n?.getLastAncestor(), d = this.currentAction.from, c = new
|
|
6347
|
+
const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Jo(
|
|
6286
6348
|
this,
|
|
6287
6349
|
e.id,
|
|
6288
6350
|
e.parent?.id,
|
|
@@ -6328,7 +6390,7 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6328
6390
|
const e = this.getPointerLocationRelativeToCanvas(t);
|
|
6329
6391
|
this.multipleSelectionContainer?.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
|
|
6330
6392
|
for (const a of this.model.nodes)
|
|
6331
|
-
|
|
6393
|
+
mo(
|
|
6332
6394
|
[
|
|
6333
6395
|
a.coords,
|
|
6334
6396
|
[a.coords[0] + a.width, a.coords[1] + a.height]
|
|
@@ -6340,9 +6402,9 @@ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
|
6340
6402
|
), S();
|
|
6341
6403
|
}
|
|
6342
6404
|
};
|
|
6343
|
-
|
|
6344
|
-
let
|
|
6345
|
-
class
|
|
6405
|
+
te.canvasCount = 0;
|
|
6406
|
+
let we = te;
|
|
6407
|
+
class io {
|
|
6346
6408
|
constructor() {
|
|
6347
6409
|
this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
|
|
6348
6410
|
}
|
|
@@ -6454,16 +6516,16 @@ class to {
|
|
|
6454
6516
|
}
|
|
6455
6517
|
}
|
|
6456
6518
|
}
|
|
6457
|
-
class
|
|
6519
|
+
class yi {
|
|
6458
6520
|
constructor(t) {
|
|
6459
6521
|
this.gapSize = t;
|
|
6460
6522
|
}
|
|
6461
6523
|
apply(t) {
|
|
6462
6524
|
if (t.nodes.length === 0)
|
|
6463
6525
|
return t;
|
|
6464
|
-
const e = new
|
|
6526
|
+
const e = new io(), a = t.nodes.filter((n) => !n.parent);
|
|
6465
6527
|
for (; a.length > 0; )
|
|
6466
|
-
|
|
6528
|
+
so(
|
|
6467
6529
|
a[0],
|
|
6468
6530
|
e,
|
|
6469
6531
|
[0, 0],
|
|
@@ -6481,25 +6543,25 @@ class pi {
|
|
|
6481
6543
|
return t;
|
|
6482
6544
|
}
|
|
6483
6545
|
}
|
|
6484
|
-
const
|
|
6546
|
+
const so = (s, t, e, a) => {
|
|
6485
6547
|
const l = t.getClosestEmptyCoordinate(e);
|
|
6486
|
-
t.set(l, s),
|
|
6548
|
+
t.set(l, s), B(a, s);
|
|
6487
6549
|
for (const r of s.getAdjacentNodes())
|
|
6488
|
-
a.includes(r) &&
|
|
6550
|
+
a.includes(r) && so(
|
|
6489
6551
|
r,
|
|
6490
6552
|
t,
|
|
6491
6553
|
l,
|
|
6492
6554
|
a
|
|
6493
6555
|
);
|
|
6494
6556
|
};
|
|
6495
|
-
class
|
|
6557
|
+
class bi {
|
|
6496
6558
|
constructor(t) {
|
|
6497
6559
|
this.gapSize = t;
|
|
6498
6560
|
}
|
|
6499
6561
|
apply(t) {
|
|
6500
6562
|
if (t.nodes.length === 0)
|
|
6501
6563
|
return t;
|
|
6502
|
-
const e = new
|
|
6564
|
+
const e = new io(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
|
|
6503
6565
|
let i = [r];
|
|
6504
6566
|
for (l[r.id] = [0, 0]; a.length > 0; ) {
|
|
6505
6567
|
const c = [];
|
|
@@ -6509,10 +6571,10 @@ class mi {
|
|
|
6509
6571
|
l[h.id]
|
|
6510
6572
|
),
|
|
6511
6573
|
h
|
|
6512
|
-
),
|
|
6574
|
+
), B(a, h);
|
|
6513
6575
|
const f = h.getAdjacentNodes();
|
|
6514
|
-
for (const
|
|
6515
|
-
a.includes(
|
|
6576
|
+
for (const b of f)
|
|
6577
|
+
a.includes(b) && (c.push(b), l[b.id] = l[h.id]);
|
|
6516
6578
|
}
|
|
6517
6579
|
if (c.length > 0)
|
|
6518
6580
|
i = c;
|
|
@@ -6533,7 +6595,7 @@ class mi {
|
|
|
6533
6595
|
return t;
|
|
6534
6596
|
}
|
|
6535
6597
|
}
|
|
6536
|
-
class
|
|
6598
|
+
class re {
|
|
6537
6599
|
constructor(t) {
|
|
6538
6600
|
this.gapSize = t;
|
|
6539
6601
|
}
|
|
@@ -6543,14 +6605,14 @@ class ne {
|
|
|
6543
6605
|
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2;
|
|
6544
6606
|
let a = t.nodes.filter((n) => !n.parent);
|
|
6545
6607
|
const l = a[0];
|
|
6546
|
-
|
|
6608
|
+
B(a, l);
|
|
6547
6609
|
const r = [[l]];
|
|
6548
6610
|
for (; a.length > 0; ) {
|
|
6549
6611
|
const n = r[r.length - 1], o = [];
|
|
6550
6612
|
for (const d of n) {
|
|
6551
6613
|
const c = d.getAdjacentNodes();
|
|
6552
6614
|
for (const h of c)
|
|
6553
|
-
a.includes(h) && (
|
|
6615
|
+
a.includes(h) && (B(a, h), o.push(h));
|
|
6554
6616
|
}
|
|
6555
6617
|
o.length > 0 ? r.push(o) : (r.push(a), a = []);
|
|
6556
6618
|
}
|
|
@@ -6567,14 +6629,14 @@ class ne {
|
|
|
6567
6629
|
return t;
|
|
6568
6630
|
}
|
|
6569
6631
|
}
|
|
6570
|
-
class
|
|
6632
|
+
class ki {
|
|
6571
6633
|
constructor(t) {
|
|
6572
6634
|
this.gapSize = t;
|
|
6573
6635
|
}
|
|
6574
6636
|
apply(t) {
|
|
6575
6637
|
if (t.nodes.length === 0)
|
|
6576
6638
|
return t;
|
|
6577
|
-
new
|
|
6639
|
+
new re(this.gapSize).apply(t);
|
|
6578
6640
|
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;
|
|
6579
6641
|
let c = 100;
|
|
6580
6642
|
for (; c > l; ) {
|
|
@@ -6586,7 +6648,7 @@ class vi {
|
|
|
6586
6648
|
h[0] = h[0] / t.nodes.length, h[1] = h[1] / t.nodes.length;
|
|
6587
6649
|
}
|
|
6588
6650
|
for (const f of t.nodes) {
|
|
6589
|
-
const
|
|
6651
|
+
const b = f.getAdjacentNodes();
|
|
6590
6652
|
for (const m of t.nodes) {
|
|
6591
6653
|
const p = [
|
|
6592
6654
|
f.coords[0] + f.width / 2,
|
|
@@ -6594,16 +6656,16 @@ class vi {
|
|
|
6594
6656
|
], u = [
|
|
6595
6657
|
m.coords[0] + m.width / 2,
|
|
6596
6658
|
m.coords[1] + m.height / 2
|
|
6597
|
-
],
|
|
6659
|
+
], y = Ue(
|
|
6598
6660
|
f.coords,
|
|
6599
6661
|
m.coords
|
|
6600
|
-
),
|
|
6601
|
-
if (
|
|
6602
|
-
const N = i / (
|
|
6603
|
-
|
|
6662
|
+
), k = [m.coords[0], m.coords[1]];
|
|
6663
|
+
if (b.includes(m) && y > 0 && (y > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (k[0] = k[0] - (u[0] - p[0]) * r, k[1] = k[1] - (u[1] - p[1]) * r) : (k[0] = k[0] + (u[0] - p[0]) * n, k[1] = k[1] + (u[1] - p[1]) * n)), y > 0) {
|
|
6664
|
+
const N = i / (y * y);
|
|
6665
|
+
k[0] = k[0] + N * (u[0] - p[0]) / y, k[1] = k[1] + N * (u[1] - p[1]) / y;
|
|
6604
6666
|
} else
|
|
6605
|
-
|
|
6606
|
-
|
|
6667
|
+
k[0] = k[0] + o * (Math.random() * 2 - 1), k[1] = k[1] + o * (Math.random() * 2 - 1);
|
|
6668
|
+
k[0] = k[0] - (u[0] - h[0]) * d, k[1] = k[1] - (u[1] - h[1]) * d, k[0] - m.coords[0] > c ? k[0] = m.coords[0] + c : k[0] - m.coords[0] < -c && (k[0] = m.coords[0] - c), k[1] - m.coords[1] > c ? k[1] = m.coords[1] + c : k[1] - m.coords[1] < -c && (k[1] = m.coords[1] - c), m.move(k);
|
|
6607
6669
|
}
|
|
6608
6670
|
}
|
|
6609
6671
|
}
|
|
@@ -6620,7 +6682,7 @@ class vi {
|
|
|
6620
6682
|
return t;
|
|
6621
6683
|
}
|
|
6622
6684
|
}
|
|
6623
|
-
class
|
|
6685
|
+
class wi {
|
|
6624
6686
|
constructor(t) {
|
|
6625
6687
|
this.gapSize = t;
|
|
6626
6688
|
}
|
|
@@ -6635,7 +6697,7 @@ class yi {
|
|
|
6635
6697
|
return t;
|
|
6636
6698
|
}
|
|
6637
6699
|
}
|
|
6638
|
-
class
|
|
6700
|
+
class Si {
|
|
6639
6701
|
constructor(t) {
|
|
6640
6702
|
this.gapSize = t;
|
|
6641
6703
|
}
|
|
@@ -6648,53 +6710,53 @@ class bi {
|
|
|
6648
6710
|
...t.nodes.map((c) => c.getPriority())
|
|
6649
6711
|
);
|
|
6650
6712
|
if (e === a)
|
|
6651
|
-
return new
|
|
6713
|
+
return new re(this.gapSize).apply(t), t;
|
|
6652
6714
|
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 = [];
|
|
6653
6715
|
if (n.length > 1) {
|
|
6654
6716
|
const c = n[0];
|
|
6655
6717
|
n.splice(0, 1), o.push(c);
|
|
6656
6718
|
const h = [c], f = [c];
|
|
6657
6719
|
for (; h.length > 0; ) {
|
|
6658
|
-
const
|
|
6659
|
-
h.splice(0, 1), n.includes(
|
|
6660
|
-
const m =
|
|
6720
|
+
const b = h[0];
|
|
6721
|
+
h.splice(0, 1), n.includes(b) && (o.push(b), B(n, b));
|
|
6722
|
+
const m = b.getAdjacentNodes();
|
|
6661
6723
|
for (const p of m)
|
|
6662
6724
|
f.includes(p) || (h.push(p), f.push(p));
|
|
6663
6725
|
}
|
|
6664
|
-
for (const
|
|
6665
|
-
o.push(
|
|
6726
|
+
for (const b of n)
|
|
6727
|
+
o.push(b);
|
|
6666
6728
|
} else
|
|
6667
6729
|
o.push(n[0]);
|
|
6668
6730
|
for (const c of o)
|
|
6669
|
-
|
|
6731
|
+
B(r, c), i.push([c]);
|
|
6670
6732
|
for (i.push([]), r.sort((c, h) => h.type.priority - c.type.priority); r.length > 0; ) {
|
|
6671
6733
|
const c = r[0];
|
|
6672
6734
|
r.splice(0, 1);
|
|
6673
6735
|
const h = [c], f = [c];
|
|
6674
|
-
let
|
|
6736
|
+
let b = !1;
|
|
6675
6737
|
for (; h.length > 0; ) {
|
|
6676
6738
|
const m = h[0];
|
|
6677
6739
|
h.splice(0, 1);
|
|
6678
6740
|
const p = o.indexOf(m);
|
|
6679
6741
|
if (p >= 0) {
|
|
6680
|
-
i[p].push(c),
|
|
6742
|
+
i[p].push(c), b = !0;
|
|
6681
6743
|
break;
|
|
6682
6744
|
} else {
|
|
6683
6745
|
const u = m.getAdjacentNodes();
|
|
6684
|
-
for (const
|
|
6685
|
-
f.includes(
|
|
6746
|
+
for (const y of u)
|
|
6747
|
+
f.includes(y) || (h.push(y), f.push(y));
|
|
6686
6748
|
}
|
|
6687
6749
|
}
|
|
6688
|
-
|
|
6750
|
+
b || i[i.length - 1].push(c);
|
|
6689
6751
|
}
|
|
6690
6752
|
let d = 0;
|
|
6691
6753
|
for (let c = 0; c < i.length; ++c) {
|
|
6692
6754
|
let h = 0;
|
|
6693
|
-
for (let
|
|
6694
|
-
const m = i[c][
|
|
6755
|
+
for (let b = 0; b < i[c].length; ++b) {
|
|
6756
|
+
const m = i[c][b];
|
|
6695
6757
|
m.move([d, h]), h += l + m.height;
|
|
6696
6758
|
}
|
|
6697
|
-
const f = Math.max(...i[c].map((
|
|
6759
|
+
const f = Math.max(...i[c].map((b) => b.width));
|
|
6698
6760
|
d += l + f;
|
|
6699
6761
|
}
|
|
6700
6762
|
for (const c of t.connections)
|
|
@@ -6702,7 +6764,7 @@ class bi {
|
|
|
6702
6764
|
return t;
|
|
6703
6765
|
}
|
|
6704
6766
|
}
|
|
6705
|
-
class
|
|
6767
|
+
class Ci {
|
|
6706
6768
|
constructor(t) {
|
|
6707
6769
|
this.gapSize = t;
|
|
6708
6770
|
}
|
|
@@ -6715,27 +6777,27 @@ class ki {
|
|
|
6715
6777
|
...t.nodes.map((c) => c.getPriority())
|
|
6716
6778
|
);
|
|
6717
6779
|
if (e === a)
|
|
6718
|
-
return new
|
|
6780
|
+
return new re(this.gapSize).apply(t), t;
|
|
6719
6781
|
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 = [];
|
|
6720
6782
|
for (; r.length > 0; ) {
|
|
6721
6783
|
const c = r[0];
|
|
6722
6784
|
r.splice(0, 1);
|
|
6723
|
-
const h = new
|
|
6724
|
-
|
|
6785
|
+
const h = new Ae(void 0, c);
|
|
6786
|
+
no(h, r), i.push(h);
|
|
6725
6787
|
}
|
|
6726
6788
|
const n = [];
|
|
6727
6789
|
for (const c of i)
|
|
6728
|
-
n.push([c]),
|
|
6790
|
+
n.push([c]), ro(c, n, n.length);
|
|
6729
6791
|
const o = Math.max(...t.nodes.map((c) => c.height));
|
|
6730
6792
|
let d = 0;
|
|
6731
6793
|
for (let c = 0; c < n.length; ++c) {
|
|
6732
6794
|
let h = 0;
|
|
6733
|
-
for (let
|
|
6734
|
-
const m = n[c][
|
|
6795
|
+
for (let b = 0; b < n[c].length; ++b) {
|
|
6796
|
+
const m = n[c][b];
|
|
6735
6797
|
m.node.move([d, h]), h += (l + o) * m.countBranchHeight();
|
|
6736
6798
|
}
|
|
6737
6799
|
const f = Math.max(
|
|
6738
|
-
...n[c].map((
|
|
6800
|
+
...n[c].map((b) => b.node.width)
|
|
6739
6801
|
);
|
|
6740
6802
|
d += l + f;
|
|
6741
6803
|
}
|
|
@@ -6744,29 +6806,29 @@ class ki {
|
|
|
6744
6806
|
return t;
|
|
6745
6807
|
}
|
|
6746
6808
|
}
|
|
6747
|
-
const
|
|
6809
|
+
const no = (s, t) => {
|
|
6748
6810
|
for (const e of s.node.getAdjacentNodes().sort((a, l) => l.getPriority() - a.getPriority())) {
|
|
6749
6811
|
const a = t.indexOf(e);
|
|
6750
6812
|
if (a >= 0) {
|
|
6751
6813
|
t.splice(a, 1);
|
|
6752
6814
|
const l = s.addBranch(e);
|
|
6753
|
-
|
|
6815
|
+
no(l, t);
|
|
6754
6816
|
}
|
|
6755
6817
|
}
|
|
6756
|
-
},
|
|
6818
|
+
}, ro = (s, t, e) => {
|
|
6757
6819
|
if (s.branches.length > 0) {
|
|
6758
6820
|
for (; e >= t.length; )
|
|
6759
6821
|
t.push([]);
|
|
6760
6822
|
for (const a of s.branches)
|
|
6761
|
-
t[e].push(a),
|
|
6823
|
+
t[e].push(a), ro(a, t, e + 1);
|
|
6762
6824
|
}
|
|
6763
6825
|
};
|
|
6764
|
-
class
|
|
6826
|
+
class Ae {
|
|
6765
6827
|
constructor(t, e) {
|
|
6766
6828
|
this.parent = t, this.branches = [], this.depth = 0, this.node = e;
|
|
6767
6829
|
}
|
|
6768
6830
|
addBranch(t) {
|
|
6769
|
-
const e = new
|
|
6831
|
+
const e = new Ae(this, t);
|
|
6770
6832
|
return e.depth = this.depth + 1, this.branches.push(e), e;
|
|
6771
6833
|
}
|
|
6772
6834
|
countBranchHeight() {
|
|
@@ -6780,7 +6842,7 @@ class Se {
|
|
|
6780
6842
|
}
|
|
6781
6843
|
}
|
|
6782
6844
|
}
|
|
6783
|
-
class
|
|
6845
|
+
class $i {
|
|
6784
6846
|
constructor(t) {
|
|
6785
6847
|
this.gapSize = t;
|
|
6786
6848
|
}
|
|
@@ -6795,17 +6857,17 @@ class wi {
|
|
|
6795
6857
|
return t;
|
|
6796
6858
|
}
|
|
6797
6859
|
}
|
|
6798
|
-
const
|
|
6799
|
-
adjacency: new
|
|
6800
|
-
breadth: new
|
|
6801
|
-
"breadth-adjacency": new
|
|
6802
|
-
force: new
|
|
6803
|
-
horizontal: new
|
|
6804
|
-
priority: new
|
|
6805
|
-
tree: new
|
|
6806
|
-
vertical: new
|
|
6807
|
-
},
|
|
6808
|
-
class
|
|
6860
|
+
const _e = {
|
|
6861
|
+
adjacency: new yi(),
|
|
6862
|
+
breadth: new re(),
|
|
6863
|
+
"breadth-adjacency": new bi(),
|
|
6864
|
+
force: new ki(),
|
|
6865
|
+
horizontal: new wi(),
|
|
6866
|
+
priority: new Si(),
|
|
6867
|
+
tree: new Ci(),
|
|
6868
|
+
vertical: new $i()
|
|
6869
|
+
}, Ai = Fe({}), $t = Fe({});
|
|
6870
|
+
class Ii {
|
|
6809
6871
|
constructor(t, e) {
|
|
6810
6872
|
this.onTitleChange = t, this.onValueSetChange = e;
|
|
6811
6873
|
}
|
|
@@ -6824,7 +6886,7 @@ class Ci {
|
|
|
6824
6886
|
highlightProperty(...t) {
|
|
6825
6887
|
}
|
|
6826
6888
|
}
|
|
6827
|
-
const
|
|
6889
|
+
const Ie = ({
|
|
6828
6890
|
direction: s,
|
|
6829
6891
|
collapsableSelector: t,
|
|
6830
6892
|
collapsableAdditionalSelector: e,
|
|
@@ -6835,10 +6897,10 @@ const Ce = ({
|
|
|
6835
6897
|
visibleValue: n,
|
|
6836
6898
|
onCollapse: o
|
|
6837
6899
|
}) => {
|
|
6838
|
-
const [d, c] =
|
|
6900
|
+
const [d, c] = D(a), h = () => {
|
|
6839
6901
|
if (!l) {
|
|
6840
|
-
const
|
|
6841
|
-
c(
|
|
6902
|
+
const b = !d;
|
|
6903
|
+
c(b), o?.(b);
|
|
6842
6904
|
let m;
|
|
6843
6905
|
if (typeof t == "string")
|
|
6844
6906
|
m = x.select(t), e && (m = m.select(e));
|
|
@@ -6847,7 +6909,7 @@ const Ce = ({
|
|
|
6847
6909
|
if (!p) throw new Error("collapsableSelector is not a valid ref");
|
|
6848
6910
|
m = x.select(p.current), e && (m = m.select(e));
|
|
6849
6911
|
}
|
|
6850
|
-
m.style(r,
|
|
6912
|
+
m.style(r, b ? i : n);
|
|
6851
6913
|
}
|
|
6852
6914
|
}, f = () => {
|
|
6853
6915
|
switch (s) {
|
|
@@ -6869,10 +6931,10 @@ const Ce = ({
|
|
|
6869
6931
|
children: /* @__PURE__ */ v("div", { className: f() })
|
|
6870
6932
|
}
|
|
6871
6933
|
) });
|
|
6872
|
-
},
|
|
6873
|
-
const s =
|
|
6874
|
-
|
|
6875
|
-
|
|
6934
|
+
}, xi = () => {
|
|
6935
|
+
const s = Dt($t), t = rt(null), [e, a] = D([]);
|
|
6936
|
+
fo(s.validatorChange$, s.diagramChange$).pipe(
|
|
6937
|
+
uo(() => l())
|
|
6876
6938
|
).subscribe();
|
|
6877
6939
|
const l = () => {
|
|
6878
6940
|
a([]);
|
|
@@ -6896,15 +6958,15 @@ const Ce = ({
|
|
|
6896
6958
|
...i.propertyNames
|
|
6897
6959
|
));
|
|
6898
6960
|
};
|
|
6899
|
-
return /* @__PURE__ */ v("daga-errors", { children: /* @__PURE__ */
|
|
6961
|
+
return /* @__PURE__ */ v("daga-errors", { children: /* @__PURE__ */ T("div", { ref: t, className: "daga-errors", children: [
|
|
6900
6962
|
e.length === 0 && /* @__PURE__ */ v("div", { className: "daga-errors-summary daga-no-errors daga-prevent-user-select", children: /* @__PURE__ */ v("span", { children: "No errors found" }) }),
|
|
6901
|
-
e.length > 0 && /* @__PURE__ */
|
|
6902
|
-
/* @__PURE__ */
|
|
6963
|
+
e.length > 0 && /* @__PURE__ */ T("div", { className: "daga-errors-summary daga-with-errors daga-prevent-user-select", children: [
|
|
6964
|
+
/* @__PURE__ */ T("span", { children: [
|
|
6903
6965
|
e.length,
|
|
6904
6966
|
" errors found"
|
|
6905
6967
|
] }),
|
|
6906
6968
|
/* @__PURE__ */ v("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ v(
|
|
6907
|
-
|
|
6969
|
+
Ie,
|
|
6908
6970
|
{
|
|
6909
6971
|
collapsableSelector: t,
|
|
6910
6972
|
collapsableAdditionalSelector: ".daga-error-panel",
|
|
@@ -6926,59 +6988,59 @@ const Ce = ({
|
|
|
6926
6988
|
n
|
|
6927
6989
|
)) }) })
|
|
6928
6990
|
] }) });
|
|
6929
|
-
},
|
|
6991
|
+
}, Li = 200, Ge = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), ao = ({
|
|
6930
6992
|
disabled: s,
|
|
6931
6993
|
options: t,
|
|
6932
6994
|
value: e,
|
|
6933
6995
|
onChange: a
|
|
6934
6996
|
}) => {
|
|
6935
|
-
const l = rt(null), [r, i] =
|
|
6997
|
+
const l = rt(null), [r, i] = D("");
|
|
6936
6998
|
let n;
|
|
6937
|
-
const [o, d] =
|
|
6999
|
+
const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, y] = D(!1);
|
|
6938
7000
|
Ct(() => {
|
|
6939
|
-
i(t.find((
|
|
7001
|
+
i(t.find((I) => St(I.key, e))?.label || "");
|
|
6940
7002
|
}, [e, t]);
|
|
6941
|
-
const
|
|
7003
|
+
const k = (I) => {
|
|
6942
7004
|
if (!s)
|
|
6943
|
-
switch (
|
|
7005
|
+
switch (I.key) {
|
|
6944
7006
|
case Z.PageDown:
|
|
6945
|
-
n === void 0 ? (P(0), E(0)) : (P(n + 5), E(n)),
|
|
7007
|
+
n === void 0 ? (P(0), E(0)) : (P(n + 5), E(n)), I.preventDefault();
|
|
6946
7008
|
break;
|
|
6947
7009
|
case Z.ArrowDown:
|
|
6948
|
-
n === void 0 ? (P(0), E(0)) : (P(n + 1), E(n)),
|
|
7010
|
+
n === void 0 ? (P(0), E(0)) : (P(n + 1), E(n)), I.preventDefault();
|
|
6949
7011
|
break;
|
|
6950
7012
|
case Z.PageUp:
|
|
6951
|
-
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 5), E(n)),
|
|
7013
|
+
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 5), E(n)), I.preventDefault();
|
|
6952
7014
|
break;
|
|
6953
7015
|
case Z.ArrowUp:
|
|
6954
|
-
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)),
|
|
7016
|
+
n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)), I.preventDefault();
|
|
6955
7017
|
break;
|
|
6956
7018
|
case Z.Escape:
|
|
6957
|
-
|
|
7019
|
+
R(), I.preventDefault();
|
|
6958
7020
|
break;
|
|
6959
7021
|
case Z.Enter:
|
|
6960
|
-
O(t[n || 0]),
|
|
7022
|
+
O(t[n || 0]), I.preventDefault();
|
|
6961
7023
|
break;
|
|
6962
7024
|
default:
|
|
6963
7025
|
N();
|
|
6964
7026
|
}
|
|
6965
7027
|
}, N = () => {
|
|
6966
7028
|
if (!s) {
|
|
6967
|
-
const
|
|
6968
|
-
d([]), h([]),
|
|
7029
|
+
const I = Ge(r.trim());
|
|
7030
|
+
d([]), h([]), b([]), p([]);
|
|
6969
7031
|
for (const _ of t) {
|
|
6970
|
-
const q =
|
|
7032
|
+
const q = Ge(_.label).indexOf(I);
|
|
6971
7033
|
if (q >= 0) {
|
|
6972
7034
|
const Bt = _.label.substring(0, q), J = _.label.substring(
|
|
6973
7035
|
q,
|
|
6974
|
-
q +
|
|
7036
|
+
q + I.length
|
|
6975
7037
|
), wt = _.label.substring(
|
|
6976
|
-
q +
|
|
7038
|
+
q + I.length
|
|
6977
7039
|
);
|
|
6978
7040
|
d((nt) => [...nt, _]), h((nt) => [
|
|
6979
7041
|
...nt,
|
|
6980
7042
|
Bt
|
|
6981
|
-
]),
|
|
7043
|
+
]), b((nt) => [
|
|
6982
7044
|
...nt,
|
|
6983
7045
|
J
|
|
6984
7046
|
]), p((nt) => [
|
|
@@ -6987,56 +7049,56 @@ const Ce = ({
|
|
|
6987
7049
|
]);
|
|
6988
7050
|
}
|
|
6989
7051
|
}
|
|
6990
|
-
|
|
7052
|
+
y(!0);
|
|
6991
7053
|
}
|
|
6992
|
-
},
|
|
6993
|
-
|
|
6994
|
-
}, P = (
|
|
7054
|
+
}, R = () => {
|
|
7055
|
+
y(!1);
|
|
7056
|
+
}, P = (I) => {
|
|
6995
7057
|
if (!s) {
|
|
6996
|
-
if (n =
|
|
7058
|
+
if (n = I, I === void 0)
|
|
6997
7059
|
return;
|
|
6998
|
-
|
|
7060
|
+
I < 0 && (n = 0), I >= t.length && (n = t.length - 1);
|
|
6999
7061
|
}
|
|
7000
7062
|
}, tt = () => {
|
|
7001
7063
|
setTimeout(() => {
|
|
7002
|
-
|
|
7003
|
-
},
|
|
7004
|
-
}, E = (
|
|
7005
|
-
const _ = l.current?.querySelectorAll("li")[
|
|
7064
|
+
R();
|
|
7065
|
+
}, Li);
|
|
7066
|
+
}, E = (I) => {
|
|
7067
|
+
const _ = l.current?.querySelectorAll("li")[I];
|
|
7006
7068
|
_ && _.scrollIntoView({ block: "center" });
|
|
7007
7069
|
}, C = () => {
|
|
7008
|
-
s || (i(""),
|
|
7009
|
-
}, O = (
|
|
7010
|
-
s || (i(
|
|
7070
|
+
s || (i(""), y(!1), n = void 0);
|
|
7071
|
+
}, O = (I) => {
|
|
7072
|
+
s || (i(I.label), y(!1), n = void 0, a(I.key));
|
|
7011
7073
|
};
|
|
7012
|
-
return /* @__PURE__ */
|
|
7074
|
+
return /* @__PURE__ */ T(
|
|
7013
7075
|
"div",
|
|
7014
7076
|
{
|
|
7015
7077
|
ref: l,
|
|
7016
7078
|
className: `daga-autocomplete ${u ? "daga-showing-options" : ""}`,
|
|
7017
7079
|
children: [
|
|
7018
|
-
/* @__PURE__ */
|
|
7080
|
+
/* @__PURE__ */ T("div", { className: "daga-autocomplete-input", children: [
|
|
7019
7081
|
/* @__PURE__ */ v(
|
|
7020
7082
|
"input",
|
|
7021
7083
|
{
|
|
7022
7084
|
value: r,
|
|
7023
7085
|
disabled: s,
|
|
7024
|
-
onKeyUp:
|
|
7086
|
+
onKeyUp: k,
|
|
7025
7087
|
onFocus: N,
|
|
7026
7088
|
onBlur: tt,
|
|
7027
|
-
onChange: (
|
|
7089
|
+
onChange: (I) => i(I.target.value)
|
|
7028
7090
|
}
|
|
7029
7091
|
),
|
|
7030
7092
|
r !== "" && /* @__PURE__ */ v("button", { className: "daga-clear", onClick: C })
|
|
7031
7093
|
] }),
|
|
7032
|
-
/* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */
|
|
7094
|
+
/* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ T("ul", { className: "daga-autocomplete-option-list", children: [
|
|
7033
7095
|
o.length === 0 && /* @__PURE__ */ v("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
|
|
7034
|
-
o.map((
|
|
7096
|
+
o.map((I, _) => /* @__PURE__ */ T(
|
|
7035
7097
|
"li",
|
|
7036
7098
|
{
|
|
7037
7099
|
className: `daga-autocomplete-option ${_ === n ? "daga-focused" : ""}`,
|
|
7038
7100
|
onMouseMove: () => P(_),
|
|
7039
|
-
onClick: () => O(
|
|
7101
|
+
onClick: () => O(I),
|
|
7040
7102
|
children: [
|
|
7041
7103
|
/* @__PURE__ */ v("span", { children: c[_] }),
|
|
7042
7104
|
/* @__PURE__ */ v("span", { className: "daga-match", children: f[_] }),
|
|
@@ -7049,52 +7111,52 @@ const Ce = ({
|
|
|
7049
7111
|
]
|
|
7050
7112
|
}
|
|
7051
7113
|
);
|
|
7052
|
-
},
|
|
7114
|
+
}, Ei = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ti = ({
|
|
7053
7115
|
disabled: s,
|
|
7054
7116
|
allowRepeats: t,
|
|
7055
7117
|
options: e,
|
|
7056
7118
|
value: a,
|
|
7057
7119
|
onChange: l
|
|
7058
7120
|
}) => {
|
|
7059
|
-
const [r, i] =
|
|
7121
|
+
const [r, i] = D(), [n, o] = D([]), [d, c] = D([]);
|
|
7060
7122
|
Ct(() => {
|
|
7061
|
-
const u = a.length === 0,
|
|
7062
|
-
o(
|
|
7123
|
+
const u = a.length === 0, y = a.map((k) => Ei(e, k));
|
|
7124
|
+
o(y), u && l(a), p();
|
|
7063
7125
|
}, [a, e]);
|
|
7064
7126
|
const h = (u) => {
|
|
7065
|
-
for (const
|
|
7066
|
-
if (
|
|
7127
|
+
for (const y of a)
|
|
7128
|
+
if (y === u)
|
|
7067
7129
|
return !0;
|
|
7068
7130
|
return !1;
|
|
7069
7131
|
}, f = (u) => {
|
|
7070
|
-
a.length > u && (a.splice(u, 1), o(n.filter((
|
|
7071
|
-
},
|
|
7132
|
+
a.length > u && (a.splice(u, 1), o(n.filter((y, k) => k !== u)), l(a), p());
|
|
7133
|
+
}, b = () => {
|
|
7072
7134
|
r !== void 0 && (t || !h(r)) && (l(a.concat(r)), m());
|
|
7073
7135
|
}, m = () => {
|
|
7074
7136
|
i("");
|
|
7075
7137
|
}, p = () => {
|
|
7076
7138
|
if (!t) {
|
|
7077
7139
|
const u = [];
|
|
7078
|
-
for (const
|
|
7079
|
-
h(
|
|
7140
|
+
for (const y of e)
|
|
7141
|
+
h(y.key) || u.push(y);
|
|
7080
7142
|
c(u);
|
|
7081
7143
|
}
|
|
7082
7144
|
};
|
|
7083
|
-
return /* @__PURE__ */
|
|
7084
|
-
a.map((u,
|
|
7085
|
-
/* @__PURE__ */ v("span", { className: "daga-input", children: n[
|
|
7145
|
+
return /* @__PURE__ */ T("div", { children: [
|
|
7146
|
+
a.map((u, y) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
|
|
7147
|
+
/* @__PURE__ */ v("span", { className: "daga-input", children: n[y] }),
|
|
7086
7148
|
!s && /* @__PURE__ */ v(
|
|
7087
7149
|
"button",
|
|
7088
7150
|
{
|
|
7089
7151
|
className: "daga-property-button",
|
|
7090
|
-
onClick: () => f(
|
|
7152
|
+
onClick: () => f(y),
|
|
7091
7153
|
children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
|
|
7092
7154
|
}
|
|
7093
7155
|
)
|
|
7094
|
-
] },
|
|
7095
|
-
!s && /* @__PURE__ */
|
|
7156
|
+
] }, y)),
|
|
7157
|
+
!s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
|
|
7096
7158
|
/* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
7097
|
-
|
|
7159
|
+
ao,
|
|
7098
7160
|
{
|
|
7099
7161
|
disabled: s,
|
|
7100
7162
|
options: t ? e || [] : d || [],
|
|
@@ -7102,25 +7164,25 @@ const Ce = ({
|
|
|
7102
7164
|
onChange: i
|
|
7103
7165
|
}
|
|
7104
7166
|
) }),
|
|
7105
|
-
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick:
|
|
7167
|
+
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7106
7168
|
] })
|
|
7107
7169
|
] });
|
|
7108
|
-
},
|
|
7170
|
+
}, Mi = ({
|
|
7109
7171
|
disabled: s,
|
|
7110
7172
|
allowRepeats: t,
|
|
7111
7173
|
value: e,
|
|
7112
7174
|
onChange: a
|
|
7113
7175
|
}) => {
|
|
7114
|
-
const [l, r] =
|
|
7115
|
-
for (const
|
|
7116
|
-
if (
|
|
7176
|
+
const [l, r] = D(""), i = (f) => {
|
|
7177
|
+
for (const b of f || [])
|
|
7178
|
+
if (b === f)
|
|
7117
7179
|
return !0;
|
|
7118
7180
|
return !1;
|
|
7119
7181
|
}, n = (f) => {
|
|
7120
|
-
e.length > f && a(e.filter((
|
|
7121
|
-
}, o = (f,
|
|
7182
|
+
e.length > f && a(e.filter((b, m) => m !== f));
|
|
7183
|
+
}, o = (f, b, m) => {
|
|
7122
7184
|
const p = e.map(
|
|
7123
|
-
(u,
|
|
7185
|
+
(u, y) => y === b ? m === "blur" ? f.trim() : f : u
|
|
7124
7186
|
);
|
|
7125
7187
|
a(p);
|
|
7126
7188
|
}, d = () => {
|
|
@@ -7131,29 +7193,29 @@ const Ce = ({
|
|
|
7131
7193
|
}, h = (f) => {
|
|
7132
7194
|
f.key === "Enter" && d();
|
|
7133
7195
|
};
|
|
7134
|
-
return /* @__PURE__ */
|
|
7135
|
-
e.map((f,
|
|
7196
|
+
return /* @__PURE__ */ T(ho, { children: [
|
|
7197
|
+
e.map((f, b) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
|
|
7136
7198
|
/* @__PURE__ */ v(
|
|
7137
7199
|
"input",
|
|
7138
7200
|
{
|
|
7139
7201
|
className: "daga-input",
|
|
7140
7202
|
disabled: s,
|
|
7141
7203
|
value: f,
|
|
7142
|
-
onChange: (m) => o(m.target.value,
|
|
7143
|
-
onBlur: (m) => o(m.target.value,
|
|
7204
|
+
onChange: (m) => o(m.target.value, b, "change"),
|
|
7205
|
+
onBlur: (m) => o(m.target.value, b, "blur")
|
|
7144
7206
|
}
|
|
7145
7207
|
),
|
|
7146
7208
|
/* @__PURE__ */ v(
|
|
7147
7209
|
"button",
|
|
7148
7210
|
{
|
|
7149
7211
|
className: "daga-property-button",
|
|
7150
|
-
onClick: () => n(
|
|
7212
|
+
onClick: () => n(b),
|
|
7151
7213
|
children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
|
|
7152
7214
|
}
|
|
7153
7215
|
)
|
|
7154
|
-
] },
|
|
7155
|
-
!s && /* @__PURE__ */
|
|
7156
|
-
/* @__PURE__ */
|
|
7216
|
+
] }, b)),
|
|
7217
|
+
!s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
|
|
7218
|
+
/* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
|
|
7157
7219
|
/* @__PURE__ */ v(
|
|
7158
7220
|
"input",
|
|
7159
7221
|
{
|
|
@@ -7168,62 +7230,62 @@ const Ce = ({
|
|
|
7168
7230
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7169
7231
|
] })
|
|
7170
7232
|
] });
|
|
7171
|
-
},
|
|
7233
|
+
}, Ni = ({
|
|
7172
7234
|
disabled: s,
|
|
7173
7235
|
value: t,
|
|
7174
7236
|
onChange: e
|
|
7175
7237
|
}) => {
|
|
7176
|
-
const [a, l] =
|
|
7177
|
-
const
|
|
7178
|
-
Object.keys(t).forEach((
|
|
7179
|
-
|
|
7180
|
-
}), e(
|
|
7181
|
-
}, c = (u,
|
|
7182
|
-
const N =
|
|
7183
|
-
if (
|
|
7238
|
+
const [a, l] = D(""), [r, i] = D(""), [n, o] = D({}), d = (u) => {
|
|
7239
|
+
const y = {};
|
|
7240
|
+
Object.keys(t).forEach((k) => {
|
|
7241
|
+
k !== u && (y[k] = t[k]);
|
|
7242
|
+
}), e(y);
|
|
7243
|
+
}, c = (u, y, k) => {
|
|
7244
|
+
const N = k === "blur" ? y.trim() : y;
|
|
7245
|
+
if (k === "blur") {
|
|
7184
7246
|
if (u !== N) {
|
|
7185
|
-
const
|
|
7247
|
+
const R = {};
|
|
7186
7248
|
Object.keys(t).forEach((P) => {
|
|
7187
|
-
P === u ?
|
|
7188
|
-
}), e(
|
|
7249
|
+
P === u ? R[N] = t[P] : R[P] = t[P];
|
|
7250
|
+
}), e(R), o((P) => {
|
|
7189
7251
|
const tt = { ...P };
|
|
7190
7252
|
return delete tt[u], tt;
|
|
7191
7253
|
});
|
|
7192
7254
|
}
|
|
7193
7255
|
} else
|
|
7194
|
-
o((
|
|
7195
|
-
...
|
|
7196
|
-
[u]:
|
|
7256
|
+
o((R) => ({
|
|
7257
|
+
...R,
|
|
7258
|
+
[u]: y
|
|
7197
7259
|
}));
|
|
7198
|
-
}, h = (u,
|
|
7199
|
-
const N =
|
|
7260
|
+
}, h = (u, y, k) => {
|
|
7261
|
+
const N = k === "blur" ? y.trim() : y;
|
|
7200
7262
|
if (N !== "") {
|
|
7201
|
-
const
|
|
7263
|
+
const R = {};
|
|
7202
7264
|
Object.keys(t).forEach((P) => {
|
|
7203
|
-
P === u ?
|
|
7204
|
-
}), e(
|
|
7265
|
+
P === u ? R[P] = N : R[P] = t[P];
|
|
7266
|
+
}), e(R);
|
|
7205
7267
|
}
|
|
7206
7268
|
}, f = () => {
|
|
7207
|
-
const u = a.trim(),
|
|
7208
|
-
if (u !== "" &&
|
|
7209
|
-
const
|
|
7269
|
+
const u = a.trim(), y = r.trim();
|
|
7270
|
+
if (u !== "" && y !== "") {
|
|
7271
|
+
const k = {};
|
|
7210
7272
|
Object.keys(t).forEach((N) => {
|
|
7211
|
-
|
|
7212
|
-
}),
|
|
7273
|
+
k[N] = t[N];
|
|
7274
|
+
}), k[u] = y, e(k), l(""), i("");
|
|
7213
7275
|
}
|
|
7214
|
-
},
|
|
7276
|
+
}, b = () => {
|
|
7215
7277
|
l("");
|
|
7216
7278
|
}, m = () => {
|
|
7217
7279
|
i("");
|
|
7218
7280
|
}, p = (u) => {
|
|
7219
7281
|
u.key === "Enter" && f();
|
|
7220
7282
|
};
|
|
7221
|
-
return /* @__PURE__ */
|
|
7222
|
-
Object.entries(t).map(([u,
|
|
7283
|
+
return /* @__PURE__ */ T("div", { children: [
|
|
7284
|
+
Object.entries(t).map(([u, y], k) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
|
|
7223
7285
|
/* @__PURE__ */ v(
|
|
7224
7286
|
"input",
|
|
7225
7287
|
{
|
|
7226
|
-
id: `key-${
|
|
7288
|
+
id: `key-${k}`,
|
|
7227
7289
|
className: "daga-input",
|
|
7228
7290
|
type: "text",
|
|
7229
7291
|
disabled: s,
|
|
@@ -7235,11 +7297,11 @@ const Ce = ({
|
|
|
7235
7297
|
/* @__PURE__ */ v(
|
|
7236
7298
|
"input",
|
|
7237
7299
|
{
|
|
7238
|
-
id: `value-${
|
|
7300
|
+
id: `value-${k}`,
|
|
7239
7301
|
className: "daga-input",
|
|
7240
7302
|
type: "text",
|
|
7241
7303
|
disabled: s,
|
|
7242
|
-
value:
|
|
7304
|
+
value: y,
|
|
7243
7305
|
onChange: (N) => h(u, N.target.value, "change"),
|
|
7244
7306
|
onBlur: (N) => h(u, N.target.value, "blur")
|
|
7245
7307
|
}
|
|
@@ -7253,8 +7315,8 @@ const Ce = ({
|
|
|
7253
7315
|
}
|
|
7254
7316
|
)
|
|
7255
7317
|
] }, u)),
|
|
7256
|
-
!s && /* @__PURE__ */
|
|
7257
|
-
/* @__PURE__ */
|
|
7318
|
+
!s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
|
|
7319
|
+
/* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
|
|
7258
7320
|
/* @__PURE__ */ v(
|
|
7259
7321
|
"input",
|
|
7260
7322
|
{
|
|
@@ -7265,9 +7327,9 @@ const Ce = ({
|
|
|
7265
7327
|
onBlur: (u) => c(a, u.target.value, "blur")
|
|
7266
7328
|
}
|
|
7267
7329
|
),
|
|
7268
|
-
/* @__PURE__ */ v("button", { className: "daga-clear", onClick:
|
|
7330
|
+
/* @__PURE__ */ v("button", { className: "daga-clear", onClick: b })
|
|
7269
7331
|
] }),
|
|
7270
|
-
/* @__PURE__ */
|
|
7332
|
+
/* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
|
|
7271
7333
|
/* @__PURE__ */ v(
|
|
7272
7334
|
"input",
|
|
7273
7335
|
{
|
|
@@ -7283,12 +7345,12 @@ const Ce = ({
|
|
|
7283
7345
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7284
7346
|
] })
|
|
7285
7347
|
] });
|
|
7286
|
-
},
|
|
7348
|
+
}, lo = ({
|
|
7287
7349
|
valueSet: s,
|
|
7288
7350
|
onValueChange: t,
|
|
7289
7351
|
depth: e
|
|
7290
7352
|
}) => {
|
|
7291
|
-
const l =
|
|
7353
|
+
const l = Dt($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
|
|
7292
7354
|
if (typeof o == "string")
|
|
7293
7355
|
return o;
|
|
7294
7356
|
if (o == null || isNaN(o.valueOf()))
|
|
@@ -7296,13 +7358,13 @@ const Ce = ({
|
|
|
7296
7358
|
const d = new Date(o), c = d.getTimezoneOffset();
|
|
7297
7359
|
return d.setMinutes(d.getMinutes() - c), d.toISOString().substring(0, 19);
|
|
7298
7360
|
}, n = (o) => new Date(o);
|
|
7299
|
-
return /* @__PURE__ */ v("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */
|
|
7361
|
+
return /* @__PURE__ */ v("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ T(
|
|
7300
7362
|
"div",
|
|
7301
7363
|
{
|
|
7302
7364
|
className: `daga-property ${r(o.name)}`,
|
|
7303
7365
|
children: [
|
|
7304
7366
|
/* @__PURE__ */ v("p", { className: "daga-property-name", children: o.label || o.name }),
|
|
7305
|
-
o.type ===
|
|
7367
|
+
o.type === M.Text && /* @__PURE__ */ v(
|
|
7306
7368
|
"input",
|
|
7307
7369
|
{
|
|
7308
7370
|
type: "daga-text",
|
|
@@ -7311,7 +7373,7 @@ const Ce = ({
|
|
|
7311
7373
|
onChange: (d) => t(s, o, d.target.value)
|
|
7312
7374
|
}
|
|
7313
7375
|
),
|
|
7314
|
-
o.type ===
|
|
7376
|
+
o.type === M.TextArea && /* @__PURE__ */ v(
|
|
7315
7377
|
"textarea",
|
|
7316
7378
|
{
|
|
7317
7379
|
disabled: o.editable === !1 || !l,
|
|
@@ -7319,7 +7381,7 @@ const Ce = ({
|
|
|
7319
7381
|
onChange: (d) => t(s, o, d.target.value)
|
|
7320
7382
|
}
|
|
7321
7383
|
),
|
|
7322
|
-
o.type ===
|
|
7384
|
+
o.type === M.Number && /* @__PURE__ */ v(
|
|
7323
7385
|
"input",
|
|
7324
7386
|
{
|
|
7325
7387
|
type: "number",
|
|
@@ -7328,7 +7390,7 @@ const Ce = ({
|
|
|
7328
7390
|
onChange: (d) => t(s, o, d.target.value)
|
|
7329
7391
|
}
|
|
7330
7392
|
),
|
|
7331
|
-
o.type ===
|
|
7393
|
+
o.type === M.Color && /* @__PURE__ */ v(
|
|
7332
7394
|
"input",
|
|
7333
7395
|
{
|
|
7334
7396
|
type: "text",
|
|
@@ -7338,7 +7400,7 @@ const Ce = ({
|
|
|
7338
7400
|
onChange: (d) => t(s, o, d.target.value)
|
|
7339
7401
|
}
|
|
7340
7402
|
),
|
|
7341
|
-
o.type ===
|
|
7403
|
+
o.type === M.Datetime && /* @__PURE__ */ v(
|
|
7342
7404
|
"input",
|
|
7343
7405
|
{
|
|
7344
7406
|
type: "datetime-local",
|
|
@@ -7353,7 +7415,7 @@ const Ce = ({
|
|
|
7353
7415
|
)
|
|
7354
7416
|
}
|
|
7355
7417
|
),
|
|
7356
|
-
o.type ===
|
|
7418
|
+
o.type === M.Date && /* @__PURE__ */ v(
|
|
7357
7419
|
"input",
|
|
7358
7420
|
{
|
|
7359
7421
|
type: "date",
|
|
@@ -7362,7 +7424,7 @@ const Ce = ({
|
|
|
7362
7424
|
onChange: (d) => t(s, o, d.target.value)
|
|
7363
7425
|
}
|
|
7364
7426
|
),
|
|
7365
|
-
o.type ===
|
|
7427
|
+
o.type === M.Time && /* @__PURE__ */ v(
|
|
7366
7428
|
"input",
|
|
7367
7429
|
{
|
|
7368
7430
|
type: "time",
|
|
@@ -7371,7 +7433,7 @@ const Ce = ({
|
|
|
7371
7433
|
onChange: (d) => t(s, o, d.target.value)
|
|
7372
7434
|
}
|
|
7373
7435
|
),
|
|
7374
|
-
o.type ===
|
|
7436
|
+
o.type === M.Url && /* @__PURE__ */ v(
|
|
7375
7437
|
"input",
|
|
7376
7438
|
{
|
|
7377
7439
|
type: "url",
|
|
@@ -7380,8 +7442,8 @@ const Ce = ({
|
|
|
7380
7442
|
onChange: (d) => t(s, o, d.target.value)
|
|
7381
7443
|
}
|
|
7382
7444
|
),
|
|
7383
|
-
o.type ===
|
|
7384
|
-
/* @__PURE__ */
|
|
7445
|
+
o.type === M.Boolean && /* @__PURE__ */ T("div", { className: "daga-radio", children: [
|
|
7446
|
+
/* @__PURE__ */ T(
|
|
7385
7447
|
"label",
|
|
7386
7448
|
{
|
|
7387
7449
|
className: "daga-radio-item daga-radio-start" + (s?.getValue(o.name) === !1 ? " daga-checked" : ""),
|
|
@@ -7401,7 +7463,7 @@ const Ce = ({
|
|
|
7401
7463
|
]
|
|
7402
7464
|
}
|
|
7403
7465
|
),
|
|
7404
|
-
/* @__PURE__ */
|
|
7466
|
+
/* @__PURE__ */ T(
|
|
7405
7467
|
"label",
|
|
7406
7468
|
{
|
|
7407
7469
|
className: "daga-radio-item daga-radio-end" + (s?.getValue(o.name) === !0 ? " daga-checked" : ""),
|
|
@@ -7422,8 +7484,8 @@ const Ce = ({
|
|
|
7422
7484
|
}
|
|
7423
7485
|
)
|
|
7424
7486
|
] }),
|
|
7425
|
-
o.type ===
|
|
7426
|
-
|
|
7487
|
+
o.type === M.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
7488
|
+
ao,
|
|
7427
7489
|
{
|
|
7428
7490
|
disabled: o.editable === !1 || !l,
|
|
7429
7491
|
options: o.options || [],
|
|
@@ -7431,35 +7493,35 @@ const Ce = ({
|
|
|
7431
7493
|
onChange: (d) => t(s, o, d)
|
|
7432
7494
|
}
|
|
7433
7495
|
) }),
|
|
7434
|
-
(o.type ===
|
|
7435
|
-
|
|
7496
|
+
(o.type === M.OptionList || o.type === M.OptionSet) && /* @__PURE__ */ v(
|
|
7497
|
+
Ti,
|
|
7436
7498
|
{
|
|
7437
7499
|
disabled: o.editable === !1 || !l,
|
|
7438
|
-
allowRepeats: o.type ===
|
|
7500
|
+
allowRepeats: o.type === M.OptionList,
|
|
7439
7501
|
options: o.options || [],
|
|
7440
7502
|
value: s?.getValue(o.name),
|
|
7441
7503
|
onChange: (d) => t(s, o, d)
|
|
7442
7504
|
}
|
|
7443
7505
|
),
|
|
7444
|
-
(o.type ===
|
|
7445
|
-
|
|
7506
|
+
(o.type === M.TextList || o.type === M.TextSet) && /* @__PURE__ */ v(
|
|
7507
|
+
Mi,
|
|
7446
7508
|
{
|
|
7447
7509
|
disabled: o.editable === !1 || !l,
|
|
7448
|
-
allowRepeats: o.type ===
|
|
7510
|
+
allowRepeats: o.type === M.TextList,
|
|
7449
7511
|
value: s?.getValue(o.name),
|
|
7450
7512
|
onChange: (d) => t(s, o, d)
|
|
7451
7513
|
}
|
|
7452
7514
|
),
|
|
7453
|
-
o.type ===
|
|
7454
|
-
|
|
7515
|
+
o.type === M.TextMap && /* @__PURE__ */ v(
|
|
7516
|
+
Ni,
|
|
7455
7517
|
{
|
|
7456
7518
|
disabled: o.editable === !1 || !l,
|
|
7457
7519
|
value: s?.getValue(o.name),
|
|
7458
7520
|
onChange: (d) => t(s, o, d)
|
|
7459
7521
|
}
|
|
7460
7522
|
),
|
|
7461
|
-
o.type ===
|
|
7462
|
-
|
|
7523
|
+
o.type === M.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
|
|
7524
|
+
lo,
|
|
7463
7525
|
{
|
|
7464
7526
|
valueSet: s.getSubValueSet(o.name),
|
|
7465
7527
|
onValueChange: t,
|
|
@@ -7470,34 +7532,34 @@ const Ce = ({
|
|
|
7470
7532
|
},
|
|
7471
7533
|
o.name
|
|
7472
7534
|
)) });
|
|
7473
|
-
},
|
|
7474
|
-
const e =
|
|
7535
|
+
}, co = ({ valueSet: s, depth: t }) => {
|
|
7536
|
+
const e = Dt($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
|
|
7475
7537
|
for (const o of s?.displayedProperties || []) {
|
|
7476
7538
|
let d = 0, c = 0, h = 0;
|
|
7477
7539
|
const f = x.select(a.current).select(
|
|
7478
7540
|
`.daga-property.${l(o.name)}.daga-depth-${t}`
|
|
7479
7541
|
);
|
|
7480
7542
|
f.select("button.daga-move-button").call(
|
|
7481
|
-
x.drag().on(
|
|
7543
|
+
x.drag().on(A.Start, (b) => {
|
|
7482
7544
|
S(L.Grabbing);
|
|
7483
|
-
const m = e.getPointerLocationRelativeToScreen(
|
|
7545
|
+
const m = e.getPointerLocationRelativeToScreen(b);
|
|
7484
7546
|
if (m.length < 2 || isNaN(m[0]) || isNaN(m[1]))
|
|
7485
7547
|
return;
|
|
7486
7548
|
const p = f.node()?.getBoundingClientRect();
|
|
7487
7549
|
d = p?.width || 0, c = p?.height || 0, f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1);
|
|
7488
|
-
}).on(
|
|
7550
|
+
}).on(A.Drag, (b) => {
|
|
7489
7551
|
S(L.Grabbing);
|
|
7490
|
-
const m = e.getPointerLocationRelativeToScreen(
|
|
7552
|
+
const m = e.getPointerLocationRelativeToScreen(b);
|
|
7491
7553
|
m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1), x.select(a.current).select(
|
|
7492
7554
|
`.daga-dropbar.daga-index-${h}.daga-depth-${t}`
|
|
7493
7555
|
).style("visibility", "hidden").style("height", 0), h = i(m), x.select(a.current).select(
|
|
7494
7556
|
`.daga-dropbar.daga-index-${h}.daga-depth-${t}`
|
|
7495
7557
|
).style("visibility", "visible").style("height", "0.25rem"));
|
|
7496
|
-
}).on(
|
|
7558
|
+
}).on(A.End, (b) => {
|
|
7497
7559
|
S(L.Auto), f.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), x.select(a.current).select(
|
|
7498
7560
|
`.daga-dropbar.daga-index-${h}.daga-depth-${t}`
|
|
7499
7561
|
).style("visibility", "hidden").style("height", 0);
|
|
7500
|
-
const m = e.getPointerLocationRelativeToScreen(
|
|
7562
|
+
const m = e.getPointerLocationRelativeToScreen(b);
|
|
7501
7563
|
m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (h = i(m), s?.displayedProperties?.splice(
|
|
7502
7564
|
s.displayedProperties.indexOf(o),
|
|
7503
7565
|
1
|
|
@@ -7522,7 +7584,7 @@ const Ce = ({
|
|
|
7522
7584
|
}
|
|
7523
7585
|
if (c.length > 0) {
|
|
7524
7586
|
const h = c.map(
|
|
7525
|
-
(
|
|
7587
|
+
(b) => ((o[0] - b[0]) ** 2 + (o[1] - b[1]) ** 2) ** 0.5
|
|
7526
7588
|
);
|
|
7527
7589
|
return h.indexOf(
|
|
7528
7590
|
Math.min(...h)
|
|
@@ -7533,25 +7595,25 @@ const Ce = ({
|
|
|
7533
7595
|
if (s === void 0)
|
|
7534
7596
|
return;
|
|
7535
7597
|
let d;
|
|
7536
|
-
o instanceof
|
|
7598
|
+
o instanceof Po ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
|
|
7537
7599
|
o.target?.value || ""
|
|
7538
7600
|
) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
|
|
7539
7601
|
};
|
|
7540
|
-
return /* @__PURE__ */
|
|
7602
|
+
return /* @__PURE__ */ T("daga-property-settings", { ref: a, children: [
|
|
7541
7603
|
/* @__PURE__ */ v("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
|
|
7542
|
-
s?.displayedProperties.map((o, d) => /* @__PURE__ */
|
|
7604
|
+
s?.displayedProperties.map((o, d) => /* @__PURE__ */ T(
|
|
7543
7605
|
"div",
|
|
7544
7606
|
{
|
|
7545
7607
|
className: `daga-property-and-dropbar ${l(o.name)} daga-depth-${t}`,
|
|
7546
7608
|
children: [
|
|
7547
|
-
/* @__PURE__ */
|
|
7609
|
+
/* @__PURE__ */ T(
|
|
7548
7610
|
"div",
|
|
7549
7611
|
{
|
|
7550
7612
|
className: `daga-property ${l(o.name)} daga-depth-${t}`,
|
|
7551
7613
|
children: [
|
|
7552
|
-
/* @__PURE__ */
|
|
7614
|
+
/* @__PURE__ */ T("div", { className: "daga-property-name", children: [
|
|
7553
7615
|
/* @__PURE__ */ v("span", { children: o.label || o.name }),
|
|
7554
|
-
/* @__PURE__ */
|
|
7616
|
+
/* @__PURE__ */ T("div", { className: "daga-buttons", children: [
|
|
7555
7617
|
/* @__PURE__ */ v("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ v("div", { className: "daga-icon daga-move-icon" }) }),
|
|
7556
7618
|
/* @__PURE__ */ v(
|
|
7557
7619
|
"button",
|
|
@@ -7563,9 +7625,9 @@ const Ce = ({
|
|
|
7563
7625
|
)
|
|
7564
7626
|
] })
|
|
7565
7627
|
] }),
|
|
7566
|
-
o.type !==
|
|
7567
|
-
o.type ===
|
|
7568
|
-
|
|
7628
|
+
o.type !== M.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
|
|
7629
|
+
o.type === M.Object && /* @__PURE__ */ v(
|
|
7630
|
+
co,
|
|
7569
7631
|
{
|
|
7570
7632
|
valueSet: s?.getSubValueSet(o.name),
|
|
7571
7633
|
depth: t + 1
|
|
@@ -7585,8 +7647,8 @@ const Ce = ({
|
|
|
7585
7647
|
o.name
|
|
7586
7648
|
))
|
|
7587
7649
|
] });
|
|
7588
|
-
},
|
|
7589
|
-
const n = rt(null), [o, d] =
|
|
7650
|
+
}, Pi = (s) => Array.isArray(s) ? s.join(", ") : zo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, zi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
|
|
7651
|
+
const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => x.select(n.current);
|
|
7590
7652
|
return Ct(() => {
|
|
7591
7653
|
if (n.current)
|
|
7592
7654
|
switch (t) {
|
|
@@ -7599,14 +7661,14 @@ const Ce = ({
|
|
|
7599
7661
|
f().style("height", e), a && f().select(".daga-panel-content").style("width", a);
|
|
7600
7662
|
break;
|
|
7601
7663
|
}
|
|
7602
|
-
}, [e, t]), /* @__PURE__ */ v("daga-property-editor", { children: /* @__PURE__ */
|
|
7664
|
+
}, [e, t]), /* @__PURE__ */ v("daga-property-editor", { children: /* @__PURE__ */ T(
|
|
7603
7665
|
"div",
|
|
7604
7666
|
{
|
|
7605
7667
|
ref: n,
|
|
7606
7668
|
className: `daga-panel daga-bottom daga-${s} daga-${t}`,
|
|
7607
7669
|
children: [
|
|
7608
7670
|
/* @__PURE__ */ v(
|
|
7609
|
-
|
|
7671
|
+
Ie,
|
|
7610
7672
|
{
|
|
7611
7673
|
disabled: !r || !r.propertySet || !r.propertySet.hasProperties(),
|
|
7612
7674
|
collapsed: o,
|
|
@@ -7619,8 +7681,8 @@ const Ce = ({
|
|
|
7619
7681
|
onCollapse: d
|
|
7620
7682
|
}
|
|
7621
7683
|
),
|
|
7622
|
-
/* @__PURE__ */ v("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */
|
|
7623
|
-
l && /* @__PURE__ */
|
|
7684
|
+
/* @__PURE__ */ v("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ T("div", { children: [
|
|
7685
|
+
l && /* @__PURE__ */ T("p", { className: "daga-title", children: [
|
|
7624
7686
|
l,
|
|
7625
7687
|
/* @__PURE__ */ v(
|
|
7626
7688
|
"button",
|
|
@@ -7637,22 +7699,22 @@ const Ce = ({
|
|
|
7637
7699
|
)
|
|
7638
7700
|
] }),
|
|
7639
7701
|
!c && /* @__PURE__ */ v(
|
|
7640
|
-
|
|
7702
|
+
lo,
|
|
7641
7703
|
{
|
|
7642
7704
|
valueSet: r,
|
|
7643
7705
|
onValueChange: i,
|
|
7644
7706
|
depth: 0
|
|
7645
7707
|
}
|
|
7646
7708
|
),
|
|
7647
|
-
c && /* @__PURE__ */ v(
|
|
7709
|
+
c && /* @__PURE__ */ v(co, { valueSet: r, depth: 0 })
|
|
7648
7710
|
] }) })
|
|
7649
7711
|
]
|
|
7650
7712
|
}
|
|
7651
7713
|
) });
|
|
7652
|
-
},
|
|
7653
|
-
const t =
|
|
7714
|
+
}, Ri = 6, Vi = (s) => {
|
|
7715
|
+
const t = Dt($t), [e, a] = D(
|
|
7654
7716
|
s.currentPalette || s.palettes[0]
|
|
7655
|
-
), [l, r] =
|
|
7717
|
+
), [l, r] = D(0), [i, n] = D(
|
|
7656
7718
|
void 0
|
|
7657
7719
|
), o = rt(null), d = (p) => {
|
|
7658
7720
|
if (a(p), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
|
|
@@ -7661,62 +7723,62 @@ const Ce = ({
|
|
|
7661
7723
|
}, c = () => x.select(o.current).select(".daga-palette-view"), h = (p) => {
|
|
7662
7724
|
const u = c().append("select").style("width", "100%").style("height", "2rem").style("padding", "0.5rem").style("border-radius", "0.25rem").style("background-color", "#f7f8fc").style("border", "1px solid #e6e6e6");
|
|
7663
7725
|
u.append("option").attr("value", "").text("(None selected)");
|
|
7664
|
-
for (const
|
|
7665
|
-
u.append("option").attr("value",
|
|
7726
|
+
for (const y in p)
|
|
7727
|
+
u.append("option").attr("value", y).text(y);
|
|
7666
7728
|
u.on($.Change, () => {
|
|
7667
7729
|
i && c().selectAll(".daga-template-container.daga-in-category").remove();
|
|
7668
|
-
const
|
|
7669
|
-
n(
|
|
7670
|
-
const
|
|
7671
|
-
for (const N of
|
|
7730
|
+
const y = u.property("value");
|
|
7731
|
+
n(y);
|
|
7732
|
+
const k = p[y] || [];
|
|
7733
|
+
for (const N of k)
|
|
7672
7734
|
f(N, "daga-in-category");
|
|
7673
7735
|
}), i && (u.property("value", i), u.dispatch($.Change));
|
|
7674
7736
|
}, f = (p, u) => {
|
|
7675
7737
|
if (p.templateType === "node") {
|
|
7676
|
-
const
|
|
7677
|
-
|
|
7738
|
+
const y = t.model.nodes.types.get(p.type);
|
|
7739
|
+
y ? b(y, p, u) : console.error(`Could not find a node type called '${p.type}'`);
|
|
7678
7740
|
} else if (p.templateType === "connection") {
|
|
7679
|
-
const
|
|
7680
|
-
|
|
7741
|
+
const y = t.model.connections.types.get(p.type);
|
|
7742
|
+
y ? m(y, p, u) : console.error(
|
|
7681
7743
|
`Could not find a connection type called '${p.type}'`
|
|
7682
7744
|
);
|
|
7683
7745
|
}
|
|
7684
|
-
},
|
|
7746
|
+
}, b = (p, u, y) => {
|
|
7685
7747
|
if (l !== void 0 && p.priority < l)
|
|
7686
7748
|
return;
|
|
7687
|
-
const
|
|
7749
|
+
const k = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, N = p.defaultHeight + k, R = p.defaultWidth + k, P = u.height || N, tt = u.width || R, E = c().append("div").attr(
|
|
7688
7750
|
"class",
|
|
7689
|
-
`daga-template-container ${
|
|
7751
|
+
`daga-template-container ${y !== void 0 ? y : ""}`
|
|
7690
7752
|
).style("width", `${tt}px`).style("height", `${P}px`).call(
|
|
7691
|
-
x.drag().on(
|
|
7753
|
+
x.drag().on(A.Drag, (O) => {
|
|
7692
7754
|
if (t.canUserPerformAction(w.AddNode)) {
|
|
7693
|
-
const
|
|
7694
|
-
if (
|
|
7755
|
+
const I = t.getPointerLocationRelativeToScreen(O);
|
|
7756
|
+
if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
|
|
7695
7757
|
return;
|
|
7696
|
-
E.style("position", "fixed").style("left", `${
|
|
7758
|
+
E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1);
|
|
7697
7759
|
}
|
|
7698
|
-
}).on(
|
|
7760
|
+
}).on(A.Start, (O) => {
|
|
7699
7761
|
if (t.canUserPerformAction(w.AddNode)) {
|
|
7700
7762
|
S(L.Grabbing);
|
|
7701
|
-
const
|
|
7702
|
-
if (
|
|
7763
|
+
const I = t.getPointerLocationRelativeToScreen(O);
|
|
7764
|
+
if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
|
|
7703
7765
|
return;
|
|
7704
|
-
E.style("position", "fixed").style("left", `${
|
|
7766
|
+
E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
|
|
7705
7767
|
(_) => !_.removed && _.type.id === p.id
|
|
7706
7768
|
) !== void 0 && S(L.NotAllowed);
|
|
7707
7769
|
}
|
|
7708
|
-
}).on(
|
|
7770
|
+
}).on(A.End, (O) => {
|
|
7709
7771
|
if (t.canUserPerformAction(w.AddNode)) {
|
|
7710
7772
|
if (S(L.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
|
|
7711
|
-
(
|
|
7773
|
+
(jt) => !jt.removed && jt.type.id === p.id
|
|
7712
7774
|
) !== void 0)
|
|
7713
7775
|
return;
|
|
7714
|
-
const
|
|
7715
|
-
if (
|
|
7776
|
+
const I = t.getPointerLocationRelativeToScreen(O);
|
|
7777
|
+
if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
|
|
7716
7778
|
return;
|
|
7717
7779
|
const _ = document.elementFromPoint(
|
|
7718
|
-
|
|
7719
|
-
|
|
7780
|
+
I[0],
|
|
7781
|
+
I[1]
|
|
7720
7782
|
);
|
|
7721
7783
|
if (_ && !t.selectCanvasView().node()?.contains(_))
|
|
7722
7784
|
return;
|
|
@@ -7735,33 +7797,33 @@ const Ce = ({
|
|
|
7735
7797
|
lt[0],
|
|
7736
7798
|
lt[1]
|
|
7737
7799
|
).filter(
|
|
7738
|
-
(
|
|
7739
|
-
), wt =
|
|
7800
|
+
(jt) => jt.type.childrenTypes.includes(p.id)
|
|
7801
|
+
), wt = Ze(
|
|
7740
7802
|
J
|
|
7741
7803
|
), nt = wt[wt.length - 1];
|
|
7742
7804
|
if (!p.canBeParentless && nt === void 0)
|
|
7743
7805
|
return;
|
|
7744
|
-
const
|
|
7806
|
+
const Xt = nt?.getLastAncestor(), xe = new qo(
|
|
7745
7807
|
t,
|
|
7746
7808
|
p,
|
|
7747
7809
|
q,
|
|
7748
7810
|
nt?.id,
|
|
7749
|
-
|
|
7750
|
-
|
|
7811
|
+
Xt?.id,
|
|
7812
|
+
Xt?.getGeometry(),
|
|
7751
7813
|
void 0,
|
|
7752
7814
|
u.label,
|
|
7753
7815
|
u.values
|
|
7754
7816
|
);
|
|
7755
|
-
|
|
7817
|
+
xe.do(), t?.actionStack.add(xe), S();
|
|
7756
7818
|
}
|
|
7757
7819
|
})
|
|
7758
|
-
).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${
|
|
7820
|
+
).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${N}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${tt}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
|
|
7759
7821
|
switch (C.lookType) {
|
|
7760
7822
|
case "shaped-look":
|
|
7761
7823
|
E.append("path").attr(
|
|
7762
7824
|
"d",
|
|
7763
|
-
|
|
7764
|
-
C.shape ||
|
|
7825
|
+
ve(
|
|
7826
|
+
C.shape || Mt.Rectangle,
|
|
7765
7827
|
(C.borderThickness || 1) / 2,
|
|
7766
7828
|
(C.borderThickness || 1) / 2,
|
|
7767
7829
|
p.defaultWidth,
|
|
@@ -7802,35 +7864,35 @@ const Ce = ({
|
|
|
7802
7864
|
).html(O.html);
|
|
7803
7865
|
if (u.label) {
|
|
7804
7866
|
const O = {
|
|
7805
|
-
...
|
|
7867
|
+
...V,
|
|
7806
7868
|
...p.label,
|
|
7807
7869
|
...u.labelLook
|
|
7808
7870
|
};
|
|
7809
7871
|
E.append("text").attr(
|
|
7810
7872
|
"transform",
|
|
7811
|
-
`translate(${(
|
|
7873
|
+
`translate(${(Y(O) + p.defaultWidth) / 2},${(U(O) + p.defaultHeight) / 2})`
|
|
7812
7874
|
).attr("x", 0).attr("y", 0).attr("font-size", `${O.fontSize}px`).attr("text-anchor", "middle").attr("font-family", O.fontFamily).attr("font-weight", 400).attr("fill", O.color).attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
|
|
7813
7875
|
}
|
|
7814
7876
|
}
|
|
7815
|
-
}, m = (p, u,
|
|
7816
|
-
const
|
|
7877
|
+
}, m = (p, u, y) => {
|
|
7878
|
+
const k = c().append("div").attr(
|
|
7817
7879
|
"class",
|
|
7818
|
-
`daga-template-container ${
|
|
7880
|
+
`daga-template-container ${y !== void 0 ? y : ""}`
|
|
7819
7881
|
).style("width", `${u.width}px`).style("height", `${u.height}px`).append("svg").attr("class", `palette-button ${p.id}`).style("position", "relative").style("left", 0).style("top", 0).style("width", "100%").style("height", "100%").on("click", () => {
|
|
7820
7882
|
t.connectionType = p;
|
|
7821
7883
|
});
|
|
7822
|
-
|
|
7884
|
+
k.append("path").attr(
|
|
7823
7885
|
"d",
|
|
7824
|
-
|
|
7825
|
-
|
|
7886
|
+
ve(
|
|
7887
|
+
Mt.Rectangle,
|
|
7826
7888
|
0,
|
|
7827
7889
|
0,
|
|
7828
7890
|
u.width,
|
|
7829
7891
|
u.height
|
|
7830
7892
|
)
|
|
7831
|
-
).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" &&
|
|
7893
|
+
).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && k.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && k.append("text").attr(
|
|
7832
7894
|
"transform",
|
|
7833
|
-
`translate(${u.width / 2},${u.height / 2 +
|
|
7895
|
+
`translate(${u.width / 2},${u.height / 2 + Ri})`
|
|
7834
7896
|
).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);
|
|
7835
7897
|
};
|
|
7836
7898
|
return Ct(() => {
|
|
@@ -7845,14 +7907,14 @@ const Ce = ({
|
|
|
7845
7907
|
o.current.style.height = s.width, s.height && (o.current.style.width = s.height);
|
|
7846
7908
|
break;
|
|
7847
7909
|
}
|
|
7848
|
-
}, [e, s.palettes]), /* @__PURE__ */ v("daga-palette", { children: /* @__PURE__ */
|
|
7910
|
+
}, [e, s.palettes]), /* @__PURE__ */ v("daga-palette", { children: /* @__PURE__ */ T(
|
|
7849
7911
|
"div",
|
|
7850
7912
|
{
|
|
7851
7913
|
ref: o,
|
|
7852
7914
|
className: `daga-panel daga-${s.location} daga-${s.direction}`,
|
|
7853
7915
|
children: [
|
|
7854
7916
|
/* @__PURE__ */ v(
|
|
7855
|
-
|
|
7917
|
+
Ie,
|
|
7856
7918
|
{
|
|
7857
7919
|
direction: s.direction,
|
|
7858
7920
|
collapsableSelector: o,
|
|
@@ -7864,7 +7926,7 @@ const Ce = ({
|
|
|
7864
7926
|
disabled: !1
|
|
7865
7927
|
}
|
|
7866
7928
|
),
|
|
7867
|
-
/* @__PURE__ */
|
|
7929
|
+
/* @__PURE__ */ T("div", { className: "daga-panel-content", children: [
|
|
7868
7930
|
s.palettes.length > 1 && /* @__PURE__ */ v("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ v(
|
|
7869
7931
|
"div",
|
|
7870
7932
|
{
|
|
@@ -7878,7 +7940,7 @@ const Ce = ({
|
|
|
7878
7940
|
]
|
|
7879
7941
|
}
|
|
7880
7942
|
) });
|
|
7881
|
-
},
|
|
7943
|
+
}, Oi = ({
|
|
7882
7944
|
location: s,
|
|
7883
7945
|
direction: t,
|
|
7884
7946
|
enableAction: e,
|
|
@@ -7887,111 +7949,111 @@ const Ce = ({
|
|
|
7887
7949
|
enableSelection: r,
|
|
7888
7950
|
enableZoom: i
|
|
7889
7951
|
}) => {
|
|
7890
|
-
let n = !1, o = !0, d = !1, c, h, f,
|
|
7952
|
+
let n = !1, o = !0, d = !1, c, h, f, b;
|
|
7891
7953
|
switch (t) {
|
|
7892
7954
|
case g.Bottom:
|
|
7893
|
-
c = "height", h = "scaleY", f = "top",
|
|
7955
|
+
c = "height", h = "scaleY", f = "top", b = "bottom";
|
|
7894
7956
|
break;
|
|
7895
7957
|
case g.Top:
|
|
7896
|
-
c = "height", h = "scaleY", f = "bottom",
|
|
7958
|
+
c = "height", h = "scaleY", f = "bottom", b = "top";
|
|
7897
7959
|
break;
|
|
7898
7960
|
case g.Left:
|
|
7899
|
-
c = "width", h = "scaleX", f = "right",
|
|
7961
|
+
c = "width", h = "scaleX", f = "right", b = "left";
|
|
7900
7962
|
break;
|
|
7901
7963
|
case g.Right:
|
|
7902
|
-
c = "width", h = "scaleX", f = "left",
|
|
7964
|
+
c = "width", h = "scaleX", f = "left", b = "right";
|
|
7903
7965
|
break;
|
|
7904
7966
|
}
|
|
7905
7967
|
const m = rt(null), p = rt(null), u = rt(null);
|
|
7906
7968
|
Ct(() => {
|
|
7907
7969
|
x.select(
|
|
7908
7970
|
m.current
|
|
7909
|
-
).style(`margin-${
|
|
7971
|
+
).style(`margin-${b}`, "-1rem").style(c, "0rem").style("transform", `${h}(0)`).style("transform-origin", f);
|
|
7910
7972
|
});
|
|
7911
|
-
const
|
|
7973
|
+
const y = async () => {
|
|
7912
7974
|
const J = x.select(
|
|
7913
7975
|
m.current
|
|
7914
7976
|
);
|
|
7915
7977
|
if (!d)
|
|
7916
7978
|
if (o) {
|
|
7917
7979
|
o = !1;
|
|
7918
|
-
const
|
|
7919
|
-
J.transition().duration(500).ease(x.easeLinear).style(c,
|
|
7980
|
+
const Xt = `${4 * J.selectChildren().size()}rem`;
|
|
7981
|
+
J.transition().duration(500).ease(x.easeLinear).style(c, Xt).style("transform", `${h}(1)`), setTimeout(() => {
|
|
7920
7982
|
d = !1;
|
|
7921
7983
|
}, 500);
|
|
7922
7984
|
} else
|
|
7923
7985
|
o = !0, J.transition().duration(500).ease(x.easeLinear).style(c, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
|
|
7924
7986
|
d = !1;
|
|
7925
7987
|
}, 500);
|
|
7926
|
-
},
|
|
7927
|
-
|
|
7928
|
-
},
|
|
7929
|
-
|
|
7988
|
+
}, k = Dt($t), N = () => {
|
|
7989
|
+
k.zoomBy(k.zoomFactor);
|
|
7990
|
+
}, R = () => {
|
|
7991
|
+
k.zoomBy(1 / k.zoomFactor);
|
|
7930
7992
|
}, P = () => {
|
|
7931
|
-
|
|
7993
|
+
k.center();
|
|
7932
7994
|
}, tt = () => {
|
|
7933
|
-
|
|
7995
|
+
k.layoutFormat && k.layoutFormat in _e && _e[k.layoutFormat].apply(k.model);
|
|
7934
7996
|
}, E = () => {
|
|
7935
7997
|
n = !n, x.select(
|
|
7936
7998
|
u.current
|
|
7937
7999
|
).classed("daga-on", n).classed("daga-off", !n);
|
|
7938
|
-
const J =
|
|
7939
|
-
J && J.length >= 2 &&
|
|
8000
|
+
const J = k.getPriorityThresholdOptions();
|
|
8001
|
+
J && J.length >= 2 && k.setPriorityThreshold(
|
|
7940
8002
|
J[n ? 1 : 0]
|
|
7941
8003
|
);
|
|
7942
8004
|
}, C = () => {
|
|
7943
|
-
|
|
8005
|
+
k.actionStack.undo();
|
|
7944
8006
|
}, O = () => {
|
|
7945
|
-
|
|
7946
|
-
},
|
|
7947
|
-
|
|
8007
|
+
k.actionStack.redo();
|
|
8008
|
+
}, I = () => {
|
|
8009
|
+
k.userSelection.copyToClipboard();
|
|
7948
8010
|
}, _ = () => {
|
|
7949
|
-
|
|
8011
|
+
k.userSelection.cutToClipboard();
|
|
7950
8012
|
}, lt = () => {
|
|
7951
|
-
|
|
8013
|
+
k.userSelection.pasteFromClipboard();
|
|
7952
8014
|
}, q = () => {
|
|
7953
|
-
|
|
8015
|
+
k.userSelection.removeFromModel();
|
|
7954
8016
|
}, Bt = () => {
|
|
7955
|
-
|
|
8017
|
+
k.multipleSelectionOn = !0, x.select(
|
|
7956
8018
|
p.current
|
|
7957
8019
|
).classed("daga-on", !0).classed("daga-off", !1);
|
|
7958
|
-
const J =
|
|
7959
|
-
wt.type ===
|
|
8020
|
+
const J = k.diagramEvent$.subscribe((wt) => {
|
|
8021
|
+
wt.type === Qe.Selection && (x.select(
|
|
7960
8022
|
p.current
|
|
7961
8023
|
).classed("daga-on", !1).classed("daga-off", !0), J.unsubscribe());
|
|
7962
8024
|
});
|
|
7963
8025
|
};
|
|
7964
|
-
return /* @__PURE__ */ v("daga-diagram-buttons", { children: /* @__PURE__ */
|
|
8026
|
+
return /* @__PURE__ */ v("daga-diagram-buttons", { children: /* @__PURE__ */ T(
|
|
7965
8027
|
"div",
|
|
7966
8028
|
{
|
|
7967
8029
|
className: `daga-diagram-buttons daga-${s} daga-${t}`,
|
|
7968
8030
|
children: [
|
|
7969
|
-
i &&
|
|
7970
|
-
i &&
|
|
7971
|
-
/* @__PURE__ */
|
|
7972
|
-
i &&
|
|
8031
|
+
i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: N, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
|
|
8032
|
+
i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
|
|
8033
|
+
/* @__PURE__ */ T("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
|
|
8034
|
+
i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
|
|
7973
8035
|
e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
|
|
7974
8036
|
e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
|
|
7975
|
-
r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick:
|
|
8037
|
+
r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: I, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
|
|
7976
8038
|
r && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: _, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
|
|
7977
8039
|
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" }) }),
|
|
7978
8040
|
r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
|
|
7979
8041
|
r && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
|
|
7980
|
-
l &&
|
|
8042
|
+
l && k.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: tt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
|
|
7981
8043
|
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" }) })
|
|
7982
8044
|
] }),
|
|
7983
|
-
/* @__PURE__ */ v("button", { className: "daga-more-options", onClick:
|
|
8045
|
+
/* @__PURE__ */ v("button", { className: "daga-more-options", onClick: y, children: o ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
|
|
7984
8046
|
]
|
|
7985
8047
|
}
|
|
7986
8048
|
) });
|
|
7987
|
-
},
|
|
8049
|
+
}, Fi = ({
|
|
7988
8050
|
config: s,
|
|
7989
8051
|
model: t,
|
|
7990
8052
|
onCanvasCreated: e,
|
|
7991
8053
|
onDiagramEvent: a,
|
|
7992
8054
|
onModelChange: l
|
|
7993
8055
|
}) => {
|
|
7994
|
-
const r = new
|
|
8056
|
+
const r = new Je(), i = new oo(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = D(void 0), [b, m] = D(void 0), p = {
|
|
7995
8057
|
zoomIn: () => {
|
|
7996
8058
|
},
|
|
7997
8059
|
zoomOut: () => {
|
|
@@ -8009,49 +8071,49 @@ const Ce = ({
|
|
|
8009
8071
|
}, u = {
|
|
8010
8072
|
refreshPalette: () => {
|
|
8011
8073
|
}
|
|
8012
|
-
},
|
|
8074
|
+
}, y = new Ii(
|
|
8013
8075
|
(E) => f(E),
|
|
8014
8076
|
(E) => m(E)
|
|
8015
|
-
),
|
|
8077
|
+
), k = {
|
|
8016
8078
|
diagramButtons: p,
|
|
8017
8079
|
palette: u,
|
|
8018
|
-
propertyEditor:
|
|
8019
|
-
}, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new
|
|
8020
|
-
|
|
8021
|
-
|
|
8080
|
+
propertyEditor: y
|
|
8081
|
+
}, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new we(k, s)), o.current), R = N(), P = (E) => {
|
|
8082
|
+
R.initView(E), c.push(
|
|
8083
|
+
R.diagramEvent$.subscribe((C) => {
|
|
8022
8084
|
a?.(C);
|
|
8023
8085
|
})
|
|
8024
8086
|
), c.push(
|
|
8025
|
-
|
|
8026
|
-
const C = i.export(
|
|
8087
|
+
R.diagramChange$.subscribe(() => {
|
|
8088
|
+
const C = i.export(R.model);
|
|
8027
8089
|
l?.(C);
|
|
8028
8090
|
})
|
|
8029
8091
|
);
|
|
8030
8092
|
};
|
|
8031
8093
|
Ct(() => {
|
|
8032
|
-
n.current && (d.current || (P(n.current), d.current = !0, e?.(
|
|
8033
|
-
}, [n.current]),
|
|
8034
|
-
n.current && (N(!0), P(n.current), e?.(
|
|
8094
|
+
n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
|
|
8095
|
+
}, [n.current]), po(() => {
|
|
8096
|
+
n.current && (N(!0), P(n.current), e?.(R));
|
|
8035
8097
|
}, [s]), Ct(() => {
|
|
8036
|
-
t && r.import(
|
|
8098
|
+
t && r.import(R.model, t);
|
|
8037
8099
|
}, [t]);
|
|
8038
8100
|
const tt = (E, C, O) => {
|
|
8039
|
-
if (
|
|
8101
|
+
if (b !== void 0 && C.editable !== !1 && !St(E.getValue(C.name), O)) {
|
|
8040
8102
|
E.setValue(C.name, O);
|
|
8041
|
-
const
|
|
8042
|
-
|
|
8103
|
+
const I = new yt(
|
|
8104
|
+
b.propertySet,
|
|
8043
8105
|
void 0
|
|
8044
8106
|
);
|
|
8045
|
-
|
|
8107
|
+
I.setValues(b.getValues()), I.rootElement = b.rootElement, y.valueSet = I, b.rootElement.valueSet = I, R.propertyEditorChanges$?.next();
|
|
8046
8108
|
}
|
|
8047
8109
|
};
|
|
8048
|
-
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(
|
|
8110
|
+
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(Ai.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ T("daga-diagram-editor", { children: [
|
|
8049
8111
|
/* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
|
|
8050
|
-
/* @__PURE__ */
|
|
8112
|
+
/* @__PURE__ */ T($t.Provider, { value: R, children: [
|
|
8051
8113
|
s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8052
|
-
|
|
8114
|
+
Oi,
|
|
8053
8115
|
{
|
|
8054
|
-
location: s.components?.buttons?.location ||
|
|
8116
|
+
location: s.components?.buttons?.location || Kt.BottomRight,
|
|
8055
8117
|
direction: s.components?.buttons?.direction || g.Top,
|
|
8056
8118
|
enableAction: s.components?.buttons?.enableAction !== !1,
|
|
8057
8119
|
enableFilter: s.components?.buttons?.enableFilter === !0,
|
|
@@ -8061,9 +8123,9 @@ const Ce = ({
|
|
|
8061
8123
|
}
|
|
8062
8124
|
),
|
|
8063
8125
|
s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
|
|
8064
|
-
|
|
8126
|
+
Vi,
|
|
8065
8127
|
{
|
|
8066
|
-
location: s.components?.palette?.location ||
|
|
8128
|
+
location: s.components?.palette?.location || Kt.TopLeft,
|
|
8067
8129
|
direction: s.components?.palette?.direction || g.Bottom,
|
|
8068
8130
|
width: s.components?.palette?.width || "12rem",
|
|
8069
8131
|
height: s.components?.palette?.height,
|
|
@@ -8071,21 +8133,21 @@ const Ce = ({
|
|
|
8071
8133
|
}
|
|
8072
8134
|
),
|
|
8073
8135
|
s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8074
|
-
|
|
8136
|
+
zi,
|
|
8075
8137
|
{
|
|
8076
|
-
location: s.components?.propertyEditor?.location ||
|
|
8138
|
+
location: s.components?.propertyEditor?.location || Kt.TopRight,
|
|
8077
8139
|
direction: s.components?.propertyEditor?.direction || g.Bottom,
|
|
8078
8140
|
width: s.components?.propertyEditor?.width || "24rem",
|
|
8079
8141
|
height: s.components?.propertyEditor?.height,
|
|
8080
8142
|
title: h,
|
|
8081
|
-
valueSet:
|
|
8143
|
+
valueSet: b,
|
|
8082
8144
|
onValueChange: tt
|
|
8083
8145
|
}
|
|
8084
8146
|
),
|
|
8085
|
-
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8147
|
+
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(xi, {})
|
|
8086
8148
|
] })
|
|
8087
8149
|
] }) }) }) });
|
|
8088
8150
|
};
|
|
8089
8151
|
export {
|
|
8090
|
-
|
|
8152
|
+
Fi as DagaDiagram
|
|
8091
8153
|
};
|