geonodes-web-render 0.1.3 → 0.2.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 +1066 -883
- package/dist/types/embed.d.ts +1 -1
- package/dist/types/gn/components/GenericGNNode.d.ts +1 -1
- package/dist/types/gn/components/GeometryNodesFlow.d.ts +1 -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 +83 -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/package.json +4 -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
|
-
}),
|
|
5098
|
-
} : void 0,
|
|
5099
|
-
onPointerDownCapture: w ? (n) => {
|
|
5100
|
-
let { domNode: r } = v.getState();
|
|
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());
|
|
5164
|
+
}), P.current && (l?.(e), x.setState({ nodesSelectionActive: M.current.size > 0 })), U());
|
|
5114
5165
|
} : void 0,
|
|
5115
|
-
|
|
5116
|
-
|
|
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,29 @@ 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:
|
|
6976
|
-
}),
|
|
6977
|
-
g(Ic, {
|
|
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
|
|
7093
|
+
viewport: Ct,
|
|
7094
|
+
onViewportChange: wt
|
|
7037
7095
|
}),
|
|
7038
|
-
g(
|
|
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);
|
|
7053
7111
|
J.error014();
|
|
7054
|
-
function
|
|
7112
|
+
function fd({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
7055
7113
|
return g("path", {
|
|
7056
7114
|
strokeWidth: t,
|
|
7057
7115
|
d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`,
|
|
@@ -7062,7 +7120,7 @@ function ud({ dimensions: e, lineWidth: t, variant: n, className: r }) {
|
|
|
7062
7120
|
])
|
|
7063
7121
|
});
|
|
7064
7122
|
}
|
|
7065
|
-
function
|
|
7123
|
+
function pd({ radius: e, className: t }) {
|
|
7066
7124
|
return g("circle", {
|
|
7067
7125
|
cx: e,
|
|
7068
7126
|
cy: e,
|
|
@@ -7074,25 +7132,25 @@ function dd({ radius: e, className: t }) {
|
|
|
7074
7132
|
])
|
|
7075
7133
|
});
|
|
7076
7134
|
}
|
|
7077
|
-
var
|
|
7135
|
+
var md;
|
|
7078
7136
|
(function(e) {
|
|
7079
7137
|
e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
|
|
7080
|
-
})(
|
|
7081
|
-
var
|
|
7082
|
-
[
|
|
7083
|
-
[
|
|
7084
|
-
[
|
|
7085
|
-
},
|
|
7138
|
+
})(md ||= {});
|
|
7139
|
+
var hd = {
|
|
7140
|
+
[md.Dots]: 1,
|
|
7141
|
+
[md.Lines]: 1,
|
|
7142
|
+
[md.Cross]: 6
|
|
7143
|
+
}, gd = (e) => ({
|
|
7086
7144
|
transform: e.transform,
|
|
7087
7145
|
patternId: `pattern-${e.rfId}`
|
|
7088
7146
|
});
|
|
7089
|
-
function
|
|
7090
|
-
let f = d(null), { transform: p, patternId: m } = Z(
|
|
7147
|
+
function _d({ id: e, variant: t = md.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
|
|
7148
|
+
let f = d(null), { transform: p, patternId: m } = Z(gd, X), h = r || hd[t], v = t === md.Dots, y = t === md.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
7149
|
return _("svg", {
|
|
7092
7150
|
className: S(["react-flow__background", l]),
|
|
7093
7151
|
style: {
|
|
7094
7152
|
...c,
|
|
7095
|
-
...
|
|
7153
|
+
...ml,
|
|
7096
7154
|
"--xy-background-color-props": s,
|
|
7097
7155
|
"--xy-background-pattern-color-props": o
|
|
7098
7156
|
},
|
|
@@ -7106,10 +7164,10 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7106
7164
|
height: x[1],
|
|
7107
7165
|
patternUnits: "userSpaceOnUse",
|
|
7108
7166
|
patternTransform: `translate(-${E[0]},-${E[1]})`,
|
|
7109
|
-
children: v ? g(
|
|
7167
|
+
children: v ? g(pd, {
|
|
7110
7168
|
radius: C / 2,
|
|
7111
7169
|
className: u
|
|
7112
|
-
}) : g(
|
|
7170
|
+
}) : g(fd, {
|
|
7113
7171
|
dimensions: T,
|
|
7114
7172
|
lineWidth: i,
|
|
7115
7173
|
variant: t,
|
|
@@ -7124,44 +7182,44 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
|
|
|
7124
7182
|
})]
|
|
7125
7183
|
});
|
|
7126
7184
|
}
|
|
7127
|
-
|
|
7128
|
-
var
|
|
7129
|
-
function
|
|
7185
|
+
_d.displayName = "Background";
|
|
7186
|
+
var vd = i(_d);
|
|
7187
|
+
function yd() {
|
|
7130
7188
|
return g("svg", {
|
|
7131
7189
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7132
7190
|
viewBox: "0 0 32 32",
|
|
7133
7191
|
children: g("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
|
|
7134
7192
|
});
|
|
7135
7193
|
}
|
|
7136
|
-
function
|
|
7194
|
+
function bd() {
|
|
7137
7195
|
return g("svg", {
|
|
7138
7196
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7139
7197
|
viewBox: "0 0 32 5",
|
|
7140
7198
|
children: g("path", { d: "M0 0h32v4.2H0z" })
|
|
7141
7199
|
});
|
|
7142
7200
|
}
|
|
7143
|
-
function
|
|
7201
|
+
function xd() {
|
|
7144
7202
|
return g("svg", {
|
|
7145
7203
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7146
7204
|
viewBox: "0 0 32 30",
|
|
7147
7205
|
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
7206
|
});
|
|
7149
7207
|
}
|
|
7150
|
-
function
|
|
7208
|
+
function Sd() {
|
|
7151
7209
|
return g("svg", {
|
|
7152
7210
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7153
7211
|
viewBox: "0 0 25 32",
|
|
7154
7212
|
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
7213
|
});
|
|
7156
7214
|
}
|
|
7157
|
-
function
|
|
7215
|
+
function Cd() {
|
|
7158
7216
|
return g("svg", {
|
|
7159
7217
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7160
7218
|
viewBox: "0 0 25 32",
|
|
7161
7219
|
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
7220
|
});
|
|
7163
7221
|
}
|
|
7164
|
-
function
|
|
7222
|
+
function wd({ children: e, className: t, ...n }) {
|
|
7165
7223
|
return g("button", {
|
|
7166
7224
|
type: "button",
|
|
7167
7225
|
className: S(["react-flow__controls-button", t]),
|
|
@@ -7169,27 +7227,15 @@ function Sd({ children: e, className: t, ...n }) {
|
|
|
7169
7227
|
children: e
|
|
7170
7228
|
});
|
|
7171
7229
|
}
|
|
7172
|
-
var
|
|
7230
|
+
var Td = (e) => ({
|
|
7173
7231
|
isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
|
|
7174
7232
|
minZoomReached: e.transform[2] <= e.minZoom,
|
|
7175
7233
|
maxZoomReached: e.transform[2] >= e.maxZoom,
|
|
7176
7234
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7177
7235
|
});
|
|
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, {
|
|
7236
|
+
function Ed({ 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 }) {
|
|
7237
|
+
let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Td, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
|
|
7238
|
+
return _(Sc, {
|
|
7193
7239
|
className: S([
|
|
7194
7240
|
"react-flow__controls",
|
|
7195
7241
|
f === "horizontal" ? "horizontal" : "vertical",
|
|
@@ -7200,42 +7246,54 @@ function wd({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
|
|
|
7200
7246
|
"data-testid": "rf__controls",
|
|
7201
7247
|
"aria-label": p ?? x["controls.ariaLabel"],
|
|
7202
7248
|
children: [
|
|
7203
|
-
t && _(h, { children: [g(
|
|
7204
|
-
onClick:
|
|
7249
|
+
t && _(h, { children: [g(wd, {
|
|
7250
|
+
onClick: () => {
|
|
7251
|
+
C(), a?.();
|
|
7252
|
+
},
|
|
7205
7253
|
className: "react-flow__controls-zoomin",
|
|
7206
7254
|
title: x["controls.zoomIn.ariaLabel"],
|
|
7207
7255
|
"aria-label": x["controls.zoomIn.ariaLabel"],
|
|
7208
7256
|
disabled: b,
|
|
7209
|
-
children: g(
|
|
7210
|
-
}), g(
|
|
7211
|
-
onClick:
|
|
7257
|
+
children: g(yd, {})
|
|
7258
|
+
}), g(wd, {
|
|
7259
|
+
onClick: () => {
|
|
7260
|
+
w(), o?.();
|
|
7261
|
+
},
|
|
7212
7262
|
className: "react-flow__controls-zoomout",
|
|
7213
7263
|
title: x["controls.zoomOut.ariaLabel"],
|
|
7214
7264
|
"aria-label": x["controls.zoomOut.ariaLabel"],
|
|
7215
7265
|
disabled: y,
|
|
7216
|
-
children: g(
|
|
7266
|
+
children: g(bd, {})
|
|
7217
7267
|
})] }),
|
|
7218
|
-
n && g(
|
|
7268
|
+
n && g(wd, {
|
|
7219
7269
|
className: "react-flow__controls-fitview",
|
|
7220
|
-
onClick:
|
|
7270
|
+
onClick: () => {
|
|
7271
|
+
T(i), s?.();
|
|
7272
|
+
},
|
|
7221
7273
|
title: x["controls.fitView.ariaLabel"],
|
|
7222
7274
|
"aria-label": x["controls.fitView.ariaLabel"],
|
|
7223
|
-
children: g(
|
|
7275
|
+
children: g(xd, {})
|
|
7224
7276
|
}),
|
|
7225
|
-
r && g(
|
|
7277
|
+
r && g(wd, {
|
|
7226
7278
|
className: "react-flow__controls-interactive",
|
|
7227
|
-
onClick:
|
|
7279
|
+
onClick: () => {
|
|
7280
|
+
m.setState({
|
|
7281
|
+
nodesDraggable: !v,
|
|
7282
|
+
nodesConnectable: !v,
|
|
7283
|
+
elementsSelectable: !v
|
|
7284
|
+
}), c?.(!v);
|
|
7285
|
+
},
|
|
7228
7286
|
title: x["controls.interactive.ariaLabel"],
|
|
7229
7287
|
"aria-label": x["controls.interactive.ariaLabel"],
|
|
7230
|
-
children: g(v ?
|
|
7288
|
+
children: g(v ? Cd : Sd, {})
|
|
7231
7289
|
}),
|
|
7232
7290
|
u
|
|
7233
7291
|
]
|
|
7234
7292
|
});
|
|
7235
7293
|
}
|
|
7236
|
-
|
|
7237
|
-
var
|
|
7238
|
-
function
|
|
7294
|
+
Ed.displayName = "Controls";
|
|
7295
|
+
var Dd = i(Ed);
|
|
7296
|
+
function Od({ 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
7297
|
let { background: m, backgroundColor: h } = a || {}, _ = o || m || h;
|
|
7240
7298
|
return g("rect", {
|
|
7241
7299
|
className: S([
|
|
@@ -7258,10 +7316,10 @@ function Ed({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, stroke
|
|
|
7258
7316
|
onClick: p ? (t) => p(t, e) : void 0
|
|
7259
7317
|
});
|
|
7260
7318
|
}
|
|
7261
|
-
var
|
|
7262
|
-
function
|
|
7263
|
-
let s = Z(
|
|
7264
|
-
return g(h, { children: s.map((e) => g(
|
|
7319
|
+
var kd = i(Od), Ad = (e) => e.nodes.map((e) => e.id), jd = (e) => e instanceof Function ? e : () => e;
|
|
7320
|
+
function Md({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = kd, onClick: o }) {
|
|
7321
|
+
let s = Z(Ad, X), c = jd(t), l = jd(e), u = jd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
7322
|
+
return g(h, { children: s.map((e) => g(Pd, {
|
|
7265
7323
|
id: e,
|
|
7266
7324
|
nodeColorFunc: c,
|
|
7267
7325
|
nodeStrokeColorFunc: l,
|
|
@@ -7273,7 +7331,7 @@ function Ad({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorde
|
|
|
7273
7331
|
shapeRendering: d
|
|
7274
7332
|
}, e)) });
|
|
7275
7333
|
}
|
|
7276
|
-
function
|
|
7334
|
+
function Nd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
|
|
7277
7335
|
let { node: l, x: u, y: d, width: f, height: p } = Z((t) => {
|
|
7278
7336
|
let n = t.nodeLookup.get(e);
|
|
7279
7337
|
if (!n) return {
|
|
@@ -7309,7 +7367,7 @@ function jd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
|
|
|
7309
7367
|
id: l.id
|
|
7310
7368
|
});
|
|
7311
7369
|
}
|
|
7312
|
-
var
|
|
7370
|
+
var Pd = i(Nd), Fd = i(Md), Id = 200, Ld = 150, Rd = (e) => !e.hidden, zd = (e) => {
|
|
7313
7371
|
let t = {
|
|
7314
7372
|
x: -e.transform[0] / e.transform[2],
|
|
7315
7373
|
y: -e.transform[1] / e.transform[2],
|
|
@@ -7318,7 +7376,7 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
|
|
|
7318
7376
|
};
|
|
7319
7377
|
return {
|
|
7320
7378
|
viewBB: t,
|
|
7321
|
-
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter:
|
|
7379
|
+
boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Rd }), t) : t,
|
|
7322
7380
|
rfId: e.rfId,
|
|
7323
7381
|
panZoom: e.panZoom,
|
|
7324
7382
|
translateExtent: e.translateExtent,
|
|
@@ -7326,9 +7384,9 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
|
|
|
7326
7384
|
flowHeight: e.height,
|
|
7327
7385
|
ariaLabelConfig: e.ariaLabelConfig
|
|
7328
7386
|
};
|
|
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(
|
|
7387
|
+
}, Bd = "react-flow__minimap-desc";
|
|
7388
|
+
function Vd({ 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 }) {
|
|
7389
|
+
let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(zd, X), L = e?.width ?? Id, R = e?.height ?? Ld, 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 = `${Bd}-${j}`, ae = d(0), oe = d();
|
|
7332
7390
|
ae.current = B, c(() => {
|
|
7333
7391
|
if (O.current && M) return oe.current = Ts({
|
|
7334
7392
|
domNode: O.current,
|
|
@@ -7367,7 +7425,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7367
7425
|
let n = D.getState().nodeLookup.get(t).internals.userNode;
|
|
7368
7426
|
y(e, n);
|
|
7369
7427
|
}, []) : void 0, le = C ?? I["minimap.ariaLabel"];
|
|
7370
|
-
return g(
|
|
7428
|
+
return g(Sc, {
|
|
7371
7429
|
position: h,
|
|
7372
7430
|
style: {
|
|
7373
7431
|
...e,
|
|
@@ -7395,7 +7453,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7395
7453
|
id: ie,
|
|
7396
7454
|
children: le
|
|
7397
7455
|
}),
|
|
7398
|
-
g(
|
|
7456
|
+
g(Fd, {
|
|
7399
7457
|
onClick: ce,
|
|
7400
7458
|
nodeColor: r,
|
|
7401
7459
|
nodeStrokeColor: n,
|
|
@@ -7415,15 +7473,15 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
|
|
|
7415
7473
|
})
|
|
7416
7474
|
});
|
|
7417
7475
|
}
|
|
7418
|
-
|
|
7419
|
-
var
|
|
7476
|
+
Vd.displayName = "MiniMap", i(Vd);
|
|
7477
|
+
var Hd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Ud = {
|
|
7420
7478
|
[Bs.Line]: "right",
|
|
7421
7479
|
[Bs.Handle]: "bottom-right"
|
|
7422
7480
|
};
|
|
7423
|
-
function
|
|
7424
|
-
let C =
|
|
7481
|
+
function Wd({ 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 }) {
|
|
7482
|
+
let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Hd(D && _), [D, _]), X), k = d(null), A = t ?? Ud[n];
|
|
7425
7483
|
return c(() => {
|
|
7426
|
-
if (!(!E.current || !w)) return k.current ||=
|
|
7484
|
+
if (!(!E.current || !w)) return k.current ||= Zs({
|
|
7427
7485
|
domNode: E.current,
|
|
7428
7486
|
nodeId: w,
|
|
7429
7487
|
getStoreItems: () => {
|
|
@@ -7547,17 +7605,17 @@ function Hd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, styl
|
|
|
7547
7605
|
children: o
|
|
7548
7606
|
});
|
|
7549
7607
|
}
|
|
7550
|
-
i(
|
|
7608
|
+
i(Wd);
|
|
7551
7609
|
//#endregion
|
|
7552
7610
|
//#region src/gn/ir/socketColors.ts
|
|
7553
|
-
function
|
|
7611
|
+
function Gd(e) {
|
|
7554
7612
|
return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
|
|
7555
7613
|
}
|
|
7556
7614
|
function $(e, t, n) {
|
|
7557
|
-
let r = (e) => Math.round(Math.min(1, Math.max(0,
|
|
7615
|
+
let r = (e) => Math.round(Math.min(1, Math.max(0, Gd(e))) * 255).toString(16).padStart(2, "0");
|
|
7558
7616
|
return `#${r(e)}${r(t)}${r(n)}`;
|
|
7559
7617
|
}
|
|
7560
|
-
var
|
|
7618
|
+
var Kd = {
|
|
7561
7619
|
FLOAT: $(.63, .63, .63),
|
|
7562
7620
|
VECTOR: $(.39, .39, .78),
|
|
7563
7621
|
RGBA: $(.78, .78, .16),
|
|
@@ -7579,12 +7637,12 @@ var Wd = {
|
|
|
7579
7637
|
INT_VECTOR: $(.36, .47, .61),
|
|
7580
7638
|
CUSTOM: $(.2, .2, .2)
|
|
7581
7639
|
};
|
|
7582
|
-
function
|
|
7583
|
-
return
|
|
7640
|
+
function qd(e) {
|
|
7641
|
+
return Kd[e] ?? Kd.CUSTOM;
|
|
7584
7642
|
}
|
|
7585
7643
|
//#endregion
|
|
7586
7644
|
//#region src/gn/ir/nodeColors.ts
|
|
7587
|
-
var
|
|
7645
|
+
var Jd = {
|
|
7588
7646
|
GEOMETRY: "#1d725e",
|
|
7589
7647
|
INPUT: "#82354c",
|
|
7590
7648
|
OUTPUT: "#3e232a",
|
|
@@ -7601,10 +7659,10 @@ var Kd = {
|
|
|
7601
7659
|
SCRIPT: "#203c3c",
|
|
7602
7660
|
DEFAULT: "#303030"
|
|
7603
7661
|
};
|
|
7604
|
-
function
|
|
7662
|
+
function Yd(e) {
|
|
7605
7663
|
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
7664
|
}
|
|
7607
|
-
var
|
|
7665
|
+
var Xd = {
|
|
7608
7666
|
GeometryNodeInputMaterial: "INPUT",
|
|
7609
7667
|
GeometryNodeInputMaterialIndex: "INPUT",
|
|
7610
7668
|
GeometryNodeInputRadius: "INPUT",
|
|
@@ -7655,12 +7713,12 @@ var Jd = {
|
|
|
7655
7713
|
GeometryNodeFieldVariance: "CONVERTER",
|
|
7656
7714
|
GeometryNodeViewer: "OUTPUT"
|
|
7657
7715
|
};
|
|
7658
|
-
function
|
|
7659
|
-
return
|
|
7716
|
+
function Zd(e) {
|
|
7717
|
+
return Jd[Xd[e] ?? Yd(e)] ?? Jd.DEFAULT;
|
|
7660
7718
|
}
|
|
7661
7719
|
//#endregion
|
|
7662
7720
|
//#region src/gn/importer/blenderTree.ts
|
|
7663
|
-
var
|
|
7721
|
+
var Qd = {
|
|
7664
7722
|
NodeSocketGeometry: "GEOMETRY",
|
|
7665
7723
|
NodeSocketFloat: "FLOAT",
|
|
7666
7724
|
NodeSocketVector: "VECTOR",
|
|
@@ -7677,10 +7735,10 @@ var Xd = {
|
|
|
7677
7735
|
NodeSocketMatrix: "MATRIX",
|
|
7678
7736
|
NodeSocketMenu: "MENU"
|
|
7679
7737
|
};
|
|
7680
|
-
function
|
|
7681
|
-
return
|
|
7738
|
+
function $d(e) {
|
|
7739
|
+
return Qd[e] ?? "CUSTOM";
|
|
7682
7740
|
}
|
|
7683
|
-
var
|
|
7741
|
+
var ef = {
|
|
7684
7742
|
HSV: [
|
|
7685
7743
|
"Hue",
|
|
7686
7744
|
"Saturation",
|
|
@@ -7697,7 +7755,7 @@ var Qd = {
|
|
|
7697
7755
|
"Blue"
|
|
7698
7756
|
]
|
|
7699
7757
|
};
|
|
7700
|
-
function
|
|
7758
|
+
function tf(e) {
|
|
7701
7759
|
let t = e.data.mapping?.data;
|
|
7702
7760
|
if (!t) return;
|
|
7703
7761
|
let n = t.curves?.data?.items;
|
|
@@ -7715,8 +7773,8 @@ function $d(e) {
|
|
|
7715
7773
|
points: r
|
|
7716
7774
|
};
|
|
7717
7775
|
}
|
|
7718
|
-
function
|
|
7719
|
-
let n =
|
|
7776
|
+
function nf(e, t) {
|
|
7777
|
+
let n = ef[t ?? "RGB"] ?? ef.RGB, r = ef.RGB;
|
|
7720
7778
|
return e.map((e) => {
|
|
7721
7779
|
let t = r.indexOf(e.name);
|
|
7722
7780
|
return t === -1 ? e : {
|
|
@@ -7725,8 +7783,11 @@ function ef(e, t) {
|
|
|
7725
7783
|
};
|
|
7726
7784
|
});
|
|
7727
7785
|
}
|
|
7728
|
-
function
|
|
7729
|
-
|
|
7786
|
+
function rf(e) {
|
|
7787
|
+
return e.replace(/\.\d{3}$/, "");
|
|
7788
|
+
}
|
|
7789
|
+
function af(e, t) {
|
|
7790
|
+
let n = $d(e.data.socket_idname ?? ""), r = qd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
|
|
7730
7791
|
id: e,
|
|
7731
7792
|
name: "",
|
|
7732
7793
|
dataType: n,
|
|
@@ -7751,7 +7812,7 @@ function tf(e, t) {
|
|
|
7751
7812
|
outputs: [o(a)]
|
|
7752
7813
|
};
|
|
7753
7814
|
}
|
|
7754
|
-
function
|
|
7815
|
+
function of(e) {
|
|
7755
7816
|
return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
|
|
7756
7817
|
kind: "vec",
|
|
7757
7818
|
values: e
|
|
@@ -7760,20 +7821,20 @@ function nf(e) {
|
|
|
7760
7821
|
value: e
|
|
7761
7822
|
} : null;
|
|
7762
7823
|
}
|
|
7763
|
-
function
|
|
7824
|
+
function sf(e, t) {
|
|
7764
7825
|
return {
|
|
7765
7826
|
id: String(e.id),
|
|
7766
7827
|
name: e.data.name,
|
|
7767
7828
|
dataType: e.data.type,
|
|
7768
7829
|
displayShape: e.data.display_shape,
|
|
7769
|
-
color:
|
|
7770
|
-
defaultValue:
|
|
7830
|
+
color: qd(e.data.type),
|
|
7831
|
+
defaultValue: of(e.data.default_value),
|
|
7771
7832
|
hideValue: e.data.hide_value ?? !1,
|
|
7772
7833
|
enabled: e.data.enabled ?? !0,
|
|
7773
7834
|
index: t
|
|
7774
7835
|
};
|
|
7775
7836
|
}
|
|
7776
|
-
function
|
|
7837
|
+
function cf(e) {
|
|
7777
7838
|
if (e.data.bl_idname === "FunctionNodeCompare") {
|
|
7778
7839
|
let t = {};
|
|
7779
7840
|
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 +7844,20 @@ function af(e) {
|
|
|
7783
7844
|
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
7845
|
}
|
|
7785
7846
|
}
|
|
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.");
|
|
7847
|
+
function lf(e, t) {
|
|
7848
|
+
if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
|
|
7849
|
+
if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
|
|
7850
|
+
if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
|
|
7793
7851
|
return {
|
|
7794
|
-
id: String(
|
|
7795
|
-
label:
|
|
7796
|
-
nodes:
|
|
7852
|
+
id: String(e.id),
|
|
7853
|
+
label: e.data.name,
|
|
7854
|
+
nodes: e.data.nodes.data.items.map((e, t) => {
|
|
7797
7855
|
if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
|
|
7798
7856
|
let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
|
|
7799
|
-
if (e.data.bl_idname === "NodeReroute") return
|
|
7857
|
+
if (e.data.bl_idname === "NodeReroute") return af(e, n);
|
|
7800
7858
|
let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
|
|
7801
7859
|
if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
|
|
7802
|
-
return
|
|
7860
|
+
return sf(t, n);
|
|
7803
7861
|
});
|
|
7804
7862
|
e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
|
|
7805
7863
|
...r[0],
|
|
@@ -7810,27 +7868,28 @@ function of(e) {
|
|
|
7810
7868
|
});
|
|
7811
7869
|
let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
|
|
7812
7870
|
if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
|
|
7813
|
-
return
|
|
7871
|
+
return sf(t, n);
|
|
7814
7872
|
});
|
|
7815
|
-
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i =
|
|
7816
|
-
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ?
|
|
7873
|
+
(e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = nf(i, e.data.mode));
|
|
7874
|
+
let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? tf(e) : void 0, o = cf(e);
|
|
7817
7875
|
return {
|
|
7818
7876
|
id: String(e.id),
|
|
7819
7877
|
type: e.data.bl_idname,
|
|
7820
|
-
label: e.data.label || e.data.name,
|
|
7878
|
+
label: e.data.label || rf(e.data.name),
|
|
7821
7879
|
position: {
|
|
7822
7880
|
x: n[0],
|
|
7823
7881
|
y: -n[1]
|
|
7824
7882
|
},
|
|
7825
7883
|
width: e.data.width ?? 140,
|
|
7826
|
-
headerColor:
|
|
7884
|
+
headerColor: Zd(e.data.bl_idname),
|
|
7827
7885
|
inputs: i,
|
|
7828
7886
|
outputs: r,
|
|
7829
7887
|
floatCurve: a,
|
|
7830
|
-
...o ? { properties: o } : {}
|
|
7888
|
+
...o ? { properties: o } : {},
|
|
7889
|
+
...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) }
|
|
7831
7890
|
};
|
|
7832
7891
|
}),
|
|
7833
|
-
links:
|
|
7892
|
+
links: e.data.links.data.items.map((e, t) => {
|
|
7834
7893
|
if (!e?.data) throw Error(`Link at index ${t} is missing ".data".`);
|
|
7835
7894
|
return {
|
|
7836
7895
|
id: String(e.id),
|
|
@@ -7840,21 +7899,45 @@ function of(e) {
|
|
|
7840
7899
|
})
|
|
7841
7900
|
};
|
|
7842
7901
|
}
|
|
7843
|
-
function
|
|
7902
|
+
function uf(e) {
|
|
7903
|
+
if (!e || typeof e != "object") throw Error("JSON root must be an object.");
|
|
7904
|
+
if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
|
|
7905
|
+
let t = {};
|
|
7906
|
+
for (let n = 0; n < e.node_trees.length; n++) {
|
|
7907
|
+
let r = lf(e.node_trees[n], n);
|
|
7908
|
+
t[r.id] = r;
|
|
7909
|
+
}
|
|
7910
|
+
let n = /* @__PURE__ */ new Set();
|
|
7911
|
+
for (let e of Object.values(t)) for (let r of e.nodes) {
|
|
7912
|
+
if (r.groupTreeId === void 0) continue;
|
|
7913
|
+
let e = t[r.groupTreeId];
|
|
7914
|
+
if (!e) {
|
|
7915
|
+
delete r.groupTreeId;
|
|
7916
|
+
continue;
|
|
7917
|
+
}
|
|
7918
|
+
r.groupTreeName = e.label, n.add(e.id);
|
|
7919
|
+
}
|
|
7920
|
+
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];
|
|
7921
|
+
return {
|
|
7922
|
+
rootId: String(i.id),
|
|
7923
|
+
trees: t
|
|
7924
|
+
};
|
|
7925
|
+
}
|
|
7926
|
+
function df(e, t) {
|
|
7844
7927
|
return {
|
|
7845
7928
|
...t,
|
|
7846
7929
|
nodeId: e,
|
|
7847
7930
|
direction: "input"
|
|
7848
7931
|
};
|
|
7849
7932
|
}
|
|
7850
|
-
function
|
|
7933
|
+
function ff(e, t) {
|
|
7851
7934
|
return {
|
|
7852
7935
|
...t,
|
|
7853
7936
|
nodeId: e,
|
|
7854
7937
|
direction: "output"
|
|
7855
7938
|
};
|
|
7856
7939
|
}
|
|
7857
|
-
function
|
|
7940
|
+
function pf(e) {
|
|
7858
7941
|
let t = e.nodes.map((e) => ({
|
|
7859
7942
|
id: e.id,
|
|
7860
7943
|
type: e.type,
|
|
@@ -7862,10 +7945,12 @@ function lf(e) {
|
|
|
7862
7945
|
position: e.position,
|
|
7863
7946
|
width: e.width,
|
|
7864
7947
|
headerColor: e.headerColor,
|
|
7865
|
-
inputs: e.inputs.map((t) =>
|
|
7866
|
-
outputs: e.outputs.map((t) =>
|
|
7948
|
+
inputs: e.inputs.map((t) => df(e.id, t)),
|
|
7949
|
+
outputs: e.outputs.map((t) => ff(e.id, t)),
|
|
7867
7950
|
floatCurve: e.floatCurve,
|
|
7868
|
-
properties: e.properties
|
|
7951
|
+
properties: e.properties,
|
|
7952
|
+
groupTreeId: e.groupTreeId,
|
|
7953
|
+
groupTreeName: e.groupTreeName
|
|
7869
7954
|
})), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
7870
7955
|
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
7956
|
let i = e.links.map((e) => ({
|
|
@@ -7885,11 +7970,11 @@ function lf(e) {
|
|
|
7885
7970
|
}
|
|
7886
7971
|
//#endregion
|
|
7887
7972
|
//#region src/gn/xyflow/mapGraphIRToFlow.ts
|
|
7888
|
-
function
|
|
7973
|
+
function mf(e) {
|
|
7889
7974
|
let t = Math.max(e.inputs.length, e.outputs.length);
|
|
7890
7975
|
return Math.max(60, 32 + t * 18 + 16);
|
|
7891
7976
|
}
|
|
7892
|
-
function
|
|
7977
|
+
function hf(e, t) {
|
|
7893
7978
|
if (e.type === "NodeReroute") {
|
|
7894
7979
|
let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
|
|
7895
7980
|
return {
|
|
@@ -7923,11 +8008,13 @@ function df(e, t) {
|
|
|
7923
8008
|
outputs: e.outputs,
|
|
7924
8009
|
connectedInputIds: e.inputs.filter((e) => t.has(e.id)).map((e) => e.id),
|
|
7925
8010
|
floatCurve: e.floatCurve,
|
|
7926
|
-
properties: e.properties
|
|
8011
|
+
properties: e.properties,
|
|
8012
|
+
groupTreeId: e.groupTreeId,
|
|
8013
|
+
groupTreeName: e.groupTreeName
|
|
7927
8014
|
}
|
|
7928
8015
|
};
|
|
7929
8016
|
}
|
|
7930
|
-
function
|
|
8017
|
+
function gf(e, t, n) {
|
|
7931
8018
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
7932
8019
|
for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
|
|
7933
8020
|
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 +8038,16 @@ function ff(e, t, n) {
|
|
|
7951
8038
|
for (let e of a) s.has(e) && l.add(e);
|
|
7952
8039
|
return l;
|
|
7953
8040
|
}
|
|
7954
|
-
function
|
|
7955
|
-
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) =>
|
|
8041
|
+
function _f(e) {
|
|
8042
|
+
let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => hf(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
|
|
7956
8043
|
if (r && i) {
|
|
7957
|
-
let t =
|
|
8044
|
+
let t = gf(r.id, i.id, e);
|
|
7958
8045
|
if (t.size > 0) {
|
|
7959
8046
|
let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
|
|
7960
8047
|
for (let e of t) {
|
|
7961
8048
|
let t = i.get(e);
|
|
7962
8049
|
if (!t) continue;
|
|
7963
|
-
let n = t.width, r =
|
|
8050
|
+
let n = t.width, r = mf(t);
|
|
7964
8051
|
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
8052
|
}
|
|
7966
8053
|
if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
|
|
@@ -8008,10 +8095,10 @@ function pf(e) {
|
|
|
8008
8095
|
}
|
|
8009
8096
|
//#endregion
|
|
8010
8097
|
//#region src/gn/ir/curvePath.ts
|
|
8011
|
-
function
|
|
8098
|
+
function vf(e, t) {
|
|
8012
8099
|
return Math.sqrt(e * e + t * t);
|
|
8013
8100
|
}
|
|
8014
|
-
function
|
|
8101
|
+
function yf(e) {
|
|
8015
8102
|
let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
|
|
8016
8103
|
let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
|
|
8017
8104
|
if (i === "VECTOR") return {
|
|
@@ -8021,11 +8108,11 @@ function hf(e) {
|
|
|
8021
8108
|
let c = 0, l = 0, u = 0, d = 0;
|
|
8022
8109
|
if (o && s) {
|
|
8023
8110
|
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 =
|
|
8111
|
+
if (u = vf(e, t), d = vf(i, a), u > 1e-8 && d > 1e-8) {
|
|
8112
|
+
let n = e / u + i / d, r = t / u + a / d, o = vf(n, r);
|
|
8026
8113
|
o > 1e-8 && (c = n / o, l = r / o);
|
|
8027
8114
|
} 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 =
|
|
8115
|
+
} else s ? (d = vf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = vf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
|
|
8029
8116
|
let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
|
|
8030
8117
|
if (i === "AUTO_CLAMPED") {
|
|
8031
8118
|
if (o) {
|
|
@@ -8070,7 +8157,7 @@ function hf(e) {
|
|
|
8070
8157
|
}
|
|
8071
8158
|
return n;
|
|
8072
8159
|
}
|
|
8073
|
-
function
|
|
8160
|
+
function bf(e, t, n, r, i, a, o) {
|
|
8074
8161
|
let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
|
|
8075
8162
|
if (e.length < 2) return {
|
|
8076
8163
|
strokePath: "",
|
|
@@ -8078,7 +8165,7 @@ function gf(e, t, n, r, i, a, o) {
|
|
|
8078
8165
|
zeroLinePath: "",
|
|
8079
8166
|
dotPositions: []
|
|
8080
8167
|
};
|
|
8081
|
-
let d =
|
|
8168
|
+
let d = yf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
|
|
8082
8169
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8083
8170
|
let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
|
|
8084
8171
|
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 +8179,19 @@ function gf(e, t, n, r, i, a, o) {
|
|
|
8092
8179
|
};
|
|
8093
8180
|
}
|
|
8094
8181
|
//#endregion
|
|
8182
|
+
//#region src/gn/components/groupNavContext.ts
|
|
8183
|
+
var xf = t(null);
|
|
8184
|
+
function Sf() {
|
|
8185
|
+
return o(xf);
|
|
8186
|
+
}
|
|
8187
|
+
//#endregion
|
|
8095
8188
|
//#region src/gn/components/GenericGNNode.tsx
|
|
8096
|
-
var
|
|
8189
|
+
var Cf = [
|
|
8097
8190
|
"X",
|
|
8098
8191
|
"Y",
|
|
8099
8192
|
"Z",
|
|
8100
8193
|
"W"
|
|
8101
|
-
],
|
|
8194
|
+
], wf = {
|
|
8102
8195
|
FLOAT: "Float",
|
|
8103
8196
|
INT: "Integer",
|
|
8104
8197
|
VECTOR: "Vector",
|
|
@@ -8106,7 +8199,7 @@ var _f = [
|
|
|
8106
8199
|
STRING: "String",
|
|
8107
8200
|
BOOLEAN: "Boolean",
|
|
8108
8201
|
ROTATION: "Rotation"
|
|
8109
|
-
},
|
|
8202
|
+
}, Tf = {
|
|
8110
8203
|
EQUAL: "Equal",
|
|
8111
8204
|
NOT_EQUAL: "Not Equal",
|
|
8112
8205
|
LESS_THAN: "Less Than",
|
|
@@ -8152,10 +8245,10 @@ var _f = [
|
|
|
8152
8245
|
RADIANS: "To Radians",
|
|
8153
8246
|
DEGREES: "To Degrees"
|
|
8154
8247
|
};
|
|
8155
|
-
function
|
|
8156
|
-
return e === "data_type" ?
|
|
8248
|
+
function Ef(e, t) {
|
|
8249
|
+
return e === "data_type" ? wf[t] ?? t : e === "operation" ? Tf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
|
|
8157
8250
|
}
|
|
8158
|
-
function
|
|
8251
|
+
function Df(e) {
|
|
8159
8252
|
switch (e) {
|
|
8160
8253
|
case "LINE": return "gn-socket--line";
|
|
8161
8254
|
case "DIAMOND": return "gn-socket--diamond";
|
|
@@ -8164,55 +8257,55 @@ function xf(e) {
|
|
|
8164
8257
|
default: return "gn-socket--circle";
|
|
8165
8258
|
}
|
|
8166
8259
|
}
|
|
8167
|
-
function
|
|
8260
|
+
function Of(e) {
|
|
8168
8261
|
return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
|
|
8169
8262
|
}
|
|
8170
|
-
function
|
|
8263
|
+
function kf(e) {
|
|
8171
8264
|
return parseFloat(e.toFixed(3)).toString();
|
|
8172
8265
|
}
|
|
8173
|
-
function
|
|
8174
|
-
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${
|
|
8266
|
+
function Af(e, t) {
|
|
8267
|
+
return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${kf(e)}${Of(t)}`;
|
|
8175
8268
|
}
|
|
8176
|
-
function
|
|
8269
|
+
function jf(e) {
|
|
8177
8270
|
return Math.round(Math.min(1, Math.max(0, e)) * 255);
|
|
8178
8271
|
}
|
|
8179
|
-
function
|
|
8272
|
+
function Mf(e) {
|
|
8180
8273
|
let [t, n, r, i = 1] = e.values;
|
|
8181
8274
|
return /* @__PURE__ */ g("div", {
|
|
8182
8275
|
className: "gn-node__color-swatch",
|
|
8183
|
-
style: { background: `rgba(${
|
|
8276
|
+
style: { background: `rgba(${jf(t)},${jf(n)},${jf(r)},${i.toFixed(2)})` }
|
|
8184
8277
|
});
|
|
8185
8278
|
}
|
|
8186
|
-
function
|
|
8187
|
-
if (e.dataType === "RGBA") return /* @__PURE__ */ g(
|
|
8188
|
-
let t =
|
|
8279
|
+
function Nf(e) {
|
|
8280
|
+
if (e.dataType === "RGBA") return /* @__PURE__ */ g(Mf, { values: e.values });
|
|
8281
|
+
let t = Of(e.dataType);
|
|
8189
8282
|
return /* @__PURE__ */ g("div", {
|
|
8190
8283
|
className: "gn-node__vec-block",
|
|
8191
8284
|
children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
|
|
8192
8285
|
className: "gn-node__vec-row",
|
|
8193
8286
|
children: [/* @__PURE__ */ g("span", {
|
|
8194
8287
|
className: "gn-node__vec-label",
|
|
8195
|
-
children:
|
|
8288
|
+
children: Cf[n]
|
|
8196
8289
|
}), /* @__PURE__ */ _("span", {
|
|
8197
8290
|
className: "gn-node__vec-value",
|
|
8198
|
-
children: [
|
|
8291
|
+
children: [kf(e), t]
|
|
8199
8292
|
})]
|
|
8200
8293
|
}, n))
|
|
8201
8294
|
});
|
|
8202
8295
|
}
|
|
8203
|
-
function
|
|
8296
|
+
function Pf({ properties: e }) {
|
|
8204
8297
|
let t = Object.entries(e);
|
|
8205
8298
|
return t.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
8206
8299
|
className: "gn-node__props",
|
|
8207
8300
|
children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
|
|
8208
8301
|
className: "gn-node__prop-row",
|
|
8209
|
-
children:
|
|
8302
|
+
children: Ef(e, t)
|
|
8210
8303
|
}, e))
|
|
8211
8304
|
});
|
|
8212
8305
|
}
|
|
8213
|
-
var
|
|
8214
|
-
function
|
|
8215
|
-
let n = Math.max(10, t -
|
|
8306
|
+
var Ff = 120, If = 6;
|
|
8307
|
+
function Lf({ curve: e, width: t }) {
|
|
8308
|
+
let n = Math.max(10, t - If * 2), r = Ff, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = bf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
|
|
8216
8309
|
return /* @__PURE__ */ g("div", {
|
|
8217
8310
|
className: "gn-node__curve-wrap",
|
|
8218
8311
|
children: /* @__PURE__ */ _("svg", {
|
|
@@ -8243,16 +8336,16 @@ function jf({ curve: e, width: t }) {
|
|
|
8243
8336
|
})
|
|
8244
8337
|
});
|
|
8245
8338
|
}
|
|
8246
|
-
function
|
|
8339
|
+
function Rf(e) {
|
|
8247
8340
|
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
8341
|
return /* @__PURE__ */ _("div", {
|
|
8249
8342
|
className: `gn-node__socket-row gn-node__socket-row--${i}`,
|
|
8250
8343
|
children: [
|
|
8251
|
-
/* @__PURE__ */ g(
|
|
8344
|
+
/* @__PURE__ */ g(Ml, {
|
|
8252
8345
|
id: t.id,
|
|
8253
8346
|
type: r,
|
|
8254
8347
|
position: n,
|
|
8255
|
-
className: `gn-socket ${
|
|
8348
|
+
className: `gn-socket ${Df(t.displayShape)}`,
|
|
8256
8349
|
style: {
|
|
8257
8350
|
top: "50%",
|
|
8258
8351
|
background: t.color,
|
|
@@ -8265,18 +8358,32 @@ function Mf(e) {
|
|
|
8265
8358
|
}),
|
|
8266
8359
|
s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
|
|
8267
8360
|
className: "gn-node__value",
|
|
8268
|
-
children:
|
|
8361
|
+
children: Af(t.defaultValue.value, t.dataType)
|
|
8269
8362
|
}) : null
|
|
8270
8363
|
]
|
|
8271
8364
|
});
|
|
8272
8365
|
}
|
|
8273
|
-
function
|
|
8366
|
+
function zf(e, t) {
|
|
8274
8367
|
return !t && !e.hideValue && e.defaultValue?.kind === "vec";
|
|
8275
8368
|
}
|
|
8276
|
-
function
|
|
8277
|
-
|
|
8369
|
+
function Bf() {
|
|
8370
|
+
return /* @__PURE__ */ _("div", {
|
|
8371
|
+
className: "gn-node__stack",
|
|
8372
|
+
"aria-hidden": "true",
|
|
8373
|
+
children: [
|
|
8374
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
|
|
8375
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
|
|
8376
|
+
/* @__PURE__ */ g("div", { className: "gn-node__stack-bar" })
|
|
8377
|
+
]
|
|
8378
|
+
});
|
|
8379
|
+
}
|
|
8380
|
+
function Vf(e) {
|
|
8381
|
+
let t = e.data, n = Sf(), 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;
|
|
8278
8382
|
return /* @__PURE__ */ _("div", {
|
|
8279
|
-
className: "gn-node"
|
|
8383
|
+
className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
|
|
8384
|
+
onClick: s ? () => n.openGroup(o) : void 0,
|
|
8385
|
+
role: s ? "button" : void 0,
|
|
8386
|
+
title: s ? `Open group "${t.groupTreeName}"` : void 0,
|
|
8280
8387
|
children: [
|
|
8281
8388
|
/* @__PURE__ */ g("div", {
|
|
8282
8389
|
className: "gn-node__header",
|
|
@@ -8286,28 +8393,29 @@ function Pf(e) {
|
|
|
8286
8393
|
children: t.label
|
|
8287
8394
|
})
|
|
8288
8395
|
}),
|
|
8289
|
-
|
|
8290
|
-
t.
|
|
8396
|
+
s && /* @__PURE__ */ g(Bf, {}),
|
|
8397
|
+
t.properties && /* @__PURE__ */ g(Pf, { properties: t.properties }),
|
|
8398
|
+
t.floatCurve && /* @__PURE__ */ g(Lf, {
|
|
8291
8399
|
curve: t.floatCurve,
|
|
8292
8400
|
width: t.width
|
|
8293
8401
|
}),
|
|
8294
8402
|
/* @__PURE__ */ _("div", {
|
|
8295
8403
|
className: "gn-node__body",
|
|
8296
|
-
children: [
|
|
8404
|
+
children: [i.map((e) => /* @__PURE__ */ g(Rf, {
|
|
8297
8405
|
socket: e,
|
|
8298
8406
|
position: Y.Right,
|
|
8299
8407
|
type: "source",
|
|
8300
8408
|
align: "right",
|
|
8301
8409
|
suppressDefault: !0
|
|
8302
|
-
}, e.id)),
|
|
8303
|
-
let t =
|
|
8304
|
-
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(
|
|
8410
|
+
}, e.id)), a.map((e) => {
|
|
8411
|
+
let t = r.has(e.id);
|
|
8412
|
+
return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Rf, {
|
|
8305
8413
|
socket: e,
|
|
8306
8414
|
position: Y.Left,
|
|
8307
8415
|
type: "target",
|
|
8308
8416
|
align: "left",
|
|
8309
8417
|
suppressDefault: t
|
|
8310
|
-
}),
|
|
8418
|
+
}), zf(e, t) ? /* @__PURE__ */ g(Nf, {
|
|
8311
8419
|
values: e.defaultValue.values,
|
|
8312
8420
|
dataType: e.dataType
|
|
8313
8421
|
}) : null] }, e.id);
|
|
@@ -8318,17 +8426,17 @@ function Pf(e) {
|
|
|
8318
8426
|
}
|
|
8319
8427
|
//#endregion
|
|
8320
8428
|
//#region src/gn/components/RerouteNode.tsx
|
|
8321
|
-
function
|
|
8429
|
+
function Hf(e) {
|
|
8322
8430
|
let t = e.data;
|
|
8323
8431
|
return /* @__PURE__ */ _("div", {
|
|
8324
8432
|
className: "gn-reroute",
|
|
8325
8433
|
style: { "--gn-reroute-color": t.color },
|
|
8326
|
-
children: [/* @__PURE__ */ g(
|
|
8434
|
+
children: [/* @__PURE__ */ g(Ml, {
|
|
8327
8435
|
id: t.inputSocketId,
|
|
8328
8436
|
type: "target",
|
|
8329
8437
|
position: Y.Left,
|
|
8330
8438
|
className: "gn-reroute__handle"
|
|
8331
|
-
}), /* @__PURE__ */ g(
|
|
8439
|
+
}), /* @__PURE__ */ g(Ml, {
|
|
8332
8440
|
id: t.outputSocketId,
|
|
8333
8441
|
type: "source",
|
|
8334
8442
|
position: Y.Right,
|
|
@@ -8338,7 +8446,7 @@ function Ff(e) {
|
|
|
8338
8446
|
}
|
|
8339
8447
|
//#endregion
|
|
8340
8448
|
//#region src/gn/components/SimulationZoneFrame.tsx
|
|
8341
|
-
function
|
|
8449
|
+
function Uf(e) {
|
|
8342
8450
|
let t = e.data;
|
|
8343
8451
|
return /* @__PURE__ */ g("div", {
|
|
8344
8452
|
className: "gn-sim-zone",
|
|
@@ -8365,21 +8473,21 @@ function If(e) {
|
|
|
8365
8473
|
}
|
|
8366
8474
|
//#endregion
|
|
8367
8475
|
//#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:
|
|
8476
|
+
var Wf = {
|
|
8477
|
+
gnNode: Vf,
|
|
8478
|
+
rerouteNode: Hf,
|
|
8479
|
+
simulationZone: Uf
|
|
8480
|
+
}, Gf = { padding: .08 };
|
|
8481
|
+
function Kf(e) {
|
|
8482
|
+
let { nodes: t, edges: n, breadcrumbs: r, onNavigate: i } = e, { fitView: a } = ll();
|
|
8375
8483
|
return c(() => {
|
|
8376
|
-
|
|
8377
|
-
}, [t,
|
|
8484
|
+
a(Gf);
|
|
8485
|
+
}, [t, a]), /* @__PURE__ */ _(dd, {
|
|
8378
8486
|
nodes: t,
|
|
8379
8487
|
edges: n,
|
|
8380
|
-
nodeTypes:
|
|
8488
|
+
nodeTypes: Wf,
|
|
8381
8489
|
fitView: !0,
|
|
8382
|
-
fitViewOptions:
|
|
8490
|
+
fitViewOptions: Gf,
|
|
8383
8491
|
minZoom: .2,
|
|
8384
8492
|
nodesDraggable: !1,
|
|
8385
8493
|
nodesConnectable: !1,
|
|
@@ -8394,12 +8502,39 @@ function zf(e) {
|
|
|
8394
8502
|
zoomOnScroll: !0,
|
|
8395
8503
|
zoomOnDoubleClick: !1,
|
|
8396
8504
|
children: [
|
|
8397
|
-
/* @__PURE__ */ g(
|
|
8505
|
+
/* @__PURE__ */ g(vd, {
|
|
8398
8506
|
gap: 20,
|
|
8399
8507
|
size: 1
|
|
8400
8508
|
}),
|
|
8401
|
-
/* @__PURE__ */ g(
|
|
8402
|
-
/* @__PURE__ */ g(
|
|
8509
|
+
/* @__PURE__ */ g(Dd, { showInteractive: !1 }),
|
|
8510
|
+
r.length > 1 ? /* @__PURE__ */ g(Sc, {
|
|
8511
|
+
position: "top-left",
|
|
8512
|
+
children: /* @__PURE__ */ g("nav", {
|
|
8513
|
+
className: "gn-breadcrumbs",
|
|
8514
|
+
"aria-label": "Node group path",
|
|
8515
|
+
children: r.map((e, t) => {
|
|
8516
|
+
let n = t === r.length - 1;
|
|
8517
|
+
return /* @__PURE__ */ _("span", {
|
|
8518
|
+
className: "gn-breadcrumbs__item",
|
|
8519
|
+
children: [t > 0 ? /* @__PURE__ */ g("span", {
|
|
8520
|
+
className: "gn-breadcrumbs__sep",
|
|
8521
|
+
"aria-hidden": "true",
|
|
8522
|
+
children: "›"
|
|
8523
|
+
}) : null, n ? /* @__PURE__ */ g("span", {
|
|
8524
|
+
className: "gn-breadcrumbs__current",
|
|
8525
|
+
"aria-current": "page",
|
|
8526
|
+
children: e.label
|
|
8527
|
+
}) : /* @__PURE__ */ g("button", {
|
|
8528
|
+
type: "button",
|
|
8529
|
+
className: "gn-breadcrumbs__link",
|
|
8530
|
+
onClick: () => i(t),
|
|
8531
|
+
children: e.label
|
|
8532
|
+
})]
|
|
8533
|
+
}, `${e.id}-${t}`);
|
|
8534
|
+
})
|
|
8535
|
+
})
|
|
8536
|
+
}) : null,
|
|
8537
|
+
/* @__PURE__ */ g(Sc, {
|
|
8403
8538
|
position: "bottom-right",
|
|
8404
8539
|
children: /* @__PURE__ */ g("a", {
|
|
8405
8540
|
href: "https://extensions.blender.org/add-ons/tree-clipper/",
|
|
@@ -8412,24 +8547,64 @@ function zf(e) {
|
|
|
8412
8547
|
]
|
|
8413
8548
|
});
|
|
8414
8549
|
}
|
|
8415
|
-
function
|
|
8416
|
-
let { jsonText: t, showHeader: n = !0 } = e, r =
|
|
8550
|
+
function qf(e) {
|
|
8551
|
+
let { jsonText: t, showHeader: n = !0 } = e, [r, i] = f({
|
|
8552
|
+
json: t,
|
|
8553
|
+
ids: []
|
|
8554
|
+
}), o = u(() => {
|
|
8417
8555
|
if (!t.trim()) return null;
|
|
8418
8556
|
try {
|
|
8419
|
-
let e =
|
|
8557
|
+
let { rootId: e, trees: n } = uf(JSON.parse(t)), r = {};
|
|
8558
|
+
for (let e of Object.values(n)) {
|
|
8559
|
+
let t = pf(e);
|
|
8560
|
+
r[t.id] = {
|
|
8561
|
+
graph: t,
|
|
8562
|
+
flow: _f(t)
|
|
8563
|
+
};
|
|
8564
|
+
}
|
|
8420
8565
|
return {
|
|
8421
|
-
|
|
8422
|
-
|
|
8566
|
+
rootId: e,
|
|
8567
|
+
views: r,
|
|
8423
8568
|
error: null
|
|
8424
8569
|
};
|
|
8425
8570
|
} catch (e) {
|
|
8426
8571
|
return {
|
|
8427
|
-
|
|
8428
|
-
|
|
8572
|
+
rootId: "",
|
|
8573
|
+
views: null,
|
|
8429
8574
|
error: e instanceof Error ? e.message : String(e)
|
|
8430
8575
|
};
|
|
8431
8576
|
}
|
|
8432
|
-
}, [t])
|
|
8577
|
+
}, [t]), s = u(() => {
|
|
8578
|
+
if (!o?.views) return [];
|
|
8579
|
+
let e = r.json === t ? r.ids : [], n = [o.rootId];
|
|
8580
|
+
for (let t of e) o.views[t] && n.push(t);
|
|
8581
|
+
return n;
|
|
8582
|
+
}, [
|
|
8583
|
+
o,
|
|
8584
|
+
r,
|
|
8585
|
+
t
|
|
8586
|
+
]), l = o?.views ? o.views[s[s.length - 1]] : null, d = a((e) => {
|
|
8587
|
+
i((n) => ({
|
|
8588
|
+
json: t,
|
|
8589
|
+
ids: n.json === t ? [...n.ids, e] : [e]
|
|
8590
|
+
}));
|
|
8591
|
+
}, [t]), p = u(() => ({ openGroup: d }), [d]);
|
|
8592
|
+
c(() => {
|
|
8593
|
+
if (s.length <= 1) return;
|
|
8594
|
+
function e(e) {
|
|
8595
|
+
if (e.key !== "Tab" && e.key !== "Escape" || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
8596
|
+
let n = e.target;
|
|
8597
|
+
n && (n.isContentEditable || n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.closest(".cm-editor")) || (e.preventDefault(), i({
|
|
8598
|
+
json: t,
|
|
8599
|
+
ids: s.slice(1, -1)
|
|
8600
|
+
}));
|
|
8601
|
+
}
|
|
8602
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
8603
|
+
}, [s, t]);
|
|
8604
|
+
let m = o?.views ? s.map((e) => ({
|
|
8605
|
+
id: e,
|
|
8606
|
+
label: o.views[e].graph.label
|
|
8607
|
+
})) : [];
|
|
8433
8608
|
return /* @__PURE__ */ _("div", {
|
|
8434
8609
|
className: "panel flow-panel",
|
|
8435
8610
|
children: [n ? /* @__PURE__ */ _("div", {
|
|
@@ -8440,18 +8615,26 @@ function Bf(e) {
|
|
|
8440
8615
|
}), /* @__PURE__ */ g("div", {
|
|
8441
8616
|
className: "panel-status",
|
|
8442
8617
|
"aria-live": "polite",
|
|
8443
|
-
children:
|
|
8618
|
+
children: l ? `${l.graph.nodes.length} nodes, ${l.graph.edges.length} links` : null
|
|
8444
8619
|
})]
|
|
8445
8620
|
}) : null, /* @__PURE__ */ g("div", {
|
|
8446
8621
|
className: "panel-body flow-panel__body",
|
|
8447
|
-
children:
|
|
8622
|
+
children: o?.error ? /* @__PURE__ */ _("div", {
|
|
8448
8623
|
className: "flow-error",
|
|
8449
8624
|
role: "alert",
|
|
8450
|
-
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children:
|
|
8451
|
-
}) :
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8625
|
+
children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: o.error })]
|
|
8626
|
+
}) : l ? /* @__PURE__ */ g(xf.Provider, {
|
|
8627
|
+
value: p,
|
|
8628
|
+
children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(Kf, {
|
|
8629
|
+
nodes: l.flow.nodes,
|
|
8630
|
+
edges: l.flow.edges,
|
|
8631
|
+
breadcrumbs: m,
|
|
8632
|
+
onNavigate: (e) => i({
|
|
8633
|
+
json: t,
|
|
8634
|
+
ids: s.slice(1, e + 1)
|
|
8635
|
+
})
|
|
8636
|
+
}) })
|
|
8637
|
+
}) : /* @__PURE__ */ g("div", {
|
|
8455
8638
|
className: "flow-empty",
|
|
8456
8639
|
children: "Waiting for sample graph..."
|
|
8457
8640
|
})
|
|
@@ -8460,7 +8643,7 @@ function Bf(e) {
|
|
|
8460
8643
|
}
|
|
8461
8644
|
//#endregion
|
|
8462
8645
|
//#region src/embed.tsx
|
|
8463
|
-
function
|
|
8646
|
+
function Jf(e) {
|
|
8464
8647
|
let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0);
|
|
8465
8648
|
return c(() => {
|
|
8466
8649
|
let e = !1;
|
|
@@ -8482,26 +8665,26 @@ function Vf(e) {
|
|
|
8482
8665
|
className: "flow-error",
|
|
8483
8666
|
role: "alert",
|
|
8484
8667
|
children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
|
|
8485
|
-
}) : /* @__PURE__ */ g(
|
|
8668
|
+
}) : /* @__PURE__ */ g(qf, {
|
|
8486
8669
|
jsonText: n,
|
|
8487
8670
|
showHeader: !1
|
|
8488
8671
|
})
|
|
8489
8672
|
})
|
|
8490
8673
|
});
|
|
8491
8674
|
}
|
|
8492
|
-
var
|
|
8493
|
-
function
|
|
8494
|
-
|
|
8675
|
+
var Yf = null;
|
|
8676
|
+
function Xf(e, t) {
|
|
8677
|
+
Yf &&= (Yf.unmount(), null), Yf = m(e);
|
|
8495
8678
|
let r = t.onClose;
|
|
8496
|
-
return
|
|
8679
|
+
return Yf.render(n(Jf, {
|
|
8497
8680
|
...t,
|
|
8498
8681
|
onClose: r ? () => {
|
|
8499
|
-
|
|
8682
|
+
Zf(), r();
|
|
8500
8683
|
} : void 0
|
|
8501
|
-
})),
|
|
8684
|
+
})), Zf;
|
|
8502
8685
|
}
|
|
8503
|
-
function
|
|
8504
|
-
|
|
8686
|
+
function Zf() {
|
|
8687
|
+
Yf &&= (Yf.unmount(), null);
|
|
8505
8688
|
}
|
|
8506
8689
|
//#endregion
|
|
8507
|
-
export {
|
|
8690
|
+
export { Jf as GraphView, Xf as mountGraphView, Zf as unmountGraphView };
|