@xyflow/react 12.10.1 → 12.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.css +1 -0
- package/dist/esm/components/Handle/index.d.ts.map +1 -1
- package/dist/esm/container/FlowRenderer/index.d.ts +1 -1
- package/dist/esm/container/FlowRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/GraphView/index.d.ts +1 -1
- package/dist/esm/container/GraphView/index.d.ts.map +1 -1
- package/dist/esm/container/Pane/index.d.ts +2 -2
- package/dist/esm/container/Pane/index.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/esm/hooks/useNodeConnections.d.ts +1 -14
- package/dist/esm/hooks/useNodeConnections.d.ts.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +134 -58
- package/dist/esm/index.mjs +134 -58
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/initialState.d.ts.map +1 -1
- package/dist/esm/types/component-props.d.ts +6 -0
- package/dist/esm/types/component-props.d.ts.map +1 -1
- package/dist/esm/types/general.d.ts +3 -2
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/types/nodes.d.ts +3 -3
- package/dist/esm/types/nodes.d.ts.map +1 -1
- package/dist/esm/utils/edges.d.ts +4 -0
- package/dist/esm/utils/edges.d.ts.map +1 -0
- package/dist/esm/utils/general.d.ts +2 -2
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/style.css +1 -0
- package/dist/umd/components/Handle/index.d.ts.map +1 -1
- package/dist/umd/container/FlowRenderer/index.d.ts +1 -1
- package/dist/umd/container/FlowRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/GraphView/index.d.ts +1 -1
- package/dist/umd/container/GraphView/index.d.ts.map +1 -1
- package/dist/umd/container/Pane/index.d.ts +2 -2
- package/dist/umd/container/Pane/index.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/umd/hooks/useNodeConnections.d.ts +1 -14
- package/dist/umd/hooks/useNodeConnections.d.ts.map +1 -1
- package/dist/umd/index.d.ts +3 -2
- package/dist/umd/index.d.ts.map +1 -1
- package/dist/umd/index.js +4 -4
- package/dist/umd/store/index.d.ts.map +1 -1
- package/dist/umd/store/initialState.d.ts.map +1 -1
- package/dist/umd/types/component-props.d.ts +6 -0
- package/dist/umd/types/component-props.d.ts.map +1 -1
- package/dist/umd/types/general.d.ts +3 -2
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/types/nodes.d.ts +3 -3
- package/dist/umd/types/nodes.d.ts.map +1 -1
- package/dist/umd/utils/edges.d.ts +4 -0
- package/dist/umd/utils/edges.d.ts.map +1 -0
- package/dist/umd/utils/general.d.ts +2 -2
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/dist/umd/utils/index.d.ts +1 -0
- package/dist/umd/utils/index.d.ts.map +1 -1
- package/package.json +14 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';
|
|
4
4
|
import cc from 'classcat';
|
|
5
|
-
import { errorMessages,
|
|
6
|
-
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode,
|
|
5
|
+
import { errorMessages, infiniteExtent, mergeAriaLabelConfig, isInputDOMNode, rendererPointToPoint, pointToRendererPoint, getViewportForBounds, createDevWarn, addEdge as addEdge$1, reconnectEdge as reconnectEdge$1, isNodeBase, isEdgeBase, withResolvers, getNodesBounds, isRectObject, getOverlappingArea, nodeToRect, getElementsToRemove, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, calcAutoPan, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, getHostForElement, XYHandle, isMouseEvent, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, defaultAriaLabelConfig, initialConnection, panBy, getHandlePosition, handleExpandParent, updateNodeInternals, updateAbsolutePositions, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform, getEdgeToolbarTransform } from '@xyflow/system';
|
|
6
|
+
export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from '@xyflow/system';
|
|
7
7
|
import { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';
|
|
8
8
|
import { shallow } from 'zustand/shallow';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
@@ -11,7 +11,7 @@ import { createPortal } from 'react-dom';
|
|
|
11
11
|
const StoreContext = createContext(null);
|
|
12
12
|
const Provider$1 = StoreContext.Provider;
|
|
13
13
|
|
|
14
|
-
const zustandErrorMessage = errorMessages['error001']();
|
|
14
|
+
const zustandErrorMessage = errorMessages['error001']('react');
|
|
15
15
|
/**
|
|
16
16
|
* This hook can be used to subscribe to internal state changes of the React Flow
|
|
17
17
|
* component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand)
|
|
@@ -500,30 +500,30 @@ const useViewportHelper = () => {
|
|
|
500
500
|
const store = useStoreApi();
|
|
501
501
|
return useMemo(() => {
|
|
502
502
|
return {
|
|
503
|
-
zoomIn: (options) => {
|
|
503
|
+
zoomIn: async (options) => {
|
|
504
504
|
const { panZoom } = store.getState();
|
|
505
|
-
return panZoom ? panZoom.scaleBy(1.2,
|
|
505
|
+
return panZoom ? panZoom.scaleBy(1.2, options) : false;
|
|
506
506
|
},
|
|
507
|
-
zoomOut: (options) => {
|
|
507
|
+
zoomOut: async (options) => {
|
|
508
508
|
const { panZoom } = store.getState();
|
|
509
|
-
return panZoom ? panZoom.scaleBy(1 / 1.2,
|
|
509
|
+
return panZoom ? panZoom.scaleBy(1 / 1.2, options) : false;
|
|
510
510
|
},
|
|
511
|
-
zoomTo: (zoomLevel, options) => {
|
|
511
|
+
zoomTo: async (zoomLevel, options) => {
|
|
512
512
|
const { panZoom } = store.getState();
|
|
513
|
-
return panZoom ? panZoom.scaleTo(zoomLevel,
|
|
513
|
+
return panZoom ? panZoom.scaleTo(zoomLevel, options) : false;
|
|
514
514
|
},
|
|
515
515
|
getZoom: () => store.getState().transform[2],
|
|
516
516
|
setViewport: async (viewport, options) => {
|
|
517
517
|
const { transform: [tX, tY, tZoom], panZoom, } = store.getState();
|
|
518
518
|
if (!panZoom) {
|
|
519
|
-
return
|
|
519
|
+
return false;
|
|
520
520
|
}
|
|
521
521
|
await panZoom.setViewport({
|
|
522
522
|
x: viewport.x ?? tX,
|
|
523
523
|
y: viewport.y ?? tY,
|
|
524
524
|
zoom: viewport.zoom ?? tZoom,
|
|
525
525
|
}, options);
|
|
526
|
-
return
|
|
526
|
+
return true;
|
|
527
527
|
},
|
|
528
528
|
getViewport: () => {
|
|
529
529
|
const [x, y, zoom] = store.getState().transform;
|
|
@@ -536,14 +536,14 @@ const useViewportHelper = () => {
|
|
|
536
536
|
const { width, height, minZoom, maxZoom, panZoom } = store.getState();
|
|
537
537
|
const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);
|
|
538
538
|
if (!panZoom) {
|
|
539
|
-
return
|
|
539
|
+
return false;
|
|
540
540
|
}
|
|
541
541
|
await panZoom.setViewport(viewport, {
|
|
542
542
|
duration: options?.duration,
|
|
543
543
|
ease: options?.ease,
|
|
544
544
|
interpolate: options?.interpolate,
|
|
545
545
|
});
|
|
546
|
-
return
|
|
546
|
+
return true;
|
|
547
547
|
},
|
|
548
548
|
screenToFlowPosition: (clientPosition, options = {}) => {
|
|
549
549
|
const { transform, snapGrid, snapToGrid, domNode } = store.getState();
|
|
@@ -818,6 +818,20 @@ function elementToRemoveChange(item) {
|
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
+
const defaultOnError = createDevWarn('React Flow', 'https://reactflow.dev/');
|
|
822
|
+
function addEdge(edgeParams, edges, options = {}) {
|
|
823
|
+
return addEdge$1(edgeParams, edges, {
|
|
824
|
+
...options,
|
|
825
|
+
onError: options.onError ?? defaultOnError,
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
function reconnectEdge(oldEdge, newConnection, edges, options = { shouldReplaceId: true }) {
|
|
829
|
+
return reconnectEdge$1(oldEdge, newConnection, edges, {
|
|
830
|
+
...options,
|
|
831
|
+
onError: options.onError ?? defaultOnError,
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
|
|
821
835
|
/**
|
|
822
836
|
* Test whether an object is usable as an [`Node`](/api-reference/types/node).
|
|
823
837
|
* In TypeScript this is a type guard that will narrow the type of whatever you pass in to
|
|
@@ -1403,10 +1417,13 @@ const selector$h = (s) => ({
|
|
|
1403
1417
|
elementsSelectable: s.elementsSelectable,
|
|
1404
1418
|
connectionInProgress: s.connection.inProgress,
|
|
1405
1419
|
dragging: s.paneDragging,
|
|
1420
|
+
panBy: s.panBy,
|
|
1421
|
+
autoPanSpeed: s.autoPanSpeed,
|
|
1406
1422
|
});
|
|
1407
|
-
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, paneClickDistance, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {
|
|
1423
|
+
function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, autoPanOnSelection, paneClickDistance, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {
|
|
1424
|
+
const autoPanId = useRef(0);
|
|
1408
1425
|
const store = useStoreApi();
|
|
1409
|
-
const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow);
|
|
1426
|
+
const { userSelectionActive, elementsSelectable, dragging, connectionInProgress, panBy, autoPanSpeed } = useStore(selector$h, shallow);
|
|
1410
1427
|
const isSelectionEnabled = elementsSelectable && (isSelecting || userSelectionActive);
|
|
1411
1428
|
const container = useRef(null);
|
|
1412
1429
|
const containerBounds = useRef();
|
|
@@ -1414,6 +1431,9 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1414
1431
|
const selectedEdgeIds = useRef(new Set());
|
|
1415
1432
|
// Used to prevent click events when the user lets go of the selectionKey during a selection
|
|
1416
1433
|
const selectionInProgress = useRef(false);
|
|
1434
|
+
// Used for auto pan when approaching the edges of the container during selection
|
|
1435
|
+
const position = useRef({ x: 0, y: 0 });
|
|
1436
|
+
const autoPanStarted = useRef(false);
|
|
1417
1437
|
const onClick = (event) => {
|
|
1418
1438
|
// We prevent click events when the user let go of the selectionKey during a selection
|
|
1419
1439
|
// We also prevent click events when a connection is in progress
|
|
@@ -1442,7 +1462,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1442
1462
|
// We are using capture here in order to prevent other pointer events
|
|
1443
1463
|
// to be able to create a selection above a node or an edge
|
|
1444
1464
|
const onPointerDownCapture = (event) => {
|
|
1445
|
-
const { domNode } = store.getState();
|
|
1465
|
+
const { domNode, transform } = store.getState();
|
|
1446
1466
|
containerBounds.current = domNode?.getBoundingClientRect();
|
|
1447
1467
|
if (!containerBounds.current)
|
|
1448
1468
|
return;
|
|
@@ -1456,12 +1476,13 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1456
1476
|
event.target?.setPointerCapture?.(event.pointerId);
|
|
1457
1477
|
selectionInProgress.current = false;
|
|
1458
1478
|
const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);
|
|
1479
|
+
const userSelectionStartPosition = pointToRendererPoint({ x, y }, transform);
|
|
1459
1480
|
store.setState({
|
|
1460
1481
|
userSelectionRect: {
|
|
1461
1482
|
width: 0,
|
|
1462
1483
|
height: 0,
|
|
1463
|
-
startX: x,
|
|
1464
|
-
startY: y,
|
|
1484
|
+
startX: userSelectionStartPosition.x,
|
|
1485
|
+
startY: userSelectionStartPosition.y,
|
|
1465
1486
|
x,
|
|
1466
1487
|
y,
|
|
1467
1488
|
},
|
|
@@ -1471,30 +1492,25 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1471
1492
|
event.preventDefault();
|
|
1472
1493
|
}
|
|
1473
1494
|
};
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1495
|
+
// We commit the user selection rectangle to the store on auto-panning or pointer move during selection.
|
|
1496
|
+
function commitUserSelectionRect(mouseX, mouseY) {
|
|
1497
|
+
const { userSelectionRect } = store.getState();
|
|
1498
|
+
if (!userSelectionRect) {
|
|
1477
1499
|
return;
|
|
1478
1500
|
}
|
|
1479
|
-
const {
|
|
1480
|
-
const { startX, startY }
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
return;
|
|
1486
|
-
}
|
|
1487
|
-
resetSelectedElements();
|
|
1488
|
-
onSelectionStart?.(event);
|
|
1489
|
-
}
|
|
1490
|
-
selectionInProgress.current = true;
|
|
1501
|
+
const { transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, } = store.getState();
|
|
1502
|
+
const userStartPosition = { x: userSelectionRect.startX, y: userSelectionRect.startY };
|
|
1503
|
+
const { x: screenStartX, y: screenStartY } = rendererPointToPoint(userStartPosition, transform);
|
|
1504
|
+
// This has to be in screen coordinates, not in flow coordinates.
|
|
1505
|
+
// We store the selection rectangle in userSelectionStartPosition coordinates to be able to
|
|
1506
|
+
// fix the start position of the selection rectangle when we are auto-panning.
|
|
1491
1507
|
const nextUserSelectRect = {
|
|
1492
|
-
startX,
|
|
1493
|
-
startY,
|
|
1494
|
-
x: mouseX <
|
|
1495
|
-
y: mouseY <
|
|
1496
|
-
width: Math.abs(mouseX -
|
|
1497
|
-
height: Math.abs(mouseY -
|
|
1508
|
+
startX: userStartPosition.x,
|
|
1509
|
+
startY: userStartPosition.y,
|
|
1510
|
+
x: mouseX < screenStartX ? mouseX : screenStartX,
|
|
1511
|
+
y: mouseY < screenStartY ? mouseY : screenStartY,
|
|
1512
|
+
width: Math.abs(mouseX - screenStartX),
|
|
1513
|
+
height: Math.abs(mouseY - screenStartY),
|
|
1498
1514
|
};
|
|
1499
1515
|
const prevSelectedNodeIds = selectedNodeIds.current;
|
|
1500
1516
|
const prevSelectedEdgeIds = selectedEdgeIds.current;
|
|
@@ -1526,6 +1542,53 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1526
1542
|
userSelectionActive: true,
|
|
1527
1543
|
nodesSelectionActive: false,
|
|
1528
1544
|
});
|
|
1545
|
+
}
|
|
1546
|
+
function autoPan() {
|
|
1547
|
+
if (!autoPanOnSelection || !containerBounds.current) {
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
const [x, y] = calcAutoPan(position.current, containerBounds.current, autoPanSpeed);
|
|
1551
|
+
panBy({ x, y }).then((panned) => {
|
|
1552
|
+
if (!selectionInProgress.current || !panned) {
|
|
1553
|
+
autoPanId.current = requestAnimationFrame(autoPan);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
const { x: mx, y: my } = position.current;
|
|
1557
|
+
commitUserSelectionRect(mx, my);
|
|
1558
|
+
autoPanId.current = requestAnimationFrame(autoPan);
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
const cleanupAutoPan = () => {
|
|
1562
|
+
cancelAnimationFrame(autoPanId.current);
|
|
1563
|
+
autoPanId.current = 0;
|
|
1564
|
+
autoPanStarted.current = false;
|
|
1565
|
+
};
|
|
1566
|
+
useEffect(() => {
|
|
1567
|
+
return () => cleanupAutoPan();
|
|
1568
|
+
}, []);
|
|
1569
|
+
const onPointerMove = (event) => {
|
|
1570
|
+
const { userSelectionRect, transform, resetSelectedElements } = store.getState();
|
|
1571
|
+
if (!containerBounds.current || !userSelectionRect) {
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current);
|
|
1575
|
+
position.current = { x: mouseX, y: mouseY };
|
|
1576
|
+
const screenStart = rendererPointToPoint({ x: userSelectionRect.startX, y: userSelectionRect.startY }, transform);
|
|
1577
|
+
if (!selectionInProgress.current) {
|
|
1578
|
+
const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance;
|
|
1579
|
+
const distance = Math.hypot(mouseX - screenStart.x, mouseY - screenStart.y);
|
|
1580
|
+
if (distance <= requiredDistance) {
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
resetSelectedElements();
|
|
1584
|
+
onSelectionStart?.(event);
|
|
1585
|
+
}
|
|
1586
|
+
selectionInProgress.current = true;
|
|
1587
|
+
if (!autoPanStarted.current) {
|
|
1588
|
+
autoPan();
|
|
1589
|
+
autoPanStarted.current = true;
|
|
1590
|
+
}
|
|
1591
|
+
commitUserSelectionRect(mouseX, mouseY);
|
|
1529
1592
|
};
|
|
1530
1593
|
const onPointerUp = (event) => {
|
|
1531
1594
|
if (event.button !== 0) {
|
|
@@ -1549,9 +1612,14 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1549
1612
|
nodesSelectionActive: selectedNodeIds.current.size > 0,
|
|
1550
1613
|
});
|
|
1551
1614
|
}
|
|
1615
|
+
cleanupAutoPan();
|
|
1616
|
+
};
|
|
1617
|
+
const onPointerCancel = (event) => {
|
|
1618
|
+
event.target?.releasePointerCapture?.(event.pointerId);
|
|
1619
|
+
cleanupAutoPan();
|
|
1552
1620
|
};
|
|
1553
1621
|
const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));
|
|
1554
|
-
return (jsxs("div", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: isSelectionEnabled ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: isSelectionEnabled ? undefined : onPaneMouseEnter, onPointerMove: isSelectionEnabled ? onPointerMove : onPaneMouseMove, onPointerUp: isSelectionEnabled ? onPointerUp : undefined, onPointerDownCapture: isSelectionEnabled ? onPointerDownCapture : undefined, onClickCapture: isSelectionEnabled ? onClickCapture : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));
|
|
1622
|
+
return (jsxs("div", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: isSelectionEnabled ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: isSelectionEnabled ? undefined : onPaneMouseEnter, onPointerMove: isSelectionEnabled ? onPointerMove : onPaneMouseMove, onPointerUp: isSelectionEnabled ? onPointerUp : undefined, onPointerCancel: isSelectionEnabled ? onPointerCancel : undefined, onPointerDownCapture: isSelectionEnabled ? onPointerDownCapture : undefined, onClickCapture: isSelectionEnabled ? onClickCapture : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));
|
|
1555
1623
|
}
|
|
1556
1624
|
|
|
1557
1625
|
/*
|
|
@@ -1746,8 +1814,8 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1746
1814
|
...params,
|
|
1747
1815
|
};
|
|
1748
1816
|
if (hasDefaultEdges) {
|
|
1749
|
-
const { edges, setEdges } = store.getState();
|
|
1750
|
-
setEdges(addEdge(edgeParams, edges));
|
|
1817
|
+
const { edges, setEdges, onError } = store.getState();
|
|
1818
|
+
setEdges(addEdge(edgeParams, edges, { onError }));
|
|
1751
1819
|
}
|
|
1752
1820
|
onConnectAction?.(edgeParams);
|
|
1753
1821
|
onConnect?.(edgeParams);
|
|
@@ -1981,7 +2049,7 @@ const win = typeof window !== 'undefined' ? window : undefined;
|
|
|
1981
2049
|
const selector$e = (s) => {
|
|
1982
2050
|
return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };
|
|
1983
2051
|
};
|
|
1984
|
-
function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) {
|
|
2052
|
+
function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, autoPanOnSelection, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) {
|
|
1985
2053
|
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e, shallow);
|
|
1986
2054
|
const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });
|
|
1987
2055
|
const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });
|
|
@@ -1990,7 +2058,7 @@ function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPane
|
|
|
1990
2058
|
const _selectionOnDrag = selectionOnDrag && panOnDrag !== true;
|
|
1991
2059
|
const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;
|
|
1992
2060
|
useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });
|
|
1993
|
-
return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) }));
|
|
2061
|
+
return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) }));
|
|
1994
2062
|
}
|
|
1995
2063
|
FlowRendererComponent.displayName = 'FlowRenderer';
|
|
1996
2064
|
const FlowRenderer = memo(FlowRendererComponent);
|
|
@@ -3113,17 +3181,18 @@ function useStylesLoadedWarning() {
|
|
|
3113
3181
|
}, []);
|
|
3114
3182
|
}
|
|
3115
3183
|
|
|
3116
|
-
function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) {
|
|
3184
|
+
function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, autoPanOnSelection, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) {
|
|
3117
3185
|
useNodeOrEdgeTypesWarning(nodeTypes);
|
|
3118
3186
|
useNodeOrEdgeTypesWarning(edgeTypes);
|
|
3119
3187
|
useStylesLoadedWarning();
|
|
3120
3188
|
useOnInitHandler(onInit);
|
|
3121
3189
|
useViewportSync(viewport);
|
|
3122
|
-
return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx("div", { className: "react-flow__edgelabel-renderer" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx("div", { className: "react-flow__viewport-portal" })] }) }));
|
|
3190
|
+
return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx("div", { className: "react-flow__edgelabel-renderer" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx("div", { className: "react-flow__viewport-portal" })] }) }));
|
|
3123
3191
|
}
|
|
3124
3192
|
GraphViewComponent.displayName = 'GraphView';
|
|
3125
3193
|
const GraphView = memo(GraphViewComponent);
|
|
3126
3194
|
|
|
3195
|
+
const devWarn = createDevWarn('React Flow', 'https://reactflow.dev/');
|
|
3127
3196
|
const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, zIndexMode = 'basic', } = {}) => {
|
|
3128
3197
|
const nodeLookup = new Map();
|
|
3129
3198
|
const parentLookup = new Map();
|
|
@@ -3134,7 +3203,7 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
3134
3203
|
const storeNodeOrigin = nodeOrigin ?? [0, 0];
|
|
3135
3204
|
const storeNodeExtent = nodeExtent ?? infiniteExtent;
|
|
3136
3205
|
updateConnectionLookup(connectionLookup, edgeLookup, storeEdges);
|
|
3137
|
-
const nodesInitialized = adoptUserNodes(storeNodes, nodeLookup, parentLookup, {
|
|
3206
|
+
const { nodesInitialized } = adoptUserNodes(storeNodes, nodeLookup, parentLookup, {
|
|
3138
3207
|
nodeOrigin: storeNodeOrigin,
|
|
3139
3208
|
nodeExtent: storeNodeExtent,
|
|
3140
3209
|
zIndexMode,
|
|
@@ -3252,7 +3321,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3252
3321
|
zIndexMode,
|
|
3253
3322
|
}),
|
|
3254
3323
|
setNodes: (nodes) => {
|
|
3255
|
-
const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued, zIndexMode } = get();
|
|
3324
|
+
const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued, zIndexMode, nodesSelectionActive, } = get();
|
|
3256
3325
|
/*
|
|
3257
3326
|
* setNodes() is called exclusively in response to user actions:
|
|
3258
3327
|
* - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,
|
|
@@ -3261,19 +3330,26 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3261
3330
|
* When this happens, we take the note objects passed by the user and extend them with fields
|
|
3262
3331
|
* relevant for internal React Flow operations.
|
|
3263
3332
|
*/
|
|
3264
|
-
const nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
3333
|
+
const { nodesInitialized, hasSelectedNodes } = adoptUserNodes(nodes, nodeLookup, parentLookup, {
|
|
3265
3334
|
nodeOrigin,
|
|
3266
3335
|
nodeExtent,
|
|
3267
3336
|
elevateNodesOnSelect,
|
|
3268
3337
|
checkEquality: true,
|
|
3269
3338
|
zIndexMode,
|
|
3270
3339
|
});
|
|
3340
|
+
const nextNodesSelectionActive = nodesSelectionActive && hasSelectedNodes;
|
|
3271
3341
|
if (fitViewQueued && nodesInitialized) {
|
|
3272
3342
|
resolveFitView();
|
|
3273
|
-
set({
|
|
3343
|
+
set({
|
|
3344
|
+
nodes,
|
|
3345
|
+
nodesInitialized,
|
|
3346
|
+
fitViewQueued: false,
|
|
3347
|
+
fitViewOptions: undefined,
|
|
3348
|
+
nodesSelectionActive: nextNodesSelectionActive
|
|
3349
|
+
});
|
|
3274
3350
|
}
|
|
3275
3351
|
else {
|
|
3276
|
-
set({ nodes, nodesInitialized });
|
|
3352
|
+
set({ nodes, nodesInitialized, nodesSelectionActive: nextNodesSelectionActive });
|
|
3277
3353
|
}
|
|
3278
3354
|
},
|
|
3279
3355
|
setEdges: (edges) => {
|
|
@@ -3294,7 +3370,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3294
3370
|
}
|
|
3295
3371
|
},
|
|
3296
3372
|
/*
|
|
3297
|
-
* Every node gets
|
|
3373
|
+
* Every node gets registered at a ResizeObserver. Whenever a node
|
|
3298
3374
|
* changes its dimensions, this function is called to measure the
|
|
3299
3375
|
* new dimensions and update the nodes.
|
|
3300
3376
|
*/
|
|
@@ -3489,7 +3565,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3489
3565
|
setCenter: async (x, y, options) => {
|
|
3490
3566
|
const { width, height, maxZoom, panZoom } = get();
|
|
3491
3567
|
if (!panZoom) {
|
|
3492
|
-
return
|
|
3568
|
+
return false;
|
|
3493
3569
|
}
|
|
3494
3570
|
const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom;
|
|
3495
3571
|
await panZoom.setViewport({
|
|
@@ -3497,7 +3573,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3497
3573
|
y: height / 2 - y * nextZoom,
|
|
3498
3574
|
zoom: nextZoom,
|
|
3499
3575
|
}, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate });
|
|
3500
|
-
return
|
|
3576
|
+
return true;
|
|
3501
3577
|
},
|
|
3502
3578
|
cancelConnection: () => {
|
|
3503
3579
|
set({
|
|
@@ -3583,7 +3659,7 @@ const wrapperStyle = {
|
|
|
3583
3659
|
position: 'relative',
|
|
3584
3660
|
zIndex: 0,
|
|
3585
3661
|
};
|
|
3586
|
-
function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 1, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect = true, elevateEdgesOnSelect = false, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, zIndexMode = 'basic', ...rest }, ref) {
|
|
3662
|
+
function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 1, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect = true, elevateEdgesOnSelect = false, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanOnSelection = true, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, zIndexMode = 'basic', ...rest }, ref) {
|
|
3587
3663
|
const rfId = id || '1';
|
|
3588
3664
|
const colorModeClassName = useColorModeClass(colorMode);
|
|
3589
3665
|
// Undo scroll events, preventing viewport from shifting when nodes outside of it are focused
|
|
@@ -3591,7 +3667,7 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
3591
3667
|
e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
|
3592
3668
|
onScroll?.(e);
|
|
3593
3669
|
}, [onScroll]);
|
|
3594
|
-
return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: "application", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: [jsx(
|
|
3670
|
+
return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: "application", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: [jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, connectionDragThreshold: connectionDragThreshold, onBeforeDelete: onBeforeDelete, debug: debug, ariaLabelConfig: ariaLabelConfig, zIndexMode: zIndexMode }), jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, autoPanOnSelection: autoPanOnSelection, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
|
|
3595
3671
|
}
|
|
3596
3672
|
/**
|
|
3597
3673
|
* The `<ReactFlow />` component is the heart of your React Flow application.
|
|
@@ -4102,7 +4178,7 @@ function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) {
|
|
|
4102
4178
|
const prevConnections = useRef(null);
|
|
4103
4179
|
const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual);
|
|
4104
4180
|
useEffect(() => {
|
|
4105
|
-
// @todo
|
|
4181
|
+
// @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts
|
|
4106
4182
|
if (prevConnections.current && prevConnections.current !== connections) {
|
|
4107
4183
|
const _connections = connections ?? new Map();
|
|
4108
4184
|
handleConnectionChange(prevConnections.current, _connections, onDisconnect);
|
|
@@ -4972,4 +5048,4 @@ function EdgeToolbar({ edgeId, x, y, children, className, style, isVisible, alig
|
|
|
4972
5048
|
}, className: cc(['react-flow__edge-toolbar', className]), "data-id": edge?.id ?? '', ...rest, children: children }) }));
|
|
4973
5049
|
}
|
|
4974
5050
|
|
|
4975
|
-
export { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, EdgeToolbar, Handle, MiniMap, MiniMapNode, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, experimental_useOnEdgesChangeMiddleware, experimental_useOnNodesChangeMiddleware, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };
|
|
5051
|
+
export { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, EdgeToolbar, Handle, MiniMap, MiniMapNode, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, addEdge, applyEdgeChanges, applyNodeChanges, experimental_useOnEdgesChangeMiddleware, experimental_useOnNodesChangeMiddleware, getSimpleBezierPath, isEdge, isNode, reconnectEdge, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAIhB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,cAAc,EAAE,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAIhB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,cAAc,EAAE,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW,GAAI,6IAclB;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,0GA8Yc,CAAC;AAEhB,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EAEhB,UAAU,EACX,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EAEhB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAgB,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzF,QAAA,MAAM,eAAe,GAAI,8IActB;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CACpB,KAAG,cA8GR,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -580,6 +580,12 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
580
580
|
* @default true
|
|
581
581
|
*/
|
|
582
582
|
autoPanOnConnect?: boolean;
|
|
583
|
+
/**
|
|
584
|
+
* When `true`, the viewport will pan automatically when the cursor moves to the edge of the
|
|
585
|
+
* viewport while creating a selection box.
|
|
586
|
+
* @default true
|
|
587
|
+
*/
|
|
588
|
+
autoPanOnSelection?: boolean;
|
|
583
589
|
/**
|
|
584
590
|
* The speed at which the viewport pans while dragging a node or a selection box.
|
|
585
591
|
* @default 15
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,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CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAA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,CAAC;IAC3B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, OnBeforeDeleteBase, Connection, NodeChange, EdgeChange } from '@xyflow/system';
|
|
2
|
+
import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, OnBeforeDeleteBase, Connection, NodeChange, EdgeChange, SnapGrid } from '@xyflow/system';
|
|
3
3
|
import type { Node, Edge, ReactFlowInstance, EdgeProps, NodeProps } from '.';
|
|
4
4
|
/**
|
|
5
5
|
* This type can be used to type the `onNodesChange` function with a custom node type.
|
|
@@ -156,7 +156,8 @@ export type ViewportHelperFunctions = {
|
|
|
156
156
|
* const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
|
|
157
157
|
*/
|
|
158
158
|
screenToFlowPosition: (clientPosition: XYPosition, options?: {
|
|
159
|
-
snapToGrid
|
|
159
|
+
snapToGrid?: boolean;
|
|
160
|
+
snapGrid?: SnapGrid;
|
|
160
161
|
}) => XYPosition;
|
|
161
162
|
/**
|
|
162
163
|
* Translate a position inside the flow's canvas to a screen pixel position.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG;;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AAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;;OAUG;IACH,oBAAoB,EAAE,CACpB,cAAc,EAAE,UAAU,EAC1B,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KACpD,UAAU,CAAC;IAChB;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,YAAY,EAAE,UAAU,KAAK,UAAU,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CACzG,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC"}
|
|
@@ -33,7 +33,7 @@ export type Node<NodeData extends Record<string, unknown> = Record<string, unkno
|
|
|
33
33
|
export type InternalNode<NodeType extends Node = Node> = InternalNodeBase<NodeType>;
|
|
34
34
|
export type NodeMouseHandler<NodeType extends Node = Node> = (event: ReactMouseEvent, node: NodeType) => void;
|
|
35
35
|
export type SelectionDragHandler<NodeType extends Node = Node> = (event: ReactMouseEvent, nodes: NodeType[]) => void;
|
|
36
|
-
export type OnNodeDrag<NodeType extends Node = Node> = (event:
|
|
36
|
+
export type OnNodeDrag<NodeType extends Node = Node> = (event: MouseEvent | TouchEvent, node: NodeType, nodes: NodeType[]) => void;
|
|
37
37
|
export type NodeWrapperProps<NodeType extends Node> = {
|
|
38
38
|
id: string;
|
|
39
39
|
nodesConnectable: boolean;
|
|
@@ -58,7 +58,7 @@ export type NodeWrapperProps<NodeType extends Node> = {
|
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* The `BuiltInNode` type represents the built-in node types that are available in React Flow.
|
|
61
|
-
* You can use this type to extend your custom node type if you still want
|
|
61
|
+
* You can use this type to extend your custom node type if you still want to use the built-in ones.
|
|
62
62
|
*
|
|
63
63
|
* @public
|
|
64
64
|
* @example
|
|
@@ -69,7 +69,7 @@ export type NodeWrapperProps<NodeType extends Node> = {
|
|
|
69
69
|
*/
|
|
70
70
|
export type BuiltInNode = Node<{
|
|
71
71
|
label: string;
|
|
72
|
-
}, 'input' | 'output' | 'default'> | Node<Record<string, never>, 'group'>;
|
|
72
|
+
}, 'input' | 'output' | 'default' | undefined> | Node<Record<string, never>, 'group'>;
|
|
73
73
|
/**
|
|
74
74
|
* When you implement a [custom node](/learn/customization/custom-nodes) it is
|
|
75
75
|
* wrapped in a component that enables basic functionality like selection and
|