geonodes-web-render 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed.css +1 -1
- package/dist/embed.js +1106 -890
- package/dist/types/embed.d.ts +8 -3
- package/dist/types/gn/components/GenericGNNode.d.ts +1 -1
- package/dist/types/gn/components/GeometryNodesFlow.d.ts +3 -1
- package/dist/types/gn/components/RerouteNode.d.ts +1 -1
- package/dist/types/gn/components/SimulationZoneFrame.d.ts +1 -1
- package/dist/types/gn/components/groupNavContext.d.ts +10 -0
- package/dist/types/gn/exporter/nodebpyExporter.d.ts +108 -0
- package/dist/types/gn/importer/blenderTree.d.ts +27 -14
- package/dist/types/gn/ir/types.d.ts +3 -0
- package/dist/types/gn/xyflow/mapGraphIRToFlow.d.ts +2 -0
- package/dist/types/utils/formatTreeClipperJson.d.ts +14 -0
- package/package.json +5 -3
package/dist/embed.js
CHANGED
|
@@ -515,7 +515,8 @@ function nt(e) {
|
|
|
515
515
|
}
|
|
516
516
|
function rt(e) {
|
|
517
517
|
return function() {
|
|
518
|
-
|
|
518
|
+
var t = e.apply(this, arguments);
|
|
519
|
+
this.textContent = t ?? "";
|
|
519
520
|
};
|
|
520
521
|
}
|
|
521
522
|
function it(e) {
|
|
@@ -533,7 +534,8 @@ function ot(e) {
|
|
|
533
534
|
}
|
|
534
535
|
function st(e) {
|
|
535
536
|
return function() {
|
|
536
|
-
|
|
537
|
+
var t = e.apply(this, arguments);
|
|
538
|
+
this.innerHTML = t ?? "";
|
|
537
539
|
};
|
|
538
540
|
}
|
|
539
541
|
function ct(e) {
|
|
@@ -1963,7 +1965,8 @@ function Ii(e) {
|
|
|
1963
1965
|
}
|
|
1964
1966
|
function Li(e) {
|
|
1965
1967
|
return function() {
|
|
1966
|
-
|
|
1968
|
+
var t = e(this);
|
|
1969
|
+
this.textContent = t ?? "";
|
|
1967
1970
|
};
|
|
1968
1971
|
}
|
|
1969
1972
|
function Ri(e) {
|
|
@@ -2381,10 +2384,10 @@ function fa() {
|
|
|
2381
2384
|
//#endregion
|
|
2382
2385
|
//#region node_modules/@xyflow/system/dist/esm/index.js
|
|
2383
2386
|
var J = {
|
|
2384
|
-
error001: (
|
|
2387
|
+
error001: (e = "react") => `Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,
|
|
2385
2388
|
error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
|
|
2386
2389
|
error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
|
|
2387
|
-
error004: () => "The
|
|
2390
|
+
error004: () => "The parent container needs a width and a height to render the graph.",
|
|
2388
2391
|
error005: () => "Only child nodes can use a parent extent.",
|
|
2389
2392
|
error006: () => "Can't create edge. An edge needs a source and a target.",
|
|
2390
2393
|
error007: (e) => `The old edge with id=${e} does not exist.`,
|
|
@@ -2395,7 +2398,8 @@ var J = {
|
|
|
2395
2398
|
error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
|
|
2396
2399
|
error013: (e = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,
|
|
2397
2400
|
error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",
|
|
2398
|
-
error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."
|
|
2401
|
+
error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",
|
|
2402
|
+
error016: (e) => `Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`
|
|
2399
2403
|
}, pa = [[-Infinity, -Infinity], [Infinity, Infinity]], ma = [
|
|
2400
2404
|
"Enter",
|
|
2401
2405
|
" ",
|
|
@@ -2530,13 +2534,13 @@ function Ma(e, t) {
|
|
|
2530
2534
|
}), n;
|
|
2531
2535
|
}
|
|
2532
2536
|
async function Na({ nodes: e, width: t, height: n, panZoom: r, minZoom: i, maxZoom: a }, o) {
|
|
2533
|
-
if (e.size === 0) return
|
|
2537
|
+
if (e.size === 0) return !0;
|
|
2534
2538
|
let s = ro(ka(Ma(e, o)), t, n, o?.minZoom ?? i, o?.maxZoom ?? a, o?.padding ?? .1);
|
|
2535
2539
|
return await r.setViewport(s, {
|
|
2536
2540
|
duration: o?.duration,
|
|
2537
2541
|
ease: o?.ease,
|
|
2538
2542
|
interpolate: o?.interpolate
|
|
2539
|
-
}),
|
|
2543
|
+
}), !0;
|
|
2540
2544
|
}
|
|
2541
2545
|
function Pa({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: i, onError: a }) {
|
|
2542
2546
|
let o = n.get(e), s = o.parentId ? n.get(o.parentId) : void 0, { x: c, y: l } = s ? s.internals.positionAbsolute : {
|
|
@@ -2628,8 +2632,8 @@ var za = (e, t, n) => e < t ? Ia(Math.abs(e - t), 1, t) / t : e > n ? -Ia(Math.a
|
|
|
2628
2632
|
}, Ka = (e, t) => Ua(Va(Ha(e), Ha(t))), qa = (e, t) => {
|
|
2629
2633
|
let n = Math.max(0, Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)), r = Math.max(0, Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y));
|
|
2630
2634
|
return Math.ceil(n * r);
|
|
2631
|
-
}, Ja = (e) => Ya(e.width) && Ya(e.height) && Ya(e.x) && Ya(e.y), Ya = (e) => !isNaN(e) && isFinite(e), Xa = (e, t) => {
|
|
2632
|
-
process.env.NODE_ENV === "development" && console.warn(`[
|
|
2635
|
+
}, Ja = (e) => Ya(e.width) && Ya(e.height) && Ya(e.x) && Ya(e.y), Ya = (e) => !isNaN(e) && isFinite(e), Xa = (e, t) => (n, r) => {
|
|
2636
|
+
process.env.NODE_ENV === "development" && console.warn(`[${e}]: ${r} Help: ${t}error#${n}`);
|
|
2633
2637
|
}, Za = (e, t = [1, 1]) => ({
|
|
2634
2638
|
x: t[0] * Math.round(e.x / t[0]),
|
|
2635
2639
|
y: t[1] * Math.round(e.y / t[1])
|
|
@@ -2653,7 +2657,7 @@ function eo(e, t) {
|
|
|
2653
2657
|
let n = parseFloat(e);
|
|
2654
2658
|
if (!Number.isNaN(n)) return Math.floor(t * n * .01);
|
|
2655
2659
|
}
|
|
2656
|
-
return console.error(`
|
|
2660
|
+
return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`), 0;
|
|
2657
2661
|
}
|
|
2658
2662
|
function to(e, t, n) {
|
|
2659
2663
|
if (typeof e == "string" || typeof e == "number") {
|
|
@@ -2883,7 +2887,7 @@ function Do({ sourceNode: e, targetNode: t, width: n, height: r, transform: i })
|
|
|
2883
2887
|
}, Ua(a)) > 0;
|
|
2884
2888
|
}
|
|
2885
2889
|
var Oo = ({ source: e, sourceHandle: t, target: n, targetHandle: r }) => `xy-edge__${e}${t || ""}-${n}${r || ""}`, ko = (e, t) => t.some((t) => t.source === e.source && t.target === e.target && (t.sourceHandle === e.sourceHandle || !t.sourceHandle && !e.sourceHandle) && (t.targetHandle === e.targetHandle || !t.targetHandle && !e.targetHandle)), Ao = (e, t, n = {}) => {
|
|
2886
|
-
if (!e.source || !e.target) return
|
|
2890
|
+
if (!e.source || !e.target) return n.onError?.("006", J.error006()), t;
|
|
2887
2891
|
let r = n.getEdgeId || Oo, i;
|
|
2888
2892
|
return i = wa(e) ? { ...e } : {
|
|
2889
2893
|
...e,
|
|
@@ -3002,18 +3006,19 @@ function Fo({ source: e, sourcePosition: t = Y.Bottom, target: n, targetPosition
|
|
|
3002
3006
|
};
|
|
3003
3007
|
Math.max(Math.abs(d.x - m[0].x), Math.abs(y.x - m[0].x)) >= Math.max(Math.abs(d.y - m[0].y), Math.abs(y.y - m[0].y)) ? (h = (d.x + y.x) / 2, g = m[0].y) : (h = m[0].x, g = (d.y + y.y) / 2);
|
|
3004
3008
|
}
|
|
3009
|
+
let x = {
|
|
3010
|
+
x: l.x + _.x,
|
|
3011
|
+
y: l.y + _.y
|
|
3012
|
+
}, S = {
|
|
3013
|
+
x: u.x + v.x,
|
|
3014
|
+
y: u.y + v.y
|
|
3015
|
+
};
|
|
3005
3016
|
return [
|
|
3006
3017
|
[
|
|
3007
3018
|
e,
|
|
3008
|
-
|
|
3009
|
-
x: l.x + _.x,
|
|
3010
|
-
y: l.y + _.y
|
|
3011
|
-
},
|
|
3019
|
+
...x.x !== m[0].x || x.y !== m[0].y ? [x] : [],
|
|
3012
3020
|
...m,
|
|
3013
|
-
|
|
3014
|
-
x: u.x + v.x,
|
|
3015
|
-
y: u.y + v.y
|
|
3016
|
-
},
|
|
3021
|
+
...S.x !== m[m.length - 1].x || S.y !== m[m.length - 1].y ? [S] : [],
|
|
3017
3022
|
n
|
|
3018
3023
|
],
|
|
3019
3024
|
h,
|
|
@@ -3050,12 +3055,10 @@ function Lo({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r,
|
|
|
3050
3055
|
},
|
|
3051
3056
|
offset: l,
|
|
3052
3057
|
stepPosition: u
|
|
3053
|
-
})
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
return r = n > 0 && n < d.length - 1 ? Io(d[n - 1], t, d[n + 1], o) : `${n === 0 ? "M" : "L"}${t.x} ${t.y}`, e += r, e;
|
|
3058
|
-
}, ""),
|
|
3058
|
+
}), g = `M${d[0].x} ${d[0].y}`;
|
|
3059
|
+
for (let e = 1; e < d.length - 1; e++) g += Io(d[e - 1], d[e], d[e + 1], o);
|
|
3060
|
+
return g += `L${d[d.length - 1].x} ${d[d.length - 1].y}`, [
|
|
3061
|
+
g,
|
|
3059
3062
|
f,
|
|
3060
3063
|
p,
|
|
3061
3064
|
m,
|
|
@@ -3185,31 +3188,34 @@ function Qo(e) {
|
|
|
3185
3188
|
return e === "manual";
|
|
3186
3189
|
}
|
|
3187
3190
|
function $o(e, t, n, r = {}) {
|
|
3188
|
-
let i = Yo(Jo, r), a = { i: 0 }, o = new Map(t), s = i?.elevateNodesOnSelect && !Qo(i.zIndexMode) ? Go : 0, c = e.length > 0;
|
|
3191
|
+
let i = Yo(Jo, r), a = { i: 0 }, o = new Map(t), s = i?.elevateNodesOnSelect && !Qo(i.zIndexMode) ? Go : 0, c = e.length > 0, l = !1;
|
|
3189
3192
|
t.clear(), n.clear();
|
|
3190
|
-
for (let
|
|
3191
|
-
let e = o.get(
|
|
3192
|
-
if (i.checkEquality &&
|
|
3193
|
+
for (let u of e) {
|
|
3194
|
+
let e = o.get(u.id);
|
|
3195
|
+
if (i.checkEquality && u === e?.internals.userNode) t.set(u.id, e);
|
|
3193
3196
|
else {
|
|
3194
|
-
let n = La(Da(
|
|
3197
|
+
let n = La(Da(u, i.nodeOrigin), ao(u.extent) ? u.extent : i.nodeExtent, oo(u));
|
|
3195
3198
|
e = {
|
|
3196
3199
|
...i.defaults,
|
|
3197
|
-
...
|
|
3200
|
+
...u,
|
|
3198
3201
|
measured: {
|
|
3199
|
-
width:
|
|
3200
|
-
height:
|
|
3202
|
+
width: u.measured?.width,
|
|
3203
|
+
height: u.measured?.height
|
|
3201
3204
|
},
|
|
3202
3205
|
internals: {
|
|
3203
3206
|
positionAbsolute: n,
|
|
3204
|
-
handleBounds: Zo(
|
|
3205
|
-
z: ns(
|
|
3206
|
-
userNode:
|
|
3207
|
+
handleBounds: Zo(u, e),
|
|
3208
|
+
z: ns(u, s, i.zIndexMode),
|
|
3209
|
+
userNode: u
|
|
3207
3210
|
}
|
|
3208
|
-
}, t.set(
|
|
3211
|
+
}, t.set(u.id, e);
|
|
3209
3212
|
}
|
|
3210
|
-
(e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (c = !1),
|
|
3213
|
+
(e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (c = !1), u.parentId && ts(e, t, n, r, a), l ||= u.selected ?? !1;
|
|
3211
3214
|
}
|
|
3212
|
-
return
|
|
3215
|
+
return {
|
|
3216
|
+
nodesInitialized: c,
|
|
3217
|
+
hasSelectedNodes: l
|
|
3218
|
+
};
|
|
3213
3219
|
}
|
|
3214
3220
|
function es(e, t) {
|
|
3215
3221
|
if (!e.parentId) return;
|
|
@@ -3353,13 +3359,13 @@ function as(e, t, n, r, i, a, o) {
|
|
|
3353
3359
|
};
|
|
3354
3360
|
}
|
|
3355
3361
|
async function os({ delta: e, panZoom: t, transform: n, translateExtent: r, width: i, height: a }) {
|
|
3356
|
-
if (!t || !e.x && !e.y) return
|
|
3362
|
+
if (!t || !e.x && !e.y) return !1;
|
|
3357
3363
|
let o = await t.setViewportConstrained({
|
|
3358
3364
|
x: n[0] + e.x,
|
|
3359
3365
|
y: n[1] + e.y,
|
|
3360
3366
|
zoom: n[2]
|
|
3361
|
-
}, [[0, 0], [i, a]], r)
|
|
3362
|
-
return
|
|
3367
|
+
}, [[0, 0], [i, a]], r);
|
|
3368
|
+
return !!o && (o.x !== n[0] || o.y !== n[1] || o.k !== n[2]);
|
|
3363
3369
|
}
|
|
3364
3370
|
function ss(e, t, n, r, i, a) {
|
|
3365
3371
|
let o = i, s = r.get(o) || /* @__PURE__ */ new Map();
|
|
@@ -3568,7 +3574,11 @@ function ms({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
|
|
|
3568
3574
|
(a.x !== g.xSnapped || a.y !== g.ySnapped) && s && d && (l = yo(e.sourceEvent, u), S(g));
|
|
3569
3575
|
}
|
|
3570
3576
|
}).on("end", (e) => {
|
|
3571
|
-
if (!
|
|
3577
|
+
if (!d || p) {
|
|
3578
|
+
p && s.size > 0 && t().updateNodePositions(s, !1);
|
|
3579
|
+
return;
|
|
3580
|
+
}
|
|
3581
|
+
if (c = !1, d = !1, cancelAnimationFrame(o), s.size > 0) {
|
|
3572
3582
|
let { nodeLookup: n, updateNodePositions: r, onNodeDragStop: a, onSelectionDragStop: o } = t();
|
|
3573
3583
|
if (m &&= (r(s, !1), !1), i || a || !b && o) {
|
|
3574
3584
|
let [t, r] = fs({
|
|
@@ -3878,11 +3888,7 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3878
3888
|
let l = {
|
|
3879
3889
|
isZoomingOrPanning: !1,
|
|
3880
3890
|
usedRightMouseButton: !1,
|
|
3881
|
-
prevViewport: {
|
|
3882
|
-
x: 0,
|
|
3883
|
-
y: 0,
|
|
3884
|
-
zoom: 0
|
|
3885
|
-
},
|
|
3891
|
+
prevViewport: {},
|
|
3886
3892
|
mouseButton: 0,
|
|
3887
3893
|
timerId: void 0,
|
|
3888
3894
|
panScrollTimeout: void 0,
|
|
@@ -3895,10 +3901,10 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3895
3901
|
}, [[0, 0], [u.width, u.height]], r);
|
|
3896
3902
|
let p = f.on("wheel.zoom"), m = f.on("dblclick.zoom");
|
|
3897
3903
|
d.wheelDelta(Ms);
|
|
3898
|
-
function h(e, t) {
|
|
3904
|
+
async function h(e, t) {
|
|
3899
3905
|
return f ? new Promise((n) => {
|
|
3900
3906
|
d?.interpolate(t?.interpolate === "linear" ? Qn : fr).transform(js(f, t?.duration, t?.ease, () => n(!0)), e);
|
|
3901
|
-
}) :
|
|
3907
|
+
}) : !1;
|
|
3902
3908
|
}
|
|
3903
3909
|
function g({ noWheelClassName: e, noPanClassName: t, onPaneContextMenu: n, userSelectionActive: r, panOnScroll: i, panOnDrag: u, panOnScrollMode: h, panOnScrollSpeed: g, preventScrolling: v, zoomOnPinch: y, zoomOnScroll: b, zoomOnDoubleClick: x, zoomActivationKeyPressed: S, lib: C, onTransformChange: w, connectionInProgress: T, paneClickDistance: E, selectionOnDrag: D }) {
|
|
3904
3910
|
r && !l.isZoomingOrPanning && _();
|
|
@@ -3920,32 +3926,31 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3920
3926
|
preventScrolling: v,
|
|
3921
3927
|
d3ZoomHandler: p
|
|
3922
3928
|
});
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
let A = Rs({
|
|
3929
|
+
f.on("wheel.zoom", k, { passive: !1 });
|
|
3930
|
+
let A = Fs({
|
|
3931
|
+
zoomPanValues: l,
|
|
3932
|
+
onDraggingChange: c,
|
|
3933
|
+
onPanZoomStart: o
|
|
3934
|
+
});
|
|
3935
|
+
d.on("start", A);
|
|
3936
|
+
let j = Is({
|
|
3937
|
+
zoomPanValues: l,
|
|
3938
|
+
panOnDrag: u,
|
|
3939
|
+
onPaneContextMenu: !!n,
|
|
3940
|
+
onPanZoom: a,
|
|
3941
|
+
onTransformChange: w
|
|
3942
|
+
});
|
|
3943
|
+
d.on("zoom", j);
|
|
3944
|
+
let M = Ls({
|
|
3945
|
+
zoomPanValues: l,
|
|
3946
|
+
panOnDrag: u,
|
|
3947
|
+
panOnScroll: i,
|
|
3948
|
+
onPaneContextMenu: n,
|
|
3949
|
+
onPanZoomEnd: s,
|
|
3950
|
+
onDraggingChange: c
|
|
3951
|
+
});
|
|
3952
|
+
d.on("end", M);
|
|
3953
|
+
let N = Rs({
|
|
3949
3954
|
zoomActivationKeyPressed: S,
|
|
3950
3955
|
panOnDrag: u,
|
|
3951
3956
|
zoomOnScroll: b,
|
|
@@ -3958,18 +3963,18 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3958
3963
|
lib: C,
|
|
3959
3964
|
connectionInProgress: T
|
|
3960
3965
|
});
|
|
3961
|
-
d.filter(
|
|
3966
|
+
d.filter(N), x ? f.on("dblclick.zoom", m) : f.on("dblclick.zoom", null);
|
|
3962
3967
|
}
|
|
3963
3968
|
function _() {
|
|
3964
3969
|
d.on("zoom", null);
|
|
3965
3970
|
}
|
|
3966
3971
|
async function v(e, t, n) {
|
|
3967
3972
|
let r = Ds(e), i = d?.constrain()(r, t, n);
|
|
3968
|
-
return i && await h(i),
|
|
3973
|
+
return i && await h(i), i;
|
|
3969
3974
|
}
|
|
3970
3975
|
async function y(e, t) {
|
|
3971
3976
|
let n = Ds(e);
|
|
3972
|
-
return await h(n, t),
|
|
3977
|
+
return await h(n, t), n;
|
|
3973
3978
|
}
|
|
3974
3979
|
function b(e) {
|
|
3975
3980
|
if (f) {
|
|
@@ -3989,15 +3994,15 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
|
|
|
3989
3994
|
zoom: e.k
|
|
3990
3995
|
};
|
|
3991
3996
|
}
|
|
3992
|
-
function S(e, t) {
|
|
3997
|
+
async function S(e, t) {
|
|
3993
3998
|
return f ? new Promise((n) => {
|
|
3994
3999
|
d?.interpolate(t?.interpolate === "linear" ? Qn : fr).scaleTo(js(f, t?.duration, t?.ease, () => n(!0)), e);
|
|
3995
|
-
}) :
|
|
4000
|
+
}) : !1;
|
|
3996
4001
|
}
|
|
3997
|
-
function C(e, t) {
|
|
4002
|
+
async function C(e, t) {
|
|
3998
4003
|
return f ? new Promise((n) => {
|
|
3999
4004
|
d?.interpolate(t?.interpolate === "linear" ? Qn : fr).scaleBy(js(f, t?.duration, t?.ease, () => n(!0)), e);
|
|
4000
|
-
}) :
|
|
4005
|
+
}) : !1;
|
|
4001
4006
|
}
|
|
4002
4007
|
function w(e) {
|
|
4003
4008
|
d?.scaleExtent(e);
|
|
@@ -4105,14 +4110,11 @@ var Js = {
|
|
|
4105
4110
|
pointerY: 0,
|
|
4106
4111
|
aspectRatio: 1
|
|
4107
4112
|
};
|
|
4108
|
-
function Xs(e) {
|
|
4109
|
-
return [[0, 0], [e.measured.width, e.measured.height]];
|
|
4110
|
-
}
|
|
4111
|
-
function Zs(e, t, n) {
|
|
4113
|
+
function Xs(e, t, n) {
|
|
4112
4114
|
let r = t.position.x + e.position.x, i = t.position.y + e.position.y, a = e.measured.width ?? 0, o = e.measured.height ?? 0, s = n[0] * a, c = n[1] * o;
|
|
4113
4115
|
return [[r - s, i - c], [r + a - s, i + o - c]];
|
|
4114
4116
|
}
|
|
4115
|
-
function
|
|
4117
|
+
function Zs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i }) {
|
|
4116
4118
|
let a = K(e), o = {
|
|
4117
4119
|
controlDirection: Hs("bottom-right"),
|
|
4118
4120
|
boundaries: {
|
|
@@ -4152,13 +4154,13 @@ function Qs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i })
|
|
|
4152
4154
|
pointerX: l,
|
|
4153
4155
|
pointerY: d,
|
|
4154
4156
|
aspectRatio: m.width / m.height
|
|
4155
|
-
}, y = void 0, g.parentId && (g.extent === "parent" || g.expandParent) && (y = r.get(g.parentId),
|
|
4157
|
+
}, y = void 0, b = ao(g.extent) ? g.extent : void 0, g.parentId && (g.extent === "parent" || g.expandParent) && (y = r.get(g.parentId)), y && g.extent === "parent" && (b = [[0, 0], [y.measured.width, y.measured.height]]), v = [], x = void 0;
|
|
4156
4158
|
for (let [e, n] of r) if (n.parentId === t && (v.push({
|
|
4157
4159
|
id: e,
|
|
4158
4160
|
position: { ...n.position },
|
|
4159
4161
|
extent: n.extent
|
|
4160
4162
|
}), n.extent === "parent" || n.expandParent)) {
|
|
4161
|
-
let e =
|
|
4163
|
+
let e = Xs(n, g, n.origin ?? s);
|
|
4162
4164
|
x = x ? [[Math.min(e[0][0], x[0][0]), Math.min(e[0][1], x[0][1])], [Math.max(e[1][0], x[1][0]), Math.max(e[1][1], x[1][1])]] : e;
|
|
4163
4165
|
}
|
|
4164
4166
|
u?.(e, { ...m });
|
|
@@ -4212,11 +4214,11 @@ function Qs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i })
|
|
|
4212
4214
|
}
|
|
4213
4215
|
//#endregion
|
|
4214
4216
|
//#region src/shims/use-sync-external-store-shim-with-selector.ts
|
|
4215
|
-
function
|
|
4217
|
+
function Qs(e, t) {
|
|
4216
4218
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
4217
4219
|
}
|
|
4218
|
-
var
|
|
4219
|
-
function
|
|
4220
|
+
var $s = typeof Object.is == "function" ? Object.is : Qs;
|
|
4221
|
+
function ec(e, t, n, r, i) {
|
|
4220
4222
|
let a = d(null);
|
|
4221
4223
|
a.current === null && (a.current = {
|
|
4222
4224
|
hasValue: !1,
|
|
@@ -4234,7 +4236,7 @@ function tc(e, t, n, r, i) {
|
|
|
4234
4236
|
return s = n, n;
|
|
4235
4237
|
}
|
|
4236
4238
|
let n = s;
|
|
4237
|
-
if (
|
|
4239
|
+
if ($s(a, t)) return n;
|
|
4238
4240
|
let c = r(t);
|
|
4239
4241
|
return i !== void 0 && i(n, c) ? (a = t, n) : (a = t, s = c, c);
|
|
4240
4242
|
};
|
|
@@ -4249,7 +4251,7 @@ function tc(e, t, n, r, i) {
|
|
|
4249
4251
|
o.hasValue = !0, o.value = m;
|
|
4250
4252
|
}, [m]), s(m), m;
|
|
4251
4253
|
}
|
|
4252
|
-
var
|
|
4254
|
+
var tc = { useSyncExternalStoreWithSelector: ec }, nc = (e) => {
|
|
4253
4255
|
let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
|
|
4254
4256
|
let i = typeof e == "function" ? e(t) : e;
|
|
4255
4257
|
if (!Object.is(i, t)) {
|
|
@@ -4266,15 +4268,15 @@ var nc = { useSyncExternalStoreWithSelector: tc }, rc = (e) => {
|
|
|
4266
4268
|
}
|
|
4267
4269
|
}, o = t = e(r, i, a);
|
|
4268
4270
|
return a;
|
|
4269
|
-
},
|
|
4270
|
-
function
|
|
4271
|
-
let r =
|
|
4272
|
-
return
|
|
4271
|
+
}, rc = (e) => e ? nc(e) : nc, { useDebugValue: ic } = e, { useSyncExternalStoreWithSelector: ac } = tc, oc = (e) => e;
|
|
4272
|
+
function sc(e, t = oc, n) {
|
|
4273
|
+
let r = ac(e.subscribe, e.getState, e.getServerState || e.getInitialState, t, n);
|
|
4274
|
+
return ic(r), r;
|
|
4273
4275
|
}
|
|
4274
|
-
var
|
|
4275
|
-
let n =
|
|
4276
|
+
var cc = (e, t) => {
|
|
4277
|
+
let n = rc(e), r = (e, r = t) => sc(n, e, r);
|
|
4276
4278
|
return Object.assign(r, n), r;
|
|
4277
|
-
},
|
|
4279
|
+
}, lc = (e, t) => e ? cc(e, t) : cc;
|
|
4278
4280
|
//#endregion
|
|
4279
4281
|
//#region node_modules/zustand/esm/shallow.mjs
|
|
4280
4282
|
function X(e, t) {
|
|
@@ -4297,22 +4299,22 @@ function X(e, t) {
|
|
|
4297
4299
|
}
|
|
4298
4300
|
//#endregion
|
|
4299
4301
|
//#region node_modules/@xyflow/react/dist/esm/index.js
|
|
4300
|
-
var
|
|
4302
|
+
var uc = t(null), dc = uc.Provider, fc = J.error001("react");
|
|
4301
4303
|
function Z(e, t) {
|
|
4302
|
-
let n = o(
|
|
4303
|
-
if (n === null) throw Error(
|
|
4304
|
-
return
|
|
4304
|
+
let n = o(uc);
|
|
4305
|
+
if (n === null) throw Error(fc);
|
|
4306
|
+
return sc(n, e, t);
|
|
4305
4307
|
}
|
|
4306
4308
|
function Q() {
|
|
4307
|
-
let e = o(
|
|
4308
|
-
if (e === null) throw Error(
|
|
4309
|
+
let e = o(uc);
|
|
4310
|
+
if (e === null) throw Error(fc);
|
|
4309
4311
|
return u(() => ({
|
|
4310
4312
|
getState: e.getState,
|
|
4311
4313
|
setState: e.setState,
|
|
4312
4314
|
subscribe: e.subscribe
|
|
4313
4315
|
}), [e]);
|
|
4314
4316
|
}
|
|
4315
|
-
var
|
|
4317
|
+
var pc = { display: "none" }, mc = {
|
|
4316
4318
|
position: "absolute",
|
|
4317
4319
|
width: 1,
|
|
4318
4320
|
height: 1,
|
|
@@ -4322,34 +4324,34 @@ var mc = { display: "none" }, hc = {
|
|
|
4322
4324
|
overflow: "hidden",
|
|
4323
4325
|
clip: "rect(0px, 0px, 0px, 0px)",
|
|
4324
4326
|
clipPath: "inset(100%)"
|
|
4325
|
-
},
|
|
4326
|
-
function
|
|
4327
|
-
let t = Z(
|
|
4327
|
+
}, hc = "react-flow__node-desc", gc = "react-flow__edge-desc", _c = "react-flow__aria-live", vc = (e) => e.ariaLiveMessage, yc = (e) => e.ariaLabelConfig;
|
|
4328
|
+
function bc({ rfId: e }) {
|
|
4329
|
+
let t = Z(vc);
|
|
4328
4330
|
return g("div", {
|
|
4329
|
-
id: `${
|
|
4331
|
+
id: `${_c}-${e}`,
|
|
4330
4332
|
"aria-live": "assertive",
|
|
4331
4333
|
"aria-atomic": "true",
|
|
4332
|
-
style:
|
|
4334
|
+
style: mc,
|
|
4333
4335
|
children: t
|
|
4334
4336
|
});
|
|
4335
4337
|
}
|
|
4336
|
-
function
|
|
4337
|
-
let n = Z(
|
|
4338
|
+
function xc({ rfId: e, disableKeyboardA11y: t }) {
|
|
4339
|
+
let n = Z(yc);
|
|
4338
4340
|
return _(h, { children: [
|
|
4339
4341
|
g("div", {
|
|
4340
|
-
id: `${
|
|
4341
|
-
style:
|
|
4342
|
+
id: `${hc}-${e}`,
|
|
4343
|
+
style: pc,
|
|
4342
4344
|
children: t ? n["node.a11yDescription.default"] : n["node.a11yDescription.keyboardDisabled"]
|
|
4343
4345
|
}),
|
|
4344
4346
|
g("div", {
|
|
4345
|
-
id: `${
|
|
4346
|
-
style:
|
|
4347
|
+
id: `${gc}-${e}`,
|
|
4348
|
+
style: pc,
|
|
4347
4349
|
children: n["edge.a11yDescription.default"]
|
|
4348
4350
|
}),
|
|
4349
|
-
!t && g(
|
|
4351
|
+
!t && g(bc, { rfId: e })
|
|
4350
4352
|
] });
|
|
4351
4353
|
}
|
|
4352
|
-
var
|
|
4354
|
+
var Sc = r(({ position: e = "top-left", children: t, className: n, style: r, ...i }, a) => g("div", {
|
|
4353
4355
|
className: S([
|
|
4354
4356
|
"react-flow__panel",
|
|
4355
4357
|
n,
|
|
@@ -4360,9 +4362,9 @@ var Cc = r(({ position: e = "top-left", children: t, className: n, style: r, ...
|
|
|
4360
4362
|
...i,
|
|
4361
4363
|
children: t
|
|
4362
4364
|
}));
|
|
4363
|
-
|
|
4364
|
-
function
|
|
4365
|
-
return e?.hideAttribution ? null : g(
|
|
4365
|
+
Sc.displayName = "Panel";
|
|
4366
|
+
function Cc({ proOptions: e, position: t = "bottom-right" }) {
|
|
4367
|
+
return e?.hideAttribution ? null : g(Sc, {
|
|
4366
4368
|
position: t,
|
|
4367
4369
|
className: "react-flow__attribution",
|
|
4368
4370
|
"data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",
|
|
@@ -4375,7 +4377,7 @@ function wc({ proOptions: e, position: t = "bottom-right" }) {
|
|
|
4375
4377
|
})
|
|
4376
4378
|
});
|
|
4377
4379
|
}
|
|
4378
|
-
var
|
|
4380
|
+
var wc = (e) => {
|
|
4379
4381
|
let t = [], n = [];
|
|
4380
4382
|
for (let [, n] of e.nodeLookup) n.selected && t.push(n.internals.userNode);
|
|
4381
4383
|
for (let [, t] of e.edgeLookup) t.selected && n.push(t);
|
|
@@ -4383,12 +4385,12 @@ var Tc = (e) => {
|
|
|
4383
4385
|
selectedNodes: t,
|
|
4384
4386
|
selectedEdges: n
|
|
4385
4387
|
};
|
|
4386
|
-
},
|
|
4387
|
-
function
|
|
4388
|
-
return X(e.selectedNodes.map(
|
|
4388
|
+
}, Tc = (e) => e.id;
|
|
4389
|
+
function Ec(e, t) {
|
|
4390
|
+
return X(e.selectedNodes.map(Tc), t.selectedNodes.map(Tc)) && X(e.selectedEdges.map(Tc), t.selectedEdges.map(Tc));
|
|
4389
4391
|
}
|
|
4390
|
-
function
|
|
4391
|
-
let t = Q(), { selectedNodes: n, selectedEdges: r } = Z(
|
|
4392
|
+
function Dc({ onSelectionChange: e }) {
|
|
4393
|
+
let t = Q(), { selectedNodes: n, selectedEdges: r } = Z(wc, Ec);
|
|
4392
4394
|
return c(() => {
|
|
4393
4395
|
let i = {
|
|
4394
4396
|
nodes: n,
|
|
@@ -4401,16 +4403,16 @@ function Oc({ onSelectionChange: e }) {
|
|
|
4401
4403
|
e
|
|
4402
4404
|
]), null;
|
|
4403
4405
|
}
|
|
4404
|
-
var
|
|
4405
|
-
function
|
|
4406
|
-
let t = Z(
|
|
4407
|
-
return e || t ? g(
|
|
4406
|
+
var Oc = (e) => !!e.onSelectionChangeHandlers;
|
|
4407
|
+
function kc({ onSelectionChange: e }) {
|
|
4408
|
+
let t = Z(Oc);
|
|
4409
|
+
return e || t ? g(Dc, { onSelectionChange: e }) : null;
|
|
4408
4410
|
}
|
|
4409
|
-
var
|
|
4411
|
+
var Ac = [0, 0], jc = {
|
|
4410
4412
|
x: 0,
|
|
4411
4413
|
y: 0,
|
|
4412
4414
|
zoom: 1
|
|
4413
|
-
},
|
|
4415
|
+
}, Mc = [.../* @__PURE__ */ "nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode".split("."), "rfId"], Nc = (e) => ({
|
|
4414
4416
|
setNodes: e.setNodes,
|
|
4415
4417
|
setEdges: e.setEdges,
|
|
4416
4418
|
setMinZoom: e.setMinZoom,
|
|
@@ -4419,48 +4421,48 @@ var jc = [0, 0], Mc = {
|
|
|
4419
4421
|
setNodeExtent: e.setNodeExtent,
|
|
4420
4422
|
reset: e.reset,
|
|
4421
4423
|
setDefaultNodesAndEdges: e.setDefaultNodesAndEdges
|
|
4422
|
-
}),
|
|
4424
|
+
}), Pc = {
|
|
4423
4425
|
translateExtent: pa,
|
|
4424
|
-
nodeOrigin:
|
|
4426
|
+
nodeOrigin: Ac,
|
|
4425
4427
|
minZoom: .5,
|
|
4426
4428
|
maxZoom: 2,
|
|
4427
4429
|
elementsSelectable: !0,
|
|
4428
4430
|
noPanClassName: "nopan",
|
|
4429
4431
|
rfId: "1"
|
|
4430
4432
|
};
|
|
4431
|
-
function
|
|
4432
|
-
let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: l } = Z(
|
|
4433
|
+
function Fc(e) {
|
|
4434
|
+
let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: l } = Z(Nc, X), u = Q();
|
|
4433
4435
|
c(() => (l(e.defaultNodes, e.defaultEdges), () => {
|
|
4434
|
-
f.current =
|
|
4436
|
+
f.current = Pc, s();
|
|
4435
4437
|
}), []);
|
|
4436
|
-
let f = d(
|
|
4438
|
+
let f = d(Pc);
|
|
4437
4439
|
return c(() => {
|
|
4438
|
-
for (let s of
|
|
4440
|
+
for (let s of Mc) {
|
|
4439
4441
|
let c = e[s];
|
|
4440
4442
|
c !== f.current[s] && e[s] !== void 0 && (s === "nodes" ? t(c) : s === "edges" ? n(c) : s === "minZoom" ? r(c) : s === "maxZoom" ? i(c) : s === "translateExtent" ? a(c) : s === "nodeExtent" ? o(c) : s === "ariaLabelConfig" ? u.setState({ ariaLabelConfig: fo(c) }) : s === "fitView" ? u.setState({ fitViewQueued: c }) : s === "fitViewOptions" ? u.setState({ fitViewOptions: c }) : u.setState({ [s]: c }));
|
|
4441
4443
|
}
|
|
4442
4444
|
f.current = e;
|
|
4443
|
-
},
|
|
4445
|
+
}, Mc.map((t) => e[t])), null;
|
|
4444
4446
|
}
|
|
4445
|
-
function
|
|
4447
|
+
function Ic() {
|
|
4446
4448
|
return typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)");
|
|
4447
4449
|
}
|
|
4448
|
-
function
|
|
4450
|
+
function Lc(e) {
|
|
4449
4451
|
let [t, n] = f(e === "system" ? null : e);
|
|
4450
4452
|
return c(() => {
|
|
4451
4453
|
if (e !== "system") {
|
|
4452
4454
|
n(e);
|
|
4453
4455
|
return;
|
|
4454
4456
|
}
|
|
4455
|
-
let t =
|
|
4457
|
+
let t = Ic(), r = () => n(t?.matches ? "dark" : "light");
|
|
4456
4458
|
return r(), t?.addEventListener("change", r), () => {
|
|
4457
4459
|
t?.removeEventListener("change", r);
|
|
4458
4460
|
};
|
|
4459
|
-
}, [e]), t === null ?
|
|
4461
|
+
}, [e]), t === null ? Ic()?.matches ? "dark" : "light" : t;
|
|
4460
4462
|
}
|
|
4461
|
-
var
|
|
4462
|
-
function
|
|
4463
|
-
target:
|
|
4463
|
+
var Rc = typeof document < "u" ? document : null;
|
|
4464
|
+
function zc(e = null, t = {
|
|
4465
|
+
target: Rc,
|
|
4464
4466
|
actInsideInputWithModifier: !0
|
|
4465
4467
|
}) {
|
|
4466
4468
|
let [n, r] = f(!1), i = d(!1), a = d(/* @__PURE__ */ new Set([])), [o, s] = u(() => {
|
|
@@ -4471,18 +4473,18 @@ function Bc(e = null, t = {
|
|
|
4471
4473
|
return [[], []];
|
|
4472
4474
|
}, [e]);
|
|
4473
4475
|
return c(() => {
|
|
4474
|
-
let n = t?.target ??
|
|
4476
|
+
let n = t?.target ?? Rc, c = t?.actInsideInputWithModifier ?? !0;
|
|
4475
4477
|
if (e !== null) {
|
|
4476
4478
|
let e = (e) => {
|
|
4477
4479
|
if (i.current = e.ctrlKey || e.metaKey || e.shiftKey || e.altKey, (!i.current || i.current && !c) && _o(e)) return !1;
|
|
4478
|
-
let n =
|
|
4479
|
-
if (a.current.add(e[n]),
|
|
4480
|
+
let n = Vc(e.code, s);
|
|
4481
|
+
if (a.current.add(e[n]), Bc(o, a.current, !1)) {
|
|
4480
4482
|
let n = e.composedPath?.()?.[0] || e.target, a = n?.nodeName === "BUTTON" || n?.nodeName === "A";
|
|
4481
4483
|
t.preventDefault !== !1 && (i.current || !a) && e.preventDefault(), r(!0);
|
|
4482
4484
|
}
|
|
4483
4485
|
}, l = (e) => {
|
|
4484
|
-
let t =
|
|
4485
|
-
|
|
4486
|
+
let t = Vc(e.code, s);
|
|
4487
|
+
Bc(o, a.current, !0) ? (r(!1), a.current.clear()) : a.current.delete(e[t]), e.key === "Meta" && a.current.clear(), i.current = !1;
|
|
4486
4488
|
}, u = () => {
|
|
4487
4489
|
a.current.clear(), r(!1);
|
|
4488
4490
|
};
|
|
@@ -4492,26 +4494,26 @@ function Bc(e = null, t = {
|
|
|
4492
4494
|
}
|
|
4493
4495
|
}, [e, r]), n;
|
|
4494
4496
|
}
|
|
4495
|
-
function
|
|
4497
|
+
function Bc(e, t, n) {
|
|
4496
4498
|
return e.filter((e) => n || e.length === t.size).some((e) => e.every((e) => t.has(e)));
|
|
4497
4499
|
}
|
|
4498
|
-
function
|
|
4500
|
+
function Vc(e, t) {
|
|
4499
4501
|
return t.includes(e) ? "code" : "key";
|
|
4500
4502
|
}
|
|
4501
|
-
var
|
|
4503
|
+
var Hc = () => {
|
|
4502
4504
|
let e = Q();
|
|
4503
4505
|
return u(() => ({
|
|
4504
|
-
zoomIn: (t) => {
|
|
4506
|
+
zoomIn: async (t) => {
|
|
4505
4507
|
let { panZoom: n } = e.getState();
|
|
4506
|
-
return n ? n.scaleBy(1.2,
|
|
4508
|
+
return n ? n.scaleBy(1.2, t) : !1;
|
|
4507
4509
|
},
|
|
4508
|
-
zoomOut: (t) => {
|
|
4510
|
+
zoomOut: async (t) => {
|
|
4509
4511
|
let { panZoom: n } = e.getState();
|
|
4510
|
-
return n ? n.scaleBy(1 / 1.2,
|
|
4512
|
+
return n ? n.scaleBy(1 / 1.2, t) : !1;
|
|
4511
4513
|
},
|
|
4512
|
-
zoomTo: (t, n) => {
|
|
4514
|
+
zoomTo: async (t, n) => {
|
|
4513
4515
|
let { panZoom: r } = e.getState();
|
|
4514
|
-
return r ? r.scaleTo(t,
|
|
4516
|
+
return r ? r.scaleTo(t, n) : !1;
|
|
4515
4517
|
},
|
|
4516
4518
|
getZoom: () => e.getState().transform[2],
|
|
4517
4519
|
setViewport: async (t, n) => {
|
|
@@ -4520,7 +4522,7 @@ var Uc = () => {
|
|
|
4520
4522
|
x: t.x ?? r,
|
|
4521
4523
|
y: t.y ?? i,
|
|
4522
4524
|
zoom: t.zoom ?? a
|
|
4523
|
-
}, n),
|
|
4525
|
+
}, n), !0) : !1;
|
|
4524
4526
|
},
|
|
4525
4527
|
getViewport: () => {
|
|
4526
4528
|
let [t, n, r] = e.getState().transform;
|
|
@@ -4537,7 +4539,7 @@ var Uc = () => {
|
|
|
4537
4539
|
duration: n?.duration,
|
|
4538
4540
|
ease: n?.ease,
|
|
4539
4541
|
interpolate: n?.interpolate
|
|
4540
|
-
}),
|
|
4542
|
+
}), !0) : !1;
|
|
4541
4543
|
},
|
|
4542
4544
|
screenToFlowPosition: (t, n = {}) => {
|
|
4543
4545
|
let { transform: r, snapGrid: i, snapToGrid: a, domNode: o } = e.getState();
|
|
@@ -4559,7 +4561,7 @@ var Uc = () => {
|
|
|
4559
4561
|
}
|
|
4560
4562
|
}), []);
|
|
4561
4563
|
};
|
|
4562
|
-
function
|
|
4564
|
+
function Uc(e, t) {
|
|
4563
4565
|
let n = [], r = /* @__PURE__ */ new Map(), i = [];
|
|
4564
4566
|
for (let t of e) if (t.type === "add") {
|
|
4565
4567
|
i.push(t);
|
|
@@ -4581,14 +4583,14 @@ function Wc(e, t) {
|
|
|
4581
4583
|
continue;
|
|
4582
4584
|
}
|
|
4583
4585
|
let i = { ...e };
|
|
4584
|
-
for (let e of t)
|
|
4586
|
+
for (let e of t) Wc(e, i);
|
|
4585
4587
|
n.push(i);
|
|
4586
4588
|
}
|
|
4587
4589
|
return i.length && i.forEach((e) => {
|
|
4588
4590
|
e.index === void 0 ? n.push({ ...e.item }) : n.splice(e.index, 0, { ...e.item });
|
|
4589
4591
|
}), n;
|
|
4590
4592
|
}
|
|
4591
|
-
function
|
|
4593
|
+
function Wc(e, t) {
|
|
4592
4594
|
switch (e.type) {
|
|
4593
4595
|
case "select":
|
|
4594
4596
|
t.selected = e.selected;
|
|
@@ -4601,28 +4603,28 @@ function Gc(e, t) {
|
|
|
4601
4603
|
break;
|
|
4602
4604
|
}
|
|
4603
4605
|
}
|
|
4606
|
+
function Gc(e, t) {
|
|
4607
|
+
return Uc(e, t);
|
|
4608
|
+
}
|
|
4604
4609
|
function Kc(e, t) {
|
|
4605
|
-
return
|
|
4610
|
+
return Uc(e, t);
|
|
4606
4611
|
}
|
|
4607
4612
|
function qc(e, t) {
|
|
4608
|
-
return Wc(e, t);
|
|
4609
|
-
}
|
|
4610
|
-
function Jc(e, t) {
|
|
4611
4613
|
return {
|
|
4612
4614
|
id: e,
|
|
4613
4615
|
type: "select",
|
|
4614
4616
|
selected: t
|
|
4615
4617
|
};
|
|
4616
4618
|
}
|
|
4617
|
-
function
|
|
4619
|
+
function Jc(e, t = /* @__PURE__ */ new Set(), n = !1) {
|
|
4618
4620
|
let r = [];
|
|
4619
4621
|
for (let [i, a] of e) {
|
|
4620
4622
|
let e = t.has(i);
|
|
4621
|
-
!(a.selected === void 0 && !e) && a.selected !== e && (n && (a.selected = e), r.push(
|
|
4623
|
+
!(a.selected === void 0 && !e) && a.selected !== e && (n && (a.selected = e), r.push(qc(a.id, e)));
|
|
4622
4624
|
}
|
|
4623
4625
|
return r;
|
|
4624
4626
|
}
|
|
4625
|
-
function
|
|
4627
|
+
function Yc({ items: e = [], lookup: t }) {
|
|
4626
4628
|
let n = [], r = new Map(e.map((e) => [e.id, e]));
|
|
4627
4629
|
for (let [r, i] of e.entries()) {
|
|
4628
4630
|
let e = t.get(i.id), a = e?.internals?.userNode ?? e;
|
|
@@ -4642,25 +4644,32 @@ function Xc({ items: e = [], lookup: t }) {
|
|
|
4642
4644
|
});
|
|
4643
4645
|
return n;
|
|
4644
4646
|
}
|
|
4645
|
-
function
|
|
4647
|
+
function Xc(e) {
|
|
4646
4648
|
return {
|
|
4647
4649
|
id: e.id,
|
|
4648
4650
|
type: "remove"
|
|
4649
4651
|
};
|
|
4650
4652
|
}
|
|
4651
|
-
var
|
|
4652
|
-
function
|
|
4653
|
+
var Zc = Xa("React Flow", "https://reactflow.dev/");
|
|
4654
|
+
function Qc(e, t, n = {}) {
|
|
4655
|
+
return Ao(e, t, {
|
|
4656
|
+
...n,
|
|
4657
|
+
onError: n.onError ?? Zc
|
|
4658
|
+
});
|
|
4659
|
+
}
|
|
4660
|
+
var $c = (e) => Ta(e), el = (e) => wa(e);
|
|
4661
|
+
function tl(e) {
|
|
4653
4662
|
return r(e);
|
|
4654
4663
|
}
|
|
4655
|
-
var
|
|
4656
|
-
function
|
|
4657
|
-
let [t, n] = f(BigInt(0)), [r] = f(() =>
|
|
4658
|
-
return
|
|
4664
|
+
var nl = typeof window < "u" ? l : c;
|
|
4665
|
+
function rl(e) {
|
|
4666
|
+
let [t, n] = f(BigInt(0)), [r] = f(() => il(() => n((e) => e + BigInt(1))));
|
|
4667
|
+
return nl(() => {
|
|
4659
4668
|
let t = r.get();
|
|
4660
4669
|
t.length && (e(t), r.reset());
|
|
4661
4670
|
}, [t]), r;
|
|
4662
4671
|
}
|
|
4663
|
-
function
|
|
4672
|
+
function il(e) {
|
|
4664
4673
|
let t = [];
|
|
4665
4674
|
return {
|
|
4666
4675
|
get: () => t,
|
|
@@ -4672,12 +4681,12 @@ function rl(e) {
|
|
|
4672
4681
|
}
|
|
4673
4682
|
};
|
|
4674
4683
|
}
|
|
4675
|
-
var
|
|
4676
|
-
function
|
|
4677
|
-
let t = Q(), n =
|
|
4684
|
+
var al = t(null);
|
|
4685
|
+
function ol({ children: e }) {
|
|
4686
|
+
let t = Q(), n = rl(a((e) => {
|
|
4678
4687
|
let { nodes: n = [], setNodes: r, hasDefaultNodes: i, onNodesChange: a, nodeLookup: o, fitViewQueued: s, onNodesChangeMiddlewareMap: c } = t.getState(), l = n;
|
|
4679
4688
|
for (let t of e) l = typeof t == "function" ? t(l) : t;
|
|
4680
|
-
let u =
|
|
4689
|
+
let u = Yc({
|
|
4681
4690
|
items: l,
|
|
4682
4691
|
lookup: o
|
|
4683
4692
|
});
|
|
@@ -4686,10 +4695,10 @@ function al({ children: e }) {
|
|
|
4686
4695
|
let { fitViewQueued: e, nodes: n, setNodes: r } = t.getState();
|
|
4687
4696
|
e && r(n);
|
|
4688
4697
|
});
|
|
4689
|
-
}, [])), r =
|
|
4698
|
+
}, [])), r = rl(a((e) => {
|
|
4690
4699
|
let { edges: n = [], setEdges: r, hasDefaultEdges: i, onEdgesChange: a, edgeLookup: o } = t.getState(), s = n;
|
|
4691
4700
|
for (let t of e) s = typeof t == "function" ? t(s) : t;
|
|
4692
|
-
i ? r(s) : a && a(
|
|
4701
|
+
i ? r(s) : a && a(Yc({
|
|
4693
4702
|
items: s,
|
|
4694
4703
|
lookup: o
|
|
4695
4704
|
}));
|
|
@@ -4697,25 +4706,25 @@ function al({ children: e }) {
|
|
|
4697
4706
|
nodeQueue: n,
|
|
4698
4707
|
edgeQueue: r
|
|
4699
4708
|
}), []);
|
|
4700
|
-
return g(
|
|
4709
|
+
return g(al.Provider, {
|
|
4701
4710
|
value: i,
|
|
4702
4711
|
children: e
|
|
4703
4712
|
});
|
|
4704
4713
|
}
|
|
4705
|
-
function
|
|
4706
|
-
let e = o(
|
|
4714
|
+
function sl() {
|
|
4715
|
+
let e = o(al);
|
|
4707
4716
|
if (!e) throw Error("useBatchContext must be used within a BatchProvider");
|
|
4708
4717
|
return e;
|
|
4709
4718
|
}
|
|
4710
|
-
var
|
|
4711
|
-
function
|
|
4712
|
-
let e =
|
|
4719
|
+
var cl = (e) => !!e.panZoom;
|
|
4720
|
+
function ll() {
|
|
4721
|
+
let e = Hc(), t = Q(), n = sl(), r = Z(cl), i = u(() => {
|
|
4713
4722
|
let e = (e) => t.getState().nodeLookup.get(e), r = (e) => {
|
|
4714
4723
|
n.nodeQueue.push(e);
|
|
4715
4724
|
}, i = (e) => {
|
|
4716
4725
|
n.edgeQueue.push(e);
|
|
4717
4726
|
}, a = (e) => {
|
|
4718
|
-
let { nodeLookup: n, nodeOrigin: r } = t.getState(), i =
|
|
4727
|
+
let { nodeLookup: n, nodeOrigin: r } = t.getState(), i = $c(e) ? e : n.get(e.id), a = i.parentId ? co(i.position, i.measured, i.parentId, n, r) : i.position;
|
|
4719
4728
|
return Wa({
|
|
4720
4729
|
...i,
|
|
4721
4730
|
position: a,
|
|
@@ -4726,7 +4735,7 @@ function cl() {
|
|
|
4726
4735
|
r((r) => r.map((r) => {
|
|
4727
4736
|
if (r.id === e) {
|
|
4728
4737
|
let e = typeof t == "function" ? t(r) : t;
|
|
4729
|
-
return n.replace &&
|
|
4738
|
+
return n.replace && $c(e) ? e : {
|
|
4730
4739
|
...r,
|
|
4731
4740
|
...e
|
|
4732
4741
|
};
|
|
@@ -4737,7 +4746,7 @@ function cl() {
|
|
|
4737
4746
|
i((r) => r.map((r) => {
|
|
4738
4747
|
if (r.id === e) {
|
|
4739
4748
|
let e = typeof t == "function" ? t(r) : t;
|
|
4740
|
-
return n.replace &&
|
|
4749
|
+
return n.replace && el(e) ? e : {
|
|
4741
4750
|
...r,
|
|
4742
4751
|
...e
|
|
4743
4752
|
};
|
|
@@ -4785,11 +4794,11 @@ function cl() {
|
|
|
4785
4794
|
onBeforeDelete: u
|
|
4786
4795
|
}), p = f.length > 0, m = d.length > 0;
|
|
4787
4796
|
if (p) {
|
|
4788
|
-
let e = f.map(
|
|
4797
|
+
let e = f.map(Xc);
|
|
4789
4798
|
o?.(f), c(e);
|
|
4790
4799
|
}
|
|
4791
4800
|
if (m) {
|
|
4792
|
-
let e = d.map(
|
|
4801
|
+
let e = d.map(Xc);
|
|
4793
4802
|
a?.(d), s(e);
|
|
4794
4803
|
}
|
|
4795
4804
|
return (m || p) && l?.({
|
|
@@ -4872,22 +4881,22 @@ function cl() {
|
|
|
4872
4881
|
viewportInitialized: r
|
|
4873
4882
|
}), [r]);
|
|
4874
4883
|
}
|
|
4875
|
-
var
|
|
4876
|
-
function
|
|
4877
|
-
let n = Q(), { deleteElements: r } =
|
|
4884
|
+
var ul = (e) => e.selected, dl = typeof window < "u" ? window : void 0;
|
|
4885
|
+
function fl({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
|
|
4886
|
+
let n = Q(), { deleteElements: r } = ll(), i = zc(e, { actInsideInputWithModifier: !1 }), a = zc(t, { target: dl });
|
|
4878
4887
|
c(() => {
|
|
4879
4888
|
if (i) {
|
|
4880
4889
|
let { edges: e, nodes: t } = n.getState();
|
|
4881
4890
|
r({
|
|
4882
|
-
nodes: t.filter(
|
|
4883
|
-
edges: e.filter(
|
|
4891
|
+
nodes: t.filter(ul),
|
|
4892
|
+
edges: e.filter(ul)
|
|
4884
4893
|
}), n.setState({ nodesSelectionActive: !1 });
|
|
4885
4894
|
}
|
|
4886
4895
|
}, [i]), c(() => {
|
|
4887
4896
|
n.setState({ multiSelectionActive: a });
|
|
4888
4897
|
}, [a]);
|
|
4889
4898
|
}
|
|
4890
|
-
function
|
|
4899
|
+
function pl(e) {
|
|
4891
4900
|
let t = Q();
|
|
4892
4901
|
c(() => {
|
|
4893
4902
|
let n = () => {
|
|
@@ -4907,20 +4916,20 @@ function fl(e) {
|
|
|
4907
4916
|
}
|
|
4908
4917
|
}, []);
|
|
4909
4918
|
}
|
|
4910
|
-
var
|
|
4919
|
+
var ml = {
|
|
4911
4920
|
position: "absolute",
|
|
4912
4921
|
width: "100%",
|
|
4913
4922
|
height: "100%",
|
|
4914
4923
|
top: 0,
|
|
4915
4924
|
left: 0
|
|
4916
|
-
},
|
|
4925
|
+
}, hl = (e) => ({
|
|
4917
4926
|
userSelectionActive: e.userSelectionActive,
|
|
4918
4927
|
lib: e.lib,
|
|
4919
4928
|
connectionInProgress: e.connection.inProgress
|
|
4920
4929
|
});
|
|
4921
|
-
function
|
|
4922
|
-
let T = Q(), E = d(null), { userSelectionActive: D, lib: O, connectionInProgress: k } = Z(
|
|
4923
|
-
|
|
4930
|
+
function gl({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: i = .5, panOnScrollMode: o = _a.Free, zoomOnDoubleClick: s = !0, panOnDrag: l = !0, defaultViewport: u, translateExtent: f, minZoom: p, maxZoom: m, zoomActivationKeyCode: h, preventScrolling: _ = !0, children: v, noWheelClassName: y, noPanClassName: b, onViewportChange: x, isControlledViewport: S, paneClickDistance: C, selectionOnDrag: w }) {
|
|
4931
|
+
let T = Q(), E = d(null), { userSelectionActive: D, lib: O, connectionInProgress: k } = Z(hl, X), A = zc(h), j = d();
|
|
4932
|
+
pl(E);
|
|
4924
4933
|
let M = a((e) => {
|
|
4925
4934
|
x?.({
|
|
4926
4935
|
x: e[0],
|
|
@@ -5006,16 +5015,16 @@ function hl({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
|
|
|
5006
5015
|
]), g("div", {
|
|
5007
5016
|
className: "react-flow__renderer",
|
|
5008
5017
|
ref: E,
|
|
5009
|
-
style:
|
|
5018
|
+
style: ml,
|
|
5010
5019
|
children: v
|
|
5011
5020
|
});
|
|
5012
5021
|
}
|
|
5013
|
-
var
|
|
5022
|
+
var _l = (e) => ({
|
|
5014
5023
|
userSelectionActive: e.userSelectionActive,
|
|
5015
5024
|
userSelectionRect: e.userSelectionRect
|
|
5016
5025
|
});
|
|
5017
|
-
function
|
|
5018
|
-
let { userSelectionActive: e, userSelectionRect: t } = Z(
|
|
5026
|
+
function vl() {
|
|
5027
|
+
let { userSelectionActive: e, userSelectionRect: t } = Z(_l, X);
|
|
5019
5028
|
return e && t ? g("div", {
|
|
5020
5029
|
className: "react-flow__selection react-flow__container",
|
|
5021
5030
|
style: {
|
|
@@ -5025,103 +5034,147 @@ function _l() {
|
|
|
5025
5034
|
}
|
|
5026
5035
|
}) : null;
|
|
5027
5036
|
}
|
|
5028
|
-
var
|
|
5037
|
+
var yl = (e, t) => (n) => {
|
|
5029
5038
|
n.target === t.current && e?.(n);
|
|
5030
|
-
},
|
|
5039
|
+
}, bl = (e) => ({
|
|
5031
5040
|
userSelectionActive: e.userSelectionActive,
|
|
5032
5041
|
elementsSelectable: e.elementsSelectable,
|
|
5033
5042
|
connectionInProgress: e.connection.inProgress,
|
|
5034
|
-
dragging: e.paneDragging
|
|
5043
|
+
dragging: e.paneDragging,
|
|
5044
|
+
panBy: e.panBy,
|
|
5045
|
+
autoPanSpeed: e.autoPanSpeed
|
|
5035
5046
|
});
|
|
5036
|
-
function
|
|
5037
|
-
let
|
|
5038
|
-
|
|
5039
|
-
|
|
5047
|
+
function xl({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = va.Full, panOnDrag: r, autoPanOnSelection: i, paneClickDistance: a, selectionOnDrag: o, onSelectionStart: s, onSelectionEnd: l, onPaneClick: u, onPaneContextMenu: f, onPaneScroll: p, onPaneMouseEnter: m, onPaneMouseMove: h, onPaneMouseLeave: v, children: y }) {
|
|
5048
|
+
let b = d(0), x = Q(), { userSelectionActive: C, elementsSelectable: w, dragging: T, connectionInProgress: E, panBy: D, autoPanSpeed: O } = Z(bl, X), k = w && (e || C), A = d(null), j = d(), M = d(/* @__PURE__ */ new Set()), N = d(/* @__PURE__ */ new Set()), P = d(!1), F = d({
|
|
5049
|
+
x: 0,
|
|
5050
|
+
y: 0
|
|
5051
|
+
}), I = d(!1), L = (e) => {
|
|
5052
|
+
if (P.current || E) {
|
|
5053
|
+
P.current = !1;
|
|
5040
5054
|
return;
|
|
5041
5055
|
}
|
|
5042
|
-
|
|
5043
|
-
},
|
|
5056
|
+
u?.(e), x.getState().resetSelectedElements(), x.setState({ nodesSelectionActive: !1 });
|
|
5057
|
+
}, R = (e) => {
|
|
5044
5058
|
if (Array.isArray(r) && r?.includes(2)) {
|
|
5045
5059
|
e.preventDefault();
|
|
5046
5060
|
return;
|
|
5047
5061
|
}
|
|
5048
|
-
|
|
5049
|
-
},
|
|
5050
|
-
|
|
5062
|
+
f?.(e);
|
|
5063
|
+
}, ee = p ? (e) => p(e) : void 0, z = (e) => {
|
|
5064
|
+
P.current &&= (e.stopPropagation(), !1);
|
|
5065
|
+
}, B = (n) => {
|
|
5066
|
+
let { domNode: r, transform: i } = x.getState();
|
|
5067
|
+
if (j.current = r?.getBoundingClientRect(), !j.current) return;
|
|
5068
|
+
let a = n.target === A.current;
|
|
5069
|
+
if (!a && n.target.closest(".nokey") || !e || !(o && a || t) || n.button !== 0 || !n.isPrimary) return;
|
|
5070
|
+
n.target?.setPointerCapture?.(n.pointerId), P.current = !1;
|
|
5071
|
+
let { x: s, y: c } = yo(n.nativeEvent, j.current), l = Qa({
|
|
5072
|
+
x: s,
|
|
5073
|
+
y: c
|
|
5074
|
+
}, i);
|
|
5075
|
+
x.setState({ userSelectionRect: {
|
|
5076
|
+
width: 0,
|
|
5077
|
+
height: 0,
|
|
5078
|
+
startX: l.x,
|
|
5079
|
+
startY: l.y,
|
|
5080
|
+
x: s,
|
|
5081
|
+
y: c
|
|
5082
|
+
} }), a || (n.stopPropagation(), n.preventDefault());
|
|
5083
|
+
};
|
|
5084
|
+
function V(e, t) {
|
|
5085
|
+
let { userSelectionRect: r } = x.getState();
|
|
5086
|
+
if (!r) return;
|
|
5087
|
+
let { transform: i, nodeLookup: a, edgeLookup: o, connectionLookup: s, triggerNodeChanges: c, triggerEdgeChanges: l, defaultEdgeOptions: u } = x.getState(), d = {
|
|
5088
|
+
x: r.startX,
|
|
5089
|
+
y: r.startY
|
|
5090
|
+
}, { x: f, y: p } = $a(d, i), m = {
|
|
5091
|
+
startX: d.x,
|
|
5092
|
+
startY: d.y,
|
|
5093
|
+
x: e < f ? e : f,
|
|
5094
|
+
y: t < p ? t : p,
|
|
5095
|
+
width: Math.abs(e - f),
|
|
5096
|
+
height: Math.abs(t - p)
|
|
5097
|
+
}, h = M.current, g = N.current;
|
|
5098
|
+
M.current = new Set(Aa(a, m, i, n === va.Partial, !0).map((e) => e.id)), N.current = /* @__PURE__ */ new Set();
|
|
5099
|
+
let _ = u?.selectable ?? !0;
|
|
5100
|
+
for (let e of M.current) {
|
|
5101
|
+
let t = s.get(e);
|
|
5102
|
+
if (t) for (let { edgeId: e } of t.values()) {
|
|
5103
|
+
let t = o.get(e);
|
|
5104
|
+
t && (t.selectable ?? _) && N.current.add(e);
|
|
5105
|
+
}
|
|
5106
|
+
}
|
|
5107
|
+
lo(h, M.current) || c(Jc(a, M.current, !0)), lo(g, N.current) || l(Jc(o, N.current)), x.setState({
|
|
5108
|
+
userSelectionRect: m,
|
|
5109
|
+
userSelectionActive: !0,
|
|
5110
|
+
nodesSelectionActive: !1
|
|
5111
|
+
});
|
|
5112
|
+
}
|
|
5113
|
+
function H() {
|
|
5114
|
+
if (!i || !j.current) return;
|
|
5115
|
+
let [e, t] = Ba(F.current, j.current, O);
|
|
5116
|
+
D({
|
|
5117
|
+
x: e,
|
|
5118
|
+
y: t
|
|
5119
|
+
}).then((e) => {
|
|
5120
|
+
if (!P.current || !e) {
|
|
5121
|
+
b.current = requestAnimationFrame(H);
|
|
5122
|
+
return;
|
|
5123
|
+
}
|
|
5124
|
+
let { x: t, y: n } = F.current;
|
|
5125
|
+
V(t, n), b.current = requestAnimationFrame(H);
|
|
5126
|
+
});
|
|
5127
|
+
}
|
|
5128
|
+
let U = () => {
|
|
5129
|
+
cancelAnimationFrame(b.current), b.current = 0, I.current = !1;
|
|
5130
|
+
};
|
|
5131
|
+
return c(() => () => U(), []), _("div", {
|
|
5051
5132
|
className: S(["react-flow__pane", {
|
|
5052
5133
|
draggable: r === !0 || Array.isArray(r) && r.includes(0),
|
|
5053
|
-
dragging:
|
|
5134
|
+
dragging: T,
|
|
5054
5135
|
selection: e
|
|
5055
5136
|
}]),
|
|
5056
|
-
onClick:
|
|
5057
|
-
onContextMenu:
|
|
5058
|
-
onWheel:
|
|
5059
|
-
onPointerEnter:
|
|
5060
|
-
onPointerMove:
|
|
5061
|
-
let { userSelectionRect:
|
|
5062
|
-
if (!
|
|
5063
|
-
let { x:
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
height: Math.abs(h - _)
|
|
5077
|
-
}, b = D.current, x = O.current;
|
|
5078
|
-
D.current = new Set(Aa(s, y, a, n === va.Partial, !0).map((e) => e.id)), O.current = /* @__PURE__ */ new Set();
|
|
5079
|
-
let S = f?.selectable ?? !0;
|
|
5080
|
-
for (let e of D.current) {
|
|
5081
|
-
let t = l.get(e);
|
|
5082
|
-
if (t) for (let { edgeId: e } of t.values()) {
|
|
5083
|
-
let t = c.get(e);
|
|
5084
|
-
t && (t.selectable ?? S) && O.current.add(e);
|
|
5085
|
-
}
|
|
5137
|
+
onClick: k ? void 0 : yl(L, A),
|
|
5138
|
+
onContextMenu: yl(R, A),
|
|
5139
|
+
onWheel: yl(ee, A),
|
|
5140
|
+
onPointerEnter: k ? void 0 : m,
|
|
5141
|
+
onPointerMove: k ? (e) => {
|
|
5142
|
+
let { userSelectionRect: n, transform: r, resetSelectedElements: i } = x.getState();
|
|
5143
|
+
if (!j.current || !n) return;
|
|
5144
|
+
let { x: o, y: c } = yo(e.nativeEvent, j.current);
|
|
5145
|
+
F.current = {
|
|
5146
|
+
x: o,
|
|
5147
|
+
y: c
|
|
5148
|
+
};
|
|
5149
|
+
let l = $a({
|
|
5150
|
+
x: n.startX,
|
|
5151
|
+
y: n.startY
|
|
5152
|
+
}, r);
|
|
5153
|
+
if (!P.current) {
|
|
5154
|
+
let n = t ? 0 : a;
|
|
5155
|
+
if (Math.hypot(o - l.x, c - l.y) <= n) return;
|
|
5156
|
+
i(), s?.(e);
|
|
5086
5157
|
}
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
});
|
|
5092
|
-
} : p,
|
|
5093
|
-
onPointerUp: w ? (e) => {
|
|
5094
|
-
e.button === 0 && (e.target?.releasePointerCapture?.(e.pointerId), !y && e.target === T.current && v.getState().userSelectionRect && A?.(e), v.setState({
|
|
5158
|
+
P.current = !0, I.current ||= (H(), !0), V(o, c);
|
|
5159
|
+
} : h,
|
|
5160
|
+
onPointerUp: k ? (e) => {
|
|
5161
|
+
e.button === 0 && (e.target?.releasePointerCapture?.(e.pointerId), !C && e.target === A.current && x.getState().userSelectionRect && L?.(e), x.setState({
|
|
5095
5162
|
userSelectionActive: !1,
|
|
5096
5163
|
userSelectionRect: null
|
|
5097
|
-
}),
|
|
5164
|
+
}), P.current && (l?.(e), x.setState({ nodesSelectionActive: M.current.size > 0 })), U());
|
|
5098
5165
|
} : void 0,
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
if (E.current = r?.getBoundingClientRect(), !E.current) return;
|
|
5102
|
-
let i = n.target === T.current;
|
|
5103
|
-
if (!i && n.target.closest(".nokey") || !e || !(a && i || t) || n.button !== 0 || !n.isPrimary) return;
|
|
5104
|
-
n.target?.setPointerCapture?.(n.pointerId), k.current = !1;
|
|
5105
|
-
let { x: o, y: s } = yo(n.nativeEvent, E.current);
|
|
5106
|
-
v.setState({ userSelectionRect: {
|
|
5107
|
-
width: 0,
|
|
5108
|
-
height: 0,
|
|
5109
|
-
startX: o,
|
|
5110
|
-
startY: s,
|
|
5111
|
-
x: o,
|
|
5112
|
-
y: s
|
|
5113
|
-
} }), i || (n.stopPropagation(), n.preventDefault());
|
|
5114
|
-
} : void 0,
|
|
5115
|
-
onClickCapture: w ? (e) => {
|
|
5116
|
-
k.current &&= (e.stopPropagation(), !1);
|
|
5166
|
+
onPointerCancel: k ? (e) => {
|
|
5167
|
+
e.target?.releasePointerCapture?.(e.pointerId), U();
|
|
5117
5168
|
} : void 0,
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5169
|
+
onPointerDownCapture: k ? B : void 0,
|
|
5170
|
+
onClickCapture: k ? z : void 0,
|
|
5171
|
+
onPointerLeave: v,
|
|
5172
|
+
ref: A,
|
|
5173
|
+
style: ml,
|
|
5174
|
+
children: [y, g(vl, {})]
|
|
5122
5175
|
});
|
|
5123
5176
|
}
|
|
5124
|
-
function
|
|
5177
|
+
function Sl({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
|
|
5125
5178
|
let { addSelectedNodes: i, unselectNodesAndEdges: a, multiSelectionActive: o, nodeLookup: s, onError: c } = t.getState(), l = s.get(e);
|
|
5126
5179
|
if (!l) {
|
|
5127
5180
|
c?.("012", J.error012(e));
|
|
@@ -5132,13 +5185,13 @@ function xl({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
|
|
|
5132
5185
|
edges: []
|
|
5133
5186
|
}), requestAnimationFrame(() => r?.current?.blur())) : i([e]);
|
|
5134
5187
|
}
|
|
5135
|
-
function
|
|
5188
|
+
function Cl({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector: r, nodeId: i, isSelectable: a, nodeClickDistance: o }) {
|
|
5136
5189
|
let s = Q(), [l, u] = f(!1), p = d();
|
|
5137
5190
|
return c(() => {
|
|
5138
5191
|
p.current = ms({
|
|
5139
5192
|
getStoreItems: () => s.getState(),
|
|
5140
5193
|
onNodeMouseDown: (t) => {
|
|
5141
|
-
|
|
5194
|
+
Sl({
|
|
5142
5195
|
id: t,
|
|
5143
5196
|
store: s,
|
|
5144
5197
|
nodeRef: e
|
|
@@ -5172,11 +5225,11 @@ function Sl({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector:
|
|
|
5172
5225
|
o
|
|
5173
5226
|
]), l;
|
|
5174
5227
|
}
|
|
5175
|
-
var
|
|
5176
|
-
function
|
|
5228
|
+
var wl = (e) => (t) => t.selected && (t.draggable || e && t.draggable === void 0);
|
|
5229
|
+
function Tl() {
|
|
5177
5230
|
let e = Q();
|
|
5178
5231
|
return a((t) => {
|
|
5179
|
-
let { nodeExtent: n, snapToGrid: r, snapGrid: i, nodesDraggable: a, onError: o, updateNodePositions: s, nodeLookup: c, nodeOrigin: l } = e.getState(), u = /* @__PURE__ */ new Map(), d =
|
|
5232
|
+
let { nodeExtent: n, snapToGrid: r, snapGrid: i, nodesDraggable: a, onError: o, updateNodePositions: s, nodeLookup: c, nodeOrigin: l } = e.getState(), u = /* @__PURE__ */ new Map(), d = wl(a), f = r ? i[0] : 5, p = r ? i[1] : 5, m = t.direction.x * f * t.factor, h = t.direction.y * p * t.factor;
|
|
5180
5233
|
for (let [, e] of c) {
|
|
5181
5234
|
if (!d(e)) continue;
|
|
5182
5235
|
let t = {
|
|
@@ -5197,13 +5250,13 @@ function wl() {
|
|
|
5197
5250
|
s(u);
|
|
5198
5251
|
}, []);
|
|
5199
5252
|
}
|
|
5200
|
-
var
|
|
5201
|
-
|
|
5202
|
-
var
|
|
5253
|
+
var El = t(null), Dl = El.Provider;
|
|
5254
|
+
El.Consumer;
|
|
5255
|
+
var Ol = () => o(El), kl = (e) => ({
|
|
5203
5256
|
connectOnClick: e.connectOnClick,
|
|
5204
5257
|
noPanClassName: e.noPanClassName,
|
|
5205
5258
|
rfId: e.rfId
|
|
5206
|
-
}),
|
|
5259
|
+
}), Al = (e, t, n) => (r) => {
|
|
5207
5260
|
let { connectionClickStartHandle: i, connectionMode: a, connection: o } = r, { fromHandle: s, toHandle: c, isValid: l } = o, u = c?.nodeId === e && c?.id === t && c?.type === n;
|
|
5208
5261
|
return {
|
|
5209
5262
|
connectingFrom: s?.nodeId === e && s?.id === t && s?.type === n,
|
|
@@ -5215,8 +5268,8 @@ var Dl = () => o(Tl), Ol = (e) => ({
|
|
|
5215
5268
|
valid: u && l
|
|
5216
5269
|
};
|
|
5217
5270
|
};
|
|
5218
|
-
function
|
|
5219
|
-
let m = o || null, h = e === "target", _ = Q(), v =
|
|
5271
|
+
function jl({ type: e = "source", position: t = Y.Top, isValidConnection: n, isConnectable: r = !0, isConnectableStart: i = !0, isConnectableEnd: a = !0, id: o, onConnect: s, children: c, className: l, onMouseDown: u, onTouchStart: d, ...f }, p) {
|
|
5272
|
+
let m = o || null, h = e === "target", _ = Q(), v = Ol(), { connectOnClick: y, noPanClassName: b, rfId: x } = Z(kl, X), { connectingFrom: C, connectingTo: w, clickConnecting: T, isPossibleEndHandle: E, connectionInProcess: D, clickConnectionInProcess: O, valid: k } = Z(Al(v, m, e), X);
|
|
5220
5273
|
v || _.getState().onError?.("010", J.error010());
|
|
5221
5274
|
let A = (e) => {
|
|
5222
5275
|
let { defaultEdgeOptions: t, onConnect: n, hasDefaultEdges: r } = _.getState(), i = {
|
|
@@ -5224,8 +5277,8 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
|
|
|
5224
5277
|
...e
|
|
5225
5278
|
};
|
|
5226
5279
|
if (r) {
|
|
5227
|
-
let { edges: e, setEdges: t } = _.getState();
|
|
5228
|
-
t(
|
|
5280
|
+
let { edges: e, setEdges: t, onError: n } = _.getState();
|
|
5281
|
+
t(Qc(i, e, { onError: n }));
|
|
5229
5282
|
}
|
|
5230
5283
|
n?.(i), s?.(i);
|
|
5231
5284
|
}, j = (e) => {
|
|
@@ -5259,40 +5312,6 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
|
|
|
5259
5312
|
});
|
|
5260
5313
|
}
|
|
5261
5314
|
t ? u?.(e) : d?.(e);
|
|
5262
|
-
}, M = (t) => {
|
|
5263
|
-
let { onClickConnectStart: r, onClickConnectEnd: a, connectionClickStartHandle: o, connectionMode: s, isValidConnection: c, lib: l, rfId: u, nodeLookup: d, connection: f } = _.getState();
|
|
5264
|
-
if (!v || !o && !i) return;
|
|
5265
|
-
if (!o) {
|
|
5266
|
-
r?.(t.nativeEvent, {
|
|
5267
|
-
nodeId: v,
|
|
5268
|
-
handleId: m,
|
|
5269
|
-
handleType: e
|
|
5270
|
-
}), _.setState({ connectionClickStartHandle: {
|
|
5271
|
-
nodeId: v,
|
|
5272
|
-
type: e,
|
|
5273
|
-
id: m
|
|
5274
|
-
} });
|
|
5275
|
-
return;
|
|
5276
|
-
}
|
|
5277
|
-
let p = ho(t.target), h = n || c, { connection: g, isValid: y } = ws.isValid(t.nativeEvent, {
|
|
5278
|
-
handle: {
|
|
5279
|
-
nodeId: v,
|
|
5280
|
-
id: m,
|
|
5281
|
-
type: e
|
|
5282
|
-
},
|
|
5283
|
-
connectionMode: s,
|
|
5284
|
-
fromNodeId: o.nodeId,
|
|
5285
|
-
fromHandleId: o.id || null,
|
|
5286
|
-
fromType: o.type,
|
|
5287
|
-
isValidConnection: h,
|
|
5288
|
-
flowId: u,
|
|
5289
|
-
doc: p,
|
|
5290
|
-
lib: l,
|
|
5291
|
-
nodeLookup: d
|
|
5292
|
-
});
|
|
5293
|
-
y && g && A(g);
|
|
5294
|
-
let b = structuredClone(f);
|
|
5295
|
-
delete b.inProgress, b.toPosition = b.toHandle ? b.toHandle.position : null, a?.(t, b), _.setState({ connectionClickStartHandle: null });
|
|
5296
5315
|
};
|
|
5297
5316
|
return g("div", {
|
|
5298
5317
|
"data-handleid": m,
|
|
@@ -5320,46 +5339,80 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
|
|
|
5320
5339
|
]),
|
|
5321
5340
|
onMouseDown: j,
|
|
5322
5341
|
onTouchStart: j,
|
|
5323
|
-
onClick: y ?
|
|
5342
|
+
onClick: y ? (t) => {
|
|
5343
|
+
let { onClickConnectStart: r, onClickConnectEnd: a, connectionClickStartHandle: o, connectionMode: s, isValidConnection: c, lib: l, rfId: u, nodeLookup: d, connection: f } = _.getState();
|
|
5344
|
+
if (!v || !o && !i) return;
|
|
5345
|
+
if (!o) {
|
|
5346
|
+
r?.(t.nativeEvent, {
|
|
5347
|
+
nodeId: v,
|
|
5348
|
+
handleId: m,
|
|
5349
|
+
handleType: e
|
|
5350
|
+
}), _.setState({ connectionClickStartHandle: {
|
|
5351
|
+
nodeId: v,
|
|
5352
|
+
type: e,
|
|
5353
|
+
id: m
|
|
5354
|
+
} });
|
|
5355
|
+
return;
|
|
5356
|
+
}
|
|
5357
|
+
let p = ho(t.target), h = n || c, { connection: g, isValid: y } = ws.isValid(t.nativeEvent, {
|
|
5358
|
+
handle: {
|
|
5359
|
+
nodeId: v,
|
|
5360
|
+
id: m,
|
|
5361
|
+
type: e
|
|
5362
|
+
},
|
|
5363
|
+
connectionMode: s,
|
|
5364
|
+
fromNodeId: o.nodeId,
|
|
5365
|
+
fromHandleId: o.id || null,
|
|
5366
|
+
fromType: o.type,
|
|
5367
|
+
isValidConnection: h,
|
|
5368
|
+
flowId: u,
|
|
5369
|
+
doc: p,
|
|
5370
|
+
lib: l,
|
|
5371
|
+
nodeLookup: d
|
|
5372
|
+
});
|
|
5373
|
+
y && g && A(g);
|
|
5374
|
+
let b = structuredClone(f);
|
|
5375
|
+
delete b.inProgress, b.toPosition = b.toHandle ? b.toHandle.position : null, a?.(t, b), _.setState({ connectionClickStartHandle: null });
|
|
5376
|
+
} : void 0,
|
|
5324
5377
|
ref: p,
|
|
5325
5378
|
...f,
|
|
5326
5379
|
children: c
|
|
5327
5380
|
});
|
|
5328
5381
|
}
|
|
5329
|
-
var
|
|
5330
|
-
function
|
|
5331
|
-
return _(h, { children: [e?.label, g(
|
|
5382
|
+
var Ml = i(tl(jl));
|
|
5383
|
+
function Nl({ data: e, isConnectable: t, sourcePosition: n = Y.Bottom }) {
|
|
5384
|
+
return _(h, { children: [e?.label, g(Ml, {
|
|
5332
5385
|
type: "source",
|
|
5333
5386
|
position: n,
|
|
5334
5387
|
isConnectable: t
|
|
5335
5388
|
})] });
|
|
5336
5389
|
}
|
|
5337
|
-
function
|
|
5390
|
+
function Pl({ data: e, isConnectable: t, targetPosition: n = Y.Top, sourcePosition: r = Y.Bottom }) {
|
|
5338
5391
|
return _(h, { children: [
|
|
5339
|
-
g(
|
|
5392
|
+
g(Ml, {
|
|
5340
5393
|
type: "target",
|
|
5341
5394
|
position: n,
|
|
5342
5395
|
isConnectable: t
|
|
5343
5396
|
}),
|
|
5344
5397
|
e?.label,
|
|
5345
|
-
g(
|
|
5398
|
+
g(Ml, {
|
|
5346
5399
|
type: "source",
|
|
5347
5400
|
position: r,
|
|
5348
5401
|
isConnectable: t
|
|
5349
5402
|
})
|
|
5350
5403
|
] });
|
|
5351
5404
|
}
|
|
5352
|
-
function
|
|
5405
|
+
function Fl() {
|
|
5353
5406
|
return null;
|
|
5354
5407
|
}
|
|
5355
|
-
function
|
|
5356
|
-
return _(h, { children: [g(
|
|
5408
|
+
function Il({ data: e, isConnectable: t, targetPosition: n = Y.Top }) {
|
|
5409
|
+
return _(h, { children: [g(Ml, {
|
|
5357
5410
|
type: "target",
|
|
5358
5411
|
position: n,
|
|
5359
5412
|
isConnectable: t
|
|
5360
5413
|
}), e?.label] });
|
|
5361
5414
|
}
|
|
5362
|
-
var
|
|
5415
|
+
var Ll = {
|
|
5363
5416
|
ArrowUp: {
|
|
5364
5417
|
x: 0,
|
|
5365
5418
|
y: -1
|
|
@@ -5376,13 +5429,13 @@ var Il = {
|
|
|
5376
5429
|
x: 1,
|
|
5377
5430
|
y: 0
|
|
5378
5431
|
}
|
|
5379
|
-
},
|
|
5380
|
-
input:
|
|
5381
|
-
default:
|
|
5382
|
-
output:
|
|
5383
|
-
group:
|
|
5432
|
+
}, Rl = {
|
|
5433
|
+
input: Nl,
|
|
5434
|
+
default: Pl,
|
|
5435
|
+
output: Il,
|
|
5436
|
+
group: Fl
|
|
5384
5437
|
};
|
|
5385
|
-
function
|
|
5438
|
+
function zl(e) {
|
|
5386
5439
|
return e.internals.handleBounds === void 0 ? {
|
|
5387
5440
|
width: e.width ?? e.initialWidth ?? e.style?.width,
|
|
5388
5441
|
height: e.height ?? e.initialHeight ?? e.style?.height
|
|
@@ -5391,7 +5444,7 @@ function Rl(e) {
|
|
|
5391
5444
|
height: e.height ?? e.style?.height
|
|
5392
5445
|
};
|
|
5393
5446
|
}
|
|
5394
|
-
var
|
|
5447
|
+
var Bl = (e) => {
|
|
5395
5448
|
let { width: t, height: n, x: r, y: i } = ka(e.nodeLookup, { filter: (e) => !!e.selected });
|
|
5396
5449
|
return {
|
|
5397
5450
|
width: Ya(t) ? t : null,
|
|
@@ -5400,13 +5453,13 @@ var zl = (e) => {
|
|
|
5400
5453
|
transformString: `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`
|
|
5401
5454
|
};
|
|
5402
5455
|
};
|
|
5403
|
-
function
|
|
5404
|
-
let r = Q(), { width: i, height: a, transformString: o, userSelectionActive: s } = Z(
|
|
5456
|
+
function Vl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
|
|
5457
|
+
let r = Q(), { width: i, height: a, transformString: o, userSelectionActive: s } = Z(Bl, X), l = Tl(), u = d(null);
|
|
5405
5458
|
c(() => {
|
|
5406
5459
|
n || u.current?.focus({ preventScroll: !0 });
|
|
5407
5460
|
}, [n]);
|
|
5408
5461
|
let f = !s && i !== null && a !== null;
|
|
5409
|
-
if (
|
|
5462
|
+
if (Cl({
|
|
5410
5463
|
nodeRef: u,
|
|
5411
5464
|
disabled: !f
|
|
5412
5465
|
}), !f) return null;
|
|
@@ -5426,8 +5479,8 @@ function Bl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
5426
5479
|
onContextMenu: p,
|
|
5427
5480
|
tabIndex: n ? void 0 : -1,
|
|
5428
5481
|
onKeyDown: n ? void 0 : (e) => {
|
|
5429
|
-
Object.prototype.hasOwnProperty.call(
|
|
5430
|
-
direction:
|
|
5482
|
+
Object.prototype.hasOwnProperty.call(Ll, e.key) && (e.preventDefault(), l({
|
|
5483
|
+
direction: Ll[e.key],
|
|
5431
5484
|
factor: e.shiftKey ? 4 : 1
|
|
5432
5485
|
}));
|
|
5433
5486
|
},
|
|
@@ -5438,38 +5491,38 @@ function Bl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
|
|
|
5438
5491
|
})
|
|
5439
5492
|
});
|
|
5440
5493
|
}
|
|
5441
|
-
var
|
|
5494
|
+
var Hl = typeof window < "u" ? window : void 0, Ul = (e) => ({
|
|
5442
5495
|
nodesSelectionActive: e.nodesSelectionActive,
|
|
5443
5496
|
userSelectionActive: e.userSelectionActive
|
|
5444
5497
|
});
|
|
5445
|
-
function
|
|
5446
|
-
let { nodesSelectionActive:
|
|
5447
|
-
return
|
|
5498
|
+
function Wl({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: i, onPaneContextMenu: a, onPaneScroll: o, paneClickDistance: s, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: u, selectionMode: d, onSelectionStart: f, onSelectionEnd: p, multiSelectionKeyCode: m, panActivationKeyCode: h, zoomActivationKeyCode: v, elementsSelectable: y, zoomOnScroll: b, zoomOnPinch: x, panOnScroll: S, panOnScrollSpeed: C, panOnScrollMode: w, zoomOnDoubleClick: T, panOnDrag: E, autoPanOnSelection: D, defaultViewport: O, translateExtent: k, minZoom: A, maxZoom: j, preventScrolling: M, onSelectionContextMenu: N, noWheelClassName: P, noPanClassName: F, disableKeyboardA11y: I, onViewportChange: L, isControlledViewport: R }) {
|
|
5499
|
+
let { nodesSelectionActive: ee, userSelectionActive: z } = Z(Ul, X), B = zc(l, { target: Hl }), V = zc(h, { target: Hl }), H = V || E, U = V || S, W = u && H !== !0, te = B || z || W;
|
|
5500
|
+
return fl({
|
|
5448
5501
|
deleteKeyCode: c,
|
|
5449
5502
|
multiSelectionKeyCode: m
|
|
5450
|
-
}), g(
|
|
5503
|
+
}), g(gl, {
|
|
5451
5504
|
onPaneContextMenu: a,
|
|
5452
5505
|
elementsSelectable: y,
|
|
5453
5506
|
zoomOnScroll: b,
|
|
5454
5507
|
zoomOnPinch: x,
|
|
5455
|
-
panOnScroll:
|
|
5508
|
+
panOnScroll: U,
|
|
5456
5509
|
panOnScrollSpeed: C,
|
|
5457
5510
|
panOnScrollMode: w,
|
|
5458
5511
|
zoomOnDoubleClick: T,
|
|
5459
|
-
panOnDrag: !
|
|
5460
|
-
defaultViewport:
|
|
5461
|
-
translateExtent:
|
|
5462
|
-
minZoom:
|
|
5463
|
-
maxZoom:
|
|
5512
|
+
panOnDrag: !B && H,
|
|
5513
|
+
defaultViewport: O,
|
|
5514
|
+
translateExtent: k,
|
|
5515
|
+
minZoom: A,
|
|
5516
|
+
maxZoom: j,
|
|
5464
5517
|
zoomActivationKeyCode: v,
|
|
5465
|
-
preventScrolling:
|
|
5466
|
-
noWheelClassName:
|
|
5467
|
-
noPanClassName:
|
|
5468
|
-
onViewportChange:
|
|
5469
|
-
isControlledViewport:
|
|
5518
|
+
preventScrolling: M,
|
|
5519
|
+
noWheelClassName: P,
|
|
5520
|
+
noPanClassName: F,
|
|
5521
|
+
onViewportChange: L,
|
|
5522
|
+
isControlledViewport: R,
|
|
5470
5523
|
paneClickDistance: s,
|
|
5471
|
-
selectionOnDrag:
|
|
5472
|
-
children: _(
|
|
5524
|
+
selectionOnDrag: W,
|
|
5525
|
+
children: _(xl, {
|
|
5473
5526
|
onSelectionStart: f,
|
|
5474
5527
|
onSelectionEnd: p,
|
|
5475
5528
|
onPaneClick: t,
|
|
@@ -5478,33 +5531,34 @@ function Ul({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove:
|
|
|
5478
5531
|
onPaneMouseLeave: i,
|
|
5479
5532
|
onPaneContextMenu: a,
|
|
5480
5533
|
onPaneScroll: o,
|
|
5481
|
-
panOnDrag:
|
|
5482
|
-
|
|
5534
|
+
panOnDrag: H,
|
|
5535
|
+
autoPanOnSelection: D,
|
|
5536
|
+
isSelecting: !!te,
|
|
5483
5537
|
selectionMode: d,
|
|
5484
|
-
selectionKeyPressed:
|
|
5538
|
+
selectionKeyPressed: B,
|
|
5485
5539
|
paneClickDistance: s,
|
|
5486
|
-
selectionOnDrag:
|
|
5487
|
-
children: [e,
|
|
5488
|
-
onSelectionContextMenu:
|
|
5489
|
-
noPanClassName:
|
|
5490
|
-
disableKeyboardA11y:
|
|
5540
|
+
selectionOnDrag: W,
|
|
5541
|
+
children: [e, ee && g(Vl, {
|
|
5542
|
+
onSelectionContextMenu: N,
|
|
5543
|
+
noPanClassName: F,
|
|
5544
|
+
disableKeyboardA11y: I
|
|
5491
5545
|
})]
|
|
5492
5546
|
})
|
|
5493
5547
|
});
|
|
5494
5548
|
}
|
|
5495
|
-
|
|
5496
|
-
var
|
|
5549
|
+
Wl.displayName = "FlowRenderer";
|
|
5550
|
+
var Gl = i(Wl), Kl = (e) => (t) => e ? Aa(t.nodeLookup, {
|
|
5497
5551
|
x: 0,
|
|
5498
5552
|
y: 0,
|
|
5499
5553
|
width: t.width,
|
|
5500
5554
|
height: t.height
|
|
5501
5555
|
}, t.transform, !0).map((e) => e.id) : Array.from(t.nodeLookup.keys());
|
|
5502
|
-
function
|
|
5503
|
-
return Z(a(
|
|
5556
|
+
function ql(e) {
|
|
5557
|
+
return Z(a(Kl(e), [e]), X);
|
|
5504
5558
|
}
|
|
5505
|
-
var
|
|
5506
|
-
function
|
|
5507
|
-
let e = Z(
|
|
5559
|
+
var Jl = (e) => e.updateNodeInternals;
|
|
5560
|
+
function Yl() {
|
|
5561
|
+
let e = Z(Jl), [t] = f(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((t) => {
|
|
5508
5562
|
let n = /* @__PURE__ */ new Map();
|
|
5509
5563
|
t.forEach((e) => {
|
|
5510
5564
|
let t = e.target.getAttribute("data-id");
|
|
@@ -5519,7 +5573,7 @@ function Jl() {
|
|
|
5519
5573
|
t?.disconnect();
|
|
5520
5574
|
}, [t]), t;
|
|
5521
5575
|
}
|
|
5522
|
-
function
|
|
5576
|
+
function Xl({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
|
|
5523
5577
|
let i = Q(), a = d(null), o = d(null), s = d(e.sourcePosition), l = d(e.targetPosition), u = d(t), f = n && !!e.internals.handleBounds;
|
|
5524
5578
|
return c(() => {
|
|
5525
5579
|
a.current && !e.hidden && (!f || o.current !== a.current) && (o.current && r?.unobserve(o.current), r?.observe(a.current), o.current = a.current);
|
|
@@ -5541,7 +5595,7 @@ function Yl({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
|
|
|
5541
5595
|
e.targetPosition
|
|
5542
5596
|
]), a;
|
|
5543
5597
|
}
|
|
5544
|
-
function
|
|
5598
|
+
function Zl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: i, onContextMenu: a, onDoubleClick: o, nodesDraggable: s, elementsSelectable: c, nodesConnectable: l, nodesFocusable: u, resizeObserver: d, noDragClassName: f, noPanClassName: p, disableKeyboardA11y: m, rfId: h, nodeTypes: _, nodeClickDistance: v, onError: y }) {
|
|
5545
5599
|
let { node: b, internals: x, isParent: C } = Z((t) => {
|
|
5546
5600
|
let n = t.nodeLookup.get(e), r = t.parentLookup.has(e);
|
|
5547
5601
|
return {
|
|
@@ -5549,14 +5603,14 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5549
5603
|
internals: n.internals,
|
|
5550
5604
|
isParent: r
|
|
5551
5605
|
};
|
|
5552
|
-
}, X), w = b.type || "default", T = _?.[w] ||
|
|
5553
|
-
T === void 0 && (y?.("003", J.error003(w)), w = "default", T = _?.default ||
|
|
5554
|
-
let E = !!(b.draggable || s && b.draggable === void 0), D = !!(b.selectable || c && b.selectable === void 0), O = !!(b.connectable || l && b.connectable === void 0), k = !!(b.focusable || u && b.focusable === void 0), A = Q(), j = so(b), M =
|
|
5606
|
+
}, X), w = b.type || "default", T = _?.[w] || Rl[w];
|
|
5607
|
+
T === void 0 && (y?.("003", J.error003(w)), w = "default", T = _?.default || Rl.default);
|
|
5608
|
+
let E = !!(b.draggable || s && b.draggable === void 0), D = !!(b.selectable || c && b.selectable === void 0), O = !!(b.connectable || l && b.connectable === void 0), k = !!(b.focusable || u && b.focusable === void 0), A = Q(), j = so(b), M = Xl({
|
|
5555
5609
|
node: b,
|
|
5556
5610
|
nodeType: w,
|
|
5557
5611
|
hasDimensions: j,
|
|
5558
5612
|
resizeObserver: d
|
|
5559
|
-
}), N =
|
|
5613
|
+
}), N = Cl({
|
|
5560
5614
|
nodeRef: M,
|
|
5561
5615
|
disabled: b.hidden || !E,
|
|
5562
5616
|
noDragClassName: f,
|
|
@@ -5564,24 +5618,24 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5564
5618
|
nodeId: e,
|
|
5565
5619
|
isSelectable: D,
|
|
5566
5620
|
nodeClickDistance: v
|
|
5567
|
-
}), P =
|
|
5621
|
+
}), P = Tl();
|
|
5568
5622
|
if (b.hidden) return null;
|
|
5569
|
-
let F = oo(b), I =
|
|
5623
|
+
let F = oo(b), I = zl(b), L = D || E || t || n || r || i, R = n ? (e) => n(e, { ...x.userNode }) : void 0, ee = r ? (e) => r(e, { ...x.userNode }) : void 0, z = i ? (e) => i(e, { ...x.userNode }) : void 0, B = a ? (e) => a(e, { ...x.userNode }) : void 0, V = o ? (e) => o(e, { ...x.userNode }) : void 0, H = (n) => {
|
|
5570
5624
|
let { selectNodesOnDrag: r, nodeDragThreshold: i } = A.getState();
|
|
5571
|
-
D && (!r || !E || i > 0) &&
|
|
5625
|
+
D && (!r || !E || i > 0) && Sl({
|
|
5572
5626
|
id: e,
|
|
5573
5627
|
store: A,
|
|
5574
5628
|
nodeRef: M
|
|
5575
5629
|
}), t && t(n, { ...x.userNode });
|
|
5576
5630
|
}, U = (t) => {
|
|
5577
5631
|
if (!(_o(t.nativeEvent) || m)) {
|
|
5578
|
-
if (ma.includes(t.key) && D)
|
|
5632
|
+
if (ma.includes(t.key) && D) Sl({
|
|
5579
5633
|
id: e,
|
|
5580
5634
|
store: A,
|
|
5581
5635
|
unselect: t.key === "Escape",
|
|
5582
5636
|
nodeRef: M
|
|
5583
5637
|
});
|
|
5584
|
-
else if (E && b.selected && Object.prototype.hasOwnProperty.call(
|
|
5638
|
+
else if (E && b.selected && Object.prototype.hasOwnProperty.call(Ll, t.key)) {
|
|
5585
5639
|
t.preventDefault();
|
|
5586
5640
|
let { ariaLabelConfig: e } = A.getState();
|
|
5587
5641
|
A.setState({ ariaLiveMessage: e["node.a11yDescription.ariaLiveMessage"]({
|
|
@@ -5589,7 +5643,7 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5589
5643
|
x: ~~x.positionAbsolute.x,
|
|
5590
5644
|
y: ~~x.positionAbsolute.y
|
|
5591
5645
|
}) }), P({
|
|
5592
|
-
direction:
|
|
5646
|
+
direction: Ll[t.key],
|
|
5593
5647
|
factor: t.shiftKey ? 4 : 1
|
|
5594
5648
|
});
|
|
5595
5649
|
}
|
|
@@ -5640,10 +5694,10 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5640
5694
|
onFocus: k ? W : void 0,
|
|
5641
5695
|
role: b.ariaRole ?? (k ? "group" : void 0),
|
|
5642
5696
|
"aria-roledescription": "node",
|
|
5643
|
-
"aria-describedby": m ? void 0 : `${
|
|
5697
|
+
"aria-describedby": m ? void 0 : `${hc}-${h}`,
|
|
5644
5698
|
"aria-label": b.ariaLabel,
|
|
5645
5699
|
...b.domAttributes,
|
|
5646
|
-
children: g(
|
|
5700
|
+
children: g(Dl, {
|
|
5647
5701
|
value: e,
|
|
5648
5702
|
children: g(T, {
|
|
5649
5703
|
id: e,
|
|
@@ -5667,19 +5721,19 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
|
|
|
5667
5721
|
})
|
|
5668
5722
|
});
|
|
5669
5723
|
}
|
|
5670
|
-
var
|
|
5724
|
+
var Ql = i(Zl), $l = (e) => ({
|
|
5671
5725
|
nodesDraggable: e.nodesDraggable,
|
|
5672
5726
|
nodesConnectable: e.nodesConnectable,
|
|
5673
5727
|
nodesFocusable: e.nodesFocusable,
|
|
5674
5728
|
elementsSelectable: e.elementsSelectable,
|
|
5675
5729
|
onError: e.onError
|
|
5676
5730
|
});
|
|
5677
|
-
function
|
|
5678
|
-
let { nodesDraggable: t, nodesConnectable: n, nodesFocusable: r, elementsSelectable: i, onError: a } = Z(
|
|
5731
|
+
function eu(e) {
|
|
5732
|
+
let { nodesDraggable: t, nodesConnectable: n, nodesFocusable: r, elementsSelectable: i, onError: a } = Z($l, X), o = ql(e.onlyRenderVisibleElements), s = Yl();
|
|
5679
5733
|
return g("div", {
|
|
5680
5734
|
className: "react-flow__nodes",
|
|
5681
|
-
style:
|
|
5682
|
-
children: o.map((o) => g(
|
|
5735
|
+
style: ml,
|
|
5736
|
+
children: o.map((o) => g(Ql, {
|
|
5683
5737
|
id: o,
|
|
5684
5738
|
nodeTypes: e.nodeTypes,
|
|
5685
5739
|
nodeExtent: e.nodeExtent,
|
|
@@ -5703,9 +5757,9 @@ function $l(e) {
|
|
|
5703
5757
|
}, o))
|
|
5704
5758
|
});
|
|
5705
5759
|
}
|
|
5706
|
-
|
|
5707
|
-
var
|
|
5708
|
-
function
|
|
5760
|
+
eu.displayName = "NodeRenderer";
|
|
5761
|
+
var tu = i(eu);
|
|
5762
|
+
function nu(e) {
|
|
5709
5763
|
return Z(a((t) => {
|
|
5710
5764
|
if (!e) return t.edges.map((e) => e.id);
|
|
5711
5765
|
let n = [];
|
|
@@ -5722,7 +5776,7 @@ function tu(e) {
|
|
|
5722
5776
|
return n;
|
|
5723
5777
|
}, [e]), X);
|
|
5724
5778
|
}
|
|
5725
|
-
var
|
|
5779
|
+
var ru = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
|
|
5726
5780
|
className: "arrow",
|
|
5727
5781
|
style: {
|
|
5728
5782
|
strokeWidth: t,
|
|
@@ -5732,7 +5786,7 @@ var nu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
|
|
|
5732
5786
|
fill: "none",
|
|
5733
5787
|
strokeLinejoin: "round",
|
|
5734
5788
|
points: "-5,-4 0,0 -5,4"
|
|
5735
|
-
}),
|
|
5789
|
+
}), iu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
|
|
5736
5790
|
className: "arrowclosed",
|
|
5737
5791
|
style: {
|
|
5738
5792
|
strokeWidth: t,
|
|
@@ -5744,16 +5798,16 @@ var nu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
|
|
|
5744
5798
|
strokeLinecap: "round",
|
|
5745
5799
|
strokeLinejoin: "round",
|
|
5746
5800
|
points: "-5,-4 0,0 -5,4 -5,-4"
|
|
5747
|
-
}),
|
|
5748
|
-
[xa.Arrow]:
|
|
5749
|
-
[xa.ArrowClosed]:
|
|
5801
|
+
}), au = {
|
|
5802
|
+
[xa.Arrow]: ru,
|
|
5803
|
+
[xa.ArrowClosed]: iu
|
|
5750
5804
|
};
|
|
5751
|
-
function
|
|
5805
|
+
function ou(e) {
|
|
5752
5806
|
let t = Q();
|
|
5753
|
-
return u(() => Object.prototype.hasOwnProperty.call(
|
|
5807
|
+
return u(() => Object.prototype.hasOwnProperty.call(au, e) ? au[e] : (t.getState().onError?.("009", J.error009(e)), null), [e]);
|
|
5754
5808
|
}
|
|
5755
|
-
var
|
|
5756
|
-
let c =
|
|
5809
|
+
var su = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerUnits: a = "strokeWidth", strokeWidth: o, orient: s = "auto-start-reverse" }) => {
|
|
5810
|
+
let c = ou(t);
|
|
5757
5811
|
return c ? g("marker", {
|
|
5758
5812
|
className: "react-flow__arrowhead",
|
|
5759
5813
|
id: e,
|
|
@@ -5769,7 +5823,7 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
|
|
|
5769
5823
|
strokeWidth: o
|
|
5770
5824
|
})
|
|
5771
5825
|
}) : null;
|
|
5772
|
-
},
|
|
5826
|
+
}, cu = ({ defaultColor: e, rfId: t }) => {
|
|
5773
5827
|
let n = Z((e) => e.edges), r = Z((e) => e.defaultEdgeOptions), i = u(() => Wo(n, {
|
|
5774
5828
|
id: t,
|
|
5775
5829
|
defaultColor: e,
|
|
@@ -5784,7 +5838,7 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
|
|
|
5784
5838
|
return i.length ? g("svg", {
|
|
5785
5839
|
className: "react-flow__marker",
|
|
5786
5840
|
"aria-hidden": "true",
|
|
5787
|
-
children: g("defs", { children: i.map((e) => g(
|
|
5841
|
+
children: g("defs", { children: i.map((e) => g(su, {
|
|
5788
5842
|
id: e.id,
|
|
5789
5843
|
type: e.type,
|
|
5790
5844
|
color: e.color,
|
|
@@ -5796,9 +5850,9 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
|
|
|
5796
5850
|
}, e.id)) })
|
|
5797
5851
|
}) : null;
|
|
5798
5852
|
};
|
|
5799
|
-
|
|
5800
|
-
var
|
|
5801
|
-
function
|
|
5853
|
+
cu.displayName = "MarkerDefinitions";
|
|
5854
|
+
var lu = i(cu);
|
|
5855
|
+
function uu({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgStyle: a, labelBgPadding: o = [2, 4], labelBgBorderRadius: s = 2, children: l, className: u, ...p }) {
|
|
5802
5856
|
let [m, h] = f({
|
|
5803
5857
|
x: 1,
|
|
5804
5858
|
y: 0,
|
|
@@ -5843,9 +5897,9 @@ function lu({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgS
|
|
|
5843
5897
|
]
|
|
5844
5898
|
}) : null;
|
|
5845
5899
|
}
|
|
5846
|
-
|
|
5847
|
-
var
|
|
5848
|
-
function
|
|
5900
|
+
uu.displayName = "EdgeText";
|
|
5901
|
+
var du = i(uu);
|
|
5902
|
+
function fu({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowBg: a, labelBgStyle: o, labelBgPadding: s, labelBgBorderRadius: c, interactionWidth: l = 20, ...u }) {
|
|
5849
5903
|
return _(h, { children: [
|
|
5850
5904
|
g("path", {
|
|
5851
5905
|
...u,
|
|
@@ -5860,7 +5914,7 @@ function du({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowB
|
|
|
5860
5914
|
strokeWidth: l,
|
|
5861
5915
|
className: "react-flow__edge-interaction"
|
|
5862
5916
|
}) : null,
|
|
5863
|
-
r && Ya(t) && Ya(n) ? g(
|
|
5917
|
+
r && Ya(t) && Ya(n) ? g(du, {
|
|
5864
5918
|
x: t,
|
|
5865
5919
|
y: n,
|
|
5866
5920
|
label: r,
|
|
@@ -5872,17 +5926,17 @@ function du({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowB
|
|
|
5872
5926
|
}) : null
|
|
5873
5927
|
] });
|
|
5874
5928
|
}
|
|
5875
|
-
function
|
|
5929
|
+
function pu({ pos: e, x1: t, y1: n, x2: r, y2: i }) {
|
|
5876
5930
|
return e === Y.Left || e === Y.Right ? [.5 * (t + r), n] : [t, .5 * (n + i)];
|
|
5877
5931
|
}
|
|
5878
|
-
function
|
|
5879
|
-
let [o, s] =
|
|
5932
|
+
function mu({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r, targetY: i, targetPosition: a = Y.Top }) {
|
|
5933
|
+
let [o, s] = pu({
|
|
5880
5934
|
pos: n,
|
|
5881
5935
|
x1: e,
|
|
5882
5936
|
y1: t,
|
|
5883
5937
|
x2: r,
|
|
5884
5938
|
y2: i
|
|
5885
|
-
}), [c, l] =
|
|
5939
|
+
}), [c, l] = pu({
|
|
5886
5940
|
pos: a,
|
|
5887
5941
|
x1: r,
|
|
5888
5942
|
y1: i,
|
|
@@ -5906,9 +5960,9 @@ function pu({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r,
|
|
|
5906
5960
|
p
|
|
5907
5961
|
];
|
|
5908
5962
|
}
|
|
5909
|
-
function
|
|
5963
|
+
function hu(e) {
|
|
5910
5964
|
return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, sourcePosition: o, targetPosition: s, label: c, labelStyle: l, labelShowBg: u, labelBgStyle: d, labelBgPadding: f, labelBgBorderRadius: p, style: m, markerEnd: h, markerStart: _, interactionWidth: v }) => {
|
|
5911
|
-
let [y, b, x] =
|
|
5965
|
+
let [y, b, x] = mu({
|
|
5912
5966
|
sourceX: n,
|
|
5913
5967
|
sourceY: r,
|
|
5914
5968
|
sourcePosition: o,
|
|
@@ -5916,7 +5970,7 @@ function mu(e) {
|
|
|
5916
5970
|
targetY: a,
|
|
5917
5971
|
targetPosition: s
|
|
5918
5972
|
});
|
|
5919
|
-
return g(
|
|
5973
|
+
return g(fu, {
|
|
5920
5974
|
id: e.isInternal ? void 0 : t,
|
|
5921
5975
|
path: y,
|
|
5922
5976
|
labelX: b,
|
|
@@ -5934,9 +5988,9 @@ function mu(e) {
|
|
|
5934
5988
|
});
|
|
5935
5989
|
});
|
|
5936
5990
|
}
|
|
5937
|
-
var
|
|
5938
|
-
|
|
5939
|
-
function
|
|
5991
|
+
var gu = hu({ isInternal: !1 }), _u = hu({ isInternal: !0 });
|
|
5992
|
+
gu.displayName = "SimpleBezierEdge", _u.displayName = "SimpleBezierEdgeInternal";
|
|
5993
|
+
function vu(e) {
|
|
5940
5994
|
return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, label: o, labelStyle: s, labelShowBg: c, labelBgStyle: l, labelBgPadding: u, labelBgBorderRadius: d, style: f, sourcePosition: p = Y.Bottom, targetPosition: m = Y.Top, markerEnd: h, markerStart: _, pathOptions: v, interactionWidth: y }) => {
|
|
5941
5995
|
let [b, x, S] = Lo({
|
|
5942
5996
|
sourceX: n,
|
|
@@ -5949,7 +6003,7 @@ function _u(e) {
|
|
|
5949
6003
|
offset: v?.offset,
|
|
5950
6004
|
stepPosition: v?.stepPosition
|
|
5951
6005
|
});
|
|
5952
|
-
return g(
|
|
6006
|
+
return g(fu, {
|
|
5953
6007
|
id: e.isInternal ? void 0 : t,
|
|
5954
6008
|
path: b,
|
|
5955
6009
|
labelX: x,
|
|
@@ -5967,12 +6021,12 @@ function _u(e) {
|
|
|
5967
6021
|
});
|
|
5968
6022
|
});
|
|
5969
6023
|
}
|
|
5970
|
-
var
|
|
5971
|
-
|
|
5972
|
-
function
|
|
6024
|
+
var yu = vu({ isInternal: !1 }), bu = vu({ isInternal: !0 });
|
|
6025
|
+
yu.displayName = "SmoothStepEdge", bu.displayName = "SmoothStepEdgeInternal";
|
|
6026
|
+
function xu(e) {
|
|
5973
6027
|
return i(({ id: t, ...n }) => {
|
|
5974
6028
|
let r = e.isInternal ? void 0 : t;
|
|
5975
|
-
return g(
|
|
6029
|
+
return g(yu, {
|
|
5976
6030
|
...n,
|
|
5977
6031
|
id: r,
|
|
5978
6032
|
pathOptions: u(() => ({
|
|
@@ -5982,9 +6036,9 @@ function bu(e) {
|
|
|
5982
6036
|
});
|
|
5983
6037
|
});
|
|
5984
6038
|
}
|
|
5985
|
-
var
|
|
5986
|
-
|
|
5987
|
-
function
|
|
6039
|
+
var Su = xu({ isInternal: !1 }), Cu = xu({ isInternal: !0 });
|
|
6040
|
+
Su.displayName = "StepEdge", Cu.displayName = "StepEdgeInternal";
|
|
6041
|
+
function wu(e) {
|
|
5988
6042
|
return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, label: o, labelStyle: s, labelShowBg: c, labelBgStyle: l, labelBgPadding: u, labelBgBorderRadius: d, style: f, markerEnd: p, markerStart: m, interactionWidth: h }) => {
|
|
5989
6043
|
let [_, v, y] = jo({
|
|
5990
6044
|
sourceX: n,
|
|
@@ -5992,7 +6046,7 @@ function Cu(e) {
|
|
|
5992
6046
|
targetX: i,
|
|
5993
6047
|
targetY: a
|
|
5994
6048
|
});
|
|
5995
|
-
return g(
|
|
6049
|
+
return g(fu, {
|
|
5996
6050
|
id: e.isInternal ? void 0 : t,
|
|
5997
6051
|
path: _,
|
|
5998
6052
|
labelX: v,
|
|
@@ -6010,9 +6064,9 @@ function Cu(e) {
|
|
|
6010
6064
|
});
|
|
6011
6065
|
});
|
|
6012
6066
|
}
|
|
6013
|
-
var
|
|
6014
|
-
|
|
6015
|
-
function
|
|
6067
|
+
var Tu = wu({ isInternal: !1 }), Eu = wu({ isInternal: !0 });
|
|
6068
|
+
Tu.displayName = "StraightEdge", Eu.displayName = "StraightEdgeInternal";
|
|
6069
|
+
function Du(e) {
|
|
6016
6070
|
return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, sourcePosition: o = Y.Bottom, targetPosition: s = Y.Top, label: c, labelStyle: l, labelShowBg: u, labelBgStyle: d, labelBgPadding: f, labelBgBorderRadius: p, style: m, markerEnd: h, markerStart: _, pathOptions: v, interactionWidth: y }) => {
|
|
6017
6071
|
let [b, x, S] = wo({
|
|
6018
6072
|
sourceX: n,
|
|
@@ -6023,7 +6077,7 @@ function Eu(e) {
|
|
|
6023
6077
|
targetPosition: s,
|
|
6024
6078
|
curvature: v?.curvature
|
|
6025
6079
|
});
|
|
6026
|
-
return g(
|
|
6080
|
+
return g(fu, {
|
|
6027
6081
|
id: e.isInternal ? void 0 : t,
|
|
6028
6082
|
path: b,
|
|
6029
6083
|
labelX: x,
|
|
@@ -6041,36 +6095,36 @@ function Eu(e) {
|
|
|
6041
6095
|
});
|
|
6042
6096
|
});
|
|
6043
6097
|
}
|
|
6044
|
-
var
|
|
6045
|
-
|
|
6046
|
-
var
|
|
6047
|
-
default:
|
|
6048
|
-
straight:
|
|
6049
|
-
step:
|
|
6050
|
-
smoothstep:
|
|
6051
|
-
simplebezier:
|
|
6052
|
-
},
|
|
6098
|
+
var Ou = Du({ isInternal: !1 }), ku = Du({ isInternal: !0 });
|
|
6099
|
+
Ou.displayName = "BezierEdge", ku.displayName = "BezierEdgeInternal";
|
|
6100
|
+
var Au = {
|
|
6101
|
+
default: ku,
|
|
6102
|
+
straight: Eu,
|
|
6103
|
+
step: Cu,
|
|
6104
|
+
smoothstep: bu,
|
|
6105
|
+
simplebezier: _u
|
|
6106
|
+
}, ju = {
|
|
6053
6107
|
sourceX: null,
|
|
6054
6108
|
sourceY: null,
|
|
6055
6109
|
targetX: null,
|
|
6056
6110
|
targetY: null,
|
|
6057
6111
|
sourcePosition: null,
|
|
6058
6112
|
targetPosition: null
|
|
6059
|
-
},
|
|
6060
|
-
function
|
|
6113
|
+
}, Mu = (e, t, n) => n === Y.Left ? e - t : n === Y.Right ? e + t : e, Nu = (e, t, n) => n === Y.Top ? e - t : n === Y.Bottom ? e + t : e, Pu = "react-flow__edgeupdater";
|
|
6114
|
+
function Fu({ position: e, centerX: t, centerY: n, radius: r = 10, onMouseDown: i, onMouseEnter: a, onMouseOut: o, type: s }) {
|
|
6061
6115
|
return g("circle", {
|
|
6062
6116
|
onMouseDown: i,
|
|
6063
6117
|
onMouseEnter: a,
|
|
6064
6118
|
onMouseOut: o,
|
|
6065
|
-
className: S([
|
|
6066
|
-
cx:
|
|
6067
|
-
cy:
|
|
6119
|
+
className: S([Pu, `${Pu}-${s}`]),
|
|
6120
|
+
cx: Mu(t, r, e),
|
|
6121
|
+
cy: Nu(n, r, e),
|
|
6068
6122
|
r,
|
|
6069
6123
|
stroke: "transparent",
|
|
6070
6124
|
fill: "transparent"
|
|
6071
6125
|
});
|
|
6072
6126
|
}
|
|
6073
|
-
function
|
|
6127
|
+
function Iu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, onReconnect: l, onReconnectStart: u, onReconnectEnd: d, setReconnecting: f, setUpdateHover: p }) {
|
|
6074
6128
|
let m = Q(), v = (e, t) => {
|
|
6075
6129
|
if (e.button !== 0) return;
|
|
6076
6130
|
let { autoPanOnConnect: r, domNode: i, connectionMode: a, connectionRadius: o, lib: s, onConnectStart: c, cancelConnection: p, nodeLookup: h, rfId: g, panBy: _, updateConnection: v } = m.getState(), y = t.type === "target";
|
|
@@ -6112,7 +6166,7 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
|
|
|
6112
6166
|
id: n.sourceHandle ?? null,
|
|
6113
6167
|
type: "source"
|
|
6114
6168
|
}), x = () => p(!0), S = () => p(!1);
|
|
6115
|
-
return _(h, { children: [(e === !0 || e === "source") && g(
|
|
6169
|
+
return _(h, { children: [(e === !0 || e === "source") && g(Fu, {
|
|
6116
6170
|
position: s,
|
|
6117
6171
|
centerX: r,
|
|
6118
6172
|
centerY: i,
|
|
@@ -6121,7 +6175,7 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
|
|
|
6121
6175
|
onMouseEnter: x,
|
|
6122
6176
|
onMouseOut: S,
|
|
6123
6177
|
type: "source"
|
|
6124
|
-
}), (e === !0 || e === "target") && g(
|
|
6178
|
+
}), (e === !0 || e === "target") && g(Fu, {
|
|
6125
6179
|
position: c,
|
|
6126
6180
|
centerX: a,
|
|
6127
6181
|
centerY: o,
|
|
@@ -6132,19 +6186,19 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
|
|
|
6132
6186
|
type: "target"
|
|
6133
6187
|
})] });
|
|
6134
6188
|
}
|
|
6135
|
-
function
|
|
6189
|
+
function Lu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: i, onDoubleClick: o, onContextMenu: s, onMouseEnter: c, onMouseMove: l, onMouseLeave: p, reconnectRadius: m, onReconnect: h, onReconnectStart: v, onReconnectEnd: y, rfId: b, edgeTypes: x, noPanClassName: C, onError: w, disableKeyboardA11y: T }) {
|
|
6136
6190
|
let E = Z((t) => t.edgeLookup.get(e)), D = Z((e) => e.defaultEdgeOptions);
|
|
6137
6191
|
E = D ? {
|
|
6138
6192
|
...D,
|
|
6139
6193
|
...E
|
|
6140
6194
|
} : E;
|
|
6141
|
-
let O = E.type || "default", k = x?.[O] ||
|
|
6142
|
-
k === void 0 && (w?.("011", J.error011(O)), O = "default", k = x?.default ||
|
|
6195
|
+
let O = E.type || "default", k = x?.[O] || Au[O];
|
|
6196
|
+
k === void 0 && (w?.("011", J.error011(O)), O = "default", k = x?.default || Au.default);
|
|
6143
6197
|
let A = !!(E.focusable || t && E.focusable === void 0), j = h !== void 0 && (E.reconnectable || n && E.reconnectable === void 0), M = !!(E.selectable || r && E.selectable === void 0), N = d(null), [P, F] = f(!1), [I, L] = f(!1), R = Q(), { zIndex: ee, sourceX: z, sourceY: B, targetX: V, targetY: H, sourcePosition: U, targetPosition: W } = Z(a((t) => {
|
|
6144
6198
|
let n = t.nodeLookup.get(E.source), r = t.nodeLookup.get(E.target);
|
|
6145
6199
|
if (!n || !r) return {
|
|
6146
6200
|
zIndex: E.zIndex,
|
|
6147
|
-
...
|
|
6201
|
+
...ju
|
|
6148
6202
|
};
|
|
6149
6203
|
let i = zo({
|
|
6150
6204
|
id: e,
|
|
@@ -6164,7 +6218,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6164
6218
|
elevateOnSelect: t.elevateEdgesOnSelect,
|
|
6165
6219
|
zIndexMode: t.zIndexMode
|
|
6166
6220
|
}),
|
|
6167
|
-
...i ||
|
|
6221
|
+
...i || ju
|
|
6168
6222
|
};
|
|
6169
6223
|
}, [
|
|
6170
6224
|
E.source,
|
|
@@ -6226,7 +6280,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6226
6280
|
"data-id": e,
|
|
6227
6281
|
"data-testid": `rf__edge-${e}`,
|
|
6228
6282
|
"aria-label": E.ariaLabel === null ? void 0 : E.ariaLabel || `Edge from ${E.source} to ${E.target}`,
|
|
6229
|
-
"aria-describedby": A ? `${
|
|
6283
|
+
"aria-describedby": A ? `${gc}-${b}` : void 0,
|
|
6230
6284
|
ref: N,
|
|
6231
6285
|
...E.domAttributes,
|
|
6232
6286
|
children: [!I && g(k, {
|
|
@@ -6258,7 +6312,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6258
6312
|
markerEnd: ne,
|
|
6259
6313
|
pathOptions: "pathOptions" in E ? E.pathOptions : void 0,
|
|
6260
6314
|
interactionWidth: E.interactionWidth
|
|
6261
|
-
}), j && g(
|
|
6315
|
+
}), j && g(Iu, {
|
|
6262
6316
|
edge: E,
|
|
6263
6317
|
isReconnectable: j,
|
|
6264
6318
|
reconnectRadius: m,
|
|
@@ -6277,21 +6331,21 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
|
|
|
6277
6331
|
})
|
|
6278
6332
|
});
|
|
6279
6333
|
}
|
|
6280
|
-
var
|
|
6334
|
+
var Ru = i(Lu), zu = (e) => ({
|
|
6281
6335
|
edgesFocusable: e.edgesFocusable,
|
|
6282
6336
|
edgesReconnectable: e.edgesReconnectable,
|
|
6283
6337
|
elementsSelectable: e.elementsSelectable,
|
|
6284
6338
|
connectionMode: e.connectionMode,
|
|
6285
6339
|
onError: e.onError
|
|
6286
6340
|
});
|
|
6287
|
-
function
|
|
6288
|
-
let { edgesFocusable: v, edgesReconnectable: y, elementsSelectable: b, onError: x } = Z(
|
|
6341
|
+
function Bu({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: r, noPanClassName: i, onReconnect: a, onEdgeContextMenu: o, onEdgeMouseEnter: s, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: u, reconnectRadius: d, onEdgeDoubleClick: f, onReconnectStart: p, onReconnectEnd: m, disableKeyboardA11y: h }) {
|
|
6342
|
+
let { edgesFocusable: v, edgesReconnectable: y, elementsSelectable: b, onError: x } = Z(zu, X), S = nu(t);
|
|
6289
6343
|
return _("div", {
|
|
6290
6344
|
className: "react-flow__edges",
|
|
6291
|
-
children: [g(
|
|
6345
|
+
children: [g(lu, {
|
|
6292
6346
|
defaultColor: e,
|
|
6293
6347
|
rfId: n
|
|
6294
|
-
}), S.map((e) => g(
|
|
6348
|
+
}), S.map((e) => g(Ru, {
|
|
6295
6349
|
id: e,
|
|
6296
6350
|
edgesFocusable: v,
|
|
6297
6351
|
edgesReconnectable: y,
|
|
@@ -6314,24 +6368,24 @@ function zu({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edge
|
|
|
6314
6368
|
}, e))]
|
|
6315
6369
|
});
|
|
6316
6370
|
}
|
|
6317
|
-
|
|
6318
|
-
var
|
|
6319
|
-
function
|
|
6371
|
+
Bu.displayName = "EdgeRenderer";
|
|
6372
|
+
var Vu = i(Bu), Hu = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
|
|
6373
|
+
function Uu({ children: e }) {
|
|
6320
6374
|
return g("div", {
|
|
6321
6375
|
className: "react-flow__viewport xyflow__viewport react-flow__container",
|
|
6322
|
-
style: { transform: Z(
|
|
6376
|
+
style: { transform: Z(Hu) },
|
|
6323
6377
|
children: e
|
|
6324
6378
|
});
|
|
6325
6379
|
}
|
|
6326
|
-
function
|
|
6327
|
-
let t =
|
|
6380
|
+
function Wu(e) {
|
|
6381
|
+
let t = ll(), n = d(!1);
|
|
6328
6382
|
c(() => {
|
|
6329
6383
|
!n.current && t.viewportInitialized && e && (setTimeout(() => e(t), 1), n.current = !0);
|
|
6330
6384
|
}, [e, t.viewportInitialized]);
|
|
6331
6385
|
}
|
|
6332
|
-
var
|
|
6333
|
-
function
|
|
6334
|
-
let t = Z(
|
|
6386
|
+
var Gu = (e) => e.panZoom?.syncViewport;
|
|
6387
|
+
function Ku(e) {
|
|
6388
|
+
let t = Z(Gu), n = Q();
|
|
6335
6389
|
return c(() => {
|
|
6336
6390
|
e && (t?.(e), n.setState({ transform: [
|
|
6337
6391
|
e.x,
|
|
@@ -6340,27 +6394,27 @@ function Gu(e) {
|
|
|
6340
6394
|
] }));
|
|
6341
6395
|
}, [e, t]), null;
|
|
6342
6396
|
}
|
|
6343
|
-
function
|
|
6397
|
+
function qu(e) {
|
|
6344
6398
|
return e.connection.inProgress ? {
|
|
6345
6399
|
...e.connection,
|
|
6346
6400
|
to: Qa(e.connection.to, e.transform)
|
|
6347
6401
|
} : { ...e.connection };
|
|
6348
6402
|
}
|
|
6349
|
-
function qu(e) {
|
|
6350
|
-
return e ? (t) => e(Ku(t)) : Ku;
|
|
6351
|
-
}
|
|
6352
6403
|
function Ju(e) {
|
|
6353
|
-
return
|
|
6404
|
+
return e ? (t) => e(qu(t)) : qu;
|
|
6354
6405
|
}
|
|
6355
|
-
|
|
6406
|
+
function Yu(e) {
|
|
6407
|
+
return Z(Ju(e), X);
|
|
6408
|
+
}
|
|
6409
|
+
var Xu = (e) => ({
|
|
6356
6410
|
nodesConnectable: e.nodesConnectable,
|
|
6357
6411
|
isValid: e.connection.isValid,
|
|
6358
6412
|
inProgress: e.connection.inProgress,
|
|
6359
6413
|
width: e.width,
|
|
6360
6414
|
height: e.height
|
|
6361
6415
|
});
|
|
6362
|
-
function
|
|
6363
|
-
let { nodesConnectable: i, width: a, height: o, isValid: s, inProgress: c } = Z(
|
|
6416
|
+
function Zu({ containerStyle: e, style: t, type: n, component: r }) {
|
|
6417
|
+
let { nodesConnectable: i, width: a, height: o, isValid: s, inProgress: c } = Z(Xu, X);
|
|
6364
6418
|
return a && i && c ? g("svg", {
|
|
6365
6419
|
style: e,
|
|
6366
6420
|
width: a,
|
|
@@ -6368,7 +6422,7 @@ function Xu({ containerStyle: e, style: t, type: n, component: r }) {
|
|
|
6368
6422
|
className: "react-flow__connectionline react-flow__container",
|
|
6369
6423
|
children: g("g", {
|
|
6370
6424
|
className: S(["react-flow__connection", Ca(s)]),
|
|
6371
|
-
children: g(
|
|
6425
|
+
children: g(Qu, {
|
|
6372
6426
|
style: t,
|
|
6373
6427
|
type: n,
|
|
6374
6428
|
CustomComponent: r,
|
|
@@ -6377,8 +6431,8 @@ function Xu({ containerStyle: e, style: t, type: n, component: r }) {
|
|
|
6377
6431
|
})
|
|
6378
6432
|
}) : null;
|
|
6379
6433
|
}
|
|
6380
|
-
var
|
|
6381
|
-
let { inProgress: i, from: a, fromNode: o, fromHandle: s, fromPosition: c, to: l, toNode: u, toHandle: d, toPosition: f, pointer: p } =
|
|
6434
|
+
var Qu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) => {
|
|
6435
|
+
let { inProgress: i, from: a, fromNode: o, fromHandle: s, fromPosition: c, to: l, toNode: u, toHandle: d, toPosition: f, pointer: p } = Yu();
|
|
6382
6436
|
if (!i) return;
|
|
6383
6437
|
if (n) return g(n, {
|
|
6384
6438
|
connectionLineType: t,
|
|
@@ -6409,7 +6463,7 @@ var Zu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) =>
|
|
|
6409
6463
|
[m] = wo(h);
|
|
6410
6464
|
break;
|
|
6411
6465
|
case ba.SimpleBezier:
|
|
6412
|
-
[m] =
|
|
6466
|
+
[m] = mu(h);
|
|
6413
6467
|
break;
|
|
6414
6468
|
case ba.Step:
|
|
6415
6469
|
[m] = Lo({
|
|
@@ -6429,9 +6483,9 @@ var Zu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) =>
|
|
|
6429
6483
|
style: e
|
|
6430
6484
|
});
|
|
6431
6485
|
};
|
|
6432
|
-
|
|
6433
|
-
var
|
|
6434
|
-
function
|
|
6486
|
+
Qu.displayName = "ConnectionLine";
|
|
6487
|
+
var $u = {};
|
|
6488
|
+
function ed(e = $u) {
|
|
6435
6489
|
let t = d(e), n = Q();
|
|
6436
6490
|
c(() => {
|
|
6437
6491
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -6444,7 +6498,7 @@ function $u(e = Qu) {
|
|
|
6444
6498
|
}
|
|
6445
6499
|
}, [e]);
|
|
6446
6500
|
}
|
|
6447
|
-
function
|
|
6501
|
+
function td() {
|
|
6448
6502
|
let e = Q(), t = d(!1);
|
|
6449
6503
|
c(() => {
|
|
6450
6504
|
if (process.env.NODE_ENV === "development" && !t.current) {
|
|
@@ -6453,15 +6507,15 @@ function ed() {
|
|
|
6453
6507
|
}
|
|
6454
6508
|
}, []);
|
|
6455
6509
|
}
|
|
6456
|
-
function
|
|
6457
|
-
return
|
|
6458
|
-
onPaneClick:
|
|
6459
|
-
onPaneMouseEnter:
|
|
6460
|
-
onPaneMouseMove:
|
|
6461
|
-
onPaneMouseLeave:
|
|
6462
|
-
onPaneContextMenu:
|
|
6463
|
-
onPaneScroll:
|
|
6464
|
-
paneClickDistance:
|
|
6510
|
+
function nd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: i, onNodeDoubleClick: a, onEdgeDoubleClick: o, onNodeMouseEnter: s, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: u, onSelectionContextMenu: d, onSelectionStart: f, onSelectionEnd: p, connectionLineType: m, connectionLineStyle: h, connectionLineComponent: v, connectionLineContainerStyle: y, selectionKeyCode: b, selectionOnDrag: x, selectionMode: S, multiSelectionKeyCode: C, panActivationKeyCode: w, zoomActivationKeyCode: T, deleteKeyCode: E, onlyRenderVisibleElements: D, elementsSelectable: O, defaultViewport: k, translateExtent: A, minZoom: j, maxZoom: M, preventScrolling: N, defaultMarkerColor: P, zoomOnScroll: F, zoomOnPinch: I, panOnScroll: L, panOnScrollSpeed: R, panOnScrollMode: ee, zoomOnDoubleClick: z, panOnDrag: B, autoPanOnSelection: V, onPaneClick: H, onPaneMouseEnter: U, onPaneMouseMove: W, onPaneMouseLeave: te, onPaneScroll: ne, onPaneContextMenu: re, paneClickDistance: ie, nodeClickDistance: ae, onEdgeContextMenu: oe, onEdgeMouseEnter: se, onEdgeMouseMove: ce, onEdgeMouseLeave: le, reconnectRadius: ue, onReconnect: de, onReconnectStart: fe, onReconnectEnd: pe, noDragClassName: me, noWheelClassName: he, noPanClassName: ge, disableKeyboardA11y: _e, nodeExtent: ve, rfId: ye, viewport: be, onViewportChange: xe }) {
|
|
6511
|
+
return ed(e), ed(t), td(), Wu(n), Ku(be), g(Gl, {
|
|
6512
|
+
onPaneClick: H,
|
|
6513
|
+
onPaneMouseEnter: U,
|
|
6514
|
+
onPaneMouseMove: W,
|
|
6515
|
+
onPaneMouseLeave: te,
|
|
6516
|
+
onPaneContextMenu: re,
|
|
6517
|
+
onPaneScroll: ne,
|
|
6518
|
+
paneClickDistance: ie,
|
|
6465
6519
|
deleteKeyCode: E,
|
|
6466
6520
|
selectionKeyCode: b,
|
|
6467
6521
|
selectionOnDrag: x,
|
|
@@ -6479,45 +6533,46 @@ function td({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
|
|
|
6479
6533
|
panOnScrollSpeed: R,
|
|
6480
6534
|
panOnScrollMode: ee,
|
|
6481
6535
|
panOnDrag: B,
|
|
6536
|
+
autoPanOnSelection: V,
|
|
6482
6537
|
defaultViewport: k,
|
|
6483
6538
|
translateExtent: A,
|
|
6484
6539
|
minZoom: j,
|
|
6485
6540
|
maxZoom: M,
|
|
6486
6541
|
onSelectionContextMenu: d,
|
|
6487
6542
|
preventScrolling: N,
|
|
6488
|
-
noDragClassName:
|
|
6489
|
-
noWheelClassName:
|
|
6490
|
-
noPanClassName:
|
|
6491
|
-
disableKeyboardA11y:
|
|
6492
|
-
onViewportChange:
|
|
6493
|
-
isControlledViewport: !!
|
|
6494
|
-
children: _(
|
|
6495
|
-
g(
|
|
6543
|
+
noDragClassName: me,
|
|
6544
|
+
noWheelClassName: he,
|
|
6545
|
+
noPanClassName: ge,
|
|
6546
|
+
disableKeyboardA11y: _e,
|
|
6547
|
+
onViewportChange: xe,
|
|
6548
|
+
isControlledViewport: !!be,
|
|
6549
|
+
children: _(Uu, { children: [
|
|
6550
|
+
g(Vu, {
|
|
6496
6551
|
edgeTypes: t,
|
|
6497
6552
|
onEdgeClick: i,
|
|
6498
6553
|
onEdgeDoubleClick: o,
|
|
6499
|
-
onReconnect:
|
|
6500
|
-
onReconnectStart:
|
|
6501
|
-
onReconnectEnd:
|
|
6554
|
+
onReconnect: de,
|
|
6555
|
+
onReconnectStart: fe,
|
|
6556
|
+
onReconnectEnd: pe,
|
|
6502
6557
|
onlyRenderVisibleElements: D,
|
|
6503
|
-
onEdgeContextMenu:
|
|
6504
|
-
onEdgeMouseEnter:
|
|
6505
|
-
onEdgeMouseMove:
|
|
6506
|
-
onEdgeMouseLeave:
|
|
6507
|
-
reconnectRadius:
|
|
6558
|
+
onEdgeContextMenu: oe,
|
|
6559
|
+
onEdgeMouseEnter: se,
|
|
6560
|
+
onEdgeMouseMove: ce,
|
|
6561
|
+
onEdgeMouseLeave: le,
|
|
6562
|
+
reconnectRadius: ue,
|
|
6508
6563
|
defaultMarkerColor: P,
|
|
6509
|
-
noPanClassName:
|
|
6510
|
-
disableKeyboardA11y:
|
|
6511
|
-
rfId:
|
|
6564
|
+
noPanClassName: ge,
|
|
6565
|
+
disableKeyboardA11y: _e,
|
|
6566
|
+
rfId: ye
|
|
6512
6567
|
}),
|
|
6513
|
-
g(
|
|
6568
|
+
g(Zu, {
|
|
6514
6569
|
style: h,
|
|
6515
6570
|
type: m,
|
|
6516
6571
|
component: v,
|
|
6517
6572
|
containerStyle: y
|
|
6518
6573
|
}),
|
|
6519
6574
|
g("div", { className: "react-flow__edgelabel-renderer" }),
|
|
6520
|
-
g(
|
|
6575
|
+
g(tu, {
|
|
6521
6576
|
nodeTypes: e,
|
|
6522
6577
|
onNodeClick: r,
|
|
6523
6578
|
onNodeDoubleClick: a,
|
|
@@ -6525,23 +6580,23 @@ function td({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
|
|
|
6525
6580
|
onNodeMouseMove: c,
|
|
6526
6581
|
onNodeMouseLeave: l,
|
|
6527
6582
|
onNodeContextMenu: u,
|
|
6528
|
-
nodeClickDistance:
|
|
6583
|
+
nodeClickDistance: ae,
|
|
6529
6584
|
onlyRenderVisibleElements: D,
|
|
6530
|
-
noPanClassName:
|
|
6531
|
-
noDragClassName:
|
|
6532
|
-
disableKeyboardA11y:
|
|
6533
|
-
nodeExtent:
|
|
6534
|
-
rfId:
|
|
6585
|
+
noPanClassName: ge,
|
|
6586
|
+
noDragClassName: me,
|
|
6587
|
+
disableKeyboardA11y: _e,
|
|
6588
|
+
nodeExtent: ve,
|
|
6589
|
+
rfId: ye
|
|
6535
6590
|
}),
|
|
6536
6591
|
g("div", { className: "react-flow__viewport-portal" })
|
|
6537
6592
|
] })
|
|
6538
6593
|
});
|
|
6539
6594
|
}
|
|
6540
|
-
|
|
6541
|
-
var
|
|
6595
|
+
nd.displayName = "GraphView";
|
|
6596
|
+
var rd = i(nd), id = Xa("React Flow", "https://reactflow.dev/"), ad = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c = .5, maxZoom: l = 2, nodeOrigin: u, nodeExtent: d, zIndexMode: f = "basic" } = {}) => {
|
|
6542
6597
|
let p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), _ = r ?? t ?? [], v = n ?? e ?? [], y = u ?? [0, 0], b = d ?? pa;
|
|
6543
6598
|
cs(h, g, _);
|
|
6544
|
-
let x = $o(v, p, m, {
|
|
6599
|
+
let { nodesInitialized: x } = $o(v, p, m, {
|
|
6545
6600
|
nodeOrigin: y,
|
|
6546
6601
|
nodeExtent: b,
|
|
6547
6602
|
zIndexMode: f
|
|
@@ -6613,7 +6668,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6613
6668
|
autoPanOnNodeFocus: !0,
|
|
6614
6669
|
autoPanSpeed: 15,
|
|
6615
6670
|
connectionRadius: 20,
|
|
6616
|
-
onError:
|
|
6671
|
+
onError: id,
|
|
6617
6672
|
isValidConnection: void 0,
|
|
6618
6673
|
onSelectionChangeHandlers: [],
|
|
6619
6674
|
lib: "react",
|
|
@@ -6623,7 +6678,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6623
6678
|
onNodesChangeMiddlewareMap: /* @__PURE__ */ new Map(),
|
|
6624
6679
|
onEdgesChangeMiddlewareMap: /* @__PURE__ */ new Map()
|
|
6625
6680
|
};
|
|
6626
|
-
},
|
|
6681
|
+
}, od = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c, maxZoom: l, nodeOrigin: u, nodeExtent: d, zIndexMode: f }) => lc((p, m) => {
|
|
6627
6682
|
async function h() {
|
|
6628
6683
|
let { nodeLookup: e, panZoom: t, fitViewOptions: n, fitViewResolver: r, width: i, height: a, minZoom: o, maxZoom: s } = m();
|
|
6629
6684
|
t && (await Na({
|
|
@@ -6636,7 +6691,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6636
6691
|
}, n), r?.resolve(!0), p({ fitViewResolver: null }));
|
|
6637
6692
|
}
|
|
6638
6693
|
return {
|
|
6639
|
-
...
|
|
6694
|
+
...ad({
|
|
6640
6695
|
nodes: e,
|
|
6641
6696
|
edges: t,
|
|
6642
6697
|
width: i,
|
|
@@ -6652,21 +6707,23 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6652
6707
|
zIndexMode: f
|
|
6653
6708
|
}),
|
|
6654
6709
|
setNodes: (e) => {
|
|
6655
|
-
let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o } = m(),
|
|
6710
|
+
let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o, nodesSelectionActive: s } = m(), { nodesInitialized: c, hasSelectedNodes: l } = $o(e, t, n, {
|
|
6656
6711
|
nodeOrigin: r,
|
|
6657
6712
|
nodeExtent: d,
|
|
6658
6713
|
elevateNodesOnSelect: i,
|
|
6659
6714
|
checkEquality: !0,
|
|
6660
6715
|
zIndexMode: o
|
|
6661
|
-
});
|
|
6662
|
-
a &&
|
|
6716
|
+
}), u = s && l;
|
|
6717
|
+
a && c ? (h(), p({
|
|
6663
6718
|
nodes: e,
|
|
6664
|
-
nodesInitialized:
|
|
6719
|
+
nodesInitialized: c,
|
|
6665
6720
|
fitViewQueued: !1,
|
|
6666
|
-
fitViewOptions: void 0
|
|
6721
|
+
fitViewOptions: void 0,
|
|
6722
|
+
nodesSelectionActive: u
|
|
6667
6723
|
})) : p({
|
|
6668
6724
|
nodes: e,
|
|
6669
|
-
nodesInitialized:
|
|
6725
|
+
nodesInitialized: c,
|
|
6726
|
+
nodesSelectionActive: u
|
|
6670
6727
|
});
|
|
6671
6728
|
},
|
|
6672
6729
|
setEdges: (e) => {
|
|
@@ -6732,37 +6789,37 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6732
6789
|
},
|
|
6733
6790
|
triggerNodeChanges: (e) => {
|
|
6734
6791
|
let { onNodesChange: t, setNodes: n, nodes: r, hasDefaultNodes: i, debug: a } = m();
|
|
6735
|
-
e?.length && (i && n(
|
|
6792
|
+
e?.length && (i && n(Gc(e, r)), a && console.log("React Flow: trigger node changes", e), t?.(e));
|
|
6736
6793
|
},
|
|
6737
6794
|
triggerEdgeChanges: (e) => {
|
|
6738
6795
|
let { onEdgesChange: t, setEdges: n, edges: r, hasDefaultEdges: i, debug: a } = m();
|
|
6739
|
-
e?.length && (i && n(
|
|
6796
|
+
e?.length && (i && n(Kc(e, r)), a && console.log("React Flow: trigger edge changes", e), t?.(e));
|
|
6740
6797
|
},
|
|
6741
6798
|
addSelectedNodes: (e) => {
|
|
6742
6799
|
let { multiSelectionActive: t, edgeLookup: n, nodeLookup: r, triggerNodeChanges: i, triggerEdgeChanges: a } = m();
|
|
6743
6800
|
if (t) {
|
|
6744
|
-
i(e.map((e) =>
|
|
6801
|
+
i(e.map((e) => qc(e, !0)));
|
|
6745
6802
|
return;
|
|
6746
6803
|
}
|
|
6747
|
-
i(
|
|
6804
|
+
i(Jc(r, new Set([...e]), !0)), a(Jc(n));
|
|
6748
6805
|
},
|
|
6749
6806
|
addSelectedEdges: (e) => {
|
|
6750
6807
|
let { multiSelectionActive: t, edgeLookup: n, nodeLookup: r, triggerNodeChanges: i, triggerEdgeChanges: a } = m();
|
|
6751
6808
|
if (t) {
|
|
6752
|
-
a(e.map((e) =>
|
|
6809
|
+
a(e.map((e) => qc(e, !0)));
|
|
6753
6810
|
return;
|
|
6754
6811
|
}
|
|
6755
|
-
a(
|
|
6812
|
+
a(Jc(n, new Set([...e]))), i(Jc(r, /* @__PURE__ */ new Set(), !0));
|
|
6756
6813
|
},
|
|
6757
6814
|
unselectNodesAndEdges: ({ nodes: e, edges: t } = {}) => {
|
|
6758
6815
|
let { edges: n, nodes: r, nodeLookup: i, triggerNodeChanges: a, triggerEdgeChanges: o } = m(), s = e || r, c = t || n, l = [];
|
|
6759
6816
|
for (let e of s) {
|
|
6760
6817
|
if (!e.selected) continue;
|
|
6761
6818
|
let t = i.get(e.id);
|
|
6762
|
-
t && (t.selected = !1), l.push(
|
|
6819
|
+
t && (t.selected = !1), l.push(qc(e.id, !1));
|
|
6763
6820
|
}
|
|
6764
6821
|
let u = [];
|
|
6765
|
-
for (let e of c) e.selected && u.push(
|
|
6822
|
+
for (let e of c) e.selected && u.push(qc(e.id, !1));
|
|
6766
6823
|
a(l), o(u);
|
|
6767
6824
|
},
|
|
6768
6825
|
setMinZoom: (e) => {
|
|
@@ -6779,7 +6836,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6779
6836
|
resetSelectedElements: () => {
|
|
6780
6837
|
let { edges: e, nodes: t, triggerNodeChanges: n, triggerEdgeChanges: r, elementsSelectable: i } = m();
|
|
6781
6838
|
if (!i) return;
|
|
6782
|
-
let a = t.reduce((e, t) => t.selected ? [...e,
|
|
6839
|
+
let a = t.reduce((e, t) => t.selected ? [...e, qc(t.id, !1)] : e, []), o = e.reduce((e, t) => t.selected ? [...e, qc(t.id, !1)] : e, []);
|
|
6783
6840
|
n(a), r(o);
|
|
6784
6841
|
},
|
|
6785
6842
|
setNodeExtent: (e) => {
|
|
@@ -6805,7 +6862,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6805
6862
|
},
|
|
6806
6863
|
setCenter: async (e, t, n) => {
|
|
6807
6864
|
let { width: r, height: i, maxZoom: a, panZoom: o } = m();
|
|
6808
|
-
if (!o) return
|
|
6865
|
+
if (!o) return !1;
|
|
6809
6866
|
let s = n?.zoom === void 0 ? a : n.zoom;
|
|
6810
6867
|
return await o.setViewport({
|
|
6811
6868
|
x: r / 2 - e * s,
|
|
@@ -6815,7 +6872,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6815
6872
|
duration: n?.duration,
|
|
6816
6873
|
ease: n?.ease,
|
|
6817
6874
|
interpolate: n?.interpolate
|
|
6818
|
-
}),
|
|
6875
|
+
}), !0;
|
|
6819
6876
|
},
|
|
6820
6877
|
cancelConnection: () => {
|
|
6821
6878
|
p({ connection: { ...ya } });
|
|
@@ -6823,11 +6880,11 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
|
|
|
6823
6880
|
updateConnection: (e) => {
|
|
6824
6881
|
p({ connection: e });
|
|
6825
6882
|
},
|
|
6826
|
-
reset: () => p({ ...
|
|
6883
|
+
reset: () => p({ ...ad() })
|
|
6827
6884
|
};
|
|
6828
6885
|
}, Object.is);
|
|
6829
|
-
function
|
|
6830
|
-
let [h] = f(() =>
|
|
6886
|
+
function sd({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: r, initialWidth: i, initialHeight: a, initialMinZoom: o, initialMaxZoom: s, initialFitViewOptions: c, fitView: l, nodeOrigin: u, nodeExtent: d, zIndexMode: p, children: m }) {
|
|
6887
|
+
let [h] = f(() => od({
|
|
6831
6888
|
nodes: e,
|
|
6832
6889
|
edges: t,
|
|
6833
6890
|
defaultNodes: n,
|
|
@@ -6842,13 +6899,13 @@ function ad({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: r
|
|
|
6842
6899
|
nodeExtent: d,
|
|
6843
6900
|
zIndexMode: p
|
|
6844
6901
|
}));
|
|
6845
|
-
return g(
|
|
6902
|
+
return g(dc, {
|
|
6846
6903
|
value: h,
|
|
6847
|
-
children: g(
|
|
6904
|
+
children: g(ol, { children: m })
|
|
6848
6905
|
});
|
|
6849
6906
|
}
|
|
6850
|
-
function
|
|
6851
|
-
return o(
|
|
6907
|
+
function cd({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i, width: a, height: s, fitView: c, fitViewOptions: l, minZoom: u, maxZoom: d, nodeOrigin: f, nodeExtent: p, zIndexMode: m }) {
|
|
6908
|
+
return o(uc) ? g(h, { children: e }) : g(sd, {
|
|
6852
6909
|
initialNodes: t,
|
|
6853
6910
|
initialEdges: n,
|
|
6854
6911
|
defaultNodes: r,
|
|
@@ -6865,51 +6922,112 @@ function od({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i,
|
|
|
6865
6922
|
children: e
|
|
6866
6923
|
});
|
|
6867
6924
|
}
|
|
6868
|
-
var
|
|
6925
|
+
var ld = {
|
|
6869
6926
|
width: "100%",
|
|
6870
6927
|
height: "100%",
|
|
6871
6928
|
overflow: "hidden",
|
|
6872
6929
|
position: "relative",
|
|
6873
6930
|
zIndex: 0
|
|
6874
6931
|
};
|
|
6875
|
-
function
|
|
6876
|
-
let
|
|
6932
|
+
function ud({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: o, edgeTypes: s, onNodeClick: c, onEdgeClick: l, onInit: u, onMove: d, onMoveStart: f, onMoveEnd: p, onConnect: m, onConnectStart: h, onConnectEnd: v, onClickConnectStart: y, onClickConnectEnd: b, onNodeMouseEnter: x, onNodeMouseMove: C, onNodeMouseLeave: w, onNodeContextMenu: T, onNodeDoubleClick: E, onNodeDragStart: D, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: A, onEdgesDelete: j, onDelete: M, onSelectionChange: N, onSelectionDragStart: P, onSelectionDrag: F, onSelectionDragStop: I, onSelectionContextMenu: L, onSelectionStart: R, onSelectionEnd: ee, onBeforeDelete: z, connectionMode: B, connectionLineType: V = ba.Bezier, connectionLineStyle: H, connectionLineComponent: U, connectionLineContainerStyle: W, deleteKeyCode: te = "Backspace", selectionKeyCode: ne = "Shift", selectionOnDrag: re = !1, selectionMode: ie = va.Full, panActivationKeyCode: ae = "Space", multiSelectionKeyCode: oe = io() ? "Meta" : "Control", zoomActivationKeyCode: se = io() ? "Meta" : "Control", snapToGrid: ce, snapGrid: le, onlyRenderVisibleElements: ue = !1, selectNodesOnDrag: de, nodesDraggable: fe, autoPanOnNodeFocus: pe, nodesConnectable: me, nodesFocusable: he, nodeOrigin: ge = Ac, edgesFocusable: _e, edgesReconnectable: ve, elementsSelectable: ye = !0, defaultViewport: be = jc, minZoom: xe = .5, maxZoom: Se = 2, translateExtent: Ce = pa, preventScrolling: we = !0, nodeExtent: Te, defaultMarkerColor: Ee = "#b1b1b7", zoomOnScroll: De = !0, zoomOnPinch: Oe = !0, panOnScroll: ke = !1, panOnScrollSpeed: Ae = .5, panOnScrollMode: je = _a.Free, zoomOnDoubleClick: Me = !0, panOnDrag: Ne = !0, onPaneClick: Pe, onPaneMouseEnter: Fe, onPaneMouseMove: Ie, onPaneMouseLeave: Le, onPaneScroll: Re, onPaneContextMenu: ze, paneClickDistance: Be = 1, nodeClickDistance: Ve = 0, children: He, onReconnect: Ue, onReconnectStart: We, onReconnectEnd: Ge, onEdgeContextMenu: Ke, onEdgeDoubleClick: qe, onEdgeMouseEnter: Je, onEdgeMouseMove: Ye, onEdgeMouseLeave: Xe, reconnectRadius: Ze = 10, onNodesChange: Qe, onEdgesChange: $e, noDragClassName: et = "nodrag", noWheelClassName: tt = "nowheel", noPanClassName: nt = "nopan", fitView: rt, fitViewOptions: it, connectOnClick: at, attributionPosition: ot, proOptions: st, defaultEdgeOptions: ct, elevateNodesOnSelect: lt = !0, elevateEdgesOnSelect: ut = !1, disableKeyboardA11y: dt = !1, autoPanOnConnect: ft, autoPanOnNodeDrag: pt, autoPanOnSelection: mt = !0, autoPanSpeed: ht, connectionRadius: gt, isValidConnection: _t, onError: vt, style: yt, id: bt, nodeDragThreshold: xt, connectionDragThreshold: St, viewport: Ct, onViewportChange: wt, width: Tt, height: Et, colorMode: Dt = "light", debug: Ot, onScroll: kt, ariaLabelConfig: At, zIndexMode: jt = "basic", ...Mt }, G) {
|
|
6933
|
+
let Nt = bt || "1", Pt = Lc(Dt), K = a((e) => {
|
|
6877
6934
|
e.currentTarget.scrollTo({
|
|
6878
6935
|
top: 0,
|
|
6879
6936
|
left: 0,
|
|
6880
6937
|
behavior: "instant"
|
|
6881
|
-
}),
|
|
6882
|
-
}, [
|
|
6938
|
+
}), kt?.(e);
|
|
6939
|
+
}, [kt]);
|
|
6883
6940
|
return g("div", {
|
|
6884
6941
|
"data-testid": "rf__wrapper",
|
|
6885
|
-
...
|
|
6886
|
-
onScroll:
|
|
6942
|
+
...Mt,
|
|
6943
|
+
onScroll: K,
|
|
6887
6944
|
style: {
|
|
6888
|
-
...
|
|
6889
|
-
...
|
|
6945
|
+
...yt,
|
|
6946
|
+
...ld
|
|
6890
6947
|
},
|
|
6891
|
-
ref:
|
|
6948
|
+
ref: G,
|
|
6892
6949
|
className: S([
|
|
6893
6950
|
"react-flow",
|
|
6894
6951
|
i,
|
|
6895
|
-
|
|
6952
|
+
Pt
|
|
6896
6953
|
]),
|
|
6897
|
-
id:
|
|
6954
|
+
id: bt,
|
|
6898
6955
|
role: "application",
|
|
6899
|
-
children: _(
|
|
6956
|
+
children: _(cd, {
|
|
6900
6957
|
nodes: e,
|
|
6901
6958
|
edges: t,
|
|
6902
|
-
width:
|
|
6903
|
-
height:
|
|
6959
|
+
width: Tt,
|
|
6960
|
+
height: Et,
|
|
6904
6961
|
fitView: rt,
|
|
6905
6962
|
fitViewOptions: it,
|
|
6906
6963
|
minZoom: xe,
|
|
6907
6964
|
maxZoom: Se,
|
|
6908
6965
|
nodeOrigin: ge,
|
|
6909
6966
|
nodeExtent: Te,
|
|
6910
|
-
zIndexMode:
|
|
6967
|
+
zIndexMode: jt,
|
|
6911
6968
|
children: [
|
|
6912
|
-
g(
|
|
6969
|
+
g(Fc, {
|
|
6970
|
+
nodes: e,
|
|
6971
|
+
edges: t,
|
|
6972
|
+
defaultNodes: n,
|
|
6973
|
+
defaultEdges: r,
|
|
6974
|
+
onConnect: m,
|
|
6975
|
+
onConnectStart: h,
|
|
6976
|
+
onConnectEnd: v,
|
|
6977
|
+
onClickConnectStart: y,
|
|
6978
|
+
onClickConnectEnd: b,
|
|
6979
|
+
nodesDraggable: fe,
|
|
6980
|
+
autoPanOnNodeFocus: pe,
|
|
6981
|
+
nodesConnectable: me,
|
|
6982
|
+
nodesFocusable: he,
|
|
6983
|
+
edgesFocusable: _e,
|
|
6984
|
+
edgesReconnectable: ve,
|
|
6985
|
+
elementsSelectable: ye,
|
|
6986
|
+
elevateNodesOnSelect: lt,
|
|
6987
|
+
elevateEdgesOnSelect: ut,
|
|
6988
|
+
minZoom: xe,
|
|
6989
|
+
maxZoom: Se,
|
|
6990
|
+
nodeExtent: Te,
|
|
6991
|
+
onNodesChange: Qe,
|
|
6992
|
+
onEdgesChange: $e,
|
|
6993
|
+
snapToGrid: ce,
|
|
6994
|
+
snapGrid: le,
|
|
6995
|
+
connectionMode: B,
|
|
6996
|
+
translateExtent: Ce,
|
|
6997
|
+
connectOnClick: at,
|
|
6998
|
+
defaultEdgeOptions: ct,
|
|
6999
|
+
fitView: rt,
|
|
7000
|
+
fitViewOptions: it,
|
|
7001
|
+
onNodesDelete: A,
|
|
7002
|
+
onEdgesDelete: j,
|
|
7003
|
+
onDelete: M,
|
|
7004
|
+
onNodeDragStart: D,
|
|
7005
|
+
onNodeDrag: O,
|
|
7006
|
+
onNodeDragStop: k,
|
|
7007
|
+
onSelectionDrag: F,
|
|
7008
|
+
onSelectionDragStart: P,
|
|
7009
|
+
onSelectionDragStop: I,
|
|
7010
|
+
onMove: d,
|
|
7011
|
+
onMoveStart: f,
|
|
7012
|
+
onMoveEnd: p,
|
|
7013
|
+
noPanClassName: nt,
|
|
7014
|
+
nodeOrigin: ge,
|
|
7015
|
+
rfId: Nt,
|
|
7016
|
+
autoPanOnConnect: ft,
|
|
7017
|
+
autoPanOnNodeDrag: pt,
|
|
7018
|
+
autoPanSpeed: ht,
|
|
7019
|
+
onError: vt,
|
|
7020
|
+
connectionRadius: gt,
|
|
7021
|
+
isValidConnection: _t,
|
|
7022
|
+
selectNodesOnDrag: de,
|
|
7023
|
+
nodeDragThreshold: xt,
|
|
7024
|
+
connectionDragThreshold: St,
|
|
7025
|
+
onBeforeDelete: z,
|
|
7026
|
+
debug: Ot,
|
|
7027
|
+
ariaLabelConfig: At,
|
|
7028
|
+
zIndexMode: jt
|
|
7029
|
+
}),
|
|
7030
|
+
g(rd, {
|
|
6913
7031
|
onInit: u,
|
|
6914
7032
|
onNodeClick: c,
|
|
6915
7033
|
onEdgeClick: l,
|
|
@@ -6944,6 +7062,7 @@ function cd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
|
|
|
6944
7062
|
panOnScrollSpeed: Ae,
|
|
6945
7063
|
panOnScrollMode: je,
|
|
6946
7064
|
panOnDrag: Ne,
|
|
7065
|
+
autoPanOnSelection: mt,
|
|
6947
7066
|
onPaneClick: Pe,
|
|
6948
7067
|
onPaneMouseEnter: Fe,
|
|
6949
7068
|
onPaneMouseMove: Ie,
|
|
@@ -6968,90 +7087,45 @@ function cd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
|
|
|
6968
7087
|
noDragClassName: et,
|
|
6969
7088
|
noWheelClassName: tt,
|
|
6970
7089
|
noPanClassName: nt,
|
|
6971
|
-
rfId:
|
|
7090
|
+
rfId: Nt,
|
|
6972
7091
|
disableKeyboardA11y: dt,
|
|
6973
7092
|
nodeExtent: Te,
|
|
6974
|
-
viewport:
|
|
6975
|
-
onViewportChange:
|
|
7093
|
+
viewport: Ct,
|
|
7094
|
+
onViewportChange: wt
|
|
6976
7095
|
}),
|
|
6977
|
-
g(
|
|
6978
|
-
nodes: e,
|
|
6979
|
-
edges: t,
|
|
6980
|
-
defaultNodes: n,
|
|
6981
|
-
defaultEdges: r,
|
|
6982
|
-
onConnect: m,
|
|
6983
|
-
onConnectStart: h,
|
|
6984
|
-
onConnectEnd: v,
|
|
6985
|
-
onClickConnectStart: y,
|
|
6986
|
-
onClickConnectEnd: b,
|
|
6987
|
-
nodesDraggable: fe,
|
|
6988
|
-
autoPanOnNodeFocus: pe,
|
|
6989
|
-
nodesConnectable: me,
|
|
6990
|
-
nodesFocusable: he,
|
|
6991
|
-
edgesFocusable: _e,
|
|
6992
|
-
edgesReconnectable: ve,
|
|
6993
|
-
elementsSelectable: ye,
|
|
6994
|
-
elevateNodesOnSelect: lt,
|
|
6995
|
-
elevateEdgesOnSelect: ut,
|
|
6996
|
-
minZoom: xe,
|
|
6997
|
-
maxZoom: Se,
|
|
6998
|
-
nodeExtent: Te,
|
|
6999
|
-
onNodesChange: Qe,
|
|
7000
|
-
onEdgesChange: $e,
|
|
7001
|
-
snapToGrid: ce,
|
|
7002
|
-
snapGrid: le,
|
|
7003
|
-
connectionMode: B,
|
|
7004
|
-
translateExtent: Ce,
|
|
7005
|
-
connectOnClick: at,
|
|
7006
|
-
defaultEdgeOptions: ct,
|
|
7007
|
-
fitView: rt,
|
|
7008
|
-
fitViewOptions: it,
|
|
7009
|
-
onNodesDelete: A,
|
|
7010
|
-
onEdgesDelete: j,
|
|
7011
|
-
onDelete: M,
|
|
7012
|
-
onNodeDragStart: D,
|
|
7013
|
-
onNodeDrag: O,
|
|
7014
|
-
onNodeDragStop: k,
|
|
7015
|
-
onSelectionDrag: F,
|
|
7016
|
-
onSelectionDragStart: P,
|
|
7017
|
-
onSelectionDragStop: I,
|
|
7018
|
-
onMove: d,
|
|
7019
|
-
onMoveStart: f,
|
|
7020
|
-
onMoveEnd: p,
|
|
7021
|
-
noPanClassName: nt,
|
|
7022
|
-
nodeOrigin: ge,
|
|
7023
|
-
rfId: G,
|
|
7024
|
-
autoPanOnConnect: ft,
|
|
7025
|
-
autoPanOnNodeDrag: pt,
|
|
7026
|
-
autoPanSpeed: mt,
|
|
7027
|
-
onError: _t,
|
|
7028
|
-
connectionRadius: ht,
|
|
7029
|
-
isValidConnection: gt,
|
|
7030
|
-
selectNodesOnDrag: de,
|
|
7031
|
-
nodeDragThreshold: bt,
|
|
7032
|
-
connectionDragThreshold: xt,
|
|
7033
|
-
onBeforeDelete: z,
|
|
7034
|
-
debug: Dt,
|
|
7035
|
-
ariaLabelConfig: kt,
|
|
7036
|
-
zIndexMode: At
|
|
7037
|
-
}),
|
|
7038
|
-
g(Ac, { onSelectionChange: N }),
|
|
7096
|
+
g(kc, { onSelectionChange: N }),
|
|
7039
7097
|
He,
|
|
7040
|
-
g(
|
|
7098
|
+
g(Cc, {
|
|
7041
7099
|
proOptions: st,
|
|
7042
7100
|
position: ot
|
|
7043
7101
|
}),
|
|
7044
|
-
g(
|
|
7045
|
-
rfId:
|
|
7102
|
+
g(xc, {
|
|
7103
|
+
rfId: Nt,
|
|
7046
7104
|
disableKeyboardA11y: dt
|
|
7047
7105
|
})
|
|
7048
7106
|
]
|
|
7049
7107
|
})
|
|
7050
7108
|
});
|
|
7051
7109
|
}
|
|
7052
|
-
var
|
|
7110
|
+
var dd = tl(ud);
|
|
7111
|
+
function fd(e) {
|
|
7112
|
+
let [t, n] = f(e);
|
|
7113
|
+
return [
|
|
7114
|
+
t,
|
|
7115
|
+
n,
|
|
7116
|
+
a((e) => n((t) => Gc(e, t)), [])
|
|
7117
|
+
];
|
|
7118
|
+
}
|
|
7119
|
+
function pd(e) {
|
|
7120
|
+
let [t, n] = f(e);
|
|
7121
|
+
return [
|
|
7122
|
+
t,
|
|
7123
|
+
n,
|
|
7124
|
+
a((e) => n((t) => Kc(e, t)), [])
|
|
7125
|
+
];
|
|
7126
|
+
}
|
|
7053
7127
|
J.error014();
|
|
7054
|
-
function
|
|
7128
|
+
function md({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
7055
7129
|
return g("path", {
|
|
7056
7130
|
strokeWidth: t,
|
|
7057
7131
|
d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`,
|
|
@@ -7062,7 +7136,7 @@ function ud({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
|
7062
7136
|
])
|
|
7063
7137
|
});
|
|
7064
7138
|
}
|
|
7065
|
-
function
|
|
7139
|
+
function hd({ radius: e, className: t }) {
|
|
7066
7140
|
return g("circle", {
|
|
7067
7141
|
cx: e,
|
|
7068
7142
|
cy: e,
|
|
@@ -7074,25 +7148,25 @@ function dd({ radius: e, className: t }) {
|
|
|
7074
7148
|
])
|
|
7075
7149
|
});
|
|
7076
7150
|
}
|
|
7077
|
-
var
|
|
7151
|
+
var gd;
|
|
7078
7152
|
(function(e) {
|
|
7079
7153
|
e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
|
|
7080
|
-
})(
|
|
7081
|
-
var
|
|
7082
|
-
[
|
|
7083
|
-
[
|
|
7084
|
-
[
|
|
7085
|
-
},
|
|
7154
|
+
})(gd ||= {});
|
|
7155
|
+
var _d = {
|
|
7156
|
+
[gd.Dots]: 1,
|
|
7157
|
+
[gd.Lines]: 1,
|
|
7158
|
+
[gd.Cross]: 6
|
|
7159
|
+
}, vd = (e) => ({
|
|
7086
7160
|
transform: e.transform,
|
|
7087
7161
|
patternId: `pattern-${e.rfId}`
|
|
7088
7162
|
});
|
|
7089
|
-
function
|
|
7090
|
-
let f = d(null), { transform: p, patternId: m } = Z(
|
|
7163
|
+
function yd({ id: e, variant: t = gd.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
|
|
7164
|
+
let f = d(null), { transform: p, patternId: m } = Z(vd, X), h = r || _d[t], v = t === gd.Dots, y = t === gd.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
|
|
7091
7165
|
return _("svg", {
|
|
7092
7166
|
className: S(["react-flow__background", l]),
|
|
7093
7167
|
style: {
|
|
7094
7168
|
...c,
|
|
7095
|
-
...
|
|
7169
|
+
...ml,
|
|
7096
7170
|
"--xy-background-color-props": s,
|
|
7097
7171
|
"--xy-background-pattern-color-props": o
|
|
7098
7172
|
},
|
|
@@ -7106,10 +7180,10 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7106
7180
|
height: x[1],
|
|
7107
7181
|
patternUnits: "userSpaceOnUse",
|
|
7108
7182
|
patternTransform: `translate(-${E[0]},-${E[1]})`,
|
|
7109
|
-
children: v ? g(
|
|
7183
|
+
children: v ? g(hd, {
|
|
7110
7184
|
radius: C / 2,
|
|
7111
7185
|
className: u
|
|
7112
|
-
}) : g(
|
|
7186
|
+
}) : g(md, {
|
|
7113
7187
|
dimensions: T,
|
|
7114
7188
|
lineWidth: i,
|
|
7115
7189
|
variant: t,
|
|
@@ -7124,44 +7198,44 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7124
7198
|
})]
|
|
7125
7199
|
});
|
|
7126
7200
|
}
|
|
7127
|
-
|
|
7128
|
-
var
|
|
7129
|
-
function
|
|
7201
|
+
yd.displayName = "Background";
|
|
7202
|
+
var bd = i(yd);
|
|
7203
|
+
function xd() {
|
|
7130
7204
|
return g("svg", {
|
|
7131
7205
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7132
7206
|
viewBox: "0 0 32 32",
|
|
7133
7207
|
children: g("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
|
|
7134
7208
|
});
|
|
7135
7209
|
}
|
|
7136
|
-
function
|
|
7210
|
+
function Sd() {
|
|
7137
7211
|
return g("svg", {
|
|
7138
7212
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7139
7213
|
viewBox: "0 0 32 5",
|
|
7140
7214
|
children: g("path", { d: "M0 0h32v4.2H0z" })
|
|
7141
7215
|
});
|
|
7142
7216
|
}
|
|
7143
|
-
function
|
|
7217
|
+
function Cd() {
|
|
7144
7218
|
return g("svg", {
|
|
7145
7219
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7146
7220
|
viewBox: "0 0 32 30",
|
|
7147
7221
|
children: g("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" })
|
|
7148
7222
|
});
|
|
7149
7223
|
}
|
|
7150
|
-
function
|
|
7224
|
+
function wd() {
|
|
7151
7225
|
return g("svg", {
|
|
7152
7226
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7153
7227
|
viewBox: "0 0 25 32",
|
|
7154
7228
|
children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" })
|
|
7155
7229
|
});
|
|
7156
7230
|
}
|
|
7157
|
-
function
|
|
7231
|
+
function Td() {
|
|
7158
7232
|
return g("svg", {
|
|
7159
7233
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7160
7234
|
viewBox: "0 0 25 32",
|
|
7161
7235
|
children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" })
|
|
7162
7236
|
});
|
|
7163
7237
|
}
|
|
7164
|
-
function
|
|
7238
|
+
function Ed({ children: e, className: t, ...n }) {
|
|
7165
7239
|
return g("button", {
|
|
7166
7240
|
type: "button",
|
|
7167
7241
|
className: S(["react-flow__controls-button", t]),
|
|
@@ -7169,27 +7243,15 @@ function Sd({ children: e, className: t, ...n }) {
|
|
|
7169
7243
|
children: e
|
|
7170
7244
|
});
|
|
7171
7245
|
}
|
|
7172
|
-
var
|
|
7246
|
+
var Dd = (e) => ({
|
|
7173
7247
|
isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
|
|
7174
7248
|
minZoomReached: e.transform[2] <= e.minZoom,
|
|
7175
7249
|
maxZoomReached: e.transform[2] >= e.maxZoom,
|
|
7176
7250
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7177
7251
|
});
|
|
7178
|
-
function
|
|
7179
|
-
let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(
|
|
7180
|
-
|
|
7181
|
-
}, D = () => {
|
|
7182
|
-
w(), o?.();
|
|
7183
|
-
}, O = () => {
|
|
7184
|
-
T(i), s?.();
|
|
7185
|
-
}, k = () => {
|
|
7186
|
-
m.setState({
|
|
7187
|
-
nodesDraggable: !v,
|
|
7188
|
-
nodesConnectable: !v,
|
|
7189
|
-
elementsSelectable: !v
|
|
7190
|
-
}), c?.(!v);
|
|
7191
|
-
};
|
|
7192
|
-
return _(Cc, {
|
|
7252
|
+
function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
|
|
7253
|
+
let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Dd, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
|
|
7254
|
+
return _(Sc, {
|
|
7193
7255
|
className: S([
|
|
7194
7256
|
"react-flow__controls",
|
|
7195
7257
|
f === "horizontal" ? "horizontal" : "vertical",
|
|
@@ -7200,42 +7262,54 @@ function wd({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7200
7262
|
"data-testid": "rf__controls",
|
|
7201
7263
|
"aria-label": p ?? x["controls.ariaLabel"],
|
|
7202
7264
|
children: [
|
|
7203
|
-
t && _(h, { children: [g(
|
|
7204
|
-
onClick:
|
|
7265
|
+
t && _(h, { children: [g(Ed, {
|
|
7266
|
+
onClick: () => {
|
|
7267
|
+
C(), a?.();
|
|
7268
|
+
},
|
|
7205
7269
|
className: "react-flow__controls-zoomin",
|
|
7206
7270
|
title: x["controls.zoomIn.ariaLabel"],
|
|
7207
7271
|
"aria-label": x["controls.zoomIn.ariaLabel"],
|
|
7208
7272
|
disabled: b,
|
|
7209
|
-
children: g(
|
|
7210
|
-
}), g(
|
|
7211
|
-
onClick:
|
|
7273
|
+
children: g(xd, {})
|
|
7274
|
+
}), g(Ed, {
|
|
7275
|
+
onClick: () => {
|
|
7276
|
+
w(), o?.();
|
|
7277
|
+
},
|
|
7212
7278
|
className: "react-flow__controls-zoomout",
|
|
7213
7279
|
title: x["controls.zoomOut.ariaLabel"],
|
|
7214
7280
|
"aria-label": x["controls.zoomOut.ariaLabel"],
|
|
7215
7281
|
disabled: y,
|
|
7216
|
-
children: g(
|
|
7282
|
+
children: g(Sd, {})
|
|
7217
7283
|
})] }),
|
|
7218
|
-
n && g(
|
|
7284
|
+
n && g(Ed, {
|
|
7219
7285
|
className: "react-flow__controls-fitview",
|
|
7220
|
-
onClick:
|
|
7286
|
+
onClick: () => {
|
|
7287
|
+
T(i), s?.();
|
|
7288
|
+
},
|
|
7221
7289
|
title: x["controls.fitView.ariaLabel"],
|
|
7222
7290
|
"aria-label": x["controls.fitView.ariaLabel"],
|
|
7223
|
-
children: g(
|
|
7291
|
+
children: g(Cd, {})
|
|
7224
7292
|
}),
|
|
7225
|
-
r && g(
|
|
7293
|
+
r && g(Ed, {
|
|
7226
7294
|
className: "react-flow__controls-interactive",
|
|
7227
|
-
onClick:
|
|
7295
|
+
onClick: () => {
|
|
7296
|
+
m.setState({
|
|
7297
|
+
nodesDraggable: !v,
|
|
7298
|
+
nodesConnectable: !v,
|
|
7299
|
+
elementsSelectable: !v
|
|
7300
|
+
}), c?.(!v);
|
|
7301
|
+
},
|
|
7228
7302
|
title: x["controls.interactive.ariaLabel"],
|
|
7229
7303
|
"aria-label": x["controls.interactive.ariaLabel"],
|
|
7230
|
-
children: g(v ?
|
|
7304
|
+
children: g(v ? Td : wd, {})
|
|
7231
7305
|
}),
|
|
7232
7306
|
u
|
|
7233
7307
|
]
|
|
7234
7308
|
});
|
|
7235
7309
|
}
|
|
7236
|
-
|
|
7237
|
-
var
|
|
7238
|
-
function
|
|
7310
|
+
Od.displayName = "Controls";
|
|
7311
|
+
var kd = i(Od);
|
|
7312
|
+
function Ad({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
|
|
7239
7313
|
let { background: m, backgroundColor: h } = a || {}, _ = o || m || h;
|
|
7240
7314
|
return g("rect", {
|
|
7241
7315
|
className: S([
|
|
@@ -7258,10 +7332,10 @@ function Ed({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, stroke
|
|
|
7258
7332
|
onClick: p ? (t) => p(t, e) : void 0
|
|
7259
7333
|
});
|
|
7260
7334
|
}
|
|
7261
|
-
var
|
|
7262
|
-
function
|
|
7263
|
-
let s = Z(
|
|
7264
|
-
return g(h, { children: s.map((e) => g(
|
|
7335
|
+
var jd = i(Ad), Md = (e) => e.nodes.map((e) => e.id), Nd = (e) => e instanceof Function ? e : () => e;
|
|
7336
|
+
function Pd({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = jd, onClick: o }) {
|
|
7337
|
+
let s = Z(Md, X), c = Nd(t), l = Nd(e), u = Nd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
7338
|
+
return g(h, { children: s.map((e) => g(Id, {
|
|
7265
7339
|
id: e,
|
|
7266
7340
|
nodeColorFunc: c,
|
|
7267
7341
|
nodeStrokeColorFunc: l,
|
|
@@ -7273,7 +7347,7 @@ function Ad({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorde
|
|
|
7273
7347
|
shapeRendering: d
|
|
7274
7348
|
}, e)) });
|
|
7275
7349
|
}
|
|
7276
|
-
function
|
|
7350
|
+
function Fd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
|
|
7277
7351
|
let { node: l, x: u, y: d, width: f, height: p } = Z((t) => {
|
|
7278
7352
|
let n = t.nodeLookup.get(e);
|
|
7279
7353
|
if (!n) return {
|
|
@@ -7309,7 +7383,7 @@ function jd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
|
|
|
7309
7383
|
id: l.id
|
|
7310
7384
|
});
|
|
7311
7385
|
}
|
|
7312
|
-
var
|
|
7386
|
+
var Id = i(Fd), Ld = i(Pd), Rd = 200, zd = 150, Bd = (e) => !e.hidden, Vd = (e) => {
|
|
7313
7387
|
let t = {
|
|
7314
7388
|
x: -e.transform[0] / e.transform[2],
|
|
7315
7389
|
y: -e.transform[1] / e.transform[2],
|
|
@@ -7318,7 +7392,7 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
|
|
|
7318
7392
|
};
|
|
7319
7393
|
return {
|
|
7320
7394
|
viewBB: t,
|
|
7321
|
-
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter:
|
|
7395
|
+
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Bd }), t) : t,
|
|
7322
7396
|
rfId: e.rfId,
|
|
7323
7397
|
panZoom: e.panZoom,
|
|
7324
7398
|
translateExtent: e.translateExtent,
|
|
@@ -7326,9 +7400,9 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
|
|
|
7326
7400
|
flowHeight: e.height,
|
|
7327
7401
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7328
7402
|
};
|
|
7329
|
-
},
|
|
7330
|
-
function
|
|
7331
|
-
let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(
|
|
7403
|
+
}, Hd = "react-flow__minimap-desc";
|
|
7404
|
+
function Ud({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
|
|
7405
|
+
let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Vd, X), L = e?.width ?? Rd, R = e?.height ?? zd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Hd}-${j}`, ae = d(0), oe = d();
|
|
7332
7406
|
ae.current = B, c(() => {
|
|
7333
7407
|
if (O.current && M) return oe.current = Ts({
|
|
7334
7408
|
domNode: O.current,
|
|
@@ -7367,7 +7441,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7367
7441
|
let n = D.getState().nodeLookup.get(t).internals.userNode;
|
|
7368
7442
|
y(e, n);
|
|
7369
7443
|
}, []) : void 0, le = C ?? I["minimap.ariaLabel"];
|
|
7370
|
-
return g(
|
|
7444
|
+
return g(Sc, {
|
|
7371
7445
|
position: h,
|
|
7372
7446
|
style: {
|
|
7373
7447
|
...e,
|
|
@@ -7395,7 +7469,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7395
7469
|
id: ie,
|
|
7396
7470
|
children: le
|
|
7397
7471
|
}),
|
|
7398
|
-
g(
|
|
7472
|
+
g(Ld, {
|
|
7399
7473
|
onClick: ce,
|
|
7400
7474
|
nodeColor: r,
|
|
7401
7475
|
nodeStrokeColor: n,
|
|
@@ -7415,15 +7489,15 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7415
7489
|
})
|
|
7416
7490
|
});
|
|
7417
7491
|
}
|
|
7418
|
-
|
|
7419
|
-
var
|
|
7492
|
+
Ud.displayName = "MiniMap", i(Ud);
|
|
7493
|
+
var Wd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Gd = {
|
|
7420
7494
|
[Bs.Line]: "right",
|
|
7421
7495
|
[Bs.Handle]: "bottom-right"
|
|
7422
7496
|
};
|
|
7423
|
-
function
|
|
7424
|
-
let C =
|
|
7497
|
+
function Kd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
|
|
7498
|
+
let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Wd(D && _), [D, _]), X), k = d(null), A = t ?? Gd[n];
|
|
7425
7499
|
return c(() => {
|
|
7426
|
-
if (!(!E.current || !w)) return k.current ||=
|
|
7500
|
+
if (!(!E.current || !w)) return k.current ||= Zs({
|
|
7427
7501
|
domNode: E.current,
|
|
7428
7502
|
nodeId: w,
|
|
7429
7503
|
getStoreItems: () => {
|
|
@@ -7547,17 +7621,17 @@ function Hd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, styl
|
|
|
7547
7621
|
children: o
|
|
7548
7622
|
});
|
|
7549
7623
|
}
|
|
7550
|
-
i(
|
|
7624
|
+
i(Kd);
|
|
7551
7625
|
//#endregion
|
|
7552
7626
|
//#region src/gn/ir/socketColors.ts
|
|
7553
|
-
function
|
|
7627
|
+
function qd(e) {
|
|
7554
7628
|
return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
|
|
7555
7629
|
}
|
|
7556
7630
|
function $(e, t, n) {
|
|
7557
|
-
let r = (e) => Math.round(Math.min(1, Math.max(0,
|
|
7631
|
+
let r = (e) => Math.round(Math.min(1, Math.max(0, qd(e))) * 255).toString(16).padStart(2, "0");
|
|
7558
7632
|
return `#${r(e)}${r(t)}${r(n)}`;
|
|
7559
7633
|
}
|
|
7560
|
-
var
|
|
7634
|
+
var Jd = {
|
|
7561
7635
|
FLOAT: $(.63, .63, .63),
|
|
7562
7636
|
VECTOR: $(.39, .39, .78),
|
|
7563
7637
|
RGBA: $(.78, .78, .16),
|
|
@@ -7579,12 +7653,12 @@ var Wd = {
|
|
|
7579
7653
|
INT_VECTOR: $(.36, .47, .61),
|
|
7580
7654
|
CUSTOM: $(.2, .2, .2)
|
|
7581
7655
|
};
|
|
7582
|
-
function
|
|
7583
|
-
return
|
|
7656
|
+
function Yd(e) {
|
|
7657
|
+
return Jd[e] ?? Jd.CUSTOM;
|
|
7584
7658
|
}
|
|
7585
7659
|
//#endregion
|
|
7586
7660
|
//#region src/gn/ir/nodeColors.ts
|
|
7587
|
-
var
|
|
7661
|
+
var Xd = {
|
|
7588
7662
|
GEOMETRY: "#1d725e",
|
|
7589
7663
|
INPUT: "#82354c",
|
|
7590
7664
|
OUTPUT: "#3e232a",
|
|
@@ -7601,10 +7675,10 @@ var Kd = {
|
|
|
7601
7675
|
SCRIPT: "#203c3c",
|
|
7602
7676
|
DEFAULT: "#303030"
|
|
7603
7677
|
};
|
|
7604
|
-
function
|
|
7678
|
+
function Zd(e) {
|
|
7605
7679
|
return e === "NodeGroupInput" || e === "NodeGroupOutput" ? "INTERFACE" : e.startsWith("NodeGroup") ? "GROUP" : e.startsWith("GeometryNodeSet") || e.startsWith("GeometryNodeTransform") || e.startsWith("GeometryNodeMerge") || e.startsWith("GeometryNodeJoin") || e.startsWith("GeometryNodeDelete") || e.startsWith("GeometryNodeSeparate") || e.startsWith("GeometryNodeDuplicate") || e.startsWith("GeometryNodeExtrude") || e.startsWith("GeometryNodeFlip") || e.startsWith("GeometryNodeSubdivide") || e.startsWith("GeometryNodeTriangulate") || e.startsWith("GeometryNodeMesh") || e.startsWith("GeometryNodeCurve") || e.startsWith("GeometryNodePoints") || e.startsWith("GeometryNodeVolume") || e.startsWith("GeometryNodeInstance") || e.startsWith("GeometryNodeRealize") || e.startsWith("GeometryNodeConvex") || e.startsWith("GeometryNodeFill") || e.startsWith("GeometryNodeSDF") || e.startsWith("GeometryNode") ? "GEOMETRY" : e.startsWith("ShaderNode") ? "SHADER" : e.startsWith("FunctionNode") ? "CONVERTER" : "DEFAULT";
|
|
7606
7680
|
}
|
|
7607
|
-
var
|
|
7681
|
+
var Qd = {
|
|
7608
7682
|
GeometryNodeInputMaterial: "INPUT",
|
|
7609
7683
|
GeometryNodeInputMaterialIndex: "INPUT",
|
|
7610
7684
|
GeometryNodeInputRadius: "INPUT",
|
|
@@ -7655,12 +7729,12 @@ var Jd = {
|
|
|
7655
7729
|
GeometryNodeFieldVariance: "CONVERTER",
|
|
7656
7730
|
GeometryNodeViewer: "OUTPUT"
|
|
7657
7731
|
};
|
|
7658
|
-
function
|
|
7659
|
-
return
|
|
7732
|
+
function $d(e) {
|
|
7733
|
+
return Xd[Qd[e] ?? Zd(e)] ?? Xd.DEFAULT;
|
|
7660
7734
|
}
|
|
7661
7735
|
//#endregion
|
|
7662
7736
|
//#region src/gn/importer/blenderTree.ts
|
|
7663
|
-
var
|
|
7737
|
+
var ef = {
|
|
7664
7738
|
NodeSocketGeometry: "GEOMETRY",
|
|
7665
7739
|
NodeSocketFloat: "FLOAT",
|
|
7666
7740
|
NodeSocketVector: "VECTOR",
|
|
@@ -7677,10 +7751,10 @@ var Xd = {
|
|
|
7677
7751
|
NodeSocketMatrix: "MATRIX",
|
|
7678
7752
|
NodeSocketMenu: "MENU"
|
|
7679
7753
|
};
|
|
7680
|
-
function
|
|
7681
|
-
return
|
|
7754
|
+
function tf(e) {
|
|
7755
|
+
return ef[e] ?? "CUSTOM";
|
|
7682
7756
|
}
|
|
7683
|
-
var
|
|
7757
|
+
var nf = {
|
|
7684
7758
|
HSV: [
|
|
7685
7759
|
"Hue",
|
|
7686
7760
|
"Saturation",
|
|
@@ -7697,7 +7771,7 @@ var Qd = {
|
|
|
7697
7771
|
"Blue"
|
|
7698
7772
|
]
|
|
7699
7773
|
};
|
|
7700
|
-
function
|
|
7774
|
+
function rf(e) {
|
|
7701
7775
|
let t = e.data.mapping?.data;
|
|
7702
7776
|
if (!t) return;
|
|
7703
7777
|
let n = t.curves?.data?.items;
|
|
@@ -7715,8 +7789,8 @@ function $d(e) {
|
|
|
7715
7789
|
points: r
|
|
7716
7790
|
};
|
|
7717
7791
|
}
|
|
7718
|
-
function
|
|
7719
|
-
let n =
|
|
7792
|
+
function af(e, t) {
|
|
7793
|
+
let n = nf[t ?? "RGB"] ?? nf.RGB, r = nf.RGB;
|
|
7720
7794
|
return e.map((e) => {
|
|
7721
7795
|
let t = r.indexOf(e.name);
|
|
7722
7796
|
return t === -1 ? e : {
|
|
@@ -7725,8 +7799,11 @@ function ef(e, t) {
|
|
|
7725
7799
|
};
|
|
7726
7800
|
});
|
|
7727
7801
|
}
|
|
7728
|
-
function
|
|
7729
|
-
|
|
7802
|
+
function of(e) {
|
|
7803
|
+
return e.replace(/\.\d{3}$/, "");
|
|
7804
|
+
}
|
|
7805
|
+
function sf(e, t) {
|
|
7806
|
+
let n = tf(e.data.socket_idname ?? ""), r = Yd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
|
|
7730
7807
|
id: e,
|
|
7731
7808
|
name: "",
|
|
7732
7809
|
dataType: n,
|
|
@@ -7751,7 +7828,7 @@ function tf(e, t) {
|
|
|
7751
7828
|
outputs: [o(a)]
|
|
7752
7829
|
};
|
|
7753
7830
|
}
|
|
7754
|
-
function
|
|
7831
|
+
function cf(e) {
|
|
7755
7832
|
return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
|
|
7756
7833
|
kind: "vec",
|
|
7757
7834
|
values: e
|
|
@@ -7760,20 +7837,20 @@ function nf(e) {
|
|
|
7760
7837
|
value: e
|
|
7761
7838
|
} : null;
|
|
7762
7839
|
}
|
|
7763
|
-
function
|
|
7840
|
+
function lf(e, t) {
|
|
7764
7841
|
return {
|
|
7765
7842
|
id: String(e.id),
|
|
7766
7843
|
name: e.data.name,
|
|
7767
7844
|
dataType: e.data.type,
|
|
7768
7845
|
displayShape: e.data.display_shape,
|
|
7769
|
-
color:
|
|
7770
|
-
defaultValue:
|
|
7846
|
+
color: Yd(e.data.type),
|
|
7847
|
+
defaultValue: cf(e.data.default_value),
|
|
7771
7848
|
hideValue: e.data.hide_value ?? !1,
|
|
7772
7849
|
enabled: e.data.enabled ?? !0,
|
|
7773
7850
|
index: t
|
|
7774
7851
|
};
|
|
7775
7852
|
}
|
|
7776
|
-
function
|
|
7853
|
+
function uf(e) {
|
|
7777
7854
|
if (e.data.bl_idname === "FunctionNodeCompare") {
|
|
7778
7855
|
let t = {};
|
|
7779
7856
|
return e.data.data_type && (t.data_type = e.data.data_type), e.data.operation && (t.operation = e.data.operation), Object.keys(t).length > 0 ? t : void 0;
|
|
@@ -7783,23 +7860,20 @@ function af(e) {
|
|
|
7783
7860
|
return e.data.operation && (t.operation = e.data.operation), e.data.use_clamp && (t.use_clamp = "true"), Object.keys(t).length > 0 ? t : void 0;
|
|
7784
7861
|
}
|
|
7785
7862
|
}
|
|
7786
|
-
function
|
|
7787
|
-
if (!e
|
|
7788
|
-
if (!
|
|
7789
|
-
|
|
7790
|
-
if (!t?.data) throw Error("\"node_trees[0].data\" is missing.");
|
|
7791
|
-
if (!t.data.nodes?.data?.items) throw Error("\"node_trees[0].data.nodes.data.items\" is missing.");
|
|
7792
|
-
if (!t.data.links?.data?.items) throw Error("\"node_trees[0].data.links.data.items\" is missing.");
|
|
7863
|
+
function df(e, t) {
|
|
7864
|
+
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
7865
|
+
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
7866
|
+
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
7793
7867
|
return {
|
|
7794
|
-
id: String(
|
|
7795
|
-
label:
|
|
7796
|
-
nodes:
|
|
7868
|
+
id: String(e.id),
|
|
7869
|
+
label: e.data.name,
|
|
7870
|
+
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
7797
7871
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
7798
7872
|
let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
7799
|
-
if (e.data.bl_idname === "NodeReroute") return
|
|
7873
|
+
if (e.data.bl_idname === "NodeReroute") return sf(e, n);
|
|
7800
7874
|
let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
7801
7875
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
7802
|
-
return
|
|
7876
|
+
return lf(t, n);
|
|
7803
7877
|
});
|
|
7804
7878
|
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
|
|
7805
7879
|
...r[0],
|
|
@@ -7810,27 +7884,28 @@ function of(e) {
|
|
|
7810
7884
|
});
|
|
7811
7885
|
let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
7812
7886
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
7813
|
-
return
|
|
7887
|
+
return lf(t, n);
|
|
7814
7888
|
});
|
|
7815
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
7816
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
7889
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = af(i, e.data.mode));
|
|
7890
|
+
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? rf(e) : void 0, o = uf(e);
|
|
7817
7891
|
return {
|
|
7818
7892
|
id: String(e.id),
|
|
7819
7893
|
type: e.data.bl_idname,
|
|
7820
|
-
label: e.data.label || e.data.name,
|
|
7894
|
+
label: e.data.label || of(e.data.name),
|
|
7821
7895
|
position: {
|
|
7822
7896
|
x: n[0],
|
|
7823
7897
|
y: -n[1]
|
|
7824
7898
|
},
|
|
7825
7899
|
width: e.data.width ?? 140,
|
|
7826
|
-
headerColor:
|
|
7900
|
+
headerColor: $d(e.data.bl_idname),
|
|
7827
7901
|
inputs: i,
|
|
7828
7902
|
outputs: r,
|
|
7829
7903
|
floatCurve: a,
|
|
7830
|
-
...o ? { properties: o } : {}
|
|
7904
|
+
...o ? { properties: o } : {},
|
|
7905
|
+
...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) }
|
|
7831
7906
|
};
|
|
7832
7907
|
}),
|
|
7833
|
-
links:
|
|
7908
|
+
links: e.data.links.data.items.map((e, t) => {
|
|
7834
7909
|
if (!e?.data) throw Error(`Link at index ${t} is missing ".data".`);
|
|
7835
7910
|
return {
|
|
7836
7911
|
id: String(e.id),
|
|
@@ -7840,21 +7915,45 @@ function of(e) {
|
|
|
7840
7915
|
})
|
|
7841
7916
|
};
|
|
7842
7917
|
}
|
|
7843
|
-
function
|
|
7918
|
+
function ff(e) {
|
|
7919
|
+
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
7920
|
+
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
7921
|
+
let t = {};
|
|
7922
|
+
for (let n = 0; n < e.node_trees.length; n++) {
|
|
7923
|
+
let r = df(e.node_trees[n], n);
|
|
7924
|
+
t[r.id] = r;
|
|
7925
|
+
}
|
|
7926
|
+
let n = /* @__PURE__ */ new Set();
|
|
7927
|
+
for (let e of Object.values(t)) for (let r of e.nodes) {
|
|
7928
|
+
if (r.groupTreeId === void 0) continue;
|
|
7929
|
+
let e = t[r.groupTreeId];
|
|
7930
|
+
if (!e) {
|
|
7931
|
+
delete r.groupTreeId;
|
|
7932
|
+
continue;
|
|
7933
|
+
}
|
|
7934
|
+
r.groupTreeName = e.label, n.add(e.id);
|
|
7935
|
+
}
|
|
7936
|
+
let r = e.node_trees.filter((e) => !n.has(String(e.id))), i = r.find((e) => e.data?.is_modifier) ?? r[0] ?? e.node_trees[0];
|
|
7937
|
+
return {
|
|
7938
|
+
rootId: String(i.id),
|
|
7939
|
+
trees: t
|
|
7940
|
+
};
|
|
7941
|
+
}
|
|
7942
|
+
function pf(e, t) {
|
|
7844
7943
|
return {
|
|
7845
7944
|
...t,
|
|
7846
7945
|
nodeId: e,
|
|
7847
7946
|
direction: "input"
|
|
7848
7947
|
};
|
|
7849
7948
|
}
|
|
7850
|
-
function
|
|
7949
|
+
function mf(e, t) {
|
|
7851
7950
|
return {
|
|
7852
7951
|
...t,
|
|
7853
7952
|
nodeId: e,
|
|
7854
7953
|
direction: "output"
|
|
7855
7954
|
};
|
|
7856
7955
|
}
|
|
7857
|
-
function
|
|
7956
|
+
function hf(e) {
|
|
7858
7957
|
let t = e.nodes.map((e) => ({
|
|
7859
7958
|
id: e.id,
|
|
7860
7959
|
type: e.type,
|
|
@@ -7862,10 +7961,12 @@ function lf(e) {
|
|
|
7862
7961
|
position: e.position,
|
|
7863
7962
|
width: e.width,
|
|
7864
7963
|
headerColor: e.headerColor,
|
|
7865
|
-
inputs: e.inputs.map((t) =>
|
|
7866
|
-
outputs: e.outputs.map((t) =>
|
|
7964
|
+
inputs: e.inputs.map((t) => pf(e.id, t)),
|
|
7965
|
+
outputs: e.outputs.map((t) => mf(e.id, t)),
|
|
7867
7966
|
floatCurve: e.floatCurve,
|
|
7868
|
-
properties: e.properties
|
|
7967
|
+
properties: e.properties,
|
|
7968
|
+
groupTreeId: e.groupTreeId,
|
|
7969
|
+
groupTreeName: e.groupTreeName
|
|
7869
7970
|
})), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
7870
7971
|
for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
|
|
7871
7972
|
let i = e.links.map((e) => ({
|
|
@@ -7885,11 +7986,11 @@ function lf(e) {
|
|
|
7885
7986
|
}
|
|
7886
7987
|
//#endregion
|
|
7887
7988
|
//#region src/gn/xyflow/mapGraphIRToFlow.ts
|
|
7888
|
-
function
|
|
7989
|
+
function gf(e) {
|
|
7889
7990
|
let t = Math.max(e.inputs.length, e.outputs.length);
|
|
7890
7991
|
return Math.max(60, 32 + t * 18 + 16);
|
|
7891
7992
|
}
|
|
7892
|
-
function
|
|
7993
|
+
function _f(e, t) {
|
|
7893
7994
|
if (e.type === "NodeReroute") {
|
|
7894
7995
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
7895
7996
|
return {
|
|
@@ -7923,11 +8024,13 @@ function df(e, t) {
|
|
|
7923
8024
|
outputs: e.outputs,
|
|
7924
8025
|
connectedInputIds: e.inputs.filter((e) => t.has(e.id)).map((e) => e.id),
|
|
7925
8026
|
floatCurve: e.floatCurve,
|
|
7926
|
-
properties: e.properties
|
|
8027
|
+
properties: e.properties,
|
|
8028
|
+
groupTreeId: e.groupTreeId,
|
|
8029
|
+
groupTreeName: e.groupTreeName
|
|
7927
8030
|
}
|
|
7928
8031
|
};
|
|
7929
8032
|
}
|
|
7930
|
-
function
|
|
8033
|
+
function vf(e, t, n) {
|
|
7931
8034
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
7932
8035
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
7933
8036
|
for (let e of n.edges) r.has(e.sourceNodeId) || r.set(e.sourceNodeId, []), i.has(e.targetNodeId) || i.set(e.targetNodeId, []), r.get(e.sourceNodeId).push(e.targetNodeId), i.get(e.targetNodeId).push(e.sourceNodeId);
|
|
@@ -7951,16 +8054,16 @@ function ff(e, t, n) {
|
|
|
7951
8054
|
for (let e of a) s.has(e) && l.add(e);
|
|
7952
8055
|
return l;
|
|
7953
8056
|
}
|
|
7954
|
-
function
|
|
7955
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) =>
|
|
8057
|
+
function yf(e) {
|
|
8058
|
+
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => _f(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
|
|
7956
8059
|
if (r && i) {
|
|
7957
|
-
let t =
|
|
8060
|
+
let t = vf(r.id, i.id, e);
|
|
7958
8061
|
if (t.size > 0) {
|
|
7959
8062
|
let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
|
|
7960
8063
|
for (let e of t) {
|
|
7961
8064
|
let t = i.get(e);
|
|
7962
8065
|
if (!t) continue;
|
|
7963
|
-
let n = t.width, r =
|
|
8066
|
+
let n = t.width, r = gf(t);
|
|
7964
8067
|
o = Math.min(o, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + n), l = Math.max(l, t.position.y + r);
|
|
7965
8068
|
}
|
|
7966
8069
|
if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
|
|
@@ -8008,10 +8111,10 @@ function pf(e) {
|
|
|
8008
8111
|
}
|
|
8009
8112
|
//#endregion
|
|
8010
8113
|
//#region src/gn/ir/curvePath.ts
|
|
8011
|
-
function
|
|
8114
|
+
function bf(e, t) {
|
|
8012
8115
|
return Math.sqrt(e * e + t * t);
|
|
8013
8116
|
}
|
|
8014
|
-
function
|
|
8117
|
+
function xf(e) {
|
|
8015
8118
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8016
8119
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8017
8120
|
if (i === "VECTOR") return {
|
|
@@ -8021,11 +8124,11 @@ function hf(e) {
|
|
|
8021
8124
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8022
8125
|
if (o && s) {
|
|
8023
8126
|
let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
|
|
8024
|
-
if (u =
|
|
8025
|
-
let n = e / u + i / d, r = t / u + a / d, o =
|
|
8127
|
+
if (u = bf(e, t), d = bf(i, a), u > 1e-8 && d > 1e-8) {
|
|
8128
|
+
let n = e / u + i / d, r = t / u + a / d, o = bf(n, r);
|
|
8026
8129
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8027
8130
|
} else d > 1e-8 ? (c = (s[0] - n) / d, l = (s[1] - r) / d) : u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u);
|
|
8028
|
-
} else s ? (d =
|
|
8131
|
+
} else s ? (d = bf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = bf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8029
8132
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8030
8133
|
if (i === "AUTO_CLAMPED") {
|
|
8031
8134
|
if (o) {
|
|
@@ -8070,7 +8173,7 @@ function hf(e) {
|
|
|
8070
8173
|
}
|
|
8071
8174
|
return n;
|
|
8072
8175
|
}
|
|
8073
|
-
function
|
|
8176
|
+
function Sf(e, t, n, r, i, a, o) {
|
|
8074
8177
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8075
8178
|
if (e.length < 2) return {
|
|
8076
8179
|
strokePath: "",
|
|
@@ -8078,7 +8181,7 @@ function gf(e, t, n, r, i, a, o) {
|
|
|
8078
8181
|
zeroLinePath: "",
|
|
8079
8182
|
dotPositions: []
|
|
8080
8183
|
};
|
|
8081
|
-
let d =
|
|
8184
|
+
let d = xf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8082
8185
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8083
8186
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8084
8187
|
m += ` C ${l(n[0]).toFixed(2)} ${u(n[1]).toFixed(2)},`, m += ` ${l(r[0]).toFixed(2)} ${u(r[1]).toFixed(2)},`, m += ` ${l(i).toFixed(2)} ${u(a).toFixed(2)}`;
|
|
@@ -8092,13 +8195,19 @@ function gf(e, t, n, r, i, a, o) {
|
|
|
8092
8195
|
};
|
|
8093
8196
|
}
|
|
8094
8197
|
//#endregion
|
|
8198
|
+
//#region src/gn/components/groupNavContext.ts
|
|
8199
|
+
var Cf = t(null);
|
|
8200
|
+
function wf() {
|
|
8201
|
+
return o(Cf);
|
|
8202
|
+
}
|
|
8203
|
+
//#endregion
|
|
8095
8204
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8096
|
-
var
|
|
8205
|
+
var Tf = [
|
|
8097
8206
|
"X",
|
|
8098
8207
|
"Y",
|
|
8099
8208
|
"Z",
|
|
8100
8209
|
"W"
|
|
8101
|
-
],
|
|
8210
|
+
], Ef = {
|
|
8102
8211
|
FLOAT: "Float",
|
|
8103
8212
|
INT: "Integer",
|
|
8104
8213
|
VECTOR: "Vector",
|
|
@@ -8106,7 +8215,7 @@ var _f = [
|
|
|
8106
8215
|
STRING: "String",
|
|
8107
8216
|
BOOLEAN: "Boolean",
|
|
8108
8217
|
ROTATION: "Rotation"
|
|
8109
|
-
},
|
|
8218
|
+
}, Df = {
|
|
8110
8219
|
EQUAL: "Equal",
|
|
8111
8220
|
NOT_EQUAL: "Not Equal",
|
|
8112
8221
|
LESS_THAN: "Less Than",
|
|
@@ -8152,10 +8261,10 @@ var _f = [
|
|
|
8152
8261
|
RADIANS: "To Radians",
|
|
8153
8262
|
DEGREES: "To Degrees"
|
|
8154
8263
|
};
|
|
8155
|
-
function
|
|
8156
|
-
return e === "data_type" ?
|
|
8264
|
+
function Of(e, t) {
|
|
8265
|
+
return e === "data_type" ? Ef[t] ?? t : e === "operation" ? Df[t] ?? t : e === "use_clamp" ? "Clamp" : t;
|
|
8157
8266
|
}
|
|
8158
|
-
function
|
|
8267
|
+
function kf(e) {
|
|
8159
8268
|
switch (e) {
|
|
8160
8269
|
case "LINE": return "gn-socket--line";
|
|
8161
8270
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8164,55 +8273,55 @@ function xf(e) {
|
|
|
8164
8273
|
default: return "gn-socket--circle";
|
|
8165
8274
|
}
|
|
8166
8275
|
}
|
|
8167
|
-
function
|
|
8276
|
+
function Af(e) {
|
|
8168
8277
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8169
8278
|
}
|
|
8170
|
-
function
|
|
8279
|
+
function jf(e) {
|
|
8171
8280
|
return parseFloat(e.toFixed(3)).toString();
|
|
8172
8281
|
}
|
|
8173
|
-
function
|
|
8174
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8282
|
+
function Mf(e, t) {
|
|
8283
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${jf(e)}${Af(t)}`;
|
|
8175
8284
|
}
|
|
8176
|
-
function
|
|
8285
|
+
function Nf(e) {
|
|
8177
8286
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8178
8287
|
}
|
|
8179
|
-
function
|
|
8288
|
+
function Pf(e) {
|
|
8180
8289
|
let [t, n, r, i = 1] = e.values;
|
|
8181
8290
|
return /* @__PURE__ */ g("div", {
|
|
8182
8291
|
className: "gn-node__color-swatch",
|
|
8183
|
-
style: { background: `rgba(${
|
|
8292
|
+
style: { background: `rgba(${Nf(t)},${Nf(n)},${Nf(r)},${i.toFixed(2)})` }
|
|
8184
8293
|
});
|
|
8185
8294
|
}
|
|
8186
|
-
function
|
|
8187
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8188
|
-
let t =
|
|
8295
|
+
function Ff(e) {
|
|
8296
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(Pf, { values: e.values });
|
|
8297
|
+
let t = Af(e.dataType);
|
|
8189
8298
|
return /* @__PURE__ */ g("div", {
|
|
8190
8299
|
className: "gn-node__vec-block",
|
|
8191
8300
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8192
8301
|
className: "gn-node__vec-row",
|
|
8193
8302
|
children: [/* @__PURE__ */ g("span", {
|
|
8194
8303
|
className: "gn-node__vec-label",
|
|
8195
|
-
children:
|
|
8304
|
+
children: Tf[n]
|
|
8196
8305
|
}), /* @__PURE__ */ _("span", {
|
|
8197
8306
|
className: "gn-node__vec-value",
|
|
8198
|
-
children: [
|
|
8307
|
+
children: [jf(e), t]
|
|
8199
8308
|
})]
|
|
8200
8309
|
}, n))
|
|
8201
8310
|
});
|
|
8202
8311
|
}
|
|
8203
|
-
function
|
|
8312
|
+
function If({ properties: e }) {
|
|
8204
8313
|
let t = Object.entries(e);
|
|
8205
8314
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8206
8315
|
className: "gn-node__props",
|
|
8207
8316
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8208
8317
|
className: "gn-node__prop-row",
|
|
8209
|
-
children:
|
|
8318
|
+
children: Of(e, t)
|
|
8210
8319
|
}, e))
|
|
8211
8320
|
});
|
|
8212
8321
|
}
|
|
8213
|
-
var
|
|
8214
|
-
function
|
|
8215
|
-
let n = Math.max(10, t -
|
|
8322
|
+
var Lf = 120, Rf = 6;
|
|
8323
|
+
function zf({ curve: e, width: t }) {
|
|
8324
|
+
let n = Math.max(10, t - Rf * 2), r = Lf, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Sf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8216
8325
|
return /* @__PURE__ */ g("div", {
|
|
8217
8326
|
className: "gn-node__curve-wrap",
|
|
8218
8327
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8243,16 +8352,16 @@ function jf({ curve: e, width: t }) {
|
|
|
8243
8352
|
})
|
|
8244
8353
|
});
|
|
8245
8354
|
}
|
|
8246
|
-
function
|
|
8355
|
+
function Bf(e) {
|
|
8247
8356
|
let { socket: t, position: n, type: r, align: i, suppressDefault: a } = e, o = t.name.trim().length === 0, s = !a && !t.hideValue && t.defaultValue?.kind === "scalar";
|
|
8248
8357
|
return /* @__PURE__ */ _("div", {
|
|
8249
8358
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
8250
8359
|
children: [
|
|
8251
|
-
/* @__PURE__ */ g(
|
|
8360
|
+
/* @__PURE__ */ g(Ml, {
|
|
8252
8361
|
id: t.id,
|
|
8253
8362
|
type: r,
|
|
8254
8363
|
position: n,
|
|
8255
|
-
className: `gn-socket ${
|
|
8364
|
+
className: `gn-socket ${kf(t.displayShape)}`,
|
|
8256
8365
|
style: {
|
|
8257
8366
|
top: "50%",
|
|
8258
8367
|
background: t.color,
|
|
@@ -8265,18 +8374,32 @@ function Mf(e) {
|
|
|
8265
8374
|
}),
|
|
8266
8375
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8267
8376
|
className: "gn-node__value",
|
|
8268
|
-
children:
|
|
8377
|
+
children: Mf(t.defaultValue.value, t.dataType)
|
|
8269
8378
|
}) : null
|
|
8270
8379
|
]
|
|
8271
8380
|
});
|
|
8272
8381
|
}
|
|
8273
|
-
function
|
|
8382
|
+
function Vf(e, t) {
|
|
8274
8383
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8275
8384
|
}
|
|
8276
|
-
function
|
|
8277
|
-
let t = e.data, n = new Set(t.connectedInputIds ?? []), r = t.outputs.filter((e) => e.enabled), i = t.inputs.filter((e) => e.enabled);
|
|
8385
|
+
function Hf() {
|
|
8278
8386
|
return /* @__PURE__ */ _("div", {
|
|
8279
|
-
className: "gn-
|
|
8387
|
+
className: "gn-node__stack",
|
|
8388
|
+
"aria-hidden": "true",
|
|
8389
|
+
children: [
|
|
8390
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
|
|
8391
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
|
|
8392
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" })
|
|
8393
|
+
]
|
|
8394
|
+
});
|
|
8395
|
+
}
|
|
8396
|
+
function Uf(e) {
|
|
8397
|
+
let t = e.data, n = wf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
|
|
8398
|
+
return /* @__PURE__ */ _("div", {
|
|
8399
|
+
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8400
|
+
onClick: s ? () => n.openGroup(o) : void 0,
|
|
8401
|
+
role: s ? "button" : void 0,
|
|
8402
|
+
title: s ? `Open group "${t.groupTreeName}"` : void 0,
|
|
8280
8403
|
children: [
|
|
8281
8404
|
/* @__PURE__ */ g("div", {
|
|
8282
8405
|
className: "gn-node__header",
|
|
@@ -8286,28 +8409,29 @@ function Pf(e) {
|
|
|
8286
8409
|
children: t.label
|
|
8287
8410
|
})
|
|
8288
8411
|
}),
|
|
8289
|
-
|
|
8290
|
-
t.
|
|
8412
|
+
s && /* @__PURE__ */ g(Hf, {}),
|
|
8413
|
+
t.properties && /* @__PURE__ */ g(If, { properties: t.properties }),
|
|
8414
|
+
t.floatCurve && /* @__PURE__ */ g(zf, {
|
|
8291
8415
|
curve: t.floatCurve,
|
|
8292
8416
|
width: t.width
|
|
8293
8417
|
}),
|
|
8294
8418
|
/* @__PURE__ */ _("div", {
|
|
8295
8419
|
className: "gn-node__body",
|
|
8296
|
-
children: [
|
|
8420
|
+
children: [i.map((e) => /* @__PURE__ */ g(Bf, {
|
|
8297
8421
|
socket: e,
|
|
8298
8422
|
position: Y.Right,
|
|
8299
8423
|
type: "source",
|
|
8300
8424
|
align: "right",
|
|
8301
8425
|
suppressDefault: !0
|
|
8302
|
-
}, e.id)),
|
|
8303
|
-
let t =
|
|
8304
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(
|
|
8426
|
+
}, e.id)), a.map((e) => {
|
|
8427
|
+
let t = r.has(e.id);
|
|
8428
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Bf, {
|
|
8305
8429
|
socket: e,
|
|
8306
8430
|
position: Y.Left,
|
|
8307
8431
|
type: "target",
|
|
8308
8432
|
align: "left",
|
|
8309
8433
|
suppressDefault: t
|
|
8310
|
-
}),
|
|
8434
|
+
}), Vf(e, t) ? /* @__PURE__ */ g(Ff, {
|
|
8311
8435
|
values: e.defaultValue.values,
|
|
8312
8436
|
dataType: e.dataType
|
|
8313
8437
|
}) : null] }, e.id);
|
|
@@ -8318,17 +8442,17 @@ function Pf(e) {
|
|
|
8318
8442
|
}
|
|
8319
8443
|
//#endregion
|
|
8320
8444
|
//#region src/gn/components/RerouteNode.tsx
|
|
8321
|
-
function
|
|
8445
|
+
function Wf(e) {
|
|
8322
8446
|
let t = e.data;
|
|
8323
8447
|
return /* @__PURE__ */ _("div", {
|
|
8324
8448
|
className: "gn-reroute",
|
|
8325
8449
|
style: { "--gn-reroute-color": t.color },
|
|
8326
|
-
children: [/* @__PURE__ */ g(
|
|
8450
|
+
children: [/* @__PURE__ */ g(Ml, {
|
|
8327
8451
|
id: t.inputSocketId,
|
|
8328
8452
|
type: "target",
|
|
8329
8453
|
position: Y.Left,
|
|
8330
8454
|
className: "gn-reroute__handle"
|
|
8331
|
-
}), /* @__PURE__ */ g(
|
|
8455
|
+
}), /* @__PURE__ */ g(Ml, {
|
|
8332
8456
|
id: t.outputSocketId,
|
|
8333
8457
|
type: "source",
|
|
8334
8458
|
position: Y.Right,
|
|
@@ -8338,7 +8462,7 @@ function Ff(e) {
|
|
|
8338
8462
|
}
|
|
8339
8463
|
//#endregion
|
|
8340
8464
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8341
|
-
function
|
|
8465
|
+
function Gf(e) {
|
|
8342
8466
|
let t = e.data;
|
|
8343
8467
|
return /* @__PURE__ */ g("div", {
|
|
8344
8468
|
className: "gn-sim-zone",
|
|
@@ -8365,41 +8489,81 @@ function If(e) {
|
|
|
8365
8489
|
}
|
|
8366
8490
|
//#endregion
|
|
8367
8491
|
//#region src/gn/components/GeometryNodesFlow.tsx
|
|
8368
|
-
var
|
|
8369
|
-
gnNode:
|
|
8370
|
-
rerouteNode:
|
|
8371
|
-
simulationZone:
|
|
8372
|
-
},
|
|
8373
|
-
function
|
|
8374
|
-
let { nodes: t, edges: n } = e, { fitView:
|
|
8492
|
+
var Kf = {
|
|
8493
|
+
gnNode: Uf,
|
|
8494
|
+
rerouteNode: Wf,
|
|
8495
|
+
simulationZone: Gf
|
|
8496
|
+
}, qf = { padding: .08 };
|
|
8497
|
+
function Jf(e) {
|
|
8498
|
+
let { nodes: t, edges: n, breadcrumbs: r, onNavigate: i, onSelectionIds: o } = e, { fitView: s } = ll(), [l, u, d] = fd(t), [f, p, m] = pd(n);
|
|
8375
8499
|
return c(() => {
|
|
8376
|
-
|
|
8377
|
-
}, [
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8500
|
+
u(t), o?.([]), s(qf);
|
|
8501
|
+
}, [
|
|
8502
|
+
t,
|
|
8503
|
+
u,
|
|
8504
|
+
o,
|
|
8505
|
+
s
|
|
8506
|
+
]), c(() => {
|
|
8507
|
+
p(n);
|
|
8508
|
+
}, [n, p]), /* @__PURE__ */ _(dd, {
|
|
8509
|
+
nodes: l,
|
|
8510
|
+
edges: f,
|
|
8511
|
+
onNodesChange: d,
|
|
8512
|
+
onEdgesChange: m,
|
|
8513
|
+
onSelectionChange: a(({ nodes: e }) => {
|
|
8514
|
+
o?.(e.map((e) => e.id));
|
|
8515
|
+
}, [o]),
|
|
8516
|
+
nodeTypes: Kf,
|
|
8381
8517
|
fitView: !0,
|
|
8382
|
-
fitViewOptions:
|
|
8518
|
+
fitViewOptions: qf,
|
|
8383
8519
|
minZoom: .2,
|
|
8384
8520
|
nodesDraggable: !1,
|
|
8385
8521
|
nodesConnectable: !1,
|
|
8386
|
-
elementsSelectable: !
|
|
8522
|
+
elementsSelectable: !0,
|
|
8387
8523
|
nodesFocusable: !1,
|
|
8388
8524
|
edgesFocusable: !1,
|
|
8389
8525
|
selectNodesOnDrag: !1,
|
|
8390
|
-
selectionOnDrag: !
|
|
8526
|
+
selectionOnDrag: !0,
|
|
8527
|
+
selectionMode: va.Partial,
|
|
8391
8528
|
connectOnClick: !1,
|
|
8392
|
-
panOnDrag:
|
|
8529
|
+
panOnDrag: [1, 2],
|
|
8393
8530
|
panOnScroll: !1,
|
|
8394
8531
|
zoomOnScroll: !0,
|
|
8395
8532
|
zoomOnDoubleClick: !1,
|
|
8396
8533
|
children: [
|
|
8397
|
-
/* @__PURE__ */ g(
|
|
8534
|
+
/* @__PURE__ */ g(bd, {
|
|
8398
8535
|
gap: 20,
|
|
8399
8536
|
size: 1
|
|
8400
8537
|
}),
|
|
8401
|
-
/* @__PURE__ */ g(
|
|
8402
|
-
/* @__PURE__ */ g(
|
|
8538
|
+
/* @__PURE__ */ g(kd, { showInteractive: !1 }),
|
|
8539
|
+
r.length > 1 ? /* @__PURE__ */ g(Sc, {
|
|
8540
|
+
position: "top-left",
|
|
8541
|
+
children: /* @__PURE__ */ g("nav", {
|
|
8542
|
+
className: "gn-breadcrumbs",
|
|
8543
|
+
"aria-label": "Node group path",
|
|
8544
|
+
children: r.map((e, t) => {
|
|
8545
|
+
let n = t === r.length - 1;
|
|
8546
|
+
return /* @__PURE__ */ _("span", {
|
|
8547
|
+
className: "gn-breadcrumbs__item",
|
|
8548
|
+
children: [t > 0 ? /* @__PURE__ */ g("span", {
|
|
8549
|
+
className: "gn-breadcrumbs__sep",
|
|
8550
|
+
"aria-hidden": "true",
|
|
8551
|
+
children: "›"
|
|
8552
|
+
}) : null, n ? /* @__PURE__ */ g("span", {
|
|
8553
|
+
className: "gn-breadcrumbs__current",
|
|
8554
|
+
"aria-current": "page",
|
|
8555
|
+
children: e.label
|
|
8556
|
+
}) : /* @__PURE__ */ g("button", {
|
|
8557
|
+
type: "button",
|
|
8558
|
+
className: "gn-breadcrumbs__link",
|
|
8559
|
+
onClick: () => i(t),
|
|
8560
|
+
children: e.label
|
|
8561
|
+
})]
|
|
8562
|
+
}, `${e.id}-${t}`);
|
|
8563
|
+
})
|
|
8564
|
+
})
|
|
8565
|
+
}) : null,
|
|
8566
|
+
/* @__PURE__ */ g(Sc, {
|
|
8403
8567
|
position: "bottom-right",
|
|
8404
8568
|
children: /* @__PURE__ */ g("a", {
|
|
8405
8569
|
href: "https://extensions.blender.org/add-ons/tree-clipper/",
|
|
@@ -8412,24 +8576,64 @@ function zf(e) {
|
|
|
8412
8576
|
]
|
|
8413
8577
|
});
|
|
8414
8578
|
}
|
|
8415
|
-
function
|
|
8416
|
-
let { jsonText: t, showHeader: n = !0 } = e,
|
|
8579
|
+
function Yf(e) {
|
|
8580
|
+
let { jsonText: t, showHeader: n = !0, onSelectionChange: r } = e, [i, o] = f({
|
|
8581
|
+
json: t,
|
|
8582
|
+
ids: []
|
|
8583
|
+
}), s = u(() => {
|
|
8417
8584
|
if (!t.trim()) return null;
|
|
8418
8585
|
try {
|
|
8419
|
-
let e =
|
|
8586
|
+
let { rootId: e, trees: n } = ff(JSON.parse(t)), r = {};
|
|
8587
|
+
for (let e of Object.values(n)) {
|
|
8588
|
+
let t = hf(e);
|
|
8589
|
+
r[t.id] = {
|
|
8590
|
+
graph: t,
|
|
8591
|
+
flow: yf(t)
|
|
8592
|
+
};
|
|
8593
|
+
}
|
|
8420
8594
|
return {
|
|
8421
|
-
|
|
8422
|
-
|
|
8595
|
+
rootId: e,
|
|
8596
|
+
views: r,
|
|
8423
8597
|
error: null
|
|
8424
8598
|
};
|
|
8425
8599
|
} catch (e) {
|
|
8426
8600
|
return {
|
|
8427
|
-
|
|
8428
|
-
|
|
8601
|
+
rootId: "",
|
|
8602
|
+
views: null,
|
|
8429
8603
|
error: e instanceof Error ? e.message : String(e)
|
|
8430
8604
|
};
|
|
8431
8605
|
}
|
|
8432
|
-
}, [t])
|
|
8606
|
+
}, [t]), l = u(() => {
|
|
8607
|
+
if (!s?.views) return [];
|
|
8608
|
+
let e = i.json === t ? i.ids : [], n = [s.rootId];
|
|
8609
|
+
for (let t of e) s.views[t] && n.push(t);
|
|
8610
|
+
return n;
|
|
8611
|
+
}, [
|
|
8612
|
+
s,
|
|
8613
|
+
i,
|
|
8614
|
+
t
|
|
8615
|
+
]), d = s?.views ? s.views[l[l.length - 1]] : null, p = a((e) => {
|
|
8616
|
+
o((n) => ({
|
|
8617
|
+
json: t,
|
|
8618
|
+
ids: n.json === t ? [...n.ids, e] : [e]
|
|
8619
|
+
}));
|
|
8620
|
+
}, [t]), m = u(() => ({ openGroup: p }), [p]);
|
|
8621
|
+
c(() => {
|
|
8622
|
+
if (l.length <= 1) return;
|
|
8623
|
+
function e(e) {
|
|
8624
|
+
if (e.key !== "Tab" && e.key !== "Escape" || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
8625
|
+
let n = e.target;
|
|
8626
|
+
n && (n.isContentEditable || n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.closest(".cm-editor")) || (e.preventDefault(), o({
|
|
8627
|
+
json: t,
|
|
8628
|
+
ids: l.slice(1, -1)
|
|
8629
|
+
}));
|
|
8630
|
+
}
|
|
8631
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
8632
|
+
}, [l, t]);
|
|
8633
|
+
let h = s?.views ? l.map((e) => ({
|
|
8634
|
+
id: e,
|
|
8635
|
+
label: s.views[e].graph.label
|
|
8636
|
+
})) : [];
|
|
8433
8637
|
return /* @__PURE__ */ _("div", {
|
|
8434
8638
|
className: "panel flow-panel",
|
|
8435
8639
|
children: [n ? /* @__PURE__ */ _("div", {
|
|
@@ -8440,18 +8644,27 @@ function Bf(e) {
|
|
|
8440
8644
|
}), /* @__PURE__ */ g("div", {
|
|
8441
8645
|
className: "panel-status",
|
|
8442
8646
|
"aria-live": "polite",
|
|
8443
|
-
children:
|
|
8647
|
+
children: d ? `${d.graph.nodes.length} nodes, ${d.graph.edges.length} links` : null
|
|
8444
8648
|
})]
|
|
8445
8649
|
}) : null, /* @__PURE__ */ g("div", {
|
|
8446
8650
|
className: "panel-body flow-panel__body",
|
|
8447
|
-
children:
|
|
8651
|
+
children: s?.error ? /* @__PURE__ */ _("div", {
|
|
8448
8652
|
className: "flow-error",
|
|
8449
8653
|
role: "alert",
|
|
8450
|
-
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children:
|
|
8451
|
-
}) :
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8654
|
+
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: s.error })]
|
|
8655
|
+
}) : d ? /* @__PURE__ */ g(Cf.Provider, {
|
|
8656
|
+
value: m,
|
|
8657
|
+
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(Jf, {
|
|
8658
|
+
nodes: d.flow.nodes,
|
|
8659
|
+
edges: d.flow.edges,
|
|
8660
|
+
breadcrumbs: h,
|
|
8661
|
+
onNavigate: (e) => o({
|
|
8662
|
+
json: t,
|
|
8663
|
+
ids: l.slice(1, e + 1)
|
|
8664
|
+
}),
|
|
8665
|
+
onSelectionIds: r
|
|
8666
|
+
}) })
|
|
8667
|
+
}) : /* @__PURE__ */ g("div", {
|
|
8455
8668
|
className: "flow-empty",
|
|
8456
8669
|
children: "Waiting for sample graph..."
|
|
8457
8670
|
})
|
|
@@ -8460,7 +8673,7 @@ function Bf(e) {
|
|
|
8460
8673
|
}
|
|
8461
8674
|
//#endregion
|
|
8462
8675
|
//#region src/embed.tsx
|
|
8463
|
-
function
|
|
8676
|
+
function Xf(e) {
|
|
8464
8677
|
let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0);
|
|
8465
8678
|
return c(() => {
|
|
8466
8679
|
let e = !1;
|
|
@@ -8482,26 +8695,29 @@ function Vf(e) {
|
|
|
8482
8695
|
className: "flow-error",
|
|
8483
8696
|
role: "alert",
|
|
8484
8697
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
|
|
8485
|
-
}) : /* @__PURE__ */ g(
|
|
8698
|
+
}) : /* @__PURE__ */ g(Yf, {
|
|
8486
8699
|
jsonText: n,
|
|
8487
8700
|
showHeader: !1
|
|
8488
8701
|
})
|
|
8489
8702
|
})
|
|
8490
8703
|
});
|
|
8491
8704
|
}
|
|
8492
|
-
var
|
|
8493
|
-
function
|
|
8494
|
-
|
|
8495
|
-
let r =
|
|
8496
|
-
|
|
8705
|
+
var Zf = /* @__PURE__ */ new Map(), Qf = null;
|
|
8706
|
+
function $f(e, t) {
|
|
8707
|
+
Zf.get(e)?.unmount();
|
|
8708
|
+
let r = m(e);
|
|
8709
|
+
Zf.set(e, r), Qf = e;
|
|
8710
|
+
let i = t.onClose;
|
|
8711
|
+
return r.render(n(Xf, {
|
|
8497
8712
|
...t,
|
|
8498
|
-
onClose:
|
|
8499
|
-
|
|
8713
|
+
onClose: i ? () => {
|
|
8714
|
+
ep(e), i();
|
|
8500
8715
|
} : void 0
|
|
8501
|
-
})),
|
|
8716
|
+
})), () => ep(e);
|
|
8502
8717
|
}
|
|
8503
|
-
function
|
|
8504
|
-
|
|
8718
|
+
function ep(e) {
|
|
8719
|
+
let t = e ?? Qf;
|
|
8720
|
+
t && (Zf.get(t)?.unmount(), Zf.delete(t), t === Qf && (Qf = null));
|
|
8505
8721
|
}
|
|
8506
8722
|
//#endregion
|
|
8507
|
-
export {
|
|
8723
|
+
export { Xf as GraphView, $f as mountGraphView, ep as unmountGraphView };
|