@metadev/daga-react 4.2.15 → 4.2.16
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 +5 -0
- package/index.js +2 -2
- package/index.mjs +133 -129
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as y, jsxs as M, Fragment as ho } from "react/jsx-runtime";
|
|
2
2
|
import * as L from "d3";
|
|
3
|
-
import { debounceTime as go, Subject as
|
|
3
|
+
import { debounceTime as go, Subject as jt, merge as fo, map as uo } from "rxjs";
|
|
4
4
|
import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as St, useMemo as po } from "react";
|
|
5
|
-
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}),
|
|
6
|
-
const
|
|
5
|
+
var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), Jt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Jt || {});
|
|
6
|
+
const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Le = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Qt = (s, t, e, a, l, r, i) => {
|
|
7
7
|
const n = (() => {
|
|
8
8
|
switch (r) {
|
|
9
9
|
case "start":
|
|
@@ -285,7 +285,7 @@ const vo = 20, yo = (s, t, e, a, l) => {
|
|
|
285
285
|
const e = s.indexOf(t);
|
|
286
286
|
return e >= 0 && s.splice(e, 1), s;
|
|
287
287
|
};
|
|
288
|
-
var
|
|
288
|
+
var Mt = /* @__PURE__ */ ((s) => (s.Ellipse = "ellipse", s.Empty = "empty", s.Folder = "folder", s.Hexagon = "hexagon", s.Octagon = "octagon", s.Pill = "pill", s.Rectangle = "rectangle", s.Rhombus = "rhombus", s.RoundedRectangle = "rounded-rectangle", s.StickyNote = "sticky-note", s))(Mt || {});
|
|
289
289
|
const ye = (s, t, e, a, l) => {
|
|
290
290
|
if (typeof s == "function")
|
|
291
291
|
return s(t, e, a, l);
|
|
@@ -316,11 +316,11 @@ const ye = (s, t, e, a, l) => {
|
|
|
316
316
|
}, Ye = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, bo = () => "Z", ko = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, wo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, So = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, qt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ye(s, t, e, a), Ee = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, Co = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, $o = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, Ao = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
|
|
317
317
|
var E = /* @__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))(E || {});
|
|
318
318
|
const Io = (s) => Math.max(...s.split(`
|
|
319
|
-
`).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0,
|
|
319
|
+
`).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, j = [];
|
|
320
320
|
for (let s = 0; s < 256; ++s)
|
|
321
|
-
|
|
321
|
+
j.push((s + 256).toString(16).slice(1));
|
|
322
322
|
function Lo(s, t = 0) {
|
|
323
|
-
return (
|
|
323
|
+
return (j[s[t + 0]] + j[s[t + 1]] + j[s[t + 2]] + j[s[t + 3]] + "-" + j[s[t + 4]] + j[s[t + 5]] + "-" + j[s[t + 6]] + j[s[t + 7]] + "-" + j[s[t + 8]] + j[s[t + 9]] + "-" + j[s[t + 10]] + j[s[t + 11]] + j[s[t + 12]] + j[s[t + 13]] + j[s[t + 14]] + j[s[t + 15]]).toLowerCase();
|
|
324
324
|
}
|
|
325
325
|
let le;
|
|
326
326
|
const Eo = new Uint8Array(16);
|
|
@@ -343,12 +343,14 @@ function No(s, t, e) {
|
|
|
343
343
|
function Me(s, t, e) {
|
|
344
344
|
return Te.randomUUID && !s ? Te.randomUUID() : No(s);
|
|
345
345
|
}
|
|
346
|
-
const
|
|
346
|
+
const Ct = (s) => {
|
|
347
347
|
if (typeof s != "object")
|
|
348
348
|
return s;
|
|
349
|
+
if (Array.isArray(s))
|
|
350
|
+
return s.map(Ct);
|
|
349
351
|
const t = {};
|
|
350
352
|
for (const e of Object.entries(s))
|
|
351
|
-
|
|
353
|
+
t[e[0]] = Ct(e[1]);
|
|
352
354
|
return t;
|
|
353
355
|
}, nt = (s) => {
|
|
354
356
|
const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, r = l, i = {
|
|
@@ -482,7 +484,7 @@ class ee {
|
|
|
482
484
|
}
|
|
483
485
|
}
|
|
484
486
|
const Nt = 0;
|
|
485
|
-
class
|
|
487
|
+
class At {
|
|
486
488
|
constructor(t, e) {
|
|
487
489
|
this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
|
|
488
490
|
}
|
|
@@ -795,7 +797,7 @@ class yt {
|
|
|
795
797
|
this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
|
|
796
798
|
for (const t in this.propertySet.propertyMap) {
|
|
797
799
|
const e = this.propertySet.getProperty(t), a = e.rootAttribute;
|
|
798
|
-
e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] =
|
|
800
|
+
e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Ct(e.defaultValue), a != null && e.defaultValue !== void 0 && !wt(
|
|
799
801
|
this.getRootElementValue(a),
|
|
800
802
|
e.defaultValue
|
|
801
803
|
) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
|
|
@@ -810,7 +812,7 @@ class yt {
|
|
|
810
812
|
constructSubValueSet(t) {
|
|
811
813
|
const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new yt(a, this.rootElement);
|
|
812
814
|
return l.overwriteValues(
|
|
813
|
-
|
|
815
|
+
Ct(e.defaultValue)
|
|
814
816
|
), l;
|
|
815
817
|
}
|
|
816
818
|
/**
|
|
@@ -892,7 +894,7 @@ class Xe {
|
|
|
892
894
|
return this.endTypes.indexOf(t) >= 0;
|
|
893
895
|
}
|
|
894
896
|
}
|
|
895
|
-
class dt extends
|
|
897
|
+
class dt extends At {
|
|
896
898
|
constructor(t, e, a, l, r) {
|
|
897
899
|
if (t.connections.get(r) !== void 0)
|
|
898
900
|
throw new Error(`DiagramConnection with id "${r}" already exists`);
|
|
@@ -1213,13 +1215,13 @@ const V = {
|
|
|
1213
1215
|
color: "#000000",
|
|
1214
1216
|
selectedColor: "#000000",
|
|
1215
1217
|
backgroundColor: "#00000000",
|
|
1216
|
-
horizontalAlign:
|
|
1218
|
+
horizontalAlign: Lt.Center,
|
|
1217
1219
|
verticalAlign: Jt.Center,
|
|
1218
1220
|
orientation: g.Top,
|
|
1219
1221
|
fit: !1,
|
|
1220
1222
|
shrink: !0
|
|
1221
1223
|
};
|
|
1222
|
-
class ht extends
|
|
1224
|
+
class ht extends At {
|
|
1223
1225
|
constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p, u) {
|
|
1224
1226
|
const v = `${e?.id}_field`;
|
|
1225
1227
|
if (t.fields.get(v) !== void 0)
|
|
@@ -1331,11 +1333,11 @@ class _o {
|
|
|
1331
1333
|
class Go {
|
|
1332
1334
|
constructor(t) {
|
|
1333
1335
|
this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Nt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
|
|
1334
|
-
const e = nt(t.look ||
|
|
1336
|
+
const e = nt(t.look || We);
|
|
1335
1337
|
this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
|
|
1336
1338
|
}
|
|
1337
1339
|
}
|
|
1338
|
-
class F extends
|
|
1340
|
+
class F extends At {
|
|
1339
1341
|
constructor(t, e, a, l, r, i, n, o) {
|
|
1340
1342
|
if (t.sections.get(o) !== void 0)
|
|
1341
1343
|
throw new Error(`DiagramSection with id "${o}" already exists`);
|
|
@@ -1715,9 +1717,9 @@ class Fo extends ft {
|
|
|
1715
1717
|
}
|
|
1716
1718
|
}
|
|
1717
1719
|
}
|
|
1718
|
-
const
|
|
1720
|
+
const We = {
|
|
1719
1721
|
lookType: "shaped-look",
|
|
1720
|
-
shape:
|
|
1722
|
+
shape: Mt.Rectangle,
|
|
1721
1723
|
fillColor: "#FFFFFF",
|
|
1722
1724
|
borderColor: "#000000",
|
|
1723
1725
|
borderThickness: 1,
|
|
@@ -1742,14 +1744,14 @@ const je = {
|
|
|
1742
1744
|
ports: [],
|
|
1743
1745
|
decorators: [],
|
|
1744
1746
|
sectionGrid: null,
|
|
1745
|
-
look:
|
|
1747
|
+
look: We,
|
|
1746
1748
|
isUnique: !1,
|
|
1747
1749
|
canBeParentless: !0,
|
|
1748
1750
|
childrenTypes: [],
|
|
1749
1751
|
priority: Nt,
|
|
1750
1752
|
properties: []
|
|
1751
1753
|
};
|
|
1752
|
-
class
|
|
1754
|
+
class je {
|
|
1753
1755
|
constructor(t) {
|
|
1754
1756
|
const e = {
|
|
1755
1757
|
...gt,
|
|
@@ -1760,7 +1762,7 @@ class We {
|
|
|
1760
1762
|
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new oe(t?.properties || []);
|
|
1761
1763
|
}
|
|
1762
1764
|
}
|
|
1763
|
-
class z extends
|
|
1765
|
+
class z extends At {
|
|
1764
1766
|
constructor(t, e, a = [0, 0], l) {
|
|
1765
1767
|
if (t.nodes.get(l) !== void 0)
|
|
1766
1768
|
throw new Error(`DiagramNode with id "${l}" already exists`);
|
|
@@ -2348,7 +2350,7 @@ class Uo extends ft {
|
|
|
2348
2350
|
*/
|
|
2349
2351
|
new(t, e, a) {
|
|
2350
2352
|
let l;
|
|
2351
|
-
if (t instanceof
|
|
2353
|
+
if (t instanceof je)
|
|
2352
2354
|
l = t;
|
|
2353
2355
|
else {
|
|
2354
2356
|
const i = this.types.get(t);
|
|
@@ -2516,7 +2518,7 @@ const Ze = (s) => {
|
|
|
2516
2518
|
return s;
|
|
2517
2519
|
}, Do = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Yo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Bo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Xo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Ke = {
|
|
2518
2520
|
lookType: "shaped-look",
|
|
2519
|
-
shape:
|
|
2521
|
+
shape: Mt.Ellipse,
|
|
2520
2522
|
fillColor: "transparent",
|
|
2521
2523
|
borderColor: "transparent",
|
|
2522
2524
|
borderThickness: 0,
|
|
@@ -2534,7 +2536,7 @@ const Ze = (s) => {
|
|
|
2534
2536
|
width: 24,
|
|
2535
2537
|
look: Ke
|
|
2536
2538
|
};
|
|
2537
|
-
class
|
|
2539
|
+
class Wo {
|
|
2538
2540
|
constructor(t) {
|
|
2539
2541
|
const e = {
|
|
2540
2542
|
...qe,
|
|
@@ -2545,7 +2547,7 @@ class jo {
|
|
|
2545
2547
|
this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook;
|
|
2546
2548
|
}
|
|
2547
2549
|
}
|
|
2548
|
-
class bt extends
|
|
2550
|
+
class bt extends At {
|
|
2549
2551
|
constructor(t, e, a, l, r, i, n, o = "floating", d = "floating") {
|
|
2550
2552
|
if (t.ports.get(n) !== void 0)
|
|
2551
2553
|
throw new Error(`DiagramPort with id "${n}" already exists`);
|
|
@@ -2722,7 +2724,7 @@ class bt extends $t {
|
|
|
2722
2724
|
return Ue(this.coords, t);
|
|
2723
2725
|
}
|
|
2724
2726
|
}
|
|
2725
|
-
class
|
|
2727
|
+
class jo extends ft {
|
|
2726
2728
|
/**
|
|
2727
2729
|
* Instance a set of ports for the given model. This method is used internally.
|
|
2728
2730
|
* @private
|
|
@@ -2772,50 +2774,48 @@ class Je {
|
|
|
2772
2774
|
const a = t.nodes.types.get(e.type);
|
|
2773
2775
|
if (a) {
|
|
2774
2776
|
const l = new z(t, a, e.coords, e.id);
|
|
2775
|
-
if (t.nodes.add(l), l.width = e.width, l.height = e.height,
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
t.decorators.new(
|
|
2780
|
-
l,
|
|
2781
|
-
[
|
|
2782
|
-
l.coords[0] + n.coords[0],
|
|
2783
|
-
l.coords[1] + n.coords[1]
|
|
2784
|
-
],
|
|
2785
|
-
n.width,
|
|
2786
|
-
n.height,
|
|
2787
|
-
l.getPriority(),
|
|
2788
|
-
n.html,
|
|
2789
|
-
`${l.id}_decorator_${i}`
|
|
2790
|
-
);
|
|
2791
|
-
}
|
|
2792
|
-
if (a.label) {
|
|
2793
|
-
const i = {
|
|
2794
|
-
...V,
|
|
2795
|
-
...a.label
|
|
2796
|
-
}, n = new ht(
|
|
2797
|
-
t,
|
|
2777
|
+
if (t.nodes.add(l), l.width = e.width, l.height = e.height, a.decorators)
|
|
2778
|
+
for (let i = 0; i < a.decorators.length; ++i) {
|
|
2779
|
+
const n = a.decorators[i];
|
|
2780
|
+
t.decorators.new(
|
|
2798
2781
|
l,
|
|
2799
2782
|
[
|
|
2800
|
-
l.coords[0] +
|
|
2801
|
-
l.coords[1] +
|
|
2783
|
+
l.coords[0] + n.coords[0],
|
|
2784
|
+
l.coords[1] + n.coords[1]
|
|
2802
2785
|
],
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
i
|
|
2808
|
-
i.selectedColor,
|
|
2809
|
-
i.horizontalAlign,
|
|
2810
|
-
i.verticalAlign,
|
|
2811
|
-
i.orientation,
|
|
2812
|
-
"",
|
|
2813
|
-
i.editable,
|
|
2814
|
-
i.fit,
|
|
2815
|
-
i.shrink
|
|
2786
|
+
n.width,
|
|
2787
|
+
n.height,
|
|
2788
|
+
l.getPriority(),
|
|
2789
|
+
n.html,
|
|
2790
|
+
`${l.id}_decorator_${i}`
|
|
2816
2791
|
);
|
|
2817
|
-
n.text = e.label, l.label = n, t.fields.add(n), n.updateInView();
|
|
2818
2792
|
}
|
|
2793
|
+
if (a.label) {
|
|
2794
|
+
const i = {
|
|
2795
|
+
...V,
|
|
2796
|
+
...a.label
|
|
2797
|
+
}, n = new ht(
|
|
2798
|
+
t,
|
|
2799
|
+
l,
|
|
2800
|
+
[
|
|
2801
|
+
l.coords[0] + Y(i),
|
|
2802
|
+
l.coords[1] + U(i)
|
|
2803
|
+
],
|
|
2804
|
+
l.width - Y(i) - it(i),
|
|
2805
|
+
l.height - U(i) - q(i),
|
|
2806
|
+
i.fontSize,
|
|
2807
|
+
i.fontFamily,
|
|
2808
|
+
i.color,
|
|
2809
|
+
i.selectedColor,
|
|
2810
|
+
i.horizontalAlign,
|
|
2811
|
+
i.verticalAlign,
|
|
2812
|
+
i.orientation,
|
|
2813
|
+
"",
|
|
2814
|
+
i.editable,
|
|
2815
|
+
i.fit,
|
|
2816
|
+
i.shrink
|
|
2817
|
+
);
|
|
2818
|
+
n.text = e.label, l.label = n, t.fields.add(n), n.updateInView();
|
|
2819
2819
|
}
|
|
2820
2820
|
for (const i of e.children || []) {
|
|
2821
2821
|
const n = this.importNode(t, i);
|
|
@@ -2832,7 +2832,7 @@ class Je {
|
|
|
2832
2832
|
i.height,
|
|
2833
2833
|
i.id
|
|
2834
2834
|
);
|
|
2835
|
-
if (l.sections?.push(n), t.sections.add(n),
|
|
2835
|
+
if (l.sections?.push(n), t.sections.add(n), a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
|
|
2836
2836
|
const d = {
|
|
2837
2837
|
...V,
|
|
2838
2838
|
...a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label
|
|
@@ -3023,7 +3023,7 @@ class ie {
|
|
|
3023
3023
|
do() {
|
|
3024
3024
|
const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
|
|
3025
3025
|
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(
|
|
3026
|
-
|
|
3026
|
+
Ct({
|
|
3027
3027
|
...t.valueSet.getValues(),
|
|
3028
3028
|
...this.values
|
|
3029
3029
|
})
|
|
@@ -3228,7 +3228,7 @@ class se {
|
|
|
3228
3228
|
);
|
|
3229
3229
|
}
|
|
3230
3230
|
}
|
|
3231
|
-
class
|
|
3231
|
+
class Et {
|
|
3232
3232
|
constructor(t, e, a, l) {
|
|
3233
3233
|
this.canvas = t, this.fieldId = e, this.to = a, this.timestamp = l;
|
|
3234
3234
|
}
|
|
@@ -3245,7 +3245,7 @@ class Lt {
|
|
|
3245
3245
|
};
|
|
3246
3246
|
}
|
|
3247
3247
|
static deserialize(t, e) {
|
|
3248
|
-
return new
|
|
3248
|
+
return new Et(
|
|
3249
3249
|
t,
|
|
3250
3250
|
e.fieldId,
|
|
3251
3251
|
e.to,
|
|
@@ -3253,7 +3253,7 @@ class Lt {
|
|
|
3253
3253
|
);
|
|
3254
3254
|
}
|
|
3255
3255
|
}
|
|
3256
|
-
class
|
|
3256
|
+
class Tt {
|
|
3257
3257
|
constructor(t, e, a, l) {
|
|
3258
3258
|
this.canvas = t, this.id = e, this.to = a, this.timestamp = l;
|
|
3259
3259
|
}
|
|
@@ -3272,7 +3272,7 @@ class Et {
|
|
|
3272
3272
|
};
|
|
3273
3273
|
}
|
|
3274
3274
|
static deserialize(t, e) {
|
|
3275
|
-
return new
|
|
3275
|
+
return new Tt(
|
|
3276
3276
|
t,
|
|
3277
3277
|
e.id,
|
|
3278
3278
|
e.to,
|
|
@@ -3433,11 +3433,11 @@ class Zo {
|
|
|
3433
3433
|
break;
|
|
3434
3434
|
}
|
|
3435
3435
|
case "editField": {
|
|
3436
|
-
|
|
3436
|
+
Et.deserialize(this.canvas, t).do();
|
|
3437
3437
|
break;
|
|
3438
3438
|
}
|
|
3439
3439
|
case "updateValues": {
|
|
3440
|
-
|
|
3440
|
+
Tt.deserialize(
|
|
3441
3441
|
this.canvas,
|
|
3442
3442
|
t
|
|
3443
3443
|
).do();
|
|
@@ -3765,7 +3765,7 @@ class Re {
|
|
|
3765
3765
|
this.canvas = t, this.fieldId = e, this.from = a, this.to = l;
|
|
3766
3766
|
}
|
|
3767
3767
|
do() {
|
|
3768
|
-
const t = this.canvas.model.fields.get(this.fieldId), e = new
|
|
3768
|
+
const t = this.canvas.model.fields.get(this.fieldId), e = new Et(
|
|
3769
3769
|
this.canvas,
|
|
3770
3770
|
this.fieldId,
|
|
3771
3771
|
this.to,
|
|
@@ -3777,7 +3777,7 @@ class Re {
|
|
|
3777
3777
|
const t = this.canvas.model.fields.get(this.fieldId);
|
|
3778
3778
|
if (t) {
|
|
3779
3779
|
this.to = t.text;
|
|
3780
|
-
const e = new
|
|
3780
|
+
const e = new Et(
|
|
3781
3781
|
this.canvas,
|
|
3782
3782
|
this.fieldId,
|
|
3783
3783
|
this.from,
|
|
@@ -3791,7 +3791,7 @@ class Re {
|
|
|
3791
3791
|
const t = this.canvas.model.fields.get(this.fieldId);
|
|
3792
3792
|
if (t) {
|
|
3793
3793
|
this.from = t.text;
|
|
3794
|
-
const e = new
|
|
3794
|
+
const e = new Et(
|
|
3795
3795
|
this.canvas,
|
|
3796
3796
|
this.fieldId,
|
|
3797
3797
|
this.to,
|
|
@@ -3807,7 +3807,7 @@ class Qo {
|
|
|
3807
3807
|
this.canvas = t, this.id = e, this.from = a, this.to = l;
|
|
3808
3808
|
}
|
|
3809
3809
|
do() {
|
|
3810
|
-
const t = new
|
|
3810
|
+
const t = new Tt(
|
|
3811
3811
|
this.canvas,
|
|
3812
3812
|
this.id,
|
|
3813
3813
|
this.to,
|
|
@@ -3816,7 +3816,7 @@ class Qo {
|
|
|
3816
3816
|
return this.canvas.collabEngine.doCollaboratively(t), !0;
|
|
3817
3817
|
}
|
|
3818
3818
|
undo() {
|
|
3819
|
-
const t = new
|
|
3819
|
+
const t = new Tt(
|
|
3820
3820
|
this.canvas,
|
|
3821
3821
|
this.id,
|
|
3822
3822
|
this.from,
|
|
@@ -3829,7 +3829,7 @@ class Qo {
|
|
|
3829
3829
|
return !e.rootElement.removed;
|
|
3830
3830
|
}
|
|
3831
3831
|
redo() {
|
|
3832
|
-
const t = new
|
|
3832
|
+
const t = new Tt(
|
|
3833
3833
|
this.canvas,
|
|
3834
3834
|
this.id,
|
|
3835
3835
|
this.to,
|
|
@@ -4054,7 +4054,7 @@ class tt extends Yt {
|
|
|
4054
4054
|
), this.target = t;
|
|
4055
4055
|
}
|
|
4056
4056
|
}
|
|
4057
|
-
class to extends
|
|
4057
|
+
class to extends At {
|
|
4058
4058
|
constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
|
|
4059
4059
|
if (t.objects.get(o) !== void 0)
|
|
4060
4060
|
throw new Error(`DiagramDecorator with id "${o}" already exists`);
|
|
@@ -4122,7 +4122,7 @@ class ii extends ft {
|
|
|
4122
4122
|
e && ((e.rootElement instanceof z || e.rootElement instanceof F) && B(e.rootElement.decorators, e), super.remove(t), e.updateInView());
|
|
4123
4123
|
}
|
|
4124
4124
|
}
|
|
4125
|
-
class si extends
|
|
4125
|
+
class si extends At {
|
|
4126
4126
|
constructor(t, e, a, l, r, i, n) {
|
|
4127
4127
|
if (t.objects.get(n) !== void 0)
|
|
4128
4128
|
throw new Error(`DiagramObject with id "${n}" already exists`);
|
|
@@ -4189,7 +4189,7 @@ class ni extends ft {
|
|
|
4189
4189
|
}
|
|
4190
4190
|
class eo {
|
|
4191
4191
|
constructor(t, e, a, l, r, i = []) {
|
|
4192
|
-
this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new
|
|
4192
|
+
this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new jo(this), this.connections = new Ro(this), this.fields = new Vo(this), this.objects = new ni(this), this.decorators = new ii(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new oe(i), this);
|
|
4193
4193
|
}
|
|
4194
4194
|
/**
|
|
4195
4195
|
* Deletes everything in this diagram.
|
|
@@ -4243,7 +4243,7 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
|
|
|
4243
4243
|
s.filter(".shaped-look").select("path").attr(
|
|
4244
4244
|
"d",
|
|
4245
4245
|
(t) => ye(
|
|
4246
|
-
t.look.shape ||
|
|
4246
|
+
t.look.shape || Mt.Rectangle,
|
|
4247
4247
|
0,
|
|
4248
4248
|
0,
|
|
4249
4249
|
t.width,
|
|
@@ -4327,7 +4327,7 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
|
|
|
4327
4327
|
}
|
|
4328
4328
|
t.select("rect").attr("fill", `url(#${e})`);
|
|
4329
4329
|
}
|
|
4330
|
-
}, we = 96,
|
|
4330
|
+
}, we = 96, W = 32, xt = we + W, ai = Math.PI / 4, li = 100, Ve = {
|
|
4331
4331
|
customButtons: []
|
|
4332
4332
|
};
|
|
4333
4333
|
class di {
|
|
@@ -4346,7 +4346,7 @@ class di {
|
|
|
4346
4346
|
*/
|
|
4347
4347
|
open(t) {
|
|
4348
4348
|
this.close();
|
|
4349
|
-
const e = this.canvas.getPointerLocationRelativeToRoot(t), a = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] -
|
|
4349
|
+
const e = this.canvas.getPointerLocationRelativeToRoot(t), a = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - xt}px`).attr("y", `${e[1] - xt}px`).attr("width", `${2 * xt}px`).attr("height", `${2 * xt}px`).style("pointer-events", "none").on($.ContextMenu, (i) => {
|
|
4350
4350
|
this.canvas.canUserPerformAction(k.ContextMenu) && (t.preventDefault(), this.open(i));
|
|
4351
4351
|
}).on($.Click, (i) => {
|
|
4352
4352
|
i.preventDefault(), this.close();
|
|
@@ -4391,19 +4391,19 @@ class di {
|
|
|
4391
4391
|
const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ai, c = l.append("xhtml:div").attr(
|
|
4392
4392
|
"class",
|
|
4393
4393
|
`daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
|
|
4394
|
-
).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 *
|
|
4394
|
+
).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * W}px`).style("height", `${2 * W}px`).style("border-radius", `${W}px`).style("pointer-events", "auto").on($.Click, (h) => {
|
|
4395
4395
|
o && (h.preventDefault(), o(this.canvas));
|
|
4396
4396
|
}).on($.KeyDown, (h) => {
|
|
4397
4397
|
o && h.key === K.Enter && (h.preventDefault(), o(this.canvas));
|
|
4398
4398
|
});
|
|
4399
|
-
n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 *
|
|
4399
|
+
n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}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 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * W}px`).style("top", `${1.1 * W}px`).style("text-align", "center").style("width", `${1.6 * W}px`).style("height", `${0.35 * W}px`).style("margin", "0").style("font-size", `${0.35 * W}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(L.easeLinear).duration(li).tween("progress", () => (h) => {
|
|
4400
4400
|
const f = d * h;
|
|
4401
4401
|
return c.style(
|
|
4402
4402
|
"left",
|
|
4403
|
-
`${Math.sin(f) * we -
|
|
4403
|
+
`${Math.sin(f) * we - W + xt}px`
|
|
4404
4404
|
).style(
|
|
4405
4405
|
"top",
|
|
4406
|
-
`${-Math.cos(f) * we -
|
|
4406
|
+
`${-Math.cos(f) * we - W + xt}px`
|
|
4407
4407
|
);
|
|
4408
4408
|
});
|
|
4409
4409
|
}
|
|
@@ -4509,8 +4509,8 @@ class oo {
|
|
|
4509
4509
|
n.push({
|
|
4510
4510
|
id: o.id,
|
|
4511
4511
|
type: o.type?.id,
|
|
4512
|
-
coords:
|
|
4513
|
-
connectionPoint:
|
|
4512
|
+
coords: It(o.coords),
|
|
4513
|
+
connectionPoint: It(o.connectionPoint || o.coords),
|
|
4514
4514
|
direction: o.direction,
|
|
4515
4515
|
label: o.label?.text || "",
|
|
4516
4516
|
...e ? {
|
|
@@ -4528,7 +4528,7 @@ class oo {
|
|
|
4528
4528
|
label: i.label?.text || "",
|
|
4529
4529
|
indexXInNode: i.indexXInNode,
|
|
4530
4530
|
indexYInNode: i.indexYInNode,
|
|
4531
|
-
coords:
|
|
4531
|
+
coords: It(i.coords),
|
|
4532
4532
|
width: i.width,
|
|
4533
4533
|
height: i.height,
|
|
4534
4534
|
...e ? {
|
|
@@ -4546,8 +4546,8 @@ class oo {
|
|
|
4546
4546
|
r.push({
|
|
4547
4547
|
id: i.id,
|
|
4548
4548
|
type: i.type?.id,
|
|
4549
|
-
coords:
|
|
4550
|
-
connectionPoint:
|
|
4549
|
+
coords: It(i.coords),
|
|
4550
|
+
connectionPoint: It(i.connectionPoint || i.coords),
|
|
4551
4551
|
direction: i.direction,
|
|
4552
4552
|
label: i.label?.text || "",
|
|
4553
4553
|
...e ? {
|
|
@@ -4566,7 +4566,7 @@ class oo {
|
|
|
4566
4566
|
sections: l,
|
|
4567
4567
|
ports: r,
|
|
4568
4568
|
label: t.label?.text || "",
|
|
4569
|
-
coords:
|
|
4569
|
+
coords: It(t.coords),
|
|
4570
4570
|
width: t.width,
|
|
4571
4571
|
height: t.height,
|
|
4572
4572
|
data: t.valueSet.getValues(),
|
|
@@ -4739,7 +4739,7 @@ class fi extends ft {
|
|
|
4739
4739
|
if (a === void 0)
|
|
4740
4740
|
return;
|
|
4741
4741
|
const l = t?.valueSet;
|
|
4742
|
-
l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues =
|
|
4742
|
+
l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Ct(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));
|
|
4743
4743
|
}
|
|
4744
4744
|
makeUpdateValuesAction() {
|
|
4745
4745
|
if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
|
|
@@ -4750,7 +4750,7 @@ class fi extends ft {
|
|
|
4750
4750
|
this.propertyEditorSelection?.valueSet.getValues()
|
|
4751
4751
|
))
|
|
4752
4752
|
return;
|
|
4753
|
-
const e = this.propertyEditorValues, a =
|
|
4753
|
+
const e = this.propertyEditorValues, a = Ct(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
|
|
4754
4754
|
e,
|
|
4755
4755
|
a,
|
|
4756
4756
|
this.propertyEditorSelection?.valueSet
|
|
@@ -4774,7 +4774,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
4774
4774
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
4775
4775
|
*/
|
|
4776
4776
|
constructor(t, e) {
|
|
4777
|
-
if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = L.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new
|
|
4777
|
+
if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = L.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 eo(
|
|
4778
4778
|
this,
|
|
4779
4779
|
void 0,
|
|
4780
4780
|
e.name || "unnamed",
|
|
@@ -4791,7 +4791,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
4791
4791
|
e.canvas?.grid?.thickness || Rt.thickness
|
|
4792
4792
|
), 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.tightenConnectionsAcrossPortTypes = e.connectionSettings?.tightenAcrossPortTypes || !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
|
|
4793
4793
|
for (const a of e.nodeTypes) {
|
|
4794
|
-
const l = new
|
|
4794
|
+
const l = new je({
|
|
4795
4795
|
...e.nodeTypeDefaults,
|
|
4796
4796
|
...a
|
|
4797
4797
|
});
|
|
@@ -4799,7 +4799,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
4799
4799
|
}
|
|
4800
4800
|
if (e.portTypes)
|
|
4801
4801
|
for (const a of e.portTypes) {
|
|
4802
|
-
const l = new
|
|
4802
|
+
const l = new Wo({
|
|
4803
4803
|
...e.portTypeDefaults,
|
|
4804
4804
|
...a
|
|
4805
4805
|
});
|
|
@@ -5718,20 +5718,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
5718
5718
|
}
|
|
5719
5719
|
}).on($.DoubleClick, (i, n) => {
|
|
5720
5720
|
const o = new pt(i, n);
|
|
5721
|
-
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.
|
|
5722
|
-
n.text,
|
|
5723
|
-
n.coords,
|
|
5724
|
-
n.width,
|
|
5725
|
-
n.height,
|
|
5726
|
-
n.fontSize,
|
|
5727
|
-
n.fontFamily || V.fontFamily,
|
|
5728
|
-
n.orientation,
|
|
5729
|
-
(d) => {
|
|
5730
|
-
},
|
|
5731
|
-
(d) => {
|
|
5732
|
-
n.text = d, this.currentAction instanceof Re && (this.currentAction.to = d, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
|
|
5733
|
-
}
|
|
5734
|
-
));
|
|
5721
|
+
this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.openTextInput(n.id));
|
|
5735
5722
|
}).call(
|
|
5736
5723
|
L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
|
|
5737
5724
|
if (this.multipleSelectionOn || this.secondaryButton)
|
|
@@ -5758,7 +5745,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
5758
5745
|
})
|
|
5759
5746
|
).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), r.attr("x", 0).attr("y", 0).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1).select("div").style(
|
|
5760
5747
|
"justify-content",
|
|
5761
|
-
(i) => i.horizontalAlign ===
|
|
5748
|
+
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
|
|
5762
5749
|
).style(
|
|
5763
5750
|
"align-items",
|
|
5764
5751
|
(i) => i.verticalAlign === Jt.Center ? "center" : i.verticalAlign === Jt.Bottom ? "end" : "start"
|
|
@@ -5770,7 +5757,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
5770
5757
|
(i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[1]}px`
|
|
5771
5758
|
).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
|
|
5772
5759
|
"text-align",
|
|
5773
|
-
(i) => i.horizontalAlign ===
|
|
5760
|
+
(i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "end" : "start"
|
|
5774
5761
|
).style("transform", (i) => `rotate(${i.orientation}deg)`).style("font-size", (i) => `${i.fontSize}px`).style(
|
|
5775
5762
|
"font-family",
|
|
5776
5763
|
(i) => i.fontFamily || "'Wonder Unit Sans', sans-serif"
|
|
@@ -6246,6 +6233,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
|
|
|
6246
6233
|
canUserPerformAction(t) {
|
|
6247
6234
|
return this.userActions[t] !== !1;
|
|
6248
6235
|
}
|
|
6236
|
+
openTextInput(t) {
|
|
6237
|
+
const e = this.model.fields.get(t);
|
|
6238
|
+
e && this.createInputField(
|
|
6239
|
+
e.text,
|
|
6240
|
+
e.coords,
|
|
6241
|
+
e.width,
|
|
6242
|
+
e.height,
|
|
6243
|
+
e.fontSize,
|
|
6244
|
+
e.fontFamily || V.fontFamily,
|
|
6245
|
+
e.orientation,
|
|
6246
|
+
() => {
|
|
6247
|
+
},
|
|
6248
|
+
(a) => {
|
|
6249
|
+
e.text = a, this.currentAction instanceof Re && (this.currentAction.to = a, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
|
|
6250
|
+
}
|
|
6251
|
+
);
|
|
6252
|
+
}
|
|
6249
6253
|
createInputField(t, e, a, l, r, i, n, o, d) {
|
|
6250
6254
|
this.removeInputField();
|
|
6251
6255
|
const c = this.selectCanvasElements().append("foreignObject").attr("x", `${e[0]}px`).attr("y", `${e[1]}px`).attr("width", `${a}px`).attr("height", `${l}px`).style("box-sizing", "border-box").style("border", "1px solid");
|
|
@@ -6879,7 +6883,7 @@ const _e = {
|
|
|
6879
6883
|
priority: new Si(),
|
|
6880
6884
|
tree: new Ci(),
|
|
6881
6885
|
vertical: new $i()
|
|
6882
|
-
}, Ai = Fe({}),
|
|
6886
|
+
}, Ai = Fe({}), $t = Fe({});
|
|
6883
6887
|
class Ii {
|
|
6884
6888
|
constructor(t, e) {
|
|
6885
6889
|
this.onTitleChange = t, this.onValueSetChange = e;
|
|
@@ -6945,7 +6949,7 @@ const xe = ({
|
|
|
6945
6949
|
}
|
|
6946
6950
|
) });
|
|
6947
6951
|
}, xi = () => {
|
|
6948
|
-
const s = Dt(
|
|
6952
|
+
const s = Dt($t), t = rt(null), [e, a] = D([]);
|
|
6949
6953
|
fo(s.validatorChange$, s.diagramChange$).pipe(
|
|
6950
6954
|
uo(() => l())
|
|
6951
6955
|
).subscribe();
|
|
@@ -7363,7 +7367,7 @@ const xe = ({
|
|
|
7363
7367
|
onValueChange: t,
|
|
7364
7368
|
depth: e
|
|
7365
7369
|
}) => {
|
|
7366
|
-
const l = Dt(
|
|
7370
|
+
const l = Dt($t).canUserPerformAction(k.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
|
|
7367
7371
|
if (typeof o == "string")
|
|
7368
7372
|
return o;
|
|
7369
7373
|
if (o == null || isNaN(o.valueOf()))
|
|
@@ -7546,7 +7550,7 @@ const xe = ({
|
|
|
7546
7550
|
o.name
|
|
7547
7551
|
)) });
|
|
7548
7552
|
}, co = ({ valueSet: s, depth: t }) => {
|
|
7549
|
-
const e = Dt(
|
|
7553
|
+
const e = Dt($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
|
|
7550
7554
|
for (const o of s?.displayedProperties || []) {
|
|
7551
7555
|
let d = 0, c = 0, h = 0;
|
|
7552
7556
|
const f = L.select(a.current).select(
|
|
@@ -7725,7 +7729,7 @@ const xe = ({
|
|
|
7725
7729
|
}
|
|
7726
7730
|
) });
|
|
7727
7731
|
}, Ri = 6, Vi = (s) => {
|
|
7728
|
-
const t = Dt(
|
|
7732
|
+
const t = Dt($t), [e, a] = D(
|
|
7729
7733
|
s.currentPalette || s.palettes[0]
|
|
7730
7734
|
), [l, r] = D(0), [i, n] = D(
|
|
7731
7735
|
void 0
|
|
@@ -7783,7 +7787,7 @@ const xe = ({
|
|
|
7783
7787
|
}).on(A.End, (O) => {
|
|
7784
7788
|
if (t.canUserPerformAction(k.AddNode)) {
|
|
7785
7789
|
if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
|
|
7786
|
-
(
|
|
7790
|
+
(Wt) => !Wt.removed && Wt.type.id === p.id
|
|
7787
7791
|
) !== void 0)
|
|
7788
7792
|
return;
|
|
7789
7793
|
const x = t.getPointerLocationRelativeToScreen(O);
|
|
@@ -7810,7 +7814,7 @@ const xe = ({
|
|
|
7810
7814
|
lt[0],
|
|
7811
7815
|
lt[1]
|
|
7812
7816
|
).filter(
|
|
7813
|
-
(
|
|
7817
|
+
(Wt) => Wt.type.childrenTypes.includes(p.id)
|
|
7814
7818
|
), Z = Ze(
|
|
7815
7819
|
Pt
|
|
7816
7820
|
), Q = Z[Z.length - 1];
|
|
@@ -7836,7 +7840,7 @@ const xe = ({
|
|
|
7836
7840
|
T.append("path").attr(
|
|
7837
7841
|
"d",
|
|
7838
7842
|
ye(
|
|
7839
|
-
C.shape ||
|
|
7843
|
+
C.shape || Mt.Rectangle,
|
|
7840
7844
|
(C.borderThickness || 1) / 2,
|
|
7841
7845
|
(C.borderThickness || 1) / 2,
|
|
7842
7846
|
p.defaultWidth,
|
|
@@ -7897,7 +7901,7 @@ const xe = ({
|
|
|
7897
7901
|
w.append("path").attr(
|
|
7898
7902
|
"d",
|
|
7899
7903
|
ye(
|
|
7900
|
-
|
|
7904
|
+
Mt.Rectangle,
|
|
7901
7905
|
0,
|
|
7902
7906
|
0,
|
|
7903
7907
|
u.width,
|
|
@@ -7999,7 +8003,7 @@ const xe = ({
|
|
|
7999
8003
|
d = !0, Z.transition().duration(500).ease(L.easeLinear).style(h, "0rem").style("transform", `${f}(0)`), setTimeout(() => {
|
|
8000
8004
|
c = !1;
|
|
8001
8005
|
}, 500);
|
|
8002
|
-
}, I = Dt(
|
|
8006
|
+
}, I = Dt($t), R = () => {
|
|
8003
8007
|
I.zoomBy(I.zoomFactor);
|
|
8004
8008
|
}, P = () => {
|
|
8005
8009
|
I.zoomBy(1 / I.zoomFactor);
|
|
@@ -8121,9 +8125,9 @@ const xe = ({
|
|
|
8121
8125
|
x.setValues(b.getValues()), x.rootElement = b.rootElement, v.valueSet = x, b.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
|
|
8122
8126
|
}
|
|
8123
8127
|
};
|
|
8124
|
-
return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Ai.Provider, { value: s, children: /* @__PURE__ */ y(
|
|
8128
|
+
return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Ai.Provider, { value: s, children: /* @__PURE__ */ y($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
|
|
8125
8129
|
/* @__PURE__ */ y("div", { className: "daga-append-to", ref: n }),
|
|
8126
|
-
/* @__PURE__ */ M(
|
|
8130
|
+
/* @__PURE__ */ M($t.Provider, { value: R, children: [
|
|
8127
8131
|
s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ y(
|
|
8128
8132
|
Oi,
|
|
8129
8133
|
{
|