@xyflow/react 12.0.3 → 12.1.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 +2 -2
- 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 +86 -66
- package/dist/esm/index.mjs +86 -66
- 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 +3 -1
- package/dist/esm/types/store.d.ts.map +1 -1
- package/dist/style.css +2 -2
- 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 +3 -1
- package/dist/umd/types/store.d.ts.map +1 -1
- package/package.json +4 -4
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);
|
|
@@ -124,7 +124,7 @@ const defaultNodeOrigin = [0, 0];
|
|
|
124
124
|
const defaultViewport = { x: 0, y: 0, zoom: 1 };
|
|
125
125
|
|
|
126
126
|
/*
|
|
127
|
-
* This component helps us to update the store with the
|
|
127
|
+
* This component helps us to update the store with the values coming from the user.
|
|
128
128
|
* We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)
|
|
129
129
|
* and values that have a dedicated setter function in the store (like `setNodes`).
|
|
130
130
|
*/
|
|
@@ -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);
|
|
@@ -750,7 +750,7 @@ function useQueue(runQueue) {
|
|
|
750
750
|
runQueue(queueItems);
|
|
751
751
|
queue.reset();
|
|
752
752
|
}
|
|
753
|
-
//
|
|
753
|
+
// Because we're using reactive state to trigger this effect, we need to flip
|
|
754
754
|
// it back to false.
|
|
755
755
|
setShouldFlush(false);
|
|
756
756
|
}, [shouldFlush]);
|
|
@@ -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);
|
|
@@ -1215,7 +1215,6 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1215
1215
|
const onPointerDown = (event) => {
|
|
1216
1216
|
const { resetSelectedElements, domNode, edgeLookup } = store.getState();
|
|
1217
1217
|
containerBounds.current = domNode?.getBoundingClientRect();
|
|
1218
|
-
event.target?.setPointerCapture?.(event.pointerId);
|
|
1219
1218
|
if (!elementsSelectable ||
|
|
1220
1219
|
!isSelecting ||
|
|
1221
1220
|
event.button !== 0 ||
|
|
@@ -1223,6 +1222,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
1223
1222
|
!containerBounds.current) {
|
|
1224
1223
|
return;
|
|
1225
1224
|
}
|
|
1225
|
+
event.target?.setPointerCapture?.(event.pointerId);
|
|
1226
1226
|
selectionStarted.current = true;
|
|
1227
1227
|
selectionInProgress.current = false;
|
|
1228
1228
|
edgeIdLookup.current = new Map();
|
|
@@ -1438,7 +1438,7 @@ const useNodeId = () => {
|
|
|
1438
1438
|
return nodeId;
|
|
1439
1439
|
};
|
|
1440
1440
|
|
|
1441
|
-
const selector$
|
|
1441
|
+
const selector$g = (s) => ({
|
|
1442
1442
|
connectOnClick: s.connectOnClick,
|
|
1443
1443
|
noPanClassName: s.noPanClassName,
|
|
1444
1444
|
rfId: s.rfId,
|
|
@@ -1463,7 +1463,7 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1463
1463
|
const isTarget = type === 'target';
|
|
1464
1464
|
const store = useStoreApi();
|
|
1465
1465
|
const nodeId = useNodeId();
|
|
1466
|
-
const { connectOnClick, noPanClassName, rfId } = useStore(selector$
|
|
1466
|
+
const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow);
|
|
1467
1467
|
const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, valid } = useStore(connectingSelector(nodeId, handleId, type), shallow);
|
|
1468
1468
|
if (!nodeId) {
|
|
1469
1469
|
store.getState().onError?.('010', errorMessages['error010']());
|
|
@@ -1520,7 +1520,7 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1520
1520
|
}
|
|
1521
1521
|
};
|
|
1522
1522
|
const onClick = (event) => {
|
|
1523
|
-
const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, } = store.getState();
|
|
1523
|
+
const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState();
|
|
1524
1524
|
if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
@@ -1545,11 +1545,15 @@ function HandleComponent({ type = 'source', position = Position.Top, isValidConn
|
|
|
1545
1545
|
flowId,
|
|
1546
1546
|
doc,
|
|
1547
1547
|
lib,
|
|
1548
|
+
nodeLookup,
|
|
1548
1549
|
});
|
|
1549
1550
|
if (isValid && connection) {
|
|
1550
1551
|
onConnectExtended(connection);
|
|
1551
1552
|
}
|
|
1552
|
-
|
|
1553
|
+
const connectionClone = structuredClone(connectionState);
|
|
1554
|
+
delete connectionClone.inProgress;
|
|
1555
|
+
connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;
|
|
1556
|
+
onClickConnectEnd?.(event, connectionClone);
|
|
1553
1557
|
store.setState({ connectionClickStartHandle: null });
|
|
1554
1558
|
};
|
|
1555
1559
|
return (jsx("div", { "data-handleid": handleId, "data-nodeid": nodeId, "data-handlepos": position, "data-id": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([
|
|
@@ -1622,7 +1626,7 @@ function getNodeInlineStyleDimensions(node) {
|
|
|
1622
1626
|
};
|
|
1623
1627
|
}
|
|
1624
1628
|
|
|
1625
|
-
const selector$
|
|
1629
|
+
const selector$f = (s) => {
|
|
1626
1630
|
const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {
|
|
1627
1631
|
filter: (node) => !!node.selected,
|
|
1628
1632
|
});
|
|
@@ -1635,7 +1639,7 @@ const selector$g = (s) => {
|
|
|
1635
1639
|
};
|
|
1636
1640
|
function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) {
|
|
1637
1641
|
const store = useStoreApi();
|
|
1638
|
-
const { width, height, transformString, userSelectionActive } = useStore(selector$
|
|
1642
|
+
const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow);
|
|
1639
1643
|
const moveSelectedNodes = useMoveSelectedNodes();
|
|
1640
1644
|
const nodeRef = useRef(null);
|
|
1641
1645
|
useEffect(() => {
|
|
@@ -1674,11 +1678,11 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
1674
1678
|
}
|
|
1675
1679
|
|
|
1676
1680
|
const win = typeof window !== 'undefined' ? window : undefined;
|
|
1677
|
-
const selector$
|
|
1681
|
+
const selector$e = (s) => {
|
|
1678
1682
|
return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };
|
|
1679
1683
|
};
|
|
1680
1684
|
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$
|
|
1685
|
+
const { nodesSelectionActive, userSelectionActive } = useStore(selector$e);
|
|
1682
1686
|
const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });
|
|
1683
1687
|
const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });
|
|
1684
1688
|
const panOnDrag = panActivationKeyPressed || _panOnDrag;
|
|
@@ -1691,7 +1695,7 @@ function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPane
|
|
|
1691
1695
|
FlowRendererComponent.displayName = 'FlowRenderer';
|
|
1692
1696
|
const FlowRenderer = memo(FlowRendererComponent);
|
|
1693
1697
|
|
|
1694
|
-
const selector$
|
|
1698
|
+
const selector$d = (onlyRenderVisible) => (s) => {
|
|
1695
1699
|
return onlyRenderVisible
|
|
1696
1700
|
? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id)
|
|
1697
1701
|
: Array.from(s.nodeLookup.keys());
|
|
@@ -1704,13 +1708,13 @@ const selector$e = (onlyRenderVisible) => (s) => {
|
|
|
1704
1708
|
* @returns array with visible node ids
|
|
1705
1709
|
*/
|
|
1706
1710
|
function useVisibleNodeIds(onlyRenderVisible) {
|
|
1707
|
-
const nodeIds = useStore(useCallback(selector$
|
|
1711
|
+
const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow);
|
|
1708
1712
|
return nodeIds;
|
|
1709
1713
|
}
|
|
1710
1714
|
|
|
1711
|
-
const selector$
|
|
1715
|
+
const selector$c = (s) => s.updateNodeInternals;
|
|
1712
1716
|
function useResizeObserver() {
|
|
1713
|
-
const updateNodeInternals = useStore(selector$
|
|
1717
|
+
const updateNodeInternals = useStore(selector$c);
|
|
1714
1718
|
const [resizeObserver] = useState(() => {
|
|
1715
1719
|
if (typeof ResizeObserver === 'undefined') {
|
|
1716
1720
|
return null;
|
|
@@ -1911,7 +1915,7 @@ function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onC
|
|
|
1911
1915
|
}, "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
1916
|
}
|
|
1913
1917
|
|
|
1914
|
-
const selector$
|
|
1918
|
+
const selector$b = (s) => ({
|
|
1915
1919
|
nodesDraggable: s.nodesDraggable,
|
|
1916
1920
|
nodesConnectable: s.nodesConnectable,
|
|
1917
1921
|
nodesFocusable: s.nodesFocusable,
|
|
@@ -1919,7 +1923,7 @@ const selector$c = (s) => ({
|
|
|
1919
1923
|
onError: s.onError,
|
|
1920
1924
|
});
|
|
1921
1925
|
function NodeRendererComponent(props) {
|
|
1922
|
-
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$
|
|
1926
|
+
const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow);
|
|
1923
1927
|
const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);
|
|
1924
1928
|
const resizeObserver = useResizeObserver();
|
|
1925
1929
|
return (jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => {
|
|
@@ -2251,9 +2255,9 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, targetHandl
|
|
|
2251
2255
|
const isTarget = isSourceHandle;
|
|
2252
2256
|
setReconnecting(true);
|
|
2253
2257
|
onReconnectStart?.(event, edge, handleType);
|
|
2254
|
-
const _onReconnectEnd = (evt) => {
|
|
2258
|
+
const _onReconnectEnd = (evt, connectionState) => {
|
|
2255
2259
|
setReconnecting(false);
|
|
2256
|
-
onReconnectEnd?.(evt, edge, handleType);
|
|
2260
|
+
onReconnectEnd?.(evt, edge, handleType, connectionState);
|
|
2257
2261
|
};
|
|
2258
2262
|
const onConnectEdge = (connection) => onReconnect?.(edge, connection);
|
|
2259
2263
|
XYHandle.onPointerDown(event.nativeEvent, {
|
|
@@ -2410,7 +2414,7 @@ function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectabl
|
|
|
2410
2414
|
]), 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
2415
|
}
|
|
2412
2416
|
|
|
2413
|
-
const selector$
|
|
2417
|
+
const selector$a = (s) => ({
|
|
2414
2418
|
width: s.width,
|
|
2415
2419
|
height: s.height,
|
|
2416
2420
|
edgesFocusable: s.edgesFocusable,
|
|
@@ -2420,7 +2424,7 @@ const selector$b = (s) => ({
|
|
|
2420
2424
|
onError: s.onError,
|
|
2421
2425
|
});
|
|
2422
2426
|
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$
|
|
2427
|
+
const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow);
|
|
2424
2428
|
const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
|
|
2425
2429
|
return (jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => {
|
|
2426
2430
|
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 +2433,9 @@ function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements,
|
|
|
2429
2433
|
EdgeRendererComponent.displayName = 'EdgeRenderer';
|
|
2430
2434
|
const EdgeRenderer = memo(EdgeRendererComponent);
|
|
2431
2435
|
|
|
2432
|
-
const selector$
|
|
2436
|
+
const selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;
|
|
2433
2437
|
function Viewport({ children }) {
|
|
2434
|
-
const transform = useStore(selector$
|
|
2438
|
+
const transform = useStore(selector$9);
|
|
2435
2439
|
return (jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform }, children: children }));
|
|
2436
2440
|
}
|
|
2437
2441
|
|
|
@@ -2451,7 +2455,7 @@ function useOnInitHandler(onInit) {
|
|
|
2451
2455
|
}, [onInit, rfInstance.viewportInitialized]);
|
|
2452
2456
|
}
|
|
2453
2457
|
|
|
2454
|
-
const selector$
|
|
2458
|
+
const selector$8 = (state) => state.panZoom?.syncViewport;
|
|
2455
2459
|
/**
|
|
2456
2460
|
* Hook for syncing the viewport with the panzoom instance.
|
|
2457
2461
|
*
|
|
@@ -2459,7 +2463,7 @@ const selector$9 = (state) => state.panZoom?.syncViewport;
|
|
|
2459
2463
|
* @param viewport
|
|
2460
2464
|
*/
|
|
2461
2465
|
function useViewportSync(viewport) {
|
|
2462
|
-
const syncViewport = useStore(selector$
|
|
2466
|
+
const syncViewport = useStore(selector$8);
|
|
2463
2467
|
const store = useStoreApi();
|
|
2464
2468
|
useEffect(() => {
|
|
2465
2469
|
if (viewport) {
|
|
@@ -2470,19 +2474,30 @@ function useViewportSync(viewport) {
|
|
|
2470
2474
|
return null;
|
|
2471
2475
|
}
|
|
2472
2476
|
|
|
2473
|
-
|
|
2477
|
+
function storeSelector$1(s) {
|
|
2474
2478
|
return s.connection.inProgress
|
|
2475
2479
|
? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }
|
|
2476
2480
|
: { ...s.connection };
|
|
2477
|
-
}
|
|
2481
|
+
}
|
|
2482
|
+
function getSelector(connectionSelector) {
|
|
2483
|
+
if (connectionSelector) {
|
|
2484
|
+
const combinedSelector = (s) => {
|
|
2485
|
+
const connection = storeSelector$1(s);
|
|
2486
|
+
return connectionSelector(connection);
|
|
2487
|
+
};
|
|
2488
|
+
return combinedSelector;
|
|
2489
|
+
}
|
|
2490
|
+
return storeSelector$1;
|
|
2491
|
+
}
|
|
2478
2492
|
/**
|
|
2479
2493
|
* Hook for accessing the connection state.
|
|
2480
2494
|
*
|
|
2481
2495
|
* @public
|
|
2482
2496
|
* @returns ConnectionState
|
|
2483
2497
|
*/
|
|
2484
|
-
function useConnection() {
|
|
2485
|
-
|
|
2498
|
+
function useConnection(connectionSelector) {
|
|
2499
|
+
const combinedSelector = getSelector(connectionSelector);
|
|
2500
|
+
return useStore(combinedSelector, shallow);
|
|
2486
2501
|
}
|
|
2487
2502
|
|
|
2488
2503
|
const selector$7 = (s) => ({
|
|
@@ -2700,27 +2715,33 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
2700
2715
|
// Every node gets registerd at a ResizeObserver. Whenever a node
|
|
2701
2716
|
// changes its dimensions, this function is called to measure the
|
|
2702
2717
|
// new dimensions and update the nodes.
|
|
2703
|
-
updateNodeInternals: (updates) => {
|
|
2718
|
+
updateNodeInternals: (updates, params = { triggerFitView: true }) => {
|
|
2704
2719
|
const { triggerNodeChanges, nodeLookup, parentLookup, fitViewOnInit, fitViewDone, fitViewOnInitOptions, domNode, nodeOrigin, debug, fitViewSync, } = get();
|
|
2705
2720
|
const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin);
|
|
2706
2721
|
if (!updatedInternals) {
|
|
2707
2722
|
return;
|
|
2708
2723
|
}
|
|
2709
2724
|
updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin });
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2725
|
+
if (params.triggerFitView) {
|
|
2726
|
+
// we call fitView once initially after all dimensions are set
|
|
2727
|
+
let nextFitViewDone = fitViewDone;
|
|
2728
|
+
if (!fitViewDone && fitViewOnInit) {
|
|
2729
|
+
nextFitViewDone = fitViewSync({
|
|
2730
|
+
...fitViewOnInitOptions,
|
|
2731
|
+
nodes: fitViewOnInitOptions?.nodes,
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2734
|
+
// here we are cirmumventing the onNodesChange handler
|
|
2735
|
+
// in order to be able to display nodes even if the user
|
|
2736
|
+
// has not provided an onNodesChange handler.
|
|
2737
|
+
// Nodes are only rendered if they have a width and height
|
|
2738
|
+
// attribute which they get from this handler.
|
|
2739
|
+
set({ fitViewDone: nextFitViewDone });
|
|
2740
|
+
}
|
|
2741
|
+
else {
|
|
2742
|
+
// we always want to trigger useStore calls whenever updateNodeInternals is called
|
|
2743
|
+
set({});
|
|
2717
2744
|
}
|
|
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
2745
|
if (changes?.length > 0) {
|
|
2725
2746
|
if (debug) {
|
|
2726
2747
|
console.log('React Flow: trigger node changes', changes);
|
|
@@ -2845,7 +2866,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
2845
2866
|
setNodeExtent: (nodeExtent) => {
|
|
2846
2867
|
const { nodeLookup } = get();
|
|
2847
2868
|
for (const [, node] of nodeLookup) {
|
|
2848
|
-
const positionAbsolute = clampPosition(node.
|
|
2869
|
+
const positionAbsolute = clampPosition(node.internals.positionAbsolute, nodeExtent);
|
|
2849
2870
|
nodeLookup.set(node.id, {
|
|
2850
2871
|
...node,
|
|
2851
2872
|
internals: {
|
|
@@ -2980,7 +3001,7 @@ function useUpdateNodeInternals() {
|
|
|
2980
3001
|
updates.set(updateId, { id: updateId, nodeElement, force: true });
|
|
2981
3002
|
}
|
|
2982
3003
|
});
|
|
2983
|
-
requestAnimationFrame(() => updateNodeInternals(updates));
|
|
3004
|
+
requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false }));
|
|
2984
3005
|
}, []);
|
|
2985
3006
|
}
|
|
2986
3007
|
|
|
@@ -3201,7 +3222,7 @@ function BackgroundComponent({ id, variant = BackgroundVariant.Dots,
|
|
|
3201
3222
|
// only used for dots and cross
|
|
3202
3223
|
gap = 20,
|
|
3203
3224
|
// only used for lines and cross
|
|
3204
|
-
size, lineWidth = 1, offset =
|
|
3225
|
+
size, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) {
|
|
3205
3226
|
const ref = useRef(null);
|
|
3206
3227
|
const { transform, patternId } = useStore(selector$3, shallow);
|
|
3207
3228
|
const patternSize = size || defaultSize[variant];
|
|
@@ -3210,17 +3231,16 @@ size, lineWidth = 1, offset = 2, color, bgColor, style, className, patternClassN
|
|
|
3210
3231
|
const gapXY = Array.isArray(gap) ? gap : [gap, gap];
|
|
3211
3232
|
const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];
|
|
3212
3233
|
const scaledSize = patternSize * transform[2];
|
|
3234
|
+
const offsetXY = Array.isArray(offset) ? offset : [offset, offset];
|
|
3235
|
+
const scaledOffset = [offsetXY[0] * transform[2] || 1, offsetXY[1] * transform[2] || 1];
|
|
3213
3236
|
const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;
|
|
3214
|
-
const patternOffset = isDots
|
|
3215
|
-
? [scaledSize / offset, scaledSize / offset]
|
|
3216
|
-
: [patternDimensions[0] / offset, patternDimensions[1] / offset];
|
|
3217
3237
|
const _patternId = `${patternId}${id ? id : ''}`;
|
|
3218
3238
|
return (jsxs("svg", { className: cc(['react-flow__background', className]), style: {
|
|
3219
3239
|
...style,
|
|
3220
3240
|
...containerStyle,
|
|
3221
3241
|
'--xy-background-color-props': bgColor,
|
|
3222
3242
|
'--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(-${
|
|
3243
|
+
}, 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
3244
|
}
|
|
3225
3245
|
BackgroundComponent.displayName = 'Background';
|
|
3226
3246
|
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":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpH,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,OAAO,
|
|
1
|
+
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,S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AAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAC/E,4BAA4B,CAAC,QAAQ,CAAC,CACvC,CAAC"}
|
|
@@ -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,E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
|
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,2CAuMX"}
|
|
@@ -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"}
|