@xyflow/react 12.0.4 → 12.1.1
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 +8 -8
- package/dist/esm/additional-components/Background/Background.d.ts.map +1 -1
- package/dist/esm/additional-components/Background/types.d.ts +1 -1
- package/dist/esm/additional-components/Background/types.d.ts.map +1 -1
- package/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
- package/dist/esm/components/Handle/index.d.ts.map +1 -1
- package/dist/esm/container/Pane/index.d.ts.map +1 -1
- package/dist/esm/hooks/useConnection.d.ts +1 -1
- package/dist/esm/hooks/useConnection.d.ts.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +84 -63
- package/dist/esm/index.mjs +84 -63
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/types/edges.d.ts +2 -2
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/types/store.d.ts +4 -2
- package/dist/esm/types/store.d.ts.map +1 -1
- package/dist/style.css +8 -8
- package/dist/umd/additional-components/Background/Background.d.ts.map +1 -1
- package/dist/umd/additional-components/Background/types.d.ts +1 -1
- package/dist/umd/additional-components/Background/types.d.ts.map +1 -1
- package/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
- package/dist/umd/components/Handle/index.d.ts.map +1 -1
- package/dist/umd/container/Pane/index.d.ts.map +1 -1
- package/dist/umd/hooks/useConnection.d.ts +1 -1
- package/dist/umd/hooks/useConnection.d.ts.map +1 -1
- package/dist/umd/index.d.ts +3 -1
- package/dist/umd/index.d.ts.map +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/store/index.d.ts.map +1 -1
- package/dist/umd/types/edges.d.ts +2 -2
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/types/store.d.ts +4 -2
- package/dist/umd/types/store.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -58,18 +58,18 @@ const ariaLiveStyle = {
|
|
|
58
58
|
const ARIA_NODE_DESC_KEY = 'react-flow__node-desc';
|
|
59
59
|
const ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc';
|
|
60
60
|
const ARIA_LIVE_MESSAGE = 'react-flow__aria-live';
|
|
61
|
-
const selector$
|
|
61
|
+
const selector$o = (s) => s.ariaLiveMessage;
|
|
62
62
|
function AriaLiveMessage({ rfId }) {
|
|
63
|
-
const ariaLiveMessage = useStore(selector$
|
|
63
|
+
const ariaLiveMessage = useStore(selector$o);
|
|
64
64
|
return (jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage }));
|
|
65
65
|
}
|
|
66
66
|
function A11yDescriptions({ rfId, disableKeyboardA11y }) {
|
|
67
67
|
return (jsxs(Fragment, { children: [jsxs("div", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: ["Press enter or space to select a node.", !disableKeyboardA11y && 'You can then use the arrow keys to move the node around.', " Press delete to remove it and escape to cancel.", ' '] }), jsx("div", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel." }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] }));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const selector$
|
|
70
|
+
const selector$n = (s) => (s.userSelectionActive ? 'none' : 'all');
|
|
71
71
|
function Panel({ position = 'top-left', children, className, style, ...rest }) {
|
|
72
|
-
const pointerEvents = useStore(selector$
|
|
72
|
+
const pointerEvents = useStore(selector$n);
|
|
73
73
|
const positionClasses = `${position}`.split('-');
|
|
74
74
|
return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ...rest, children: children }));
|
|
75
75
|
}
|
|
@@ -81,7 +81,7 @@ function Attribution({ proOptions, position = 'bottom-right' }) {
|
|
|
81
81
|
return (jsx(Panel, { position: position, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) }));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
const selector$
|
|
84
|
+
const selector$m = (s) => {
|
|
85
85
|
const selectedNodes = [];
|
|
86
86
|
const selectedEdges = [];
|
|
87
87
|
for (const [, node] of s.nodeLookup) {
|
|
@@ -103,7 +103,7 @@ function areEqual(a, b) {
|
|
|
103
103
|
}
|
|
104
104
|
function SelectionListenerInner({ onSelectionChange }) {
|
|
105
105
|
const store = useStoreApi();
|
|
106
|
-
const { selectedNodes, selectedEdges } = useStore(selector$
|
|
106
|
+
const { selectedNodes, selectedEdges } = useStore(selector$m, areEqual);
|
|
107
107
|
useEffect(() => {
|
|
108
108
|
const params = { nodes: selectedNodes, edges: selectedEdges };
|
|
109
109
|
onSelectionChange?.(params);
|
|
@@ -188,7 +188,7 @@ const reactFlowFieldsToTrack = [
|
|
|
188
188
|
];
|
|
189
189
|
// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update
|
|
190
190
|
const fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId'];
|
|
191
|
-
const selector$
|
|
191
|
+
const selector$l = (s) => ({
|
|
192
192
|
setNodes: s.setNodes,
|
|
193
193
|
setEdges: s.setEdges,
|
|
194
194
|
setMinZoom: s.setMinZoom,
|
|
@@ -213,7 +213,7 @@ const initPrevValues = {
|
|
|
213
213
|
paneClickDistance: 0,
|
|
214
214
|
};
|
|
215
215
|
function StoreUpdater(props) {
|
|
216
|
-
const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance, } = useStore(selector$
|
|
216
|
+
const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance, } = useStore(selector$l, shallow);
|
|
217
217
|
const store = useStoreApi();
|
|
218
218
|
useEffect(() => {
|
|
219
219
|
setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges);
|
|
@@ -827,7 +827,7 @@ function useBatchContext() {
|
|
|
827
827
|
return batchContext;
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
-
const selector$
|
|
830
|
+
const selector$k = (s) => !!s.panZoom;
|
|
831
831
|
/**
|
|
832
832
|
* Hook for accessing the ReactFlow instance.
|
|
833
833
|
*
|
|
@@ -838,7 +838,7 @@ function useReactFlow() {
|
|
|
838
838
|
const viewportHelper = useViewportHelper();
|
|
839
839
|
const store = useStoreApi();
|
|
840
840
|
const batchContext = useBatchContext();
|
|
841
|
-
const viewportInitialized = useStore(selector$
|
|
841
|
+
const viewportInitialized = useStore(selector$k);
|
|
842
842
|
const generalHelper = useMemo(() => {
|
|
843
843
|
const getInternalNode = (id) => store.getState().nodeLookup.get(id);
|
|
844
844
|
const setNodes = (payload) => {
|
|
@@ -1057,14 +1057,14 @@ const containerStyle = {
|
|
|
1057
1057
|
left: 0,
|
|
1058
1058
|
};
|
|
1059
1059
|
|
|
1060
|
-
const selector$
|
|
1060
|
+
const selector$j = (s) => ({
|
|
1061
1061
|
userSelectionActive: s.userSelectionActive,
|
|
1062
1062
|
lib: s.lib,
|
|
1063
1063
|
});
|
|
1064
1064
|
function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, }) {
|
|
1065
1065
|
const store = useStoreApi();
|
|
1066
1066
|
const zoomPane = useRef(null);
|
|
1067
|
-
const { userSelectionActive, lib } = useStore(selector$
|
|
1067
|
+
const { userSelectionActive, lib } = useStore(selector$j, shallow);
|
|
1068
1068
|
const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);
|
|
1069
1069
|
const panZoom = useRef();
|
|
1070
1070
|
useResizeHandler(zoomPane);
|
|
@@ -1147,12 +1147,12 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true,
|
|
|
1147
1147
|
return (jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children }));
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
1150
|
-
const selector$
|
|
1150
|
+
const selector$i = (s) => ({
|
|
1151
1151
|
userSelectionActive: s.userSelectionActive,
|
|
1152
1152
|
userSelectionRect: s.userSelectionRect,
|
|
1153
1153
|
});
|
|
1154
1154
|
function UserSelection() {
|
|
1155
|
-
const { userSelectionActive, userSelectionRect } = useStore(selector$
|
|
1155
|
+
const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow);
|
|
1156
1156
|
const isActive = userSelectionActive && userSelectionRect;
|
|
1157
1157
|
if (!isActive) {
|
|
1158
1158
|
return null;
|
|
@@ -1172,7 +1172,7 @@ const wrapHandler = (handler, containerRef) => {
|
|
|
1172
1172
|
handler?.(event);
|
|
1173
1173
|
};
|
|
1174
1174
|
};
|
|
1175
|
-
const selector$
|
|
1175
|
+
const selector$h = (s) => ({
|
|
1176
1176
|
userSelectionActive: s.userSelectionActive,
|
|
1177
1177
|
elementsSelectable: s.elementsSelectable,
|
|
1178
1178
|
dragging: s.paneDragging,
|
|
@@ -1184,7 +1184,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1184
1184
|
const prevSelectedEdgesCount = useRef(0);
|
|
1185
1185
|
const containerBounds = useRef();
|
|
1186
1186
|
const edgeIdLookup = useRef(new Map());
|
|
1187
|
-
const { userSelectionActive, elementsSelectable, dragging } = useStore(selector$
|
|
1187
|
+
const { userSelectionActive, elementsSelectable, dragging } = useStore(selector$h, shallow);
|
|
1188
1188
|
const hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive);
|
|
1189
1189
|
// Used to prevent click events when the user lets go of the selectionKey during a selection
|
|
1190
1190
|
const selectionInProgress = useRef(false);
|
|
@@ -1311,7 +1311,8 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1311
1311
|
}
|
|
1312
1312
|
selectionStarted.current = false;
|
|
1313
1313
|
};
|
|
1314
|
-
|
|
1314
|
+
const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));
|
|
1315
|
+
return (jsxs("div", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: hasActiveSelection ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: hasActiveSelection ? undefined : onPaneMouseEnter, onPointerDown: hasActiveSelection ? onPointerDown : onPaneMouseMove, onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove, onPointerUp: hasActiveSelection ? onPointerUp : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));
|
|
1315
1316
|
}
|
|
1316
1317
|
|
|
1317
1318
|
// this handler is called by
|
|
@@ -1438,7 +1439,7 @@ const useNodeId = () => {
|
|
|
1438
1439
|
return nodeId;
|
|
1439
1440
|
};
|
|
1440
1441
|
|
|
1441
|
-
const selector$
|
|
1442
|
+
const selector$g = (s) => ({
|
|
1442
1443
|
connectOnClick: s.connectOnClick,
|
|
1443
1444
|
noPanClassName: s.noPanClassName,
|
|
1444
1445
|
rfId: s.rfId,
|
|
@@ -1463,7 +1464,7 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1463
1464
|
const isTarget = type === 'target';
|
|
1464
1465
|
const store = useStoreApi();
|
|
1465
1466
|
const nodeId = useNodeId();
|
|
1466
|
-
const { connectOnClick, noPanClassName, rfId } = useStore(selector$
|
|
1467
|
+
const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow);
|
|
1467
1468
|
const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, valid } = useStore(connectingSelector(nodeId, handleId, type), shallow);
|
|
1468
1469
|
if (!nodeId) {
|
|
1469
1470
|
store.getState().onError?.('010', errorMessages['error010']());
|
|
@@ -1520,7 +1521,7 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1520
1521
|
}
|
|
1521
1522
|
};
|
|
1522
1523
|
const onClick = (event) => {
|
|
1523
|
-
const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, } = store.getState();
|
|
1524
|
+
const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState();
|
|
1524
1525
|
if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {
|
|
1525
1526
|
return;
|
|
1526
1527
|
}
|
|
@@ -1545,11 +1546,15 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1545
1546
|
flowId,
|
|
1546
1547
|
doc,
|
|
1547
1548
|
lib,
|
|
1549
|
+
nodeLookup,
|
|
1548
1550
|
});
|
|
1549
1551
|
if (isValid && connection) {
|
|
1550
1552
|
onConnectExtended(connection);
|
|
1551
1553
|
}
|
|
1552
|
-
|
|
1554
|
+
const connectionClone = structuredClone(connectionState);
|
|
1555
|
+
delete connectionClone.inProgress;
|
|
1556
|
+
connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;
|
|
1557
|
+
onClickConnectEnd?.(event, connectionClone);
|
|
1553
1558
|
store.setState({ connectionClickStartHandle: null });
|
|
1554
1559
|
};
|
|
1555
1560
|
return (jsx("div", { "data-handleid": handleId, "data-nodeid": nodeId, "data-handlepos": position, "data-id": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([
|
|
@@ -1622,7 +1627,7 @@ function getNodeInlineStyleDimensions(node) {
|
|
|
1622
1627
|
};
|
|
1623
1628
|
}
|
|
1624
1629
|
|
|
1625
|
-
const selector$
|
|
1630
|
+
const selector$f = (s) => {
|
|
1626
1631
|
const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {
|
|
1627
1632
|
filter: (node) => !!node.selected,
|
|
1628
1633
|
});
|
|
@@ -1635,7 +1640,7 @@ const selector$g = (s) => {
|
|
|
1635
1640
|
};
|
|
1636
1641
|
function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) {
|
|
1637
1642
|
const store = useStoreApi();
|
|
1638
|
-
const { width, height, transformString, userSelectionActive } = useStore(selector$
|
|
1643
|
+
const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow);
|
|
1639
1644
|
const moveSelectedNodes = useMoveSelectedNodes();
|
|
1640
1645
|
const nodeRef = useRef(null);
|
|
1641
1646
|
useEffect(() => {
|
|
@@ -1674,11 +1679,11 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
1674
1679
|
}
|
|
1675
1680
|
|
|
1676
1681
|
const win = typeof window !== 'undefined' ? window : undefined;
|
|
1677
|
-
const selector$
|
|
1682
|
+
const selector$e = (s) => {
|
|
1678
1683
|
return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };
|
|
1679
1684
|
};
|
|
1680
1685
|
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, }) {
|
|
1681
|
-
const { nodesSelectionActive, userSelectionActive } = useStore(selector$
|
|
1686
|
+
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e);
|
|
1682
1687
|
const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });
|
|
1683
1688
|
const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });
|
|
1684
1689
|
const panOnDrag = panActivationKeyPressed || _panOnDrag;
|
|
@@ -1691,7 +1696,7 @@ function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPane
|
|
|
1691
1696
|
FlowRendererComponent.displayName = 'FlowRenderer';
|
|
1692
1697
|
const FlowRenderer = memo(FlowRendererComponent);
|
|
1693
1698
|
|
|
1694
|
-
const selector$
|
|
1699
|
+
const selector$d = (onlyRenderVisible) => (s) => {
|
|
1695
1700
|
return onlyRenderVisible
|
|
1696
1701
|
? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id)
|
|
1697
1702
|
: Array.from(s.nodeLookup.keys());
|
|
@@ -1704,13 +1709,13 @@ const selector$e = (onlyRenderVisible) => (s) => {
|
|
|
1704
1709
|
* @returns array with visible node ids
|
|
1705
1710
|
*/
|
|
1706
1711
|
function useVisibleNodeIds(onlyRenderVisible) {
|
|
1707
|
-
const nodeIds = useStore(useCallback(selector$
|
|
1712
|
+
const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow);
|
|
1708
1713
|
return nodeIds;
|
|
1709
1714
|
}
|
|
1710
1715
|
|
|
1711
|
-
const selector$
|
|
1716
|
+
const selector$c = (s) => s.updateNodeInternals;
|
|
1712
1717
|
function useResizeObserver() {
|
|
1713
|
-
const updateNodeInternals = useStore(selector$
|
|
1718
|
+
const updateNodeInternals = useStore(selector$c);
|
|
1714
1719
|
const [resizeObserver] = useState(() => {
|
|
1715
1720
|
if (typeof ResizeObserver === 'undefined') {
|
|
1716
1721
|
return null;
|
|
@@ -1911,7 +1916,7 @@ function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onC
|
|
|
1911
1916
|
}, "data-id": id, "data-testid": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: isFocusable ? 'button' : undefined, "aria-describedby": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: clampedPosition.x, positionAbsoluteY: clampedPosition.y, selected: node.selected, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) }));
|
|
1912
1917
|
}
|
|
1913
1918
|
|
|
1914
|
-
const selector$
|
|
1919
|
+
const selector$b = (s) => ({
|
|
1915
1920
|
nodesDraggable: s.nodesDraggable,
|
|
1916
1921
|
nodesConnectable: s.nodesConnectable,
|
|
1917
1922
|
nodesFocusable: s.nodesFocusable,
|
|
@@ -1919,7 +1924,7 @@ const selector$c = (s) => ({
|
|
|
1919
1924
|
onError: s.onError,
|
|
1920
1925
|
});
|
|
1921
1926
|
function NodeRendererComponent(props) {
|
|
1922
|
-
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$
|
|
1927
|
+
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow);
|
|
1923
1928
|
const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);
|
|
1924
1929
|
const resizeObserver = useResizeObserver();
|
|
1925
1930
|
return (jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => {
|
|
@@ -2251,9 +2256,9 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, targetHandl
|
|
|
2251
2256
|
const isTarget = isSourceHandle;
|
|
2252
2257
|
setReconnecting(true);
|
|
2253
2258
|
onReconnectStart?.(event, edge, handleType);
|
|
2254
|
-
const _onReconnectEnd = (evt) => {
|
|
2259
|
+
const _onReconnectEnd = (evt, connectionState) => {
|
|
2255
2260
|
setReconnecting(false);
|
|
2256
|
-
onReconnectEnd?.(evt, edge, handleType);
|
|
2261
|
+
onReconnectEnd?.(evt, edge, handleType, connectionState);
|
|
2257
2262
|
};
|
|
2258
2263
|
const onConnectEdge = (connection) => onReconnect?.(edge, connection);
|
|
2259
2264
|
XYHandle.onPointerDown(event.nativeEvent, {
|
|
@@ -2410,7 +2415,7 @@ function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectabl
|
|
|
2410
2415
|
]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: isFocusable ? 'button' : 'img', "data-id": id, "data-testid": `rf__edge-${id}`, "aria-label": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle }))] }) }));
|
|
2411
2416
|
}
|
|
2412
2417
|
|
|
2413
|
-
const selector$
|
|
2418
|
+
const selector$a = (s) => ({
|
|
2414
2419
|
width: s.width,
|
|
2415
2420
|
height: s.height,
|
|
2416
2421
|
edgesFocusable: s.edgesFocusable,
|
|
@@ -2420,7 +2425,7 @@ const selector$b = (s) => ({
|
|
|
2420
2425
|
onError: s.onError,
|
|
2421
2426
|
});
|
|
2422
2427
|
function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) {
|
|
2423
|
-
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$
|
|
2428
|
+
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow);
|
|
2424
2429
|
const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
|
|
2425
2430
|
return (jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => {
|
|
2426
2431
|
return (jsx(EdgeWrapper, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id));
|
|
@@ -2429,9 +2434,9 @@ function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements,
|
|
|
2429
2434
|
EdgeRendererComponent.displayName = 'EdgeRenderer';
|
|
2430
2435
|
const EdgeRenderer = memo(EdgeRendererComponent);
|
|
2431
2436
|
|
|
2432
|
-
const selector$
|
|
2437
|
+
const selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;
|
|
2433
2438
|
function Viewport({ children }) {
|
|
2434
|
-
const transform = useStore(selector$
|
|
2439
|
+
const transform = useStore(selector$9);
|
|
2435
2440
|
return (jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform }, children: children }));
|
|
2436
2441
|
}
|
|
2437
2442
|
|
|
@@ -2451,7 +2456,7 @@ function useOnInitHandler(onInit) {
|
|
|
2451
2456
|
}, [onInit, rfInstance.viewportInitialized]);
|
|
2452
2457
|
}
|
|
2453
2458
|
|
|
2454
|
-
const selector$
|
|
2459
|
+
const selector$8 = (state) => state.panZoom?.syncViewport;
|
|
2455
2460
|
/**
|
|
2456
2461
|
* Hook for syncing the viewport with the panzoom instance.
|
|
2457
2462
|
*
|
|
@@ -2459,7 +2464,7 @@ const selector$9 = (state) => state.panZoom?.syncViewport;
|
|
|
2459
2464
|
* @param viewport
|
|
2460
2465
|
*/
|
|
2461
2466
|
function useViewportSync(viewport) {
|
|
2462
|
-
const syncViewport = useStore(selector$
|
|
2467
|
+
const syncViewport = useStore(selector$8);
|
|
2463
2468
|
const store = useStoreApi();
|
|
2464
2469
|
useEffect(() => {
|
|
2465
2470
|
if (viewport) {
|
|
@@ -2470,19 +2475,30 @@ function useViewportSync(viewport) {
|
|
|
2470
2475
|
return null;
|
|
2471
2476
|
}
|
|
2472
2477
|
|
|
2473
|
-
|
|
2478
|
+
function storeSelector$1(s) {
|
|
2474
2479
|
return s.connection.inProgress
|
|
2475
2480
|
? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }
|
|
2476
2481
|
: { ...s.connection };
|
|
2477
|
-
}
|
|
2482
|
+
}
|
|
2483
|
+
function getSelector(connectionSelector) {
|
|
2484
|
+
if (connectionSelector) {
|
|
2485
|
+
const combinedSelector = (s) => {
|
|
2486
|
+
const connection = storeSelector$1(s);
|
|
2487
|
+
return connectionSelector(connection);
|
|
2488
|
+
};
|
|
2489
|
+
return combinedSelector;
|
|
2490
|
+
}
|
|
2491
|
+
return storeSelector$1;
|
|
2492
|
+
}
|
|
2478
2493
|
/**
|
|
2479
2494
|
* Hook for accessing the connection state.
|
|
2480
2495
|
*
|
|
2481
2496
|
* @public
|
|
2482
2497
|
* @returns ConnectionState
|
|
2483
2498
|
*/
|
|
2484
|
-
function useConnection() {
|
|
2485
|
-
|
|
2499
|
+
function useConnection(connectionSelector) {
|
|
2500
|
+
const combinedSelector = getSelector(connectionSelector);
|
|
2501
|
+
return useStore(combinedSelector, shallow);
|
|
2486
2502
|
}
|
|
2487
2503
|
|
|
2488
2504
|
const selector$7 = (s) => ({
|
|
@@ -2700,27 +2716,33 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
2700
2716
|
// Every node gets registerd at a ResizeObserver. Whenever a node
|
|
2701
2717
|
// changes its dimensions, this function is called to measure the
|
|
2702
2718
|
// new dimensions and update the nodes.
|
|
2703
|
-
updateNodeInternals: (updates) => {
|
|
2719
|
+
updateNodeInternals: (updates, params = { triggerFitView: true }) => {
|
|
2704
2720
|
const { triggerNodeChanges, nodeLookup, parentLookup, fitViewOnInit, fitViewDone, fitViewOnInitOptions, domNode, nodeOrigin, debug, fitViewSync, } = get();
|
|
2705
2721
|
const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin);
|
|
2706
2722
|
if (!updatedInternals) {
|
|
2707
2723
|
return;
|
|
2708
2724
|
}
|
|
2709
2725
|
updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin });
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2726
|
+
if (params.triggerFitView) {
|
|
2727
|
+
// we call fitView once initially after all dimensions are set
|
|
2728
|
+
let nextFitViewDone = fitViewDone;
|
|
2729
|
+
if (!fitViewDone && fitViewOnInit) {
|
|
2730
|
+
nextFitViewDone = fitViewSync({
|
|
2731
|
+
...fitViewOnInitOptions,
|
|
2732
|
+
nodes: fitViewOnInitOptions?.nodes,
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
// here we are cirmumventing the onNodesChange handler
|
|
2736
|
+
// in order to be able to display nodes even if the user
|
|
2737
|
+
// has not provided an onNodesChange handler.
|
|
2738
|
+
// Nodes are only rendered if they have a width and height
|
|
2739
|
+
// attribute which they get from this handler.
|
|
2740
|
+
set({ fitViewDone: nextFitViewDone });
|
|
2741
|
+
}
|
|
2742
|
+
else {
|
|
2743
|
+
// we always want to trigger useStore calls whenever updateNodeInternals is called
|
|
2744
|
+
set({});
|
|
2717
2745
|
}
|
|
2718
|
-
// here we are cirmumventing the onNodesChange handler
|
|
2719
|
-
// in order to be able to display nodes even if the user
|
|
2720
|
-
// has not provided an onNodesChange handler.
|
|
2721
|
-
// Nodes are only rendered if they have a width and height
|
|
2722
|
-
// attribute which they get from this handler.
|
|
2723
|
-
set({ fitViewDone: nextFitViewDone });
|
|
2724
2746
|
if (changes?.length > 0) {
|
|
2725
2747
|
if (debug) {
|
|
2726
2748
|
console.log('React Flow: trigger node changes', changes);
|
|
@@ -2980,7 +3002,7 @@ function useUpdateNodeInternals() {
|
|
|
2980
3002
|
updates.set(updateId, { id: updateId, nodeElement, force: true });
|
|
2981
3003
|
}
|
|
2982
3004
|
});
|
|
2983
|
-
requestAnimationFrame(() => updateNodeInternals(updates));
|
|
3005
|
+
requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false }));
|
|
2984
3006
|
}, []);
|
|
2985
3007
|
}
|
|
2986
3008
|
|
|
@@ -3201,7 +3223,7 @@ function BackgroundComponent({ id, variant = BackgroundVariant.Dots,
|
|
|
3201
3223
|
// only used for dots and cross
|
|
3202
3224
|
gap = 20,
|
|
3203
3225
|
// only used for lines and cross
|
|
3204
|
-
size, lineWidth = 1, offset =
|
|
3226
|
+
size, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) {
|
|
3205
3227
|
const ref = useRef(null);
|
|
3206
3228
|
const { transform, patternId } = useStore(selector$3, shallow);
|
|
3207
3229
|
const patternSize = size || defaultSize[variant];
|
|
@@ -3210,17 +3232,16 @@ size, lineWidth = 1, offset = 2, color, bgColor, style, className, patternClassN
|
|
|
3210
3232
|
const gapXY = Array.isArray(gap) ? gap : [gap, gap];
|
|
3211
3233
|
const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];
|
|
3212
3234
|
const scaledSize = patternSize * transform[2];
|
|
3235
|
+
const offsetXY = Array.isArray(offset) ? offset : [offset, offset];
|
|
3236
|
+
const scaledOffset = [offsetXY[0] * transform[2] || 1, offsetXY[1] * transform[2] || 1];
|
|
3213
3237
|
const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;
|
|
3214
|
-
const patternOffset = isDots
|
|
3215
|
-
? [scaledSize / offset, scaledSize / offset]
|
|
3216
|
-
: [patternDimensions[0] / offset, patternDimensions[1] / offset];
|
|
3217
3238
|
const _patternId = `${patternId}${id ? id : ''}`;
|
|
3218
3239
|
return (jsxs("svg", { className: cc(['react-flow__background', className]), style: {
|
|
3219
3240
|
...style,
|
|
3220
3241
|
...containerStyle,
|
|
3221
3242
|
'--xy-background-color-props': bgColor,
|
|
3222
3243
|
'--xy-background-pattern-color-props': color,
|
|
3223
|
-
}, ref: ref, "data-testid": "rf__background", children: [jsx("pattern", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${
|
|
3244
|
+
}, ref: ref, "data-testid": "rf__background", children: [jsx("pattern", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${_patternId})` })] }));
|
|
3224
3245
|
}
|
|
3225
3246
|
BackgroundComponent.displayName = 'Background';
|
|
3226
3247
|
const Background = memo(BackgroundComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAeL,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAeL,UAAU,EACX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+C,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW;;;;;;;;;2GAkVd,CAAC;AAEJ,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, HTMLAttributes, ReactNode, MouseEvent as ReactMouseEvent, ComponentType } from 'react';
|
|
2
|
-
import type { EdgeBase, BezierPathOptions, Position, SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, Connection, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError } from '@xyflow/system';
|
|
2
|
+
import type { EdgeBase, BezierPathOptions, Position, SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, Connection, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError, FinalConnectionState } from '@xyflow/system';
|
|
3
3
|
import { EdgeTypes, InternalNode, Node } from '.';
|
|
4
4
|
export type EdgeLabelOptions = {
|
|
5
5
|
label?: string | ReactNode;
|
|
@@ -46,7 +46,7 @@ export type EdgeWrapperProps<EdgeType extends Edge = Edge> = {
|
|
|
46
46
|
onMouseLeave?: EdgeMouseHandler<EdgeType>;
|
|
47
47
|
reconnectRadius?: number;
|
|
48
48
|
onReconnectStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
49
|
-
onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
49
|
+
onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
|
|
50
50
|
rfId?: string;
|
|
51
51
|
edgeTypes?: EdgeTypes;
|
|
52
52
|
onError?: OnError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],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AC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,UAAU,EAAE,QAAQ,CAAC;IACrB,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAC/E,4BAA4B,CAAC,QAAQ,CAAC,CACvC,CAAC"}
|
|
@@ -8,7 +8,7 @@ export type ReactFlowStore<NodeType extends Node = Node, EdgeType extends Edge =
|
|
|
8
8
|
nodes: NodeType[];
|
|
9
9
|
nodeLookup: NodeLookup<InternalNode<NodeType>>;
|
|
10
10
|
parentLookup: ParentLookup<InternalNode<NodeType>>;
|
|
11
|
-
edges:
|
|
11
|
+
edges: EdgeType[];
|
|
12
12
|
edgeLookup: EdgeLookup<EdgeType>;
|
|
13
13
|
connectionLookup: ConnectionLookup;
|
|
14
14
|
onNodesChange: OnNodesChange<NodeType> | null;
|
|
@@ -84,7 +84,9 @@ export type ReactFlowActions<NodeType extends Node, EdgeType extends Edge> = {
|
|
|
84
84
|
setNodes: (nodes: NodeType[]) => void;
|
|
85
85
|
setEdges: (edges: EdgeType[]) => void;
|
|
86
86
|
setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void;
|
|
87
|
-
updateNodeInternals: (updates: Map<string, InternalNodeUpdate
|
|
87
|
+
updateNodeInternals: (updates: Map<string, InternalNodeUpdate>, params?: {
|
|
88
|
+
triggerFitView: boolean;
|
|
89
|
+
}) => void;
|
|
88
90
|
updateNodePositions: UpdateNodePositions;
|
|
89
91
|
resetSelectedElements: () => void;
|
|
90
92
|
unselectNodesAndEdges: (params?: UnselectNodesAndEdgesParams) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,2BAA2B,EAC3B,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACb,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,UAAU,C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flow__pane.selection {
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
}
|
|
116
113
|
.react-flow__pane.draggable {
|
|
117
114
|
cursor: grab;
|
|
118
115
|
}
|
|
119
|
-
.react-flow__pane.
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
.react-flow__pane.dragging {
|
|
117
|
+
cursor: grabbing;
|
|
118
|
+
}
|
|
119
|
+
.react-flow__pane.selection {
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
122
|
.react-flow__viewport {
|
|
123
123
|
transform-origin: 0 0;
|
|
124
124
|
z-index: 2;
|
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));
|
|
145
145
|
fill: none;
|
|
146
146
|
}
|
|
147
|
-
.react-flow__edges {
|
|
147
|
+
.react-flow .react-flow__edges {
|
|
148
148
|
position: absolute;
|
|
149
149
|
}
|
|
150
|
-
.react-flow__edges svg {
|
|
150
|
+
.react-flow .react-flow__edges svg {
|
|
151
151
|
overflow: visible;
|
|
152
152
|
position: absolute;
|
|
153
153
|
pointer-events: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Background.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,SAAS,CAAC;AAWlE,iBAAS,mBAAmB,CAAC,EAC3B,EAAE,EACF,OAAgC,EAEhC,GAAQ,EAER,IAAI,EACJ,SAAa,EACb,MAAU,EACV,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,GACjB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Background.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,SAAS,CAAC;AAWlE,iBAAS,mBAAmB,CAAC,EAC3B,EAAE,EACF,OAAgC,EAEhC,GAAQ,EAER,IAAI,EACJ,SAAa,EACb,MAAU,EACV,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,GACjB,EAAE,eAAe,2CAqDjB;kBAnEQ,mBAAmB;;;AAuE5B,eAAO,MAAM,UAAU,iEAA4B,CAAC"}
|
|
@@ -19,7 +19,7 @@ export type BackgroundProps = {
|
|
|
19
19
|
/** Size of a single pattern element */
|
|
20
20
|
size?: number;
|
|
21
21
|
/** Offset of the pattern */
|
|
22
|
-
offset?: number;
|
|
22
|
+
offset?: number | [number, number];
|
|
23
23
|
/** Line width of the Line pattern */
|
|
24
24
|
lineWidth?: number;
|
|
25
25
|
/** Variant of the pattern
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,qCAAqC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeUpdateAnchors.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/EdgeUpdateAnchors.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,YAAY,
|
|
1
|
+
{"version":3,"file":"EdgeUpdateAnchors.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/EdgeUpdateAnchors.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AAG/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGhE,KAAK,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC1D,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC/C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACrD,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC;IACvD,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACjE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,GAAG,YAAY,CAAC;AAEjB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC9D,eAAe,EACf,eAAe,EACf,IAAI,EACJ,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,GACf,EAAE,sBAAsB,CAAC,QAAQ,CAAC,2CAoGlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Handle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAOL,KAAK,WAAW,IAAI,iBAAiB,EAIrC,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Handle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAOL,KAAK,WAAW,IAAI,iBAAiB,EAIrC,SAAS,EAGV,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,WAAY,SAAQ,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;IAChG,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAwND;;GAEG;AACH,eAAO,MAAM,MAAM,0HAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Pane/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAElE,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,OAAO,CACT,IAAI,CACF,cAAc,EACZ,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,CACpB,CACF,CAAC;AAoBF,wBAAgB,IAAI,CAAC,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAkC,EAClC,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Pane/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAElE,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,OAAO,CACT,IAAI,CACF,cAAc,EACZ,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,CACpB,CACF,CAAC;AAoBF,wBAAgB,IAAI,CAAC,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAkC,EAClC,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,EAAE,SAAS,2CAyMX"}
|
|
@@ -6,5 +6,5 @@ import type { InternalNode, Node } from '../types';
|
|
|
6
6
|
* @public
|
|
7
7
|
* @returns ConnectionState
|
|
8
8
|
*/
|
|
9
|
-
export declare function useConnection<NodeType extends Node = Node
|
|
9
|
+
export declare function useConnection<NodeType extends Node = Node, SelectorReturn = ConnectionState<InternalNode<NodeType>>>(connectionSelector?: (connection: ConnectionState<InternalNode<NodeType>>) => SelectorReturn): SelectorReturn;
|
|
10
10
|
//# sourceMappingURL=useConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAqBnE;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAClH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,cAAc,GAC3F,cAAc,CAGhB"}
|