@arudovwen/form-builder-react 1.9.8 → 1.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-builder-react.css +1 -1
- package/dist/form-builder.es.js +1 -1
- package/dist/form-builder.umd.js +14 -14
- package/dist/{index-D-zmAziH.js → index-C09au66N.js} +2905 -2768
- package/dist/{logic-flow-B--jci8l.js → logic-flow-v4466BPC.js} +548 -547
- package/package.json +1 -1
- package/types/components/editor/layout.d.ts +3 -1
- package/types/context/editor-context.d.ts +3 -0
- package/types/demo-data.d.ts +181 -0
- package/types/index.d.ts +3 -0
- package/types/pages/builder/index.d.ts +1 -1
- package/types/utils/getAllQuestions.d.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as ce, jsx as D, Fragment as De } from "react/jsx-runtime";
|
|
2
2
|
import ht, { memo as le, useState as xe, useCallback as we, forwardRef as Oo, useRef as ne, useEffect as ie, useContext as gt, createContext as fn, useMemo as be, useLayoutEffect as Aa } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
import { A as Ia } from "./index-
|
|
4
|
+
import { A as Ia } from "./index-C09au66N.js";
|
|
5
5
|
function ue(e) {
|
|
6
6
|
if (typeof e == "string" || typeof e == "number") return "" + e;
|
|
7
7
|
let t = "";
|
|
@@ -231,11 +231,11 @@ function nc(e, t) {
|
|
|
231
231
|
var n = t ? ec : ja, r = this._parents, o = this._groups;
|
|
232
232
|
typeof e != "function" && (e = Ja(e));
|
|
233
233
|
for (var i = o.length, s = new Array(i), a = new Array(i), c = new Array(i), l = 0; l < i; ++l) {
|
|
234
|
-
var d = r[l], u = o[l], f = u.length, g = rc(e.call(d, d && d.__data__, l, r)), h = g.length, y = a[l] = new Array(h), x = s[l] = new Array(h),
|
|
235
|
-
n(d, u, y, x,
|
|
236
|
-
for (var v = 0,
|
|
234
|
+
var d = r[l], u = o[l], f = u.length, g = rc(e.call(d, d && d.__data__, l, r)), h = g.length, y = a[l] = new Array(h), x = s[l] = new Array(h), p = c[l] = new Array(f);
|
|
235
|
+
n(d, u, y, x, p, g, t);
|
|
236
|
+
for (var v = 0, m = 0, w, S; v < h; ++v)
|
|
237
237
|
if (w = y[v]) {
|
|
238
|
-
for (v >=
|
|
238
|
+
for (v >= m && (m = v + 1); !(S = x[m]) && ++m < h; ) ;
|
|
239
239
|
w._next = S || null;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
@@ -730,11 +730,11 @@ function yl() {
|
|
|
730
730
|
function Qo() {
|
|
731
731
|
var e = gl, t = pl, n = ml, r = yl, o = {}, i = hn("start", "drag", "end"), s = 0, a, c, l, d, u = 0;
|
|
732
732
|
function f(w) {
|
|
733
|
-
w.on("mousedown.drag", g).filter(r).on("touchstart.drag", x).on("touchmove.drag",
|
|
733
|
+
w.on("mousedown.drag", g).filter(r).on("touchstart.drag", x).on("touchmove.drag", p, hl).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
734
734
|
}
|
|
735
735
|
function g(w, S) {
|
|
736
736
|
if (!(d || !e.call(this, w, S))) {
|
|
737
|
-
var _ =
|
|
737
|
+
var _ = m(this, t.call(this, w, S), w, S, "mouse");
|
|
738
738
|
_ && (pe(w.view).on("mousemove.drag", h, _t).on("mouseup.drag", y, _t), Uo(w.view), Cn(w), l = !1, a = w.clientX, c = w.clientY, _("start", w));
|
|
739
739
|
}
|
|
740
740
|
}
|
|
@@ -750,29 +750,29 @@ function Qo() {
|
|
|
750
750
|
}
|
|
751
751
|
function x(w, S) {
|
|
752
752
|
if (e.call(this, w, S)) {
|
|
753
|
-
var _ = w.changedTouches, E = t.call(this, w, S),
|
|
754
|
-
for (T = 0; T <
|
|
755
|
-
(B =
|
|
753
|
+
var _ = w.changedTouches, E = t.call(this, w, S), I = _.length, T, B;
|
|
754
|
+
for (T = 0; T < I; ++T)
|
|
755
|
+
(B = m(this, E, w, S, _[T].identifier, _[T])) && (Cn(w), B("start", w, _[T]));
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
function
|
|
759
|
-
var S = w.changedTouches, _ = S.length, E,
|
|
758
|
+
function p(w) {
|
|
759
|
+
var S = w.changedTouches, _ = S.length, E, I;
|
|
760
760
|
for (E = 0; E < _; ++E)
|
|
761
|
-
(
|
|
761
|
+
(I = o[S[E].identifier]) && (rt(w), I("drag", w, S[E]));
|
|
762
762
|
}
|
|
763
763
|
function v(w) {
|
|
764
|
-
var S = w.changedTouches, _ = S.length, E,
|
|
764
|
+
var S = w.changedTouches, _ = S.length, E, I;
|
|
765
765
|
for (d && clearTimeout(d), d = setTimeout(function() {
|
|
766
766
|
d = null;
|
|
767
767
|
}, 500), E = 0; E < _; ++E)
|
|
768
|
-
(
|
|
768
|
+
(I = o[S[E].identifier]) && (Cn(w), I("end", w, S[E]));
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function m(w, S, _, E, I, T) {
|
|
771
771
|
var B = i.copy(), k = ve(T || _, S), M, L, b;
|
|
772
772
|
if ((b = n.call(w, new Bn("beforestart", {
|
|
773
773
|
sourceEvent: _,
|
|
774
774
|
target: f,
|
|
775
|
-
identifier:
|
|
775
|
+
identifier: I,
|
|
776
776
|
active: s,
|
|
777
777
|
x: k[0],
|
|
778
778
|
y: k[1],
|
|
@@ -780,27 +780,27 @@ function Qo() {
|
|
|
780
780
|
dy: 0,
|
|
781
781
|
dispatch: B
|
|
782
782
|
}), E)) != null)
|
|
783
|
-
return M = b.x - k[0] || 0, L = b.y - k[1] || 0, function A(N,
|
|
783
|
+
return M = b.x - k[0] || 0, L = b.y - k[1] || 0, function A(N, $, P) {
|
|
784
784
|
var C = k, z;
|
|
785
785
|
switch (N) {
|
|
786
786
|
case "start":
|
|
787
|
-
o[
|
|
787
|
+
o[I] = A, z = s++;
|
|
788
788
|
break;
|
|
789
789
|
case "end":
|
|
790
|
-
delete o[
|
|
790
|
+
delete o[I], --s;
|
|
791
791
|
// falls through
|
|
792
792
|
case "drag":
|
|
793
|
-
k = ve(P ||
|
|
793
|
+
k = ve(P || $, S), z = s;
|
|
794
794
|
break;
|
|
795
795
|
}
|
|
796
796
|
B.call(
|
|
797
797
|
N,
|
|
798
798
|
w,
|
|
799
799
|
new Bn(N, {
|
|
800
|
-
sourceEvent:
|
|
800
|
+
sourceEvent: $,
|
|
801
801
|
subject: b,
|
|
802
802
|
target: f,
|
|
803
|
-
identifier:
|
|
803
|
+
identifier: I,
|
|
804
804
|
active: z,
|
|
805
805
|
x: k[0] + M,
|
|
806
806
|
y: k[1] + L,
|
|
@@ -1292,27 +1292,27 @@ function Gl(e) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
const Qt = function e(t, n, r) {
|
|
1294
1294
|
function o(i, s) {
|
|
1295
|
-
var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], g = d - a, h = u - c, y = g * g + h * h, x,
|
|
1295
|
+
var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], g = d - a, h = u - c, y = g * g + h * h, x, p;
|
|
1296
1296
|
if (y < Yl)
|
|
1297
|
-
|
|
1297
|
+
p = Math.log(f / l) / t, x = function(E) {
|
|
1298
1298
|
return [
|
|
1299
1299
|
a + E * g,
|
|
1300
1300
|
c + E * h,
|
|
1301
|
-
l * Math.exp(t * E *
|
|
1301
|
+
l * Math.exp(t * E * p)
|
|
1302
1302
|
];
|
|
1303
1303
|
};
|
|
1304
1304
|
else {
|
|
1305
|
-
var v = Math.sqrt(y),
|
|
1306
|
-
|
|
1307
|
-
var
|
|
1305
|
+
var v = Math.sqrt(y), m = (f * f - l * l + r * y) / (2 * l * n * v), w = (f * f - l * l - r * y) / (2 * f * n * v), S = Math.log(Math.sqrt(m * m + 1) - m), _ = Math.log(Math.sqrt(w * w + 1) - w);
|
|
1306
|
+
p = (_ - S) / t, x = function(E) {
|
|
1307
|
+
var I = E * p, T = Or(S), B = l / (n * v) * (T * Gl(t * I + S) - Wl(S));
|
|
1308
1308
|
return [
|
|
1309
1309
|
a + B * g,
|
|
1310
1310
|
c + B * h,
|
|
1311
|
-
l * T / Or(t *
|
|
1311
|
+
l * T / Or(t * I + S)
|
|
1312
1312
|
];
|
|
1313
1313
|
};
|
|
1314
1314
|
}
|
|
1315
|
-
return x.duration =
|
|
1315
|
+
return x.duration = p * 1e3 * t / Math.SQRT2, x;
|
|
1316
1316
|
}
|
|
1317
1317
|
return o.rho = function(i) {
|
|
1318
1318
|
var s = Math.max(1e-3, +i), a = s * s, c = a * a;
|
|
@@ -1990,57 +1990,57 @@ function ld(e, t, n) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
function fi() {
|
|
1992
1992
|
var e = id, t = sd, n = ld, r = ad, o = cd, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, c = Qt, l = hn("start", "zoom", "end"), d, u, f, g = 500, h = 150, y = 0, x = 10;
|
|
1993
|
-
function
|
|
1994
|
-
b.property("__zoom", Vr).on("wheel.zoom",
|
|
1993
|
+
function p(b) {
|
|
1994
|
+
b.property("__zoom", Vr).on("wheel.zoom", I, { passive: !1 }).on("mousedown.zoom", T).on("dblclick.zoom", B).filter(o).on("touchstart.zoom", k).on("touchmove.zoom", M).on("touchend.zoom touchcancel.zoom", L).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
1995
1995
|
}
|
|
1996
|
-
|
|
1996
|
+
p.transform = function(b, A, N, $) {
|
|
1997
1997
|
var P = b.selection ? b.selection() : b;
|
|
1998
|
-
P.property("__zoom", Vr), b !== P ? S(b, A, N,
|
|
1999
|
-
_(this, arguments).event(
|
|
1998
|
+
P.property("__zoom", Vr), b !== P ? S(b, A, N, $) : P.interrupt().each(function() {
|
|
1999
|
+
_(this, arguments).event($).start().zoom(null, typeof A == "function" ? A.apply(this, arguments) : A).end();
|
|
2000
2000
|
});
|
|
2001
|
-
},
|
|
2002
|
-
|
|
2001
|
+
}, p.scaleBy = function(b, A, N, $) {
|
|
2002
|
+
p.scaleTo(b, function() {
|
|
2003
2003
|
var P = this.__zoom.k, C = typeof A == "function" ? A.apply(this, arguments) : A;
|
|
2004
2004
|
return P * C;
|
|
2005
|
-
}, N,
|
|
2006
|
-
},
|
|
2007
|
-
|
|
2005
|
+
}, N, $);
|
|
2006
|
+
}, p.scaleTo = function(b, A, N, $) {
|
|
2007
|
+
p.transform(b, function() {
|
|
2008
2008
|
var P = t.apply(this, arguments), C = this.__zoom, z = N == null ? w(P) : typeof N == "function" ? N.apply(this, arguments) : N, R = C.invert(z), O = typeof A == "function" ? A.apply(this, arguments) : A;
|
|
2009
|
-
return n(
|
|
2010
|
-
}, N,
|
|
2011
|
-
},
|
|
2012
|
-
|
|
2009
|
+
return n(m(v(C, O), z, R), P, s);
|
|
2010
|
+
}, N, $);
|
|
2011
|
+
}, p.translateBy = function(b, A, N, $) {
|
|
2012
|
+
p.transform(b, function() {
|
|
2013
2013
|
return n(this.__zoom.translate(
|
|
2014
2014
|
typeof A == "function" ? A.apply(this, arguments) : A,
|
|
2015
2015
|
typeof N == "function" ? N.apply(this, arguments) : N
|
|
2016
2016
|
), t.apply(this, arguments), s);
|
|
2017
|
-
}, null,
|
|
2018
|
-
},
|
|
2019
|
-
|
|
2020
|
-
var C = t.apply(this, arguments), z = this.__zoom, R =
|
|
2017
|
+
}, null, $);
|
|
2018
|
+
}, p.translateTo = function(b, A, N, $, P) {
|
|
2019
|
+
p.transform(b, function() {
|
|
2020
|
+
var C = t.apply(this, arguments), z = this.__zoom, R = $ == null ? w(C) : typeof $ == "function" ? $.apply(this, arguments) : $;
|
|
2021
2021
|
return n(yn.translate(R[0], R[1]).scale(z.k).translate(
|
|
2022
2022
|
typeof A == "function" ? -A.apply(this, arguments) : -A,
|
|
2023
2023
|
typeof N == "function" ? -N.apply(this, arguments) : -N
|
|
2024
2024
|
), C, s);
|
|
2025
|
-
},
|
|
2025
|
+
}, $, P);
|
|
2026
2026
|
};
|
|
2027
2027
|
function v(b, A) {
|
|
2028
2028
|
return A = Math.max(i[0], Math.min(i[1], A)), A === b.k ? b : new Pe(A, b.x, b.y);
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2031
|
-
var
|
|
2032
|
-
return
|
|
2030
|
+
function m(b, A, N) {
|
|
2031
|
+
var $ = A[0] - N[0] * b.k, P = A[1] - N[1] * b.k;
|
|
2032
|
+
return $ === b.x && P === b.y ? b : new Pe(b.k, $, P);
|
|
2033
2033
|
}
|
|
2034
2034
|
function w(b) {
|
|
2035
2035
|
return [(+b[0][0] + +b[1][0]) / 2, (+b[0][1] + +b[1][1]) / 2];
|
|
2036
2036
|
}
|
|
2037
|
-
function S(b, A, N,
|
|
2037
|
+
function S(b, A, N, $) {
|
|
2038
2038
|
b.on("start.zoom", function() {
|
|
2039
|
-
_(this, arguments).event(
|
|
2039
|
+
_(this, arguments).event($).start();
|
|
2040
2040
|
}).on("interrupt.zoom end.zoom", function() {
|
|
2041
|
-
_(this, arguments).event(
|
|
2041
|
+
_(this, arguments).event($).end();
|
|
2042
2042
|
}).tween("zoom", function() {
|
|
2043
|
-
var P = this, C = arguments, z = _(P, C).event(
|
|
2043
|
+
var P = this, C = arguments, z = _(P, C).event($), R = t.apply(P, C), O = N == null ? w(R) : typeof N == "function" ? N.apply(P, C) : N, F = Math.max(R[1][0] - R[0][0], R[1][1] - R[0][1]), Y = P.__zoom, K = typeof A == "function" ? A.apply(P, C) : A, Z = c(Y.invert(O).concat(F / Y.k), K.invert(O).concat(F / K.k));
|
|
2044
2044
|
return function(X) {
|
|
2045
2045
|
if (X === 1) X = K;
|
|
2046
2046
|
else {
|
|
@@ -2077,7 +2077,7 @@ function fi() {
|
|
|
2077
2077
|
this.that,
|
|
2078
2078
|
new od(b, {
|
|
2079
2079
|
sourceEvent: this.sourceEvent,
|
|
2080
|
-
target:
|
|
2080
|
+
target: p,
|
|
2081
2081
|
transform: this.that.__zoom,
|
|
2082
2082
|
dispatch: l
|
|
2083
2083
|
}),
|
|
@@ -2085,45 +2085,45 @@ function fi() {
|
|
|
2085
2085
|
);
|
|
2086
2086
|
}
|
|
2087
2087
|
};
|
|
2088
|
-
function
|
|
2088
|
+
function I(b, ...A) {
|
|
2089
2089
|
if (!e.apply(this, arguments)) return;
|
|
2090
|
-
var N = _(this, A).event(b),
|
|
2090
|
+
var N = _(this, A).event(b), $ = this.__zoom, P = Math.max(i[0], Math.min(i[1], $.k * Math.pow(2, r.apply(this, arguments)))), C = ve(b);
|
|
2091
2091
|
if (N.wheel)
|
|
2092
|
-
(N.mouse[0][0] !== C[0] || N.mouse[0][1] !== C[1]) && (N.mouse[1] =
|
|
2092
|
+
(N.mouse[0][0] !== C[0] || N.mouse[0][1] !== C[1]) && (N.mouse[1] = $.invert(N.mouse[0] = C)), clearTimeout(N.wheel);
|
|
2093
2093
|
else {
|
|
2094
|
-
if (
|
|
2095
|
-
N.mouse = [C,
|
|
2094
|
+
if ($.k === P) return;
|
|
2095
|
+
N.mouse = [C, $.invert(C)], en(this), N.start();
|
|
2096
2096
|
}
|
|
2097
|
-
yt(b), N.wheel = setTimeout(z, h), N.zoom("mouse", n(
|
|
2097
|
+
yt(b), N.wheel = setTimeout(z, h), N.zoom("mouse", n(m(v($, P), N.mouse[0], N.mouse[1]), N.extent, s));
|
|
2098
2098
|
function z() {
|
|
2099
2099
|
N.wheel = null, N.end();
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
2102
|
function T(b, ...A) {
|
|
2103
2103
|
if (f || !e.apply(this, arguments)) return;
|
|
2104
|
-
var N = b.currentTarget,
|
|
2105
|
-
Uo(b.view), An(b),
|
|
2104
|
+
var N = b.currentTarget, $ = _(this, A, !0).event(b), P = pe(b.view).on("mousemove.zoom", O, !0).on("mouseup.zoom", F, !0), C = ve(b, N), z = b.clientX, R = b.clientY;
|
|
2105
|
+
Uo(b.view), An(b), $.mouse = [C, this.__zoom.invert(C)], en(this), $.start();
|
|
2106
2106
|
function O(Y) {
|
|
2107
|
-
if (yt(Y),
|
|
2107
|
+
if (yt(Y), !$.moved) {
|
|
2108
2108
|
var K = Y.clientX - z, Z = Y.clientY - R;
|
|
2109
|
-
|
|
2109
|
+
$.moved = K * K + Z * Z > y;
|
|
2110
2110
|
}
|
|
2111
|
-
|
|
2111
|
+
$.event(Y).zoom("mouse", n(m($.that.__zoom, $.mouse[0] = ve(Y, N), $.mouse[1]), $.extent, s));
|
|
2112
2112
|
}
|
|
2113
2113
|
function F(Y) {
|
|
2114
|
-
P.on("mousemove.zoom mouseup.zoom", null), Zo(Y.view,
|
|
2114
|
+
P.on("mousemove.zoom mouseup.zoom", null), Zo(Y.view, $.moved), yt(Y), $.event(Y).end();
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
function B(b, ...A) {
|
|
2118
2118
|
if (e.apply(this, arguments)) {
|
|
2119
|
-
var N = this.__zoom,
|
|
2120
|
-
yt(b), a > 0 ? pe(this).transition().duration(a).call(S, z,
|
|
2119
|
+
var N = this.__zoom, $ = ve(b.changedTouches ? b.changedTouches[0] : b, this), P = N.invert($), C = N.k * (b.shiftKey ? 0.5 : 2), z = n(m(v(N, C), $, P), t.apply(this, A), s);
|
|
2120
|
+
yt(b), a > 0 ? pe(this).transition().duration(a).call(S, z, $, b) : pe(this).call(p.transform, z, $, b);
|
|
2121
2121
|
}
|
|
2122
2122
|
}
|
|
2123
2123
|
function k(b, ...A) {
|
|
2124
2124
|
if (e.apply(this, arguments)) {
|
|
2125
|
-
var N = b.touches,
|
|
2126
|
-
for (An(b), z = 0; z <
|
|
2125
|
+
var N = b.touches, $ = N.length, P = _(this, A, b.changedTouches.length === $).event(b), C, z, R, O;
|
|
2126
|
+
for (An(b), z = 0; z < $; ++z)
|
|
2127
2127
|
R = N[z], O = ve(R, this), O = [O, this.__zoom.invert(O), R.identifier], P.touch0 ? !P.touch1 && P.touch0[2] !== O[2] && (P.touch1 = O, P.taps = 0) : (P.touch0 = O, C = !0, P.taps = 1 + !!d);
|
|
2128
2128
|
d && (d = clearTimeout(d)), C && (P.taps < 2 && (u = O[0], d = setTimeout(function() {
|
|
2129
2129
|
d = null;
|
|
@@ -2132,24 +2132,24 @@ function fi() {
|
|
|
2132
2132
|
}
|
|
2133
2133
|
function M(b, ...A) {
|
|
2134
2134
|
if (this.__zooming) {
|
|
2135
|
-
var N = _(this, A).event(b),
|
|
2135
|
+
var N = _(this, A).event(b), $ = b.changedTouches, P = $.length, C, z, R, O;
|
|
2136
2136
|
for (yt(b), C = 0; C < P; ++C)
|
|
2137
|
-
z =
|
|
2137
|
+
z = $[C], R = ve(z, this), N.touch0 && N.touch0[2] === z.identifier ? N.touch0[0] = R : N.touch1 && N.touch1[2] === z.identifier && (N.touch1[0] = R);
|
|
2138
2138
|
if (z = N.that.__zoom, N.touch1) {
|
|
2139
2139
|
var F = N.touch0[0], Y = N.touch0[1], K = N.touch1[0], Z = N.touch1[1], X = (X = K[0] - F[0]) * X + (X = K[1] - F[1]) * X, H = (H = Z[0] - Y[0]) * H + (H = Z[1] - Y[1]) * H;
|
|
2140
2140
|
z = v(z, Math.sqrt(X / H)), R = [(F[0] + K[0]) / 2, (F[1] + K[1]) / 2], O = [(Y[0] + Z[0]) / 2, (Y[1] + Z[1]) / 2];
|
|
2141
2141
|
} else if (N.touch0) R = N.touch0[0], O = N.touch0[1];
|
|
2142
2142
|
else return;
|
|
2143
|
-
N.zoom("touch", n(
|
|
2143
|
+
N.zoom("touch", n(m(z, R, O), N.extent, s));
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
2146
|
function L(b, ...A) {
|
|
2147
2147
|
if (this.__zooming) {
|
|
2148
|
-
var N = _(this, A).event(b),
|
|
2148
|
+
var N = _(this, A).event(b), $ = b.changedTouches, P = $.length, C, z;
|
|
2149
2149
|
for (An(b), f && clearTimeout(f), f = setTimeout(function() {
|
|
2150
2150
|
f = null;
|
|
2151
2151
|
}, g), C = 0; C < P; ++C)
|
|
2152
|
-
z =
|
|
2152
|
+
z = $[C], N.touch0 && N.touch0[2] === z.identifier ? delete N.touch0 : N.touch1 && N.touch1[2] === z.identifier && delete N.touch1;
|
|
2153
2153
|
if (N.touch1 && !N.touch0 && (N.touch0 = N.touch1, delete N.touch1), N.touch0) N.touch0[1] = this.__zoom.invert(N.touch0[0]);
|
|
2154
2154
|
else if (N.end(), N.taps === 2 && (z = ve(z, this), Math.hypot(u[0] - z[0], u[1] - z[1]) < x)) {
|
|
2155
2155
|
var R = pe(this).on("dblclick.zoom");
|
|
@@ -2157,32 +2157,32 @@ function fi() {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
}
|
|
2160
|
-
return
|
|
2161
|
-
return arguments.length ? (r = typeof b == "function" ? b : Xt(+b),
|
|
2162
|
-
},
|
|
2163
|
-
return arguments.length ? (e = typeof b == "function" ? b : Xt(!!b),
|
|
2164
|
-
},
|
|
2165
|
-
return arguments.length ? (o = typeof b == "function" ? b : Xt(!!b),
|
|
2166
|
-
},
|
|
2167
|
-
return arguments.length ? (t = typeof b == "function" ? b : Xt([[+b[0][0], +b[0][1]], [+b[1][0], +b[1][1]]]),
|
|
2168
|
-
},
|
|
2169
|
-
return arguments.length ? (i[0] = +b[0], i[1] = +b[1],
|
|
2170
|
-
},
|
|
2171
|
-
return arguments.length ? (s[0][0] = +b[0][0], s[1][0] = +b[1][0], s[0][1] = +b[0][1], s[1][1] = +b[1][1],
|
|
2172
|
-
},
|
|
2173
|
-
return arguments.length ? (n = b,
|
|
2174
|
-
},
|
|
2175
|
-
return arguments.length ? (a = +b,
|
|
2176
|
-
},
|
|
2177
|
-
return arguments.length ? (c = b,
|
|
2178
|
-
},
|
|
2160
|
+
return p.wheelDelta = function(b) {
|
|
2161
|
+
return arguments.length ? (r = typeof b == "function" ? b : Xt(+b), p) : r;
|
|
2162
|
+
}, p.filter = function(b) {
|
|
2163
|
+
return arguments.length ? (e = typeof b == "function" ? b : Xt(!!b), p) : e;
|
|
2164
|
+
}, p.touchable = function(b) {
|
|
2165
|
+
return arguments.length ? (o = typeof b == "function" ? b : Xt(!!b), p) : o;
|
|
2166
|
+
}, p.extent = function(b) {
|
|
2167
|
+
return arguments.length ? (t = typeof b == "function" ? b : Xt([[+b[0][0], +b[0][1]], [+b[1][0], +b[1][1]]]), p) : t;
|
|
2168
|
+
}, p.scaleExtent = function(b) {
|
|
2169
|
+
return arguments.length ? (i[0] = +b[0], i[1] = +b[1], p) : [i[0], i[1]];
|
|
2170
|
+
}, p.translateExtent = function(b) {
|
|
2171
|
+
return arguments.length ? (s[0][0] = +b[0][0], s[1][0] = +b[1][0], s[0][1] = +b[0][1], s[1][1] = +b[1][1], p) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]];
|
|
2172
|
+
}, p.constrain = function(b) {
|
|
2173
|
+
return arguments.length ? (n = b, p) : n;
|
|
2174
|
+
}, p.duration = function(b) {
|
|
2175
|
+
return arguments.length ? (a = +b, p) : a;
|
|
2176
|
+
}, p.interpolate = function(b) {
|
|
2177
|
+
return arguments.length ? (c = b, p) : c;
|
|
2178
|
+
}, p.on = function() {
|
|
2179
2179
|
var b = l.on.apply(l, arguments);
|
|
2180
|
-
return b === l ?
|
|
2181
|
-
},
|
|
2182
|
-
return arguments.length ? (y = (b = +b) * b,
|
|
2183
|
-
},
|
|
2184
|
-
return arguments.length ? (x = +b,
|
|
2185
|
-
},
|
|
2180
|
+
return b === l ? p : b;
|
|
2181
|
+
}, p.clickDistance = function(b) {
|
|
2182
|
+
return arguments.length ? (y = (b = +b) * b, p) : Math.sqrt(y);
|
|
2183
|
+
}, p.tapDistance = function(b) {
|
|
2184
|
+
return arguments.length ? (x = +b, p) : x;
|
|
2185
|
+
}, p;
|
|
2186
2186
|
}
|
|
2187
2187
|
const ye = {
|
|
2188
2188
|
error001: (e = "react") => `Seems like you have not used ${e === "svelte" ? "SvelteFlowProvider" : "ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,
|
|
@@ -2290,13 +2290,13 @@ const yi = (e) => "id" in e && "source" in e && "target" in e, ud = (e) => "id"
|
|
|
2290
2290
|
(t.filter === void 0 || t.filter(o)) && (n = xn(n, ln(o)), r = !0);
|
|
2291
2291
|
}), r ? wn(n) : { x: 0, y: 0, width: 0, height: 0 };
|
|
2292
2292
|
}, ar = (e, t, [n, r, o] = [0, 0, 1], i = !1, s = !1) => {
|
|
2293
|
-
var f, g, h, y, x,
|
|
2293
|
+
var f, g, h, y, x, p;
|
|
2294
2294
|
const a = (t.x - n) / o, c = (t.y - r) / o, l = t.width / o, d = t.height / o, u = [];
|
|
2295
2295
|
for (const v of e.values()) {
|
|
2296
|
-
const { measured:
|
|
2296
|
+
const { measured: m, selectable: w = !0, hidden: S = !1 } = v;
|
|
2297
2297
|
if (s && !w || S)
|
|
2298
2298
|
continue;
|
|
2299
|
-
const _ = (h = (g = (f =
|
|
2299
|
+
const _ = (h = (g = (f = m.width) != null ? f : v.width) != null ? g : v.initialWidth) != null ? h : 0, E = (p = (x = (y = m.height) != null ? y : v.height) != null ? x : v.initialHeight) != null ? p : 0, { x: I, y: T } = v.internals.positionAbsolute, B = vi(a, c, l, d, I, T, _, E), k = _ * E, M = i && B > 0;
|
|
2300
2300
|
(!v.internals.handleBounds || M || B >= k || v.dragging) && u.push(v);
|
|
2301
2301
|
}
|
|
2302
2302
|
return u;
|
|
@@ -2331,10 +2331,10 @@ function xi({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0],
|
|
|
2331
2331
|
if (!a)
|
|
2332
2332
|
i == null || i("005", ye.error005());
|
|
2333
2333
|
else {
|
|
2334
|
-
const x = a.measured.width,
|
|
2335
|
-
x &&
|
|
2334
|
+
const x = a.measured.width, p = a.measured.height;
|
|
2335
|
+
x && p && (u = [
|
|
2336
2336
|
[c, l],
|
|
2337
|
-
[c + x, l +
|
|
2337
|
+
[c + x, l + p]
|
|
2338
2338
|
]);
|
|
2339
2339
|
}
|
|
2340
2340
|
else a && Ze(s.extent) && (u = [
|
|
@@ -2682,21 +2682,21 @@ const qr = {
|
|
|
2682
2682
|
[G.Bottom]: { x: 0, y: 1 }
|
|
2683
2683
|
}, Cd = ({ source: e, sourcePosition: t = G.Bottom, target: n }) => t === G.Left || t === G.Right ? e.x < n.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : e.y < n.y ? { x: 0, y: 1 } : { x: 0, y: -1 }, Ur = (e, t) => Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
|
|
2684
2684
|
function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition: r = G.Top, center: o, offset: i, stepPosition: s }) {
|
|
2685
|
-
var
|
|
2685
|
+
var I, T, B, k;
|
|
2686
2686
|
const a = qr[t], c = qr[r], l = { x: e.x + a.x * i, y: e.y + a.y * i }, d = { x: n.x + c.x * i, y: n.y + c.y * i }, u = Cd({
|
|
2687
2687
|
source: l,
|
|
2688
2688
|
sourcePosition: t,
|
|
2689
2689
|
target: d
|
|
2690
2690
|
}), f = u.x !== 0 ? "x" : "y", g = u[f];
|
|
2691
2691
|
let h = [], y, x;
|
|
2692
|
-
const
|
|
2692
|
+
const p = { x: 0, y: 0 }, v = { x: 0, y: 0 }, [, , m, w] = Ii({
|
|
2693
2693
|
sourceX: e.x,
|
|
2694
2694
|
sourceY: e.y,
|
|
2695
2695
|
targetX: n.x,
|
|
2696
2696
|
targetY: n.y
|
|
2697
2697
|
});
|
|
2698
2698
|
if (a[f] * c[f] === -1) {
|
|
2699
|
-
f === "x" ? (y = (
|
|
2699
|
+
f === "x" ? (y = (I = o.x) != null ? I : l.x + (d.x - l.x) * s, x = (T = o.y) != null ? T : (l.y + d.y) / 2) : (y = (B = o.x) != null ? B : (l.x + d.x) / 2, x = (k = o.y) != null ? k : l.y + (d.y - l.y) * s);
|
|
2700
2700
|
const M = [
|
|
2701
2701
|
{ x: y, y: l.y },
|
|
2702
2702
|
{ x: y, y: d.y }
|
|
@@ -2711,17 +2711,17 @@ function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition
|
|
|
2711
2711
|
const P = Math.abs(e[f] - n[f]);
|
|
2712
2712
|
if (P <= i) {
|
|
2713
2713
|
const C = Math.min(i - 1, i - P);
|
|
2714
|
-
a[f] === g ?
|
|
2714
|
+
a[f] === g ? p[f] = (l[f] > e[f] ? -1 : 1) * C : v[f] = (d[f] > n[f] ? -1 : 1) * C;
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
2717
|
if (t !== r) {
|
|
2718
2718
|
const P = f === "x" ? "y" : "x", C = a[f] === c[P], z = l[P] > d[P], R = l[P] < d[P];
|
|
2719
2719
|
(a[f] === 1 && (!C && z || C && R) || a[f] !== 1 && (!C && R || C && z)) && (h = f === "x" ? M : L);
|
|
2720
2720
|
}
|
|
2721
|
-
const b = { x: l.x +
|
|
2722
|
-
N >=
|
|
2721
|
+
const b = { x: l.x + p.x, y: l.y + p.y }, A = { x: d.x + v.x, y: d.y + v.y }, N = Math.max(Math.abs(b.x - h[0].x), Math.abs(A.x - h[0].x)), $ = Math.max(Math.abs(b.y - h[0].y), Math.abs(A.y - h[0].y));
|
|
2722
|
+
N >= $ ? (y = (b.x + A.x) / 2, x = h[0].y) : (y = h[0].x, x = (b.y + A.y) / 2);
|
|
2723
2723
|
}
|
|
2724
|
-
const S = { x: l.x +
|
|
2724
|
+
const S = { x: l.x + p.x, y: l.y + p.y }, _ = { x: d.x + v.x, y: d.y + v.y };
|
|
2725
2725
|
return [[
|
|
2726
2726
|
e,
|
|
2727
2727
|
// we only want to add the gapped source/target if they are different from the first/last point to avoid duplicates which can cause issues with the bends
|
|
@@ -2729,7 +2729,7 @@ function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition
|
|
|
2729
2729
|
...h,
|
|
2730
2730
|
..._.x !== h[h.length - 1].x || _.y !== h[h.length - 1].y ? [_] : [],
|
|
2731
2731
|
n
|
|
2732
|
-
], y, x,
|
|
2732
|
+
], y, x, m, w];
|
|
2733
2733
|
}
|
|
2734
2734
|
function kd(e, t, n, r) {
|
|
2735
2735
|
const o = Math.min(Ur(e, t) / 2, Ur(t, n) / 2, r), { x: i, y: s } = t;
|
|
@@ -2753,8 +2753,8 @@ function qn({ sourceX: e, sourceY: t, sourcePosition: n = G.Bottom, targetX: r,
|
|
|
2753
2753
|
stepPosition: d
|
|
2754
2754
|
});
|
|
2755
2755
|
let x = `M${u[0].x} ${u[0].y}`;
|
|
2756
|
-
for (let
|
|
2757
|
-
x += kd(u[
|
|
2756
|
+
for (let p = 1; p < u.length - 1; p++)
|
|
2757
|
+
x += kd(u[p - 1], u[p], u[p + 1], s);
|
|
2758
2758
|
return x += `L${u[u.length - 1].x} ${u[u.length - 1].y}`, [x, f, g, h, y];
|
|
2759
2759
|
}
|
|
2760
2760
|
function Zr(e) {
|
|
@@ -2892,7 +2892,7 @@ function Zn(e, t, n, r = {}) {
|
|
|
2892
2892
|
if (o.checkEquality && g === (h == null ? void 0 : h.internals.userNode))
|
|
2893
2893
|
t.set(g.id, h);
|
|
2894
2894
|
else {
|
|
2895
|
-
const y = Tt(g, o.nodeOrigin), x = Ze(g.extent) ? g.extent : o.nodeExtent,
|
|
2895
|
+
const y = Tt(g, o.nodeOrigin), x = Ze(g.extent) ? g.extent : o.nodeExtent, p = Ue(y, x, Le(g));
|
|
2896
2896
|
h = {
|
|
2897
2897
|
...o.defaults,
|
|
2898
2898
|
...g,
|
|
@@ -2901,7 +2901,7 @@ function Zn(e, t, n, r = {}) {
|
|
|
2901
2901
|
height: (u = g.measured) == null ? void 0 : u.height
|
|
2902
2902
|
},
|
|
2903
2903
|
internals: {
|
|
2904
|
-
positionAbsolute:
|
|
2904
|
+
positionAbsolute: p,
|
|
2905
2905
|
// if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
|
|
2906
2906
|
handleBounds: Dd(g, h),
|
|
2907
2907
|
z: Ti(g, a, o.zIndexMode),
|
|
@@ -2964,13 +2964,13 @@ function pr(e, t, n, r = [0, 0]) {
|
|
|
2964
2964
|
}
|
|
2965
2965
|
return i.size > 0 && i.forEach(({ expandedRect: c, parent: l }, d) => {
|
|
2966
2966
|
var w, S;
|
|
2967
|
-
const u = l.internals.positionAbsolute, f = Le(l), g = (w = l.origin) != null ? w : r, h = c.x < u.x ? Math.round(Math.abs(u.x - c.x)) : 0, y = c.y < u.y ? Math.round(Math.abs(u.y - c.y)) : 0, x = Math.max(f.width, Math.round(c.width)),
|
|
2968
|
-
(h > 0 || y > 0 || v ||
|
|
2967
|
+
const u = l.internals.positionAbsolute, f = Le(l), g = (w = l.origin) != null ? w : r, h = c.x < u.x ? Math.round(Math.abs(u.x - c.x)) : 0, y = c.y < u.y ? Math.round(Math.abs(u.y - c.y)) : 0, x = Math.max(f.width, Math.round(c.width)), p = Math.max(f.height, Math.round(c.height)), v = (x - f.width) * g[0], m = (p - f.height) * g[1];
|
|
2968
|
+
(h > 0 || y > 0 || v || m) && (o.push({
|
|
2969
2969
|
id: d,
|
|
2970
2970
|
type: "position",
|
|
2971
2971
|
position: {
|
|
2972
2972
|
x: l.position.x - h + v,
|
|
2973
|
-
y: l.position.y - y +
|
|
2973
|
+
y: l.position.y - y + m
|
|
2974
2974
|
}
|
|
2975
2975
|
}), (S = n.get(d)) == null || S.forEach((_) => {
|
|
2976
2976
|
e.some((E) => E.id === _.id) || o.push({
|
|
@@ -2987,7 +2987,7 @@ function pr(e, t, n, r = [0, 0]) {
|
|
|
2987
2987
|
setAttributes: !0,
|
|
2988
2988
|
dimensions: {
|
|
2989
2989
|
width: x + (h ? g[0] * h - v : 0),
|
|
2990
|
-
height:
|
|
2990
|
+
height: p + (y ? g[1] * y - m : 0)
|
|
2991
2991
|
}
|
|
2992
2992
|
});
|
|
2993
2993
|
}), o;
|
|
@@ -3014,9 +3014,9 @@ function zd(e, t, n, r, o, i, s) {
|
|
|
3014
3014
|
}
|
|
3015
3015
|
const y = ur(g.nodeElement), x = h.measured.width !== y.width || h.measured.height !== y.height;
|
|
3016
3016
|
if (!!(y.width && y.height && (x || !h.internals.handleBounds || g.force))) {
|
|
3017
|
-
const v = g.nodeElement.getBoundingClientRect(),
|
|
3017
|
+
const v = g.nodeElement.getBoundingClientRect(), m = Ze(h.extent) ? h.extent : i;
|
|
3018
3018
|
let { positionAbsolute: w } = h.internals;
|
|
3019
|
-
h.parentId && h.extent === "parent" ? w = wi(w, y, t.get(h.parentId)) :
|
|
3019
|
+
h.parentId && h.extent === "parent" ? w = wi(w, y, t.get(h.parentId)) : m && (w = Ue(w, m, y));
|
|
3020
3020
|
const S = {
|
|
3021
3021
|
...h,
|
|
3022
3022
|
measured: y,
|
|
@@ -3161,13 +3161,13 @@ function Bd({ dragItems: e, snapGrid: t, x: n, y: r }) {
|
|
|
3161
3161
|
}
|
|
3162
3162
|
function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, onDragStop: o }) {
|
|
3163
3163
|
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, g = !1, h = !1, y = null;
|
|
3164
|
-
function x({ noDragClassName: v, handleSelector:
|
|
3164
|
+
function x({ noDragClassName: v, handleSelector: m, domNode: w, isSelectable: S, nodeId: _, nodeClickDistance: E = 0 }) {
|
|
3165
3165
|
f = pe(w);
|
|
3166
|
-
function
|
|
3167
|
-
const { nodeLookup: b, nodeExtent: A, snapGrid: N, snapToGrid:
|
|
3166
|
+
function I({ x: M, y: L }) {
|
|
3167
|
+
const { nodeLookup: b, nodeExtent: A, snapGrid: N, snapToGrid: $, nodeOrigin: P, onNodeDrag: C, onSelectionDrag: z, onError: R, updateNodePositions: O } = t();
|
|
3168
3168
|
i = { x: M, y: L };
|
|
3169
3169
|
let F = !1;
|
|
3170
|
-
const Y = a.size > 1, K = Y && A ? Kn(Dt(a)) : null, Z = Y &&
|
|
3170
|
+
const Y = a.size > 1, K = Y && A ? Kn(Dt(a)) : null, Z = Y && $ ? Bd({
|
|
3171
3171
|
dragItems: a,
|
|
3172
3172
|
snapGrid: N,
|
|
3173
3173
|
x: M,
|
|
@@ -3177,7 +3177,7 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
|
|
|
3177
3177
|
if (!b.has(X))
|
|
3178
3178
|
continue;
|
|
3179
3179
|
let W = { x: M - H.distance.x, y: L - H.distance.y };
|
|
3180
|
-
|
|
3180
|
+
$ && (W = Z ? {
|
|
3181
3181
|
x: Math.round(W.x + Z.x),
|
|
3182
3182
|
y: Math.round(W.y + Z.y)
|
|
3183
3183
|
} : Lt(W, N));
|
|
@@ -3217,14 +3217,14 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
|
|
|
3217
3217
|
c = !1, cancelAnimationFrame(s);
|
|
3218
3218
|
return;
|
|
3219
3219
|
}
|
|
3220
|
-
const [N,
|
|
3221
|
-
(N !== 0 ||
|
|
3220
|
+
const [N, $] = cr(l, d, b);
|
|
3221
|
+
(N !== 0 || $ !== 0) && (i.x = ((P = i.x) != null ? P : 0) - N / M[2], i.y = ((C = i.y) != null ? C : 0) - $ / M[2], await L({ x: N, y: $ }) && I(i)), s = requestAnimationFrame(T);
|
|
3222
3222
|
}
|
|
3223
3223
|
function B(M) {
|
|
3224
3224
|
var Y;
|
|
3225
|
-
const { nodeLookup: L, multiSelectionActive: b, nodesDraggable: A, transform: N, snapGrid:
|
|
3225
|
+
const { nodeLookup: L, multiSelectionActive: b, nodesDraggable: A, transform: N, snapGrid: $, snapToGrid: P, selectNodesOnDrag: C, onNodeDragStart: z, onSelectionDragStart: R, unselectNodesAndEdges: O } = t();
|
|
3226
3226
|
u = !0, (!C || !S) && !b && _ && ((Y = L.get(_)) != null && Y.selected || O()), S && C && _ && (e == null || e(_));
|
|
3227
|
-
const F = vt(M.sourceEvent, { transform: N, snapGrid:
|
|
3227
|
+
const F = vt(M.sourceEvent, { transform: N, snapGrid: $, snapToGrid: P, containerBounds: d });
|
|
3228
3228
|
if (i = F, a = Rd(L, A, F, _), a.size > 0 && (n || z || !_ && R)) {
|
|
3229
3229
|
const [K, Z] = In({
|
|
3230
3230
|
nodeId: _,
|
|
@@ -3235,17 +3235,17 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
|
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
3237
|
const k = Qo().clickDistance(E).on("start", (M) => {
|
|
3238
|
-
const { domNode: L, nodeDragThreshold: b, transform: A, snapGrid: N, snapToGrid:
|
|
3239
|
-
d = (L == null ? void 0 : L.getBoundingClientRect()) || null, g = !1, h = !1, y = M.sourceEvent, b === 0 && B(M), i = vt(M.sourceEvent, { transform: A, snapGrid: N, snapToGrid:
|
|
3238
|
+
const { domNode: L, nodeDragThreshold: b, transform: A, snapGrid: N, snapToGrid: $ } = t();
|
|
3239
|
+
d = (L == null ? void 0 : L.getBoundingClientRect()) || null, g = !1, h = !1, y = M.sourceEvent, b === 0 && B(M), i = vt(M.sourceEvent, { transform: A, snapGrid: N, snapToGrid: $, containerBounds: d }), l = Ee(M.sourceEvent, d);
|
|
3240
3240
|
}).on("drag", (M) => {
|
|
3241
|
-
const { autoPanOnNodeDrag: L, transform: b, snapGrid: A, snapToGrid: N, nodeDragThreshold:
|
|
3241
|
+
const { autoPanOnNodeDrag: L, transform: b, snapGrid: A, snapToGrid: N, nodeDragThreshold: $, nodeLookup: P } = t(), C = vt(M.sourceEvent, { transform: b, snapGrid: A, snapToGrid: N, containerBounds: d });
|
|
3242
3242
|
if (y = M.sourceEvent, (M.sourceEvent.type === "touchmove" && M.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
|
|
3243
3243
|
_ && !P.has(_)) && (g = !0), !g) {
|
|
3244
3244
|
if (!c && L && u && (c = !0, T()), !u) {
|
|
3245
3245
|
const z = Ee(M.sourceEvent, d), R = z.x - l.x, O = z.y - l.y;
|
|
3246
|
-
Math.sqrt(R * R + O * O) >
|
|
3246
|
+
Math.sqrt(R * R + O * O) > $ && B(M);
|
|
3247
3247
|
}
|
|
3248
|
-
(i.x !== C.xSnapped || i.y !== C.ySnapped) && a && u && (l = Ee(M.sourceEvent, d),
|
|
3248
|
+
(i.x !== C.xSnapped || i.y !== C.ySnapped) && a && u && (l = Ee(M.sourceEvent, d), I(C));
|
|
3249
3249
|
}
|
|
3250
3250
|
}).on("end", (M) => {
|
|
3251
3251
|
if (!u || g) {
|
|
@@ -3255,27 +3255,27 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
|
|
|
3255
3255
|
if (c = !1, u = !1, cancelAnimationFrame(s), a.size > 0) {
|
|
3256
3256
|
const { nodeLookup: L, updateNodePositions: b, onNodeDragStop: A, onSelectionDragStop: N } = t();
|
|
3257
3257
|
if (h && (b(a, !1), h = !1), o || A || !_ && N) {
|
|
3258
|
-
const [
|
|
3258
|
+
const [$, P] = In({
|
|
3259
3259
|
nodeId: _,
|
|
3260
3260
|
dragItems: a,
|
|
3261
3261
|
nodeLookup: L,
|
|
3262
3262
|
dragging: !1
|
|
3263
3263
|
});
|
|
3264
|
-
o == null || o(M.sourceEvent, a,
|
|
3264
|
+
o == null || o(M.sourceEvent, a, $, P), A == null || A(M.sourceEvent, $, P), _ || N == null || N(M.sourceEvent, P);
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
3267
3267
|
}).filter((M) => {
|
|
3268
3268
|
const L = M.target;
|
|
3269
|
-
return !M.button && (!v || !eo(L, `.${v}`, w)) && (!
|
|
3269
|
+
return !M.button && (!v || !eo(L, `.${v}`, w)) && (!m || eo(L, m, w));
|
|
3270
3270
|
});
|
|
3271
3271
|
f.call(k);
|
|
3272
3272
|
}
|
|
3273
|
-
function
|
|
3273
|
+
function p() {
|
|
3274
3274
|
f == null || f.on(".drag", null);
|
|
3275
3275
|
}
|
|
3276
3276
|
return {
|
|
3277
3277
|
update: x,
|
|
3278
|
-
destroy:
|
|
3278
|
+
destroy: p
|
|
3279
3279
|
};
|
|
3280
3280
|
}
|
|
3281
3281
|
function Fd(e, t, n) {
|
|
@@ -3299,8 +3299,8 @@ function Yd(e, t, n, r) {
|
|
|
3299
3299
|
for (const h of g) {
|
|
3300
3300
|
if (r.nodeId === h.nodeId && r.type === h.type && r.id === h.id)
|
|
3301
3301
|
continue;
|
|
3302
|
-
const { x: y, y: x } = Qe(f, h, h.position, !0),
|
|
3303
|
-
|
|
3302
|
+
const { x: y, y: x } = Qe(f, h, h.position, !0), p = Math.sqrt(Math.pow(y - e.x, 2) + Math.pow(x - e.y, 2));
|
|
3303
|
+
p > t || (p < i ? (o = [{ ...h, x: y, y: x }], i = p) : p === i && o.push({ ...h, x: y, y: x }));
|
|
3304
3304
|
}
|
|
3305
3305
|
}
|
|
3306
3306
|
if (!o.length)
|
|
@@ -3327,15 +3327,15 @@ function Wd(e, t) {
|
|
|
3327
3327
|
return t ? n = !0 : e && !t && (n = !1), n;
|
|
3328
3328
|
}
|
|
3329
3329
|
const Hi = () => !0;
|
|
3330
|
-
function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: g, onConnectStart: h, onConnect: y, onConnectEnd: x, isValidConnection:
|
|
3330
|
+
function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: g, onConnectStart: h, onConnect: y, onConnectEnd: x, isValidConnection: p = Hi, onReconnectEnd: v, updateConnection: m, getTransform: w, getFromHandle: S, autoPanSpeed: _, dragThreshold: E = 1, handleDomNode: I }) {
|
|
3331
3331
|
const T = Ni(e.target);
|
|
3332
3332
|
let B = 0, k;
|
|
3333
|
-
const { x: M, y: L } = Ee(e), b = zi(i,
|
|
3333
|
+
const { x: M, y: L } = Ee(e), b = zi(i, I), A = a == null ? void 0 : a.getBoundingClientRect();
|
|
3334
3334
|
let N = !1;
|
|
3335
3335
|
if (!A || !b)
|
|
3336
3336
|
return;
|
|
3337
|
-
const
|
|
3338
|
-
if (
|
|
3337
|
+
const $ = Oi(o, b, r, c, t);
|
|
3338
|
+
if (!$)
|
|
3339
3339
|
return;
|
|
3340
3340
|
let P = Ee(e, A), C = !1, z = null, R = !1, O = null;
|
|
3341
3341
|
function F() {
|
|
@@ -3345,10 +3345,10 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
|
|
|
3345
3345
|
f({ x: V, y: J }), B = requestAnimationFrame(F);
|
|
3346
3346
|
}
|
|
3347
3347
|
const Y = {
|
|
3348
|
-
|
|
3348
|
+
...$,
|
|
3349
3349
|
nodeId: o,
|
|
3350
3350
|
type: b,
|
|
3351
|
-
position:
|
|
3351
|
+
position: $.position
|
|
3352
3352
|
}, K = c.get(o);
|
|
3353
3353
|
let X = {
|
|
3354
3354
|
inProgress: !0,
|
|
@@ -3364,7 +3364,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
|
|
|
3364
3364
|
pointer: P
|
|
3365
3365
|
};
|
|
3366
3366
|
function H() {
|
|
3367
|
-
N = !0,
|
|
3367
|
+
N = !0, m(X), h == null || h(e, { nodeId: o, handleId: r, handleType: b });
|
|
3368
3368
|
}
|
|
3369
3369
|
E === 0 && H();
|
|
3370
3370
|
function W(V) {
|
|
@@ -3386,7 +3386,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
|
|
|
3386
3386
|
fromNodeId: o,
|
|
3387
3387
|
fromHandleId: r,
|
|
3388
3388
|
fromType: s ? "target" : "source",
|
|
3389
|
-
isValidConnection:
|
|
3389
|
+
isValidConnection: p,
|
|
3390
3390
|
doc: T,
|
|
3391
3391
|
lib: l,
|
|
3392
3392
|
flowId: u,
|
|
@@ -3403,7 +3403,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
|
|
|
3403
3403
|
toNode: U.toHandle ? c.get(U.toHandle.nodeId) : null,
|
|
3404
3404
|
pointer: P
|
|
3405
3405
|
};
|
|
3406
|
-
|
|
3406
|
+
m(re), X = re;
|
|
3407
3407
|
}
|
|
3408
3408
|
function Q(V) {
|
|
3409
3409
|
if (!("touches" in V && V.touches.length > 0)) {
|
|
@@ -3421,27 +3421,27 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
|
|
|
3421
3421
|
T.addEventListener("mousemove", W), T.addEventListener("mouseup", Q), T.addEventListener("touchmove", W), T.addEventListener("touchend", Q);
|
|
3422
3422
|
}
|
|
3423
3423
|
function Ri(e, { handle: t, connectionMode: n, fromNodeId: r, fromHandleId: o, fromType: i, doc: s, lib: a, flowId: c, isValidConnection: l = Hi, nodeLookup: d }) {
|
|
3424
|
-
const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t == null ? void 0 : t.nodeId}-${t == null ? void 0 : t.id}-${t == null ? void 0 : t.type}"]`) : null, { x: g, y: h } = Ee(e), y = s.elementFromPoint(g, h), x = y != null && y.classList.contains(`${a}-flow__handle`) ? y : f,
|
|
3424
|
+
const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t == null ? void 0 : t.nodeId}-${t == null ? void 0 : t.id}-${t == null ? void 0 : t.type}"]`) : null, { x: g, y: h } = Ee(e), y = s.elementFromPoint(g, h), x = y != null && y.classList.contains(`${a}-flow__handle`) ? y : f, p = {
|
|
3425
3425
|
handleDomNode: x,
|
|
3426
3426
|
isValid: !1,
|
|
3427
3427
|
connection: null,
|
|
3428
3428
|
toHandle: null
|
|
3429
3429
|
};
|
|
3430
3430
|
if (x) {
|
|
3431
|
-
const v = zi(void 0, x),
|
|
3432
|
-
if (!
|
|
3433
|
-
return
|
|
3431
|
+
const v = zi(void 0, x), m = x.getAttribute("data-nodeid"), w = x.getAttribute("data-handleid"), S = x.classList.contains("connectable"), _ = x.classList.contains("connectableend");
|
|
3432
|
+
if (!m || !v)
|
|
3433
|
+
return p;
|
|
3434
3434
|
const E = {
|
|
3435
|
-
source: u ?
|
|
3435
|
+
source: u ? m : r,
|
|
3436
3436
|
sourceHandle: u ? w : o,
|
|
3437
|
-
target: u ? r :
|
|
3437
|
+
target: u ? r : m,
|
|
3438
3438
|
targetHandle: u ? o : w
|
|
3439
3439
|
};
|
|
3440
|
-
|
|
3441
|
-
const T = S && _ && (n === at.Strict ? u && v === "source" || !u && v === "target" :
|
|
3442
|
-
|
|
3440
|
+
p.connection = E;
|
|
3441
|
+
const T = S && _ && (n === at.Strict ? u && v === "source" || !u && v === "target" : m !== r || w !== o);
|
|
3442
|
+
p.isValid = T && l(E), p.toHandle = Oi(m, v, w, d, n, !0);
|
|
3443
3443
|
}
|
|
3444
|
-
return
|
|
3444
|
+
return p;
|
|
3445
3445
|
}
|
|
3446
3446
|
const Qn = {
|
|
3447
3447
|
onPointerDown: Gd,
|
|
@@ -3450,30 +3450,30 @@ const Qn = {
|
|
|
3450
3450
|
function Kd({ domNode: e, panZoom: t, getTransform: n, getViewScale: r }) {
|
|
3451
3451
|
const o = pe(e);
|
|
3452
3452
|
function i({ translateExtent: a, width: c, height: l, zoomStep: d = 1, pannable: u = !0, zoomable: f = !0, inversePan: g = !1 }) {
|
|
3453
|
-
const h = (
|
|
3454
|
-
if (
|
|
3453
|
+
const h = (m) => {
|
|
3454
|
+
if (m.sourceEvent.type !== "wheel" || !t)
|
|
3455
3455
|
return;
|
|
3456
|
-
const w = n(), S =
|
|
3456
|
+
const w = n(), S = m.sourceEvent.ctrlKey && At() ? 10 : 1, _ = -m.sourceEvent.deltaY * (m.sourceEvent.deltaMode === 1 ? 0.05 : m.sourceEvent.deltaMode ? 1 : 2e-3) * d, E = w[2] * Math.pow(2, _ * S);
|
|
3457
3457
|
t.scaleTo(E);
|
|
3458
3458
|
};
|
|
3459
3459
|
let y = [0, 0];
|
|
3460
|
-
const x = (
|
|
3460
|
+
const x = (m) => {
|
|
3461
3461
|
var w, S;
|
|
3462
|
-
(
|
|
3463
|
-
(w =
|
|
3464
|
-
(S =
|
|
3462
|
+
(m.sourceEvent.type === "mousedown" || m.sourceEvent.type === "touchstart") && (y = [
|
|
3463
|
+
(w = m.sourceEvent.clientX) != null ? w : m.sourceEvent.touches[0].clientX,
|
|
3464
|
+
(S = m.sourceEvent.clientY) != null ? S : m.sourceEvent.touches[0].clientY
|
|
3465
3465
|
]);
|
|
3466
|
-
},
|
|
3466
|
+
}, p = (m) => {
|
|
3467
3467
|
var B, k;
|
|
3468
3468
|
const w = n();
|
|
3469
|
-
if (
|
|
3469
|
+
if (m.sourceEvent.type !== "mousemove" && m.sourceEvent.type !== "touchmove" || !t)
|
|
3470
3470
|
return;
|
|
3471
3471
|
const S = [
|
|
3472
|
-
(B =
|
|
3473
|
-
(k =
|
|
3472
|
+
(B = m.sourceEvent.clientX) != null ? B : m.sourceEvent.touches[0].clientX,
|
|
3473
|
+
(k = m.sourceEvent.clientY) != null ? k : m.sourceEvent.touches[0].clientY
|
|
3474
3474
|
], _ = [S[0] - y[0], S[1] - y[1]];
|
|
3475
3475
|
y = S;
|
|
3476
|
-
const E = r() * Math.max(w[2], Math.log(w[2])) * (g ? -1 : 1),
|
|
3476
|
+
const E = r() * Math.max(w[2], Math.log(w[2])) * (g ? -1 : 1), I = {
|
|
3477
3477
|
x: w[0] - _[0] * E,
|
|
3478
3478
|
y: w[1] - _[1] * E
|
|
3479
3479
|
}, T = [
|
|
@@ -3481,11 +3481,11 @@ function Kd({ domNode: e, panZoom: t, getTransform: n, getViewScale: r }) {
|
|
|
3481
3481
|
[c, l]
|
|
3482
3482
|
];
|
|
3483
3483
|
t.setViewportConstrained({
|
|
3484
|
-
x:
|
|
3485
|
-
y:
|
|
3484
|
+
x: I.x,
|
|
3485
|
+
y: I.y,
|
|
3486
3486
|
zoom: w[2]
|
|
3487
3487
|
}, T, a);
|
|
3488
|
-
}, v = fi().on("start", x).on("zoom", u ?
|
|
3488
|
+
}, v = fi().on("start", x).on("zoom", u ? p : null).on("zoom.wheel", f ? h : null);
|
|
3489
3489
|
o.call(v, {});
|
|
3490
3490
|
}
|
|
3491
3491
|
function s() {
|
|
@@ -3516,7 +3516,7 @@ function Ud({ zoomPanValues: e, noWheelClassName: t, d3Selection: n, d3Zoom: r,
|
|
|
3516
3516
|
d.preventDefault(), d.stopImmediatePropagation();
|
|
3517
3517
|
const u = n.property("__zoom").k || 1;
|
|
3518
3518
|
if (d.ctrlKey && s) {
|
|
3519
|
-
const x = ve(d),
|
|
3519
|
+
const x = ve(d), p = Vi(d), v = u * Math.pow(2, p);
|
|
3520
3520
|
r.scaleTo(n, v, x, d);
|
|
3521
3521
|
return;
|
|
3522
3522
|
}
|
|
@@ -3614,8 +3614,8 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3614
3614
|
u == null || u.interpolate((M == null ? void 0 : M.interpolate) === "linear" ? bt : Qt).transform(Pn(f, M == null ? void 0 : M.duration, M == null ? void 0 : M.ease, () => L(!0)), k);
|
|
3615
3615
|
}) : !1;
|
|
3616
3616
|
}
|
|
3617
|
-
function x({ noWheelClassName: k, noPanClassName: M, onPaneContextMenu: L, userSelectionActive: b, panOnScroll: A, panOnDrag: N, panOnScrollMode:
|
|
3618
|
-
b && !l.isZoomingOrPanning &&
|
|
3617
|
+
function x({ noWheelClassName: k, noPanClassName: M, onPaneContextMenu: L, userSelectionActive: b, panOnScroll: A, panOnDrag: N, panOnScrollMode: $, panOnScrollSpeed: P, preventScrolling: C, zoomOnPinch: z, zoomOnScroll: R, zoomOnDoubleClick: O, zoomActivationKeyPressed: F, lib: Y, onTransformChange: K, connectionInProgress: Z, paneClickDistance: X, selectionOnDrag: H }) {
|
|
3618
|
+
b && !l.isZoomingOrPanning && p();
|
|
3619
3619
|
const W = A && !F && !b;
|
|
3620
3620
|
u.clickDistance(H ? 1 / 0 : !Se(X) || X < 0 ? 0 : X);
|
|
3621
3621
|
const Q = W ? Ud({
|
|
@@ -3623,7 +3623,7 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3623
3623
|
noWheelClassName: k,
|
|
3624
3624
|
d3Selection: f,
|
|
3625
3625
|
d3Zoom: u,
|
|
3626
|
-
panOnScrollMode:
|
|
3626
|
+
panOnScrollMode: $,
|
|
3627
3627
|
panOnScrollSpeed: P,
|
|
3628
3628
|
zoomOnPinch: z,
|
|
3629
3629
|
onPanZoomStart: s,
|
|
@@ -3673,14 +3673,14 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3673
3673
|
});
|
|
3674
3674
|
u.filter(q), O ? f.on("dblclick.zoom", h) : f.on("dblclick.zoom", null);
|
|
3675
3675
|
}
|
|
3676
|
-
function
|
|
3676
|
+
function p() {
|
|
3677
3677
|
u.on("zoom", null);
|
|
3678
3678
|
}
|
|
3679
3679
|
async function v(k, M, L) {
|
|
3680
3680
|
const b = $n(k), A = u == null ? void 0 : u.constrain()(b, M, L);
|
|
3681
3681
|
return A && await y(A), A;
|
|
3682
3682
|
}
|
|
3683
|
-
async function
|
|
3683
|
+
async function m(k, M) {
|
|
3684
3684
|
const L = $n(k);
|
|
3685
3685
|
return await y(L, M), L;
|
|
3686
3686
|
}
|
|
@@ -3704,7 +3704,7 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3704
3704
|
u == null || u.interpolate((M == null ? void 0 : M.interpolate) === "linear" ? bt : Qt).scaleBy(Pn(f, M == null ? void 0 : M.duration, M == null ? void 0 : M.ease, () => L(!0)), k);
|
|
3705
3705
|
}) : !1;
|
|
3706
3706
|
}
|
|
3707
|
-
function
|
|
3707
|
+
function I(k) {
|
|
3708
3708
|
u == null || u.scaleExtent(k);
|
|
3709
3709
|
}
|
|
3710
3710
|
function T(k) {
|
|
@@ -3716,13 +3716,13 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3716
3716
|
}
|
|
3717
3717
|
return {
|
|
3718
3718
|
update: x,
|
|
3719
|
-
destroy:
|
|
3720
|
-
setViewport:
|
|
3719
|
+
destroy: p,
|
|
3720
|
+
setViewport: m,
|
|
3721
3721
|
setViewportConstrained: v,
|
|
3722
3722
|
getViewport: S,
|
|
3723
3723
|
scaleTo: _,
|
|
3724
3724
|
scaleBy: E,
|
|
3725
|
-
setScaleExtent:
|
|
3725
|
+
setScaleExtent: I,
|
|
3726
3726
|
setTranslateExtent: T,
|
|
3727
3727
|
syncViewport: w,
|
|
3728
3728
|
setClickDistance: B
|
|
@@ -3759,49 +3759,49 @@ function no(e, t) {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
function rf(e, t, n, r, o, i, s, a) {
|
|
3761
3761
|
let { affectsX: c, affectsY: l } = t;
|
|
3762
|
-
const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: g, ySnapped: h } = n, { minWidth: y, maxWidth: x, minHeight:
|
|
3763
|
-
let
|
|
3764
|
-
const B = S + (c ?
|
|
3765
|
-
let b = Wt(B, y, x), A = Wt(k,
|
|
3762
|
+
const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: g, ySnapped: h } = n, { minWidth: y, maxWidth: x, minHeight: p, maxHeight: v } = r, { x: m, y: w, width: S, height: _, aspectRatio: E } = e;
|
|
3763
|
+
let I = Math.floor(d ? g - e.pointerX : 0), T = Math.floor(u ? h - e.pointerY : 0);
|
|
3764
|
+
const B = S + (c ? -I : I), k = _ + (l ? -T : T), M = -i[0] * S, L = -i[1] * _;
|
|
3765
|
+
let b = Wt(B, y, x), A = Wt(k, p, v);
|
|
3766
3766
|
if (s) {
|
|
3767
3767
|
let P = 0, C = 0;
|
|
3768
|
-
c &&
|
|
3768
|
+
c && I < 0 ? P = Oe(m + I + M, s[0][0]) : !c && I > 0 && (P = ze(m + B + M, s[1][0])), l && T < 0 ? C = Oe(w + T + L, s[0][1]) : !l && T > 0 && (C = ze(w + k + L, s[1][1])), b = Math.max(b, P), A = Math.max(A, C);
|
|
3769
3769
|
}
|
|
3770
3770
|
if (a) {
|
|
3771
3771
|
let P = 0, C = 0;
|
|
3772
|
-
c &&
|
|
3772
|
+
c && I > 0 ? P = ze(m + I, a[0][0]) : !c && I < 0 && (P = Oe(m + B, a[1][0])), l && T > 0 ? C = ze(w + T, a[0][1]) : !l && T < 0 && (C = Oe(w + k, a[1][1])), b = Math.max(b, P), A = Math.max(A, C);
|
|
3773
3773
|
}
|
|
3774
3774
|
if (o) {
|
|
3775
3775
|
if (d) {
|
|
3776
|
-
const P = Wt(B / E,
|
|
3776
|
+
const P = Wt(B / E, p, v) * E;
|
|
3777
3777
|
if (b = Math.max(b, P), s) {
|
|
3778
3778
|
let C = 0;
|
|
3779
|
-
!c && !l || c && !l && f ? C = ze(w + L + B / E, s[1][1]) * E : C = Oe(w + L + (c ?
|
|
3779
|
+
!c && !l || c && !l && f ? C = ze(w + L + B / E, s[1][1]) * E : C = Oe(w + L + (c ? I : -I) / E, s[0][1]) * E, b = Math.max(b, C);
|
|
3780
3780
|
}
|
|
3781
3781
|
if (a) {
|
|
3782
3782
|
let C = 0;
|
|
3783
|
-
!c && !l || c && !l && f ? C = Oe(w + B / E, a[1][1]) * E : C = ze(w + (c ?
|
|
3783
|
+
!c && !l || c && !l && f ? C = Oe(w + B / E, a[1][1]) * E : C = ze(w + (c ? I : -I) / E, a[0][1]) * E, b = Math.max(b, C);
|
|
3784
3784
|
}
|
|
3785
3785
|
}
|
|
3786
3786
|
if (u) {
|
|
3787
3787
|
const P = Wt(k * E, y, x) / E;
|
|
3788
3788
|
if (A = Math.max(A, P), s) {
|
|
3789
3789
|
let C = 0;
|
|
3790
|
-
!c && !l || l && !c && f ? C = ze(
|
|
3790
|
+
!c && !l || l && !c && f ? C = ze(m + k * E + M, s[1][0]) / E : C = Oe(m + (l ? T : -T) * E + M, s[0][0]) / E, A = Math.max(A, C);
|
|
3791
3791
|
}
|
|
3792
3792
|
if (a) {
|
|
3793
3793
|
let C = 0;
|
|
3794
|
-
!c && !l || l && !c && f ? C = Oe(
|
|
3794
|
+
!c && !l || l && !c && f ? C = Oe(m + k * E, a[1][0]) / E : C = ze(m + (l ? T : -T) * E, a[0][0]) / E, A = Math.max(A, C);
|
|
3795
3795
|
}
|
|
3796
3796
|
}
|
|
3797
3797
|
}
|
|
3798
|
-
T = T + (T < 0 ? A : -A),
|
|
3799
|
-
const N = c ?
|
|
3798
|
+
T = T + (T < 0 ? A : -A), I = I + (I < 0 ? b : -b), o && (f ? B > k * E ? T = (no(c, l) ? -I : I) / E : I = (no(c, l) ? -T : T) * E : d ? (T = I / E, l = c) : (I = T * E, c = l));
|
|
3799
|
+
const N = c ? m + I : m, $ = l ? w + T : w;
|
|
3800
3800
|
return {
|
|
3801
|
-
width: S + (c ?
|
|
3801
|
+
width: S + (c ? -I : I),
|
|
3802
3802
|
height: _ + (l ? -T : T),
|
|
3803
|
-
x: i[0] *
|
|
3804
|
-
y: i[1] * T * (l ? -1 : 1) +
|
|
3803
|
+
x: i[0] * I * (c ? -1 : 1) + N,
|
|
3804
|
+
y: i[1] * T * (l ? -1 : 1) + $
|
|
3805
3805
|
};
|
|
3806
3806
|
}
|
|
3807
3807
|
const Fi = { width: 0, height: 0, x: 0, y: 0 }, of = {
|
|
@@ -3832,53 +3832,53 @@ function af({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: o })
|
|
|
3832
3832
|
keepAspectRatio: !1
|
|
3833
3833
|
};
|
|
3834
3834
|
function a({ controlPosition: l, boundaries: d, keepAspectRatio: u, resizeDirection: f, onResizeStart: g, onResize: h, onResizeEnd: y, shouldResize: x }) {
|
|
3835
|
-
let
|
|
3835
|
+
let p = { ...Fi }, v = { ...of };
|
|
3836
3836
|
s = {
|
|
3837
3837
|
boundaries: d,
|
|
3838
3838
|
resizeDirection: f,
|
|
3839
3839
|
keepAspectRatio: u,
|
|
3840
3840
|
controlDirection: to(l)
|
|
3841
3841
|
};
|
|
3842
|
-
let
|
|
3842
|
+
let m, w = null, S = [], _, E, I, T = !1;
|
|
3843
3843
|
const B = Qo().on("start", (k) => {
|
|
3844
3844
|
var z, R, O, F, Y, K;
|
|
3845
|
-
const { nodeLookup: M, transform: L, snapGrid: b, snapToGrid: A, nodeOrigin: N, paneDomNode:
|
|
3846
|
-
if (
|
|
3845
|
+
const { nodeLookup: M, transform: L, snapGrid: b, snapToGrid: A, nodeOrigin: N, paneDomNode: $ } = n();
|
|
3846
|
+
if (m = M.get(t), !m)
|
|
3847
3847
|
return;
|
|
3848
|
-
w = (z =
|
|
3848
|
+
w = (z = $ == null ? void 0 : $.getBoundingClientRect()) != null ? z : null;
|
|
3849
3849
|
const { xSnapped: P, ySnapped: C } = vt(k.sourceEvent, {
|
|
3850
3850
|
transform: L,
|
|
3851
3851
|
snapGrid: b,
|
|
3852
3852
|
snapToGrid: A,
|
|
3853
3853
|
containerBounds: w
|
|
3854
3854
|
});
|
|
3855
|
-
|
|
3856
|
-
width: (R =
|
|
3857
|
-
height: (O =
|
|
3858
|
-
x: (F =
|
|
3859
|
-
y: (Y =
|
|
3855
|
+
p = {
|
|
3856
|
+
width: (R = m.measured.width) != null ? R : 0,
|
|
3857
|
+
height: (O = m.measured.height) != null ? O : 0,
|
|
3858
|
+
x: (F = m.position.x) != null ? F : 0,
|
|
3859
|
+
y: (Y = m.position.y) != null ? Y : 0
|
|
3860
3860
|
}, v = {
|
|
3861
|
-
...
|
|
3861
|
+
...p,
|
|
3862
3862
|
pointerX: P,
|
|
3863
3863
|
pointerY: C,
|
|
3864
|
-
aspectRatio:
|
|
3865
|
-
}, _ = void 0, E = Ze(
|
|
3864
|
+
aspectRatio: p.width / p.height
|
|
3865
|
+
}, _ = void 0, E = Ze(m.extent) ? m.extent : void 0, m.parentId && (m.extent === "parent" || m.expandParent) && (_ = M.get(m.parentId)), _ && m.extent === "parent" && (E = [
|
|
3866
3866
|
[0, 0],
|
|
3867
3867
|
[_.measured.width, _.measured.height]
|
|
3868
|
-
]), S = [],
|
|
3868
|
+
]), S = [], I = void 0;
|
|
3869
3869
|
for (const [Z, X] of M)
|
|
3870
3870
|
if (X.parentId === t && (S.push({
|
|
3871
3871
|
id: Z,
|
|
3872
3872
|
position: { ...X.position },
|
|
3873
3873
|
extent: X.extent
|
|
3874
3874
|
}), X.extent === "parent" || X.expandParent)) {
|
|
3875
|
-
const H = sf(X,
|
|
3876
|
-
|
|
3877
|
-
[Math.min(H[0][0],
|
|
3878
|
-
[Math.max(H[1][0],
|
|
3879
|
-
] :
|
|
3875
|
+
const H = sf(X, m, (K = X.origin) != null ? K : N);
|
|
3876
|
+
I ? I = [
|
|
3877
|
+
[Math.min(H[0][0], I[0][0]), Math.min(H[0][1], I[0][1])],
|
|
3878
|
+
[Math.max(H[1][0], I[1][0]), Math.max(H[1][1], I[1][1])]
|
|
3879
|
+
] : I = H;
|
|
3880
3880
|
}
|
|
3881
|
-
g == null || g(k, { ...
|
|
3881
|
+
g == null || g(k, { ...p });
|
|
3882
3882
|
}).on("drag", (k) => {
|
|
3883
3883
|
var j, re, te;
|
|
3884
3884
|
const { transform: M, snapGrid: L, snapToGrid: b, nodeOrigin: A } = n(), N = vt(k.sourceEvent, {
|
|
@@ -3886,37 +3886,37 @@ function af({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: o })
|
|
|
3886
3886
|
snapGrid: L,
|
|
3887
3887
|
snapToGrid: b,
|
|
3888
3888
|
containerBounds: w
|
|
3889
|
-
}),
|
|
3890
|
-
if (!
|
|
3889
|
+
}), $ = [];
|
|
3890
|
+
if (!m)
|
|
3891
3891
|
return;
|
|
3892
|
-
const { x: P, y: C, width: z, height: R } =
|
|
3892
|
+
const { x: P, y: C, width: z, height: R } = p, O = {}, F = (j = m.origin) != null ? j : A, { width: Y, height: K, x: Z, y: X } = rf(v, s.controlDirection, N, s.boundaries, s.keepAspectRatio, F, E, I), H = Y !== z, W = K !== R, Q = Z !== P && H, V = X !== C && W;
|
|
3893
3893
|
if (!Q && !V && !H && !W)
|
|
3894
3894
|
return;
|
|
3895
|
-
if ((Q || V || F[0] === 1 || F[1] === 1) && (O.x = Q ? Z :
|
|
3895
|
+
if ((Q || V || F[0] === 1 || F[1] === 1) && (O.x = Q ? Z : p.x, O.y = V ? X : p.y, p.x = O.x, p.y = O.y, S.length > 0)) {
|
|
3896
3896
|
const oe = Z - P, de = X - C;
|
|
3897
3897
|
for (const fe of S)
|
|
3898
3898
|
fe.position = {
|
|
3899
3899
|
x: fe.position.x - oe + F[0] * (Y - z),
|
|
3900
3900
|
y: fe.position.y - de + F[1] * (K - R)
|
|
3901
|
-
},
|
|
3901
|
+
}, $.push(fe);
|
|
3902
3902
|
}
|
|
3903
|
-
if ((H || W) && (O.width = H && (!s.resizeDirection || s.resizeDirection === "horizontal") ? Y :
|
|
3903
|
+
if ((H || W) && (O.width = H && (!s.resizeDirection || s.resizeDirection === "horizontal") ? Y : p.width, O.height = W && (!s.resizeDirection || s.resizeDirection === "vertical") ? K : p.height, p.width = O.width, p.height = O.height), _ && m.expandParent) {
|
|
3904
3904
|
const oe = F[0] * ((re = O.width) != null ? re : 0);
|
|
3905
|
-
O.x && O.x < oe && (
|
|
3905
|
+
O.x && O.x < oe && (p.x = oe, v.x = v.x - (O.x - oe));
|
|
3906
3906
|
const de = F[1] * ((te = O.height) != null ? te : 0);
|
|
3907
|
-
O.y && O.y < de && (
|
|
3907
|
+
O.y && O.y < de && (p.y = de, v.y = v.y - (O.y - de));
|
|
3908
3908
|
}
|
|
3909
3909
|
const J = nf({
|
|
3910
|
-
width:
|
|
3910
|
+
width: p.width,
|
|
3911
3911
|
prevWidth: z,
|
|
3912
|
-
height:
|
|
3912
|
+
height: p.height,
|
|
3913
3913
|
prevHeight: R,
|
|
3914
3914
|
affectsX: s.controlDirection.affectsX,
|
|
3915
3915
|
affectsY: s.controlDirection.affectsY
|
|
3916
|
-
}), U = { ...
|
|
3917
|
-
(x == null ? void 0 : x(k, U)) !== !1 && (T = !0, h == null || h(k, U), r(O,
|
|
3916
|
+
}), U = { ...p, direction: J };
|
|
3917
|
+
(x == null ? void 0 : x(k, U)) !== !1 && (T = !0, h == null || h(k, U), r(O, $));
|
|
3918
3918
|
}).on("end", (k) => {
|
|
3919
|
-
T && (y == null || y(k, { ...
|
|
3919
|
+
T && (y == null || y(k, { ...p }), o == null || o({ ...p }), T = !1);
|
|
3920
3920
|
});
|
|
3921
3921
|
i.call(B);
|
|
3922
3922
|
}
|
|
@@ -4012,16 +4012,16 @@ function uf() {
|
|
|
4012
4012
|
x = s({
|
|
4013
4013
|
inst: { value: y, getSnapshot: h }
|
|
4014
4014
|
});
|
|
4015
|
-
var
|
|
4015
|
+
var p = x[0].inst, v = x[1];
|
|
4016
4016
|
return c(
|
|
4017
4017
|
function() {
|
|
4018
|
-
|
|
4018
|
+
p.value = y, p.getSnapshot = h, n(p) && v({ inst: p });
|
|
4019
4019
|
},
|
|
4020
4020
|
[g, y, h]
|
|
4021
4021
|
), a(
|
|
4022
4022
|
function() {
|
|
4023
|
-
return n(
|
|
4024
|
-
n(
|
|
4023
|
+
return n(p) && v({ inst: p }), g(function() {
|
|
4024
|
+
n(p) && v({ inst: p });
|
|
4025
4025
|
});
|
|
4026
4026
|
},
|
|
4027
4027
|
[g]
|
|
@@ -4075,26 +4075,26 @@ function df() {
|
|
|
4075
4075
|
} else y = h.current;
|
|
4076
4076
|
h = a(
|
|
4077
4077
|
function() {
|
|
4078
|
-
function
|
|
4078
|
+
function p(_) {
|
|
4079
4079
|
if (!v) {
|
|
4080
|
-
if (v = !0,
|
|
4080
|
+
if (v = !0, m = _, _ = f(_), g !== void 0 && y.hasValue) {
|
|
4081
4081
|
var E = y.value;
|
|
4082
4082
|
if (g(E, _))
|
|
4083
4083
|
return w = E;
|
|
4084
4084
|
}
|
|
4085
4085
|
return w = _;
|
|
4086
4086
|
}
|
|
4087
|
-
if (E = w, r(
|
|
4088
|
-
var
|
|
4089
|
-
return g !== void 0 && g(E,
|
|
4087
|
+
if (E = w, r(m, _)) return E;
|
|
4088
|
+
var I = f(_);
|
|
4089
|
+
return g !== void 0 && g(E, I) ? (m = _, E) : (m = _, w = I);
|
|
4090
4090
|
}
|
|
4091
|
-
var v = !1,
|
|
4091
|
+
var v = !1, m, w, S = u === void 0 ? null : u;
|
|
4092
4092
|
return [
|
|
4093
4093
|
function() {
|
|
4094
|
-
return
|
|
4094
|
+
return p(d());
|
|
4095
4095
|
},
|
|
4096
4096
|
S === null ? void 0 : function() {
|
|
4097
|
-
return
|
|
4097
|
+
return p(S());
|
|
4098
4098
|
}
|
|
4099
4099
|
];
|
|
4100
4100
|
},
|
|
@@ -4135,27 +4135,27 @@ function ff() {
|
|
|
4135
4135
|
} else y = h.current;
|
|
4136
4136
|
h = a(
|
|
4137
4137
|
function() {
|
|
4138
|
-
function
|
|
4138
|
+
function p(_) {
|
|
4139
4139
|
if (!v) {
|
|
4140
|
-
if (v = !0,
|
|
4140
|
+
if (v = !0, m = _, _ = f(_), g !== void 0 && y.hasValue) {
|
|
4141
4141
|
var E = y.value;
|
|
4142
4142
|
if (g(E, _))
|
|
4143
4143
|
return w = E;
|
|
4144
4144
|
}
|
|
4145
4145
|
return w = _;
|
|
4146
4146
|
}
|
|
4147
|
-
if (E = w, r(
|
|
4147
|
+
if (E = w, r(m, _))
|
|
4148
4148
|
return E;
|
|
4149
|
-
var
|
|
4150
|
-
return g !== void 0 && g(E,
|
|
4149
|
+
var I = f(_);
|
|
4150
|
+
return g !== void 0 && g(E, I) ? (m = _, E) : (m = _, w = I);
|
|
4151
4151
|
}
|
|
4152
|
-
var v = !1,
|
|
4152
|
+
var v = !1, m, w, S = u === void 0 ? null : u;
|
|
4153
4153
|
return [
|
|
4154
4154
|
function() {
|
|
4155
|
-
return
|
|
4155
|
+
return p(d());
|
|
4156
4156
|
},
|
|
4157
4157
|
S === null ? void 0 : function() {
|
|
4158
|
-
return
|
|
4158
|
+
return p(S());
|
|
4159
4159
|
}
|
|
4160
4160
|
];
|
|
4161
4161
|
},
|
|
@@ -4436,12 +4436,12 @@ function It(e = null, t = { target: yo, actInsideInputWithModifier: !0 }) {
|
|
|
4436
4436
|
const c = (d = t == null ? void 0 : t.target) != null ? d : yo, l = (u = t == null ? void 0 : t.actInsideInputWithModifier) != null ? u : !0;
|
|
4437
4437
|
if (e !== null) {
|
|
4438
4438
|
const f = (y) => {
|
|
4439
|
-
var v,
|
|
4439
|
+
var v, m;
|
|
4440
4440
|
if (o.current = y.ctrlKey || y.metaKey || y.shiftKey || y.altKey, (!o.current || o.current && !l) && Ci(y))
|
|
4441
4441
|
return !1;
|
|
4442
|
-
const
|
|
4443
|
-
if (i.current.add(y[
|
|
4444
|
-
const w = ((
|
|
4442
|
+
const p = wo(y.code, a);
|
|
4443
|
+
if (i.current.add(y[p]), xo(s, i.current, !1)) {
|
|
4444
|
+
const w = ((m = (v = y.composedPath) == null ? void 0 : v.call(y)) == null ? void 0 : m[0]) || y.target, S = (w == null ? void 0 : w.nodeName) === "BUTTON" || (w == null ? void 0 : w.nodeName) === "A";
|
|
4445
4445
|
t.preventDefault !== !1 && (o.current || !S) && y.preventDefault(), r(!0);
|
|
4446
4446
|
}
|
|
4447
4447
|
}, g = (y) => {
|
|
@@ -4650,17 +4650,17 @@ function Kf({ children: e }) {
|
|
|
4650
4650
|
const t = ae(), n = we((a) => {
|
|
4651
4651
|
const { nodes: c = [], setNodes: l, hasDefaultNodes: d, onNodesChange: u, nodeLookup: f, fitViewQueued: g, onNodesChangeMiddlewareMap: h } = t.getState();
|
|
4652
4652
|
let y = c;
|
|
4653
|
-
for (const
|
|
4654
|
-
y = typeof
|
|
4653
|
+
for (const p of a)
|
|
4654
|
+
y = typeof p == "function" ? p(y) : p;
|
|
4655
4655
|
let x = bo({
|
|
4656
4656
|
items: y,
|
|
4657
4657
|
lookup: f
|
|
4658
4658
|
});
|
|
4659
|
-
for (const
|
|
4660
|
-
x =
|
|
4659
|
+
for (const p of h.values())
|
|
4660
|
+
x = p(x);
|
|
4661
4661
|
d && l(y), x.length > 0 ? u == null || u(x) : g && window.requestAnimationFrame(() => {
|
|
4662
|
-
const { fitViewQueued:
|
|
4663
|
-
|
|
4662
|
+
const { fitViewQueued: p, nodes: v, setNodes: m } = t.getState();
|
|
4663
|
+
p && m(v);
|
|
4664
4664
|
});
|
|
4665
4665
|
}, []), r = So(n), o = we((a) => {
|
|
4666
4666
|
const { edges: c = [], setEdges: l, hasDefaultEdges: d, onEdgesChange: u, edgeLookup: f } = t.getState();
|
|
@@ -4688,12 +4688,12 @@ function mr() {
|
|
|
4688
4688
|
}, a = (u) => {
|
|
4689
4689
|
n.edgeQueue.push(u);
|
|
4690
4690
|
}, c = (u) => {
|
|
4691
|
-
var
|
|
4691
|
+
var p, v, m, w;
|
|
4692
4692
|
const { nodeLookup: f, nodeOrigin: g } = t.getState(), h = _o(u) ? u : f.get(u.id), y = h.parentId ? Ei(h.position, h.measured, h.parentId, f, g) : h.position, x = {
|
|
4693
4693
|
...h,
|
|
4694
4694
|
position: y,
|
|
4695
|
-
width: (v = (
|
|
4696
|
-
height: (w = (
|
|
4695
|
+
width: (v = (p = h.measured) == null ? void 0 : p.width) != null ? v : h.width,
|
|
4696
|
+
height: (w = (m = h.measured) == null ? void 0 : m.height) != null ? w : h.height
|
|
4697
4697
|
};
|
|
4698
4698
|
return kt(x);
|
|
4699
4699
|
}, l = (u, f, g = { replace: !1 }) => {
|
|
@@ -4738,8 +4738,8 @@ function mr() {
|
|
|
4738
4738
|
toObject: () => {
|
|
4739
4739
|
const { nodes: u = [], edges: f = [], transform: g } = t.getState(), [h, y, x] = g;
|
|
4740
4740
|
return {
|
|
4741
|
-
nodes: u.map((
|
|
4742
|
-
edges: f.map((
|
|
4741
|
+
nodes: u.map((p) => ({ ...p })),
|
|
4742
|
+
edges: f.map((p) => ({ ...p })),
|
|
4743
4743
|
viewport: {
|
|
4744
4744
|
x: h,
|
|
4745
4745
|
y,
|
|
@@ -4748,22 +4748,22 @@ function mr() {
|
|
|
4748
4748
|
};
|
|
4749
4749
|
},
|
|
4750
4750
|
deleteElements: async ({ nodes: u = [], edges: f = [] }) => {
|
|
4751
|
-
const { nodes: g, edges: h, onNodesDelete: y, onEdgesDelete: x, triggerNodeChanges:
|
|
4751
|
+
const { nodes: g, edges: h, onNodesDelete: y, onEdgesDelete: x, triggerNodeChanges: p, triggerEdgeChanges: v, onDelete: m, onBeforeDelete: w } = t.getState(), { nodes: S, edges: _ } = await pd({
|
|
4752
4752
|
nodesToRemove: u,
|
|
4753
4753
|
edgesToRemove: f,
|
|
4754
4754
|
nodes: g,
|
|
4755
4755
|
edges: h,
|
|
4756
4756
|
onBeforeDelete: w
|
|
4757
|
-
}), E = _.length > 0,
|
|
4757
|
+
}), E = _.length > 0, I = S.length > 0;
|
|
4758
4758
|
if (E) {
|
|
4759
4759
|
const T = _.map(vo);
|
|
4760
4760
|
x == null || x(_), v(T);
|
|
4761
4761
|
}
|
|
4762
|
-
if (
|
|
4762
|
+
if (I) {
|
|
4763
4763
|
const T = S.map(vo);
|
|
4764
|
-
y == null || y(S),
|
|
4764
|
+
y == null || y(S), p(T);
|
|
4765
4765
|
}
|
|
4766
|
-
return (
|
|
4766
|
+
return (I || E) && (m == null || m({ nodes: S, edges: _ })), { deletedNodes: S, deletedEdges: _ };
|
|
4767
4767
|
},
|
|
4768
4768
|
/**
|
|
4769
4769
|
* Partial is defined as "the 2 nodes/areas are intersecting partially".
|
|
@@ -4772,12 +4772,12 @@ function mr() {
|
|
|
4772
4772
|
*/
|
|
4773
4773
|
getIntersectingNodes: (u, f = !0, g) => {
|
|
4774
4774
|
const h = Yr(u), y = h ? u : c(u), x = g !== void 0;
|
|
4775
|
-
return y ? (g || t.getState().nodes).filter((
|
|
4776
|
-
const v = t.getState().nodeLookup.get(
|
|
4777
|
-
if (v && !h && (
|
|
4775
|
+
return y ? (g || t.getState().nodes).filter((p) => {
|
|
4776
|
+
const v = t.getState().nodeLookup.get(p.id);
|
|
4777
|
+
if (v && !h && (p.id === u.id || !v.internals.positionAbsolute))
|
|
4778
4778
|
return !1;
|
|
4779
|
-
const
|
|
4780
|
-
return f && w > 0 || w >=
|
|
4779
|
+
const m = kt(x ? p : v), w = un(m, y);
|
|
4780
|
+
return f && w > 0 || w >= m.width * m.height || w >= y.width * y.height;
|
|
4781
4781
|
}) : [];
|
|
4782
4782
|
},
|
|
4783
4783
|
isNodeIntersecting: (u, f, g = !0) => {
|
|
@@ -4868,12 +4868,12 @@ const Sn = {
|
|
|
4868
4868
|
lib: e.lib,
|
|
4869
4869
|
connectionInProgress: e.connection.inProgress
|
|
4870
4870
|
});
|
|
4871
|
-
function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: o = 0.5, panOnScrollMode: i = Ge.Free, zoomOnDoubleClick: s = !0, panOnDrag: a = !0, defaultViewport: c, translateExtent: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: g = !0, children: h, noWheelClassName: y, noPanClassName: x, onViewportChange:
|
|
4872
|
-
const S = ae(), _ = ne(null), { userSelectionActive: E, lib:
|
|
4871
|
+
function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: o = 0.5, panOnScrollMode: i = Ge.Free, zoomOnDoubleClick: s = !0, panOnDrag: a = !0, defaultViewport: c, translateExtent: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: g = !0, children: h, noWheelClassName: y, noPanClassName: x, onViewportChange: p, isControlledViewport: v, paneClickDistance: m, selectionOnDrag: w }) {
|
|
4872
|
+
const S = ae(), _ = ne(null), { userSelectionActive: E, lib: I, connectionInProgress: T } = ee(jf, se), B = It(f), k = ne();
|
|
4873
4873
|
Jf(_);
|
|
4874
4874
|
const M = we((L) => {
|
|
4875
|
-
|
|
4876
|
-
}, [
|
|
4875
|
+
p == null || p({ x: L[0], y: L[1], zoom: L[2] }), v || S.setState({ transform: L });
|
|
4876
|
+
}, [p, v]);
|
|
4877
4877
|
return ie(() => {
|
|
4878
4878
|
if (_.current) {
|
|
4879
4879
|
k.current = tf({
|
|
@@ -4882,18 +4882,18 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4882
4882
|
maxZoom: u,
|
|
4883
4883
|
translateExtent: l,
|
|
4884
4884
|
viewport: c,
|
|
4885
|
-
onDraggingChange: (N) => S.setState((
|
|
4886
|
-
onPanZoomStart: (N,
|
|
4885
|
+
onDraggingChange: (N) => S.setState(($) => $.paneDragging === N ? $ : { paneDragging: N }),
|
|
4886
|
+
onPanZoomStart: (N, $) => {
|
|
4887
4887
|
const { onViewportChangeStart: P, onMoveStart: C } = S.getState();
|
|
4888
|
-
C == null || C(N,
|
|
4888
|
+
C == null || C(N, $), P == null || P($);
|
|
4889
4889
|
},
|
|
4890
|
-
onPanZoom: (N,
|
|
4890
|
+
onPanZoom: (N, $) => {
|
|
4891
4891
|
const { onViewportChange: P, onMove: C } = S.getState();
|
|
4892
|
-
C == null || C(N,
|
|
4892
|
+
C == null || C(N, $), P == null || P($);
|
|
4893
4893
|
},
|
|
4894
|
-
onPanZoomEnd: (N,
|
|
4894
|
+
onPanZoomEnd: (N, $) => {
|
|
4895
4895
|
const { onViewportChangeEnd: P, onMoveEnd: C } = S.getState();
|
|
4896
|
-
C == null || C(N,
|
|
4896
|
+
C == null || C(N, $), P == null || P($);
|
|
4897
4897
|
}
|
|
4898
4898
|
});
|
|
4899
4899
|
const { x: L, y: b, zoom: A } = k.current.getViewport();
|
|
@@ -4922,11 +4922,11 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4922
4922
|
noPanClassName: x,
|
|
4923
4923
|
userSelectionActive: E,
|
|
4924
4924
|
noWheelClassName: y,
|
|
4925
|
-
lib:
|
|
4925
|
+
lib: I,
|
|
4926
4926
|
onTransformChange: M,
|
|
4927
4927
|
connectionInProgress: T,
|
|
4928
4928
|
selectionOnDrag: w,
|
|
4929
|
-
paneClickDistance:
|
|
4929
|
+
paneClickDistance: m
|
|
4930
4930
|
});
|
|
4931
4931
|
}, [
|
|
4932
4932
|
e,
|
|
@@ -4942,11 +4942,11 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
4942
4942
|
x,
|
|
4943
4943
|
E,
|
|
4944
4944
|
y,
|
|
4945
|
-
|
|
4945
|
+
I,
|
|
4946
4946
|
M,
|
|
4947
4947
|
T,
|
|
4948
4948
|
w,
|
|
4949
|
-
|
|
4949
|
+
m
|
|
4950
4950
|
]), D("div", { className: "react-flow__renderer", ref: _, style: Sn, children: h });
|
|
4951
4951
|
}
|
|
4952
4952
|
const th = (e) => ({
|
|
@@ -4971,13 +4971,13 @@ const zn = (e, t) => (n) => {
|
|
|
4971
4971
|
autoPanSpeed: e.autoPanSpeed
|
|
4972
4972
|
});
|
|
4973
4973
|
function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full, panOnDrag: r, autoPanOnSelection: o, paneClickDistance: i, selectionOnDrag: s, onSelectionStart: a, onSelectionEnd: c, onPaneClick: l, onPaneContextMenu: d, onPaneScroll: u, onPaneMouseEnter: f, onPaneMouseMove: g, onPaneMouseLeave: h, children: y }) {
|
|
4974
|
-
const x = ne(0),
|
|
4975
|
-
if (L.current || M.current ||
|
|
4974
|
+
const x = ne(0), p = ae(), { userSelectionActive: v, elementsSelectable: m, dragging: w, panBy: S, autoPanSpeed: _ } = ee(rh, se), E = m && (e || v), I = ne(null), T = ne(), B = ne(/* @__PURE__ */ new Set()), k = ne(/* @__PURE__ */ new Set()), M = ne(!1), L = ne(!1), b = ne({ x: 0, y: 0 }), A = ne(!1), N = (H) => {
|
|
4975
|
+
if (L.current || M.current || p.getState().connection.inProgress) {
|
|
4976
4976
|
L.current = !1, M.current = !1;
|
|
4977
4977
|
return;
|
|
4978
4978
|
}
|
|
4979
|
-
l == null || l(H),
|
|
4980
|
-
},
|
|
4979
|
+
l == null || l(H), p.getState().resetSelectedElements(), p.setState({ nodesSelectionActive: !1 });
|
|
4980
|
+
}, $ = (H) => {
|
|
4981
4981
|
if (Array.isArray(r) && (r != null && r.includes(2))) {
|
|
4982
4982
|
H.preventDefault();
|
|
4983
4983
|
return;
|
|
@@ -4987,15 +4987,15 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
|
|
|
4987
4987
|
L.current && (H.stopPropagation(), L.current = !1);
|
|
4988
4988
|
}, z = (H) => {
|
|
4989
4989
|
var te, oe;
|
|
4990
|
-
const { domNode: W, transform: Q } =
|
|
4990
|
+
const { domNode: W, transform: Q } = p.getState();
|
|
4991
4991
|
if (T.current = W == null ? void 0 : W.getBoundingClientRect(), !T.current)
|
|
4992
4992
|
return;
|
|
4993
|
-
const V = H.target ===
|
|
4993
|
+
const V = H.target === I.current;
|
|
4994
4994
|
if (!V && !!H.target.closest(".nokey") || !e || !(s && V || t) || H.button !== 0 || !H.isPrimary)
|
|
4995
4995
|
return;
|
|
4996
4996
|
(oe = (te = H.target) == null ? void 0 : te.setPointerCapture) == null || oe.call(te, H.pointerId), L.current = !1;
|
|
4997
4997
|
const { x: q, y: j } = Ee(H.nativeEvent, T.current), re = Ot({ x: q, y: j }, Q);
|
|
4998
|
-
|
|
4998
|
+
p.setState({
|
|
4999
4999
|
userSelectionRect: {
|
|
5000
5000
|
width: 0,
|
|
5001
5001
|
height: 0,
|
|
@@ -5008,10 +5008,10 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
|
|
|
5008
5008
|
};
|
|
5009
5009
|
function R(H, W) {
|
|
5010
5010
|
var Je, Ie;
|
|
5011
|
-
const { userSelectionRect: Q } =
|
|
5011
|
+
const { userSelectionRect: Q } = p.getState();
|
|
5012
5012
|
if (!Q)
|
|
5013
5013
|
return;
|
|
5014
|
-
const { transform: V, nodeLookup: J, edgeLookup: U, connectionLookup: q, triggerNodeChanges: j, triggerEdgeChanges: re, defaultEdgeOptions: te } =
|
|
5014
|
+
const { transform: V, nodeLookup: J, edgeLookup: U, connectionLookup: q, triggerNodeChanges: j, triggerEdgeChanges: re, defaultEdgeOptions: te } = p.getState(), oe = { x: Q.startX, y: Q.startY }, { x: de, y: fe } = ut(oe, V), Ae = {
|
|
5015
5015
|
startX: oe.x,
|
|
5016
5016
|
startY: oe.y,
|
|
5017
5017
|
x: H < de ? H : de,
|
|
@@ -5037,7 +5037,7 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
|
|
|
5037
5037
|
const he = nt(U, k.current);
|
|
5038
5038
|
re(he);
|
|
5039
5039
|
}
|
|
5040
|
-
|
|
5040
|
+
p.setState({
|
|
5041
5041
|
userSelectionRect: Ae,
|
|
5042
5042
|
userSelectionActive: !0,
|
|
5043
5043
|
nodesSelectionActive: !1
|
|
@@ -5061,7 +5061,7 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
|
|
|
5061
5061
|
};
|
|
5062
5062
|
ie(() => () => F(), []);
|
|
5063
5063
|
const Y = (H) => {
|
|
5064
|
-
const { userSelectionRect: W, transform: Q, resetSelectedElements: V } =
|
|
5064
|
+
const { userSelectionRect: W, transform: Q, resetSelectedElements: V } = p.getState();
|
|
5065
5065
|
if (!T.current || !W)
|
|
5066
5066
|
return;
|
|
5067
5067
|
const { x: J, y: U } = Ee(H.nativeEvent, T.current);
|
|
@@ -5077,20 +5077,20 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
|
|
|
5077
5077
|
}, K = (H) => {
|
|
5078
5078
|
var W, Q;
|
|
5079
5079
|
if (!E) {
|
|
5080
|
-
H.target ===
|
|
5080
|
+
H.target === I.current && p.getState().connection.inProgress && (M.current = !0);
|
|
5081
5081
|
return;
|
|
5082
5082
|
}
|
|
5083
|
-
H.button === 0 && ((Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), !v && H.target ===
|
|
5083
|
+
H.button === 0 && ((Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), !v && H.target === I.current && p.getState().userSelectionRect && (N == null || N(H)), p.setState({
|
|
5084
5084
|
userSelectionActive: !1,
|
|
5085
5085
|
userSelectionRect: null
|
|
5086
|
-
}), L.current && (c == null || c(H),
|
|
5086
|
+
}), L.current && (c == null || c(H), p.setState({
|
|
5087
5087
|
nodesSelectionActive: B.current.size > 0
|
|
5088
5088
|
})), F());
|
|
5089
5089
|
}, Z = (H) => {
|
|
5090
5090
|
var W, Q;
|
|
5091
5091
|
(Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), F();
|
|
5092
5092
|
}, X = r === !0 || Array.isArray(r) && r.includes(0);
|
|
5093
|
-
return ce("div", { className: ue(["react-flow__pane", { draggable: X, dragging: w, selection: e }]), onClick: E ? void 0 : zn(N,
|
|
5093
|
+
return ce("div", { className: ue(["react-flow__pane", { draggable: X, dragging: w, selection: e }]), onClick: E ? void 0 : zn(N, I), onContextMenu: zn($, I), onWheel: zn(P, I), onPointerEnter: E ? void 0 : f, onPointerMove: E ? Y : g, onPointerUp: K, onPointerCancel: E ? Z : void 0, onPointerDownCapture: E ? z : void 0, onClickCapture: E ? C : void 0, onPointerLeave: h, ref: I, style: Sn, children: [y, D(nh, {})] });
|
|
5094
5094
|
}
|
|
5095
5095
|
function Jn({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
|
|
5096
5096
|
const { addSelectedNodes: o, unselectNodesAndEdges: i, multiSelectionActive: s, nodeLookup: a, onError: c } = t.getState(), l = a.get(e);
|
|
@@ -5142,23 +5142,23 @@ function ts() {
|
|
|
5142
5142
|
const e = ae();
|
|
5143
5143
|
return we((n) => {
|
|
5144
5144
|
const { nodeExtent: r, snapToGrid: o, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: l, nodeOrigin: d } = e.getState(), u = /* @__PURE__ */ new Map(), f = ih(s), g = o ? i[0] : 5, h = o ? i[1] : 5, y = n.direction.x * g * n.factor, x = n.direction.y * h * n.factor;
|
|
5145
|
-
for (const [,
|
|
5146
|
-
if (!f(
|
|
5145
|
+
for (const [, p] of l) {
|
|
5146
|
+
if (!f(p))
|
|
5147
5147
|
continue;
|
|
5148
5148
|
let v = {
|
|
5149
|
-
x:
|
|
5150
|
-
y:
|
|
5149
|
+
x: p.internals.positionAbsolute.x + y,
|
|
5150
|
+
y: p.internals.positionAbsolute.y + x
|
|
5151
5151
|
};
|
|
5152
5152
|
o && (v = Lt(v, i));
|
|
5153
|
-
const { position:
|
|
5154
|
-
nodeId:
|
|
5153
|
+
const { position: m, positionAbsolute: w } = xi({
|
|
5154
|
+
nodeId: p.id,
|
|
5155
5155
|
nextPosition: v,
|
|
5156
5156
|
nodeLookup: l,
|
|
5157
5157
|
nodeExtent: r,
|
|
5158
5158
|
nodeOrigin: d,
|
|
5159
5159
|
onError: a
|
|
5160
5160
|
});
|
|
5161
|
-
|
|
5161
|
+
p.position = m, p.internals.positionAbsolute = w, u.set(p.id, p);
|
|
5162
5162
|
}
|
|
5163
5163
|
c(u);
|
|
5164
5164
|
}, []);
|
|
@@ -5205,26 +5205,26 @@ const uh = {
|
|
|
5205
5205
|
};
|
|
5206
5206
|
function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isConnectable: r = !0, isConnectableStart: o = !0, isConnectableEnd: i = !0, id: s, onConnect: a, children: c, className: l, onMouseDown: d, onTouchStart: u, ...f }, g) {
|
|
5207
5207
|
var A, N;
|
|
5208
|
-
const h = s || null, y = e === "target", x = ae(),
|
|
5209
|
-
|
|
5210
|
-
const M = (
|
|
5208
|
+
const h = s || null, y = e === "target", x = ae(), p = ns(), { connectOnClick: v, noPanClassName: m, rfId: w } = lh(), { connectingFrom: S, connectingTo: _, clickConnecting: E, isPossibleEndHandle: I, connectionInProcess: T, clickConnectionInProcess: B, valid: k } = ee(dh(p, h, e), se);
|
|
5209
|
+
p || (N = (A = x.getState()).onError) == null || N.call(A, "010", ye.error010());
|
|
5210
|
+
const M = ($) => {
|
|
5211
5211
|
const { defaultEdgeOptions: P, onConnect: C, hasDefaultEdges: z } = x.getState(), R = {
|
|
5212
5212
|
...P,
|
|
5213
|
-
|
|
5213
|
+
...$
|
|
5214
5214
|
};
|
|
5215
5215
|
if (z) {
|
|
5216
5216
|
const { edges: O, setEdges: F, onError: Y } = x.getState();
|
|
5217
5217
|
F(Xf(R, O, { onError: Y }));
|
|
5218
5218
|
}
|
|
5219
5219
|
C == null || C(R), a == null || a(R);
|
|
5220
|
-
}, L = (
|
|
5221
|
-
if (!
|
|
5220
|
+
}, L = ($) => {
|
|
5221
|
+
if (!p)
|
|
5222
5222
|
return;
|
|
5223
|
-
const P = Mi(
|
|
5224
|
-
if (o && (P &&
|
|
5223
|
+
const P = Mi($.nativeEvent);
|
|
5224
|
+
if (o && (P && $.button === 0 || !P)) {
|
|
5225
5225
|
const C = x.getState();
|
|
5226
|
-
Qn.onPointerDown(
|
|
5227
|
-
handleDomNode:
|
|
5226
|
+
Qn.onPointerDown($.nativeEvent, {
|
|
5227
|
+
handleDomNode: $.currentTarget,
|
|
5228
5228
|
autoPanOnConnect: C.autoPanOnConnect,
|
|
5229
5229
|
connectionMode: C.connectionMode,
|
|
5230
5230
|
connectionRadius: C.connectionRadius,
|
|
@@ -5233,7 +5233,7 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
|
|
|
5233
5233
|
lib: C.lib,
|
|
5234
5234
|
isTarget: y,
|
|
5235
5235
|
handleId: h,
|
|
5236
|
-
nodeId:
|
|
5236
|
+
nodeId: p,
|
|
5237
5237
|
flowId: C.rfId,
|
|
5238
5238
|
panBy: C.panBy,
|
|
5239
5239
|
cancelConnection: C.cancelConnection,
|
|
@@ -5254,18 +5254,18 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
|
|
|
5254
5254
|
dragThreshold: C.connectionDragThreshold
|
|
5255
5255
|
});
|
|
5256
5256
|
}
|
|
5257
|
-
P ? d == null || d(
|
|
5258
|
-
}, b = (
|
|
5257
|
+
P ? d == null || d($) : u == null || u($);
|
|
5258
|
+
}, b = ($) => {
|
|
5259
5259
|
const { onClickConnectStart: P, onClickConnectEnd: C, connectionClickStartHandle: z, connectionMode: R, isValidConnection: O, lib: F, rfId: Y, nodeLookup: K, connection: Z } = x.getState();
|
|
5260
|
-
if (!
|
|
5260
|
+
if (!p || !z && !o)
|
|
5261
5261
|
return;
|
|
5262
5262
|
if (!z) {
|
|
5263
|
-
P == null || P(
|
|
5263
|
+
P == null || P($.nativeEvent, { nodeId: p, handleId: h, handleType: e }), x.setState({ connectionClickStartHandle: { nodeId: p, type: e, id: h } });
|
|
5264
5264
|
return;
|
|
5265
5265
|
}
|
|
5266
|
-
const X = Ni(
|
|
5266
|
+
const X = Ni($.target), H = n || O, { connection: W, isValid: Q } = Qn.isValid($.nativeEvent, {
|
|
5267
5267
|
handle: {
|
|
5268
|
-
nodeId:
|
|
5268
|
+
nodeId: p,
|
|
5269
5269
|
id: h,
|
|
5270
5270
|
type: e
|
|
5271
5271
|
},
|
|
@@ -5281,13 +5281,13 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
|
|
|
5281
5281
|
});
|
|
5282
5282
|
Q && W && M(W);
|
|
5283
5283
|
const V = structuredClone(Z);
|
|
5284
|
-
delete V.inProgress, V.toPosition = V.toHandle ? V.toHandle.position : null, C == null || C(
|
|
5284
|
+
delete V.inProgress, V.toPosition = V.toHandle ? V.toHandle.position : null, C == null || C($, V), x.setState({ connectionClickStartHandle: null });
|
|
5285
5285
|
};
|
|
5286
|
-
return D("div", { "data-handleid": h, "data-nodeid":
|
|
5286
|
+
return D("div", { "data-handleid": h, "data-nodeid": p, "data-handlepos": t, "data-id": `${w}-${p}-${h}-${e}`, className: ue([
|
|
5287
5287
|
"react-flow__handle",
|
|
5288
5288
|
`react-flow__handle-${t}`,
|
|
5289
5289
|
"nodrag",
|
|
5290
|
-
|
|
5290
|
+
m,
|
|
5291
5291
|
l,
|
|
5292
5292
|
{
|
|
5293
5293
|
source: !y,
|
|
@@ -5303,7 +5303,7 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
|
|
|
5303
5303
|
* shows where you can start a connection from
|
|
5304
5304
|
* and where you can end it while connecting
|
|
5305
5305
|
*/
|
|
5306
|
-
connectionindicator: r && (!T ||
|
|
5306
|
+
connectionindicator: r && (!T || I) && (T || B ? i : o)
|
|
5307
5307
|
}
|
|
5308
5308
|
]), onMouseDown: L, onTouchStart: L, onClick: v ? b : void 0, ref: g, ...f, children: c });
|
|
5309
5309
|
}
|
|
@@ -5383,9 +5383,9 @@ function wh({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
5383
5383
|
} }) });
|
|
5384
5384
|
}
|
|
5385
5385
|
const Co = typeof window != "undefined" ? window : void 0, bh = (e) => ({ nodesSelectionActive: e.nodesSelectionActive, userSelectionActive: e.userSelectionActive });
|
|
5386
|
-
function os({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: h, panActivationKeyCode: y, zoomActivationKeyCode: x, elementsSelectable:
|
|
5387
|
-
const { nodesSelectionActive: R, userSelectionActive: O } = ee(bh, se), F = It(l, { target: Co }), Y = It(y, { target: Co }), K = Y ||
|
|
5388
|
-
return Qf({ deleteKeyCode: c, multiSelectionKeyCode: h }), D(eh, { onPaneContextMenu: i, elementsSelectable:
|
|
5386
|
+
function os({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: h, panActivationKeyCode: y, zoomActivationKeyCode: x, elementsSelectable: p, zoomOnScroll: v, zoomOnPinch: m, panOnScroll: w, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: I, autoPanOnSelection: T, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, preventScrolling: b, onSelectionContextMenu: A, noWheelClassName: N, noPanClassName: $, disableKeyboardA11y: P, onViewportChange: C, isControlledViewport: z }) {
|
|
5387
|
+
const { nodesSelectionActive: R, userSelectionActive: O } = ee(bh, se), F = It(l, { target: Co }), Y = It(y, { target: Co }), K = Y || I, Z = Y || w, X = d && K !== !0, H = F || O || X;
|
|
5388
|
+
return Qf({ deleteKeyCode: c, multiSelectionKeyCode: h }), D(eh, { onPaneContextMenu: i, elementsSelectable: p, zoomOnScroll: v, zoomOnPinch: m, panOnScroll: Z, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: !F && K, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, zoomActivationKeyCode: x, preventScrolling: b, noWheelClassName: N, noPanClassName: $, onViewportChange: C, isControlledViewport: z, paneClickDistance: a, selectionOnDrag: X, children: ce(oh, { onSelectionStart: f, onSelectionEnd: g, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, panOnDrag: K, autoPanOnSelection: T, isSelecting: !!H, selectionMode: u, selectionKeyPressed: F, paneClickDistance: a, selectionOnDrag: X, children: [e, R && D(wh, { onSelectionContextMenu: A, noPanClassName: $, disableKeyboardA11y: P })] }) });
|
|
5389
5389
|
}
|
|
5390
5390
|
os.displayName = "FlowRenderer";
|
|
5391
5391
|
const vh = le(os), _h = (e) => (t) => e ? ar(t.nodeLookup, { x: 0, y: 0, width: t.width, height: t.height }, t.transform, !0).map((n) => n.id) : Array.from(t.nodeLookup.keys());
|
|
@@ -5422,9 +5422,9 @@ function Ch({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
|
|
|
5422
5422
|
}
|
|
5423
5423
|
}, [e.id, t, e.sourcePosition, e.targetPosition]), i;
|
|
5424
5424
|
}
|
|
5425
|
-
function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: o, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: g, disableKeyboardA11y: h, rfId: y, nodeTypes: x, nodeClickDistance:
|
|
5425
|
+
function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: o, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: g, disableKeyboardA11y: h, rfId: y, nodeTypes: x, nodeClickDistance: p, onError: v }) {
|
|
5426
5426
|
var H, W, Q;
|
|
5427
|
-
const { node:
|
|
5427
|
+
const { node: m, internals: w, isParent: S } = ee((V) => {
|
|
5428
5428
|
const J = V.nodeLookup.get(e), U = V.parentLookup.has(e);
|
|
5429
5429
|
return {
|
|
5430
5430
|
node: J,
|
|
@@ -5432,22 +5432,22 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5432
5432
|
isParent: U
|
|
5433
5433
|
};
|
|
5434
5434
|
}, se);
|
|
5435
|
-
let _ =
|
|
5435
|
+
let _ = m.type || "default", E = (x == null ? void 0 : x[_]) || No[_];
|
|
5436
5436
|
E === void 0 && (v == null || v("003", ye.error003(_)), _ = "default", E = (x == null ? void 0 : x.default) || No.default);
|
|
5437
|
-
const
|
|
5437
|
+
const I = !!(m.draggable || a && typeof m.draggable == "undefined"), T = !!(m.selectable || c && typeof m.selectable == "undefined"), B = !!(m.connectable || l && typeof m.connectable == "undefined"), k = !!(m.focusable || d && typeof m.focusable == "undefined"), M = ae(), L = Si(m), b = Ch({ node: m, nodeType: _, hasDimensions: L, resizeObserver: u }), A = es({
|
|
5438
5438
|
nodeRef: b,
|
|
5439
|
-
disabled:
|
|
5439
|
+
disabled: m.hidden || !I,
|
|
5440
5440
|
noDragClassName: f,
|
|
5441
|
-
handleSelector:
|
|
5441
|
+
handleSelector: m.dragHandle,
|
|
5442
5442
|
nodeId: e,
|
|
5443
5443
|
isSelectable: T,
|
|
5444
|
-
nodeClickDistance:
|
|
5444
|
+
nodeClickDistance: p
|
|
5445
5445
|
}), N = ts();
|
|
5446
|
-
if (
|
|
5446
|
+
if (m.hidden)
|
|
5447
5447
|
return null;
|
|
5448
|
-
const
|
|
5448
|
+
const $ = Le(m), P = yh(m), C = T || I || t || n || r || o, z = n ? (V) => n(V, { ...w.userNode }) : void 0, R = r ? (V) => r(V, { ...w.userNode }) : void 0, O = o ? (V) => o(V, { ...w.userNode }) : void 0, F = i ? (V) => i(V, { ...w.userNode }) : void 0, Y = s ? (V) => s(V, { ...w.userNode }) : void 0, K = (V) => {
|
|
5449
5449
|
const { selectNodesOnDrag: J, nodeDragThreshold: U } = M.getState();
|
|
5450
|
-
T && (!J ||
|
|
5450
|
+
T && (!J || !I || U > 0) && Jn({
|
|
5451
5451
|
id: e,
|
|
5452
5452
|
store: M,
|
|
5453
5453
|
nodeRef: b
|
|
@@ -5462,7 +5462,7 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5462
5462
|
unselect: J,
|
|
5463
5463
|
nodeRef: b
|
|
5464
5464
|
});
|
|
5465
|
-
} else if (
|
|
5465
|
+
} else if (I && m.selected && Object.prototype.hasOwnProperty.call(dn, V.key)) {
|
|
5466
5466
|
V.preventDefault();
|
|
5467
5467
|
const { ariaLabelConfig: J } = M.getState();
|
|
5468
5468
|
M.setState({
|
|
@@ -5484,7 +5484,7 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5484
5484
|
const { transform: V, width: J, height: U, autoPanOnNodeFocus: q, setCenter: j } = M.getState();
|
|
5485
5485
|
if (!q)
|
|
5486
5486
|
return;
|
|
5487
|
-
ar(/* @__PURE__ */ new Map([[e,
|
|
5487
|
+
ar(/* @__PURE__ */ new Map([[e, m]]), { x: 0, y: 0, width: J, height: U }, V, !0).length > 0 || j(m.position.x + $.width / 2, m.position.y + $.height / 2, {
|
|
5488
5488
|
zoom: V[2]
|
|
5489
5489
|
});
|
|
5490
5490
|
};
|
|
@@ -5493,14 +5493,14 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5493
5493
|
`react-flow__node-${_}`,
|
|
5494
5494
|
{
|
|
5495
5495
|
// this is overwritable by passing `nopan` as a class name
|
|
5496
|
-
[g]:
|
|
5496
|
+
[g]: I
|
|
5497
5497
|
},
|
|
5498
|
-
|
|
5498
|
+
m.className,
|
|
5499
5499
|
{
|
|
5500
|
-
selected:
|
|
5500
|
+
selected: m.selected,
|
|
5501
5501
|
selectable: T,
|
|
5502
5502
|
parent: S,
|
|
5503
|
-
draggable:
|
|
5503
|
+
draggable: I,
|
|
5504
5504
|
dragging: A
|
|
5505
5505
|
}
|
|
5506
5506
|
]), ref: b, style: {
|
|
@@ -5508,9 +5508,9 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5508
5508
|
transform: `translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,
|
|
5509
5509
|
pointerEvents: C ? "all" : "none",
|
|
5510
5510
|
visibility: L ? "visible" : "hidden",
|
|
5511
|
-
...
|
|
5511
|
+
...m.style,
|
|
5512
5512
|
...P
|
|
5513
|
-
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: z, onMouseMove: R, onMouseLeave: O, onContextMenu: F, onClick: K, onDoubleClick: Y, onKeyDown: k ? Z : void 0, tabIndex: k ? 0 : void 0, onFocus: k ? X : void 0, role: (H =
|
|
5513
|
+
}, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: z, onMouseMove: R, onMouseLeave: O, onContextMenu: F, onClick: K, onDoubleClick: Y, onKeyDown: k ? Z : void 0, tabIndex: k ? 0 : void 0, onFocus: k ? X : void 0, role: (H = m.ariaRole) != null ? H : k ? "group" : void 0, "aria-roledescription": "node", "aria-describedby": h ? void 0 : `${Gi}-${y}`, "aria-label": m.ariaLabel, ...m.domAttributes, children: D(sh, { value: e, children: D(E, { id: e, data: m.data, type: _, positionAbsoluteX: w.positionAbsolute.x, positionAbsoluteY: w.positionAbsolute.y, selected: (W = m.selected) != null ? W : !1, selectable: T, draggable: I, deletable: (Q = m.deletable) != null ? Q : !0, isConnectable: B, sourcePosition: m.sourcePosition, targetPosition: m.targetPosition, dragging: A, dragHandle: m.dragHandle, zIndex: w.z, parentId: m.parentId, ...$ }) }) });
|
|
5514
5514
|
}
|
|
5515
5515
|
var kh = le(Mh);
|
|
5516
5516
|
const Ah = (e) => ({
|
|
@@ -5663,8 +5663,8 @@ function cs({ sourceX: e, sourceY: t, sourcePosition: n = G.Bottom, targetX: r,
|
|
|
5663
5663
|
];
|
|
5664
5664
|
}
|
|
5665
5665
|
function ls(e) {
|
|
5666
|
-
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s, targetPosition: a, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth:
|
|
5667
|
-
const [v,
|
|
5666
|
+
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s, targetPosition: a, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: p }) => {
|
|
5667
|
+
const [v, m, w] = cs({
|
|
5668
5668
|
sourceX: n,
|
|
5669
5669
|
sourceY: r,
|
|
5670
5670
|
sourcePosition: s,
|
|
@@ -5672,26 +5672,26 @@ function ls(e) {
|
|
|
5672
5672
|
targetY: i,
|
|
5673
5673
|
targetPosition: a
|
|
5674
5674
|
}), S = e.isInternal ? void 0 : t;
|
|
5675
|
-
return D(En, { id: S, path: v, labelX:
|
|
5675
|
+
return D(En, { id: S, path: v, labelX: m, labelY: w, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: p });
|
|
5676
5676
|
});
|
|
5677
5677
|
}
|
|
5678
5678
|
const Hh = ls({ isInternal: !1 }), us = ls({ isInternal: !0 });
|
|
5679
5679
|
Hh.displayName = "SimpleBezierEdge";
|
|
5680
5680
|
us.displayName = "SimpleBezierEdgeInternal";
|
|
5681
5681
|
function ds(e) {
|
|
5682
|
-
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: g = G.Bottom, targetPosition: h = G.Top, markerEnd: y, markerStart: x, pathOptions:
|
|
5683
|
-
const [
|
|
5682
|
+
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: g = G.Bottom, targetPosition: h = G.Top, markerEnd: y, markerStart: x, pathOptions: p, interactionWidth: v }) => {
|
|
5683
|
+
const [m, w, S] = qn({
|
|
5684
5684
|
sourceX: n,
|
|
5685
5685
|
sourceY: r,
|
|
5686
5686
|
sourcePosition: g,
|
|
5687
5687
|
targetX: o,
|
|
5688
5688
|
targetY: i,
|
|
5689
5689
|
targetPosition: h,
|
|
5690
|
-
borderRadius:
|
|
5691
|
-
offset:
|
|
5692
|
-
stepPosition:
|
|
5690
|
+
borderRadius: p == null ? void 0 : p.borderRadius,
|
|
5691
|
+
offset: p == null ? void 0 : p.offset,
|
|
5692
|
+
stepPosition: p == null ? void 0 : p.stepPosition
|
|
5693
5693
|
}), _ = e.isInternal ? void 0 : t;
|
|
5694
|
-
return D(En, { id: _, path:
|
|
5694
|
+
return D(En, { id: _, path: m, labelX: w, labelY: S, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: y, markerStart: x, interactionWidth: v });
|
|
5695
5695
|
});
|
|
5696
5696
|
}
|
|
5697
5697
|
const fs = ds({ isInternal: !1 }), hs = ds({ isInternal: !0 });
|
|
@@ -5712,25 +5712,25 @@ Rh.displayName = "StepEdge";
|
|
|
5712
5712
|
ps.displayName = "StepEdgeInternal";
|
|
5713
5713
|
function ms(e) {
|
|
5714
5714
|
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: g, markerStart: h, interactionWidth: y }) => {
|
|
5715
|
-
const [x,
|
|
5716
|
-
return D(En, { id:
|
|
5715
|
+
const [x, p, v] = $i({ sourceX: n, sourceY: r, targetX: o, targetY: i }), m = e.isInternal ? void 0 : t;
|
|
5716
|
+
return D(En, { id: m, path: x, labelX: p, labelY: v, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: g, markerStart: h, interactionWidth: y });
|
|
5717
5717
|
});
|
|
5718
5718
|
}
|
|
5719
5719
|
const Bh = ms({ isInternal: !1 }), ys = ms({ isInternal: !0 });
|
|
5720
5720
|
Bh.displayName = "StraightEdge";
|
|
5721
5721
|
ys.displayName = "StraightEdgeInternal";
|
|
5722
5722
|
function xs(e) {
|
|
5723
|
-
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s = G.Bottom, targetPosition: a = G.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, pathOptions:
|
|
5724
|
-
const [
|
|
5723
|
+
return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s = G.Bottom, targetPosition: a = G.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, pathOptions: p, interactionWidth: v }) => {
|
|
5724
|
+
const [m, w, S] = Ai({
|
|
5725
5725
|
sourceX: n,
|
|
5726
5726
|
sourceY: r,
|
|
5727
5727
|
sourcePosition: s,
|
|
5728
5728
|
targetX: o,
|
|
5729
5729
|
targetY: i,
|
|
5730
5730
|
targetPosition: a,
|
|
5731
|
-
curvature:
|
|
5731
|
+
curvature: p == null ? void 0 : p.curvature
|
|
5732
5732
|
}), _ = e.isInternal ? void 0 : t;
|
|
5733
|
-
return D(En, { id: _, path:
|
|
5733
|
+
return D(En, { id: _, path: m, labelX: w, labelY: S, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: v });
|
|
5734
5734
|
});
|
|
5735
5735
|
}
|
|
5736
5736
|
const Vh = xs({ isInternal: !1 }), ws = xs({ isInternal: !0 });
|
|
@@ -5758,20 +5758,20 @@ function Yh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
|
|
|
5758
5758
|
const h = ae(), y = (w, S) => {
|
|
5759
5759
|
if (w.button !== 0)
|
|
5760
5760
|
return;
|
|
5761
|
-
const { autoPanOnConnect: _, domNode: E, connectionMode:
|
|
5761
|
+
const { autoPanOnConnect: _, domNode: E, connectionMode: I, connectionRadius: T, lib: B, onConnectStart: k, cancelConnection: M, nodeLookup: L, rfId: b, panBy: A, updateConnection: N } = h.getState(), $ = S.type === "target", P = (R, O) => {
|
|
5762
5762
|
f(!1), u == null || u(R, n, S.type, O);
|
|
5763
5763
|
}, C = (R) => l == null ? void 0 : l(n, R), z = (R, O) => {
|
|
5764
5764
|
f(!0), d == null || d(w, n, S.type), k == null || k(R, O);
|
|
5765
5765
|
};
|
|
5766
5766
|
Qn.onPointerDown(w.nativeEvent, {
|
|
5767
5767
|
autoPanOnConnect: _,
|
|
5768
|
-
connectionMode:
|
|
5768
|
+
connectionMode: I,
|
|
5769
5769
|
connectionRadius: T,
|
|
5770
5770
|
domNode: E,
|
|
5771
5771
|
handleId: S.id,
|
|
5772
5772
|
nodeId: S.nodeId,
|
|
5773
5773
|
nodeLookup: L,
|
|
5774
|
-
isTarget:
|
|
5774
|
+
isTarget: $,
|
|
5775
5775
|
edgeUpdaterType: S.type,
|
|
5776
5776
|
lib: B,
|
|
5777
5777
|
flowId: b,
|
|
@@ -5797,34 +5797,34 @@ function Yh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
|
|
|
5797
5797
|
}, x = (w) => {
|
|
5798
5798
|
var S;
|
|
5799
5799
|
return y(w, { nodeId: n.target, id: (S = n.targetHandle) != null ? S : null, type: "target" });
|
|
5800
|
-
},
|
|
5800
|
+
}, p = (w) => {
|
|
5801
5801
|
var S;
|
|
5802
5802
|
return y(w, { nodeId: n.source, id: (S = n.sourceHandle) != null ? S : null, type: "source" });
|
|
5803
|
-
}, v = () => g(!0),
|
|
5804
|
-
return ce(De, { children: [(e === !0 || e === "source") && D(Po, { position: a, centerX: r, centerY: o, radius: t, onMouseDown: x, onMouseEnter: v, onMouseOut:
|
|
5803
|
+
}, v = () => g(!0), m = () => g(!1);
|
|
5804
|
+
return ce(De, { children: [(e === !0 || e === "source") && D(Po, { position: a, centerX: r, centerY: o, radius: t, onMouseDown: x, onMouseEnter: v, onMouseOut: m, type: "source" }), (e === !0 || e === "target") && D(Po, { position: c, centerX: i, centerY: s, radius: t, onMouseDown: p, onMouseEnter: v, onMouseOut: m, type: "target" })] });
|
|
5805
5805
|
}
|
|
5806
|
-
function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: o, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, rfId: h, edgeTypes: y, noPanClassName: x, onError:
|
|
5806
|
+
function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: o, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, rfId: h, edgeTypes: y, noPanClassName: x, onError: p, disableKeyboardA11y: v }) {
|
|
5807
5807
|
var J, U;
|
|
5808
|
-
let
|
|
5808
|
+
let m = ee((q) => q.edgeLookup.get(e));
|
|
5809
5809
|
const w = ee((q) => q.defaultEdgeOptions);
|
|
5810
|
-
|
|
5811
|
-
let S =
|
|
5812
|
-
_ === void 0 && (
|
|
5813
|
-
const E = !!(
|
|
5814
|
-
const j = q.nodeLookup.get(
|
|
5810
|
+
m = w ? { ...w, ...m } : m;
|
|
5811
|
+
let S = m.type || "default", _ = (y == null ? void 0 : y[S]) || Ao[S];
|
|
5812
|
+
_ === void 0 && (p == null || p("011", ye.error011(S)), S = "default", _ = (y == null ? void 0 : y.default) || Ao.default);
|
|
5813
|
+
const E = !!(m.focusable || t && typeof m.focusable == "undefined"), I = typeof u != "undefined" && (m.reconnectable || n && typeof m.reconnectable == "undefined"), T = !!(m.selectable || r && typeof m.selectable == "undefined"), B = ne(null), [k, M] = xe(!1), [L, b] = xe(!1), A = ae(), { zIndex: N = m.zIndex, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O } = ee(we((q) => {
|
|
5814
|
+
const j = q.nodeLookup.get(m.source), re = q.nodeLookup.get(m.target);
|
|
5815
5815
|
if (!j || !re)
|
|
5816
5816
|
return Io;
|
|
5817
5817
|
const te = Ad({
|
|
5818
5818
|
id: e,
|
|
5819
5819
|
sourceNode: j,
|
|
5820
5820
|
targetNode: re,
|
|
5821
|
-
sourceHandle:
|
|
5822
|
-
targetHandle:
|
|
5821
|
+
sourceHandle: m.sourceHandle || null,
|
|
5822
|
+
targetHandle: m.targetHandle || null,
|
|
5823
5823
|
connectionMode: q.connectionMode,
|
|
5824
|
-
onError:
|
|
5824
|
+
onError: p
|
|
5825
5825
|
}), oe = vd({
|
|
5826
|
-
selected:
|
|
5827
|
-
zIndex:
|
|
5826
|
+
selected: m.selected,
|
|
5827
|
+
zIndex: m.zIndex,
|
|
5828
5828
|
sourceNode: j,
|
|
5829
5829
|
targetNode: re,
|
|
5830
5830
|
elevateOnSelect: q.elevateEdgesOnSelect,
|
|
@@ -5834,43 +5834,43 @@ function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
5834
5834
|
...te || Io,
|
|
5835
5835
|
zIndex: oe
|
|
5836
5836
|
};
|
|
5837
|
-
}, [
|
|
5838
|
-
if (
|
|
5837
|
+
}, [m.source, m.target, m.sourceHandle, m.targetHandle, m.selected, m.zIndex]), se), F = be(() => m.markerStart ? `url('#${Un(m.markerStart, h)}')` : void 0, [m.markerStart, h]), Y = be(() => m.markerEnd ? `url('#${Un(m.markerEnd, h)}')` : void 0, [m.markerEnd, h]);
|
|
5838
|
+
if (m.hidden || $ === null || P === null || C === null || z === null)
|
|
5839
5839
|
return null;
|
|
5840
5840
|
const K = (q) => {
|
|
5841
5841
|
var oe;
|
|
5842
5842
|
const { addSelectedEdges: j, unselectNodesAndEdges: re, multiSelectionActive: te } = A.getState();
|
|
5843
|
-
T && (A.setState({ nodesSelectionActive: !1 }),
|
|
5843
|
+
T && (A.setState({ nodesSelectionActive: !1 }), m.selected && te ? (re({ nodes: [], edges: [m] }), (oe = B.current) == null || oe.blur()) : j([e])), o && o(q, m);
|
|
5844
5844
|
}, Z = i ? (q) => {
|
|
5845
|
-
i(q, { ...
|
|
5845
|
+
i(q, { ...m });
|
|
5846
5846
|
} : void 0, X = s ? (q) => {
|
|
5847
|
-
s(q, { ...
|
|
5847
|
+
s(q, { ...m });
|
|
5848
5848
|
} : void 0, H = a ? (q) => {
|
|
5849
|
-
a(q, { ...
|
|
5849
|
+
a(q, { ...m });
|
|
5850
5850
|
} : void 0, W = c ? (q) => {
|
|
5851
|
-
c(q, { ...
|
|
5851
|
+
c(q, { ...m });
|
|
5852
5852
|
} : void 0, Q = l ? (q) => {
|
|
5853
|
-
l(q, { ...
|
|
5853
|
+
l(q, { ...m });
|
|
5854
5854
|
} : void 0, V = (q) => {
|
|
5855
5855
|
var j;
|
|
5856
5856
|
if (!v && hi.includes(q.key) && T) {
|
|
5857
5857
|
const { unselectNodesAndEdges: re, addSelectedEdges: te } = A.getState();
|
|
5858
|
-
q.key === "Escape" ? ((j = B.current) == null || j.blur(), re({ edges: [
|
|
5858
|
+
q.key === "Escape" ? ((j = B.current) == null || j.blur(), re({ edges: [m] })) : te([e]);
|
|
5859
5859
|
}
|
|
5860
5860
|
};
|
|
5861
5861
|
return D("svg", { style: { zIndex: N }, children: ce("g", { className: ue([
|
|
5862
5862
|
"react-flow__edge",
|
|
5863
5863
|
`react-flow__edge-${S}`,
|
|
5864
|
-
|
|
5864
|
+
m.className,
|
|
5865
5865
|
x,
|
|
5866
5866
|
{
|
|
5867
|
-
selected:
|
|
5868
|
-
animated:
|
|
5867
|
+
selected: m.selected,
|
|
5868
|
+
animated: m.animated,
|
|
5869
5869
|
inactive: !T && !o,
|
|
5870
5870
|
updating: k,
|
|
5871
5871
|
selectable: T
|
|
5872
5872
|
}
|
|
5873
|
-
]), onClick: K, onDoubleClick: Z, onContextMenu: X, onMouseEnter: H, onMouseMove: W, onMouseLeave: Q, onKeyDown: E ? V : void 0, tabIndex: E ? 0 : void 0, role: (J =
|
|
5873
|
+
]), onClick: K, onDoubleClick: Z, onContextMenu: X, onMouseEnter: H, onMouseMove: W, onMouseLeave: Q, onKeyDown: E ? V : void 0, tabIndex: E ? 0 : void 0, role: (J = m.ariaRole) != null ? J : E ? "group" : "img", "aria-roledescription": "edge", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": m.ariaLabel === null ? void 0 : m.ariaLabel || `Edge from ${m.source} to ${m.target}`, "aria-describedby": E ? `${Ki}-${h}` : void 0, ref: B, ...m.domAttributes, children: [!L && D(_, { id: e, source: m.source, target: m.target, type: m.type, selected: m.selected, animated: m.animated, selectable: T, deletable: (U = m.deletable) != null ? U : !0, label: m.label, labelStyle: m.labelStyle, labelShowBg: m.labelShowBg, labelBgStyle: m.labelBgStyle, labelBgPadding: m.labelBgPadding, labelBgBorderRadius: m.labelBgBorderRadius, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, data: m.data, style: m.style, sourceHandleId: m.sourceHandle, targetHandleId: m.targetHandle, markerStart: F, markerEnd: Y, pathOptions: "pathOptions" in m ? m.pathOptions : void 0, interactionWidth: m.interactionWidth }), I && D(Yh, { edge: m, isReconnectable: I, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, setUpdateHover: M, setReconnecting: b })] }) });
|
|
5874
5874
|
}
|
|
5875
5875
|
var Gh = le(Wh);
|
|
5876
5876
|
const Kh = (e) => ({
|
|
@@ -5881,8 +5881,8 @@ const Kh = (e) => ({
|
|
|
5881
5881
|
onError: e.onError
|
|
5882
5882
|
});
|
|
5883
5883
|
function bs({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: r, noPanClassName: o, onReconnect: i, onEdgeContextMenu: s, onEdgeMouseEnter: a, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: d, reconnectRadius: u, onEdgeDoubleClick: f, onReconnectStart: g, onReconnectEnd: h, disableKeyboardA11y: y }) {
|
|
5884
|
-
const { edgesFocusable: x, edgesReconnectable:
|
|
5885
|
-
return ce("div", { className: "react-flow__edges", children: [D(Oh, { defaultColor: e, rfId: n }), w.map((S) => D(Gh, { id: S, edgesFocusable: x, edgesReconnectable:
|
|
5884
|
+
const { edgesFocusable: x, edgesReconnectable: p, elementsSelectable: v, onError: m } = ee(Kh, se), w = $h(t);
|
|
5885
|
+
return ce("div", { className: "react-flow__edges", children: [D(Oh, { defaultColor: e, rfId: n }), w.map((S) => D(Gh, { id: S, edgesFocusable: x, edgesReconnectable: p, elementsSelectable: v, noPanClassName: o, onReconnect: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, onClick: d, reconnectRadius: u, onDoubleClick: f, onReconnectStart: g, onReconnectEnd: h, rfId: n, onError: m, edgeTypes: r, disableKeyboardA11y: y }, S))] });
|
|
5886
5886
|
}
|
|
5887
5887
|
bs.displayName = "EdgeRenderer";
|
|
5888
5888
|
const qh = le(bs), Uh = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
|
|
@@ -5990,16 +5990,16 @@ function sg() {
|
|
|
5990
5990
|
}
|
|
5991
5991
|
}, []);
|
|
5992
5992
|
}
|
|
5993
|
-
function _s({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: o, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: g, connectionLineType: h, connectionLineStyle: y, connectionLineComponent: x, connectionLineContainerStyle:
|
|
5994
|
-
return To(e), To(t), sg(), Qh(n), jh(he), D(vh, { onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneContextMenu: Q, onPaneScroll: W, paneClickDistance: V, deleteKeyCode:
|
|
5993
|
+
function _s({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: o, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: g, connectionLineType: h, connectionLineStyle: y, connectionLineComponent: x, connectionLineContainerStyle: p, selectionKeyCode: v, selectionOnDrag: m, selectionMode: w, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, deleteKeyCode: I, onlyRenderVisibleElements: T, elementsSelectable: B, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, preventScrolling: A, defaultMarkerColor: N, zoomOnScroll: $, zoomOnPinch: P, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, zoomOnDoubleClick: O, panOnDrag: F, autoPanOnSelection: Y, onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneScroll: W, onPaneContextMenu: Q, paneClickDistance: V, nodeClickDistance: J, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie, viewport: he, onViewportChange: Fe }) {
|
|
5994
|
+
return To(e), To(t), sg(), Qh(n), jh(he), D(vh, { onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneContextMenu: Q, onPaneScroll: W, paneClickDistance: V, deleteKeyCode: I, selectionKeyCode: v, selectionOnDrag: m, selectionMode: w, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, elementsSelectable: B, zoomOnScroll: $, zoomOnPinch: P, zoomOnDoubleClick: O, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, panOnDrag: F, autoPanOnSelection: Y, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, onSelectionContextMenu: u, preventScrolling: A, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, onViewportChange: Fe, isControlledViewport: !!he, children: ce(Zh, { children: [D(qh, { edgeTypes: t, onEdgeClick: o, onEdgeDoubleClick: s, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, onlyRenderVisibleElements: T, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, defaultMarkerColor: N, noPanClassName: Be, disableKeyboardA11y: Ve, rfId: Ie }), D(og, { style: y, type: h, component: x, containerStyle: p }), D("div", { className: "react-flow__edgelabel-renderer" }), D(Ih, { nodeTypes: e, onNodeClick: r, onNodeDoubleClick: i, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, nodeClickDistance: J, onlyRenderVisibleElements: T, noPanClassName: Be, noDragClassName: Ae, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie }), D("div", { className: "react-flow__viewport-portal" })] }) });
|
|
5995
5995
|
}
|
|
5996
5996
|
_s.displayName = "GraphView";
|
|
5997
5997
|
const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: o, height: i, fitView: s, fitViewOptions: a, minZoom: c = 0.5, maxZoom: l = 2, nodeOrigin: d, nodeExtent: u, zIndexMode: f = "basic" } = {}) => {
|
|
5998
|
-
var E,
|
|
5999
|
-
const g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(),
|
|
6000
|
-
Di(y, x,
|
|
5998
|
+
var E, I, T;
|
|
5999
|
+
const g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), p = (E = r != null ? r : t) != null ? E : [], v = (I = n != null ? n : e) != null ? I : [], m = d != null ? d : [0, 0], w = u != null ? u : Ct;
|
|
6000
|
+
Di(y, x, p);
|
|
6001
6001
|
const { nodesInitialized: S } = Zn(v, g, h, {
|
|
6002
|
-
nodeOrigin:
|
|
6002
|
+
nodeOrigin: m,
|
|
6003
6003
|
nodeExtent: w,
|
|
6004
6004
|
zIndexMode: f
|
|
6005
6005
|
});
|
|
@@ -6019,7 +6019,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6019
6019
|
nodesInitialized: S,
|
|
6020
6020
|
nodeLookup: g,
|
|
6021
6021
|
parentLookup: h,
|
|
6022
|
-
edges:
|
|
6022
|
+
edges: p,
|
|
6023
6023
|
edgeLookup: x,
|
|
6024
6024
|
connectionLookup: y,
|
|
6025
6025
|
onNodesChange: null,
|
|
@@ -6038,7 +6038,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6038
6038
|
domNode: null,
|
|
6039
6039
|
paneDragging: !1,
|
|
6040
6040
|
noPanClassName: "nopan",
|
|
6041
|
-
nodeOrigin:
|
|
6041
|
+
nodeOrigin: m,
|
|
6042
6042
|
nodeDragThreshold: 1,
|
|
6043
6043
|
connectionDragThreshold: 1,
|
|
6044
6044
|
snapGrid: [15, 15],
|
|
@@ -6077,15 +6077,15 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6077
6077
|
};
|
|
6078
6078
|
}, lg = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: o, height: i, fitView: s, fitViewOptions: a, minZoom: c, maxZoom: l, nodeOrigin: d, nodeExtent: u, zIndexMode: f }) => vf((g, h) => {
|
|
6079
6079
|
async function y() {
|
|
6080
|
-
const { nodeLookup: x, panZoom:
|
|
6081
|
-
|
|
6080
|
+
const { nodeLookup: x, panZoom: p, fitViewOptions: v, fitViewResolver: m, width: w, height: S, minZoom: _, maxZoom: E } = h();
|
|
6081
|
+
p && (await gd({
|
|
6082
6082
|
nodes: x,
|
|
6083
6083
|
width: w,
|
|
6084
6084
|
height: S,
|
|
6085
|
-
panZoom:
|
|
6085
|
+
panZoom: p,
|
|
6086
6086
|
minZoom: _,
|
|
6087
6087
|
maxZoom: E
|
|
6088
|
-
}, v),
|
|
6088
|
+
}, v), m == null || m.resolve(!0), g({ fitViewResolver: null }));
|
|
6089
6089
|
}
|
|
6090
6090
|
return {
|
|
6091
6091
|
...Do({
|
|
@@ -6104,33 +6104,33 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6104
6104
|
zIndexMode: f
|
|
6105
6105
|
}),
|
|
6106
6106
|
setNodes: (x) => {
|
|
6107
|
-
const { nodeLookup:
|
|
6108
|
-
nodeOrigin:
|
|
6107
|
+
const { nodeLookup: p, parentLookup: v, nodeOrigin: m, elevateNodesOnSelect: w, fitViewQueued: S, zIndexMode: _, nodesSelectionActive: E } = h(), { nodesInitialized: I, hasSelectedNodes: T } = Zn(x, p, v, {
|
|
6108
|
+
nodeOrigin: m,
|
|
6109
6109
|
nodeExtent: u,
|
|
6110
6110
|
elevateNodesOnSelect: w,
|
|
6111
6111
|
checkEquality: !0,
|
|
6112
6112
|
zIndexMode: _
|
|
6113
6113
|
}), B = E && T;
|
|
6114
|
-
S &&
|
|
6114
|
+
S && I ? (y(), g({
|
|
6115
6115
|
nodes: x,
|
|
6116
|
-
nodesInitialized:
|
|
6116
|
+
nodesInitialized: I,
|
|
6117
6117
|
fitViewQueued: !1,
|
|
6118
6118
|
fitViewOptions: void 0,
|
|
6119
6119
|
nodesSelectionActive: B
|
|
6120
|
-
})) : g({ nodes: x, nodesInitialized:
|
|
6120
|
+
})) : g({ nodes: x, nodesInitialized: I, nodesSelectionActive: B });
|
|
6121
6121
|
},
|
|
6122
6122
|
setEdges: (x) => {
|
|
6123
|
-
const { connectionLookup:
|
|
6124
|
-
Di(
|
|
6123
|
+
const { connectionLookup: p, edgeLookup: v } = h();
|
|
6124
|
+
Di(p, v, x), g({ edges: x });
|
|
6125
6125
|
},
|
|
6126
|
-
setDefaultNodesAndEdges: (x,
|
|
6126
|
+
setDefaultNodesAndEdges: (x, p) => {
|
|
6127
6127
|
if (x) {
|
|
6128
6128
|
const { setNodes: v } = h();
|
|
6129
6129
|
v(x), g({ hasDefaultNodes: !0 });
|
|
6130
6130
|
}
|
|
6131
|
-
if (
|
|
6131
|
+
if (p) {
|
|
6132
6132
|
const { setEdges: v } = h();
|
|
6133
|
-
v(
|
|
6133
|
+
v(p), g({ hasDefaultEdges: !0 });
|
|
6134
6134
|
}
|
|
6135
6135
|
},
|
|
6136
6136
|
/*
|
|
@@ -6139,14 +6139,14 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6139
6139
|
* new dimensions and update the nodes.
|
|
6140
6140
|
*/
|
|
6141
6141
|
updateNodeInternals: (x) => {
|
|
6142
|
-
const { triggerNodeChanges:
|
|
6143
|
-
k && (Td(v,
|
|
6142
|
+
const { triggerNodeChanges: p, nodeLookup: v, parentLookup: m, domNode: w, nodeOrigin: S, nodeExtent: _, debug: E, fitViewQueued: I, zIndexMode: T } = h(), { changes: B, updatedInternals: k } = zd(x, v, m, w, S, _, T);
|
|
6143
|
+
k && (Td(v, m, { nodeOrigin: S, nodeExtent: _, zIndexMode: T }), I ? (y(), g({ fitViewQueued: !1, fitViewOptions: void 0 })) : g({}), (B == null ? void 0 : B.length) > 0 && (E && console.log("React Flow: trigger node changes", B), p == null || p(B)));
|
|
6144
6144
|
},
|
|
6145
|
-
updateNodePositions: (x,
|
|
6145
|
+
updateNodePositions: (x, p = !1) => {
|
|
6146
6146
|
var T, B;
|
|
6147
6147
|
const v = [];
|
|
6148
|
-
let
|
|
6149
|
-
const { nodeLookup: w, triggerNodeChanges: S, connection: _, updateConnection: E, onNodesChangeMiddlewareMap:
|
|
6148
|
+
let m = [];
|
|
6149
|
+
const { nodeLookup: w, triggerNodeChanges: S, connection: _, updateConnection: E, onNodesChangeMiddlewareMap: I } = h();
|
|
6150
6150
|
for (const [k, M] of x) {
|
|
6151
6151
|
const L = w.get(k), b = !!(L != null && L.expandParent && (L != null && L.parentId) && (M != null && M.position)), A = {
|
|
6152
6152
|
id: k,
|
|
@@ -6155,7 +6155,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6155
6155
|
x: Math.max(0, M.position.x),
|
|
6156
6156
|
y: Math.max(0, M.position.y)
|
|
6157
6157
|
} : M.position,
|
|
6158
|
-
dragging:
|
|
6158
|
+
dragging: p
|
|
6159
6159
|
};
|
|
6160
6160
|
if (L && _.inProgress && _.fromNode.id === L.id) {
|
|
6161
6161
|
const N = Qe(L, _.fromHandle, G.Left, !0);
|
|
@@ -6169,56 +6169,56 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6169
6169
|
width: (T = M.measured.width) != null ? T : 0,
|
|
6170
6170
|
height: (B = M.measured.height) != null ? B : 0
|
|
6171
6171
|
}
|
|
6172
|
-
}),
|
|
6172
|
+
}), m.push(A);
|
|
6173
6173
|
}
|
|
6174
6174
|
if (v.length > 0) {
|
|
6175
6175
|
const { parentLookup: k, nodeOrigin: M } = h(), L = pr(v, w, k, M);
|
|
6176
|
-
|
|
6176
|
+
m.push(...L);
|
|
6177
6177
|
}
|
|
6178
|
-
for (const k of
|
|
6179
|
-
|
|
6180
|
-
S(
|
|
6178
|
+
for (const k of I.values())
|
|
6179
|
+
m = k(m);
|
|
6180
|
+
S(m);
|
|
6181
6181
|
},
|
|
6182
6182
|
triggerNodeChanges: (x) => {
|
|
6183
|
-
const { onNodesChange:
|
|
6183
|
+
const { onNodesChange: p, setNodes: v, nodes: m, hasDefaultNodes: w, debug: S } = h();
|
|
6184
6184
|
if (x != null && x.length) {
|
|
6185
6185
|
if (w) {
|
|
6186
|
-
const _ = Zi(x,
|
|
6186
|
+
const _ = Zi(x, m);
|
|
6187
6187
|
v(_);
|
|
6188
6188
|
}
|
|
6189
|
-
S && console.log("React Flow: trigger node changes", x),
|
|
6189
|
+
S && console.log("React Flow: trigger node changes", x), p == null || p(x);
|
|
6190
6190
|
}
|
|
6191
6191
|
},
|
|
6192
6192
|
triggerEdgeChanges: (x) => {
|
|
6193
|
-
const { onEdgesChange:
|
|
6193
|
+
const { onEdgesChange: p, setEdges: v, edges: m, hasDefaultEdges: w, debug: S } = h();
|
|
6194
6194
|
if (x != null && x.length) {
|
|
6195
6195
|
if (w) {
|
|
6196
|
-
const _ = Qi(x,
|
|
6196
|
+
const _ = Qi(x, m);
|
|
6197
6197
|
v(_);
|
|
6198
6198
|
}
|
|
6199
|
-
S && console.log("React Flow: trigger edge changes", x),
|
|
6199
|
+
S && console.log("React Flow: trigger edge changes", x), p == null || p(x);
|
|
6200
6200
|
}
|
|
6201
6201
|
},
|
|
6202
6202
|
addSelectedNodes: (x) => {
|
|
6203
|
-
const { multiSelectionActive:
|
|
6204
|
-
if (
|
|
6203
|
+
const { multiSelectionActive: p, edgeLookup: v, nodeLookup: m, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
|
|
6204
|
+
if (p) {
|
|
6205
6205
|
const _ = x.map((E) => Xe(E, !0));
|
|
6206
6206
|
w(_);
|
|
6207
6207
|
return;
|
|
6208
6208
|
}
|
|
6209
|
-
w(nt(
|
|
6209
|
+
w(nt(m, /* @__PURE__ */ new Set([...x]), !0)), S(nt(v));
|
|
6210
6210
|
},
|
|
6211
6211
|
addSelectedEdges: (x) => {
|
|
6212
|
-
const { multiSelectionActive:
|
|
6213
|
-
if (
|
|
6212
|
+
const { multiSelectionActive: p, edgeLookup: v, nodeLookup: m, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
|
|
6213
|
+
if (p) {
|
|
6214
6214
|
const _ = x.map((E) => Xe(E, !0));
|
|
6215
6215
|
S(_);
|
|
6216
6216
|
return;
|
|
6217
6217
|
}
|
|
6218
|
-
S(nt(v, /* @__PURE__ */ new Set([...x]))), w(nt(
|
|
6218
|
+
S(nt(v, /* @__PURE__ */ new Set([...x]))), w(nt(m, /* @__PURE__ */ new Set(), !0));
|
|
6219
6219
|
},
|
|
6220
|
-
unselectNodesAndEdges: ({ nodes: x, edges:
|
|
6221
|
-
const { edges: v, nodes:
|
|
6220
|
+
unselectNodesAndEdges: ({ nodes: x, edges: p } = {}) => {
|
|
6221
|
+
const { edges: v, nodes: m, nodeLookup: w, triggerNodeChanges: S, triggerEdgeChanges: _ } = h(), E = x || m, I = p || v, T = [];
|
|
6222
6222
|
for (const k of E) {
|
|
6223
6223
|
if (!k.selected)
|
|
6224
6224
|
continue;
|
|
@@ -6226,32 +6226,32 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6226
6226
|
M && (M.selected = !1), T.push(Xe(k.id, !1));
|
|
6227
6227
|
}
|
|
6228
6228
|
const B = [];
|
|
6229
|
-
for (const k of
|
|
6229
|
+
for (const k of I)
|
|
6230
6230
|
k.selected && B.push(Xe(k.id, !1));
|
|
6231
6231
|
S(T), _(B);
|
|
6232
6232
|
},
|
|
6233
6233
|
setMinZoom: (x) => {
|
|
6234
|
-
const { panZoom:
|
|
6235
|
-
|
|
6234
|
+
const { panZoom: p, maxZoom: v } = h();
|
|
6235
|
+
p == null || p.setScaleExtent([x, v]), g({ minZoom: x });
|
|
6236
6236
|
},
|
|
6237
6237
|
setMaxZoom: (x) => {
|
|
6238
|
-
const { panZoom:
|
|
6239
|
-
|
|
6238
|
+
const { panZoom: p, minZoom: v } = h();
|
|
6239
|
+
p == null || p.setScaleExtent([v, x]), g({ maxZoom: x });
|
|
6240
6240
|
},
|
|
6241
6241
|
setTranslateExtent: (x) => {
|
|
6242
|
-
var
|
|
6243
|
-
(
|
|
6242
|
+
var p;
|
|
6243
|
+
(p = h().panZoom) == null || p.setTranslateExtent(x), g({ translateExtent: x });
|
|
6244
6244
|
},
|
|
6245
6245
|
resetSelectedElements: () => {
|
|
6246
|
-
const { edges: x, nodes:
|
|
6246
|
+
const { edges: x, nodes: p, triggerNodeChanges: v, triggerEdgeChanges: m, elementsSelectable: w } = h();
|
|
6247
6247
|
if (!w)
|
|
6248
6248
|
return;
|
|
6249
|
-
const S =
|
|
6250
|
-
v(S),
|
|
6249
|
+
const S = p.reduce((E, I) => I.selected ? [...E, Xe(I.id, !1)] : E, []), _ = x.reduce((E, I) => I.selected ? [...E, Xe(I.id, !1)] : E, []);
|
|
6250
|
+
v(S), m(_);
|
|
6251
6251
|
},
|
|
6252
6252
|
setNodeExtent: (x) => {
|
|
6253
|
-
const { nodes:
|
|
6254
|
-
x[0][0] === _[0][0] && x[0][1] === _[0][1] && x[1][0] === _[1][0] && x[1][1] === _[1][1] || (Zn(
|
|
6253
|
+
const { nodes: p, nodeLookup: v, parentLookup: m, nodeOrigin: w, elevateNodesOnSelect: S, nodeExtent: _, zIndexMode: E } = h();
|
|
6254
|
+
x[0][0] === _[0][0] && x[0][1] === _[0][1] && x[1][0] === _[1][0] && x[1][1] === _[1][1] || (Zn(p, v, m, {
|
|
6255
6255
|
nodeOrigin: w,
|
|
6256
6256
|
nodeExtent: x,
|
|
6257
6257
|
elevateNodesOnSelect: S,
|
|
@@ -6260,17 +6260,17 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
|
|
|
6260
6260
|
}), g({ nodeExtent: x }));
|
|
6261
6261
|
},
|
|
6262
6262
|
panBy: (x) => {
|
|
6263
|
-
const { transform:
|
|
6264
|
-
return Hd({ delta: x, panZoom: w, transform:
|
|
6263
|
+
const { transform: p, width: v, height: m, panZoom: w, translateExtent: S } = h();
|
|
6264
|
+
return Hd({ delta: x, panZoom: w, transform: p, translateExtent: S, width: v, height: m });
|
|
6265
6265
|
},
|
|
6266
|
-
setCenter: async (x,
|
|
6267
|
-
const { width:
|
|
6266
|
+
setCenter: async (x, p, v) => {
|
|
6267
|
+
const { width: m, height: w, maxZoom: S, panZoom: _ } = h();
|
|
6268
6268
|
if (!_)
|
|
6269
6269
|
return !1;
|
|
6270
6270
|
const E = typeof (v == null ? void 0 : v.zoom) != "undefined" ? v.zoom : S;
|
|
6271
6271
|
return await _.setViewport({
|
|
6272
|
-
x:
|
|
6273
|
-
y: w / 2 -
|
|
6272
|
+
x: m / 2 - x * E,
|
|
6273
|
+
y: w / 2 - p * E,
|
|
6274
6274
|
zoom: E
|
|
6275
6275
|
}, { duration: v == null ? void 0 : v.duration, ease: v == null ? void 0 : v.ease, interpolate: v == null ? void 0 : v.interpolate }), !0;
|
|
6276
6276
|
},
|
|
@@ -6313,11 +6313,11 @@ const fg = {
|
|
|
6313
6313
|
position: "relative",
|
|
6314
6314
|
zIndex: 0
|
|
6315
6315
|
};
|
|
6316
|
-
function hg({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: o, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd:
|
|
6316
|
+
function hg({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: o, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: p, onNodeMouseEnter: v, onNodeMouseMove: m, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, onNodeDragStart: E, onNodeDrag: I, onNodeDragStop: T, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onSelectionChange: L, onSelectionDragStart: b, onSelectionDrag: A, onSelectionDragStop: N, onSelectionContextMenu: $, onSelectionStart: P, onSelectionEnd: C, onBeforeDelete: z, connectionMode: R, connectionLineType: O = He.Bezier, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, deleteKeyCode: Z = "Backspace", selectionKeyCode: X = "Shift", selectionOnDrag: H = !1, selectionMode: W = Mt.Full, panActivationKeyCode: Q = "Space", multiSelectionKeyCode: V = At() ? "Meta" : "Control", zoomActivationKeyCode: J = At() ? "Meta" : "Control", snapToGrid: U, snapGrid: q, onlyRenderVisibleElements: j = !1, selectNodesOnDrag: re, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, nodeOrigin: Ae = qi, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve = !0, defaultViewport: Je = Lf, minZoom: Ie = 0.5, maxZoom: he = 2, translateExtent: Fe = Ct, preventScrolling: zt = !0, nodeExtent: je, defaultMarkerColor: Cs = "#b1b1b7", zoomOnScroll: Ms = !0, zoomOnPinch: ks = !0, panOnScroll: As = !1, panOnScrollSpeed: Is = 0.5, panOnScrollMode: $s = Ge.Free, zoomOnDoubleClick: Ps = !0, panOnDrag: Ts = !0, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs = 1, nodeClickDistance: Vs = 0, children: Fs, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs = 10, onNodesChange: Js, onEdgesChange: js, noDragClassName: ea = "nodrag", noWheelClassName: ta = "nowheel", noPanClassName: xr = "nopan", fitView: wr, fitViewOptions: br, connectOnClick: na, attributionPosition: ra, proOptions: oa, defaultEdgeOptions: ia, elevateNodesOnSelect: sa = !0, elevateEdgesOnSelect: aa = !1, disableKeyboardA11y: vr = !1, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanOnSelection: ua = !0, autoPanSpeed: da, connectionRadius: fa, isValidConnection: ha, onError: ga, style: pa, id: _r, nodeDragThreshold: ma, connectionDragThreshold: ya, viewport: xa, onViewportChange: wa, width: ba, height: va, colorMode: _a = "light", debug: Sa, onScroll: Ht, ariaLabelConfig: Ea, zIndexMode: Sr = "basic", ...Na }, Ca) {
|
|
6317
6317
|
const Nn = _r || "1", Ma = Rf(_a), ka = we((Er) => {
|
|
6318
6318
|
Er.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" }), Ht == null || Ht(Er);
|
|
6319
6319
|
}, [Ht]);
|
|
6320
|
-
return D("div", { "data-testid": "rf__wrapper", ...Na, onScroll: ka, style: { ...pa, ...fg }, ref: Ca, className: ue(["react-flow", o, Ma]), id: _r, role: "application", children: ce(dg, { nodes: e, edges: t, width: ba, height: va, fitView: wr, fitViewOptions: br, minZoom: Ie, maxZoom: he, nodeOrigin: Ae, nodeExtent: je, zIndexMode: Sr, children: [D(Hf, { nodes: e, edges: t, defaultNodes: n, defaultEdges: r, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd:
|
|
6320
|
+
return D("div", { "data-testid": "rf__wrapper", ...Na, onScroll: ka, style: { ...pa, ...fg }, ref: Ca, className: ue(["react-flow", o, Ma]), id: _r, role: "application", children: ce(dg, { nodes: e, edges: t, width: ba, height: va, fitView: wr, fitViewOptions: br, minZoom: Ie, maxZoom: he, nodeOrigin: Ae, nodeExtent: je, zIndexMode: Sr, children: [D(Hf, { nodes: e, edges: t, defaultNodes: n, defaultEdges: r, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: p, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve, elevateNodesOnSelect: sa, elevateEdgesOnSelect: aa, minZoom: Ie, maxZoom: he, nodeExtent: je, onNodesChange: Js, onEdgesChange: js, snapToGrid: U, snapGrid: q, connectionMode: R, translateExtent: Fe, connectOnClick: na, defaultEdgeOptions: ia, fitView: wr, fitViewOptions: br, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onNodeDragStart: E, onNodeDrag: I, onNodeDragStop: T, onSelectionDrag: A, onSelectionDragStart: b, onSelectionDragStop: N, onMove: d, onMoveStart: u, onMoveEnd: f, noPanClassName: xr, nodeOrigin: Ae, rfId: Nn, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanSpeed: da, onError: ga, connectionRadius: fa, isValidConnection: ha, selectNodesOnDrag: re, nodeDragThreshold: ma, connectionDragThreshold: ya, onBeforeDelete: z, debug: Sa, ariaLabelConfig: Ea, zIndexMode: Sr }), D(ag, { onInit: l, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter: v, onNodeMouseMove: m, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, nodeTypes: i, edgeTypes: s, connectionLineType: O, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, selectionKeyCode: X, selectionOnDrag: H, selectionMode: W, deleteKeyCode: Z, multiSelectionKeyCode: V, panActivationKeyCode: Q, zoomActivationKeyCode: J, onlyRenderVisibleElements: j, defaultViewport: Je, translateExtent: Fe, minZoom: Ie, maxZoom: he, preventScrolling: zt, zoomOnScroll: Ms, zoomOnPinch: ks, zoomOnDoubleClick: Ps, panOnScroll: As, panOnScrollSpeed: Is, panOnScrollMode: $s, panOnDrag: Ts, autoPanOnSelection: ua, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs, nodeClickDistance: Vs, onSelectionContextMenu: $, onSelectionStart: P, onSelectionEnd: C, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs, defaultMarkerColor: Cs, noDragClassName: ea, noWheelClassName: ta, noPanClassName: xr, rfId: Nn, disableKeyboardA11y: vr, nodeExtent: je, viewport: xa, onViewportChange: wa }), D(Df, { onSelectionChange: L }), Fs, D(Af, { proOptions: oa, position: ra }), D(kf, { rfId: Nn, disableKeyboardA11y: vr })] }) });
|
|
6321
6321
|
}
|
|
6322
6322
|
var gg = Ji(hg);
|
|
6323
6323
|
function pg(e) {
|
|
@@ -6358,7 +6358,7 @@ function Ss({
|
|
|
6358
6358
|
className: l,
|
|
6359
6359
|
patternClassName: d
|
|
6360
6360
|
}) {
|
|
6361
|
-
const u = ne(null), { transform: f, patternId: g } = ee(bg, se), h = r || wg[t], y = t === Re.Dots, x = t === Re.Cross,
|
|
6361
|
+
const u = ne(null), { transform: f, patternId: g } = ee(bg, se), h = r || wg[t], y = t === Re.Dots, x = t === Re.Cross, p = Array.isArray(n) ? n : [n, n], v = [p[0] * f[2] || 1, p[1] * f[2] || 1], m = h * f[2], w = Array.isArray(i) ? i : [i, i], S = x ? [m, m] : v, _ = [
|
|
6362
6362
|
w[0] * f[2] || 1 + S[0] / 2,
|
|
6363
6363
|
w[1] * f[2] || 1 + S[1] / 2
|
|
6364
6364
|
], E = `${g}${e || ""}`;
|
|
@@ -6367,7 +6367,7 @@ function Ss({
|
|
|
6367
6367
|
...Sn,
|
|
6368
6368
|
"--xy-background-color-props": a,
|
|
6369
6369
|
"--xy-background-pattern-color-props": s
|
|
6370
|
-
}, ref: u, "data-testid": "rf__background", children: [D("pattern", { id: E, x: f[0] % v[0], y: f[1] % v[1], width: v[0], height: v[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${_[0]},-${_[1]})`, children: y ? D(xg, { radius:
|
|
6370
|
+
}, ref: u, "data-testid": "rf__background", children: [D("pattern", { id: E, x: f[0] % v[0], y: f[1] % v[1], width: v[0], height: v[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${_[0]},-${_[1]})`, children: y ? D(xg, { radius: m / 2, className: d }) : D(yg, { dimensions: S, lineWidth: o, variant: t, className: d }) }), D("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${E})` })] });
|
|
6371
6371
|
}
|
|
6372
6372
|
Ss.displayName = "Background";
|
|
6373
6373
|
const vg = le(Ss);
|
|
@@ -6396,11 +6396,11 @@ const Mg = (e) => ({
|
|
|
6396
6396
|
ariaLabelConfig: e.ariaLabelConfig
|
|
6397
6397
|
});
|
|
6398
6398
|
function Es({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: o, onZoomIn: i, onZoomOut: s, onFitView: a, onInteractiveChange: c, className: l, children: d, position: u = "bottom-left", orientation: f = "vertical", "aria-label": g }) {
|
|
6399
|
-
const h = ae(), { isInteractive: y, minZoomReached: x, maxZoomReached:
|
|
6400
|
-
|
|
6399
|
+
const h = ae(), { isInteractive: y, minZoomReached: x, maxZoomReached: p, ariaLabelConfig: v } = ee(Mg, se), { zoomIn: m, zoomOut: w, fitView: S } = mr(), _ = () => {
|
|
6400
|
+
m(), i == null || i();
|
|
6401
6401
|
}, E = () => {
|
|
6402
6402
|
w(), s == null || s();
|
|
6403
|
-
},
|
|
6403
|
+
}, I = () => {
|
|
6404
6404
|
S(o), a == null || a();
|
|
6405
6405
|
}, T = () => {
|
|
6406
6406
|
h.setState({
|
|
@@ -6409,7 +6409,7 @@ function Es({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
6409
6409
|
elementsSelectable: !y
|
|
6410
6410
|
}), c == null || c(!y);
|
|
6411
6411
|
};
|
|
6412
|
-
return ce(_n, { className: ue(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": g != null ? g : v["controls.ariaLabel"], children: [t && ce(De, { children: [D(Ut, { onClick: _, className: "react-flow__controls-zoomin", title: v["controls.zoomIn.ariaLabel"], "aria-label": v["controls.zoomIn.ariaLabel"], disabled:
|
|
6412
|
+
return ce(_n, { className: ue(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": g != null ? g : v["controls.ariaLabel"], children: [t && ce(De, { children: [D(Ut, { onClick: _, className: "react-flow__controls-zoomin", title: v["controls.zoomIn.ariaLabel"], "aria-label": v["controls.zoomIn.ariaLabel"], disabled: p, children: D(_g, {}) }), D(Ut, { onClick: E, className: "react-flow__controls-zoomout", title: v["controls.zoomOut.ariaLabel"], "aria-label": v["controls.zoomOut.ariaLabel"], disabled: x, children: D(Sg, {}) })] }), n && D(Ut, { className: "react-flow__controls-fitview", onClick: I, title: v["controls.fitView.ariaLabel"], "aria-label": v["controls.fitView.ariaLabel"], children: D(Eg, {}) }), r && D(Ut, { className: "react-flow__controls-interactive", onClick: T, title: v["controls.interactive.ariaLabel"], "aria-label": v["controls.interactive.ariaLabel"], children: y ? D(Cg, {}) : D(Ng, {}) }), d] });
|
|
6413
6413
|
}
|
|
6414
6414
|
Es.displayName = "Controls";
|
|
6415
6415
|
const kg = le(Es);
|
|
@@ -6419,7 +6419,7 @@ function Ag({ id: e, x: t, y: n, width: r, height: o, style: i, color: s, stroke
|
|
|
6419
6419
|
fill: x,
|
|
6420
6420
|
stroke: a,
|
|
6421
6421
|
strokeWidth: c
|
|
6422
|
-
}, shapeRendering: u, onClick: g ? (
|
|
6422
|
+
}, shapeRendering: u, onClick: g ? (p) => g(p, e) : void 0 });
|
|
6423
6423
|
}
|
|
6424
6424
|
const Ig = le(Ag), $g = (e) => e.nodes.map((t) => t.id), Hn = (e) => e instanceof Function ? e : () => e;
|
|
6425
6425
|
function Pg({
|
|
@@ -6452,12 +6452,12 @@ function Tg({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
|
|
|
6452
6452
|
const y = h.nodeLookup.get(e);
|
|
6453
6453
|
if (!y)
|
|
6454
6454
|
return { node: void 0, x: 0, y: 0, width: 0, height: 0 };
|
|
6455
|
-
const x = y.internals.userNode, { x:
|
|
6455
|
+
const x = y.internals.userNode, { x: p, y: v } = y.internals.positionAbsolute, { width: m, height: w } = Le(x);
|
|
6456
6456
|
return {
|
|
6457
6457
|
node: x,
|
|
6458
|
-
x:
|
|
6458
|
+
x: p,
|
|
6459
6459
|
y: v,
|
|
6460
|
-
width:
|
|
6460
|
+
width: m,
|
|
6461
6461
|
height: w
|
|
6462
6462
|
};
|
|
6463
6463
|
}, se);
|
|
@@ -6505,13 +6505,13 @@ function Ns({
|
|
|
6505
6505
|
onNodeClick: h,
|
|
6506
6506
|
pannable: y = !1,
|
|
6507
6507
|
zoomable: x = !1,
|
|
6508
|
-
ariaLabel:
|
|
6508
|
+
ariaLabel: p,
|
|
6509
6509
|
inversePan: v,
|
|
6510
|
-
zoomStep:
|
|
6510
|
+
zoomStep: m = 1,
|
|
6511
6511
|
offsetScale: w = 5
|
|
6512
6512
|
}) {
|
|
6513
6513
|
var U, q;
|
|
6514
|
-
const S = ae(), _ = ne(null), { boundingRect: E, viewBB:
|
|
6514
|
+
const S = ae(), _ = ne(null), { boundingRect: E, viewBB: I, rfId: T, panZoom: B, translateExtent: k, flowWidth: M, flowHeight: L, ariaLabelConfig: b } = ee(Rg, se), A = (U = e == null ? void 0 : e.width) != null ? U : Og, N = (q = e == null ? void 0 : e.height) != null ? q : zg, $ = E.width / A, P = E.height / N, C = Math.max($, P), z = C * A, R = C * N, O = w * C, F = E.x - (z - E.width) / 2 - O, Y = E.y - (R - E.height) / 2 - O, K = z + O * 2, Z = R + O * 2, X = `${Bg}-${T}`, H = ne(0), W = ne();
|
|
6515
6515
|
H.current = C, ie(() => {
|
|
6516
6516
|
if (_.current && B)
|
|
6517
6517
|
return W.current = Kd({
|
|
@@ -6531,10 +6531,10 @@ function Ns({
|
|
|
6531
6531
|
height: L,
|
|
6532
6532
|
inversePan: v,
|
|
6533
6533
|
pannable: y,
|
|
6534
|
-
zoomStep:
|
|
6534
|
+
zoomStep: m,
|
|
6535
6535
|
zoomable: x
|
|
6536
6536
|
});
|
|
6537
|
-
}, [y, x, v,
|
|
6537
|
+
}, [y, x, v, m, k, M, L]);
|
|
6538
6538
|
const Q = g ? (j) => {
|
|
6539
6539
|
var oe;
|
|
6540
6540
|
const [re, te] = ((oe = W.current) == null ? void 0 : oe.pointer(j)) || [0, 0];
|
|
@@ -6542,7 +6542,7 @@ function Ns({
|
|
|
6542
6542
|
} : void 0, V = h ? we((j, re) => {
|
|
6543
6543
|
const te = S.getState().nodeLookup.get(re).internals.userNode;
|
|
6544
6544
|
h(j, te);
|
|
6545
|
-
}, []) : void 0, J =
|
|
6545
|
+
}, []) : void 0, J = p != null ? p : b["minimap.ariaLabel"];
|
|
6546
6546
|
return D(_n, { position: f, style: {
|
|
6547
6547
|
...e,
|
|
6548
6548
|
"--xy-minimap-background-color-props": typeof c == "string" ? c : void 0,
|
|
@@ -6553,20 +6553,20 @@ function Ns({
|
|
|
6553
6553
|
"--xy-minimap-node-stroke-color-props": typeof n == "string" ? n : void 0,
|
|
6554
6554
|
"--xy-minimap-node-stroke-width-props": typeof s == "number" ? s : void 0
|
|
6555
6555
|
}, className: ue(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: ce("svg", { width: A, height: N, viewBox: `${F} ${Y} ${K} ${Z}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": X, ref: _, onClick: Q, children: [J && D("title", { id: X, children: J }), D(Lg, { onClick: V, nodeColor: r, nodeStrokeColor: n, nodeBorderRadius: i, nodeClassName: o, nodeStrokeWidth: s, nodeComponent: a }), D("path", { className: "react-flow__minimap-mask", d: `M${F - O},${Y - O}h${K + O * 2}v${Z + O * 2}h${-K - O * 2}z
|
|
6556
|
-
M${
|
|
6556
|
+
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
|
|
6557
6557
|
}
|
|
6558
6558
|
Ns.displayName = "MiniMap";
|
|
6559
6559
|
const Vg = le(Ns), Fg = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Xg = {
|
|
6560
6560
|
[dt.Line]: "right",
|
|
6561
6561
|
[dt.Handle]: "bottom-right"
|
|
6562
6562
|
};
|
|
6563
|
-
function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, style: o = void 0, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, resizeDirection: f, autoScale: g = !0, shouldResize: h, onResizeStart: y, onResize: x, onResizeEnd:
|
|
6564
|
-
const v = ns(),
|
|
6563
|
+
function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, style: o = void 0, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, resizeDirection: f, autoScale: g = !0, shouldResize: h, onResizeStart: y, onResize: x, onResizeEnd: p }) {
|
|
6564
|
+
const v = ns(), m = typeof e == "string" ? e : v, w = ae(), S = ne(null), _ = n === dt.Handle, E = ee(we(Fg(_ && g), [_, g]), se), I = ne(null), T = t != null ? t : Xg[n];
|
|
6565
6565
|
ie(() => {
|
|
6566
|
-
if (!(!S.current || !
|
|
6567
|
-
return
|
|
6566
|
+
if (!(!S.current || !m))
|
|
6567
|
+
return I.current || (I.current = af({
|
|
6568
6568
|
domNode: S.current,
|
|
6569
|
-
nodeId:
|
|
6569
|
+
nodeId: m,
|
|
6570
6570
|
getStoreItems: () => {
|
|
6571
6571
|
const { nodeLookup: k, transform: M, snapGrid: L, snapToGrid: b, nodeOrigin: A, domNode: N } = w.getState();
|
|
6572
6572
|
return {
|
|
@@ -6580,7 +6580,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6580
6580
|
},
|
|
6581
6581
|
onChange: (k, M) => {
|
|
6582
6582
|
var z, R, O, F, Y, K, Z;
|
|
6583
|
-
const { triggerNodeChanges: L, nodeLookup: b, parentLookup: A, nodeOrigin: N } = w.getState(),
|
|
6583
|
+
const { triggerNodeChanges: L, nodeLookup: b, parentLookup: A, nodeOrigin: N } = w.getState(), $ = [], P = { x: k.x, y: k.y }, C = b.get(m);
|
|
6584
6584
|
if (C && C.expandParent && C.parentId) {
|
|
6585
6585
|
const X = (z = C.origin) != null ? z : N, H = (O = (R = k.width) != null ? R : C.measured.width) != null ? O : 0, W = (Y = (F = k.height) != null ? F : C.measured.height) != null ? Y : 0, Q = {
|
|
6586
6586
|
id: C.id,
|
|
@@ -6594,19 +6594,19 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6594
6594
|
}, { width: H, height: W }, C.parentId, b, X)
|
|
6595
6595
|
}
|
|
6596
6596
|
}, V = pr([Q], b, A, N);
|
|
6597
|
-
|
|
6597
|
+
$.push(...V), P.x = k.x ? Math.max(X[0] * H, k.x) : void 0, P.y = k.y ? Math.max(X[1] * W, k.y) : void 0;
|
|
6598
6598
|
}
|
|
6599
6599
|
if (P.x !== void 0 && P.y !== void 0) {
|
|
6600
6600
|
const X = {
|
|
6601
|
-
id:
|
|
6601
|
+
id: m,
|
|
6602
6602
|
type: "position",
|
|
6603
6603
|
position: { ...P }
|
|
6604
6604
|
};
|
|
6605
|
-
|
|
6605
|
+
$.push(X);
|
|
6606
6606
|
}
|
|
6607
6607
|
if (k.width !== void 0 && k.height !== void 0) {
|
|
6608
6608
|
const H = {
|
|
6609
|
-
id:
|
|
6609
|
+
id: m,
|
|
6610
6610
|
type: "dimensions",
|
|
6611
6611
|
resizing: !0,
|
|
6612
6612
|
setAttributes: f ? f === "horizontal" ? "width" : "height" : !0,
|
|
@@ -6615,20 +6615,20 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6615
6615
|
height: k.height
|
|
6616
6616
|
}
|
|
6617
6617
|
};
|
|
6618
|
-
|
|
6618
|
+
$.push(H);
|
|
6619
6619
|
}
|
|
6620
6620
|
for (const X of M) {
|
|
6621
6621
|
const H = {
|
|
6622
6622
|
...X,
|
|
6623
6623
|
type: "position"
|
|
6624
6624
|
};
|
|
6625
|
-
|
|
6625
|
+
$.push(H);
|
|
6626
6626
|
}
|
|
6627
|
-
L(
|
|
6627
|
+
L($);
|
|
6628
6628
|
},
|
|
6629
6629
|
onEnd: ({ width: k, height: M }) => {
|
|
6630
6630
|
const L = {
|
|
6631
|
-
id:
|
|
6631
|
+
id: m,
|
|
6632
6632
|
type: "dimensions",
|
|
6633
6633
|
resizing: !1,
|
|
6634
6634
|
dimensions: {
|
|
@@ -6638,7 +6638,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6638
6638
|
};
|
|
6639
6639
|
w.getState().triggerNodeChanges([L]);
|
|
6640
6640
|
}
|
|
6641
|
-
})),
|
|
6641
|
+
})), I.current.update({
|
|
6642
6642
|
controlPosition: T,
|
|
6643
6643
|
boundaries: {
|
|
6644
6644
|
minWidth: a,
|
|
@@ -6650,11 +6650,11 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6650
6650
|
resizeDirection: f,
|
|
6651
6651
|
onResizeStart: y,
|
|
6652
6652
|
onResize: x,
|
|
6653
|
-
onResizeEnd:
|
|
6653
|
+
onResizeEnd: p,
|
|
6654
6654
|
shouldResize: h
|
|
6655
6655
|
}), () => {
|
|
6656
6656
|
var k;
|
|
6657
|
-
(k =
|
|
6657
|
+
(k = I.current) == null || k.destroy();
|
|
6658
6658
|
};
|
|
6659
6659
|
}, [
|
|
6660
6660
|
T,
|
|
@@ -6665,7 +6665,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
|
|
|
6665
6665
|
u,
|
|
6666
6666
|
y,
|
|
6667
6667
|
x,
|
|
6668
|
-
|
|
6668
|
+
p,
|
|
6669
6669
|
h
|
|
6670
6670
|
]);
|
|
6671
6671
|
const B = T.split("-");
|
|
@@ -6799,44 +6799,45 @@ const Lo = [
|
|
|
6799
6799
|
};
|
|
6800
6800
|
function Jg({ formData: e }) {
|
|
6801
6801
|
const { nodes: t, edges: n } = be(() => {
|
|
6802
|
+
var f, g;
|
|
6802
6803
|
const l = [], d = [];
|
|
6803
6804
|
let u = null;
|
|
6804
|
-
return e == null
|
|
6805
|
-
var
|
|
6806
|
-
const
|
|
6805
|
+
return (f = e == null ? void 0 : e.filter((h) => !(h != null && h.isDeleted))) == null || f.forEach((h, y) => {
|
|
6806
|
+
var _;
|
|
6807
|
+
const x = Lo[y % Lo.length], p = ((_ = h == null ? void 0 : h.questionData) == null ? void 0 : _.filter((E) => !(E != null && E.isDeleted))) || [], v = y * 400, m = 0, w = 320, S = 60 + p.length * 110;
|
|
6807
6808
|
l.push({
|
|
6808
|
-
id:
|
|
6809
|
+
id: h.id,
|
|
6809
6810
|
type: "sectionGroup",
|
|
6810
|
-
data: { title:
|
|
6811
|
-
position: { x:
|
|
6811
|
+
data: { title: h.title || `Section ${y + 1}` },
|
|
6812
|
+
position: { x: v, y: m },
|
|
6812
6813
|
style: {
|
|
6813
|
-
width:
|
|
6814
|
-
height:
|
|
6814
|
+
width: w,
|
|
6815
|
+
height: S,
|
|
6815
6816
|
backgroundColor: "rgba(248, 250, 252, 0.4)",
|
|
6816
6817
|
border: "2px dashed #cbd5e1",
|
|
6817
6818
|
borderRadius: "16px"
|
|
6818
6819
|
}
|
|
6819
|
-
}),
|
|
6820
|
-
const
|
|
6820
|
+
}), p.forEach((E, I) => {
|
|
6821
|
+
const T = E.id;
|
|
6821
6822
|
l.push({
|
|
6822
|
-
id:
|
|
6823
|
+
id: T,
|
|
6823
6824
|
type: "customField",
|
|
6824
|
-
parentId:
|
|
6825
|
+
parentId: h.id,
|
|
6825
6826
|
extent: "parent",
|
|
6826
6827
|
targetPosition: G.Top,
|
|
6827
6828
|
sourcePosition: G.Bottom,
|
|
6828
6829
|
data: {
|
|
6829
|
-
label:
|
|
6830
|
-
type:
|
|
6831
|
-
sectionTitle:
|
|
6832
|
-
isHidden:
|
|
6833
|
-
colorScheme:
|
|
6830
|
+
label: E.inputLabel || E.label,
|
|
6831
|
+
type: E.type,
|
|
6832
|
+
sectionTitle: h.title || "Untitled Section",
|
|
6833
|
+
isHidden: E.isHidden,
|
|
6834
|
+
colorScheme: x
|
|
6834
6835
|
},
|
|
6835
|
-
position: { x: 20, y: 40 +
|
|
6836
|
-
}), u && !
|
|
6837
|
-
id: `e-${u}-${
|
|
6836
|
+
position: { x: 20, y: 40 + I * 110 }
|
|
6837
|
+
}), u && !E.isHidden && d.push({
|
|
6838
|
+
id: `e-${u}-${T}`,
|
|
6838
6839
|
source: u,
|
|
6839
|
-
target:
|
|
6840
|
+
target: T,
|
|
6840
6841
|
type: "smoothstep",
|
|
6841
6842
|
animated: !0,
|
|
6842
6843
|
style: { stroke: "#cbd5e1", strokeWidth: 2 },
|
|
@@ -6846,20 +6847,20 @@ function Jg({ formData: e }) {
|
|
|
6846
6847
|
height: 20,
|
|
6847
6848
|
color: "#cbd5e1"
|
|
6848
6849
|
}
|
|
6849
|
-
}),
|
|
6850
|
+
}), E.isHidden || (u = T);
|
|
6850
6851
|
});
|
|
6851
|
-
}), e == null
|
|
6852
|
-
var
|
|
6853
|
-
(
|
|
6854
|
-
var
|
|
6855
|
-
|
|
6852
|
+
}), (g = e == null ? void 0 : e.filter((h) => !(h != null && h.isDeleted))) == null || g.forEach((h) => {
|
|
6853
|
+
var y, x;
|
|
6854
|
+
(x = (y = h == null ? void 0 : h.questionData) == null ? void 0 : y.filter((p) => !(p != null && p.isDeleted))) == null || x.forEach((p) => {
|
|
6855
|
+
var v;
|
|
6856
|
+
p.isHidden && ((v = p.visibilityDependentFields) == null ? void 0 : v.length) > 0 && p.visibilityDependentFields.forEach((m) => {
|
|
6856
6857
|
d.push({
|
|
6857
|
-
id: `e-cond-${
|
|
6858
|
-
source:
|
|
6859
|
-
target:
|
|
6858
|
+
id: `e-cond-${m.id}-${p.id}`,
|
|
6859
|
+
source: m.id,
|
|
6860
|
+
target: p.id,
|
|
6860
6861
|
type: "smoothstep",
|
|
6861
6862
|
animated: !0,
|
|
6862
|
-
label: `if ${
|
|
6863
|
+
label: `if ${m.operator} '${m.fieldValue}'`,
|
|
6863
6864
|
labelStyle: { fill: "#f59e0b", fontWeight: 600, fontSize: 12 },
|
|
6864
6865
|
labelBgStyle: {
|
|
6865
6866
|
fill: "#fffef2",
|