@metadev/daga-react 5.0.1 → 5.0.3
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 -1
- package/index.js +2 -2
- package/index.mjs +255 -250
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as v, jsxs as M, Fragment as
|
|
1
|
+
import { jsx as v, jsxs as M, Fragment as lo } from "react/jsx-runtime";
|
|
2
2
|
import * as A from "d3";
|
|
3
|
-
import { debounceTime as
|
|
4
|
-
import { createContext as
|
|
3
|
+
import { debounceTime as co, Subject as jt, merge as ho, map as go } from "rxjs";
|
|
4
|
+
import { createContext as _e, useState as G, useContext as Bt, useRef as at, useEffect as ft } from "react";
|
|
5
5
|
var f = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(f || {}), Zt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Zt || {}), Mt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Mt || {}), qt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(qt || {});
|
|
6
6
|
const Lt = (s) => [Math.round(s[0]), Math.round(s[1])], mt = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Ae = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Jt = (s, t, e, a, l, r, i) => {
|
|
7
7
|
const n = (() => {
|
|
@@ -32,7 +32,7 @@ const Lt = (s) => [Math.round(s[0]), Math.round(s[1])], mt = (s, t, e) => t < e
|
|
|
32
32
|
}
|
|
33
33
|
})();
|
|
34
34
|
return [n, o];
|
|
35
|
-
},
|
|
35
|
+
}, Ge = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, fo = (s, t) => (mt(
|
|
36
36
|
s[0][0],
|
|
37
37
|
t[0][0],
|
|
38
38
|
t[1][0]
|
|
@@ -67,8 +67,8 @@ const Lt = (s) => [Math.round(s[0]), Math.round(s[1])], mt = (s, t, e) => t < e
|
|
|
67
67
|
));
|
|
68
68
|
var S = /* @__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))(S || {}), q = /* @__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))(q || {}), 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 || {});
|
|
69
69
|
const ue = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
|
|
70
|
-
var
|
|
71
|
-
const
|
|
70
|
+
var Fe = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(Fe || {}), be = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(be || {});
|
|
71
|
+
const uo = 20, po = (s, t, e, a, l) => {
|
|
72
72
|
if (typeof s == "function")
|
|
73
73
|
return s(
|
|
74
74
|
t,
|
|
@@ -81,7 +81,7 @@ const fo = 20, uo = (s, t, e, a, l) => {
|
|
|
81
81
|
if (t.length === 1)
|
|
82
82
|
return `M ${t[0][0]} ${t[0][1]}`;
|
|
83
83
|
{
|
|
84
|
-
l = l ||
|
|
84
|
+
l = l || uo;
|
|
85
85
|
let r = "", i, n;
|
|
86
86
|
switch (s) {
|
|
87
87
|
case "straight":
|
|
@@ -291,57 +291,57 @@ const me = (s, t, e, a, l) => {
|
|
|
291
291
|
return s(t, e, a, l);
|
|
292
292
|
switch (s) {
|
|
293
293
|
case "ellipse":
|
|
294
|
-
return
|
|
294
|
+
return Ue(t, e, a, l);
|
|
295
295
|
case "empty":
|
|
296
|
-
return
|
|
296
|
+
return mo();
|
|
297
297
|
case "folder":
|
|
298
|
-
return mo(t, e, a, l);
|
|
299
|
-
case "hexagon":
|
|
300
298
|
return vo(t, e, a, l);
|
|
301
|
-
case "
|
|
299
|
+
case "hexagon":
|
|
302
300
|
return yo(t, e, a, l);
|
|
301
|
+
case "octagon":
|
|
302
|
+
return bo(t, e, a, l);
|
|
303
303
|
case "pill":
|
|
304
304
|
return Kt(t, e, a, l);
|
|
305
305
|
case "rectangle":
|
|
306
306
|
return xe(t, e, a, l);
|
|
307
307
|
case "rhombus":
|
|
308
|
-
return bo(t, e, a, l);
|
|
309
|
-
case "rounded-rectangle":
|
|
310
308
|
return ko(t, e, a, l);
|
|
311
|
-
case "
|
|
309
|
+
case "rounded-rectangle":
|
|
312
310
|
return wo(t, e, a, l);
|
|
311
|
+
case "sticky-note":
|
|
312
|
+
return So(t, e, a, l);
|
|
313
313
|
default:
|
|
314
314
|
return xe(t, e, a, l);
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, Ue = (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`, mo = () => "Z", vo = (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`, yo = (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`, bo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, Kt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ue(s, t, e, a), xe = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, ko = (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`, wo = (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`, So = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
|
|
317
317
|
var x = /* @__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))(x || {});
|
|
318
|
-
const
|
|
319
|
-
`).map((t) => t.length)),
|
|
318
|
+
const Co = (s) => Math.max(...s.split(`
|
|
319
|
+
`).map((t) => t.length)), $o = (s) => s.match(/\n/g)?.length || 0, K = [];
|
|
320
320
|
for (let s = 0; s < 256; ++s)
|
|
321
321
|
K.push((s + 256).toString(16).slice(1));
|
|
322
|
-
function
|
|
322
|
+
function Io(s, t = 0) {
|
|
323
323
|
return (K[s[t + 0]] + K[s[t + 1]] + K[s[t + 2]] + K[s[t + 3]] + "-" + K[s[t + 4]] + K[s[t + 5]] + "-" + K[s[t + 6]] + K[s[t + 7]] + "-" + K[s[t + 8]] + K[s[t + 9]] + "-" + K[s[t + 10]] + K[s[t + 11]] + K[s[t + 12]] + K[s[t + 13]] + K[s[t + 14]] + K[s[t + 15]]).toLowerCase();
|
|
324
324
|
}
|
|
325
325
|
let re;
|
|
326
|
-
const
|
|
327
|
-
function
|
|
326
|
+
const Ao = new Uint8Array(16);
|
|
327
|
+
function xo() {
|
|
328
328
|
if (!re) {
|
|
329
329
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
330
330
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
331
331
|
re = crypto.getRandomValues.bind(crypto);
|
|
332
332
|
}
|
|
333
|
-
return re(
|
|
333
|
+
return re(Ao);
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
function
|
|
335
|
+
const Lo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Le = { randomUUID: Lo };
|
|
336
|
+
function Eo(s, t, e) {
|
|
337
337
|
s = s || {};
|
|
338
|
-
const a = s.random ?? s.rng?.() ??
|
|
338
|
+
const a = s.random ?? s.rng?.() ?? xo();
|
|
339
339
|
if (a.length < 16)
|
|
340
340
|
throw new Error("Random bytes length must be >= 16");
|
|
341
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
341
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Io(a);
|
|
342
342
|
}
|
|
343
343
|
function Ee(s, t, e) {
|
|
344
|
-
return Le.randomUUID && !s ? Le.randomUUID() :
|
|
344
|
+
return Le.randomUUID && !s ? Le.randomUUID() : Eo(s);
|
|
345
345
|
}
|
|
346
346
|
const $t = (s) => {
|
|
347
347
|
if (typeof s != "object")
|
|
@@ -554,7 +554,7 @@ class pt extends te {
|
|
|
554
554
|
yield e;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
class
|
|
557
|
+
class Mo {
|
|
558
558
|
constructor(t, e, a, l, r, i, n) {
|
|
559
559
|
this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = r, this.editable = i, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
|
|
560
560
|
}
|
|
@@ -579,11 +579,11 @@ class ee {
|
|
|
579
579
|
function St(s, t) {
|
|
580
580
|
return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
|
|
581
581
|
}
|
|
582
|
-
const Me = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, Ct = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t),
|
|
582
|
+
const Me = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, Ct = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), De = (s, t, e) => {
|
|
583
583
|
const a = {}, l = {};
|
|
584
584
|
for (const r in e.propertySet.propertyMap)
|
|
585
585
|
if (e.propertySet.propertyMap[r].type === N.Object) {
|
|
586
|
-
const i =
|
|
586
|
+
const i = De(
|
|
587
587
|
s[r],
|
|
588
588
|
t[r],
|
|
589
589
|
e.getSubValueSet(r)
|
|
@@ -592,7 +592,7 @@ const Me = (s) => s == null || s === "" || s instanceof Array && s.length === 0
|
|
|
592
592
|
} else
|
|
593
593
|
Ct(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
|
|
594
594
|
return [a, l];
|
|
595
|
-
},
|
|
595
|
+
}, To = (s) => s != null && s.constructor === Object;
|
|
596
596
|
class kt {
|
|
597
597
|
constructor(t, e) {
|
|
598
598
|
this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
|
|
@@ -848,7 +848,7 @@ const it = {
|
|
|
848
848
|
lookType: "connection-look",
|
|
849
849
|
color: "#000000",
|
|
850
850
|
thickness: 1,
|
|
851
|
-
shape:
|
|
851
|
+
shape: Fe.Straight,
|
|
852
852
|
style: be.Solid,
|
|
853
853
|
selected: {
|
|
854
854
|
color: "#AA00AA"
|
|
@@ -863,7 +863,7 @@ const it = {
|
|
|
863
863
|
endTypes: [],
|
|
864
864
|
properties: []
|
|
865
865
|
};
|
|
866
|
-
class
|
|
866
|
+
class Be {
|
|
867
867
|
constructor(t) {
|
|
868
868
|
const e = {
|
|
869
869
|
...it,
|
|
@@ -1163,7 +1163,7 @@ class ct extends At {
|
|
|
1163
1163
|
return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : zt;
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
|
-
class
|
|
1166
|
+
class No extends pt {
|
|
1167
1167
|
/**
|
|
1168
1168
|
* Instance a set of connections for the given model. This method is used internally.
|
|
1169
1169
|
* @private
|
|
@@ -1182,7 +1182,7 @@ class To extends pt {
|
|
|
1182
1182
|
*/
|
|
1183
1183
|
new(t, e, a, l) {
|
|
1184
1184
|
let r;
|
|
1185
|
-
if (t instanceof
|
|
1185
|
+
if (t instanceof Be)
|
|
1186
1186
|
r = t;
|
|
1187
1187
|
else {
|
|
1188
1188
|
const n = this.types.get(t);
|
|
@@ -1278,7 +1278,7 @@ class gt extends At {
|
|
|
1278
1278
|
return this.rootElement?.getPriority() || zt;
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
class
|
|
1281
|
+
class Po extends pt {
|
|
1282
1282
|
/**
|
|
1283
1283
|
* Instance a set of fields for the given model. This method is used internally.
|
|
1284
1284
|
* @private
|
|
@@ -1316,7 +1316,7 @@ class No extends pt {
|
|
|
1316
1316
|
e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
|
-
const J = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], st = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Ht = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), _t = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Gt = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Ft = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Te = 1, Ne = 1,
|
|
1319
|
+
const J = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], st = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? O.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? O.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Ht = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), _t = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Gt = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Ft = (s) => s?.padding === null || s?.padding === void 0 ? O.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? O.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Te = 1, Ne = 1, zo = 1, Vo = 1;
|
|
1320
1320
|
class Ro {
|
|
1321
1321
|
constructor(t) {
|
|
1322
1322
|
this.margin = t.margin || 0, this.defaultWidths = t.defaultWidths || null, this.defaultHeights = t.defaultHeights || null, this.minWidths = t.minWidths || null, this.minHeights = t.minHeights || null, this.sections = [];
|
|
@@ -1324,14 +1324,14 @@ class Ro {
|
|
|
1324
1324
|
const a = [];
|
|
1325
1325
|
this.sections.push(a);
|
|
1326
1326
|
for (const l of e)
|
|
1327
|
-
a.push(new
|
|
1327
|
+
a.push(new Oo(l));
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
|
-
class
|
|
1331
|
+
class Oo {
|
|
1332
1332
|
constructor(t) {
|
|
1333
1333
|
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || zt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
|
|
1334
|
-
const e = rt(t.look ||
|
|
1334
|
+
const e = rt(t.look || Ye);
|
|
1335
1335
|
this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
@@ -1415,10 +1415,10 @@ class B extends At {
|
|
|
1415
1415
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
|
|
1416
1416
|
}
|
|
1417
1417
|
getMinWidth() {
|
|
1418
|
-
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] ||
|
|
1418
|
+
return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || zo;
|
|
1419
1419
|
}
|
|
1420
1420
|
getMinHeight() {
|
|
1421
|
-
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] ||
|
|
1421
|
+
return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Vo;
|
|
1422
1422
|
}
|
|
1423
1423
|
getPriority() {
|
|
1424
1424
|
return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || zt;
|
|
@@ -1591,7 +1591,7 @@ class B extends At {
|
|
|
1591
1591
|
this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((n) => n.tighten()), this.updateInView();
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
class
|
|
1594
|
+
class Ho extends pt {
|
|
1595
1595
|
/**
|
|
1596
1596
|
* Instance a set of sections for the given model. This method is used internally.
|
|
1597
1597
|
* @private
|
|
@@ -1715,7 +1715,7 @@ class Oo extends pt {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
const
|
|
1718
|
+
const Ye = {
|
|
1719
1719
|
lookType: "shaped-look",
|
|
1720
1720
|
shape: Pt.Rectangle,
|
|
1721
1721
|
fillColor: "#FFFFFF",
|
|
@@ -1742,20 +1742,20 @@ const Be = {
|
|
|
1742
1742
|
ports: [],
|
|
1743
1743
|
decorators: [],
|
|
1744
1744
|
sectionGrid: null,
|
|
1745
|
-
look:
|
|
1745
|
+
look: Ye,
|
|
1746
1746
|
isUnique: !1,
|
|
1747
1747
|
canBeParentless: !0,
|
|
1748
1748
|
childrenTypes: [],
|
|
1749
1749
|
priority: zt,
|
|
1750
1750
|
properties: []
|
|
1751
1751
|
};
|
|
1752
|
-
class
|
|
1752
|
+
class Xe {
|
|
1753
1753
|
constructor(t) {
|
|
1754
1754
|
const e = {
|
|
1755
1755
|
...ut,
|
|
1756
1756
|
...t
|
|
1757
1757
|
};
|
|
1758
|
-
this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding =
|
|
1758
|
+
this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = Go(e), this.leftPadding = Fo(e), this.rightPadding = Uo(e), this.topPadding = Do(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Ro(e.sectionGrid) : null;
|
|
1759
1759
|
const a = rt(e.look);
|
|
1760
1760
|
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new ee(t?.properties || []);
|
|
1761
1761
|
}
|
|
@@ -2314,7 +2314,7 @@ class z extends At {
|
|
|
2314
2314
|
this.stretch(f.Bottom, e + a);
|
|
2315
2315
|
}
|
|
2316
2316
|
}
|
|
2317
|
-
class
|
|
2317
|
+
class _o extends pt {
|
|
2318
2318
|
/**
|
|
2319
2319
|
* Instance a set of nodes for the given model. This method is used internally.
|
|
2320
2320
|
* @private
|
|
@@ -2332,7 +2332,7 @@ class Ho extends pt {
|
|
|
2332
2332
|
*/
|
|
2333
2333
|
new(t, e, a) {
|
|
2334
2334
|
let l;
|
|
2335
|
-
if (t instanceof
|
|
2335
|
+
if (t instanceof Xe)
|
|
2336
2336
|
l = t;
|
|
2337
2337
|
else {
|
|
2338
2338
|
const i = this.types.get(t);
|
|
@@ -2493,12 +2493,12 @@ class Ho extends pt {
|
|
|
2493
2493
|
return a;
|
|
2494
2494
|
}
|
|
2495
2495
|
}
|
|
2496
|
-
const
|
|
2496
|
+
const je = (s) => {
|
|
2497
2497
|
for (let t = 0; t < s.length; ++t)
|
|
2498
2498
|
for (let e = 0; e < s.length; ++e)
|
|
2499
2499
|
e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
|
|
2500
2500
|
return s;
|
|
2501
|
-
},
|
|
2501
|
+
}, Go = (s) => s?.padding === null || s?.padding === void 0 ? ut.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? ut.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Fo = (s) => s?.padding === null || s?.padding === void 0 ? ut.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? ut.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Uo = (s) => s?.padding === null || s?.padding === void 0 ? ut.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? ut.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Do = (s) => s?.padding === null || s?.padding === void 0 ? ut.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? ut.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), We = {
|
|
2502
2502
|
lookType: "shaped-look",
|
|
2503
2503
|
shape: Pt.Ellipse,
|
|
2504
2504
|
fillColor: "transparent",
|
|
@@ -2510,18 +2510,18 @@ const Xe = (s) => {
|
|
|
2510
2510
|
highlighted: {
|
|
2511
2511
|
fillColor: "rgba(0, 255, 255, 0.5)"
|
|
2512
2512
|
}
|
|
2513
|
-
}, Wt = rt(
|
|
2513
|
+
}, Wt = rt(We), Ze = {
|
|
2514
2514
|
name: "",
|
|
2515
2515
|
label: null,
|
|
2516
2516
|
allowsOutgoing: !0,
|
|
2517
2517
|
allowsIncoming: !0,
|
|
2518
2518
|
width: 24,
|
|
2519
|
-
look:
|
|
2519
|
+
look: We
|
|
2520
2520
|
};
|
|
2521
|
-
class
|
|
2521
|
+
class Bo {
|
|
2522
2522
|
constructor(t) {
|
|
2523
2523
|
const e = {
|
|
2524
|
-
...
|
|
2524
|
+
...Ze,
|
|
2525
2525
|
...t
|
|
2526
2526
|
};
|
|
2527
2527
|
this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
|
|
@@ -2629,7 +2629,7 @@ class wt extends At {
|
|
|
2629
2629
|
* @private
|
|
2630
2630
|
*/
|
|
2631
2631
|
get width() {
|
|
2632
|
-
return this.type?.width ||
|
|
2632
|
+
return this.type?.width || Ze.width;
|
|
2633
2633
|
}
|
|
2634
2634
|
/**
|
|
2635
2635
|
* Current height of this port. Same as the width.
|
|
@@ -2702,10 +2702,10 @@ class wt extends At {
|
|
|
2702
2702
|
]), this.updateInView();
|
|
2703
2703
|
}
|
|
2704
2704
|
distanceTo(t) {
|
|
2705
|
-
return
|
|
2705
|
+
return Ge(this.coords, t);
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
|
-
class
|
|
2708
|
+
class Yo extends pt {
|
|
2709
2709
|
/**
|
|
2710
2710
|
* Instance a set of ports for the given model. This method is used internally.
|
|
2711
2711
|
* @private
|
|
@@ -2742,7 +2742,7 @@ class Bo extends pt {
|
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
2744
|
}
|
|
2745
|
-
class
|
|
2745
|
+
class Ke {
|
|
2746
2746
|
import(t, e) {
|
|
2747
2747
|
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);
|
|
2748
2748
|
for (const a of e.nodes || [])
|
|
@@ -3313,7 +3313,7 @@ class se {
|
|
|
3313
3313
|
this.canvas = t, this.nodes = e, this.connections = a;
|
|
3314
3314
|
}
|
|
3315
3315
|
do() {
|
|
3316
|
-
const t = new
|
|
3316
|
+
const t = new Ke();
|
|
3317
3317
|
this.canvas.userSelection.clear();
|
|
3318
3318
|
for (const e of this.nodes) {
|
|
3319
3319
|
const a = t.importNode(this.canvas.model, e);
|
|
@@ -3342,7 +3342,7 @@ class se {
|
|
|
3342
3342
|
);
|
|
3343
3343
|
}
|
|
3344
3344
|
}
|
|
3345
|
-
class
|
|
3345
|
+
class Xo {
|
|
3346
3346
|
constructor(t) {
|
|
3347
3347
|
this.isInRoom = !1, this.canvas = t, this.replicaId = Ee();
|
|
3348
3348
|
}
|
|
@@ -3445,7 +3445,7 @@ class Yo {
|
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
3447
|
}
|
|
3448
|
-
class
|
|
3448
|
+
class jo {
|
|
3449
3449
|
constructor(t, e) {
|
|
3450
3450
|
this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
|
|
3451
3451
|
}
|
|
@@ -3498,7 +3498,7 @@ class Xo {
|
|
|
3498
3498
|
}
|
|
3499
3499
|
}
|
|
3500
3500
|
var k = /* @__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))(k || {});
|
|
3501
|
-
class
|
|
3501
|
+
class Wo {
|
|
3502
3502
|
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3503
3503
|
this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = r, this.fromAncestorGeometry = i, this.toAncestorGeometry = n, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
|
|
3504
3504
|
}
|
|
@@ -3656,7 +3656,7 @@ class W {
|
|
|
3656
3656
|
return t !== void 0;
|
|
3657
3657
|
}
|
|
3658
3658
|
}
|
|
3659
|
-
class
|
|
3659
|
+
class Zo {
|
|
3660
3660
|
constructor(t, e, a, l, r, i, n, o, d) {
|
|
3661
3661
|
this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry = r, this.toChildGeometry = i, this.ancestorId = n, this.fromAncestorGeometry = o, this.toAncestorGeometry = d;
|
|
3662
3662
|
}
|
|
@@ -3785,7 +3785,7 @@ class Pe {
|
|
|
3785
3785
|
return t !== void 0;
|
|
3786
3786
|
}
|
|
3787
3787
|
}
|
|
3788
|
-
class
|
|
3788
|
+
class Ko {
|
|
3789
3789
|
constructor(t, e, a, l) {
|
|
3790
3790
|
this.canvas = t, this.id = e, this.from = a, this.to = l;
|
|
3791
3791
|
}
|
|
@@ -3825,7 +3825,7 @@ class Zo {
|
|
|
3825
3825
|
return !e.rootElement.removed;
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
class
|
|
3828
|
+
class qo {
|
|
3829
3829
|
constructor(t, e, a, l, r, i) {
|
|
3830
3830
|
this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i;
|
|
3831
3831
|
}
|
|
@@ -3867,7 +3867,7 @@ class Ko {
|
|
|
3867
3867
|
return this.do();
|
|
3868
3868
|
}
|
|
3869
3869
|
}
|
|
3870
|
-
class
|
|
3870
|
+
class Jo {
|
|
3871
3871
|
constructor(t, e, a, l) {
|
|
3872
3872
|
this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
|
|
3873
3873
|
}
|
|
@@ -3966,8 +3966,8 @@ class Yt {
|
|
|
3966
3966
|
this.defaultPrevented = !0;
|
|
3967
3967
|
}
|
|
3968
3968
|
}
|
|
3969
|
-
var
|
|
3970
|
-
class
|
|
3969
|
+
var qe = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s))(qe || {});
|
|
3970
|
+
class Qo extends Yt {
|
|
3971
3971
|
/**
|
|
3972
3972
|
* Create a diagram zoom event.
|
|
3973
3973
|
*
|
|
@@ -4037,7 +4037,7 @@ class tt extends Yt {
|
|
|
4037
4037
|
), this.target = t;
|
|
4038
4038
|
}
|
|
4039
4039
|
}
|
|
4040
|
-
class
|
|
4040
|
+
class Je extends At {
|
|
4041
4041
|
constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
|
|
4042
4042
|
if (t.objects.get(o) !== void 0)
|
|
4043
4043
|
throw new Error(`DiagramDecorator with id "${o}" already exists`);
|
|
@@ -4066,7 +4066,7 @@ class qe extends At {
|
|
|
4066
4066
|
return this.priority;
|
|
4067
4067
|
}
|
|
4068
4068
|
}
|
|
4069
|
-
class
|
|
4069
|
+
class ti extends pt {
|
|
4070
4070
|
/**
|
|
4071
4071
|
* Instance a set of decorators for the given model. This method is used internally.
|
|
4072
4072
|
* @private
|
|
@@ -4086,7 +4086,7 @@ class Qo extends pt {
|
|
|
4086
4086
|
* @returns The instanced decorator.
|
|
4087
4087
|
*/
|
|
4088
4088
|
new(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
4089
|
-
const c = new
|
|
4089
|
+
const c = new Je(
|
|
4090
4090
|
this.model,
|
|
4091
4091
|
t,
|
|
4092
4092
|
e,
|
|
@@ -4105,7 +4105,7 @@ class Qo extends pt {
|
|
|
4105
4105
|
e && ((e.rootElement instanceof z || e.rootElement instanceof B) && X(e.rootElement.decorators, e), super.remove(t), e.updateInView());
|
|
4106
4106
|
}
|
|
4107
4107
|
}
|
|
4108
|
-
class
|
|
4108
|
+
class ei extends At {
|
|
4109
4109
|
constructor(t, e, a, l, r, i, n) {
|
|
4110
4110
|
if (t.objects.get(n) !== void 0)
|
|
4111
4111
|
throw new Error(`DiagramObject with id "${n}" already exists`);
|
|
@@ -4134,7 +4134,7 @@ class ti extends At {
|
|
|
4134
4134
|
return this.priority;
|
|
4135
4135
|
}
|
|
4136
4136
|
}
|
|
4137
|
-
class
|
|
4137
|
+
class oi extends pt {
|
|
4138
4138
|
/**
|
|
4139
4139
|
* Instance a set of objects for the given model. This method is used internally.
|
|
4140
4140
|
* @private
|
|
@@ -4154,7 +4154,7 @@ class ei extends pt {
|
|
|
4154
4154
|
* @returns The instanced object.
|
|
4155
4155
|
*/
|
|
4156
4156
|
new(t, e, a, l, r, i) {
|
|
4157
|
-
const n = new
|
|
4157
|
+
const n = new ei(
|
|
4158
4158
|
this.model,
|
|
4159
4159
|
t,
|
|
4160
4160
|
e,
|
|
@@ -4170,9 +4170,9 @@ class ei extends pt {
|
|
|
4170
4170
|
e && (super.remove(t), e.updateInView());
|
|
4171
4171
|
}
|
|
4172
4172
|
}
|
|
4173
|
-
class
|
|
4173
|
+
class Qe {
|
|
4174
4174
|
constructor(t, e, a, l, r, i = []) {
|
|
4175
|
-
this.nodes = new
|
|
4175
|
+
this.nodes = new _o(this), this.sections = new Ho(this), this.ports = new Yo(this), this.connections = new No(this), this.fields = new Po(this), this.objects = new oi(this), this.decorators = new ti(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new kt(new ee(i), this);
|
|
4176
4176
|
}
|
|
4177
4177
|
/**
|
|
4178
4178
|
* Deletes everything in this diagram.
|
|
@@ -4182,7 +4182,7 @@ class Je {
|
|
|
4182
4182
|
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();
|
|
4183
4183
|
}
|
|
4184
4184
|
}
|
|
4185
|
-
const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) =>
|
|
4185
|
+
const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
|
|
4186
4186
|
s,
|
|
4187
4187
|
[t, e],
|
|
4188
4188
|
a,
|
|
@@ -4197,7 +4197,7 @@ const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
|
|
|
4197
4197
|
s ? A.select("body").style("cursor", s) : A.select("body").style("cursor", x.Auto);
|
|
4198
4198
|
}, ht = (s) => s instanceof z ? s : s instanceof B ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof B || s.rootElement instanceof wt ? ht(s.rootElement) : s, ce = (s) => {
|
|
4199
4199
|
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");
|
|
4200
|
-
},
|
|
4200
|
+
}, Rt = {
|
|
4201
4201
|
fillColor: "#FFFFFF",
|
|
4202
4202
|
borderColor: "#000000",
|
|
4203
4203
|
borderThickness: 1,
|
|
@@ -4214,18 +4214,18 @@ const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
|
|
|
4214
4214
|
)
|
|
4215
4215
|
).attr(
|
|
4216
4216
|
"fill",
|
|
4217
|
-
(t) => t.look.fillColor ||
|
|
4217
|
+
(t) => t.look.fillColor || Rt.fillColor
|
|
4218
4218
|
).attr(
|
|
4219
4219
|
"stroke",
|
|
4220
|
-
(t) => t.look.borderColor ||
|
|
4220
|
+
(t) => t.look.borderColor || Rt.borderColor
|
|
4221
4221
|
).attr(
|
|
4222
4222
|
"stroke-width",
|
|
4223
|
-
(t) => `${t.look.borderThickness ||
|
|
4223
|
+
(t) => `${t.look.borderThickness || Rt.borderThickness}px`
|
|
4224
4224
|
).attr(
|
|
4225
4225
|
"stroke-dasharray",
|
|
4226
4226
|
(t) => pe(
|
|
4227
|
-
t.look.borderStyle ||
|
|
4228
|
-
t.type?.defaultLook?.borderThickness || t.look?.borderThickness ||
|
|
4227
|
+
t.look.borderStyle || Rt.borderStyle,
|
|
4228
|
+
t.type?.defaultLook?.borderThickness || t.look?.borderThickness || Rt.borderThickness
|
|
4229
4229
|
)
|
|
4230
4230
|
), 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(
|
|
4231
4231
|
"href",
|
|
@@ -4270,7 +4270,7 @@ const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
|
|
|
4270
4270
|
snap: !1,
|
|
4271
4271
|
spacing: 10,
|
|
4272
4272
|
thickness: 0.05
|
|
4273
|
-
},
|
|
4273
|
+
}, ii = (s, t, e) => {
|
|
4274
4274
|
const a = t.append("defs");
|
|
4275
4275
|
if (s.gridSize > 0 && isFinite(s.gridSize)) {
|
|
4276
4276
|
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");
|
|
@@ -4290,10 +4290,10 @@ const bt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
|
|
|
4290
4290
|
}
|
|
4291
4291
|
t.select("rect").attr("fill", `url(#${e})`);
|
|
4292
4292
|
}
|
|
4293
|
-
}, ve = 96, Z = 32, Et = ve + Z,
|
|
4293
|
+
}, ve = 96, Z = 32, Et = ve + Z, si = Math.PI / 4, ni = 100, ze = {
|
|
4294
4294
|
customButtons: []
|
|
4295
4295
|
};
|
|
4296
|
-
class
|
|
4296
|
+
class ri {
|
|
4297
4297
|
/**
|
|
4298
4298
|
* Constructs a context menu object.
|
|
4299
4299
|
* @public
|
|
@@ -4351,7 +4351,7 @@ class ni {
|
|
|
4351
4351
|
onPress: void 0
|
|
4352
4352
|
});
|
|
4353
4353
|
for (let i = 0; i < r.length; ++i) {
|
|
4354
|
-
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) *
|
|
4354
|
+
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * si, c = l.append("xhtml:div").attr(
|
|
4355
4355
|
"class",
|
|
4356
4356
|
`daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
|
|
4357
4357
|
).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * Z}px`).style("height", `${2 * Z}px`).style("border-radius", `${Z}px`).style("pointer-events", "auto").on(S.Click, (h) => {
|
|
@@ -4359,7 +4359,7 @@ class ni {
|
|
|
4359
4359
|
}).on(S.KeyDown, (h) => {
|
|
4360
4360
|
o && h.key === q.Enter && (h.preventDefault(), o(this.canvas));
|
|
4361
4361
|
});
|
|
4362
|
-
n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Z}px`).style("top", `${1.1 * Z}px`).style("text-align", "center").style("width", `${1.6 * Z}px`).style("height", `${0.35 * Z}px`).style("margin", "0").style("font-size", `${0.35 * Z}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(A.easeLinear).duration(
|
|
4362
|
+
n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Z}px`).style("top", `${1.1 * Z}px`).style("text-align", "center").style("width", `${1.6 * Z}px`).style("height", `${0.35 * Z}px`).style("margin", "0").style("font-size", `${0.35 * Z}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(A.easeLinear).duration(ni).tween("progress", () => (h) => {
|
|
4363
4363
|
const u = d * h;
|
|
4364
4364
|
return c.style(
|
|
4365
4365
|
"left",
|
|
@@ -4379,7 +4379,7 @@ class ni {
|
|
|
4379
4379
|
this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
|
-
class
|
|
4382
|
+
class ai extends pt {
|
|
4383
4383
|
/**
|
|
4384
4384
|
* Constructs a user highlight object.
|
|
4385
4385
|
* @public
|
|
@@ -4401,7 +4401,7 @@ class ri extends pt {
|
|
|
4401
4401
|
* @param element
|
|
4402
4402
|
*/
|
|
4403
4403
|
focusOn(t) {
|
|
4404
|
-
this.clear(), this.focus = t, (t instanceof gt || t instanceof
|
|
4404
|
+
this.clear(), this.focus = t, (t instanceof gt || t instanceof Je) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
|
|
4405
4405
|
}
|
|
4406
4406
|
add(t) {
|
|
4407
4407
|
if (super.add(t), t instanceof z) {
|
|
@@ -4433,13 +4433,13 @@ class ri extends pt {
|
|
|
4433
4433
|
this.focus = void 0;
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
|
-
const
|
|
4437
|
-
class
|
|
4436
|
+
const li = 1;
|
|
4437
|
+
class to {
|
|
4438
4438
|
export(t, e = !1) {
|
|
4439
4439
|
const a = {
|
|
4440
4440
|
name: t.name,
|
|
4441
4441
|
type: t.type,
|
|
4442
|
-
typeVersion:
|
|
4442
|
+
typeVersion: li,
|
|
4443
4443
|
createdAt: t.createdAt,
|
|
4444
4444
|
updatedAt: t.updatedAt,
|
|
4445
4445
|
nodes: [],
|
|
@@ -4577,17 +4577,17 @@ class Qe {
|
|
|
4577
4577
|
} : {};
|
|
4578
4578
|
}
|
|
4579
4579
|
}
|
|
4580
|
-
const
|
|
4581
|
-
class
|
|
4580
|
+
const di = "Diagram properties";
|
|
4581
|
+
class ci extends pt {
|
|
4582
4582
|
/**
|
|
4583
4583
|
* Constructs a user selection object.
|
|
4584
4584
|
* @public
|
|
4585
4585
|
* @param canvas A canvas.
|
|
4586
4586
|
*/
|
|
4587
4587
|
constructor(t, e) {
|
|
4588
|
-
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(
|
|
4588
|
+
super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(co(2e3)).subscribe(() => {
|
|
4589
4589
|
this.makeUpdateValuesAction();
|
|
4590
|
-
}), this.diagramPropertiesText = e !== void 0 ? e :
|
|
4590
|
+
}), this.diagramPropertiesText = e !== void 0 ? e : di;
|
|
4591
4591
|
}
|
|
4592
4592
|
add(t) {
|
|
4593
4593
|
if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof ct) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof B ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
|
|
@@ -4636,7 +4636,7 @@ class di extends pt {
|
|
|
4636
4636
|
const t = [], e = [], a = [], l = [], r = [];
|
|
4637
4637
|
for (const n of this.all())
|
|
4638
4638
|
n instanceof z ? t.push(n.id) : n instanceof B ? e.push(n.id) : n instanceof wt ? a.push(n.id) : n instanceof ct ? l.push(n.id) : n instanceof gt && r.push(n.id);
|
|
4639
|
-
const i = new
|
|
4639
|
+
const i = new qo(
|
|
4640
4640
|
this.canvas,
|
|
4641
4641
|
t,
|
|
4642
4642
|
e,
|
|
@@ -4652,7 +4652,7 @@ class di extends pt {
|
|
|
4652
4652
|
* @public
|
|
4653
4653
|
*/
|
|
4654
4654
|
copyToClipboard() {
|
|
4655
|
-
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new
|
|
4655
|
+
const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new to();
|
|
4656
4656
|
for (const a of this.all())
|
|
4657
4657
|
a instanceof z && t.nodes.push(e.exportNode(a, !1)), a instanceof ct && t.connections.push(
|
|
4658
4658
|
e.exportConnection(a, !1)
|
|
@@ -4676,7 +4676,7 @@ class di extends pt {
|
|
|
4676
4676
|
const a = JSON.parse(e);
|
|
4677
4677
|
if (a.type !== "daga-user-selection")
|
|
4678
4678
|
return;
|
|
4679
|
-
const l = new
|
|
4679
|
+
const l = new Jo(
|
|
4680
4680
|
this.canvas,
|
|
4681
4681
|
a.nodes,
|
|
4682
4682
|
a.connections,
|
|
@@ -4707,17 +4707,17 @@ class di extends pt {
|
|
|
4707
4707
|
makeUpdateValuesAction() {
|
|
4708
4708
|
if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
|
|
4709
4709
|
return;
|
|
4710
|
-
const t = this.propertyEditorSelection instanceof
|
|
4710
|
+
const t = this.propertyEditorSelection instanceof Qe ? void 0 : this.propertyEditorSelection.id;
|
|
4711
4711
|
if (Ct(
|
|
4712
4712
|
this.propertyEditorValues,
|
|
4713
4713
|
this.propertyEditorSelection?.valueSet.getValues()
|
|
4714
4714
|
))
|
|
4715
4715
|
return;
|
|
4716
|
-
const e = this.propertyEditorValues, a = $t(this.propertyEditorSelection?.valueSet.getValues()), [l, r] =
|
|
4716
|
+
const e = this.propertyEditorValues, a = $t(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = De(
|
|
4717
4717
|
e,
|
|
4718
4718
|
a,
|
|
4719
4719
|
this.propertyEditorSelection?.valueSet
|
|
4720
|
-
), i = new
|
|
4720
|
+
), i = new Ko(
|
|
4721
4721
|
this.canvas,
|
|
4722
4722
|
t,
|
|
4723
4723
|
l,
|
|
@@ -4726,10 +4726,10 @@ class di extends pt {
|
|
|
4726
4726
|
i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
|
|
4727
4727
|
}
|
|
4728
4728
|
}
|
|
4729
|
-
const
|
|
4730
|
-
const a =
|
|
4729
|
+
const hi = (s) => s * Math.PI / 180, Ve = (s, t, e) => {
|
|
4730
|
+
const a = hi(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
|
|
4731
4731
|
return [i, n];
|
|
4732
|
-
},
|
|
4732
|
+
}, Re = navigator?.userAgent?.indexOf("AppleWebKit") >= 0, gi = 12, H = 6, fi = 25, ge = "diagram-connection-unfinished", Qt = class Qt {
|
|
4733
4733
|
/**
|
|
4734
4734
|
* Constructs a canvas object.
|
|
4735
4735
|
* @public
|
|
@@ -4737,24 +4737,24 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
4737
4737
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
4738
4738
|
*/
|
|
4739
4739
|
constructor(t, e) {
|
|
4740
|
-
if (this.backgroundPatternId = `daga-background-pattern-id-${Qt.canvasCount++}`, this.zoomTransform = A.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new
|
|
4740
|
+
if (this.backgroundPatternId = `daga-background-pattern-id-${Qt.canvasCount++}`, this.zoomTransform = A.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new Qe(
|
|
4741
4741
|
this,
|
|
4742
4742
|
void 0,
|
|
4743
4743
|
e.name || "unnamed",
|
|
4744
4744
|
"",
|
|
4745
4745
|
e.type || "",
|
|
4746
4746
|
e.properties || []
|
|
4747
|
-
), this.userSelection = new
|
|
4747
|
+
), this.userSelection = new ci(
|
|
4748
4748
|
this,
|
|
4749
4749
|
e.components?.propertyEditor?.title
|
|
4750
|
-
), this.userHighlight = new
|
|
4750
|
+
), this.userHighlight = new ai(
|
|
4751
4751
|
this,
|
|
4752
4752
|
e.canvas?.highlightSections !== !1
|
|
4753
|
-
), this.contextMenu = new
|
|
4753
|
+
), this.contextMenu = new ri(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Ot.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Ot.spacing), this.gridThickness = Math.abs(
|
|
4754
4754
|
e.canvas?.grid?.thickness || Ot.thickness
|
|
4755
|
-
), this.gridColor = e.canvas?.grid?.color || Ot.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Ot.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
|
|
4755
|
+
), this.gridColor = e.canvas?.grid?.color || Ot.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Ot.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 jo(this, fi), this.collabEngine = new Xo(this), e.nodeTypes)
|
|
4756
4756
|
for (const a of e.nodeTypes) {
|
|
4757
|
-
const l = new
|
|
4757
|
+
const l = new Xe({
|
|
4758
4758
|
...e.nodeTypeDefaults,
|
|
4759
4759
|
...a
|
|
4760
4760
|
});
|
|
@@ -4762,7 +4762,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
4762
4762
|
}
|
|
4763
4763
|
if (e.portTypes)
|
|
4764
4764
|
for (const a of e.portTypes) {
|
|
4765
|
-
const l = new
|
|
4765
|
+
const l = new Bo({
|
|
4766
4766
|
...e.portTypeDefaults,
|
|
4767
4767
|
...a
|
|
4768
4768
|
});
|
|
@@ -4770,7 +4770,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
4770
4770
|
}
|
|
4771
4771
|
if (e.connectionTypes) {
|
|
4772
4772
|
for (const a of e.connectionTypes) {
|
|
4773
|
-
const l = new
|
|
4773
|
+
const l = new Be({
|
|
4774
4774
|
...e.connectionTypeDefaults,
|
|
4775
4775
|
...a
|
|
4776
4776
|
});
|
|
@@ -4871,8 +4871,8 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
4871
4871
|
this.selectCanvasElements().attr("transform", r), A.select(`#${this.backgroundPatternId}`).attr(
|
|
4872
4872
|
"patternTransform",
|
|
4873
4873
|
r
|
|
4874
|
-
), this.contextMenu.close(), this.diagramEvent$.next(
|
|
4875
|
-
new
|
|
4874
|
+
), Re && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
|
|
4875
|
+
new Qo(
|
|
4876
4876
|
[this.zoomTransform.x, this.zoomTransform.y],
|
|
4877
4877
|
this.zoomTransform.k
|
|
4878
4878
|
)
|
|
@@ -4903,7 +4903,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
4903
4903
|
}).on(I.End, (l) => {
|
|
4904
4904
|
this.finishMultipleSelection(l);
|
|
4905
4905
|
})
|
|
4906
|
-
),
|
|
4906
|
+
), ii(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
|
|
4907
4907
|
}
|
|
4908
4908
|
getZoomLevel() {
|
|
4909
4909
|
return this.zoomTransform.k;
|
|
@@ -5591,7 +5591,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
5591
5591
|
)
|
|
5592
5592
|
).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
|
|
5593
5593
|
"stroke-width",
|
|
5594
|
-
(n) => `${(n.look.thickness || it.look.thickness) +
|
|
5594
|
+
(n) => `${(n.look.thickness || it.look.thickness) + gi}px`
|
|
5595
5595
|
).attr(
|
|
5596
5596
|
"stroke-dasharray",
|
|
5597
5597
|
(n) => pe(
|
|
@@ -5614,7 +5614,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
5614
5614
|
const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-field");
|
|
5615
5615
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
|
|
5616
5616
|
const r = l.merge(e);
|
|
5617
|
-
a.remove(), l.style("box-sizing", "border-box").on(S.MouseOver, (i, n) => {
|
|
5617
|
+
if (a.remove(), l.style("box-sizing", "border-box").on(S.MouseOver, (i, n) => {
|
|
5618
5618
|
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
|
|
5619
5619
|
}).on(S.Click, (i, n) => {
|
|
5620
5620
|
if (!i.ctrlKey && !i.shiftKey) {
|
|
@@ -5691,10 +5691,10 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
5691
5691
|
(i) => i.verticalAlign === qt.Center ? "center" : i.verticalAlign === qt.Bottom ? "end" : "start"
|
|
5692
5692
|
).select("p").style(
|
|
5693
5693
|
"max-width",
|
|
5694
|
-
(i) => i.fit ? "default" : `${
|
|
5694
|
+
(i) => i.fit ? "default" : `${Ve(i.width, i.height, i.orientation)[0]}px`
|
|
5695
5695
|
).style(
|
|
5696
5696
|
"max-height",
|
|
5697
|
-
(i) => i.fit ? "default" : `${
|
|
5697
|
+
(i) => i.fit ? "default" : `${Ve(i.width, i.height, i.orientation)[1]}px`
|
|
5698
5698
|
).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
|
|
5699
5699
|
"text-align",
|
|
5700
5700
|
(i) => i.horizontalAlign === Mt.Center ? "center" : i.horizontalAlign === Mt.Right ? "end" : "start"
|
|
@@ -5706,18 +5706,25 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
5706
5706
|
(i) => i.selected ? i.selectedColor || "#000000" : i.color || "#000000"
|
|
5707
5707
|
).html(
|
|
5708
5708
|
(i) => i.text.replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>")
|
|
5709
|
-
)
|
|
5709
|
+
), Re) {
|
|
5710
|
+
const i = this.zoomTransform.k;
|
|
5711
|
+
r.attr("width", (n) => `${n.width * i}px`).attr("height", (n) => `${n.height * i}px`).select("div").style("position", "absolute").style(
|
|
5712
|
+
"left",
|
|
5713
|
+
(n) => `${n.coords[0] * i + this.zoomTransform.x}px`
|
|
5714
|
+
).style(
|
|
5715
|
+
"top",
|
|
5716
|
+
(n) => `${n.coords[1] * i + this.zoomTransform.y}px`
|
|
5717
|
+
).select("p").style("font-size", (n) => `${n.fontSize * i}px`);
|
|
5718
|
+
}
|
|
5710
5719
|
}
|
|
5711
5720
|
updateObjectsInView(...t) {
|
|
5712
|
-
let e = this.selectCanvasElements().selectAll(
|
|
5713
|
-
"foreignObject.diagram-object"
|
|
5714
|
-
).data(
|
|
5721
|
+
let e = this.selectCanvasElements().selectAll("g.diagram-object").data(
|
|
5715
5722
|
this.model.objects.filter(
|
|
5716
5723
|
(i) => this.priorityThreshold !== void 0 ? i.getPriority() >= this.priorityThreshold : !0
|
|
5717
5724
|
),
|
|
5718
5725
|
(i) => i.id
|
|
5719
5726
|
);
|
|
5720
|
-
const a = e.exit(), l = e.enter().append("
|
|
5727
|
+
const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-object");
|
|
5721
5728
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on(S.ContextMenu, (i, n) => {
|
|
5722
5729
|
if (this.dragging) {
|
|
5723
5730
|
i.preventDefault(), i.stopPropagation(), this.dragging = !1;
|
|
@@ -5739,15 +5746,13 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
5739
5746
|
);
|
|
5740
5747
|
}
|
|
5741
5748
|
updateDecoratorsInView(...t) {
|
|
5742
|
-
let e = this.selectCanvasElements().selectAll(
|
|
5743
|
-
"foreignObject.diagram-decorator"
|
|
5744
|
-
).data(
|
|
5749
|
+
let e = this.selectCanvasElements().selectAll("g.diagram-decorator").data(
|
|
5745
5750
|
this.model.decorators.filter(
|
|
5746
5751
|
(i) => this.priorityThreshold !== void 0 ? i.getPriority() >= this.priorityThreshold : !0
|
|
5747
5752
|
),
|
|
5748
5753
|
(i) => i.id
|
|
5749
5754
|
);
|
|
5750
|
-
const a = e.exit(), l = e.enter().append("
|
|
5755
|
+
const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-decorator");
|
|
5751
5756
|
t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on(S.MouseOver, (i, n) => {
|
|
5752
5757
|
this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
|
|
5753
5758
|
}).on(S.Click, (i, n) => {
|
|
@@ -6183,7 +6188,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
6183
6188
|
}
|
|
6184
6189
|
}).on(S.Input, () => {
|
|
6185
6190
|
const C = h.property("value");
|
|
6186
|
-
h.attr("cols",
|
|
6191
|
+
h.attr("cols", Co(C) + 1), h.attr("rows", $o(C) + 1), h.style("width", ""), h.style("height", ""), u = h.property("scrollWidth") + 1, b = h.property("scrollHeight") + 1;
|
|
6187
6192
|
const g = Math.max(u, a), m = Math.max(b, l);
|
|
6188
6193
|
c?.attr("width", `${g}px`), h.style("width", `${g}px`), c?.attr("height", `${m}px`), h.style("height", `${m}px`), o && o(C);
|
|
6189
6194
|
}).on(S.Click, (C) => {
|
|
@@ -6275,11 +6280,11 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
6275
6280
|
e.move(a);
|
|
6276
6281
|
const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
|
|
6277
6282
|
(o) => o.type.childrenTypes.includes(e.type.id)
|
|
6278
|
-
), i =
|
|
6283
|
+
), i = je(
|
|
6279
6284
|
r
|
|
6280
6285
|
), n = i[i.length - 1];
|
|
6281
6286
|
if (n !== e.parent && (e.type.canBeParentless || n !== void 0)) {
|
|
6282
|
-
const o = n?.getLastAncestor(), d = this.currentAction.from, c = new
|
|
6287
|
+
const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Zo(
|
|
6283
6288
|
this,
|
|
6284
6289
|
e.id,
|
|
6285
6290
|
e.parent?.id,
|
|
@@ -6325,7 +6330,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
6325
6330
|
const e = this.getPointerLocationRelativeToCanvas(t);
|
|
6326
6331
|
this.multipleSelectionContainer?.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
|
|
6327
6332
|
for (const a of this.model.nodes)
|
|
6328
|
-
|
|
6333
|
+
fo(
|
|
6329
6334
|
[
|
|
6330
6335
|
a.coords,
|
|
6331
6336
|
[a.coords[0] + a.width, a.coords[1] + a.height]
|
|
@@ -6339,7 +6344,7 @@ const ci = (s) => s * Math.PI / 180, Re = (s, t, e) => {
|
|
|
6339
6344
|
};
|
|
6340
6345
|
Qt.canvasCount = 0;
|
|
6341
6346
|
let ye = Qt;
|
|
6342
|
-
class
|
|
6347
|
+
class eo {
|
|
6343
6348
|
constructor() {
|
|
6344
6349
|
this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
|
|
6345
6350
|
}
|
|
@@ -6451,16 +6456,16 @@ class to {
|
|
|
6451
6456
|
}
|
|
6452
6457
|
}
|
|
6453
6458
|
}
|
|
6454
|
-
class
|
|
6459
|
+
class ui {
|
|
6455
6460
|
constructor(t) {
|
|
6456
6461
|
this.gapSize = t;
|
|
6457
6462
|
}
|
|
6458
6463
|
apply(t) {
|
|
6459
6464
|
if (t.nodes.length === 0)
|
|
6460
6465
|
return t;
|
|
6461
|
-
const e = new
|
|
6466
|
+
const e = new eo(), a = t.nodes.filter((n) => !n.parent);
|
|
6462
6467
|
for (; a.length > 0; )
|
|
6463
|
-
|
|
6468
|
+
oo(
|
|
6464
6469
|
a[0],
|
|
6465
6470
|
e,
|
|
6466
6471
|
[0, 0],
|
|
@@ -6478,25 +6483,25 @@ class fi {
|
|
|
6478
6483
|
return t;
|
|
6479
6484
|
}
|
|
6480
6485
|
}
|
|
6481
|
-
const
|
|
6486
|
+
const oo = (s, t, e, a) => {
|
|
6482
6487
|
const l = t.getClosestEmptyCoordinate(e);
|
|
6483
6488
|
t.set(l, s), X(a, s);
|
|
6484
6489
|
for (const r of s.getAdjacentNodes())
|
|
6485
|
-
a.includes(r) &&
|
|
6490
|
+
a.includes(r) && oo(
|
|
6486
6491
|
r,
|
|
6487
6492
|
t,
|
|
6488
6493
|
l,
|
|
6489
6494
|
a
|
|
6490
6495
|
);
|
|
6491
6496
|
};
|
|
6492
|
-
class
|
|
6497
|
+
class pi {
|
|
6493
6498
|
constructor(t) {
|
|
6494
6499
|
this.gapSize = t;
|
|
6495
6500
|
}
|
|
6496
6501
|
apply(t) {
|
|
6497
6502
|
if (t.nodes.length === 0)
|
|
6498
6503
|
return t;
|
|
6499
|
-
const e = new
|
|
6504
|
+
const e = new eo(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
|
|
6500
6505
|
let i = [r];
|
|
6501
6506
|
for (l[r.id] = [0, 0]; a.length > 0; ) {
|
|
6502
6507
|
const c = [];
|
|
@@ -6564,7 +6569,7 @@ class ne {
|
|
|
6564
6569
|
return t;
|
|
6565
6570
|
}
|
|
6566
6571
|
}
|
|
6567
|
-
class
|
|
6572
|
+
class mi {
|
|
6568
6573
|
constructor(t) {
|
|
6569
6574
|
this.gapSize = t;
|
|
6570
6575
|
}
|
|
@@ -6591,7 +6596,7 @@ class pi {
|
|
|
6591
6596
|
], g = [
|
|
6592
6597
|
p.coords[0] + p.width / 2,
|
|
6593
6598
|
p.coords[1] + p.height / 2
|
|
6594
|
-
], m =
|
|
6599
|
+
], m = Ge(
|
|
6595
6600
|
u.coords,
|
|
6596
6601
|
p.coords
|
|
6597
6602
|
), y = [p.coords[0], p.coords[1]];
|
|
@@ -6617,7 +6622,7 @@ class pi {
|
|
|
6617
6622
|
return t;
|
|
6618
6623
|
}
|
|
6619
6624
|
}
|
|
6620
|
-
class
|
|
6625
|
+
class vi {
|
|
6621
6626
|
constructor(t) {
|
|
6622
6627
|
this.gapSize = t;
|
|
6623
6628
|
}
|
|
@@ -6632,7 +6637,7 @@ class mi {
|
|
|
6632
6637
|
return t;
|
|
6633
6638
|
}
|
|
6634
6639
|
}
|
|
6635
|
-
class
|
|
6640
|
+
class yi {
|
|
6636
6641
|
constructor(t) {
|
|
6637
6642
|
this.gapSize = t;
|
|
6638
6643
|
}
|
|
@@ -6699,7 +6704,7 @@ class vi {
|
|
|
6699
6704
|
return t;
|
|
6700
6705
|
}
|
|
6701
6706
|
}
|
|
6702
|
-
class
|
|
6707
|
+
class bi {
|
|
6703
6708
|
constructor(t) {
|
|
6704
6709
|
this.gapSize = t;
|
|
6705
6710
|
}
|
|
@@ -6718,11 +6723,11 @@ class yi {
|
|
|
6718
6723
|
const c = r[0];
|
|
6719
6724
|
r.splice(0, 1);
|
|
6720
6725
|
const h = new Se(void 0, c);
|
|
6721
|
-
|
|
6726
|
+
io(h, r), i.push(h);
|
|
6722
6727
|
}
|
|
6723
6728
|
const n = [];
|
|
6724
6729
|
for (const c of i)
|
|
6725
|
-
n.push([c]),
|
|
6730
|
+
n.push([c]), so(c, n, n.length);
|
|
6726
6731
|
const o = Math.max(...t.nodes.map((c) => c.height));
|
|
6727
6732
|
let d = 0;
|
|
6728
6733
|
for (let c = 0; c < n.length; ++c) {
|
|
@@ -6741,21 +6746,21 @@ class yi {
|
|
|
6741
6746
|
return t;
|
|
6742
6747
|
}
|
|
6743
6748
|
}
|
|
6744
|
-
const
|
|
6749
|
+
const io = (s, t) => {
|
|
6745
6750
|
for (const e of s.node.getAdjacentNodes().sort((a, l) => l.getPriority() - a.getPriority())) {
|
|
6746
6751
|
const a = t.indexOf(e);
|
|
6747
6752
|
if (a >= 0) {
|
|
6748
6753
|
t.splice(a, 1);
|
|
6749
6754
|
const l = s.addBranch(e);
|
|
6750
|
-
|
|
6755
|
+
io(l, t);
|
|
6751
6756
|
}
|
|
6752
6757
|
}
|
|
6753
|
-
},
|
|
6758
|
+
}, so = (s, t, e) => {
|
|
6754
6759
|
if (s.branches.length > 0) {
|
|
6755
6760
|
for (; e >= t.length; )
|
|
6756
6761
|
t.push([]);
|
|
6757
6762
|
for (const a of s.branches)
|
|
6758
|
-
t[e].push(a),
|
|
6763
|
+
t[e].push(a), so(a, t, e + 1);
|
|
6759
6764
|
}
|
|
6760
6765
|
};
|
|
6761
6766
|
class Se {
|
|
@@ -6777,7 +6782,7 @@ class Se {
|
|
|
6777
6782
|
}
|
|
6778
6783
|
}
|
|
6779
6784
|
}
|
|
6780
|
-
class
|
|
6785
|
+
class ki {
|
|
6781
6786
|
constructor(t) {
|
|
6782
6787
|
this.gapSize = t;
|
|
6783
6788
|
}
|
|
@@ -6792,17 +6797,17 @@ class bi {
|
|
|
6792
6797
|
return t;
|
|
6793
6798
|
}
|
|
6794
6799
|
}
|
|
6795
|
-
const
|
|
6796
|
-
adjacency: new
|
|
6800
|
+
const Oe = {
|
|
6801
|
+
adjacency: new ui(),
|
|
6797
6802
|
breadth: new ne(),
|
|
6798
|
-
"breadth-adjacency": new
|
|
6799
|
-
force: new
|
|
6800
|
-
horizontal: new
|
|
6801
|
-
priority: new
|
|
6802
|
-
tree: new
|
|
6803
|
-
vertical: new
|
|
6804
|
-
},
|
|
6805
|
-
class
|
|
6803
|
+
"breadth-adjacency": new pi(),
|
|
6804
|
+
force: new mi(),
|
|
6805
|
+
horizontal: new vi(),
|
|
6806
|
+
priority: new yi(),
|
|
6807
|
+
tree: new bi(),
|
|
6808
|
+
vertical: new ki()
|
|
6809
|
+
}, wi = _e({}), It = _e({});
|
|
6810
|
+
class Si {
|
|
6806
6811
|
constructor(t, e) {
|
|
6807
6812
|
this.onTitleChange = t, this.onValueSetChange = e;
|
|
6808
6813
|
}
|
|
@@ -6866,10 +6871,10 @@ const Ce = ({
|
|
|
6866
6871
|
children: /* @__PURE__ */ v("div", { className: u() })
|
|
6867
6872
|
}
|
|
6868
6873
|
) });
|
|
6869
|
-
},
|
|
6874
|
+
}, Ci = () => {
|
|
6870
6875
|
const s = Bt(It), t = at(null), [e, a] = G([]);
|
|
6871
|
-
|
|
6872
|
-
|
|
6876
|
+
ho(s.validatorChange$, s.diagramChange$).pipe(
|
|
6877
|
+
go(() => l())
|
|
6873
6878
|
).subscribe();
|
|
6874
6879
|
const l = () => {
|
|
6875
6880
|
a([]);
|
|
@@ -6923,7 +6928,7 @@ const Ce = ({
|
|
|
6923
6928
|
n
|
|
6924
6929
|
)) }) })
|
|
6925
6930
|
] }) });
|
|
6926
|
-
},
|
|
6931
|
+
}, $i = 200, He = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), no = ({
|
|
6927
6932
|
disabled: s,
|
|
6928
6933
|
options: t,
|
|
6929
6934
|
value: e,
|
|
@@ -6952,25 +6957,25 @@ const Ce = ({
|
|
|
6952
6957
|
F(), L.preventDefault();
|
|
6953
6958
|
break;
|
|
6954
6959
|
case q.Enter:
|
|
6955
|
-
|
|
6960
|
+
V(t[n || 0]), L.preventDefault();
|
|
6956
6961
|
break;
|
|
6957
6962
|
default:
|
|
6958
6963
|
P();
|
|
6959
6964
|
}
|
|
6960
6965
|
}, P = () => {
|
|
6961
6966
|
if (!s) {
|
|
6962
|
-
const L =
|
|
6967
|
+
const L = He(r.trim());
|
|
6963
6968
|
c([]), u([]), p([]), g([]);
|
|
6964
|
-
for (const
|
|
6965
|
-
const Q =
|
|
6969
|
+
for (const R of t) {
|
|
6970
|
+
const Q = He(R.label).indexOf(L);
|
|
6966
6971
|
if (Q >= 0) {
|
|
6967
|
-
const et =
|
|
6972
|
+
const et = R.label.substring(0, Q), xt = R.label.substring(
|
|
6968
6973
|
Q,
|
|
6969
6974
|
Q + L.length
|
|
6970
|
-
),
|
|
6975
|
+
), Vt = R.label.substring(
|
|
6971
6976
|
Q + L.length
|
|
6972
6977
|
);
|
|
6973
|
-
c((ot) => [...ot,
|
|
6978
|
+
c((ot) => [...ot, R]), u((ot) => [
|
|
6974
6979
|
...ot,
|
|
6975
6980
|
et
|
|
6976
6981
|
]), p((ot) => [
|
|
@@ -6978,7 +6983,7 @@ const Ce = ({
|
|
|
6978
6983
|
xt
|
|
6979
6984
|
]), g((ot) => [
|
|
6980
6985
|
...ot,
|
|
6981
|
-
|
|
6986
|
+
Vt
|
|
6982
6987
|
]);
|
|
6983
6988
|
}
|
|
6984
6989
|
}
|
|
@@ -6988,23 +6993,23 @@ const Ce = ({
|
|
|
6988
6993
|
y(!1);
|
|
6989
6994
|
}, D = (L) => {
|
|
6990
6995
|
if (!s) {
|
|
6991
|
-
let
|
|
6996
|
+
let R = L;
|
|
6992
6997
|
if (L === void 0) {
|
|
6993
6998
|
o(void 0);
|
|
6994
6999
|
return;
|
|
6995
7000
|
}
|
|
6996
|
-
L < 0 && (
|
|
7001
|
+
L < 0 && (R = 0), L >= t.length && (R = t.length - 1), o(R);
|
|
6997
7002
|
}
|
|
6998
7003
|
}, j = () => {
|
|
6999
7004
|
setTimeout(() => {
|
|
7000
7005
|
F();
|
|
7001
|
-
},
|
|
7006
|
+
}, $i);
|
|
7002
7007
|
}, E = (L) => {
|
|
7003
|
-
const
|
|
7004
|
-
|
|
7008
|
+
const R = l.current?.querySelectorAll("li")[L];
|
|
7009
|
+
R && R.scrollIntoView({ block: "center" });
|
|
7005
7010
|
}, $ = () => {
|
|
7006
7011
|
s || (i(""), y(!1), o(void 0));
|
|
7007
|
-
},
|
|
7012
|
+
}, V = (L) => {
|
|
7008
7013
|
s || (i(L.label), y(!1), o(void 0), a(L.key));
|
|
7009
7014
|
};
|
|
7010
7015
|
return /* @__PURE__ */ M(
|
|
@@ -7029,25 +7034,25 @@ const Ce = ({
|
|
|
7029
7034
|
] }),
|
|
7030
7035
|
/* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ M("ul", { className: "daga-autocomplete-option-list", children: [
|
|
7031
7036
|
d.length === 0 && /* @__PURE__ */ v("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
|
|
7032
|
-
d.map((L,
|
|
7037
|
+
d.map((L, R) => /* @__PURE__ */ M(
|
|
7033
7038
|
"li",
|
|
7034
7039
|
{
|
|
7035
|
-
className: `daga-autocomplete-option ${
|
|
7036
|
-
onMouseMove: () => D(
|
|
7037
|
-
onClick: () =>
|
|
7040
|
+
className: `daga-autocomplete-option ${R === n ? "daga-focused" : ""}`,
|
|
7041
|
+
onMouseMove: () => D(R),
|
|
7042
|
+
onClick: () => V(L),
|
|
7038
7043
|
children: [
|
|
7039
|
-
/* @__PURE__ */ v("span", { children: h[
|
|
7040
|
-
/* @__PURE__ */ v("span", { className: "daga-match", children: b[
|
|
7041
|
-
/* @__PURE__ */ v("span", { children: C[
|
|
7044
|
+
/* @__PURE__ */ v("span", { children: h[R] }),
|
|
7045
|
+
/* @__PURE__ */ v("span", { className: "daga-match", children: b[R] }),
|
|
7046
|
+
/* @__PURE__ */ v("span", { children: C[R] })
|
|
7042
7047
|
]
|
|
7043
7048
|
},
|
|
7044
|
-
|
|
7049
|
+
R
|
|
7045
7050
|
))
|
|
7046
7051
|
] }) })
|
|
7047
7052
|
]
|
|
7048
7053
|
}
|
|
7049
7054
|
);
|
|
7050
|
-
},
|
|
7055
|
+
}, Ii = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ai = ({
|
|
7051
7056
|
disabled: s,
|
|
7052
7057
|
allowRepeats: t,
|
|
7053
7058
|
options: e,
|
|
@@ -7068,7 +7073,7 @@ const Ce = ({
|
|
|
7068
7073
|
}
|
|
7069
7074
|
};
|
|
7070
7075
|
ft(() => {
|
|
7071
|
-
const g = a.length === 0, m = a.map((y) =>
|
|
7076
|
+
const g = a.length === 0, m = a.map((y) => Ii(e, y));
|
|
7072
7077
|
o(m), g && l(a), u();
|
|
7073
7078
|
}, [a, e]);
|
|
7074
7079
|
const b = (g) => {
|
|
@@ -7092,7 +7097,7 @@ const Ce = ({
|
|
|
7092
7097
|
] }, m)),
|
|
7093
7098
|
!s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
|
|
7094
7099
|
/* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
7095
|
-
|
|
7100
|
+
no,
|
|
7096
7101
|
{
|
|
7097
7102
|
disabled: s,
|
|
7098
7103
|
options: t ? e || [] : d || [],
|
|
@@ -7103,7 +7108,7 @@ const Ce = ({
|
|
|
7103
7108
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: p, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7104
7109
|
] })
|
|
7105
7110
|
] });
|
|
7106
|
-
},
|
|
7111
|
+
}, xi = ({
|
|
7107
7112
|
disabled: s,
|
|
7108
7113
|
allowRepeats: t,
|
|
7109
7114
|
value: e,
|
|
@@ -7129,7 +7134,7 @@ const Ce = ({
|
|
|
7129
7134
|
}, h = (u) => {
|
|
7130
7135
|
u.key === "Enter" && d();
|
|
7131
7136
|
};
|
|
7132
|
-
return /* @__PURE__ */ M(
|
|
7137
|
+
return /* @__PURE__ */ M(lo, { children: [
|
|
7133
7138
|
e.map((u, b) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
|
|
7134
7139
|
/* @__PURE__ */ v(
|
|
7135
7140
|
"input",
|
|
@@ -7166,7 +7171,7 @@ const Ce = ({
|
|
|
7166
7171
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7167
7172
|
] })
|
|
7168
7173
|
] });
|
|
7169
|
-
},
|
|
7174
|
+
}, Li = ({
|
|
7170
7175
|
disabled: s,
|
|
7171
7176
|
value: t,
|
|
7172
7177
|
onChange: e
|
|
@@ -7281,7 +7286,7 @@ const Ce = ({
|
|
|
7281
7286
|
/* @__PURE__ */ v("button", { className: "daga-property-button", onClick: u, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
|
|
7282
7287
|
] })
|
|
7283
7288
|
] });
|
|
7284
|
-
},
|
|
7289
|
+
}, ro = ({
|
|
7285
7290
|
valueSet: s,
|
|
7286
7291
|
onValueChange: t,
|
|
7287
7292
|
depth: e
|
|
@@ -7421,7 +7426,7 @@ const Ce = ({
|
|
|
7421
7426
|
)
|
|
7422
7427
|
] }),
|
|
7423
7428
|
o.type === N.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
|
|
7424
|
-
|
|
7429
|
+
no,
|
|
7425
7430
|
{
|
|
7426
7431
|
disabled: o.editable === !1 || !l,
|
|
7427
7432
|
options: o.options || [],
|
|
@@ -7430,7 +7435,7 @@ const Ce = ({
|
|
|
7430
7435
|
}
|
|
7431
7436
|
) }),
|
|
7432
7437
|
(o.type === N.OptionList || o.type === N.OptionSet) && /* @__PURE__ */ v(
|
|
7433
|
-
|
|
7438
|
+
Ai,
|
|
7434
7439
|
{
|
|
7435
7440
|
disabled: o.editable === !1 || !l,
|
|
7436
7441
|
allowRepeats: o.type === N.OptionList,
|
|
@@ -7440,7 +7445,7 @@ const Ce = ({
|
|
|
7440
7445
|
}
|
|
7441
7446
|
),
|
|
7442
7447
|
(o.type === N.TextList || o.type === N.TextSet) && /* @__PURE__ */ v(
|
|
7443
|
-
|
|
7448
|
+
xi,
|
|
7444
7449
|
{
|
|
7445
7450
|
disabled: o.editable === !1 || !l,
|
|
7446
7451
|
allowRepeats: o.type === N.TextList,
|
|
@@ -7449,7 +7454,7 @@ const Ce = ({
|
|
|
7449
7454
|
}
|
|
7450
7455
|
),
|
|
7451
7456
|
o.type === N.TextMap && /* @__PURE__ */ v(
|
|
7452
|
-
|
|
7457
|
+
Li,
|
|
7453
7458
|
{
|
|
7454
7459
|
disabled: o.editable === !1 || !l,
|
|
7455
7460
|
value: s?.getValue(o.name),
|
|
@@ -7457,7 +7462,7 @@ const Ce = ({
|
|
|
7457
7462
|
}
|
|
7458
7463
|
),
|
|
7459
7464
|
o.type === N.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
|
|
7460
|
-
|
|
7465
|
+
ro,
|
|
7461
7466
|
{
|
|
7462
7467
|
valueSet: s.getSubValueSet(o.name),
|
|
7463
7468
|
onValueChange: t,
|
|
@@ -7468,7 +7473,7 @@ const Ce = ({
|
|
|
7468
7473
|
},
|
|
7469
7474
|
o.name
|
|
7470
7475
|
)) });
|
|
7471
|
-
},
|
|
7476
|
+
}, ao = ({ valueSet: s, depth: t }) => {
|
|
7472
7477
|
const e = Bt(It), a = at(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
|
|
7473
7478
|
for (const o of s?.displayedProperties || []) {
|
|
7474
7479
|
let d = 0, c = 0, h = 0;
|
|
@@ -7531,7 +7536,7 @@ const Ce = ({
|
|
|
7531
7536
|
if (s === void 0)
|
|
7532
7537
|
return;
|
|
7533
7538
|
let d;
|
|
7534
|
-
o instanceof
|
|
7539
|
+
o instanceof Mo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
|
|
7535
7540
|
o.target?.value || ""
|
|
7536
7541
|
) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
|
|
7537
7542
|
};
|
|
@@ -7561,9 +7566,9 @@ const Ce = ({
|
|
|
7561
7566
|
)
|
|
7562
7567
|
] })
|
|
7563
7568
|
] }),
|
|
7564
|
-
o.type !== N.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children:
|
|
7569
|
+
o.type !== N.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Ei(s?.getValue(o.name)) }),
|
|
7565
7570
|
o.type === N.Object && /* @__PURE__ */ v(
|
|
7566
|
-
|
|
7571
|
+
ao,
|
|
7567
7572
|
{
|
|
7568
7573
|
valueSet: s?.getSubValueSet(o.name),
|
|
7569
7574
|
depth: t + 1
|
|
@@ -7583,7 +7588,7 @@ const Ce = ({
|
|
|
7583
7588
|
o.name
|
|
7584
7589
|
))
|
|
7585
7590
|
] });
|
|
7586
|
-
},
|
|
7591
|
+
}, Ei = (s) => Array.isArray(s) ? s.join(", ") : To(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, Mi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
|
|
7587
7592
|
const n = at(null), [o, d] = G(!1), [c, h] = G(!1), u = () => A.select(n.current);
|
|
7588
7593
|
return ft(() => {
|
|
7589
7594
|
if (n.current)
|
|
@@ -7635,19 +7640,19 @@ const Ce = ({
|
|
|
7635
7640
|
)
|
|
7636
7641
|
] }),
|
|
7637
7642
|
!c && /* @__PURE__ */ v(
|
|
7638
|
-
|
|
7643
|
+
ro,
|
|
7639
7644
|
{
|
|
7640
7645
|
valueSet: r,
|
|
7641
7646
|
onValueChange: i,
|
|
7642
7647
|
depth: 0
|
|
7643
7648
|
}
|
|
7644
7649
|
),
|
|
7645
|
-
c && /* @__PURE__ */ v(
|
|
7650
|
+
c && /* @__PURE__ */ v(ao, { valueSet: r, depth: 0 })
|
|
7646
7651
|
] }) })
|
|
7647
7652
|
]
|
|
7648
7653
|
}
|
|
7649
7654
|
) });
|
|
7650
|
-
},
|
|
7655
|
+
}, Ti = 6, Ni = (s) => {
|
|
7651
7656
|
const t = Bt(It), [e, a] = G(
|
|
7652
7657
|
s.currentPalette || s.palettes[0]
|
|
7653
7658
|
), [l, r] = G(0), [i, n] = G(
|
|
@@ -7686,39 +7691,39 @@ const Ce = ({
|
|
|
7686
7691
|
"class",
|
|
7687
7692
|
`daga-template-container ${y !== void 0 ? y : ""}`
|
|
7688
7693
|
).style("width", `${j}px`).style("height", `${D}px`).call(
|
|
7689
|
-
A.drag().on(I.Drag, (
|
|
7694
|
+
A.drag().on(I.Drag, (V) => {
|
|
7690
7695
|
if (t.canUserPerformAction(k.AddNode)) {
|
|
7691
|
-
const L = t.getPointerLocationRelativeToScreen(
|
|
7696
|
+
const L = t.getPointerLocationRelativeToScreen(V);
|
|
7692
7697
|
if (L.length < 2 || isNaN(L[0]) || isNaN(L[1]))
|
|
7693
7698
|
return;
|
|
7694
7699
|
E.style("position", "fixed").style("left", `${L[0] - j / 2}px`).style("top", `${L[1] - D / 2}px`).style("z-index", 1);
|
|
7695
7700
|
}
|
|
7696
|
-
}).on(I.Start, (
|
|
7701
|
+
}).on(I.Start, (V) => {
|
|
7697
7702
|
if (t.canUserPerformAction(k.AddNode)) {
|
|
7698
7703
|
w(x.Grabbing);
|
|
7699
|
-
const L = t.getPointerLocationRelativeToScreen(
|
|
7704
|
+
const L = t.getPointerLocationRelativeToScreen(V);
|
|
7700
7705
|
if (L.length < 2 || isNaN(L[0]) || isNaN(L[1]))
|
|
7701
7706
|
return;
|
|
7702
7707
|
E.style("position", "fixed").style("left", `${L[0] - j / 2}px`).style("top", `${L[1] - D / 2}px`).style("z-index", 1), g.isUnique && t.model.nodes.find(
|
|
7703
|
-
(
|
|
7708
|
+
(R) => !R.removed && R.type.id === g.id
|
|
7704
7709
|
) !== void 0 && w(x.NotAllowed);
|
|
7705
7710
|
}
|
|
7706
|
-
}).on(I.End, (
|
|
7711
|
+
}).on(I.End, (V) => {
|
|
7707
7712
|
if (t.canUserPerformAction(k.AddNode)) {
|
|
7708
7713
|
if (w(x.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), g.isUnique && t.model.nodes.find(
|
|
7709
7714
|
(Xt) => !Xt.removed && Xt.type.id === g.id
|
|
7710
7715
|
) !== void 0)
|
|
7711
7716
|
return;
|
|
7712
|
-
const L = t.getPointerLocationRelativeToScreen(
|
|
7717
|
+
const L = t.getPointerLocationRelativeToScreen(V);
|
|
7713
7718
|
if (L.length < 2 || isNaN(L[0]) || isNaN(L[1]))
|
|
7714
7719
|
return;
|
|
7715
|
-
const
|
|
7720
|
+
const R = document.elementFromPoint(
|
|
7716
7721
|
L[0],
|
|
7717
7722
|
L[1]
|
|
7718
7723
|
);
|
|
7719
|
-
if (
|
|
7724
|
+
if (R && !t.selectCanvasView().node()?.contains(R))
|
|
7720
7725
|
return;
|
|
7721
|
-
const dt = t.getPointerLocationRelativeToCanvas(
|
|
7726
|
+
const dt = t.getPointerLocationRelativeToCanvas(V);
|
|
7722
7727
|
if (dt.length < 2 || isNaN(dt[0]) || isNaN(dt[1]))
|
|
7723
7728
|
return;
|
|
7724
7729
|
let Q = [
|
|
@@ -7734,12 +7739,12 @@ const Ce = ({
|
|
|
7734
7739
|
dt[1]
|
|
7735
7740
|
).filter(
|
|
7736
7741
|
(Xt) => Xt.type.childrenTypes.includes(g.id)
|
|
7737
|
-
),
|
|
7742
|
+
), Vt = je(
|
|
7738
7743
|
xt
|
|
7739
|
-
), ot =
|
|
7744
|
+
), ot = Vt[Vt.length - 1];
|
|
7740
7745
|
if (!g.canBeParentless && ot === void 0)
|
|
7741
7746
|
return;
|
|
7742
|
-
const $e = ot?.getLastAncestor(), Ie = new
|
|
7747
|
+
const $e = ot?.getLastAncestor(), Ie = new Wo(
|
|
7743
7748
|
t,
|
|
7744
7749
|
g,
|
|
7745
7750
|
Q,
|
|
@@ -7793,21 +7798,21 @@ const Ce = ({
|
|
|
7793
7798
|
}
|
|
7794
7799
|
if (m.look === void 0) {
|
|
7795
7800
|
if (g.decorators)
|
|
7796
|
-
for (const
|
|
7797
|
-
E.append("foreignObject").attr("width", `${
|
|
7801
|
+
for (const V of g.decorators)
|
|
7802
|
+
E.append("foreignObject").attr("width", `${V.width}px`).attr("height", `${V.height}px`).attr(
|
|
7798
7803
|
"transform",
|
|
7799
|
-
`translate(${
|
|
7800
|
-
).html(
|
|
7804
|
+
`translate(${V.coords[0]},${V.coords[1]})`
|
|
7805
|
+
).html(V.html);
|
|
7801
7806
|
if (m.label) {
|
|
7802
|
-
const
|
|
7807
|
+
const V = {
|
|
7803
7808
|
...O,
|
|
7804
7809
|
...g.label,
|
|
7805
7810
|
...m.labelLook
|
|
7806
7811
|
};
|
|
7807
7812
|
E.append("text").attr(
|
|
7808
7813
|
"transform",
|
|
7809
|
-
`translate(${(Y(
|
|
7810
|
-
).attr("x", 0).attr("y", 0).attr("font-size", `${
|
|
7814
|
+
`translate(${(Y(V) + g.defaultWidth) / 2},${(U(V) + g.defaultHeight) / 2})`
|
|
7815
|
+
).attr("x", 0).attr("y", 0).attr("font-size", `${V.fontSize}px`).attr("text-anchor", "middle").attr("font-family", V.fontFamily).attr("font-weight", 400).attr("fill", V.color).attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(m.label);
|
|
7811
7816
|
}
|
|
7812
7817
|
}
|
|
7813
7818
|
}, C = (g, m, y) => {
|
|
@@ -7828,7 +7833,7 @@ const Ce = ({
|
|
|
7828
7833
|
)
|
|
7829
7834
|
).attr("fill", m.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), m.icon !== "" && T.append("image").attr("x", 0).attr("y", 0).attr("width", m.width).attr("height", m.height).attr("href", m.icon), m.label !== "" && T.append("text").attr(
|
|
7830
7835
|
"transform",
|
|
7831
|
-
`translate(${m.width / 2},${m.height / 2 +
|
|
7836
|
+
`translate(${m.width / 2},${m.height / 2 + Ti})`
|
|
7832
7837
|
).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(m.label);
|
|
7833
7838
|
};
|
|
7834
7839
|
return ft(() => {
|
|
@@ -7878,7 +7883,7 @@ const Ce = ({
|
|
|
7878
7883
|
]
|
|
7879
7884
|
}
|
|
7880
7885
|
) });
|
|
7881
|
-
},
|
|
7886
|
+
}, Pi = ({
|
|
7882
7887
|
location: s,
|
|
7883
7888
|
direction: t,
|
|
7884
7889
|
enableAction: e,
|
|
@@ -7930,7 +7935,7 @@ const Ce = ({
|
|
|
7930
7935
|
}, F = () => {
|
|
7931
7936
|
y.center();
|
|
7932
7937
|
}, D = () => {
|
|
7933
|
-
y.layoutFormat && y.layoutFormat in
|
|
7938
|
+
y.layoutFormat && y.layoutFormat in Oe && Oe[y.layoutFormat].apply(y.model);
|
|
7934
7939
|
}, j = () => {
|
|
7935
7940
|
n = !n, A.select(
|
|
7936
7941
|
g.current
|
|
@@ -7943,11 +7948,11 @@ const Ce = ({
|
|
|
7943
7948
|
y.actionStack.undo();
|
|
7944
7949
|
}, $ = () => {
|
|
7945
7950
|
y.actionStack.redo();
|
|
7946
|
-
},
|
|
7951
|
+
}, V = () => {
|
|
7947
7952
|
y.userSelection.copyToClipboard();
|
|
7948
7953
|
}, L = () => {
|
|
7949
7954
|
y.userSelection.cutToClipboard();
|
|
7950
|
-
},
|
|
7955
|
+
}, R = () => {
|
|
7951
7956
|
y.userSelection.pasteFromClipboard();
|
|
7952
7957
|
}, dt = () => {
|
|
7953
7958
|
y.userSelection.removeFromModel();
|
|
@@ -7956,7 +7961,7 @@ const Ce = ({
|
|
|
7956
7961
|
C.current
|
|
7957
7962
|
).classed("daga-on", !0).classed("daga-off", !1);
|
|
7958
7963
|
const et = y.diagramEvent$.subscribe((xt) => {
|
|
7959
|
-
xt.type ===
|
|
7964
|
+
xt.type === qe.Selection && (A.select(
|
|
7960
7965
|
C.current
|
|
7961
7966
|
).classed("daga-on", !1).classed("daga-off", !0), et.unsubscribe());
|
|
7962
7967
|
});
|
|
@@ -7972,10 +7977,10 @@ const Ce = ({
|
|
|
7972
7977
|
i && y.canUserPerformAction(k.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: F, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
|
|
7973
7978
|
e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: E, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
|
|
7974
7979
|
e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: $, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
|
|
7975
|
-
r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick:
|
|
7980
|
+
r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: V, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
|
|
7976
7981
|
r && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: L, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
|
|
7977
7982
|
r && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${n ? "daga-on" : "daga-off"}`, onClick: Q, ref: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
|
|
7978
|
-
r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick:
|
|
7983
|
+
r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
|
|
7979
7984
|
r && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: dt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
|
|
7980
7985
|
l && y.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: D, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
|
|
7981
7986
|
a && /* @__PURE__ */ v("button", { className: `daga-filter ${n ? "daga-on" : "daga-off"}`, onClick: j, ref: g, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
|
|
@@ -7984,14 +7989,14 @@ const Ce = ({
|
|
|
7984
7989
|
]
|
|
7985
7990
|
}
|
|
7986
7991
|
) });
|
|
7987
|
-
},
|
|
7992
|
+
}, Oi = ({
|
|
7988
7993
|
config: s,
|
|
7989
7994
|
model: t,
|
|
7990
7995
|
onCanvasCreated: e,
|
|
7991
7996
|
onDiagramEvent: a,
|
|
7992
7997
|
onModelChange: l
|
|
7993
7998
|
}) => {
|
|
7994
|
-
const r = new
|
|
7999
|
+
const r = new Ke(), i = new to(), n = at(null), o = at(void 0), d = at(!1), c = [], [h, u] = G(void 0), [b, p] = G(void 0), C = {
|
|
7995
8000
|
zoomIn: () => {
|
|
7996
8001
|
},
|
|
7997
8002
|
zoomOut: () => {
|
|
@@ -8009,7 +8014,7 @@ const Ce = ({
|
|
|
8009
8014
|
}, g = {
|
|
8010
8015
|
refreshPalette: () => {
|
|
8011
8016
|
}
|
|
8012
|
-
}, m = new
|
|
8017
|
+
}, m = new Si(
|
|
8013
8018
|
(j) => u(j),
|
|
8014
8019
|
(j) => p(j)
|
|
8015
8020
|
), y = {
|
|
@@ -8042,18 +8047,18 @@ const Ce = ({
|
|
|
8042
8047
|
const D = (j, E, $) => {
|
|
8043
8048
|
if (b !== void 0 && E.editable !== !1 && !Ct(j.getValue(E.name), $)) {
|
|
8044
8049
|
j.setValue(E.name, $);
|
|
8045
|
-
const
|
|
8050
|
+
const V = new kt(
|
|
8046
8051
|
b.propertySet,
|
|
8047
8052
|
void 0
|
|
8048
8053
|
);
|
|
8049
|
-
|
|
8054
|
+
V.setValues(b.getValues()), V.rootElement = b.rootElement, m.valueSet = V, b.rootElement.valueSet = V, P.propertyEditorChanges$?.next();
|
|
8050
8055
|
}
|
|
8051
8056
|
};
|
|
8052
|
-
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(
|
|
8057
|
+
return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(wi.Provider, { value: s, children: /* @__PURE__ */ v(It.Provider, { value: P, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
|
|
8053
8058
|
/* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
|
|
8054
8059
|
/* @__PURE__ */ M(It.Provider, { value: P, children: [
|
|
8055
8060
|
s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8056
|
-
|
|
8061
|
+
Pi,
|
|
8057
8062
|
{
|
|
8058
8063
|
location: s.components?.buttons?.location || Zt.BottomRight,
|
|
8059
8064
|
direction: s.components?.buttons?.direction || f.Top,
|
|
@@ -8065,7 +8070,7 @@ const Ce = ({
|
|
|
8065
8070
|
}
|
|
8066
8071
|
),
|
|
8067
8072
|
s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
|
|
8068
|
-
|
|
8073
|
+
Ni,
|
|
8069
8074
|
{
|
|
8070
8075
|
location: s.components?.palette?.location || Zt.TopLeft,
|
|
8071
8076
|
direction: s.components?.palette?.direction || f.Bottom,
|
|
@@ -8075,7 +8080,7 @@ const Ce = ({
|
|
|
8075
8080
|
}
|
|
8076
8081
|
),
|
|
8077
8082
|
s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8078
|
-
|
|
8083
|
+
Mi,
|
|
8079
8084
|
{
|
|
8080
8085
|
location: s.components?.propertyEditor?.location || Zt.TopRight,
|
|
8081
8086
|
direction: s.components?.propertyEditor?.direction || f.Bottom,
|
|
@@ -8086,10 +8091,10 @@ const Ce = ({
|
|
|
8086
8091
|
onValueChange: D
|
|
8087
8092
|
}
|
|
8088
8093
|
),
|
|
8089
|
-
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(
|
|
8094
|
+
s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(Ci, {})
|
|
8090
8095
|
] })
|
|
8091
8096
|
] }) }) }) });
|
|
8092
8097
|
};
|
|
8093
8098
|
export {
|
|
8094
|
-
|
|
8099
|
+
Oi as DagaDiagram
|
|
8095
8100
|
};
|