@xyflow/react 12.0.0-next.0 → 12.0.0-next.10
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/LICENSE +1 -1
- package/dist/base.css +47 -26
- package/dist/esm/additional-components/Background/Background.d.ts +5 -5
- package/dist/esm/additional-components/Background/Background.d.ts.map +1 -1
- package/dist/esm/additional-components/Background/index.d.ts +2 -2
- package/dist/esm/additional-components/Background/index.d.ts.map +1 -1
- package/dist/esm/additional-components/Background/types.d.ts +13 -0
- package/dist/esm/additional-components/Background/types.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/ControlButton.d.ts +1 -3
- package/dist/esm/additional-components/Controls/ControlButton.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Controls.d.ts +7 -3
- package/dist/esm/additional-components/Controls/Controls.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Icons/FitView.d.ts +1 -2
- package/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Icons/Lock.d.ts +1 -2
- package/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Icons/Minus.d.ts +1 -2
- package/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Icons/Plus.d.ts +1 -2
- package/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/Icons/Unlock.d.ts +1 -2
- package/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/index.d.ts +3 -3
- package/dist/esm/additional-components/Controls/index.d.ts.map +1 -1
- package/dist/esm/additional-components/Controls/types.d.ts +20 -2
- package/dist/esm/additional-components/Controls/types.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/MiniMap.d.ts +5 -5
- package/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts +3 -3
- package/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts +3 -3
- package/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/index.d.ts +1 -1
- package/dist/esm/additional-components/MiniMap/index.d.ts.map +1 -1
- package/dist/esm/additional-components/MiniMap/types.d.ts +23 -0
- package/dist/esm/additional-components/MiniMap/types.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts +7 -0
- package/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -0
- package/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts +2 -2
- package/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/ResizeControl.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/index.d.ts +2 -2
- package/dist/esm/additional-components/NodeResizer/index.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeResizer/types.d.ts +26 -23
- package/dist/esm/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts +2 -3
- package/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +1 -2
- package/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeToolbar/index.d.ts +2 -2
- package/dist/esm/additional-components/NodeToolbar/index.d.ts.map +1 -1
- package/dist/esm/additional-components/NodeToolbar/types.d.ts +10 -0
- package/dist/esm/additional-components/NodeToolbar/types.d.ts.map +1 -1
- package/dist/esm/components/A11yDescriptions/index.d.ts +1 -2
- package/dist/esm/components/A11yDescriptions/index.d.ts.map +1 -1
- package/dist/esm/components/Attribution/index.d.ts +2 -2
- package/dist/esm/components/Attribution/index.d.ts.map +1 -1
- package/dist/esm/components/ConnectionLine/index.d.ts +2 -2
- package/dist/esm/components/ConnectionLine/index.d.ts.map +1 -1
- package/dist/esm/components/EdgeLabelRenderer/index.d.ts +1 -2
- package/dist/esm/components/EdgeLabelRenderer/index.d.ts.map +1 -1
- package/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +9 -9
- package/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
- package/dist/esm/components/EdgeWrapper/index.d.ts +2 -7
- package/dist/esm/components/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/esm/components/Edges/BaseEdge.d.ts +1 -5
- package/dist/esm/components/Edges/BaseEdge.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeAnchor.d.ts +2 -2
- package/dist/esm/components/Edges/EdgeAnchor.d.ts.map +1 -1
- package/dist/esm/components/Edges/EdgeText.d.ts +7 -3
- package/dist/esm/components/Edges/EdgeText.d.ts.map +1 -1
- package/dist/esm/components/Handle/index.d.ts +6 -3
- package/dist/esm/components/Handle/index.d.ts.map +1 -1
- package/dist/esm/components/NodeWrapper/index.d.ts +2 -7
- package/dist/esm/components/NodeWrapper/index.d.ts.map +1 -1
- package/dist/esm/components/NodeWrapper/utils.d.ts +5 -1
- package/dist/esm/components/NodeWrapper/utils.d.ts.map +1 -1
- package/dist/esm/components/Nodes/DefaultNode.d.ts +1 -6
- package/dist/esm/components/Nodes/DefaultNode.d.ts.map +1 -1
- package/dist/esm/components/Nodes/GroupNode.d.ts +1 -5
- package/dist/esm/components/Nodes/GroupNode.d.ts.map +1 -1
- package/dist/esm/components/Nodes/InputNode.d.ts +1 -6
- package/dist/esm/components/Nodes/InputNode.d.ts.map +1 -1
- package/dist/esm/components/Nodes/OutputNode.d.ts +1 -6
- package/dist/esm/components/Nodes/OutputNode.d.ts.map +1 -1
- package/dist/esm/components/Nodes/utils.d.ts.map +1 -1
- package/dist/esm/components/NodesSelection/index.d.ts +3 -5
- package/dist/esm/components/NodesSelection/index.d.ts.map +1 -1
- package/dist/esm/components/Panel/index.d.ts +5 -3
- package/dist/esm/components/Panel/index.d.ts.map +1 -1
- package/dist/esm/components/ReactFlowProvider/index.d.ts +3 -5
- package/dist/esm/components/ReactFlowProvider/index.d.ts.map +1 -1
- package/dist/esm/components/SelectionListener/index.d.ts +2 -2
- package/dist/esm/components/SelectionListener/index.d.ts.map +1 -1
- package/dist/esm/components/StoreUpdater/index.d.ts +5 -5
- package/dist/esm/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/esm/components/UserSelection/index.d.ts +1 -2
- package/dist/esm/components/UserSelection/index.d.ts.map +1 -1
- package/dist/esm/components/ViewportPortal/index.d.ts +1 -2
- package/dist/esm/components/ViewportPortal/index.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts +1 -1
- package/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -1
- package/dist/esm/container/EdgeRenderer/index.d.ts +9 -7
- package/dist/esm/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/FlowRenderer/index.d.ts +8 -6
- package/dist/esm/container/FlowRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/GraphView/index.d.ts +8 -8
- package/dist/esm/container/GraphView/index.d.ts.map +1 -1
- package/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +0 -1
- package/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map +1 -1
- package/dist/esm/container/NodeRenderer/index.d.ts +8 -7
- package/dist/esm/container/NodeRenderer/index.d.ts.map +1 -1
- package/dist/esm/container/NodeRenderer/useResizeObserver.d.ts +1 -1
- package/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map +1 -1
- package/dist/esm/container/Pane/index.d.ts +2 -2
- package/dist/esm/container/Pane/index.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/Wrapper.d.ts +3 -5
- package/dist/esm/container/ReactFlow/Wrapper.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/index.d.ts +5 -119
- package/dist/esm/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/esm/container/ReactFlow/init-values.d.ts +4 -0
- package/dist/esm/container/ReactFlow/init-values.d.ts.map +1 -0
- package/dist/esm/container/Viewport/index.d.ts +1 -1
- package/dist/esm/container/Viewport/index.d.ts.map +1 -1
- package/dist/esm/container/ZoomPane/index.d.ts +2 -2
- package/dist/esm/container/ZoomPane/index.d.ts.map +1 -1
- package/dist/esm/contexts/RFStoreContext.d.ts +2 -2
- package/dist/esm/contexts/RFStoreContext.d.ts.map +1 -1
- package/dist/esm/hooks/useColorModeClass.d.ts +1 -1
- package/dist/esm/hooks/useColorModeClass.d.ts.map +1 -1
- package/dist/esm/hooks/useConnection.d.ts +13 -7
- package/dist/esm/hooks/useConnection.d.ts.map +1 -1
- package/dist/esm/hooks/useDrag.d.ts +3 -3
- package/dist/esm/hooks/useDrag.d.ts.map +1 -1
- package/dist/esm/hooks/useEdges.d.ts +1 -2
- package/dist/esm/hooks/useEdges.d.ts.map +1 -1
- package/dist/esm/hooks/useGlobalKeyHandler.d.ts +2 -3
- package/dist/esm/hooks/useGlobalKeyHandler.d.ts.map +1 -1
- package/dist/esm/hooks/useHandleConnections.d.ts +4 -4
- package/dist/esm/hooks/useHandleConnections.d.ts.map +1 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/esm/hooks/useKeyPress.d.ts +1 -2
- package/dist/esm/hooks/useKeyPress.d.ts.map +1 -1
- package/dist/esm/hooks/useMoveSelectedNodes.d.ts +12 -0
- package/dist/esm/hooks/useMoveSelectedNodes.d.ts.map +1 -0
- package/dist/esm/hooks/useNodes.d.ts +1 -2
- package/dist/esm/hooks/useNodes.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesData.d.ts +8 -4
- package/dist/esm/hooks/useNodesData.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesEdgesState.d.ts +3 -3
- package/dist/esm/hooks/useNodesEdgesState.d.ts.map +1 -1
- package/dist/esm/hooks/useNodesInitialized.d.ts +1 -2
- package/dist/esm/hooks/useNodesInitialized.d.ts.map +1 -1
- package/dist/esm/hooks/useOnInitHandler.d.ts +2 -3
- package/dist/esm/hooks/useOnInitHandler.d.ts.map +1 -1
- package/dist/esm/hooks/useOnSelectionChange.d.ts +2 -3
- package/dist/esm/hooks/useOnSelectionChange.d.ts.map +1 -1
- package/dist/esm/hooks/useOnViewportChange.d.ts +1 -2
- package/dist/esm/hooks/useOnViewportChange.d.ts.map +1 -1
- package/dist/esm/hooks/useReactFlow.d.ts +1 -1
- package/dist/esm/hooks/useReactFlow.d.ts.map +1 -1
- package/dist/esm/hooks/useResizeHandler.d.ts +1 -2
- package/dist/esm/hooks/useResizeHandler.d.ts.map +1 -1
- package/dist/esm/hooks/useStore.d.ts +10 -10
- package/dist/esm/hooks/useStore.d.ts.map +1 -1
- package/dist/esm/hooks/useUpdateNodeInternals.d.ts +1 -2
- package/dist/esm/hooks/useUpdateNodeInternals.d.ts.map +1 -1
- package/dist/esm/hooks/useUpdateNodePositions.d.ts +1 -2
- package/dist/esm/hooks/useUpdateNodePositions.d.ts.map +1 -1
- package/dist/esm/hooks/useViewport.d.ts +1 -2
- package/dist/esm/hooks/useViewport.d.ts.map +1 -1
- package/dist/esm/hooks/useViewportSync.d.ts +1 -1
- package/dist/esm/hooks/useViewportSync.d.ts.map +1 -1
- package/dist/esm/hooks/useVisibleEdgeIds.d.ts +1 -2
- package/dist/esm/hooks/useVisibleEdgeIds.d.ts.map +1 -1
- package/dist/esm/hooks/useVisibleNodeIds.d.ts +1 -2
- package/dist/esm/hooks/useVisibleNodeIds.d.ts.map +1 -1
- package/dist/esm/index.d.ts +20 -20
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +750 -803
- package/dist/esm/index.mjs +750 -803
- package/dist/esm/store/index.d.ts +6 -4
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/initialState.d.ts +5 -3
- package/dist/esm/store/initialState.d.ts.map +1 -1
- package/dist/esm/types/changes.d.ts +8 -7
- package/dist/esm/types/changes.d.ts.map +1 -1
- package/dist/esm/types/component-props.d.ts +380 -37
- package/dist/esm/types/component-props.d.ts.map +1 -1
- package/dist/esm/types/edges.d.ts +34 -27
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/types/general.d.ts +88 -10
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/types/instance.d.ts +94 -11
- package/dist/esm/types/instance.d.ts.map +1 -1
- package/dist/esm/types/nodes.d.ts +14 -11
- package/dist/esm/types/nodes.d.ts.map +1 -1
- package/dist/esm/types/store.d.ts +24 -22
- package/dist/esm/types/store.d.ts.map +1 -1
- package/dist/esm/utils/changes.d.ts +23 -5
- package/dist/esm/utils/changes.d.ts.map +1 -1
- package/dist/esm/utils/general.d.ts +2 -49
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/style.css +58 -29
- package/dist/umd/additional-components/Background/Background.d.ts +5 -5
- package/dist/umd/additional-components/Background/Background.d.ts.map +1 -1
- package/dist/umd/additional-components/Background/index.d.ts +2 -2
- package/dist/umd/additional-components/Background/index.d.ts.map +1 -1
- package/dist/umd/additional-components/Background/types.d.ts +13 -0
- package/dist/umd/additional-components/Background/types.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/ControlButton.d.ts +1 -3
- package/dist/umd/additional-components/Controls/ControlButton.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Controls.d.ts +7 -3
- package/dist/umd/additional-components/Controls/Controls.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Icons/FitView.d.ts +1 -2
- package/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Icons/Lock.d.ts +1 -2
- package/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Icons/Minus.d.ts +1 -2
- package/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Icons/Plus.d.ts +1 -2
- package/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/Icons/Unlock.d.ts +1 -2
- package/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/index.d.ts +3 -3
- package/dist/umd/additional-components/Controls/index.d.ts.map +1 -1
- package/dist/umd/additional-components/Controls/types.d.ts +20 -2
- package/dist/umd/additional-components/Controls/types.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/MiniMap.d.ts +5 -5
- package/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts +3 -3
- package/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts +3 -3
- package/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/index.d.ts +1 -1
- package/dist/umd/additional-components/MiniMap/index.d.ts.map +1 -1
- package/dist/umd/additional-components/MiniMap/types.d.ts +23 -0
- package/dist/umd/additional-components/MiniMap/types.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts +7 -0
- package/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map +1 -0
- package/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts +2 -2
- package/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/ResizeControl.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/index.d.ts +2 -2
- package/dist/umd/additional-components/NodeResizer/index.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeResizer/types.d.ts +26 -23
- package/dist/umd/additional-components/NodeResizer/types.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts +2 -3
- package/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +1 -2
- package/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeToolbar/index.d.ts +2 -2
- package/dist/umd/additional-components/NodeToolbar/index.d.ts.map +1 -1
- package/dist/umd/additional-components/NodeToolbar/types.d.ts +10 -0
- package/dist/umd/additional-components/NodeToolbar/types.d.ts.map +1 -1
- package/dist/umd/components/A11yDescriptions/index.d.ts +1 -2
- package/dist/umd/components/A11yDescriptions/index.d.ts.map +1 -1
- package/dist/umd/components/Attribution/index.d.ts +2 -2
- package/dist/umd/components/Attribution/index.d.ts.map +1 -1
- package/dist/umd/components/ConnectionLine/index.d.ts +2 -2
- package/dist/umd/components/ConnectionLine/index.d.ts.map +1 -1
- package/dist/umd/components/EdgeLabelRenderer/index.d.ts +1 -2
- package/dist/umd/components/EdgeLabelRenderer/index.d.ts.map +1 -1
- package/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +9 -9
- package/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
- package/dist/umd/components/EdgeWrapper/index.d.ts +2 -7
- package/dist/umd/components/EdgeWrapper/index.d.ts.map +1 -1
- package/dist/umd/components/Edges/BaseEdge.d.ts +1 -5
- package/dist/umd/components/Edges/BaseEdge.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeAnchor.d.ts +2 -2
- package/dist/umd/components/Edges/EdgeAnchor.d.ts.map +1 -1
- package/dist/umd/components/Edges/EdgeText.d.ts +7 -3
- package/dist/umd/components/Edges/EdgeText.d.ts.map +1 -1
- package/dist/umd/components/Handle/index.d.ts +6 -3
- package/dist/umd/components/Handle/index.d.ts.map +1 -1
- package/dist/umd/components/NodeWrapper/index.d.ts +2 -7
- package/dist/umd/components/NodeWrapper/index.d.ts.map +1 -1
- package/dist/umd/components/NodeWrapper/utils.d.ts +5 -1
- package/dist/umd/components/NodeWrapper/utils.d.ts.map +1 -1
- package/dist/umd/components/Nodes/DefaultNode.d.ts +1 -6
- package/dist/umd/components/Nodes/DefaultNode.d.ts.map +1 -1
- package/dist/umd/components/Nodes/GroupNode.d.ts +1 -5
- package/dist/umd/components/Nodes/GroupNode.d.ts.map +1 -1
- package/dist/umd/components/Nodes/InputNode.d.ts +1 -6
- package/dist/umd/components/Nodes/InputNode.d.ts.map +1 -1
- package/dist/umd/components/Nodes/OutputNode.d.ts +1 -6
- package/dist/umd/components/Nodes/OutputNode.d.ts.map +1 -1
- package/dist/umd/components/Nodes/utils.d.ts.map +1 -1
- package/dist/umd/components/NodesSelection/index.d.ts +3 -5
- package/dist/umd/components/NodesSelection/index.d.ts.map +1 -1
- package/dist/umd/components/Panel/index.d.ts +5 -3
- package/dist/umd/components/Panel/index.d.ts.map +1 -1
- package/dist/umd/components/ReactFlowProvider/index.d.ts +3 -5
- package/dist/umd/components/ReactFlowProvider/index.d.ts.map +1 -1
- package/dist/umd/components/SelectionListener/index.d.ts +2 -2
- package/dist/umd/components/SelectionListener/index.d.ts.map +1 -1
- package/dist/umd/components/StoreUpdater/index.d.ts +5 -5
- package/dist/umd/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/umd/components/UserSelection/index.d.ts +1 -2
- package/dist/umd/components/UserSelection/index.d.ts.map +1 -1
- package/dist/umd/components/ViewportPortal/index.d.ts +1 -2
- package/dist/umd/components/ViewportPortal/index.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts +1 -1
- package/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -1
- package/dist/umd/container/EdgeRenderer/index.d.ts +9 -7
- package/dist/umd/container/EdgeRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/FlowRenderer/index.d.ts +8 -6
- package/dist/umd/container/FlowRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/GraphView/index.d.ts +8 -8
- package/dist/umd/container/GraphView/index.d.ts.map +1 -1
- package/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +0 -1
- package/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map +1 -1
- package/dist/umd/container/NodeRenderer/index.d.ts +8 -7
- package/dist/umd/container/NodeRenderer/index.d.ts.map +1 -1
- package/dist/umd/container/NodeRenderer/useResizeObserver.d.ts +1 -1
- package/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map +1 -1
- package/dist/umd/container/Pane/index.d.ts +2 -2
- package/dist/umd/container/Pane/index.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/Wrapper.d.ts +3 -5
- package/dist/umd/container/ReactFlow/Wrapper.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/index.d.ts +5 -119
- package/dist/umd/container/ReactFlow/index.d.ts.map +1 -1
- package/dist/umd/container/ReactFlow/init-values.d.ts +4 -0
- package/dist/umd/container/ReactFlow/init-values.d.ts.map +1 -0
- package/dist/umd/container/Viewport/index.d.ts +1 -1
- package/dist/umd/container/Viewport/index.d.ts.map +1 -1
- package/dist/umd/container/ZoomPane/index.d.ts +2 -2
- package/dist/umd/container/ZoomPane/index.d.ts.map +1 -1
- package/dist/umd/contexts/RFStoreContext.d.ts +2 -2
- package/dist/umd/contexts/RFStoreContext.d.ts.map +1 -1
- package/dist/umd/hooks/useColorModeClass.d.ts +1 -1
- package/dist/umd/hooks/useColorModeClass.d.ts.map +1 -1
- package/dist/umd/hooks/useConnection.d.ts +13 -7
- package/dist/umd/hooks/useConnection.d.ts.map +1 -1
- package/dist/umd/hooks/useDrag.d.ts +3 -3
- package/dist/umd/hooks/useDrag.d.ts.map +1 -1
- package/dist/umd/hooks/useEdges.d.ts +1 -2
- package/dist/umd/hooks/useEdges.d.ts.map +1 -1
- package/dist/umd/hooks/useGlobalKeyHandler.d.ts +2 -3
- package/dist/umd/hooks/useGlobalKeyHandler.d.ts.map +1 -1
- package/dist/umd/hooks/useHandleConnections.d.ts +4 -4
- package/dist/umd/hooks/useHandleConnections.d.ts.map +1 -1
- package/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/umd/hooks/useKeyPress.d.ts +1 -2
- package/dist/umd/hooks/useKeyPress.d.ts.map +1 -1
- package/dist/umd/hooks/useMoveSelectedNodes.d.ts +12 -0
- package/dist/umd/hooks/useMoveSelectedNodes.d.ts.map +1 -0
- package/dist/umd/hooks/useNodes.d.ts +1 -2
- package/dist/umd/hooks/useNodes.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesData.d.ts +8 -4
- package/dist/umd/hooks/useNodesData.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesEdgesState.d.ts +3 -3
- package/dist/umd/hooks/useNodesEdgesState.d.ts.map +1 -1
- package/dist/umd/hooks/useNodesInitialized.d.ts +1 -2
- package/dist/umd/hooks/useNodesInitialized.d.ts.map +1 -1
- package/dist/umd/hooks/useOnInitHandler.d.ts +2 -3
- package/dist/umd/hooks/useOnInitHandler.d.ts.map +1 -1
- package/dist/umd/hooks/useOnSelectionChange.d.ts +2 -3
- package/dist/umd/hooks/useOnSelectionChange.d.ts.map +1 -1
- package/dist/umd/hooks/useOnViewportChange.d.ts +1 -2
- package/dist/umd/hooks/useOnViewportChange.d.ts.map +1 -1
- package/dist/umd/hooks/useReactFlow.d.ts +1 -1
- package/dist/umd/hooks/useReactFlow.d.ts.map +1 -1
- package/dist/umd/hooks/useResizeHandler.d.ts +1 -2
- package/dist/umd/hooks/useResizeHandler.d.ts.map +1 -1
- package/dist/umd/hooks/useStore.d.ts +10 -10
- package/dist/umd/hooks/useStore.d.ts.map +1 -1
- package/dist/umd/hooks/useUpdateNodeInternals.d.ts +1 -2
- package/dist/umd/hooks/useUpdateNodeInternals.d.ts.map +1 -1
- package/dist/umd/hooks/useUpdateNodePositions.d.ts +1 -2
- package/dist/umd/hooks/useUpdateNodePositions.d.ts.map +1 -1
- package/dist/umd/hooks/useViewport.d.ts +1 -2
- package/dist/umd/hooks/useViewport.d.ts.map +1 -1
- package/dist/umd/hooks/useViewportSync.d.ts +1 -1
- package/dist/umd/hooks/useViewportSync.d.ts.map +1 -1
- package/dist/umd/hooks/useVisibleEdgeIds.d.ts +1 -2
- package/dist/umd/hooks/useVisibleEdgeIds.d.ts.map +1 -1
- package/dist/umd/hooks/useVisibleNodeIds.d.ts +1 -2
- package/dist/umd/hooks/useVisibleNodeIds.d.ts.map +1 -1
- package/dist/umd/index.d.ts +20 -20
- package/dist/umd/index.d.ts.map +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/store/index.d.ts +6 -4
- package/dist/umd/store/index.d.ts.map +1 -1
- package/dist/umd/store/initialState.d.ts +5 -3
- package/dist/umd/store/initialState.d.ts.map +1 -1
- package/dist/umd/types/changes.d.ts +8 -7
- package/dist/umd/types/changes.d.ts.map +1 -1
- package/dist/umd/types/component-props.d.ts +380 -37
- package/dist/umd/types/component-props.d.ts.map +1 -1
- package/dist/umd/types/edges.d.ts +34 -27
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/types/general.d.ts +88 -10
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/types/instance.d.ts +94 -11
- package/dist/umd/types/instance.d.ts.map +1 -1
- package/dist/umd/types/nodes.d.ts +14 -11
- package/dist/umd/types/nodes.d.ts.map +1 -1
- package/dist/umd/types/store.d.ts +24 -22
- package/dist/umd/types/store.d.ts.map +1 -1
- package/dist/umd/utils/changes.d.ts +23 -5
- package/dist/umd/utils/changes.d.ts.map +1 -1
- package/dist/umd/utils/general.d.ts +2 -49
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/package.json +3 -10
|
@@ -10,51 +10,47 @@ export type EdgeLabelOptions = {
|
|
|
10
10
|
labelBgBorderRadius?: number;
|
|
11
11
|
};
|
|
12
12
|
export type EdgeUpdatable = boolean | HandleType;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The Edge type is mainly used for the `edges` that get passed to the ReactFlow component
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type Edge<EdgeData extends Record<string, unknown> = Record<string, unknown>, EdgeType extends string | undefined = string | undefined> = EdgeBase<EdgeData, EdgeType> & EdgeLabelOptions & {
|
|
14
18
|
style?: CSSProperties;
|
|
15
19
|
className?: string;
|
|
16
20
|
updatable?: EdgeUpdatable;
|
|
17
21
|
focusable?: boolean;
|
|
18
22
|
};
|
|
19
|
-
type
|
|
20
|
-
type: 'smoothstep';
|
|
23
|
+
type SmoothStepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'smoothstep'> & {
|
|
21
24
|
pathOptions?: SmoothStepPathOptions;
|
|
22
25
|
};
|
|
23
|
-
type
|
|
24
|
-
type: 'default';
|
|
26
|
+
type BezierEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'default'> & {
|
|
25
27
|
pathOptions?: BezierPathOptions;
|
|
26
28
|
};
|
|
27
|
-
type
|
|
28
|
-
type: 'step';
|
|
29
|
+
type StepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'step'> & {
|
|
29
30
|
pathOptions?: StepPathOptions;
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
export type Edge<T = any> = DefaultEdge<T> | SmoothStepEdgeType<T> | BezierEdgeType<T> | StepEdgeType<T>;
|
|
36
|
-
export type EdgeMouseHandler = (event: ReactMouseEvent, edge: Edge) => void;
|
|
37
|
-
export type EdgeWrapperProps = {
|
|
32
|
+
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge;
|
|
33
|
+
export type EdgeMouseHandler<EdgeType extends Edge = Edge> = (event: ReactMouseEvent, edge: EdgeType) => void;
|
|
34
|
+
export type EdgeWrapperProps<EdgeType extends Edge = Edge> = {
|
|
38
35
|
id: string;
|
|
39
36
|
edgesFocusable: boolean;
|
|
40
37
|
edgesUpdatable: boolean;
|
|
41
38
|
elementsSelectable: boolean;
|
|
42
39
|
noPanClassName: string;
|
|
43
|
-
onClick?: EdgeMouseHandler
|
|
44
|
-
onDoubleClick?: EdgeMouseHandler
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onMouseMove?: EdgeMouseHandler;
|
|
51
|
-
onMouseLeave?: EdgeMouseHandler;
|
|
40
|
+
onClick?: EdgeMouseHandler<EdgeType>;
|
|
41
|
+
onDoubleClick?: EdgeMouseHandler<EdgeType>;
|
|
42
|
+
onEdgeUpdate?: OnEdgeUpdateFunc<EdgeType>;
|
|
43
|
+
onContextMenu?: EdgeMouseHandler<EdgeType>;
|
|
44
|
+
onMouseEnter?: EdgeMouseHandler<EdgeType>;
|
|
45
|
+
onMouseMove?: EdgeMouseHandler<EdgeType>;
|
|
46
|
+
onMouseLeave?: EdgeMouseHandler<EdgeType>;
|
|
52
47
|
edgeUpdaterRadius?: number;
|
|
53
|
-
onEdgeUpdateStart?: (event: ReactMouseEvent, edge:
|
|
54
|
-
onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge:
|
|
48
|
+
onEdgeUpdateStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
49
|
+
onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
|
|
55
50
|
rfId?: string;
|
|
56
51
|
edgeTypes?: EdgeTypes;
|
|
57
52
|
onError?: OnError;
|
|
53
|
+
disableKeyboardA11y?: boolean;
|
|
58
54
|
};
|
|
59
55
|
export type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
|
|
60
56
|
export type EdgeTextProps = HTMLAttributes<SVGElement> & EdgeLabelOptions & {
|
|
@@ -65,7 +61,7 @@ export type EdgeTextProps = HTMLAttributes<SVGElement> & EdgeLabelOptions & {
|
|
|
65
61
|
* Custom edge component props
|
|
66
62
|
* @public
|
|
67
63
|
*/
|
|
68
|
-
export type EdgeProps<
|
|
64
|
+
export type EdgeProps<EdgeData extends Record<string, unknown> = Record<string, unknown>, EdgeType extends string | undefined = string | undefined> = Pick<Edge<EdgeData, EdgeType>, 'id' | 'animated' | 'data' | 'style' | 'selected' | 'source' | 'target'> & EdgePosition & EdgeLabelOptions & {
|
|
69
65
|
sourceHandleId?: string | null;
|
|
70
66
|
targetHandleId?: string | null;
|
|
71
67
|
markerStart?: string;
|
|
@@ -78,13 +74,24 @@ export type EdgeProps<T = any> = Pick<Edge<T>, 'id' | 'animated' | 'data' | 'sty
|
|
|
78
74
|
* @public
|
|
79
75
|
*/
|
|
80
76
|
export type BaseEdgeProps = EdgeLabelOptions & {
|
|
77
|
+
/** Unique id of edge */
|
|
81
78
|
id?: string;
|
|
79
|
+
/** Additional padding where interacting with an edge is still possible */
|
|
82
80
|
interactionWidth?: number;
|
|
83
81
|
className?: string;
|
|
82
|
+
/** The x position of edge label */
|
|
84
83
|
labelX?: number;
|
|
84
|
+
/** The y position of edge label */
|
|
85
85
|
labelY?: number;
|
|
86
|
+
/** Marker at start of edge
|
|
87
|
+
* @example 'url(#arrow)'
|
|
88
|
+
*/
|
|
86
89
|
markerStart?: string;
|
|
90
|
+
/** Marker at end of edge
|
|
91
|
+
* @example 'url(#arrow)'
|
|
92
|
+
*/
|
|
87
93
|
markerEnd?: string;
|
|
94
|
+
/** SVG path of the edge */
|
|
88
95
|
path: string;
|
|
89
96
|
style?: CSSProperties;
|
|
90
97
|
};
|
|
@@ -129,7 +136,7 @@ export type StraightEdgeProps = Omit<EdgeComponentProps, 'sourcePosition' | 'tar
|
|
|
129
136
|
* @public
|
|
130
137
|
*/
|
|
131
138
|
export type SimpleBezierEdgeProps = EdgeComponentProps;
|
|
132
|
-
export type OnEdgeUpdateFunc<
|
|
139
|
+
export type OnEdgeUpdateFunc<EdgeType extends Edge = Edge> = (oldEdge: EdgeType, newConnection: Connection) => void;
|
|
133
140
|
export type ConnectionLineComponentProps = {
|
|
134
141
|
connectionLineStyle?: CSSProperties;
|
|
135
142
|
connectionLineType: ConnectionLineType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../../../packages/react/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,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,CAAC;AAEjD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/edges.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,a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, NodeProps } from '@xyflow/system';
|
|
1
|
+
import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, NodeProps, OnBeforeDeleteBase, Connection } from '@xyflow/system';
|
|
2
2
|
import type { NodeChange, EdgeChange, Node, Edge, ReactFlowInstance, EdgeProps } from '.';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
|
-
export type OnNodesChange = (changes: NodeChange[]) => void;
|
|
5
|
-
export type OnEdgesChange = (changes: EdgeChange[]) => void;
|
|
6
|
-
export type OnNodesDelete = (nodes:
|
|
7
|
-
export type OnEdgesDelete = (edges:
|
|
8
|
-
export type OnDelete = (params: {
|
|
9
|
-
nodes:
|
|
10
|
-
edges:
|
|
4
|
+
export type OnNodesChange<NodeType extends Node = Node> = (changes: NodeChange<NodeType>[]) => void;
|
|
5
|
+
export type OnEdgesChange<EdgeType extends Edge = Edge> = (changes: EdgeChange<EdgeType>[]) => void;
|
|
6
|
+
export type OnNodesDelete<NodeType extends Node = Node> = (nodes: NodeType[]) => void;
|
|
7
|
+
export type OnEdgesDelete<EdgeType extends Edge = Edge> = (edges: EdgeType[]) => void;
|
|
8
|
+
export type OnDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
|
|
9
|
+
nodes: NodeType[];
|
|
10
|
+
edges: EdgeType[];
|
|
11
11
|
}) => void;
|
|
12
12
|
export type NodeTypes = {
|
|
13
13
|
[key: string]: ComponentType<NodeProps>;
|
|
@@ -29,17 +29,95 @@ export type FitViewOptions = FitViewOptionsBase<Node>;
|
|
|
29
29
|
export type FitView = (fitViewOptions?: FitViewOptions) => boolean;
|
|
30
30
|
export type OnInit<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (reactFlowInstance: ReactFlowInstance<NodeType, EdgeType>) => void;
|
|
31
31
|
export type ViewportHelperFunctions = {
|
|
32
|
+
/**
|
|
33
|
+
* Zooms viewport in by 1.2.
|
|
34
|
+
*
|
|
35
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
36
|
+
*/
|
|
32
37
|
zoomIn: ZoomInOut;
|
|
38
|
+
/**
|
|
39
|
+
* Zooms viewport out by 1 / 1.2.
|
|
40
|
+
*
|
|
41
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
42
|
+
*/
|
|
33
43
|
zoomOut: ZoomInOut;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the current zoom level.
|
|
46
|
+
*
|
|
47
|
+
* @param zoomLevel - the zoom level to set
|
|
48
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
49
|
+
*/
|
|
34
50
|
zoomTo: ZoomTo;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the current zoom level.
|
|
53
|
+
*
|
|
54
|
+
* @returns current zoom as a number
|
|
55
|
+
*/
|
|
35
56
|
getZoom: GetZoom;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the current viewport.
|
|
59
|
+
*
|
|
60
|
+
* @param viewport - the viewport to set
|
|
61
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
62
|
+
*/
|
|
36
63
|
setViewport: SetViewport;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the current viewport.
|
|
66
|
+
*
|
|
67
|
+
* @returns Viewport
|
|
68
|
+
*/
|
|
37
69
|
getViewport: GetViewport;
|
|
70
|
+
/**
|
|
71
|
+
* Fits the view.
|
|
72
|
+
*
|
|
73
|
+
* @param options.padding - optional padding
|
|
74
|
+
* @param options.includeHiddenNodes - optional includeHiddenNodes
|
|
75
|
+
* @param options.minZoom - optional minZoom
|
|
76
|
+
* @param options.maxZoom - optional maxZoom
|
|
77
|
+
* @param options.duration - optional duration. If set, a transition will be applied
|
|
78
|
+
* @param options.nodes - optional nodes to fit the view to
|
|
79
|
+
*/
|
|
38
80
|
fitView: FitView;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the center of the view to the given position.
|
|
83
|
+
*
|
|
84
|
+
* @param x - x position
|
|
85
|
+
* @param y - y position
|
|
86
|
+
* @param options.zoom - optional zoom
|
|
87
|
+
*/
|
|
39
88
|
setCenter: SetCenter;
|
|
89
|
+
/**
|
|
90
|
+
* Fits the view to the given bounds .
|
|
91
|
+
*
|
|
92
|
+
* @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
|
|
93
|
+
* @param options.padding - optional padding
|
|
94
|
+
*/
|
|
40
95
|
fitBounds: FitBounds;
|
|
41
|
-
|
|
42
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Converts a screen / client position to a flow position.
|
|
98
|
+
*
|
|
99
|
+
* @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
|
|
100
|
+
* @param options.snapToGrid - if true, the converted position will be snapped to the grid
|
|
101
|
+
* @returns position as { x: number, y: number }
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
|
|
105
|
+
*/
|
|
106
|
+
screenToFlowPosition: (clientPosition: XYPosition, options?: {
|
|
107
|
+
snapToGrid: boolean;
|
|
108
|
+
}) => XYPosition;
|
|
109
|
+
/**
|
|
110
|
+
* Converts a flow position to a screen / client position.
|
|
111
|
+
*
|
|
112
|
+
* @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
|
|
113
|
+
* @returns position as { x: number, y: number }
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
|
|
117
|
+
*/
|
|
118
|
+
flowToScreenPosition: (flowPosition: XYPosition) => XYPosition;
|
|
43
119
|
viewportInitialized: boolean;
|
|
44
120
|
};
|
|
121
|
+
export type OnBeforeDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = OnBeforeDeleteBase<NodeType, EdgeType>;
|
|
122
|
+
export type IsValidConnection<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection) => boolean;
|
|
45
123
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/general.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AACpG,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACtF,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACtF,MAAM,MAAM,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;IAC1F,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EA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IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;;;;OASG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,oBAAoB,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,UAAU,CAAC;IACpG;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,YAAY,EAAE,UAAU,KAAK,UAAU,CAAC;IAC/D,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CACzG,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Rect, Viewport } from '@xyflow/system';
|
|
2
2
|
import type { Node, Edge, ViewportHelperFunctions } from '.';
|
|
3
3
|
export type ReactFlowJsonObject<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
4
4
|
nodes: NodeType[];
|
|
@@ -12,7 +12,6 @@ export type DeleteElementsOptions = {
|
|
|
12
12
|
edges?: (Edge | {
|
|
13
13
|
id: Edge['id'];
|
|
14
14
|
})[];
|
|
15
|
-
onBeforeDelete?: OnBeforeDelete;
|
|
16
15
|
};
|
|
17
16
|
export declare namespace Instance {
|
|
18
17
|
type GetNodes<NodeType extends Node = Node> = () => NodeType[];
|
|
@@ -34,15 +33,6 @@ export declare namespace Instance {
|
|
|
34
33
|
type IsNodeIntersecting<NodeType extends Node = Node> = (node: NodeType | {
|
|
35
34
|
id: Node['id'];
|
|
36
35
|
} | Rect, area: Rect, partially?: boolean) => boolean;
|
|
37
|
-
type getConnectedEdges = (id: string | (Node | {
|
|
38
|
-
id: Node['id'];
|
|
39
|
-
})[]) => Edge[];
|
|
40
|
-
type getIncomers = (node: string | Node | {
|
|
41
|
-
id: Node['id'];
|
|
42
|
-
}) => Node[];
|
|
43
|
-
type getOutgoers = (node: string | Node | {
|
|
44
|
-
id: Node['id'];
|
|
45
|
-
}) => Node[];
|
|
46
36
|
type UpdateNode<NodeType extends Node = Node> = (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
|
|
47
37
|
replace: boolean;
|
|
48
38
|
}) => void;
|
|
@@ -51,19 +41,112 @@ export declare namespace Instance {
|
|
|
51
41
|
}) => void;
|
|
52
42
|
}
|
|
53
43
|
export type ReactFlowInstance<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
44
|
+
/**
|
|
45
|
+
* Returns nodes.
|
|
46
|
+
*
|
|
47
|
+
* @returns nodes array
|
|
48
|
+
*/
|
|
54
49
|
getNodes: Instance.GetNodes<NodeType>;
|
|
50
|
+
/**
|
|
51
|
+
* Sets nodes.
|
|
52
|
+
*
|
|
53
|
+
* @param payload - the nodes to set or a function that receives the current nodes and returns the new nodes
|
|
54
|
+
*/
|
|
55
55
|
setNodes: Instance.SetNodes<NodeType>;
|
|
56
|
+
/**
|
|
57
|
+
* Adds nodes.
|
|
58
|
+
*
|
|
59
|
+
* @param payload - the nodes to add
|
|
60
|
+
*/
|
|
56
61
|
addNodes: Instance.AddNodes<NodeType>;
|
|
62
|
+
/**
|
|
63
|
+
* Returns a node by id.
|
|
64
|
+
*
|
|
65
|
+
* @param id - the node id
|
|
66
|
+
* @returns the node or undefined if no node was found
|
|
67
|
+
*/
|
|
57
68
|
getNode: Instance.GetNode<NodeType>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns edges.
|
|
71
|
+
*
|
|
72
|
+
* @returns edges array
|
|
73
|
+
*/
|
|
58
74
|
getEdges: Instance.GetEdges<EdgeType>;
|
|
75
|
+
/**
|
|
76
|
+
* Sets edges.
|
|
77
|
+
*
|
|
78
|
+
* @param payload - the edges to set or a function that receives the current edges and returns the new edges
|
|
79
|
+
*/
|
|
59
80
|
setEdges: Instance.SetEdges<EdgeType>;
|
|
81
|
+
/**
|
|
82
|
+
* Adds edges.
|
|
83
|
+
*
|
|
84
|
+
* @param payload - the edges to add
|
|
85
|
+
*/
|
|
60
86
|
addEdges: Instance.AddEdges<EdgeType>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns an edge by id.
|
|
89
|
+
*
|
|
90
|
+
* @param id - the edge id
|
|
91
|
+
* @returns the edge or undefined if no edge was found
|
|
92
|
+
*/
|
|
61
93
|
getEdge: Instance.GetEdge<EdgeType>;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the nodes, edges and the viewport as a JSON object.
|
|
96
|
+
*
|
|
97
|
+
* @returns the nodes, edges and the viewport as a JSON object
|
|
98
|
+
*/
|
|
62
99
|
toObject: Instance.ToObject<NodeType, EdgeType>;
|
|
100
|
+
/**
|
|
101
|
+
* Deletes nodes and edges.
|
|
102
|
+
*
|
|
103
|
+
* @param params.nodes - optional nodes array to delete
|
|
104
|
+
* @param params.edges - optional edges array to delete
|
|
105
|
+
*
|
|
106
|
+
* @returns a promise that resolves with the deleted nodes and edges
|
|
107
|
+
*/
|
|
63
108
|
deleteElements: Instance.DeleteElements;
|
|
109
|
+
/**
|
|
110
|
+
* Returns all nodes that intersect with the given node or rect.
|
|
111
|
+
*
|
|
112
|
+
* @param node - the node or rect to check for intersections
|
|
113
|
+
* @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
|
|
114
|
+
* @param nodes - optional nodes array to check for intersections
|
|
115
|
+
*
|
|
116
|
+
* @returns an array of intersecting nodes
|
|
117
|
+
*/
|
|
64
118
|
getIntersectingNodes: Instance.GetIntersectingNodes<NodeType>;
|
|
119
|
+
/**
|
|
120
|
+
* Checks if the given node or rect intersects with the passed rect.
|
|
121
|
+
*
|
|
122
|
+
* @param node - the node or rect to check for intersections
|
|
123
|
+
* @param area - the rect to check for intersections
|
|
124
|
+
* @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
|
|
125
|
+
*
|
|
126
|
+
* @returns true if the node or rect intersects with the given area
|
|
127
|
+
*/
|
|
65
128
|
isNodeIntersecting: Instance.IsNodeIntersecting<NodeType>;
|
|
129
|
+
/**
|
|
130
|
+
* Updates a node.
|
|
131
|
+
*
|
|
132
|
+
* @param id - id of the node to update
|
|
133
|
+
* @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
|
|
134
|
+
* @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
|
|
138
|
+
*/
|
|
66
139
|
updateNode: Instance.UpdateNode<NodeType>;
|
|
140
|
+
/**
|
|
141
|
+
* Updates the data attribute of a node.
|
|
142
|
+
*
|
|
143
|
+
* @param id - id of the node to update
|
|
144
|
+
* @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
|
|
145
|
+
* @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* updateNodeData('node-1', { label: 'A new label' });
|
|
149
|
+
*/
|
|
67
150
|
updateNodeData: Instance.UpdateNodeData<NodeType>;
|
|
68
151
|
viewportInitialized: boolean;
|
|
69
152
|
} & Omit<ViewportHelperFunctions, 'initialized'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/instance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/instance.ts"],"names":[],"mappings":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;;OAKG;IACH,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChD;;;;;;;OAOG;IACH,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC;IACxC;;;;;;;;OAQG;IACH,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9D;;;;;;;;OAQG;IACH,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1D;;;;;;;;;OASG;IACH,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1C;;;;;;;;;OASG;IACH,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClD,mBAAmB,EAAE,OAAO,CAAC;CAC9B,GAAG,IAAI,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -5,27 +5,27 @@ import { NodeTypes } from './general';
|
|
|
5
5
|
* The node data structure that gets used for the nodes prop.
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export type Node<NodeData =
|
|
8
|
+
export type Node<NodeData extends Record<string, unknown> = Record<string, unknown>, NodeType extends string | undefined = string | undefined> = NodeBase<NodeData, NodeType> & {
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
className?: string;
|
|
11
11
|
resizing?: boolean;
|
|
12
12
|
focusable?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export type NodeMouseHandler = (event: ReactMouseEvent, node:
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type NodeWrapperProps = {
|
|
14
|
+
export type NodeMouseHandler<NodeType extends Node = Node> = (event: ReactMouseEvent, node: NodeType) => void;
|
|
15
|
+
export type SelectionDragHandler<NodeType extends Node = Node> = (event: ReactMouseEvent, nodes: NodeType[]) => void;
|
|
16
|
+
export type OnNodeDrag<NodeType extends Node = Node> = (event: ReactMouseEvent, node: NodeType, nodes: NodeType[]) => void;
|
|
17
|
+
export type NodeWrapperProps<NodeType extends Node> = {
|
|
18
18
|
id: string;
|
|
19
19
|
nodesConnectable: boolean;
|
|
20
20
|
elementsSelectable: boolean;
|
|
21
21
|
nodesDraggable: boolean;
|
|
22
22
|
nodesFocusable: boolean;
|
|
23
|
-
onClick?: NodeMouseHandler
|
|
24
|
-
onDoubleClick?: NodeMouseHandler
|
|
25
|
-
onMouseEnter?: NodeMouseHandler
|
|
26
|
-
onMouseMove?: NodeMouseHandler
|
|
27
|
-
onMouseLeave?: NodeMouseHandler
|
|
28
|
-
onContextMenu?: NodeMouseHandler
|
|
23
|
+
onClick?: NodeMouseHandler<NodeType>;
|
|
24
|
+
onDoubleClick?: NodeMouseHandler<NodeType>;
|
|
25
|
+
onMouseEnter?: NodeMouseHandler<NodeType>;
|
|
26
|
+
onMouseMove?: NodeMouseHandler<NodeType>;
|
|
27
|
+
onMouseLeave?: NodeMouseHandler<NodeType>;
|
|
28
|
+
onContextMenu?: NodeMouseHandler<NodeType>;
|
|
29
29
|
resizeObserver: ResizeObserver | null;
|
|
30
30
|
noDragClassName: string;
|
|
31
31
|
noPanClassName: string;
|
|
@@ -36,4 +36,7 @@ export type NodeWrapperProps = {
|
|
|
36
36
|
nodeOrigin: NodeOrigin;
|
|
37
37
|
onError?: OnError;
|
|
38
38
|
};
|
|
39
|
+
export type BuiltInNode = Node<{
|
|
40
|
+
label: string;
|
|
41
|
+
}, 'input' | 'output' | 'default'>;
|
|
39
42
|
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAC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AAe,EACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,IAAI;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ConnectionMode, type ConnectionStatus, type CoordinateExtent, type NodeDimensionUpdate, type UpdateNodePositions, type NodeOrigin, type OnConnect, type OnError, type OnViewportChange, type SelectionRect, type SnapGrid, type ConnectingHandle, type Transform, type XYPosition, type PanZoomInstance, type PanBy, type OnConnectStart, type OnConnectEnd, type
|
|
2
|
-
import type { Edge, Node, NodeChange, OnNodesChange, OnEdgesChange, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, OnDelete } from '.';
|
|
3
|
-
export type ReactFlowStore = {
|
|
1
|
+
import { ConnectionMode, type ConnectionStatus, type CoordinateExtent, type NodeDimensionUpdate, type UpdateNodePositions, type NodeOrigin, type OnConnect, type OnError, type OnViewportChange, type SelectionRect, type SnapGrid, type ConnectingHandle, type Transform, type XYPosition, type PanZoomInstance, type PanBy, type OnConnectStart, type OnConnectEnd, type OnSelectionDrag, type OnMoveStart, type OnMove, type OnMoveEnd, type UpdateConnection, type EdgeLookup, type ConnectionLookup, type NodeLookup } from '@xyflow/system';
|
|
2
|
+
import type { Edge, Node, NodeChange, OnNodesChange, OnEdgesChange, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, OnDelete, OnNodeDrag, OnBeforeDelete, IsValidConnection, EdgeChange } from '.';
|
|
3
|
+
export type ReactFlowStore<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
|
|
4
4
|
rfId: string;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
transform: Transform;
|
|
8
|
-
nodes:
|
|
9
|
-
nodeLookup: NodeLookup<
|
|
8
|
+
nodes: NodeType[];
|
|
9
|
+
nodeLookup: NodeLookup<NodeType>;
|
|
10
10
|
edges: Edge[];
|
|
11
|
-
edgeLookup: EdgeLookup<
|
|
11
|
+
edgeLookup: EdgeLookup<EdgeType>;
|
|
12
12
|
connectionLookup: ConnectionLookup;
|
|
13
|
-
onNodesChange: OnNodesChange | null;
|
|
14
|
-
onEdgesChange: OnEdgesChange | null;
|
|
13
|
+
onNodesChange: OnNodesChange<NodeType> | null;
|
|
14
|
+
onEdgesChange: OnEdgesChange<EdgeType> | null;
|
|
15
15
|
hasDefaultNodes: boolean;
|
|
16
16
|
hasDefaultEdges: boolean;
|
|
17
17
|
domNode: HTMLDivElement | null;
|
|
@@ -45,9 +45,9 @@ export type ReactFlowStore = {
|
|
|
45
45
|
connectionStartHandle: ConnectingHandle | null;
|
|
46
46
|
connectionEndHandle: ConnectingHandle | null;
|
|
47
47
|
connectionClickStartHandle: ConnectingHandle | null;
|
|
48
|
-
onNodeDragStart?: OnNodeDrag
|
|
49
|
-
onNodeDrag?: OnNodeDrag
|
|
50
|
-
onNodeDragStop?: OnNodeDrag
|
|
48
|
+
onNodeDragStart?: OnNodeDrag<NodeType>;
|
|
49
|
+
onNodeDrag?: OnNodeDrag<NodeType>;
|
|
50
|
+
onNodeDragStop?: OnNodeDrag<NodeType>;
|
|
51
51
|
onSelectionDragStart?: OnSelectionDrag;
|
|
52
52
|
onSelectionDrag?: OnSelectionDrag;
|
|
53
53
|
onSelectionDragStop?: OnSelectionDrag;
|
|
@@ -64,26 +64,27 @@ export type ReactFlowStore = {
|
|
|
64
64
|
fitViewOnInit: boolean;
|
|
65
65
|
fitViewDone: boolean;
|
|
66
66
|
fitViewOnInitOptions: FitViewOptions | undefined;
|
|
67
|
-
onNodesDelete?: OnNodesDelete
|
|
68
|
-
onEdgesDelete?: OnEdgesDelete
|
|
67
|
+
onNodesDelete?: OnNodesDelete<NodeType>;
|
|
68
|
+
onEdgesDelete?: OnEdgesDelete<EdgeType>;
|
|
69
69
|
onDelete?: OnDelete;
|
|
70
70
|
onError?: OnError;
|
|
71
71
|
onViewportChangeStart?: OnViewportChange;
|
|
72
72
|
onViewportChange?: OnViewportChange;
|
|
73
73
|
onViewportChangeEnd?: OnViewportChange;
|
|
74
|
-
onBeforeDelete?: OnBeforeDelete
|
|
74
|
+
onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
|
|
75
75
|
onSelectionChangeHandlers: OnSelectionChangeFunc[];
|
|
76
76
|
ariaLiveMessage: string;
|
|
77
77
|
autoPanOnConnect: boolean;
|
|
78
78
|
autoPanOnNodeDrag: boolean;
|
|
79
79
|
connectionRadius: number;
|
|
80
|
-
isValidConnection?: IsValidConnection
|
|
80
|
+
isValidConnection?: IsValidConnection<EdgeType>;
|
|
81
81
|
lib: string;
|
|
82
|
+
debug: boolean;
|
|
82
83
|
};
|
|
83
|
-
export type ReactFlowActions = {
|
|
84
|
-
setNodes: (nodes:
|
|
85
|
-
setEdges: (edges:
|
|
86
|
-
setDefaultNodesAndEdges: (nodes?:
|
|
84
|
+
export type ReactFlowActions<NodeType extends Node, EdgeType extends Edge> = {
|
|
85
|
+
setNodes: (nodes: NodeType[]) => void;
|
|
86
|
+
setEdges: (edges: EdgeType[]) => void;
|
|
87
|
+
setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void;
|
|
87
88
|
updateNodeDimensions: (updates: Map<string, NodeDimensionUpdate>) => void;
|
|
88
89
|
updateNodePositions: UpdateNodePositions;
|
|
89
90
|
resetSelectedElements: () => void;
|
|
@@ -97,9 +98,10 @@ export type ReactFlowActions = {
|
|
|
97
98
|
cancelConnection: () => void;
|
|
98
99
|
updateConnection: UpdateConnection;
|
|
99
100
|
reset: () => void;
|
|
100
|
-
triggerNodeChanges: (changes: NodeChange[]) => void;
|
|
101
|
+
triggerNodeChanges: (changes: NodeChange<NodeType>[]) => void;
|
|
102
|
+
triggerEdgeChanges: (changes: EdgeChange<EdgeType>[]) => void;
|
|
101
103
|
panBy: PanBy;
|
|
102
|
-
fitView: (nodes:
|
|
104
|
+
fitView: (nodes: NodeType[], options?: FitViewOptions) => boolean;
|
|
103
105
|
};
|
|
104
|
-
export type ReactFlowState = ReactFlowStore & ReactFlowActions
|
|
106
|
+
export type ReactFlowState<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ReactFlowStore<NodeType, EdgeType> & ReactFlowActions<NodeType, EdgeType>;
|
|
105
107
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,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,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,2BAA2B,EAC3B,QAAQ,EACR,UAAU,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