likec4 1.20.3 → 1.21.0
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/README.md +3 -3
- package/__app__/src/chunks/{-index-overview-TebwYeV7.js → -index-overview-Csw3b-Fk.js} +4 -4
- package/__app__/src/chunks/{likec4-D8rQPdul.js → likec4-fsbHEjF3.js} +479 -478
- package/__app__/src/chunks/{main-DSlxn73B.js → main-DbAbBULM.js} +5105 -5106
- package/__app__/src/chunks/{mantine-D3AsIG-5.js → mantine-BdYO4lQg.js} +3837 -3743
- package/__app__/src/chunks/{tanstack-router-BE0xJAYp.js → tanstack-router-H-3IPlI6.js} +1 -1
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +888 -799
- package/dist/cli/index.cjs +36 -36
- package/dist/cli/index.mjs +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +90 -27
- package/dist/index.d.mts +90 -27
- package/dist/index.d.ts +90 -27
- package/dist/index.mjs +1 -1
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +2 -2
- package/dist/model/index.d.mts +2 -2
- package/dist/model/index.d.ts +2 -2
- package/dist/model/index.mjs +1 -1
- package/dist/shared/likec4.BH2DNgw1.mjs +1855 -0
- package/dist/shared/likec4.DIyCHEbR.cjs +1855 -0
- package/package.json +19 -19
- package/react/index.js +553 -469
- package/react/style.css +1 -1
- package/dist/shared/likec4.32ndthTo.cjs +0 -1855
- package/dist/shared/likec4.BgEQuI_b.mjs +0 -1855
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Xn, {
|
|
2
|
-
import { jsx as P, jsxs as se, Fragment as
|
|
1
|
+
import Xn, { useState as de, createContext as Yn, useCallback as fe, useMemo as me, useContext as wt, useLayoutEffect as ia, useEffect as j, forwardRef as yr, memo as ie, useRef as J } from "react";
|
|
2
|
+
import { jsx as P, jsxs as se, Fragment as Se } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as wr } from "react-dom";
|
|
4
4
|
function sa(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -163,16 +163,16 @@ function _a(e) {
|
|
|
163
163
|
return this.select(e == null ? va : xa(typeof e == "function" ? e : br(e)));
|
|
164
164
|
}
|
|
165
165
|
var ba = Array.prototype.filter;
|
|
166
|
-
function
|
|
166
|
+
function Ea() {
|
|
167
167
|
return Array.from(this.children);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Sa(e) {
|
|
170
170
|
return function() {
|
|
171
171
|
return ba.call(this.children, e);
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
function Na(e) {
|
|
175
|
-
return this.selectAll(e == null ?
|
|
175
|
+
return this.selectAll(e == null ? Ea : Sa(typeof e == "function" ? e : br(e)));
|
|
176
176
|
}
|
|
177
177
|
function Ca(e) {
|
|
178
178
|
typeof e != "function" && (e = _r(e));
|
|
@@ -181,11 +181,11 @@ function Ca(e) {
|
|
|
181
181
|
(c = i[u]) && e.call(c, c.__data__, u, i) && a.push(c);
|
|
182
182
|
return new le(o, this._parents);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Er(e) {
|
|
185
185
|
return new Array(e.length);
|
|
186
186
|
}
|
|
187
187
|
function Ma() {
|
|
188
|
-
return new le(this._enter || this._groups.map(
|
|
188
|
+
return new le(this._enter || this._groups.map(Er), this._parents);
|
|
189
189
|
}
|
|
190
190
|
function Vt(e, t) {
|
|
191
191
|
this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
|
|
@@ -235,10 +235,10 @@ function Pa(e, t) {
|
|
|
235
235
|
for (var i = r.length, s = new Array(i), a = new Array(i), c = new Array(i), u = 0; u < i; ++u) {
|
|
236
236
|
var f = o[u], l = r[u], d = l.length, h = za(e.call(f, f && f.__data__, u, o)), p = h.length, y = a[u] = new Array(p), _ = s[u] = new Array(p), x = c[u] = new Array(d);
|
|
237
237
|
n(f, l, y, _, x, h, t);
|
|
238
|
-
for (var b = 0, w = 0, m,
|
|
238
|
+
for (var b = 0, w = 0, m, E; b < p; ++b)
|
|
239
239
|
if (m = y[b]) {
|
|
240
|
-
for (b >= w && (w = b + 1); !(
|
|
241
|
-
m._next =
|
|
240
|
+
for (b >= w && (w = b + 1); !(E = _[w]) && ++w < p; ) ;
|
|
241
|
+
m._next = E || null;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
return s = new le(s, o), s._enter = a, s._exit = c, s;
|
|
@@ -247,7 +247,7 @@ function za(e) {
|
|
|
247
247
|
return typeof e == "object" && "length" in e ? e : Array.from(e);
|
|
248
248
|
}
|
|
249
249
|
function Ta() {
|
|
250
|
-
return new le(this._exit || this._groups.map(
|
|
250
|
+
return new le(this._exit || this._groups.map(Er), this._parents);
|
|
251
251
|
}
|
|
252
252
|
function Da(e, t, n) {
|
|
253
253
|
var o = this.enter(), r = this, i = this.exit();
|
|
@@ -351,7 +351,7 @@ function Ja(e, t) {
|
|
|
351
351
|
}
|
|
352
352
|
return this.each((t == null ? n.local ? qa : Wa : typeof t == "function" ? n.local ? Qa : Ua : n.local ? Ka : Ga)(n, t));
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Sr(e) {
|
|
355
355
|
return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
|
|
356
356
|
}
|
|
357
357
|
function ja(e) {
|
|
@@ -374,7 +374,7 @@ function nc(e, t, n) {
|
|
|
374
374
|
return arguments.length > 1 ? this.each((t == null ? ja : typeof t == "function" ? tc : ec)(e, t, n ?? "")) : Xe(this.node(), e);
|
|
375
375
|
}
|
|
376
376
|
function Xe(e, t) {
|
|
377
|
-
return e.style.getPropertyValue(t) ||
|
|
377
|
+
return e.style.getPropertyValue(t) || Sr(e).getComputedStyle(e, null).getPropertyValue(t);
|
|
378
378
|
}
|
|
379
379
|
function oc(e) {
|
|
380
380
|
return function() {
|
|
@@ -492,17 +492,17 @@ function _c() {
|
|
|
492
492
|
function bc() {
|
|
493
493
|
return this.each(_c);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ec(e) {
|
|
496
496
|
var t = typeof e == "function" ? e : xr(e);
|
|
497
497
|
return this.select(function() {
|
|
498
498
|
return this.appendChild(t.apply(this, arguments));
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Sc() {
|
|
502
502
|
return null;
|
|
503
503
|
}
|
|
504
504
|
function Nc(e, t) {
|
|
505
|
-
var n = typeof e == "function" ? e : xr(e), o = t == null ?
|
|
505
|
+
var n = typeof e == "function" ? e : xr(e), o = t == null ? Sc : typeof t == "function" ? t : Zn(t);
|
|
506
506
|
return this.select(function() {
|
|
507
507
|
return this.insertBefore(n.apply(this, arguments), o.apply(this, arguments) || null);
|
|
508
508
|
});
|
|
@@ -578,7 +578,7 @@ function Hc(e, t, n) {
|
|
|
578
578
|
return this;
|
|
579
579
|
}
|
|
580
580
|
function $r(e, t, n) {
|
|
581
|
-
var o =
|
|
581
|
+
var o = Sr(e), r = o.CustomEvent;
|
|
582
582
|
typeof r == "function" ? r = new r(t, n) : (r = o.document.createEvent("Event"), n ? (r.initEvent(t, n.bubbles, n.cancelable), r.detail = n.detail) : r.initEvent(t, !1, !1)), e.dispatchEvent(r);
|
|
583
583
|
}
|
|
584
584
|
function Vc(e, t) {
|
|
@@ -638,7 +638,7 @@ le.prototype = xt.prototype = {
|
|
|
638
638
|
html: wc,
|
|
639
639
|
raise: vc,
|
|
640
640
|
lower: bc,
|
|
641
|
-
append:
|
|
641
|
+
append: Ec,
|
|
642
642
|
insert: Nc,
|
|
643
643
|
remove: Mc,
|
|
644
644
|
clone: Ic,
|
|
@@ -686,7 +686,7 @@ function Pr(e, t) {
|
|
|
686
686
|
o.on("click.drag", null);
|
|
687
687
|
}, 0)), "onselectstart" in n ? o.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
|
|
688
688
|
}
|
|
689
|
-
const
|
|
689
|
+
const St = (e) => () => e;
|
|
690
690
|
function Mn(e, {
|
|
691
691
|
sourceEvent: t,
|
|
692
692
|
subject: n,
|
|
@@ -734,43 +734,43 @@ function zr() {
|
|
|
734
734
|
function d(m) {
|
|
735
735
|
m.on("mousedown.drag", h).filter(o).on("touchstart.drag", _).on("touchmove.drag", x, Xc).on("touchend.drag touchcancel.drag", b).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
736
736
|
}
|
|
737
|
-
function h(m,
|
|
738
|
-
if (!(f || !e.call(this, m,
|
|
739
|
-
var A = w(this, t.call(this, m,
|
|
737
|
+
function h(m, E) {
|
|
738
|
+
if (!(f || !e.call(this, m, E))) {
|
|
739
|
+
var A = w(this, t.call(this, m, E), m, E, "mouse");
|
|
740
740
|
A && (ue(m.view).on("mousemove.drag", p, ct).on("mouseup.drag", y, ct), Ar(m.view), mn(m), u = !1, a = m.clientX, c = m.clientY, A("start", m));
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
function p(m) {
|
|
744
744
|
if (Re(m), !u) {
|
|
745
|
-
var
|
|
746
|
-
u =
|
|
745
|
+
var E = m.clientX - a, A = m.clientY - c;
|
|
746
|
+
u = E * E + A * A > l;
|
|
747
747
|
}
|
|
748
748
|
r.mouse("drag", m);
|
|
749
749
|
}
|
|
750
750
|
function y(m) {
|
|
751
751
|
ue(m.view).on("mousemove.drag mouseup.drag", null), Pr(m.view, u), Re(m), r.mouse("end", m);
|
|
752
752
|
}
|
|
753
|
-
function _(m,
|
|
754
|
-
if (e.call(this, m,
|
|
755
|
-
var A = m.changedTouches, N = t.call(this, m,
|
|
753
|
+
function _(m, E) {
|
|
754
|
+
if (e.call(this, m, E)) {
|
|
755
|
+
var A = m.changedTouches, N = t.call(this, m, E), z = A.length, I, k;
|
|
756
756
|
for (I = 0; I < z; ++I)
|
|
757
|
-
(k = w(this, N, m,
|
|
757
|
+
(k = w(this, N, m, E, A[I].identifier, A[I])) && (mn(m), k("start", m, A[I]));
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
760
|
function x(m) {
|
|
761
|
-
var
|
|
761
|
+
var E = m.changedTouches, A = E.length, N, z;
|
|
762
762
|
for (N = 0; N < A; ++N)
|
|
763
|
-
(z = r[
|
|
763
|
+
(z = r[E[N].identifier]) && (Re(m), z("drag", m, E[N]));
|
|
764
764
|
}
|
|
765
765
|
function b(m) {
|
|
766
|
-
var
|
|
766
|
+
var E = m.changedTouches, A = E.length, N, z;
|
|
767
767
|
for (f && clearTimeout(f), f = setTimeout(function() {
|
|
768
768
|
f = null;
|
|
769
769
|
}, 500), N = 0; N < A; ++N)
|
|
770
|
-
(z = r[
|
|
770
|
+
(z = r[E[N].identifier]) && (mn(m), z("end", m, E[N]));
|
|
771
771
|
}
|
|
772
|
-
function w(m,
|
|
773
|
-
var k = i.copy(), V = he(I || A,
|
|
772
|
+
function w(m, E, A, N, z, I) {
|
|
773
|
+
var k = i.copy(), V = he(I || A, E), D, H, g;
|
|
774
774
|
if ((g = n.call(m, new Mn("beforestart", {
|
|
775
775
|
sourceEvent: A,
|
|
776
776
|
target: d,
|
|
@@ -782,16 +782,16 @@ function zr() {
|
|
|
782
782
|
dy: 0,
|
|
783
783
|
dispatch: k
|
|
784
784
|
}), N)) != null)
|
|
785
|
-
return D = g.x - V[0] || 0, H = g.y - V[1] || 0, function
|
|
785
|
+
return D = g.x - V[0] || 0, H = g.y - V[1] || 0, function S(v, M, $) {
|
|
786
786
|
var C = V, T;
|
|
787
787
|
switch (v) {
|
|
788
788
|
case "start":
|
|
789
|
-
r[z] =
|
|
789
|
+
r[z] = S, T = s++;
|
|
790
790
|
break;
|
|
791
791
|
case "end":
|
|
792
792
|
delete r[z], --s;
|
|
793
793
|
case "drag":
|
|
794
|
-
V = he($ || M,
|
|
794
|
+
V = he($ || M, E), T = s;
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
797
|
k.call(
|
|
@@ -814,13 +814,13 @@ function zr() {
|
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
816
|
return d.filter = function(m) {
|
|
817
|
-
return arguments.length ? (e = typeof m == "function" ? m :
|
|
817
|
+
return arguments.length ? (e = typeof m == "function" ? m : St(!!m), d) : e;
|
|
818
818
|
}, d.container = function(m) {
|
|
819
|
-
return arguments.length ? (t = typeof m == "function" ? m :
|
|
819
|
+
return arguments.length ? (t = typeof m == "function" ? m : St(m), d) : t;
|
|
820
820
|
}, d.subject = function(m) {
|
|
821
|
-
return arguments.length ? (n = typeof m == "function" ? m :
|
|
821
|
+
return arguments.length ? (n = typeof m == "function" ? m : St(m), d) : n;
|
|
822
822
|
}, d.touchable = function(m) {
|
|
823
|
-
return arguments.length ? (o = typeof m == "function" ? m :
|
|
823
|
+
return arguments.length ? (o = typeof m == "function" ? m : St(!!m), d) : o;
|
|
824
824
|
}, d.on = function() {
|
|
825
825
|
var m = i.on.apply(i, arguments);
|
|
826
826
|
return m === i ? d : m;
|
|
@@ -1017,7 +1017,7 @@ function xo() {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
function dt(e) {
|
|
1019
1019
|
var t, n;
|
|
1020
|
-
return e = (e + "").trim().toLowerCase(), (t = Gc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? vo(t) : n === 3 ? new ce(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? Nt(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? Nt(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Kc.exec(e)) ? new ce(t[1], t[2], t[3], 1) : (t = Uc.exec(e)) ? new ce(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Qc.exec(e)) ? Nt(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? Nt(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = jc.exec(e)) ?
|
|
1020
|
+
return e = (e + "").trim().toLowerCase(), (t = Gc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? vo(t) : n === 3 ? new ce(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? Nt(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? Nt(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Kc.exec(e)) ? new ce(t[1], t[2], t[3], 1) : (t = Uc.exec(e)) ? new ce(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Qc.exec(e)) ? Nt(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? Nt(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = jc.exec(e)) ? Eo(t[1], t[2] / 100, t[3] / 100, 1) : (t = eu.exec(e)) ? Eo(t[1], t[2] / 100, t[3] / 100, t[4]) : yo.hasOwnProperty(e) ? vo(yo[e]) : e === "transparent" ? new ce(NaN, NaN, NaN, 0) : null;
|
|
1021
1021
|
}
|
|
1022
1022
|
function vo(e) {
|
|
1023
1023
|
return new ce(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
|
|
@@ -1076,7 +1076,7 @@ function De(e) {
|
|
|
1076
1076
|
function Te(e) {
|
|
1077
1077
|
return e = De(e), (e < 16 ? "0" : "") + e.toString(16);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function Eo(e, t, n, o) {
|
|
1080
1080
|
return o <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new ge(e, t, n, o);
|
|
1081
1081
|
}
|
|
1082
1082
|
function Dr(e) {
|
|
@@ -1110,17 +1110,17 @@ qn(ge, iu, Tr(vt, {
|
|
|
1110
1110
|
);
|
|
1111
1111
|
},
|
|
1112
1112
|
clamp() {
|
|
1113
|
-
return new ge(
|
|
1113
|
+
return new ge(So(this.h), Ct(this.s), Ct(this.l), Bt(this.opacity));
|
|
1114
1114
|
},
|
|
1115
1115
|
displayable() {
|
|
1116
1116
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
1117
1117
|
},
|
|
1118
1118
|
formatHsl() {
|
|
1119
1119
|
const e = Bt(this.opacity);
|
|
1120
|
-
return `${e === 1 ? "hsl(" : "hsla("}${
|
|
1120
|
+
return `${e === 1 ? "hsl(" : "hsla("}${So(this.h)}, ${Ct(this.s) * 100}%, ${Ct(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
|
|
1121
1121
|
}
|
|
1122
1122
|
}));
|
|
1123
|
-
function
|
|
1123
|
+
function So(e) {
|
|
1124
1124
|
return e = (e || 0) % 360, e < 0 ? e + 360 : e;
|
|
1125
1125
|
}
|
|
1126
1126
|
function Ct(e) {
|
|
@@ -1263,13 +1263,13 @@ const xu = function e(t, n, o) {
|
|
|
1263
1263
|
];
|
|
1264
1264
|
};
|
|
1265
1265
|
else {
|
|
1266
|
-
var b = Math.sqrt(y), w = (d * d - u * u + o * y) / (2 * u * n * b), m = (d * d - u * u - o * y) / (2 * d * n * b),
|
|
1267
|
-
x = (A -
|
|
1268
|
-
var z = N * x, I = Mo(
|
|
1266
|
+
var b = Math.sqrt(y), w = (d * d - u * u + o * y) / (2 * u * n * b), m = (d * d - u * u - o * y) / (2 * d * n * b), E = Math.log(Math.sqrt(w * w + 1) - w), A = Math.log(Math.sqrt(m * m + 1) - m);
|
|
1267
|
+
x = (A - E) / t, _ = function(N) {
|
|
1268
|
+
var z = N * x, I = Mo(E), k = u / (n * b) * (I * wu(t * z + E) - yu(E));
|
|
1269
1269
|
return [
|
|
1270
1270
|
a + k * h,
|
|
1271
1271
|
c + k * p,
|
|
1272
|
-
u * I / Mo(t * z +
|
|
1272
|
+
u * I / Mo(t * z + E)
|
|
1273
1273
|
];
|
|
1274
1274
|
};
|
|
1275
1275
|
}
|
|
@@ -1317,14 +1317,14 @@ function ko() {
|
|
|
1317
1317
|
try {
|
|
1318
1318
|
_u();
|
|
1319
1319
|
} finally {
|
|
1320
|
-
Ye = 0,
|
|
1320
|
+
Ye = 0, Eu(), Ve = 0;
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
1323
|
function bu() {
|
|
1324
1324
|
var e = ft.now(), t = e - Rt;
|
|
1325
1325
|
t > Lr && (Ut -= t, Rt = e);
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function Eu() {
|
|
1328
1328
|
for (var e, t = Lt, n, o = 1 / 0; t; )
|
|
1329
1329
|
t._call ? (o > t._time && (o = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Lt = n);
|
|
1330
1330
|
it = e, An(o);
|
|
@@ -1342,7 +1342,7 @@ function $o(e, t, n) {
|
|
|
1342
1342
|
o.stop(), e(r + t);
|
|
1343
1343
|
}, t, n), o;
|
|
1344
1344
|
}
|
|
1345
|
-
var
|
|
1345
|
+
var Su = Gt("start", "end", "cancel", "interrupt"), Nu = [], Xr = 0, Io = 1, Pn = 2, Tt = 3, Ao = 4, zn = 5, Dt = 6;
|
|
1346
1346
|
function Qt(e, t, n, o, r, i) {
|
|
1347
1347
|
var s = e.__transition;
|
|
1348
1348
|
if (!s) e.__transition = {};
|
|
@@ -1353,7 +1353,7 @@ function Qt(e, t, n, o, r, i) {
|
|
|
1353
1353
|
// For context during callback.
|
|
1354
1354
|
group: r,
|
|
1355
1355
|
// For context during callback.
|
|
1356
|
-
on:
|
|
1356
|
+
on: Su,
|
|
1357
1357
|
tween: Nu,
|
|
1358
1358
|
time: i.time,
|
|
1359
1359
|
delay: i.delay,
|
|
@@ -1615,7 +1615,7 @@ function ju(e) {
|
|
|
1615
1615
|
for (var t = this._groups, n = t.length, o = new Array(n), r = 0; r < n; ++r)
|
|
1616
1616
|
for (var i = t[r], s = i.length, a = o[r] = [], c, u = 0; u < s; ++u)
|
|
1617
1617
|
(c = i[u]) && e.call(c, c.__data__, u, i) && a.push(c);
|
|
1618
|
-
return new
|
|
1618
|
+
return new Ee(o, this._parents, this._name, this._id);
|
|
1619
1619
|
}
|
|
1620
1620
|
function el(e) {
|
|
1621
1621
|
if (e._id !== this._id) throw new Error();
|
|
@@ -1624,7 +1624,7 @@ function el(e) {
|
|
|
1624
1624
|
(d = c[h] || u[h]) && (l[h] = d);
|
|
1625
1625
|
for (; a < o; ++a)
|
|
1626
1626
|
s[a] = t[a];
|
|
1627
|
-
return new
|
|
1627
|
+
return new Ee(s, this._parents, this._name, this._id);
|
|
1628
1628
|
}
|
|
1629
1629
|
function tl(e) {
|
|
1630
1630
|
return (e + "").trim().split(/^|\s+/).every(function(t) {
|
|
@@ -1659,7 +1659,7 @@ function sl(e) {
|
|
|
1659
1659
|
for (var o = this._groups, r = o.length, i = new Array(r), s = 0; s < r; ++s)
|
|
1660
1660
|
for (var a = o[s], c = a.length, u = i[s] = new Array(c), f, l, d = 0; d < c; ++d)
|
|
1661
1661
|
(f = a[d]) && (l = e.call(f, f.__data__, d, a)) && ("__data__" in f && (l.__data__ = f.__data__), u[d] = l, Qt(u[d], t, n, d, u, ye(f, n)));
|
|
1662
|
-
return new
|
|
1662
|
+
return new Ee(i, this._parents, t, n);
|
|
1663
1663
|
}
|
|
1664
1664
|
function al(e) {
|
|
1665
1665
|
var t = this._name, n = this._id;
|
|
@@ -1671,7 +1671,7 @@ function al(e) {
|
|
|
1671
1671
|
(h = d[y]) && Qt(h, t, n, y, d, p);
|
|
1672
1672
|
i.push(d), s.push(f);
|
|
1673
1673
|
}
|
|
1674
|
-
return new
|
|
1674
|
+
return new Ee(i, s, t, n);
|
|
1675
1675
|
}
|
|
1676
1676
|
var cl = xt.prototype.constructor;
|
|
1677
1677
|
function ul() {
|
|
@@ -1761,14 +1761,14 @@ function bl(e) {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
return o._value = e, o;
|
|
1763
1763
|
}
|
|
1764
|
-
function
|
|
1764
|
+
function El(e) {
|
|
1765
1765
|
var t = "text";
|
|
1766
1766
|
if (arguments.length < 1) return (t = this.tween(t)) && t._value;
|
|
1767
1767
|
if (e == null) return this.tween(t, null);
|
|
1768
1768
|
if (typeof e != "function") throw new Error();
|
|
1769
1769
|
return this.tween(t, bl(e));
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function Sl() {
|
|
1772
1772
|
for (var e = this._name, t = this._id, n = Wr(), o = this._groups, r = o.length, i = 0; i < r; ++i)
|
|
1773
1773
|
for (var s = o[i], a = s.length, c, u = 0; u < a; ++u)
|
|
1774
1774
|
if (c = s[u]) {
|
|
@@ -1780,7 +1780,7 @@ function El() {
|
|
|
1780
1780
|
ease: f.ease
|
|
1781
1781
|
});
|
|
1782
1782
|
}
|
|
1783
|
-
return new
|
|
1783
|
+
return new Ee(o, this._parents, e, n);
|
|
1784
1784
|
}
|
|
1785
1785
|
function Nl() {
|
|
1786
1786
|
var e, t, n = this, o = n._id, r = n.size();
|
|
@@ -1795,15 +1795,15 @@ function Nl() {
|
|
|
1795
1795
|
});
|
|
1796
1796
|
}
|
|
1797
1797
|
var Cl = 0;
|
|
1798
|
-
function
|
|
1798
|
+
function Ee(e, t, n, o) {
|
|
1799
1799
|
this._groups = e, this._parents = t, this._name = n, this._id = o;
|
|
1800
1800
|
}
|
|
1801
1801
|
function Wr() {
|
|
1802
1802
|
return ++Cl;
|
|
1803
1803
|
}
|
|
1804
1804
|
var ve = xt.prototype;
|
|
1805
|
-
|
|
1806
|
-
constructor:
|
|
1805
|
+
Ee.prototype = {
|
|
1806
|
+
constructor: Ee,
|
|
1807
1807
|
select: sl,
|
|
1808
1808
|
selectAll: al,
|
|
1809
1809
|
selectChild: ve.selectChild,
|
|
@@ -1811,7 +1811,7 @@ Se.prototype = {
|
|
|
1811
1811
|
filter: ju,
|
|
1812
1812
|
merge: el,
|
|
1813
1813
|
selection: ul,
|
|
1814
|
-
transition:
|
|
1814
|
+
transition: Sl,
|
|
1815
1815
|
call: ve.call,
|
|
1816
1816
|
nodes: ve.nodes,
|
|
1817
1817
|
node: ve.node,
|
|
@@ -1824,7 +1824,7 @@ Se.prototype = {
|
|
|
1824
1824
|
style: gl,
|
|
1825
1825
|
styleTween: yl,
|
|
1826
1826
|
text: vl,
|
|
1827
|
-
textTween:
|
|
1827
|
+
textTween: El,
|
|
1828
1828
|
remove: il,
|
|
1829
1829
|
tween: Iu,
|
|
1830
1830
|
delay: Zu,
|
|
@@ -1852,11 +1852,11 @@ function $l(e, t) {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
function Il(e) {
|
|
1854
1854
|
var t, n;
|
|
1855
|
-
e instanceof
|
|
1855
|
+
e instanceof Ee ? (t = e._id, e = e._name) : (t = Wr(), (n = kl).time = Gn(), e = e == null ? null : e + "");
|
|
1856
1856
|
for (var o = this._groups, r = o.length, i = 0; i < r; ++i)
|
|
1857
1857
|
for (var s = o[i], a = s.length, c, u = 0; u < a; ++u)
|
|
1858
1858
|
(c = s[u]) && Qt(c, e, t, u, s, n || $l(c, t));
|
|
1859
|
-
return new
|
|
1859
|
+
return new Ee(o, this._parents, e, t);
|
|
1860
1860
|
}
|
|
1861
1861
|
xt.prototype.interrupt = Mu;
|
|
1862
1862
|
xt.prototype.transition = Il;
|
|
@@ -1954,54 +1954,54 @@ function Gr() {
|
|
|
1954
1954
|
function x(g) {
|
|
1955
1955
|
g.property("__zoom", Po).on("wheel.zoom", z, { passive: !1 }).on("mousedown.zoom", I).on("dblclick.zoom", k).filter(r).on("touchstart.zoom", V).on("touchmove.zoom", D).on("touchend.zoom touchcancel.zoom", H).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
1956
1956
|
}
|
|
1957
|
-
x.transform = function(g,
|
|
1957
|
+
x.transform = function(g, S, v, M) {
|
|
1958
1958
|
var $ = g.selection ? g.selection() : g;
|
|
1959
|
-
$.property("__zoom", Po), g !== $ ?
|
|
1960
|
-
A(this, arguments).event(M).start().zoom(null, typeof
|
|
1959
|
+
$.property("__zoom", Po), g !== $ ? E(g, S, v, M) : $.interrupt().each(function() {
|
|
1960
|
+
A(this, arguments).event(M).start().zoom(null, typeof S == "function" ? S.apply(this, arguments) : S).end();
|
|
1961
1961
|
});
|
|
1962
|
-
}, x.scaleBy = function(g,
|
|
1962
|
+
}, x.scaleBy = function(g, S, v, M) {
|
|
1963
1963
|
x.scaleTo(g, function() {
|
|
1964
|
-
var $ = this.__zoom.k, C = typeof
|
|
1964
|
+
var $ = this.__zoom.k, C = typeof S == "function" ? S.apply(this, arguments) : S;
|
|
1965
1965
|
return $ * C;
|
|
1966
1966
|
}, v, M);
|
|
1967
|
-
}, x.scaleTo = function(g,
|
|
1967
|
+
}, x.scaleTo = function(g, S, v, M) {
|
|
1968
1968
|
x.transform(g, function() {
|
|
1969
|
-
var $ = t.apply(this, arguments), C = this.__zoom, T = v == null ? m($) : typeof v == "function" ? v.apply(this, arguments) : v, O = C.invert(T), L = typeof
|
|
1969
|
+
var $ = t.apply(this, arguments), C = this.__zoom, T = v == null ? m($) : typeof v == "function" ? v.apply(this, arguments) : v, O = C.invert(T), L = typeof S == "function" ? S.apply(this, arguments) : S;
|
|
1970
1970
|
return n(w(b(C, L), T, O), $, s);
|
|
1971
1971
|
}, v, M);
|
|
1972
|
-
}, x.translateBy = function(g,
|
|
1972
|
+
}, x.translateBy = function(g, S, v, M) {
|
|
1973
1973
|
x.transform(g, function() {
|
|
1974
1974
|
return n(this.__zoom.translate(
|
|
1975
|
-
typeof
|
|
1975
|
+
typeof S == "function" ? S.apply(this, arguments) : S,
|
|
1976
1976
|
typeof v == "function" ? v.apply(this, arguments) : v
|
|
1977
1977
|
), t.apply(this, arguments), s);
|
|
1978
1978
|
}, null, M);
|
|
1979
|
-
}, x.translateTo = function(g,
|
|
1979
|
+
}, x.translateTo = function(g, S, v, M, $) {
|
|
1980
1980
|
x.transform(g, function() {
|
|
1981
1981
|
var C = t.apply(this, arguments), T = this.__zoom, O = M == null ? m(C) : typeof M == "function" ? M.apply(this, arguments) : M;
|
|
1982
1982
|
return n(Jt.translate(O[0], O[1]).scale(T.k).translate(
|
|
1983
|
-
typeof
|
|
1983
|
+
typeof S == "function" ? -S.apply(this, arguments) : -S,
|
|
1984
1984
|
typeof v == "function" ? -v.apply(this, arguments) : -v
|
|
1985
1985
|
), C, s);
|
|
1986
1986
|
}, M, $);
|
|
1987
1987
|
};
|
|
1988
|
-
function b(g,
|
|
1989
|
-
return
|
|
1988
|
+
function b(g, S) {
|
|
1989
|
+
return S = Math.max(i[0], Math.min(i[1], S)), S === g.k ? g : new _e(S, g.x, g.y);
|
|
1990
1990
|
}
|
|
1991
|
-
function w(g,
|
|
1992
|
-
var M =
|
|
1991
|
+
function w(g, S, v) {
|
|
1992
|
+
var M = S[0] - v[0] * g.k, $ = S[1] - v[1] * g.k;
|
|
1993
1993
|
return M === g.x && $ === g.y ? g : new _e(g.k, M, $);
|
|
1994
1994
|
}
|
|
1995
1995
|
function m(g) {
|
|
1996
1996
|
return [(+g[0][0] + +g[1][0]) / 2, (+g[0][1] + +g[1][1]) / 2];
|
|
1997
1997
|
}
|
|
1998
|
-
function
|
|
1998
|
+
function E(g, S, v, M) {
|
|
1999
1999
|
g.on("start.zoom", function() {
|
|
2000
2000
|
A(this, arguments).event(M).start();
|
|
2001
2001
|
}).on("interrupt.zoom end.zoom", function() {
|
|
2002
2002
|
A(this, arguments).event(M).end();
|
|
2003
2003
|
}).tween("zoom", function() {
|
|
2004
|
-
var $ = this, C = arguments, T = A($, C).event(M), O = t.apply($, C), L = v == null ? m(O) : typeof v == "function" ? v.apply($, C) : v, Z = Math.max(O[1][0] - O[0][0], O[1][1] - O[0][1]), X = $.__zoom, F = typeof
|
|
2004
|
+
var $ = this, C = arguments, T = A($, C).event(M), O = t.apply($, C), L = v == null ? m(O) : typeof v == "function" ? v.apply($, C) : v, Z = Math.max(O[1][0] - O[0][0], O[1][1] - O[0][1]), X = $.__zoom, F = typeof S == "function" ? S.apply($, C) : S, Y = c(X.invert(L).concat(Z / X.k), F.invert(L).concat(Z / F.k));
|
|
2005
2005
|
return function(q) {
|
|
2006
2006
|
if (q === 1) q = F;
|
|
2007
2007
|
else {
|
|
@@ -2012,11 +2012,11 @@ function Gr() {
|
|
|
2012
2012
|
};
|
|
2013
2013
|
});
|
|
2014
2014
|
}
|
|
2015
|
-
function A(g,
|
|
2016
|
-
return !v && g.__zooming || new N(g,
|
|
2015
|
+
function A(g, S, v) {
|
|
2016
|
+
return !v && g.__zooming || new N(g, S);
|
|
2017
2017
|
}
|
|
2018
|
-
function N(g,
|
|
2019
|
-
this.that = g, this.args =
|
|
2018
|
+
function N(g, S) {
|
|
2019
|
+
this.that = g, this.args = S, this.active = 0, this.sourceEvent = null, this.extent = t.apply(g, S), this.taps = 0;
|
|
2020
2020
|
}
|
|
2021
2021
|
N.prototype = {
|
|
2022
2022
|
event: function(g) {
|
|
@@ -2025,31 +2025,30 @@ function Gr() {
|
|
|
2025
2025
|
start: function() {
|
|
2026
2026
|
return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
|
2027
2027
|
},
|
|
2028
|
-
zoom: function(g,
|
|
2029
|
-
return this.mouse && g !== "mouse" && (this.mouse[1] =
|
|
2028
|
+
zoom: function(g, S) {
|
|
2029
|
+
return this.mouse && g !== "mouse" && (this.mouse[1] = S.invert(this.mouse[0])), this.touch0 && g !== "touch" && (this.touch0[1] = S.invert(this.touch0[0])), this.touch1 && g !== "touch" && (this.touch1[1] = S.invert(this.touch1[0])), this.that.__zoom = S, this.emit("zoom"), this;
|
|
2030
2030
|
},
|
|
2031
2031
|
end: function() {
|
|
2032
2032
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
2033
2033
|
},
|
|
2034
2034
|
emit: function(g) {
|
|
2035
|
-
var
|
|
2035
|
+
var S = ue(this.that).datum();
|
|
2036
2036
|
u.call(
|
|
2037
2037
|
g,
|
|
2038
2038
|
this.that,
|
|
2039
2039
|
new Al(g, {
|
|
2040
2040
|
sourceEvent: this.sourceEvent,
|
|
2041
2041
|
target: x,
|
|
2042
|
-
type: g,
|
|
2043
2042
|
transform: this.that.__zoom,
|
|
2044
2043
|
dispatch: u
|
|
2045
2044
|
}),
|
|
2046
|
-
|
|
2045
|
+
S
|
|
2047
2046
|
);
|
|
2048
2047
|
}
|
|
2049
2048
|
};
|
|
2050
|
-
function z(g, ...
|
|
2049
|
+
function z(g, ...S) {
|
|
2051
2050
|
if (!e.apply(this, arguments)) return;
|
|
2052
|
-
var v = A(this,
|
|
2051
|
+
var v = A(this, S).event(g), M = this.__zoom, $ = Math.max(i[0], Math.min(i[1], M.k * Math.pow(2, o.apply(this, arguments)))), C = he(g);
|
|
2053
2052
|
if (v.wheel)
|
|
2054
2053
|
(v.mouse[0][0] !== C[0] || v.mouse[0][1] !== C[1]) && (v.mouse[1] = M.invert(v.mouse[0] = C)), clearTimeout(v.wheel);
|
|
2055
2054
|
else {
|
|
@@ -2061,9 +2060,9 @@ function Gr() {
|
|
|
2061
2060
|
v.wheel = null, v.end();
|
|
2062
2061
|
}
|
|
2063
2062
|
}
|
|
2064
|
-
function I(g, ...
|
|
2063
|
+
function I(g, ...S) {
|
|
2065
2064
|
if (d || !e.apply(this, arguments)) return;
|
|
2066
|
-
var v = g.currentTarget, M = A(this,
|
|
2065
|
+
var v = g.currentTarget, M = A(this, S, !0).event(g), $ = ue(g.view).on("mousemove.zoom", L, !0).on("mouseup.zoom", Z, !0), C = he(g, v), T = g.clientX, O = g.clientY;
|
|
2067
2066
|
Ar(g.view), xn(g), M.mouse = [C, this.__zoom.invert(C)], Ht(this), M.start();
|
|
2068
2067
|
function L(X) {
|
|
2069
2068
|
if (ot(X), !M.moved) {
|
|
@@ -2076,15 +2075,15 @@ function Gr() {
|
|
|
2076
2075
|
$.on("mousemove.zoom mouseup.zoom", null), Pr(X.view, M.moved), ot(X), M.event(X).end();
|
|
2077
2076
|
}
|
|
2078
2077
|
}
|
|
2079
|
-
function k(g, ...
|
|
2078
|
+
function k(g, ...S) {
|
|
2080
2079
|
if (e.apply(this, arguments)) {
|
|
2081
|
-
var v = this.__zoom, M = he(g.changedTouches ? g.changedTouches[0] : g, this), $ = v.invert(M), C = v.k * (g.shiftKey ? 0.5 : 2), T = n(w(b(v, C), M, $), t.apply(this,
|
|
2082
|
-
ot(g), a > 0 ? ue(this).transition().duration(a).call(
|
|
2080
|
+
var v = this.__zoom, M = he(g.changedTouches ? g.changedTouches[0] : g, this), $ = v.invert(M), C = v.k * (g.shiftKey ? 0.5 : 2), T = n(w(b(v, C), M, $), t.apply(this, S), s);
|
|
2081
|
+
ot(g), a > 0 ? ue(this).transition().duration(a).call(E, T, M, g) : ue(this).call(x.transform, T, M, g);
|
|
2083
2082
|
}
|
|
2084
2083
|
}
|
|
2085
|
-
function V(g, ...
|
|
2084
|
+
function V(g, ...S) {
|
|
2086
2085
|
if (e.apply(this, arguments)) {
|
|
2087
|
-
var v = g.touches, M = v.length, $ = A(this,
|
|
2086
|
+
var v = g.touches, M = v.length, $ = A(this, S, g.changedTouches.length === M).event(g), C, T, O, L;
|
|
2088
2087
|
for (xn(g), T = 0; T < M; ++T)
|
|
2089
2088
|
O = v[T], L = he(O, this), L = [L, this.__zoom.invert(L), O.identifier], $.touch0 ? !$.touch1 && $.touch0[2] !== L[2] && ($.touch1 = L, $.taps = 0) : ($.touch0 = L, C = !0, $.taps = 1 + !!f);
|
|
2090
2089
|
f && (f = clearTimeout(f)), C && ($.taps < 2 && (l = L[0], f = setTimeout(function() {
|
|
@@ -2092,9 +2091,9 @@ function Gr() {
|
|
|
2092
2091
|
}, h)), Ht(this), $.start());
|
|
2093
2092
|
}
|
|
2094
2093
|
}
|
|
2095
|
-
function D(g, ...
|
|
2094
|
+
function D(g, ...S) {
|
|
2096
2095
|
if (this.__zooming) {
|
|
2097
|
-
var v = A(this,
|
|
2096
|
+
var v = A(this, S).event(g), M = g.changedTouches, $ = M.length, C, T, O, L;
|
|
2098
2097
|
for (ot(g), C = 0; C < $; ++C)
|
|
2099
2098
|
T = M[C], O = he(T, this), v.touch0 && v.touch0[2] === T.identifier ? v.touch0[0] = O : v.touch1 && v.touch1[2] === T.identifier && (v.touch1[0] = O);
|
|
2100
2099
|
if (T = v.that.__zoom, v.touch1) {
|
|
@@ -2105,9 +2104,9 @@ function Gr() {
|
|
|
2105
2104
|
v.zoom("touch", n(w(T, O, L), v.extent, s));
|
|
2106
2105
|
}
|
|
2107
2106
|
}
|
|
2108
|
-
function H(g, ...
|
|
2107
|
+
function H(g, ...S) {
|
|
2109
2108
|
if (this.__zooming) {
|
|
2110
|
-
var v = A(this,
|
|
2109
|
+
var v = A(this, S).event(g), M = g.changedTouches, $ = M.length, C, T;
|
|
2111
2110
|
for (xn(g), d && clearTimeout(d), d = setTimeout(function() {
|
|
2112
2111
|
d = null;
|
|
2113
2112
|
}, h), C = 0; C < $; ++C)
|
|
@@ -2551,7 +2550,7 @@ function Kl({ source: e, sourcePosition: t = R.Bottom, target: n, targetPosition
|
|
|
2551
2550
|
target: u
|
|
2552
2551
|
}), l = f.x !== 0 ? "x" : "y", d = f[l];
|
|
2553
2552
|
let h = [], p, y;
|
|
2554
|
-
const _ = { x: 0, y: 0 }, x = { x: 0, y: 0 }, [b, w, m,
|
|
2553
|
+
const _ = { x: 0, y: 0 }, x = { x: 0, y: 0 }, [b, w, m, E] = di({
|
|
2555
2554
|
sourceX: e.x,
|
|
2556
2555
|
sourceY: e.y,
|
|
2557
2556
|
targetX: n.x,
|
|
@@ -2577,8 +2576,8 @@ function Kl({ source: e, sourcePosition: t = R.Bottom, target: n, targetPosition
|
|
|
2577
2576
|
}
|
|
2578
2577
|
}
|
|
2579
2578
|
if (t !== o) {
|
|
2580
|
-
const H = l === "x" ? "y" : "x", g = s[l] === a[H],
|
|
2581
|
-
(s[l] === 1 && (!g &&
|
|
2579
|
+
const H = l === "x" ? "y" : "x", g = s[l] === a[H], S = c[H] > u[H], v = c[H] < u[H];
|
|
2580
|
+
(s[l] === 1 && (!g && S || g && v) || s[l] !== 1 && (!g && v || g && S)) && (h = l === "x" ? N : z);
|
|
2582
2581
|
}
|
|
2583
2582
|
const I = { x: c.x + _.x, y: c.y + _.y }, k = { x: u.x + x.x, y: u.y + x.y }, V = Math.max(Math.abs(I.x - h[0].x), Math.abs(k.x - h[0].x)), D = Math.max(Math.abs(I.y - h[0].y), Math.abs(k.y - h[0].y));
|
|
2584
2583
|
V >= D ? (p = (I.x + k.x) / 2, y = h[0].y) : (p = h[0].x, y = (I.y + k.y) / 2);
|
|
@@ -2589,7 +2588,7 @@ function Kl({ source: e, sourcePosition: t = R.Bottom, target: n, targetPosition
|
|
|
2589
2588
|
...h,
|
|
2590
2589
|
{ x: u.x + x.x, y: u.y + x.y },
|
|
2591
2590
|
n
|
|
2592
|
-
], p, y, m,
|
|
2591
|
+
], p, y, m, E];
|
|
2593
2592
|
}
|
|
2594
2593
|
function Ul(e, t, n, o) {
|
|
2595
2594
|
const r = Math.min(Lo(e, t) / 2, Lo(t, n) / 2, o), { x: i, y: s } = t;
|
|
@@ -2992,10 +2991,10 @@ function vn({ nodeId: e, dragItems: t, nodeLookup: n, dragging: o = !0 }) {
|
|
|
2992
2991
|
}
|
|
2993
2992
|
function ad({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, onDragStop: r }) {
|
|
2994
2993
|
let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), c = !1, u = { x: 0, y: 0 }, f = null, l = !1, d = null, h = !1;
|
|
2995
|
-
function p({ noDragClassName: _, handleSelector: x, domNode: b, isSelectable: w, nodeId: m, nodeClickDistance:
|
|
2994
|
+
function p({ noDragClassName: _, handleSelector: x, domNode: b, isSelectable: w, nodeId: m, nodeClickDistance: E = 0 }) {
|
|
2996
2995
|
d = ue(b);
|
|
2997
2996
|
function A({ x: k, y: V }, D) {
|
|
2998
|
-
const { nodeLookup: H, nodeExtent: g, snapGrid:
|
|
2997
|
+
const { nodeLookup: H, nodeExtent: g, snapGrid: S, snapToGrid: v, nodeOrigin: M, onNodeDrag: $, onSelectionDrag: C, onError: T, updateNodePositions: O } = t();
|
|
2999
2998
|
i = { x: k, y: V };
|
|
3000
2999
|
let L = !1, Z = { x: 0, y: 0, x2: 0, y2: 0 };
|
|
3001
3000
|
if (a.size > 1 && g) {
|
|
@@ -3006,7 +3005,7 @@ function ad({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3006
3005
|
if (!H.has(X))
|
|
3007
3006
|
continue;
|
|
3008
3007
|
let Y = { x: k - F.distance.x, y: V - F.distance.y };
|
|
3009
|
-
v && (Y = tn(Y,
|
|
3008
|
+
v && (Y = tn(Y, S));
|
|
3010
3009
|
let q = [
|
|
3011
3010
|
[g[0][0], g[0][1]],
|
|
3012
3011
|
[g[1][0], g[1][1]]
|
|
@@ -3044,9 +3043,9 @@ function ad({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3044
3043
|
(H !== 0 || g !== 0) && (i.x = (i.x ?? 0) - H / k[2], i.y = (i.y ?? 0) - g / k[2], await V({ x: H, y: g }) && A(i, null)), s = requestAnimationFrame(N);
|
|
3045
3044
|
}
|
|
3046
3045
|
function z(k) {
|
|
3047
|
-
const { nodeLookup: V, multiSelectionActive: D, nodesDraggable: H, transform: g, snapGrid:
|
|
3046
|
+
const { nodeLookup: V, multiSelectionActive: D, nodesDraggable: H, transform: g, snapGrid: S, snapToGrid: v, selectNodesOnDrag: M, onNodeDragStart: $, onSelectionDragStart: C, unselectNodesAndEdges: T } = t();
|
|
3048
3047
|
l = !0, (!M || !w) && !D && m && (V.get(m)?.selected || T()), w && M && m && e?.(m);
|
|
3049
|
-
const O = st(k.sourceEvent, { transform: g, snapGrid:
|
|
3048
|
+
const O = st(k.sourceEvent, { transform: g, snapGrid: S, snapToGrid: v, containerBounds: f });
|
|
3050
3049
|
if (i = O, a = sd(V, H, O, m), a.size > 0 && (n || $ || !m && C)) {
|
|
3051
3050
|
const [L, Z] = vn({
|
|
3052
3051
|
nodeId: m,
|
|
@@ -3056,16 +3055,16 @@ function ad({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3056
3055
|
n?.(k.sourceEvent, a, L, Z), $?.(k.sourceEvent, L, Z), m || C?.(k.sourceEvent, Z);
|
|
3057
3056
|
}
|
|
3058
3057
|
}
|
|
3059
|
-
const I = zr().clickDistance(
|
|
3060
|
-
const { domNode: V, nodeDragThreshold: D, transform: H, snapGrid: g, snapToGrid:
|
|
3061
|
-
f = V?.getBoundingClientRect() || null, h = !1, D === 0 && z(k), i = st(k.sourceEvent, { transform: H, snapGrid: g, snapToGrid:
|
|
3058
|
+
const I = zr().clickDistance(E).on("start", (k) => {
|
|
3059
|
+
const { domNode: V, nodeDragThreshold: D, transform: H, snapGrid: g, snapToGrid: S } = t();
|
|
3060
|
+
f = V?.getBoundingClientRect() || null, h = !1, D === 0 && z(k), i = st(k.sourceEvent, { transform: H, snapGrid: g, snapToGrid: S, containerBounds: f }), u = be(k.sourceEvent, f);
|
|
3062
3061
|
}).on("drag", (k) => {
|
|
3063
|
-
const { autoPanOnNodeDrag: V, transform: D, snapGrid: H, snapToGrid: g, nodeDragThreshold:
|
|
3062
|
+
const { autoPanOnNodeDrag: V, transform: D, snapGrid: H, snapToGrid: g, nodeDragThreshold: S, nodeLookup: v } = t(), M = st(k.sourceEvent, { transform: D, snapGrid: H, snapToGrid: g, containerBounds: f });
|
|
3064
3063
|
if ((k.sourceEvent.type === "touchmove" && k.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
3065
3064
|
m && !v.has(m)) && (h = !0), !h) {
|
|
3066
3065
|
if (!c && V && l && (c = !0, N()), !l) {
|
|
3067
3066
|
const $ = M.xSnapped - (i.x ?? 0), C = M.ySnapped - (i.y ?? 0);
|
|
3068
|
-
Math.sqrt($ * $ + C * C) >
|
|
3067
|
+
Math.sqrt($ * $ + C * C) > S && z(k);
|
|
3069
3068
|
}
|
|
3070
3069
|
(i.x !== M.xSnapped || i.y !== M.ySnapped) && a && l && (u = be(k.sourceEvent, f), A(M, k.sourceEvent));
|
|
3071
3070
|
}
|
|
@@ -3073,13 +3072,13 @@ function ad({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3073
3072
|
if (!(!l || h) && (c = !1, l = !1, cancelAnimationFrame(s), a.size > 0)) {
|
|
3074
3073
|
const { nodeLookup: V, updateNodePositions: D, onNodeDragStop: H, onSelectionDragStop: g } = t();
|
|
3075
3074
|
if (D(a, !1), r || H || !m && g) {
|
|
3076
|
-
const [
|
|
3075
|
+
const [S, v] = vn({
|
|
3077
3076
|
nodeId: m,
|
|
3078
3077
|
dragItems: a,
|
|
3079
3078
|
nodeLookup: V,
|
|
3080
3079
|
dragging: !1
|
|
3081
3080
|
});
|
|
3082
|
-
r?.(k.sourceEvent, a,
|
|
3081
|
+
r?.(k.sourceEvent, a, S, v), H?.(k.sourceEvent, S, v), m || g?.(k.sourceEvent, v);
|
|
3083
3082
|
}
|
|
3084
3083
|
}
|
|
3085
3084
|
}).filter((k) => {
|
|
@@ -3143,14 +3142,14 @@ function dd(e, t) {
|
|
|
3143
3142
|
return t ? n = !0 : e && !t && (n = !1), n;
|
|
3144
3143
|
}
|
|
3145
3144
|
const wi = () => !0;
|
|
3146
|
-
function fd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: u, autoPanOnConnect: f, flowId: l, panBy: d, cancelConnection: h, onConnectStart: p, onConnect: y, onConnectEnd: _, isValidConnection: x = wi, onReconnectEnd: b, updateConnection: w, getTransform: m, getFromHandle:
|
|
3145
|
+
function fd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: u, autoPanOnConnect: f, flowId: l, panBy: d, cancelConnection: h, onConnectStart: p, onConnect: y, onConnectEnd: _, isValidConnection: x = wi, onReconnectEnd: b, updateConnection: w, getTransform: m, getFromHandle: E, autoPanSpeed: A }) {
|
|
3147
3146
|
const N = ai(e.target);
|
|
3148
3147
|
let z = 0, I;
|
|
3149
3148
|
const { x: k, y: V } = be(e), D = N?.elementFromPoint(k, V), H = yi(i, D), g = a?.getBoundingClientRect();
|
|
3150
3149
|
if (!g || !H)
|
|
3151
3150
|
return;
|
|
3152
|
-
const
|
|
3153
|
-
if (!
|
|
3151
|
+
const S = mi(r, H, o, c, t);
|
|
3152
|
+
if (!S)
|
|
3154
3153
|
return;
|
|
3155
3154
|
let v = be(e, g), M = !1, $ = null, C = !1, T = null;
|
|
3156
3155
|
function O() {
|
|
@@ -3160,10 +3159,10 @@ function fd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r,
|
|
|
3160
3159
|
d({ x: G, y: ee }), z = requestAnimationFrame(O);
|
|
3161
3160
|
}
|
|
3162
3161
|
const L = {
|
|
3163
|
-
...
|
|
3162
|
+
...S,
|
|
3164
3163
|
nodeId: r,
|
|
3165
3164
|
type: H,
|
|
3166
|
-
position:
|
|
3165
|
+
position: S.position
|
|
3167
3166
|
}, Z = c.get(r), F = {
|
|
3168
3167
|
inProgress: !0,
|
|
3169
3168
|
isValid: null,
|
|
@@ -3180,7 +3179,7 @@ function fd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r,
|
|
|
3180
3179
|
let Y = F;
|
|
3181
3180
|
p?.(e, { nodeId: r, handleId: o, handleType: H });
|
|
3182
3181
|
function q(G) {
|
|
3183
|
-
if (!
|
|
3182
|
+
if (!E() || !L) {
|
|
3184
3183
|
B(G);
|
|
3185
3184
|
return;
|
|
3186
3185
|
}
|
|
@@ -3228,7 +3227,7 @@ function xi(e, { handle: t, connectionMode: n, fromNodeId: o, fromHandleId: r, f
|
|
|
3228
3227
|
toHandle: null
|
|
3229
3228
|
};
|
|
3230
3229
|
if (_) {
|
|
3231
|
-
const b = yi(void 0, _), w = _.getAttribute("data-nodeid"), m = _.getAttribute("data-handleid"),
|
|
3230
|
+
const b = yi(void 0, _), w = _.getAttribute("data-nodeid"), m = _.getAttribute("data-handleid"), E = _.classList.contains("connectable"), A = _.classList.contains("connectableend");
|
|
3232
3231
|
if (!w || !b)
|
|
3233
3232
|
return x;
|
|
3234
3233
|
const N = {
|
|
@@ -3238,7 +3237,7 @@ function xi(e, { handle: t, connectionMode: n, fromNodeId: o, fromHandleId: r, f
|
|
|
3238
3237
|
targetHandle: l ? r : m
|
|
3239
3238
|
};
|
|
3240
3239
|
x.connection = N;
|
|
3241
|
-
const I =
|
|
3240
|
+
const I = E && A && (n === Ze.Strict ? l && b === "source" || !l && b === "target" : w !== o || m !== r);
|
|
3242
3241
|
x.isValid = I && u(N), x.toHandle = mi(w, b, m, f, n, !1);
|
|
3243
3242
|
}
|
|
3244
3243
|
return x;
|
|
@@ -3254,7 +3253,7 @@ function hd({ domNode: e, panZoom: t, getTransform: n, getViewScale: o }) {
|
|
|
3254
3253
|
const m = n();
|
|
3255
3254
|
if (w.sourceEvent.type !== "wheel" || !t)
|
|
3256
3255
|
return;
|
|
3257
|
-
const
|
|
3256
|
+
const E = -w.sourceEvent.deltaY * (w.sourceEvent.deltaMode === 1 ? 0.05 : w.sourceEvent.deltaMode ? 1 : 2e-3) * f, A = m[2] * Math.pow(2, E);
|
|
3258
3257
|
t.scaleTo(A);
|
|
3259
3258
|
};
|
|
3260
3259
|
let y = [0, 0];
|
|
@@ -3267,11 +3266,11 @@ function hd({ domNode: e, panZoom: t, getTransform: n, getViewScale: o }) {
|
|
|
3267
3266
|
const m = n();
|
|
3268
3267
|
if (w.sourceEvent.type !== "mousemove" && w.sourceEvent.type !== "touchmove" || !t)
|
|
3269
3268
|
return;
|
|
3270
|
-
const
|
|
3269
|
+
const E = [
|
|
3271
3270
|
w.sourceEvent.clientX ?? w.sourceEvent.touches[0].clientX,
|
|
3272
3271
|
w.sourceEvent.clientY ?? w.sourceEvent.touches[0].clientY
|
|
3273
|
-
], A = [
|
|
3274
|
-
y =
|
|
3272
|
+
], A = [E[0] - y[0], E[1] - y[1]];
|
|
3273
|
+
y = E;
|
|
3275
3274
|
const N = o() * Math.max(m[2], Math.log(m[2])) * (h ? -1 : 1), z = {
|
|
3276
3275
|
x: m[0] - A[0] * N,
|
|
3277
3276
|
y: m[1] - A[1] * N
|
|
@@ -3408,9 +3407,9 @@ function _d({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3408
3407
|
d?.transform(bn(h, H?.duration, () => g(!0)), D);
|
|
3409
3408
|
}) : Promise.resolve(!1);
|
|
3410
3409
|
}
|
|
3411
|
-
function x({ noWheelClassName: D, noPanClassName: H, onPaneContextMenu: g, userSelectionActive:
|
|
3412
|
-
|
|
3413
|
-
const B = v && !X && !
|
|
3410
|
+
function x({ noWheelClassName: D, noPanClassName: H, onPaneContextMenu: g, userSelectionActive: S, panOnScroll: v, panOnDrag: M, panOnScrollMode: $, panOnScrollSpeed: C, preventScrolling: T, zoomOnPinch: O, zoomOnScroll: L, zoomOnDoubleClick: Z, zoomActivationKeyPressed: X, lib: F, onTransformChange: Y }) {
|
|
3411
|
+
S && !f.isZoomingOrPanning && b();
|
|
3412
|
+
const B = v && !X && !S ? pd({
|
|
3414
3413
|
zoomPanValues: f,
|
|
3415
3414
|
noWheelClassName: D,
|
|
3416
3415
|
d3Selection: h,
|
|
@@ -3426,7 +3425,7 @@ function _d({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3426
3425
|
preventScrolling: T,
|
|
3427
3426
|
d3ZoomHandler: p
|
|
3428
3427
|
});
|
|
3429
|
-
if (h.on("wheel.zoom", B, { passive: !1 }), !
|
|
3428
|
+
if (h.on("wheel.zoom", B, { passive: !1 }), !S) {
|
|
3430
3429
|
const ee = yd({
|
|
3431
3430
|
zoomPanValues: f,
|
|
3432
3431
|
onDraggingChange: u,
|
|
@@ -3458,7 +3457,7 @@ function _d({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3458
3457
|
panOnScroll: v,
|
|
3459
3458
|
zoomOnDoubleClick: Z,
|
|
3460
3459
|
zoomOnPinch: O,
|
|
3461
|
-
userSelectionActive:
|
|
3460
|
+
userSelectionActive: S,
|
|
3462
3461
|
noPanClassName: H,
|
|
3463
3462
|
noWheelClassName: D,
|
|
3464
3463
|
lib: F
|
|
@@ -3469,14 +3468,14 @@ function _d({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3469
3468
|
d.on("zoom", null);
|
|
3470
3469
|
}
|
|
3471
3470
|
async function w(D, H, g) {
|
|
3472
|
-
const
|
|
3471
|
+
const S = _n(D), v = d?.constrain()(S, H, g);
|
|
3473
3472
|
return v && await _(v), new Promise((M) => M(v));
|
|
3474
3473
|
}
|
|
3475
3474
|
async function m(D, H) {
|
|
3476
3475
|
const g = _n(D);
|
|
3477
|
-
return await _(g, H), new Promise((
|
|
3476
|
+
return await _(g, H), new Promise((S) => S(g));
|
|
3478
3477
|
}
|
|
3479
|
-
function
|
|
3478
|
+
function E(D) {
|
|
3480
3479
|
if (h) {
|
|
3481
3480
|
const H = _n(D), g = h.property("__zoom");
|
|
3482
3481
|
(g.k !== D.zoom || g.x !== D.x || g.y !== D.y) && d?.transform(h, H, null, { sync: !0 });
|
|
@@ -3516,7 +3515,7 @@ function _d({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3516
3515
|
scaleBy: z,
|
|
3517
3516
|
setScaleExtent: I,
|
|
3518
3517
|
setTranslateExtent: k,
|
|
3519
|
-
syncViewport:
|
|
3518
|
+
syncViewport: E,
|
|
3520
3519
|
setClickDistance: V
|
|
3521
3520
|
};
|
|
3522
3521
|
}
|
|
@@ -3528,7 +3527,7 @@ function bd({ width: e, prevWidth: t, height: n, prevHeight: o, affectsX: r, aff
|
|
|
3528
3527
|
const s = e - t, a = n - o, c = [s > 0 ? 1 : s < 0 ? -1 : 0, a > 0 ? 1 : a < 0 ? -1 : 0];
|
|
3529
3528
|
return s && r && (c[0] = c[0] * -1), a && i && (c[1] = c[1] * -1), c;
|
|
3530
3529
|
}
|
|
3531
|
-
function
|
|
3530
|
+
function Ed(e) {
|
|
3532
3531
|
const t = e.includes("right") || e.includes("left"), n = e.includes("bottom") || e.includes("top"), o = e.includes("left"), r = e.includes("top");
|
|
3533
3532
|
return {
|
|
3534
3533
|
isHorizontal: t,
|
|
@@ -3549,19 +3548,19 @@ function It(e, t, n) {
|
|
|
3549
3548
|
function Wo(e, t) {
|
|
3550
3549
|
return e ? !t : t;
|
|
3551
3550
|
}
|
|
3552
|
-
function
|
|
3551
|
+
function Sd(e, t, n, o, r, i, s, a) {
|
|
3553
3552
|
let { affectsX: c, affectsY: u } = t;
|
|
3554
|
-
const { isHorizontal: f, isVertical: l } = t, d = f && l, { xSnapped: h, ySnapped: p } = n, { minWidth: y, maxWidth: _, minHeight: x, maxHeight: b } = o, { x: w, y: m, width:
|
|
3553
|
+
const { isHorizontal: f, isVertical: l } = t, d = f && l, { xSnapped: h, ySnapped: p } = n, { minWidth: y, maxWidth: _, minHeight: x, maxHeight: b } = o, { x: w, y: m, width: E, height: A, aspectRatio: N } = e;
|
|
3555
3554
|
let z = Math.floor(f ? h - e.pointerX : 0), I = Math.floor(l ? p - e.pointerY : 0);
|
|
3556
|
-
const k =
|
|
3557
|
-
let g = It(k, y, _),
|
|
3555
|
+
const k = E + (c ? -z : z), V = A + (u ? -I : I), D = -i[0] * E, H = -i[1] * A;
|
|
3556
|
+
let g = It(k, y, _), S = It(V, x, b);
|
|
3558
3557
|
if (s) {
|
|
3559
3558
|
let $ = 0, C = 0;
|
|
3560
|
-
c && z < 0 ? $ = Me(w + z + D, s[0][0]) : !c && z > 0 && ($ = ke(w + k + D, s[1][0])), u && I < 0 ? C = Me(m + I + H, s[0][1]) : !u && I > 0 && (C = ke(m + V + H, s[1][1])), g = Math.max(g, $),
|
|
3559
|
+
c && z < 0 ? $ = Me(w + z + D, s[0][0]) : !c && z > 0 && ($ = ke(w + k + D, s[1][0])), u && I < 0 ? C = Me(m + I + H, s[0][1]) : !u && I > 0 && (C = ke(m + V + H, s[1][1])), g = Math.max(g, $), S = Math.max(S, C);
|
|
3561
3560
|
}
|
|
3562
3561
|
if (a) {
|
|
3563
3562
|
let $ = 0, C = 0;
|
|
3564
|
-
c && z > 0 ? $ = ke(w + z, a[0][0]) : !c && z < 0 && ($ = Me(w + k, a[1][0])), u && I > 0 ? C = ke(m + I, a[0][1]) : !u && I < 0 && (C = Me(m + V, a[1][1])), g = Math.max(g, $),
|
|
3563
|
+
c && z > 0 ? $ = ke(w + z, a[0][0]) : !c && z < 0 && ($ = Me(w + k, a[1][0])), u && I > 0 ? C = ke(m + I, a[0][1]) : !u && I < 0 && (C = Me(m + V, a[1][1])), g = Math.max(g, $), S = Math.max(S, C);
|
|
3565
3564
|
}
|
|
3566
3565
|
if (r) {
|
|
3567
3566
|
if (f) {
|
|
@@ -3577,20 +3576,20 @@ function Ed(e, t, n, o, r, i, s, a) {
|
|
|
3577
3576
|
}
|
|
3578
3577
|
if (l) {
|
|
3579
3578
|
const $ = It(V * N, y, _) / N;
|
|
3580
|
-
if (
|
|
3579
|
+
if (S = Math.max(S, $), s) {
|
|
3581
3580
|
let C = 0;
|
|
3582
|
-
!c && !u || u && !c && d ? C = ke(w + V * N + D, s[1][0]) / N : C = Me(w + (u ? I : -I) * N + D, s[0][0]) / N,
|
|
3581
|
+
!c && !u || u && !c && d ? C = ke(w + V * N + D, s[1][0]) / N : C = Me(w + (u ? I : -I) * N + D, s[0][0]) / N, S = Math.max(S, C);
|
|
3583
3582
|
}
|
|
3584
3583
|
if (a) {
|
|
3585
3584
|
let C = 0;
|
|
3586
|
-
!c && !u || u && !c && d ? C = Me(w + V * N, a[1][0]) / N : C = ke(w + (u ? I : -I) * N, a[0][0]) / N,
|
|
3585
|
+
!c && !u || u && !c && d ? C = Me(w + V * N, a[1][0]) / N : C = ke(w + (u ? I : -I) * N, a[0][0]) / N, S = Math.max(S, C);
|
|
3587
3586
|
}
|
|
3588
3587
|
}
|
|
3589
3588
|
}
|
|
3590
|
-
I = I + (I < 0 ?
|
|
3589
|
+
I = I + (I < 0 ? S : -S), z = z + (z < 0 ? g : -g), r && (d ? k > V * N ? I = (Wo(c, u) ? -z : z) / N : z = (Wo(c, u) ? -I : I) * N : f ? (I = z / N, u = c) : (z = I * N, c = u));
|
|
3591
3590
|
const v = c ? w + z : w, M = u ? m + I : m;
|
|
3592
3591
|
return {
|
|
3593
|
-
width:
|
|
3592
|
+
width: E + (c ? -z : z),
|
|
3594
3593
|
height: A + (u ? -I : I),
|
|
3595
3594
|
x: i[0] * z * (c ? -1 : 1) + v,
|
|
3596
3595
|
y: i[1] * I * (u ? -1 : 1) + M
|
|
@@ -3619,13 +3618,13 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3619
3618
|
const i = ue(e);
|
|
3620
3619
|
function s({ controlPosition: c, boundaries: u, keepAspectRatio: f, onResizeStart: l, onResize: d, onResizeEnd: h, shouldResize: p }) {
|
|
3621
3620
|
let y = { ...bi }, _ = { ...Nd };
|
|
3622
|
-
const x =
|
|
3623
|
-
let b, w = null, m = [],
|
|
3621
|
+
const x = Ed(c);
|
|
3622
|
+
let b, w = null, m = [], E, A, N;
|
|
3624
3623
|
const z = zr().on("start", (I) => {
|
|
3625
|
-
const { nodeLookup: k, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: g, paneDomNode:
|
|
3624
|
+
const { nodeLookup: k, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: g, paneDomNode: S } = n();
|
|
3626
3625
|
if (b = k.get(t), !b)
|
|
3627
3626
|
return;
|
|
3628
|
-
w =
|
|
3627
|
+
w = S?.getBoundingClientRect() ?? null;
|
|
3629
3628
|
const { xSnapped: v, ySnapped: M } = st(I.sourceEvent, {
|
|
3630
3629
|
transform: V,
|
|
3631
3630
|
snapGrid: D,
|
|
@@ -3642,7 +3641,7 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3642
3641
|
pointerX: v,
|
|
3643
3642
|
pointerY: M,
|
|
3644
3643
|
aspectRatio: y.width / y.height
|
|
3645
|
-
},
|
|
3644
|
+
}, E = void 0, b.parentId && (b.extent === "parent" || b.expandParent) && (E = k.get(b.parentId), A = E && b.extent === "parent" ? Cd(E) : void 0), m = [], N = void 0;
|
|
3646
3645
|
for (const [$, C] of k)
|
|
3647
3646
|
if (C.parentId === t && (m.push({
|
|
3648
3647
|
id: $,
|
|
@@ -3662,10 +3661,10 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3662
3661
|
snapGrid: V,
|
|
3663
3662
|
snapToGrid: D,
|
|
3664
3663
|
containerBounds: w
|
|
3665
|
-
}),
|
|
3664
|
+
}), S = [];
|
|
3666
3665
|
if (!b)
|
|
3667
3666
|
return;
|
|
3668
|
-
const { x: v, y: M, width: $, height: C } = y, T = {}, O = b.origin ?? H, { width: L, height: Z, x: X, y: F } =
|
|
3667
|
+
const { x: v, y: M, width: $, height: C } = y, T = {}, O = b.origin ?? H, { width: L, height: Z, x: X, y: F } = Sd(_, x, g, u, f, O, A, N), Y = L !== $, q = Z !== C, B = X !== v && Y, G = F !== M && q;
|
|
3669
3668
|
if (!B && !G && !Y && !q)
|
|
3670
3669
|
return;
|
|
3671
3670
|
if ((B || G || O[0] === 1 || O[1] === 1) && (T.x = B ? X : y.x, T.y = G ? F : y.y, y.x = T.x, y.y = T.y, m.length > 0)) {
|
|
@@ -3674,9 +3673,9 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3674
3673
|
ae.position = {
|
|
3675
3674
|
x: ae.position.x - U + O[0] * (L - $),
|
|
3676
3675
|
y: ae.position.y - oe + O[1] * (Z - C)
|
|
3677
|
-
},
|
|
3676
|
+
}, S.push(ae);
|
|
3678
3677
|
}
|
|
3679
|
-
if ((Y || q) && (T.width = Y ? L : y.width, T.height = q ? Z : y.height, y.width = T.width, y.height = T.height),
|
|
3678
|
+
if ((Y || q) && (T.width = Y ? L : y.width, T.height = q ? Z : y.height, y.width = T.width, y.height = T.height), E && b.expandParent) {
|
|
3680
3679
|
const U = O[0] * (T.width ?? 0);
|
|
3681
3680
|
T.x && T.x < U && (y.x = U, _.x = _.x - (T.x - U));
|
|
3682
3681
|
const oe = O[1] * (T.height ?? 0);
|
|
@@ -3690,7 +3689,7 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3690
3689
|
affectsX: x.affectsX,
|
|
3691
3690
|
affectsY: x.affectsY
|
|
3692
3691
|
}), Q = { ...y, direction: ee };
|
|
3693
|
-
p?.(I, Q) !== !1 && (d?.(I, Q), o(T,
|
|
3692
|
+
p?.(I, Q) !== !1 && (d?.(I, Q), o(T, S));
|
|
3694
3693
|
}).on("end", (I) => {
|
|
3695
3694
|
h?.(I, { ...y }), r?.();
|
|
3696
3695
|
});
|
|
@@ -3704,7 +3703,7 @@ function kd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3704
3703
|
destroy: a
|
|
3705
3704
|
};
|
|
3706
3705
|
}
|
|
3707
|
-
var oo = { exports: {} },
|
|
3706
|
+
var oo = { exports: {} }, Ei = {}, ro = { exports: {} }, Si = {};
|
|
3708
3707
|
/**
|
|
3709
3708
|
* @license React
|
|
3710
3709
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -3722,14 +3721,14 @@ var Id = typeof Object.is == "function" ? Object.is : $d, Ad = Ke.useState, Pd =
|
|
|
3722
3721
|
function Dd(e, t) {
|
|
3723
3722
|
var n = t(), o = Ad({ inst: { value: n, getSnapshot: t } }), r = o[0].inst, i = o[1];
|
|
3724
3723
|
return zd(function() {
|
|
3725
|
-
r.value = n, r.getSnapshot = t,
|
|
3724
|
+
r.value = n, r.getSnapshot = t, En(r) && i({ inst: r });
|
|
3726
3725
|
}, [e, n, t]), Pd(function() {
|
|
3727
|
-
return
|
|
3728
|
-
|
|
3726
|
+
return En(r) && i({ inst: r }), e(function() {
|
|
3727
|
+
En(r) && i({ inst: r });
|
|
3729
3728
|
});
|
|
3730
3729
|
}, [e]), Td(n), n;
|
|
3731
3730
|
}
|
|
3732
|
-
function
|
|
3731
|
+
function En(e) {
|
|
3733
3732
|
var t = e.getSnapshot;
|
|
3734
3733
|
e = e.value;
|
|
3735
3734
|
try {
|
|
@@ -3743,9 +3742,9 @@ function Hd(e, t) {
|
|
|
3743
3742
|
return t();
|
|
3744
3743
|
}
|
|
3745
3744
|
var Vd = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? Hd : Dd;
|
|
3746
|
-
|
|
3745
|
+
Si.useSyncExternalStore = Ke.useSyncExternalStore !== void 0 ? Ke.useSyncExternalStore : Vd;
|
|
3747
3746
|
ro.exports;
|
|
3748
|
-
ro.exports =
|
|
3747
|
+
ro.exports = Si;
|
|
3749
3748
|
var Od = ro.exports;
|
|
3750
3749
|
/**
|
|
3751
3750
|
* @license React
|
|
@@ -3761,7 +3760,7 @@ function Ld(e, t) {
|
|
|
3761
3760
|
return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t;
|
|
3762
3761
|
}
|
|
3763
3762
|
var Rd = typeof Object.is == "function" ? Object.is : Ld, Fd = Bd.useSyncExternalStore, Xd = rn.useRef, Yd = rn.useEffect, Zd = rn.useMemo, Wd = rn.useDebugValue;
|
|
3764
|
-
|
|
3763
|
+
Ei.useSyncExternalStoreWithSelector = function(e, t, n, o, r) {
|
|
3765
3764
|
var i = Xd(null);
|
|
3766
3765
|
if (i.current === null) {
|
|
3767
3766
|
var s = { hasValue: !1, value: null };
|
|
@@ -3793,9 +3792,9 @@ Si.useSyncExternalStoreWithSelector = function(e, t, n, o, r) {
|
|
|
3793
3792
|
}, [a]), Wd(a), a;
|
|
3794
3793
|
};
|
|
3795
3794
|
oo.exports;
|
|
3796
|
-
oo.exports =
|
|
3795
|
+
oo.exports = Ei;
|
|
3797
3796
|
var qd = oo.exports;
|
|
3798
|
-
const Gd = /* @__PURE__ */ sa(qd), qo = (e) => {
|
|
3797
|
+
const Gd = /* @__PURE__ */ sa(qd), Kd = {}, qo = (e) => {
|
|
3799
3798
|
let t;
|
|
3800
3799
|
const n = /* @__PURE__ */ new Set(), o = (f, l) => {
|
|
3801
3800
|
const d = typeof f == "function" ? f(t) : f;
|
|
@@ -3804,24 +3803,26 @@ const Gd = /* @__PURE__ */ sa(qd), qo = (e) => {
|
|
|
3804
3803
|
t = l ?? (typeof d != "object" || d === null) ? d : Object.assign({}, t, d), n.forEach((p) => p(t, h));
|
|
3805
3804
|
}
|
|
3806
3805
|
}, r = () => t, c = { setState: o, getState: r, getInitialState: () => u, subscribe: (f) => (n.add(f), () => n.delete(f)), destroy: () => {
|
|
3807
|
-
|
|
3806
|
+
(Kd ? "production" : void 0) !== "production" && console.warn(
|
|
3807
|
+
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
|
|
3808
|
+
), n.clear();
|
|
3808
3809
|
} }, u = t = e(o, r, c);
|
|
3809
3810
|
return c;
|
|
3810
|
-
},
|
|
3811
|
-
function Ni(e, t =
|
|
3812
|
-
const o =
|
|
3811
|
+
}, Ud = (e) => e ? qo(e) : qo, { useDebugValue: Qd } = Xn, { useSyncExternalStoreWithSelector: Jd } = Gd, jd = (e) => e;
|
|
3812
|
+
function Ni(e, t = jd, n) {
|
|
3813
|
+
const o = Jd(
|
|
3813
3814
|
e.subscribe,
|
|
3814
3815
|
e.getState,
|
|
3815
3816
|
e.getServerState || e.getInitialState,
|
|
3816
3817
|
t,
|
|
3817
3818
|
n
|
|
3818
3819
|
);
|
|
3819
|
-
return
|
|
3820
|
+
return Qd(o), o;
|
|
3820
3821
|
}
|
|
3821
3822
|
const Go = (e, t) => {
|
|
3822
|
-
const n =
|
|
3823
|
+
const n = Ud(e), o = (r, i = t) => Ni(n, r, i);
|
|
3823
3824
|
return Object.assign(o, n), o;
|
|
3824
|
-
},
|
|
3825
|
+
}, ef = (e, t) => e ? Go(e, t) : Go;
|
|
3825
3826
|
function ne(e, t) {
|
|
3826
3827
|
if (Object.is(e, t))
|
|
3827
3828
|
return !0;
|
|
@@ -3849,7 +3850,7 @@ function ne(e, t) {
|
|
|
3849
3850
|
return !1;
|
|
3850
3851
|
return !0;
|
|
3851
3852
|
}
|
|
3852
|
-
const sn = Yn(null),
|
|
3853
|
+
const sn = Yn(null), tf = sn.Provider, Ci = Ne.error001();
|
|
3853
3854
|
function K(e, t) {
|
|
3854
3855
|
const n = wt(sn);
|
|
3855
3856
|
if (n === null)
|
|
@@ -3866,7 +3867,7 @@ function te() {
|
|
|
3866
3867
|
subscribe: e.subscribe
|
|
3867
3868
|
}), [e]);
|
|
3868
3869
|
}
|
|
3869
|
-
const Ko = { display: "none" },
|
|
3870
|
+
const Ko = { display: "none" }, nf = {
|
|
3870
3871
|
position: "absolute",
|
|
3871
3872
|
width: 1,
|
|
3872
3873
|
height: 1,
|
|
@@ -3876,22 +3877,22 @@ const Ko = { display: "none" }, tf = {
|
|
|
3876
3877
|
overflow: "hidden",
|
|
3877
3878
|
clip: "rect(0px, 0px, 0px, 0px)",
|
|
3878
3879
|
clipPath: "inset(100%)"
|
|
3879
|
-
}, Mi = "react-flow__node-desc", ki = "react-flow__edge-desc",
|
|
3880
|
-
function
|
|
3881
|
-
const t = K(
|
|
3882
|
-
return P("div", { id: `${
|
|
3880
|
+
}, Mi = "react-flow__node-desc", ki = "react-flow__edge-desc", of = "react-flow__aria-live", rf = (e) => e.ariaLiveMessage;
|
|
3881
|
+
function sf({ rfId: e }) {
|
|
3882
|
+
const t = K(rf);
|
|
3883
|
+
return P("div", { id: `${of}-${e}`, "aria-live": "assertive", "aria-atomic": "true", style: nf, children: t });
|
|
3883
3884
|
}
|
|
3884
|
-
function
|
|
3885
|
-
return se(
|
|
3885
|
+
function af({ rfId: e, disableKeyboardA11y: t }) {
|
|
3886
|
+
return se(Se, { children: [se("div", { id: `${Mi}-${e}`, style: Ko, children: ["Press enter or space to select a node.", !t && "You can then use the arrow keys to move the node around.", " Press delete to remove it and escape to cancel.", " "] }), P("div", { id: `${ki}-${e}`, style: Ko, children: "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel." }), !t && P(sf, { rfId: e })] });
|
|
3886
3887
|
}
|
|
3887
|
-
const
|
|
3888
|
-
const s = K(
|
|
3888
|
+
const cf = (e) => e.userSelectionActive ? "none" : "all", io = yr(({ position: e = "top-left", children: t, className: n, style: o, ...r }, i) => {
|
|
3889
|
+
const s = K(cf), a = `${e}`.split("-");
|
|
3889
3890
|
return P("div", { className: re(["react-flow__panel", n, ...a]), style: { ...o, pointerEvents: s }, ref: i, ...r, children: t });
|
|
3890
3891
|
});
|
|
3891
|
-
function
|
|
3892
|
+
function uf({ proOptions: e, position: t = "bottom-right" }) {
|
|
3892
3893
|
return e?.hideAttribution ? null : P(io, { position: t, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: P("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) });
|
|
3893
3894
|
}
|
|
3894
|
-
const
|
|
3895
|
+
const lf = (e) => {
|
|
3895
3896
|
const t = [], n = [];
|
|
3896
3897
|
for (const [, o] of e.nodeLookup)
|
|
3897
3898
|
o.selected && t.push(o.internals.userNode);
|
|
@@ -3899,22 +3900,22 @@ const uf = (e) => {
|
|
|
3899
3900
|
o.selected && n.push(o);
|
|
3900
3901
|
return { selectedNodes: t, selectedEdges: n };
|
|
3901
3902
|
}, At = (e) => e.id;
|
|
3902
|
-
function
|
|
3903
|
+
function df(e, t) {
|
|
3903
3904
|
return ne(e.selectedNodes.map(At), t.selectedNodes.map(At)) && ne(e.selectedEdges.map(At), t.selectedEdges.map(At));
|
|
3904
3905
|
}
|
|
3905
|
-
function
|
|
3906
|
-
const t = te(), { selectedNodes: n, selectedEdges: o } = K(
|
|
3906
|
+
function ff({ onSelectionChange: e }) {
|
|
3907
|
+
const t = te(), { selectedNodes: n, selectedEdges: o } = K(lf, df);
|
|
3907
3908
|
return j(() => {
|
|
3908
3909
|
const r = { nodes: n, edges: o };
|
|
3909
3910
|
e?.(r), t.getState().onSelectionChangeHandlers.forEach((i) => i(r));
|
|
3910
3911
|
}, [n, o, e]), null;
|
|
3911
3912
|
}
|
|
3912
|
-
const
|
|
3913
|
-
function
|
|
3914
|
-
const t = K(
|
|
3915
|
-
return e || t ? P(
|
|
3913
|
+
const hf = (e) => !!e.onSelectionChangeHandlers;
|
|
3914
|
+
function gf({ onSelectionChange: e }) {
|
|
3915
|
+
const t = K(hf);
|
|
3916
|
+
return e || t ? P(ff, { onSelectionChange: e }) : null;
|
|
3916
3917
|
}
|
|
3917
|
-
const $i = [0, 0],
|
|
3918
|
+
const $i = [0, 0], pf = { x: 0, y: 0, zoom: 1 }, mf = [
|
|
3918
3919
|
"nodes",
|
|
3919
3920
|
"edges",
|
|
3920
3921
|
"defaultNodes",
|
|
@@ -3970,7 +3971,7 @@ const $i = [0, 0], gf = { x: 0, y: 0, zoom: 1 }, pf = [
|
|
|
3970
3971
|
"debug",
|
|
3971
3972
|
"autoPanSpeed",
|
|
3972
3973
|
"paneClickDistance"
|
|
3973
|
-
], Uo = [...
|
|
3974
|
+
], Uo = [...mf, "rfId"], yf = (e) => ({
|
|
3974
3975
|
setNodes: e.setNodes,
|
|
3975
3976
|
setEdges: e.setEdges,
|
|
3976
3977
|
setMinZoom: e.setMinZoom,
|
|
@@ -3993,8 +3994,8 @@ const $i = [0, 0], gf = { x: 0, y: 0, zoom: 1 }, pf = [
|
|
|
3993
3994
|
rfId: "1",
|
|
3994
3995
|
paneClickDistance: 0
|
|
3995
3996
|
};
|
|
3996
|
-
function
|
|
3997
|
-
const { setNodes: t, setEdges: n, setMinZoom: o, setMaxZoom: r, setTranslateExtent: i, setNodeExtent: s, reset: a, setDefaultNodesAndEdges: c, setPaneClickDistance: u } = K(
|
|
3997
|
+
function wf(e) {
|
|
3998
|
+
const { setNodes: t, setEdges: n, setMinZoom: o, setMaxZoom: r, setTranslateExtent: i, setNodeExtent: s, reset: a, setDefaultNodesAndEdges: c, setPaneClickDistance: u } = K(yf, ne), f = te();
|
|
3998
3999
|
j(() => (c(e.defaultNodes, e.defaultEdges), () => {
|
|
3999
4000
|
l.current = Qo, a();
|
|
4000
4001
|
}), []);
|
|
@@ -4014,7 +4015,7 @@ function yf(e) {
|
|
|
4014
4015
|
function Jo() {
|
|
4015
4016
|
return typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)");
|
|
4016
4017
|
}
|
|
4017
|
-
function
|
|
4018
|
+
function xf(e) {
|
|
4018
4019
|
const [t, n] = de(e === "system" ? null : e);
|
|
4019
4020
|
return j(() => {
|
|
4020
4021
|
if (e !== "system") {
|
|
@@ -4069,7 +4070,7 @@ function er(e, t, n) {
|
|
|
4069
4070
|
function tr(e, t) {
|
|
4070
4071
|
return t.includes(e) ? "code" : "key";
|
|
4071
4072
|
}
|
|
4072
|
-
const
|
|
4073
|
+
const vf = () => {
|
|
4073
4074
|
const e = te();
|
|
4074
4075
|
return me(() => ({
|
|
4075
4076
|
zoomIn: (t) => {
|
|
@@ -4171,14 +4172,14 @@ function Ii(e, t) {
|
|
|
4171
4172
|
}
|
|
4172
4173
|
const a = { ...i };
|
|
4173
4174
|
for (const c of s)
|
|
4174
|
-
|
|
4175
|
+
_f(c, a);
|
|
4175
4176
|
n.push(a);
|
|
4176
4177
|
}
|
|
4177
4178
|
return r.length && r.forEach((i) => {
|
|
4178
4179
|
i.index !== void 0 ? n.splice(i.index, 0, { ...i.item }) : n.push({ ...i.item });
|
|
4179
4180
|
}), n;
|
|
4180
4181
|
}
|
|
4181
|
-
function
|
|
4182
|
+
function _f(e, t) {
|
|
4182
4183
|
switch (e.type) {
|
|
4183
4184
|
case "select": {
|
|
4184
4185
|
t.selected = e.selected;
|
|
@@ -4231,14 +4232,14 @@ function or(e) {
|
|
|
4231
4232
|
type: "remove"
|
|
4232
4233
|
};
|
|
4233
4234
|
}
|
|
4234
|
-
const rr = (e) => Vl(e),
|
|
4235
|
+
const rr = (e) => Vl(e), bf = (e) => Jr(e);
|
|
4235
4236
|
function zi(e) {
|
|
4236
4237
|
return yr(e);
|
|
4237
4238
|
}
|
|
4238
|
-
const
|
|
4239
|
+
const Ef = typeof window < "u" ? ia : j;
|
|
4239
4240
|
function ir(e) {
|
|
4240
4241
|
const [t, n] = de(BigInt(0)), [o] = de(() => Sf(() => n((r) => r + BigInt(1))));
|
|
4241
|
-
return
|
|
4242
|
+
return Ef(() => {
|
|
4242
4243
|
const r = o.get();
|
|
4243
4244
|
r.length && (e(r), o.reset());
|
|
4244
4245
|
}, [t]), o;
|
|
@@ -4256,7 +4257,7 @@ function Sf(e) {
|
|
|
4256
4257
|
};
|
|
4257
4258
|
}
|
|
4258
4259
|
const Ti = Yn(null);
|
|
4259
|
-
function
|
|
4260
|
+
function Nf({ children: e }) {
|
|
4260
4261
|
const t = te(), n = fe((a) => {
|
|
4261
4262
|
const { nodes: c = [], setNodes: u, hasDefaultNodes: f, onNodesChange: l, nodeLookup: d } = t.getState();
|
|
4262
4263
|
let h = c;
|
|
@@ -4278,15 +4279,15 @@ function Ef({ children: e }) {
|
|
|
4278
4279
|
}, []), i = ir(r), s = me(() => ({ nodeQueue: o, edgeQueue: i }), []);
|
|
4279
4280
|
return P(Ti.Provider, { value: s, children: e });
|
|
4280
4281
|
}
|
|
4281
|
-
function
|
|
4282
|
+
function Cf() {
|
|
4282
4283
|
const e = wt(Ti);
|
|
4283
4284
|
if (!e)
|
|
4284
4285
|
throw new Error("useBatchContext must be used within a BatchProvider");
|
|
4285
4286
|
return e;
|
|
4286
4287
|
}
|
|
4287
|
-
const
|
|
4288
|
+
const Mf = (e) => !!e.panZoom;
|
|
4288
4289
|
function so() {
|
|
4289
|
-
const e =
|
|
4290
|
+
const e = vf(), t = te(), n = Cf(), o = K(Mf), r = me(() => {
|
|
4290
4291
|
const i = (l) => t.getState().nodeLookup.get(l), s = (l) => {
|
|
4291
4292
|
n.nodeQueue.push(l);
|
|
4292
4293
|
}, a = (l) => {
|
|
@@ -4311,7 +4312,7 @@ function so() {
|
|
|
4311
4312
|
a((p) => p.map((y) => {
|
|
4312
4313
|
if (y.id === l) {
|
|
4313
4314
|
const _ = typeof d == "function" ? d(y) : d;
|
|
4314
|
-
return h.replace &&
|
|
4315
|
+
return h.replace && bf(_) ? _ : { ...y, ..._ };
|
|
4315
4316
|
}
|
|
4316
4317
|
return y;
|
|
4317
4318
|
}));
|
|
@@ -4348,22 +4349,22 @@ function so() {
|
|
|
4348
4349
|
};
|
|
4349
4350
|
},
|
|
4350
4351
|
deleteElements: async ({ nodes: l = [], edges: d = [] }) => {
|
|
4351
|
-
const { nodes: h, edges: p, onNodesDelete: y, onEdgesDelete: _, triggerNodeChanges: x, triggerEdgeChanges: b, onDelete: w, onBeforeDelete: m } = t.getState(), { nodes:
|
|
4352
|
+
const { nodes: h, edges: p, onNodesDelete: y, onEdgesDelete: _, triggerNodeChanges: x, triggerEdgeChanges: b, onDelete: w, onBeforeDelete: m } = t.getState(), { nodes: E, edges: A } = await Ll({
|
|
4352
4353
|
nodesToRemove: l,
|
|
4353
4354
|
edgesToRemove: d,
|
|
4354
4355
|
nodes: h,
|
|
4355
4356
|
edges: p,
|
|
4356
4357
|
onBeforeDelete: m
|
|
4357
|
-
}), N = A.length > 0, z =
|
|
4358
|
+
}), N = A.length > 0, z = E.length > 0;
|
|
4358
4359
|
if (N) {
|
|
4359
4360
|
const I = A.map(or);
|
|
4360
4361
|
_?.(A), b(I);
|
|
4361
4362
|
}
|
|
4362
4363
|
if (z) {
|
|
4363
|
-
const I =
|
|
4364
|
-
y?.(
|
|
4364
|
+
const I = E.map(or);
|
|
4365
|
+
y?.(E), x(I);
|
|
4365
4366
|
}
|
|
4366
|
-
return (z || N) && w?.({ nodes:
|
|
4367
|
+
return (z || N) && w?.({ nodes: E, edges: A }), { deletedNodes: E, deletedEdges: A };
|
|
4367
4368
|
},
|
|
4368
4369
|
getIntersectingNodes: (l, d = !0, h) => {
|
|
4369
4370
|
const p = Do(l), y = p ? l : c(l), _ = h !== void 0;
|
|
@@ -4410,9 +4411,9 @@ function so() {
|
|
|
4410
4411
|
viewportInitialized: o
|
|
4411
4412
|
}), [o]);
|
|
4412
4413
|
}
|
|
4413
|
-
const sr = (e) => e.selected,
|
|
4414
|
-
function
|
|
4415
|
-
const n = te(), { deleteElements: o } = so(), r = yt(e,
|
|
4414
|
+
const sr = (e) => e.selected, kf = { actInsideInputWithModifier: !1 }, $f = typeof window < "u" ? window : void 0;
|
|
4415
|
+
function If({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
|
|
4416
|
+
const n = te(), { deleteElements: o } = so(), r = yt(e, kf), i = yt(t, { target: $f });
|
|
4416
4417
|
j(() => {
|
|
4417
4418
|
if (r) {
|
|
4418
4419
|
const { edges: s, nodes: a } = n.getState();
|
|
@@ -4422,7 +4423,7 @@ function $f({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
|
|
|
4422
4423
|
n.setState({ multiSelectionActive: i });
|
|
4423
4424
|
}, [i]);
|
|
4424
4425
|
}
|
|
4425
|
-
function
|
|
4426
|
+
function Af(e) {
|
|
4426
4427
|
const t = te();
|
|
4427
4428
|
j(() => {
|
|
4428
4429
|
const n = () => {
|
|
@@ -4446,44 +4447,44 @@ const an = {
|
|
|
4446
4447
|
height: "100%",
|
|
4447
4448
|
top: 0,
|
|
4448
4449
|
left: 0
|
|
4449
|
-
},
|
|
4450
|
+
}, Pf = (e) => ({
|
|
4450
4451
|
userSelectionActive: e.userSelectionActive,
|
|
4451
4452
|
lib: e.lib
|
|
4452
4453
|
});
|
|
4453
|
-
function
|
|
4454
|
-
const m = te(),
|
|
4455
|
-
|
|
4454
|
+
function zf({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: o = !1, panOnScrollSpeed: r = 0.5, panOnScrollMode: i = He.Free, zoomOnDoubleClick: s = !0, panOnDrag: a = !0, defaultViewport: c, translateExtent: u, minZoom: f, maxZoom: l, zoomActivationKeyCode: d, preventScrolling: h = !0, children: p, noWheelClassName: y, noPanClassName: _, onViewportChange: x, isControlledViewport: b, paneClickDistance: w }) {
|
|
4455
|
+
const m = te(), E = J(null), { userSelectionActive: A, lib: N } = K(Pf, ne), z = yt(d), I = J();
|
|
4456
|
+
Af(E);
|
|
4456
4457
|
const k = fe((V) => {
|
|
4457
4458
|
x?.({ x: V[0], y: V[1], zoom: V[2] }), b || m.setState({ transform: V });
|
|
4458
4459
|
}, [x, b]);
|
|
4459
4460
|
return j(() => {
|
|
4460
|
-
if (
|
|
4461
|
+
if (E.current) {
|
|
4461
4462
|
I.current = _d({
|
|
4462
|
-
domNode:
|
|
4463
|
+
domNode: E.current,
|
|
4463
4464
|
minZoom: f,
|
|
4464
4465
|
maxZoom: l,
|
|
4465
4466
|
translateExtent: u,
|
|
4466
4467
|
viewport: c,
|
|
4467
4468
|
paneClickDistance: w,
|
|
4468
4469
|
onDraggingChange: (g) => m.setState({ paneDragging: g }),
|
|
4469
|
-
onPanZoomStart: (g,
|
|
4470
|
+
onPanZoomStart: (g, S) => {
|
|
4470
4471
|
const { onViewportChangeStart: v, onMoveStart: M } = m.getState();
|
|
4471
|
-
M?.(g,
|
|
4472
|
+
M?.(g, S), v?.(S);
|
|
4472
4473
|
},
|
|
4473
|
-
onPanZoom: (g,
|
|
4474
|
+
onPanZoom: (g, S) => {
|
|
4474
4475
|
const { onViewportChange: v, onMove: M } = m.getState();
|
|
4475
|
-
M?.(g,
|
|
4476
|
+
M?.(g, S), v?.(S);
|
|
4476
4477
|
},
|
|
4477
|
-
onPanZoomEnd: (g,
|
|
4478
|
+
onPanZoomEnd: (g, S) => {
|
|
4478
4479
|
const { onViewportChangeEnd: v, onMoveEnd: M } = m.getState();
|
|
4479
|
-
M?.(g,
|
|
4480
|
+
M?.(g, S), v?.(S);
|
|
4480
4481
|
}
|
|
4481
4482
|
});
|
|
4482
4483
|
const { x: V, y: D, zoom: H } = I.current.getViewport();
|
|
4483
4484
|
return m.setState({
|
|
4484
4485
|
panZoom: I.current,
|
|
4485
4486
|
transform: [V, D, H],
|
|
4486
|
-
domNode:
|
|
4487
|
+
domNode: E.current.closest(".react-flow")
|
|
4487
4488
|
}), () => {
|
|
4488
4489
|
I.current?.destroy();
|
|
4489
4490
|
};
|
|
@@ -4522,29 +4523,29 @@ function Pf({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4522
4523
|
y,
|
|
4523
4524
|
N,
|
|
4524
4525
|
k
|
|
4525
|
-
]), P("div", { className: "react-flow__renderer", ref:
|
|
4526
|
+
]), P("div", { className: "react-flow__renderer", ref: E, style: an, children: p });
|
|
4526
4527
|
}
|
|
4527
|
-
const
|
|
4528
|
+
const Tf = (e) => ({
|
|
4528
4529
|
userSelectionActive: e.userSelectionActive,
|
|
4529
4530
|
userSelectionRect: e.userSelectionRect
|
|
4530
4531
|
});
|
|
4531
|
-
function
|
|
4532
|
-
const { userSelectionActive: e, userSelectionRect: t } = K(
|
|
4532
|
+
function Df() {
|
|
4533
|
+
const { userSelectionActive: e, userSelectionRect: t } = K(Tf, ne);
|
|
4533
4534
|
return e && t ? P("div", { className: "react-flow__selection react-flow__container", style: {
|
|
4534
4535
|
width: t.width,
|
|
4535
4536
|
height: t.height,
|
|
4536
4537
|
transform: `translate(${t.x}px, ${t.y}px)`
|
|
4537
4538
|
} }) : null;
|
|
4538
4539
|
}
|
|
4539
|
-
const
|
|
4540
|
+
const Sn = (e, t) => (n) => {
|
|
4540
4541
|
n.target === t.current && e?.(n);
|
|
4541
|
-
},
|
|
4542
|
+
}, Hf = (e) => ({
|
|
4542
4543
|
userSelectionActive: e.userSelectionActive,
|
|
4543
4544
|
elementsSelectable: e.elementsSelectable,
|
|
4544
4545
|
dragging: e.paneDragging
|
|
4545
4546
|
});
|
|
4546
|
-
function
|
|
4547
|
-
const p = te(), { userSelectionActive: y, elementsSelectable: _, dragging: x } = K(
|
|
4547
|
+
function Vf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full, panOnDrag: o, selectionOnDrag: r, onSelectionStart: i, onSelectionEnd: s, onPaneClick: a, onPaneContextMenu: c, onPaneScroll: u, onPaneMouseEnter: f, onPaneMouseMove: l, onPaneMouseLeave: d, children: h }) {
|
|
4548
|
+
const p = te(), { userSelectionActive: y, elementsSelectable: _, dragging: x } = K(Hf, ne), b = _ && (e || y), w = J(null), m = J(), E = J(/* @__PURE__ */ new Set()), A = J(/* @__PURE__ */ new Set()), N = J(!1), z = J(!1), I = (v) => {
|
|
4548
4549
|
if (N.current) {
|
|
4549
4550
|
N.current = !1;
|
|
4550
4551
|
return;
|
|
@@ -4584,10 +4585,10 @@ function Hf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full
|
|
|
4584
4585
|
y: Y < B ? Y : B,
|
|
4585
4586
|
width: Math.abs(F - q),
|
|
4586
4587
|
height: Math.abs(Y - B)
|
|
4587
|
-
}, ee =
|
|
4588
|
-
|
|
4588
|
+
}, ee = E.current, Q = A.current;
|
|
4589
|
+
E.current = new Set(jr(C, G, $, n === gt.Partial, !0).map((U) => U.id)), A.current = /* @__PURE__ */ new Set();
|
|
4589
4590
|
const W = X?.selectable ?? !0;
|
|
4590
|
-
for (const U of
|
|
4591
|
+
for (const U of E.current) {
|
|
4591
4592
|
const oe = O.get(U);
|
|
4592
4593
|
if (oe)
|
|
4593
4594
|
for (const { edgeId: ae } of oe.values()) {
|
|
@@ -4595,8 +4596,8 @@ function Hf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full
|
|
|
4595
4596
|
Pe && (Pe.selectable ?? W) && A.current.add(ae);
|
|
4596
4597
|
}
|
|
4597
4598
|
}
|
|
4598
|
-
if (!Ho(ee,
|
|
4599
|
-
const U = Le(C,
|
|
4599
|
+
if (!Ho(ee, E.current)) {
|
|
4600
|
+
const U = Le(C, E.current, !0);
|
|
4600
4601
|
L(U);
|
|
4601
4602
|
}
|
|
4602
4603
|
if (!Ho(Q, A.current)) {
|
|
@@ -4616,10 +4617,10 @@ function Hf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full
|
|
|
4616
4617
|
!y && M && v.target === w.current && I?.(v), p.setState({
|
|
4617
4618
|
userSelectionActive: !1,
|
|
4618
4619
|
userSelectionRect: null,
|
|
4619
|
-
nodesSelectionActive:
|
|
4620
|
+
nodesSelectionActive: E.current.size > 0
|
|
4620
4621
|
}), s?.(v), (t || r) && (N.current = !1), z.current = !1;
|
|
4621
|
-
},
|
|
4622
|
-
return se("div", { className: re(["react-flow__pane", { draggable:
|
|
4622
|
+
}, S = o === !0 || Array.isArray(o) && o.includes(0);
|
|
4623
|
+
return se("div", { className: re(["react-flow__pane", { draggable: S, dragging: x, selection: e }]), onClick: b ? void 0 : Sn(I, w), onContextMenu: Sn(k, w), onWheel: Sn(V, w), onPointerEnter: b ? void 0 : f, onPointerDown: b ? D : l, onPointerMove: b ? H : l, onPointerUp: b ? g : void 0, onPointerLeave: d, ref: w, style: an, children: [h, P(Df, {})] });
|
|
4623
4624
|
}
|
|
4624
4625
|
function Fn({ id: e, store: t, unselect: n = !1, nodeRef: o }) {
|
|
4625
4626
|
const { addSelectedNodes: r, unselectNodesAndEdges: i, multiSelectionActive: s, nodeLookup: a, onError: c } = t.getState(), u = a.get(e);
|
|
@@ -4664,11 +4665,11 @@ function Di({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector:
|
|
|
4664
4665
|
};
|
|
4665
4666
|
}, [n, o, t, i, e, r]), c;
|
|
4666
4667
|
}
|
|
4667
|
-
const
|
|
4668
|
+
const Of = (e) => (t) => t.selected && (t.draggable || e && typeof t.draggable > "u");
|
|
4668
4669
|
function Hi() {
|
|
4669
4670
|
const e = te();
|
|
4670
4671
|
return fe((n) => {
|
|
4671
|
-
const { nodeExtent: o, snapToGrid: r, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: u, nodeOrigin: f } = e.getState(), l = /* @__PURE__ */ new Map(), d =
|
|
4672
|
+
const { nodeExtent: o, snapToGrid: r, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: u, nodeOrigin: f } = e.getState(), l = /* @__PURE__ */ new Map(), d = Of(s), h = r ? i[0] : 5, p = r ? i[1] : 5, y = n.direction.x * h * n.factor, _ = n.direction.y * p * n.factor;
|
|
4672
4673
|
for (const [, x] of u) {
|
|
4673
4674
|
if (!d(x))
|
|
4674
4675
|
continue;
|
|
@@ -4690,13 +4691,13 @@ function Hi() {
|
|
|
4690
4691
|
c(l);
|
|
4691
4692
|
}, []);
|
|
4692
4693
|
}
|
|
4693
|
-
const ao = Yn(null),
|
|
4694
|
+
const ao = Yn(null), Bf = ao.Provider;
|
|
4694
4695
|
ao.Consumer;
|
|
4695
|
-
const co = () => wt(ao),
|
|
4696
|
+
const co = () => wt(ao), Lf = (e) => ({
|
|
4696
4697
|
connectOnClick: e.connectOnClick,
|
|
4697
4698
|
noPanClassName: e.noPanClassName,
|
|
4698
4699
|
rfId: e.rfId
|
|
4699
|
-
}),
|
|
4700
|
+
}), Rf = (e, t, n) => (o) => {
|
|
4700
4701
|
const { connectionClickStartHandle: r, connectionMode: i, connection: s } = o, { fromHandle: a, toHandle: c, isValid: u } = s, f = c?.nodeId === e && c?.id === t && c?.type === n;
|
|
4701
4702
|
return {
|
|
4702
4703
|
connectingFrom: a?.nodeId === e && a?.id === t && a?.type === n,
|
|
@@ -4707,12 +4708,12 @@ const co = () => wt(ao), Bf = (e) => ({
|
|
|
4707
4708
|
valid: f && u
|
|
4708
4709
|
};
|
|
4709
4710
|
};
|
|
4710
|
-
function
|
|
4711
|
-
const p = s || null, y = e === "target", _ = te(), x = co(), { connectOnClick: b, noPanClassName: w, rfId: m } = K(
|
|
4711
|
+
function Ff({ type: e = "source", position: t = R.Top, isValidConnection: n, isConnectable: o = !0, isConnectableStart: r = !0, isConnectableEnd: i = !0, id: s, onConnect: a, children: c, className: u, onMouseDown: f, onTouchStart: l, ...d }, h) {
|
|
4712
|
+
const p = s || null, y = e === "target", _ = te(), x = co(), { connectOnClick: b, noPanClassName: w, rfId: m } = K(Lf, ne), { connectingFrom: E, connectingTo: A, clickConnecting: N, isPossibleEndHandle: z, connectionInProcess: I, valid: k } = K(Rf(x, p, e), ne);
|
|
4712
4713
|
x || _.getState().onError?.("010", Ne.error010());
|
|
4713
4714
|
const V = (g) => {
|
|
4714
|
-
const { defaultEdgeOptions:
|
|
4715
|
-
...
|
|
4715
|
+
const { defaultEdgeOptions: S, onConnect: v, hasDefaultEdges: M } = _.getState(), $ = {
|
|
4716
|
+
...S,
|
|
4716
4717
|
...g
|
|
4717
4718
|
};
|
|
4718
4719
|
if (M) {
|
|
@@ -4723,8 +4724,8 @@ function Rf({ type: e = "source", position: t = R.Top, isValidConnection: n, isC
|
|
|
4723
4724
|
}, D = (g) => {
|
|
4724
4725
|
if (!x)
|
|
4725
4726
|
return;
|
|
4726
|
-
const
|
|
4727
|
-
if (r && (
|
|
4727
|
+
const S = ci(g.nativeEvent);
|
|
4728
|
+
if (r && (S && g.button === 0 || !S)) {
|
|
4728
4729
|
const v = _.getState();
|
|
4729
4730
|
Rn.onPointerDown(g.nativeEvent, {
|
|
4730
4731
|
autoPanOnConnect: v.autoPanOnConnect,
|
|
@@ -4749,13 +4750,13 @@ function Rf({ type: e = "source", position: t = R.Top, isValidConnection: n, isC
|
|
|
4749
4750
|
autoPanSpeed: v.autoPanSpeed
|
|
4750
4751
|
});
|
|
4751
4752
|
}
|
|
4752
|
-
|
|
4753
|
+
S ? f?.(g) : l?.(g);
|
|
4753
4754
|
}, H = (g) => {
|
|
4754
|
-
const { onClickConnectStart:
|
|
4755
|
+
const { onClickConnectStart: S, onClickConnectEnd: v, connectionClickStartHandle: M, connectionMode: $, isValidConnection: C, lib: T, rfId: O, nodeLookup: L, connection: Z } = _.getState();
|
|
4755
4756
|
if (!x || !M && !r)
|
|
4756
4757
|
return;
|
|
4757
4758
|
if (!M) {
|
|
4758
|
-
|
|
4759
|
+
S?.(g.nativeEvent, { nodeId: x, handleId: p, handleType: e }), _.setState({ connectionClickStartHandle: { nodeId: x, type: e, id: p } });
|
|
4759
4760
|
return;
|
|
4760
4761
|
}
|
|
4761
4762
|
const X = ai(g.target), F = n || C, { connection: Y, isValid: q } = Rn.isValid(g.nativeEvent, {
|
|
@@ -4791,7 +4792,7 @@ function Rf({ type: e = "source", position: t = R.Top, isValidConnection: n, isC
|
|
|
4791
4792
|
connectablestart: r,
|
|
4792
4793
|
connectableend: i,
|
|
4793
4794
|
clickconnecting: N,
|
|
4794
|
-
connectingfrom:
|
|
4795
|
+
connectingfrom: E,
|
|
4795
4796
|
connectingto: A,
|
|
4796
4797
|
valid: k,
|
|
4797
4798
|
// shows where you can start a connection from
|
|
@@ -4800,18 +4801,18 @@ function Rf({ type: e = "source", position: t = R.Top, isValidConnection: n, isC
|
|
|
4800
4801
|
}
|
|
4801
4802
|
]), onMouseDown: D, onTouchStart: D, onClick: b ? H : void 0, ref: h, ...d, children: c });
|
|
4802
4803
|
}
|
|
4803
|
-
const Wt = ie(zi(
|
|
4804
|
-
function
|
|
4805
|
-
return se(
|
|
4804
|
+
const Wt = ie(zi(Ff));
|
|
4805
|
+
function Xf({ data: e, isConnectable: t, sourcePosition: n = R.Bottom }) {
|
|
4806
|
+
return se(Se, { children: [e?.label, P(Wt, { type: "source", position: n, isConnectable: t })] });
|
|
4806
4807
|
}
|
|
4807
|
-
function
|
|
4808
|
-
return se(
|
|
4808
|
+
function Yf({ data: e, isConnectable: t, targetPosition: n = R.Top, sourcePosition: o = R.Bottom }) {
|
|
4809
|
+
return se(Se, { children: [P(Wt, { type: "target", position: n, isConnectable: t }), e?.label, P(Wt, { type: "source", position: o, isConnectable: t })] });
|
|
4809
4810
|
}
|
|
4810
|
-
function
|
|
4811
|
+
function Zf() {
|
|
4811
4812
|
return null;
|
|
4812
4813
|
}
|
|
4813
|
-
function
|
|
4814
|
-
return se(
|
|
4814
|
+
function Wf({ data: e, isConnectable: t, targetPosition: n = R.Top }) {
|
|
4815
|
+
return se(Se, { children: [P(Wt, { type: "target", position: n, isConnectable: t }), e?.label] });
|
|
4815
4816
|
}
|
|
4816
4817
|
const qt = {
|
|
4817
4818
|
ArrowUp: { x: 0, y: -1 },
|
|
@@ -4819,12 +4820,12 @@ const qt = {
|
|
|
4819
4820
|
ArrowLeft: { x: -1, y: 0 },
|
|
4820
4821
|
ArrowRight: { x: 1, y: 0 }
|
|
4821
4822
|
}, ar = {
|
|
4822
|
-
input:
|
|
4823
|
-
default:
|
|
4824
|
-
output:
|
|
4825
|
-
group:
|
|
4823
|
+
input: Xf,
|
|
4824
|
+
default: Yf,
|
|
4825
|
+
output: Wf,
|
|
4826
|
+
group: Zf
|
|
4826
4827
|
};
|
|
4827
|
-
function
|
|
4828
|
+
function qf(e) {
|
|
4828
4829
|
return e.internals.handleBounds === void 0 ? {
|
|
4829
4830
|
width: e.width ?? e.initialWidth ?? e.style?.width,
|
|
4830
4831
|
height: e.height ?? e.initialHeight ?? e.style?.height
|
|
@@ -4833,7 +4834,7 @@ function Wf(e) {
|
|
|
4833
4834
|
height: e.height ?? e.style?.height
|
|
4834
4835
|
};
|
|
4835
4836
|
}
|
|
4836
|
-
const
|
|
4837
|
+
const Gf = (e) => {
|
|
4837
4838
|
const { width: t, height: n, x: o, y: r } = Ue(e.nodeLookup, {
|
|
4838
4839
|
filter: (i) => !!i.selected
|
|
4839
4840
|
});
|
|
@@ -4844,8 +4845,8 @@ const qf = (e) => {
|
|
|
4844
4845
|
transformString: `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`
|
|
4845
4846
|
};
|
|
4846
4847
|
};
|
|
4847
|
-
function
|
|
4848
|
-
const o = te(), { width: r, height: i, transformString: s, userSelectionActive: a } = K(
|
|
4848
|
+
function Kf({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
|
|
4849
|
+
const o = te(), { width: r, height: i, transformString: s, userSelectionActive: a } = K(Gf, ne), c = Hi(), u = J(null);
|
|
4849
4850
|
if (j(() => {
|
|
4850
4851
|
n || u.current?.focus({
|
|
4851
4852
|
preventScroll: !0
|
|
@@ -4870,19 +4871,19 @@ function Gf({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
4870
4871
|
height: i
|
|
4871
4872
|
} }) });
|
|
4872
4873
|
}
|
|
4873
|
-
const cr = typeof window < "u" ? window : void 0,
|
|
4874
|
-
function Vi({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: u, selectionOnDrag: f, selectionMode: l, onSelectionStart: d, onSelectionEnd: h, multiSelectionKeyCode: p, panActivationKeyCode: y, zoomActivationKeyCode: _, elementsSelectable: x, zoomOnScroll: b, zoomOnPinch: w, panOnScroll: m, panOnScrollSpeed:
|
|
4875
|
-
const { nodesSelectionActive: T, userSelectionActive: O } = K(
|
|
4876
|
-
return
|
|
4874
|
+
const cr = typeof window < "u" ? window : void 0, Uf = (e) => ({ nodesSelectionActive: e.nodesSelectionActive, userSelectionActive: e.userSelectionActive });
|
|
4875
|
+
function Vi({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: u, selectionOnDrag: f, selectionMode: l, onSelectionStart: d, onSelectionEnd: h, multiSelectionKeyCode: p, panActivationKeyCode: y, zoomActivationKeyCode: _, elementsSelectable: x, zoomOnScroll: b, zoomOnPinch: w, panOnScroll: m, panOnScrollSpeed: E, panOnScrollMode: A, zoomOnDoubleClick: N, panOnDrag: z, defaultViewport: I, translateExtent: k, minZoom: V, maxZoom: D, preventScrolling: H, onSelectionContextMenu: g, noWheelClassName: S, noPanClassName: v, disableKeyboardA11y: M, onViewportChange: $, isControlledViewport: C }) {
|
|
4876
|
+
const { nodesSelectionActive: T, userSelectionActive: O } = K(Uf), L = yt(u, { target: cr }), Z = yt(y, { target: cr }), X = Z || z, F = Z || m, Y = f && X !== !0, q = L || O || Y;
|
|
4877
|
+
return If({ deleteKeyCode: c, multiSelectionKeyCode: p }), P(zf, { onPaneContextMenu: i, elementsSelectable: x, zoomOnScroll: b, zoomOnPinch: w, panOnScroll: F, panOnScrollSpeed: E, panOnScrollMode: A, zoomOnDoubleClick: N, panOnDrag: !L && X, defaultViewport: I, translateExtent: k, minZoom: V, maxZoom: D, zoomActivationKeyCode: _, preventScrolling: H, noWheelClassName: S, noPanClassName: v, onViewportChange: $, isControlledViewport: C, paneClickDistance: a, children: se(Vf, { onSelectionStart: d, onSelectionEnd: h, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, panOnDrag: X, isSelecting: !!q, selectionMode: l, selectionKeyPressed: L, selectionOnDrag: Y, children: [e, T && P(Kf, { onSelectionContextMenu: g, noPanClassName: v, disableKeyboardA11y: M })] }) });
|
|
4877
4878
|
}
|
|
4878
4879
|
Vi.displayName = "FlowRenderer";
|
|
4879
|
-
const
|
|
4880
|
-
function
|
|
4881
|
-
return K(fe(
|
|
4880
|
+
const Qf = ie(Vi), Jf = (e) => (t) => e ? jr(t.nodeLookup, { x: 0, y: 0, width: t.width, height: t.height }, t.transform, !0).map((n) => n.id) : Array.from(t.nodeLookup.keys());
|
|
4881
|
+
function jf(e) {
|
|
4882
|
+
return K(fe(Jf(e), [e]), ne);
|
|
4882
4883
|
}
|
|
4883
|
-
const
|
|
4884
|
-
function
|
|
4885
|
-
const e = K(
|
|
4884
|
+
const eh = (e) => e.updateNodeInternals;
|
|
4885
|
+
function th() {
|
|
4886
|
+
const e = K(eh), [t] = de(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((n) => {
|
|
4886
4887
|
const o = /* @__PURE__ */ new Map();
|
|
4887
4888
|
n.forEach((r) => {
|
|
4888
4889
|
const i = r.target.getAttribute("data-id");
|
|
@@ -4897,7 +4898,7 @@ function eh() {
|
|
|
4897
4898
|
t?.disconnect();
|
|
4898
4899
|
}, [t]), t;
|
|
4899
4900
|
}
|
|
4900
|
-
function
|
|
4901
|
+
function nh({ node: e, nodeType: t, hasDimensions: n, resizeObserver: o }) {
|
|
4901
4902
|
const r = te(), i = J(null), s = J(null), a = J(e.sourcePosition), c = J(e.targetPosition), u = J(t), f = n && !!e.internals.handleBounds;
|
|
4902
4903
|
return j(() => {
|
|
4903
4904
|
i.current && !e.hidden && (!f || s.current !== i.current) && (s.current && o?.unobserve(s.current), o?.observe(i.current), s.current = i.current);
|
|
@@ -4910,8 +4911,8 @@ function th({ node: e, nodeType: t, hasDimensions: n, resizeObserver: o }) {
|
|
|
4910
4911
|
}
|
|
4911
4912
|
}, [e.id, t, e.sourcePosition, e.targetPosition]), i;
|
|
4912
4913
|
}
|
|
4913
|
-
function
|
|
4914
|
-
const { node: m, internals:
|
|
4914
|
+
function oh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave: r, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: u, nodesFocusable: f, resizeObserver: l, noDragClassName: d, noPanClassName: h, disableKeyboardA11y: p, rfId: y, nodeTypes: _, nodeExtent: x, nodeClickDistance: b, onError: w }) {
|
|
4915
|
+
const { node: m, internals: E, isParent: A } = K((B) => {
|
|
4915
4916
|
const G = B.nodeLookup.get(e), ee = B.parentLookup.has(e);
|
|
4916
4917
|
return {
|
|
4917
4918
|
node: G,
|
|
@@ -4921,8 +4922,8 @@ function nh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave:
|
|
|
4921
4922
|
}, ne);
|
|
4922
4923
|
let N = m.type || "default", z = _?.[N] || ar[N];
|
|
4923
4924
|
z === void 0 && (w?.("003", Ne.error003(N)), N = "default", z = ar.default);
|
|
4924
|
-
const I = !!(m.draggable || a && typeof m.draggable > "u"), k = !!(m.selectable || c && typeof m.selectable > "u"), V = !!(m.connectable || u && typeof m.connectable > "u"), D = !!(m.focusable || f && typeof m.focusable > "u"), H = te(), g = ii(m),
|
|
4925
|
-
nodeRef:
|
|
4925
|
+
const I = !!(m.draggable || a && typeof m.draggable > "u"), k = !!(m.selectable || c && typeof m.selectable > "u"), V = !!(m.connectable || u && typeof m.connectable > "u"), D = !!(m.focusable || f && typeof m.focusable > "u"), H = te(), g = ii(m), S = nh({ node: m, nodeType: N, hasDimensions: g, resizeObserver: l }), v = Di({
|
|
4926
|
+
nodeRef: S,
|
|
4926
4927
|
disabled: m.hidden || !I,
|
|
4927
4928
|
noDragClassName: d,
|
|
4928
4929
|
handleSelector: m.dragHandle,
|
|
@@ -4932,13 +4933,13 @@ function nh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave:
|
|
|
4932
4933
|
}), M = Hi();
|
|
4933
4934
|
if (m.hidden)
|
|
4934
4935
|
return null;
|
|
4935
|
-
const $ = Ce(m), C =
|
|
4936
|
+
const $ = Ce(m), C = qf(m), T = k || I || t || n || o || r, O = n ? (B) => n(B, { ...E.userNode }) : void 0, L = o ? (B) => o(B, { ...E.userNode }) : void 0, Z = r ? (B) => r(B, { ...E.userNode }) : void 0, X = i ? (B) => i(B, { ...E.userNode }) : void 0, F = s ? (B) => s(B, { ...E.userNode }) : void 0, Y = (B) => {
|
|
4936
4937
|
const { selectNodesOnDrag: G, nodeDragThreshold: ee } = H.getState();
|
|
4937
4938
|
k && (!G || !I || ee > 0) && Fn({
|
|
4938
4939
|
id: e,
|
|
4939
4940
|
store: H,
|
|
4940
|
-
nodeRef:
|
|
4941
|
-
}), t && t(B, { ...
|
|
4941
|
+
nodeRef: S
|
|
4942
|
+
}), t && t(B, { ...E.userNode });
|
|
4942
4943
|
}, q = (B) => {
|
|
4943
4944
|
if (!(Vn(B.nativeEvent) || p))
|
|
4944
4945
|
if (Kr.includes(B.key) && k) {
|
|
@@ -4947,10 +4948,10 @@ function nh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave:
|
|
|
4947
4948
|
id: e,
|
|
4948
4949
|
store: H,
|
|
4949
4950
|
unselect: G,
|
|
4950
|
-
nodeRef:
|
|
4951
|
+
nodeRef: S
|
|
4951
4952
|
});
|
|
4952
4953
|
} else I && m.selected && Object.prototype.hasOwnProperty.call(qt, B.key) && (B.preventDefault(), H.setState({
|
|
4953
|
-
ariaLiveMessage: `Moved selected node ${B.key.replace("Arrow", "").toLowerCase()}. New position, x: ${~~
|
|
4954
|
+
ariaLiveMessage: `Moved selected node ${B.key.replace("Arrow", "").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`
|
|
4954
4955
|
}), M({
|
|
4955
4956
|
direction: qt[B.key],
|
|
4956
4957
|
factor: B.shiftKey ? 4 : 1
|
|
@@ -4971,16 +4972,16 @@ function nh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave:
|
|
|
4971
4972
|
draggable: I,
|
|
4972
4973
|
dragging: v
|
|
4973
4974
|
}
|
|
4974
|
-
]), ref:
|
|
4975
|
-
zIndex:
|
|
4976
|
-
transform: `translate(${
|
|
4975
|
+
]), ref: S, style: {
|
|
4976
|
+
zIndex: E.z,
|
|
4977
|
+
transform: `translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,
|
|
4977
4978
|
pointerEvents: T ? "all" : "none",
|
|
4978
4979
|
visibility: g ? "visible" : "hidden",
|
|
4979
4980
|
...m.style,
|
|
4980
4981
|
...C
|
|
4981
|
-
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: O, onMouseMove: L, onMouseLeave: Z, onContextMenu: X, onClick: Y, onDoubleClick: F, onKeyDown: D ? q : void 0, tabIndex: D ? 0 : void 0, role: D ? "button" : void 0, "aria-describedby": p ? void 0 : `${Mi}-${y}`, "aria-label": m.ariaLabel, children: P(
|
|
4982
|
+
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: O, onMouseMove: L, onMouseLeave: Z, onContextMenu: X, onClick: Y, onDoubleClick: F, onKeyDown: D ? q : void 0, tabIndex: D ? 0 : void 0, role: D ? "button" : void 0, "aria-describedby": p ? void 0 : `${Mi}-${y}`, "aria-label": m.ariaLabel, children: P(Bf, { value: e, children: P(z, { id: e, data: m.data, type: N, positionAbsoluteX: E.positionAbsolute.x, positionAbsoluteY: E.positionAbsolute.y, selected: m.selected ?? !1, selectable: k, draggable: I, deletable: m.deletable ?? !0, isConnectable: V, sourcePosition: m.sourcePosition, targetPosition: m.targetPosition, dragging: v, dragHandle: m.dragHandle, zIndex: E.z, parentId: m.parentId, ...$ }) }) });
|
|
4982
4983
|
}
|
|
4983
|
-
const
|
|
4984
|
+
const rh = (e) => ({
|
|
4984
4985
|
nodesDraggable: e.nodesDraggable,
|
|
4985
4986
|
nodesConnectable: e.nodesConnectable,
|
|
4986
4987
|
nodesFocusable: e.nodesFocusable,
|
|
@@ -4988,7 +4989,7 @@ const oh = (e) => ({
|
|
|
4988
4989
|
onError: e.onError
|
|
4989
4990
|
});
|
|
4990
4991
|
function Oi(e) {
|
|
4991
|
-
const { nodesDraggable: t, nodesConnectable: n, nodesFocusable: o, elementsSelectable: r, onError: i } = K(
|
|
4992
|
+
const { nodesDraggable: t, nodesConnectable: n, nodesFocusable: o, elementsSelectable: r, onError: i } = K(rh, ne), s = jf(e.onlyRenderVisibleElements), a = th();
|
|
4992
4993
|
return P("div", { className: "react-flow__nodes", style: an, children: s.map((c) => (
|
|
4993
4994
|
// The split of responsibilities between NodeRenderer and
|
|
4994
4995
|
// NodeComponentWrapper may appear weird. However, it’s designed to
|
|
@@ -5013,12 +5014,12 @@ function Oi(e) {
|
|
|
5013
5014
|
// moved into `NodeComponentWrapper`. This ensures they are
|
|
5014
5015
|
// memorized – so if `NodeRenderer` *has* to rerender, it only
|
|
5015
5016
|
// needs to regenerate the list of nodes, nothing else.
|
|
5016
|
-
P(
|
|
5017
|
+
P(oh, { id: c, nodeTypes: e.nodeTypes, nodeExtent: e.nodeExtent, onClick: e.onNodeClick, onMouseEnter: e.onNodeMouseEnter, onMouseMove: e.onNodeMouseMove, onMouseLeave: e.onNodeMouseLeave, onContextMenu: e.onNodeContextMenu, onDoubleClick: e.onNodeDoubleClick, noDragClassName: e.noDragClassName, noPanClassName: e.noPanClassName, rfId: e.rfId, disableKeyboardA11y: e.disableKeyboardA11y, resizeObserver: a, nodesDraggable: t, nodesConnectable: n, nodesFocusable: o, elementsSelectable: r, nodeClickDistance: e.nodeClickDistance, onError: i }, c)
|
|
5017
5018
|
)) });
|
|
5018
5019
|
}
|
|
5019
5020
|
Oi.displayName = "NodeRenderer";
|
|
5020
|
-
const
|
|
5021
|
-
function
|
|
5021
|
+
const ih = ie(Oi);
|
|
5022
|
+
function sh(e) {
|
|
5022
5023
|
return K(fe((n) => {
|
|
5023
5024
|
if (!e)
|
|
5024
5025
|
return n.edges.map((r) => r.id);
|
|
@@ -5037,23 +5038,23 @@ function ih(e) {
|
|
|
5037
5038
|
return o;
|
|
5038
5039
|
}, [e]), ne);
|
|
5039
5040
|
}
|
|
5040
|
-
const
|
|
5041
|
+
const ah = ({ color: e = "none", strokeWidth: t = 1 }) => P("polyline", { style: {
|
|
5041
5042
|
stroke: e,
|
|
5042
5043
|
strokeWidth: t
|
|
5043
|
-
}, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" }),
|
|
5044
|
+
}, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" }), ch = ({ color: e = "none", strokeWidth: t = 1 }) => P("polyline", { style: {
|
|
5044
5045
|
stroke: e,
|
|
5045
5046
|
fill: e,
|
|
5046
5047
|
strokeWidth: t
|
|
5047
5048
|
}, strokeLinecap: "round", strokeLinejoin: "round", points: "-5,-4 0,0 -5,4 -5,-4" }), ur = {
|
|
5048
|
-
[Xt.Arrow]:
|
|
5049
|
-
[Xt.ArrowClosed]:
|
|
5049
|
+
[Xt.Arrow]: ah,
|
|
5050
|
+
[Xt.ArrowClosed]: ch
|
|
5050
5051
|
};
|
|
5051
|
-
function
|
|
5052
|
+
function uh(e) {
|
|
5052
5053
|
const t = te();
|
|
5053
5054
|
return me(() => Object.prototype.hasOwnProperty.call(ur, e) ? ur[e] : (t.getState().onError?.("009", Ne.error009(e)), null), [e]);
|
|
5054
5055
|
}
|
|
5055
|
-
const
|
|
5056
|
-
const c =
|
|
5056
|
+
const lh = ({ id: e, type: t, color: n, width: o = 12.5, height: r = 12.5, markerUnits: i = "strokeWidth", strokeWidth: s, orient: a = "auto-start-reverse" }) => {
|
|
5057
|
+
const c = uh(t);
|
|
5057
5058
|
return c ? P("marker", { className: "react-flow__arrowhead", id: e, markerWidth: `${o}`, markerHeight: `${r}`, viewBox: "-10 -10 20 20", markerUnits: i, orient: a, refX: "0", refY: "0", children: P(c, { color: n, strokeWidth: s }) }) : null;
|
|
5058
5059
|
}, Bi = ({ defaultColor: e, rfId: t }) => {
|
|
5059
5060
|
const n = K((i) => i.edges), o = K((i) => i.defaultEdgeOptions), r = me(() => Jl(n, {
|
|
@@ -5062,10 +5063,10 @@ const uh = ({ id: e, type: t, color: n, width: o = 12.5, height: r = 12.5, marke
|
|
|
5062
5063
|
defaultMarkerStart: o?.markerStart,
|
|
5063
5064
|
defaultMarkerEnd: o?.markerEnd
|
|
5064
5065
|
}), [n, o, t, e]);
|
|
5065
|
-
return r.length ? P("svg", { className: "react-flow__marker", children: P("defs", { children: r.map((i) => P(
|
|
5066
|
+
return r.length ? P("svg", { className: "react-flow__marker", children: P("defs", { children: r.map((i) => P(lh, { id: i.id, type: i.type, color: i.color, width: i.width, height: i.height, markerUnits: i.markerUnits, strokeWidth: i.strokeWidth, orient: i.orient }, i.id)) }) }) : null;
|
|
5066
5067
|
};
|
|
5067
5068
|
Bi.displayName = "MarkerDefinitions";
|
|
5068
|
-
var
|
|
5069
|
+
var dh = ie(Bi);
|
|
5069
5070
|
function Li({ x: e, y: t, label: n, labelStyle: o = {}, labelShowBg: r = !0, labelBgStyle: i = {}, labelBgPadding: s = [2, 4], labelBgBorderRadius: a = 2, children: c, className: u, ...f }) {
|
|
5070
5071
|
const [l, d] = de({ x: 1, y: 0, width: 0, height: 0 }), h = re(["react-flow__edge-textwrapper", u]), p = J(null);
|
|
5071
5072
|
return j(() => {
|
|
@@ -5081,9 +5082,9 @@ function Li({ x: e, y: t, label: n, labelStyle: o = {}, labelShowBg: r = !0, lab
|
|
|
5081
5082
|
}, [n]), typeof n > "u" || !n ? null : se("g", { transform: `translate(${e - l.width / 2} ${t - l.height / 2})`, className: h, visibility: l.width ? "visible" : "hidden", ...f, children: [r && P("rect", { width: l.width + 2 * s[0], x: -s[0], y: -s[1], height: l.height + 2 * s[1], className: "react-flow__edge-textbg", style: i, rx: a, ry: a }), P("text", { className: "react-flow__edge-text", y: l.height / 2, dy: "0.3em", ref: p, style: o, children: n }), c] });
|
|
5082
5083
|
}
|
|
5083
5084
|
Li.displayName = "EdgeText";
|
|
5084
|
-
const
|
|
5085
|
+
const fh = ie(Li);
|
|
5085
5086
|
function cn({ path: e, labelX: t, labelY: n, label: o, labelStyle: r, labelShowBg: i, labelBgStyle: s, labelBgPadding: a, labelBgBorderRadius: c, interactionWidth: u = 20, ...f }) {
|
|
5086
|
-
return se(
|
|
5087
|
+
return se(Se, { children: [P("path", { ...f, d: e, fill: "none", className: re(["react-flow__edge-path", f.className]) }), u && P("path", { d: e, fill: "none", strokeOpacity: 0, strokeWidth: u, className: "react-flow__edge-interaction" }), o && pe(t) && pe(n) ? P(fh, { x: t, y: n, label: o, labelStyle: r, labelShowBg: i, labelBgStyle: s, labelBgPadding: a, labelBgBorderRadius: c }) : null] });
|
|
5087
5088
|
}
|
|
5088
5089
|
function lr({ pos: e, x1: t, y1: n, x2: o, y2: r }) {
|
|
5089
5090
|
return e === R.Left || e === R.Right ? [0.5 * (t + o), n] : [t, 0.5 * (n + r)];
|
|
@@ -5128,16 +5129,16 @@ function Fi(e) {
|
|
|
5128
5129
|
targetX: r,
|
|
5129
5130
|
targetY: i,
|
|
5130
5131
|
targetPosition: a
|
|
5131
|
-
}),
|
|
5132
|
-
return P(cn, { id:
|
|
5132
|
+
}), E = e.isInternal ? void 0 : t;
|
|
5133
|
+
return P(cn, { id: E, path: b, labelX: w, labelY: m, label: c, labelStyle: u, labelShowBg: f, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: h, style: p, markerEnd: y, markerStart: _, interactionWidth: x });
|
|
5133
5134
|
});
|
|
5134
5135
|
}
|
|
5135
|
-
const
|
|
5136
|
-
|
|
5136
|
+
const hh = Fi({ isInternal: !1 }), Xi = Fi({ isInternal: !0 });
|
|
5137
|
+
hh.displayName = "SimpleBezierEdge";
|
|
5137
5138
|
Xi.displayName = "SimpleBezierEdgeInternal";
|
|
5138
5139
|
function Yi(e) {
|
|
5139
5140
|
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: l, style: d, sourcePosition: h = R.Bottom, targetPosition: p = R.Top, markerEnd: y, markerStart: _, pathOptions: x, interactionWidth: b }) => {
|
|
5140
|
-
const [w, m,
|
|
5141
|
+
const [w, m, E] = On({
|
|
5141
5142
|
sourceX: n,
|
|
5142
5143
|
sourceY: o,
|
|
5143
5144
|
sourcePosition: h,
|
|
@@ -5147,7 +5148,7 @@ function Yi(e) {
|
|
|
5147
5148
|
borderRadius: x?.borderRadius,
|
|
5148
5149
|
offset: x?.offset
|
|
5149
5150
|
}), A = e.isInternal ? void 0 : t;
|
|
5150
|
-
return P(cn, { id: A, path: w, labelX: m, labelY:
|
|
5151
|
+
return P(cn, { id: A, path: w, labelX: m, labelY: E, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: l, style: d, markerEnd: y, markerStart: _, interactionWidth: b });
|
|
5151
5152
|
});
|
|
5152
5153
|
}
|
|
5153
5154
|
const Zi = Yi({ isInternal: !1 }), Wi = Yi({ isInternal: !0 });
|
|
@@ -5159,8 +5160,8 @@ function qi(e) {
|
|
|
5159
5160
|
return P(Zi, { ...n, id: o, pathOptions: me(() => ({ borderRadius: 0, offset: n.pathOptions?.offset }), [n.pathOptions?.offset]) });
|
|
5160
5161
|
});
|
|
5161
5162
|
}
|
|
5162
|
-
const
|
|
5163
|
-
|
|
5163
|
+
const gh = qi({ isInternal: !1 }), Gi = qi({ isInternal: !0 });
|
|
5164
|
+
gh.displayName = "StepEdge";
|
|
5164
5165
|
Gi.displayName = "StepEdgeInternal";
|
|
5165
5166
|
function Ki(e) {
|
|
5166
5167
|
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: l, style: d, markerEnd: h, markerStart: p, interactionWidth: y }) => {
|
|
@@ -5168,12 +5169,12 @@ function Ki(e) {
|
|
|
5168
5169
|
return P(cn, { id: w, path: _, labelX: x, labelY: b, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: l, style: d, markerEnd: h, markerStart: p, interactionWidth: y });
|
|
5169
5170
|
});
|
|
5170
5171
|
}
|
|
5171
|
-
const
|
|
5172
|
-
|
|
5172
|
+
const ph = Ki({ isInternal: !1 }), Ui = Ki({ isInternal: !0 });
|
|
5173
|
+
ph.displayName = "StraightEdge";
|
|
5173
5174
|
Ui.displayName = "StraightEdgeInternal";
|
|
5174
5175
|
function Qi(e) {
|
|
5175
5176
|
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, sourcePosition: s = R.Bottom, targetPosition: a = R.Top, label: c, labelStyle: u, labelShowBg: f, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: h, style: p, markerEnd: y, markerStart: _, pathOptions: x, interactionWidth: b }) => {
|
|
5176
|
-
const [w, m,
|
|
5177
|
+
const [w, m, E] = li({
|
|
5177
5178
|
sourceX: n,
|
|
5178
5179
|
sourceY: o,
|
|
5179
5180
|
sourcePosition: s,
|
|
@@ -5182,11 +5183,11 @@ function Qi(e) {
|
|
|
5182
5183
|
targetPosition: a,
|
|
5183
5184
|
curvature: x?.curvature
|
|
5184
5185
|
}), A = e.isInternal ? void 0 : t;
|
|
5185
|
-
return P(cn, { id: A, path: w, labelX: m, labelY:
|
|
5186
|
+
return P(cn, { id: A, path: w, labelX: m, labelY: E, label: c, labelStyle: u, labelShowBg: f, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: h, style: p, markerEnd: y, markerStart: _, interactionWidth: b });
|
|
5186
5187
|
});
|
|
5187
5188
|
}
|
|
5188
|
-
const
|
|
5189
|
-
|
|
5189
|
+
const mh = Qi({ isInternal: !1 }), Ji = Qi({ isInternal: !0 });
|
|
5190
|
+
mh.displayName = "BezierEdge";
|
|
5190
5191
|
Ji.displayName = "BezierEdgeInternal";
|
|
5191
5192
|
const dr = {
|
|
5192
5193
|
default: Ji,
|
|
@@ -5201,29 +5202,29 @@ const dr = {
|
|
|
5201
5202
|
targetY: null,
|
|
5202
5203
|
sourcePosition: null,
|
|
5203
5204
|
targetPosition: null
|
|
5204
|
-
},
|
|
5205
|
+
}, yh = (e, t, n) => n === R.Left ? e - t : n === R.Right ? e + t : e, wh = (e, t, n) => n === R.Top ? e - t : n === R.Bottom ? e + t : e, hr = "react-flow__edgeupdater";
|
|
5205
5206
|
function gr({ position: e, centerX: t, centerY: n, radius: o = 10, onMouseDown: r, onMouseEnter: i, onMouseOut: s, type: a }) {
|
|
5206
|
-
return P("circle", { onMouseDown: r, onMouseEnter: i, onMouseOut: s, className: re([hr, `${hr}-${a}`]), cx:
|
|
5207
|
+
return P("circle", { onMouseDown: r, onMouseEnter: i, onMouseOut: s, className: re([hr, `${hr}-${a}`]), cx: yh(t, o, e), cy: wh(n, o, e), r: o, stroke: "transparent", fill: "transparent" });
|
|
5207
5208
|
}
|
|
5208
|
-
function
|
|
5209
|
-
const p = te(), y = (m,
|
|
5209
|
+
function xh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: o, sourceY: r, targetX: i, targetY: s, sourcePosition: a, targetPosition: c, onReconnect: u, onReconnectStart: f, onReconnectEnd: l, setReconnecting: d, setUpdateHover: h }) {
|
|
5210
|
+
const p = te(), y = (m, E) => {
|
|
5210
5211
|
if (m.button !== 0)
|
|
5211
5212
|
return;
|
|
5212
|
-
const { autoPanOnConnect: A, domNode: N, isValidConnection: z, connectionMode: I, connectionRadius: k, lib: V, onConnectStart: D, onConnectEnd: H, cancelConnection: g, nodeLookup:
|
|
5213
|
-
d(!0), f?.(m, n,
|
|
5213
|
+
const { autoPanOnConnect: A, domNode: N, isValidConnection: z, connectionMode: I, connectionRadius: k, lib: V, onConnectStart: D, onConnectEnd: H, cancelConnection: g, nodeLookup: S, rfId: v, panBy: M, updateConnection: $ } = p.getState(), C = E.type === "target";
|
|
5214
|
+
d(!0), f?.(m, n, E.type);
|
|
5214
5215
|
const T = (L, Z) => {
|
|
5215
|
-
d(!1), l?.(L, n,
|
|
5216
|
+
d(!1), l?.(L, n, E.type, Z);
|
|
5216
5217
|
}, O = (L) => u?.(n, L);
|
|
5217
5218
|
Rn.onPointerDown(m.nativeEvent, {
|
|
5218
5219
|
autoPanOnConnect: A,
|
|
5219
5220
|
connectionMode: I,
|
|
5220
5221
|
connectionRadius: k,
|
|
5221
5222
|
domNode: N,
|
|
5222
|
-
handleId:
|
|
5223
|
-
nodeId:
|
|
5224
|
-
nodeLookup:
|
|
5223
|
+
handleId: E.id,
|
|
5224
|
+
nodeId: E.nodeId,
|
|
5225
|
+
nodeLookup: S,
|
|
5225
5226
|
isTarget: C,
|
|
5226
|
-
edgeUpdaterType:
|
|
5227
|
+
edgeUpdaterType: E.type,
|
|
5227
5228
|
lib: V,
|
|
5228
5229
|
flowId: v,
|
|
5229
5230
|
cancelConnection: g,
|
|
@@ -5238,15 +5239,15 @@ function wh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: o, sourc
|
|
|
5238
5239
|
getFromHandle: () => p.getState().connection.fromHandle
|
|
5239
5240
|
});
|
|
5240
5241
|
}, _ = (m) => y(m, { nodeId: n.target, id: n.targetHandle ?? null, type: "target" }), x = (m) => y(m, { nodeId: n.source, id: n.sourceHandle ?? null, type: "source" }), b = () => h(!0), w = () => h(!1);
|
|
5241
|
-
return se(
|
|
5242
|
+
return se(Se, { children: [(e === !0 || e === "source") && P(gr, { position: a, centerX: o, centerY: r, radius: t, onMouseDown: _, onMouseEnter: b, onMouseOut: w, type: "source" }), (e === !0 || e === "target") && P(gr, { position: c, centerX: i, centerY: s, radius: t, onMouseDown: x, onMouseEnter: b, onMouseOut: w, type: "target" })] });
|
|
5242
5243
|
}
|
|
5243
|
-
function
|
|
5244
|
+
function vh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: o, onClick: r, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: u, reconnectRadius: f, onReconnect: l, onReconnectStart: d, onReconnectEnd: h, rfId: p, edgeTypes: y, noPanClassName: _, onError: x, disableKeyboardA11y: b }) {
|
|
5244
5245
|
let w = K((W) => W.edgeLookup.get(e));
|
|
5245
5246
|
const m = K((W) => W.defaultEdgeOptions);
|
|
5246
5247
|
w = m ? { ...m, ...w } : w;
|
|
5247
|
-
let
|
|
5248
|
-
A === void 0 && (x?.("011", Ne.error011(
|
|
5249
|
-
const N = !!(w.focusable || t && typeof w.focusable > "u"), z = typeof l < "u" && (w.reconnectable || n && typeof w.reconnectable > "u"), I = !!(w.selectable || o && typeof w.selectable > "u"), k = J(null), [V, D] = de(!1), [H, g] = de(!1),
|
|
5248
|
+
let E = w.type || "default", A = y?.[E] || dr[E];
|
|
5249
|
+
A === void 0 && (x?.("011", Ne.error011(E)), E = "default", A = dr.default);
|
|
5250
|
+
const N = !!(w.focusable || t && typeof w.focusable > "u"), z = typeof l < "u" && (w.reconnectable || n && typeof w.reconnectable > "u"), I = !!(w.selectable || o && typeof w.selectable > "u"), k = J(null), [V, D] = de(!1), [H, g] = de(!1), S = te(), { zIndex: v, sourceX: M, sourceY: $, targetX: C, targetY: T, sourcePosition: O, targetPosition: L } = K(fe((W) => {
|
|
5250
5251
|
const U = W.nodeLookup.get(w.source), oe = W.nodeLookup.get(w.target);
|
|
5251
5252
|
if (!U || !oe)
|
|
5252
5253
|
return {
|
|
@@ -5276,8 +5277,8 @@ function xh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
5276
5277
|
if (w.hidden || M === null || $ === null || C === null || T === null)
|
|
5277
5278
|
return null;
|
|
5278
5279
|
const F = (W) => {
|
|
5279
|
-
const { addSelectedEdges: U, unselectNodesAndEdges: oe, multiSelectionActive: ae } =
|
|
5280
|
-
I && (
|
|
5280
|
+
const { addSelectedEdges: U, unselectNodesAndEdges: oe, multiSelectionActive: ae } = S.getState();
|
|
5281
|
+
I && (S.setState({ nodesSelectionActive: !1 }), w.selected && ae ? (oe({ nodes: [], edges: [w] }), k.current?.blur()) : U([e])), r && r(W, w);
|
|
5281
5282
|
}, Y = i ? (W) => {
|
|
5282
5283
|
i(W, { ...w });
|
|
5283
5284
|
} : void 0, q = s ? (W) => {
|
|
@@ -5290,13 +5291,13 @@ function xh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
5290
5291
|
u(W, { ...w });
|
|
5291
5292
|
} : void 0, Q = (W) => {
|
|
5292
5293
|
if (!b && Kr.includes(W.key) && I) {
|
|
5293
|
-
const { unselectNodesAndEdges: U, addSelectedEdges: oe } =
|
|
5294
|
+
const { unselectNodesAndEdges: U, addSelectedEdges: oe } = S.getState();
|
|
5294
5295
|
W.key === "Escape" ? (k.current?.blur(), U({ edges: [w] })) : oe([e]);
|
|
5295
5296
|
}
|
|
5296
5297
|
};
|
|
5297
5298
|
return P("svg", { style: { zIndex: v }, children: se("g", { className: re([
|
|
5298
5299
|
"react-flow__edge",
|
|
5299
|
-
`react-flow__edge-${
|
|
5300
|
+
`react-flow__edge-${E}`,
|
|
5300
5301
|
w.className,
|
|
5301
5302
|
_,
|
|
5302
5303
|
{
|
|
@@ -5306,9 +5307,9 @@ function xh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
5306
5307
|
updating: V,
|
|
5307
5308
|
selectable: I
|
|
5308
5309
|
}
|
|
5309
|
-
]), onClick: F, onDoubleClick: Y, onContextMenu: q, onMouseEnter: B, onMouseMove: G, onMouseLeave: ee, onKeyDown: N ? Q : void 0, tabIndex: N ? 0 : void 0, role: N ? "button" : "img", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": w.ariaLabel === null ? void 0 : w.ariaLabel || `Edge from ${w.source} to ${w.target}`, "aria-describedby": N ? `${ki}-${p}` : void 0, ref: k, children: [!H && P(A, { id: e, source: w.source, target: w.target, type: w.type, selected: w.selected, animated: w.animated, selectable: I, deletable: w.deletable ?? !0, label: w.label, labelStyle: w.labelStyle, labelShowBg: w.labelShowBg, labelBgStyle: w.labelBgStyle, labelBgPadding: w.labelBgPadding, labelBgBorderRadius: w.labelBgBorderRadius, sourceX: M, sourceY: $, targetX: C, targetY: T, sourcePosition: O, targetPosition: L, data: w.data, style: w.style, sourceHandleId: w.sourceHandle, targetHandleId: w.targetHandle, markerStart: Z, markerEnd: X, pathOptions: "pathOptions" in w ? w.pathOptions : void 0, interactionWidth: w.interactionWidth }), z && P(
|
|
5310
|
+
]), onClick: F, onDoubleClick: Y, onContextMenu: q, onMouseEnter: B, onMouseMove: G, onMouseLeave: ee, onKeyDown: N ? Q : void 0, tabIndex: N ? 0 : void 0, role: N ? "button" : "img", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": w.ariaLabel === null ? void 0 : w.ariaLabel || `Edge from ${w.source} to ${w.target}`, "aria-describedby": N ? `${ki}-${p}` : void 0, ref: k, children: [!H && P(A, { id: e, source: w.source, target: w.target, type: w.type, selected: w.selected, animated: w.animated, selectable: I, deletable: w.deletable ?? !0, label: w.label, labelStyle: w.labelStyle, labelShowBg: w.labelShowBg, labelBgStyle: w.labelBgStyle, labelBgPadding: w.labelBgPadding, labelBgBorderRadius: w.labelBgBorderRadius, sourceX: M, sourceY: $, targetX: C, targetY: T, sourcePosition: O, targetPosition: L, data: w.data, style: w.style, sourceHandleId: w.sourceHandle, targetHandleId: w.targetHandle, markerStart: Z, markerEnd: X, pathOptions: "pathOptions" in w ? w.pathOptions : void 0, interactionWidth: w.interactionWidth }), z && P(xh, { edge: w, isReconnectable: z, reconnectRadius: f, onReconnect: l, onReconnectStart: d, onReconnectEnd: h, sourceX: M, sourceY: $, targetX: C, targetY: T, sourcePosition: O, targetPosition: L, setUpdateHover: D, setReconnecting: g })] }) });
|
|
5310
5311
|
}
|
|
5311
|
-
const
|
|
5312
|
+
const _h = (e) => ({
|
|
5312
5313
|
edgesFocusable: e.edgesFocusable,
|
|
5313
5314
|
edgesReconnectable: e.edgesReconnectable,
|
|
5314
5315
|
elementsSelectable: e.elementsSelectable,
|
|
@@ -5316,51 +5317,51 @@ const vh = (e) => ({
|
|
|
5316
5317
|
onError: e.onError
|
|
5317
5318
|
});
|
|
5318
5319
|
function ji({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: o, noPanClassName: r, onReconnect: i, onEdgeContextMenu: s, onEdgeMouseEnter: a, onEdgeMouseMove: c, onEdgeMouseLeave: u, onEdgeClick: f, reconnectRadius: l, onEdgeDoubleClick: d, onReconnectStart: h, onReconnectEnd: p, disableKeyboardA11y: y }) {
|
|
5319
|
-
const { edgesFocusable: _, edgesReconnectable: x, elementsSelectable: b, onError: w } = K(
|
|
5320
|
-
return se("div", { className: "react-flow__edges", children: [P(
|
|
5320
|
+
const { edgesFocusable: _, edgesReconnectable: x, elementsSelectable: b, onError: w } = K(_h, ne), m = sh(t);
|
|
5321
|
+
return se("div", { className: "react-flow__edges", children: [P(dh, { defaultColor: e, rfId: n }), m.map((E) => P(vh, { id: E, edgesFocusable: _, edgesReconnectable: x, elementsSelectable: b, noPanClassName: r, onReconnect: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: u, onClick: f, reconnectRadius: l, onDoubleClick: d, onReconnectStart: h, onReconnectEnd: p, rfId: n, onError: w, edgeTypes: o, disableKeyboardA11y: y }, E))] });
|
|
5321
5322
|
}
|
|
5322
5323
|
ji.displayName = "EdgeRenderer";
|
|
5323
|
-
const
|
|
5324
|
+
const bh = ie(ji), Eh = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
|
|
5324
5325
|
function Sh({ children: e }) {
|
|
5325
|
-
const t = K(
|
|
5326
|
+
const t = K(Eh);
|
|
5326
5327
|
return P("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform: t }, children: e });
|
|
5327
5328
|
}
|
|
5328
|
-
function
|
|
5329
|
+
function Nh(e) {
|
|
5329
5330
|
const t = so(), n = J(!1);
|
|
5330
5331
|
j(() => {
|
|
5331
5332
|
!n.current && t.viewportInitialized && e && (setTimeout(() => e(t), 1), n.current = !0);
|
|
5332
5333
|
}, [e, t.viewportInitialized]);
|
|
5333
5334
|
}
|
|
5334
|
-
const
|
|
5335
|
-
function
|
|
5336
|
-
const t = K(
|
|
5335
|
+
const Ch = (e) => e.panZoom?.syncViewport;
|
|
5336
|
+
function Mh(e) {
|
|
5337
|
+
const t = K(Ch), n = te();
|
|
5337
5338
|
return j(() => {
|
|
5338
5339
|
e && (t?.(e), n.setState({ transform: [e.x, e.y, e.zoom] }));
|
|
5339
5340
|
}, [e, t]), null;
|
|
5340
5341
|
}
|
|
5341
|
-
function Mh(e) {
|
|
5342
|
-
return e.connection.inProgress ? { ...e.connection, to: bt(e.connection.to, e.transform) } : { ...e.connection };
|
|
5343
|
-
}
|
|
5344
5342
|
function kh(e) {
|
|
5345
|
-
return
|
|
5343
|
+
return e.connection.inProgress ? { ...e.connection, to: bt(e.connection.to, e.transform) } : { ...e.connection };
|
|
5346
5344
|
}
|
|
5347
5345
|
function $h(e) {
|
|
5348
|
-
|
|
5346
|
+
return kh;
|
|
5347
|
+
}
|
|
5348
|
+
function Ih(e) {
|
|
5349
|
+
const t = $h();
|
|
5349
5350
|
return K(t, ne);
|
|
5350
5351
|
}
|
|
5351
|
-
const
|
|
5352
|
+
const Ah = (e) => ({
|
|
5352
5353
|
nodesConnectable: e.nodesConnectable,
|
|
5353
5354
|
isValid: e.connection.isValid,
|
|
5354
5355
|
inProgress: e.connection.inProgress,
|
|
5355
5356
|
width: e.width,
|
|
5356
5357
|
height: e.height
|
|
5357
5358
|
});
|
|
5358
|
-
function
|
|
5359
|
-
const { nodesConnectable: r, width: i, height: s, isValid: a, inProgress: c } = K(
|
|
5359
|
+
function Ph({ containerStyle: e, style: t, type: n, component: o }) {
|
|
5360
|
+
const { nodesConnectable: r, width: i, height: s, isValid: a, inProgress: c } = K(Ah, ne);
|
|
5360
5361
|
return !(i && r && c) ? null : P("svg", { style: e, width: i, height: s, className: "react-flow__connectionline react-flow__container", children: P("g", { className: re(["react-flow__connection", Qr(a)]), children: P(es, { style: t, type: n, CustomComponent: o, isValid: a }) }) });
|
|
5361
5362
|
}
|
|
5362
5363
|
const es = ({ style: e, type: t = Ie.Bezier, CustomComponent: n, isValid: o }) => {
|
|
5363
|
-
const { inProgress: r, from: i, fromNode: s, fromHandle: a, fromPosition: c, to: u, toNode: f, toHandle: l, toPosition: d } =
|
|
5364
|
+
const { inProgress: r, from: i, fromNode: s, fromHandle: a, fromPosition: c, to: u, toNode: f, toHandle: l, toPosition: d } = Ih();
|
|
5364
5365
|
if (!r)
|
|
5365
5366
|
return;
|
|
5366
5367
|
if (n)
|
|
@@ -5396,20 +5397,20 @@ const es = ({ style: e, type: t = Ie.Bezier, CustomComponent: n, isValid: o }) =
|
|
|
5396
5397
|
return P("path", { d: h, fill: "none", className: "react-flow__connection-path", style: e });
|
|
5397
5398
|
};
|
|
5398
5399
|
es.displayName = "ConnectionLine";
|
|
5399
|
-
const
|
|
5400
|
-
function pr(e =
|
|
5400
|
+
const zh = {};
|
|
5401
|
+
function pr(e = zh) {
|
|
5401
5402
|
J(e), te(), j(() => {
|
|
5402
5403
|
}, [e]);
|
|
5403
5404
|
}
|
|
5404
|
-
function
|
|
5405
|
+
function Th() {
|
|
5405
5406
|
te(), J(!1), j(() => {
|
|
5406
5407
|
}, []);
|
|
5407
5408
|
}
|
|
5408
|
-
function ts({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: o, onEdgeClick: r, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: u, onNodeContextMenu: f, onSelectionContextMenu: l, onSelectionStart: d, onSelectionEnd: h, connectionLineType: p, connectionLineStyle: y, connectionLineComponent: _, connectionLineContainerStyle: x, selectionKeyCode: b, selectionOnDrag: w, selectionMode: m, multiSelectionKeyCode:
|
|
5409
|
-
return pr(e), pr(t),
|
|
5409
|
+
function ts({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: o, onEdgeClick: r, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: u, onNodeContextMenu: f, onSelectionContextMenu: l, onSelectionStart: d, onSelectionEnd: h, connectionLineType: p, connectionLineStyle: y, connectionLineComponent: _, connectionLineContainerStyle: x, selectionKeyCode: b, selectionOnDrag: w, selectionMode: m, multiSelectionKeyCode: E, panActivationKeyCode: A, zoomActivationKeyCode: N, deleteKeyCode: z, onlyRenderVisibleElements: I, elementsSelectable: k, defaultViewport: V, translateExtent: D, minZoom: H, maxZoom: g, preventScrolling: S, defaultMarkerColor: v, zoomOnScroll: M, zoomOnPinch: $, panOnScroll: C, panOnScrollSpeed: T, panOnScrollMode: O, zoomOnDoubleClick: L, panOnDrag: Z, onPaneClick: X, onPaneMouseEnter: F, onPaneMouseMove: Y, onPaneMouseLeave: q, onPaneScroll: B, onPaneContextMenu: G, paneClickDistance: ee, nodeClickDistance: Q, onEdgeContextMenu: W, onEdgeMouseEnter: U, onEdgeMouseMove: oe, onEdgeMouseLeave: ae, reconnectRadius: Pe, onReconnect: un, onReconnectStart: ln, onReconnectEnd: dn, noDragClassName: Qe, noWheelClassName: fn, noPanClassName: Je, disableKeyboardA11y: je, nodeExtent: hn, rfId: et, viewport: tt, onViewportChange: Et }) {
|
|
5410
|
+
return pr(e), pr(t), Th(), Nh(n), Mh(tt), P(Qf, { onPaneClick: X, onPaneMouseEnter: F, onPaneMouseMove: Y, onPaneMouseLeave: q, onPaneContextMenu: G, onPaneScroll: B, paneClickDistance: ee, deleteKeyCode: z, selectionKeyCode: b, selectionOnDrag: w, selectionMode: m, onSelectionStart: d, onSelectionEnd: h, multiSelectionKeyCode: E, panActivationKeyCode: A, zoomActivationKeyCode: N, elementsSelectable: k, zoomOnScroll: M, zoomOnPinch: $, zoomOnDoubleClick: L, panOnScroll: C, panOnScrollSpeed: T, panOnScrollMode: O, panOnDrag: Z, defaultViewport: V, translateExtent: D, minZoom: H, maxZoom: g, onSelectionContextMenu: l, preventScrolling: S, noDragClassName: Qe, noWheelClassName: fn, noPanClassName: Je, disableKeyboardA11y: je, onViewportChange: Et, isControlledViewport: !!tt, children: se(Sh, { children: [P(bh, { edgeTypes: t, onEdgeClick: r, onEdgeDoubleClick: s, onReconnect: un, onReconnectStart: ln, onReconnectEnd: dn, onlyRenderVisibleElements: I, onEdgeContextMenu: W, onEdgeMouseEnter: U, onEdgeMouseMove: oe, onEdgeMouseLeave: ae, reconnectRadius: Pe, defaultMarkerColor: v, noPanClassName: Je, disableKeyboardA11y: je, rfId: et }), P(Ph, { style: y, type: p, component: _, containerStyle: x }), P("div", { className: "react-flow__edgelabel-renderer" }), P(ih, { nodeTypes: e, onNodeClick: o, onNodeDoubleClick: i, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: u, onNodeContextMenu: f, nodeClickDistance: Q, onlyRenderVisibleElements: I, noPanClassName: Je, noDragClassName: Qe, disableKeyboardA11y: je, nodeExtent: hn, rfId: et }), P("div", { className: "react-flow__viewport-portal" })] }) });
|
|
5410
5411
|
}
|
|
5411
5412
|
ts.displayName = "GraphView";
|
|
5412
|
-
const
|
|
5413
|
+
const Dh = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c } = {}) => {
|
|
5413
5414
|
const u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), h = o ?? t ?? [], p = n ?? e ?? [], y = a ?? [0, 0], _ = c ?? ht;
|
|
5414
5415
|
gi(l, d, h), Ln(p, u, f, {
|
|
5415
5416
|
nodeOrigin: y,
|
|
@@ -5420,8 +5421,8 @@ const Th = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5420
5421
|
if (s && r && i) {
|
|
5421
5422
|
const b = Ue(u, {
|
|
5422
5423
|
filter: (A) => !!((A.width || A.initialWidth) && (A.height || A.initialHeight))
|
|
5423
|
-
}), { x: w, y: m, zoom:
|
|
5424
|
-
x = [w, m,
|
|
5424
|
+
}), { x: w, y: m, zoom: E } = Jn(b, r, i, 0.5, 2, 0.1);
|
|
5425
|
+
x = [w, m, E];
|
|
5425
5426
|
}
|
|
5426
5427
|
return {
|
|
5427
5428
|
rfId: "1",
|
|
@@ -5481,7 +5482,7 @@ const Th = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5481
5482
|
lib: "react",
|
|
5482
5483
|
debug: !1
|
|
5483
5484
|
};
|
|
5484
|
-
},
|
|
5485
|
+
}, Hh = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c }) => ef((u, f) => ({
|
|
5485
5486
|
...mr({ nodes: e, edges: t, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c, defaultNodes: n, defaultEdges: o }),
|
|
5486
5487
|
setNodes: (l) => {
|
|
5487
5488
|
const { nodeLookup: d, parentLookup: h, nodeOrigin: p, elevateNodesOnSelect: y } = f();
|
|
@@ -5510,9 +5511,9 @@ const Th = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5510
5511
|
// changes its dimensions, this function is called to measure the
|
|
5511
5512
|
// new dimensions and update the nodes.
|
|
5512
5513
|
updateNodeInternals: (l, d = { triggerFitView: !0 }) => {
|
|
5513
|
-
const { triggerNodeChanges: h, nodeLookup: p, parentLookup: y, fitViewOnInit: _, fitViewDone: x, fitViewOnInitOptions: b, domNode: w, nodeOrigin: m, nodeExtent:
|
|
5514
|
+
const { triggerNodeChanges: h, nodeLookup: p, parentLookup: y, fitViewOnInit: _, fitViewDone: x, fitViewOnInitOptions: b, domNode: w, nodeOrigin: m, nodeExtent: E, debug: A, fitViewSync: N } = f(), { changes: z, updatedInternals: I } = rd(l, p, y, w, m, E);
|
|
5514
5515
|
if (I) {
|
|
5515
|
-
if (td(p, y, { nodeOrigin: m, nodeExtent:
|
|
5516
|
+
if (td(p, y, { nodeOrigin: m, nodeExtent: E }), d.triggerFitView) {
|
|
5516
5517
|
let k = x;
|
|
5517
5518
|
!x && _ && (k = N({
|
|
5518
5519
|
...b,
|
|
@@ -5593,8 +5594,8 @@ const Th = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5593
5594
|
const { edges: h, nodes: p, nodeLookup: y, triggerNodeChanges: _, triggerEdgeChanges: x } = f(), b = l || p, w = d || h, m = b.map((A) => {
|
|
5594
5595
|
const N = y.get(A.id);
|
|
5595
5596
|
return N && (N.selected = !1), ze(A.id, !1);
|
|
5596
|
-
}),
|
|
5597
|
-
_(m), x(
|
|
5597
|
+
}), E = w.map((A) => ze(A.id, !1));
|
|
5598
|
+
_(m), x(E);
|
|
5598
5599
|
},
|
|
5599
5600
|
setMinZoom: (l) => {
|
|
5600
5601
|
const { panZoom: d, maxZoom: h } = f();
|
|
@@ -5667,8 +5668,8 @@ const Th = ie(ts), mr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5667
5668
|
},
|
|
5668
5669
|
reset: () => u({ ...mr() })
|
|
5669
5670
|
}), Object.is);
|
|
5670
|
-
function
|
|
5671
|
-
const [f] = de(() =>
|
|
5671
|
+
function Vh({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: o, initialWidth: r, initialHeight: i, fitView: s, nodeOrigin: a, nodeExtent: c, children: u }) {
|
|
5672
|
+
const [f] = de(() => Hh({
|
|
5672
5673
|
nodes: e,
|
|
5673
5674
|
edges: t,
|
|
5674
5675
|
defaultNodes: n,
|
|
@@ -5679,37 +5680,37 @@ function Hh({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: o
|
|
|
5679
5680
|
nodeOrigin: a,
|
|
5680
5681
|
nodeExtent: c
|
|
5681
5682
|
}));
|
|
5682
|
-
return P(
|
|
5683
|
+
return P(tf, { value: f, children: P(Nf, { children: u }) });
|
|
5683
5684
|
}
|
|
5684
|
-
function
|
|
5685
|
-
return wt(sn) ? P(
|
|
5685
|
+
function Oh({ children: e, nodes: t, edges: n, defaultNodes: o, defaultEdges: r, width: i, height: s, fitView: a, nodeOrigin: c, nodeExtent: u }) {
|
|
5686
|
+
return wt(sn) ? P(Se, { children: e }) : P(Vh, { initialNodes: t, initialEdges: n, defaultNodes: o, defaultEdges: r, initialWidth: i, initialHeight: s, fitView: a, nodeOrigin: c, nodeExtent: u, children: e });
|
|
5686
5687
|
}
|
|
5687
|
-
const
|
|
5688
|
+
const Bh = {
|
|
5688
5689
|
width: "100%",
|
|
5689
5690
|
height: "100%",
|
|
5690
5691
|
overflow: "hidden",
|
|
5691
5692
|
position: "relative",
|
|
5692
5693
|
zIndex: 0
|
|
5693
5694
|
};
|
|
5694
|
-
function
|
|
5695
|
-
const pn = go || "1", ra =
|
|
5696
|
-
return P("div", { "data-testid": "rf__wrapper", ...na, style: { ...Gs, ...
|
|
5697
|
-
}
|
|
5698
|
-
var
|
|
5699
|
-
const
|
|
5700
|
-
function
|
|
5701
|
-
const t = K(
|
|
5695
|
+
function Lh({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, className: r, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: u, onMove: f, onMoveStart: l, onMoveEnd: d, onConnect: h, onConnectStart: p, onConnectEnd: y, onClickConnectStart: _, onClickConnectEnd: x, onNodeMouseEnter: b, onNodeMouseMove: w, onNodeMouseLeave: m, onNodeContextMenu: E, onNodeDoubleClick: A, onNodeDragStart: N, onNodeDrag: z, onNodeDragStop: I, onNodesDelete: k, onEdgesDelete: V, onDelete: D, onSelectionChange: H, onSelectionDragStart: g, onSelectionDrag: S, onSelectionDragStop: v, onSelectionContextMenu: M, onSelectionStart: $, onSelectionEnd: C, onBeforeDelete: T, connectionMode: O, connectionLineType: L = Ie.Bezier, connectionLineStyle: Z, connectionLineComponent: X, connectionLineContainerStyle: F, deleteKeyCode: Y = "Backspace", selectionKeyCode: q = "Shift", selectionOnDrag: B = !1, selectionMode: G = gt.Full, panActivationKeyCode: ee = "Space", multiSelectionKeyCode: Q = Zt() ? "Meta" : "Control", zoomActivationKeyCode: W = Zt() ? "Meta" : "Control", snapToGrid: U, snapGrid: oe, onlyRenderVisibleElements: ae = !1, selectNodesOnDrag: Pe, nodesDraggable: un, nodesConnectable: ln, nodesFocusable: dn, nodeOrigin: Qe = $i, edgesFocusable: fn, edgesReconnectable: Je, elementsSelectable: je = !0, defaultViewport: hn = pf, minZoom: et = 0.5, maxZoom: tt = 2, translateExtent: Et = ht, preventScrolling: is = !0, nodeExtent: gn, defaultMarkerColor: ss = "#b1b1b7", zoomOnScroll: as = !0, zoomOnPinch: cs = !0, panOnScroll: us = !1, panOnScrollSpeed: ls = 0.5, panOnScrollMode: ds = He.Free, zoomOnDoubleClick: fs = !0, panOnDrag: hs = !0, onPaneClick: gs, onPaneMouseEnter: ps, onPaneMouseMove: ms, onPaneMouseLeave: ys, onPaneScroll: ws, onPaneContextMenu: xs, paneClickDistance: uo = 0, nodeClickDistance: vs = 0, children: _s, onReconnect: bs, onReconnectStart: Es, onReconnectEnd: Ss, onEdgeContextMenu: Ns, onEdgeDoubleClick: Cs, onEdgeMouseEnter: Ms, onEdgeMouseMove: ks, onEdgeMouseLeave: $s, reconnectRadius: Is = 10, onNodesChange: As, onEdgesChange: Ps, noDragClassName: zs = "nodrag", noWheelClassName: Ts = "nowheel", noPanClassName: lo = "nopan", fitView: fo, fitViewOptions: Ds, connectOnClick: Hs, attributionPosition: Vs, proOptions: Os, defaultEdgeOptions: Bs, elevateNodesOnSelect: Ls, elevateEdgesOnSelect: Rs, disableKeyboardA11y: ho = !1, autoPanOnConnect: Fs, autoPanOnNodeDrag: Xs, autoPanSpeed: Ys, connectionRadius: Zs, isValidConnection: Ws, onError: qs, style: Gs, id: go, nodeDragThreshold: Ks, viewport: Us, onViewportChange: Qs, width: Js, height: js, colorMode: ea = "light", debug: ta, ...na }, oa) {
|
|
5696
|
+
const pn = go || "1", ra = xf(ea);
|
|
5697
|
+
return P("div", { "data-testid": "rf__wrapper", ...na, style: { ...Gs, ...Bh }, ref: oa, className: re(["react-flow", r, ra]), id: go, children: se(Oh, { nodes: e, edges: t, width: Js, height: js, fitView: fo, nodeOrigin: Qe, nodeExtent: gn, children: [P(Dh, { onInit: u, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter: b, onNodeMouseMove: w, onNodeMouseLeave: m, onNodeContextMenu: E, onNodeDoubleClick: A, nodeTypes: i, edgeTypes: s, connectionLineType: L, connectionLineStyle: Z, connectionLineComponent: X, connectionLineContainerStyle: F, selectionKeyCode: q, selectionOnDrag: B, selectionMode: G, deleteKeyCode: Y, multiSelectionKeyCode: Q, panActivationKeyCode: ee, zoomActivationKeyCode: W, onlyRenderVisibleElements: ae, defaultViewport: hn, translateExtent: Et, minZoom: et, maxZoom: tt, preventScrolling: is, zoomOnScroll: as, zoomOnPinch: cs, zoomOnDoubleClick: fs, panOnScroll: us, panOnScrollSpeed: ls, panOnScrollMode: ds, panOnDrag: hs, onPaneClick: gs, onPaneMouseEnter: ps, onPaneMouseMove: ms, onPaneMouseLeave: ys, onPaneScroll: ws, onPaneContextMenu: xs, paneClickDistance: uo, nodeClickDistance: vs, onSelectionContextMenu: M, onSelectionStart: $, onSelectionEnd: C, onReconnect: bs, onReconnectStart: Es, onReconnectEnd: Ss, onEdgeContextMenu: Ns, onEdgeDoubleClick: Cs, onEdgeMouseEnter: Ms, onEdgeMouseMove: ks, onEdgeMouseLeave: $s, reconnectRadius: Is, defaultMarkerColor: ss, noDragClassName: zs, noWheelClassName: Ts, noPanClassName: lo, rfId: pn, disableKeyboardA11y: ho, nodeExtent: gn, viewport: Us, onViewportChange: Qs }), P(wf, { nodes: e, edges: t, defaultNodes: n, defaultEdges: o, onConnect: h, onConnectStart: p, onConnectEnd: y, onClickConnectStart: _, onClickConnectEnd: x, nodesDraggable: un, nodesConnectable: ln, nodesFocusable: dn, edgesFocusable: fn, edgesReconnectable: Je, elementsSelectable: je, elevateNodesOnSelect: Ls, elevateEdgesOnSelect: Rs, minZoom: et, maxZoom: tt, nodeExtent: gn, onNodesChange: As, onEdgesChange: Ps, snapToGrid: U, snapGrid: oe, connectionMode: O, translateExtent: Et, connectOnClick: Hs, defaultEdgeOptions: Bs, fitView: fo, fitViewOptions: Ds, onNodesDelete: k, onEdgesDelete: V, onDelete: D, onNodeDragStart: N, onNodeDrag: z, onNodeDragStop: I, onSelectionDrag: S, onSelectionDragStart: g, onSelectionDragStop: v, onMove: f, onMoveStart: l, onMoveEnd: d, noPanClassName: lo, nodeOrigin: Qe, rfId: pn, autoPanOnConnect: Fs, autoPanOnNodeDrag: Xs, autoPanSpeed: Ys, onError: qs, connectionRadius: Zs, isValidConnection: Ws, selectNodesOnDrag: Pe, nodeDragThreshold: Ks, onBeforeDelete: T, paneClickDistance: uo, debug: ta }), P(gf, { onSelectionChange: H }), _s, P(uf, { proOptions: Os, position: Vs }), P(af, { rfId: pn, disableKeyboardA11y: ho })] }) });
|
|
5698
|
+
}
|
|
5699
|
+
var wg = zi(Lh);
|
|
5700
|
+
const Rh = (e) => e.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
5701
|
+
function xg({ children: e }) {
|
|
5702
|
+
const t = K(Rh);
|
|
5702
5703
|
return t ? wr(e, t) : null;
|
|
5703
5704
|
}
|
|
5704
|
-
function
|
|
5705
|
+
function vg(e) {
|
|
5705
5706
|
const [t, n] = de(e), o = fe((r) => n((i) => Ai(r, i)), []);
|
|
5706
5707
|
return [t, n, o];
|
|
5707
5708
|
}
|
|
5708
|
-
function
|
|
5709
|
+
function _g(e) {
|
|
5709
5710
|
const [t, n] = de(e), o = fe((r) => n((i) => Pi(r, i)), []);
|
|
5710
5711
|
return [t, n, o];
|
|
5711
5712
|
}
|
|
5712
|
-
function
|
|
5713
|
+
function bg({ onStart: e, onChange: t, onEnd: n }) {
|
|
5713
5714
|
const o = te();
|
|
5714
5715
|
j(() => {
|
|
5715
5716
|
o.setState({ onViewportChangeStart: e });
|
|
@@ -5719,24 +5720,24 @@ function _g({ onStart: e, onChange: t, onEnd: n }) {
|
|
|
5719
5720
|
o.setState({ onViewportChangeEnd: n });
|
|
5720
5721
|
}, [n]);
|
|
5721
5722
|
}
|
|
5722
|
-
function
|
|
5723
|
+
function Eg(e) {
|
|
5723
5724
|
return K(fe((n) => n.nodeLookup.get(e), [e]), ne);
|
|
5724
5725
|
}
|
|
5725
|
-
function
|
|
5726
|
+
function Fh({ dimensions: e, lineWidth: t, variant: n, className: o }) {
|
|
5726
5727
|
return P("path", { strokeWidth: t, d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`, className: re(["react-flow__background-pattern", n, o]) });
|
|
5727
5728
|
}
|
|
5728
|
-
function
|
|
5729
|
+
function Xh({ radius: e, className: t }) {
|
|
5729
5730
|
return P("circle", { cx: e, cy: e, r: e, className: re(["react-flow__background-pattern", "dots", t]) });
|
|
5730
5731
|
}
|
|
5731
5732
|
var Ae;
|
|
5732
5733
|
(function(e) {
|
|
5733
5734
|
e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
|
|
5734
5735
|
})(Ae || (Ae = {}));
|
|
5735
|
-
const
|
|
5736
|
+
const Yh = {
|
|
5736
5737
|
[Ae.Dots]: 1,
|
|
5737
5738
|
[Ae.Lines]: 1,
|
|
5738
5739
|
[Ae.Cross]: 6
|
|
5739
|
-
},
|
|
5740
|
+
}, Zh = (e) => ({ transform: e.transform, patternId: `pattern-${e.rfId}` });
|
|
5740
5741
|
function ns({
|
|
5741
5742
|
id: e,
|
|
5742
5743
|
variant: t = Ae.Dots,
|
|
@@ -5752,44 +5753,44 @@ function ns({
|
|
|
5752
5753
|
className: u,
|
|
5753
5754
|
patternClassName: f
|
|
5754
5755
|
}) {
|
|
5755
|
-
const l = J(null), { transform: d, patternId: h } = K(
|
|
5756
|
-
m[0] * d[2] || 1 +
|
|
5757
|
-
m[1] * d[2] || 1 +
|
|
5756
|
+
const l = J(null), { transform: d, patternId: h } = K(Zh, ne), p = o || Yh[t], y = t === Ae.Dots, _ = t === Ae.Cross, x = Array.isArray(n) ? n : [n, n], b = [x[0] * d[2] || 1, x[1] * d[2] || 1], w = p * d[2], m = Array.isArray(i) ? i : [i, i], E = _ ? [w, w] : b, A = [
|
|
5757
|
+
m[0] * d[2] || 1 + E[0] / 2,
|
|
5758
|
+
m[1] * d[2] || 1 + E[1] / 2
|
|
5758
5759
|
], N = `${h}${e || ""}`;
|
|
5759
5760
|
return se("svg", { className: re(["react-flow__background", u]), style: {
|
|
5760
5761
|
...c,
|
|
5761
5762
|
...an,
|
|
5762
5763
|
"--xy-background-color-props": a,
|
|
5763
5764
|
"--xy-background-pattern-color-props": s
|
|
5764
|
-
}, ref: l, "data-testid": "rf__background", children: [P("pattern", { id: N, x: d[0] % b[0], y: d[1] % b[1], width: b[0], height: b[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${A[0]},-${A[1]})`, children: y ? P(
|
|
5765
|
+
}, ref: l, "data-testid": "rf__background", children: [P("pattern", { id: N, x: d[0] % b[0], y: d[1] % b[1], width: b[0], height: b[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${A[0]},-${A[1]})`, children: y ? P(Xh, { radius: w / 2, className: f }) : P(Fh, { dimensions: E, lineWidth: r, variant: t, className: f }) }), P("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${N})` })] });
|
|
5765
5766
|
}
|
|
5766
5767
|
ns.displayName = "Background";
|
|
5767
5768
|
const Sg = ie(ns);
|
|
5768
|
-
function
|
|
5769
|
+
function Wh() {
|
|
5769
5770
|
return P("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", children: P("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" }) });
|
|
5770
5771
|
}
|
|
5771
|
-
function
|
|
5772
|
+
function qh() {
|
|
5772
5773
|
return P("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 5", children: P("path", { d: "M0 0h32v4.2H0z" }) });
|
|
5773
5774
|
}
|
|
5774
|
-
function
|
|
5775
|
+
function Gh() {
|
|
5775
5776
|
return P("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 30", children: P("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" }) });
|
|
5776
5777
|
}
|
|
5777
|
-
function
|
|
5778
|
+
function Kh() {
|
|
5778
5779
|
return P("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: P("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" }) });
|
|
5779
5780
|
}
|
|
5780
|
-
function
|
|
5781
|
+
function Uh() {
|
|
5781
5782
|
return P("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: P("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" }) });
|
|
5782
5783
|
}
|
|
5783
5784
|
function Pt({ children: e, className: t, ...n }) {
|
|
5784
5785
|
return P("button", { type: "button", className: re(["react-flow__controls-button", t]), ...n, children: e });
|
|
5785
5786
|
}
|
|
5786
|
-
const
|
|
5787
|
+
const Qh = (e) => ({
|
|
5787
5788
|
isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
|
|
5788
5789
|
minZoomReached: e.transform[2] <= e.minZoom,
|
|
5789
5790
|
maxZoomReached: e.transform[2] >= e.maxZoom
|
|
5790
5791
|
});
|
|
5791
5792
|
function os({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: o = !0, fitViewOptions: r, onZoomIn: i, onZoomOut: s, onFitView: a, onInteractiveChange: c, className: u, children: f, position: l = "bottom-left", orientation: d = "vertical", "aria-label": h = "React Flow controls" }) {
|
|
5792
|
-
const p = te(), { isInteractive: y, minZoomReached: _, maxZoomReached: x } = K(
|
|
5793
|
+
const p = te(), { isInteractive: y, minZoomReached: _, maxZoomReached: x } = K(Qh, ne), { zoomIn: b, zoomOut: w, fitView: m } = so(), E = () => {
|
|
5793
5794
|
b(), i?.();
|
|
5794
5795
|
}, A = () => {
|
|
5795
5796
|
w(), s?.();
|
|
@@ -5802,11 +5803,11 @@ function os({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
5802
5803
|
elementsSelectable: !y
|
|
5803
5804
|
}), c?.(!y);
|
|
5804
5805
|
};
|
|
5805
|
-
return se(io, { className: re(["react-flow__controls", d === "horizontal" ? "horizontal" : "vertical", u]), position: l, style: e, "data-testid": "rf__controls", "aria-label": h, children: [t && se(
|
|
5806
|
+
return se(io, { className: re(["react-flow__controls", d === "horizontal" ? "horizontal" : "vertical", u]), position: l, style: e, "data-testid": "rf__controls", "aria-label": h, children: [t && se(Se, { children: [P(Pt, { onClick: E, className: "react-flow__controls-zoomin", title: "zoom in", "aria-label": "zoom in", disabled: x, children: P(Wh, {}) }), P(Pt, { onClick: A, className: "react-flow__controls-zoomout", title: "zoom out", "aria-label": "zoom out", disabled: _, children: P(qh, {}) })] }), n && P(Pt, { className: "react-flow__controls-fitview", onClick: N, title: "fit view", "aria-label": "fit view", children: P(Gh, {}) }), o && P(Pt, { className: "react-flow__controls-interactive", onClick: z, title: "toggle interactivity", "aria-label": "toggle interactivity", children: y ? P(Uh, {}) : P(Kh, {}) }), f] });
|
|
5806
5807
|
}
|
|
5807
5808
|
os.displayName = "Controls";
|
|
5808
5809
|
ie(os);
|
|
5809
|
-
function
|
|
5810
|
+
function Jh({ id: e, x: t, y: n, width: o, height: r, style: i, color: s, strokeColor: a, strokeWidth: c, className: u, borderRadius: f, shapeRendering: l, selected: d, onClick: h }) {
|
|
5810
5811
|
const { background: p, backgroundColor: y } = i || {}, _ = s || p || y;
|
|
5811
5812
|
return P("rect", { className: re(["react-flow__minimap-node", { selected: d }, u]), x: t, y: n, rx: f, ry: f, width: o, height: r, style: {
|
|
5812
5813
|
fill: _,
|
|
@@ -5814,8 +5815,8 @@ function Qh({ id: e, x: t, y: n, width: o, height: r, style: i, color: s, stroke
|
|
|
5814
5815
|
strokeWidth: c
|
|
5815
5816
|
}, shapeRendering: l, onClick: h ? (x) => h(x, e) : void 0 });
|
|
5816
5817
|
}
|
|
5817
|
-
const
|
|
5818
|
-
function
|
|
5818
|
+
const jh = ie(Jh), eg = (e) => e.nodes.map((t) => t.id), Nn = (e) => e instanceof Function ? e : () => e;
|
|
5819
|
+
function tg({
|
|
5819
5820
|
nodeStrokeColor: e,
|
|
5820
5821
|
nodeColor: t,
|
|
5821
5822
|
nodeClassName: n = "",
|
|
@@ -5823,20 +5824,20 @@ function eg({
|
|
|
5823
5824
|
nodeStrokeWidth: r,
|
|
5824
5825
|
// We need to rename the prop to be `CapitalCase` so that JSX will render it as
|
|
5825
5826
|
// a component properly.
|
|
5826
|
-
nodeComponent: i =
|
|
5827
|
+
nodeComponent: i = jh,
|
|
5827
5828
|
onClick: s
|
|
5828
5829
|
}) {
|
|
5829
|
-
const a = K(
|
|
5830
|
-
return P(
|
|
5830
|
+
const a = K(eg, ne), c = Nn(t), u = Nn(e), f = Nn(n), l = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
5831
|
+
return P(Se, { children: a.map((d) => (
|
|
5831
5832
|
// The split of responsibilities between MiniMapNodes and
|
|
5832
5833
|
// NodeComponentWrapper may appear weird. However, it’s designed to
|
|
5833
5834
|
// minimize the cost of updates when individual nodes change.
|
|
5834
5835
|
//
|
|
5835
5836
|
// For more details, see a similar commit in `NodeRenderer/index.tsx`.
|
|
5836
|
-
P(
|
|
5837
|
+
P(og, { id: d, nodeColorFunc: c, nodeStrokeColorFunc: u, nodeClassNameFunc: f, nodeBorderRadius: o, nodeStrokeWidth: r, NodeComponent: i, onClick: s, shapeRendering: l }, d)
|
|
5837
5838
|
)) });
|
|
5838
5839
|
}
|
|
5839
|
-
function
|
|
5840
|
+
function ng({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: o, nodeBorderRadius: r, nodeStrokeWidth: i, shapeRendering: s, NodeComponent: a, onClick: c }) {
|
|
5840
5841
|
const { node: u, x: f, y: l, width: d, height: h } = K((p) => {
|
|
5841
5842
|
const y = p.nodeLookup.get(e), { x: _, y: x } = y.internals.positionAbsolute, { width: b, height: w } = Ce(y);
|
|
5842
5843
|
return {
|
|
@@ -5849,9 +5850,9 @@ function tg({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
|
|
|
5849
5850
|
}, ne);
|
|
5850
5851
|
return !u || u.hidden || !ii(u) ? null : P(a, { x: f, y: l, width: d, height: h, style: u.style, selected: !!u.selected, className: o(u), color: t(u), borderRadius: r, strokeColor: n(u), strokeWidth: i, shapeRendering: s, onClick: c, id: u.id });
|
|
5851
5852
|
}
|
|
5852
|
-
const
|
|
5853
|
-
var
|
|
5854
|
-
const
|
|
5853
|
+
const og = ie(ng);
|
|
5854
|
+
var rg = ie(tg);
|
|
5855
|
+
const ig = 200, sg = 150, ag = (e) => {
|
|
5855
5856
|
const t = {
|
|
5856
5857
|
x: -e.transform[0] / e.transform[2],
|
|
5857
5858
|
y: -e.transform[1] / e.transform[2],
|
|
@@ -5867,7 +5868,7 @@ const rg = 200, ig = 150, sg = (e) => {
|
|
|
5867
5868
|
flowWidth: e.width,
|
|
5868
5869
|
flowHeight: e.height
|
|
5869
5870
|
};
|
|
5870
|
-
},
|
|
5871
|
+
}, cg = "react-flow__minimap-desc";
|
|
5871
5872
|
function rs({
|
|
5872
5873
|
style: e,
|
|
5873
5874
|
className: t,
|
|
@@ -5893,13 +5894,13 @@ function rs({
|
|
|
5893
5894
|
zoomStep: w = 10,
|
|
5894
5895
|
offsetScale: m = 5
|
|
5895
5896
|
}) {
|
|
5896
|
-
const
|
|
5897
|
+
const E = te(), A = J(null), { boundingRect: N, viewBB: z, rfId: I, panZoom: k, translateExtent: V, flowWidth: D, flowHeight: H } = K(ag, ne), g = e?.width ?? ig, S = e?.height ?? sg, v = N.width / g, M = N.height / S, $ = Math.max(v, M), C = $ * g, T = $ * S, O = m * $, L = N.x - (C - N.width) / 2 - O, Z = N.y - (T - N.height) / 2 - O, X = C + O * 2, F = T + O * 2, Y = `${cg}-${I}`, q = J(0), B = J();
|
|
5897
5898
|
q.current = $, j(() => {
|
|
5898
5899
|
if (A.current && k)
|
|
5899
5900
|
return B.current = hd({
|
|
5900
5901
|
domNode: A.current,
|
|
5901
5902
|
panZoom: k,
|
|
5902
|
-
getTransform: () =>
|
|
5903
|
+
getTransform: () => E.getState().transform,
|
|
5903
5904
|
getViewScale: () => q.current
|
|
5904
5905
|
}), () => {
|
|
5905
5906
|
B.current?.destroy();
|
|
@@ -5919,7 +5920,7 @@ function rs({
|
|
|
5919
5920
|
const [W, U] = B.current?.pointer(Q) || [0, 0];
|
|
5920
5921
|
h(Q, { x: W, y: U });
|
|
5921
5922
|
} : void 0, ee = p ? fe((Q, W) => {
|
|
5922
|
-
const U =
|
|
5923
|
+
const U = E.getState().nodeLookup.get(W);
|
|
5923
5924
|
p(Q, U);
|
|
5924
5925
|
}, []) : void 0;
|
|
5925
5926
|
return P(io, { position: d, style: {
|
|
@@ -5931,33 +5932,33 @@ function rs({
|
|
|
5931
5932
|
"--xy-minimap-node-background-color-props": typeof o == "string" ? o : void 0,
|
|
5932
5933
|
"--xy-minimap-node-stroke-color-props": typeof n == "string" ? n : void 0,
|
|
5933
5934
|
"--xy-minimap-node-stroke-width-props": typeof s == "string" ? s : void 0
|
|
5934
|
-
}, className: re(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: se("svg", { width: g, height:
|
|
5935
|
+
}, className: re(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: se("svg", { width: g, height: S, viewBox: `${L} ${Z} ${X} ${F}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": Y, ref: A, onClick: G, children: [x && P("title", { id: Y, children: x }), P(rg, { onClick: ee, nodeColor: o, nodeStrokeColor: n, nodeBorderRadius: i, nodeClassName: r, nodeStrokeWidth: s, nodeComponent: a }), P("path", { className: "react-flow__minimap-mask", d: `M${L - O},${Z - O}h${X + O * 2}v${F + O * 2}h${-X - O * 2}z
|
|
5935
5936
|
M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
5936
5937
|
}
|
|
5937
5938
|
rs.displayName = "MiniMap";
|
|
5938
5939
|
ie(rs);
|
|
5939
|
-
function
|
|
5940
|
-
const _ = co(), x = typeof e == "string" ? e : _, b = te(), w = J(null), m = n === at.Line ? "right" : "bottom-right",
|
|
5940
|
+
function ug({ nodeId: e, position: t, variant: n = at.Handle, className: o, style: r = {}, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: u = Number.MAX_VALUE, maxHeight: f = Number.MAX_VALUE, keepAspectRatio: l = !1, shouldResize: d, onResizeStart: h, onResize: p, onResizeEnd: y }) {
|
|
5941
|
+
const _ = co(), x = typeof e == "string" ? e : _, b = te(), w = J(null), m = n === at.Line ? "right" : "bottom-right", E = t ?? m, A = J(null);
|
|
5941
5942
|
j(() => {
|
|
5942
5943
|
if (!(!w.current || !x))
|
|
5943
5944
|
return A.current || (A.current = kd({
|
|
5944
5945
|
domNode: w.current,
|
|
5945
5946
|
nodeId: x,
|
|
5946
5947
|
getStoreItems: () => {
|
|
5947
|
-
const { nodeLookup: k, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: g, domNode:
|
|
5948
|
+
const { nodeLookup: k, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: g, domNode: S } = b.getState();
|
|
5948
5949
|
return {
|
|
5949
5950
|
nodeLookup: k,
|
|
5950
5951
|
transform: V,
|
|
5951
5952
|
snapGrid: D,
|
|
5952
5953
|
snapToGrid: H,
|
|
5953
5954
|
nodeOrigin: g,
|
|
5954
|
-
paneDomNode:
|
|
5955
|
+
paneDomNode: S
|
|
5955
5956
|
};
|
|
5956
5957
|
},
|
|
5957
5958
|
onChange: (k, V) => {
|
|
5958
|
-
const { triggerNodeChanges: D, nodeLookup: H, parentLookup: g, nodeOrigin:
|
|
5959
|
+
const { triggerNodeChanges: D, nodeLookup: H, parentLookup: g, nodeOrigin: S } = b.getState(), v = [], M = { x: k.x, y: k.y }, $ = H.get(x);
|
|
5959
5960
|
if ($ && $.expandParent && $.parentId) {
|
|
5960
|
-
const C = $.origin ??
|
|
5961
|
+
const C = $.origin ?? S, T = k.width ?? $.measured.width, O = k.height ?? $.measured.height, L = {
|
|
5961
5962
|
id: $.id,
|
|
5962
5963
|
parentId: $.parentId,
|
|
5963
5964
|
rect: {
|
|
@@ -5968,7 +5969,7 @@ function cg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
5968
5969
|
y: k.y ?? $.position.y
|
|
5969
5970
|
}, { width: T, height: O }, $.parentId, H, C)
|
|
5970
5971
|
}
|
|
5971
|
-
}, Z = no([L], H, g,
|
|
5972
|
+
}, Z = no([L], H, g, S);
|
|
5972
5973
|
v.push(...Z), M.x = k.x ? Math.max(C[0] * T, k.x) : void 0, M.y = k.y ? Math.max(C[1] * O, k.y) : void 0;
|
|
5973
5974
|
}
|
|
5974
5975
|
if (M.x !== void 0 && M.y !== void 0) {
|
|
@@ -6010,7 +6011,7 @@ function cg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6010
6011
|
b.getState().triggerNodeChanges([k]);
|
|
6011
6012
|
}
|
|
6012
6013
|
})), A.current.update({
|
|
6013
|
-
controlPosition:
|
|
6014
|
+
controlPosition: E,
|
|
6014
6015
|
boundaries: {
|
|
6015
6016
|
minWidth: a,
|
|
6016
6017
|
minHeight: c,
|
|
@@ -6026,7 +6027,7 @@ function cg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6026
6027
|
A.current?.destroy();
|
|
6027
6028
|
};
|
|
6028
6029
|
}, [
|
|
6029
|
-
|
|
6030
|
+
E,
|
|
6030
6031
|
a,
|
|
6031
6032
|
c,
|
|
6032
6033
|
u,
|
|
@@ -6037,68 +6038,68 @@ function cg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6037
6038
|
y,
|
|
6038
6039
|
d
|
|
6039
6040
|
]);
|
|
6040
|
-
const N =
|
|
6041
|
+
const N = E.split("-"), z = n === at.Line ? "borderColor" : "backgroundColor", I = s ? { ...r, [z]: s } : r;
|
|
6041
6042
|
return P("div", { className: re(["react-flow__resize-control", "nodrag", ...N, n, o]), ref: w, style: I, children: i });
|
|
6042
6043
|
}
|
|
6043
|
-
ie(
|
|
6044
|
-
const
|
|
6045
|
-
function
|
|
6046
|
-
const t = K(
|
|
6044
|
+
ie(ug);
|
|
6045
|
+
const lg = (e) => e.domNode?.querySelector(".react-flow__renderer");
|
|
6046
|
+
function dg({ children: e }) {
|
|
6047
|
+
const t = K(lg);
|
|
6047
6048
|
return t ? wr(e, t) : null;
|
|
6048
6049
|
}
|
|
6049
|
-
const
|
|
6050
|
+
const fg = (e, t) => e?.internals.positionAbsolute.x !== t?.internals.positionAbsolute.x || e?.internals.positionAbsolute.y !== t?.internals.positionAbsolute.y || e?.measured.width !== t?.measured.width || e?.measured.height !== t?.measured.height || e?.selected !== t?.selected || e?.internals.z !== t?.internals.z, hg = (e, t) => {
|
|
6050
6051
|
if (e.size !== t.size)
|
|
6051
6052
|
return !1;
|
|
6052
6053
|
for (const [n, o] of e)
|
|
6053
|
-
if (
|
|
6054
|
+
if (fg(o, t.get(n)))
|
|
6054
6055
|
return !1;
|
|
6055
6056
|
return !0;
|
|
6056
|
-
},
|
|
6057
|
+
}, gg = (e) => ({
|
|
6057
6058
|
x: e.transform[0],
|
|
6058
6059
|
y: e.transform[1],
|
|
6059
6060
|
zoom: e.transform[2],
|
|
6060
6061
|
selectedNodesCount: e.nodes.filter((t) => t.selected).length
|
|
6061
6062
|
});
|
|
6062
|
-
function
|
|
6063
|
-
const u = co(), f = fe((
|
|
6064
|
-
const k =
|
|
6063
|
+
function Ng({ nodeId: e, children: t, className: n, style: o, isVisible: r, position: i = R.Top, offset: s = 10, align: a = "center", ...c }) {
|
|
6064
|
+
const u = co(), f = fe((E) => (Array.isArray(e) ? e : [e || u || ""]).reduce((z, I) => {
|
|
6065
|
+
const k = E.nodeLookup.get(I);
|
|
6065
6066
|
return k && z.set(k.id, k), z;
|
|
6066
|
-
}, /* @__PURE__ */ new Map()), [e, u]), l = K(f,
|
|
6067
|
+
}, /* @__PURE__ */ new Map()), [e, u]), l = K(f, hg), { x: d, y: h, zoom: p, selectedNodesCount: y } = K(gg, ne);
|
|
6067
6068
|
if (!(typeof r == "boolean" ? r : l.size === 1 && l.values().next().value.selected && y === 1) || !l.size)
|
|
6068
6069
|
return null;
|
|
6069
|
-
const x = Ue(l), b = Array.from(l.values()), w = Math.max(...b.map((
|
|
6070
|
+
const x = Ue(l), b = Array.from(l.values()), w = Math.max(...b.map((E) => E.internals.z + 1)), m = {
|
|
6070
6071
|
position: "absolute",
|
|
6071
6072
|
transform: jl(x, { x: d, y: h, zoom: p }, i, s, a),
|
|
6072
6073
|
zIndex: w,
|
|
6073
6074
|
...o
|
|
6074
6075
|
};
|
|
6075
|
-
return P(
|
|
6076
|
+
return P(dg, { children: P("div", { style: m, className: re(["react-flow__node-toolbar", n]), ...c, "data-id": b.reduce((E, A) => `${E}${A.id} `, "").trim(), children: t }) });
|
|
6076
6077
|
}
|
|
6077
6078
|
export {
|
|
6078
6079
|
cn as B,
|
|
6079
|
-
|
|
6080
|
+
xg as E,
|
|
6080
6081
|
Wt as H,
|
|
6081
|
-
|
|
6082
|
+
Ng as N,
|
|
6082
6083
|
R as P,
|
|
6083
|
-
|
|
6084
|
-
|
|
6084
|
+
Vh as R,
|
|
6085
|
+
_g as a,
|
|
6085
6086
|
Sg as b,
|
|
6086
6087
|
Ae as c,
|
|
6087
|
-
|
|
6088
|
-
|
|
6088
|
+
te as d,
|
|
6089
|
+
K as e,
|
|
6089
6090
|
so as f,
|
|
6090
|
-
|
|
6091
|
+
Eg as g,
|
|
6091
6092
|
Ce as h,
|
|
6092
|
-
|
|
6093
|
-
|
|
6093
|
+
wg as i,
|
|
6094
|
+
bg as j,
|
|
6094
6095
|
sa as k,
|
|
6095
|
-
|
|
6096
|
+
Pi as l,
|
|
6096
6097
|
Ai as m,
|
|
6097
|
-
|
|
6098
|
+
Jn as n,
|
|
6098
6099
|
oi as o,
|
|
6099
6100
|
en as p,
|
|
6100
6101
|
qe as q,
|
|
6101
6102
|
li as r,
|
|
6102
6103
|
io as s,
|
|
6103
|
-
|
|
6104
|
+
vg as u
|
|
6104
6105
|
};
|