likec4 1.24.0 → 1.25.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/__app__/index.html +1 -1
- package/__app__/src/chunks/{-index-overview-fhfhEsGb.js → -index-overview-BQqR8e0d.js} +4 -4
- package/__app__/src/chunks/{index-B1tnNgDX.js → index-C6pszJh8.js} +164 -160
- package/__app__/src/chunks/{likec4-DgZMMrvs.js → likec4-DRDnYFvy.js} +841 -839
- package/__app__/src/chunks/{main-DiEdSc7f.js → main-iM8EmCL0.js} +7101 -6854
- package/__app__/src/chunks/{mantine-Dy50iVbn.js → mantine-B7q9iXnB.js} +98 -96
- package/__app__/src/chunks/{tanstack-router-B97XgOdm.js → tanstack-router-MjA2OK6n.js} +1 -1
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +20 -20
- package/dist/index.d.mts +201 -199
- package/dist/index.d.ts +201 -199
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.DNjEPXYD.mjs → likec4.DX7xzn9M.mjs} +1461 -1458
- package/package.json +25 -26
- package/react/index.d.ts +33 -1
- package/react/index.js +1489 -1249
- package/react/style.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Yn, { useState as fe, createContext as Zn, useCallback as ue, useMemo as me, useContext as wt, useLayoutEffect as ca, useEffect as j, forwardRef as xr, memo as ie, useRef as J } from "react";
|
|
2
|
-
import { jsx as z, jsxs as se, Fragment as
|
|
2
|
+
import { jsx as z, jsxs as se, Fragment as Ne } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as vr } from "react-dom";
|
|
4
4
|
function la(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -78,15 +78,15 @@ _r.useSyncExternalStoreWithSelector = function(e, t, n, o, r) {
|
|
|
78
78
|
function c(h) {
|
|
79
79
|
if (!l) {
|
|
80
80
|
if (l = !0, d = h, h = o(h), r !== void 0 && s.hasValue) {
|
|
81
|
-
var
|
|
82
|
-
if (r(
|
|
83
|
-
return u =
|
|
81
|
+
var g = s.value;
|
|
82
|
+
if (r(g, h))
|
|
83
|
+
return u = g;
|
|
84
84
|
}
|
|
85
85
|
return u = h;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
87
|
+
if (g = u, ba(d, h)) return g;
|
|
88
88
|
var y = o(h);
|
|
89
|
-
return r !== void 0 && r(
|
|
89
|
+
return r !== void 0 && r(g, y) ? (d = h, g) : (d = h, u = y);
|
|
90
90
|
}
|
|
91
91
|
var l = !1, d, u, f = n === void 0 ? null : n;
|
|
92
92
|
return [
|
|
@@ -341,11 +341,11 @@ function tc(e, t) {
|
|
|
341
341
|
var n = t ? ja : Ja, o = this._parents, r = this._groups;
|
|
342
342
|
typeof e != "function" && (e = Qa(e));
|
|
343
343
|
for (var i = r.length, s = new Array(i), a = new Array(i), c = new Array(i), l = 0; l < i; ++l) {
|
|
344
|
-
var d = o[l], u = r[l], f = u.length, h = nc(e.call(d, d && d.__data__, l, o)),
|
|
345
|
-
n(d, u, y,
|
|
346
|
-
for (var
|
|
347
|
-
if (w = y[
|
|
348
|
-
for (
|
|
344
|
+
var d = o[l], u = r[l], f = u.length, h = nc(e.call(d, d && d.__data__, l, o)), g = h.length, y = a[l] = new Array(g), b = s[l] = new Array(g), x = c[l] = new Array(f);
|
|
345
|
+
n(d, u, y, b, x, h, t);
|
|
346
|
+
for (var _ = 0, p = 0, w, N; _ < g; ++_)
|
|
347
|
+
if (w = y[_]) {
|
|
348
|
+
for (_ >= p && (p = _ + 1); !(N = b[p]) && ++p < g; ) ;
|
|
349
349
|
w._next = N || null;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
@@ -363,8 +363,8 @@ function rc(e, t, n) {
|
|
|
363
363
|
}
|
|
364
364
|
function ic(e) {
|
|
365
365
|
for (var t = e.selection ? e.selection() : e, n = this._groups, o = t._groups, r = n.length, i = o.length, s = Math.min(r, i), a = new Array(r), c = 0; c < s; ++c)
|
|
366
|
-
for (var l = n[c], d = o[c], u = l.length, f = a[c] = new Array(u), h,
|
|
367
|
-
(h = l[
|
|
366
|
+
for (var l = n[c], d = o[c], u = l.length, f = a[c] = new Array(u), h, g = 0; g < u; ++g)
|
|
367
|
+
(h = l[g] || d[g]) && (f[g] = h);
|
|
368
368
|
for (; c < r; ++c)
|
|
369
369
|
a[c] = n[c];
|
|
370
370
|
return new de(a, this._parents);
|
|
@@ -840,15 +840,15 @@ function ml() {
|
|
|
840
840
|
function Vr() {
|
|
841
841
|
var e = hl, t = gl, n = pl, o = ml, r = {}, i = Kt("start", "drag", "end"), s = 0, a, c, l, d, u = 0;
|
|
842
842
|
function f(w) {
|
|
843
|
-
w.on("mousedown.drag", h).filter(o).on("touchstart.drag",
|
|
843
|
+
w.on("mousedown.drag", h).filter(o).on("touchstart.drag", b).on("touchmove.drag", x, fl).on("touchend.drag touchcancel.drag", _).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
844
844
|
}
|
|
845
845
|
function h(w, N) {
|
|
846
846
|
if (!(d || !e.call(this, w, N))) {
|
|
847
|
-
var k =
|
|
848
|
-
k && (le(w.view).on("mousemove.drag",
|
|
847
|
+
var k = p(this, t.call(this, w, N), w, N, "mouse");
|
|
848
|
+
k && (le(w.view).on("mousemove.drag", g, ct).on("mouseup.drag", y, ct), Dr(w.view), wn(w), l = !1, a = w.clientX, c = w.clientY, k("start", w));
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function g(w) {
|
|
852
852
|
if (Be(w), !l) {
|
|
853
853
|
var N = w.clientX - a, k = w.clientY - c;
|
|
854
854
|
l = N * N + k * k > u;
|
|
@@ -858,11 +858,11 @@ function Vr() {
|
|
|
858
858
|
function y(w) {
|
|
859
859
|
le(w.view).on("mousemove.drag mouseup.drag", null), Hr(w.view, l), Be(w), r.mouse("end", w);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function b(w, N) {
|
|
862
862
|
if (e.call(this, w, N)) {
|
|
863
863
|
var k = w.changedTouches, S = t.call(this, w, N), P = k.length, I, A;
|
|
864
864
|
for (I = 0; I < P; ++I)
|
|
865
|
-
(A =
|
|
865
|
+
(A = p(this, S, w, N, k[I].identifier, k[I])) && (wn(w), A("start", w, k[I]));
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
function x(w) {
|
|
@@ -870,16 +870,16 @@ function Vr() {
|
|
|
870
870
|
for (S = 0; S < k; ++S)
|
|
871
871
|
(P = r[N[S].identifier]) && (Be(w), P("drag", w, N[S]));
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function _(w) {
|
|
874
874
|
var N = w.changedTouches, k = N.length, S, P;
|
|
875
875
|
for (d && clearTimeout(d), d = setTimeout(function() {
|
|
876
876
|
d = null;
|
|
877
877
|
}, 500), S = 0; S < k; ++S)
|
|
878
878
|
(P = r[N[S].identifier]) && (wn(w), P("end", w, N[S]));
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
var A = i.copy(), V = he(I || k, N), D, H,
|
|
882
|
-
if ((
|
|
880
|
+
function p(w, N, k, S, P, I) {
|
|
881
|
+
var A = i.copy(), V = he(I || k, N), D, H, m;
|
|
882
|
+
if ((m = n.call(w, new kn("beforestart", {
|
|
883
883
|
sourceEvent: k,
|
|
884
884
|
target: f,
|
|
885
885
|
identifier: P,
|
|
@@ -890,8 +890,8 @@ function Vr() {
|
|
|
890
890
|
dy: 0,
|
|
891
891
|
dispatch: A
|
|
892
892
|
}), S)) != null)
|
|
893
|
-
return D =
|
|
894
|
-
var
|
|
893
|
+
return D = m.x - V[0] || 0, H = m.y - V[1] || 0, function E(v, C, $) {
|
|
894
|
+
var M = V, T;
|
|
895
895
|
switch (v) {
|
|
896
896
|
case "start":
|
|
897
897
|
r[P] = E, T = s++;
|
|
@@ -899,22 +899,22 @@ function Vr() {
|
|
|
899
899
|
case "end":
|
|
900
900
|
delete r[P], --s;
|
|
901
901
|
case "drag":
|
|
902
|
-
V = he($ ||
|
|
902
|
+
V = he($ || C, N), T = s;
|
|
903
903
|
break;
|
|
904
904
|
}
|
|
905
905
|
A.call(
|
|
906
906
|
v,
|
|
907
907
|
w,
|
|
908
908
|
new kn(v, {
|
|
909
|
-
sourceEvent:
|
|
910
|
-
subject:
|
|
909
|
+
sourceEvent: C,
|
|
910
|
+
subject: m,
|
|
911
911
|
target: f,
|
|
912
912
|
identifier: P,
|
|
913
913
|
active: T,
|
|
914
914
|
x: V[0] + D,
|
|
915
915
|
y: V[1] + H,
|
|
916
|
-
dx: V[0] -
|
|
917
|
-
dy: V[1] -
|
|
916
|
+
dx: V[0] - M[0],
|
|
917
|
+
dy: V[1] - M[1],
|
|
918
918
|
dispatch: A
|
|
919
919
|
}),
|
|
920
920
|
S
|
|
@@ -1323,10 +1323,10 @@ function Xr(e, t, n, o) {
|
|
|
1323
1323
|
function r(l) {
|
|
1324
1324
|
return l.length ? l.pop() + " " : "";
|
|
1325
1325
|
}
|
|
1326
|
-
function i(l, d, u, f, h,
|
|
1326
|
+
function i(l, d, u, f, h, g) {
|
|
1327
1327
|
if (l !== u || d !== f) {
|
|
1328
1328
|
var y = h.push("translate(", null, t, null, n);
|
|
1329
|
-
|
|
1329
|
+
g.push({ i: y - 4, x: $e(l, u) }, { i: y - 2, x: $e(d, f) });
|
|
1330
1330
|
} else (u || f) && h.push("translate(" + u + t + f + n);
|
|
1331
1331
|
}
|
|
1332
1332
|
function s(l, d, u, f) {
|
|
@@ -1335,16 +1335,16 @@ function Xr(e, t, n, o) {
|
|
|
1335
1335
|
function a(l, d, u, f) {
|
|
1336
1336
|
l !== d ? f.push({ i: u.push(r(u) + "skewX(", null, o) - 2, x: $e(l, d) }) : d && u.push(r(u) + "skewX(" + d + o);
|
|
1337
1337
|
}
|
|
1338
|
-
function c(l, d, u, f, h,
|
|
1338
|
+
function c(l, d, u, f, h, g) {
|
|
1339
1339
|
if (l !== u || d !== f) {
|
|
1340
1340
|
var y = h.push(r(h) + "scale(", null, ",", null, ")");
|
|
1341
|
-
|
|
1341
|
+
g.push({ i: y - 4, x: $e(l, u) }, { i: y - 2, x: $e(d, f) });
|
|
1342
1342
|
} else (u !== 1 || f !== 1) && h.push(r(h) + "scale(" + u + "," + f + ")");
|
|
1343
1343
|
}
|
|
1344
1344
|
return function(l, d) {
|
|
1345
1345
|
var u = [], f = [];
|
|
1346
1346
|
return l = e(l), d = e(d), i(l.translateX, l.translateY, d.translateX, d.translateY, u, f), s(l.rotate, d.rotate, u, f), a(l.skewX, d.skewX, u, f), c(l.scaleX, l.scaleY, d.scaleX, d.scaleY, u, f), l = d = null, function(h) {
|
|
1347
|
-
for (var
|
|
1347
|
+
for (var g = -1, y = f.length, b; ++g < y; ) u[(b = f[g]).i] = b.x(h);
|
|
1348
1348
|
return u.join("");
|
|
1349
1349
|
};
|
|
1350
1350
|
};
|
|
@@ -1361,27 +1361,27 @@ function Bl(e) {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
const Fl = function e(t, n, o) {
|
|
1363
1363
|
function r(i, s) {
|
|
1364
|
-
var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], h = d - a,
|
|
1364
|
+
var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], h = d - a, g = u - c, y = h * h + g * g, b, x;
|
|
1365
1365
|
if (y < Rl)
|
|
1366
|
-
x = Math.log(f / l) / t,
|
|
1366
|
+
x = Math.log(f / l) / t, b = function(S) {
|
|
1367
1367
|
return [
|
|
1368
1368
|
a + S * h,
|
|
1369
|
-
c + S *
|
|
1369
|
+
c + S * g,
|
|
1370
1370
|
l * Math.exp(t * S * x)
|
|
1371
1371
|
];
|
|
1372
1372
|
};
|
|
1373
1373
|
else {
|
|
1374
|
-
var
|
|
1375
|
-
x = (k - N) / t,
|
|
1376
|
-
var P = S * x, I = $o(N), A = l / (n *
|
|
1374
|
+
var _ = Math.sqrt(y), p = (f * f - l * l + o * y) / (2 * l * n * _), w = (f * f - l * l - o * y) / (2 * f * n * _), N = Math.log(Math.sqrt(p * p + 1) - p), k = Math.log(Math.sqrt(w * w + 1) - w);
|
|
1375
|
+
x = (k - N) / t, b = function(S) {
|
|
1376
|
+
var P = S * x, I = $o(N), A = l / (n * _) * (I * Bl(t * P + N) - Ll(N));
|
|
1377
1377
|
return [
|
|
1378
1378
|
a + A * h,
|
|
1379
|
-
c + A *
|
|
1379
|
+
c + A * g,
|
|
1380
1380
|
l * I / $o(t * P + N)
|
|
1381
1381
|
];
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
|
-
return
|
|
1384
|
+
return b.duration = x * 1e3 * t / Math.SQRT2, b;
|
|
1385
1385
|
}
|
|
1386
1386
|
return r.rho = function(i) {
|
|
1387
1387
|
var s = Math.max(1e-3, +i), a = s * s, c = a * a;
|
|
@@ -1476,7 +1476,7 @@ function Jn(e, t) {
|
|
|
1476
1476
|
if (n.state > qr) throw new Error("too late; already scheduled");
|
|
1477
1477
|
return n;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1479
|
+
function ve(e, t) {
|
|
1480
1480
|
var n = ye(e, t);
|
|
1481
1481
|
if (n.state > Tt) throw new Error("too late; already running");
|
|
1482
1482
|
return n;
|
|
@@ -1541,7 +1541,7 @@ function Ul(e) {
|
|
|
1541
1541
|
function Ql(e, t) {
|
|
1542
1542
|
var n, o;
|
|
1543
1543
|
return function() {
|
|
1544
|
-
var r =
|
|
1544
|
+
var r = ve(this, e), i = r.tween;
|
|
1545
1545
|
if (i !== n) {
|
|
1546
1546
|
o = n = i;
|
|
1547
1547
|
for (var s = 0, a = o.length; s < a; ++s)
|
|
@@ -1557,7 +1557,7 @@ function Jl(e, t, n) {
|
|
|
1557
1557
|
var o, r;
|
|
1558
1558
|
if (typeof n != "function") throw new Error();
|
|
1559
1559
|
return function() {
|
|
1560
|
-
var i =
|
|
1560
|
+
var i = ve(this, e), s = i.tween;
|
|
1561
1561
|
if (s !== o) {
|
|
1562
1562
|
r = (o = s).slice();
|
|
1563
1563
|
for (var a = { name: t, value: n }, c = 0, l = r.length; c < l; ++c)
|
|
@@ -1583,7 +1583,7 @@ function jl(e, t) {
|
|
|
1583
1583
|
function jn(e, t, n) {
|
|
1584
1584
|
var o = e._id;
|
|
1585
1585
|
return e.each(function() {
|
|
1586
|
-
var r =
|
|
1586
|
+
var r = ve(this, o);
|
|
1587
1587
|
(r.value || (r.value = {}))[t] = n.apply(this, arguments);
|
|
1588
1588
|
}), function(r) {
|
|
1589
1589
|
return ye(r, o).value[t];
|
|
@@ -1685,12 +1685,12 @@ function gu(e) {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
function pu(e, t) {
|
|
1687
1687
|
return function() {
|
|
1688
|
-
|
|
1688
|
+
ve(this, e).duration = +t.apply(this, arguments);
|
|
1689
1689
|
};
|
|
1690
1690
|
}
|
|
1691
1691
|
function mu(e, t) {
|
|
1692
1692
|
return t = +t, function() {
|
|
1693
|
-
|
|
1693
|
+
ve(this, e).duration = t;
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
1696
|
function yu(e) {
|
|
@@ -1700,7 +1700,7 @@ function yu(e) {
|
|
|
1700
1700
|
function wu(e, t) {
|
|
1701
1701
|
if (typeof t != "function") throw new Error();
|
|
1702
1702
|
return function() {
|
|
1703
|
-
|
|
1703
|
+
ve(this, e).ease = t;
|
|
1704
1704
|
};
|
|
1705
1705
|
}
|
|
1706
1706
|
function xu(e) {
|
|
@@ -1711,7 +1711,7 @@ function vu(e, t) {
|
|
|
1711
1711
|
return function() {
|
|
1712
1712
|
var n = t.apply(this, arguments);
|
|
1713
1713
|
if (typeof n != "function") throw new Error();
|
|
1714
|
-
|
|
1714
|
+
ve(this, e).ease = n;
|
|
1715
1715
|
};
|
|
1716
1716
|
}
|
|
1717
1717
|
function _u(e) {
|
|
@@ -1723,7 +1723,7 @@ function bu(e) {
|
|
|
1723
1723
|
for (var t = this._groups, n = t.length, o = new Array(n), r = 0; r < n; ++r)
|
|
1724
1724
|
for (var i = t[r], s = i.length, a = o[r] = [], c, l = 0; l < s; ++l)
|
|
1725
1725
|
(c = i[l]) && e.call(c, c.__data__, l, i) && a.push(c);
|
|
1726
|
-
return new
|
|
1726
|
+
return new Se(o, this._parents, this._name, this._id);
|
|
1727
1727
|
}
|
|
1728
1728
|
function Eu(e) {
|
|
1729
1729
|
if (e._id !== this._id) throw new Error();
|
|
@@ -1732,7 +1732,7 @@ function Eu(e) {
|
|
|
1732
1732
|
(f = c[h] || l[h]) && (u[h] = f);
|
|
1733
1733
|
for (; a < o; ++a)
|
|
1734
1734
|
s[a] = t[a];
|
|
1735
|
-
return new
|
|
1735
|
+
return new Se(s, this._parents, this._name, this._id);
|
|
1736
1736
|
}
|
|
1737
1737
|
function Su(e) {
|
|
1738
1738
|
return (e + "").trim().split(/^|\s+/).every(function(t) {
|
|
@@ -1741,7 +1741,7 @@ function Su(e) {
|
|
|
1741
1741
|
});
|
|
1742
1742
|
}
|
|
1743
1743
|
function Nu(e, t, n) {
|
|
1744
|
-
var o, r, i = Su(t) ? Jn :
|
|
1744
|
+
var o, r, i = Su(t) ? Jn : ve;
|
|
1745
1745
|
return function() {
|
|
1746
1746
|
var s = i(this, e), a = s.on;
|
|
1747
1747
|
a !== o && (r = (o = a).copy()).on(t, n), s.on = r;
|
|
@@ -1767,7 +1767,7 @@ function $u(e) {
|
|
|
1767
1767
|
for (var o = this._groups, r = o.length, i = new Array(r), s = 0; s < r; ++s)
|
|
1768
1768
|
for (var a = o[s], c = a.length, l = i[s] = new Array(c), d, u, f = 0; f < c; ++f)
|
|
1769
1769
|
(d = a[f]) && (u = e.call(d, d.__data__, f, a)) && ("__data__" in d && (u.__data__ = d.__data__), l[f] = u, Jt(l[f], t, n, f, l, ye(d, n)));
|
|
1770
|
-
return new
|
|
1770
|
+
return new Se(i, this._parents, t, n);
|
|
1771
1771
|
}
|
|
1772
1772
|
function Iu(e) {
|
|
1773
1773
|
var t = this._name, n = this._id;
|
|
@@ -1775,11 +1775,11 @@ function Iu(e) {
|
|
|
1775
1775
|
for (var o = this._groups, r = o.length, i = [], s = [], a = 0; a < r; ++a)
|
|
1776
1776
|
for (var c = o[a], l = c.length, d, u = 0; u < l; ++u)
|
|
1777
1777
|
if (d = c[u]) {
|
|
1778
|
-
for (var f = e.call(d, d.__data__, u, c), h,
|
|
1779
|
-
(h = f[y]) && Jt(h, t, n, y, f,
|
|
1778
|
+
for (var f = e.call(d, d.__data__, u, c), h, g = ye(d, n), y = 0, b = f.length; y < b; ++y)
|
|
1779
|
+
(h = f[y]) && Jt(h, t, n, y, f, g);
|
|
1780
1780
|
i.push(f), s.push(d);
|
|
1781
1781
|
}
|
|
1782
|
-
return new
|
|
1782
|
+
return new Se(i, s, t, n);
|
|
1783
1783
|
}
|
|
1784
1784
|
var Au = xt.prototype.constructor;
|
|
1785
1785
|
function Pu() {
|
|
@@ -1814,7 +1814,7 @@ function Du(e, t, n) {
|
|
|
1814
1814
|
function Hu(e, t) {
|
|
1815
1815
|
var n, o, r, i = "style." + t, s = "end." + i, a;
|
|
1816
1816
|
return function() {
|
|
1817
|
-
var c =
|
|
1817
|
+
var c = ve(this, e), l = c.on, d = c.value[i] == null ? a || (a = Kr(t)) : void 0;
|
|
1818
1818
|
(l !== n || r !== d) && (o = (n = l).copy()).on(s, r = d), c.on = o;
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
@@ -1888,7 +1888,7 @@ function qu() {
|
|
|
1888
1888
|
ease: d.ease
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
1891
|
-
return new
|
|
1891
|
+
return new Se(o, this._parents, e, n);
|
|
1892
1892
|
}
|
|
1893
1893
|
function Gu() {
|
|
1894
1894
|
var e, t, n = this, o = n._id, r = n.size();
|
|
@@ -1897,35 +1897,35 @@ function Gu() {
|
|
|
1897
1897
|
--r === 0 && i();
|
|
1898
1898
|
} };
|
|
1899
1899
|
n.each(function() {
|
|
1900
|
-
var l =
|
|
1900
|
+
var l = ve(this, o), d = l.on;
|
|
1901
1901
|
d !== e && (t = (e = d).copy(), t._.cancel.push(a), t._.interrupt.push(a), t._.end.push(c)), l.on = t;
|
|
1902
1902
|
}), r === 0 && i();
|
|
1903
1903
|
});
|
|
1904
1904
|
}
|
|
1905
1905
|
var Ku = 0;
|
|
1906
|
-
function
|
|
1906
|
+
function Se(e, t, n, o) {
|
|
1907
1907
|
this._groups = e, this._parents = t, this._name = n, this._id = o;
|
|
1908
1908
|
}
|
|
1909
1909
|
function Ur() {
|
|
1910
1910
|
return ++Ku;
|
|
1911
1911
|
}
|
|
1912
|
-
var
|
|
1913
|
-
|
|
1914
|
-
constructor:
|
|
1912
|
+
var _e = xt.prototype;
|
|
1913
|
+
Se.prototype = {
|
|
1914
|
+
constructor: Se,
|
|
1915
1915
|
select: $u,
|
|
1916
1916
|
selectAll: Iu,
|
|
1917
|
-
selectChild:
|
|
1918
|
-
selectChildren:
|
|
1917
|
+
selectChild: _e.selectChild,
|
|
1918
|
+
selectChildren: _e.selectChildren,
|
|
1919
1919
|
filter: bu,
|
|
1920
1920
|
merge: Eu,
|
|
1921
1921
|
selection: Pu,
|
|
1922
1922
|
transition: qu,
|
|
1923
|
-
call:
|
|
1924
|
-
nodes:
|
|
1925
|
-
node:
|
|
1926
|
-
size:
|
|
1927
|
-
empty:
|
|
1928
|
-
each:
|
|
1923
|
+
call: _e.call,
|
|
1924
|
+
nodes: _e.nodes,
|
|
1925
|
+
node: _e.node,
|
|
1926
|
+
size: _e.size,
|
|
1927
|
+
empty: _e.empty,
|
|
1928
|
+
each: _e.each,
|
|
1929
1929
|
on: Cu,
|
|
1930
1930
|
attr: su,
|
|
1931
1931
|
attrTween: du,
|
|
@@ -1940,7 +1940,7 @@ Ee.prototype = {
|
|
|
1940
1940
|
ease: xu,
|
|
1941
1941
|
easeVarying: _u,
|
|
1942
1942
|
end: Gu,
|
|
1943
|
-
[Symbol.iterator]:
|
|
1943
|
+
[Symbol.iterator]: _e[Symbol.iterator]
|
|
1944
1944
|
};
|
|
1945
1945
|
function Uu(e) {
|
|
1946
1946
|
return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
|
|
@@ -1960,11 +1960,11 @@ function Ju(e, t) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
function ju(e) {
|
|
1962
1962
|
var t, n;
|
|
1963
|
-
e instanceof
|
|
1963
|
+
e instanceof Se ? (t = e._id, e = e._name) : (t = Ur(), (n = Qu).time = Qn(), e = e == null ? null : e + "");
|
|
1964
1964
|
for (var o = this._groups, r = o.length, i = 0; i < r; ++i)
|
|
1965
1965
|
for (var s = o[i], a = s.length, c, l = 0; l < a; ++l)
|
|
1966
1966
|
(c = s[l]) && Jt(c, e, t, l, s, n || Ju(c, t));
|
|
1967
|
-
return new
|
|
1967
|
+
return new Se(o, this._parents, e, t);
|
|
1968
1968
|
}
|
|
1969
1969
|
xt.prototype.interrupt = Ul;
|
|
1970
1970
|
xt.prototype.transition = ju;
|
|
@@ -1983,16 +1983,16 @@ function ed(e, {
|
|
|
1983
1983
|
_: { value: r }
|
|
1984
1984
|
});
|
|
1985
1985
|
}
|
|
1986
|
-
function
|
|
1986
|
+
function be(e, t, n) {
|
|
1987
1987
|
this.k = e, this.x = t, this.y = n;
|
|
1988
1988
|
}
|
|
1989
|
-
|
|
1990
|
-
constructor:
|
|
1989
|
+
be.prototype = {
|
|
1990
|
+
constructor: be,
|
|
1991
1991
|
scale: function(e) {
|
|
1992
|
-
return e === 1 ? this : new
|
|
1992
|
+
return e === 1 ? this : new be(this.k * e, this.x, this.y);
|
|
1993
1993
|
},
|
|
1994
1994
|
translate: function(e, t) {
|
|
1995
|
-
return e === 0 & t === 0 ? this : new
|
|
1995
|
+
return e === 0 & t === 0 ? this : new be(this.k, this.x + this.k * e, this.y + this.k * t);
|
|
1996
1996
|
},
|
|
1997
1997
|
apply: function(e) {
|
|
1998
1998
|
return [e[0] * this.k + this.x, e[1] * this.k + this.y];
|
|
@@ -2022,8 +2022,8 @@ _e.prototype = {
|
|
|
2022
2022
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
2023
2023
|
}
|
|
2024
2024
|
};
|
|
2025
|
-
var jt = new
|
|
2026
|
-
Qr.prototype =
|
|
2025
|
+
var jt = new be(1, 0, 0);
|
|
2026
|
+
Qr.prototype = be.prototype;
|
|
2027
2027
|
function Qr(e) {
|
|
2028
2028
|
for (; !e.__zoom; ) if (!(e = e.parentNode)) return jt;
|
|
2029
2029
|
return e.__zoom;
|
|
@@ -2058,93 +2058,93 @@ function id(e, t, n) {
|
|
|
2058
2058
|
);
|
|
2059
2059
|
}
|
|
2060
2060
|
function Jr() {
|
|
2061
|
-
var e = td, t = nd, n = id, o = od, r = rd, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, c = Fl, l = Kt("start", "zoom", "end"), d, u, f, h = 500,
|
|
2062
|
-
function x(
|
|
2063
|
-
|
|
2061
|
+
var e = td, t = nd, n = id, o = od, r = rd, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, c = Fl, l = Kt("start", "zoom", "end"), d, u, f, h = 500, g = 150, y = 0, b = 10;
|
|
2062
|
+
function x(m) {
|
|
2063
|
+
m.property("__zoom", To).on("wheel.zoom", P, { passive: !1 }).on("mousedown.zoom", I).on("dblclick.zoom", A).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)");
|
|
2064
2064
|
}
|
|
2065
|
-
x.transform = function(
|
|
2066
|
-
var $ =
|
|
2067
|
-
$.property("__zoom", To),
|
|
2068
|
-
k(this, arguments).event(
|
|
2065
|
+
x.transform = function(m, E, v, C) {
|
|
2066
|
+
var $ = m.selection ? m.selection() : m;
|
|
2067
|
+
$.property("__zoom", To), m !== $ ? N(m, E, v, C) : $.interrupt().each(function() {
|
|
2068
|
+
k(this, arguments).event(C).start().zoom(null, typeof E == "function" ? E.apply(this, arguments) : E).end();
|
|
2069
2069
|
});
|
|
2070
|
-
}, x.scaleBy = function(
|
|
2071
|
-
x.scaleTo(
|
|
2072
|
-
var $ = this.__zoom.k,
|
|
2073
|
-
return $ *
|
|
2074
|
-
}, v,
|
|
2075
|
-
}, x.scaleTo = function(
|
|
2076
|
-
x.transform(
|
|
2077
|
-
var $ = t.apply(this, arguments),
|
|
2078
|
-
return n(
|
|
2079
|
-
}, v,
|
|
2080
|
-
}, x.translateBy = function(
|
|
2081
|
-
x.transform(
|
|
2070
|
+
}, x.scaleBy = function(m, E, v, C) {
|
|
2071
|
+
x.scaleTo(m, function() {
|
|
2072
|
+
var $ = this.__zoom.k, M = typeof E == "function" ? E.apply(this, arguments) : E;
|
|
2073
|
+
return $ * M;
|
|
2074
|
+
}, v, C);
|
|
2075
|
+
}, x.scaleTo = function(m, E, v, C) {
|
|
2076
|
+
x.transform(m, function() {
|
|
2077
|
+
var $ = t.apply(this, arguments), M = this.__zoom, T = v == null ? w($) : typeof v == "function" ? v.apply(this, arguments) : v, O = M.invert(T), R = typeof E == "function" ? E.apply(this, arguments) : E;
|
|
2078
|
+
return n(p(_(M, R), T, O), $, s);
|
|
2079
|
+
}, v, C);
|
|
2080
|
+
}, x.translateBy = function(m, E, v, C) {
|
|
2081
|
+
x.transform(m, function() {
|
|
2082
2082
|
return n(this.__zoom.translate(
|
|
2083
2083
|
typeof E == "function" ? E.apply(this, arguments) : E,
|
|
2084
2084
|
typeof v == "function" ? v.apply(this, arguments) : v
|
|
2085
2085
|
), t.apply(this, arguments), s);
|
|
2086
|
-
}, null,
|
|
2087
|
-
}, x.translateTo = function(
|
|
2088
|
-
x.transform(
|
|
2089
|
-
var
|
|
2086
|
+
}, null, C);
|
|
2087
|
+
}, x.translateTo = function(m, E, v, C, $) {
|
|
2088
|
+
x.transform(m, function() {
|
|
2089
|
+
var M = t.apply(this, arguments), T = this.__zoom, O = C == null ? w(M) : typeof C == "function" ? C.apply(this, arguments) : C;
|
|
2090
2090
|
return n(jt.translate(O[0], O[1]).scale(T.k).translate(
|
|
2091
2091
|
typeof E == "function" ? -E.apply(this, arguments) : -E,
|
|
2092
2092
|
typeof v == "function" ? -v.apply(this, arguments) : -v
|
|
2093
|
-
),
|
|
2094
|
-
},
|
|
2093
|
+
), M, s);
|
|
2094
|
+
}, C, $);
|
|
2095
2095
|
};
|
|
2096
|
-
function
|
|
2097
|
-
return E = Math.max(i[0], Math.min(i[1], E)), E ===
|
|
2096
|
+
function _(m, E) {
|
|
2097
|
+
return E = Math.max(i[0], Math.min(i[1], E)), E === m.k ? m : new be(E, m.x, m.y);
|
|
2098
2098
|
}
|
|
2099
|
-
function m
|
|
2100
|
-
var
|
|
2101
|
-
return
|
|
2099
|
+
function p(m, E, v) {
|
|
2100
|
+
var C = E[0] - v[0] * m.k, $ = E[1] - v[1] * m.k;
|
|
2101
|
+
return C === m.x && $ === m.y ? m : new be(m.k, C, $);
|
|
2102
2102
|
}
|
|
2103
|
-
function w(
|
|
2104
|
-
return [(+
|
|
2103
|
+
function w(m) {
|
|
2104
|
+
return [(+m[0][0] + +m[1][0]) / 2, (+m[0][1] + +m[1][1]) / 2];
|
|
2105
2105
|
}
|
|
2106
|
-
function N(
|
|
2107
|
-
|
|
2108
|
-
k(this, arguments).event(
|
|
2106
|
+
function N(m, E, v, C) {
|
|
2107
|
+
m.on("start.zoom", function() {
|
|
2108
|
+
k(this, arguments).event(C).start();
|
|
2109
2109
|
}).on("interrupt.zoom end.zoom", function() {
|
|
2110
|
-
k(this, arguments).event(
|
|
2110
|
+
k(this, arguments).event(C).end();
|
|
2111
2111
|
}).tween("zoom", function() {
|
|
2112
|
-
var $ = this,
|
|
2112
|
+
var $ = this, M = arguments, T = k($, M).event(C), O = t.apply($, M), R = v == null ? w(O) : typeof v == "function" ? v.apply($, M) : v, Y = Math.max(O[1][0] - O[0][0], O[1][1] - O[0][1]), X = $.__zoom, F = typeof E == "function" ? E.apply($, M) : E, Z = c(X.invert(R).concat(Y / X.k), F.invert(R).concat(Y / F.k));
|
|
2113
2113
|
return function(L) {
|
|
2114
2114
|
if (L === 1) L = F;
|
|
2115
2115
|
else {
|
|
2116
|
-
var
|
|
2117
|
-
L = new
|
|
2116
|
+
var W = Z(L), G = Y / W[2];
|
|
2117
|
+
L = new be(G, R[0] - W[0] * G, R[1] - W[1] * G);
|
|
2118
2118
|
}
|
|
2119
2119
|
T.zoom(null, L);
|
|
2120
2120
|
};
|
|
2121
2121
|
});
|
|
2122
2122
|
}
|
|
2123
|
-
function k(
|
|
2124
|
-
return !v &&
|
|
2123
|
+
function k(m, E, v) {
|
|
2124
|
+
return !v && m.__zooming || new S(m, E);
|
|
2125
2125
|
}
|
|
2126
|
-
function S(
|
|
2127
|
-
this.that =
|
|
2126
|
+
function S(m, E) {
|
|
2127
|
+
this.that = m, this.args = E, this.active = 0, this.sourceEvent = null, this.extent = t.apply(m, E), this.taps = 0;
|
|
2128
2128
|
}
|
|
2129
2129
|
S.prototype = {
|
|
2130
|
-
event: function(
|
|
2131
|
-
return
|
|
2130
|
+
event: function(m) {
|
|
2131
|
+
return m && (this.sourceEvent = m), this;
|
|
2132
2132
|
},
|
|
2133
2133
|
start: function() {
|
|
2134
2134
|
return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
|
2135
2135
|
},
|
|
2136
|
-
zoom: function(
|
|
2137
|
-
return this.mouse &&
|
|
2136
|
+
zoom: function(m, E) {
|
|
2137
|
+
return this.mouse && m !== "mouse" && (this.mouse[1] = E.invert(this.mouse[0])), this.touch0 && m !== "touch" && (this.touch0[1] = E.invert(this.touch0[0])), this.touch1 && m !== "touch" && (this.touch1[1] = E.invert(this.touch1[0])), this.that.__zoom = E, this.emit("zoom"), this;
|
|
2138
2138
|
},
|
|
2139
2139
|
end: function() {
|
|
2140
2140
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
2141
2141
|
},
|
|
2142
|
-
emit: function(
|
|
2142
|
+
emit: function(m) {
|
|
2143
2143
|
var E = le(this.that).datum();
|
|
2144
2144
|
l.call(
|
|
2145
|
-
|
|
2145
|
+
m,
|
|
2146
2146
|
this.that,
|
|
2147
|
-
new ed(
|
|
2147
|
+
new ed(m, {
|
|
2148
2148
|
sourceEvent: this.sourceEvent,
|
|
2149
2149
|
target: x,
|
|
2150
2150
|
transform: this.that.__zoom,
|
|
@@ -2154,106 +2154,106 @@ function Jr() {
|
|
|
2154
2154
|
);
|
|
2155
2155
|
}
|
|
2156
2156
|
};
|
|
2157
|
-
function P(
|
|
2157
|
+
function P(m, ...E) {
|
|
2158
2158
|
if (!e.apply(this, arguments)) return;
|
|
2159
|
-
var v = k(this, E).event(
|
|
2159
|
+
var v = k(this, E).event(m), C = this.__zoom, $ = Math.max(i[0], Math.min(i[1], C.k * Math.pow(2, o.apply(this, arguments)))), M = he(m);
|
|
2160
2160
|
if (v.wheel)
|
|
2161
|
-
(v.mouse[0][0] !==
|
|
2161
|
+
(v.mouse[0][0] !== M[0] || v.mouse[0][1] !== M[1]) && (v.mouse[1] = C.invert(v.mouse[0] = M)), clearTimeout(v.wheel);
|
|
2162
2162
|
else {
|
|
2163
|
-
if (
|
|
2164
|
-
v.mouse = [
|
|
2163
|
+
if (C.k === $) return;
|
|
2164
|
+
v.mouse = [M, C.invert(M)], Ht(this), v.start();
|
|
2165
2165
|
}
|
|
2166
|
-
ot(
|
|
2166
|
+
ot(m), v.wheel = setTimeout(T, g), v.zoom("mouse", n(p(_(C, $), v.mouse[0], v.mouse[1]), v.extent, s));
|
|
2167
2167
|
function T() {
|
|
2168
2168
|
v.wheel = null, v.end();
|
|
2169
2169
|
}
|
|
2170
2170
|
}
|
|
2171
|
-
function I(
|
|
2171
|
+
function I(m, ...E) {
|
|
2172
2172
|
if (f || !e.apply(this, arguments)) return;
|
|
2173
|
-
var v =
|
|
2174
|
-
Dr(
|
|
2175
|
-
function R(
|
|
2176
|
-
if (ot(
|
|
2177
|
-
var F =
|
|
2178
|
-
|
|
2173
|
+
var v = m.currentTarget, C = k(this, E, !0).event(m), $ = le(m.view).on("mousemove.zoom", R, !0).on("mouseup.zoom", Y, !0), M = he(m, v), T = m.clientX, O = m.clientY;
|
|
2174
|
+
Dr(m.view), _n(m), C.mouse = [M, this.__zoom.invert(M)], Ht(this), C.start();
|
|
2175
|
+
function R(X) {
|
|
2176
|
+
if (ot(X), !C.moved) {
|
|
2177
|
+
var F = X.clientX - T, Z = X.clientY - O;
|
|
2178
|
+
C.moved = F * F + Z * Z > y;
|
|
2179
2179
|
}
|
|
2180
|
-
|
|
2180
|
+
C.event(X).zoom("mouse", n(p(C.that.__zoom, C.mouse[0] = he(X, v), C.mouse[1]), C.extent, s));
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2183
|
-
$.on("mousemove.zoom mouseup.zoom", null), Hr(
|
|
2182
|
+
function Y(X) {
|
|
2183
|
+
$.on("mousemove.zoom mouseup.zoom", null), Hr(X.view, C.moved), ot(X), C.event(X).end();
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
function A(
|
|
2186
|
+
function A(m, ...E) {
|
|
2187
2187
|
if (e.apply(this, arguments)) {
|
|
2188
|
-
var v = this.__zoom,
|
|
2189
|
-
ot(
|
|
2188
|
+
var v = this.__zoom, C = he(m.changedTouches ? m.changedTouches[0] : m, this), $ = v.invert(C), M = v.k * (m.shiftKey ? 0.5 : 2), T = n(p(_(v, M), C, $), t.apply(this, E), s);
|
|
2189
|
+
ot(m), a > 0 ? le(this).transition().duration(a).call(N, T, C, m) : le(this).call(x.transform, T, C, m);
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
|
-
function V(
|
|
2192
|
+
function V(m, ...E) {
|
|
2193
2193
|
if (e.apply(this, arguments)) {
|
|
2194
|
-
var v =
|
|
2195
|
-
for (_n(
|
|
2196
|
-
O = v[T], R = he(O, this), R = [R, this.__zoom.invert(R), O.identifier], $.touch0 ? !$.touch1 && $.touch0[2] !== R[2] && ($.touch1 = R, $.taps = 0) : ($.touch0 = R,
|
|
2197
|
-
d && (d = clearTimeout(d)),
|
|
2194
|
+
var v = m.touches, C = v.length, $ = k(this, E, m.changedTouches.length === C).event(m), M, T, O, R;
|
|
2195
|
+
for (_n(m), T = 0; T < C; ++T)
|
|
2196
|
+
O = v[T], R = he(O, this), R = [R, this.__zoom.invert(R), O.identifier], $.touch0 ? !$.touch1 && $.touch0[2] !== R[2] && ($.touch1 = R, $.taps = 0) : ($.touch0 = R, M = !0, $.taps = 1 + !!d);
|
|
2197
|
+
d && (d = clearTimeout(d)), M && ($.taps < 2 && (u = R[0], d = setTimeout(function() {
|
|
2198
2198
|
d = null;
|
|
2199
2199
|
}, h)), Ht(this), $.start());
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
|
-
function D(
|
|
2202
|
+
function D(m, ...E) {
|
|
2203
2203
|
if (this.__zooming) {
|
|
2204
|
-
var v = k(this, E).event(
|
|
2205
|
-
for (ot(
|
|
2206
|
-
T = M
|
|
2204
|
+
var v = k(this, E).event(m), C = m.changedTouches, $ = C.length, M, T, O, R;
|
|
2205
|
+
for (ot(m), M = 0; M < $; ++M)
|
|
2206
|
+
T = C[M], 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);
|
|
2207
2207
|
if (T = v.that.__zoom, v.touch1) {
|
|
2208
|
-
var
|
|
2209
|
-
T =
|
|
2208
|
+
var Y = v.touch0[0], X = v.touch0[1], F = v.touch1[0], Z = v.touch1[1], L = (L = F[0] - Y[0]) * L + (L = F[1] - Y[1]) * L, W = (W = Z[0] - X[0]) * W + (W = Z[1] - X[1]) * W;
|
|
2209
|
+
T = _(T, Math.sqrt(L / W)), O = [(Y[0] + F[0]) / 2, (Y[1] + F[1]) / 2], R = [(X[0] + Z[0]) / 2, (X[1] + Z[1]) / 2];
|
|
2210
2210
|
} else if (v.touch0) O = v.touch0[0], R = v.touch0[1];
|
|
2211
2211
|
else return;
|
|
2212
|
-
v.zoom("touch", n(
|
|
2212
|
+
v.zoom("touch", n(p(T, O, R), v.extent, s));
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
|
-
function H(
|
|
2215
|
+
function H(m, ...E) {
|
|
2216
2216
|
if (this.__zooming) {
|
|
2217
|
-
var v = k(this, E).event(
|
|
2218
|
-
for (_n(
|
|
2217
|
+
var v = k(this, E).event(m), C = m.changedTouches, $ = C.length, M, T;
|
|
2218
|
+
for (_n(m), f && clearTimeout(f), f = setTimeout(function() {
|
|
2219
2219
|
f = null;
|
|
2220
|
-
}, h),
|
|
2221
|
-
T = M
|
|
2220
|
+
}, h), M = 0; M < $; ++M)
|
|
2221
|
+
T = C[M], v.touch0 && v.touch0[2] === T.identifier ? delete v.touch0 : v.touch1 && v.touch1[2] === T.identifier && delete v.touch1;
|
|
2222
2222
|
if (v.touch1 && !v.touch0 && (v.touch0 = v.touch1, delete v.touch1), v.touch0) v.touch0[1] = this.__zoom.invert(v.touch0[0]);
|
|
2223
|
-
else if (v.end(), v.taps === 2 && (T = he(T, this), Math.hypot(u[0] - T[0], u[1] - T[1]) <
|
|
2223
|
+
else if (v.end(), v.taps === 2 && (T = he(T, this), Math.hypot(u[0] - T[0], u[1] - T[1]) < b)) {
|
|
2224
2224
|
var O = le(this).on("dblclick.zoom");
|
|
2225
2225
|
O && O.apply(this, arguments);
|
|
2226
2226
|
}
|
|
2227
2227
|
}
|
|
2228
2228
|
}
|
|
2229
|
-
return x.wheelDelta = function(
|
|
2230
|
-
return arguments.length ? (o = typeof
|
|
2231
|
-
}, x.filter = function(
|
|
2232
|
-
return arguments.length ? (e = typeof
|
|
2233
|
-
}, x.touchable = function(
|
|
2234
|
-
return arguments.length ? (r = typeof
|
|
2235
|
-
}, x.extent = function(
|
|
2236
|
-
return arguments.length ? (t = typeof
|
|
2237
|
-
}, x.scaleExtent = function(
|
|
2238
|
-
return arguments.length ? (i[0] = +
|
|
2239
|
-
}, x.translateExtent = function(
|
|
2240
|
-
return arguments.length ? (s[0][0] = +
|
|
2241
|
-
}, x.constrain = function(
|
|
2242
|
-
return arguments.length ? (n =
|
|
2243
|
-
}, x.duration = function(
|
|
2244
|
-
return arguments.length ? (a = +
|
|
2245
|
-
}, x.interpolate = function(
|
|
2246
|
-
return arguments.length ? (c =
|
|
2229
|
+
return x.wheelDelta = function(m) {
|
|
2230
|
+
return arguments.length ? (o = typeof m == "function" ? m : kt(+m), x) : o;
|
|
2231
|
+
}, x.filter = function(m) {
|
|
2232
|
+
return arguments.length ? (e = typeof m == "function" ? m : kt(!!m), x) : e;
|
|
2233
|
+
}, x.touchable = function(m) {
|
|
2234
|
+
return arguments.length ? (r = typeof m == "function" ? m : kt(!!m), x) : r;
|
|
2235
|
+
}, x.extent = function(m) {
|
|
2236
|
+
return arguments.length ? (t = typeof m == "function" ? m : kt([[+m[0][0], +m[0][1]], [+m[1][0], +m[1][1]]]), x) : t;
|
|
2237
|
+
}, x.scaleExtent = function(m) {
|
|
2238
|
+
return arguments.length ? (i[0] = +m[0], i[1] = +m[1], x) : [i[0], i[1]];
|
|
2239
|
+
}, x.translateExtent = function(m) {
|
|
2240
|
+
return arguments.length ? (s[0][0] = +m[0][0], s[1][0] = +m[1][0], s[0][1] = +m[0][1], s[1][1] = +m[1][1], x) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]];
|
|
2241
|
+
}, x.constrain = function(m) {
|
|
2242
|
+
return arguments.length ? (n = m, x) : n;
|
|
2243
|
+
}, x.duration = function(m) {
|
|
2244
|
+
return arguments.length ? (a = +m, x) : a;
|
|
2245
|
+
}, x.interpolate = function(m) {
|
|
2246
|
+
return arguments.length ? (c = m, x) : c;
|
|
2247
2247
|
}, x.on = function() {
|
|
2248
|
-
var
|
|
2249
|
-
return
|
|
2250
|
-
}, x.clickDistance = function(
|
|
2251
|
-
return arguments.length ? (y = (
|
|
2252
|
-
}, x.tapDistance = function(
|
|
2253
|
-
return arguments.length ? (
|
|
2248
|
+
var m = l.on.apply(l, arguments);
|
|
2249
|
+
return m === l ? x : m;
|
|
2250
|
+
}, x.clickDistance = function(m) {
|
|
2251
|
+
return arguments.length ? (y = (m = +m) * m, x) : Math.sqrt(y);
|
|
2252
|
+
}, x.tapDistance = function(m) {
|
|
2253
|
+
return arguments.length ? (b = +m, x) : b;
|
|
2254
2254
|
}, x;
|
|
2255
2255
|
}
|
|
2256
|
-
const
|
|
2256
|
+
const xe = {
|
|
2257
2257
|
error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",
|
|
2258
2258
|
error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
|
|
2259
2259
|
error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
|
|
@@ -2267,7 +2267,8 @@ const Ne = {
|
|
|
2267
2267
|
error011: (e) => `Edge type "${e}" not found. Using fallback type "default".`,
|
|
2268
2268
|
error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
|
|
2269
2269
|
error013: (e = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,
|
|
2270
|
-
error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID."
|
|
2270
|
+
error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",
|
|
2271
|
+
error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."
|
|
2271
2272
|
}, ht = [
|
|
2272
2273
|
[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
|
|
2273
2274
|
[Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]
|
|
@@ -2354,8 +2355,8 @@ const ni = (e) => "id" in e && "source" in e && "target" in e, sd = (e) => "id"
|
|
|
2354
2355
|
const { measured: d, selectable: u = !0, hidden: f = !1 } = l;
|
|
2355
2356
|
if (s && !u || f)
|
|
2356
2357
|
continue;
|
|
2357
|
-
const h = d.width ?? l.width ?? l.initialWidth ?? null,
|
|
2358
|
-
(!l.internals.handleBounds || x || y >=
|
|
2358
|
+
const h = d.width ?? l.width ?? l.initialWidth ?? null, g = d.height ?? l.height ?? l.initialHeight ?? null, y = pt(a, Ge(l)), b = (h ?? 0) * (g ?? 0), x = i && y > 0;
|
|
2359
|
+
(!l.internals.handleBounds || x || y >= b || l.dragging) && c.push(l);
|
|
2359
2360
|
}
|
|
2360
2361
|
return c;
|
|
2361
2362
|
}, cd = (e, t) => {
|
|
@@ -2381,12 +2382,12 @@ function ri({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: o = [0, 0],
|
|
|
2381
2382
|
let u = r;
|
|
2382
2383
|
if (s.extent === "parent" && !s.expandParent)
|
|
2383
2384
|
if (!a)
|
|
2384
|
-
i?.("005",
|
|
2385
|
+
i?.("005", xe.error005());
|
|
2385
2386
|
else {
|
|
2386
|
-
const h = a.measured.width,
|
|
2387
|
-
h &&
|
|
2387
|
+
const h = a.measured.width, g = a.measured.height;
|
|
2388
|
+
h && g && (u = [
|
|
2388
2389
|
[c, l],
|
|
2389
|
-
[c + h, l +
|
|
2390
|
+
[c + h, l + g]
|
|
2390
2391
|
]);
|
|
2391
2392
|
}
|
|
2392
2393
|
else a && Ke(s.extent) && (u = [
|
|
@@ -2394,10 +2395,10 @@ function ri({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: o = [0, 0],
|
|
|
2394
2395
|
[s.extent[1][0] + c, s.extent[1][1] + l]
|
|
2395
2396
|
]);
|
|
2396
2397
|
const f = Ke(u) ? Oe(t, u, s.measured) : t;
|
|
2397
|
-
return {
|
|
2398
|
+
return (s.measured.width === void 0 || s.measured.height === void 0) && i?.("015", xe.error015()), {
|
|
2398
2399
|
position: {
|
|
2399
|
-
x: f.x - c + s.measured.width * d[0],
|
|
2400
|
-
y: f.y - l + s.measured.height * d[1]
|
|
2400
|
+
x: f.x - c + (s.measured.width ?? 0) * d[0],
|
|
2401
|
+
y: f.y - l + (s.measured.height ?? 0) * d[1]
|
|
2401
2402
|
},
|
|
2402
2403
|
positionAbsolute: f
|
|
2403
2404
|
};
|
|
@@ -2407,12 +2408,12 @@ async function ld({ nodesToRemove: e = [], edgesToRemove: t = [], nodes: n, edge
|
|
|
2407
2408
|
for (const f of n) {
|
|
2408
2409
|
if (f.deletable === !1)
|
|
2409
2410
|
continue;
|
|
2410
|
-
const h = i.has(f.id),
|
|
2411
|
-
(h ||
|
|
2411
|
+
const h = i.has(f.id), g = !h && f.parentId && s.find((y) => y.id === f.parentId);
|
|
2412
|
+
(h || g) && s.push(f);
|
|
2412
2413
|
}
|
|
2413
2414
|
const a = new Set(t.map((f) => f.id)), c = o.filter((f) => f.deletable !== !1), d = cd(s, c);
|
|
2414
2415
|
for (const f of c)
|
|
2415
|
-
a.has(f.id) && !d.find((
|
|
2416
|
+
a.has(f.id) && !d.find((g) => g.id === f.id) && d.push(f);
|
|
2416
2417
|
if (!r)
|
|
2417
2418
|
return {
|
|
2418
2419
|
edges: d,
|
|
@@ -2518,7 +2519,7 @@ function Oo(e, t) {
|
|
|
2518
2519
|
return !0;
|
|
2519
2520
|
}
|
|
2520
2521
|
function st(e, { snapGrid: t = [0, 0], snapToGrid: n = !1, transform: o, containerBounds: r }) {
|
|
2521
|
-
const { x: i, y: s } =
|
|
2522
|
+
const { x: i, y: s } = Ee(e), a = bt({ x: i - (r?.left ?? 0), y: s - (r?.top ?? 0) }, o), { x: c, y: l } = n ? nn(a, t) : a;
|
|
2522
2523
|
return {
|
|
2523
2524
|
xSnapped: c,
|
|
2524
2525
|
ySnapped: l,
|
|
@@ -2533,7 +2534,7 @@ function On(e) {
|
|
|
2533
2534
|
const t = e.composedPath?.()?.[0] || e.target;
|
|
2534
2535
|
return t?.nodeType !== 1 ? !1 : dd.includes(t.nodeName) || t.hasAttribute("contenteditable") || !!t.closest(".nokey");
|
|
2535
2536
|
}
|
|
2536
|
-
const fi = (e) => "clientX" in e,
|
|
2537
|
+
const fi = (e) => "clientX" in e, Ee = (e, t) => {
|
|
2537
2538
|
const n = fi(e), o = n ? e.clientX : e.touches?.[0].clientX, r = n ? e.clientY : e.touches?.[0].clientY;
|
|
2538
2539
|
return {
|
|
2539
2540
|
x: o - (t?.left ?? 0),
|
|
@@ -2588,7 +2589,7 @@ function gi({ sourceX: e, sourceY: t, sourcePosition: n = B.Bottom, targetX: o,
|
|
|
2588
2589
|
x2: e,
|
|
2589
2590
|
y2: t,
|
|
2590
2591
|
c: s
|
|
2591
|
-
}), [u, f, h,
|
|
2592
|
+
}), [u, f, h, g] = hi({
|
|
2592
2593
|
sourceX: e,
|
|
2593
2594
|
sourceY: t,
|
|
2594
2595
|
targetX: o,
|
|
@@ -2603,7 +2604,7 @@ function gi({ sourceX: e, sourceY: t, sourcePosition: n = B.Bottom, targetX: o,
|
|
|
2603
2604
|
u,
|
|
2604
2605
|
f,
|
|
2605
2606
|
h,
|
|
2606
|
-
|
|
2607
|
+
g
|
|
2607
2608
|
];
|
|
2608
2609
|
}
|
|
2609
2610
|
function pi({ sourceX: e, sourceY: t, targetX: n, targetY: o }) {
|
|
@@ -2657,18 +2658,18 @@ function wd({ source: e, sourcePosition: t = B.Bottom, target: n, targetPosition
|
|
|
2657
2658
|
sourcePosition: t,
|
|
2658
2659
|
target: l
|
|
2659
2660
|
}), u = d.x !== 0 ? "x" : "y", f = d[u];
|
|
2660
|
-
let h = [],
|
|
2661
|
-
const
|
|
2661
|
+
let h = [], g, y;
|
|
2662
|
+
const b = { x: 0, y: 0 }, x = { x: 0, y: 0 }, [_, p, w, N] = pi({
|
|
2662
2663
|
sourceX: e.x,
|
|
2663
2664
|
sourceY: e.y,
|
|
2664
2665
|
targetX: n.x,
|
|
2665
2666
|
targetY: n.y
|
|
2666
2667
|
});
|
|
2667
2668
|
if (s[u] * a[u] === -1) {
|
|
2668
|
-
|
|
2669
|
+
g = r.x ?? _, y = r.y ?? p;
|
|
2669
2670
|
const S = [
|
|
2670
|
-
{ x:
|
|
2671
|
-
{ x:
|
|
2671
|
+
{ x: g, y: c.y },
|
|
2672
|
+
{ x: g, y: l.y }
|
|
2672
2673
|
], P = [
|
|
2673
2674
|
{ x: c.x, y },
|
|
2674
2675
|
{ x: l.x, y }
|
|
@@ -2679,24 +2680,24 @@ function wd({ source: e, sourcePosition: t = B.Bottom, target: n, targetPosition
|
|
|
2679
2680
|
if (u === "x" ? h = s.x === f ? P : S : h = s.y === f ? S : P, t === o) {
|
|
2680
2681
|
const H = Math.abs(e[u] - n[u]);
|
|
2681
2682
|
if (H <= i) {
|
|
2682
|
-
const
|
|
2683
|
-
s[u] === f ?
|
|
2683
|
+
const m = Math.min(i - 1, i - H);
|
|
2684
|
+
s[u] === f ? b[u] = (c[u] > e[u] ? -1 : 1) * m : x[u] = (l[u] > n[u] ? -1 : 1) * m;
|
|
2684
2685
|
}
|
|
2685
2686
|
}
|
|
2686
2687
|
if (t !== o) {
|
|
2687
|
-
const H = u === "x" ? "y" : "x",
|
|
2688
|
-
(s[u] === 1 && (!
|
|
2688
|
+
const H = u === "x" ? "y" : "x", m = s[u] === a[H], E = c[H] > l[H], v = c[H] < l[H];
|
|
2689
|
+
(s[u] === 1 && (!m && E || m && v) || s[u] !== 1 && (!m && v || m && E)) && (h = u === "x" ? S : P);
|
|
2689
2690
|
}
|
|
2690
|
-
const I = { x: c.x +
|
|
2691
|
-
V >= D ? (
|
|
2691
|
+
const I = { x: c.x + b.x, y: c.y + b.y }, A = { x: l.x + x.x, y: l.y + x.y }, V = Math.max(Math.abs(I.x - h[0].x), Math.abs(A.x - h[0].x)), D = Math.max(Math.abs(I.y - h[0].y), Math.abs(A.y - h[0].y));
|
|
2692
|
+
V >= D ? (g = (I.x + A.x) / 2, y = h[0].y) : (g = h[0].x, y = (I.y + A.y) / 2);
|
|
2692
2693
|
}
|
|
2693
2694
|
return [[
|
|
2694
2695
|
e,
|
|
2695
|
-
{ x: c.x +
|
|
2696
|
+
{ x: c.x + b.x, y: c.y + b.y },
|
|
2696
2697
|
...h,
|
|
2697
2698
|
{ x: l.x + x.x, y: l.y + x.y },
|
|
2698
2699
|
n
|
|
2699
|
-
],
|
|
2700
|
+
], g, y, w, N];
|
|
2700
2701
|
}
|
|
2701
2702
|
function xd(e, t, n, o) {
|
|
2702
2703
|
const r = Math.min(Fo(e, t) / 2, Fo(t, n) / 2, o), { x: i, y: s } = t;
|
|
@@ -2710,7 +2711,7 @@ function xd(e, t, n, o) {
|
|
|
2710
2711
|
return `L ${i},${s + r * c}Q ${i},${s} ${i + r * a},${s}`;
|
|
2711
2712
|
}
|
|
2712
2713
|
function Rn({ sourceX: e, sourceY: t, sourcePosition: n = B.Bottom, targetX: o, targetY: r, targetPosition: i = B.Top, borderRadius: s = 5, centerX: a, centerY: c, offset: l = 20 }) {
|
|
2713
|
-
const [d, u, f, h,
|
|
2714
|
+
const [d, u, f, h, g] = wd({
|
|
2714
2715
|
source: { x: e, y: t },
|
|
2715
2716
|
sourcePosition: n,
|
|
2716
2717
|
target: { x: o, y: r },
|
|
@@ -2718,10 +2719,10 @@ function Rn({ sourceX: e, sourceY: t, sourcePosition: n = B.Bottom, targetX: o,
|
|
|
2718
2719
|
center: { x: a, y: c },
|
|
2719
2720
|
offset: l
|
|
2720
2721
|
});
|
|
2721
|
-
return [d.reduce((
|
|
2722
|
-
let
|
|
2723
|
-
return
|
|
2724
|
-
}, ""), u, f, h,
|
|
2722
|
+
return [d.reduce((b, x, _) => {
|
|
2723
|
+
let p = "";
|
|
2724
|
+
return _ > 0 && _ < d.length - 1 ? p = xd(d[_ - 1], x, d[_ + 1], s) : p = `${_ === 0 ? "M" : "L"}${x.x} ${x.y}`, b += p, b;
|
|
2725
|
+
}, ""), u, f, h, g];
|
|
2725
2726
|
}
|
|
2726
2727
|
function Xo(e) {
|
|
2727
2728
|
return e && !!(e.internals.handleBounds || e.handles?.length) && !!(e.measured.width || e.width || e.initialWidth);
|
|
@@ -2736,7 +2737,7 @@ function vd(e) {
|
|
|
2736
2737
|
e.targetHandle
|
|
2737
2738
|
);
|
|
2738
2739
|
if (!i || !s)
|
|
2739
|
-
return e.onError?.("008",
|
|
2740
|
+
return e.onError?.("008", xe.error008(i ? "target" : "source", {
|
|
2740
2741
|
id: e.id,
|
|
2741
2742
|
sourceHandle: e.sourceHandle,
|
|
2742
2743
|
targetHandle: e.targetHandle
|
|
@@ -2884,12 +2885,12 @@ function ro(e, t, n, o) {
|
|
|
2884
2885
|
return;
|
|
2885
2886
|
}
|
|
2886
2887
|
Nd(e, n);
|
|
2887
|
-
const l = r ? 1e3 : 0, { x: d, y: u, z: f } = Cd(e, c, i, s, l), { positionAbsolute: h } = e.internals,
|
|
2888
|
-
(
|
|
2888
|
+
const l = r ? 1e3 : 0, { x: d, y: u, z: f } = Cd(e, c, i, s, l), { positionAbsolute: h } = e.internals, g = d !== h.x || u !== h.y;
|
|
2889
|
+
(g || f !== e.internals.z) && t.set(e.id, {
|
|
2889
2890
|
...e,
|
|
2890
2891
|
internals: {
|
|
2891
2892
|
...e.internals,
|
|
2892
|
-
positionAbsolute:
|
|
2893
|
+
positionAbsolute: g ? { x: d, y: u } : h,
|
|
2893
2894
|
z: f
|
|
2894
2895
|
}
|
|
2895
2896
|
});
|
|
@@ -2918,21 +2919,21 @@ function io(e, t, n, o = [0, 0]) {
|
|
|
2918
2919
|
i.set(s.parentId, { expandedRect: l, parent: a });
|
|
2919
2920
|
}
|
|
2920
2921
|
return i.size > 0 && i.forEach(({ expandedRect: s, parent: a }, c) => {
|
|
2921
|
-
const l = a.internals.positionAbsolute, d = Ce(a), u = a.origin ?? o, f = s.x < l.x ? Math.round(Math.abs(l.x - s.x)) : 0, h = s.y < l.y ? Math.round(Math.abs(l.y - s.y)) : 0,
|
|
2922
|
-
(f > 0 || h > 0 ||
|
|
2922
|
+
const l = a.internals.positionAbsolute, d = Ce(a), u = a.origin ?? o, f = s.x < l.x ? Math.round(Math.abs(l.x - s.x)) : 0, h = s.y < l.y ? Math.round(Math.abs(l.y - s.y)) : 0, g = Math.max(d.width, Math.round(s.width)), y = Math.max(d.height, Math.round(s.height)), b = (g - d.width) * u[0], x = (y - d.height) * u[1];
|
|
2923
|
+
(f > 0 || h > 0 || b || x) && (r.push({
|
|
2923
2924
|
id: c,
|
|
2924
2925
|
type: "position",
|
|
2925
2926
|
position: {
|
|
2926
|
-
x: a.position.x - f +
|
|
2927
|
+
x: a.position.x - f + b,
|
|
2927
2928
|
y: a.position.y - h + x
|
|
2928
2929
|
}
|
|
2929
|
-
}), n.get(c)?.forEach((
|
|
2930
|
-
e.some((
|
|
2931
|
-
id:
|
|
2930
|
+
}), n.get(c)?.forEach((_) => {
|
|
2931
|
+
e.some((p) => p.id === _.id) || r.push({
|
|
2932
|
+
id: _.id,
|
|
2932
2933
|
type: "position",
|
|
2933
2934
|
position: {
|
|
2934
|
-
x:
|
|
2935
|
-
y:
|
|
2935
|
+
x: _.position.x + f,
|
|
2936
|
+
y: _.position.y + h
|
|
2936
2937
|
}
|
|
2937
2938
|
});
|
|
2938
2939
|
})), (d.width < s.width || d.height < s.height || f || h) && r.push({
|
|
@@ -2940,7 +2941,7 @@ function io(e, t, n, o = [0, 0]) {
|
|
|
2940
2941
|
type: "dimensions",
|
|
2941
2942
|
setAttributes: !0,
|
|
2942
2943
|
dimensions: {
|
|
2943
|
-
width:
|
|
2944
|
+
width: g + (f ? u[0] * f - b : 0),
|
|
2944
2945
|
height: y + (h ? u[1] * h - x : 0)
|
|
2945
2946
|
}
|
|
2946
2947
|
});
|
|
@@ -2966,17 +2967,17 @@ function Md(e, t, n, o, r, i) {
|
|
|
2966
2967
|
}), a = !0;
|
|
2967
2968
|
continue;
|
|
2968
2969
|
}
|
|
2969
|
-
const
|
|
2970
|
-
if (!!(
|
|
2971
|
-
const x = f.nodeElement.getBoundingClientRect(),
|
|
2972
|
-
let { positionAbsolute:
|
|
2973
|
-
h.parentId && h.extent === "parent" ?
|
|
2970
|
+
const g = on(f.nodeElement), y = h.measured.width !== g.width || h.measured.height !== g.height;
|
|
2971
|
+
if (!!(g.width && g.height && (y || !h.internals.handleBounds || f.force))) {
|
|
2972
|
+
const x = f.nodeElement.getBoundingClientRect(), _ = Ke(h.extent) ? h.extent : i;
|
|
2973
|
+
let { positionAbsolute: p } = h.internals;
|
|
2974
|
+
h.parentId && h.extent === "parent" ? p = ii(p, g, t.get(h.parentId)) : _ && (p = Oe(p, _, g));
|
|
2974
2975
|
const w = {
|
|
2975
2976
|
...h,
|
|
2976
|
-
measured:
|
|
2977
|
+
measured: g,
|
|
2977
2978
|
internals: {
|
|
2978
2979
|
...h.internals,
|
|
2979
|
-
positionAbsolute:
|
|
2980
|
+
positionAbsolute: p,
|
|
2980
2981
|
handleBounds: {
|
|
2981
2982
|
source: Ro("source", f.nodeElement, x, d, h.id),
|
|
2982
2983
|
target: Ro("target", f.nodeElement, x, d, h.id)
|
|
@@ -2986,7 +2987,7 @@ function Md(e, t, n, o, r, i) {
|
|
|
2986
2987
|
t.set(h.id, w), h.parentId && ro(w, t, n, { nodeOrigin: r }), a = !0, y && (c.push({
|
|
2987
2988
|
id: h.id,
|
|
2988
2989
|
type: "dimensions",
|
|
2989
|
-
dimensions:
|
|
2990
|
+
dimensions: g
|
|
2990
2991
|
}), h.expandParent && h.parentId && u.push({
|
|
2991
2992
|
id: h.id,
|
|
2992
2993
|
parentId: h.parentId,
|
|
@@ -3099,49 +3100,49 @@ function bn({ nodeId: e, dragItems: t, nodeLookup: n, dragging: o = !0 }) {
|
|
|
3099
3100
|
}
|
|
3100
3101
|
function Id({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, onDragStop: r }) {
|
|
3101
3102
|
let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), c = !1, l = { x: 0, y: 0 }, d = null, u = !1, f = null, h = !1;
|
|
3102
|
-
function
|
|
3103
|
-
f = le(
|
|
3103
|
+
function g({ noDragClassName: b, handleSelector: x, domNode: _, isSelectable: p, nodeId: w, nodeClickDistance: N = 0 }) {
|
|
3104
|
+
f = le(_);
|
|
3104
3105
|
function k({ x: A, y: V }, D) {
|
|
3105
|
-
const { nodeLookup: H, nodeExtent:
|
|
3106
|
+
const { nodeLookup: H, nodeExtent: m, snapGrid: E, snapToGrid: v, nodeOrigin: C, onNodeDrag: $, onSelectionDrag: M, onError: T, updateNodePositions: O } = t();
|
|
3106
3107
|
i = { x: A, y: V };
|
|
3107
|
-
let R = !1,
|
|
3108
|
-
if (a.size > 1 &&
|
|
3109
|
-
const
|
|
3110
|
-
|
|
3108
|
+
let R = !1, Y = { x: 0, y: 0, x2: 0, y2: 0 };
|
|
3109
|
+
if (a.size > 1 && m) {
|
|
3110
|
+
const X = Ue(a);
|
|
3111
|
+
Y = Vn(X);
|
|
3111
3112
|
}
|
|
3112
|
-
for (const [
|
|
3113
|
-
if (!H.has(
|
|
3113
|
+
for (const [X, F] of a) {
|
|
3114
|
+
if (!H.has(X))
|
|
3114
3115
|
continue;
|
|
3115
3116
|
let Z = { x: A - F.distance.x, y: V - F.distance.y };
|
|
3116
3117
|
v && (Z = nn(Z, E));
|
|
3117
3118
|
let L = [
|
|
3118
|
-
[
|
|
3119
|
-
[
|
|
3119
|
+
[m[0][0], m[0][1]],
|
|
3120
|
+
[m[1][0], m[1][1]]
|
|
3120
3121
|
];
|
|
3121
|
-
if (a.size > 1 &&
|
|
3122
|
-
const { positionAbsolute: te } = F.internals, Q = te.x -
|
|
3122
|
+
if (a.size > 1 && m && !F.extent) {
|
|
3123
|
+
const { positionAbsolute: te } = F.internals, Q = te.x - Y.x + m[0][0], q = te.x + F.measured.width - Y.x2 + m[1][0], U = te.y - Y.y + m[0][1], oe = te.y + F.measured.height - Y.y2 + m[1][1];
|
|
3123
3124
|
L = [
|
|
3124
3125
|
[Q, U],
|
|
3125
3126
|
[q, oe]
|
|
3126
3127
|
];
|
|
3127
3128
|
}
|
|
3128
|
-
const { position:
|
|
3129
|
-
nodeId:
|
|
3129
|
+
const { position: W, positionAbsolute: G } = ri({
|
|
3130
|
+
nodeId: X,
|
|
3130
3131
|
nextPosition: Z,
|
|
3131
3132
|
nodeLookup: H,
|
|
3132
3133
|
nodeExtent: L,
|
|
3133
|
-
nodeOrigin:
|
|
3134
|
+
nodeOrigin: C,
|
|
3134
3135
|
onError: T
|
|
3135
3136
|
});
|
|
3136
|
-
R = R || F.position.x !==
|
|
3137
|
+
R = R || F.position.x !== W.x || F.position.y !== W.y, F.position = W, F.internals.positionAbsolute = G;
|
|
3137
3138
|
}
|
|
3138
|
-
if (R && (O(a, !0), D && (o || $ || !w &&
|
|
3139
|
-
const [
|
|
3139
|
+
if (R && (O(a, !0), D && (o || $ || !w && M))) {
|
|
3140
|
+
const [X, F] = bn({
|
|
3140
3141
|
nodeId: w,
|
|
3141
3142
|
dragItems: a,
|
|
3142
3143
|
nodeLookup: H
|
|
3143
3144
|
});
|
|
3144
|
-
o?.(D, a,
|
|
3145
|
+
o?.(D, a, X, F), $?.(D, X, F), w || M?.(D, F);
|
|
3145
3146
|
}
|
|
3146
3147
|
}
|
|
3147
3148
|
async function S() {
|
|
@@ -3152,51 +3153,51 @@ function Id({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3152
3153
|
c = !1, cancelAnimationFrame(s);
|
|
3153
3154
|
return;
|
|
3154
3155
|
}
|
|
3155
|
-
const [
|
|
3156
|
-
(
|
|
3156
|
+
const [m, E] = si(l, d, D);
|
|
3157
|
+
(m !== 0 || E !== 0) && (i.x = (i.x ?? 0) - m / A[2], i.y = (i.y ?? 0) - E / A[2], await V({ x: m, y: E }) && k(i, null)), s = requestAnimationFrame(S);
|
|
3157
3158
|
}
|
|
3158
3159
|
function P(A) {
|
|
3159
|
-
const { nodeLookup: V, multiSelectionActive: D, nodesDraggable: H, transform:
|
|
3160
|
-
u = !0, (!
|
|
3161
|
-
const O = st(A.sourceEvent, { transform:
|
|
3162
|
-
if (i = O, a = $d(V, H, O, w), a.size > 0 && (n || $ || !w &&
|
|
3163
|
-
const [R,
|
|
3160
|
+
const { nodeLookup: V, multiSelectionActive: D, nodesDraggable: H, transform: m, snapGrid: E, snapToGrid: v, selectNodesOnDrag: C, onNodeDragStart: $, onSelectionDragStart: M, unselectNodesAndEdges: T } = t();
|
|
3161
|
+
u = !0, (!C || !p) && !D && w && (V.get(w)?.selected || T()), p && C && w && e?.(w);
|
|
3162
|
+
const O = st(A.sourceEvent, { transform: m, snapGrid: E, snapToGrid: v, containerBounds: d });
|
|
3163
|
+
if (i = O, a = $d(V, H, O, w), a.size > 0 && (n || $ || !w && M)) {
|
|
3164
|
+
const [R, Y] = bn({
|
|
3164
3165
|
nodeId: w,
|
|
3165
3166
|
dragItems: a,
|
|
3166
3167
|
nodeLookup: V
|
|
3167
3168
|
});
|
|
3168
|
-
n?.(A.sourceEvent, a, R,
|
|
3169
|
+
n?.(A.sourceEvent, a, R, Y), $?.(A.sourceEvent, R, Y), w || M?.(A.sourceEvent, Y);
|
|
3169
3170
|
}
|
|
3170
3171
|
}
|
|
3171
3172
|
const I = Vr().clickDistance(N).on("start", (A) => {
|
|
3172
|
-
const { domNode: V, nodeDragThreshold: D, transform: H, snapGrid:
|
|
3173
|
-
d = V?.getBoundingClientRect() || null, h = !1, D === 0 && P(A), i = st(A.sourceEvent, { transform: H, snapGrid:
|
|
3173
|
+
const { domNode: V, nodeDragThreshold: D, transform: H, snapGrid: m, snapToGrid: E } = t();
|
|
3174
|
+
d = V?.getBoundingClientRect() || null, h = !1, D === 0 && P(A), i = st(A.sourceEvent, { transform: H, snapGrid: m, snapToGrid: E, containerBounds: d }), l = Ee(A.sourceEvent, d);
|
|
3174
3175
|
}).on("drag", (A) => {
|
|
3175
|
-
const { autoPanOnNodeDrag: V, transform: D, snapGrid: H, snapToGrid:
|
|
3176
|
+
const { autoPanOnNodeDrag: V, transform: D, snapGrid: H, snapToGrid: m, nodeDragThreshold: E, nodeLookup: v } = t(), C = st(A.sourceEvent, { transform: D, snapGrid: H, snapToGrid: m, containerBounds: d });
|
|
3176
3177
|
if ((A.sourceEvent.type === "touchmove" && A.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
3177
3178
|
w && !v.has(w)) && (h = !0), !h) {
|
|
3178
3179
|
if (!c && V && u && (c = !0, S()), !u) {
|
|
3179
|
-
const $ =
|
|
3180
|
-
Math.sqrt($ * $ +
|
|
3180
|
+
const $ = C.xSnapped - (i.x ?? 0), M = C.ySnapped - (i.y ?? 0);
|
|
3181
|
+
Math.sqrt($ * $ + M * M) > E && P(A);
|
|
3181
3182
|
}
|
|
3182
|
-
(i.x !==
|
|
3183
|
+
(i.x !== C.xSnapped || i.y !== C.ySnapped) && a && u && (l = Ee(A.sourceEvent, d), k(C, A.sourceEvent));
|
|
3183
3184
|
}
|
|
3184
3185
|
}).on("end", (A) => {
|
|
3185
3186
|
if (!(!u || h) && (c = !1, u = !1, cancelAnimationFrame(s), a.size > 0)) {
|
|
3186
|
-
const { nodeLookup: V, updateNodePositions: D, onNodeDragStop: H, onSelectionDragStop:
|
|
3187
|
-
if (D(a, !1), r || H || !w &&
|
|
3187
|
+
const { nodeLookup: V, updateNodePositions: D, onNodeDragStop: H, onSelectionDragStop: m } = t();
|
|
3188
|
+
if (D(a, !1), r || H || !w && m) {
|
|
3188
3189
|
const [E, v] = bn({
|
|
3189
3190
|
nodeId: w,
|
|
3190
3191
|
dragItems: a,
|
|
3191
3192
|
nodeLookup: V,
|
|
3192
3193
|
dragging: !1
|
|
3193
3194
|
});
|
|
3194
|
-
r?.(A.sourceEvent, a, E, v), H?.(A.sourceEvent, E, v), w ||
|
|
3195
|
+
r?.(A.sourceEvent, a, E, v), H?.(A.sourceEvent, E, v), w || m?.(A.sourceEvent, v);
|
|
3195
3196
|
}
|
|
3196
3197
|
}
|
|
3197
3198
|
}).filter((A) => {
|
|
3198
3199
|
const V = A.target;
|
|
3199
|
-
return !A.button && (!
|
|
3200
|
+
return !A.button && (!b || !qo(V, `.${b}`, _)) && (!x || qo(V, x, _));
|
|
3200
3201
|
});
|
|
3201
3202
|
f.call(I);
|
|
3202
3203
|
}
|
|
@@ -3204,7 +3205,7 @@ function Id({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: o, o
|
|
|
3204
3205
|
f?.on(".drag", null);
|
|
3205
3206
|
}
|
|
3206
3207
|
return {
|
|
3207
|
-
update:
|
|
3208
|
+
update: g,
|
|
3208
3209
|
destroy: y
|
|
3209
3210
|
};
|
|
3210
3211
|
}
|
|
@@ -3255,50 +3256,50 @@ function Td(e, t) {
|
|
|
3255
3256
|
return t ? n = !0 : e && !t && (n = !1), n;
|
|
3256
3257
|
}
|
|
3257
3258
|
const bi = () => !0;
|
|
3258
|
-
function Dd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: h, onConnectStart:
|
|
3259
|
+
function Dd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: h, onConnectStart: g, onConnect: y, onConnectEnd: b, isValidConnection: x = bi, onReconnectEnd: _, updateConnection: p, getTransform: w, getFromHandle: N, autoPanSpeed: k }) {
|
|
3259
3260
|
const S = di(e.target);
|
|
3260
3261
|
let P = 0, I;
|
|
3261
|
-
const { x: A, y: V } =
|
|
3262
|
-
if (!
|
|
3262
|
+
const { x: A, y: V } = Ee(e), D = S?.elementFromPoint(A, V), H = _i(i, D), m = a?.getBoundingClientRect();
|
|
3263
|
+
if (!m || !H)
|
|
3263
3264
|
return;
|
|
3264
3265
|
const E = vi(r, H, o, c, t);
|
|
3265
3266
|
if (!E)
|
|
3266
3267
|
return;
|
|
3267
|
-
let v =
|
|
3268
|
+
let v = Ee(e, m), C = !1, $ = null, M = !1, T = null;
|
|
3268
3269
|
function O() {
|
|
3269
|
-
if (!d || !
|
|
3270
|
+
if (!d || !m)
|
|
3270
3271
|
return;
|
|
3271
|
-
const [
|
|
3272
|
-
f({ x:
|
|
3272
|
+
const [G, te] = si(v, m, k);
|
|
3273
|
+
f({ x: G, y: te }), P = requestAnimationFrame(O);
|
|
3273
3274
|
}
|
|
3274
3275
|
const R = {
|
|
3275
3276
|
...E,
|
|
3276
3277
|
nodeId: r,
|
|
3277
3278
|
type: H,
|
|
3278
3279
|
position: E.position
|
|
3279
|
-
},
|
|
3280
|
+
}, Y = c.get(r), F = {
|
|
3280
3281
|
inProgress: !0,
|
|
3281
3282
|
isValid: null,
|
|
3282
|
-
from: mt(
|
|
3283
|
+
from: mt(Y, R, B.Left, !0),
|
|
3283
3284
|
fromHandle: R,
|
|
3284
3285
|
fromPosition: R.position,
|
|
3285
|
-
fromNode:
|
|
3286
|
+
fromNode: Y,
|
|
3286
3287
|
to: v,
|
|
3287
3288
|
toHandle: null,
|
|
3288
3289
|
toPosition: Do[R.position],
|
|
3289
3290
|
toNode: null
|
|
3290
3291
|
};
|
|
3291
|
-
|
|
3292
|
+
p(F);
|
|
3292
3293
|
let Z = F;
|
|
3293
|
-
|
|
3294
|
-
function L(
|
|
3294
|
+
g?.(e, { nodeId: r, handleId: o, handleType: H });
|
|
3295
|
+
function L(G) {
|
|
3295
3296
|
if (!N() || !R) {
|
|
3296
|
-
|
|
3297
|
+
W(G);
|
|
3297
3298
|
return;
|
|
3298
3299
|
}
|
|
3299
3300
|
const te = w();
|
|
3300
|
-
v =
|
|
3301
|
-
const Q = Ei(
|
|
3301
|
+
v = Ee(G, m), I = zd(bt(v, te, !1, [1, 1]), n, c, R), C || (O(), C = !0);
|
|
3302
|
+
const Q = Ei(G, {
|
|
3302
3303
|
handle: I,
|
|
3303
3304
|
connectionMode: t,
|
|
3304
3305
|
fromNodeId: r,
|
|
@@ -3310,48 +3311,48 @@ function Dd(e, { connectionMode: t, connectionRadius: n, handleId: o, nodeId: r,
|
|
|
3310
3311
|
flowId: u,
|
|
3311
3312
|
nodeLookup: c
|
|
3312
3313
|
});
|
|
3313
|
-
T = Q.handleDomNode, $ = Q.connection,
|
|
3314
|
+
T = Q.handleDomNode, $ = Q.connection, M = Td(!!I, Q.isValid);
|
|
3314
3315
|
const q = {
|
|
3315
3316
|
// from stays the same
|
|
3316
3317
|
...Z,
|
|
3317
|
-
isValid:
|
|
3318
|
-
to: I &&
|
|
3318
|
+
isValid: M,
|
|
3319
|
+
to: I && M ? ci({ x: I.x, y: I.y }, te) : v,
|
|
3319
3320
|
toHandle: Q.toHandle,
|
|
3320
|
-
toPosition:
|
|
3321
|
+
toPosition: M && Q.toHandle ? Q.toHandle.position : Do[R.position],
|
|
3321
3322
|
toNode: Q.toHandle ? c.get(Q.toHandle.nodeId) : null
|
|
3322
3323
|
};
|
|
3323
|
-
|
|
3324
|
+
M && I && Z.toHandle && q.toHandle && Z.toHandle.type === q.toHandle.type && Z.toHandle.nodeId === q.toHandle.nodeId && Z.toHandle.id === q.toHandle.id && Z.to.x === q.to.x && Z.to.y === q.to.y || (p(q), Z = q);
|
|
3324
3325
|
}
|
|
3325
|
-
function
|
|
3326
|
-
(I || T) && $ &&
|
|
3326
|
+
function W(G) {
|
|
3327
|
+
(I || T) && $ && M && y?.($);
|
|
3327
3328
|
const { inProgress: te, ...Q } = Z, q = {
|
|
3328
3329
|
...Q,
|
|
3329
3330
|
toPosition: Z.toHandle ? Z.toPosition : null
|
|
3330
3331
|
};
|
|
3331
|
-
|
|
3332
|
+
b?.(G, q), i && _?.(G, q), h(), cancelAnimationFrame(P), C = !1, M = !1, $ = null, T = null, S.removeEventListener("mousemove", L), S.removeEventListener("mouseup", W), S.removeEventListener("touchmove", L), S.removeEventListener("touchend", W);
|
|
3332
3333
|
}
|
|
3333
|
-
S.addEventListener("mousemove", L), S.addEventListener("mouseup",
|
|
3334
|
+
S.addEventListener("mousemove", L), S.addEventListener("mouseup", W), S.addEventListener("touchmove", L), S.addEventListener("touchend", W);
|
|
3334
3335
|
}
|
|
3335
3336
|
function Ei(e, { handle: t, connectionMode: n, fromNodeId: o, fromHandleId: r, fromType: i, doc: s, lib: a, flowId: c, isValidConnection: l = bi, nodeLookup: d }) {
|
|
3336
|
-
const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`) : null, { x: h, y:
|
|
3337
|
-
handleDomNode:
|
|
3337
|
+
const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`) : null, { x: h, y: g } = Ee(e), y = s.elementFromPoint(h, g), b = y?.classList.contains(`${a}-flow__handle`) ? y : f, x = {
|
|
3338
|
+
handleDomNode: b,
|
|
3338
3339
|
isValid: !1,
|
|
3339
3340
|
connection: null,
|
|
3340
3341
|
toHandle: null
|
|
3341
3342
|
};
|
|
3342
|
-
if (
|
|
3343
|
-
const
|
|
3344
|
-
if (!
|
|
3343
|
+
if (b) {
|
|
3344
|
+
const _ = _i(void 0, b), p = b.getAttribute("data-nodeid"), w = b.getAttribute("data-handleid"), N = b.classList.contains("connectable"), k = b.classList.contains("connectableend");
|
|
3345
|
+
if (!p || !_)
|
|
3345
3346
|
return x;
|
|
3346
3347
|
const S = {
|
|
3347
|
-
source: u ?
|
|
3348
|
+
source: u ? p : o,
|
|
3348
3349
|
sourceHandle: u ? w : r,
|
|
3349
|
-
target: u ? o :
|
|
3350
|
+
target: u ? o : p,
|
|
3350
3351
|
targetHandle: u ? r : w
|
|
3351
3352
|
};
|
|
3352
3353
|
x.connection = S;
|
|
3353
|
-
const I = N && k && (n === We.Strict ? u &&
|
|
3354
|
-
x.isValid = I && l(S), x.toHandle = vi(
|
|
3354
|
+
const I = N && k && (n === We.Strict ? u && _ === "source" || !u && _ === "target" : p !== o || w !== r);
|
|
3355
|
+
x.isValid = I && l(S), x.toHandle = vi(p, _, w, d, n, !1);
|
|
3355
3356
|
}
|
|
3356
3357
|
return x;
|
|
3357
3358
|
}
|
|
@@ -3362,26 +3363,26 @@ const Fn = {
|
|
|
3362
3363
|
function Hd({ domNode: e, panZoom: t, getTransform: n, getViewScale: o }) {
|
|
3363
3364
|
const r = le(e);
|
|
3364
3365
|
function i({ translateExtent: a, width: c, height: l, zoomStep: d = 10, pannable: u = !0, zoomable: f = !0, inversePan: h = !1 }) {
|
|
3365
|
-
const
|
|
3366
|
+
const g = (p) => {
|
|
3366
3367
|
const w = n();
|
|
3367
|
-
if (
|
|
3368
|
+
if (p.sourceEvent.type !== "wheel" || !t)
|
|
3368
3369
|
return;
|
|
3369
|
-
const N = -
|
|
3370
|
+
const N = -p.sourceEvent.deltaY * (p.sourceEvent.deltaMode === 1 ? 0.05 : p.sourceEvent.deltaMode ? 1 : 2e-3) * d, k = w[2] * Math.pow(2, N);
|
|
3370
3371
|
t.scaleTo(k);
|
|
3371
3372
|
};
|
|
3372
3373
|
let y = [0, 0];
|
|
3373
|
-
const
|
|
3374
|
-
(
|
|
3375
|
-
|
|
3376
|
-
|
|
3374
|
+
const b = (p) => {
|
|
3375
|
+
(p.sourceEvent.type === "mousedown" || p.sourceEvent.type === "touchstart") && (y = [
|
|
3376
|
+
p.sourceEvent.clientX ?? p.sourceEvent.touches[0].clientX,
|
|
3377
|
+
p.sourceEvent.clientY ?? p.sourceEvent.touches[0].clientY
|
|
3377
3378
|
]);
|
|
3378
|
-
}, x = (
|
|
3379
|
+
}, x = (p) => {
|
|
3379
3380
|
const w = n();
|
|
3380
|
-
if (
|
|
3381
|
+
if (p.sourceEvent.type !== "mousemove" && p.sourceEvent.type !== "touchmove" || !t)
|
|
3381
3382
|
return;
|
|
3382
3383
|
const N = [
|
|
3383
|
-
|
|
3384
|
-
|
|
3384
|
+
p.sourceEvent.clientX ?? p.sourceEvent.touches[0].clientX,
|
|
3385
|
+
p.sourceEvent.clientY ?? p.sourceEvent.touches[0].clientY
|
|
3385
3386
|
], k = [N[0] - y[0], N[1] - y[1]];
|
|
3386
3387
|
y = N;
|
|
3387
3388
|
const S = o() * Math.max(w[2], Math.log(w[2])) * (h ? -1 : 1), P = {
|
|
@@ -3396,8 +3397,8 @@ function Hd({ domNode: e, panZoom: t, getTransform: n, getViewScale: o }) {
|
|
|
3396
3397
|
y: P.y,
|
|
3397
3398
|
zoom: w[2]
|
|
3398
3399
|
}, I, a);
|
|
3399
|
-
},
|
|
3400
|
-
r.call(
|
|
3400
|
+
}, _ = Jr().on("start", b).on("zoom", u ? x : null).on("zoom.wheel", f ? g : null);
|
|
3401
|
+
r.call(_, {});
|
|
3401
3402
|
}
|
|
3402
3403
|
function s() {
|
|
3403
3404
|
r.on("zoom", null);
|
|
@@ -3427,16 +3428,16 @@ function Od({ zoomPanValues: e, noWheelClassName: t, d3Selection: n, d3Zoom: o,
|
|
|
3427
3428
|
d.preventDefault(), d.stopImmediatePropagation();
|
|
3428
3429
|
const u = n.property("__zoom").k || 1;
|
|
3429
3430
|
if (d.ctrlKey && s) {
|
|
3430
|
-
const
|
|
3431
|
-
o.scaleTo(n,
|
|
3431
|
+
const b = he(d), x = Ni(d), _ = u * Math.pow(2, x);
|
|
3432
|
+
o.scaleTo(n, _, b, d);
|
|
3432
3433
|
return;
|
|
3433
3434
|
}
|
|
3434
3435
|
const f = d.deltaMode === 1 ? 20 : 1;
|
|
3435
|
-
let h = r === He.Vertical ? 0 : d.deltaX * f,
|
|
3436
|
-
!Zt() && d.shiftKey && r !== He.Vertical && (h = d.deltaY * f,
|
|
3436
|
+
let h = r === He.Vertical ? 0 : d.deltaX * f, g = r === He.Horizontal ? 0 : d.deltaY * f;
|
|
3437
|
+
!Zt() && d.shiftKey && r !== He.Vertical && (h = d.deltaY * f, g = 0), o.translateBy(
|
|
3437
3438
|
n,
|
|
3438
3439
|
-(h / u) * i,
|
|
3439
|
-
-(
|
|
3440
|
+
-(g / u) * i,
|
|
3440
3441
|
// @ts-ignore
|
|
3441
3442
|
{ internal: !0 }
|
|
3442
3443
|
);
|
|
@@ -3505,7 +3506,7 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3505
3506
|
panScrollTimeout: void 0,
|
|
3506
3507
|
isPanScrolling: !1
|
|
3507
3508
|
}, u = e.getBoundingClientRect(), f = Jr().clickDistance(!pe(o) || o < 0 ? 0 : o).scaleExtent([t, n]).translateExtent(r), h = le(e).call(f);
|
|
3508
|
-
|
|
3509
|
+
p({
|
|
3509
3510
|
x: i.x,
|
|
3510
3511
|
y: i.y,
|
|
3511
3512
|
zoom: qe(i.zoom, t, n)
|
|
@@ -3513,22 +3514,22 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3513
3514
|
[0, 0],
|
|
3514
3515
|
[u.width, u.height]
|
|
3515
3516
|
], r);
|
|
3516
|
-
const
|
|
3517
|
+
const g = h.on("wheel.zoom"), y = h.on("dblclick.zoom");
|
|
3517
3518
|
f.wheelDelta(Ni);
|
|
3518
|
-
function
|
|
3519
|
-
return h ? new Promise((
|
|
3520
|
-
f?.transform(Sn(h, H?.duration, () =>
|
|
3519
|
+
function b(D, H) {
|
|
3520
|
+
return h ? new Promise((m) => {
|
|
3521
|
+
f?.transform(Sn(h, H?.duration, () => m(!0)), D);
|
|
3521
3522
|
}) : Promise.resolve(!1);
|
|
3522
3523
|
}
|
|
3523
|
-
function x({ noWheelClassName: D, noPanClassName: H, onPaneContextMenu:
|
|
3524
|
-
E && !d.isZoomingOrPanning &&
|
|
3525
|
-
const
|
|
3524
|
+
function x({ noWheelClassName: D, noPanClassName: H, onPaneContextMenu: m, userSelectionActive: E, panOnScroll: v, panOnDrag: C, panOnScrollMode: $, panOnScrollSpeed: M, preventScrolling: T, zoomOnPinch: O, zoomOnScroll: R, zoomOnDoubleClick: Y, zoomActivationKeyPressed: X, lib: F, onTransformChange: Z }) {
|
|
3525
|
+
E && !d.isZoomingOrPanning && _();
|
|
3526
|
+
const W = v && !X && !E ? Od({
|
|
3526
3527
|
zoomPanValues: d,
|
|
3527
3528
|
noWheelClassName: D,
|
|
3528
3529
|
d3Selection: h,
|
|
3529
3530
|
d3Zoom: f,
|
|
3530
3531
|
panOnScrollMode: $,
|
|
3531
|
-
panOnScrollSpeed:
|
|
3532
|
+
panOnScrollSpeed: M,
|
|
3532
3533
|
zoomOnPinch: O,
|
|
3533
3534
|
onPanZoomStart: a,
|
|
3534
3535
|
onPanZoom: s,
|
|
@@ -3536,9 +3537,9 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3536
3537
|
}) : Rd({
|
|
3537
3538
|
noWheelClassName: D,
|
|
3538
3539
|
preventScrolling: T,
|
|
3539
|
-
d3ZoomHandler:
|
|
3540
|
+
d3ZoomHandler: g
|
|
3540
3541
|
});
|
|
3541
|
-
if (h.on("wheel.zoom",
|
|
3542
|
+
if (h.on("wheel.zoom", W, { passive: !1 }), !E) {
|
|
3542
3543
|
const te = Ld({
|
|
3543
3544
|
zoomPanValues: d,
|
|
3544
3545
|
onDraggingChange: l,
|
|
@@ -3547,51 +3548,51 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3547
3548
|
f.on("start", te);
|
|
3548
3549
|
const Q = Bd({
|
|
3549
3550
|
zoomPanValues: d,
|
|
3550
|
-
panOnDrag:
|
|
3551
|
-
onPaneContextMenu: !!
|
|
3551
|
+
panOnDrag: C,
|
|
3552
|
+
onPaneContextMenu: !!m,
|
|
3552
3553
|
onPanZoom: s,
|
|
3553
3554
|
onTransformChange: Z
|
|
3554
3555
|
});
|
|
3555
3556
|
f.on("zoom", Q);
|
|
3556
3557
|
const q = Fd({
|
|
3557
3558
|
zoomPanValues: d,
|
|
3558
|
-
panOnDrag:
|
|
3559
|
+
panOnDrag: C,
|
|
3559
3560
|
panOnScroll: v,
|
|
3560
|
-
onPaneContextMenu:
|
|
3561
|
+
onPaneContextMenu: m,
|
|
3561
3562
|
onPanZoomEnd: c,
|
|
3562
3563
|
onDraggingChange: l
|
|
3563
3564
|
});
|
|
3564
3565
|
f.on("end", q);
|
|
3565
3566
|
}
|
|
3566
|
-
const
|
|
3567
|
-
zoomActivationKeyPressed:
|
|
3568
|
-
panOnDrag:
|
|
3567
|
+
const G = Xd({
|
|
3568
|
+
zoomActivationKeyPressed: X,
|
|
3569
|
+
panOnDrag: C,
|
|
3569
3570
|
zoomOnScroll: R,
|
|
3570
3571
|
panOnScroll: v,
|
|
3571
|
-
zoomOnDoubleClick:
|
|
3572
|
+
zoomOnDoubleClick: Y,
|
|
3572
3573
|
zoomOnPinch: O,
|
|
3573
3574
|
userSelectionActive: E,
|
|
3574
3575
|
noPanClassName: H,
|
|
3575
3576
|
noWheelClassName: D,
|
|
3576
3577
|
lib: F
|
|
3577
3578
|
});
|
|
3578
|
-
f.filter(
|
|
3579
|
+
f.filter(G), Y ? h.on("dblclick.zoom", y) : h.on("dblclick.zoom", null);
|
|
3579
3580
|
}
|
|
3580
|
-
function
|
|
3581
|
+
function _() {
|
|
3581
3582
|
f.on("zoom", null);
|
|
3582
3583
|
}
|
|
3583
|
-
async function
|
|
3584
|
-
const E = En(D), v = f?.constrain()(E, H,
|
|
3585
|
-
return v && await
|
|
3584
|
+
async function p(D, H, m) {
|
|
3585
|
+
const E = En(D), v = f?.constrain()(E, H, m);
|
|
3586
|
+
return v && await b(v), new Promise((C) => C(v));
|
|
3586
3587
|
}
|
|
3587
3588
|
async function w(D, H) {
|
|
3588
|
-
const
|
|
3589
|
-
return await
|
|
3589
|
+
const m = En(D);
|
|
3590
|
+
return await b(m, H), new Promise((E) => E(m));
|
|
3590
3591
|
}
|
|
3591
3592
|
function N(D) {
|
|
3592
3593
|
if (h) {
|
|
3593
|
-
const H = En(D),
|
|
3594
|
-
(
|
|
3594
|
+
const H = En(D), m = h.property("__zoom");
|
|
3595
|
+
(m.k !== D.zoom || m.x !== D.x || m.y !== D.y) && f?.transform(h, H, null, { sync: !0 });
|
|
3595
3596
|
}
|
|
3596
3597
|
}
|
|
3597
3598
|
function k() {
|
|
@@ -3599,13 +3600,13 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3599
3600
|
return { x: D.x, y: D.y, zoom: D.k };
|
|
3600
3601
|
}
|
|
3601
3602
|
function S(D, H) {
|
|
3602
|
-
return h ? new Promise((
|
|
3603
|
-
f?.scaleTo(Sn(h, H?.duration, () =>
|
|
3603
|
+
return h ? new Promise((m) => {
|
|
3604
|
+
f?.scaleTo(Sn(h, H?.duration, () => m(!0)), D);
|
|
3604
3605
|
}) : Promise.resolve(!1);
|
|
3605
3606
|
}
|
|
3606
3607
|
function P(D, H) {
|
|
3607
|
-
return h ? new Promise((
|
|
3608
|
-
f?.scaleBy(Sn(h, H?.duration, () =>
|
|
3608
|
+
return h ? new Promise((m) => {
|
|
3609
|
+
f?.scaleBy(Sn(h, H?.duration, () => m(!0)), D);
|
|
3609
3610
|
}) : Promise.resolve(!1);
|
|
3610
3611
|
}
|
|
3611
3612
|
function I(D) {
|
|
@@ -3620,9 +3621,9 @@ function Yd({ domNode: e, minZoom: t, maxZoom: n, paneClickDistance: o, translat
|
|
|
3620
3621
|
}
|
|
3621
3622
|
return {
|
|
3622
3623
|
update: x,
|
|
3623
|
-
destroy:
|
|
3624
|
+
destroy: _,
|
|
3624
3625
|
setViewport: w,
|
|
3625
|
-
setViewportConstrained:
|
|
3626
|
+
setViewportConstrained: p,
|
|
3626
3627
|
getViewport: k,
|
|
3627
3628
|
scaleTo: S,
|
|
3628
3629
|
scaleBy: P,
|
|
@@ -3663,49 +3664,49 @@ function Go(e, t) {
|
|
|
3663
3664
|
}
|
|
3664
3665
|
function qd(e, t, n, o, r, i, s, a) {
|
|
3665
3666
|
let { affectsX: c, affectsY: l } = t;
|
|
3666
|
-
const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: h, ySnapped:
|
|
3667
|
-
let P = Math.floor(d ? h - e.pointerX : 0), I = Math.floor(u ?
|
|
3667
|
+
const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: h, ySnapped: g } = n, { minWidth: y, maxWidth: b, minHeight: x, maxHeight: _ } = o, { x: p, y: w, width: N, height: k, aspectRatio: S } = e;
|
|
3668
|
+
let P = Math.floor(d ? h - e.pointerX : 0), I = Math.floor(u ? g - e.pointerY : 0);
|
|
3668
3669
|
const A = N + (c ? -P : P), V = k + (l ? -I : I), D = -i[0] * N, H = -i[1] * k;
|
|
3669
|
-
let
|
|
3670
|
+
let m = It(A, y, b), E = It(V, x, _);
|
|
3670
3671
|
if (s) {
|
|
3671
|
-
let $ = 0,
|
|
3672
|
-
c && P < 0 ? $ = Me(
|
|
3672
|
+
let $ = 0, M = 0;
|
|
3673
|
+
c && P < 0 ? $ = Me(p + P + D, s[0][0]) : !c && P > 0 && ($ = ke(p + A + D, s[1][0])), l && I < 0 ? M = Me(w + I + H, s[0][1]) : !l && I > 0 && (M = ke(w + V + H, s[1][1])), m = Math.max(m, $), E = Math.max(E, M);
|
|
3673
3674
|
}
|
|
3674
3675
|
if (a) {
|
|
3675
|
-
let $ = 0,
|
|
3676
|
-
c && P > 0 ? $ = ke(
|
|
3676
|
+
let $ = 0, M = 0;
|
|
3677
|
+
c && P > 0 ? $ = ke(p + P, a[0][0]) : !c && P < 0 && ($ = Me(p + A, a[1][0])), l && I > 0 ? M = ke(w + I, a[0][1]) : !l && I < 0 && (M = Me(w + V, a[1][1])), m = Math.max(m, $), E = Math.max(E, M);
|
|
3677
3678
|
}
|
|
3678
3679
|
if (r) {
|
|
3679
3680
|
if (d) {
|
|
3680
|
-
const $ = It(A / S, x,
|
|
3681
|
-
if (
|
|
3682
|
-
let
|
|
3683
|
-
!c && !l || c && !l && f ?
|
|
3681
|
+
const $ = It(A / S, x, _) * S;
|
|
3682
|
+
if (m = Math.max(m, $), s) {
|
|
3683
|
+
let M = 0;
|
|
3684
|
+
!c && !l || c && !l && f ? M = ke(w + H + A / S, s[1][1]) * S : M = Me(w + H + (c ? P : -P) / S, s[0][1]) * S, m = Math.max(m, M);
|
|
3684
3685
|
}
|
|
3685
3686
|
if (a) {
|
|
3686
|
-
let
|
|
3687
|
-
!c && !l || c && !l && f ?
|
|
3687
|
+
let M = 0;
|
|
3688
|
+
!c && !l || c && !l && f ? M = Me(w + A / S, a[1][1]) * S : M = ke(w + (c ? P : -P) / S, a[0][1]) * S, m = Math.max(m, M);
|
|
3688
3689
|
}
|
|
3689
3690
|
}
|
|
3690
3691
|
if (u) {
|
|
3691
|
-
const $ = It(V * S, y,
|
|
3692
|
+
const $ = It(V * S, y, b) / S;
|
|
3692
3693
|
if (E = Math.max(E, $), s) {
|
|
3693
|
-
let
|
|
3694
|
-
!c && !l || l && !c && f ?
|
|
3694
|
+
let M = 0;
|
|
3695
|
+
!c && !l || l && !c && f ? M = ke(p + V * S + D, s[1][0]) / S : M = Me(p + (l ? I : -I) * S + D, s[0][0]) / S, E = Math.max(E, M);
|
|
3695
3696
|
}
|
|
3696
3697
|
if (a) {
|
|
3697
|
-
let
|
|
3698
|
-
!c && !l || l && !c && f ?
|
|
3698
|
+
let M = 0;
|
|
3699
|
+
!c && !l || l && !c && f ? M = Me(p + V * S, a[1][0]) / S : M = ke(p + (l ? I : -I) * S, a[0][0]) / S, E = Math.max(E, M);
|
|
3699
3700
|
}
|
|
3700
3701
|
}
|
|
3701
3702
|
}
|
|
3702
|
-
I = I + (I < 0 ? E : -E), P = P + (P < 0 ?
|
|
3703
|
-
const v = c ?
|
|
3703
|
+
I = I + (I < 0 ? E : -E), P = P + (P < 0 ? m : -m), r && (f ? A > V * S ? I = (Go(c, l) ? -P : P) / S : P = (Go(c, l) ? -I : I) * S : d ? (I = P / S, l = c) : (P = I * S, c = l));
|
|
3704
|
+
const v = c ? p + P : p, C = l ? w + I : w;
|
|
3704
3705
|
return {
|
|
3705
3706
|
width: N + (c ? -P : P),
|
|
3706
3707
|
height: k + (l ? -I : I),
|
|
3707
3708
|
x: i[0] * P * (c ? -1 : 1) + v,
|
|
3708
|
-
y: i[1] * I * (l ? -1 : 1) +
|
|
3709
|
+
y: i[1] * I * (l ? -1 : 1) + C
|
|
3709
3710
|
};
|
|
3710
3711
|
}
|
|
3711
3712
|
const Ci = { width: 0, height: 0, x: 0, y: 0 }, Gd = {
|
|
@@ -3729,39 +3730,39 @@ function Ud(e, t, n) {
|
|
|
3729
3730
|
}
|
|
3730
3731
|
function Qd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r }) {
|
|
3731
3732
|
const i = le(e);
|
|
3732
|
-
function s({ controlPosition: c, boundaries: l, keepAspectRatio: d, onResizeStart: u, onResize: f, onResizeEnd: h, shouldResize:
|
|
3733
|
-
let y = { ...Ci },
|
|
3733
|
+
function s({ controlPosition: c, boundaries: l, keepAspectRatio: d, onResizeStart: u, onResize: f, onResizeEnd: h, shouldResize: g }) {
|
|
3734
|
+
let y = { ...Ci }, b = { ...Gd };
|
|
3734
3735
|
const x = Wd(c);
|
|
3735
|
-
let
|
|
3736
|
+
let _, p = null, w = [], N, k, S;
|
|
3736
3737
|
const P = Vr().on("start", (I) => {
|
|
3737
|
-
const { nodeLookup: A, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin:
|
|
3738
|
-
if (
|
|
3738
|
+
const { nodeLookup: A, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: m, paneDomNode: E } = n();
|
|
3739
|
+
if (_ = A.get(t), !_)
|
|
3739
3740
|
return;
|
|
3740
|
-
|
|
3741
|
-
const { xSnapped: v, ySnapped:
|
|
3741
|
+
p = E?.getBoundingClientRect() ?? null;
|
|
3742
|
+
const { xSnapped: v, ySnapped: C } = st(I.sourceEvent, {
|
|
3742
3743
|
transform: V,
|
|
3743
3744
|
snapGrid: D,
|
|
3744
3745
|
snapToGrid: H,
|
|
3745
|
-
containerBounds:
|
|
3746
|
+
containerBounds: p
|
|
3746
3747
|
});
|
|
3747
3748
|
y = {
|
|
3748
|
-
width:
|
|
3749
|
-
height:
|
|
3750
|
-
x:
|
|
3751
|
-
y:
|
|
3752
|
-
},
|
|
3749
|
+
width: _.measured.width ?? 0,
|
|
3750
|
+
height: _.measured.height ?? 0,
|
|
3751
|
+
x: _.position.x ?? 0,
|
|
3752
|
+
y: _.position.y ?? 0
|
|
3753
|
+
}, b = {
|
|
3753
3754
|
...y,
|
|
3754
3755
|
pointerX: v,
|
|
3755
|
-
pointerY:
|
|
3756
|
+
pointerY: C,
|
|
3756
3757
|
aspectRatio: y.width / y.height
|
|
3757
|
-
}, N = void 0,
|
|
3758
|
-
for (const [$,
|
|
3759
|
-
if (
|
|
3758
|
+
}, N = void 0, _.parentId && (_.extent === "parent" || _.expandParent) && (N = A.get(_.parentId), k = N && _.extent === "parent" ? Kd(N) : void 0), w = [], S = void 0;
|
|
3759
|
+
for (const [$, M] of A)
|
|
3760
|
+
if (M.parentId === t && (w.push({
|
|
3760
3761
|
id: $,
|
|
3761
|
-
position: { ...
|
|
3762
|
-
extent:
|
|
3763
|
-
}),
|
|
3764
|
-
const T = Ud(
|
|
3762
|
+
position: { ...M.position },
|
|
3763
|
+
extent: M.extent
|
|
3764
|
+
}), M.extent === "parent" || M.expandParent)) {
|
|
3765
|
+
const T = Ud(M, _, M.origin ?? m);
|
|
3765
3766
|
S ? S = [
|
|
3766
3767
|
[Math.min(T[0][0], S[0][0]), Math.min(T[0][1], S[0][1])],
|
|
3767
3768
|
[Math.max(T[1][0], S[1][0]), Math.max(T[1][1], S[1][1])]
|
|
@@ -3769,40 +3770,40 @@ function Qd({ domNode: e, nodeId: t, getStoreItems: n, onChange: o, onEnd: r })
|
|
|
3769
3770
|
}
|
|
3770
3771
|
u?.(I, { ...y });
|
|
3771
3772
|
}).on("drag", (I) => {
|
|
3772
|
-
const { transform: A, snapGrid: V, snapToGrid: D, nodeOrigin: H } = n(),
|
|
3773
|
+
const { transform: A, snapGrid: V, snapToGrid: D, nodeOrigin: H } = n(), m = st(I.sourceEvent, {
|
|
3773
3774
|
transform: A,
|
|
3774
3775
|
snapGrid: V,
|
|
3775
3776
|
snapToGrid: D,
|
|
3776
|
-
containerBounds:
|
|
3777
|
+
containerBounds: p
|
|
3777
3778
|
}), E = [];
|
|
3778
|
-
if (!
|
|
3779
|
+
if (!_)
|
|
3779
3780
|
return;
|
|
3780
|
-
const { x: v, y:
|
|
3781
|
-
if (!
|
|
3781
|
+
const { x: v, y: C, width: $, height: M } = y, T = {}, O = _.origin ?? H, { width: R, height: Y, x: X, y: F } = qd(b, x, m, l, d, O, k, S), Z = R !== $, L = Y !== M, W = X !== v && Z, G = F !== C && L;
|
|
3782
|
+
if (!W && !G && !Z && !L)
|
|
3782
3783
|
return;
|
|
3783
|
-
if ((
|
|
3784
|
-
const U =
|
|
3784
|
+
if ((W || G || O[0] === 1 || O[1] === 1) && (T.x = W ? X : y.x, T.y = G ? F : y.y, y.x = T.x, y.y = T.y, w.length > 0)) {
|
|
3785
|
+
const U = X - v, oe = F - C;
|
|
3785
3786
|
for (const ae of w)
|
|
3786
3787
|
ae.position = {
|
|
3787
3788
|
x: ae.position.x - U + O[0] * (R - $),
|
|
3788
|
-
y: ae.position.y - oe + O[1] * (
|
|
3789
|
+
y: ae.position.y - oe + O[1] * (Y - M)
|
|
3789
3790
|
}, E.push(ae);
|
|
3790
3791
|
}
|
|
3791
|
-
if ((Z || L) && (T.width = Z ? R : y.width, T.height = L ?
|
|
3792
|
+
if ((Z || L) && (T.width = Z ? R : y.width, T.height = L ? Y : y.height, y.width = T.width, y.height = T.height), N && _.expandParent) {
|
|
3792
3793
|
const U = O[0] * (T.width ?? 0);
|
|
3793
|
-
T.x && T.x < U && (y.x = U,
|
|
3794
|
+
T.x && T.x < U && (y.x = U, b.x = b.x - (T.x - U));
|
|
3794
3795
|
const oe = O[1] * (T.height ?? 0);
|
|
3795
|
-
T.y && T.y < oe && (y.y = oe,
|
|
3796
|
+
T.y && T.y < oe && (y.y = oe, b.y = b.y - (T.y - oe));
|
|
3796
3797
|
}
|
|
3797
3798
|
const te = Zd({
|
|
3798
3799
|
width: y.width,
|
|
3799
3800
|
prevWidth: $,
|
|
3800
3801
|
height: y.height,
|
|
3801
|
-
prevHeight:
|
|
3802
|
+
prevHeight: M,
|
|
3802
3803
|
affectsX: x.affectsX,
|
|
3803
3804
|
affectsY: x.affectsY
|
|
3804
3805
|
}), Q = { ...y, direction: te };
|
|
3805
|
-
|
|
3806
|
+
g?.(I, Q) !== !1 && (f?.(I, Q), o(T, E));
|
|
3806
3807
|
}).on("end", (I) => {
|
|
3807
3808
|
h?.(I, { ...y }), r?.();
|
|
3808
3809
|
});
|
|
@@ -3822,7 +3823,7 @@ const Jd = {}, Ko = (e) => {
|
|
|
3822
3823
|
const f = typeof d == "function" ? d(t) : d;
|
|
3823
3824
|
if (!Object.is(f, t)) {
|
|
3824
3825
|
const h = t;
|
|
3825
|
-
t = u ?? (typeof f != "object" || f === null) ? f : Object.assign({}, t, f), n.forEach((
|
|
3826
|
+
t = u ?? (typeof f != "object" || f === null) ? f : Object.assign({}, t, f), n.forEach((g) => g(t, h));
|
|
3826
3827
|
}
|
|
3827
3828
|
}, r = () => t, c = { setState: o, getState: r, getInitialState: () => l, subscribe: (d) => (n.add(d), () => n.delete(d)), destroy: () => {
|
|
3828
3829
|
(Jd ? "production" : void 0) !== "production" && console.warn(
|
|
@@ -3872,8 +3873,8 @@ function ne(e, t) {
|
|
|
3872
3873
|
return !1;
|
|
3873
3874
|
return !0;
|
|
3874
3875
|
}
|
|
3875
|
-
const sn = Zn(null), rf = sn.Provider, ki =
|
|
3876
|
-
function
|
|
3876
|
+
const sn = Zn(null), rf = sn.Provider, ki = xe.error001();
|
|
3877
|
+
function K(e, t) {
|
|
3877
3878
|
const n = wt(sn);
|
|
3878
3879
|
if (n === null)
|
|
3879
3880
|
throw new Error(ki);
|
|
@@ -3901,14 +3902,14 @@ const Qo = { display: "none" }, sf = {
|
|
|
3901
3902
|
clipPath: "inset(100%)"
|
|
3902
3903
|
}, $i = "react-flow__node-desc", Ii = "react-flow__edge-desc", af = "react-flow__aria-live", cf = (e) => e.ariaLiveMessage;
|
|
3903
3904
|
function lf({ rfId: e }) {
|
|
3904
|
-
const t =
|
|
3905
|
+
const t = K(cf);
|
|
3905
3906
|
return z("div", { id: `${af}-${e}`, "aria-live": "assertive", "aria-atomic": "true", style: sf, children: t });
|
|
3906
3907
|
}
|
|
3907
3908
|
function uf({ rfId: e, disableKeyboardA11y: t }) {
|
|
3908
|
-
return se(
|
|
3909
|
+
return se(Ne, { children: [se("div", { id: `${$i}-${e}`, style: Qo, 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.", " "] }), z("div", { id: `${Ii}-${e}`, style: Qo, children: "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel." }), !t && z(lf, { rfId: e })] });
|
|
3909
3910
|
}
|
|
3910
3911
|
const df = (e) => e.userSelectionActive ? "none" : "all", an = xr(({ position: e = "top-left", children: t, className: n, style: o, ...r }, i) => {
|
|
3911
|
-
const s =
|
|
3912
|
+
const s = K(df), a = `${e}`.split("-");
|
|
3912
3913
|
return z("div", { className: re(["react-flow__panel", n, ...a]), style: { ...o, pointerEvents: s }, ref: i, ...r, children: t });
|
|
3913
3914
|
});
|
|
3914
3915
|
an.displayName = "Panel";
|
|
@@ -3927,7 +3928,7 @@ function gf(e, t) {
|
|
|
3927
3928
|
return ne(e.selectedNodes.map(At), t.selectedNodes.map(At)) && ne(e.selectedEdges.map(At), t.selectedEdges.map(At));
|
|
3928
3929
|
}
|
|
3929
3930
|
function pf({ onSelectionChange: e }) {
|
|
3930
|
-
const t = ee(), { selectedNodes: n, selectedEdges: o } =
|
|
3931
|
+
const t = ee(), { selectedNodes: n, selectedEdges: o } = K(hf, gf);
|
|
3931
3932
|
return j(() => {
|
|
3932
3933
|
const r = { nodes: n, edges: o };
|
|
3933
3934
|
e?.(r), t.getState().onSelectionChangeHandlers.forEach((i) => i(r));
|
|
@@ -3935,7 +3936,7 @@ function pf({ onSelectionChange: e }) {
|
|
|
3935
3936
|
}
|
|
3936
3937
|
const mf = (e) => !!e.onSelectionChangeHandlers;
|
|
3937
3938
|
function yf({ onSelectionChange: e }) {
|
|
3938
|
-
const t =
|
|
3939
|
+
const t = K(mf);
|
|
3939
3940
|
return e || t ? z(pf, { onSelectionChange: e }) : null;
|
|
3940
3941
|
}
|
|
3941
3942
|
const Ai = [0, 0], wf = { x: 0, y: 0, zoom: 1 }, xf = [
|
|
@@ -4020,7 +4021,7 @@ const Ai = [0, 0], wf = { x: 0, y: 0, zoom: 1 }, xf = [
|
|
|
4020
4021
|
paneClickDistance: 0
|
|
4021
4022
|
};
|
|
4022
4023
|
function _f(e) {
|
|
4023
|
-
const { setNodes: t, setEdges: n, setMinZoom: o, setMaxZoom: r, setTranslateExtent: i, setNodeExtent: s, reset: a, setDefaultNodesAndEdges: c, setPaneClickDistance: l } =
|
|
4024
|
+
const { setNodes: t, setEdges: n, setMinZoom: o, setMaxZoom: r, setTranslateExtent: i, setNodeExtent: s, reset: a, setDefaultNodesAndEdges: c, setPaneClickDistance: l } = K(vf, ne), d = ee();
|
|
4024
4025
|
j(() => (c(e.defaultNodes, e.defaultEdges), () => {
|
|
4025
4026
|
u.current = jo, a();
|
|
4026
4027
|
}), []);
|
|
@@ -4028,8 +4029,8 @@ function _f(e) {
|
|
|
4028
4029
|
return j(
|
|
4029
4030
|
() => {
|
|
4030
4031
|
for (const f of Jo) {
|
|
4031
|
-
const h = e[f],
|
|
4032
|
-
h !==
|
|
4032
|
+
const h = e[f], g = u.current[f];
|
|
4033
|
+
h !== g && (typeof e[f] > "u" || (f === "nodes" ? t(h) : f === "edges" ? n(h) : f === "minZoom" ? o(h) : f === "maxZoom" ? r(h) : f === "translateExtent" ? i(h) : f === "nodeExtent" ? s(h) : f === "paneClickDistance" ? l(h) : f === "fitView" ? d.setState({ fitViewOnInit: h }) : f === "fitViewOptions" ? d.setState({ fitViewOnInitOptions: h }) : d.setState({ [f]: h })));
|
|
4033
4034
|
}
|
|
4034
4035
|
u.current = e;
|
|
4035
4036
|
},
|
|
@@ -4073,13 +4074,13 @@ function yt(e = null, t = { target: tr, actInsideInputWithModifier: !0 }) {
|
|
|
4073
4074
|
const l = (f) => {
|
|
4074
4075
|
if (r.current = f.ctrlKey || f.metaKey || f.shiftKey, (!r.current || r.current && !t.actInsideInputWithModifier) && On(f))
|
|
4075
4076
|
return !1;
|
|
4076
|
-
const
|
|
4077
|
-
i.current.add(f[
|
|
4077
|
+
const g = or(f.code, a);
|
|
4078
|
+
i.current.add(f[g]), nr(s, i.current, !1) && (f.preventDefault(), o(!0));
|
|
4078
4079
|
}, d = (f) => {
|
|
4079
4080
|
if ((!r.current || r.current && !t.actInsideInputWithModifier) && On(f))
|
|
4080
4081
|
return !1;
|
|
4081
|
-
const
|
|
4082
|
-
nr(s, i.current, !0) ? (o(!1), i.current.clear()) : i.current.delete(f[
|
|
4082
|
+
const g = or(f.code, a);
|
|
4083
|
+
nr(s, i.current, !0) ? (o(!1), i.current.clear()) : i.current.delete(f[g]), f.key === "Meta" && i.current.clear(), r.current = !1;
|
|
4083
4084
|
}, u = () => {
|
|
4084
4085
|
i.current.clear(), o(!1);
|
|
4085
4086
|
};
|
|
@@ -4286,8 +4287,8 @@ function kf({ children: e }) {
|
|
|
4286
4287
|
const t = ee(), n = ue((a) => {
|
|
4287
4288
|
const { nodes: c = [], setNodes: l, hasDefaultNodes: d, onNodesChange: u, nodeLookup: f } = t.getState();
|
|
4288
4289
|
let h = c;
|
|
4289
|
-
for (const
|
|
4290
|
-
h = typeof
|
|
4290
|
+
for (const g of a)
|
|
4291
|
+
h = typeof g == "function" ? g(h) : g;
|
|
4291
4292
|
d ? l(h) : u && u(rr({
|
|
4292
4293
|
items: h,
|
|
4293
4294
|
lookup: f
|
|
@@ -4295,8 +4296,8 @@ function kf({ children: e }) {
|
|
|
4295
4296
|
}, []), o = ar(n), r = ue((a) => {
|
|
4296
4297
|
const { edges: c = [], setEdges: l, hasDefaultEdges: d, onEdgesChange: u, edgeLookup: f } = t.getState();
|
|
4297
4298
|
let h = c;
|
|
4298
|
-
for (const
|
|
4299
|
-
h = typeof
|
|
4299
|
+
for (const g of a)
|
|
4300
|
+
h = typeof g == "function" ? g(h) : g;
|
|
4300
4301
|
d ? l(h) : u && u(rr({
|
|
4301
4302
|
items: h,
|
|
4302
4303
|
lookup: f
|
|
@@ -4312,32 +4313,32 @@ function $f() {
|
|
|
4312
4313
|
}
|
|
4313
4314
|
const If = (e) => !!e.panZoom;
|
|
4314
4315
|
function so() {
|
|
4315
|
-
const e = Ef(), t = ee(), n = $f(), o =
|
|
4316
|
+
const e = Ef(), t = ee(), n = $f(), o = K(If), r = me(() => {
|
|
4316
4317
|
const i = (u) => t.getState().nodeLookup.get(u), s = (u) => {
|
|
4317
4318
|
n.nodeQueue.push(u);
|
|
4318
4319
|
}, a = (u) => {
|
|
4319
4320
|
n.edgeQueue.push(u);
|
|
4320
4321
|
}, c = (u) => {
|
|
4321
|
-
const { nodeLookup: f, nodeOrigin: h } = t.getState(),
|
|
4322
|
-
...
|
|
4322
|
+
const { nodeLookup: f, nodeOrigin: h } = t.getState(), g = sr(u) ? u : f.get(u.id), y = g.parentId ? ui(g.position, g.measured, g.parentId, f, h) : g.position, b = {
|
|
4323
|
+
...g,
|
|
4323
4324
|
position: y,
|
|
4324
|
-
width:
|
|
4325
|
-
height:
|
|
4325
|
+
width: g.measured?.width ?? g.width,
|
|
4326
|
+
height: g.measured?.height ?? g.height
|
|
4326
4327
|
};
|
|
4327
|
-
return Ge(
|
|
4328
|
+
return Ge(b);
|
|
4328
4329
|
}, l = (u, f, h = { replace: !1 }) => {
|
|
4329
|
-
s((
|
|
4330
|
+
s((g) => g.map((y) => {
|
|
4330
4331
|
if (y.id === u) {
|
|
4331
|
-
const
|
|
4332
|
-
return h.replace && sr(
|
|
4332
|
+
const b = typeof f == "function" ? f(y) : f;
|
|
4333
|
+
return h.replace && sr(b) ? b : { ...y, ...b };
|
|
4333
4334
|
}
|
|
4334
4335
|
return y;
|
|
4335
4336
|
}));
|
|
4336
4337
|
}, d = (u, f, h = { replace: !1 }) => {
|
|
4337
|
-
a((
|
|
4338
|
+
a((g) => g.map((y) => {
|
|
4338
4339
|
if (y.id === u) {
|
|
4339
|
-
const
|
|
4340
|
-
return h.replace && Nf(
|
|
4340
|
+
const b = typeof f == "function" ? f(y) : f;
|
|
4341
|
+
return h.replace && Nf(b) ? b : { ...y, ...b };
|
|
4341
4342
|
}
|
|
4342
4343
|
return y;
|
|
4343
4344
|
}));
|
|
@@ -4362,42 +4363,42 @@ function so() {
|
|
|
4362
4363
|
n.edgeQueue.push((h) => [...h, ...f]);
|
|
4363
4364
|
},
|
|
4364
4365
|
toObject: () => {
|
|
4365
|
-
const { nodes: u = [], edges: f = [], transform: h } = t.getState(), [
|
|
4366
|
+
const { nodes: u = [], edges: f = [], transform: h } = t.getState(), [g, y, b] = h;
|
|
4366
4367
|
return {
|
|
4367
4368
|
nodes: u.map((x) => ({ ...x })),
|
|
4368
4369
|
edges: f.map((x) => ({ ...x })),
|
|
4369
4370
|
viewport: {
|
|
4370
|
-
x:
|
|
4371
|
+
x: g,
|
|
4371
4372
|
y,
|
|
4372
|
-
zoom:
|
|
4373
|
+
zoom: b
|
|
4373
4374
|
}
|
|
4374
4375
|
};
|
|
4375
4376
|
},
|
|
4376
4377
|
deleteElements: async ({ nodes: u = [], edges: f = [] }) => {
|
|
4377
|
-
const { nodes: h, edges:
|
|
4378
|
+
const { nodes: h, edges: g, onNodesDelete: y, onEdgesDelete: b, triggerNodeChanges: x, triggerEdgeChanges: _, onDelete: p, onBeforeDelete: w } = t.getState(), { nodes: N, edges: k } = await ld({
|
|
4378
4379
|
nodesToRemove: u,
|
|
4379
4380
|
edgesToRemove: f,
|
|
4380
4381
|
nodes: h,
|
|
4381
|
-
edges:
|
|
4382
|
+
edges: g,
|
|
4382
4383
|
onBeforeDelete: w
|
|
4383
4384
|
}), S = k.length > 0, P = N.length > 0;
|
|
4384
4385
|
if (S) {
|
|
4385
4386
|
const I = k.map(ir);
|
|
4386
|
-
|
|
4387
|
+
b?.(k), _(I);
|
|
4387
4388
|
}
|
|
4388
4389
|
if (P) {
|
|
4389
4390
|
const I = N.map(ir);
|
|
4390
4391
|
y?.(N), x(I);
|
|
4391
4392
|
}
|
|
4392
|
-
return (P || S) &&
|
|
4393
|
+
return (P || S) && p?.({ nodes: N, edges: k }), { deletedNodes: N, deletedEdges: k };
|
|
4393
4394
|
},
|
|
4394
4395
|
getIntersectingNodes: (u, f = !0, h) => {
|
|
4395
|
-
const
|
|
4396
|
+
const g = Vo(u), y = g ? u : c(u), b = h !== void 0;
|
|
4396
4397
|
return y ? (h || t.getState().nodes).filter((x) => {
|
|
4397
|
-
const
|
|
4398
|
-
if (
|
|
4398
|
+
const _ = t.getState().nodeLookup.get(x.id);
|
|
4399
|
+
if (_ && !g && (x.id === u.id || !_.internals.positionAbsolute))
|
|
4399
4400
|
return !1;
|
|
4400
|
-
const
|
|
4401
|
+
const p = Ge(b ? x : _), w = pt(p, y);
|
|
4401
4402
|
return f && w > 0 || w >= y.width * y.height;
|
|
4402
4403
|
}) : [];
|
|
4403
4404
|
},
|
|
@@ -4405,21 +4406,21 @@ function so() {
|
|
|
4405
4406
|
const y = Vo(u) ? u : c(u);
|
|
4406
4407
|
if (!y)
|
|
4407
4408
|
return !1;
|
|
4408
|
-
const
|
|
4409
|
-
return h &&
|
|
4409
|
+
const b = pt(y, f);
|
|
4410
|
+
return h && b > 0 || b >= y.width * y.height;
|
|
4410
4411
|
},
|
|
4411
4412
|
updateNode: l,
|
|
4412
4413
|
updateNodeData: (u, f, h = { replace: !1 }) => {
|
|
4413
|
-
l(u, (
|
|
4414
|
-
const y = typeof f == "function" ? f(
|
|
4415
|
-
return h.replace ? { ...
|
|
4414
|
+
l(u, (g) => {
|
|
4415
|
+
const y = typeof f == "function" ? f(g) : f;
|
|
4416
|
+
return h.replace ? { ...g, data: y } : { ...g, data: { ...g.data, ...y } };
|
|
4416
4417
|
}, h);
|
|
4417
4418
|
},
|
|
4418
4419
|
updateEdge: d,
|
|
4419
4420
|
updateEdgeData: (u, f, h = { replace: !1 }) => {
|
|
4420
|
-
d(u, (
|
|
4421
|
-
const y = typeof f == "function" ? f(
|
|
4422
|
-
return h.replace ? { ...
|
|
4421
|
+
d(u, (g) => {
|
|
4422
|
+
const y = typeof f == "function" ? f(g) : f;
|
|
4423
|
+
return h.replace ? { ...g, data: y } : { ...g, data: { ...g.data, ...y } };
|
|
4423
4424
|
}, h);
|
|
4424
4425
|
},
|
|
4425
4426
|
getNodesBounds: (u) => {
|
|
@@ -4455,7 +4456,7 @@ function Tf(e) {
|
|
|
4455
4456
|
if (!e.current)
|
|
4456
4457
|
return !1;
|
|
4457
4458
|
const o = on(e.current);
|
|
4458
|
-
(o.height === 0 || o.width === 0) && t.getState().onError?.("004",
|
|
4459
|
+
(o.height === 0 || o.width === 0) && t.getState().onError?.("004", xe.error004()), t.setState({ width: o.width || 500, height: o.height || 500 });
|
|
4459
4460
|
};
|
|
4460
4461
|
if (e.current) {
|
|
4461
4462
|
n(), window.addEventListener("resize", n);
|
|
@@ -4476,12 +4477,12 @@ const cn = {
|
|
|
4476
4477
|
userSelectionActive: e.userSelectionActive,
|
|
4477
4478
|
lib: e.lib
|
|
4478
4479
|
});
|
|
4479
|
-
function Hf({ 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: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: h = !0, children:
|
|
4480
|
-
const w = ee(), N = J(null), { userSelectionActive: k, lib: S } =
|
|
4480
|
+
function Hf({ 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: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: h = !0, children: g, noWheelClassName: y, noPanClassName: b, onViewportChange: x, isControlledViewport: _, paneClickDistance: p }) {
|
|
4481
|
+
const w = ee(), N = J(null), { userSelectionActive: k, lib: S } = K(Df, ne), P = yt(f), I = J();
|
|
4481
4482
|
Tf(N);
|
|
4482
4483
|
const A = ue((V) => {
|
|
4483
|
-
x?.({ x: V[0], y: V[1], zoom: V[2] }),
|
|
4484
|
-
}, [x,
|
|
4484
|
+
x?.({ x: V[0], y: V[1], zoom: V[2] }), _ || w.setState({ transform: V });
|
|
4485
|
+
}, [x, _]);
|
|
4485
4486
|
return j(() => {
|
|
4486
4487
|
if (N.current) {
|
|
4487
4488
|
I.current = Yd({
|
|
@@ -4490,19 +4491,19 @@ function Hf({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4490
4491
|
maxZoom: u,
|
|
4491
4492
|
translateExtent: l,
|
|
4492
4493
|
viewport: c,
|
|
4493
|
-
paneClickDistance:
|
|
4494
|
-
onDraggingChange: (
|
|
4495
|
-
onPanZoomStart: (
|
|
4496
|
-
const { onViewportChangeStart: v, onMoveStart:
|
|
4497
|
-
|
|
4494
|
+
paneClickDistance: p,
|
|
4495
|
+
onDraggingChange: (m) => w.setState({ paneDragging: m }),
|
|
4496
|
+
onPanZoomStart: (m, E) => {
|
|
4497
|
+
const { onViewportChangeStart: v, onMoveStart: C } = w.getState();
|
|
4498
|
+
C?.(m, E), v?.(E);
|
|
4498
4499
|
},
|
|
4499
|
-
onPanZoom: (
|
|
4500
|
-
const { onViewportChange: v, onMove:
|
|
4501
|
-
|
|
4500
|
+
onPanZoom: (m, E) => {
|
|
4501
|
+
const { onViewportChange: v, onMove: C } = w.getState();
|
|
4502
|
+
C?.(m, E), v?.(E);
|
|
4502
4503
|
},
|
|
4503
|
-
onPanZoomEnd: (
|
|
4504
|
-
const { onViewportChangeEnd: v, onMoveEnd:
|
|
4505
|
-
|
|
4504
|
+
onPanZoomEnd: (m, E) => {
|
|
4505
|
+
const { onViewportChangeEnd: v, onMoveEnd: C } = w.getState();
|
|
4506
|
+
C?.(m, E), v?.(E);
|
|
4506
4507
|
}
|
|
4507
4508
|
});
|
|
4508
4509
|
const { x: V, y: D, zoom: H } = I.current.getViewport();
|
|
@@ -4526,7 +4527,7 @@ function Hf({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4526
4527
|
panOnDrag: a,
|
|
4527
4528
|
zoomActivationKeyPressed: P,
|
|
4528
4529
|
preventScrolling: h,
|
|
4529
|
-
noPanClassName:
|
|
4530
|
+
noPanClassName: b,
|
|
4530
4531
|
userSelectionActive: k,
|
|
4531
4532
|
noWheelClassName: y,
|
|
4532
4533
|
lib: S,
|
|
@@ -4543,19 +4544,19 @@ function Hf({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4543
4544
|
a,
|
|
4544
4545
|
P,
|
|
4545
4546
|
h,
|
|
4546
|
-
|
|
4547
|
+
b,
|
|
4547
4548
|
k,
|
|
4548
4549
|
y,
|
|
4549
4550
|
S,
|
|
4550
4551
|
A
|
|
4551
|
-
]), z("div", { className: "react-flow__renderer", ref: N, style: cn, children:
|
|
4552
|
+
]), z("div", { className: "react-flow__renderer", ref: N, style: cn, children: g });
|
|
4552
4553
|
}
|
|
4553
4554
|
const Vf = (e) => ({
|
|
4554
4555
|
userSelectionActive: e.userSelectionActive,
|
|
4555
4556
|
userSelectionRect: e.userSelectionRect
|
|
4556
4557
|
});
|
|
4557
4558
|
function Of() {
|
|
4558
|
-
const { userSelectionActive: e, userSelectionRect: t } =
|
|
4559
|
+
const { userSelectionActive: e, userSelectionRect: t } = K(Vf, ne);
|
|
4559
4560
|
return e && t ? z("div", { className: "react-flow__selection react-flow__container", style: {
|
|
4560
4561
|
width: t.width,
|
|
4561
4562
|
height: t.height,
|
|
@@ -4570,12 +4571,12 @@ const Nn = (e, t) => (n) => {
|
|
|
4570
4571
|
dragging: e.paneDragging
|
|
4571
4572
|
});
|
|
4572
4573
|
function Lf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full, panOnDrag: o, selectionOnDrag: r, onSelectionStart: i, onSelectionEnd: s, onPaneClick: a, onPaneContextMenu: c, onPaneScroll: l, onPaneMouseEnter: d, onPaneMouseMove: u, onPaneMouseLeave: f, children: h }) {
|
|
4573
|
-
const
|
|
4574
|
+
const g = ee(), { userSelectionActive: y, elementsSelectable: b, dragging: x } = K(Rf, ne), _ = b && (e || y), p = J(null), w = J(), N = J(/* @__PURE__ */ new Set()), k = J(/* @__PURE__ */ new Set()), S = J(!1), P = J(!1), I = (v) => {
|
|
4574
4575
|
if (S.current) {
|
|
4575
4576
|
S.current = !1;
|
|
4576
4577
|
return;
|
|
4577
4578
|
}
|
|
4578
|
-
a?.(v),
|
|
4579
|
+
a?.(v), g.getState().resetSelectedElements(), g.setState({ nodesSelectionActive: !1 });
|
|
4579
4580
|
}, A = (v) => {
|
|
4580
4581
|
if (Array.isArray(o) && o?.includes(2)) {
|
|
4581
4582
|
v.preventDefault();
|
|
@@ -4583,36 +4584,36 @@ function Lf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full
|
|
|
4583
4584
|
}
|
|
4584
4585
|
c?.(v);
|
|
4585
4586
|
}, V = l ? (v) => l(v) : void 0, D = (v) => {
|
|
4586
|
-
const { resetSelectedElements:
|
|
4587
|
-
if (w.current = $?.getBoundingClientRect(), !
|
|
4587
|
+
const { resetSelectedElements: C, domNode: $ } = g.getState();
|
|
4588
|
+
if (w.current = $?.getBoundingClientRect(), !b || !e || v.button !== 0 || v.target !== p.current || !w.current)
|
|
4588
4589
|
return;
|
|
4589
4590
|
v.target?.setPointerCapture?.(v.pointerId), P.current = !0, S.current = !1;
|
|
4590
|
-
const { x:
|
|
4591
|
-
|
|
4591
|
+
const { x: M, y: T } = Ee(v.nativeEvent, w.current);
|
|
4592
|
+
C(), g.setState({
|
|
4592
4593
|
userSelectionRect: {
|
|
4593
4594
|
width: 0,
|
|
4594
4595
|
height: 0,
|
|
4595
|
-
startX:
|
|
4596
|
+
startX: M,
|
|
4596
4597
|
startY: T,
|
|
4597
|
-
x:
|
|
4598
|
+
x: M,
|
|
4598
4599
|
y: T
|
|
4599
4600
|
}
|
|
4600
4601
|
}), i?.(v);
|
|
4601
4602
|
}, H = (v) => {
|
|
4602
|
-
const { userSelectionRect:
|
|
4603
|
-
if (!w.current || !
|
|
4603
|
+
const { userSelectionRect: C, transform: $, nodeLookup: M, edgeLookup: T, connectionLookup: O, triggerNodeChanges: R, triggerEdgeChanges: Y, defaultEdgeOptions: X } = g.getState();
|
|
4604
|
+
if (!w.current || !C)
|
|
4604
4605
|
return;
|
|
4605
4606
|
S.current = !0;
|
|
4606
|
-
const { x: F, y: Z } =
|
|
4607
|
+
const { x: F, y: Z } = Ee(v.nativeEvent, w.current), { startX: L, startY: W } = C, G = {
|
|
4607
4608
|
startX: L,
|
|
4608
|
-
startY:
|
|
4609
|
+
startY: W,
|
|
4609
4610
|
x: F < L ? F : L,
|
|
4610
|
-
y: Z <
|
|
4611
|
+
y: Z < W ? Z : W,
|
|
4611
4612
|
width: Math.abs(F - L),
|
|
4612
|
-
height: Math.abs(Z -
|
|
4613
|
+
height: Math.abs(Z - W)
|
|
4613
4614
|
}, te = N.current, Q = k.current;
|
|
4614
|
-
N.current = new Set(oi(
|
|
4615
|
-
const q =
|
|
4615
|
+
N.current = new Set(oi(M, G, $, n === gt.Partial, !0).map((U) => U.id)), k.current = /* @__PURE__ */ new Set();
|
|
4616
|
+
const q = X?.selectable ?? !0;
|
|
4616
4617
|
for (const U of N.current) {
|
|
4617
4618
|
const oe = O.get(U);
|
|
4618
4619
|
if (oe)
|
|
@@ -4622,35 +4623,35 @@ function Lf({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = gt.Full
|
|
|
4622
4623
|
}
|
|
4623
4624
|
}
|
|
4624
4625
|
if (!Oo(te, N.current)) {
|
|
4625
|
-
const U = Le(
|
|
4626
|
+
const U = Le(M, N.current, !0);
|
|
4626
4627
|
R(U);
|
|
4627
4628
|
}
|
|
4628
4629
|
if (!Oo(Q, k.current)) {
|
|
4629
4630
|
const U = Le(T, k.current);
|
|
4630
|
-
|
|
4631
|
+
Y(U);
|
|
4631
4632
|
}
|
|
4632
|
-
|
|
4633
|
-
userSelectionRect:
|
|
4633
|
+
g.setState({
|
|
4634
|
+
userSelectionRect: G,
|
|
4634
4635
|
userSelectionActive: !0,
|
|
4635
4636
|
nodesSelectionActive: !1
|
|
4636
4637
|
});
|
|
4637
|
-
},
|
|
4638
|
+
}, m = (v) => {
|
|
4638
4639
|
if (v.button !== 0 || !P.current)
|
|
4639
4640
|
return;
|
|
4640
4641
|
v.target?.releasePointerCapture?.(v.pointerId);
|
|
4641
|
-
const { userSelectionRect:
|
|
4642
|
-
!y &&
|
|
4642
|
+
const { userSelectionRect: C } = g.getState();
|
|
4643
|
+
!y && C && v.target === p.current && I?.(v), g.setState({
|
|
4643
4644
|
userSelectionActive: !1,
|
|
4644
4645
|
userSelectionRect: null,
|
|
4645
4646
|
nodesSelectionActive: N.current.size > 0
|
|
4646
4647
|
}), s?.(v), (t || r) && (S.current = !1), P.current = !1;
|
|
4647
4648
|
}, E = o === !0 || Array.isArray(o) && o.includes(0);
|
|
4648
|
-
return se("div", { className: re(["react-flow__pane", { draggable: E, dragging: x, selection: e }]), onClick:
|
|
4649
|
+
return se("div", { className: re(["react-flow__pane", { draggable: E, dragging: x, selection: e }]), onClick: _ ? void 0 : Nn(I, p), onContextMenu: Nn(A, p), onWheel: Nn(V, p), onPointerEnter: _ ? void 0 : d, onPointerDown: _ ? D : u, onPointerMove: _ ? H : u, onPointerUp: _ ? m : void 0, onPointerLeave: f, ref: p, style: cn, children: [h, z(Of, {})] });
|
|
4649
4650
|
}
|
|
4650
4651
|
function Xn({ id: e, store: t, unselect: n = !1, nodeRef: o }) {
|
|
4651
4652
|
const { addSelectedNodes: r, unselectNodesAndEdges: i, multiSelectionActive: s, nodeLookup: a, onError: c } = t.getState(), l = a.get(e);
|
|
4652
4653
|
if (!l) {
|
|
4653
|
-
c?.("012",
|
|
4654
|
+
c?.("012", xe.error012(e));
|
|
4654
4655
|
return;
|
|
4655
4656
|
}
|
|
4656
4657
|
t.setState({ nodesSelectionActive: !1 }), l.selected ? (n || l.selected && s) && (i({ nodes: [l], edges: [] }), requestAnimationFrame(() => o?.current?.blur())) : r([e]);
|
|
@@ -4694,24 +4695,24 @@ const Bf = (e) => (t) => t.selected && (t.draggable || e && typeof t.draggable >
|
|
|
4694
4695
|
function Oi() {
|
|
4695
4696
|
const e = ee();
|
|
4696
4697
|
return ue((n) => {
|
|
4697
|
-
const { nodeExtent: o, snapToGrid: r, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: l, nodeOrigin: d } = e.getState(), u = /* @__PURE__ */ new Map(), f = Bf(s), h = r ? i[0] : 5,
|
|
4698
|
+
const { nodeExtent: o, snapToGrid: r, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: l, nodeOrigin: d } = e.getState(), u = /* @__PURE__ */ new Map(), f = Bf(s), h = r ? i[0] : 5, g = r ? i[1] : 5, y = n.direction.x * h * n.factor, b = n.direction.y * g * n.factor;
|
|
4698
4699
|
for (const [, x] of l) {
|
|
4699
4700
|
if (!f(x))
|
|
4700
4701
|
continue;
|
|
4701
|
-
let
|
|
4702
|
+
let _ = {
|
|
4702
4703
|
x: x.internals.positionAbsolute.x + y,
|
|
4703
|
-
y: x.internals.positionAbsolute.y +
|
|
4704
|
+
y: x.internals.positionAbsolute.y + b
|
|
4704
4705
|
};
|
|
4705
|
-
r && (
|
|
4706
|
-
const { position:
|
|
4706
|
+
r && (_ = nn(_, i));
|
|
4707
|
+
const { position: p, positionAbsolute: w } = ri({
|
|
4707
4708
|
nodeId: x.id,
|
|
4708
|
-
nextPosition:
|
|
4709
|
+
nextPosition: _,
|
|
4709
4710
|
nodeLookup: l,
|
|
4710
4711
|
nodeExtent: o,
|
|
4711
4712
|
nodeOrigin: d,
|
|
4712
4713
|
onError: a
|
|
4713
4714
|
});
|
|
4714
|
-
x.position =
|
|
4715
|
+
x.position = p, x.internals.positionAbsolute = w, u.set(x.id, x);
|
|
4715
4716
|
}
|
|
4716
4717
|
c(u);
|
|
4717
4718
|
}, []);
|
|
@@ -4730,85 +4731,86 @@ const co = () => wt(ao), Xf = (e) => ({
|
|
|
4730
4731
|
clickConnecting: r?.nodeId === e && r?.id === t && r?.type === n,
|
|
4731
4732
|
isPossibleEndHandle: i === We.Strict ? a?.type !== n : e !== a?.nodeId || t !== a?.id,
|
|
4732
4733
|
connectionInProcess: !!a,
|
|
4734
|
+
clickConnectionInProcess: !!r,
|
|
4733
4735
|
valid: d && l
|
|
4734
4736
|
};
|
|
4735
4737
|
};
|
|
4736
4738
|
function Zf({ type: e = "source", position: t = B.Top, isValidConnection: n, isConnectable: o = !0, isConnectableStart: r = !0, isConnectableEnd: i = !0, id: s, onConnect: a, children: c, className: l, onMouseDown: d, onTouchStart: u, ...f }, h) {
|
|
4737
|
-
const
|
|
4738
|
-
x ||
|
|
4739
|
-
const
|
|
4740
|
-
const { defaultEdgeOptions:
|
|
4741
|
-
...
|
|
4742
|
-
...
|
|
4739
|
+
const g = s || null, y = e === "target", b = ee(), x = co(), { connectOnClick: _, noPanClassName: p, rfId: w } = K(Xf, ne), { connectingFrom: N, connectingTo: k, clickConnecting: S, isPossibleEndHandle: P, connectionInProcess: I, clickConnectionInProcess: A, valid: V } = K(Yf(x, g, e), ne);
|
|
4740
|
+
x || b.getState().onError?.("010", xe.error010());
|
|
4741
|
+
const D = (E) => {
|
|
4742
|
+
const { defaultEdgeOptions: v, onConnect: C, hasDefaultEdges: $ } = b.getState(), M = {
|
|
4743
|
+
...v,
|
|
4744
|
+
...E
|
|
4743
4745
|
};
|
|
4744
|
-
if (
|
|
4745
|
-
const { edges:
|
|
4746
|
-
|
|
4746
|
+
if ($) {
|
|
4747
|
+
const { edges: T, setEdges: O } = b.getState();
|
|
4748
|
+
O(md(M, T));
|
|
4747
4749
|
}
|
|
4748
|
-
|
|
4749
|
-
},
|
|
4750
|
+
C?.(M), a?.(M);
|
|
4751
|
+
}, H = (E) => {
|
|
4750
4752
|
if (!x)
|
|
4751
4753
|
return;
|
|
4752
|
-
const
|
|
4753
|
-
if (r && (
|
|
4754
|
-
const
|
|
4755
|
-
Fn.onPointerDown(
|
|
4756
|
-
autoPanOnConnect:
|
|
4757
|
-
connectionMode:
|
|
4758
|
-
connectionRadius:
|
|
4759
|
-
domNode:
|
|
4760
|
-
nodeLookup:
|
|
4761
|
-
lib:
|
|
4754
|
+
const v = fi(E.nativeEvent);
|
|
4755
|
+
if (r && (v && E.button === 0 || !v)) {
|
|
4756
|
+
const C = b.getState();
|
|
4757
|
+
Fn.onPointerDown(E.nativeEvent, {
|
|
4758
|
+
autoPanOnConnect: C.autoPanOnConnect,
|
|
4759
|
+
connectionMode: C.connectionMode,
|
|
4760
|
+
connectionRadius: C.connectionRadius,
|
|
4761
|
+
domNode: C.domNode,
|
|
4762
|
+
nodeLookup: C.nodeLookup,
|
|
4763
|
+
lib: C.lib,
|
|
4762
4764
|
isTarget: y,
|
|
4763
|
-
handleId:
|
|
4765
|
+
handleId: g,
|
|
4764
4766
|
nodeId: x,
|
|
4765
|
-
flowId:
|
|
4766
|
-
panBy:
|
|
4767
|
-
cancelConnection:
|
|
4768
|
-
onConnectStart:
|
|
4769
|
-
onConnectEnd:
|
|
4770
|
-
updateConnection:
|
|
4771
|
-
onConnect:
|
|
4772
|
-
isValidConnection: n ||
|
|
4773
|
-
getTransform: () =>
|
|
4774
|
-
getFromHandle: () =>
|
|
4775
|
-
autoPanSpeed:
|
|
4767
|
+
flowId: C.rfId,
|
|
4768
|
+
panBy: C.panBy,
|
|
4769
|
+
cancelConnection: C.cancelConnection,
|
|
4770
|
+
onConnectStart: C.onConnectStart,
|
|
4771
|
+
onConnectEnd: C.onConnectEnd,
|
|
4772
|
+
updateConnection: C.updateConnection,
|
|
4773
|
+
onConnect: D,
|
|
4774
|
+
isValidConnection: n || C.isValidConnection,
|
|
4775
|
+
getTransform: () => b.getState().transform,
|
|
4776
|
+
getFromHandle: () => b.getState().connection.fromHandle,
|
|
4777
|
+
autoPanSpeed: C.autoPanSpeed
|
|
4776
4778
|
});
|
|
4777
4779
|
}
|
|
4778
|
-
|
|
4779
|
-
},
|
|
4780
|
-
const { onClickConnectStart:
|
|
4781
|
-
if (!x ||
|
|
4780
|
+
v ? d?.(E) : u?.(E);
|
|
4781
|
+
}, m = (E) => {
|
|
4782
|
+
const { onClickConnectStart: v, onClickConnectEnd: C, connectionClickStartHandle: $, connectionMode: M, isValidConnection: T, lib: O, rfId: R, nodeLookup: Y, connection: X } = b.getState();
|
|
4783
|
+
if (!x || !$ && !r)
|
|
4782
4784
|
return;
|
|
4783
|
-
if (
|
|
4784
|
-
|
|
4785
|
+
if (!$) {
|
|
4786
|
+
v?.(E.nativeEvent, { nodeId: x, handleId: g, handleType: e }), b.setState({ connectionClickStartHandle: { nodeId: x, type: e, id: g } });
|
|
4785
4787
|
return;
|
|
4786
4788
|
}
|
|
4787
|
-
const
|
|
4789
|
+
const F = di(E.target), Z = n || T, { connection: L, isValid: W } = Fn.isValid(E.nativeEvent, {
|
|
4788
4790
|
handle: {
|
|
4789
4791
|
nodeId: x,
|
|
4790
|
-
id:
|
|
4792
|
+
id: g,
|
|
4791
4793
|
type: e
|
|
4792
4794
|
},
|
|
4793
|
-
connectionMode:
|
|
4794
|
-
fromNodeId:
|
|
4795
|
-
fromHandleId:
|
|
4796
|
-
fromType:
|
|
4797
|
-
isValidConnection:
|
|
4798
|
-
flowId:
|
|
4799
|
-
doc:
|
|
4800
|
-
lib:
|
|
4801
|
-
nodeLookup:
|
|
4795
|
+
connectionMode: M,
|
|
4796
|
+
fromNodeId: $.nodeId,
|
|
4797
|
+
fromHandleId: $.id || null,
|
|
4798
|
+
fromType: $.type,
|
|
4799
|
+
isValidConnection: Z,
|
|
4800
|
+
flowId: R,
|
|
4801
|
+
doc: F,
|
|
4802
|
+
lib: O,
|
|
4803
|
+
nodeLookup: Y
|
|
4802
4804
|
});
|
|
4803
|
-
|
|
4804
|
-
const
|
|
4805
|
-
delete
|
|
4805
|
+
W && L && D(L);
|
|
4806
|
+
const G = structuredClone(X);
|
|
4807
|
+
delete G.inProgress, G.toPosition = G.toHandle ? G.toHandle.position : null, C?.(E, G), b.setState({ connectionClickStartHandle: null });
|
|
4806
4808
|
};
|
|
4807
|
-
return z("div", { "data-handleid":
|
|
4809
|
+
return z("div", { "data-handleid": g, "data-nodeid": x, "data-handlepos": t, "data-id": `${w}-${x}-${g}-${e}`, className: re([
|
|
4808
4810
|
"react-flow__handle",
|
|
4809
4811
|
`react-flow__handle-${t}`,
|
|
4810
4812
|
"nodrag",
|
|
4811
|
-
|
|
4813
|
+
p,
|
|
4812
4814
|
l,
|
|
4813
4815
|
{
|
|
4814
4816
|
source: !y,
|
|
@@ -4819,27 +4821,27 @@ function Zf({ type: e = "source", position: t = B.Top, isValidConnection: n, isC
|
|
|
4819
4821
|
clickconnecting: S,
|
|
4820
4822
|
connectingfrom: N,
|
|
4821
4823
|
connectingto: k,
|
|
4822
|
-
valid:
|
|
4824
|
+
valid: V,
|
|
4823
4825
|
/*
|
|
4824
4826
|
* shows where you can start a connection from
|
|
4825
4827
|
* and where you can end it while connecting
|
|
4826
4828
|
*/
|
|
4827
|
-
connectionindicator: o && (!I || P) && (I ? i : r)
|
|
4829
|
+
connectionindicator: o && (!I || P) && (I || A ? i : r)
|
|
4828
4830
|
}
|
|
4829
|
-
]), onMouseDown:
|
|
4831
|
+
]), onMouseDown: H, onTouchStart: H, onClick: _ ? m : void 0, ref: h, ...f, children: c });
|
|
4830
4832
|
}
|
|
4831
4833
|
const Wt = ie(Di(Zf));
|
|
4832
4834
|
function Wf({ data: e, isConnectable: t, sourcePosition: n = B.Bottom }) {
|
|
4833
|
-
return se(
|
|
4835
|
+
return se(Ne, { children: [e?.label, z(Wt, { type: "source", position: n, isConnectable: t })] });
|
|
4834
4836
|
}
|
|
4835
4837
|
function qf({ data: e, isConnectable: t, targetPosition: n = B.Top, sourcePosition: o = B.Bottom }) {
|
|
4836
|
-
return se(
|
|
4838
|
+
return se(Ne, { children: [z(Wt, { type: "target", position: n, isConnectable: t }), e?.label, z(Wt, { type: "source", position: o, isConnectable: t })] });
|
|
4837
4839
|
}
|
|
4838
4840
|
function Gf() {
|
|
4839
4841
|
return null;
|
|
4840
4842
|
}
|
|
4841
4843
|
function Kf({ data: e, isConnectable: t, targetPosition: n = B.Top }) {
|
|
4842
|
-
return se(
|
|
4844
|
+
return se(Ne, { children: [z(Wt, { type: "target", position: n, isConnectable: t }), e?.label] });
|
|
4843
4845
|
}
|
|
4844
4846
|
const qt = {
|
|
4845
4847
|
ArrowUp: { x: 0, y: -1 },
|
|
@@ -4873,7 +4875,7 @@ const Qf = (e) => {
|
|
|
4873
4875
|
};
|
|
4874
4876
|
};
|
|
4875
4877
|
function Jf({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
|
|
4876
|
-
const o = ee(), { width: r, height: i, transformString: s, userSelectionActive: a } =
|
|
4878
|
+
const o = ee(), { width: r, height: i, transformString: s, userSelectionActive: a } = K(Qf, ne), c = Oi(), l = J(null);
|
|
4877
4879
|
if (j(() => {
|
|
4878
4880
|
n || l.current?.focus({
|
|
4879
4881
|
preventScroll: !0
|
|
@@ -4883,7 +4885,7 @@ function Jf({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
4883
4885
|
}), a || !r || !i)
|
|
4884
4886
|
return null;
|
|
4885
4887
|
const d = e ? (f) => {
|
|
4886
|
-
const h = o.getState().nodes.filter((
|
|
4888
|
+
const h = o.getState().nodes.filter((g) => g.selected);
|
|
4887
4889
|
e(f, h);
|
|
4888
4890
|
} : void 0, u = (f) => {
|
|
4889
4891
|
Object.prototype.hasOwnProperty.call(qt, f.key) && (f.preventDefault(), c({
|
|
@@ -4899,18 +4901,18 @@ function Jf({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
4899
4901
|
} }) });
|
|
4900
4902
|
}
|
|
4901
4903
|
const ur = typeof window < "u" ? window : void 0, jf = (e) => ({ nodesSelectionActive: e.nodesSelectionActive, userSelectionActive: e.userSelectionActive });
|
|
4902
|
-
function Ri({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: h, multiSelectionKeyCode:
|
|
4903
|
-
const { nodesSelectionActive: T, userSelectionActive: O } =
|
|
4904
|
-
return zf({ deleteKeyCode: c, multiSelectionKeyCode:
|
|
4904
|
+
function Ri({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: h, multiSelectionKeyCode: g, panActivationKeyCode: y, zoomActivationKeyCode: b, elementsSelectable: x, zoomOnScroll: _, zoomOnPinch: p, panOnScroll: w, panOnScrollSpeed: N, panOnScrollMode: k, zoomOnDoubleClick: S, panOnDrag: P, defaultViewport: I, translateExtent: A, minZoom: V, maxZoom: D, preventScrolling: H, onSelectionContextMenu: m, noWheelClassName: E, noPanClassName: v, disableKeyboardA11y: C, onViewportChange: $, isControlledViewport: M }) {
|
|
4905
|
+
const { nodesSelectionActive: T, userSelectionActive: O } = K(jf), R = yt(l, { target: ur }), Y = yt(y, { target: ur }), X = Y || P, F = Y || w, Z = d && X !== !0, L = R || O || Z;
|
|
4906
|
+
return zf({ deleteKeyCode: c, multiSelectionKeyCode: g }), z(Hf, { onPaneContextMenu: i, elementsSelectable: x, zoomOnScroll: _, zoomOnPinch: p, panOnScroll: F, panOnScrollSpeed: N, panOnScrollMode: k, zoomOnDoubleClick: S, panOnDrag: !R && X, defaultViewport: I, translateExtent: A, minZoom: V, maxZoom: D, zoomActivationKeyCode: b, preventScrolling: H, noWheelClassName: E, noPanClassName: v, onViewportChange: $, isControlledViewport: M, paneClickDistance: a, children: se(Lf, { onSelectionStart: f, onSelectionEnd: h, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: o, onPaneMouseLeave: r, onPaneContextMenu: i, onPaneScroll: s, panOnDrag: X, isSelecting: !!L, selectionMode: u, selectionKeyPressed: R, selectionOnDrag: Z, children: [e, T && z(Jf, { onSelectionContextMenu: m, noPanClassName: v, disableKeyboardA11y: C })] }) });
|
|
4905
4907
|
}
|
|
4906
4908
|
Ri.displayName = "FlowRenderer";
|
|
4907
4909
|
const eh = ie(Ri), th = (e) => (t) => e ? oi(t.nodeLookup, { x: 0, y: 0, width: t.width, height: t.height }, t.transform, !0).map((n) => n.id) : Array.from(t.nodeLookup.keys());
|
|
4908
4910
|
function nh(e) {
|
|
4909
|
-
return
|
|
4911
|
+
return K(ue(th(e), [e]), ne);
|
|
4910
4912
|
}
|
|
4911
4913
|
const oh = (e) => e.updateNodeInternals;
|
|
4912
4914
|
function rh() {
|
|
4913
|
-
const e =
|
|
4915
|
+
const e = K(oh), [t] = fe(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((n) => {
|
|
4914
4916
|
const o = /* @__PURE__ */ new Map();
|
|
4915
4917
|
n.forEach((r) => {
|
|
4916
4918
|
const i = r.target.getAttribute("data-id");
|
|
@@ -4938,46 +4940,46 @@ function ih({ node: e, nodeType: t, hasDimensions: n, resizeObserver: o }) {
|
|
|
4938
4940
|
}
|
|
4939
4941
|
}, [e.id, t, e.sourcePosition, e.targetPosition]), i;
|
|
4940
4942
|
}
|
|
4941
|
-
function sh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave: r, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: h, disableKeyboardA11y:
|
|
4942
|
-
const { node:
|
|
4943
|
-
const
|
|
4943
|
+
function sh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave: r, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: h, disableKeyboardA11y: g, rfId: y, nodeTypes: b, nodeClickDistance: x, onError: _ }) {
|
|
4944
|
+
const { node: p, internals: w, isParent: N } = K((L) => {
|
|
4945
|
+
const W = L.nodeLookup.get(e), G = L.parentLookup.has(e);
|
|
4944
4946
|
return {
|
|
4945
|
-
node:
|
|
4946
|
-
internals:
|
|
4947
|
-
isParent:
|
|
4947
|
+
node: W,
|
|
4948
|
+
internals: W.internals,
|
|
4949
|
+
isParent: G
|
|
4948
4950
|
};
|
|
4949
4951
|
}, ne);
|
|
4950
|
-
let k =
|
|
4951
|
-
S === void 0 && (
|
|
4952
|
-
const P = !!(
|
|
4953
|
-
nodeRef:
|
|
4954
|
-
disabled:
|
|
4952
|
+
let k = p.type || "default", S = b?.[k] || lr[k];
|
|
4953
|
+
S === void 0 && (_?.("003", xe.error003(k)), k = "default", S = lr.default);
|
|
4954
|
+
const P = !!(p.draggable || a && typeof p.draggable > "u"), I = !!(p.selectable || c && typeof p.selectable > "u"), A = !!(p.connectable || l && typeof p.connectable > "u"), V = !!(p.focusable || d && typeof p.focusable > "u"), D = ee(), H = li(p), m = ih({ node: p, nodeType: k, hasDimensions: H, resizeObserver: u }), E = Vi({
|
|
4955
|
+
nodeRef: m,
|
|
4956
|
+
disabled: p.hidden || !P,
|
|
4955
4957
|
noDragClassName: f,
|
|
4956
|
-
handleSelector:
|
|
4958
|
+
handleSelector: p.dragHandle,
|
|
4957
4959
|
nodeId: e,
|
|
4958
4960
|
isSelectable: I,
|
|
4959
4961
|
nodeClickDistance: x
|
|
4960
4962
|
}), v = Oi();
|
|
4961
|
-
if (
|
|
4963
|
+
if (p.hidden)
|
|
4962
4964
|
return null;
|
|
4963
|
-
const
|
|
4964
|
-
const { selectNodesOnDrag:
|
|
4965
|
-
I && (!
|
|
4965
|
+
const C = Ce(p), $ = Uf(p), M = I || P || t || n || o || r, T = n ? (L) => n(L, { ...w.userNode }) : void 0, O = o ? (L) => o(L, { ...w.userNode }) : void 0, R = r ? (L) => r(L, { ...w.userNode }) : void 0, Y = i ? (L) => i(L, { ...w.userNode }) : void 0, X = s ? (L) => s(L, { ...w.userNode }) : void 0, F = (L) => {
|
|
4966
|
+
const { selectNodesOnDrag: W, nodeDragThreshold: G } = D.getState();
|
|
4967
|
+
I && (!W || !P || G > 0) && Xn({
|
|
4966
4968
|
id: e,
|
|
4967
4969
|
store: D,
|
|
4968
|
-
nodeRef:
|
|
4970
|
+
nodeRef: m
|
|
4969
4971
|
}), t && t(L, { ...w.userNode });
|
|
4970
4972
|
}, Z = (L) => {
|
|
4971
|
-
if (!(On(L.nativeEvent) ||
|
|
4973
|
+
if (!(On(L.nativeEvent) || g))
|
|
4972
4974
|
if (jr.includes(L.key) && I) {
|
|
4973
|
-
const
|
|
4975
|
+
const W = L.key === "Escape";
|
|
4974
4976
|
Xn({
|
|
4975
4977
|
id: e,
|
|
4976
4978
|
store: D,
|
|
4977
|
-
unselect:
|
|
4978
|
-
nodeRef:
|
|
4979
|
+
unselect: W,
|
|
4980
|
+
nodeRef: m
|
|
4979
4981
|
});
|
|
4980
|
-
} else P &&
|
|
4982
|
+
} else P && p.selected && Object.prototype.hasOwnProperty.call(qt, L.key) && (L.preventDefault(), D.setState({
|
|
4981
4983
|
ariaLiveMessage: `Moved selected node ${L.key.replace("Arrow", "").toLowerCase()}. New position, x: ${~~w.positionAbsolute.x}, y: ${~~w.positionAbsolute.y}`
|
|
4982
4984
|
}), v({
|
|
4983
4985
|
direction: qt[L.key],
|
|
@@ -4991,22 +4993,22 @@ function sh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: o, onMouseLeave:
|
|
|
4991
4993
|
// this is overwritable by passing `nopan` as a class name
|
|
4992
4994
|
[h]: P
|
|
4993
4995
|
},
|
|
4994
|
-
|
|
4996
|
+
p.className,
|
|
4995
4997
|
{
|
|
4996
|
-
selected:
|
|
4998
|
+
selected: p.selected,
|
|
4997
4999
|
selectable: I,
|
|
4998
5000
|
parent: N,
|
|
4999
5001
|
draggable: P,
|
|
5000
5002
|
dragging: E
|
|
5001
5003
|
}
|
|
5002
|
-
]), ref:
|
|
5004
|
+
]), ref: m, style: {
|
|
5003
5005
|
zIndex: w.z,
|
|
5004
5006
|
transform: `translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,
|
|
5005
|
-
pointerEvents:
|
|
5007
|
+
pointerEvents: M ? "all" : "none",
|
|
5006
5008
|
visibility: H ? "visible" : "hidden",
|
|
5007
|
-
...
|
|
5009
|
+
...p.style,
|
|
5008
5010
|
...$
|
|
5009
|
-
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: T, onMouseMove: O, onMouseLeave: R, onContextMenu:
|
|
5011
|
+
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: T, onMouseMove: O, onMouseLeave: R, onContextMenu: Y, onClick: F, onDoubleClick: X, onKeyDown: V ? Z : void 0, tabIndex: V ? 0 : void 0, role: V ? "button" : void 0, "aria-describedby": g ? void 0 : `${$i}-${y}`, "aria-label": p.ariaLabel, children: z(Ff, { value: e, children: z(S, { id: e, data: p.data, type: k, positionAbsoluteX: w.positionAbsolute.x, positionAbsoluteY: w.positionAbsolute.y, selected: p.selected ?? !1, selectable: I, draggable: P, deletable: p.deletable ?? !0, isConnectable: A, sourcePosition: p.sourcePosition, targetPosition: p.targetPosition, dragging: E, dragHandle: p.dragHandle, zIndex: w.z, parentId: p.parentId, ...C }) }) });
|
|
5010
5012
|
}
|
|
5011
5013
|
const ah = (e) => ({
|
|
5012
5014
|
nodesDraggable: e.nodesDraggable,
|
|
@@ -5016,7 +5018,7 @@ const ah = (e) => ({
|
|
|
5016
5018
|
onError: e.onError
|
|
5017
5019
|
});
|
|
5018
5020
|
function Li(e) {
|
|
5019
|
-
const { nodesDraggable: t, nodesConnectable: n, nodesFocusable: o, elementsSelectable: r, onError: i } =
|
|
5021
|
+
const { nodesDraggable: t, nodesConnectable: n, nodesFocusable: o, elementsSelectable: r, onError: i } = K(ah, ne), s = nh(e.onlyRenderVisibleElements), a = rh();
|
|
5020
5022
|
return z("div", { className: "react-flow__nodes", style: cn, children: s.map((c) => (
|
|
5021
5023
|
/*
|
|
5022
5024
|
* The split of responsibilities between NodeRenderer and
|
|
@@ -5049,7 +5051,7 @@ function Li(e) {
|
|
|
5049
5051
|
Li.displayName = "NodeRenderer";
|
|
5050
5052
|
const ch = ie(Li);
|
|
5051
5053
|
function lh(e) {
|
|
5052
|
-
return
|
|
5054
|
+
return K(ue((n) => {
|
|
5053
5055
|
if (!e)
|
|
5054
5056
|
return n.edges.map((r) => r.id);
|
|
5055
5057
|
const o = [];
|
|
@@ -5080,13 +5082,13 @@ const uh = ({ color: e = "none", strokeWidth: t = 1 }) => z("polyline", { style:
|
|
|
5080
5082
|
};
|
|
5081
5083
|
function fh(e) {
|
|
5082
5084
|
const t = ee();
|
|
5083
|
-
return me(() => Object.prototype.hasOwnProperty.call(dr, e) ? dr[e] : (t.getState().onError?.("009",
|
|
5085
|
+
return me(() => Object.prototype.hasOwnProperty.call(dr, e) ? dr[e] : (t.getState().onError?.("009", xe.error009(e)), null), [e]);
|
|
5084
5086
|
}
|
|
5085
5087
|
const hh = ({ id: e, type: t, color: n, width: o = 12.5, height: r = 12.5, markerUnits: i = "strokeWidth", strokeWidth: s, orient: a = "auto-start-reverse" }) => {
|
|
5086
5088
|
const c = fh(t);
|
|
5087
5089
|
return c ? z("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: z(c, { color: n, strokeWidth: s }) }) : null;
|
|
5088
5090
|
}, Bi = ({ defaultColor: e, rfId: t }) => {
|
|
5089
|
-
const n =
|
|
5091
|
+
const n = K((i) => i.edges), o = K((i) => i.defaultEdgeOptions), r = me(() => _d(n, {
|
|
5090
5092
|
id: t,
|
|
5091
5093
|
defaultColor: e,
|
|
5092
5094
|
defaultMarkerStart: o?.markerStart,
|
|
@@ -5097,10 +5099,10 @@ const hh = ({ id: e, type: t, color: n, width: o = 12.5, height: r = 12.5, marke
|
|
|
5097
5099
|
Bi.displayName = "MarkerDefinitions";
|
|
5098
5100
|
var gh = ie(Bi);
|
|
5099
5101
|
function Fi({ x: e, y: t, label: n, labelStyle: o = {}, labelShowBg: r = !0, labelBgStyle: i = {}, labelBgPadding: s = [2, 4], labelBgBorderRadius: a = 2, children: c, className: l, ...d }) {
|
|
5100
|
-
const [u, f] = fe({ x: 1, y: 0, width: 0, height: 0 }), h = re(["react-flow__edge-textwrapper", l]),
|
|
5102
|
+
const [u, f] = fe({ x: 1, y: 0, width: 0, height: 0 }), h = re(["react-flow__edge-textwrapper", l]), g = J(null);
|
|
5101
5103
|
return j(() => {
|
|
5102
|
-
if (
|
|
5103
|
-
const y =
|
|
5104
|
+
if (g.current) {
|
|
5105
|
+
const y = g.current.getBBox();
|
|
5104
5106
|
f({
|
|
5105
5107
|
x: y.x,
|
|
5106
5108
|
y: y.y,
|
|
@@ -5108,12 +5110,12 @@ function Fi({ x: e, y: t, label: n, labelStyle: o = {}, labelShowBg: r = !0, lab
|
|
|
5108
5110
|
height: y.height
|
|
5109
5111
|
});
|
|
5110
5112
|
}
|
|
5111
|
-
}, [n]), typeof n > "u" || !n ? null : se("g", { transform: `translate(${e - u.width / 2} ${t - u.height / 2})`, className: h, visibility: u.width ? "visible" : "hidden", ...d, children: [r && z("rect", { width: u.width + 2 * s[0], x: -s[0], y: -s[1], height: u.height + 2 * s[1], className: "react-flow__edge-textbg", style: i, rx: a, ry: a }), z("text", { className: "react-flow__edge-text", y: u.height / 2, dy: "0.3em", ref:
|
|
5113
|
+
}, [n]), typeof n > "u" || !n ? null : se("g", { transform: `translate(${e - u.width / 2} ${t - u.height / 2})`, className: h, visibility: u.width ? "visible" : "hidden", ...d, children: [r && z("rect", { width: u.width + 2 * s[0], x: -s[0], y: -s[1], height: u.height + 2 * s[1], className: "react-flow__edge-textbg", style: i, rx: a, ry: a }), z("text", { className: "react-flow__edge-text", y: u.height / 2, dy: "0.3em", ref: g, style: o, children: n }), c] });
|
|
5112
5114
|
}
|
|
5113
5115
|
Fi.displayName = "EdgeText";
|
|
5114
5116
|
const ph = ie(Fi);
|
|
5115
5117
|
function ln({ path: e, labelX: t, labelY: n, label: o, labelStyle: r, labelShowBg: i, labelBgStyle: s, labelBgPadding: a, labelBgBorderRadius: c, interactionWidth: l = 20, ...d }) {
|
|
5116
|
-
return se(
|
|
5118
|
+
return se(Ne, { children: [z("path", { ...d, d: e, fill: "none", className: re(["react-flow__edge-path", d.className]) }), l && z("path", { d: e, fill: "none", strokeOpacity: 0, strokeWidth: l, className: "react-flow__edge-interaction" }), o && pe(t) && pe(n) ? z(ph, { x: t, y: n, label: o, labelStyle: r, labelShowBg: i, labelBgStyle: s, labelBgPadding: a, labelBgBorderRadius: c }) : null] });
|
|
5117
5119
|
}
|
|
5118
5120
|
function fr({ pos: e, x1: t, y1: n, x2: o, y2: r }) {
|
|
5119
5121
|
return e === B.Left || e === B.Right ? [0.5 * (t + o), n] : [t, 0.5 * (n + r)];
|
|
@@ -5150,8 +5152,8 @@ function Xi({ sourceX: e, sourceY: t, sourcePosition: n = B.Bottom, targetX: o,
|
|
|
5150
5152
|
];
|
|
5151
5153
|
}
|
|
5152
5154
|
function Yi(e) {
|
|
5153
|
-
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, sourcePosition: s = B.Bottom, targetPosition: a = B.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style:
|
|
5154
|
-
const [
|
|
5155
|
+
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, sourcePosition: s = B.Bottom, targetPosition: a = B.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style: g, markerEnd: y, markerStart: b, interactionWidth: x }) => {
|
|
5156
|
+
const [_, p, w] = Xi({
|
|
5155
5157
|
sourceX: n,
|
|
5156
5158
|
sourceY: o,
|
|
5157
5159
|
sourcePosition: s,
|
|
@@ -5159,25 +5161,25 @@ function Yi(e) {
|
|
|
5159
5161
|
targetY: i,
|
|
5160
5162
|
targetPosition: a
|
|
5161
5163
|
}), N = e.isInternal ? void 0 : t;
|
|
5162
|
-
return z(ln, { id: N, path:
|
|
5164
|
+
return z(ln, { id: N, path: _, labelX: p, labelY: w, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style: g, markerEnd: y, markerStart: b, interactionWidth: x });
|
|
5163
5165
|
});
|
|
5164
5166
|
}
|
|
5165
5167
|
const mh = Yi({ isInternal: !1 }), Zi = Yi({ isInternal: !0 });
|
|
5166
5168
|
mh.displayName = "SimpleBezierEdge";
|
|
5167
5169
|
Zi.displayName = "SimpleBezierEdgeInternal";
|
|
5168
5170
|
function Wi(e) {
|
|
5169
|
-
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: h = B.Bottom, targetPosition:
|
|
5170
|
-
const [
|
|
5171
|
+
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: h = B.Bottom, targetPosition: g = B.Top, markerEnd: y, markerStart: b, pathOptions: x, interactionWidth: _ }) => {
|
|
5172
|
+
const [p, w, N] = Rn({
|
|
5171
5173
|
sourceX: n,
|
|
5172
5174
|
sourceY: o,
|
|
5173
5175
|
sourcePosition: h,
|
|
5174
5176
|
targetX: r,
|
|
5175
5177
|
targetY: i,
|
|
5176
|
-
targetPosition:
|
|
5178
|
+
targetPosition: g,
|
|
5177
5179
|
borderRadius: x?.borderRadius,
|
|
5178
5180
|
offset: x?.offset
|
|
5179
5181
|
}), k = e.isInternal ? void 0 : t;
|
|
5180
|
-
return z(ln, { id: k, path:
|
|
5182
|
+
return z(ln, { id: k, path: p, labelX: w, labelY: N, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: y, markerStart: b, interactionWidth: _ });
|
|
5181
5183
|
});
|
|
5182
5184
|
}
|
|
5183
5185
|
const qi = Wi({ isInternal: !1 }), Gi = Wi({ isInternal: !0 });
|
|
@@ -5193,17 +5195,17 @@ const yh = Ki({ isInternal: !1 }), Ui = Ki({ isInternal: !0 });
|
|
|
5193
5195
|
yh.displayName = "StepEdge";
|
|
5194
5196
|
Ui.displayName = "StepEdgeInternal";
|
|
5195
5197
|
function Qi(e) {
|
|
5196
|
-
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: h, markerStart:
|
|
5197
|
-
const [
|
|
5198
|
-
return z(ln, { id:
|
|
5198
|
+
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: h, markerStart: g, interactionWidth: y }) => {
|
|
5199
|
+
const [b, x, _] = mi({ sourceX: n, sourceY: o, targetX: r, targetY: i }), p = e.isInternal ? void 0 : t;
|
|
5200
|
+
return z(ln, { id: p, path: b, labelX: x, labelY: _, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: h, markerStart: g, interactionWidth: y });
|
|
5199
5201
|
});
|
|
5200
5202
|
}
|
|
5201
5203
|
const wh = Qi({ isInternal: !1 }), Ji = Qi({ isInternal: !0 });
|
|
5202
5204
|
wh.displayName = "StraightEdge";
|
|
5203
5205
|
Ji.displayName = "StraightEdgeInternal";
|
|
5204
5206
|
function ji(e) {
|
|
5205
|
-
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, sourcePosition: s = B.Bottom, targetPosition: a = B.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style:
|
|
5206
|
-
const [
|
|
5207
|
+
return ie(({ id: t, sourceX: n, sourceY: o, targetX: r, targetY: i, sourcePosition: s = B.Bottom, targetPosition: a = B.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style: g, markerEnd: y, markerStart: b, pathOptions: x, interactionWidth: _ }) => {
|
|
5208
|
+
const [p, w, N] = gi({
|
|
5207
5209
|
sourceX: n,
|
|
5208
5210
|
sourceY: o,
|
|
5209
5211
|
sourcePosition: s,
|
|
@@ -5212,7 +5214,7 @@ function ji(e) {
|
|
|
5212
5214
|
targetPosition: a,
|
|
5213
5215
|
curvature: x?.curvature
|
|
5214
5216
|
}), k = e.isInternal ? void 0 : t;
|
|
5215
|
-
return z(ln, { id: k, path:
|
|
5217
|
+
return z(ln, { id: k, path: p, labelX: w, labelY: N, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: h, style: g, markerEnd: y, markerStart: b, interactionWidth: _ });
|
|
5216
5218
|
});
|
|
5217
5219
|
}
|
|
5218
5220
|
const xh = ji({ isInternal: !1 }), es = ji({ isInternal: !0 });
|
|
@@ -5236,13 +5238,13 @@ function mr({ position: e, centerX: t, centerY: n, radius: o = 10, onMouseDown:
|
|
|
5236
5238
|
return z("circle", { onMouseDown: r, onMouseEnter: i, onMouseOut: s, className: re([pr, `${pr}-${a}`]), cx: vh(t, o, e), cy: _h(n, o, e), r: o, stroke: "transparent", fill: "transparent" });
|
|
5237
5239
|
}
|
|
5238
5240
|
function bh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: o, sourceY: r, targetX: i, targetY: s, sourcePosition: a, targetPosition: c, onReconnect: l, onReconnectStart: d, onReconnectEnd: u, setReconnecting: f, setUpdateHover: h }) {
|
|
5239
|
-
const
|
|
5241
|
+
const g = ee(), y = (w, N) => {
|
|
5240
5242
|
if (w.button !== 0)
|
|
5241
5243
|
return;
|
|
5242
|
-
const { autoPanOnConnect: k, domNode: S, isValidConnection: P, connectionMode: I, connectionRadius: A, lib: V, onConnectStart: D, onConnectEnd: H, cancelConnection:
|
|
5244
|
+
const { autoPanOnConnect: k, domNode: S, isValidConnection: P, connectionMode: I, connectionRadius: A, lib: V, onConnectStart: D, onConnectEnd: H, cancelConnection: m, nodeLookup: E, rfId: v, panBy: C, updateConnection: $ } = g.getState(), M = N.type === "target";
|
|
5243
5245
|
f(!0), d?.(w, n, N.type);
|
|
5244
|
-
const T = (R,
|
|
5245
|
-
f(!1), u?.(R, n, N.type,
|
|
5246
|
+
const T = (R, Y) => {
|
|
5247
|
+
f(!1), u?.(R, n, N.type, Y);
|
|
5246
5248
|
}, O = (R) => l?.(n, R);
|
|
5247
5249
|
Fn.onPointerDown(w.nativeEvent, {
|
|
5248
5250
|
autoPanOnConnect: k,
|
|
@@ -5252,91 +5254,91 @@ function bh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: o, sourc
|
|
|
5252
5254
|
handleId: N.id,
|
|
5253
5255
|
nodeId: N.nodeId,
|
|
5254
5256
|
nodeLookup: E,
|
|
5255
|
-
isTarget:
|
|
5257
|
+
isTarget: M,
|
|
5256
5258
|
edgeUpdaterType: N.type,
|
|
5257
5259
|
lib: V,
|
|
5258
5260
|
flowId: v,
|
|
5259
|
-
cancelConnection:
|
|
5260
|
-
panBy:
|
|
5261
|
+
cancelConnection: m,
|
|
5262
|
+
panBy: C,
|
|
5261
5263
|
isValidConnection: P,
|
|
5262
5264
|
onConnect: O,
|
|
5263
5265
|
onConnectStart: D,
|
|
5264
5266
|
onConnectEnd: H,
|
|
5265
5267
|
onReconnectEnd: T,
|
|
5266
5268
|
updateConnection: $,
|
|
5267
|
-
getTransform: () =>
|
|
5268
|
-
getFromHandle: () =>
|
|
5269
|
+
getTransform: () => g.getState().transform,
|
|
5270
|
+
getFromHandle: () => g.getState().connection.fromHandle
|
|
5269
5271
|
});
|
|
5270
|
-
},
|
|
5271
|
-
return se(
|
|
5272
|
-
}
|
|
5273
|
-
function Eh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: o, onClick: r, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: h, rfId:
|
|
5274
|
-
let
|
|
5275
|
-
const w =
|
|
5276
|
-
|
|
5277
|
-
let N =
|
|
5278
|
-
k === void 0 && (x?.("011",
|
|
5279
|
-
const S = !!(
|
|
5280
|
-
const U = q.nodeLookup.get(
|
|
5272
|
+
}, b = (w) => y(w, { nodeId: n.target, id: n.targetHandle ?? null, type: "target" }), x = (w) => y(w, { nodeId: n.source, id: n.sourceHandle ?? null, type: "source" }), _ = () => h(!0), p = () => h(!1);
|
|
5273
|
+
return se(Ne, { children: [(e === !0 || e === "source") && z(mr, { position: a, centerX: o, centerY: r, radius: t, onMouseDown: b, onMouseEnter: _, onMouseOut: p, type: "source" }), (e === !0 || e === "target") && z(mr, { position: c, centerX: i, centerY: s, radius: t, onMouseDown: x, onMouseEnter: _, onMouseOut: p, type: "target" })] });
|
|
5274
|
+
}
|
|
5275
|
+
function Eh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: o, onClick: r, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: h, rfId: g, edgeTypes: y, noPanClassName: b, onError: x, disableKeyboardA11y: _ }) {
|
|
5276
|
+
let p = K((q) => q.edgeLookup.get(e));
|
|
5277
|
+
const w = K((q) => q.defaultEdgeOptions);
|
|
5278
|
+
p = w ? { ...w, ...p } : p;
|
|
5279
|
+
let N = p.type || "default", k = y?.[N] || hr[N];
|
|
5280
|
+
k === void 0 && (x?.("011", xe.error011(N)), N = "default", k = hr.default);
|
|
5281
|
+
const S = !!(p.focusable || t && typeof p.focusable > "u"), P = typeof u < "u" && (p.reconnectable || n && typeof p.reconnectable > "u"), I = !!(p.selectable || o && typeof p.selectable > "u"), A = J(null), [V, D] = fe(!1), [H, m] = fe(!1), E = ee(), { zIndex: v, sourceX: C, sourceY: $, targetX: M, targetY: T, sourcePosition: O, targetPosition: R } = K(ue((q) => {
|
|
5282
|
+
const U = q.nodeLookup.get(p.source), oe = q.nodeLookup.get(p.target);
|
|
5281
5283
|
if (!U || !oe)
|
|
5282
5284
|
return {
|
|
5283
|
-
zIndex:
|
|
5285
|
+
zIndex: p.zIndex,
|
|
5284
5286
|
...gr
|
|
5285
5287
|
};
|
|
5286
5288
|
const ae = vd({
|
|
5287
5289
|
id: e,
|
|
5288
5290
|
sourceNode: U,
|
|
5289
5291
|
targetNode: oe,
|
|
5290
|
-
sourceHandle:
|
|
5291
|
-
targetHandle:
|
|
5292
|
+
sourceHandle: p.sourceHandle || null,
|
|
5293
|
+
targetHandle: p.targetHandle || null,
|
|
5292
5294
|
connectionMode: q.connectionMode,
|
|
5293
5295
|
onError: x
|
|
5294
5296
|
});
|
|
5295
5297
|
return {
|
|
5296
5298
|
zIndex: fd({
|
|
5297
|
-
selected:
|
|
5298
|
-
zIndex:
|
|
5299
|
+
selected: p.selected,
|
|
5300
|
+
zIndex: p.zIndex,
|
|
5299
5301
|
sourceNode: U,
|
|
5300
5302
|
targetNode: oe,
|
|
5301
5303
|
elevateOnSelect: q.elevateEdgesOnSelect
|
|
5302
5304
|
}),
|
|
5303
5305
|
...ae || gr
|
|
5304
5306
|
};
|
|
5305
|
-
}, [
|
|
5306
|
-
if (
|
|
5307
|
+
}, [p.source, p.target, p.sourceHandle, p.targetHandle, p.selected, p.zIndex]), ne), Y = me(() => p.markerStart ? `url('#${Ln(p.markerStart, g)}')` : void 0, [p.markerStart, g]), X = me(() => p.markerEnd ? `url('#${Ln(p.markerEnd, g)}')` : void 0, [p.markerEnd, g]);
|
|
5308
|
+
if (p.hidden || C === null || $ === null || M === null || T === null)
|
|
5307
5309
|
return null;
|
|
5308
5310
|
const F = (q) => {
|
|
5309
5311
|
const { addSelectedEdges: U, unselectNodesAndEdges: oe, multiSelectionActive: ae } = E.getState();
|
|
5310
|
-
I && (E.setState({ nodesSelectionActive: !1 }),
|
|
5312
|
+
I && (E.setState({ nodesSelectionActive: !1 }), p.selected && ae ? (oe({ nodes: [], edges: [p] }), A.current?.blur()) : U([e])), r && r(q, p);
|
|
5311
5313
|
}, Z = i ? (q) => {
|
|
5312
|
-
i(q, { ...
|
|
5314
|
+
i(q, { ...p });
|
|
5313
5315
|
} : void 0, L = s ? (q) => {
|
|
5314
|
-
s(q, { ...
|
|
5315
|
-
} : void 0,
|
|
5316
|
-
a(q, { ...
|
|
5317
|
-
} : void 0,
|
|
5318
|
-
c(q, { ...
|
|
5316
|
+
s(q, { ...p });
|
|
5317
|
+
} : void 0, W = a ? (q) => {
|
|
5318
|
+
a(q, { ...p });
|
|
5319
|
+
} : void 0, G = c ? (q) => {
|
|
5320
|
+
c(q, { ...p });
|
|
5319
5321
|
} : void 0, te = l ? (q) => {
|
|
5320
|
-
l(q, { ...
|
|
5322
|
+
l(q, { ...p });
|
|
5321
5323
|
} : void 0, Q = (q) => {
|
|
5322
|
-
if (!
|
|
5324
|
+
if (!_ && jr.includes(q.key) && I) {
|
|
5323
5325
|
const { unselectNodesAndEdges: U, addSelectedEdges: oe } = E.getState();
|
|
5324
|
-
q.key === "Escape" ? (A.current?.blur(), U({ edges: [
|
|
5326
|
+
q.key === "Escape" ? (A.current?.blur(), U({ edges: [p] })) : oe([e]);
|
|
5325
5327
|
}
|
|
5326
5328
|
};
|
|
5327
5329
|
return z("svg", { style: { zIndex: v }, children: se("g", { className: re([
|
|
5328
5330
|
"react-flow__edge",
|
|
5329
5331
|
`react-flow__edge-${N}`,
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
+
p.className,
|
|
5333
|
+
b,
|
|
5332
5334
|
{
|
|
5333
|
-
selected:
|
|
5334
|
-
animated:
|
|
5335
|
+
selected: p.selected,
|
|
5336
|
+
animated: p.animated,
|
|
5335
5337
|
inactive: !I && !r,
|
|
5336
5338
|
updating: V,
|
|
5337
5339
|
selectable: I
|
|
5338
5340
|
}
|
|
5339
|
-
]), onClick: F, onDoubleClick: Z, onContextMenu: L, onMouseEnter:
|
|
5341
|
+
]), onClick: F, onDoubleClick: Z, onContextMenu: L, onMouseEnter: W, onMouseMove: G, onMouseLeave: te, onKeyDown: S ? Q : void 0, tabIndex: S ? 0 : void 0, role: S ? "button" : "img", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": p.ariaLabel === null ? void 0 : p.ariaLabel || `Edge from ${p.source} to ${p.target}`, "aria-describedby": S ? `${Ii}-${g}` : void 0, ref: A, children: [!H && z(k, { id: e, source: p.source, target: p.target, type: p.type, selected: p.selected, animated: p.animated, selectable: I, deletable: p.deletable ?? !0, label: p.label, labelStyle: p.labelStyle, labelShowBg: p.labelShowBg, labelBgStyle: p.labelBgStyle, labelBgPadding: p.labelBgPadding, labelBgBorderRadius: p.labelBgBorderRadius, sourceX: C, sourceY: $, targetX: M, targetY: T, sourcePosition: O, targetPosition: R, data: p.data, style: p.style, sourceHandleId: p.sourceHandle, targetHandleId: p.targetHandle, markerStart: Y, markerEnd: X, pathOptions: "pathOptions" in p ? p.pathOptions : void 0, interactionWidth: p.interactionWidth }), P && z(bh, { edge: p, isReconnectable: P, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: h, sourceX: C, sourceY: $, targetX: M, targetY: T, sourcePosition: O, targetPosition: R, setUpdateHover: D, setReconnecting: m })] }) });
|
|
5340
5342
|
}
|
|
5341
5343
|
const Sh = (e) => ({
|
|
5342
5344
|
edgesFocusable: e.edgesFocusable,
|
|
@@ -5345,14 +5347,14 @@ const Sh = (e) => ({
|
|
|
5345
5347
|
connectionMode: e.connectionMode,
|
|
5346
5348
|
onError: e.onError
|
|
5347
5349
|
});
|
|
5348
|
-
function ts({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: o, noPanClassName: r, onReconnect: i, onEdgeContextMenu: s, onEdgeMouseEnter: a, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: d, reconnectRadius: u, onEdgeDoubleClick: f, onReconnectStart: h, onReconnectEnd:
|
|
5349
|
-
const { edgesFocusable:
|
|
5350
|
-
return se("div", { className: "react-flow__edges", children: [z(gh, { defaultColor: e, rfId: n }), w.map((N) => z(Eh, { id: N, edgesFocusable:
|
|
5350
|
+
function ts({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: o, noPanClassName: r, onReconnect: i, onEdgeContextMenu: s, onEdgeMouseEnter: a, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: d, reconnectRadius: u, onEdgeDoubleClick: f, onReconnectStart: h, onReconnectEnd: g, disableKeyboardA11y: y }) {
|
|
5351
|
+
const { edgesFocusable: b, edgesReconnectable: x, elementsSelectable: _, onError: p } = K(Sh, ne), w = lh(t);
|
|
5352
|
+
return se("div", { className: "react-flow__edges", children: [z(gh, { defaultColor: e, rfId: n }), w.map((N) => z(Eh, { id: N, edgesFocusable: b, edgesReconnectable: x, elementsSelectable: _, noPanClassName: r, onReconnect: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, onClick: d, reconnectRadius: u, onDoubleClick: f, onReconnectStart: h, onReconnectEnd: g, rfId: n, onError: p, edgeTypes: o, disableKeyboardA11y: y }, N))] });
|
|
5351
5353
|
}
|
|
5352
5354
|
ts.displayName = "EdgeRenderer";
|
|
5353
5355
|
const Nh = ie(ts), Ch = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
|
|
5354
5356
|
function Mh({ children: e }) {
|
|
5355
|
-
const t =
|
|
5357
|
+
const t = K(Ch);
|
|
5356
5358
|
return z("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform: t }, children: e });
|
|
5357
5359
|
}
|
|
5358
5360
|
function kh(e) {
|
|
@@ -5363,7 +5365,7 @@ function kh(e) {
|
|
|
5363
5365
|
}
|
|
5364
5366
|
const $h = (e) => e.panZoom?.syncViewport;
|
|
5365
5367
|
function Ih(e) {
|
|
5366
|
-
const t =
|
|
5368
|
+
const t = K($h), n = ee();
|
|
5367
5369
|
return j(() => {
|
|
5368
5370
|
e && (t?.(e), n.setState({ transform: [e.x, e.y, e.zoom] }));
|
|
5369
5371
|
}, [e, t]), null;
|
|
@@ -5376,7 +5378,7 @@ function Ph(e) {
|
|
|
5376
5378
|
}
|
|
5377
5379
|
function zh(e) {
|
|
5378
5380
|
const t = Ph();
|
|
5379
|
-
return
|
|
5381
|
+
return K(t, ne);
|
|
5380
5382
|
}
|
|
5381
5383
|
const Th = (e) => ({
|
|
5382
5384
|
nodesConnectable: e.nodesConnectable,
|
|
@@ -5386,7 +5388,7 @@ const Th = (e) => ({
|
|
|
5386
5388
|
height: e.height
|
|
5387
5389
|
});
|
|
5388
5390
|
function Dh({ containerStyle: e, style: t, type: n, component: o }) {
|
|
5389
|
-
const { nodesConnectable: r, width: i, height: s, isValid: a, inProgress: c } =
|
|
5391
|
+
const { nodesConnectable: r, width: i, height: s, isValid: a, inProgress: c } = K(Th, ne);
|
|
5390
5392
|
return !(i && r && c) ? null : z("svg", { style: e, width: i, height: s, className: "react-flow__connectionline react-flow__container", children: z("g", { className: re(["react-flow__connection", ti(a)]), children: z(ns, { style: t, type: n, CustomComponent: o, isValid: a }) }) });
|
|
5391
5393
|
}
|
|
5392
5394
|
const ns = ({ style: e, type: t = Ie.Bezier, CustomComponent: n, isValid: o }) => {
|
|
@@ -5396,7 +5398,7 @@ const ns = ({ style: e, type: t = Ie.Bezier, CustomComponent: n, isValid: o }) =
|
|
|
5396
5398
|
if (n)
|
|
5397
5399
|
return z(n, { connectionLineType: t, connectionLineStyle: e, fromNode: s, fromHandle: a, fromX: i.x, fromY: i.y, toX: l.x, toY: l.y, fromPosition: c, toPosition: f, connectionStatus: ti(o), toNode: d, toHandle: u });
|
|
5398
5400
|
let h = "";
|
|
5399
|
-
const
|
|
5401
|
+
const g = {
|
|
5400
5402
|
sourceX: i.x,
|
|
5401
5403
|
sourceY: i.y,
|
|
5402
5404
|
sourcePosition: c,
|
|
@@ -5406,22 +5408,22 @@ const ns = ({ style: e, type: t = Ie.Bezier, CustomComponent: n, isValid: o }) =
|
|
|
5406
5408
|
};
|
|
5407
5409
|
switch (t) {
|
|
5408
5410
|
case Ie.Bezier:
|
|
5409
|
-
[h] = gi(
|
|
5411
|
+
[h] = gi(g);
|
|
5410
5412
|
break;
|
|
5411
5413
|
case Ie.SimpleBezier:
|
|
5412
|
-
[h] = Xi(
|
|
5414
|
+
[h] = Xi(g);
|
|
5413
5415
|
break;
|
|
5414
5416
|
case Ie.Step:
|
|
5415
5417
|
[h] = Rn({
|
|
5416
|
-
...
|
|
5418
|
+
...g,
|
|
5417
5419
|
borderRadius: 0
|
|
5418
5420
|
});
|
|
5419
5421
|
break;
|
|
5420
5422
|
case Ie.SmoothStep:
|
|
5421
|
-
[h] = Rn(
|
|
5423
|
+
[h] = Rn(g);
|
|
5422
5424
|
break;
|
|
5423
5425
|
default:
|
|
5424
|
-
[h] = mi(
|
|
5426
|
+
[h] = mi(g);
|
|
5425
5427
|
}
|
|
5426
5428
|
return z("path", { d: h, fill: "none", className: "react-flow__connection-path", style: e });
|
|
5427
5429
|
};
|
|
@@ -5435,30 +5437,30 @@ function Vh() {
|
|
|
5435
5437
|
ee(), J(!1), j(() => {
|
|
5436
5438
|
}, []);
|
|
5437
5439
|
}
|
|
5438
|
-
function os({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: o, onEdgeClick: r, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: h, connectionLineType:
|
|
5439
|
-
return yr(e), yr(t), Vh(), kh(n), Ih(tt), z(eh, { onPaneClick:
|
|
5440
|
+
function os({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: o, onEdgeClick: r, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: h, connectionLineType: g, connectionLineStyle: y, connectionLineComponent: b, connectionLineContainerStyle: x, selectionKeyCode: _, selectionOnDrag: p, selectionMode: w, multiSelectionKeyCode: N, panActivationKeyCode: k, zoomActivationKeyCode: S, deleteKeyCode: P, onlyRenderVisibleElements: I, elementsSelectable: A, defaultViewport: V, translateExtent: D, minZoom: H, maxZoom: m, preventScrolling: E, defaultMarkerColor: v, zoomOnScroll: C, zoomOnPinch: $, panOnScroll: M, panOnScrollSpeed: T, panOnScrollMode: O, zoomOnDoubleClick: R, panOnDrag: Y, onPaneClick: X, onPaneMouseEnter: F, onPaneMouseMove: Z, onPaneMouseLeave: L, onPaneScroll: W, onPaneContextMenu: G, paneClickDistance: te, nodeClickDistance: Q, onEdgeContextMenu: q, onEdgeMouseEnter: U, onEdgeMouseMove: oe, onEdgeMouseLeave: ae, reconnectRadius: Pe, onReconnect: un, onReconnectStart: dn, onReconnectEnd: fn, noDragClassName: Qe, noWheelClassName: hn, noPanClassName: Je, disableKeyboardA11y: je, nodeExtent: gn, rfId: et, viewport: tt, onViewportChange: Et }) {
|
|
5441
|
+
return yr(e), yr(t), Vh(), kh(n), Ih(tt), z(eh, { onPaneClick: X, onPaneMouseEnter: F, onPaneMouseMove: Z, onPaneMouseLeave: L, onPaneContextMenu: G, onPaneScroll: W, paneClickDistance: te, deleteKeyCode: P, selectionKeyCode: _, selectionOnDrag: p, selectionMode: w, onSelectionStart: f, onSelectionEnd: h, multiSelectionKeyCode: N, panActivationKeyCode: k, zoomActivationKeyCode: S, elementsSelectable: A, zoomOnScroll: C, zoomOnPinch: $, zoomOnDoubleClick: R, panOnScroll: M, panOnScrollSpeed: T, panOnScrollMode: O, panOnDrag: Y, defaultViewport: V, translateExtent: D, minZoom: H, maxZoom: m, onSelectionContextMenu: u, preventScrolling: E, noDragClassName: Qe, noWheelClassName: hn, noPanClassName: Je, disableKeyboardA11y: je, onViewportChange: Et, isControlledViewport: !!tt, children: se(Mh, { children: [z(Nh, { edgeTypes: t, onEdgeClick: r, onEdgeDoubleClick: s, onReconnect: un, onReconnectStart: dn, onReconnectEnd: fn, onlyRenderVisibleElements: I, onEdgeContextMenu: q, onEdgeMouseEnter: U, onEdgeMouseMove: oe, onEdgeMouseLeave: ae, reconnectRadius: Pe, defaultMarkerColor: v, noPanClassName: Je, disableKeyboardA11y: je, rfId: et }), z(Dh, { style: y, type: g, component: b, containerStyle: x }), z("div", { className: "react-flow__edgelabel-renderer" }), z(ch, { nodeTypes: e, onNodeClick: o, onNodeDoubleClick: i, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, nodeClickDistance: Q, onlyRenderVisibleElements: I, noPanClassName: Je, noDragClassName: Qe, disableKeyboardA11y: je, nodeExtent: gn, rfId: et }), z("div", { className: "react-flow__viewport-portal" })] }) });
|
|
5440
5442
|
}
|
|
5441
5443
|
os.displayName = "GraphView";
|
|
5442
5444
|
const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c } = {}) => {
|
|
5443
|
-
const l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), h = o ?? t ?? [],
|
|
5444
|
-
wi(u, f, h), Bn(
|
|
5445
|
+
const l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), h = o ?? t ?? [], g = n ?? e ?? [], y = a ?? [0, 0], b = c ?? ht;
|
|
5446
|
+
wi(u, f, h), Bn(g, l, d, {
|
|
5445
5447
|
nodeOrigin: y,
|
|
5446
|
-
nodeExtent:
|
|
5448
|
+
nodeExtent: b,
|
|
5447
5449
|
elevateNodesOnSelect: !1
|
|
5448
5450
|
});
|
|
5449
5451
|
let x = [0, 0, 1];
|
|
5450
5452
|
if (s && r && i) {
|
|
5451
|
-
const
|
|
5453
|
+
const _ = Ue(l, {
|
|
5452
5454
|
filter: (k) => !!((k.width || k.initialWidth) && (k.height || k.initialHeight))
|
|
5453
|
-
}), { x:
|
|
5454
|
-
x = [
|
|
5455
|
+
}), { x: p, y: w, zoom: N } = to(_, r, i, 0.5, 2, 0.1);
|
|
5456
|
+
x = [p, w, N];
|
|
5455
5457
|
}
|
|
5456
5458
|
return {
|
|
5457
5459
|
rfId: "1",
|
|
5458
5460
|
width: 0,
|
|
5459
5461
|
height: 0,
|
|
5460
5462
|
transform: x,
|
|
5461
|
-
nodes:
|
|
5463
|
+
nodes: g,
|
|
5462
5464
|
nodeLookup: l,
|
|
5463
5465
|
parentLookup: d,
|
|
5464
5466
|
edges: h,
|
|
@@ -5472,7 +5474,7 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5472
5474
|
minZoom: 0.5,
|
|
5473
5475
|
maxZoom: 2,
|
|
5474
5476
|
translateExtent: ht,
|
|
5475
|
-
nodeExtent:
|
|
5477
|
+
nodeExtent: b,
|
|
5476
5478
|
nodesSelectionActive: !1,
|
|
5477
5479
|
userSelectionActive: !1,
|
|
5478
5480
|
userSelectionRect: null,
|
|
@@ -5514,9 +5516,9 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5514
5516
|
}, Rh = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c }) => of((l, d) => ({
|
|
5515
5517
|
...wr({ nodes: e, edges: t, width: r, height: i, fitView: s, nodeOrigin: a, nodeExtent: c, defaultNodes: n, defaultEdges: o }),
|
|
5516
5518
|
setNodes: (u) => {
|
|
5517
|
-
const { nodeLookup: f, parentLookup: h, nodeOrigin:
|
|
5519
|
+
const { nodeLookup: f, parentLookup: h, nodeOrigin: g, elevateNodesOnSelect: y } = d();
|
|
5518
5520
|
Bn(u, f, h, {
|
|
5519
|
-
nodeOrigin:
|
|
5521
|
+
nodeOrigin: g,
|
|
5520
5522
|
nodeExtent: c,
|
|
5521
5523
|
elevateNodesOnSelect: y,
|
|
5522
5524
|
checkEquality: !0
|
|
@@ -5542,13 +5544,13 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5542
5544
|
* new dimensions and update the nodes.
|
|
5543
5545
|
*/
|
|
5544
5546
|
updateNodeInternals: (u, f = { triggerFitView: !0 }) => {
|
|
5545
|
-
const { triggerNodeChanges: h, nodeLookup:
|
|
5547
|
+
const { triggerNodeChanges: h, nodeLookup: g, parentLookup: y, fitViewOnInit: b, fitViewDone: x, fitViewOnInitOptions: _, domNode: p, nodeOrigin: w, nodeExtent: N, debug: k, fitViewSync: S } = d(), { changes: P, updatedInternals: I } = Md(u, g, y, p, w, N);
|
|
5546
5548
|
if (I) {
|
|
5547
|
-
if (Sd(
|
|
5549
|
+
if (Sd(g, y, { nodeOrigin: w, nodeExtent: N }), f.triggerFitView) {
|
|
5548
5550
|
let A = x;
|
|
5549
|
-
!x &&
|
|
5550
|
-
...
|
|
5551
|
-
nodes:
|
|
5551
|
+
!x && b && (A = S({
|
|
5552
|
+
..._,
|
|
5553
|
+
nodes: _?.nodes
|
|
5552
5554
|
})), l({ fitViewDone: A });
|
|
5553
5555
|
} else
|
|
5554
5556
|
l({});
|
|
@@ -5556,77 +5558,77 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5556
5558
|
}
|
|
5557
5559
|
},
|
|
5558
5560
|
updateNodePositions: (u, f = !1) => {
|
|
5559
|
-
const h = [],
|
|
5560
|
-
for (const [
|
|
5561
|
-
const x = !!(
|
|
5562
|
-
id:
|
|
5561
|
+
const h = [], g = [], { nodeLookup: y, triggerNodeChanges: b } = d();
|
|
5562
|
+
for (const [x, _] of u) {
|
|
5563
|
+
const p = y.get(x), w = !!(p?.expandParent && p?.parentId && _?.position), N = {
|
|
5564
|
+
id: x,
|
|
5563
5565
|
type: "position",
|
|
5564
|
-
position:
|
|
5566
|
+
position: w ? {
|
|
5565
5567
|
x: Math.max(0, _.position.x),
|
|
5566
5568
|
y: Math.max(0, _.position.y)
|
|
5567
5569
|
} : _.position,
|
|
5568
5570
|
dragging: f
|
|
5569
5571
|
};
|
|
5570
|
-
|
|
5571
|
-
id:
|
|
5572
|
-
parentId:
|
|
5572
|
+
w && p.parentId && h.push({
|
|
5573
|
+
id: x,
|
|
5574
|
+
parentId: p.parentId,
|
|
5573
5575
|
rect: {
|
|
5574
5576
|
..._.internals.positionAbsolute,
|
|
5575
|
-
width: _.measured.width,
|
|
5576
|
-
height: _.measured.height
|
|
5577
|
+
width: _.measured.width ?? 0,
|
|
5578
|
+
height: _.measured.height ?? 0
|
|
5577
5579
|
}
|
|
5578
|
-
}),
|
|
5580
|
+
}), g.push(N);
|
|
5579
5581
|
}
|
|
5580
5582
|
if (h.length > 0) {
|
|
5581
|
-
const {
|
|
5582
|
-
|
|
5583
|
+
const { parentLookup: x, nodeOrigin: _ } = d(), p = io(h, y, x, _);
|
|
5584
|
+
g.push(...p);
|
|
5583
5585
|
}
|
|
5584
|
-
|
|
5586
|
+
b(g);
|
|
5585
5587
|
},
|
|
5586
5588
|
triggerNodeChanges: (u) => {
|
|
5587
|
-
const { onNodesChange: f, setNodes: h, nodes:
|
|
5589
|
+
const { onNodesChange: f, setNodes: h, nodes: g, hasDefaultNodes: y, debug: b } = d();
|
|
5588
5590
|
if (u?.length) {
|
|
5589
5591
|
if (y) {
|
|
5590
|
-
const x = zi(u,
|
|
5592
|
+
const x = zi(u, g);
|
|
5591
5593
|
h(x);
|
|
5592
5594
|
}
|
|
5593
|
-
|
|
5595
|
+
b && console.log("React Flow: trigger node changes", u), f?.(u);
|
|
5594
5596
|
}
|
|
5595
5597
|
},
|
|
5596
5598
|
triggerEdgeChanges: (u) => {
|
|
5597
|
-
const { onEdgesChange: f, setEdges: h, edges:
|
|
5599
|
+
const { onEdgesChange: f, setEdges: h, edges: g, hasDefaultEdges: y, debug: b } = d();
|
|
5598
5600
|
if (u?.length) {
|
|
5599
5601
|
if (y) {
|
|
5600
|
-
const x = Ti(u,
|
|
5602
|
+
const x = Ti(u, g);
|
|
5601
5603
|
h(x);
|
|
5602
5604
|
}
|
|
5603
|
-
|
|
5605
|
+
b && console.log("React Flow: trigger edge changes", u), f?.(u);
|
|
5604
5606
|
}
|
|
5605
5607
|
},
|
|
5606
5608
|
addSelectedNodes: (u) => {
|
|
5607
|
-
const { multiSelectionActive: f, edgeLookup: h, nodeLookup:
|
|
5609
|
+
const { multiSelectionActive: f, edgeLookup: h, nodeLookup: g, triggerNodeChanges: y, triggerEdgeChanges: b } = d();
|
|
5608
5610
|
if (f) {
|
|
5609
|
-
const x = u.map((
|
|
5611
|
+
const x = u.map((_) => ze(_, !0));
|
|
5610
5612
|
y(x);
|
|
5611
5613
|
return;
|
|
5612
5614
|
}
|
|
5613
|
-
y(Le(
|
|
5615
|
+
y(Le(g, /* @__PURE__ */ new Set([...u]), !0)), b(Le(h));
|
|
5614
5616
|
},
|
|
5615
5617
|
addSelectedEdges: (u) => {
|
|
5616
|
-
const { multiSelectionActive: f, edgeLookup: h, nodeLookup:
|
|
5618
|
+
const { multiSelectionActive: f, edgeLookup: h, nodeLookup: g, triggerNodeChanges: y, triggerEdgeChanges: b } = d();
|
|
5617
5619
|
if (f) {
|
|
5618
|
-
const x = u.map((
|
|
5619
|
-
|
|
5620
|
+
const x = u.map((_) => ze(_, !0));
|
|
5621
|
+
b(x);
|
|
5620
5622
|
return;
|
|
5621
5623
|
}
|
|
5622
|
-
|
|
5624
|
+
b(Le(h, /* @__PURE__ */ new Set([...u]))), y(Le(g, /* @__PURE__ */ new Set(), !0));
|
|
5623
5625
|
},
|
|
5624
5626
|
unselectNodesAndEdges: ({ nodes: u, edges: f } = {}) => {
|
|
5625
|
-
const { edges: h, nodes:
|
|
5627
|
+
const { edges: h, nodes: g, nodeLookup: y, triggerNodeChanges: b, triggerEdgeChanges: x } = d(), _ = u || g, p = f || h, w = _.map((k) => {
|
|
5626
5628
|
const S = y.get(k.id);
|
|
5627
5629
|
return S && (S.selected = !1), ze(k.id, !1);
|
|
5628
|
-
}), N =
|
|
5629
|
-
|
|
5630
|
+
}), N = p.map((k) => ze(k.id, !1));
|
|
5631
|
+
b(w), x(N);
|
|
5630
5632
|
},
|
|
5631
5633
|
setMinZoom: (u) => {
|
|
5632
5634
|
const { panZoom: f, maxZoom: h } = d();
|
|
@@ -5643,34 +5645,34 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5643
5645
|
d().panZoom?.setClickDistance(u);
|
|
5644
5646
|
},
|
|
5645
5647
|
resetSelectedElements: () => {
|
|
5646
|
-
const { edges: u, nodes: f, triggerNodeChanges: h, triggerEdgeChanges:
|
|
5647
|
-
h(y),
|
|
5648
|
+
const { edges: u, nodes: f, triggerNodeChanges: h, triggerEdgeChanges: g } = d(), y = f.reduce((x, _) => _.selected ? [...x, ze(_.id, !1)] : x, []), b = u.reduce((x, _) => _.selected ? [...x, ze(_.id, !1)] : x, []);
|
|
5649
|
+
h(y), g(b);
|
|
5648
5650
|
},
|
|
5649
5651
|
setNodeExtent: (u) => {
|
|
5650
|
-
const { nodes: f, nodeLookup: h, parentLookup:
|
|
5651
|
-
u[0][0] === x[0][0] && u[0][1] === x[0][1] && u[1][0] === x[1][0] && u[1][1] === x[1][1] || (Bn(f, h,
|
|
5652
|
+
const { nodes: f, nodeLookup: h, parentLookup: g, nodeOrigin: y, elevateNodesOnSelect: b, nodeExtent: x } = d();
|
|
5653
|
+
u[0][0] === x[0][0] && u[0][1] === x[0][1] && u[1][0] === x[1][0] && u[1][1] === x[1][1] || (Bn(f, h, g, {
|
|
5652
5654
|
nodeOrigin: y,
|
|
5653
5655
|
nodeExtent: u,
|
|
5654
|
-
elevateNodesOnSelect:
|
|
5656
|
+
elevateNodesOnSelect: b,
|
|
5655
5657
|
checkEquality: !1
|
|
5656
5658
|
}), l({ nodeExtent: u }));
|
|
5657
5659
|
},
|
|
5658
5660
|
panBy: (u) => {
|
|
5659
|
-
const { transform: f, width: h, height:
|
|
5660
|
-
return kd({ delta: u, panZoom: y, transform: f, translateExtent:
|
|
5661
|
+
const { transform: f, width: h, height: g, panZoom: y, translateExtent: b } = d();
|
|
5662
|
+
return kd({ delta: u, panZoom: y, transform: f, translateExtent: b, width: h, height: g });
|
|
5661
5663
|
},
|
|
5662
5664
|
fitView: (u) => {
|
|
5663
|
-
const { panZoom: f, width: h, height:
|
|
5665
|
+
const { panZoom: f, width: h, height: g, minZoom: y, maxZoom: b, nodeLookup: x } = d();
|
|
5664
5666
|
if (!f)
|
|
5665
5667
|
return Promise.resolve(!1);
|
|
5666
|
-
const
|
|
5668
|
+
const _ = Dn(x, u);
|
|
5667
5669
|
return Hn({
|
|
5668
|
-
nodes:
|
|
5670
|
+
nodes: _,
|
|
5669
5671
|
width: h,
|
|
5670
|
-
height:
|
|
5672
|
+
height: g,
|
|
5671
5673
|
panZoom: f,
|
|
5672
5674
|
minZoom: y,
|
|
5673
|
-
maxZoom:
|
|
5675
|
+
maxZoom: b
|
|
5674
5676
|
}, u);
|
|
5675
5677
|
},
|
|
5676
5678
|
/*
|
|
@@ -5678,18 +5680,18 @@ const Oh = ie(os), wr = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o,
|
|
|
5678
5680
|
* for that we created this sync version of fitView
|
|
5679
5681
|
*/
|
|
5680
5682
|
fitViewSync: (u) => {
|
|
5681
|
-
const { panZoom: f, width: h, height:
|
|
5683
|
+
const { panZoom: f, width: h, height: g, minZoom: y, maxZoom: b, nodeLookup: x } = d();
|
|
5682
5684
|
if (!f)
|
|
5683
5685
|
return !1;
|
|
5684
|
-
const
|
|
5686
|
+
const _ = Dn(x, u);
|
|
5685
5687
|
return Hn({
|
|
5686
|
-
nodes:
|
|
5688
|
+
nodes: _,
|
|
5687
5689
|
width: h,
|
|
5688
|
-
height:
|
|
5690
|
+
height: g,
|
|
5689
5691
|
panZoom: f,
|
|
5690
5692
|
minZoom: y,
|
|
5691
|
-
maxZoom:
|
|
5692
|
-
}, u),
|
|
5693
|
+
maxZoom: b
|
|
5694
|
+
}, u), _.size > 0;
|
|
5693
5695
|
},
|
|
5694
5696
|
cancelConnection: () => {
|
|
5695
5697
|
l({
|
|
@@ -5716,7 +5718,7 @@ function Lh({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: o
|
|
|
5716
5718
|
return z(rf, { value: d, children: z(kf, { children: l }) });
|
|
5717
5719
|
}
|
|
5718
5720
|
function Bh({ children: e, nodes: t, edges: n, defaultNodes: o, defaultEdges: r, width: i, height: s, fitView: a, nodeOrigin: c, nodeExtent: l }) {
|
|
5719
|
-
return wt(sn) ? z(
|
|
5721
|
+
return wt(sn) ? z(Ne, { children: e }) : z(Lh, { initialNodes: t, initialEdges: n, defaultNodes: o, defaultEdges: r, initialWidth: i, initialHeight: s, fitView: a, nodeOrigin: c, nodeExtent: l, children: e });
|
|
5720
5722
|
}
|
|
5721
5723
|
const Fh = {
|
|
5722
5724
|
width: "100%",
|
|
@@ -5725,16 +5727,16 @@ const Fh = {
|
|
|
5725
5727
|
position: "relative",
|
|
5726
5728
|
zIndex: 0
|
|
5727
5729
|
};
|
|
5728
|
-
function Xh({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, className: r, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: h, onConnectStart:
|
|
5730
|
+
function Xh({ nodes: e, edges: t, defaultNodes: n, defaultEdges: o, className: r, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: h, onConnectStart: g, onConnectEnd: y, onClickConnectStart: b, onClickConnectEnd: x, onNodeMouseEnter: _, onNodeMouseMove: p, onNodeMouseLeave: w, onNodeContextMenu: N, onNodeDoubleClick: k, onNodeDragStart: S, onNodeDrag: P, onNodeDragStop: I, onNodesDelete: A, onEdgesDelete: V, onDelete: D, onSelectionChange: H, onSelectionDragStart: m, onSelectionDrag: E, onSelectionDragStop: v, onSelectionContextMenu: C, onSelectionStart: $, onSelectionEnd: M, onBeforeDelete: T, connectionMode: O, connectionLineType: R = Ie.Bezier, connectionLineStyle: Y, connectionLineComponent: X, connectionLineContainerStyle: F, deleteKeyCode: Z = "Backspace", selectionKeyCode: L = "Shift", selectionOnDrag: W = !1, selectionMode: G = gt.Full, panActivationKeyCode: te = "Space", multiSelectionKeyCode: Q = Zt() ? "Meta" : "Control", zoomActivationKeyCode: q = Zt() ? "Meta" : "Control", snapToGrid: U, snapGrid: oe, onlyRenderVisibleElements: ae = !1, selectNodesOnDrag: Pe, nodesDraggable: un, nodesConnectable: dn, nodesFocusable: fn, nodeOrigin: Qe = Ai, edgesFocusable: hn, edgesReconnectable: Je, elementsSelectable: je = !0, defaultViewport: gn = wf, minZoom: et = 0.5, maxZoom: tt = 2, translateExtent: Et = ht, preventScrolling: as = !0, nodeExtent: pn, defaultMarkerColor: cs = "#b1b1b7", zoomOnScroll: ls = !0, zoomOnPinch: us = !0, panOnScroll: ds = !1, panOnScrollSpeed: fs = 0.5, panOnScrollMode: hs = He.Free, zoomOnDoubleClick: gs = !0, panOnDrag: ps = !0, onPaneClick: ms, onPaneMouseEnter: ys, onPaneMouseMove: ws, onPaneMouseLeave: xs, onPaneScroll: vs, onPaneContextMenu: _s, paneClickDistance: lo = 0, nodeClickDistance: bs = 0, children: Es, onReconnect: Ss, onReconnectStart: Ns, onReconnectEnd: Cs, onEdgeContextMenu: Ms, onEdgeDoubleClick: ks, onEdgeMouseEnter: $s, onEdgeMouseMove: Is, onEdgeMouseLeave: As, reconnectRadius: Ps = 10, onNodesChange: zs, onEdgesChange: Ts, noDragClassName: Ds = "nodrag", noWheelClassName: Hs = "nowheel", noPanClassName: uo = "nopan", fitView: fo, fitViewOptions: Vs, connectOnClick: Os, attributionPosition: Rs, proOptions: Ls, defaultEdgeOptions: Bs, elevateNodesOnSelect: Fs, elevateEdgesOnSelect: Xs, disableKeyboardA11y: ho = !1, autoPanOnConnect: Ys, autoPanOnNodeDrag: Zs, autoPanSpeed: Ws, connectionRadius: qs, isValidConnection: Gs, onError: Ks, style: Us, id: go, nodeDragThreshold: Qs, viewport: Js, onViewportChange: js, width: ea, height: ta, colorMode: na = "light", debug: oa, onScroll: po, ...ra }, ia) {
|
|
5729
5731
|
const mn = go || "1", sa = bf(na), aa = ue((mo) => {
|
|
5730
5732
|
mo.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" }), po?.(mo);
|
|
5731
5733
|
}, [po]);
|
|
5732
|
-
return z("div", { "data-testid": "rf__wrapper", ...ra, onScroll: aa, style: { ...Us, ...Fh }, ref: ia, className: re(["react-flow", r, sa]), id: go, children: se(Bh, { nodes: e, edges: t, width: ea, height: ta, fitView: fo, nodeOrigin: Qe, nodeExtent: pn, children: [z(Oh, { onInit: l, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter:
|
|
5734
|
+
return z("div", { "data-testid": "rf__wrapper", ...ra, onScroll: aa, style: { ...Us, ...Fh }, ref: ia, className: re(["react-flow", r, sa]), id: go, children: se(Bh, { nodes: e, edges: t, width: ea, height: ta, fitView: fo, nodeOrigin: Qe, nodeExtent: pn, children: [z(Oh, { onInit: l, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter: _, onNodeMouseMove: p, onNodeMouseLeave: w, onNodeContextMenu: N, onNodeDoubleClick: k, nodeTypes: i, edgeTypes: s, connectionLineType: R, connectionLineStyle: Y, connectionLineComponent: X, connectionLineContainerStyle: F, selectionKeyCode: L, selectionOnDrag: W, selectionMode: G, deleteKeyCode: Z, multiSelectionKeyCode: Q, panActivationKeyCode: te, zoomActivationKeyCode: q, onlyRenderVisibleElements: ae, defaultViewport: gn, translateExtent: Et, minZoom: et, maxZoom: tt, preventScrolling: as, zoomOnScroll: ls, zoomOnPinch: us, zoomOnDoubleClick: gs, panOnScroll: ds, panOnScrollSpeed: fs, panOnScrollMode: hs, panOnDrag: ps, onPaneClick: ms, onPaneMouseEnter: ys, onPaneMouseMove: ws, onPaneMouseLeave: xs, onPaneScroll: vs, onPaneContextMenu: _s, paneClickDistance: lo, nodeClickDistance: bs, onSelectionContextMenu: C, onSelectionStart: $, onSelectionEnd: M, onReconnect: Ss, onReconnectStart: Ns, onReconnectEnd: Cs, onEdgeContextMenu: Ms, onEdgeDoubleClick: ks, onEdgeMouseEnter: $s, onEdgeMouseMove: Is, onEdgeMouseLeave: As, reconnectRadius: Ps, defaultMarkerColor: cs, noDragClassName: Ds, noWheelClassName: Hs, noPanClassName: uo, rfId: mn, disableKeyboardA11y: ho, nodeExtent: pn, viewport: Js, onViewportChange: js }), z(_f, { nodes: e, edges: t, defaultNodes: n, defaultEdges: o, onConnect: h, onConnectStart: g, onConnectEnd: y, onClickConnectStart: b, onClickConnectEnd: x, nodesDraggable: un, nodesConnectable: dn, nodesFocusable: fn, edgesFocusable: hn, edgesReconnectable: Je, elementsSelectable: je, elevateNodesOnSelect: Fs, elevateEdgesOnSelect: Xs, minZoom: et, maxZoom: tt, nodeExtent: pn, onNodesChange: zs, onEdgesChange: Ts, snapToGrid: U, snapGrid: oe, connectionMode: O, translateExtent: Et, connectOnClick: Os, defaultEdgeOptions: Bs, fitView: fo, fitViewOptions: Vs, onNodesDelete: A, onEdgesDelete: V, onDelete: D, onNodeDragStart: S, onNodeDrag: P, onNodeDragStop: I, onSelectionDrag: E, onSelectionDragStart: m, onSelectionDragStop: v, onMove: d, onMoveStart: u, onMoveEnd: f, noPanClassName: uo, nodeOrigin: Qe, rfId: mn, autoPanOnConnect: Ys, autoPanOnNodeDrag: Zs, autoPanSpeed: Ws, onError: Ks, connectionRadius: qs, isValidConnection: Gs, selectNodesOnDrag: Pe, nodeDragThreshold: Qs, onBeforeDelete: T, paneClickDistance: lo, debug: oa }), z(yf, { onSelectionChange: H }), Es, z(ff, { proOptions: Ls, position: Rs }), z(uf, { rfId: mn, disableKeyboardA11y: ho })] }) });
|
|
5733
5735
|
}
|
|
5734
5736
|
var _g = Di(Xh);
|
|
5735
5737
|
const Yh = (e) => e.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
5736
5738
|
function bg({ children: e }) {
|
|
5737
|
-
const t =
|
|
5739
|
+
const t = K(Yh);
|
|
5738
5740
|
return t ? vr(e, t) : null;
|
|
5739
5741
|
}
|
|
5740
5742
|
function Eg(e) {
|
|
@@ -5756,7 +5758,7 @@ function Ng({ onStart: e, onChange: t, onEnd: n }) {
|
|
|
5756
5758
|
}, [n]);
|
|
5757
5759
|
}
|
|
5758
5760
|
function Cg(e) {
|
|
5759
|
-
return
|
|
5761
|
+
return K(ue((n) => n.nodeLookup.get(e), [e]), ne);
|
|
5760
5762
|
}
|
|
5761
5763
|
function Zh({ dimensions: e, lineWidth: t, variant: n, className: o }) {
|
|
5762
5764
|
return z("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]) });
|
|
@@ -5788,7 +5790,7 @@ function rs({
|
|
|
5788
5790
|
className: l,
|
|
5789
5791
|
patternClassName: d
|
|
5790
5792
|
}) {
|
|
5791
|
-
const u = J(null), { transform: f, patternId: h } =
|
|
5793
|
+
const u = J(null), { transform: f, patternId: h } = K(Gh, ne), g = o || qh[t], y = t === Ae.Dots, b = t === Ae.Cross, x = Array.isArray(n) ? n : [n, n], _ = [x[0] * f[2] || 1, x[1] * f[2] || 1], p = g * f[2], w = Array.isArray(i) ? i : [i, i], N = b ? [p, p] : _, k = [
|
|
5792
5794
|
w[0] * f[2] || 1 + N[0] / 2,
|
|
5793
5795
|
w[1] * f[2] || 1 + N[1] / 2
|
|
5794
5796
|
], S = `${h}${e || ""}`;
|
|
@@ -5797,7 +5799,7 @@ function rs({
|
|
|
5797
5799
|
...cn,
|
|
5798
5800
|
"--xy-background-color-props": a,
|
|
5799
5801
|
"--xy-background-pattern-color-props": s
|
|
5800
|
-
}, ref: u, "data-testid": "rf__background", children: [z("pattern", { id: S, x: f[0] %
|
|
5802
|
+
}, ref: u, "data-testid": "rf__background", children: [z("pattern", { id: S, x: f[0] % _[0], y: f[1] % _[1], width: _[0], height: _[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${k[0]},-${k[1]})`, children: y ? z(Wh, { radius: p / 2, className: d }) : z(Zh, { dimensions: N, lineWidth: r, variant: t, className: d }) }), z("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${S})` })] });
|
|
5801
5803
|
}
|
|
5802
5804
|
rs.displayName = "Background";
|
|
5803
5805
|
const Mg = ie(rs);
|
|
@@ -5825,27 +5827,27 @@ const eg = (e) => ({
|
|
|
5825
5827
|
maxZoomReached: e.transform[2] >= e.maxZoom
|
|
5826
5828
|
});
|
|
5827
5829
|
function is({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: o = !0, fitViewOptions: r, onZoomIn: i, onZoomOut: s, onFitView: a, onInteractiveChange: c, className: l, children: d, position: u = "bottom-left", orientation: f = "vertical", "aria-label": h = "React Flow controls" }) {
|
|
5828
|
-
const
|
|
5829
|
-
|
|
5830
|
+
const g = ee(), { isInteractive: y, minZoomReached: b, maxZoomReached: x } = K(eg, ne), { zoomIn: _, zoomOut: p, fitView: w } = so(), N = () => {
|
|
5831
|
+
_(), i?.();
|
|
5830
5832
|
}, k = () => {
|
|
5831
|
-
|
|
5833
|
+
p(), s?.();
|
|
5832
5834
|
}, S = () => {
|
|
5833
5835
|
w(r), a?.();
|
|
5834
5836
|
}, P = () => {
|
|
5835
|
-
|
|
5837
|
+
g.setState({
|
|
5836
5838
|
nodesDraggable: !y,
|
|
5837
5839
|
nodesConnectable: !y,
|
|
5838
5840
|
elementsSelectable: !y
|
|
5839
5841
|
}), c?.(!y);
|
|
5840
5842
|
};
|
|
5841
|
-
return se(an, { className: re(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": h, children: [t && se(
|
|
5843
|
+
return se(an, { className: re(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": h, children: [t && se(Ne, { children: [z(Pt, { onClick: N, className: "react-flow__controls-zoomin", title: "zoom in", "aria-label": "zoom in", disabled: x, children: z(Kh, {}) }), z(Pt, { onClick: k, className: "react-flow__controls-zoomout", title: "zoom out", "aria-label": "zoom out", disabled: b, children: z(Uh, {}) })] }), n && z(Pt, { className: "react-flow__controls-fitview", onClick: S, title: "fit view", "aria-label": "fit view", children: z(Qh, {}) }), o && z(Pt, { className: "react-flow__controls-interactive", onClick: P, title: "toggle interactivity", "aria-label": "toggle interactivity", children: y ? z(jh, {}) : z(Jh, {}) }), d] });
|
|
5842
5844
|
}
|
|
5843
5845
|
is.displayName = "Controls";
|
|
5844
5846
|
ie(is);
|
|
5845
5847
|
function tg({ id: e, x: t, y: n, width: o, height: r, style: i, color: s, strokeColor: a, strokeWidth: c, className: l, borderRadius: d, shapeRendering: u, selected: f, onClick: h }) {
|
|
5846
|
-
const { background:
|
|
5848
|
+
const { background: g, backgroundColor: y } = i || {}, b = s || g || y;
|
|
5847
5849
|
return z("rect", { className: re(["react-flow__minimap-node", { selected: f }, l]), x: t, y: n, rx: d, ry: d, width: o, height: r, style: {
|
|
5848
|
-
fill:
|
|
5850
|
+
fill: b,
|
|
5849
5851
|
stroke: a,
|
|
5850
5852
|
strokeWidth: c
|
|
5851
5853
|
}, shapeRendering: u, onClick: h ? (x) => h(x, e) : void 0 });
|
|
@@ -5864,8 +5866,8 @@ function rg({
|
|
|
5864
5866
|
nodeComponent: i = ng,
|
|
5865
5867
|
onClick: s
|
|
5866
5868
|
}) {
|
|
5867
|
-
const a =
|
|
5868
|
-
return z(
|
|
5869
|
+
const a = K(og, ne), c = Cn(t), l = Cn(e), d = Cn(n), u = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
5870
|
+
return z(Ne, { children: a.map((f) => (
|
|
5869
5871
|
/*
|
|
5870
5872
|
* The split of responsibilities between MiniMapNodes and
|
|
5871
5873
|
* NodeComponentWrapper may appear weird. However, it’s designed to
|
|
@@ -5877,14 +5879,14 @@ function rg({
|
|
|
5877
5879
|
)) });
|
|
5878
5880
|
}
|
|
5879
5881
|
function ig({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: o, nodeBorderRadius: r, nodeStrokeWidth: i, shapeRendering: s, NodeComponent: a, onClick: c }) {
|
|
5880
|
-
const { node: l, x: d, y: u, width: f, height: h } =
|
|
5881
|
-
const y =
|
|
5882
|
+
const { node: l, x: d, y: u, width: f, height: h } = K((g) => {
|
|
5883
|
+
const y = g.nodeLookup.get(e), { x: b, y: x } = y.internals.positionAbsolute, { width: _, height: p } = Ce(y);
|
|
5882
5884
|
return {
|
|
5883
5885
|
node: y,
|
|
5884
|
-
x:
|
|
5886
|
+
x: b,
|
|
5885
5887
|
y: x,
|
|
5886
|
-
width:
|
|
5887
|
-
height:
|
|
5888
|
+
width: _,
|
|
5889
|
+
height: p
|
|
5888
5890
|
};
|
|
5889
5891
|
}, ne);
|
|
5890
5892
|
return !l || l.hidden || !li(l) ? null : z(a, { x: d, y: u, width: f, height: h, style: l.style, selected: !!l.selected, className: o(l), color: t(l), borderRadius: r, strokeColor: n(l), strokeWidth: i, shapeRendering: s, onClick: c, id: l.id });
|
|
@@ -5927,42 +5929,42 @@ function ss({
|
|
|
5927
5929
|
maskStrokeWidth: u,
|
|
5928
5930
|
position: f = "bottom-right",
|
|
5929
5931
|
onClick: h,
|
|
5930
|
-
onNodeClick:
|
|
5932
|
+
onNodeClick: g,
|
|
5931
5933
|
pannable: y = !1,
|
|
5932
|
-
zoomable:
|
|
5934
|
+
zoomable: b = !1,
|
|
5933
5935
|
ariaLabel: x = "React Flow mini map",
|
|
5934
|
-
inversePan:
|
|
5935
|
-
zoomStep:
|
|
5936
|
+
inversePan: _,
|
|
5937
|
+
zoomStep: p = 10,
|
|
5936
5938
|
offsetScale: w = 5
|
|
5937
5939
|
}) {
|
|
5938
|
-
const N = ee(), k = J(null), { boundingRect: S, viewBB: P, rfId: I, panZoom: A, translateExtent: V, flowWidth: D, flowHeight: H } =
|
|
5940
|
+
const N = ee(), k = J(null), { boundingRect: S, viewBB: P, rfId: I, panZoom: A, translateExtent: V, flowWidth: D, flowHeight: H } = K(ug, ne), m = e?.width ?? cg, E = e?.height ?? lg, v = S.width / m, C = S.height / E, $ = Math.max(v, C), M = $ * m, T = $ * E, O = w * $, R = S.x - (M - S.width) / 2 - O, Y = S.y - (T - S.height) / 2 - O, X = M + O * 2, F = T + O * 2, Z = `${dg}-${I}`, L = J(0), W = J();
|
|
5939
5941
|
L.current = $, j(() => {
|
|
5940
5942
|
if (k.current && A)
|
|
5941
|
-
return
|
|
5943
|
+
return W.current = Hd({
|
|
5942
5944
|
domNode: k.current,
|
|
5943
5945
|
panZoom: A,
|
|
5944
5946
|
getTransform: () => N.getState().transform,
|
|
5945
5947
|
getViewScale: () => L.current
|
|
5946
5948
|
}), () => {
|
|
5947
|
-
|
|
5949
|
+
W.current?.destroy();
|
|
5948
5950
|
};
|
|
5949
5951
|
}, [A]), j(() => {
|
|
5950
|
-
|
|
5952
|
+
W.current?.update({
|
|
5951
5953
|
translateExtent: V,
|
|
5952
5954
|
width: D,
|
|
5953
5955
|
height: H,
|
|
5954
|
-
inversePan:
|
|
5956
|
+
inversePan: _,
|
|
5955
5957
|
pannable: y,
|
|
5956
|
-
zoomStep:
|
|
5957
|
-
zoomable:
|
|
5958
|
+
zoomStep: p,
|
|
5959
|
+
zoomable: b
|
|
5958
5960
|
});
|
|
5959
|
-
}, [y,
|
|
5960
|
-
const
|
|
5961
|
-
const [q, U] =
|
|
5961
|
+
}, [y, b, _, p, V, D, H]);
|
|
5962
|
+
const G = h ? (Q) => {
|
|
5963
|
+
const [q, U] = W.current?.pointer(Q) || [0, 0];
|
|
5962
5964
|
h(Q, { x: q, y: U });
|
|
5963
|
-
} : void 0, te =
|
|
5965
|
+
} : void 0, te = g ? ue((Q, q) => {
|
|
5964
5966
|
const U = N.getState().nodeLookup.get(q);
|
|
5965
|
-
|
|
5967
|
+
g(Q, U);
|
|
5966
5968
|
}, []) : void 0;
|
|
5967
5969
|
return z(an, { position: f, style: {
|
|
5968
5970
|
...e,
|
|
@@ -5973,33 +5975,33 @@ function ss({
|
|
|
5973
5975
|
"--xy-minimap-node-background-color-props": typeof o == "string" ? o : void 0,
|
|
5974
5976
|
"--xy-minimap-node-stroke-color-props": typeof n == "string" ? n : void 0,
|
|
5975
5977
|
"--xy-minimap-node-stroke-width-props": typeof s == "string" ? s : void 0
|
|
5976
|
-
}, className: re(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: se("svg", { width:
|
|
5978
|
+
}, className: re(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: se("svg", { width: m, height: E, viewBox: `${R} ${Y} ${X} ${F}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": Z, ref: k, onClick: G, children: [x && z("title", { id: Z, children: x }), z(ag, { onClick: te, nodeColor: o, nodeStrokeColor: n, nodeBorderRadius: i, nodeClassName: r, nodeStrokeWidth: s, nodeComponent: a }), z("path", { className: "react-flow__minimap-mask", d: `M${R - O},${Y - O}h${X + O * 2}v${F + O * 2}h${-X - O * 2}z
|
|
5977
5979
|
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
5978
5980
|
}
|
|
5979
5981
|
ss.displayName = "MiniMap";
|
|
5980
5982
|
ie(ss);
|
|
5981
|
-
function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, style: r = {}, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, shouldResize: f, onResizeStart: h, onResize:
|
|
5982
|
-
const
|
|
5983
|
+
function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, style: r = {}, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, shouldResize: f, onResizeStart: h, onResize: g, onResizeEnd: y }) {
|
|
5984
|
+
const b = co(), x = typeof e == "string" ? e : b, _ = ee(), p = J(null), w = n === at.Line ? "right" : "bottom-right", N = t ?? w, k = J(null);
|
|
5983
5985
|
j(() => {
|
|
5984
|
-
if (!(!
|
|
5986
|
+
if (!(!p.current || !x))
|
|
5985
5987
|
return k.current || (k.current = Qd({
|
|
5986
|
-
domNode:
|
|
5988
|
+
domNode: p.current,
|
|
5987
5989
|
nodeId: x,
|
|
5988
5990
|
getStoreItems: () => {
|
|
5989
|
-
const { nodeLookup: A, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin:
|
|
5991
|
+
const { nodeLookup: A, transform: V, snapGrid: D, snapToGrid: H, nodeOrigin: m, domNode: E } = _.getState();
|
|
5990
5992
|
return {
|
|
5991
5993
|
nodeLookup: A,
|
|
5992
5994
|
transform: V,
|
|
5993
5995
|
snapGrid: D,
|
|
5994
5996
|
snapToGrid: H,
|
|
5995
|
-
nodeOrigin:
|
|
5997
|
+
nodeOrigin: m,
|
|
5996
5998
|
paneDomNode: E
|
|
5997
5999
|
};
|
|
5998
6000
|
},
|
|
5999
6001
|
onChange: (A, V) => {
|
|
6000
|
-
const { triggerNodeChanges: D, nodeLookup: H, parentLookup:
|
|
6002
|
+
const { triggerNodeChanges: D, nodeLookup: H, parentLookup: m, nodeOrigin: E } = _.getState(), v = [], C = { x: A.x, y: A.y }, $ = H.get(x);
|
|
6001
6003
|
if ($ && $.expandParent && $.parentId) {
|
|
6002
|
-
const
|
|
6004
|
+
const M = $.origin ?? E, T = A.width ?? $.measured.width ?? 0, O = A.height ?? $.measured.height ?? 0, R = {
|
|
6003
6005
|
id: $.id,
|
|
6004
6006
|
parentId: $.parentId,
|
|
6005
6007
|
rect: {
|
|
@@ -6008,21 +6010,21 @@ function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6008
6010
|
...ui({
|
|
6009
6011
|
x: A.x ?? $.position.x,
|
|
6010
6012
|
y: A.y ?? $.position.y
|
|
6011
|
-
}, { width: T, height: O }, $.parentId, H,
|
|
6013
|
+
}, { width: T, height: O }, $.parentId, H, M)
|
|
6012
6014
|
}
|
|
6013
|
-
},
|
|
6014
|
-
v.push(...
|
|
6015
|
+
}, Y = io([R], H, m, E);
|
|
6016
|
+
v.push(...Y), C.x = A.x ? Math.max(M[0] * T, A.x) : void 0, C.y = A.y ? Math.max(M[1] * O, A.y) : void 0;
|
|
6015
6017
|
}
|
|
6016
|
-
if (
|
|
6017
|
-
const
|
|
6018
|
+
if (C.x !== void 0 && C.y !== void 0) {
|
|
6019
|
+
const M = {
|
|
6018
6020
|
id: x,
|
|
6019
6021
|
type: "position",
|
|
6020
|
-
position: { ...
|
|
6022
|
+
position: { ...C }
|
|
6021
6023
|
};
|
|
6022
|
-
v.push(
|
|
6024
|
+
v.push(M);
|
|
6023
6025
|
}
|
|
6024
6026
|
if (A.width !== void 0 && A.height !== void 0) {
|
|
6025
|
-
const
|
|
6027
|
+
const M = {
|
|
6026
6028
|
id: x,
|
|
6027
6029
|
type: "dimensions",
|
|
6028
6030
|
resizing: !0,
|
|
@@ -6032,11 +6034,11 @@ function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6032
6034
|
height: A.height
|
|
6033
6035
|
}
|
|
6034
6036
|
};
|
|
6035
|
-
v.push(
|
|
6037
|
+
v.push(M);
|
|
6036
6038
|
}
|
|
6037
|
-
for (const
|
|
6039
|
+
for (const M of V) {
|
|
6038
6040
|
const T = {
|
|
6039
|
-
...
|
|
6041
|
+
...M,
|
|
6040
6042
|
type: "position"
|
|
6041
6043
|
};
|
|
6042
6044
|
v.push(T);
|
|
@@ -6049,7 +6051,7 @@ function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6049
6051
|
type: "dimensions",
|
|
6050
6052
|
resizing: !1
|
|
6051
6053
|
};
|
|
6052
|
-
|
|
6054
|
+
_.getState().triggerNodeChanges([A]);
|
|
6053
6055
|
}
|
|
6054
6056
|
})), k.current.update({
|
|
6055
6057
|
controlPosition: N,
|
|
@@ -6061,7 +6063,7 @@ function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6061
6063
|
},
|
|
6062
6064
|
keepAspectRatio: u,
|
|
6063
6065
|
onResizeStart: h,
|
|
6064
|
-
onResize:
|
|
6066
|
+
onResize: g,
|
|
6065
6067
|
onResizeEnd: y,
|
|
6066
6068
|
shouldResize: f
|
|
6067
6069
|
}), () => {
|
|
@@ -6075,17 +6077,17 @@ function fg({ nodeId: e, position: t, variant: n = at.Handle, className: o, styl
|
|
|
6075
6077
|
d,
|
|
6076
6078
|
u,
|
|
6077
6079
|
h,
|
|
6078
|
-
|
|
6080
|
+
g,
|
|
6079
6081
|
y,
|
|
6080
6082
|
f
|
|
6081
6083
|
]);
|
|
6082
6084
|
const S = N.split("-"), P = n === at.Line ? "borderColor" : "backgroundColor", I = s ? { ...r, [P]: s } : r;
|
|
6083
|
-
return z("div", { className: re(["react-flow__resize-control", "nodrag", ...S, n, o]), ref:
|
|
6085
|
+
return z("div", { className: re(["react-flow__resize-control", "nodrag", ...S, n, o]), ref: p, style: I, children: i });
|
|
6084
6086
|
}
|
|
6085
6087
|
ie(fg);
|
|
6086
6088
|
const hg = (e) => e.domNode?.querySelector(".react-flow__renderer");
|
|
6087
6089
|
function gg({ children: e }) {
|
|
6088
|
-
const t =
|
|
6090
|
+
const t = K(hg);
|
|
6089
6091
|
return t ? vr(e, t) : null;
|
|
6090
6092
|
}
|
|
6091
6093
|
const pg = (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, mg = (e, t) => {
|
|
@@ -6105,16 +6107,16 @@ function kg({ nodeId: e, children: t, className: n, style: o, isVisible: r, posi
|
|
|
6105
6107
|
const l = co(), d = ue((N) => (Array.isArray(e) ? e : [e || l || ""]).reduce((P, I) => {
|
|
6106
6108
|
const A = N.nodeLookup.get(I);
|
|
6107
6109
|
return A && P.set(A.id, A), P;
|
|
6108
|
-
}, /* @__PURE__ */ new Map()), [e, l]), u =
|
|
6110
|
+
}, /* @__PURE__ */ new Map()), [e, l]), u = K(d, mg), { x: f, y: h, zoom: g, selectedNodesCount: y } = K(yg, ne);
|
|
6109
6111
|
if (!(typeof r == "boolean" ? r : u.size === 1 && u.values().next().value?.selected && y === 1) || !u.size)
|
|
6110
6112
|
return null;
|
|
6111
|
-
const x = Ue(u),
|
|
6113
|
+
const x = Ue(u), _ = Array.from(u.values()), p = Math.max(..._.map((N) => N.internals.z + 1)), w = {
|
|
6112
6114
|
position: "absolute",
|
|
6113
|
-
transform: bd(x, { x: f, y: h, zoom:
|
|
6114
|
-
zIndex:
|
|
6115
|
+
transform: bd(x, { x: f, y: h, zoom: g }, i, s, a),
|
|
6116
|
+
zIndex: p,
|
|
6115
6117
|
...o
|
|
6116
6118
|
};
|
|
6117
|
-
return z(gg, { children: z("div", { style: w, className: re(["react-flow__node-toolbar", n]), ...c, "data-id":
|
|
6119
|
+
return z(gg, { children: z("div", { style: w, className: re(["react-flow__node-toolbar", n]), ...c, "data-id": _.reduce((N, k) => `${N}${k.id} `, "").trim(), children: t }) });
|
|
6118
6120
|
}
|
|
6119
6121
|
export {
|
|
6120
6122
|
ln as B,
|
|
@@ -6127,7 +6129,7 @@ export {
|
|
|
6127
6129
|
Mg as b,
|
|
6128
6130
|
Ae as c,
|
|
6129
6131
|
ee as d,
|
|
6130
|
-
|
|
6132
|
+
K as e,
|
|
6131
6133
|
so as f,
|
|
6132
6134
|
Cg as g,
|
|
6133
6135
|
Ce as h,
|