likec4 1.59.2 → 1.59.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/src/chunks/AIChat.mjs +118 -123
- package/__app__/src/chunks/LikeC4Styles.mjs +828 -686
- package/__app__/src/chunks/ProjectsOverview.mjs +82 -82
- package/__app__/src/chunks/es.mjs +1 -1
- package/__app__/src/chunks/hooks.mjs +164 -135
- package/__app__/src/chunks/libs/@floating-ui.mjs +649 -335
- package/__app__/src/chunks/libs/@mantine.mjs +2934 -2040
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +28 -28
- package/__app__/src/chunks/libs/@tanstack.mjs +46 -51
- package/__app__/src/chunks/libs/@xstate/react.mjs +59 -40
- package/__app__/src/chunks/libs/@xyflow/react.mjs +535 -448
- package/__app__/src/chunks/libs/bezier-js.mjs +10 -9
- package/__app__/src/chunks/libs/d3.mjs +20 -45
- package/__app__/src/chunks/libs/fast-equals.mjs +62 -50
- package/__app__/src/chunks/libs/framer.mjs +300 -279
- package/__app__/src/chunks/libs/zod.mjs +17 -14
- package/__app__/src/chunks/rolldown-runtime.mjs +2 -2
- package/__app__/src/chunks/styled-system.mjs +2580 -132
- package/__app__/src/main.mjs +24925 -23485
- package/__app__/src/style.css +1 -1
- package/config/schema.json +49 -0
- package/dist/app/render-view-client.css +1 -0
- package/dist/app/render-view-client.js +739 -0
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +7 -6
- package/dist/chunks/index.d.mts +18 -1
- package/dist/chunks/index2.d.mts +79 -26
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +5 -5
- package/dist/chunks/libs/@chevrotain/types.d.mts +108 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/chunks/libs/birpc.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
- package/dist/chunks/libs/chevrotain.mjs +16 -16
- package/dist/chunks/libs/json5.mjs +3 -3
- package/dist/chunks/libs/langium.d.mts +1777 -16
- package/dist/chunks/libs/langium.mjs +11 -11
- package/dist/chunks/libs/merge-error-cause.mjs +2 -2
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +2 -2
- package/dist/chunks/libs/picomatch.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +1717 -17
- package/dist/chunks/libs/zod.mjs +4 -4
- package/dist/chunks/node.mjs +68 -57
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +168 -54
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +291 -165
- package/dist/config/index.d.mts +7 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +4 -4
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/internal/index.d.mts +72 -35
- package/dist/vite-plugin/internal/index.mjs +125 -44
- package/package.json +47 -47
- package/react/index.d.mts +22767 -1432
- package/react/index.mjs +38152 -32309
- package/vite-plugin-modules.d.ts +21 -1
- package/dist/chunks/dist.mjs +0 -10
- package/dist/chunks/logger.mjs +0 -1
|
@@ -13,9 +13,9 @@ function cc(e) {
|
|
|
13
13
|
return t;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../../node_modules/.pnpm/@xyflow+system@0.0.
|
|
16
|
+
//#region ../../node_modules/.pnpm/@xyflow+system@0.0.82/node_modules/@xyflow/system/dist/esm/index.js
|
|
17
17
|
var T = {
|
|
18
|
-
error001: (e = "react") => `Seems like you have not used
|
|
18
|
+
error001: (e = "react") => `Seems like you have not used ${e === "svelte" ? "SvelteFlowProvider" : "ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,
|
|
19
19
|
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.",
|
|
20
20
|
error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
|
|
21
21
|
error004: () => "The parent container needs a width and a height to render the graph.",
|
|
@@ -88,35 +88,35 @@ var I = {
|
|
|
88
88
|
[F.Right]: F.Left,
|
|
89
89
|
[F.Top]: F.Bottom,
|
|
90
90
|
[F.Bottom]: F.Top
|
|
91
|
-
}
|
|
92
|
-
function getConnectionStatus(e) {
|
|
93
|
-
return e === null ? null : e ? "valid" : "invalid";
|
|
94
|
-
}
|
|
95
|
-
var isEdgeBase = (e) => "id" in e && "source" in e && "target" in e, isNodeBase = (e) => "id" in e && "position" in e && !("source" in e) && !("target" in e), isInternalNodeBase = (e) => "id" in e && "internals" in e && !("source" in e) && !("target" in e), getNodePositionWithOrigin = (e, t = [0, 0]) => {
|
|
91
|
+
}, isEdgeBase = (e) => !!e && typeof e == "object" && "id" in e && "source" in e && "target" in e, isNodeBase = (e) => !!e && typeof e == "object" && "id" in e && "position" in e && !("source" in e) && !("target" in e), isInternalNodeBase = (e) => !!e && typeof e == "object" && "id" in e && "internals" in e && !("source" in e) && !("target" in e), getNodePositionWithOrigin = (e, t = [0, 0]) => {
|
|
96
92
|
let { width: n, height: r } = getNodeDimensions(e), i = e.origin ?? t, a = n * i[0], o = r * i[1];
|
|
97
93
|
return {
|
|
98
94
|
x: e.position.x - a,
|
|
99
95
|
y: e.position.y - o
|
|
100
96
|
};
|
|
101
|
-
}, getNodesBounds = (e, t = { nodeOrigin: [0, 0] }) =>
|
|
102
|
-
|
|
103
|
-
y: 0,
|
|
104
|
-
width: 0,
|
|
105
|
-
height: 0
|
|
106
|
-
} : boxToRect(e.reduce((e, n) => {
|
|
107
|
-
let r = typeof n == "string", i = !t.nodeLookup && !r ? n : void 0;
|
|
108
|
-
return t.nodeLookup && (i = r ? t.nodeLookup.get(n) : isInternalNodeBase(n) ? n : t.nodeLookup.get(n.id)), getBoundsOfBoxes(e, i ? nodeToBox(i, t.nodeOrigin) : {
|
|
97
|
+
}, getNodesBounds = (e, t = { nodeOrigin: [0, 0] }) => {
|
|
98
|
+
if (e.length === 0) return {
|
|
109
99
|
x: 0,
|
|
110
100
|
y: 0,
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
width: 0,
|
|
102
|
+
height: 0
|
|
103
|
+
};
|
|
104
|
+
let n = !1, r = e.reduce((e, r) => {
|
|
105
|
+
let i = typeof r == "string", a = !t.nodeLookup && !i ? r : void 0;
|
|
106
|
+
return t.nodeLookup && (a = i ? t.nodeLookup.get(r) : isInternalNodeBase(r) ? r : t.nodeLookup.get(r.id)), a ? (n = !0, getBoundsOfBoxes(e, nodeToBox(a, t.nodeOrigin))) : e;
|
|
107
|
+
}, {
|
|
108
|
+
x: Infinity,
|
|
109
|
+
y: Infinity,
|
|
110
|
+
x2: -Infinity,
|
|
111
|
+
y2: -Infinity
|
|
113
112
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
113
|
+
return n ? boxToRect(r) : {
|
|
114
|
+
x: 0,
|
|
115
|
+
y: 0,
|
|
116
|
+
width: 0,
|
|
117
|
+
height: 0
|
|
118
|
+
};
|
|
119
|
+
}, getInternalNodesBounds = (e, t = {}) => {
|
|
120
120
|
let n = {
|
|
121
121
|
x: Infinity,
|
|
122
122
|
y: Infinity,
|
|
@@ -136,22 +136,14 @@ var isEdgeBase = (e) => "id" in e && "source" in e && "target" in e, isNodeBase
|
|
|
136
136
|
0,
|
|
137
137
|
1
|
|
138
138
|
], a = !1, o = !1) => {
|
|
139
|
-
let s =
|
|
140
|
-
...pointToRendererPoint(t, [
|
|
141
|
-
n,
|
|
142
|
-
r,
|
|
143
|
-
i
|
|
144
|
-
]),
|
|
145
|
-
width: t.width / i,
|
|
146
|
-
height: t.height / i
|
|
147
|
-
}, c = [];
|
|
139
|
+
let s = (t.x - n) / i, c = (t.y - r) / i, l = t.width / i, u = t.height / i, d = [];
|
|
148
140
|
for (let t of e.values()) {
|
|
149
141
|
let { measured: e, selectable: n = !0, hidden: r = !1 } = t;
|
|
150
142
|
if (o && !n || r) continue;
|
|
151
|
-
let i = e.width ?? t.width ?? t.initialWidth ??
|
|
152
|
-
(!t.internals.handleBounds ||
|
|
143
|
+
let i = e.width ?? t.width ?? t.initialWidth ?? 0, f = e.height ?? t.height ?? t.initialHeight ?? 0, { x: p, y: m } = t.internals.positionAbsolute, h = getRectsOverlappingArea(s, c, l, u, p, m, i, f), g = i * f, _ = a && h > 0;
|
|
144
|
+
(!t.internals.handleBounds || _ || h >= g || t.dragging) && d.push(t);
|
|
153
145
|
}
|
|
154
|
-
return
|
|
146
|
+
return d;
|
|
155
147
|
}, getConnectedEdges = (e, t) => {
|
|
156
148
|
let n = /* @__PURE__ */ new Set();
|
|
157
149
|
return e.forEach((e) => {
|
|
@@ -161,7 +153,12 @@ var isEdgeBase = (e) => "id" in e && "source" in e && "target" in e, isNodeBase
|
|
|
161
153
|
function getFitViewNodes(e, t) {
|
|
162
154
|
let n = /* @__PURE__ */ new Map(), r = t?.nodes ? new Set(t.nodes.map((e) => e.id)) : null;
|
|
163
155
|
return e.forEach((e) => {
|
|
164
|
-
|
|
156
|
+
let i;
|
|
157
|
+
if (t?.includeHiddenNodes) {
|
|
158
|
+
let { width: t, height: n } = getNodeDimensions(e);
|
|
159
|
+
i = t > 0 && n > 0;
|
|
160
|
+
} else i = !!(e.measured.width && e.measured.height && !e.hidden);
|
|
161
|
+
i && (!r || r.has(e.id)) && n.set(e.id, e);
|
|
165
162
|
}), n;
|
|
166
163
|
}
|
|
167
164
|
async function fitViewport({ nodes: e, width: t, height: n, panZoom: r, minZoom: i, maxZoom: a }, o) {
|
|
@@ -178,12 +175,13 @@ function calculateNodePosition({ nodeId: e, nextPosition: t, nodeLookup: n, node
|
|
|
178
175
|
x: 0,
|
|
179
176
|
y: 0
|
|
180
177
|
}, u = o.origin ?? r, d = o.extent || i;
|
|
181
|
-
if (o.extent === "parent" && !o.expandParent)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
178
|
+
if (o.extent === "parent" && !o.expandParent) {
|
|
179
|
+
if (!s) a?.("005", T.error005());
|
|
180
|
+
else {
|
|
181
|
+
let { width: e, height: t } = getNodeDimensions(s);
|
|
182
|
+
e && t && (d = [[c, l], [c + e, l + t]]);
|
|
183
|
+
}
|
|
184
|
+
} else s && isCoordinateExtent(o.extent) && (d = [[o.extent[0][0] + c, o.extent[0][1] + l], [o.extent[1][0] + c, o.extent[1][1] + l]]);
|
|
187
185
|
let f = isCoordinateExtent(d) ? clampPosition(t, d, o.measured) : t;
|
|
188
186
|
return (o.measured.width === void 0 || o.measured.height === void 0) && a?.("015", T.error015()), {
|
|
189
187
|
position: {
|
|
@@ -260,10 +258,10 @@ var calcAutoPanVelocity = (e, t, n) => e < t ? clamp(Math.abs(e - t), 1, t) / t
|
|
|
260
258
|
x2: n + (e.measured?.width ?? e.width ?? e.initialWidth ?? 0),
|
|
261
259
|
y2: r + (e.measured?.height ?? e.height ?? e.initialHeight ?? 0)
|
|
262
260
|
};
|
|
263
|
-
}, getBoundsOfRects = (e, t) => boxToRect(getBoundsOfBoxes(rectToBox(e), rectToBox(t))),
|
|
264
|
-
let
|
|
265
|
-
return Math.ceil(
|
|
266
|
-
}, isRectObject = (e) => isNumeric(e.width) && isNumeric(e.height) && isNumeric(e.x) && isNumeric(e.y), isNumeric = (e) => !isNaN(e) && isFinite(e), createDevWarn = (e, t) => (e, t) => {}, snapPosition = (e, t = [1, 1]) => ({
|
|
261
|
+
}, getBoundsOfRects = (e, t) => boxToRect(getBoundsOfBoxes(rectToBox(e), rectToBox(t))), getRectsOverlappingArea = (e, t, n, r, i, a, o, s) => {
|
|
262
|
+
let c = Math.max(0, Math.min(e + n, i + o) - Math.max(e, i)), l = Math.max(0, Math.min(t + r, a + s) - Math.max(t, a));
|
|
263
|
+
return Math.ceil(c * l);
|
|
264
|
+
}, getOverlappingArea = (e, t) => getRectsOverlappingArea(e.x, e.y, e.width, e.height, t.x, t.y, t.width, t.height), isRectObject = (e) => isNumeric(e.width) && isNumeric(e.height) && isNumeric(e.x) && isNumeric(e.y), isNumeric = (e) => !isNaN(e) && isFinite(e), createDevWarn = (e, t) => (e, t) => {}, snapPosition = (e, t = [1, 1]) => ({
|
|
267
265
|
x: t[0] * Math.round(e.x / t[0]),
|
|
268
266
|
y: t[1] * Math.round(e.y / t[1])
|
|
269
267
|
}), pointToRendererPoint = ({ x: e, y: t }, [n, r, i], a = !1, o = [1, 1]) => {
|
|
@@ -397,6 +395,9 @@ function mergeAriaLabelConfig(e) {
|
|
|
397
395
|
...e || {}
|
|
398
396
|
};
|
|
399
397
|
}
|
|
398
|
+
function getConnectionStatus(e) {
|
|
399
|
+
return e === null ? null : e ? "valid" : "invalid";
|
|
400
|
+
}
|
|
400
401
|
function getPointerPosition(e, { snapGrid: t = [0, 0], snapToGrid: n = !1, transform: r, containerBounds: i }) {
|
|
401
402
|
let { x: a, y: o } = getEventPosition(e), s = pointToRendererPoint({
|
|
402
403
|
x: a - (i?.left ?? 0),
|
|
@@ -780,9 +781,7 @@ function getNodeToolbarTransform(e, t, n, r, i) {
|
|
|
780
781
|
case F.Bottom:
|
|
781
782
|
o[1] = (e.y + e.height) * t.zoom + t.y + r, s[1] = 0;
|
|
782
783
|
break;
|
|
783
|
-
case F.Left:
|
|
784
|
-
o = [e.x * t.zoom + t.x - r, (e.y + e.height * a) * t.zoom + t.y], s = [-100, -100 * a];
|
|
785
|
-
break;
|
|
784
|
+
case F.Left: o = [e.x * t.zoom + t.x - r, (e.y + e.height * a) * t.zoom + t.y], s = [-100, -100 * a];
|
|
786
785
|
}
|
|
787
786
|
return `translate(${o[0]}px, ${o[1]}px) translate(${s[0]}%, ${s[1]}%)`;
|
|
788
787
|
}
|
|
@@ -968,7 +967,10 @@ function updateNodeInternals(e, t, n, r, i, a, o) {
|
|
|
968
967
|
let s = getDimensions(r.nodeElement), u = e.measured.width !== s.width || e.measured.height !== s.height;
|
|
969
968
|
if (s.width && s.height && (u || !e.internals.handleBounds || r.force)) {
|
|
970
969
|
let p = r.nodeElement.getBoundingClientRect(), m = isCoordinateExtent(e.extent) ? e.extent : a, { positionAbsolute: h } = e.internals;
|
|
971
|
-
e.parentId && e.extent === "parent"
|
|
970
|
+
if (e.parentId && e.extent === "parent") {
|
|
971
|
+
let n = t.get(e.parentId);
|
|
972
|
+
n && (h = clampPositionToParent(h, s, n));
|
|
973
|
+
} else m && (h = clampPosition(h, m, s));
|
|
972
974
|
let g = {
|
|
973
975
|
...e,
|
|
974
976
|
measured: s,
|
|
@@ -1488,9 +1490,9 @@ function createPanOnScrollHandler({ zoomPanValues: e, noWheelClassName: t, d3Sel
|
|
|
1488
1490
|
let p = d.deltaMode === 1 ? 20 : 1, m = a === A.Vertical ? 0 : d.deltaX * p, h = a === A.Horizontal ? 0 : d.deltaY * p;
|
|
1489
1491
|
!isMacOs() && d.shiftKey && a !== A.Vertical && (m = d.deltaY * p, h = 0), r.translateBy(n, -(m / f) * o, -(h / f) * o, { internal: !0 });
|
|
1490
1492
|
let g = transformToViewport(n.property("__zoom"));
|
|
1491
|
-
clearTimeout(e.panScrollTimeout), e.isPanScrolling ?
|
|
1493
|
+
clearTimeout(e.panScrollTimeout), e.isPanScrolling ? l?.(d, g) : (e.isPanScrolling = !0, c?.(d, g)), e.panScrollTimeout = setTimeout(() => {
|
|
1492
1494
|
u?.(d, g), e.isPanScrolling = !1;
|
|
1493
|
-
}, 150)
|
|
1495
|
+
}, 150);
|
|
1494
1496
|
};
|
|
1495
1497
|
}
|
|
1496
1498
|
function createZoomOnScrollHandler({ noWheelClassName: e, preventScrolling: t, d3ZoomHandler: n }) {
|
|
@@ -1526,15 +1528,15 @@ function createPanZoomEndHandler({ zoomPanValues: e, panOnDrag: t, panOnScroll:
|
|
|
1526
1528
|
}
|
|
1527
1529
|
};
|
|
1528
1530
|
}
|
|
1529
|
-
function createFilter({
|
|
1530
|
-
return (
|
|
1531
|
-
let
|
|
1532
|
-
if (
|
|
1533
|
-
if (!
|
|
1534
|
-
if (!
|
|
1535
|
-
if (!
|
|
1536
|
-
let
|
|
1537
|
-
return (!
|
|
1531
|
+
function createFilter({ panActivationKeyPressed: e, zoomActivationKeyPressed: t, zoomOnScroll: n, zoomOnPinch: r, panOnDrag: i, panOnScroll: a, zoomOnDoubleClick: o, userSelectionActive: s, noWheelClassName: c, noPanClassName: l, lib: u, connectionInProgress: d }) {
|
|
1532
|
+
return (f) => {
|
|
1533
|
+
let p = t || n, m = r && f.ctrlKey, h = f.type === "wheel";
|
|
1534
|
+
if (f.button === 1 && f.type === "mousedown" && (isWrappedWithClass(f, `${u}-flow__node`) || isWrappedWithClass(f, `${u}-flow__edge`) || isWrappedWithClass(f, `${u}-flow__selection`) || isWrappedWithClass(f, `${u}-flow__nodesselection`))) return !0;
|
|
1535
|
+
if (!i && !p && !a && !o && !r || s || d && !h || isWrappedWithClass(f, c) && h || isWrappedWithClass(f, l) && (!h || a && h && !t) || !r && f.ctrlKey && h) return !1;
|
|
1536
|
+
if (!r && f.type === "touchstart" && f.touches?.length > 1) return f.preventDefault(), !1;
|
|
1537
|
+
if (!p && !a && !m && h || !i && (f.type === "mousedown" || f.type === "touchstart") || Array.isArray(i) && !i.includes(f.button) && f.type === "mousedown") return !1;
|
|
1538
|
+
let g = Array.isArray(i) && i.includes(f.button) || !f.button || f.button <= 1;
|
|
1539
|
+
return (!f.ctrlKey || h || e) && g;
|
|
1538
1540
|
};
|
|
1539
1541
|
}
|
|
1540
1542
|
function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, viewport: l, onPanZoom: u, onPanZoomStart: d, onPanZoomEnd: f, onDraggingChange: p }) {
|
|
@@ -1546,28 +1548,33 @@ function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, vie
|
|
|
1546
1548
|
timerId: void 0,
|
|
1547
1549
|
panScrollTimeout: void 0,
|
|
1548
1550
|
isPanScrolling: !1
|
|
1549
|
-
}, h = e.getBoundingClientRect(), g =
|
|
1551
|
+
}, h = e.getBoundingClientRect(), g = [[0, 0], [h.width, h.height]];
|
|
1552
|
+
(typeof ResizeObserver < "u" ? new ResizeObserver((e) => {
|
|
1553
|
+
let t = e[0];
|
|
1554
|
+
t && (g = [[0, 0], [t.contentRect.width, t.contentRect.height]]);
|
|
1555
|
+
}) : null)?.observe(e);
|
|
1556
|
+
let _ = o().extent(() => g).scaleExtent([n, r]).translateExtent(i), v = c(e).call(_);
|
|
1550
1557
|
setViewportConstrained({
|
|
1551
1558
|
x: l.x,
|
|
1552
1559
|
y: l.y,
|
|
1553
1560
|
zoom: clamp(l.zoom, n, r)
|
|
1554
1561
|
}, [[0, 0], [h.width, h.height]], i);
|
|
1555
|
-
let
|
|
1556
|
-
|
|
1562
|
+
let y = v.on("wheel.zoom"), b = v.on("dblclick.zoom");
|
|
1563
|
+
_.wheelDelta(wheelDelta);
|
|
1557
1564
|
async function setTransform(e, t) {
|
|
1558
|
-
return
|
|
1559
|
-
|
|
1565
|
+
return v ? new Promise((n) => {
|
|
1566
|
+
_?.interpolate(t?.interpolate === "linear" ? s : a).transform(getD3Transition(v, t?.duration, t?.ease, () => n(!0)), e);
|
|
1560
1567
|
}) : !1;
|
|
1561
1568
|
}
|
|
1562
|
-
function update({ noWheelClassName: e, noPanClassName: t, onPaneContextMenu: n, userSelectionActive: r, panOnScroll: i, panOnDrag: a, panOnScrollMode: o, panOnScrollSpeed: s, preventScrolling: c, zoomOnPinch: l, zoomOnScroll: h, zoomOnDoubleClick:
|
|
1569
|
+
function update({ noWheelClassName: e, noPanClassName: t, onPaneContextMenu: n, userSelectionActive: r, panOnScroll: i, panOnDrag: a, panOnScrollMode: o, panOnScrollSpeed: s, preventScrolling: c, zoomOnPinch: l, zoomOnScroll: h, zoomOnDoubleClick: g, panActivationKeyPressed: x = !1, zoomActivationKeyPressed: S, lib: C, onTransformChange: w, connectionInProgress: T, paneClickDistance: E, selectionOnDrag: D }) {
|
|
1563
1570
|
r && !m.isZoomingOrPanning && destroy();
|
|
1564
|
-
let
|
|
1565
|
-
|
|
1566
|
-
let
|
|
1571
|
+
let O = i && !S && !r;
|
|
1572
|
+
_.clickDistance(D ? Infinity : !isNumeric(E) || E < 0 ? 0 : E);
|
|
1573
|
+
let k = O ? createPanOnScrollHandler({
|
|
1567
1574
|
zoomPanValues: m,
|
|
1568
1575
|
noWheelClassName: e,
|
|
1569
|
-
d3Selection:
|
|
1570
|
-
d3Zoom:
|
|
1576
|
+
d3Selection: v,
|
|
1577
|
+
d3Zoom: _,
|
|
1571
1578
|
panOnScrollMode: o,
|
|
1572
1579
|
panOnScrollSpeed: s,
|
|
1573
1580
|
zoomOnPinch: l,
|
|
@@ -1577,24 +1584,24 @@ function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, vie
|
|
|
1577
1584
|
}) : createZoomOnScrollHandler({
|
|
1578
1585
|
noWheelClassName: e,
|
|
1579
1586
|
preventScrolling: c,
|
|
1580
|
-
d3ZoomHandler:
|
|
1587
|
+
d3ZoomHandler: y
|
|
1581
1588
|
});
|
|
1582
|
-
|
|
1583
|
-
let
|
|
1589
|
+
v.on("wheel.zoom", k, { passive: !1 });
|
|
1590
|
+
let A = createPanZoomStartHandler({
|
|
1584
1591
|
zoomPanValues: m,
|
|
1585
1592
|
onDraggingChange: p,
|
|
1586
1593
|
onPanZoomStart: d
|
|
1587
1594
|
});
|
|
1588
|
-
|
|
1589
|
-
let
|
|
1595
|
+
_.on("start", A);
|
|
1596
|
+
let j = createPanZoomHandler({
|
|
1590
1597
|
zoomPanValues: m,
|
|
1591
1598
|
panOnDrag: a,
|
|
1592
1599
|
onPaneContextMenu: !!n,
|
|
1593
1600
|
onPanZoom: u,
|
|
1594
|
-
onTransformChange:
|
|
1601
|
+
onTransformChange: w
|
|
1595
1602
|
});
|
|
1596
|
-
|
|
1597
|
-
let
|
|
1603
|
+
_.on("zoom", j);
|
|
1604
|
+
let M = createPanZoomEndHandler({
|
|
1598
1605
|
zoomPanValues: m,
|
|
1599
1606
|
panOnDrag: a,
|
|
1600
1607
|
panOnScroll: i,
|
|
@@ -1602,27 +1609,28 @@ function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, vie
|
|
|
1602
1609
|
onPanZoomEnd: f,
|
|
1603
1610
|
onDraggingChange: p
|
|
1604
1611
|
});
|
|
1605
|
-
|
|
1606
|
-
let
|
|
1607
|
-
|
|
1612
|
+
_.on("end", M);
|
|
1613
|
+
let N = createFilter({
|
|
1614
|
+
panActivationKeyPressed: x,
|
|
1615
|
+
zoomActivationKeyPressed: S,
|
|
1608
1616
|
panOnDrag: a,
|
|
1609
1617
|
zoomOnScroll: h,
|
|
1610
1618
|
panOnScroll: i,
|
|
1611
|
-
zoomOnDoubleClick:
|
|
1619
|
+
zoomOnDoubleClick: g,
|
|
1612
1620
|
zoomOnPinch: l,
|
|
1613
1621
|
userSelectionActive: r,
|
|
1614
1622
|
noPanClassName: t,
|
|
1615
1623
|
noWheelClassName: e,
|
|
1616
|
-
lib:
|
|
1617
|
-
connectionInProgress:
|
|
1624
|
+
lib: C,
|
|
1625
|
+
connectionInProgress: T
|
|
1618
1626
|
});
|
|
1619
|
-
|
|
1627
|
+
_.filter(N), g ? v.on("dblclick.zoom", b) : v.on("dblclick.zoom", null);
|
|
1620
1628
|
}
|
|
1621
1629
|
function destroy() {
|
|
1622
|
-
|
|
1630
|
+
_.on("zoom", null);
|
|
1623
1631
|
}
|
|
1624
1632
|
async function setViewportConstrained(e, t, n) {
|
|
1625
|
-
let r = viewportToTransform(e), i =
|
|
1633
|
+
let r = viewportToTransform(e), i = _?.constrain()(r, t, n);
|
|
1626
1634
|
return i && await setTransform(i), i;
|
|
1627
1635
|
}
|
|
1628
1636
|
async function setViewport(e, t) {
|
|
@@ -1630,13 +1638,13 @@ function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, vie
|
|
|
1630
1638
|
return await setTransform(n, t), n;
|
|
1631
1639
|
}
|
|
1632
1640
|
function syncViewport(e) {
|
|
1633
|
-
if (
|
|
1634
|
-
let t = viewportToTransform(e), n =
|
|
1635
|
-
(n.k !== e.zoom || n.x !== e.x || n.y !== e.y) &&
|
|
1641
|
+
if (v) {
|
|
1642
|
+
let t = viewportToTransform(e), n = v.property("__zoom");
|
|
1643
|
+
(n.k !== e.zoom || n.x !== e.x || n.y !== e.y) && _?.transform(v, t, null, { sync: !0 });
|
|
1636
1644
|
}
|
|
1637
1645
|
}
|
|
1638
1646
|
function getViewport() {
|
|
1639
|
-
let e =
|
|
1647
|
+
let e = v ? t(v.node()) : {
|
|
1640
1648
|
x: 0,
|
|
1641
1649
|
y: 0,
|
|
1642
1650
|
k: 1
|
|
@@ -1648,24 +1656,24 @@ function XYPanZoom({ domNode: e, minZoom: n, maxZoom: r, translateExtent: i, vie
|
|
|
1648
1656
|
};
|
|
1649
1657
|
}
|
|
1650
1658
|
async function scaleTo(e, t) {
|
|
1651
|
-
return
|
|
1652
|
-
|
|
1659
|
+
return v ? new Promise((n) => {
|
|
1660
|
+
_?.interpolate(t?.interpolate === "linear" ? s : a).scaleTo(getD3Transition(v, t?.duration, t?.ease, () => n(!0)), e);
|
|
1653
1661
|
}) : !1;
|
|
1654
1662
|
}
|
|
1655
1663
|
async function scaleBy(e, t) {
|
|
1656
|
-
return
|
|
1657
|
-
|
|
1664
|
+
return v ? new Promise((n) => {
|
|
1665
|
+
_?.interpolate(t?.interpolate === "linear" ? s : a).scaleBy(getD3Transition(v, t?.duration, t?.ease, () => n(!0)), e);
|
|
1658
1666
|
}) : !1;
|
|
1659
1667
|
}
|
|
1660
1668
|
function setScaleExtent(e) {
|
|
1661
|
-
|
|
1669
|
+
_?.scaleExtent(e);
|
|
1662
1670
|
}
|
|
1663
1671
|
function setTranslateExtent(e) {
|
|
1664
|
-
|
|
1672
|
+
_?.translateExtent(e);
|
|
1665
1673
|
}
|
|
1666
1674
|
function setClickDistance(e) {
|
|
1667
1675
|
let t = !isNumeric(e) || e < 0 ? 0 : e;
|
|
1668
|
-
|
|
1676
|
+
_?.clickDistance(t);
|
|
1669
1677
|
}
|
|
1670
1678
|
return {
|
|
1671
1679
|
update,
|
|
@@ -1866,7 +1874,7 @@ function XYResizer({ domNode: e, nodeId: t, getStoreItems: r, onChange: i, onEnd
|
|
|
1866
1874
|
};
|
|
1867
1875
|
}
|
|
1868
1876
|
//#endregion
|
|
1869
|
-
//#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.
|
|
1877
|
+
//#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.18_immer@11.1.18_react@19.2.8/node_modules/zustand/esm/vanilla.mjs
|
|
1870
1878
|
var createStoreImpl = (e) => {
|
|
1871
1879
|
let t, n = /* @__PURE__ */ new Set(), setState = (e, r) => {
|
|
1872
1880
|
let i = typeof e == "function" ? e(t) : e;
|
|
@@ -1894,7 +1902,7 @@ var createWithEqualityFnImpl = (e, t) => {
|
|
|
1894
1902
|
return Object.assign(useBoundStoreWithEqualityFn, n), useBoundStoreWithEqualityFn;
|
|
1895
1903
|
}, createWithEqualityFn = (e, t) => e ? createWithEqualityFnImpl(e, t) : createWithEqualityFnImpl;
|
|
1896
1904
|
//#endregion
|
|
1897
|
-
//#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.
|
|
1905
|
+
//#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.18_immer@11.1.18_react@19.2.8/node_modules/zustand/esm/shallow.mjs
|
|
1898
1906
|
function shallow$1(e, t) {
|
|
1899
1907
|
if (Object.is(e, t)) return !0;
|
|
1900
1908
|
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
|
|
@@ -1914,7 +1922,7 @@ function shallow$1(e, t) {
|
|
|
1914
1922
|
return !0;
|
|
1915
1923
|
}
|
|
1916
1924
|
//#endregion
|
|
1917
|
-
//#region ../../node_modules/.pnpm/@xyflow+react@12.11.
|
|
1925
|
+
//#region ../../node_modules/.pnpm/@xyflow+react@12.11.6_@types+react-dom@19.2.5_@types+react@19.2.18__@types+react@19.2.1_9d4149e5c73352343a0f166391aa9cf0/node_modules/@xyflow/react/dist/esm/index.js
|
|
1918
1926
|
var X = u(null), ne = X.Provider, re = T.error001("react");
|
|
1919
1927
|
function useStore(e, t) {
|
|
1920
1928
|
let n = m(X);
|
|
@@ -1967,25 +1975,29 @@ function A11yDescriptions({ rfId: e, disableKeyboardA11y: t }) {
|
|
|
1967
1975
|
!t && x(AriaLiveMessage, { rfId: e })
|
|
1968
1976
|
] });
|
|
1969
1977
|
}
|
|
1970
|
-
var Z = d(({ position: e = "top-left", children: t, className: n, style: r, ...i }, a) =>
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1978
|
+
var Z = d(({ position: e = "top-left", children: t, className: n, style: r, ...i }, a) => {
|
|
1979
|
+
let o = `${e}`.split("-");
|
|
1980
|
+
return x("div", {
|
|
1981
|
+
className: cc([
|
|
1982
|
+
"react-flow__panel",
|
|
1983
|
+
n,
|
|
1984
|
+
...o
|
|
1985
|
+
]),
|
|
1986
|
+
style: r,
|
|
1987
|
+
ref: a,
|
|
1988
|
+
...i,
|
|
1989
|
+
children: t
|
|
1990
|
+
});
|
|
1991
|
+
});
|
|
1981
1992
|
Z.displayName = "Panel";
|
|
1993
|
+
var le = "https://reactflow.dev?utm_source=attribution";
|
|
1982
1994
|
function Attribution({ proOptions: e, position: t = "bottom-right" }) {
|
|
1983
|
-
return e?.hideAttribution ? null : x(Z, {
|
|
1995
|
+
return h(() => {}, []), e?.hideAttribution ? null : x(Z, {
|
|
1984
1996
|
position: t,
|
|
1985
1997
|
className: "react-flow__attribution",
|
|
1986
|
-
"data-message":
|
|
1998
|
+
"data-message": `Please only hide this attribution when you are subscribed to React Flow Pro: ${le}`,
|
|
1987
1999
|
children: x("a", {
|
|
1988
|
-
href:
|
|
2000
|
+
href: le,
|
|
1989
2001
|
target: "_blank",
|
|
1990
2002
|
rel: "noopener noreferrer",
|
|
1991
2003
|
"aria-label": "React Flow attribution",
|
|
@@ -1993,7 +2005,7 @@ function Attribution({ proOptions: e, position: t = "bottom-right" }) {
|
|
|
1993
2005
|
})
|
|
1994
2006
|
});
|
|
1995
2007
|
}
|
|
1996
|
-
var selector$
|
|
2008
|
+
var selector$l = (e) => {
|
|
1997
2009
|
let t = [], n = [];
|
|
1998
2010
|
for (let [, n] of e.nodeLookup) n.selected && t.push(n.internals.userNode);
|
|
1999
2011
|
for (let [, t] of e.edgeLookup) t.selected && n.push(t);
|
|
@@ -2002,11 +2014,11 @@ var selector$m = (e) => {
|
|
|
2002
2014
|
selectedEdges: n
|
|
2003
2015
|
};
|
|
2004
2016
|
}, selectId = (e) => e.id;
|
|
2005
|
-
function areEqual(e, t) {
|
|
2017
|
+
function areEqual$1(e, t) {
|
|
2006
2018
|
return shallow$1(e.selectedNodes.map(selectId), t.selectedNodes.map(selectId)) && shallow$1(e.selectedEdges.map(selectId), t.selectedEdges.map(selectId));
|
|
2007
2019
|
}
|
|
2008
2020
|
function SelectionListenerInner({ onSelectionChange: e }) {
|
|
2009
|
-
let t = useStoreApi(), { selectedNodes: n, selectedEdges: r } = useStore(selector$
|
|
2021
|
+
let t = useStoreApi(), { selectedNodes: n, selectedEdges: r } = useStore(selector$l, areEqual$1);
|
|
2010
2022
|
return h(() => {
|
|
2011
2023
|
let i = {
|
|
2012
2024
|
nodes: n,
|
|
@@ -2024,11 +2036,11 @@ function SelectionListener({ onSelectionChange: e }) {
|
|
|
2024
2036
|
let t = useStore(changeSelector);
|
|
2025
2037
|
return e || t ? x(SelectionListenerInner, { onSelectionChange: e }) : null;
|
|
2026
2038
|
}
|
|
2027
|
-
var
|
|
2039
|
+
var ue = [0, 0], de = {
|
|
2028
2040
|
x: 0,
|
|
2029
2041
|
y: 0,
|
|
2030
2042
|
zoom: 1
|
|
2031
|
-
},
|
|
2043
|
+
}, fe = [.../* @__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"], selector$k = (e) => ({
|
|
2032
2044
|
setNodes: e.setNodes,
|
|
2033
2045
|
setEdges: e.setEdges,
|
|
2034
2046
|
setMinZoom: e.setMinZoom,
|
|
@@ -2037,9 +2049,9 @@ var le = [0, 0], ue = {
|
|
|
2037
2049
|
setNodeExtent: e.setNodeExtent,
|
|
2038
2050
|
reset: e.reset,
|
|
2039
2051
|
setDefaultNodesAndEdges: e.setDefaultNodesAndEdges
|
|
2040
|
-
}),
|
|
2052
|
+
}), pe = {
|
|
2041
2053
|
translateExtent: E,
|
|
2042
|
-
nodeOrigin:
|
|
2054
|
+
nodeOrigin: ue,
|
|
2043
2055
|
minZoom: .5,
|
|
2044
2056
|
maxZoom: 2,
|
|
2045
2057
|
elementsSelectable: !0,
|
|
@@ -2047,18 +2059,18 @@ var le = [0, 0], ue = {
|
|
|
2047
2059
|
rfId: "1"
|
|
2048
2060
|
};
|
|
2049
2061
|
function StoreUpdater(e) {
|
|
2050
|
-
let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: c } = useStore(selector$
|
|
2062
|
+
let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: c } = useStore(selector$k, shallow$1), l = useStoreApi();
|
|
2051
2063
|
h(() => (c(e.defaultNodes, e.defaultEdges), () => {
|
|
2052
|
-
u.current =
|
|
2064
|
+
u.current = pe, s();
|
|
2053
2065
|
}), []);
|
|
2054
|
-
let u = v(
|
|
2066
|
+
let u = v(pe);
|
|
2055
2067
|
return h(() => {
|
|
2056
|
-
for (let s of
|
|
2068
|
+
for (let s of fe) {
|
|
2057
2069
|
let c = e[s];
|
|
2058
2070
|
c !== u.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" ? l.setState({ ariaLabelConfig: mergeAriaLabelConfig(c) }) : s === "fitView" ? l.setState({ fitViewQueued: c }) : s === "fitViewOptions" ? l.setState({ fitViewOptions: c }) : l.setState({ [s]: c }));
|
|
2059
2071
|
}
|
|
2060
2072
|
u.current = e;
|
|
2061
|
-
},
|
|
2073
|
+
}, fe.map((t) => e[t])), null;
|
|
2062
2074
|
}
|
|
2063
2075
|
function getMediaQuery() {
|
|
2064
2076
|
return typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -2076,20 +2088,20 @@ function useColorModeClass(e) {
|
|
|
2076
2088
|
};
|
|
2077
2089
|
}, [e]), t === null ? getMediaQuery()?.matches ? "dark" : "light" : t;
|
|
2078
2090
|
}
|
|
2079
|
-
var
|
|
2091
|
+
var me = typeof document < "u" ? document : null;
|
|
2080
2092
|
function useKeyPress(e = null, t = {
|
|
2081
|
-
target:
|
|
2093
|
+
target: me,
|
|
2082
2094
|
actInsideInputWithModifier: !0
|
|
2083
2095
|
}) {
|
|
2084
2096
|
let [n, r] = y(!1), i = v(!1), a = v(/* @__PURE__ */ new Set([])), [o, s] = _(() => {
|
|
2085
2097
|
if (e !== null) {
|
|
2086
|
-
let t = (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string").map((e) => e.replace(
|
|
2098
|
+
let t = (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string").map((e) => e.replace(/\+/g, "\n").replace("\n\n", "\n+").split("\n"));
|
|
2087
2099
|
return [t, t.reduce((e, t) => e.concat(...t), [])];
|
|
2088
2100
|
}
|
|
2089
2101
|
return [[], []];
|
|
2090
2102
|
}, [e]);
|
|
2091
2103
|
return h(() => {
|
|
2092
|
-
let n = t?.target ??
|
|
2104
|
+
let n = t?.target ?? me, c = t?.actInsideInputWithModifier ?? !0;
|
|
2093
2105
|
if (e !== null) {
|
|
2094
2106
|
let downHandler = (e) => {
|
|
2095
2107
|
if (i.current = e.ctrlKey || e.metaKey || e.shiftKey || e.altKey, (!i.current || i.current && !c) && isInputDOMNode(e)) return !1;
|
|
@@ -2214,9 +2226,7 @@ function applyChange(e, t) {
|
|
|
2214
2226
|
case "position":
|
|
2215
2227
|
e.position !== void 0 && (t.position = e.position), e.dragging !== void 0 && (t.dragging = e.dragging);
|
|
2216
2228
|
break;
|
|
2217
|
-
case "dimensions":
|
|
2218
|
-
e.dimensions !== void 0 && (t.measured = { ...e.dimensions }, e.setAttributes && ((e.setAttributes === !0 || e.setAttributes === "width") && (t.width = e.dimensions.width), (e.setAttributes === !0 || e.setAttributes === "height") && (t.height = e.dimensions.height))), typeof e.resizing == "boolean" && (t.resizing = e.resizing);
|
|
2219
|
-
break;
|
|
2229
|
+
case "dimensions": e.dimensions !== void 0 && (t.measured = { ...e.dimensions }, e.setAttributes && ((e.setAttributes === !0 || e.setAttributes === "width") && (t.width = e.dimensions.width), (e.setAttributes === !0 || e.setAttributes === "height") && (t.height = e.dimensions.height))), typeof e.resizing == "boolean" && (t.resizing = e.resizing);
|
|
2220
2230
|
}
|
|
2221
2231
|
}
|
|
2222
2232
|
function applyNodeChanges(e, t) {
|
|
@@ -2236,7 +2246,7 @@ function getSelectionChanges(e, t = /* @__PURE__ */ new Set(), n = !1) {
|
|
|
2236
2246
|
let r = [];
|
|
2237
2247
|
for (let [i, a] of e) {
|
|
2238
2248
|
let e = t.has(i);
|
|
2239
|
-
|
|
2249
|
+
(a.selected !== void 0 || e) && a.selected !== e && (n && (a.selected = e), r.push(createSelectionChange(a.id, e)));
|
|
2240
2250
|
}
|
|
2241
2251
|
return r;
|
|
2242
2252
|
}
|
|
@@ -2266,21 +2276,21 @@ function elementToRemoveChange(e) {
|
|
|
2266
2276
|
type: "remove"
|
|
2267
2277
|
};
|
|
2268
2278
|
}
|
|
2269
|
-
var
|
|
2279
|
+
var he = createDevWarn("React Flow", "https://reactflow.dev/");
|
|
2270
2280
|
function addEdge(e, t, n = {}) {
|
|
2271
2281
|
return R(e, t, {
|
|
2272
2282
|
...n,
|
|
2273
|
-
onError: n.onError ??
|
|
2283
|
+
onError: n.onError ?? he
|
|
2274
2284
|
});
|
|
2275
2285
|
}
|
|
2276
2286
|
var isNode = (e) => isNodeBase(e), isEdge = (e) => isEdgeBase(e);
|
|
2277
2287
|
function fixedForwardRef(e) {
|
|
2278
2288
|
return d(e);
|
|
2279
2289
|
}
|
|
2280
|
-
var
|
|
2290
|
+
var ge = typeof window < "u" ? g : h;
|
|
2281
2291
|
function useQueue(e) {
|
|
2282
2292
|
let [t, n] = y(BigInt(0)), [r] = y(() => createQueue(() => n((e) => e + BigInt(1))));
|
|
2283
|
-
return
|
|
2293
|
+
return ge(() => {
|
|
2284
2294
|
let t = r.get();
|
|
2285
2295
|
t.length && (e(t), r.reset());
|
|
2286
2296
|
}, [t]), r;
|
|
@@ -2297,7 +2307,7 @@ function createQueue(e) {
|
|
|
2297
2307
|
}
|
|
2298
2308
|
};
|
|
2299
2309
|
}
|
|
2300
|
-
var
|
|
2310
|
+
var _e = u(null);
|
|
2301
2311
|
function BatchProvider({ children: e }) {
|
|
2302
2312
|
let t = useStoreApi(), n = useQueue(p((e) => {
|
|
2303
2313
|
let { nodes: n = [], setNodes: r, hasDefaultNodes: i, onNodesChange: a, nodeLookup: o, fitViewQueued: s, onNodesChangeMiddlewareMap: c } = t.getState(), l = n;
|
|
@@ -2322,19 +2332,19 @@ function BatchProvider({ children: e }) {
|
|
|
2322
2332
|
nodeQueue: n,
|
|
2323
2333
|
edgeQueue: r
|
|
2324
2334
|
}), []);
|
|
2325
|
-
return x(
|
|
2335
|
+
return x(_e.Provider, {
|
|
2326
2336
|
value: i,
|
|
2327
2337
|
children: e
|
|
2328
2338
|
});
|
|
2329
2339
|
}
|
|
2330
2340
|
function useBatchContext() {
|
|
2331
|
-
let e = m(
|
|
2341
|
+
let e = m(_e);
|
|
2332
2342
|
if (!e) throw Error("useBatchContext must be used within a BatchProvider");
|
|
2333
2343
|
return e;
|
|
2334
2344
|
}
|
|
2335
|
-
var selector$
|
|
2345
|
+
var selector$j = (e) => !!e.panZoom;
|
|
2336
2346
|
function useReactFlow() {
|
|
2337
|
-
let e = useViewportHelper(), t = useStoreApi(), n = useBatchContext(), r = useStore(selector$
|
|
2347
|
+
let e = useViewportHelper(), t = useStoreApi(), n = useBatchContext(), r = useStore(selector$j), i = _(() => {
|
|
2338
2348
|
let getInternalNode = (e) => t.getState().nodeLookup.get(e), setNodes = (e) => {
|
|
2339
2349
|
n.nodeQueue.push(e);
|
|
2340
2350
|
}, setEdges = (e) => {
|
|
@@ -2497,9 +2507,9 @@ function useReactFlow() {
|
|
|
2497
2507
|
viewportInitialized: r
|
|
2498
2508
|
}), [r]);
|
|
2499
2509
|
}
|
|
2500
|
-
var selected = (e) => e.selected,
|
|
2510
|
+
var selected = (e) => e.selected, ve = typeof window < "u" ? window : void 0;
|
|
2501
2511
|
function useGlobalKeyHandler({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
|
|
2502
|
-
let n = useStoreApi(), { deleteElements: r } = useReactFlow(), i = useKeyPress(e, { actInsideInputWithModifier: !1 }), a = useKeyPress(t, { target:
|
|
2512
|
+
let n = useStoreApi(), { deleteElements: r } = useReactFlow(), i = useKeyPress(e, { actInsideInputWithModifier: !1 }), a = useKeyPress(t, { target: ve });
|
|
2503
2513
|
h(() => {
|
|
2504
2514
|
if (i) {
|
|
2505
2515
|
let { edges: e, nodes: t } = n.getState();
|
|
@@ -2532,82 +2542,83 @@ function useResizeHandler(e) {
|
|
|
2532
2542
|
}
|
|
2533
2543
|
}, []);
|
|
2534
2544
|
}
|
|
2535
|
-
var
|
|
2545
|
+
var Q = {
|
|
2536
2546
|
position: "absolute",
|
|
2537
2547
|
width: "100%",
|
|
2538
2548
|
height: "100%",
|
|
2539
2549
|
top: 0,
|
|
2540
2550
|
left: 0
|
|
2541
|
-
}, selector$
|
|
2551
|
+
}, selector$i = (e) => ({
|
|
2542
2552
|
userSelectionActive: e.userSelectionActive,
|
|
2543
2553
|
lib: e.lib,
|
|
2544
2554
|
connectionInProgress: e.connection.inProgress
|
|
2545
2555
|
});
|
|
2546
|
-
function ZoomPane({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1,
|
|
2547
|
-
let
|
|
2548
|
-
useResizeHandler(
|
|
2549
|
-
let
|
|
2550
|
-
|
|
2556
|
+
function ZoomPane({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panActivationKeyPressed: i, panOnScrollSpeed: a = .5, panOnScrollMode: o = A.Free, zoomOnDoubleClick: s = !0, panOnDrag: c = !0, defaultViewport: l, translateExtent: u, minZoom: d, maxZoom: f, zoomActivationKeyCode: m, preventScrolling: g = !0, children: _, noWheelClassName: y, noPanClassName: b, onViewportChange: S, isControlledViewport: C, paneClickDistance: w, selectionOnDrag: T }) {
|
|
2557
|
+
let E = useStoreApi(), D = v(null), { userSelectionActive: O, lib: k, connectionInProgress: j } = useStore(selector$i, shallow$1), M = useKeyPress(m), N = v();
|
|
2558
|
+
useResizeHandler(D);
|
|
2559
|
+
let P = p((e) => {
|
|
2560
|
+
S?.({
|
|
2551
2561
|
x: e[0],
|
|
2552
2562
|
y: e[1],
|
|
2553
2563
|
zoom: e[2]
|
|
2554
|
-
}),
|
|
2555
|
-
}, [
|
|
2564
|
+
}), C || E.setState({ transform: e });
|
|
2565
|
+
}, [S, C]);
|
|
2556
2566
|
return h(() => {
|
|
2557
|
-
if (
|
|
2558
|
-
|
|
2559
|
-
domNode:
|
|
2560
|
-
minZoom:
|
|
2561
|
-
maxZoom:
|
|
2562
|
-
translateExtent:
|
|
2563
|
-
viewport:
|
|
2564
|
-
onDraggingChange: (e) =>
|
|
2567
|
+
if (D.current) {
|
|
2568
|
+
N.current = XYPanZoom({
|
|
2569
|
+
domNode: D.current,
|
|
2570
|
+
minZoom: d,
|
|
2571
|
+
maxZoom: f,
|
|
2572
|
+
translateExtent: u,
|
|
2573
|
+
viewport: l,
|
|
2574
|
+
onDraggingChange: (e) => E.setState((t) => t.paneDragging === e ? t : { paneDragging: e }),
|
|
2565
2575
|
onPanZoomStart: (e, t) => {
|
|
2566
|
-
let { onViewportChangeStart: n, onMoveStart: r } =
|
|
2576
|
+
let { onViewportChangeStart: n, onMoveStart: r } = E.getState();
|
|
2567
2577
|
r?.(e, t), n?.(t);
|
|
2568
2578
|
},
|
|
2569
2579
|
onPanZoom: (e, t) => {
|
|
2570
|
-
let { onViewportChange: n, onMove: r } =
|
|
2580
|
+
let { onViewportChange: n, onMove: r } = E.getState();
|
|
2571
2581
|
r?.(e, t), n?.(t);
|
|
2572
2582
|
},
|
|
2573
2583
|
onPanZoomEnd: (e, t) => {
|
|
2574
|
-
let { onViewportChangeEnd: n, onMoveEnd: r } =
|
|
2584
|
+
let { onViewportChangeEnd: n, onMoveEnd: r } = E.getState();
|
|
2575
2585
|
r?.(e, t), n?.(t);
|
|
2576
2586
|
}
|
|
2577
2587
|
});
|
|
2578
|
-
let { x: e, y: t, zoom: n } =
|
|
2579
|
-
return
|
|
2580
|
-
panZoom:
|
|
2588
|
+
let { x: e, y: t, zoom: n } = N.current.getViewport();
|
|
2589
|
+
return E.setState({
|
|
2590
|
+
panZoom: N.current,
|
|
2581
2591
|
transform: [
|
|
2582
2592
|
e,
|
|
2583
2593
|
t,
|
|
2584
2594
|
n
|
|
2585
2595
|
],
|
|
2586
|
-
domNode:
|
|
2596
|
+
domNode: D.current.closest(".react-flow")
|
|
2587
2597
|
}), () => {
|
|
2588
|
-
|
|
2598
|
+
N.current?.destroy();
|
|
2589
2599
|
};
|
|
2590
2600
|
}
|
|
2591
2601
|
}, []), h(() => {
|
|
2592
|
-
|
|
2602
|
+
N.current?.update({
|
|
2593
2603
|
onPaneContextMenu: e,
|
|
2594
2604
|
zoomOnScroll: t,
|
|
2595
2605
|
zoomOnPinch: n,
|
|
2596
2606
|
panOnScroll: r,
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2607
|
+
panActivationKeyPressed: i,
|
|
2608
|
+
panOnScrollSpeed: a,
|
|
2609
|
+
panOnScrollMode: o,
|
|
2610
|
+
zoomOnDoubleClick: s,
|
|
2611
|
+
panOnDrag: c,
|
|
2612
|
+
zoomActivationKeyPressed: M,
|
|
2613
|
+
preventScrolling: g,
|
|
2614
|
+
noPanClassName: b,
|
|
2615
|
+
userSelectionActive: O,
|
|
2616
|
+
noWheelClassName: y,
|
|
2617
|
+
lib: k,
|
|
2618
|
+
onTransformChange: P,
|
|
2619
|
+
connectionInProgress: j,
|
|
2620
|
+
selectionOnDrag: T,
|
|
2621
|
+
paneClickDistance: w
|
|
2611
2622
|
});
|
|
2612
2623
|
}, [
|
|
2613
2624
|
e,
|
|
@@ -2618,29 +2629,30 @@ function ZoomPane({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n =
|
|
|
2618
2629
|
a,
|
|
2619
2630
|
o,
|
|
2620
2631
|
s,
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
_,
|
|
2632
|
+
c,
|
|
2633
|
+
M,
|
|
2634
|
+
g,
|
|
2635
|
+
b,
|
|
2626
2636
|
O,
|
|
2627
|
-
|
|
2637
|
+
y,
|
|
2628
2638
|
k,
|
|
2629
|
-
|
|
2630
|
-
|
|
2639
|
+
P,
|
|
2640
|
+
j,
|
|
2641
|
+
T,
|
|
2642
|
+
w
|
|
2631
2643
|
]), x("div", {
|
|
2632
2644
|
className: "react-flow__renderer",
|
|
2633
|
-
ref:
|
|
2634
|
-
style:
|
|
2635
|
-
children:
|
|
2645
|
+
ref: D,
|
|
2646
|
+
style: Q,
|
|
2647
|
+
children: _
|
|
2636
2648
|
});
|
|
2637
2649
|
}
|
|
2638
|
-
var selector$
|
|
2650
|
+
var selector$h = (e) => ({
|
|
2639
2651
|
userSelectionActive: e.userSelectionActive,
|
|
2640
2652
|
userSelectionRect: e.userSelectionRect
|
|
2641
2653
|
});
|
|
2642
2654
|
function UserSelection() {
|
|
2643
|
-
let { userSelectionActive: e, userSelectionRect: t } = useStore(selector$
|
|
2655
|
+
let { userSelectionActive: e, userSelectionRect: t } = useStore(selector$h, shallow$1);
|
|
2644
2656
|
return e && t ? x("div", {
|
|
2645
2657
|
className: "react-flow__selection react-flow__container",
|
|
2646
2658
|
style: {
|
|
@@ -2652,21 +2664,20 @@ function UserSelection() {
|
|
|
2652
2664
|
}
|
|
2653
2665
|
var wrapHandler = (e, t) => (n) => {
|
|
2654
2666
|
n.target === t.current && e?.(n);
|
|
2655
|
-
}, selector$
|
|
2667
|
+
}, selector$g = (e) => ({
|
|
2656
2668
|
userSelectionActive: e.userSelectionActive,
|
|
2657
2669
|
elementsSelectable: e.elementsSelectable,
|
|
2658
|
-
connectionInProgress: e.connection.inProgress,
|
|
2659
2670
|
dragging: e.paneDragging,
|
|
2660
2671
|
panBy: e.panBy,
|
|
2661
2672
|
autoPanSpeed: e.autoPanSpeed
|
|
2662
2673
|
});
|
|
2663
2674
|
function Pane({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = j.Full, panOnDrag: r, autoPanOnSelection: i, paneClickDistance: a, selectionOnDrag: o, onSelectionStart: s, onSelectionEnd: c, onPaneClick: l, onPaneContextMenu: u, onPaneScroll: d, onPaneMouseEnter: f, onPaneMouseMove: p, onPaneMouseLeave: m, children: g }) {
|
|
2664
|
-
let _ = v(0), y = useStoreApi(), { userSelectionActive: b, elementsSelectable: C, dragging: w,
|
|
2675
|
+
let _ = v(0), y = useStoreApi(), { userSelectionActive: b, elementsSelectable: C, dragging: w, panBy: T, autoPanSpeed: E } = useStore(selector$g, shallow$1), D = C && (e || b), O = v(null), k = v(), A = v(/* @__PURE__ */ new Set()), M = v(/* @__PURE__ */ new Set()), N = v(!1), P = v(!1), F = v({
|
|
2665
2676
|
x: 0,
|
|
2666
2677
|
y: 0
|
|
2667
2678
|
}), I = v(!1), onClick = (e) => {
|
|
2668
|
-
if (P.current ||
|
|
2669
|
-
P.current = !1;
|
|
2679
|
+
if (P.current || N.current || y.getState().connection.inProgress) {
|
|
2680
|
+
P.current = !1, N.current = !1;
|
|
2670
2681
|
return;
|
|
2671
2682
|
}
|
|
2672
2683
|
l?.(e), y.getState().resetSelectedElements(), y.setState({ nodesSelectionActive: !1 });
|
|
@@ -2679,23 +2690,24 @@ function Pane({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = j.Ful
|
|
|
2679
2690
|
}, L = d ? (e) => d(e) : void 0, onClickCapture = (e) => {
|
|
2680
2691
|
P.current &&= (e.stopPropagation(), !1);
|
|
2681
2692
|
}, onPointerDownCapture = (n) => {
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2693
|
+
if (n.pointerType === "touch" && r !== !1 && !t) return;
|
|
2694
|
+
let { domNode: i, transform: a } = y.getState();
|
|
2695
|
+
if (k.current = i?.getBoundingClientRect(), !k.current) return;
|
|
2696
|
+
let s = n.target === O.current;
|
|
2697
|
+
if (!s && n.target.closest(".nokey") || !e || !(o && s || t) || n.button !== 0 || !n.isPrimary) return;
|
|
2686
2698
|
n.target?.setPointerCapture?.(n.pointerId), P.current = !1;
|
|
2687
|
-
let { x:
|
|
2688
|
-
x:
|
|
2689
|
-
y:
|
|
2690
|
-
},
|
|
2699
|
+
let { x: c, y: l } = getEventPosition(n.nativeEvent, k.current), u = pointToRendererPoint({
|
|
2700
|
+
x: c,
|
|
2701
|
+
y: l
|
|
2702
|
+
}, a);
|
|
2691
2703
|
y.setState({ userSelectionRect: {
|
|
2692
2704
|
width: 0,
|
|
2693
2705
|
height: 0,
|
|
2694
|
-
startX:
|
|
2695
|
-
startY:
|
|
2696
|
-
x:
|
|
2697
|
-
y:
|
|
2698
|
-
} }),
|
|
2706
|
+
startX: u.x,
|
|
2707
|
+
startY: u.y,
|
|
2708
|
+
x: c,
|
|
2709
|
+
y: l
|
|
2710
|
+
} }), s || (n.stopPropagation(), n.preventDefault());
|
|
2699
2711
|
};
|
|
2700
2712
|
function commitUserSelectionRect(e, t) {
|
|
2701
2713
|
let { userSelectionRect: r } = y.getState();
|
|
@@ -2710,26 +2722,26 @@ function Pane({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = j.Ful
|
|
|
2710
2722
|
y: t < p ? t : p,
|
|
2711
2723
|
width: Math.abs(e - f),
|
|
2712
2724
|
height: Math.abs(t - p)
|
|
2713
|
-
}, h =
|
|
2714
|
-
|
|
2725
|
+
}, h = A.current, g = M.current;
|
|
2726
|
+
A.current = new Set(getNodesInside(a, m, i, n === j.Partial, !0).map((e) => e.id)), M.current = /* @__PURE__ */ new Set();
|
|
2715
2727
|
let _ = u?.selectable ?? !0;
|
|
2716
|
-
for (let e of
|
|
2728
|
+
for (let e of A.current) {
|
|
2717
2729
|
let t = s.get(e);
|
|
2718
2730
|
if (t) for (let { edgeId: e } of t.values()) {
|
|
2719
2731
|
let t = o.get(e);
|
|
2720
|
-
t && (t.selectable ?? _) &&
|
|
2732
|
+
t && (t.selectable ?? _) && M.current.add(e);
|
|
2721
2733
|
}
|
|
2722
2734
|
}
|
|
2723
|
-
areSetsEqual(h,
|
|
2735
|
+
areSetsEqual(h, A.current) || c(getSelectionChanges(a, A.current, !0)), areSetsEqual(g, M.current) || l(getSelectionChanges(o, M.current)), y.setState({
|
|
2724
2736
|
userSelectionRect: m,
|
|
2725
2737
|
userSelectionActive: !0,
|
|
2726
2738
|
nodesSelectionActive: !1
|
|
2727
2739
|
});
|
|
2728
2740
|
}
|
|
2729
2741
|
function autoPan() {
|
|
2730
|
-
if (!i || !
|
|
2731
|
-
let [e, t] = calcAutoPan(F.current,
|
|
2732
|
-
|
|
2742
|
+
if (!i || !k.current) return;
|
|
2743
|
+
let [e, t] = calcAutoPan(F.current, k.current, E);
|
|
2744
|
+
T({
|
|
2733
2745
|
x: e,
|
|
2734
2746
|
y: t
|
|
2735
2747
|
}).then((e) => {
|
|
@@ -2747,8 +2759,8 @@ function Pane({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = j.Ful
|
|
|
2747
2759
|
h(() => () => cleanupAutoPan(), []);
|
|
2748
2760
|
let onPointerMove = (e) => {
|
|
2749
2761
|
let { userSelectionRect: n, transform: r, resetSelectedElements: i } = y.getState();
|
|
2750
|
-
if (!
|
|
2751
|
-
let { x: o, y: c } = getEventPosition(e.nativeEvent,
|
|
2762
|
+
if (!k.current || !n) return;
|
|
2763
|
+
let { x: o, y: c } = getEventPosition(e.nativeEvent, k.current);
|
|
2752
2764
|
F.current = {
|
|
2753
2765
|
x: o,
|
|
2754
2766
|
y: c
|
|
@@ -2764,31 +2776,35 @@ function Pane({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = j.Ful
|
|
|
2764
2776
|
}
|
|
2765
2777
|
P.current = !0, I.current ||= (autoPan(), !0), commitUserSelectionRect(o, c);
|
|
2766
2778
|
}, onPointerUp = (e) => {
|
|
2767
|
-
|
|
2779
|
+
if (!D) {
|
|
2780
|
+
e.target === O.current && y.getState().connection.inProgress && (N.current = !0);
|
|
2781
|
+
return;
|
|
2782
|
+
}
|
|
2783
|
+
e.button === 0 && (e.target?.releasePointerCapture?.(e.pointerId), !b && e.target === O.current && y.getState().userSelectionRect && onClick?.(e), y.setState({
|
|
2768
2784
|
userSelectionActive: !1,
|
|
2769
2785
|
userSelectionRect: null
|
|
2770
|
-
}), P.current && (c?.(e), y.setState({ nodesSelectionActive:
|
|
2786
|
+
}), P.current && (c?.(e), y.setState({ nodesSelectionActive: A.current.size > 0 })), cleanupAutoPan());
|
|
2771
2787
|
}, onPointerCancel = (e) => {
|
|
2772
2788
|
e.target?.releasePointerCapture?.(e.pointerId), cleanupAutoPan();
|
|
2773
|
-
};
|
|
2789
|
+
}, R = r === !0 || Array.isArray(r) && r.includes(0);
|
|
2774
2790
|
return S("div", {
|
|
2775
2791
|
className: cc(["react-flow__pane", {
|
|
2776
|
-
draggable:
|
|
2792
|
+
draggable: R,
|
|
2777
2793
|
dragging: w,
|
|
2778
2794
|
selection: e
|
|
2779
2795
|
}]),
|
|
2780
|
-
onClick:
|
|
2781
|
-
onContextMenu: wrapHandler(onContextMenu,
|
|
2782
|
-
onWheel: wrapHandler(L,
|
|
2783
|
-
onPointerEnter:
|
|
2784
|
-
onPointerMove:
|
|
2785
|
-
onPointerUp
|
|
2786
|
-
onPointerCancel:
|
|
2787
|
-
onPointerDownCapture:
|
|
2788
|
-
onClickCapture:
|
|
2796
|
+
onClick: D ? void 0 : wrapHandler(onClick, O),
|
|
2797
|
+
onContextMenu: wrapHandler(onContextMenu, O),
|
|
2798
|
+
onWheel: wrapHandler(L, O),
|
|
2799
|
+
onPointerEnter: D ? void 0 : f,
|
|
2800
|
+
onPointerMove: D ? onPointerMove : p,
|
|
2801
|
+
onPointerUp,
|
|
2802
|
+
onPointerCancel: D ? onPointerCancel : void 0,
|
|
2803
|
+
onPointerDownCapture: D ? onPointerDownCapture : void 0,
|
|
2804
|
+
onClickCapture: D ? onClickCapture : void 0,
|
|
2789
2805
|
onPointerLeave: m,
|
|
2790
|
-
ref:
|
|
2791
|
-
style:
|
|
2806
|
+
ref: O,
|
|
2807
|
+
style: Q,
|
|
2792
2808
|
children: [g, x(UserSelection, {})]
|
|
2793
2809
|
});
|
|
2794
2810
|
}
|
|
@@ -2806,7 +2822,7 @@ function handleNodeClick({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
|
|
|
2806
2822
|
function useDrag({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector: r, nodeId: i, isSelectable: a, nodeClickDistance: o }) {
|
|
2807
2823
|
let s = useStoreApi(), [c, l] = y(!1), u = v();
|
|
2808
2824
|
return h(() => {
|
|
2809
|
-
u.current = XYDrag({
|
|
2825
|
+
if (!t) return u.current = XYDrag({
|
|
2810
2826
|
getStoreItems: () => s.getState(),
|
|
2811
2827
|
onNodeMouseDown: (t) => {
|
|
2812
2828
|
handleNodeClick({
|
|
@@ -2821,18 +2837,22 @@ function useDrag({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelec
|
|
|
2821
2837
|
onDragStop: () => {
|
|
2822
2838
|
l(!1);
|
|
2823
2839
|
}
|
|
2824
|
-
})
|
|
2825
|
-
|
|
2826
|
-
|
|
2840
|
+
}), () => {
|
|
2841
|
+
u.current?.destroy(), u.current = void 0;
|
|
2842
|
+
};
|
|
2843
|
+
}, [
|
|
2844
|
+
t,
|
|
2845
|
+
s,
|
|
2846
|
+
e
|
|
2847
|
+
]), h(() => {
|
|
2848
|
+
!t && e.current && u.current && u.current.update({
|
|
2827
2849
|
noDragClassName: n,
|
|
2828
2850
|
handleSelector: r,
|
|
2829
2851
|
domNode: e.current,
|
|
2830
2852
|
isSelectable: a,
|
|
2831
2853
|
nodeId: i,
|
|
2832
2854
|
nodeClickDistance: o
|
|
2833
|
-
})
|
|
2834
|
-
u.current?.destroy();
|
|
2835
|
-
};
|
|
2855
|
+
});
|
|
2836
2856
|
}, [
|
|
2837
2857
|
n,
|
|
2838
2858
|
r,
|
|
@@ -2870,12 +2890,35 @@ function useMoveSelectedNodes() {
|
|
|
2870
2890
|
}
|
|
2871
2891
|
var ye = u(null), be = ye.Provider;
|
|
2872
2892
|
ye.Consumer;
|
|
2873
|
-
var useNodeId = () => m(ye), selector$
|
|
2893
|
+
var useNodeId = () => m(ye), selector$f = (e) => ({
|
|
2874
2894
|
connectOnClick: e.connectOnClick,
|
|
2875
2895
|
noPanClassName: e.noPanClassName,
|
|
2876
2896
|
rfId: e.rfId
|
|
2877
|
-
}),
|
|
2878
|
-
|
|
2897
|
+
}), xe = u(null);
|
|
2898
|
+
function HandleConfigProvider({ children: e }) {
|
|
2899
|
+
let t = useStore(selector$f, shallow$1);
|
|
2900
|
+
return x(xe.Provider, {
|
|
2901
|
+
value: t,
|
|
2902
|
+
children: e
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
function useHandleConfig() {
|
|
2906
|
+
let e = m(xe);
|
|
2907
|
+
if (!e) throw Error("useHandleConfig must be used within a HandleConfigProvider");
|
|
2908
|
+
return e;
|
|
2909
|
+
}
|
|
2910
|
+
var Se = {
|
|
2911
|
+
connectingFrom: !1,
|
|
2912
|
+
connectingTo: !1,
|
|
2913
|
+
clickConnecting: !1,
|
|
2914
|
+
isPossibleEndHandle: !0,
|
|
2915
|
+
connectionInProcess: !1,
|
|
2916
|
+
clickConnectionInProcess: !1,
|
|
2917
|
+
valid: !1
|
|
2918
|
+
}, connectingSelector = (e, t, n) => (r) => {
|
|
2919
|
+
let { connectionClickStartHandle: i, connectionMode: a, connection: o } = r, { fromHandle: s, toHandle: c, isValid: l } = o;
|
|
2920
|
+
if (!s && !i) return Se;
|
|
2921
|
+
let u = c?.nodeId === e && c?.id === t && c?.type === n;
|
|
2879
2922
|
return {
|
|
2880
2923
|
connectingFrom: s?.nodeId === e && s?.id === t && s?.type === n,
|
|
2881
2924
|
connectingTo: u,
|
|
@@ -2887,7 +2930,7 @@ var useNodeId = () => m(ye), selector$g = (e) => ({
|
|
|
2887
2930
|
};
|
|
2888
2931
|
};
|
|
2889
2932
|
function HandleComponent({ type: e = "source", position: t = F.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) {
|
|
2890
|
-
let m = o || null, h = e === "target", g = useStoreApi(), _ = useNodeId(), { connectOnClick: v, noPanClassName: y, rfId: b } =
|
|
2933
|
+
let m = o || null, h = e === "target", g = useStoreApi(), _ = useNodeId(), { connectOnClick: v, noPanClassName: y, rfId: b } = useHandleConfig(), { connectingFrom: S, connectingTo: C, clickConnecting: w, isPossibleEndHandle: E, connectionInProcess: D, clickConnectionInProcess: O, valid: k } = useStore(connectingSelector(_, m, e), shallow$1);
|
|
2891
2934
|
_ || g.getState().onError?.("010", T.error010());
|
|
2892
2935
|
let onConnectExtended = (e) => {
|
|
2893
2936
|
let { defaultEdgeOptions: t, onConnect: n, hasDefaultEdges: r } = g.getState(), i = {
|
|
@@ -2997,9 +3040,9 @@ function HandleComponent({ type: e = "source", position: t = F.Top, isValidConne
|
|
|
2997
3040
|
children: c
|
|
2998
3041
|
});
|
|
2999
3042
|
}
|
|
3000
|
-
var
|
|
3043
|
+
var Ce = f(fixedForwardRef(HandleComponent));
|
|
3001
3044
|
function InputNode({ data: e, isConnectable: t, sourcePosition: n = F.Bottom }) {
|
|
3002
|
-
return S(b, { children: [e?.label, x(
|
|
3045
|
+
return S(b, { children: [e?.label, x(Ce, {
|
|
3003
3046
|
type: "source",
|
|
3004
3047
|
position: n,
|
|
3005
3048
|
isConnectable: t
|
|
@@ -3007,13 +3050,13 @@ function InputNode({ data: e, isConnectable: t, sourcePosition: n = F.Bottom })
|
|
|
3007
3050
|
}
|
|
3008
3051
|
function DefaultNode({ data: e, isConnectable: t, targetPosition: n = F.Top, sourcePosition: r = F.Bottom }) {
|
|
3009
3052
|
return S(b, { children: [
|
|
3010
|
-
x(
|
|
3053
|
+
x(Ce, {
|
|
3011
3054
|
type: "target",
|
|
3012
3055
|
position: n,
|
|
3013
3056
|
isConnectable: t
|
|
3014
3057
|
}),
|
|
3015
3058
|
e?.label,
|
|
3016
|
-
x(
|
|
3059
|
+
x(Ce, {
|
|
3017
3060
|
type: "source",
|
|
3018
3061
|
position: r,
|
|
3019
3062
|
isConnectable: t
|
|
@@ -3024,13 +3067,13 @@ function GroupNode() {
|
|
|
3024
3067
|
return null;
|
|
3025
3068
|
}
|
|
3026
3069
|
function OutputNode({ data: e, isConnectable: t, targetPosition: n = F.Top }) {
|
|
3027
|
-
return S(b, { children: [x(
|
|
3070
|
+
return S(b, { children: [x(Ce, {
|
|
3028
3071
|
type: "target",
|
|
3029
3072
|
position: n,
|
|
3030
3073
|
isConnectable: t
|
|
3031
3074
|
}), e?.label] });
|
|
3032
3075
|
}
|
|
3033
|
-
var
|
|
3076
|
+
var we = {
|
|
3034
3077
|
ArrowUp: {
|
|
3035
3078
|
x: 0,
|
|
3036
3079
|
y: -1
|
|
@@ -3047,7 +3090,7 @@ var xe = {
|
|
|
3047
3090
|
x: 1,
|
|
3048
3091
|
y: 0
|
|
3049
3092
|
}
|
|
3050
|
-
},
|
|
3093
|
+
}, Te = {
|
|
3051
3094
|
input: InputNode,
|
|
3052
3095
|
default: DefaultNode,
|
|
3053
3096
|
output: OutputNode,
|
|
@@ -3062,7 +3105,7 @@ function getNodeInlineStyleDimensions(e) {
|
|
|
3062
3105
|
height: e.height ?? e.style?.height
|
|
3063
3106
|
};
|
|
3064
3107
|
}
|
|
3065
|
-
var selector$
|
|
3108
|
+
var selector$e = (e) => {
|
|
3066
3109
|
let { width: t, height: n, x: r, y: i } = getInternalNodesBounds(e.nodeLookup, { filter: (e) => !!e.selected });
|
|
3067
3110
|
return {
|
|
3068
3111
|
width: isNumeric(t) ? t : null,
|
|
@@ -3072,7 +3115,7 @@ var selector$f = (e) => {
|
|
|
3072
3115
|
};
|
|
3073
3116
|
};
|
|
3074
3117
|
function NodesSelection({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
|
|
3075
|
-
let r = useStoreApi(), { width: i, height: a, transformString: o, userSelectionActive: s } = useStore(selector$
|
|
3118
|
+
let r = useStoreApi(), { width: i, height: a, transformString: o, userSelectionActive: s } = useStore(selector$e, shallow$1), c = useMoveSelectedNodes(), l = v(null);
|
|
3076
3119
|
h(() => {
|
|
3077
3120
|
n || l.current?.focus({ preventScroll: !0 });
|
|
3078
3121
|
}, [n]);
|
|
@@ -3084,8 +3127,8 @@ function NodesSelection({ onSelectionContextMenu: e, noPanClassName: t, disableK
|
|
|
3084
3127
|
let d = e ? (t) => {
|
|
3085
3128
|
e(t, r.getState().nodes.filter((e) => e.selected));
|
|
3086
3129
|
} : void 0, onKeyDown = (e) => {
|
|
3087
|
-
Object.prototype.hasOwnProperty.call(
|
|
3088
|
-
direction:
|
|
3130
|
+
Object.prototype.hasOwnProperty.call(we, e.key) && (e.preventDefault(), c({
|
|
3131
|
+
direction: we[e.key],
|
|
3089
3132
|
factor: e.shiftKey ? 4 : 1
|
|
3090
3133
|
}));
|
|
3091
3134
|
};
|
|
@@ -3109,12 +3152,12 @@ function NodesSelection({ onSelectionContextMenu: e, noPanClassName: t, disableK
|
|
|
3109
3152
|
})
|
|
3110
3153
|
});
|
|
3111
3154
|
}
|
|
3112
|
-
var
|
|
3155
|
+
var Ee = typeof window < "u" ? window : void 0, selector$d = (e) => ({
|
|
3113
3156
|
nodesSelectionActive: e.nodesSelectionActive,
|
|
3114
3157
|
userSelectionActive: e.userSelectionActive
|
|
3115
3158
|
});
|
|
3116
3159
|
function FlowRendererComponent({ 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: g, elementsSelectable: _, zoomOnScroll: v, zoomOnPinch: y, panOnScroll: b, 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 }) {
|
|
3117
|
-
let { nodesSelectionActive: z, userSelectionActive: B } = useStore(selector$
|
|
3160
|
+
let { nodesSelectionActive: z, userSelectionActive: B } = useStore(selector$d, shallow$1), V = useKeyPress(l, { target: Ee }), H = useKeyPress(h, { target: Ee }), U = H || E, W = H || b, G = u && U !== !0, K = V || B || G;
|
|
3118
3161
|
return useGlobalKeyHandler({
|
|
3119
3162
|
deleteKeyCode: c,
|
|
3120
3163
|
multiSelectionKeyCode: m
|
|
@@ -3124,6 +3167,7 @@ function FlowRendererComponent({ children: e, onPaneClick: t, onPaneMouseEnter:
|
|
|
3124
3167
|
zoomOnScroll: v,
|
|
3125
3168
|
zoomOnPinch: y,
|
|
3126
3169
|
panOnScroll: W,
|
|
3170
|
+
panActivationKeyPressed: H,
|
|
3127
3171
|
panOnScrollSpeed: C,
|
|
3128
3172
|
panOnScrollMode: w,
|
|
3129
3173
|
zoomOnDoubleClick: T,
|
|
@@ -3165,18 +3209,18 @@ function FlowRendererComponent({ children: e, onPaneClick: t, onPaneMouseEnter:
|
|
|
3165
3209
|
});
|
|
3166
3210
|
}
|
|
3167
3211
|
FlowRendererComponent.displayName = "FlowRenderer";
|
|
3168
|
-
var
|
|
3212
|
+
var De = f(FlowRendererComponent), selector$c = (e) => (t) => e ? getNodesInside(t.nodeLookup, {
|
|
3169
3213
|
x: 0,
|
|
3170
3214
|
y: 0,
|
|
3171
3215
|
width: t.width,
|
|
3172
3216
|
height: t.height
|
|
3173
3217
|
}, t.transform, !0).map((e) => e.id) : Array.from(t.nodeLookup.keys());
|
|
3174
3218
|
function useVisibleNodeIds(e) {
|
|
3175
|
-
return useStore(p(selector$
|
|
3219
|
+
return useStore(p(selector$c(e), [e]), shallow$1);
|
|
3176
3220
|
}
|
|
3177
|
-
var selector$
|
|
3221
|
+
var selector$b = (e) => e.updateNodeInternals;
|
|
3178
3222
|
function useResizeObserver() {
|
|
3179
|
-
let e = useStore(selector$
|
|
3223
|
+
let e = useStore(selector$b), [t] = y(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((t) => {
|
|
3180
3224
|
let n = /* @__PURE__ */ new Map();
|
|
3181
3225
|
t.forEach((e) => {
|
|
3182
3226
|
let t = e.target.getAttribute("data-id");
|
|
@@ -3221,8 +3265,8 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
|
|
|
3221
3265
|
internals: n.internals,
|
|
3222
3266
|
isParent: r
|
|
3223
3267
|
};
|
|
3224
|
-
}, shallow$1), C = y.type || "default", w = g?.[C] ||
|
|
3225
|
-
w === void 0 && (v?.("003", T.error003(C)), C = "default", w = g?.default ||
|
|
3268
|
+
}, shallow$1), C = y.type || "default", w = g?.[C] || Te[C];
|
|
3269
|
+
w === void 0 && (v?.("003", T.error003(C)), C = "default", w = g?.default || Te.default);
|
|
3226
3270
|
let E = !!(y.draggable || s && y.draggable === void 0), O = !!(y.selectable || c && y.selectable === void 0), k = !!(y.connectable || l && y.connectable === void 0), A = !!(y.focusable || u && y.focusable === void 0), j = useStoreApi(), M = nodeHasDimensions(y), N = useNodeObserver({
|
|
3227
3271
|
node: y,
|
|
3228
3272
|
nodeType: C,
|
|
@@ -3255,7 +3299,7 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
|
|
|
3255
3299
|
unselect: n,
|
|
3256
3300
|
nodeRef: N
|
|
3257
3301
|
});
|
|
3258
|
-
} else if (E && y.selected && Object.prototype.hasOwnProperty.call(
|
|
3302
|
+
} else if (E && y.selected && Object.prototype.hasOwnProperty.call(we, t.key)) {
|
|
3259
3303
|
t.preventDefault();
|
|
3260
3304
|
let { ariaLabelConfig: e } = j.getState();
|
|
3261
3305
|
j.setState({ ariaLiveMessage: e["node.a11yDescription.ariaLiveMessage"]({
|
|
@@ -3263,7 +3307,7 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
|
|
|
3263
3307
|
x: ~~b.positionAbsolute.x,
|
|
3264
3308
|
y: ~~b.positionAbsolute.y
|
|
3265
3309
|
}) }), F({
|
|
3266
|
-
direction:
|
|
3310
|
+
direction: we[t.key],
|
|
3267
3311
|
factor: t.shiftKey ? 4 : 1
|
|
3268
3312
|
});
|
|
3269
3313
|
}
|
|
@@ -3341,20 +3385,19 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
|
|
|
3341
3385
|
})
|
|
3342
3386
|
});
|
|
3343
3387
|
}
|
|
3344
|
-
var
|
|
3345
|
-
nodesDraggable: e.nodesDraggable,
|
|
3388
|
+
var Oe = f(NodeWrapper), selector$a = (e) => ({
|
|
3346
3389
|
nodesConnectable: e.nodesConnectable,
|
|
3347
3390
|
nodesFocusable: e.nodesFocusable,
|
|
3348
3391
|
elementsSelectable: e.elementsSelectable,
|
|
3349
3392
|
onError: e.onError
|
|
3350
3393
|
});
|
|
3351
3394
|
function NodeRendererComponent(e) {
|
|
3352
|
-
let {
|
|
3395
|
+
let { nodesConnectable: t, nodesFocusable: n, elementsSelectable: r, onError: i } = useStore(selector$a, shallow$1), a = useVisibleNodeIds(e.onlyRenderVisibleElements), o = useResizeObserver();
|
|
3353
3396
|
return x("div", {
|
|
3354
3397
|
className: "react-flow__nodes",
|
|
3355
|
-
style:
|
|
3356
|
-
children:
|
|
3357
|
-
id:
|
|
3398
|
+
style: Q,
|
|
3399
|
+
children: a.map((a) => x(Oe, {
|
|
3400
|
+
id: a,
|
|
3358
3401
|
nodeTypes: e.nodeTypes,
|
|
3359
3402
|
nodeExtent: e.nodeExtent,
|
|
3360
3403
|
onClick: e.onNodeClick,
|
|
@@ -3367,18 +3410,18 @@ function NodeRendererComponent(e) {
|
|
|
3367
3410
|
noPanClassName: e.noPanClassName,
|
|
3368
3411
|
rfId: e.rfId,
|
|
3369
3412
|
disableKeyboardA11y: e.disableKeyboardA11y,
|
|
3370
|
-
resizeObserver:
|
|
3371
|
-
nodesDraggable:
|
|
3372
|
-
nodesConnectable:
|
|
3373
|
-
nodesFocusable:
|
|
3374
|
-
elementsSelectable:
|
|
3413
|
+
resizeObserver: o,
|
|
3414
|
+
nodesDraggable: e.nodesDraggable ?? !0,
|
|
3415
|
+
nodesConnectable: t,
|
|
3416
|
+
nodesFocusable: n,
|
|
3417
|
+
elementsSelectable: r,
|
|
3375
3418
|
nodeClickDistance: e.nodeClickDistance,
|
|
3376
|
-
onError:
|
|
3377
|
-
},
|
|
3419
|
+
onError: i
|
|
3420
|
+
}, a))
|
|
3378
3421
|
});
|
|
3379
3422
|
}
|
|
3380
3423
|
NodeRendererComponent.displayName = "NodeRenderer";
|
|
3381
|
-
var
|
|
3424
|
+
var ke = f(NodeRendererComponent);
|
|
3382
3425
|
function useVisibleEdgeIds(e) {
|
|
3383
3426
|
return useStore(p((t) => {
|
|
3384
3427
|
if (!e) return t.edges.map((e) => e.id);
|
|
@@ -3396,35 +3439,41 @@ function useVisibleEdgeIds(e) {
|
|
|
3396
3439
|
return n;
|
|
3397
3440
|
}, [e]), shallow$1);
|
|
3398
3441
|
}
|
|
3399
|
-
var ArrowSymbol = ({ color: e = "none", strokeWidth: t = 1 }) =>
|
|
3400
|
-
|
|
3401
|
-
style: {
|
|
3442
|
+
var ArrowSymbol = ({ color: e = "none", strokeWidth: t = 1 }) => {
|
|
3443
|
+
let n = {
|
|
3402
3444
|
strokeWidth: t,
|
|
3403
3445
|
...e && { stroke: e }
|
|
3404
|
-
}
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3446
|
+
};
|
|
3447
|
+
return x("polyline", {
|
|
3448
|
+
className: "arrow",
|
|
3449
|
+
style: n,
|
|
3450
|
+
strokeLinecap: "round",
|
|
3451
|
+
fill: "none",
|
|
3452
|
+
strokeLinejoin: "round",
|
|
3453
|
+
points: "-5,-4 0,0 -5,4"
|
|
3454
|
+
});
|
|
3455
|
+
}, ArrowClosedSymbol = ({ color: e = "none", strokeWidth: t = 1 }) => {
|
|
3456
|
+
let n = {
|
|
3412
3457
|
strokeWidth: t,
|
|
3413
3458
|
...e && {
|
|
3414
3459
|
stroke: e,
|
|
3415
3460
|
fill: e
|
|
3416
3461
|
}
|
|
3417
|
-
}
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3462
|
+
};
|
|
3463
|
+
return x("polyline", {
|
|
3464
|
+
className: "arrowclosed",
|
|
3465
|
+
style: n,
|
|
3466
|
+
strokeLinecap: "round",
|
|
3467
|
+
strokeLinejoin: "round",
|
|
3468
|
+
points: "-5,-4 0,0 -5,4 -5,-4"
|
|
3469
|
+
});
|
|
3470
|
+
}, Ae = {
|
|
3422
3471
|
[P.Arrow]: ArrowSymbol,
|
|
3423
3472
|
[P.ArrowClosed]: ArrowClosedSymbol
|
|
3424
3473
|
};
|
|
3425
3474
|
function useMarkerSymbol(e) {
|
|
3426
3475
|
let t = useStoreApi();
|
|
3427
|
-
return _(() => Object.prototype.hasOwnProperty.call(
|
|
3476
|
+
return _(() => Object.prototype.hasOwnProperty.call(Ae, e) ? Ae[e] : (t.getState().onError?.("009", T.error009(e)), null), [e]);
|
|
3428
3477
|
}
|
|
3429
3478
|
var Marker = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerUnits: a = "strokeWidth", strokeWidth: o, orient: s = "auto-start-reverse" }) => {
|
|
3430
3479
|
let c = useMarkerSymbol(t);
|
|
@@ -3471,7 +3520,7 @@ var Marker = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, mar
|
|
|
3471
3520
|
}) : null;
|
|
3472
3521
|
};
|
|
3473
3522
|
MarkerDefinitions.displayName = "MarkerDefinitions";
|
|
3474
|
-
var
|
|
3523
|
+
var je = f(MarkerDefinitions);
|
|
3475
3524
|
function EdgeTextComponent({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgStyle: a, labelBgPadding: o = [2, 4], labelBgBorderRadius: s = 2, children: c, className: l, ...u }) {
|
|
3476
3525
|
let [d, f] = y({
|
|
3477
3526
|
x: 1,
|
|
@@ -3518,7 +3567,7 @@ function EdgeTextComponent({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i
|
|
|
3518
3567
|
}) : null;
|
|
3519
3568
|
}
|
|
3520
3569
|
EdgeTextComponent.displayName = "EdgeText";
|
|
3521
|
-
var
|
|
3570
|
+
var Me = f(EdgeTextComponent);
|
|
3522
3571
|
function BaseEdge({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowBg: a, labelBgStyle: o, labelBgPadding: s, labelBgBorderRadius: c, interactionWidth: l = 20, ...u }) {
|
|
3523
3572
|
return S(b, { children: [
|
|
3524
3573
|
x("path", {
|
|
@@ -3534,7 +3583,7 @@ function BaseEdge({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labe
|
|
|
3534
3583
|
strokeWidth: l,
|
|
3535
3584
|
className: "react-flow__edge-interaction"
|
|
3536
3585
|
}) : null,
|
|
3537
|
-
r && isNumeric(t) && isNumeric(n) ? x(
|
|
3586
|
+
r && isNumeric(t) && isNumeric(n) ? x(Me, {
|
|
3538
3587
|
x: t,
|
|
3539
3588
|
y: n,
|
|
3540
3589
|
label: r,
|
|
@@ -3589,9 +3638,9 @@ function createSimpleBezierEdge(e) {
|
|
|
3589
3638
|
targetX: i,
|
|
3590
3639
|
targetY: a,
|
|
3591
3640
|
targetPosition: s
|
|
3592
|
-
});
|
|
3641
|
+
}), S = e.isInternal ? void 0 : t;
|
|
3593
3642
|
return x(BaseEdge, {
|
|
3594
|
-
id:
|
|
3643
|
+
id: S,
|
|
3595
3644
|
path: v,
|
|
3596
3645
|
labelX: y,
|
|
3597
3646
|
labelY: b,
|
|
@@ -3608,8 +3657,8 @@ function createSimpleBezierEdge(e) {
|
|
|
3608
3657
|
});
|
|
3609
3658
|
});
|
|
3610
3659
|
}
|
|
3611
|
-
var
|
|
3612
|
-
|
|
3660
|
+
var Ne = createSimpleBezierEdge({ isInternal: !1 }), Pe = createSimpleBezierEdge({ isInternal: !0 });
|
|
3661
|
+
Ne.displayName = "SimpleBezierEdge", Pe.displayName = "SimpleBezierEdgeInternal";
|
|
3613
3662
|
function createSmoothStepEdge(e) {
|
|
3614
3663
|
return f(({ 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 = F.Bottom, targetPosition: m = F.Top, markerEnd: h, markerStart: g, pathOptions: _, interactionWidth: v }) => {
|
|
3615
3664
|
let [y, b, S] = getSmoothStepPath({
|
|
@@ -3622,9 +3671,9 @@ function createSmoothStepEdge(e) {
|
|
|
3622
3671
|
borderRadius: _?.borderRadius,
|
|
3623
3672
|
offset: _?.offset,
|
|
3624
3673
|
stepPosition: _?.stepPosition
|
|
3625
|
-
});
|
|
3674
|
+
}), C = e.isInternal ? void 0 : t;
|
|
3626
3675
|
return x(BaseEdge, {
|
|
3627
|
-
id:
|
|
3676
|
+
id: C,
|
|
3628
3677
|
path: y,
|
|
3629
3678
|
labelX: b,
|
|
3630
3679
|
labelY: S,
|
|
@@ -3641,12 +3690,12 @@ function createSmoothStepEdge(e) {
|
|
|
3641
3690
|
});
|
|
3642
3691
|
});
|
|
3643
3692
|
}
|
|
3644
|
-
var
|
|
3645
|
-
|
|
3693
|
+
var Fe = createSmoothStepEdge({ isInternal: !1 }), Ie = createSmoothStepEdge({ isInternal: !0 });
|
|
3694
|
+
Fe.displayName = "SmoothStepEdge", Ie.displayName = "SmoothStepEdgeInternal";
|
|
3646
3695
|
function createStepEdge(e) {
|
|
3647
3696
|
return f(({ id: t, ...n }) => {
|
|
3648
3697
|
let r = e.isInternal ? void 0 : t;
|
|
3649
|
-
return x(
|
|
3698
|
+
return x(Fe, {
|
|
3650
3699
|
...n,
|
|
3651
3700
|
id: r,
|
|
3652
3701
|
pathOptions: _(() => ({
|
|
@@ -3656,8 +3705,8 @@ function createStepEdge(e) {
|
|
|
3656
3705
|
});
|
|
3657
3706
|
});
|
|
3658
3707
|
}
|
|
3659
|
-
var
|
|
3660
|
-
|
|
3708
|
+
var Le = createStepEdge({ isInternal: !1 }), Re = createStepEdge({ isInternal: !0 });
|
|
3709
|
+
Le.displayName = "StepEdge", Re.displayName = "StepEdgeInternal";
|
|
3661
3710
|
function createStraightEdge(e) {
|
|
3662
3711
|
return f(({ 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 }) => {
|
|
3663
3712
|
let [g, _, v] = getStraightPath({
|
|
@@ -3665,9 +3714,9 @@ function createStraightEdge(e) {
|
|
|
3665
3714
|
sourceY: r,
|
|
3666
3715
|
targetX: i,
|
|
3667
3716
|
targetY: a
|
|
3668
|
-
});
|
|
3717
|
+
}), y = e.isInternal ? void 0 : t;
|
|
3669
3718
|
return x(BaseEdge, {
|
|
3670
|
-
id:
|
|
3719
|
+
id: y,
|
|
3671
3720
|
path: g,
|
|
3672
3721
|
labelX: _,
|
|
3673
3722
|
labelY: v,
|
|
@@ -3684,8 +3733,8 @@ function createStraightEdge(e) {
|
|
|
3684
3733
|
});
|
|
3685
3734
|
});
|
|
3686
3735
|
}
|
|
3687
|
-
var
|
|
3688
|
-
|
|
3736
|
+
var ze = createStraightEdge({ isInternal: !1 }), Be = createStraightEdge({ isInternal: !0 });
|
|
3737
|
+
ze.displayName = "StraightEdge", Be.displayName = "StraightEdgeInternal";
|
|
3689
3738
|
function createBezierEdge(e) {
|
|
3690
3739
|
return f(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, sourcePosition: o = F.Bottom, targetPosition: s = F.Top, label: c, labelStyle: l, labelShowBg: u, labelBgStyle: d, labelBgPadding: f, labelBgBorderRadius: p, style: m, markerEnd: h, markerStart: g, pathOptions: _, interactionWidth: v }) => {
|
|
3691
3740
|
let [y, b, S] = getBezierPath({
|
|
@@ -3696,9 +3745,9 @@ function createBezierEdge(e) {
|
|
|
3696
3745
|
targetY: a,
|
|
3697
3746
|
targetPosition: s,
|
|
3698
3747
|
curvature: _?.curvature
|
|
3699
|
-
});
|
|
3748
|
+
}), C = e.isInternal ? void 0 : t;
|
|
3700
3749
|
return x(BaseEdge, {
|
|
3701
|
-
id:
|
|
3750
|
+
id: C,
|
|
3702
3751
|
path: y,
|
|
3703
3752
|
labelX: b,
|
|
3704
3753
|
labelY: S,
|
|
@@ -3715,28 +3764,29 @@ function createBezierEdge(e) {
|
|
|
3715
3764
|
});
|
|
3716
3765
|
});
|
|
3717
3766
|
}
|
|
3718
|
-
var
|
|
3719
|
-
|
|
3720
|
-
var
|
|
3721
|
-
default:
|
|
3722
|
-
straight:
|
|
3723
|
-
step:
|
|
3724
|
-
smoothstep:
|
|
3725
|
-
simplebezier:
|
|
3726
|
-
},
|
|
3767
|
+
var Ve = createBezierEdge({ isInternal: !1 }), He = createBezierEdge({ isInternal: !0 });
|
|
3768
|
+
Ve.displayName = "BezierEdge", He.displayName = "BezierEdgeInternal";
|
|
3769
|
+
var Ue = {
|
|
3770
|
+
default: He,
|
|
3771
|
+
straight: Be,
|
|
3772
|
+
step: Re,
|
|
3773
|
+
smoothstep: Ie,
|
|
3774
|
+
simplebezier: Pe
|
|
3775
|
+
}, We = {
|
|
3727
3776
|
sourceX: null,
|
|
3728
3777
|
sourceY: null,
|
|
3729
3778
|
targetX: null,
|
|
3730
3779
|
targetY: null,
|
|
3731
3780
|
sourcePosition: null,
|
|
3732
|
-
targetPosition: null
|
|
3733
|
-
|
|
3781
|
+
targetPosition: null,
|
|
3782
|
+
zIndex: void 0
|
|
3783
|
+
}, shiftX = (e, t, n) => n === F.Left ? e - t : n === F.Right ? e + t : e, shiftY = (e, t, n) => n === F.Top ? e - t : n === F.Bottom ? e + t : e, Ge = "react-flow__edgeupdater";
|
|
3734
3784
|
function EdgeAnchor({ position: e, centerX: t, centerY: n, radius: r = 10, onMouseDown: i, onMouseEnter: a, onMouseOut: o, type: s }) {
|
|
3735
3785
|
return x("circle", {
|
|
3736
3786
|
onMouseDown: i,
|
|
3737
3787
|
onMouseEnter: a,
|
|
3738
3788
|
onMouseOut: o,
|
|
3739
|
-
className: cc([
|
|
3789
|
+
className: cc([Ge, `${Ge}-${s}`]),
|
|
3740
3790
|
cx: shiftX(t, r, e),
|
|
3741
3791
|
cy: shiftY(n, r, e),
|
|
3742
3792
|
r,
|
|
@@ -3812,14 +3862,11 @@ function EdgeWrapper({ id: e, edgesFocusable: t, edgesReconnectable: n, elements
|
|
|
3812
3862
|
...O,
|
|
3813
3863
|
...E
|
|
3814
3864
|
} : E;
|
|
3815
|
-
let k = E.type || "default", A = g?.[k] ||
|
|
3816
|
-
A === void 0 && (C?.("011", T.error011(k)), k = "default", A = g?.default ||
|
|
3817
|
-
let j = !!(E.focusable || t && E.focusable === void 0), M = d !== void 0 && (E.reconnectable || n && E.reconnectable === void 0), N = !!(E.selectable || r && E.selectable === void 0), P = v(null), [F, I] = y(!1), [L, R] = y(!1), z = useStoreApi(), { zIndex: B, sourceX: V, sourceY: H, targetX: U, targetY: W, sourcePosition: G, targetPosition: K } = useStore(p((t) => {
|
|
3865
|
+
let k = E.type || "default", A = g?.[k] || Ue[k];
|
|
3866
|
+
A === void 0 && (C?.("011", T.error011(k)), k = "default", A = g?.default || Ue.default);
|
|
3867
|
+
let j = !!(E.focusable || t && E.focusable === void 0), M = d !== void 0 && (E.reconnectable || n && E.reconnectable === void 0), N = !!(E.selectable || r && E.selectable === void 0), P = v(null), [F, I] = y(!1), [L, R] = y(!1), z = useStoreApi(), { zIndex: B = E.zIndex, sourceX: V, sourceY: H, targetX: U, targetY: W, sourcePosition: G, targetPosition: K } = useStore(p((t) => {
|
|
3818
3868
|
let n = t.nodeLookup.get(E.source), r = t.nodeLookup.get(E.target);
|
|
3819
|
-
if (!n || !r) return
|
|
3820
|
-
zIndex: E.zIndex,
|
|
3821
|
-
...Ve
|
|
3822
|
-
};
|
|
3869
|
+
if (!n || !r) return We;
|
|
3823
3870
|
let i = getEdgePosition({
|
|
3824
3871
|
id: e,
|
|
3825
3872
|
sourceNode: n,
|
|
@@ -3828,17 +3875,17 @@ function EdgeWrapper({ id: e, edgesFocusable: t, edgesReconnectable: n, elements
|
|
|
3828
3875
|
targetHandle: E.targetHandle || null,
|
|
3829
3876
|
connectionMode: t.connectionMode,
|
|
3830
3877
|
onError: C
|
|
3878
|
+
}), a = getElevatedEdgeZIndex({
|
|
3879
|
+
selected: E.selected,
|
|
3880
|
+
zIndex: E.zIndex,
|
|
3881
|
+
sourceNode: n,
|
|
3882
|
+
targetNode: r,
|
|
3883
|
+
elevateOnSelect: t.elevateEdgesOnSelect,
|
|
3884
|
+
zIndexMode: t.zIndexMode
|
|
3831
3885
|
});
|
|
3832
3886
|
return {
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
zIndex: E.zIndex,
|
|
3836
|
-
sourceNode: n,
|
|
3837
|
-
targetNode: r,
|
|
3838
|
-
elevateOnSelect: t.elevateEdgesOnSelect,
|
|
3839
|
-
zIndexMode: t.zIndexMode
|
|
3840
|
-
}),
|
|
3841
|
-
...i || Ve
|
|
3887
|
+
...i || We,
|
|
3888
|
+
zIndex: a
|
|
3842
3889
|
};
|
|
3843
3890
|
}, [
|
|
3844
3891
|
E.source,
|
|
@@ -3846,7 +3893,8 @@ function EdgeWrapper({ id: e, edgesFocusable: t, edgesReconnectable: n, elements
|
|
|
3846
3893
|
E.sourceHandle,
|
|
3847
3894
|
E.targetHandle,
|
|
3848
3895
|
E.selected,
|
|
3849
|
-
E.zIndex
|
|
3896
|
+
E.zIndex,
|
|
3897
|
+
C
|
|
3850
3898
|
]), shallow$1), q = _(() => E.markerStart ? `url('#${getMarkerId(E.markerStart, h)}')` : void 0, [E.markerStart, h]), J = _(() => E.markerEnd ? `url('#${getMarkerId(E.markerEnd, h)}')` : void 0, [E.markerEnd, h]);
|
|
3851
3899
|
if (E.hidden || V === null || H === null || U === null || W === null) return null;
|
|
3852
3900
|
let onEdgeClick = (t) => {
|
|
@@ -3951,7 +3999,7 @@ function EdgeWrapper({ id: e, edgesFocusable: t, edgesReconnectable: n, elements
|
|
|
3951
3999
|
})
|
|
3952
4000
|
});
|
|
3953
4001
|
}
|
|
3954
|
-
var
|
|
4002
|
+
var Ke = f(EdgeWrapper), selector$9 = (e) => ({
|
|
3955
4003
|
edgesFocusable: e.edgesFocusable,
|
|
3956
4004
|
edgesReconnectable: e.edgesReconnectable,
|
|
3957
4005
|
elementsSelectable: e.elementsSelectable,
|
|
@@ -3959,13 +4007,13 @@ var Ue = f(EdgeWrapper), selector$a = (e) => ({
|
|
|
3959
4007
|
onError: e.onError
|
|
3960
4008
|
});
|
|
3961
4009
|
function EdgeRendererComponent({ 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 }) {
|
|
3962
|
-
let { edgesFocusable: g, edgesReconnectable: _, elementsSelectable: v, onError: y } = useStore(selector$
|
|
4010
|
+
let { edgesFocusable: g, edgesReconnectable: _, elementsSelectable: v, onError: y } = useStore(selector$9, shallow$1), b = useVisibleEdgeIds(t);
|
|
3963
4011
|
return S("div", {
|
|
3964
4012
|
className: "react-flow__edges",
|
|
3965
|
-
children: [x(
|
|
4013
|
+
children: [x(je, {
|
|
3966
4014
|
defaultColor: e,
|
|
3967
4015
|
rfId: n
|
|
3968
|
-
}), b.map((e) => x(
|
|
4016
|
+
}), b.map((e) => x(Ke, {
|
|
3969
4017
|
id: e,
|
|
3970
4018
|
edgesFocusable: g,
|
|
3971
4019
|
edgesReconnectable: _,
|
|
@@ -3989,11 +4037,19 @@ function EdgeRendererComponent({ defaultMarkerColor: e, onlyRenderVisibleElement
|
|
|
3989
4037
|
});
|
|
3990
4038
|
}
|
|
3991
4039
|
EdgeRendererComponent.displayName = "EdgeRenderer";
|
|
3992
|
-
var
|
|
4040
|
+
var qe = f(EdgeRendererComponent), toTransformString = (e) => `translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;
|
|
3993
4041
|
function Viewport({ children: e }) {
|
|
3994
|
-
|
|
4042
|
+
let t = useStoreApi(), n = v(null), [r] = y(() => t.getState().transform);
|
|
4043
|
+
return ge(() => {
|
|
4044
|
+
let e = null, applyTransform = () => {
|
|
4045
|
+
let r = t.getState().transform;
|
|
4046
|
+
e && r[0] === e[0] && r[1] === e[1] && r[2] === e[2] || (e = r, n.current && (n.current.style.transform = toTransformString(r)));
|
|
4047
|
+
};
|
|
4048
|
+
return applyTransform(), t.subscribe(applyTransform);
|
|
4049
|
+
}, [t]), x("div", {
|
|
4050
|
+
ref: n,
|
|
3995
4051
|
className: "react-flow__viewport xyflow__viewport react-flow__container",
|
|
3996
|
-
style: { transform:
|
|
4052
|
+
style: { transform: toTransformString(r) },
|
|
3997
4053
|
children: e
|
|
3998
4054
|
});
|
|
3999
4055
|
}
|
|
@@ -4108,15 +4164,15 @@ var ConnectionLine = ({ style: e, type: t = N.Bezier, CustomComponent: n, isVali
|
|
|
4108
4164
|
});
|
|
4109
4165
|
};
|
|
4110
4166
|
ConnectionLine.displayName = "ConnectionLine";
|
|
4111
|
-
var
|
|
4112
|
-
function useNodeOrEdgeTypesWarning(e =
|
|
4167
|
+
var Je = {};
|
|
4168
|
+
function useNodeOrEdgeTypesWarning(e = Je) {
|
|
4113
4169
|
v(e), useStoreApi(), h(() => {}, [e]);
|
|
4114
4170
|
}
|
|
4115
4171
|
function useStylesLoadedWarning() {
|
|
4116
4172
|
useStoreApi(), v(!1), h(() => {}, []);
|
|
4117
4173
|
}
|
|
4118
|
-
function GraphViewComponent({ 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: g, connectionLineContainerStyle: _, selectionKeyCode: v, selectionOnDrag: y, selectionMode: b, 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: z, zoomOnDoubleClick: B, panOnDrag: V, autoPanOnSelection: H, onPaneClick: U, onPaneMouseEnter: W, onPaneMouseMove: G, onPaneMouseLeave: K, onPaneScroll: q, onPaneContextMenu: J, paneClickDistance: ee, nodeClickDistance: Y, onEdgeContextMenu: te, onEdgeMouseEnter: X, onEdgeMouseMove: ne, onEdgeMouseLeave: re, reconnectRadius: ie, onReconnect: ae, onReconnectStart: oe, onReconnectEnd: se, noDragClassName: ce, noWheelClassName: Z, noPanClassName: le, disableKeyboardA11y: ue, nodeExtent: de, rfId: fe, viewport: pe, onViewportChange: me }) {
|
|
4119
|
-
return useNodeOrEdgeTypesWarning(e), useNodeOrEdgeTypesWarning(t), useStylesLoadedWarning(), useOnInitHandler(n), useViewportSync(pe), x(
|
|
4174
|
+
function GraphViewComponent({ 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: g, connectionLineContainerStyle: _, selectionKeyCode: v, selectionOnDrag: y, selectionMode: b, 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: z, zoomOnDoubleClick: B, panOnDrag: V, autoPanOnSelection: H, onPaneClick: U, onPaneMouseEnter: W, onPaneMouseMove: G, onPaneMouseLeave: K, onPaneScroll: q, onPaneContextMenu: J, paneClickDistance: ee, nodeClickDistance: Y, onEdgeContextMenu: te, onEdgeMouseEnter: X, onEdgeMouseMove: ne, onEdgeMouseLeave: re, reconnectRadius: ie, onReconnect: ae, onReconnectStart: oe, onReconnectEnd: se, noDragClassName: ce, noWheelClassName: Z, noPanClassName: le, disableKeyboardA11y: ue, nodeExtent: de, rfId: fe, viewport: pe, onViewportChange: me, nodesDraggable: he }) {
|
|
4175
|
+
return useNodeOrEdgeTypesWarning(e), useNodeOrEdgeTypesWarning(t), useStylesLoadedWarning(), useOnInitHandler(n), useViewportSync(pe), x(De, {
|
|
4120
4176
|
onPaneClick: U,
|
|
4121
4177
|
onPaneMouseEnter: W,
|
|
4122
4178
|
onPaneMouseMove: G,
|
|
@@ -4155,7 +4211,7 @@ function GraphViewComponent({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick
|
|
|
4155
4211
|
onViewportChange: me,
|
|
4156
4212
|
isControlledViewport: !!pe,
|
|
4157
4213
|
children: S(Viewport, { children: [
|
|
4158
|
-
x(
|
|
4214
|
+
x(qe, {
|
|
4159
4215
|
edgeTypes: t,
|
|
4160
4216
|
onEdgeClick: i,
|
|
4161
4217
|
onEdgeDoubleClick: o,
|
|
@@ -4180,7 +4236,7 @@ function GraphViewComponent({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick
|
|
|
4180
4236
|
containerStyle: _
|
|
4181
4237
|
}),
|
|
4182
4238
|
x("div", { className: "react-flow__edgelabel-renderer" }),
|
|
4183
|
-
x(
|
|
4239
|
+
x(ke, {
|
|
4184
4240
|
nodeTypes: e,
|
|
4185
4241
|
onNodeClick: r,
|
|
4186
4242
|
onNodeDoubleClick: a,
|
|
@@ -4194,14 +4250,15 @@ function GraphViewComponent({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick
|
|
|
4194
4250
|
noDragClassName: ce,
|
|
4195
4251
|
disableKeyboardA11y: ue,
|
|
4196
4252
|
nodeExtent: de,
|
|
4197
|
-
rfId: fe
|
|
4253
|
+
rfId: fe,
|
|
4254
|
+
nodesDraggable: he
|
|
4198
4255
|
}),
|
|
4199
4256
|
x("div", { className: "react-flow__viewport-portal" })
|
|
4200
4257
|
] })
|
|
4201
4258
|
});
|
|
4202
4259
|
}
|
|
4203
4260
|
GraphViewComponent.displayName = "GraphView";
|
|
4204
|
-
var
|
|
4261
|
+
var Ye = f(GraphViewComponent), Xe = createDevWarn("React Flow", "https://reactflow.dev/"), getInitialState = ({ 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" } = {}) => {
|
|
4205
4262
|
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 ?? E;
|
|
4206
4263
|
updateConnectionLookup(h, g, _);
|
|
4207
4264
|
let { nodesInitialized: x } = adoptUserNodes(v, p, m, {
|
|
@@ -4214,7 +4271,7 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
|
|
|
4214
4271
|
1
|
|
4215
4272
|
];
|
|
4216
4273
|
if (o && i && a) {
|
|
4217
|
-
let { x: e, y: t, zoom: n } = getViewportForBounds(getInternalNodesBounds(p, { filter: (e) =>
|
|
4274
|
+
let { x: e, y: t, zoom: n } = getViewportForBounds(getInternalNodesBounds(p, { filter: (e) => !(!e.width && !e.initialWidth || !e.height && !e.initialHeight) }), i, a, c, l, s?.padding ?? .1);
|
|
4218
4275
|
S = [
|
|
4219
4276
|
e,
|
|
4220
4277
|
t,
|
|
@@ -4276,15 +4333,37 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
|
|
|
4276
4333
|
autoPanOnNodeFocus: !0,
|
|
4277
4334
|
autoPanSpeed: 15,
|
|
4278
4335
|
connectionRadius: 20,
|
|
4279
|
-
onError:
|
|
4336
|
+
onError: Xe,
|
|
4280
4337
|
isValidConnection: void 0,
|
|
4281
4338
|
onSelectionChangeHandlers: [],
|
|
4282
4339
|
lib: "react",
|
|
4283
4340
|
debug: !1,
|
|
4284
4341
|
ariaLabelConfig: O,
|
|
4285
4342
|
zIndexMode: f,
|
|
4343
|
+
defaultEdgeOptions: void 0,
|
|
4286
4344
|
onNodesChangeMiddlewareMap: /* @__PURE__ */ new Map(),
|
|
4287
|
-
onEdgesChangeMiddlewareMap: /* @__PURE__ */ new Map()
|
|
4345
|
+
onEdgesChangeMiddlewareMap: /* @__PURE__ */ new Map(),
|
|
4346
|
+
onNodesDelete: void 0,
|
|
4347
|
+
onEdgesDelete: void 0,
|
|
4348
|
+
onDelete: void 0,
|
|
4349
|
+
onBeforeDelete: void 0,
|
|
4350
|
+
onViewportChangeStart: void 0,
|
|
4351
|
+
onViewportChange: void 0,
|
|
4352
|
+
onViewportChangeEnd: void 0,
|
|
4353
|
+
onNodeDragStart: void 0,
|
|
4354
|
+
onNodeDrag: void 0,
|
|
4355
|
+
onNodeDragStop: void 0,
|
|
4356
|
+
onSelectionDragStart: void 0,
|
|
4357
|
+
onSelectionDrag: void 0,
|
|
4358
|
+
onSelectionDragStop: void 0,
|
|
4359
|
+
onMoveStart: void 0,
|
|
4360
|
+
onMove: void 0,
|
|
4361
|
+
onMoveEnd: void 0,
|
|
4362
|
+
onConnect: void 0,
|
|
4363
|
+
onConnectStart: void 0,
|
|
4364
|
+
onConnectEnd: void 0,
|
|
4365
|
+
onClickConnectStart: void 0,
|
|
4366
|
+
onClickConnectEnd: void 0
|
|
4288
4367
|
};
|
|
4289
4368
|
}, createStore = ({ 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 }) => createWithEqualityFn((p, m) => {
|
|
4290
4369
|
async function resolveFitView() {
|
|
@@ -4315,23 +4394,23 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
|
|
|
4315
4394
|
zIndexMode: f
|
|
4316
4395
|
}),
|
|
4317
4396
|
setNodes: (e) => {
|
|
4318
|
-
let { nodeLookup: t, parentLookup: n, nodeOrigin: r,
|
|
4397
|
+
let { nodeLookup: t, parentLookup: n, nodeOrigin: r, nodeExtent: i, elevateNodesOnSelect: a, fitViewQueued: o, zIndexMode: s, nodesSelectionActive: c } = m(), { nodesInitialized: l, hasSelectedNodes: u } = adoptUserNodes(e, t, n, {
|
|
4319
4398
|
nodeOrigin: r,
|
|
4320
|
-
nodeExtent:
|
|
4321
|
-
elevateNodesOnSelect:
|
|
4399
|
+
nodeExtent: i,
|
|
4400
|
+
elevateNodesOnSelect: a,
|
|
4322
4401
|
checkEquality: !0,
|
|
4323
|
-
zIndexMode:
|
|
4324
|
-
}),
|
|
4325
|
-
|
|
4402
|
+
zIndexMode: s
|
|
4403
|
+
}), d = c && u;
|
|
4404
|
+
o && l ? (resolveFitView(), p({
|
|
4326
4405
|
nodes: e,
|
|
4327
|
-
nodesInitialized:
|
|
4406
|
+
nodesInitialized: l,
|
|
4328
4407
|
fitViewQueued: !1,
|
|
4329
4408
|
fitViewOptions: void 0,
|
|
4330
|
-
nodesSelectionActive:
|
|
4409
|
+
nodesSelectionActive: d
|
|
4331
4410
|
})) : p({
|
|
4332
4411
|
nodes: e,
|
|
4333
|
-
nodesInitialized:
|
|
4334
|
-
nodesSelectionActive:
|
|
4412
|
+
nodesInitialized: l,
|
|
4413
|
+
nodesSelectionActive: d
|
|
4335
4414
|
});
|
|
4336
4415
|
},
|
|
4337
4416
|
setEdges: (e) => {
|
|
@@ -4449,7 +4528,7 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
|
|
|
4449
4528
|
},
|
|
4450
4529
|
setNodeExtent: (e) => {
|
|
4451
4530
|
let { nodes: t, nodeLookup: n, parentLookup: r, nodeOrigin: i, elevateNodesOnSelect: a, nodeExtent: o, zIndexMode: s } = m();
|
|
4452
|
-
e[0][0]
|
|
4531
|
+
(e[0][0] !== o[0][0] || e[0][1] !== o[0][1] || e[1][0] !== o[1][0] || e[1][1] !== o[1][1]) && (adoptUserNodes(t, n, r, {
|
|
4453
4532
|
nodeOrigin: i,
|
|
4454
4533
|
nodeExtent: e,
|
|
4455
4534
|
elevateNodesOnSelect: a,
|
|
@@ -4509,7 +4588,7 @@ function ReactFlowProvider({ initialNodes: e, initialEdges: t, defaultNodes: n,
|
|
|
4509
4588
|
}));
|
|
4510
4589
|
return x(ne, {
|
|
4511
4590
|
value: m,
|
|
4512
|
-
children: x(BatchProvider, { children: p })
|
|
4591
|
+
children: x(BatchProvider, { children: x(HandleConfigProvider, { children: p }) })
|
|
4513
4592
|
});
|
|
4514
4593
|
}
|
|
4515
4594
|
function Wrapper({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i, width: a, height: o, fitView: s, fitViewOptions: c, minZoom: l, maxZoom: u, nodeOrigin: d, nodeExtent: f, zIndexMode: p }) {
|
|
@@ -4530,14 +4609,14 @@ function Wrapper({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdge
|
|
|
4530
4609
|
children: e
|
|
4531
4610
|
});
|
|
4532
4611
|
}
|
|
4533
|
-
var
|
|
4612
|
+
var Ze = {
|
|
4534
4613
|
width: "100%",
|
|
4535
4614
|
height: "100%",
|
|
4536
4615
|
overflow: "hidden",
|
|
4537
4616
|
position: "relative",
|
|
4538
4617
|
zIndex: 0
|
|
4539
4618
|
};
|
|
4540
|
-
function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: a, edgeTypes: o, onNodeClick: s, onEdgeClick: c, onInit: l, onMove: u, onMoveStart: d, onMoveEnd: f, onConnect: m, onConnectStart: h, onConnectEnd: g, onClickConnectStart: _, onClickConnectEnd: v, onNodeMouseEnter: y, onNodeMouseMove: b, onNodeMouseLeave: C, onNodeContextMenu: w, onNodeDoubleClick: T, onNodeDragStart: D, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: M, onEdgesDelete: P, onDelete: F, onSelectionChange: I, onSelectionDragStart: L, onSelectionDrag: R, onSelectionDragStop: z, onSelectionContextMenu: B, onSelectionStart: V, onSelectionEnd: H, onBeforeDelete: U, connectionMode: W, connectionLineType: G = N.Bezier, connectionLineStyle: K, connectionLineComponent: q, connectionLineContainerStyle: J, deleteKeyCode: ee = "Backspace", selectionKeyCode: Y = "Shift", selectionOnDrag: te = !1, selectionMode: X = j.Full, panActivationKeyCode: ne = "Space", multiSelectionKeyCode: re = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode: ie = isMacOs() ? "Meta" : "Control", snapToGrid: ae, snapGrid: oe, onlyRenderVisibleElements: se = !1, selectNodesOnDrag: ce, nodesDraggable: Z, autoPanOnNodeFocus:
|
|
4619
|
+
function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: a, edgeTypes: o, onNodeClick: s, onEdgeClick: c, onInit: l, onMove: u, onMoveStart: d, onMoveEnd: f, onConnect: m, onConnectStart: h, onConnectEnd: g, onClickConnectStart: _, onClickConnectEnd: v, onNodeMouseEnter: y, onNodeMouseMove: b, onNodeMouseLeave: C, onNodeContextMenu: w, onNodeDoubleClick: T, onNodeDragStart: D, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: M, onEdgesDelete: P, onDelete: F, onSelectionChange: I, onSelectionDragStart: L, onSelectionDrag: R, onSelectionDragStop: z, onSelectionContextMenu: B, onSelectionStart: V, onSelectionEnd: H, onBeforeDelete: U, connectionMode: W, connectionLineType: G = N.Bezier, connectionLineStyle: K, connectionLineComponent: q, connectionLineContainerStyle: J, deleteKeyCode: ee = "Backspace", selectionKeyCode: Y = "Shift", selectionOnDrag: te = !1, selectionMode: X = j.Full, panActivationKeyCode: ne = "Space", multiSelectionKeyCode: re = isMacOs() ? "Meta" : "Control", zoomActivationKeyCode: ie = isMacOs() ? "Meta" : "Control", snapToGrid: ae, snapGrid: oe, onlyRenderVisibleElements: se = !1, selectNodesOnDrag: ce, nodesDraggable: Z, autoPanOnNodeFocus: le, nodesConnectable: fe, nodesFocusable: pe, nodeOrigin: me = ue, edgesFocusable: he, edgesReconnectable: ge, elementsSelectable: _e = !0, defaultViewport: ve = de, minZoom: Q = .5, maxZoom: ye = 2, translateExtent: be = E, preventScrolling: xe = !0, nodeExtent: Se, defaultMarkerColor: Ce = "#b1b1b7", zoomOnScroll: we = !0, zoomOnPinch: Te = !0, panOnScroll: Ee = !1, panOnScrollSpeed: De = .5, panOnScrollMode: Oe = A.Free, zoomOnDoubleClick: ke = !0, panOnDrag: Ae = !0, onPaneClick: je, onPaneMouseEnter: Me, onPaneMouseMove: Ne, onPaneMouseLeave: Pe, onPaneScroll: Fe, onPaneContextMenu: Ie, paneClickDistance: Le = 1, nodeClickDistance: Re = 0, children: ze, onReconnect: Be, onReconnectStart: Ve, onReconnectEnd: He, onEdgeContextMenu: Ue, onEdgeDoubleClick: We, onEdgeMouseEnter: Ge, onEdgeMouseMove: Ke, onEdgeMouseLeave: qe, reconnectRadius: Je = 10, onNodesChange: Xe, onEdgesChange: Qe, noDragClassName: $ = "nodrag", noWheelClassName: $e = "nowheel", noPanClassName: et = "nopan", fitView: tt, fitViewOptions: nt, connectOnClick: rt, attributionPosition: it, proOptions: at, defaultEdgeOptions: ot, elevateNodesOnSelect: st = !0, elevateEdgesOnSelect: ct = !1, disableKeyboardA11y: lt = !1, autoPanOnConnect: ut, autoPanOnNodeDrag: dt, autoPanOnSelection: ft = !0, autoPanSpeed: pt, connectionRadius: mt, isValidConnection: ht, onError: gt, style: _t, id: vt, nodeDragThreshold: yt, connectionDragThreshold: bt, viewport: xt, onViewportChange: St, width: Ct, height: wt, colorMode: Tt = "light", debug: Et, onScroll: Dt, ariaLabelConfig: Ot, zIndexMode: kt = "basic", ...At }, jt) {
|
|
4541
4620
|
let Mt = vt || "1", Nt = useColorModeClass(Tt), Pt = p((e) => {
|
|
4542
4621
|
e.currentTarget.scrollTo({
|
|
4543
4622
|
top: 0,
|
|
@@ -4551,7 +4630,7 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4551
4630
|
onScroll: Pt,
|
|
4552
4631
|
style: {
|
|
4553
4632
|
..._t,
|
|
4554
|
-
...
|
|
4633
|
+
...Ze
|
|
4555
4634
|
},
|
|
4556
4635
|
ref: jt,
|
|
4557
4636
|
className: cc([
|
|
@@ -4568,8 +4647,8 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4568
4647
|
height: wt,
|
|
4569
4648
|
fitView: tt,
|
|
4570
4649
|
fitViewOptions: nt,
|
|
4571
|
-
minZoom:
|
|
4572
|
-
maxZoom:
|
|
4650
|
+
minZoom: Q,
|
|
4651
|
+
maxZoom: ye,
|
|
4573
4652
|
nodeOrigin: me,
|
|
4574
4653
|
nodeExtent: Se,
|
|
4575
4654
|
zIndexMode: kt,
|
|
@@ -4585,7 +4664,7 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4585
4664
|
onClickConnectStart: _,
|
|
4586
4665
|
onClickConnectEnd: v,
|
|
4587
4666
|
nodesDraggable: Z,
|
|
4588
|
-
autoPanOnNodeFocus:
|
|
4667
|
+
autoPanOnNodeFocus: le,
|
|
4589
4668
|
nodesConnectable: fe,
|
|
4590
4669
|
nodesFocusable: pe,
|
|
4591
4670
|
edgesFocusable: he,
|
|
@@ -4593,15 +4672,15 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4593
4672
|
elementsSelectable: _e,
|
|
4594
4673
|
elevateNodesOnSelect: st,
|
|
4595
4674
|
elevateEdgesOnSelect: ct,
|
|
4596
|
-
minZoom:
|
|
4597
|
-
maxZoom:
|
|
4675
|
+
minZoom: Q,
|
|
4676
|
+
maxZoom: ye,
|
|
4598
4677
|
nodeExtent: Se,
|
|
4599
4678
|
onNodesChange: Xe,
|
|
4600
|
-
onEdgesChange:
|
|
4679
|
+
onEdgesChange: Qe,
|
|
4601
4680
|
snapToGrid: ae,
|
|
4602
4681
|
snapGrid: oe,
|
|
4603
4682
|
connectionMode: W,
|
|
4604
|
-
translateExtent:
|
|
4683
|
+
translateExtent: be,
|
|
4605
4684
|
connectOnClick: rt,
|
|
4606
4685
|
defaultEdgeOptions: ot,
|
|
4607
4686
|
fitView: tt,
|
|
@@ -4635,7 +4714,7 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4635
4714
|
ariaLabelConfig: Ot,
|
|
4636
4715
|
zIndexMode: kt
|
|
4637
4716
|
}),
|
|
4638
|
-
x(
|
|
4717
|
+
x(Ye, {
|
|
4639
4718
|
onInit: l,
|
|
4640
4719
|
onNodeClick: s,
|
|
4641
4720
|
onEdgeClick: c,
|
|
@@ -4659,9 +4738,9 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4659
4738
|
zoomActivationKeyCode: ie,
|
|
4660
4739
|
onlyRenderVisibleElements: se,
|
|
4661
4740
|
defaultViewport: ve,
|
|
4662
|
-
translateExtent:
|
|
4663
|
-
minZoom:
|
|
4664
|
-
maxZoom:
|
|
4741
|
+
translateExtent: be,
|
|
4742
|
+
minZoom: Q,
|
|
4743
|
+
maxZoom: ye,
|
|
4665
4744
|
preventScrolling: xe,
|
|
4666
4745
|
zoomOnScroll: we,
|
|
4667
4746
|
zoomOnPinch: Te,
|
|
@@ -4688,18 +4767,19 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4688
4767
|
onEdgeContextMenu: Ue,
|
|
4689
4768
|
onEdgeDoubleClick: We,
|
|
4690
4769
|
onEdgeMouseEnter: Ge,
|
|
4691
|
-
onEdgeMouseMove:
|
|
4692
|
-
onEdgeMouseLeave:
|
|
4693
|
-
reconnectRadius:
|
|
4770
|
+
onEdgeMouseMove: Ke,
|
|
4771
|
+
onEdgeMouseLeave: qe,
|
|
4772
|
+
reconnectRadius: Je,
|
|
4694
4773
|
defaultMarkerColor: Ce,
|
|
4695
|
-
noDragClassName:
|
|
4774
|
+
noDragClassName: $,
|
|
4696
4775
|
noWheelClassName: $e,
|
|
4697
4776
|
noPanClassName: et,
|
|
4698
4777
|
rfId: Mt,
|
|
4699
4778
|
disableKeyboardA11y: lt,
|
|
4700
4779
|
nodeExtent: Se,
|
|
4701
4780
|
viewport: xt,
|
|
4702
|
-
onViewportChange: St
|
|
4781
|
+
onViewportChange: St,
|
|
4782
|
+
nodesDraggable: Z
|
|
4703
4783
|
}),
|
|
4704
4784
|
x(SelectionListener, { onSelectionChange: I }),
|
|
4705
4785
|
ze,
|
|
@@ -4715,7 +4795,7 @@ function ReactFlow({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, class
|
|
|
4715
4795
|
})
|
|
4716
4796
|
});
|
|
4717
4797
|
}
|
|
4718
|
-
var
|
|
4798
|
+
var Qe = fixedForwardRef(ReactFlow), selector$6 = (e) => e.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
4719
4799
|
function EdgeLabelRenderer({ children: e }) {
|
|
4720
4800
|
let t = useStore(selector$6);
|
|
4721
4801
|
return t ? w(e, t) : null;
|
|
@@ -4767,7 +4847,7 @@ var $;
|
|
|
4767
4847
|
(function(e) {
|
|
4768
4848
|
e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
|
|
4769
4849
|
})($ ||= {});
|
|
4770
|
-
var
|
|
4850
|
+
var $e = {
|
|
4771
4851
|
[$.Dots]: 1,
|
|
4772
4852
|
[$.Lines]: 1,
|
|
4773
4853
|
[$.Cross]: 6
|
|
@@ -4776,12 +4856,12 @@ var Xe = {
|
|
|
4776
4856
|
patternId: `pattern-${e.rfId}`
|
|
4777
4857
|
});
|
|
4778
4858
|
function BackgroundComponent({ id: e, variant: t = $.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
|
|
4779
|
-
let d = v(null), { transform: f, patternId: p } = useStore(selector$3, shallow$1), m = r ||
|
|
4859
|
+
let d = v(null), { transform: f, patternId: p } = useStore(selector$3, shallow$1), m = r || $e[t], h = t === $.Dots, g = t === $.Cross, _ = Array.isArray(n) ? n : [n, n], y = [_[0] * f[2] || 1, _[1] * f[2] || 1], b = m * f[2], C = Array.isArray(a) ? a : [a, a], w = g ? [b, b] : y, T = [C[0] * f[2] + w[0] / 2, C[1] * f[2] + w[1] / 2], E = `${p}${e || ""}`;
|
|
4780
4860
|
return S("svg", {
|
|
4781
4861
|
className: cc(["react-flow__background", l]),
|
|
4782
4862
|
style: {
|
|
4783
4863
|
...c,
|
|
4784
|
-
...
|
|
4864
|
+
...Q,
|
|
4785
4865
|
"--xy-background-color-props": s,
|
|
4786
4866
|
"--xy-background-pattern-color-props": o
|
|
4787
4867
|
},
|
|
@@ -4814,7 +4894,7 @@ function BackgroundComponent({ id: e, variant: t = $.Dots, gap: n = 20, size: r,
|
|
|
4814
4894
|
});
|
|
4815
4895
|
}
|
|
4816
4896
|
BackgroundComponent.displayName = "Background";
|
|
4817
|
-
var
|
|
4897
|
+
var et = f(BackgroundComponent);
|
|
4818
4898
|
function PlusIcon() {
|
|
4819
4899
|
return x("svg", {
|
|
4820
4900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4923,7 +5003,7 @@ function ControlsComponent({ style: e, showZoom: t = !0, showFitView: n = !0, sh
|
|
|
4923
5003
|
});
|
|
4924
5004
|
}
|
|
4925
5005
|
ControlsComponent.displayName = "Controls";
|
|
4926
|
-
var
|
|
5006
|
+
var tt = f(ControlsComponent);
|
|
4927
5007
|
function MiniMapNodeComponent({ 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 }) {
|
|
4928
5008
|
let { background: m, backgroundColor: h } = a || {}, g = o || m || h;
|
|
4929
5009
|
return x("rect", {
|
|
@@ -4947,10 +5027,10 @@ function MiniMapNodeComponent({ id: e, x: t, y: n, width: r, height: i, style: a
|
|
|
4947
5027
|
onClick: p ? (t) => p(t, e) : void 0
|
|
4948
5028
|
});
|
|
4949
5029
|
}
|
|
4950
|
-
var
|
|
4951
|
-
function MiniMapNodes({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a =
|
|
5030
|
+
var nt = f(MiniMapNodeComponent), selectorNodeIds = (e) => e.nodes.map((e) => e.id), getAttrFunction = (e) => e instanceof Function ? e : () => e;
|
|
5031
|
+
function MiniMapNodes({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = nt, onClick: o }) {
|
|
4952
5032
|
let s = useStore(selectorNodeIds, shallow$1), c = getAttrFunction(t), l = getAttrFunction(e), u = getAttrFunction(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
|
|
4953
|
-
return x(b, { children: s.map((e) => x(
|
|
5033
|
+
return x(b, { children: s.map((e) => x(rt, {
|
|
4954
5034
|
id: e,
|
|
4955
5035
|
nodeColorFunc: c,
|
|
4956
5036
|
nodeStrokeColorFunc: l,
|
|
@@ -4998,16 +5078,20 @@ function NodeComponentWrapperInner({ id: e, nodeColorFunc: t, nodeStrokeColorFun
|
|
|
4998
5078
|
id: l.id
|
|
4999
5079
|
});
|
|
5000
5080
|
}
|
|
5001
|
-
var
|
|
5081
|
+
var rt = f(NodeComponentWrapperInner), it = f(MiniMapNodes), at = 200, ot = 150, filterHidden = (e) => !e.hidden, selector$1 = (e) => {
|
|
5002
5082
|
let t = {
|
|
5003
5083
|
x: -e.transform[0] / e.transform[2],
|
|
5004
5084
|
y: -e.transform[1] / e.transform[2],
|
|
5005
5085
|
width: e.width / e.transform[2],
|
|
5006
5086
|
height: e.height / e.transform[2]
|
|
5007
|
-
};
|
|
5087
|
+
}, n = !1;
|
|
5088
|
+
for (let t of e.nodeLookup.values()) if (!t.hidden) {
|
|
5089
|
+
n = !0;
|
|
5090
|
+
break;
|
|
5091
|
+
}
|
|
5008
5092
|
return {
|
|
5009
5093
|
viewBB: t,
|
|
5010
|
-
boundingRect:
|
|
5094
|
+
boundingRect: n ? getBoundsOfRects(getInternalNodesBounds(e.nodeLookup, { filter: filterHidden }), t) : t,
|
|
5011
5095
|
rfId: e.rfId,
|
|
5012
5096
|
panZoom: e.panZoom,
|
|
5013
5097
|
translateExtent: e.translateExtent,
|
|
@@ -5015,19 +5099,20 @@ var et = f(NodeComponentWrapperInner), tt = f(MiniMapNodes), nt = 200, rt = 150,
|
|
|
5015
5099
|
flowHeight: e.height,
|
|
5016
5100
|
ariaLabelConfig: e.ariaLabelConfig
|
|
5017
5101
|
};
|
|
5018
|
-
},
|
|
5102
|
+
}, rectEqual = (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height, areEqual = (e, t) => rectEqual(e.viewBB, t.viewBB) && rectEqual(e.boundingRect, t.boundingRect) && e.rfId === t.rfId && e.panZoom === t.panZoom && e.translateExtent === t.translateExtent && e.flowWidth === t.flowWidth && e.flowHeight === t.flowHeight && e.ariaLabelConfig === t.ariaLabelConfig, st = "react-flow__minimap-desc";
|
|
5019
5103
|
function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: a = 5, nodeStrokeWidth: o, nodeComponent: s, bgColor: c, maskColor: l, maskStrokeColor: u, maskStrokeWidth: d, position: f = "bottom-right", onClick: m, onNodeClick: g, pannable: _ = !1, zoomable: y = !1, ariaLabel: b, inversePan: C, zoomStep: w = 1, offsetScale: T = 5 }) {
|
|
5020
|
-
let E = useStoreApi(), D = v(null), { boundingRect: O,
|
|
5104
|
+
let E = useStoreApi(), D = v(null), { boundingRect: O, panZoom: k, viewBB: A, rfId: j, translateExtent: M, flowWidth: N, flowHeight: P, ariaLabelConfig: F } = useStore(selector$1, areEqual), I = e?.width ?? at, L = e?.height ?? ot, R = O.width / I, z = O.height / L, B = Math.max(R, z), V = B * I, H = B * L, U = T * B, W = O.x - (V - O.width) / 2 - U, G = O.y - (H - O.height) / 2 - U, K = V + U * 2, q = H + U * 2, J = `${st}-${j}`, ee = v(0), Y = v();
|
|
5021
5105
|
ee.current = B, h(() => {
|
|
5022
|
-
|
|
5106
|
+
let e = E.getState().panZoom;
|
|
5107
|
+
if (D.current && e) return Y.current = XYMinimap({
|
|
5023
5108
|
domNode: D.current,
|
|
5024
|
-
panZoom:
|
|
5109
|
+
panZoom: e,
|
|
5025
5110
|
getTransform: () => E.getState().transform,
|
|
5026
5111
|
getViewScale: () => ee.current
|
|
5027
5112
|
}), () => {
|
|
5028
5113
|
Y.current?.destroy();
|
|
5029
5114
|
};
|
|
5030
|
-
}, [
|
|
5115
|
+
}, [k]), h(() => {
|
|
5031
5116
|
Y.current?.update({
|
|
5032
5117
|
translateExtent: M,
|
|
5033
5118
|
width: N,
|
|
@@ -5052,10 +5137,10 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
|
|
|
5052
5137
|
x: t,
|
|
5053
5138
|
y: n
|
|
5054
5139
|
});
|
|
5055
|
-
} : void 0, X =
|
|
5140
|
+
} : void 0, X = p((e, t) => {
|
|
5056
5141
|
let n = E.getState().nodeLookup.get(t).internals.userNode;
|
|
5057
|
-
g(e, n);
|
|
5058
|
-
}, []) : void 0,
|
|
5142
|
+
g?.(e, n);
|
|
5143
|
+
}, [g]), ne = g ? X : void 0, re = b ?? F["minimap.ariaLabel"];
|
|
5059
5144
|
return x(Z, {
|
|
5060
5145
|
position: f,
|
|
5061
5146
|
style: {
|
|
@@ -5080,12 +5165,12 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
|
|
|
5080
5165
|
ref: D,
|
|
5081
5166
|
onClick: te,
|
|
5082
5167
|
children: [
|
|
5083
|
-
|
|
5168
|
+
re && x("title", {
|
|
5084
5169
|
id: J,
|
|
5085
|
-
children:
|
|
5170
|
+
children: re
|
|
5086
5171
|
}),
|
|
5087
|
-
x(
|
|
5088
|
-
onClick:
|
|
5172
|
+
x(it, {
|
|
5173
|
+
onClick: ne,
|
|
5089
5174
|
nodeColor: r,
|
|
5090
5175
|
nodeStrokeColor: n,
|
|
5091
5176
|
nodeBorderRadius: a,
|
|
@@ -5096,7 +5181,7 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
|
|
|
5096
5181
|
x("path", {
|
|
5097
5182
|
className: "react-flow__minimap-mask",
|
|
5098
5183
|
d: `M${W - U},${G - U}h${K + U * 2}v${q + U * 2}h${-K - U * 2}z
|
|
5099
|
-
M${
|
|
5184
|
+
M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,
|
|
5100
5185
|
fillRule: "evenodd",
|
|
5101
5186
|
pointerEvents: "none"
|
|
5102
5187
|
})
|
|
@@ -5105,14 +5190,14 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
|
|
|
5105
5190
|
});
|
|
5106
5191
|
}
|
|
5107
5192
|
MiniMapComponent.displayName = "MiniMap", f(MiniMapComponent);
|
|
5108
|
-
var scaleSelector = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0,
|
|
5193
|
+
var scaleSelector = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, ct = {
|
|
5109
5194
|
[K.Line]: "right",
|
|
5110
5195
|
[K.Handle]: "bottom-right"
|
|
5111
5196
|
};
|
|
5112
5197
|
function ResizeControl({ nodeId: e, position: t, variant: n = K.Handle, className: r, style: i = void 0, children: a, color: o, minWidth: s = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: u = Number.MAX_VALUE, keepAspectRatio: d = !1, resizeDirection: f, autoScale: m = !0, shouldResize: g, onResizeStart: _, onResize: y, onResizeEnd: b }) {
|
|
5113
|
-
let S = useNodeId(), C = typeof e == "string" ? e : S, w = useStoreApi(), T = v(null), E = n === K.Handle, D = useStore(p(scaleSelector(E && m), [E, m]), shallow$1), O = v(null), k = t ??
|
|
5114
|
-
|
|
5115
|
-
if (
|
|
5198
|
+
let S = useNodeId(), C = typeof e == "string" ? e : S, w = useStoreApi(), T = v(null), E = n === K.Handle, D = useStore(p(scaleSelector(E && m), [E, m]), shallow$1), O = v(null), k = t ?? ct[n];
|
|
5199
|
+
h(() => {
|
|
5200
|
+
if (T.current && C) return O.current ||= XYResizer({
|
|
5116
5201
|
domNode: T.current,
|
|
5117
5202
|
nodeId: C,
|
|
5118
5203
|
getStoreItems: () => {
|
|
@@ -5219,11 +5304,13 @@ function ResizeControl({ nodeId: e, position: t, variant: n = K.Handle, classNam
|
|
|
5219
5304
|
y,
|
|
5220
5305
|
b,
|
|
5221
5306
|
g
|
|
5222
|
-
])
|
|
5307
|
+
]);
|
|
5308
|
+
let A = k.split("-");
|
|
5309
|
+
return x("div", {
|
|
5223
5310
|
className: cc([
|
|
5224
5311
|
"react-flow__resize-control",
|
|
5225
5312
|
"nodrag",
|
|
5226
|
-
...
|
|
5313
|
+
...A,
|
|
5227
5314
|
n,
|
|
5228
5315
|
r
|
|
5229
5316
|
]),
|
|
@@ -5258,18 +5345,18 @@ function NodeToolbar({ nodeId: e, children: t, className: n, style: r, isVisible
|
|
|
5258
5345
|
return r && e.set(r.id, r), e;
|
|
5259
5346
|
}, /* @__PURE__ */ new Map()), [e, l]), nodesEqualityFn), { x: d, y: f, zoom: m, selectedNodesCount: h } = useStore(storeSelector, shallow$1);
|
|
5260
5347
|
if (!(typeof i == "boolean" ? i : u.size === 1 && u.values().next().value?.selected && h === 1) || !u.size) return null;
|
|
5261
|
-
let g = getInternalNodesBounds(u), _ = Array.from(u.values()), v = Math.max(..._.map((e) => e.internals.z + 1))
|
|
5348
|
+
let g = getInternalNodesBounds(u), _ = Array.from(u.values()), v = Math.max(..._.map((e) => e.internals.z + 1)), y = {
|
|
5349
|
+
position: "absolute",
|
|
5350
|
+
transform: getNodeToolbarTransform(g, {
|
|
5351
|
+
x: d,
|
|
5352
|
+
y: f,
|
|
5353
|
+
zoom: m
|
|
5354
|
+
}, a, o, s),
|
|
5355
|
+
zIndex: v,
|
|
5356
|
+
...r
|
|
5357
|
+
};
|
|
5262
5358
|
return x(NodeToolbarPortal, { children: x("div", {
|
|
5263
|
-
style:
|
|
5264
|
-
position: "absolute",
|
|
5265
|
-
transform: getNodeToolbarTransform(g, {
|
|
5266
|
-
x: d,
|
|
5267
|
-
y: f,
|
|
5268
|
-
zoom: m
|
|
5269
|
-
}, a, o, s),
|
|
5270
|
-
zIndex: v,
|
|
5271
|
-
...r
|
|
5272
|
-
},
|
|
5359
|
+
style: y,
|
|
5273
5360
|
className: cc(["react-flow__node-toolbar", n]),
|
|
5274
5361
|
...c,
|
|
5275
5362
|
"data-id": _.reduce((e, t) => `${e}${t.id} `, "").trim(),
|
|
@@ -5277,4 +5364,4 @@ function NodeToolbar({ nodeId: e, children: t, className: n, style: r, isVisible
|
|
|
5277
5364
|
}) });
|
|
5278
5365
|
}
|
|
5279
5366
|
//#endregion
|
|
5280
|
-
export { getViewportForBounds as C, getSmoothStepPath as S, nodeToRect as T, F as _,
|
|
5367
|
+
export { getViewportForBounds as C, getSmoothStepPath as S, nodeToRect as T, F as _, Ce as a, getNodeDimensions as b, ReactFlowProvider as c, applyNodeChanges as d, Qe as f, useStoreApi as g, useStore as h, EdgeLabelRenderer as i, ViewportPortal as l, useReactFlow as m, $ as n, NodeToolbar as o, useNodesData as p, tt as r, Z as s, et as t, applyEdgeChanges as u, getBezierPath as v, isMacOs as w, getNodesBounds as x, getEdgePosition as y };
|