@xyflow/react 12.5.6 → 12.6.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 +2 -2
- package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts +1 -1
- package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/types.d.ts +7 -2
- package/dist/esm/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/esm/components/BatchProvider/index.d.ts.map +1 -1
- package/dist/esm/components/ReactFlowProvider/index.d.ts +33 -2
- package/dist/esm/components/ReactFlowProvider/index.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/Wrapper.d.ts +5 -2
- package/dist/esm/container/ReactFlow/Wrapper.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/esm/index.js +59 -37
- package/dist/esm/index.mjs +59 -37
- package/dist/esm/store/index.d.ts +5 -2
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/initialState.d.ts +5 -2
- package/dist/esm/store/initialState.d.ts.map +1 -1
- package/dist/esm/types/component-props.d.ts +3 -30
- package/dist/esm/types/component-props.d.ts.map +1 -1
- package/dist/esm/utils/changes.d.ts.map +1 -1
- package/dist/style.css +2 -2
- package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts +1 -1
- package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/types.d.ts +7 -2
- package/dist/umd/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/umd/components/BatchProvider/index.d.ts.map +1 -1
- package/dist/umd/components/ReactFlowProvider/index.d.ts +33 -2
- package/dist/umd/components/ReactFlowProvider/index.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/Wrapper.d.ts +5 -2
- package/dist/umd/container/ReactFlow/Wrapper.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/store/index.d.ts +5 -2
- package/dist/umd/store/index.d.ts.map +1 -1
- package/dist/umd/store/initialState.d.ts +5 -2
- package/dist/umd/store/initialState.d.ts.map +1 -1
- package/dist/umd/types/component-props.d.ts +3 -30
- package/dist/umd/types/component-props.d.ts.map +1 -1
- package/dist/umd/utils/changes.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -135,12 +135,12 @@ const selector$m = (s) => {
|
|
|
135
135
|
const selectedNodes = [];
|
|
136
136
|
const selectedEdges = [];
|
|
137
137
|
for (const [, node] of s.nodeLookup) {
|
|
138
|
-
if (node.selected
|
|
138
|
+
if (node.selected) {
|
|
139
139
|
selectedNodes.push(node.internals.userNode);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
for (const [, edge] of s.edgeLookup) {
|
|
143
|
-
if (edge.selected
|
|
143
|
+
if (edge.selected) {
|
|
144
144
|
selectedEdges.push(edge);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -685,8 +685,12 @@ function applyChange(change, element) {
|
|
|
685
685
|
element.measured.width = change.dimensions.width;
|
|
686
686
|
element.measured.height = change.dimensions.height;
|
|
687
687
|
if (change.setAttributes) {
|
|
688
|
-
|
|
689
|
-
|
|
688
|
+
if (change.setAttributes === true || change.setAttributes === 'width') {
|
|
689
|
+
element.width = change.dimensions.width;
|
|
690
|
+
}
|
|
691
|
+
if (change.setAttributes === true || change.setAttributes === 'height') {
|
|
692
|
+
element.height = change.dimensions.height;
|
|
693
|
+
}
|
|
690
694
|
}
|
|
691
695
|
}
|
|
692
696
|
if (typeof change.resizing === 'boolean') {
|
|
@@ -942,29 +946,26 @@ function BatchProvider({ children, }) {
|
|
|
942
946
|
for (const payload of queueItems) {
|
|
943
947
|
next = typeof payload === 'function' ? payload(next) : payload;
|
|
944
948
|
}
|
|
949
|
+
const changes = getElementsDiffChanges({
|
|
950
|
+
items: next,
|
|
951
|
+
lookup: nodeLookup,
|
|
952
|
+
});
|
|
945
953
|
if (hasDefaultNodes) {
|
|
946
954
|
setNodes(next);
|
|
947
955
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
956
|
+
// We only want to fire onNodesChange if there are changes to the nodes
|
|
957
|
+
if (changes.length > 0) {
|
|
958
|
+
onNodesChange?.(changes);
|
|
959
|
+
}
|
|
960
|
+
else if (fitViewQueued) {
|
|
961
|
+
// If there are no changes to the nodes, we still need to call setNodes
|
|
962
|
+
// to trigger a re-render and fitView.
|
|
963
|
+
window.requestAnimationFrame(() => {
|
|
964
|
+
const { fitViewQueued, nodes, setNodes } = store.getState();
|
|
965
|
+
if (fitViewQueued) {
|
|
966
|
+
setNodes(nodes);
|
|
967
|
+
}
|
|
953
968
|
});
|
|
954
|
-
// We only want to fire onNodesChange if there are changes to the nodes
|
|
955
|
-
if (changes.length > 0) {
|
|
956
|
-
onNodesChange?.(changes);
|
|
957
|
-
}
|
|
958
|
-
else if (fitViewQueued) {
|
|
959
|
-
// If there are no changes to the nodes, we still need to call setNodes
|
|
960
|
-
// to trigger a re-render and fitView.
|
|
961
|
-
window.requestAnimationFrame(() => {
|
|
962
|
-
const { fitViewQueued, nodes, setNodes } = store.getState();
|
|
963
|
-
if (fitViewQueued) {
|
|
964
|
-
setNodes(nodes);
|
|
965
|
-
}
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
969
|
}
|
|
969
970
|
}, []);
|
|
970
971
|
const nodeQueue = useQueue(nodeQueueHandler);
|
|
@@ -3066,7 +3067,7 @@ function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeC
|
|
|
3066
3067
|
GraphViewComponent.displayName = 'GraphView';
|
|
3067
3068
|
const GraphView = memo(GraphViewComponent);
|
|
3068
3069
|
|
|
3069
|
-
const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, } = {}) => {
|
|
3070
|
+
const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, } = {}) => {
|
|
3070
3071
|
const nodeLookup = new Map();
|
|
3071
3072
|
const parentLookup = new Map();
|
|
3072
3073
|
const connectionLookup = new Map();
|
|
@@ -3086,7 +3087,7 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
3086
3087
|
const bounds = getInternalNodesBounds(nodeLookup, {
|
|
3087
3088
|
filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)),
|
|
3088
3089
|
});
|
|
3089
|
-
const { x, y, zoom } = getViewportForBounds(bounds, width, height,
|
|
3090
|
+
const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);
|
|
3090
3091
|
transform = [x, y, zoom];
|
|
3091
3092
|
}
|
|
3092
3093
|
return {
|
|
@@ -3106,8 +3107,8 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
3106
3107
|
hasDefaultNodes: defaultNodes !== undefined,
|
|
3107
3108
|
hasDefaultEdges: defaultEdges !== undefined,
|
|
3108
3109
|
panZoom: null,
|
|
3109
|
-
minZoom
|
|
3110
|
-
maxZoom
|
|
3110
|
+
minZoom,
|
|
3111
|
+
maxZoom,
|
|
3111
3112
|
translateExtent: infiniteExtent,
|
|
3112
3113
|
nodeExtent: storeNodeExtent,
|
|
3113
3114
|
nodesSelectionActive: false,
|
|
@@ -3132,7 +3133,7 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
3132
3133
|
selectNodesOnDrag: true,
|
|
3133
3134
|
multiSelectionActive: false,
|
|
3134
3135
|
fitViewQueued: fitView ?? false,
|
|
3135
|
-
fitViewOptions
|
|
3136
|
+
fitViewOptions,
|
|
3136
3137
|
fitViewResolver: null,
|
|
3137
3138
|
connection: { ...initialConnection },
|
|
3138
3139
|
connectionClickStartHandle: null,
|
|
@@ -3150,7 +3151,7 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
3150
3151
|
};
|
|
3151
3152
|
};
|
|
3152
3153
|
|
|
3153
|
-
const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => {
|
|
3154
|
+
const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => {
|
|
3154
3155
|
async function resolveFitView() {
|
|
3155
3156
|
const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();
|
|
3156
3157
|
if (!panZoom) {
|
|
@@ -3172,7 +3173,20 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3172
3173
|
set({ fitViewResolver: null });
|
|
3173
3174
|
}
|
|
3174
3175
|
return {
|
|
3175
|
-
...getInitialState({
|
|
3176
|
+
...getInitialState({
|
|
3177
|
+
nodes,
|
|
3178
|
+
edges,
|
|
3179
|
+
width,
|
|
3180
|
+
height,
|
|
3181
|
+
fitView,
|
|
3182
|
+
fitViewOptions,
|
|
3183
|
+
minZoom,
|
|
3184
|
+
maxZoom,
|
|
3185
|
+
nodeOrigin,
|
|
3186
|
+
nodeExtent,
|
|
3187
|
+
defaultNodes,
|
|
3188
|
+
defaultEdges,
|
|
3189
|
+
}),
|
|
3176
3190
|
setNodes: (nodes) => {
|
|
3177
3191
|
const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued } = get();
|
|
3178
3192
|
/*
|
|
@@ -3363,7 +3377,10 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3363
3377
|
get().panZoom?.setClickDistance(clickDistance);
|
|
3364
3378
|
},
|
|
3365
3379
|
resetSelectedElements: () => {
|
|
3366
|
-
const { edges, nodes, triggerNodeChanges, triggerEdgeChanges } = get();
|
|
3380
|
+
const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get();
|
|
3381
|
+
if (!elementsSelectable) {
|
|
3382
|
+
return;
|
|
3383
|
+
}
|
|
3367
3384
|
const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);
|
|
3368
3385
|
const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);
|
|
3369
3386
|
triggerNodeChanges(nodeChanges);
|
|
@@ -3435,7 +3452,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
3435
3452
|
* your router. If you have multiple flows on the same page you will need to use a separate
|
|
3436
3453
|
* `<ReactFlowProvider />` for each flow.
|
|
3437
3454
|
*/
|
|
3438
|
-
function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, fitView, nodeOrigin, nodeExtent, children, }) {
|
|
3455
|
+
function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }) {
|
|
3439
3456
|
const [store] = useState(() => createStore({
|
|
3440
3457
|
nodes,
|
|
3441
3458
|
edges,
|
|
@@ -3444,13 +3461,16 @@ function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNo
|
|
|
3444
3461
|
width,
|
|
3445
3462
|
height,
|
|
3446
3463
|
fitView,
|
|
3464
|
+
minZoom,
|
|
3465
|
+
maxZoom,
|
|
3466
|
+
fitViewOptions,
|
|
3447
3467
|
nodeOrigin,
|
|
3448
3468
|
nodeExtent,
|
|
3449
3469
|
}));
|
|
3450
3470
|
return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: children }) }));
|
|
3451
3471
|
}
|
|
3452
3472
|
|
|
3453
|
-
function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, }) {
|
|
3473
|
+
function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) {
|
|
3454
3474
|
const isWrapped = useContext(StoreContext);
|
|
3455
3475
|
if (isWrapped) {
|
|
3456
3476
|
/*
|
|
@@ -3459,7 +3479,7 @@ function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, he
|
|
|
3459
3479
|
*/
|
|
3460
3480
|
return jsx(Fragment, { children: children });
|
|
3461
3481
|
}
|
|
3462
|
-
return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: children }));
|
|
3482
|
+
return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: children }));
|
|
3463
3483
|
}
|
|
3464
3484
|
|
|
3465
3485
|
const wrapperStyle = {
|
|
@@ -3477,7 +3497,7 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
3477
3497
|
e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
|
3478
3498
|
onScroll?.(e);
|
|
3479
3499
|
}, [onScroll]);
|
|
3480
|
-
return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
|
|
3500
|
+
return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));
|
|
3481
3501
|
}
|
|
3482
3502
|
/**
|
|
3483
3503
|
* The `<ReactFlow />` component is the heart of your React Flow application.
|
|
@@ -4482,7 +4502,7 @@ MiniMapComponent.displayName = 'MiniMap';
|
|
|
4482
4502
|
*/
|
|
4483
4503
|
const MiniMap = memo(MiniMapComponent);
|
|
4484
4504
|
|
|
4485
|
-
function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = {}, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, shouldResize, onResizeStart, onResize, onResizeEnd, }) {
|
|
4505
|
+
function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = {}, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, shouldResize, onResizeStart, onResize, onResizeEnd, }) {
|
|
4486
4506
|
const contextNodeId = useNodeId();
|
|
4487
4507
|
const id = typeof nodeId === 'string' ? nodeId : contextNodeId;
|
|
4488
4508
|
const store = useStoreApi();
|
|
@@ -4548,11 +4568,12 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
4548
4568
|
changes.push(positionChange);
|
|
4549
4569
|
}
|
|
4550
4570
|
if (change.width !== undefined && change.height !== undefined) {
|
|
4571
|
+
const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height';
|
|
4551
4572
|
const dimensionChange = {
|
|
4552
4573
|
id,
|
|
4553
4574
|
type: 'dimensions',
|
|
4554
4575
|
resizing: true,
|
|
4555
|
-
setAttributes
|
|
4576
|
+
setAttributes,
|
|
4556
4577
|
dimensions: {
|
|
4557
4578
|
width: change.width,
|
|
4558
4579
|
height: change.height,
|
|
@@ -4592,6 +4613,7 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
4592
4613
|
maxHeight,
|
|
4593
4614
|
},
|
|
4594
4615
|
keepAspectRatio,
|
|
4616
|
+
resizeDirection,
|
|
4595
4617
|
onResizeStart,
|
|
4596
4618
|
onResize,
|
|
4597
4619
|
onResizeEnd,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeOrigin, CoordinateExtent } from '@xyflow/system';
|
|
2
|
-
import type { ReactFlowState, Node, Edge } from '../types';
|
|
3
|
-
declare const createStore: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, }: {
|
|
2
|
+
import type { ReactFlowState, Node, Edge, FitViewOptions } from '../types';
|
|
3
|
+
declare const createStore: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }: {
|
|
4
4
|
nodes?: Node[];
|
|
5
5
|
edges?: Edge[];
|
|
6
6
|
defaultNodes?: Node[];
|
|
@@ -8,6 +8,9 @@ declare const createStore: ({ nodes, edges, defaultNodes, defaultEdges, width, h
|
|
|
8
8
|
width?: number;
|
|
9
9
|
height?: number;
|
|
10
10
|
fitView?: boolean;
|
|
11
|
+
fitViewOptions?: FitViewOptions;
|
|
12
|
+
minZoom?: number;
|
|
13
|
+
maxZoom?: number;
|
|
11
14
|
nodeOrigin?: NodeOrigin;
|
|
12
15
|
nodeExtent?: CoordinateExtent;
|
|
13
16
|
}) => import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<ReactFlowState>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,cAAc,EAAE,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW,oIAad;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,0GAqUc,CAAC;AAEhB,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeOrigin, CoordinateExtent } from '@xyflow/system';
|
|
2
|
-
import type { Edge, Node, ReactFlowStore } from '../types';
|
|
3
|
-
declare const getInitialState: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, nodeOrigin, nodeExtent, }?: {
|
|
2
|
+
import type { Edge, FitViewOptions, Node, ReactFlowStore } from '../types';
|
|
3
|
+
declare const getInitialState: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }?: {
|
|
4
4
|
nodes?: Node[];
|
|
5
5
|
edges?: Edge[];
|
|
6
6
|
defaultNodes?: Node[];
|
|
@@ -8,6 +8,9 @@ declare const getInitialState: ({ nodes, edges, defaultNodes, defaultEdges, widt
|
|
|
8
8
|
width?: number;
|
|
9
9
|
height?: number;
|
|
10
10
|
fitView?: boolean;
|
|
11
|
+
fitViewOptions?: FitViewOptions;
|
|
12
|
+
minZoom?: number;
|
|
13
|
+
maxZoom?: number;
|
|
11
14
|
nodeOrigin?: NodeOrigin;
|
|
12
15
|
nodeExtent?: CoordinateExtent;
|
|
13
16
|
}) => ReactFlowStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAgB,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAgB,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzF,QAAA,MAAM,eAAe,qIAalB;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,KAAQ,cAsGR,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -39,22 +39,11 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
39
39
|
defaultEdges?: EdgeType[];
|
|
40
40
|
/**
|
|
41
41
|
* Defaults to be applied to all new edges that are added to the flow.
|
|
42
|
-
*
|
|
43
42
|
* Properties on a new edge will override these defaults if they exist.
|
|
44
43
|
* @example
|
|
45
44
|
* const defaultEdgeOptions = {
|
|
46
45
|
* type: 'customEdgeType',
|
|
47
|
-
* animated: true
|
|
48
|
-
* interactionWidth: 10,
|
|
49
|
-
* data: { label: 'custom label' },
|
|
50
|
-
* hidden: false,
|
|
51
|
-
* deletable: true,
|
|
52
|
-
* selected: false,
|
|
53
|
-
* focusable: true,
|
|
54
|
-
* markerStart: EdgeMarker.ArrowClosed,
|
|
55
|
-
* markerEnd: EdgeMarker.ArrowClosed,
|
|
56
|
-
* zIndex: 12,
|
|
57
|
-
* ariaLabel: 'custom aria label'
|
|
46
|
+
* animated: true
|
|
58
47
|
* }
|
|
59
48
|
*/
|
|
60
49
|
defaultEdgeOptions?: DefaultEdgeOptions;
|
|
@@ -91,7 +80,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
91
80
|
/**
|
|
92
81
|
* This handler is called when the source or target of a reconnectable edge is dragged from the
|
|
93
82
|
* current node. It will fire even if the edge's source or target do not end up changing.
|
|
94
|
-
*
|
|
95
83
|
* You can use the `reconnectEdge` utility to convert the connection to a new edge.
|
|
96
84
|
*/
|
|
97
85
|
onReconnect?: OnReconnect<EdgeType>;
|
|
@@ -102,7 +90,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
102
90
|
/**
|
|
103
91
|
* This event fires when the user releases the source or target of an editable edge. It is called
|
|
104
92
|
* even if an edge update does not occur.
|
|
105
|
-
*
|
|
106
93
|
*/
|
|
107
94
|
onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
108
95
|
/**
|
|
@@ -163,7 +150,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
163
150
|
onSelectionContextMenu?: (event: ReactMouseEvent, nodes: NodeType[]) => void;
|
|
164
151
|
/**
|
|
165
152
|
* When a connection line is completed and two nodes are connected by the user, this event fires with the new connection.
|
|
166
|
-
*
|
|
167
153
|
* You can use the `addEdge` utility to convert the connection to a complete edge.
|
|
168
154
|
* @example // Use helper function to update edges onConnect
|
|
169
155
|
* import ReactFlow, { addEdge } from '@xyflow/react';
|
|
@@ -231,9 +217,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
231
217
|
onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
|
|
232
218
|
/**
|
|
233
219
|
* Custom node types to be available in a flow.
|
|
234
|
-
*
|
|
235
220
|
* React Flow matches a node's type to a component in the `nodeTypes` object.
|
|
236
|
-
* @TODO check if @default is correct
|
|
237
221
|
* @default {
|
|
238
222
|
* input: InputNode,
|
|
239
223
|
* default: DefaultNode,
|
|
@@ -248,9 +232,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
248
232
|
nodeTypes?: NodeTypes;
|
|
249
233
|
/**
|
|
250
234
|
* Custom edge types to be available in a flow.
|
|
251
|
-
*
|
|
252
235
|
* React Flow matches an edge's type to a component in the `edgeTypes` object.
|
|
253
|
-
* @TODO check if @default is correct
|
|
254
236
|
* @default {
|
|
255
237
|
* default: BezierEdge,
|
|
256
238
|
* straight: StraightEdge,
|
|
@@ -266,7 +248,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
266
248
|
edgeTypes?: EdgeTypes;
|
|
267
249
|
/**
|
|
268
250
|
* The type of edge path to use for connection lines.
|
|
269
|
-
*
|
|
270
251
|
* Although created edges can be of any type, React Flow needs to know what type of path to render for the connection line before the edge is created!
|
|
271
252
|
* @default ConnectionLineType.Bezier
|
|
272
253
|
*/
|
|
@@ -287,7 +268,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
287
268
|
/**
|
|
288
269
|
* If set, pressing the key or chord will delete any selected nodes and edges. Passing an array
|
|
289
270
|
* represents multiple keys that can be pressed.
|
|
290
|
-
|
|
271
|
+
|
|
291
272
|
* For example, `["Delete", "Backspace"]` will delete selected elements when either key is pressed.
|
|
292
273
|
* @default 'Backspace'
|
|
293
274
|
*/
|
|
@@ -404,7 +385,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
404
385
|
selectNodesOnDrag?: boolean;
|
|
405
386
|
/**
|
|
406
387
|
* Enabling this prop allows users to pan the viewport by clicking and dragging.
|
|
407
|
-
*
|
|
408
388
|
* You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
|
|
409
389
|
* @default true
|
|
410
390
|
* @example [0, 2] // allows panning with the left and right mouse buttons
|
|
@@ -443,7 +423,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
443
423
|
onViewportChange?: (viewport: Viewport) => void;
|
|
444
424
|
/**
|
|
445
425
|
* By default, the viewport extends infinitely. You can use this prop to set a boundary.
|
|
446
|
-
*
|
|
447
426
|
* The first pair of coordinates is the top left boundary and the second pair is the bottom right.
|
|
448
427
|
* @default [[-∞, -∞], [+∞, +∞]]
|
|
449
428
|
* @example [[-1000, -10000], [1000, 1000]]
|
|
@@ -456,7 +435,6 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
456
435
|
preventScrolling?: boolean;
|
|
457
436
|
/**
|
|
458
437
|
* By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary.
|
|
459
|
-
*
|
|
460
438
|
* The first pair of coordinates is the top left boundary and the second pair is the bottom right.
|
|
461
439
|
* @example [[-1000, -10000], [1000, 1000]]
|
|
462
440
|
*/
|
|
@@ -478,21 +456,18 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
478
456
|
zoomOnPinch?: boolean;
|
|
479
457
|
/**
|
|
480
458
|
* Controls if the viewport should pan by scrolling inside the container.
|
|
481
|
-
*
|
|
482
459
|
* Can be limited to a specific direction with `panOnScrollMode`.
|
|
483
460
|
* @default false
|
|
484
461
|
*/
|
|
485
462
|
panOnScroll?: boolean;
|
|
486
463
|
/**
|
|
487
464
|
* Controls how fast viewport should be panned on scroll.
|
|
488
|
-
*
|
|
489
465
|
* Use together with `panOnScroll` prop.
|
|
490
466
|
* @default 0.5
|
|
491
467
|
*/
|
|
492
468
|
panOnScrollSpeed?: number;
|
|
493
469
|
/**
|
|
494
470
|
* This prop is used to limit the direction of panning when `panOnScroll` is enabled.
|
|
495
|
-
*
|
|
496
471
|
* The `"free"` option allows panning in any direction.
|
|
497
472
|
* @default "free"
|
|
498
473
|
* @example "horizontal" | "vertical"
|
|
@@ -625,10 +600,8 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|
|
625
600
|
isValidConnection?: IsValidConnection<EdgeType>;
|
|
626
601
|
/**
|
|
627
602
|
* With a threshold greater than zero you can delay node drag events.
|
|
628
|
-
*
|
|
629
603
|
* If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
|
|
630
|
-
*
|
|
631
|
-
* 1 is the default value, so clicks don't trigger drag events.
|
|
604
|
+
* 1 is the default value, so that clicks don't trigger drag events.
|
|
632
605
|
* @default 1
|
|
633
606
|
*/
|
|
634
607
|
nodeDragThreshold?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;I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,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;CACxC,GAAG,UAAU,EAAE,CAAC;AACjB,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,UAAU,EAAE,CAAC;AAmCjB,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,GAAG,gBAAgB,CAKzG"}
|
package/dist/style.css
CHANGED
|
@@ -290,7 +290,7 @@ svg.react-flow__connectionline {
|
|
|
290
290
|
}
|
|
291
291
|
.react-flow__panel.top.center, .react-flow__panel.bottom.center {
|
|
292
292
|
left: 50%;
|
|
293
|
-
transform: translateX(-50%);
|
|
293
|
+
transform: translateX(-15px) translateX(-50%);
|
|
294
294
|
}
|
|
295
295
|
.react-flow__panel.left {
|
|
296
296
|
left: 0;
|
|
@@ -300,7 +300,7 @@ svg.react-flow__connectionline {
|
|
|
300
300
|
}
|
|
301
301
|
.react-flow__panel.left.center, .react-flow__panel.right.center {
|
|
302
302
|
top: 50%;
|
|
303
|
-
transform: translateY(-50%);
|
|
303
|
+
transform: translateY(-15px) translateY(-50%);
|
|
304
304
|
}
|
|
305
305
|
.react-flow__attribution {
|
|
306
306
|
font-size: 10px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ResizeControlProps, ResizeControlLineProps } from './types';
|
|
3
|
-
declare function ResizeControl({ nodeId, position, variant, className, style, children, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, shouldResize, onResizeStart, onResize, onResizeEnd, }: ResizeControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function ResizeControl({ nodeId, position, variant, className, style, children, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, resizeDirection, shouldResize, onResizeStart, onResize, onResizeEnd, }: ResizeControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function ResizeControlLine(props: ResizeControlLineProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
/**
|
|
6
6
|
* To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,2CAuKpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { ControlPosition, ControlLinePosition, ResizeControlVariant, ShouldResize, OnResizeStart, OnResize, OnResizeEnd } from '@xyflow/system';
|
|
2
|
+
import type { ControlPosition, ControlLinePosition, ResizeControlVariant, ResizeControlDirection, ShouldResize, OnResizeStart, OnResize, OnResizeEnd } from '@xyflow/system';
|
|
3
3
|
/**
|
|
4
4
|
* @expand
|
|
5
5
|
*/
|
|
@@ -74,6 +74,11 @@ export type ResizeControlProps = Pick<NodeResizerProps, 'nodeId' | 'color' | 'mi
|
|
|
74
74
|
* @example ResizeControlVariant.Handle, ResizeControlVariant.Line
|
|
75
75
|
*/
|
|
76
76
|
variant?: ResizeControlVariant;
|
|
77
|
+
/**
|
|
78
|
+
* The direction the user can resize the node.
|
|
79
|
+
* If not provided, the user can resize in any direction.
|
|
80
|
+
*/
|
|
81
|
+
resizeDirection?: ResizeControlDirection;
|
|
77
82
|
className?: string;
|
|
78
83
|
style?: CSSProperties;
|
|
79
84
|
children?: ReactNode;
|
|
@@ -81,7 +86,7 @@ export type ResizeControlProps = Pick<NodeResizerProps, 'nodeId' | 'color' | 'mi
|
|
|
81
86
|
/**
|
|
82
87
|
* @expand
|
|
83
88
|
*/
|
|
84
|
-
export type ResizeControlLineProps = ResizeControlProps & {
|
|
89
|
+
export type ResizeControlLineProps = Omit<ResizeControlProps, 'resizeDirection'> & {
|
|
85
90
|
position?: ControlLinePosition;
|
|
86
91
|
};
|
|
87
92
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CA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,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACn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AQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAC;AAKnF,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAU9C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACxF,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkEA;AAED,wBAAgB,eAAe;;;EAQ9B"}
|
|
@@ -1,15 +1,46 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { Node, Edge } from '../../types';
|
|
2
|
+
import type { Node, Edge, FitViewOptions } from '../../types';
|
|
3
3
|
import { CoordinateExtent, NodeOrigin } from '@xyflow/system';
|
|
4
4
|
export type ReactFlowProviderProps = {
|
|
5
|
+
/** These nodes are used to initialize the flow. They are not dynamic. */
|
|
5
6
|
initialNodes?: Node[];
|
|
7
|
+
/** These edges are used to initialize the flow. They are not dynamic. */
|
|
6
8
|
initialEdges?: Edge[];
|
|
9
|
+
/** These nodes are used to initialize the flow. They are not dynamic. */
|
|
7
10
|
defaultNodes?: Node[];
|
|
11
|
+
/** These edges are used to initialize the flow. They are not dynamic. */
|
|
8
12
|
defaultEdges?: Edge[];
|
|
13
|
+
/** The initial width is necessary to be able to use fitView on the server */
|
|
9
14
|
initialWidth?: number;
|
|
15
|
+
/** The initial height is necessary to be able to use fitView on the server */
|
|
10
16
|
initialHeight?: number;
|
|
17
|
+
/** When `true`, the flow will be zoomed and panned to fit all the nodes initially provided. */
|
|
11
18
|
fitView?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* You can provide an object of options to customize the initial fitView behavior.
|
|
21
|
+
*/
|
|
22
|
+
initialFitViewOptions?: FitViewOptions;
|
|
23
|
+
/** Initial minimum zoom level */
|
|
24
|
+
initialMinZoom?: number;
|
|
25
|
+
/** Initial maximum zoom level */
|
|
26
|
+
initialMaxZoom?: number;
|
|
27
|
+
/**
|
|
28
|
+
* The origin of the node to use when placing it in the flow or looking up its `x` and `y`
|
|
29
|
+
* position. An origin of `[0, 0]` means that a node's top left corner will be placed at the `x`
|
|
30
|
+
* and `y` position.
|
|
31
|
+
* @default [0, 0]
|
|
32
|
+
* @example
|
|
33
|
+
* [0, 0] // default, top left
|
|
34
|
+
* [0.5, 0.5] // center
|
|
35
|
+
* [1, 1] // bottom right
|
|
36
|
+
*/
|
|
12
37
|
nodeOrigin?: NodeOrigin;
|
|
38
|
+
/**
|
|
39
|
+
* By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary.
|
|
40
|
+
*
|
|
41
|
+
* The first pair of coordinates is the top left boundary and the second pair is the bottom right.
|
|
42
|
+
* @example [[-1000, -10000], [1000, 1000]]
|
|
43
|
+
*/
|
|
13
44
|
nodeExtent?: CoordinateExtent;
|
|
14
45
|
children: ReactNode;
|
|
15
46
|
};
|
|
@@ -47,5 +78,5 @@ export type ReactFlowProviderProps = {
|
|
|
47
78
|
* your router. If you have multiple flows on the same page you will need to use a separate
|
|
48
79
|
* `<ReactFlowProvider />` for each flow.
|
|
49
80
|
*/
|
|
50
|
-
export declare function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, fitView, nodeOrigin, nodeExtent, children, }: ReactFlowProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
export declare function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }: ReactFlowProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
51
82
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ReactFlowProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ReactFlowProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACvC,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,CAA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