@metadev/daga-react 4.2.8 → 4.2.10
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 +10 -0
- package/index.js +2 -2
- package/index.mjs +477 -384
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as v, jsxs as M, Fragment as
|
|
1
|
+
import { jsx as v, jsxs as M, Fragment as ro } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "d3";
|
|
3
|
-
import { debounceTime as
|
|
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 At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t,
|
|
3
|
+
import { debounceTime as ao, Subject as Xt, merge as lo, map as co } from "rxjs";
|
|
4
|
+
import { createContext as Oe, useState as U, useContext as Ut, useRef as rt, useEffect as Ct, useMemo as ho } from "react";
|
|
5
|
+
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Wt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Wt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), Kt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Kt || {});
|
|
6
|
+
const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Ie = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], qt = (s, t, e, a, l, n, i) => {
|
|
7
7
|
const r = (() => {
|
|
8
8
|
switch (n) {
|
|
9
9
|
case "start":
|
|
@@ -16,7 +16,7 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
16
16
|
}
|
|
17
17
|
case "floating":
|
|
18
18
|
default:
|
|
19
|
-
return
|
|
19
|
+
return Ie(s[0], t, a);
|
|
20
20
|
}
|
|
21
21
|
})(), o = (() => {
|
|
22
22
|
switch (i) {
|
|
@@ -30,11 +30,11 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
30
30
|
}
|
|
31
31
|
case "floating":
|
|
32
32
|
default:
|
|
33
|
-
return
|
|
33
|
+
return Ie(s[1], e, l);
|
|
34
34
|
}
|
|
35
35
|
})();
|
|
36
36
|
return [r, o];
|
|
37
|
-
},
|
|
37
|
+
}, He = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, go = (s, t) => (ut(
|
|
38
38
|
s[0][0],
|
|
39
39
|
t[0][0],
|
|
40
40
|
t[1][0]
|
|
@@ -67,10 +67,10 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
|
|
|
67
67
|
s[1][1],
|
|
68
68
|
s[0][1]
|
|
69
69
|
));
|
|
70
|
-
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 || {}), I = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(I || {}),
|
|
71
|
-
const
|
|
72
|
-
var
|
|
73
|
-
const
|
|
70
|
+
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 || {}), I = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(I || {}), fe = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(fe || {});
|
|
71
|
+
const ue = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
|
|
72
|
+
var _e = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(_e || {}), be = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(be || {});
|
|
73
|
+
const fo = 20, uo = (s, t, e, a, l) => {
|
|
74
74
|
if (typeof s == "function")
|
|
75
75
|
return s(
|
|
76
76
|
t,
|
|
@@ -83,7 +83,7 @@ const go = 20, fo = (s, t, e, a, l) => {
|
|
|
83
83
|
if (t.length === 1)
|
|
84
84
|
return `M ${t[0][0]} ${t[0][1]}`;
|
|
85
85
|
{
|
|
86
|
-
l = l ||
|
|
86
|
+
l = l || fo;
|
|
87
87
|
let n = "", i, r;
|
|
88
88
|
switch (s) {
|
|
89
89
|
case "straight":
|
|
@@ -272,7 +272,7 @@ const go = 20, fo = (s, t, e, a, l) => {
|
|
|
272
272
|
}
|
|
273
273
|
return n;
|
|
274
274
|
}
|
|
275
|
-
},
|
|
275
|
+
}, pe = (s, t) => {
|
|
276
276
|
switch (s) {
|
|
277
277
|
case "dotted":
|
|
278
278
|
return `${t}`;
|
|
@@ -289,63 +289,70 @@ const go = 20, fo = (s, t, e, a, l) => {
|
|
|
289
289
|
return e >= 0 && s.splice(e, 1), s;
|
|
290
290
|
};
|
|
291
291
|
var Tt = /* @__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))(Tt || {});
|
|
292
|
-
const
|
|
292
|
+
const me = (s, t, e, a, l) => {
|
|
293
293
|
if (typeof s == "function")
|
|
294
294
|
return s(t, e, a, l);
|
|
295
295
|
switch (s) {
|
|
296
296
|
case "ellipse":
|
|
297
|
-
return
|
|
297
|
+
return Ge(t, e, a, l);
|
|
298
298
|
case "empty":
|
|
299
|
-
return
|
|
299
|
+
return po();
|
|
300
300
|
case "folder":
|
|
301
|
-
return po(t, e, a, l);
|
|
302
|
-
case "hexagon":
|
|
303
301
|
return mo(t, e, a, l);
|
|
304
|
-
case "
|
|
302
|
+
case "hexagon":
|
|
305
303
|
return vo(t, e, a, l);
|
|
304
|
+
case "octagon":
|
|
305
|
+
return yo(t, e, a, l);
|
|
306
306
|
case "pill":
|
|
307
|
-
return
|
|
307
|
+
return Zt(t, e, a, l);
|
|
308
308
|
case "rectangle":
|
|
309
|
-
return
|
|
309
|
+
return Ae(t, e, a, l);
|
|
310
310
|
case "rhombus":
|
|
311
|
-
return yo(t, e, a, l);
|
|
312
|
-
case "rounded-rectangle":
|
|
313
311
|
return bo(t, e, a, l);
|
|
314
|
-
case "
|
|
312
|
+
case "rounded-rectangle":
|
|
315
313
|
return ko(t, e, a, l);
|
|
314
|
+
case "sticky-note":
|
|
315
|
+
return wo(t, e, a, l);
|
|
316
316
|
default:
|
|
317
|
-
return
|
|
317
|
+
return Ae(t, e, a, l);
|
|
318
318
|
}
|
|
319
|
-
},
|
|
319
|
+
}, Ge = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, po = () => "Z", mo = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, vo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, yo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, Zt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ge(s, t, e, a), Ae = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, bo = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, ko = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, wo = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
|
|
320
320
|
var L = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(L || {});
|
|
321
|
-
const
|
|
322
|
-
`).map((t) => t.length)),
|
|
321
|
+
const So = (s) => Math.max(...s.split(`
|
|
322
|
+
`).map((t) => t.length)), Co = (s) => s.match(/\n/g)?.length || 0, W = [];
|
|
323
323
|
for (let s = 0; s < 256; ++s)
|
|
324
324
|
W.push((s + 256).toString(16).slice(1));
|
|
325
|
-
function
|
|
325
|
+
function $o(s, t = 0) {
|
|
326
326
|
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();
|
|
327
327
|
}
|
|
328
|
-
let
|
|
329
|
-
const
|
|
330
|
-
function
|
|
331
|
-
if (!
|
|
328
|
+
let re;
|
|
329
|
+
const Io = new Uint8Array(16);
|
|
330
|
+
function Ao() {
|
|
331
|
+
if (!re) {
|
|
332
332
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
333
333
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
334
|
-
|
|
334
|
+
re = crypto.getRandomValues.bind(crypto);
|
|
335
335
|
}
|
|
336
|
-
return
|
|
336
|
+
return re(Io);
|
|
337
337
|
}
|
|
338
|
-
const
|
|
339
|
-
function
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
338
|
+
const xo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: xo };
|
|
339
|
+
function Le(s, t, e) {
|
|
340
|
+
if (xe.randomUUID && !s)
|
|
341
|
+
return xe.randomUUID();
|
|
342
342
|
s = s || {};
|
|
343
|
-
const a = s.random ?? s.rng?.() ??
|
|
343
|
+
const a = s.random ?? s.rng?.() ?? Ao();
|
|
344
344
|
if (a.length < 16)
|
|
345
345
|
throw new Error("Random bytes length must be >= 16");
|
|
346
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
346
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, $o(a);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
348
|
+
const Nt = (s) => {
|
|
349
|
+
if (typeof s != "object")
|
|
350
|
+
return s;
|
|
351
|
+
const t = {};
|
|
352
|
+
for (const e of Object.entries(s))
|
|
353
|
+
typeof e[1] == "object" ? t[e[0]] = Nt(e[1]) : t[e[0]] = e[1];
|
|
354
|
+
return t;
|
|
355
|
+
}, st = (s) => {
|
|
349
356
|
const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, n = l, i = {
|
|
350
357
|
...n,
|
|
351
358
|
...t
|
|
@@ -365,7 +372,7 @@ const st = (s) => {
|
|
|
365
372
|
selectedAndHighlightedLook: o
|
|
366
373
|
};
|
|
367
374
|
};
|
|
368
|
-
class
|
|
375
|
+
class Qt {
|
|
369
376
|
constructor() {
|
|
370
377
|
this.entities = [], this.entityMap = {};
|
|
371
378
|
}
|
|
@@ -476,7 +483,7 @@ class Jt {
|
|
|
476
483
|
yield t;
|
|
477
484
|
}
|
|
478
485
|
}
|
|
479
|
-
const
|
|
486
|
+
const Pt = 0;
|
|
480
487
|
class It {
|
|
481
488
|
constructor(t, e) {
|
|
482
489
|
this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
|
|
@@ -506,10 +513,10 @@ class It {
|
|
|
506
513
|
* @private
|
|
507
514
|
*/
|
|
508
515
|
select() {
|
|
509
|
-
return this.model.canvas?.selectCanvasView()?.select(`[id='${
|
|
516
|
+
return this.model.canvas?.selectCanvasView()?.select(`[id='${ue(this.id)}']`);
|
|
510
517
|
}
|
|
511
518
|
}
|
|
512
|
-
class ft extends
|
|
519
|
+
class ft extends Qt {
|
|
513
520
|
all(t = !1) {
|
|
514
521
|
return t ? super.all() : super.filter((e) => !e.removed);
|
|
515
522
|
}
|
|
@@ -547,13 +554,13 @@ class ft extends Jt {
|
|
|
547
554
|
yield e;
|
|
548
555
|
}
|
|
549
556
|
}
|
|
550
|
-
class
|
|
557
|
+
class Lo {
|
|
551
558
|
constructor(t, e, a, l, n, i, r) {
|
|
552
559
|
this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = n, this.editable = i, this.rootAttribute = r, this.options = void 0, this.properties = void 0;
|
|
553
560
|
}
|
|
554
561
|
}
|
|
555
562
|
var T = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(T || {});
|
|
556
|
-
class
|
|
563
|
+
class te {
|
|
557
564
|
constructor(t = []) {
|
|
558
565
|
this.propertyList = t, this.propertyMap = {};
|
|
559
566
|
for (const e of this.propertyList)
|
|
@@ -572,11 +579,11 @@ class Qt {
|
|
|
572
579
|
function kt(s, t) {
|
|
573
580
|
return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
|
|
574
581
|
}
|
|
575
|
-
const
|
|
582
|
+
const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Fe = (s, t, e) => {
|
|
576
583
|
const a = {}, l = {};
|
|
577
584
|
for (const n in e.propertySet.propertyMap)
|
|
578
585
|
if (e.propertySet.propertyMap[n].type === T.Object) {
|
|
579
|
-
const i =
|
|
586
|
+
const i = Fe(
|
|
580
587
|
s[n],
|
|
581
588
|
t[n],
|
|
582
589
|
e.getSubValueSet(n)
|
|
@@ -585,7 +592,7 @@ const Le = (s) => s == null || s === "" || s instanceof Array && s.length === 0
|
|
|
585
592
|
} else
|
|
586
593
|
St(s[n], t[n]) || (a[n] = s[n], l[n] = t[n]);
|
|
587
594
|
return [a, l];
|
|
588
|
-
},
|
|
595
|
+
}, Eo = (s) => s != null && s.constructor === Object;
|
|
589
596
|
class yt {
|
|
590
597
|
constructor(t, e) {
|
|
591
598
|
this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
|
|
@@ -697,7 +704,7 @@ class yt {
|
|
|
697
704
|
*/
|
|
698
705
|
hasValue(t) {
|
|
699
706
|
const e = this.getValue(t);
|
|
700
|
-
return !
|
|
707
|
+
return !Ee(e);
|
|
701
708
|
}
|
|
702
709
|
/**
|
|
703
710
|
* Checks if the value under the key is not empty or the default value.
|
|
@@ -707,7 +714,7 @@ class yt {
|
|
|
707
714
|
*/
|
|
708
715
|
hasSetValue(t) {
|
|
709
716
|
const e = this.getValue(t), a = this.propertySet.getProperty(t);
|
|
710
|
-
return a && a.type === T.Object ? this.getSubValueSet(t).hasAnySetValue() : !
|
|
717
|
+
return a && a.type === T.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ee(e) && !St(e, a?.defaultValue);
|
|
711
718
|
}
|
|
712
719
|
/**
|
|
713
720
|
* Checks if any of the values in the set are not empty or the default value.
|
|
@@ -790,7 +797,7 @@ class yt {
|
|
|
790
797
|
this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
|
|
791
798
|
for (const t in this.propertySet.propertyMap) {
|
|
792
799
|
const e = this.propertySet.getProperty(t), a = e.rootAttribute;
|
|
793
|
-
e.type === T.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] =
|
|
800
|
+
e.type === T.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Nt(e.defaultValue), a != null && e.defaultValue !== void 0 && !St(
|
|
794
801
|
this.getRootElementValue(a),
|
|
795
802
|
e.defaultValue
|
|
796
803
|
) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
|
|
@@ -803,9 +810,9 @@ class yt {
|
|
|
803
810
|
* @returns The constructed ValueSet.
|
|
804
811
|
*/
|
|
805
812
|
constructSubValueSet(t) {
|
|
806
|
-
const e = this.propertySet.getProperty(t), a = new
|
|
813
|
+
const e = this.propertySet.getProperty(t), a = new te(e.properties), l = new yt(a, this.rootElement);
|
|
807
814
|
return l.overwriteValues(
|
|
808
|
-
|
|
815
|
+
Nt(e.defaultValue)
|
|
809
816
|
), l;
|
|
810
817
|
}
|
|
811
818
|
/**
|
|
@@ -841,8 +848,8 @@ const et = {
|
|
|
841
848
|
lookType: "connection-look",
|
|
842
849
|
color: "#000000",
|
|
843
850
|
thickness: 1,
|
|
844
|
-
shape:
|
|
845
|
-
style:
|
|
851
|
+
shape: _e.Straight,
|
|
852
|
+
style: be.Solid,
|
|
846
853
|
selected: {
|
|
847
854
|
color: "#AA00AA"
|
|
848
855
|
},
|
|
@@ -856,7 +863,7 @@ const et = {
|
|
|
856
863
|
endTypes: [],
|
|
857
864
|
properties: []
|
|
858
865
|
};
|
|
859
|
-
class
|
|
866
|
+
class Ue {
|
|
860
867
|
constructor(t) {
|
|
861
868
|
const e = {
|
|
862
869
|
...et,
|
|
@@ -878,7 +885,7 @@ class Fe {
|
|
|
878
885
|
this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
|
|
879
886
|
} else
|
|
880
887
|
this.defaultEndMarkerLook = null, this.selectedEndMarkerLook = null, this.highlightedEndMarkerLook = null, this.selectedAndHighlightedEndMarkerLook = null;
|
|
881
|
-
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new
|
|
888
|
+
this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new te(e.properties);
|
|
882
889
|
}
|
|
883
890
|
canStartFromType(t) {
|
|
884
891
|
return this.startTypes.indexOf(t) >= 0;
|
|
@@ -927,13 +934,27 @@ class dt extends It {
|
|
|
927
934
|
get look() {
|
|
928
935
|
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : this.type.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : this.type.defaultLook;
|
|
929
936
|
}
|
|
937
|
+
/**
|
|
938
|
+
* An alias for the `lookConfig` attribute.
|
|
939
|
+
* @private
|
|
940
|
+
*/
|
|
941
|
+
set look(t) {
|
|
942
|
+
this.lookConfig = t;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Look configuration used to derive the current look of this connection.
|
|
946
|
+
* @private
|
|
947
|
+
*/
|
|
948
|
+
get lookConfig() {
|
|
949
|
+
return this._lookConfig;
|
|
950
|
+
}
|
|
930
951
|
/**
|
|
931
952
|
* Sets the look configuration of the connection to override the one determined by the type.
|
|
932
953
|
* `undefined` resets it to the one determined by the type.
|
|
933
954
|
* @private
|
|
934
955
|
*/
|
|
935
|
-
set
|
|
936
|
-
if (t) {
|
|
956
|
+
set lookConfig(t) {
|
|
957
|
+
if (this._lookConfig = t, t) {
|
|
937
958
|
const e = st(t);
|
|
938
959
|
this._defaultLook = {
|
|
939
960
|
...this._defaultLook,
|
|
@@ -958,14 +979,30 @@ class dt extends It {
|
|
|
958
979
|
get startMarkerLook() {
|
|
959
980
|
return this.selected ? this.highlighted ? this._selectedAndHighlightedStartMarkerLook !== void 0 ? this._selectedAndHighlightedStartMarkerLook : this.type.selectedAndHighlightedStartMarkerLook : this._selectedStartMarkerLook !== void 0 ? this._selectedStartMarkerLook : this.type.selectedStartMarkerLook : this.highlighted ? this._highlightedStartMarkerLook !== void 0 ? this._highlightedStartMarkerLook : this.type.highlightedStartMarkerLook : this._defaultStartMarkerLook !== void 0 ? this._defaultStartMarkerLook : this.type.defaultStartMarkerLook;
|
|
960
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* An alias for the `lookConfig` attribute.
|
|
984
|
+
* @private
|
|
985
|
+
*/
|
|
986
|
+
set startMarkerLook(t) {
|
|
987
|
+
this.startMarkerLookConfig = t;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Look configuration used to derive the current look of the start marker of this connection.
|
|
991
|
+
* @private
|
|
992
|
+
*/
|
|
993
|
+
get startMarkerLookConfig() {
|
|
994
|
+
return this._startMarkerLookConfig;
|
|
995
|
+
}
|
|
961
996
|
/**
|
|
962
997
|
* Sets the look configuration of the start marker to override the one determined by the type.
|
|
963
998
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
964
999
|
* @private
|
|
965
1000
|
*/
|
|
966
|
-
set
|
|
967
|
-
if (t) {
|
|
968
|
-
const e = st(
|
|
1001
|
+
set startMarkerLookConfig(t) {
|
|
1002
|
+
if (this._startMarkerLookConfig = t, t) {
|
|
1003
|
+
const e = st(
|
|
1004
|
+
t
|
|
1005
|
+
);
|
|
969
1006
|
this._defaultStartMarkerLook = {
|
|
970
1007
|
...this._defaultStartMarkerLook,
|
|
971
1008
|
...e.defaultLook
|
|
@@ -989,13 +1026,27 @@ class dt extends It {
|
|
|
989
1026
|
get endMarkerLook() {
|
|
990
1027
|
return this.selected ? this.highlighted ? this._selectedAndHighlightedEndMarkerLook !== void 0 ? this._selectedAndHighlightedEndMarkerLook : this.type.selectedAndHighlightedEndMarkerLook : this._selectedEndMarkerLook !== void 0 ? this._selectedEndMarkerLook : this.type.selectedEndMarkerLook : this.highlighted ? this._highlightedEndMarkerLook !== void 0 ? this._highlightedEndMarkerLook : this.type.highlightedEndMarkerLook : this._defaultEndMarkerLook !== void 0 ? this._defaultEndMarkerLook : this.type.defaultEndMarkerLook;
|
|
991
1028
|
}
|
|
1029
|
+
/**
|
|
1030
|
+
* An alias for the `lookConfig` attribute.
|
|
1031
|
+
* @private
|
|
1032
|
+
*/
|
|
1033
|
+
set endMarkerLook(t) {
|
|
1034
|
+
this.endMarkerLookConfig = t;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Look configuration used to derive the current look of the end marker of this connection.
|
|
1038
|
+
* @private
|
|
1039
|
+
*/
|
|
1040
|
+
get endMarkerLookConfig() {
|
|
1041
|
+
return this._endMarkerLookConfig;
|
|
1042
|
+
}
|
|
992
1043
|
/**
|
|
993
1044
|
* Sets the look configuration of the end marker to override the one determined by the type.
|
|
994
1045
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
995
1046
|
* @private
|
|
996
1047
|
*/
|
|
997
|
-
set
|
|
998
|
-
if (t) {
|
|
1048
|
+
set endMarkerLookConfig(t) {
|
|
1049
|
+
if (this._endMarkerLookConfig = t, t) {
|
|
999
1050
|
const e = st(t);
|
|
1000
1051
|
this._defaultEndMarkerLook = {
|
|
1001
1052
|
...this._defaultEndMarkerLook,
|
|
@@ -1093,16 +1144,16 @@ class dt extends It {
|
|
|
1093
1144
|
}
|
|
1094
1145
|
}
|
|
1095
1146
|
getPriority() {
|
|
1096
|
-
return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() :
|
|
1147
|
+
return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
|
|
1097
1148
|
}
|
|
1098
1149
|
}
|
|
1099
|
-
class
|
|
1150
|
+
class Mo extends ft {
|
|
1100
1151
|
/**
|
|
1101
1152
|
* Instance a set of connections for the given model. This method is used internally.
|
|
1102
1153
|
* @private
|
|
1103
1154
|
*/
|
|
1104
1155
|
constructor(t) {
|
|
1105
|
-
super(), this.types = new
|
|
1156
|
+
super(), this.types = new Qt(), this.model = t;
|
|
1106
1157
|
}
|
|
1107
1158
|
/**
|
|
1108
1159
|
* Instance a new connection and add it to this set.
|
|
@@ -1115,7 +1166,7 @@ class Eo extends ft {
|
|
|
1115
1166
|
*/
|
|
1116
1167
|
new(t, e, a, l) {
|
|
1117
1168
|
let n;
|
|
1118
|
-
if (t instanceof
|
|
1169
|
+
if (t instanceof Ue)
|
|
1119
1170
|
n = t;
|
|
1120
1171
|
else {
|
|
1121
1172
|
const r = this.types.get(t);
|
|
@@ -1149,7 +1200,7 @@ const V = {
|
|
|
1149
1200
|
selectedColor: "#000000",
|
|
1150
1201
|
backgroundColor: "#00000000",
|
|
1151
1202
|
horizontalAlign: Lt.Center,
|
|
1152
|
-
verticalAlign:
|
|
1203
|
+
verticalAlign: Kt.Center,
|
|
1153
1204
|
orientation: g.Top,
|
|
1154
1205
|
fit: !1,
|
|
1155
1206
|
shrink: !0
|
|
@@ -1208,10 +1259,10 @@ class ht extends It {
|
|
|
1208
1259
|
this.coords = t, this.updateInView();
|
|
1209
1260
|
}
|
|
1210
1261
|
getPriority() {
|
|
1211
|
-
return this.rootElement?.getPriority() ||
|
|
1262
|
+
return this.rootElement?.getPriority() || Pt;
|
|
1212
1263
|
}
|
|
1213
1264
|
}
|
|
1214
|
-
class
|
|
1265
|
+
class To extends ft {
|
|
1215
1266
|
/**
|
|
1216
1267
|
* Instance a set of fields for the given model. This method is used internally.
|
|
1217
1268
|
* @private
|
|
@@ -1249,22 +1300,22 @@ class Mo extends ft {
|
|
|
1249
1300
|
e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
|
|
1250
1301
|
}
|
|
1251
1302
|
}
|
|
1252
|
-
const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]),
|
|
1253
|
-
class
|
|
1303
|
+
const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Me = 1, Te = 1, No = 1, Po = 1;
|
|
1304
|
+
class zo {
|
|
1254
1305
|
constructor(t) {
|
|
1255
1306
|
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 = [];
|
|
1256
1307
|
for (const e of t.sections) {
|
|
1257
1308
|
const a = [];
|
|
1258
1309
|
this.sections.push(a);
|
|
1259
1310
|
for (const l of e)
|
|
1260
|
-
a.push(new
|
|
1311
|
+
a.push(new Ro(l));
|
|
1261
1312
|
}
|
|
1262
1313
|
}
|
|
1263
1314
|
}
|
|
1264
|
-
class
|
|
1315
|
+
class Ro {
|
|
1265
1316
|
constructor(t) {
|
|
1266
|
-
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority ||
|
|
1267
|
-
const e = st(t.look ||
|
|
1317
|
+
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
|
|
1318
|
+
const e = st(t.look || De);
|
|
1268
1319
|
this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
|
|
1269
1320
|
}
|
|
1270
1321
|
}
|
|
@@ -1293,13 +1344,27 @@ class D extends It {
|
|
|
1293
1344
|
get look() {
|
|
1294
1345
|
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type?.selectedAndHighlightedLook || this.node?.look : this._selectedLook !== void 0 ? this._selectedLook : this.type?.selectedLook || this.node?.look : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type?.highlightedLook || this.node?.look : this._defaultLook !== void 0 ? this._defaultLook : this.type?.defaultLook || this.node?.look;
|
|
1295
1346
|
}
|
|
1347
|
+
/**
|
|
1348
|
+
* An alias for the `lookConfig` attribute.
|
|
1349
|
+
* @private
|
|
1350
|
+
*/
|
|
1351
|
+
set look(t) {
|
|
1352
|
+
this.lookConfig = t;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Look configuration used to derive the current look of this section.
|
|
1356
|
+
* @private
|
|
1357
|
+
*/
|
|
1358
|
+
get lookConfig() {
|
|
1359
|
+
return this._lookConfig;
|
|
1360
|
+
}
|
|
1296
1361
|
/**
|
|
1297
1362
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
1298
1363
|
* `undefined` resets it to the one determined by the type.
|
|
1299
1364
|
* @private
|
|
1300
1365
|
*/
|
|
1301
|
-
set
|
|
1302
|
-
if (t) {
|
|
1366
|
+
set lookConfig(t) {
|
|
1367
|
+
if (this._lookConfig = t, t) {
|
|
1303
1368
|
const e = st(t);
|
|
1304
1369
|
this._defaultLook = {
|
|
1305
1370
|
...this._defaultLook,
|
|
@@ -1334,13 +1399,13 @@ class D extends It {
|
|
|
1334
1399
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
|
|
1335
1400
|
}
|
|
1336
1401
|
getMinWidth() {
|
|
1337
|
-
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] ||
|
|
1402
|
+
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || No;
|
|
1338
1403
|
}
|
|
1339
1404
|
getMinHeight() {
|
|
1340
|
-
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] ||
|
|
1405
|
+
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Po;
|
|
1341
1406
|
}
|
|
1342
1407
|
getPriority() {
|
|
1343
|
-
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority ||
|
|
1408
|
+
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
|
|
1344
1409
|
}
|
|
1345
1410
|
/**
|
|
1346
1411
|
* Returns whether this section can be resized horizontally.
|
|
@@ -1480,7 +1545,7 @@ class D extends It {
|
|
|
1480
1545
|
const l = [this.coords[0], this.coords[0] + this.width], n = [this.coords[1], this.coords[1] + this.height];
|
|
1481
1546
|
for (const r of this.ports)
|
|
1482
1547
|
r.move(
|
|
1483
|
-
|
|
1548
|
+
qt(
|
|
1484
1549
|
r.coords,
|
|
1485
1550
|
e,
|
|
1486
1551
|
a,
|
|
@@ -1497,7 +1562,7 @@ class D extends It {
|
|
|
1497
1562
|
], this.label.width = this.width - B(i?.label) - ot(i?.label), this.label.height = this.height - F(i?.label) - K(i?.label), this.label.updateInView());
|
|
1498
1563
|
for (const r of this.decorators)
|
|
1499
1564
|
r.move(
|
|
1500
|
-
|
|
1565
|
+
qt(
|
|
1501
1566
|
r.coords,
|
|
1502
1567
|
e,
|
|
1503
1568
|
a,
|
|
@@ -1510,7 +1575,7 @@ class D extends It {
|
|
|
1510
1575
|
this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((r) => r.tighten()), this.updateInView();
|
|
1511
1576
|
}
|
|
1512
1577
|
}
|
|
1513
|
-
class
|
|
1578
|
+
class Vo extends ft {
|
|
1514
1579
|
/**
|
|
1515
1580
|
* Instance a set of sections for the given model. This method is used internally.
|
|
1516
1581
|
* @private
|
|
@@ -1557,7 +1622,7 @@ class Ro extends ft {
|
|
|
1557
1622
|
const m = {
|
|
1558
1623
|
...V,
|
|
1559
1624
|
...y.type?.label
|
|
1560
|
-
}, p = 6 * m.fontSize +
|
|
1625
|
+
}, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
|
|
1561
1626
|
let k;
|
|
1562
1627
|
switch (y.direction) {
|
|
1563
1628
|
case g.Bottom:
|
|
@@ -1634,7 +1699,7 @@ class Ro extends ft {
|
|
|
1634
1699
|
}
|
|
1635
1700
|
}
|
|
1636
1701
|
}
|
|
1637
|
-
const
|
|
1702
|
+
const De = {
|
|
1638
1703
|
lookType: "shaped-look",
|
|
1639
1704
|
shape: Tt.Rectangle,
|
|
1640
1705
|
fillColor: "#FFFFFF",
|
|
@@ -1661,22 +1726,22 @@ const Ue = {
|
|
|
1661
1726
|
ports: [],
|
|
1662
1727
|
decorators: [],
|
|
1663
1728
|
sectionGrid: null,
|
|
1664
|
-
look:
|
|
1729
|
+
look: De,
|
|
1665
1730
|
isUnique: !1,
|
|
1666
1731
|
canBeParentless: !0,
|
|
1667
1732
|
childrenTypes: [],
|
|
1668
|
-
priority:
|
|
1733
|
+
priority: Pt,
|
|
1669
1734
|
properties: []
|
|
1670
1735
|
};
|
|
1671
|
-
class
|
|
1736
|
+
class Be {
|
|
1672
1737
|
constructor(t) {
|
|
1673
1738
|
const e = {
|
|
1674
1739
|
...gt,
|
|
1675
1740
|
...t
|
|
1676
1741
|
};
|
|
1677
|
-
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 =
|
|
1742
|
+
this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = Ho(e), this.leftPadding = _o(e), this.rightPadding = Go(e), this.topPadding = Fo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new zo(e.sectionGrid) : null;
|
|
1678
1743
|
const a = st(e.look);
|
|
1679
|
-
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
|
|
1744
|
+
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new te(t?.properties || []);
|
|
1680
1745
|
}
|
|
1681
1746
|
}
|
|
1682
1747
|
class z extends It {
|
|
@@ -1719,13 +1784,27 @@ class z extends It {
|
|
|
1719
1784
|
get look() {
|
|
1720
1785
|
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : this.type.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : this.type.defaultLook;
|
|
1721
1786
|
}
|
|
1787
|
+
/**
|
|
1788
|
+
* An alias for the `lookConfig` attribute.
|
|
1789
|
+
* @private
|
|
1790
|
+
*/
|
|
1791
|
+
set look(t) {
|
|
1792
|
+
this.lookConfig = t;
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* Look configuration used to derive the current look of this node.
|
|
1796
|
+
* @private
|
|
1797
|
+
*/
|
|
1798
|
+
get lookConfig() {
|
|
1799
|
+
return this._lookConfig;
|
|
1800
|
+
}
|
|
1722
1801
|
/**
|
|
1723
1802
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
1724
1803
|
* `undefined` resets it to the one determined by the type.
|
|
1725
1804
|
* @private
|
|
1726
1805
|
*/
|
|
1727
|
-
set
|
|
1728
|
-
if (t) {
|
|
1806
|
+
set lookConfig(t) {
|
|
1807
|
+
if (this._lookConfig = t, t) {
|
|
1729
1808
|
const e = st(t);
|
|
1730
1809
|
this._defaultLook = {
|
|
1731
1810
|
...this._defaultLook,
|
|
@@ -2088,7 +2167,7 @@ class z extends It {
|
|
|
2088
2167
|
}
|
|
2089
2168
|
for (const i of this.ports)
|
|
2090
2169
|
i.move(
|
|
2091
|
-
|
|
2170
|
+
qt(
|
|
2092
2171
|
i.coords,
|
|
2093
2172
|
e,
|
|
2094
2173
|
a,
|
|
@@ -2104,7 +2183,7 @@ class z extends It {
|
|
|
2104
2183
|
], this.label.width = this.width - B(this.type.label) - ot(this.type.label), this.label.height = this.height - F(this.type.label) - K(this.type.label), this.label.updateInView());
|
|
2105
2184
|
for (const i of this.decorators)
|
|
2106
2185
|
i.move(
|
|
2107
|
-
|
|
2186
|
+
qt(
|
|
2108
2187
|
i.coords,
|
|
2109
2188
|
e,
|
|
2110
2189
|
a,
|
|
@@ -2219,13 +2298,13 @@ class z extends It {
|
|
|
2219
2298
|
this.stretch(g.Bottom, e + a);
|
|
2220
2299
|
}
|
|
2221
2300
|
}
|
|
2222
|
-
class
|
|
2301
|
+
class Oo extends ft {
|
|
2223
2302
|
/**
|
|
2224
2303
|
* Instance a set of nodes for the given model. This method is used internally.
|
|
2225
2304
|
* @private
|
|
2226
2305
|
*/
|
|
2227
2306
|
constructor(t) {
|
|
2228
|
-
super(), this.types = new
|
|
2307
|
+
super(), this.types = new Qt(), this.model = t;
|
|
2229
2308
|
}
|
|
2230
2309
|
/**
|
|
2231
2310
|
* Instance a new node and add it to this set.
|
|
@@ -2237,7 +2316,7 @@ class Vo extends ft {
|
|
|
2237
2316
|
*/
|
|
2238
2317
|
new(t, e, a) {
|
|
2239
2318
|
let l;
|
|
2240
|
-
if (t instanceof
|
|
2319
|
+
if (t instanceof Be)
|
|
2241
2320
|
l = t;
|
|
2242
2321
|
else {
|
|
2243
2322
|
const i = this.types.get(t);
|
|
@@ -2256,11 +2335,11 @@ class Vo extends ft {
|
|
|
2256
2335
|
d,
|
|
2257
2336
|
r,
|
|
2258
2337
|
[o, i],
|
|
2259
|
-
l.sectionGrid.defaultWidths?.[d] ||
|
|
2260
|
-
l.sectionGrid.defaultHeights?.[r] ||
|
|
2338
|
+
l.sectionGrid.defaultWidths?.[d] || Me,
|
|
2339
|
+
l.sectionGrid.defaultHeights?.[r] || Te,
|
|
2261
2340
|
`${n.id}_${r}_${d}`
|
|
2262
|
-
), o += (l.sectionGrid.defaultWidths?.[d] ||
|
|
2263
|
-
i += (l.sectionGrid.defaultHeights?.[r] ||
|
|
2341
|
+
), o += (l.sectionGrid.defaultWidths?.[d] || Me) + (l.sectionGrid.margin || 0);
|
|
2342
|
+
i += (l.sectionGrid.defaultHeights?.[r] || Te) + (l.sectionGrid.margin || 0);
|
|
2264
2343
|
}
|
|
2265
2344
|
}
|
|
2266
2345
|
if (l.ports.length > 0)
|
|
@@ -2285,7 +2364,7 @@ class Vo extends ft {
|
|
|
2285
2364
|
const c = {
|
|
2286
2365
|
...V,
|
|
2287
2366
|
...d.type?.label
|
|
2288
|
-
}, h = 6 * c.fontSize +
|
|
2367
|
+
}, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) + Vt(c);
|
|
2289
2368
|
let y;
|
|
2290
2369
|
switch (d.direction) {
|
|
2291
2370
|
case g.Bottom:
|
|
@@ -2398,12 +2477,12 @@ class Vo extends ft {
|
|
|
2398
2477
|
return a;
|
|
2399
2478
|
}
|
|
2400
2479
|
}
|
|
2401
|
-
const
|
|
2480
|
+
const Ye = (s) => {
|
|
2402
2481
|
for (let t = 0; t < s.length; ++t)
|
|
2403
2482
|
for (let e = 0; e < s.length; ++e)
|
|
2404
2483
|
e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
|
|
2405
2484
|
return s;
|
|
2406
|
-
},
|
|
2485
|
+
}, Ho = (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]), _o = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Go = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Fo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Xe = {
|
|
2407
2486
|
lookType: "shaped-look",
|
|
2408
2487
|
shape: Tt.Ellipse,
|
|
2409
2488
|
fillColor: "transparent",
|
|
@@ -2415,18 +2494,18 @@ const Be = (s) => {
|
|
|
2415
2494
|
highlighted: {
|
|
2416
2495
|
fillColor: "rgba(0, 255, 255, 0.5)"
|
|
2417
2496
|
}
|
|
2418
|
-
},
|
|
2497
|
+
}, jt = st(Xe), je = {
|
|
2419
2498
|
name: "",
|
|
2420
2499
|
label: null,
|
|
2421
2500
|
allowsOutgoing: !0,
|
|
2422
2501
|
allowsIncoming: !0,
|
|
2423
2502
|
width: 24,
|
|
2424
|
-
look:
|
|
2503
|
+
look: Xe
|
|
2425
2504
|
};
|
|
2426
|
-
class
|
|
2505
|
+
class Uo {
|
|
2427
2506
|
constructor(t) {
|
|
2428
2507
|
const e = {
|
|
2429
|
-
...
|
|
2508
|
+
...je,
|
|
2430
2509
|
...t
|
|
2431
2510
|
};
|
|
2432
2511
|
this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
|
|
@@ -2487,15 +2566,29 @@ class bt extends It {
|
|
|
2487
2566
|
* @private
|
|
2488
2567
|
*/
|
|
2489
2568
|
get look() {
|
|
2490
|
-
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type ||
|
|
2569
|
+
return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || jt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || jt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || jt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || jt)?.defaultLook;
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* An alias for the `lookConfig` attribute.
|
|
2573
|
+
* @private
|
|
2574
|
+
*/
|
|
2575
|
+
set look(t) {
|
|
2576
|
+
this.lookConfig = t;
|
|
2577
|
+
}
|
|
2578
|
+
/**
|
|
2579
|
+
* Look configuration used to derive the current look of this port.
|
|
2580
|
+
* @private
|
|
2581
|
+
*/
|
|
2582
|
+
get lookConfig() {
|
|
2583
|
+
return this._lookConfig;
|
|
2491
2584
|
}
|
|
2492
2585
|
/**
|
|
2493
2586
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
2494
2587
|
* `undefined` resets it to the one determined by the type.
|
|
2495
2588
|
* @private
|
|
2496
2589
|
*/
|
|
2497
|
-
set
|
|
2498
|
-
if (t) {
|
|
2590
|
+
set lookConfig(t) {
|
|
2591
|
+
if (this._lookConfig = t, t) {
|
|
2499
2592
|
const e = st(
|
|
2500
2593
|
t
|
|
2501
2594
|
);
|
|
@@ -2520,7 +2613,7 @@ class bt extends It {
|
|
|
2520
2613
|
* @private
|
|
2521
2614
|
*/
|
|
2522
2615
|
get width() {
|
|
2523
|
-
return this.type?.width ||
|
|
2616
|
+
return this.type?.width || je.width;
|
|
2524
2617
|
}
|
|
2525
2618
|
/**
|
|
2526
2619
|
* Current height of this port. Same as the width.
|
|
@@ -2570,7 +2663,7 @@ class bt extends It {
|
|
|
2570
2663
|
return this.rootElement.node;
|
|
2571
2664
|
}
|
|
2572
2665
|
getPriority() {
|
|
2573
|
-
return this.rootElement?.getPriority() ||
|
|
2666
|
+
return this.rootElement?.getPriority() || Pt;
|
|
2574
2667
|
}
|
|
2575
2668
|
/**
|
|
2576
2669
|
* Change the coordinates of this port to the given coordinates and move its labels correspondingly.
|
|
@@ -2593,16 +2686,16 @@ class bt extends It {
|
|
|
2593
2686
|
]), this.updateInView();
|
|
2594
2687
|
}
|
|
2595
2688
|
distanceTo(t) {
|
|
2596
|
-
return
|
|
2689
|
+
return He(this.coords, t);
|
|
2597
2690
|
}
|
|
2598
2691
|
}
|
|
2599
|
-
class
|
|
2692
|
+
class Do extends ft {
|
|
2600
2693
|
/**
|
|
2601
2694
|
* Instance a set of ports for the given model. This method is used internally.
|
|
2602
2695
|
* @private
|
|
2603
2696
|
*/
|
|
2604
2697
|
constructor(t) {
|
|
2605
|
-
super(), this.types = new
|
|
2698
|
+
super(), this.types = new Qt(), this.model = t;
|
|
2606
2699
|
}
|
|
2607
2700
|
/**
|
|
2608
2701
|
* 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.
|
|
@@ -2633,7 +2726,7 @@ class Uo extends ft {
|
|
|
2633
2726
|
}
|
|
2634
2727
|
}
|
|
2635
2728
|
}
|
|
2636
|
-
class
|
|
2729
|
+
class We {
|
|
2637
2730
|
import(t, e) {
|
|
2638
2731
|
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);
|
|
2639
2732
|
for (const a of e.nodes || [])
|
|
@@ -2890,14 +2983,14 @@ class je {
|
|
|
2890
2983
|
t && e && (t.selfRemoved = e.selfRemoved, t.selfRemovedTimestamp = e.selfRemovedTimestamp, t.textTimestamp = e.textTimestamp);
|
|
2891
2984
|
}
|
|
2892
2985
|
}
|
|
2893
|
-
class
|
|
2986
|
+
class ee {
|
|
2894
2987
|
constructor(t, e, a, l, n, i, r) {
|
|
2895
2988
|
this.canvas = t, this.id = e, this.typeId = a, this.coords = l, this.parentId = n, this.label = i, this.values = r;
|
|
2896
2989
|
}
|
|
2897
2990
|
do() {
|
|
2898
2991
|
const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
|
|
2899
2992
|
this.parentId !== void 0 && this.canvas.model.nodes.get(this.parentId)?.addChild(t), t.label && (t.label.text = this.label || ""), this.values !== void 0 ? t.valueSet.setValues(
|
|
2900
|
-
|
|
2993
|
+
Nt({
|
|
2901
2994
|
...t.valueSet.getValues(),
|
|
2902
2995
|
...this.values
|
|
2903
2996
|
})
|
|
@@ -2915,7 +3008,7 @@ class te {
|
|
|
2915
3008
|
};
|
|
2916
3009
|
}
|
|
2917
3010
|
static deserialize(t, e) {
|
|
2918
|
-
return new
|
|
3011
|
+
return new ee(
|
|
2919
3012
|
t,
|
|
2920
3013
|
e.id,
|
|
2921
3014
|
e.typeId,
|
|
@@ -2926,7 +3019,7 @@ class te {
|
|
|
2926
3019
|
);
|
|
2927
3020
|
}
|
|
2928
3021
|
}
|
|
2929
|
-
class
|
|
3022
|
+
class ke {
|
|
2930
3023
|
constructor(t, e, a, l, n, i, r) {
|
|
2931
3024
|
this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex = n, this.removeRowIndex = i, this.timestamp = r;
|
|
2932
3025
|
}
|
|
@@ -2946,7 +3039,7 @@ class be {
|
|
|
2946
3039
|
};
|
|
2947
3040
|
}
|
|
2948
3041
|
static deserialize(t, e) {
|
|
2949
|
-
return new
|
|
3042
|
+
return new ke(
|
|
2950
3043
|
t,
|
|
2951
3044
|
e.nodeId,
|
|
2952
3045
|
e.copyColumnIndex,
|
|
@@ -2957,7 +3050,7 @@ class be {
|
|
|
2957
3050
|
);
|
|
2958
3051
|
}
|
|
2959
3052
|
}
|
|
2960
|
-
class
|
|
3053
|
+
class we {
|
|
2961
3054
|
constructor(t, e, a) {
|
|
2962
3055
|
this.canvas = t, this.to = e, this.timestamp = a;
|
|
2963
3056
|
}
|
|
@@ -2978,14 +3071,14 @@ class ke {
|
|
|
2978
3071
|
};
|
|
2979
3072
|
}
|
|
2980
3073
|
static deserialize(t, e) {
|
|
2981
|
-
return new
|
|
3074
|
+
return new we(
|
|
2982
3075
|
t,
|
|
2983
3076
|
e.to,
|
|
2984
3077
|
e.timestamp
|
|
2985
3078
|
);
|
|
2986
3079
|
}
|
|
2987
3080
|
}
|
|
2988
|
-
class
|
|
3081
|
+
class Gt {
|
|
2989
3082
|
constructor(t, e, a, l) {
|
|
2990
3083
|
this.canvas = t, this.nodeIds = e, this.delta = a, this.timestamp = l;
|
|
2991
3084
|
}
|
|
@@ -3007,7 +3100,7 @@ class _t {
|
|
|
3007
3100
|
};
|
|
3008
3101
|
}
|
|
3009
3102
|
static deserialize(t, e) {
|
|
3010
|
-
return new
|
|
3103
|
+
return new Gt(
|
|
3011
3104
|
t,
|
|
3012
3105
|
e.nodeIds,
|
|
3013
3106
|
e.delta,
|
|
@@ -3048,7 +3141,7 @@ class it {
|
|
|
3048
3141
|
);
|
|
3049
3142
|
}
|
|
3050
3143
|
}
|
|
3051
|
-
class
|
|
3144
|
+
class Ft {
|
|
3052
3145
|
constructor(t, e, a, l, n) {
|
|
3053
3146
|
this.canvas = t, this.childId = e, this.parentId = a, this.childGeometry = l, this.timestamp = n;
|
|
3054
3147
|
}
|
|
@@ -3066,7 +3159,7 @@ class Gt {
|
|
|
3066
3159
|
};
|
|
3067
3160
|
}
|
|
3068
3161
|
static deserialize(t, e) {
|
|
3069
|
-
return new
|
|
3162
|
+
return new Ft(
|
|
3070
3163
|
t,
|
|
3071
3164
|
e.childId,
|
|
3072
3165
|
e.parentId,
|
|
@@ -3075,7 +3168,7 @@ class Gt {
|
|
|
3075
3168
|
);
|
|
3076
3169
|
}
|
|
3077
3170
|
}
|
|
3078
|
-
class
|
|
3171
|
+
class oe {
|
|
3079
3172
|
constructor(t, e, a, l, n) {
|
|
3080
3173
|
this.canvas = t, this.id = e, this.typeId = a, this.startId = l, this.endId = n;
|
|
3081
3174
|
}
|
|
@@ -3093,7 +3186,7 @@ class ee {
|
|
|
3093
3186
|
};
|
|
3094
3187
|
}
|
|
3095
3188
|
static deserialize(t, e) {
|
|
3096
|
-
return new
|
|
3189
|
+
return new oe(
|
|
3097
3190
|
t,
|
|
3098
3191
|
e.id,
|
|
3099
3192
|
e.typeId,
|
|
@@ -3199,12 +3292,12 @@ class at {
|
|
|
3199
3292
|
);
|
|
3200
3293
|
}
|
|
3201
3294
|
}
|
|
3202
|
-
class
|
|
3295
|
+
class ie {
|
|
3203
3296
|
constructor(t, e, a) {
|
|
3204
3297
|
this.canvas = t, this.nodes = e, this.connections = a;
|
|
3205
3298
|
}
|
|
3206
3299
|
do() {
|
|
3207
|
-
const t = new
|
|
3300
|
+
const t = new We();
|
|
3208
3301
|
this.canvas.userSelection.clear();
|
|
3209
3302
|
for (const e of this.nodes) {
|
|
3210
3303
|
const a = t.importNode(this.canvas.model, e);
|
|
@@ -3226,16 +3319,16 @@ class oe {
|
|
|
3226
3319
|
};
|
|
3227
3320
|
}
|
|
3228
3321
|
static deserialize(t, e) {
|
|
3229
|
-
return new
|
|
3322
|
+
return new ie(
|
|
3230
3323
|
t,
|
|
3231
3324
|
e.nodes,
|
|
3232
3325
|
e.connections
|
|
3233
3326
|
);
|
|
3234
3327
|
}
|
|
3235
3328
|
}
|
|
3236
|
-
class
|
|
3329
|
+
class Bo {
|
|
3237
3330
|
constructor(t) {
|
|
3238
|
-
this.isInRoom = !1, this.canvas = t, this.replicaId =
|
|
3331
|
+
this.isInRoom = !1, this.canvas = t, this.replicaId = Le();
|
|
3239
3332
|
}
|
|
3240
3333
|
/**
|
|
3241
3334
|
* Returns a fresh timestamp, suitable for use by new CollabActions.
|
|
@@ -3247,7 +3340,7 @@ class Do {
|
|
|
3247
3340
|
* Returns a fresh unique ID, suitable for use by new CollabActions.
|
|
3248
3341
|
*/
|
|
3249
3342
|
freshId() {
|
|
3250
|
-
return "id" +
|
|
3343
|
+
return "id" + Le();
|
|
3251
3344
|
}
|
|
3252
3345
|
/**
|
|
3253
3346
|
* Performs the action - immediately locally, and eventually for remote collaborators.
|
|
@@ -3270,22 +3363,22 @@ class Do {
|
|
|
3270
3363
|
t.timestamp[0]
|
|
3271
3364
|
)), t.type) {
|
|
3272
3365
|
case "addNode": {
|
|
3273
|
-
|
|
3366
|
+
ee.deserialize(this.canvas, t).do();
|
|
3274
3367
|
break;
|
|
3275
3368
|
}
|
|
3276
3369
|
case "addSection": {
|
|
3277
|
-
|
|
3370
|
+
ke.deserialize(this.canvas, t).do();
|
|
3278
3371
|
break;
|
|
3279
3372
|
}
|
|
3280
3373
|
case "applyLayout": {
|
|
3281
|
-
|
|
3374
|
+
we.deserialize(
|
|
3282
3375
|
this.canvas,
|
|
3283
3376
|
t
|
|
3284
3377
|
).do();
|
|
3285
3378
|
break;
|
|
3286
3379
|
}
|
|
3287
3380
|
case "move": {
|
|
3288
|
-
|
|
3381
|
+
Gt.deserialize(this.canvas, t).do();
|
|
3289
3382
|
break;
|
|
3290
3383
|
}
|
|
3291
3384
|
case "setGeometry": {
|
|
@@ -3296,11 +3389,11 @@ class Do {
|
|
|
3296
3389
|
break;
|
|
3297
3390
|
}
|
|
3298
3391
|
case "setParent": {
|
|
3299
|
-
|
|
3392
|
+
Ft.deserialize(this.canvas, t).do();
|
|
3300
3393
|
break;
|
|
3301
3394
|
}
|
|
3302
3395
|
case "addConnection": {
|
|
3303
|
-
|
|
3396
|
+
oe.deserialize(
|
|
3304
3397
|
this.canvas,
|
|
3305
3398
|
t
|
|
3306
3399
|
).do();
|
|
@@ -3325,7 +3418,7 @@ class Do {
|
|
|
3325
3418
|
break;
|
|
3326
3419
|
}
|
|
3327
3420
|
case "paste": {
|
|
3328
|
-
|
|
3421
|
+
ie.deserialize(this.canvas, t).do();
|
|
3329
3422
|
break;
|
|
3330
3423
|
}
|
|
3331
3424
|
default:
|
|
@@ -3336,7 +3429,7 @@ class Do {
|
|
|
3336
3429
|
}
|
|
3337
3430
|
}
|
|
3338
3431
|
}
|
|
3339
|
-
class
|
|
3432
|
+
class Yo {
|
|
3340
3433
|
constructor(t, e) {
|
|
3341
3434
|
this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
|
|
3342
3435
|
}
|
|
@@ -3389,12 +3482,12 @@ class Bo {
|
|
|
3389
3482
|
}
|
|
3390
3483
|
}
|
|
3391
3484
|
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 || {});
|
|
3392
|
-
class
|
|
3485
|
+
class Xo {
|
|
3393
3486
|
constructor(t, e, a, l, n, i, r, o, d) {
|
|
3394
3487
|
this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = n, this.fromAncestorGeometry = i, this.toAncestorGeometry = r, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
|
|
3395
3488
|
}
|
|
3396
3489
|
do() {
|
|
3397
|
-
const t = new
|
|
3490
|
+
const t = new ee(
|
|
3398
3491
|
this.canvas,
|
|
3399
3492
|
this.id,
|
|
3400
3493
|
this.type.id,
|
|
@@ -3459,12 +3552,12 @@ class Yo {
|
|
|
3459
3552
|
return t === void 0;
|
|
3460
3553
|
}
|
|
3461
3554
|
}
|
|
3462
|
-
class
|
|
3555
|
+
class ae {
|
|
3463
3556
|
constructor(t, e, a) {
|
|
3464
3557
|
this.canvas = t, this.nodeIds = e, this.delta = a;
|
|
3465
3558
|
}
|
|
3466
3559
|
do() {
|
|
3467
|
-
const t = new
|
|
3560
|
+
const t = new Gt(
|
|
3468
3561
|
this.canvas,
|
|
3469
3562
|
this.nodeIds,
|
|
3470
3563
|
this.delta,
|
|
@@ -3473,7 +3566,7 @@ class re {
|
|
|
3473
3566
|
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);
|
|
3474
3567
|
}
|
|
3475
3568
|
undo() {
|
|
3476
|
-
const t = new
|
|
3569
|
+
const t = new Gt(
|
|
3477
3570
|
this.canvas,
|
|
3478
3571
|
this.nodeIds,
|
|
3479
3572
|
[-this.delta[0], -this.delta[1]],
|
|
@@ -3547,12 +3640,12 @@ class X {
|
|
|
3547
3640
|
return t !== void 0;
|
|
3548
3641
|
}
|
|
3549
3642
|
}
|
|
3550
|
-
class
|
|
3643
|
+
class jo {
|
|
3551
3644
|
constructor(t, e, a, l, n, i, r, o, d) {
|
|
3552
3645
|
this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry = n, this.toChildGeometry = i, this.ancestorId = r, this.fromAncestorGeometry = o, this.toAncestorGeometry = d;
|
|
3553
3646
|
}
|
|
3554
3647
|
do() {
|
|
3555
|
-
const t = this.canvas.model.nodes.get(this.childId), e = new
|
|
3648
|
+
const t = this.canvas.model.nodes.get(this.childId), e = new Ft(
|
|
3556
3649
|
this.canvas,
|
|
3557
3650
|
this.childId,
|
|
3558
3651
|
this.toParentId,
|
|
@@ -3571,7 +3664,7 @@ class Xo {
|
|
|
3571
3664
|
return t !== void 0;
|
|
3572
3665
|
}
|
|
3573
3666
|
undo() {
|
|
3574
|
-
const t = this.canvas.model.nodes.get(this.childId), e = new
|
|
3667
|
+
const t = this.canvas.model.nodes.get(this.childId), e = new Ft(
|
|
3575
3668
|
this.canvas,
|
|
3576
3669
|
this.childId,
|
|
3577
3670
|
this.fromParentId,
|
|
@@ -3593,12 +3686,12 @@ class Xo {
|
|
|
3593
3686
|
return this.do();
|
|
3594
3687
|
}
|
|
3595
3688
|
}
|
|
3596
|
-
class
|
|
3689
|
+
class le {
|
|
3597
3690
|
constructor(t, e, a, l) {
|
|
3598
3691
|
this.canvas = t, this.type = e, this.startId = a, this.endId = l, this.id = this.canvas.collabEngine.freshId();
|
|
3599
3692
|
}
|
|
3600
3693
|
do() {
|
|
3601
|
-
const t = new
|
|
3694
|
+
const t = new oe(
|
|
3602
3695
|
this.canvas,
|
|
3603
3696
|
this.id,
|
|
3604
3697
|
this.type.id,
|
|
@@ -3634,7 +3727,7 @@ class ae {
|
|
|
3634
3727
|
return this.canvas.collabEngine.doCollaboratively(e), t === void 0;
|
|
3635
3728
|
}
|
|
3636
3729
|
}
|
|
3637
|
-
class
|
|
3730
|
+
class Ne {
|
|
3638
3731
|
constructor(t, e, a, l) {
|
|
3639
3732
|
this.canvas = t, this.fieldId = e, this.from = a, this.to = l;
|
|
3640
3733
|
}
|
|
@@ -3676,7 +3769,7 @@ class Te {
|
|
|
3676
3769
|
return t !== void 0;
|
|
3677
3770
|
}
|
|
3678
3771
|
}
|
|
3679
|
-
class
|
|
3772
|
+
class Wo {
|
|
3680
3773
|
constructor(t, e, a, l) {
|
|
3681
3774
|
this.canvas = t, this.id = e, this.from = a, this.to = l;
|
|
3682
3775
|
}
|
|
@@ -3716,7 +3809,7 @@ class jo {
|
|
|
3716
3809
|
return !e.rootElement.removed;
|
|
3717
3810
|
}
|
|
3718
3811
|
}
|
|
3719
|
-
class
|
|
3812
|
+
class Zo {
|
|
3720
3813
|
constructor(t, e, a, l, n, i) {
|
|
3721
3814
|
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = n, this.fieldIds = i;
|
|
3722
3815
|
}
|
|
@@ -3758,7 +3851,7 @@ class Wo {
|
|
|
3758
3851
|
return this.do();
|
|
3759
3852
|
}
|
|
3760
3853
|
}
|
|
3761
|
-
class
|
|
3854
|
+
class Ko {
|
|
3762
3855
|
constructor(t, e, a, l) {
|
|
3763
3856
|
this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
|
|
3764
3857
|
}
|
|
@@ -3811,7 +3904,7 @@ class Zo {
|
|
|
3811
3904
|
n.points[r][1] + e[1]
|
|
3812
3905
|
];
|
|
3813
3906
|
}
|
|
3814
|
-
const l = new
|
|
3907
|
+
const l = new ie(
|
|
3815
3908
|
this.canvas,
|
|
3816
3909
|
this.nodes,
|
|
3817
3910
|
this.connections
|
|
@@ -3849,7 +3942,7 @@ class Zo {
|
|
|
3849
3942
|
return this.canvas.collabEngine.doCollaboratively(e), t;
|
|
3850
3943
|
}
|
|
3851
3944
|
}
|
|
3852
|
-
class
|
|
3945
|
+
class se {
|
|
3853
3946
|
constructor(t) {
|
|
3854
3947
|
this.type = t, this.defaultPrevented = !1;
|
|
3855
3948
|
}
|
|
@@ -3857,8 +3950,8 @@ class ie {
|
|
|
3857
3950
|
this.defaultPrevented = !0;
|
|
3858
3951
|
}
|
|
3859
3952
|
}
|
|
3860
|
-
var
|
|
3861
|
-
class pt extends
|
|
3953
|
+
var Ze = /* @__PURE__ */ ((s) => (s[s.DoubleClick = 0] = "DoubleClick", s[s.SecondaryClick = 1] = "SecondaryClick", s[s.Selection = 2] = "Selection", s[s.Highlight = 3] = "Highlight", s))(Ze || {});
|
|
3954
|
+
class pt extends se {
|
|
3862
3955
|
/**
|
|
3863
3956
|
* Create a diagram double click event.
|
|
3864
3957
|
*
|
|
@@ -3873,7 +3966,7 @@ class pt extends ie {
|
|
|
3873
3966
|
), this.cause = t, this.target = e, this.coords = a;
|
|
3874
3967
|
}
|
|
3875
3968
|
}
|
|
3876
|
-
class mt extends
|
|
3969
|
+
class mt extends se {
|
|
3877
3970
|
/**
|
|
3878
3971
|
* Create a diagram secondary click event.
|
|
3879
3972
|
*
|
|
@@ -3888,7 +3981,7 @@ class mt extends ie {
|
|
|
3888
3981
|
), this.cause = t, this.target = e, this.coords = a;
|
|
3889
3982
|
}
|
|
3890
3983
|
}
|
|
3891
|
-
class G extends
|
|
3984
|
+
class G extends se {
|
|
3892
3985
|
/**
|
|
3893
3986
|
* Create a diagram selection event.
|
|
3894
3987
|
*
|
|
@@ -3902,7 +3995,7 @@ class G extends ie {
|
|
|
3902
3995
|
), this.targets = t, this.selected = e;
|
|
3903
3996
|
}
|
|
3904
3997
|
}
|
|
3905
|
-
class Q extends
|
|
3998
|
+
class Q extends se {
|
|
3906
3999
|
/**
|
|
3907
4000
|
* Create a diagram highlight event.
|
|
3908
4001
|
*
|
|
@@ -3915,7 +4008,7 @@ class Q extends ie {
|
|
|
3915
4008
|
), this.target = t;
|
|
3916
4009
|
}
|
|
3917
4010
|
}
|
|
3918
|
-
class
|
|
4011
|
+
class Ke extends It {
|
|
3919
4012
|
constructor(t, e, a, l, n, i, r, o, d = "floating", c = "floating") {
|
|
3920
4013
|
if (t.objects.get(o) !== void 0)
|
|
3921
4014
|
throw new Error(`DiagramDecorator with id "${o}" already exists`);
|
|
@@ -3944,7 +4037,7 @@ class Ze extends It {
|
|
|
3944
4037
|
return this.priority;
|
|
3945
4038
|
}
|
|
3946
4039
|
}
|
|
3947
|
-
class
|
|
4040
|
+
class qo extends ft {
|
|
3948
4041
|
/**
|
|
3949
4042
|
* Instance a set of decorators for the given model. This method is used internally.
|
|
3950
4043
|
* @private
|
|
@@ -3964,7 +4057,7 @@ class Ko extends ft {
|
|
|
3964
4057
|
* @returns The instanced decorator.
|
|
3965
4058
|
*/
|
|
3966
4059
|
new(t, e, a, l, n, i, r, o = "floating", d = "floating") {
|
|
3967
|
-
const c = new
|
|
4060
|
+
const c = new Ke(
|
|
3968
4061
|
this.model,
|
|
3969
4062
|
t,
|
|
3970
4063
|
e,
|
|
@@ -3983,7 +4076,7 @@ class Ko extends ft {
|
|
|
3983
4076
|
e && ((e.rootElement instanceof z || e.rootElement instanceof D) && Y(e.rootElement.decorators, e), super.remove(t), e.updateInView());
|
|
3984
4077
|
}
|
|
3985
4078
|
}
|
|
3986
|
-
class
|
|
4079
|
+
class Jo extends It {
|
|
3987
4080
|
constructor(t, e, a, l, n, i, r) {
|
|
3988
4081
|
if (t.objects.get(r) !== void 0)
|
|
3989
4082
|
throw new Error(`DiagramObject with id "${r}" already exists`);
|
|
@@ -4012,7 +4105,7 @@ class qo extends It {
|
|
|
4012
4105
|
return this.priority;
|
|
4013
4106
|
}
|
|
4014
4107
|
}
|
|
4015
|
-
class
|
|
4108
|
+
class Qo extends ft {
|
|
4016
4109
|
/**
|
|
4017
4110
|
* Instance a set of objects for the given model. This method is used internally.
|
|
4018
4111
|
* @private
|
|
@@ -4032,7 +4125,7 @@ class Jo extends ft {
|
|
|
4032
4125
|
* @returns The instanced object.
|
|
4033
4126
|
*/
|
|
4034
4127
|
new(t, e, a, l, n, i) {
|
|
4035
|
-
const r = new
|
|
4128
|
+
const r = new Jo(
|
|
4036
4129
|
this.model,
|
|
4037
4130
|
t,
|
|
4038
4131
|
e,
|
|
@@ -4048,9 +4141,9 @@ class Jo extends ft {
|
|
|
4048
4141
|
e && (super.remove(t), e.updateInView());
|
|
4049
4142
|
}
|
|
4050
4143
|
}
|
|
4051
|
-
class
|
|
4144
|
+
class qe {
|
|
4052
4145
|
constructor(t, e, a, l, n, i = []) {
|
|
4053
|
-
this.nodes = new
|
|
4146
|
+
this.nodes = new Oo(this), this.sections = new Vo(this), this.ports = new Do(this), this.connections = new Mo(this), this.fields = new To(this), this.objects = new Qo(this), this.decorators = new qo(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = n, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new te(i), this);
|
|
4054
4147
|
}
|
|
4055
4148
|
/**
|
|
4056
4149
|
* Deletes everything in this diagram.
|
|
@@ -4060,7 +4153,7 @@ class Ke {
|
|
|
4060
4153
|
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();
|
|
4061
4154
|
}
|
|
4062
4155
|
}
|
|
4063
|
-
const vt = (s) => !!s.button,
|
|
4156
|
+
const vt = (s) => !!s.button, de = (s, t, e, a, l, n, i, r) => uo(
|
|
4064
4157
|
s,
|
|
4065
4158
|
[t, e],
|
|
4066
4159
|
a,
|
|
@@ -4073,17 +4166,17 @@ const vt = (s) => !!s.button, le = (s, t, e, a, l, n, i, r) => fo(
|
|
|
4073
4166
|
) * n
|
|
4074
4167
|
), S = (s) => {
|
|
4075
4168
|
s ? x.select("body").style("cursor", s) : x.select("body").style("cursor", L.Auto);
|
|
4076
|
-
}, ct = (s) => s instanceof z ? s : s instanceof D ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof D || s.rootElement instanceof bt ? ct(s.rootElement) : s,
|
|
4169
|
+
}, ct = (s) => s instanceof z ? s : s instanceof D ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof D || s.rootElement instanceof bt ? ct(s.rootElement) : s, ce = (s) => {
|
|
4077
4170
|
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");
|
|
4078
|
-
},
|
|
4171
|
+
}, zt = {
|
|
4079
4172
|
fillColor: "#FFFFFF",
|
|
4080
4173
|
borderColor: "#000000",
|
|
4081
4174
|
borderThickness: 1,
|
|
4082
|
-
borderStyle:
|
|
4083
|
-
},
|
|
4175
|
+
borderStyle: be.Solid
|
|
4176
|
+
}, he = (s) => {
|
|
4084
4177
|
s.filter(".shaped-look").select("path").attr(
|
|
4085
4178
|
"d",
|
|
4086
|
-
(t) =>
|
|
4179
|
+
(t) => me(
|
|
4087
4180
|
t.look.shape || Tt.Rectangle,
|
|
4088
4181
|
0,
|
|
4089
4182
|
0,
|
|
@@ -4092,18 +4185,18 @@ const vt = (s) => !!s.button, le = (s, t, e, a, l, n, i, r) => fo(
|
|
|
4092
4185
|
)
|
|
4093
4186
|
).attr(
|
|
4094
4187
|
"fill",
|
|
4095
|
-
(t) => t.look.fillColor ||
|
|
4188
|
+
(t) => t.look.fillColor || zt.fillColor
|
|
4096
4189
|
).attr(
|
|
4097
4190
|
"stroke",
|
|
4098
|
-
(t) => t.look.borderColor ||
|
|
4191
|
+
(t) => t.look.borderColor || zt.borderColor
|
|
4099
4192
|
).attr(
|
|
4100
4193
|
"stroke-width",
|
|
4101
|
-
(t) => `${t.look.borderThickness ||
|
|
4194
|
+
(t) => `${t.look.borderThickness || zt.borderThickness}px`
|
|
4102
4195
|
).attr(
|
|
4103
4196
|
"stroke-dasharray",
|
|
4104
|
-
(t) =>
|
|
4105
|
-
t.look.borderStyle ||
|
|
4106
|
-
t.type?.defaultLook?.borderThickness || t.look?.borderThickness ||
|
|
4197
|
+
(t) => pe(
|
|
4198
|
+
t.look.borderStyle || zt.borderStyle,
|
|
4199
|
+
t.type?.defaultLook?.borderThickness || t.look?.borderThickness || zt.borderThickness
|
|
4107
4200
|
)
|
|
4108
4201
|
), s.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("href", (t) => t.look.backgroundImage), s.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (t) => t.look.leftMargin).attr("height", (t) => t.look.topMargin).attr(
|
|
4109
4202
|
"href",
|
|
@@ -4142,13 +4235,13 @@ const vt = (s) => !!s.button, le = (s, t, e, a, l, n, i, r) => fo(
|
|
|
4142
4235
|
"href",
|
|
4143
4236
|
(t) => t.look.backgroundImageBottomRight
|
|
4144
4237
|
);
|
|
4145
|
-
},
|
|
4238
|
+
}, Rt = {
|
|
4146
4239
|
style: "dots",
|
|
4147
4240
|
color: "rgba(0, 0, 0, 0.1)",
|
|
4148
4241
|
snap: !1,
|
|
4149
4242
|
spacing: 10,
|
|
4150
4243
|
thickness: 0.05
|
|
4151
|
-
},
|
|
4244
|
+
}, ti = (s, t, e) => {
|
|
4152
4245
|
const a = t.append("defs");
|
|
4153
4246
|
if (s.gridSize > 0 && isFinite(s.gridSize)) {
|
|
4154
4247
|
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");
|
|
@@ -4168,17 +4261,17 @@ const vt = (s) => !!s.button, le = (s, t, e, a, l, n, i, r) => fo(
|
|
|
4168
4261
|
}
|
|
4169
4262
|
t.select("rect").attr("fill", `url(#${e})`);
|
|
4170
4263
|
}
|
|
4171
|
-
},
|
|
4264
|
+
}, ve = 96, j = 32, xt = ve + j, ei = Math.PI / 4, oi = 100, Pe = {
|
|
4172
4265
|
customButtons: []
|
|
4173
4266
|
};
|
|
4174
|
-
class
|
|
4267
|
+
class ii {
|
|
4175
4268
|
/**
|
|
4176
4269
|
* Constructs a context menu object.
|
|
4177
4270
|
* @public
|
|
4178
4271
|
* @param canvas A canvas.
|
|
4179
4272
|
*/
|
|
4180
4273
|
constructor(t, e) {
|
|
4181
|
-
this.canvas = t, this.config = e ||
|
|
4274
|
+
this.canvas = t, this.config = e || Pe;
|
|
4182
4275
|
}
|
|
4183
4276
|
/**
|
|
4184
4277
|
* Opens the context menu at the location determined by the given mouse event.
|
|
@@ -4221,7 +4314,7 @@ class oi {
|
|
|
4221
4314
|
i.userSelection.removeFromModel(), i.cancelAllUserActions();
|
|
4222
4315
|
}
|
|
4223
4316
|
});
|
|
4224
|
-
for (const i of this.config.customButtons ||
|
|
4317
|
+
for (const i of this.config.customButtons || Pe.customButtons)
|
|
4225
4318
|
(i.condition === void 0 || i.condition(this.canvas)) && n.push(i);
|
|
4226
4319
|
n.length === 0 && n.push({
|
|
4227
4320
|
name: "NONE",
|
|
@@ -4229,7 +4322,7 @@ class oi {
|
|
|
4229
4322
|
onPress: void 0
|
|
4230
4323
|
});
|
|
4231
4324
|
for (let i = 0; i < n.length; ++i) {
|
|
4232
|
-
const r = n[i], o = r.onPress, d = (i + 0.5 - n.length / 2) *
|
|
4325
|
+
const r = n[i], o = r.onPress, d = (i + 0.5 - n.length / 2) * ei, c = l.append("xhtml:div").attr(
|
|
4233
4326
|
"class",
|
|
4234
4327
|
`daga-context-menu-button ${r.onPress !== void 0 ? " daga-clickable" : ""}`
|
|
4235
4328
|
).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) => {
|
|
@@ -4237,14 +4330,14 @@ class oi {
|
|
|
4237
4330
|
}).on($.KeyDown, (h) => {
|
|
4238
4331
|
o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
|
|
4239
4332
|
});
|
|
4240
|
-
r.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", r.imageClass) : r.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", r.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(r.name), c.transition().ease(x.easeLinear).duration(
|
|
4333
|
+
r.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", r.imageClass) : r.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", r.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(r.name), c.transition().ease(x.easeLinear).duration(oi).tween("progress", () => (h) => {
|
|
4241
4334
|
const f = d * h;
|
|
4242
4335
|
return c.style(
|
|
4243
4336
|
"left",
|
|
4244
|
-
`${Math.sin(f) *
|
|
4337
|
+
`${Math.sin(f) * ve - j + xt}px`
|
|
4245
4338
|
).style(
|
|
4246
4339
|
"top",
|
|
4247
|
-
`${-Math.cos(f) *
|
|
4340
|
+
`${-Math.cos(f) * ve - j + xt}px`
|
|
4248
4341
|
);
|
|
4249
4342
|
});
|
|
4250
4343
|
}
|
|
@@ -4257,7 +4350,7 @@ class oi {
|
|
|
4257
4350
|
this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
|
|
4258
4351
|
}
|
|
4259
4352
|
}
|
|
4260
|
-
class
|
|
4353
|
+
class si extends ft {
|
|
4261
4354
|
/**
|
|
4262
4355
|
* Constructs a user highlight object.
|
|
4263
4356
|
* @public
|
|
@@ -4279,7 +4372,7 @@ class ii extends ft {
|
|
|
4279
4372
|
* @param element
|
|
4280
4373
|
*/
|
|
4281
4374
|
focusOn(t) {
|
|
4282
|
-
this.clear(), this.focus = t, (t instanceof ht || t instanceof
|
|
4375
|
+
this.clear(), this.focus = t, (t instanceof ht || t instanceof Ke) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
|
|
4283
4376
|
}
|
|
4284
4377
|
add(t) {
|
|
4285
4378
|
if (super.add(t), t instanceof z) {
|
|
@@ -4311,13 +4404,13 @@ class ii extends ft {
|
|
|
4311
4404
|
this.focus = void 0;
|
|
4312
4405
|
}
|
|
4313
4406
|
}
|
|
4314
|
-
const
|
|
4315
|
-
class
|
|
4407
|
+
const ni = 1;
|
|
4408
|
+
class Je {
|
|
4316
4409
|
export(t, e = !1) {
|
|
4317
4410
|
const a = {
|
|
4318
4411
|
name: t.name,
|
|
4319
4412
|
type: t.type,
|
|
4320
|
-
typeVersion:
|
|
4413
|
+
typeVersion: ni,
|
|
4321
4414
|
createdAt: t.createdAt,
|
|
4322
4415
|
updatedAt: t.updatedAt,
|
|
4323
4416
|
nodes: [],
|
|
@@ -4455,17 +4548,17 @@ class qe {
|
|
|
4455
4548
|
} : {};
|
|
4456
4549
|
}
|
|
4457
4550
|
}
|
|
4458
|
-
const
|
|
4459
|
-
class
|
|
4551
|
+
const ri = "Diagram properties";
|
|
4552
|
+
class ai extends ft {
|
|
4460
4553
|
/**
|
|
4461
4554
|
* Constructs a user selection object.
|
|
4462
4555
|
* @public
|
|
4463
4556
|
* @param canvas A canvas.
|
|
4464
4557
|
*/
|
|
4465
|
-
constructor(t) {
|
|
4466
|
-
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(
|
|
4558
|
+
constructor(t, e) {
|
|
4559
|
+
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(ao(2e3)).subscribe(() => {
|
|
4467
4560
|
this.makeUpdateValuesAction();
|
|
4468
|
-
});
|
|
4561
|
+
}), console.log(e), this.diagramPropertiesText = e !== void 0 ? e : ri;
|
|
4469
4562
|
}
|
|
4470
4563
|
add(t) {
|
|
4471
4564
|
if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof dt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof D ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
|
|
@@ -4514,7 +4607,7 @@ class ri extends ft {
|
|
|
4514
4607
|
const t = [], e = [], a = [], l = [], n = [];
|
|
4515
4608
|
for (const r of this.all())
|
|
4516
4609
|
r instanceof z ? t.push(r.id) : r instanceof D ? e.push(r.id) : r instanceof bt ? a.push(r.id) : r instanceof dt ? l.push(r.id) : r instanceof ht && n.push(r.id);
|
|
4517
|
-
const i = new
|
|
4610
|
+
const i = new Zo(
|
|
4518
4611
|
this.canvas,
|
|
4519
4612
|
t,
|
|
4520
4613
|
e,
|
|
@@ -4530,7 +4623,7 @@ class ri extends ft {
|
|
|
4530
4623
|
* @public
|
|
4531
4624
|
*/
|
|
4532
4625
|
copyToClipboard() {
|
|
4533
|
-
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new
|
|
4626
|
+
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Je();
|
|
4534
4627
|
for (const a of this.all())
|
|
4535
4628
|
a instanceof z && t.nodes.push(e.exportNode(a, !1)), a instanceof dt && t.connections.push(
|
|
4536
4629
|
e.exportConnection(a, !1)
|
|
@@ -4554,7 +4647,7 @@ class ri extends ft {
|
|
|
4554
4647
|
const a = JSON.parse(e);
|
|
4555
4648
|
if (a.type !== "daga-user-selection")
|
|
4556
4649
|
return;
|
|
4557
|
-
const l = new
|
|
4650
|
+
const l = new Ko(
|
|
4558
4651
|
this.canvas,
|
|
4559
4652
|
a.nodes,
|
|
4560
4653
|
a.connections,
|
|
@@ -4580,26 +4673,22 @@ class ri extends ft {
|
|
|
4580
4673
|
if (a === void 0)
|
|
4581
4674
|
return;
|
|
4582
4675
|
const l = t?.valueSet;
|
|
4583
|
-
l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues =
|
|
4584
|
-
l.getValues()
|
|
4585
|
-
)), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = ni, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
|
|
4676
|
+
l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Nt(l.getValues())), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
|
|
4586
4677
|
}
|
|
4587
4678
|
makeUpdateValuesAction() {
|
|
4588
4679
|
if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
|
|
4589
4680
|
return;
|
|
4590
|
-
const t = this.propertyEditorSelection instanceof
|
|
4681
|
+
const t = this.propertyEditorSelection instanceof qe ? void 0 : this.propertyEditorSelection.id;
|
|
4591
4682
|
if (St(
|
|
4592
4683
|
this.propertyEditorValues,
|
|
4593
4684
|
this.propertyEditorSelection?.valueSet.getValues()
|
|
4594
4685
|
))
|
|
4595
4686
|
return;
|
|
4596
|
-
const e = this.propertyEditorValues, a =
|
|
4597
|
-
this.propertyEditorSelection?.valueSet.getValues()
|
|
4598
|
-
), [l, n] = Ge(
|
|
4687
|
+
const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, n] = Fe(
|
|
4599
4688
|
e,
|
|
4600
4689
|
a,
|
|
4601
4690
|
this.propertyEditorSelection?.valueSet
|
|
4602
|
-
), i = new
|
|
4691
|
+
), i = new Wo(
|
|
4603
4692
|
this.canvas,
|
|
4604
4693
|
t,
|
|
4605
4694
|
l,
|
|
@@ -4608,10 +4697,10 @@ class ri extends ft {
|
|
|
4608
4697
|
i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
|
|
4609
4698
|
}
|
|
4610
4699
|
}
|
|
4611
|
-
const
|
|
4612
|
-
const a =
|
|
4700
|
+
const li = (s) => s * Math.PI / 180, ze = (s, t, e) => {
|
|
4701
|
+
const a = li(e), l = Math.sin(a), n = Math.cos(a), i = (Math.abs(s * n) - Math.abs(t * l)) / (n * n - l * l), r = (Math.abs(s * l) - Math.abs(t * n)) / (l * l - n * n);
|
|
4613
4702
|
return [i, r];
|
|
4614
|
-
},
|
|
4703
|
+
}, di = 12, H = 6, ci = 25, ge = "diagram-connection-unfinished", Jt = class Jt {
|
|
4615
4704
|
/**
|
|
4616
4705
|
* Constructs a canvas object.
|
|
4617
4706
|
* @public
|
|
@@ -4619,21 +4708,24 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4619
4708
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
4620
4709
|
*/
|
|
4621
4710
|
constructor(t, e) {
|
|
4622
|
-
if (this.backgroundPatternId = `daga-background-pattern-id-${
|
|
4711
|
+
if (this.backgroundPatternId = `daga-background-pattern-id-${Jt.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Xt(), this.diagramChange$ = new Xt(), this.diagramEvent$ = new Xt(), this.propertyEditorChanges$ = new Xt(), this.parentComponent = t, this.model = new qe(
|
|
4623
4712
|
this,
|
|
4624
4713
|
void 0,
|
|
4625
4714
|
e.name || "unnamed",
|
|
4626
4715
|
"",
|
|
4627
4716
|
e.type || "",
|
|
4628
4717
|
e.properties || []
|
|
4629
|
-
), this.userSelection = new
|
|
4718
|
+
), this.userSelection = new ai(
|
|
4719
|
+
this,
|
|
4720
|
+
e.components?.propertyEditor?.title
|
|
4721
|
+
), this.userHighlight = new si(
|
|
4630
4722
|
this,
|
|
4631
4723
|
e.canvas?.highlightSections !== !1
|
|
4632
|
-
), this.contextMenu = new
|
|
4633
|
-
e.canvas?.grid?.thickness ||
|
|
4634
|
-
), this.gridColor = e.canvas?.grid?.color ||
|
|
4724
|
+
), this.contextMenu = new ii(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Rt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Rt.spacing), this.gridThickness = Math.abs(
|
|
4725
|
+
e.canvas?.grid?.thickness || Rt.thickness
|
|
4726
|
+
), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Yo(this, ci), this.collabEngine = new Bo(this), e.nodeTypes)
|
|
4635
4727
|
for (const a of e.nodeTypes) {
|
|
4636
|
-
const l = new
|
|
4728
|
+
const l = new Be({
|
|
4637
4729
|
...e.nodeTypeDefaults,
|
|
4638
4730
|
...a
|
|
4639
4731
|
});
|
|
@@ -4641,7 +4733,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4641
4733
|
}
|
|
4642
4734
|
if (e.portTypes)
|
|
4643
4735
|
for (const a of e.portTypes) {
|
|
4644
|
-
const l = new
|
|
4736
|
+
const l = new Uo({
|
|
4645
4737
|
...e.portTypeDefaults,
|
|
4646
4738
|
...a
|
|
4647
4739
|
});
|
|
@@ -4649,7 +4741,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4649
4741
|
}
|
|
4650
4742
|
if (e.connectionTypes) {
|
|
4651
4743
|
for (const a of e.connectionTypes) {
|
|
4652
|
-
const l = new
|
|
4744
|
+
const l = new Ue({
|
|
4653
4745
|
...e.connectionTypeDefaults,
|
|
4654
4746
|
...a
|
|
4655
4747
|
});
|
|
@@ -4737,7 +4829,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4737
4829
|
});
|
|
4738
4830
|
const a = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
|
|
4739
4831
|
a.call(
|
|
4740
|
-
this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(
|
|
4832
|
+
this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(fe.Zoom, (l) => {
|
|
4741
4833
|
if (l.sourceEvent) {
|
|
4742
4834
|
if (!this.canUserPerformAction(w.Zoom)) {
|
|
4743
4835
|
S(L.NotAllowed);
|
|
@@ -4751,7 +4843,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4751
4843
|
"patternTransform",
|
|
4752
4844
|
n
|
|
4753
4845
|
), this.contextMenu.close();
|
|
4754
|
-
}).on(
|
|
4846
|
+
}).on(fe.End, () => {
|
|
4755
4847
|
S();
|
|
4756
4848
|
})
|
|
4757
4849
|
), 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) => {
|
|
@@ -4766,8 +4858,9 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4766
4858
|
const l = this.userSelection.all();
|
|
4767
4859
|
this.userSelection.clear(), this.diagramEvent$.next(
|
|
4768
4860
|
new G(l, !1)
|
|
4769
|
-
)
|
|
4861
|
+
);
|
|
4770
4862
|
}
|
|
4863
|
+
this.userSelection.openInPropertyEditor(this.model);
|
|
4771
4864
|
}).call(
|
|
4772
4865
|
x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(I.Start, (l) => {
|
|
4773
4866
|
this.startMultipleSelection(l);
|
|
@@ -4776,7 +4869,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4776
4869
|
}).on(I.End, (l) => {
|
|
4777
4870
|
this.finishMultipleSelection(l);
|
|
4778
4871
|
})
|
|
4779
|
-
),
|
|
4872
|
+
), ti(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
|
|
4780
4873
|
}
|
|
4781
4874
|
getZoomLevel() {
|
|
4782
4875
|
return this.zoomTransform.k;
|
|
@@ -4910,7 +5003,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
4910
5003
|
}).on(I.End, (i, r) => {
|
|
4911
5004
|
this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, r), this.secondaryButton = !1;
|
|
4912
5005
|
})
|
|
4913
|
-
),
|
|
5006
|
+
), ce(
|
|
4914
5007
|
l
|
|
4915
5008
|
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, r) => {
|
|
4916
5009
|
this.canUserPerformAction(w.StretchNode) && r.type.resizableX && !r.removed && S(L.EWResize);
|
|
@@ -5030,7 +5123,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5030
5123
|
}
|
|
5031
5124
|
S();
|
|
5032
5125
|
})
|
|
5033
|
-
), n.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5126
|
+
), n.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5034
5127
|
n
|
|
5035
5128
|
), n.filter(".resizable-x").select("line.left-resizer").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), n.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), n.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), n.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);
|
|
5036
5129
|
}
|
|
@@ -5103,7 +5196,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5103
5196
|
}
|
|
5104
5197
|
this.secondaryButton = !1;
|
|
5105
5198
|
})
|
|
5106
|
-
),
|
|
5199
|
+
), ce(
|
|
5107
5200
|
l
|
|
5108
5201
|
), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, r) => {
|
|
5109
5202
|
this.canUserPerformAction(w.StretchSection) && r.getResizableX() && !r.removed && S(L.EWResize);
|
|
@@ -5245,7 +5338,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5245
5338
|
}
|
|
5246
5339
|
S();
|
|
5247
5340
|
})
|
|
5248
|
-
), n.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5341
|
+
), n.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5249
5342
|
n
|
|
5250
5343
|
), n.filter(".resizable-x").select("line.left-resizer").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), n.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), n.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), n.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);
|
|
5251
5344
|
}
|
|
@@ -5315,7 +5408,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5315
5408
|
const o = [i.x, i.y];
|
|
5316
5409
|
this.unfinishedConnectionTracer?.attr(
|
|
5317
5410
|
"d",
|
|
5318
|
-
|
|
5411
|
+
de(
|
|
5319
5412
|
this.unfinishedConnection.look.shape || et.look.shape,
|
|
5320
5413
|
this.unfinishedConnection.startCoords,
|
|
5321
5414
|
o,
|
|
@@ -5340,7 +5433,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5340
5433
|
];
|
|
5341
5434
|
} else
|
|
5342
5435
|
this.unfinishedConnection.endCoords = o;
|
|
5343
|
-
if (this.updateConnectionsInView(
|
|
5436
|
+
if (this.updateConnectionsInView(ge), this.model.ports.length > 0) {
|
|
5344
5437
|
const c = this.getPointerLocationRelativeToCanvas(i);
|
|
5345
5438
|
let h = Number.POSITIVE_INFINITY, f;
|
|
5346
5439
|
for (const y of this.model.ports) {
|
|
@@ -5383,12 +5476,12 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5383
5476
|
}
|
|
5384
5477
|
this.secondaryButton = !1;
|
|
5385
5478
|
})
|
|
5386
|
-
), l.filter(".image-look").append("image"),
|
|
5479
|
+
), l.filter(".image-look").append("image"), ce(
|
|
5387
5480
|
l
|
|
5388
5481
|
), n.attr(
|
|
5389
5482
|
"transform",
|
|
5390
5483
|
(i) => `translate(${i.coords[0] - i.width / 2},${i.coords[1] - i.width / 2})`
|
|
5391
|
-
).attr("opacity", (i) => i.removed ? 0.5 : 1),
|
|
5484
|
+
).attr("opacity", (i) => i.removed ? 0.5 : 1), he(
|
|
5392
5485
|
n
|
|
5393
5486
|
);
|
|
5394
5487
|
}
|
|
@@ -5431,7 +5524,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5431
5524
|
})
|
|
5432
5525
|
), n.append("path").attr("class", "diagram-connection-path"), n.append("path").attr("class", "diagram-connection-path-box"), n.append("marker").attr("id", (r) => `${r.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), n.append("marker").attr("id", (r) => `${r.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), n.append("g").attr("class", "diagram-connection-start-label"), n.select("g.diagram-connection-start-label").append("path"), n.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), n.append("g").attr("class", "diagram-connection-middle-label"), n.select("g.diagram-connection-middle-label").append("path"), n.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), n.append("g").attr("class", "diagram-connection-end-label"), n.select("g.diagram-connection-end-label").append("path"), n.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), i.attr("opacity", (r) => r.removed ? 0.5 : 1).select("path.diagram-connection-path").attr(
|
|
5433
5526
|
"d",
|
|
5434
|
-
(r) =>
|
|
5527
|
+
(r) => de(
|
|
5435
5528
|
r.look.shape || et.look.shape,
|
|
5436
5529
|
r.startCoords,
|
|
5437
5530
|
r.endCoords,
|
|
@@ -5446,13 +5539,13 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5446
5539
|
(r) => r.look.color || et.look.color
|
|
5447
5540
|
).attr("stroke-width", (r) => `${r.look.thickness}px`).attr(
|
|
5448
5541
|
"stroke-dasharray",
|
|
5449
|
-
(r) =>
|
|
5542
|
+
(r) => pe(
|
|
5450
5543
|
r.look.style || et.look.style,
|
|
5451
5544
|
r.type.defaultLook.thickness || et.look.thickness
|
|
5452
5545
|
)
|
|
5453
5546
|
).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
|
|
5454
5547
|
"d",
|
|
5455
|
-
(r) =>
|
|
5548
|
+
(r) => de(
|
|
5456
5549
|
r.look.shape || et.look.shape,
|
|
5457
5550
|
r.startCoords,
|
|
5458
5551
|
r.endCoords,
|
|
@@ -5464,10 +5557,10 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5464
5557
|
)
|
|
5465
5558
|
).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
|
|
5466
5559
|
"stroke-width",
|
|
5467
|
-
(r) => `${(r.look.thickness || et.look.thickness) +
|
|
5560
|
+
(r) => `${(r.look.thickness || et.look.thickness) + di}px`
|
|
5468
5561
|
).attr(
|
|
5469
5562
|
"stroke-dasharray",
|
|
5470
|
-
(r) =>
|
|
5563
|
+
(r) => pe(
|
|
5471
5564
|
r.look.style || et.look.style,
|
|
5472
5565
|
r.type.defaultLook.thickness || et.look.thickness
|
|
5473
5566
|
)
|
|
@@ -5518,7 +5611,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5518
5611
|
}
|
|
5519
5612
|
}).on($.DoubleClick, (i, r) => {
|
|
5520
5613
|
const o = new pt(i, r);
|
|
5521
|
-
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && r.editable && !r.removed && (this.currentAction = new
|
|
5614
|
+
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && r.editable && !r.removed && (this.currentAction = new Ne(this, r.id, r.text, ""), this.createInputField(
|
|
5522
5615
|
r.text,
|
|
5523
5616
|
r.coords,
|
|
5524
5617
|
r.width,
|
|
@@ -5529,7 +5622,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5529
5622
|
(d) => {
|
|
5530
5623
|
},
|
|
5531
5624
|
(d) => {
|
|
5532
|
-
r.text = d, this.currentAction instanceof
|
|
5625
|
+
r.text = d, this.currentAction instanceof Ne && (this.currentAction.to = d, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
|
|
5533
5626
|
}
|
|
5534
5627
|
));
|
|
5535
5628
|
}).call(
|
|
@@ -5561,13 +5654,13 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5561
5654
|
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
|
|
5562
5655
|
).style(
|
|
5563
5656
|
"align-items",
|
|
5564
|
-
(i) => i.verticalAlign ===
|
|
5657
|
+
(i) => i.verticalAlign === Kt.Center ? "center" : i.verticalAlign === Kt.Bottom ? "end" : "start"
|
|
5565
5658
|
).select("p").style(
|
|
5566
5659
|
"max-width",
|
|
5567
|
-
(i) => i.fit ? "default" : `${
|
|
5660
|
+
(i) => i.fit ? "default" : `${ze(i.width, i.height, i.orientation)[0]}px`
|
|
5568
5661
|
).style(
|
|
5569
5662
|
"max-height",
|
|
5570
|
-
(i) => i.fit ? "default" : `${
|
|
5663
|
+
(i) => i.fit ? "default" : `${ze(i.width, i.height, i.orientation)[1]}px`
|
|
5571
5664
|
).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
|
|
5572
5665
|
"text-align",
|
|
5573
5666
|
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "end" : "start"
|
|
@@ -5685,7 +5778,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5685
5778
|
}
|
|
5686
5779
|
updateConnectionLabelsInView(t) {
|
|
5687
5780
|
const e = this.selectCanvasView().select(
|
|
5688
|
-
`[id='${
|
|
5781
|
+
`[id='${ue(t.id)}']`
|
|
5689
5782
|
), l = e.select("path").node(), n = {
|
|
5690
5783
|
...V,
|
|
5691
5784
|
...t.type.label
|
|
@@ -5735,7 +5828,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5735
5828
|
).style("font-kerning", "none").text(t.startLabel);
|
|
5736
5829
|
const y = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
|
|
5737
5830
|
if (y) {
|
|
5738
|
-
const u = t.startLabel ? y.width / this.zoomTransform.k +
|
|
5831
|
+
const u = t.startLabel ? y.width / this.zoomTransform.k + Ot(n) + Ht(n) : 0, k = t.startLabel ? y.height / this.zoomTransform.k + _t(n) + Vt(n) : 0;
|
|
5739
5832
|
let b;
|
|
5740
5833
|
switch (t.startDirection) {
|
|
5741
5834
|
case g.Left:
|
|
@@ -5770,7 +5863,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5770
5863
|
}
|
|
5771
5864
|
e.select("g.diagram-connection-start-label path").attr(
|
|
5772
5865
|
"d",
|
|
5773
|
-
|
|
5866
|
+
Zt(
|
|
5774
5867
|
-u / 2,
|
|
5775
5868
|
-k / 2,
|
|
5776
5869
|
u,
|
|
@@ -5787,10 +5880,10 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5787
5880
|
).style("font-kerning", "none").text(t.middleLabel);
|
|
5788
5881
|
const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
|
|
5789
5882
|
if (m) {
|
|
5790
|
-
const u = t.middleLabel ? m.width / this.zoomTransform.k +
|
|
5883
|
+
const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(n) + Ht(n) : 0, k = t.middleLabel ? m.height / this.zoomTransform.k + _t(n) + Vt(n) : 0, b = l.getPointAtLength(i / 2);
|
|
5791
5884
|
e.select("g.diagram-connection-middle-label path").attr(
|
|
5792
5885
|
"d",
|
|
5793
|
-
|
|
5886
|
+
Zt(
|
|
5794
5887
|
-u / 2,
|
|
5795
5888
|
-k / 2,
|
|
5796
5889
|
u,
|
|
@@ -5807,7 +5900,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5807
5900
|
).style("font-kerning", "none").text(t.endLabel);
|
|
5808
5901
|
const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
|
|
5809
5902
|
if (p) {
|
|
5810
|
-
const u = t.endLabel ? p.width / this.zoomTransform.k +
|
|
5903
|
+
const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(n) + Ht(n) : 0, k = t.endLabel ? p.height / this.zoomTransform.k + _t(n) + Vt(n) : 0;
|
|
5811
5904
|
let b;
|
|
5812
5905
|
switch (t.endDirection) {
|
|
5813
5906
|
case g.Left:
|
|
@@ -5842,7 +5935,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5842
5935
|
}
|
|
5843
5936
|
e.select("g.diagram-connection-end-label path").attr(
|
|
5844
5937
|
"d",
|
|
5845
|
-
|
|
5938
|
+
Zt(
|
|
5846
5939
|
-u / 2,
|
|
5847
5940
|
-k / 2,
|
|
5848
5941
|
u,
|
|
@@ -5857,7 +5950,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5857
5950
|
}
|
|
5858
5951
|
updateConnectionMarkersInView(t) {
|
|
5859
5952
|
const e = this.selectCanvasView().select(
|
|
5860
|
-
`[id='${
|
|
5953
|
+
`[id='${ue(t.id)}']`
|
|
5861
5954
|
), a = e.select("marker.diagram-connection-start-marker"), l = e.select("marker.diagram-connection-end-marker");
|
|
5862
5955
|
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);
|
|
5863
5956
|
}
|
|
@@ -5950,7 +6043,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5950
6043
|
this.connectionType,
|
|
5951
6044
|
t,
|
|
5952
6045
|
void 0,
|
|
5953
|
-
|
|
6046
|
+
ge
|
|
5954
6047
|
);
|
|
5955
6048
|
else if (this.inferConnectionType) {
|
|
5956
6049
|
let e = this.model.connections.types.all().find(
|
|
@@ -5963,7 +6056,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5963
6056
|
e,
|
|
5964
6057
|
t,
|
|
5965
6058
|
void 0,
|
|
5966
|
-
|
|
6059
|
+
ge
|
|
5967
6060
|
));
|
|
5968
6061
|
}
|
|
5969
6062
|
}
|
|
@@ -5989,7 +6082,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
5989
6082
|
) && this.unfinishedConnection?.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(
|
|
5990
6083
|
t.getNode()?.type?.id || ""
|
|
5991
6084
|
) && t.allowsIncoming) {
|
|
5992
|
-
const e = new
|
|
6085
|
+
const e = new le(
|
|
5993
6086
|
this,
|
|
5994
6087
|
this.unfinishedConnection.type,
|
|
5995
6088
|
this.unfinishedConnection.start?.id,
|
|
@@ -6001,7 +6094,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6001
6094
|
) && this.unfinishedConnection?.start?.allowsIncoming && this.unfinishedConnection.type.canStartFromType(
|
|
6002
6095
|
t.getNode()?.type?.id || ""
|
|
6003
6096
|
) && t.allowsOutgoing) {
|
|
6004
|
-
const e = new
|
|
6097
|
+
const e = new le(
|
|
6005
6098
|
this,
|
|
6006
6099
|
this.unfinishedConnection.type,
|
|
6007
6100
|
t.id,
|
|
@@ -6019,7 +6112,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6019
6112
|
this.unfinishedConnection?.start?.getNode()?.type?.id || ""
|
|
6020
6113
|
) && this.unfinishedConnection?.start?.allowsIncoming && l.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing
|
|
6021
6114
|
), a = !0), e !== void 0) {
|
|
6022
|
-
const l = new
|
|
6115
|
+
const l = new le(
|
|
6023
6116
|
this,
|
|
6024
6117
|
e,
|
|
6025
6118
|
a ? t.id : this.unfinishedConnection.start?.id,
|
|
@@ -6056,7 +6149,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6056
6149
|
}
|
|
6057
6150
|
}).on($.Input, () => {
|
|
6058
6151
|
const p = h.property("value");
|
|
6059
|
-
h.attr("cols",
|
|
6152
|
+
h.attr("cols", So(p) + 1), h.attr("rows", Co(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, y = h.property("scrollHeight") + 1;
|
|
6060
6153
|
const u = Math.max(f, a), k = Math.max(y, l);
|
|
6061
6154
|
c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${k}px`), h.style("height", `${k}px`), o && o(p);
|
|
6062
6155
|
}).on($.Click, (p) => {
|
|
@@ -6087,7 +6180,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6087
6180
|
startMovingNode(t, e) {
|
|
6088
6181
|
if (this.canUserPerformAction(w.MoveNode) && !e.removed)
|
|
6089
6182
|
if (S(L.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
|
|
6090
|
-
this.currentAction = new
|
|
6183
|
+
this.currentAction = new ae(
|
|
6091
6184
|
this,
|
|
6092
6185
|
this.userSelection.filter((a) => a instanceof z).map((a) => a.id),
|
|
6093
6186
|
e.coords
|
|
@@ -6112,7 +6205,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6112
6205
|
* Method to call to continue the moving of a node triggered by a user drag event.
|
|
6113
6206
|
*/
|
|
6114
6207
|
continueMovingNode(t, e) {
|
|
6115
|
-
if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof
|
|
6208
|
+
if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof ae || this.currentAction instanceof X) && !e.removed) {
|
|
6116
6209
|
const a = [
|
|
6117
6210
|
t.x - e.width / 2,
|
|
6118
6211
|
t.y - e.height / 2
|
|
@@ -6135,7 +6228,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6135
6228
|
if (this.snapToGrid && (a = this.getClosestGridPoint([
|
|
6136
6229
|
a[0] - e.type.snapToGridOffset[0],
|
|
6137
6230
|
a[1] - e.type.snapToGridOffset[1]
|
|
6138
|
-
]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof
|
|
6231
|
+
]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof ae) {
|
|
6139
6232
|
const l = this.currentAction.delta;
|
|
6140
6233
|
this.currentAction.delta = [
|
|
6141
6234
|
a[0] - l[0],
|
|
@@ -6148,11 +6241,11 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6148
6241
|
e.move(a);
|
|
6149
6242
|
const n = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
|
|
6150
6243
|
(o) => o.type.childrenTypes.includes(e.type.id)
|
|
6151
|
-
), i =
|
|
6244
|
+
), i = Ye(
|
|
6152
6245
|
n
|
|
6153
6246
|
), r = i[i.length - 1];
|
|
6154
6247
|
if (r !== e.parent && (e.type.canBeParentless || r !== void 0)) {
|
|
6155
|
-
const o = r?.getLastAncestor(), d = this.currentAction.from, c = new
|
|
6248
|
+
const o = r?.getLastAncestor(), d = this.currentAction.from, c = new jo(
|
|
6156
6249
|
this,
|
|
6157
6250
|
e.id,
|
|
6158
6251
|
e.parent?.id,
|
|
@@ -6198,7 +6291,7 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6198
6291
|
const e = this.getPointerLocationRelativeToCanvas(t);
|
|
6199
6292
|
this.multipleSelectionContainer?.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
|
|
6200
6293
|
for (const a of this.model.nodes)
|
|
6201
|
-
|
|
6294
|
+
go(
|
|
6202
6295
|
[
|
|
6203
6296
|
a.coords,
|
|
6204
6297
|
[a.coords[0] + a.width, a.coords[1] + a.height]
|
|
@@ -6210,9 +6303,9 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
|
|
|
6210
6303
|
), S();
|
|
6211
6304
|
}
|
|
6212
6305
|
};
|
|
6213
|
-
|
|
6214
|
-
let
|
|
6215
|
-
class
|
|
6306
|
+
Jt.canvasCount = 0;
|
|
6307
|
+
let ye = Jt;
|
|
6308
|
+
class Qe {
|
|
6216
6309
|
constructor() {
|
|
6217
6310
|
this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
|
|
6218
6311
|
}
|
|
@@ -6324,16 +6417,16 @@ class Je {
|
|
|
6324
6417
|
}
|
|
6325
6418
|
}
|
|
6326
6419
|
}
|
|
6327
|
-
class
|
|
6420
|
+
class hi {
|
|
6328
6421
|
constructor(t) {
|
|
6329
6422
|
this.gapSize = t;
|
|
6330
6423
|
}
|
|
6331
6424
|
apply(t) {
|
|
6332
6425
|
if (t.nodes.length === 0)
|
|
6333
6426
|
return t;
|
|
6334
|
-
const e = new
|
|
6427
|
+
const e = new Qe(), a = t.nodes.filter((r) => !r.parent);
|
|
6335
6428
|
for (; a.length > 0; )
|
|
6336
|
-
|
|
6429
|
+
to(
|
|
6337
6430
|
a[0],
|
|
6338
6431
|
e,
|
|
6339
6432
|
[0, 0],
|
|
@@ -6351,25 +6444,25 @@ class ci {
|
|
|
6351
6444
|
return t;
|
|
6352
6445
|
}
|
|
6353
6446
|
}
|
|
6354
|
-
const
|
|
6447
|
+
const to = (s, t, e, a) => {
|
|
6355
6448
|
const l = t.getClosestEmptyCoordinate(e);
|
|
6356
6449
|
t.set(l, s), Y(a, s);
|
|
6357
6450
|
for (const n of s.getAdjacentNodes())
|
|
6358
|
-
a.includes(n) &&
|
|
6451
|
+
a.includes(n) && to(
|
|
6359
6452
|
n,
|
|
6360
6453
|
t,
|
|
6361
6454
|
l,
|
|
6362
6455
|
a
|
|
6363
6456
|
);
|
|
6364
6457
|
};
|
|
6365
|
-
class
|
|
6458
|
+
class gi {
|
|
6366
6459
|
constructor(t) {
|
|
6367
6460
|
this.gapSize = t;
|
|
6368
6461
|
}
|
|
6369
6462
|
apply(t) {
|
|
6370
6463
|
if (t.nodes.length === 0)
|
|
6371
6464
|
return t;
|
|
6372
|
-
const e = new
|
|
6465
|
+
const e = new Qe(), a = t.nodes.filter((c) => !c.parent), l = {}, n = a[0];
|
|
6373
6466
|
let i = [n];
|
|
6374
6467
|
for (l[n.id] = [0, 0]; a.length > 0; ) {
|
|
6375
6468
|
const c = [];
|
|
@@ -6403,7 +6496,7 @@ class hi {
|
|
|
6403
6496
|
return t;
|
|
6404
6497
|
}
|
|
6405
6498
|
}
|
|
6406
|
-
class
|
|
6499
|
+
class ne {
|
|
6407
6500
|
constructor(t) {
|
|
6408
6501
|
this.gapSize = t;
|
|
6409
6502
|
}
|
|
@@ -6437,14 +6530,14 @@ class se {
|
|
|
6437
6530
|
return t;
|
|
6438
6531
|
}
|
|
6439
6532
|
}
|
|
6440
|
-
class
|
|
6533
|
+
class fi {
|
|
6441
6534
|
constructor(t) {
|
|
6442
6535
|
this.gapSize = t;
|
|
6443
6536
|
}
|
|
6444
6537
|
apply(t) {
|
|
6445
6538
|
if (t.nodes.length === 0)
|
|
6446
6539
|
return t;
|
|
6447
|
-
new
|
|
6540
|
+
new ne(this.gapSize).apply(t);
|
|
6448
6541
|
const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, a = 0.99, l = 1, n = 0.1, i = 2e5, r = 0.5, o = 1, d = 2e-3;
|
|
6449
6542
|
let c = 100;
|
|
6450
6543
|
for (; c > l; ) {
|
|
@@ -6464,7 +6557,7 @@ class gi {
|
|
|
6464
6557
|
], u = [
|
|
6465
6558
|
m.coords[0] + m.width / 2,
|
|
6466
6559
|
m.coords[1] + m.height / 2
|
|
6467
|
-
], k =
|
|
6560
|
+
], k = He(
|
|
6468
6561
|
f.coords,
|
|
6469
6562
|
m.coords
|
|
6470
6563
|
), b = [m.coords[0], m.coords[1]];
|
|
@@ -6490,7 +6583,7 @@ class gi {
|
|
|
6490
6583
|
return t;
|
|
6491
6584
|
}
|
|
6492
6585
|
}
|
|
6493
|
-
class
|
|
6586
|
+
class ui {
|
|
6494
6587
|
constructor(t) {
|
|
6495
6588
|
this.gapSize = t;
|
|
6496
6589
|
}
|
|
@@ -6505,7 +6598,7 @@ class fi {
|
|
|
6505
6598
|
return t;
|
|
6506
6599
|
}
|
|
6507
6600
|
}
|
|
6508
|
-
class
|
|
6601
|
+
class pi {
|
|
6509
6602
|
constructor(t) {
|
|
6510
6603
|
this.gapSize = t;
|
|
6511
6604
|
}
|
|
@@ -6518,7 +6611,7 @@ class ui {
|
|
|
6518
6611
|
...t.nodes.map((c) => c.getPriority())
|
|
6519
6612
|
);
|
|
6520
6613
|
if (e === a)
|
|
6521
|
-
return new
|
|
6614
|
+
return new ne(this.gapSize).apply(t), t;
|
|
6522
6615
|
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, n = t.nodes.filter((c) => !c.parent), i = [], r = t.nodes.filter((c) => !c.parent).filter((c) => c.getPriority() >= e), o = [];
|
|
6523
6616
|
if (r.length > 1) {
|
|
6524
6617
|
const c = r[0];
|
|
@@ -6572,7 +6665,7 @@ class ui {
|
|
|
6572
6665
|
return t;
|
|
6573
6666
|
}
|
|
6574
6667
|
}
|
|
6575
|
-
class
|
|
6668
|
+
class mi {
|
|
6576
6669
|
constructor(t) {
|
|
6577
6670
|
this.gapSize = t;
|
|
6578
6671
|
}
|
|
@@ -6585,17 +6678,17 @@ class pi {
|
|
|
6585
6678
|
...t.nodes.map((c) => c.getPriority())
|
|
6586
6679
|
);
|
|
6587
6680
|
if (e === a)
|
|
6588
|
-
return new
|
|
6681
|
+
return new ne(this.gapSize).apply(t), t;
|
|
6589
6682
|
const l = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2, n = t.nodes.filter((c) => !c.parent).sort((c, h) => h.getPriority() - c.getPriority()), i = [];
|
|
6590
6683
|
for (; n.length > 0; ) {
|
|
6591
6684
|
const c = n[0];
|
|
6592
6685
|
n.splice(0, 1);
|
|
6593
|
-
const h = new
|
|
6594
|
-
|
|
6686
|
+
const h = new Se(void 0, c);
|
|
6687
|
+
eo(h, n), i.push(h);
|
|
6595
6688
|
}
|
|
6596
6689
|
const r = [];
|
|
6597
6690
|
for (const c of i)
|
|
6598
|
-
r.push([c]),
|
|
6691
|
+
r.push([c]), oo(c, r, r.length);
|
|
6599
6692
|
const o = Math.max(...t.nodes.map((c) => c.height));
|
|
6600
6693
|
let d = 0;
|
|
6601
6694
|
for (let c = 0; c < r.length; ++c) {
|
|
@@ -6614,29 +6707,29 @@ class pi {
|
|
|
6614
6707
|
return t;
|
|
6615
6708
|
}
|
|
6616
6709
|
}
|
|
6617
|
-
const
|
|
6710
|
+
const eo = (s, t) => {
|
|
6618
6711
|
for (const e of s.node.getAdjacentNodes().sort((a, l) => l.getPriority() - a.getPriority())) {
|
|
6619
6712
|
const a = t.indexOf(e);
|
|
6620
6713
|
if (a >= 0) {
|
|
6621
6714
|
t.splice(a, 1);
|
|
6622
6715
|
const l = s.addBranch(e);
|
|
6623
|
-
|
|
6716
|
+
eo(l, t);
|
|
6624
6717
|
}
|
|
6625
6718
|
}
|
|
6626
|
-
},
|
|
6719
|
+
}, oo = (s, t, e) => {
|
|
6627
6720
|
if (s.branches.length > 0) {
|
|
6628
6721
|
for (; e >= t.length; )
|
|
6629
6722
|
t.push([]);
|
|
6630
6723
|
for (const a of s.branches)
|
|
6631
|
-
t[e].push(a),
|
|
6724
|
+
t[e].push(a), oo(a, t, e + 1);
|
|
6632
6725
|
}
|
|
6633
6726
|
};
|
|
6634
|
-
class
|
|
6727
|
+
class Se {
|
|
6635
6728
|
constructor(t, e) {
|
|
6636
6729
|
this.parent = t, this.branches = [], this.depth = 0, this.node = e;
|
|
6637
6730
|
}
|
|
6638
6731
|
addBranch(t) {
|
|
6639
|
-
const e = new
|
|
6732
|
+
const e = new Se(this, t);
|
|
6640
6733
|
return e.depth = this.depth + 1, this.branches.push(e), e;
|
|
6641
6734
|
}
|
|
6642
6735
|
countBranchHeight() {
|
|
@@ -6650,7 +6743,7 @@ class we {
|
|
|
6650
6743
|
}
|
|
6651
6744
|
}
|
|
6652
6745
|
}
|
|
6653
|
-
class
|
|
6746
|
+
class vi {
|
|
6654
6747
|
constructor(t) {
|
|
6655
6748
|
this.gapSize = t;
|
|
6656
6749
|
}
|
|
@@ -6665,17 +6758,17 @@ class mi {
|
|
|
6665
6758
|
return t;
|
|
6666
6759
|
}
|
|
6667
6760
|
}
|
|
6668
|
-
const
|
|
6669
|
-
adjacency: new
|
|
6670
|
-
breadth: new
|
|
6671
|
-
"breadth-adjacency": new
|
|
6672
|
-
force: new
|
|
6673
|
-
horizontal: new
|
|
6674
|
-
priority: new
|
|
6675
|
-
tree: new
|
|
6676
|
-
vertical: new
|
|
6677
|
-
},
|
|
6678
|
-
class
|
|
6761
|
+
const Re = {
|
|
6762
|
+
adjacency: new hi(),
|
|
6763
|
+
breadth: new ne(),
|
|
6764
|
+
"breadth-adjacency": new gi(),
|
|
6765
|
+
force: new fi(),
|
|
6766
|
+
horizontal: new ui(),
|
|
6767
|
+
priority: new pi(),
|
|
6768
|
+
tree: new mi(),
|
|
6769
|
+
vertical: new vi()
|
|
6770
|
+
}, yi = Oe({}), $t = Oe({});
|
|
6771
|
+
class bi {
|
|
6679
6772
|
constructor(t, e) {
|
|
6680
6773
|
this.onTitleChange = t, this.onValueSetChange = e;
|
|
6681
6774
|
}
|
|
@@ -6694,7 +6787,7 @@ class yi {
|
|
|
6694
6787
|
highlightProperty(...t) {
|
|
6695
6788
|
}
|
|
6696
6789
|
}
|
|
6697
|
-
const
|
|
6790
|
+
const Ce = ({
|
|
6698
6791
|
direction: s,
|
|
6699
6792
|
collapsableSelector: t,
|
|
6700
6793
|
collapsableAdditionalSelector: e,
|
|
@@ -6739,10 +6832,10 @@ const Se = ({
|
|
|
6739
6832
|
children: /* @__PURE__ */ v("div", { className: f() })
|
|
6740
6833
|
}
|
|
6741
6834
|
) });
|
|
6742
|
-
},
|
|
6743
|
-
const s =
|
|
6744
|
-
|
|
6745
|
-
|
|
6835
|
+
}, ki = () => {
|
|
6836
|
+
const s = Ut($t), t = rt(null), [e, a] = U([]);
|
|
6837
|
+
lo(s.validatorChange$, s.diagramChange$).pipe(
|
|
6838
|
+
co(() => l())
|
|
6746
6839
|
).subscribe();
|
|
6747
6840
|
const l = () => {
|
|
6748
6841
|
a([]);
|
|
@@ -6774,7 +6867,7 @@ const Se = ({
|
|
|
6774
6867
|
" errors found"
|
|
6775
6868
|
] }),
|
|
6776
6869
|
/* @__PURE__ */ v("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ v(
|
|
6777
|
-
|
|
6870
|
+
Ce,
|
|
6778
6871
|
{
|
|
6779
6872
|
collapsableSelector: t,
|
|
6780
6873
|
collapsableAdditionalSelector: ".daga-error-panel",
|
|
@@ -6796,7 +6889,7 @@ const Se = ({
|
|
|
6796
6889
|
r
|
|
6797
6890
|
)) }) })
|
|
6798
6891
|
] }) });
|
|
6799
|
-
},
|
|
6892
|
+
}, wi = 200, Ve = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), io = ({
|
|
6800
6893
|
disabled: s,
|
|
6801
6894
|
options: t,
|
|
6802
6895
|
value: e,
|
|
@@ -6834,12 +6927,12 @@ const Se = ({
|
|
|
6834
6927
|
}
|
|
6835
6928
|
}, N = () => {
|
|
6836
6929
|
if (!s) {
|
|
6837
|
-
const A =
|
|
6930
|
+
const A = Ve(n.trim());
|
|
6838
6931
|
d([]), h([]), y([]), p([]);
|
|
6839
6932
|
for (const _ of t) {
|
|
6840
|
-
const q =
|
|
6933
|
+
const q = Ve(_.label).indexOf(A);
|
|
6841
6934
|
if (q >= 0) {
|
|
6842
|
-
const
|
|
6935
|
+
const Dt = _.label.substring(0, q), J = _.label.substring(
|
|
6843
6936
|
q,
|
|
6844
6937
|
q + A.length
|
|
6845
6938
|
), wt = _.label.substring(
|
|
@@ -6847,7 +6940,7 @@ const Se = ({
|
|
|
6847
6940
|
);
|
|
6848
6941
|
d((nt) => [...nt, _]), h((nt) => [
|
|
6849
6942
|
...nt,
|
|
6850
|
-
|
|
6943
|
+
Dt
|
|
6851
6944
|
]), y((nt) => [
|
|
6852
6945
|
...nt,
|
|
6853
6946
|
J
|
|
@@ -6870,7 +6963,7 @@ const Se = ({
|
|
|
6870
6963
|
}, tt = () => {
|
|
6871
6964
|
setTimeout(() => {
|
|
6872
6965
|
R();
|
|
6873
|
-
},
|
|
6966
|
+
}, wi);
|
|
6874
6967
|
}, E = (A) => {
|
|
6875
6968
|
const _ = l.current?.querySelectorAll("li")[A];
|
|
6876
6969
|
_ && _.scrollIntoView({ block: "center" });
|
|
@@ -6919,7 +7012,7 @@ const Se = ({
|
|
|
6919
7012
|
]
|
|
6920
7013
|
}
|
|
6921
7014
|
);
|
|
6922
|
-
},
|
|
7015
|
+
}, Si = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ci = ({
|
|
6923
7016
|
disabled: s,
|
|
6924
7017
|
allowRepeats: t,
|
|
6925
7018
|
options: e,
|
|
@@ -6928,7 +7021,7 @@ const Se = ({
|
|
|
6928
7021
|
}) => {
|
|
6929
7022
|
const [n, i] = U(), [r, o] = U([]), [d, c] = U([]);
|
|
6930
7023
|
Ct(() => {
|
|
6931
|
-
const u = a.length === 0, k = a.map((b) =>
|
|
7024
|
+
const u = a.length === 0, k = a.map((b) => Si(e, b));
|
|
6932
7025
|
o(k), u && l(a), p();
|
|
6933
7026
|
}, [a, e]);
|
|
6934
7027
|
const h = (u) => {
|
|
@@ -6964,7 +7057,7 @@ const Se = ({
|
|
|
6964
7057
|
] }, k)),
|
|
6965
7058
|
!s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
|
|
6966
7059
|
/* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
6967
|
-
|
|
7060
|
+
io,
|
|
6968
7061
|
{
|
|
6969
7062
|
disabled: s,
|
|
6970
7063
|
options: t ? e || [] : d || [],
|
|
@@ -6975,7 +7068,7 @@ const Se = ({
|
|
|
6975
7068
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: y, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
6976
7069
|
] })
|
|
6977
7070
|
] });
|
|
6978
|
-
},
|
|
7071
|
+
}, $i = ({
|
|
6979
7072
|
disabled: s,
|
|
6980
7073
|
allowRepeats: t,
|
|
6981
7074
|
value: e,
|
|
@@ -7001,7 +7094,7 @@ const Se = ({
|
|
|
7001
7094
|
}, h = (f) => {
|
|
7002
7095
|
f.key === "Enter" && d();
|
|
7003
7096
|
};
|
|
7004
|
-
return /* @__PURE__ */ M(
|
|
7097
|
+
return /* @__PURE__ */ M(ro, { children: [
|
|
7005
7098
|
e.map((f, y) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
|
|
7006
7099
|
/* @__PURE__ */ v(
|
|
7007
7100
|
"input",
|
|
@@ -7038,7 +7131,7 @@ const Se = ({
|
|
|
7038
7131
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7039
7132
|
] })
|
|
7040
7133
|
] });
|
|
7041
|
-
},
|
|
7134
|
+
}, Ii = ({
|
|
7042
7135
|
disabled: s,
|
|
7043
7136
|
value: t,
|
|
7044
7137
|
onChange: e
|
|
@@ -7153,12 +7246,12 @@ const Se = ({
|
|
|
7153
7246
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7154
7247
|
] })
|
|
7155
7248
|
] });
|
|
7156
|
-
},
|
|
7249
|
+
}, so = ({
|
|
7157
7250
|
valueSet: s,
|
|
7158
7251
|
onValueChange: t,
|
|
7159
7252
|
depth: e
|
|
7160
7253
|
}) => {
|
|
7161
|
-
const l =
|
|
7254
|
+
const l = Ut($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0, n = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
|
|
7162
7255
|
if (typeof o == "string")
|
|
7163
7256
|
return o;
|
|
7164
7257
|
if (o == null || isNaN(o.valueOf()))
|
|
@@ -7293,7 +7386,7 @@ const Se = ({
|
|
|
7293
7386
|
)
|
|
7294
7387
|
] }),
|
|
7295
7388
|
o.type === T.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
7296
|
-
|
|
7389
|
+
io,
|
|
7297
7390
|
{
|
|
7298
7391
|
disabled: o.editable === !1 || !l,
|
|
7299
7392
|
options: o.options || [],
|
|
@@ -7302,7 +7395,7 @@ const Se = ({
|
|
|
7302
7395
|
}
|
|
7303
7396
|
) }),
|
|
7304
7397
|
(o.type === T.OptionList || o.type === T.OptionSet) && /* @__PURE__ */ v(
|
|
7305
|
-
|
|
7398
|
+
Ci,
|
|
7306
7399
|
{
|
|
7307
7400
|
disabled: o.editable === !1 || !l,
|
|
7308
7401
|
allowRepeats: o.type === T.OptionList,
|
|
@@ -7312,7 +7405,7 @@ const Se = ({
|
|
|
7312
7405
|
}
|
|
7313
7406
|
),
|
|
7314
7407
|
(o.type === T.TextList || o.type === T.TextSet) && /* @__PURE__ */ v(
|
|
7315
|
-
|
|
7408
|
+
$i,
|
|
7316
7409
|
{
|
|
7317
7410
|
disabled: o.editable === !1 || !l,
|
|
7318
7411
|
allowRepeats: o.type === T.TextList,
|
|
@@ -7321,7 +7414,7 @@ const Se = ({
|
|
|
7321
7414
|
}
|
|
7322
7415
|
),
|
|
7323
7416
|
o.type === T.TextMap && /* @__PURE__ */ v(
|
|
7324
|
-
|
|
7417
|
+
Ii,
|
|
7325
7418
|
{
|
|
7326
7419
|
disabled: o.editable === !1 || !l,
|
|
7327
7420
|
value: s?.getValue(o.name),
|
|
@@ -7329,7 +7422,7 @@ const Se = ({
|
|
|
7329
7422
|
}
|
|
7330
7423
|
),
|
|
7331
7424
|
o.type === T.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
|
|
7332
|
-
|
|
7425
|
+
so,
|
|
7333
7426
|
{
|
|
7334
7427
|
valueSet: s.getSubValueSet(o.name),
|
|
7335
7428
|
onValueChange: t,
|
|
@@ -7340,8 +7433,8 @@ const Se = ({
|
|
|
7340
7433
|
},
|
|
7341
7434
|
o.name
|
|
7342
7435
|
)) });
|
|
7343
|
-
},
|
|
7344
|
-
const e =
|
|
7436
|
+
}, no = ({ valueSet: s, depth: t }) => {
|
|
7437
|
+
const e = Ut($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), n = () => {
|
|
7345
7438
|
for (const o of s?.displayedProperties || []) {
|
|
7346
7439
|
let d = 0, c = 0, h = 0;
|
|
7347
7440
|
const f = x.select(a.current).select(
|
|
@@ -7403,7 +7496,7 @@ const Se = ({
|
|
|
7403
7496
|
if (s === void 0)
|
|
7404
7497
|
return;
|
|
7405
7498
|
let d;
|
|
7406
|
-
o instanceof
|
|
7499
|
+
o instanceof Lo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
|
|
7407
7500
|
o.target?.value || ""
|
|
7408
7501
|
) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), n();
|
|
7409
7502
|
};
|
|
@@ -7433,9 +7526,9 @@ const Se = ({
|
|
|
7433
7526
|
)
|
|
7434
7527
|
] })
|
|
7435
7528
|
] }),
|
|
7436
|
-
o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children:
|
|
7529
|
+
o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Ai(s?.getValue(o.name)) }),
|
|
7437
7530
|
o.type === T.Object && /* @__PURE__ */ v(
|
|
7438
|
-
|
|
7531
|
+
no,
|
|
7439
7532
|
{
|
|
7440
7533
|
valueSet: s?.getSubValueSet(o.name),
|
|
7441
7534
|
depth: t + 1
|
|
@@ -7455,7 +7548,7 @@ const Se = ({
|
|
|
7455
7548
|
o.name
|
|
7456
7549
|
))
|
|
7457
7550
|
] });
|
|
7458
|
-
},
|
|
7551
|
+
}, Ai = (s) => Array.isArray(s) ? s.join(", ") : Eo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, xi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: n, onValueChange: i }) => {
|
|
7459
7552
|
const r = rt(null), [o, d] = U(!1), [c, h] = U(!1), f = () => x.select(r.current);
|
|
7460
7553
|
return Ct(() => {
|
|
7461
7554
|
if (r.current)
|
|
@@ -7476,7 +7569,7 @@ const Se = ({
|
|
|
7476
7569
|
className: `daga-panel daga-bottom daga-${s} daga-${t}`,
|
|
7477
7570
|
children: [
|
|
7478
7571
|
/* @__PURE__ */ v(
|
|
7479
|
-
|
|
7572
|
+
Ce,
|
|
7480
7573
|
{
|
|
7481
7574
|
disabled: !n || !n.propertySet || !n.propertySet.hasProperties(),
|
|
7482
7575
|
collapsed: o,
|
|
@@ -7507,20 +7600,20 @@ const Se = ({
|
|
|
7507
7600
|
)
|
|
7508
7601
|
] }),
|
|
7509
7602
|
!c && /* @__PURE__ */ v(
|
|
7510
|
-
|
|
7603
|
+
so,
|
|
7511
7604
|
{
|
|
7512
7605
|
valueSet: n,
|
|
7513
7606
|
onValueChange: i,
|
|
7514
7607
|
depth: 0
|
|
7515
7608
|
}
|
|
7516
7609
|
),
|
|
7517
|
-
c && /* @__PURE__ */ v(
|
|
7610
|
+
c && /* @__PURE__ */ v(no, { valueSet: n, depth: 0 })
|
|
7518
7611
|
] }) })
|
|
7519
7612
|
]
|
|
7520
7613
|
}
|
|
7521
7614
|
) });
|
|
7522
|
-
},
|
|
7523
|
-
const t =
|
|
7615
|
+
}, Li = 6, Ei = (s) => {
|
|
7616
|
+
const t = Ut($t), [e, a] = U(
|
|
7524
7617
|
s.currentPalette || s.palettes[0]
|
|
7525
7618
|
), [l, n] = U(0), [i, r] = U(
|
|
7526
7619
|
void 0
|
|
@@ -7578,7 +7671,7 @@ const Se = ({
|
|
|
7578
7671
|
}).on(I.End, (O) => {
|
|
7579
7672
|
if (t.canUserPerformAction(w.AddNode)) {
|
|
7580
7673
|
if (S(L.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
|
|
7581
|
-
(
|
|
7674
|
+
(Yt) => !Yt.removed && Yt.type.id === p.id
|
|
7582
7675
|
) !== void 0)
|
|
7583
7676
|
return;
|
|
7584
7677
|
const A = t.getPointerLocationRelativeToScreen(O);
|
|
@@ -7605,24 +7698,24 @@ const Se = ({
|
|
|
7605
7698
|
lt[0],
|
|
7606
7699
|
lt[1]
|
|
7607
7700
|
).filter(
|
|
7608
|
-
(
|
|
7609
|
-
), wt =
|
|
7701
|
+
(Yt) => Yt.type.childrenTypes.includes(p.id)
|
|
7702
|
+
), wt = Ye(
|
|
7610
7703
|
J
|
|
7611
7704
|
), nt = wt[wt.length - 1];
|
|
7612
7705
|
if (!p.canBeParentless && nt === void 0)
|
|
7613
7706
|
return;
|
|
7614
|
-
const
|
|
7707
|
+
const Bt = nt?.getLastAncestor(), $e = new Xo(
|
|
7615
7708
|
t,
|
|
7616
7709
|
p,
|
|
7617
7710
|
q,
|
|
7618
7711
|
nt?.id,
|
|
7619
|
-
|
|
7620
|
-
|
|
7712
|
+
Bt?.id,
|
|
7713
|
+
Bt?.getGeometry(),
|
|
7621
7714
|
void 0,
|
|
7622
7715
|
u.label,
|
|
7623
7716
|
u.values
|
|
7624
7717
|
);
|
|
7625
|
-
|
|
7718
|
+
$e.do(), t?.actionStack.add($e), S();
|
|
7626
7719
|
}
|
|
7627
7720
|
})
|
|
7628
7721
|
).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;
|
|
@@ -7630,7 +7723,7 @@ const Se = ({
|
|
|
7630
7723
|
case "shaped-look":
|
|
7631
7724
|
E.append("path").attr(
|
|
7632
7725
|
"d",
|
|
7633
|
-
|
|
7726
|
+
me(
|
|
7634
7727
|
C.shape || Tt.Rectangle,
|
|
7635
7728
|
(C.borderThickness || 1) / 2,
|
|
7636
7729
|
(C.borderThickness || 1) / 2,
|
|
@@ -7691,7 +7784,7 @@ const Se = ({
|
|
|
7691
7784
|
});
|
|
7692
7785
|
b.append("path").attr(
|
|
7693
7786
|
"d",
|
|
7694
|
-
|
|
7787
|
+
me(
|
|
7695
7788
|
Tt.Rectangle,
|
|
7696
7789
|
0,
|
|
7697
7790
|
0,
|
|
@@ -7700,7 +7793,7 @@ const Se = ({
|
|
|
7700
7793
|
)
|
|
7701
7794
|
).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && b.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && b.append("text").attr(
|
|
7702
7795
|
"transform",
|
|
7703
|
-
`translate(${u.width / 2},${u.height / 2 +
|
|
7796
|
+
`translate(${u.width / 2},${u.height / 2 + Li})`
|
|
7704
7797
|
).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);
|
|
7705
7798
|
};
|
|
7706
7799
|
return Ct(() => {
|
|
@@ -7722,7 +7815,7 @@ const Se = ({
|
|
|
7722
7815
|
className: `daga-panel daga-${s.location} daga-${s.direction}`,
|
|
7723
7816
|
children: [
|
|
7724
7817
|
/* @__PURE__ */ v(
|
|
7725
|
-
|
|
7818
|
+
Ce,
|
|
7726
7819
|
{
|
|
7727
7820
|
direction: s.direction,
|
|
7728
7821
|
collapsableSelector: o,
|
|
@@ -7748,7 +7841,7 @@ const Se = ({
|
|
|
7748
7841
|
]
|
|
7749
7842
|
}
|
|
7750
7843
|
) });
|
|
7751
|
-
},
|
|
7844
|
+
}, Mi = ({
|
|
7752
7845
|
location: s,
|
|
7753
7846
|
direction: t,
|
|
7754
7847
|
enableAction: e,
|
|
@@ -7785,22 +7878,22 @@ const Se = ({
|
|
|
7785
7878
|
if (!d)
|
|
7786
7879
|
if (o) {
|
|
7787
7880
|
o = !1;
|
|
7788
|
-
const
|
|
7789
|
-
J.transition().duration(500).ease(x.easeLinear).style(c,
|
|
7881
|
+
const Bt = `${4 * J.selectChildren().size()}rem`;
|
|
7882
|
+
J.transition().duration(500).ease(x.easeLinear).style(c, Bt).style("transform", `${h}(1)`), setTimeout(() => {
|
|
7790
7883
|
d = !1;
|
|
7791
7884
|
}, 500);
|
|
7792
7885
|
} else
|
|
7793
7886
|
o = !0, J.transition().duration(500).ease(x.easeLinear).style(c, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
|
|
7794
7887
|
d = !1;
|
|
7795
7888
|
}, 500);
|
|
7796
|
-
}, b =
|
|
7889
|
+
}, b = Ut($t), N = () => {
|
|
7797
7890
|
b.zoomBy(b.zoomFactor);
|
|
7798
7891
|
}, R = () => {
|
|
7799
7892
|
b.zoomBy(1 / b.zoomFactor);
|
|
7800
7893
|
}, P = () => {
|
|
7801
7894
|
b.center();
|
|
7802
7895
|
}, tt = () => {
|
|
7803
|
-
b.layoutFormat && b.layoutFormat in
|
|
7896
|
+
b.layoutFormat && b.layoutFormat in Re && Re[b.layoutFormat].apply(b.model);
|
|
7804
7897
|
}, E = () => {
|
|
7805
7898
|
r = !r, x.select(
|
|
7806
7899
|
u.current
|
|
@@ -7821,12 +7914,12 @@ const Se = ({
|
|
|
7821
7914
|
b.userSelection.pasteFromClipboard();
|
|
7822
7915
|
}, q = () => {
|
|
7823
7916
|
b.userSelection.removeFromModel();
|
|
7824
|
-
},
|
|
7917
|
+
}, Dt = () => {
|
|
7825
7918
|
b.multipleSelectionOn = !0, x.select(
|
|
7826
7919
|
p.current
|
|
7827
7920
|
).classed("daga-on", !0).classed("daga-off", !1);
|
|
7828
7921
|
const J = b.diagramEvent$.subscribe((wt) => {
|
|
7829
|
-
wt.type ===
|
|
7922
|
+
wt.type === Ze.Selection && (x.select(
|
|
7830
7923
|
p.current
|
|
7831
7924
|
).classed("daga-on", !1).classed("daga-off", !0), J.unsubscribe());
|
|
7832
7925
|
});
|
|
@@ -7844,7 +7937,7 @@ const Se = ({
|
|
|
7844
7937
|
e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
|
|
7845
7938
|
n && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: A, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
|
|
7846
7939
|
n && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: _, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
|
|
7847
|
-
n && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${r ? "daga-on" : "daga-off"}`, onClick:
|
|
7940
|
+
n && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${r ? "daga-on" : "daga-off"}`, onClick: Dt, ref: p, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
|
|
7848
7941
|
n && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
|
|
7849
7942
|
n && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
|
|
7850
7943
|
l && b.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: tt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
|
|
@@ -7854,14 +7947,14 @@ const Se = ({
|
|
|
7854
7947
|
]
|
|
7855
7948
|
}
|
|
7856
7949
|
) });
|
|
7857
|
-
},
|
|
7950
|
+
}, zi = ({
|
|
7858
7951
|
config: s,
|
|
7859
7952
|
model: t,
|
|
7860
7953
|
onCanvasCreated: e,
|
|
7861
7954
|
onDiagramEvent: a,
|
|
7862
7955
|
onModelChange: l
|
|
7863
7956
|
}) => {
|
|
7864
|
-
const n = new
|
|
7957
|
+
const n = new We(), i = new Je(), r = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = U(void 0), [y, m] = U(void 0), p = {
|
|
7865
7958
|
zoomIn: () => {
|
|
7866
7959
|
},
|
|
7867
7960
|
zoomOut: () => {
|
|
@@ -7879,14 +7972,14 @@ const Se = ({
|
|
|
7879
7972
|
}, u = {
|
|
7880
7973
|
refreshPalette: () => {
|
|
7881
7974
|
}
|
|
7882
|
-
}, k = new
|
|
7975
|
+
}, k = new bi(
|
|
7883
7976
|
(E) => f(E),
|
|
7884
7977
|
(E) => m(E)
|
|
7885
7978
|
), b = {
|
|
7886
7979
|
diagramButtons: p,
|
|
7887
7980
|
palette: u,
|
|
7888
7981
|
propertyEditor: k
|
|
7889
|
-
}, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new
|
|
7982
|
+
}, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new ye(b, s)), o.current), R = N(), P = (E) => {
|
|
7890
7983
|
R.initView(E), c.push(
|
|
7891
7984
|
R.diagramEvent$.subscribe((C) => {
|
|
7892
7985
|
a?.(C);
|
|
@@ -7900,7 +7993,7 @@ const Se = ({
|
|
|
7900
7993
|
};
|
|
7901
7994
|
Ct(() => {
|
|
7902
7995
|
r.current && (d.current || (P(r.current), d.current = !0, e?.(R)));
|
|
7903
|
-
}, [r.current]),
|
|
7996
|
+
}, [r.current]), ho(() => {
|
|
7904
7997
|
r.current && (N(!0), P(r.current), e?.(R));
|
|
7905
7998
|
}, [s]), Ct(() => {
|
|
7906
7999
|
t && n.import(R.model, t);
|
|
@@ -7915,13 +8008,13 @@ const Se = ({
|
|
|
7915
8008
|
A.setValues(y.getValues()), A.rootElement = y.rootElement, k.valueSet = A, y.rootElement.valueSet = A, R.propertyEditorChanges$?.next();
|
|
7916
8009
|
}
|
|
7917
8010
|
};
|
|
7918
|
-
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(
|
|
8011
|
+
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(yi.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
|
|
7919
8012
|
/* @__PURE__ */ v("div", { className: "daga-append-to", ref: r }),
|
|
7920
8013
|
/* @__PURE__ */ M($t.Provider, { value: R, children: [
|
|
7921
8014
|
s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
|
|
7922
|
-
|
|
8015
|
+
Mi,
|
|
7923
8016
|
{
|
|
7924
|
-
location: s.components?.buttons?.location ||
|
|
8017
|
+
location: s.components?.buttons?.location || Wt.BottomRight,
|
|
7925
8018
|
direction: s.components?.buttons?.direction || g.Top,
|
|
7926
8019
|
enableAction: s.components?.buttons?.enableAction !== !1,
|
|
7927
8020
|
enableFilter: s.components?.buttons?.enableFilter === !0,
|
|
@@ -7931,9 +8024,9 @@ const Se = ({
|
|
|
7931
8024
|
}
|
|
7932
8025
|
),
|
|
7933
8026
|
s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
|
|
7934
|
-
|
|
8027
|
+
Ei,
|
|
7935
8028
|
{
|
|
7936
|
-
location: s.components?.palette?.location ||
|
|
8029
|
+
location: s.components?.palette?.location || Wt.TopLeft,
|
|
7937
8030
|
direction: s.components?.palette?.direction || g.Bottom,
|
|
7938
8031
|
width: s.components?.palette?.width || "12rem",
|
|
7939
8032
|
height: s.components?.palette?.height,
|
|
@@ -7941,9 +8034,9 @@ const Se = ({
|
|
|
7941
8034
|
}
|
|
7942
8035
|
),
|
|
7943
8036
|
s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
|
|
7944
|
-
|
|
8037
|
+
xi,
|
|
7945
8038
|
{
|
|
7946
|
-
location: s.components?.propertyEditor?.location ||
|
|
8039
|
+
location: s.components?.propertyEditor?.location || Wt.TopRight,
|
|
7947
8040
|
direction: s.components?.propertyEditor?.direction || g.Bottom,
|
|
7948
8041
|
width: s.components?.propertyEditor?.width || "24rem",
|
|
7949
8042
|
height: s.components?.propertyEditor?.height,
|
|
@@ -7952,10 +8045,10 @@ const Se = ({
|
|
|
7952
8045
|
onValueChange: tt
|
|
7953
8046
|
}
|
|
7954
8047
|
),
|
|
7955
|
-
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8048
|
+
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(ki, {})
|
|
7956
8049
|
] })
|
|
7957
8050
|
] }) }) }) });
|
|
7958
8051
|
};
|
|
7959
8052
|
export {
|
|
7960
|
-
|
|
8053
|
+
zi as DagaDiagram
|
|
7961
8054
|
};
|