@xyflow/react 12.0.0-next.6 → 12.0.0-next.8

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.
Files changed (111) hide show
  1. package/LICENSE +1 -1
  2. package/dist/base.css +2 -16
  3. package/dist/esm/additional-components/Background/types.d.ts +13 -0
  4. package/dist/esm/additional-components/Background/types.d.ts.map +1 -1
  5. package/dist/esm/additional-components/Controls/types.d.ts +14 -0
  6. package/dist/esm/additional-components/Controls/types.d.ts.map +1 -1
  7. package/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map +1 -1
  8. package/dist/esm/additional-components/MiniMap/types.d.ts +21 -0
  9. package/dist/esm/additional-components/MiniMap/types.d.ts.map +1 -1
  10. package/dist/esm/additional-components/NodeResizer/types.d.ts +25 -0
  11. package/dist/esm/additional-components/NodeResizer/types.d.ts.map +1 -1
  12. package/dist/esm/additional-components/NodeToolbar/types.d.ts +10 -0
  13. package/dist/esm/additional-components/NodeToolbar/types.d.ts.map +1 -1
  14. package/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
  15. package/dist/esm/components/EdgeWrapper/index.d.ts.map +1 -1
  16. package/dist/esm/components/Handle/index.d.ts +6 -2
  17. package/dist/esm/components/Handle/index.d.ts.map +1 -1
  18. package/dist/esm/components/Panel/index.d.ts +3 -0
  19. package/dist/esm/components/Panel/index.d.ts.map +1 -1
  20. package/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -1
  21. package/dist/esm/container/FlowRenderer/index.d.ts.map +1 -1
  22. package/dist/esm/container/ReactFlow/index.d.ts +4 -117
  23. package/dist/esm/container/ReactFlow/index.d.ts.map +1 -1
  24. package/dist/esm/hooks/useConnection.d.ts +13 -7
  25. package/dist/esm/hooks/useConnection.d.ts.map +1 -1
  26. package/dist/esm/hooks/useDrag.d.ts +1 -1
  27. package/dist/esm/hooks/useDrag.d.ts.map +1 -1
  28. package/dist/esm/hooks/useHandleConnections.d.ts +1 -1
  29. package/dist/esm/hooks/useNodesEdgesState.d.ts +2 -2
  30. package/dist/esm/hooks/useNodesEdgesState.d.ts.map +1 -1
  31. package/dist/esm/hooks/useNodesInitialized.d.ts.map +1 -1
  32. package/dist/esm/hooks/useOnSelectionChange.d.ts +1 -1
  33. package/dist/esm/hooks/useUpdateNodePositions.d.ts.map +1 -1
  34. package/dist/esm/index.d.ts +3 -3
  35. package/dist/esm/index.d.ts.map +1 -1
  36. package/dist/esm/index.js +76 -96
  37. package/dist/esm/index.mjs +76 -96
  38. package/dist/esm/store/initialState.d.ts.map +1 -1
  39. package/dist/esm/types/changes.d.ts +2 -2
  40. package/dist/esm/types/changes.d.ts.map +1 -1
  41. package/dist/esm/types/component-props.d.ts +346 -8
  42. package/dist/esm/types/component-props.d.ts.map +1 -1
  43. package/dist/esm/types/edges.d.ts +11 -0
  44. package/dist/esm/types/edges.d.ts.map +1 -1
  45. package/dist/esm/types/general.d.ts +83 -6
  46. package/dist/esm/types/general.d.ts.map +1 -1
  47. package/dist/esm/types/instance.d.ts +93 -9
  48. package/dist/esm/types/instance.d.ts.map +1 -1
  49. package/dist/esm/types/nodes.d.ts +3 -3
  50. package/dist/esm/types/nodes.d.ts.map +1 -1
  51. package/dist/esm/types/store.d.ts +2 -2
  52. package/dist/esm/types/store.d.ts.map +1 -1
  53. package/dist/esm/utils/changes.d.ts +3 -3
  54. package/dist/esm/utils/changes.d.ts.map +1 -1
  55. package/dist/esm/utils/general.d.ts +2 -49
  56. package/dist/esm/utils/general.d.ts.map +1 -1
  57. package/dist/style.css +10 -12
  58. package/dist/umd/additional-components/Background/types.d.ts +13 -0
  59. package/dist/umd/additional-components/Background/types.d.ts.map +1 -1
  60. package/dist/umd/additional-components/Controls/types.d.ts +14 -0
  61. package/dist/umd/additional-components/Controls/types.d.ts.map +1 -1
  62. package/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map +1 -1
  63. package/dist/umd/additional-components/MiniMap/types.d.ts +21 -0
  64. package/dist/umd/additional-components/MiniMap/types.d.ts.map +1 -1
  65. package/dist/umd/additional-components/NodeResizer/types.d.ts +25 -0
  66. package/dist/umd/additional-components/NodeResizer/types.d.ts.map +1 -1
  67. package/dist/umd/additional-components/NodeToolbar/types.d.ts +10 -0
  68. package/dist/umd/additional-components/NodeToolbar/types.d.ts.map +1 -1
  69. package/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
  70. package/dist/umd/components/EdgeWrapper/index.d.ts.map +1 -1
  71. package/dist/umd/components/Handle/index.d.ts +6 -2
  72. package/dist/umd/components/Handle/index.d.ts.map +1 -1
  73. package/dist/umd/components/Panel/index.d.ts +3 -0
  74. package/dist/umd/components/Panel/index.d.ts.map +1 -1
  75. package/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map +1 -1
  76. package/dist/umd/container/FlowRenderer/index.d.ts.map +1 -1
  77. package/dist/umd/container/ReactFlow/index.d.ts +4 -117
  78. package/dist/umd/container/ReactFlow/index.d.ts.map +1 -1
  79. package/dist/umd/hooks/useConnection.d.ts +13 -7
  80. package/dist/umd/hooks/useConnection.d.ts.map +1 -1
  81. package/dist/umd/hooks/useDrag.d.ts +1 -1
  82. package/dist/umd/hooks/useDrag.d.ts.map +1 -1
  83. package/dist/umd/hooks/useHandleConnections.d.ts +1 -1
  84. package/dist/umd/hooks/useNodesEdgesState.d.ts +2 -2
  85. package/dist/umd/hooks/useNodesEdgesState.d.ts.map +1 -1
  86. package/dist/umd/hooks/useNodesInitialized.d.ts.map +1 -1
  87. package/dist/umd/hooks/useOnSelectionChange.d.ts +1 -1
  88. package/dist/umd/hooks/useUpdateNodePositions.d.ts.map +1 -1
  89. package/dist/umd/index.d.ts +3 -3
  90. package/dist/umd/index.d.ts.map +1 -1
  91. package/dist/umd/index.js +2 -2
  92. package/dist/umd/store/initialState.d.ts.map +1 -1
  93. package/dist/umd/types/changes.d.ts +2 -2
  94. package/dist/umd/types/changes.d.ts.map +1 -1
  95. package/dist/umd/types/component-props.d.ts +346 -8
  96. package/dist/umd/types/component-props.d.ts.map +1 -1
  97. package/dist/umd/types/edges.d.ts +11 -0
  98. package/dist/umd/types/edges.d.ts.map +1 -1
  99. package/dist/umd/types/general.d.ts +83 -6
  100. package/dist/umd/types/general.d.ts.map +1 -1
  101. package/dist/umd/types/instance.d.ts +93 -9
  102. package/dist/umd/types/instance.d.ts.map +1 -1
  103. package/dist/umd/types/nodes.d.ts +3 -3
  104. package/dist/umd/types/nodes.d.ts.map +1 -1
  105. package/dist/umd/types/store.d.ts +2 -2
  106. package/dist/umd/types/store.d.ts.map +1 -1
  107. package/dist/umd/utils/changes.d.ts +3 -3
  108. package/dist/umd/utils/changes.d.ts.map +1 -1
  109. package/dist/umd/utils/general.d.ts +2 -49
  110. package/dist/umd/utils/general.d.ts.map +1 -1
  111. package/package.json +4 -4
@@ -1,124 +1,462 @@
1
1
  import type { CSSProperties, HTMLAttributes, MouseEvent as ReactMouseEvent, WheelEvent } from 'react';
2
- import type { ConnectionMode, ConnectionLineType, OnConnect, OnConnectStart, OnConnectEnd, CoordinateExtent, KeyCode, PanOnScrollMode, ProOptions, PanelPosition, OnMove, OnMoveStart, OnMoveEnd, Viewport, NodeOrigin, HandleType, SelectionMode, OnError, IsValidConnection, ColorMode, SnapGrid, OnBeforeDelete } from '@xyflow/system';
3
- import type { OnSelectionChangeFunc, NodeTypes, EdgeTypes, Node, Edge, ConnectionLineComponent, OnEdgeUpdateFunc, OnInit, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnDelete, OnNodesChange, OnEdgesChange, NodeDragHandler, NodeMouseHandler, SelectionDragHandler, EdgeMouseHandler } from '.';
2
+ import type { ConnectionMode, ConnectionLineType, OnConnect, OnConnectStart, OnConnectEnd, CoordinateExtent, KeyCode, PanOnScrollMode, ProOptions, PanelPosition, OnMove, OnMoveStart, OnMoveEnd, Viewport, NodeOrigin, HandleType, SelectionMode, OnError, IsValidConnection, ColorMode, SnapGrid } from '@xyflow/system';
3
+ import type { OnSelectionChangeFunc, NodeTypes, EdgeTypes, Node, Edge, ConnectionLineComponent, OnEdgeUpdateFunc, OnInit, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnDelete, OnNodesChange, OnEdgesChange, NodeMouseHandler, SelectionDragHandler, EdgeMouseHandler, OnNodeDrag, OnBeforeDelete } from '.';
4
4
  /**
5
5
  * ReactFlow component props.
6
6
  * @public
7
7
  */
8
- export type ReactFlowProps = Omit<HTMLAttributes<HTMLDivElement>, 'onError'> & {
8
+ export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onError'> {
9
+ /** An array of nodes to render in a controlled flow.
10
+ * @example
11
+ * const nodes = [
12
+ * {
13
+ * id: 'node-1',
14
+ * type: 'input',
15
+ * data: { label: 'Node 1' },
16
+ * position: { x: 250, y: 50 }
17
+ * }
18
+ * ];
19
+ */
9
20
  nodes?: Node[];
21
+ /** An array of edges to render in a controlled flow.
22
+ * @example
23
+ * const edges = [
24
+ * {
25
+ * id: 'edge-1-2',
26
+ * source: 'node-1',
27
+ * target: 'node-2',
28
+ * }
29
+ * ];
30
+ */
10
31
  edges?: Edge[];
32
+ /** The initial nodes to render in an uncontrolled flow. */
11
33
  defaultNodes?: Node[];
34
+ /** The initial edges to render in an uncontrolled flow. */
12
35
  defaultEdges?: Edge[];
36
+ /** Defaults to be applied to all new edges that are added to the flow.
37
+ *
38
+ * Properties on a new edge will override these defaults if they exist.
39
+ * @example
40
+ * const defaultEdgeOptions = {
41
+ * type: 'customEdgeType',
42
+ * animated: true,
43
+ * interactionWidth: 10,
44
+ * data: { label: 'custom label' },
45
+ * hidden: false,
46
+ * deletable: true,
47
+ * selected: false,
48
+ * focusable: true,
49
+ * markerStart: EdgeMarker.ArrowClosed,
50
+ * markerEnd: EdgeMarker.ArrowClosed,
51
+ * zIndex: 12,
52
+ * ariaLabel: 'custom aria label'
53
+ * }
54
+ */
13
55
  defaultEdgeOptions?: DefaultEdgeOptions;
56
+ /** This event handler is called when a user clicks on a node */
14
57
  onNodeClick?: NodeMouseHandler;
58
+ /** This event handler is called when a user double clicks on a node */
15
59
  onNodeDoubleClick?: NodeMouseHandler;
60
+ /** This event handler is called when mouse of a user enters a node */
16
61
  onNodeMouseEnter?: NodeMouseHandler;
62
+ /** This event handler is called when mouse of a user moves over a node */
17
63
  onNodeMouseMove?: NodeMouseHandler;
64
+ /** This event handler is called when mouse of a user leaves a node */
18
65
  onNodeMouseLeave?: NodeMouseHandler;
66
+ /** This event handler is called when a user right clicks on a node */
19
67
  onNodeContextMenu?: NodeMouseHandler;
20
- onNodeDragStart?: NodeDragHandler;
21
- onNodeDrag?: NodeDragHandler;
22
- onNodeDragStop?: NodeDragHandler;
68
+ /** This event handler is called when a user starts to drag a node */
69
+ onNodeDragStart?: OnNodeDrag;
70
+ /** This event handler is called when a user drags a node */
71
+ onNodeDrag?: OnNodeDrag;
72
+ /** This event handler is called when a user stops dragging a node */
73
+ onNodeDragStop?: OnNodeDrag;
74
+ /** This event handler is called when a user clicks on an edge */
23
75
  onEdgeClick?: (event: ReactMouseEvent, edge: Edge) => void;
24
- onEdgeUpdate?: OnEdgeUpdateFunc;
76
+ /** This event handler is called when a user right clicks on an edge */
25
77
  onEdgeContextMenu?: EdgeMouseHandler;
78
+ /** This event handler is called when mouse of a user enters an edge */
26
79
  onEdgeMouseEnter?: EdgeMouseHandler;
80
+ /** This event handler is called when mouse of a user moves over an edge */
27
81
  onEdgeMouseMove?: EdgeMouseHandler;
82
+ /** This event handler is called when mouse of a user leaves an edge */
28
83
  onEdgeMouseLeave?: EdgeMouseHandler;
84
+ /** This event handler is called when a user double clicks on an edge */
29
85
  onEdgeDoubleClick?: EdgeMouseHandler;
30
86
  onEdgeUpdateStart?: (event: ReactMouseEvent, edge: Edge, handleType: HandleType) => void;
31
87
  onEdgeUpdateEnd?: (event: MouseEvent | TouchEvent, edge: Edge, handleType: HandleType) => void;
88
+ onEdgeUpdate?: OnEdgeUpdateFunc;
89
+ /** This event handler is called when a Node is updated
90
+ * @example // Use NodesState hook to create edges and get onNodesChange handler
91
+ * import ReactFlow, { useNodesState } from '@xyflow/react';
92
+ * const [edges, setNodes, onNodesChange] = useNodesState(initialNodes);
93
+ *
94
+ * return (<ReactFlow onNodeChange={onNodeChange} {...rest} />)
95
+ * @example // Use helper function to update edge
96
+ * import ReactFlow, { applyNodeChanges } from '@xyflow/react';
97
+ *
98
+ * const onNodeChange = useCallback(
99
+ * (changes) => setNode((eds) => applyNodeChanges(changes, eds)),
100
+ * [],
101
+ * );
102
+ *
103
+ * return (<ReactFlow onNodeChange={onNodeChange} {...rest} />)
104
+ */
32
105
  onNodesChange?: OnNodesChange;
106
+ /** This event handler is called when a Edge is updated
107
+ * @example // Use EdgesState hook to create edges and get onEdgesChange handler
108
+ * import ReactFlow, { useEdgesState } from '@xyflow/react';
109
+ * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
110
+ *
111
+ * return (<ReactFlow onEdgesChange={onEdgesChange} {...rest} />)
112
+ * @example // Use helper function to update edge
113
+ * import ReactFlow, { applyEdgeChanges } from '@xyflow/react';
114
+ *
115
+ * const onEdgesChange = useCallback(
116
+ * (changes) => setEdges((eds) => applyEdgeChanges(changes, eds)),
117
+ * [],
118
+ * );
119
+ *
120
+ * return (<ReactFlow onEdgesChange={onEdgesChange} {...rest} />)
121
+ */
33
122
  onEdgesChange?: OnEdgesChange;
123
+ /** This event handler gets called when a Node is deleted */
34
124
  onNodesDelete?: OnNodesDelete;
125
+ /** This event handler gets called when a Edge is deleted */
35
126
  onEdgesDelete?: OnEdgesDelete;
127
+ /** This event handler gets called when a Node or Edge is deleted */
36
128
  onDelete?: OnDelete;
129
+ /** This event handler gets called when a user starts to drag a selection box */
37
130
  onSelectionDragStart?: SelectionDragHandler;
131
+ /** This event handler gets called when a user drags a selection box */
38
132
  onSelectionDrag?: SelectionDragHandler;
133
+ /** This event handler gets called when a user stops dragging a selection box */
39
134
  onSelectionDragStop?: SelectionDragHandler;
40
135
  onSelectionStart?: (event: ReactMouseEvent) => void;
41
136
  onSelectionEnd?: (event: ReactMouseEvent) => void;
42
137
  onSelectionContextMenu?: (event: ReactMouseEvent, nodes: Node[]) => void;
138
+ /** When a connection line is completed and two nodes are connected by the user, this event fires with the new connection.
139
+ *
140
+ * You can use the addEdge utility to convert the connection to a complete edge.
141
+ * @example // Use helper function to update edges onConnect
142
+ * import ReactFlow, { addEdge } from '@xyflow/react';
143
+ *
144
+ * const onConnect = useCallback(
145
+ * (params) => setEdges((eds) => addEdge(params, eds)),
146
+ * [],
147
+ * );
148
+ *
149
+ * return (<ReactFlow onConnect={onConnect} {...rest} />)
150
+ */
43
151
  onConnect?: OnConnect;
152
+ /** This event handler gets called when a user starts to drag a connection line */
44
153
  onConnectStart?: OnConnectStart;
154
+ /** This event handler gets called when a user stops dragging a connection line */
45
155
  onConnectEnd?: OnConnectEnd;
46
156
  onClickConnectStart?: OnConnectStart;
47
157
  onClickConnectEnd?: OnConnectEnd;
158
+ /** This event handler gets called when a flow has finished initializing */
48
159
  onInit?: OnInit;
160
+ /** This event handler is called while the user is either panning or zooming the viewport. */
49
161
  onMove?: OnMove;
162
+ /** This event handler gets called when a user starts to pan or zoom the viewport */
50
163
  onMoveStart?: OnMoveStart;
164
+ /** This event handler gets called when a user stops panning or zooming the viewport */
51
165
  onMoveEnd?: OnMoveEnd;
166
+ /** This event handler gets called when a user changes group of selected elements in the flow */
52
167
  onSelectionChange?: OnSelectionChangeFunc;
168
+ /** This event handler gets called when user scroll inside the pane */
53
169
  onPaneScroll?: (event?: WheelEvent) => void;
170
+ /** This event handler gets called when user clicks inside the pane */
54
171
  onPaneClick?: (event: ReactMouseEvent) => void;
172
+ /** This event handler gets called when user right clicks inside the pane */
55
173
  onPaneContextMenu?: (event: ReactMouseEvent | MouseEvent) => void;
174
+ /** This event handler gets called when mouse enters the pane */
56
175
  onPaneMouseEnter?: (event: ReactMouseEvent) => void;
176
+ /** This event handler gets called when mouse moves over the pane */
57
177
  onPaneMouseMove?: (event: ReactMouseEvent) => void;
178
+ /** This event handler gets called when mouse leaves the pane */
58
179
  onPaneMouseLeave?: (event: ReactMouseEvent) => void;
180
+ /** This handler gets called before the user deletes nodes or edges and provides a way to abort the deletion by returning false. */
59
181
  onBeforeDelete?: OnBeforeDelete;
182
+ /** Custom node types to be available in a flow.
183
+ *
184
+ * React Flow matches a node's type to a component in the nodeTypes object.
185
+ * @example
186
+ * import CustomNode from './CustomNode';
187
+ *
188
+ * const nodeTypes = { nameOfNodeType: CustomNode };
189
+ */
60
190
  nodeTypes?: NodeTypes;
191
+ /** Custom edge types to be available in a flow.
192
+ *
193
+ * React Flow matches an edge's type to a component in the edgeTypes object.
194
+ * @example
195
+ * import CustomEdge from './CustomEdge';
196
+ *
197
+ * const edgeTypes = { nameOfEdgeType: CustomEdge };
198
+ */
61
199
  edgeTypes?: EdgeTypes;
200
+ /** The type of edge path to use for connection lines.
201
+ *
202
+ * 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!
203
+ */
62
204
  connectionLineType?: ConnectionLineType;
205
+ /** Styles to be applied to the connection line */
63
206
  connectionLineStyle?: CSSProperties;
207
+ /** React Component to be used as a connection line */
64
208
  connectionLineComponent?: ConnectionLineComponent;
209
+ /** Styles to be applied to the container of the connection line */
65
210
  connectionLineContainerStyle?: CSSProperties;
211
+ /** 'strict' connection mode will only allow you to connect source handles to target handles.
212
+ *
213
+ * 'loose' connection mode will allow you to connect handles of any type to one another.
214
+ * @default 'strict'
215
+ */
66
216
  connectionMode?: ConnectionMode;
217
+ /** Pressing down this key deletes all selected nodes & edges.
218
+ * @default 'Backspace'
219
+ */
67
220
  deleteKeyCode?: KeyCode | null;
221
+ /** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
222
+ *
223
+ * By setting this prop to null you can disable this functionality.
224
+ * @default 'Space'
225
+ */
68
226
  selectionKeyCode?: KeyCode | null;
227
+ /** Select multiple elements with a selection box, without pressing down selectionKey */
69
228
  selectionOnDrag?: boolean;
229
+ /** When set to "partial", when the user creates a selection box by click and dragging nodes that are only partially in the box are still selected.
230
+ * @default 'full'
231
+ */
70
232
  selectionMode?: SelectionMode;
233
+ /** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
234
+ *
235
+ * By setting this prop to null you can disable this functionality.
236
+ * @default 'Space'
237
+ */
71
238
  panActivationKeyCode?: KeyCode | null;
239
+ /** Pressing down this key you can select multiple elements by clicking.
240
+ * @default 'Meta' for macOS, "Ctrl" for other systems
241
+ */
72
242
  multiSelectionKeyCode?: KeyCode | null;
243
+ /** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
244
+ *
245
+ * By setting this prop to null you can disable this functionality.
246
+ * @default 'Meta' for macOS, "Ctrl" for other systems
247
+ * */
73
248
  zoomActivationKeyCode?: KeyCode | null;
249
+ /** Set this prop to make the flow snap to the grid */
74
250
  snapToGrid?: boolean;
251
+ /** Grid all nodes will snap to
252
+ * @example [20, 20]
253
+ */
75
254
  snapGrid?: SnapGrid;
255
+ /** You can enable this optimisation to instruct Svelte Flow to only render nodes and edges that would be visible in the viewport.
256
+ *
257
+ * This might improve performance when you have a large number of nodes and edges but also adds an overhead.
258
+ * @default false
259
+ */
76
260
  onlyRenderVisibleElements?: boolean;
261
+ /** Controls if all nodes should be draggable
262
+ * @default true
263
+ */
77
264
  nodesDraggable?: boolean;
265
+ /** Controls if all nodes should be connectable to each other
266
+ * @default true
267
+ */
78
268
  nodesConnectable?: boolean;
269
+ /** Controls if all nodes should be focusable
270
+ * @default true
271
+ */
79
272
  nodesFocusable?: boolean;
273
+ /** Defines nodes relative position to its coordinates
274
+ * @example
275
+ * [0, 0] // default, top left
276
+ * [0.5, 0.5] // center
277
+ * [1, 1] // bottom right
278
+ */
80
279
  nodeOrigin?: NodeOrigin;
280
+ /** Controls if all edges should be focusable
281
+ * @default true
282
+ */
81
283
  edgesFocusable?: boolean;
284
+ /** Controls if all edges should be updateable
285
+ * @default true
286
+ */
82
287
  edgesUpdatable?: boolean;
288
+ /** Controls if all elements should (nodes & edges) be selectable
289
+ * @default true
290
+ */
83
291
  elementsSelectable?: boolean;
292
+ /** If true, nodes get selected on drag
293
+ * @default true
294
+ */
84
295
  selectNodesOnDrag?: boolean;
296
+ /** Enableing this prop allows users to pan the viewport by clicking and dragging.
297
+ *
298
+ * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
299
+ * @example [0, 2] // allows panning with the left and right mouse buttons
300
+ * [0, 1, 2, 3, 4] // allows panning with all mouse buttons
301
+ */
85
302
  panOnDrag?: boolean | number[];
303
+ /** Minimum zoom level
304
+ * @default 0.1
305
+ */
86
306
  minZoom?: number;
307
+ /** Maximum zoom level
308
+ * @default 1
309
+ */
87
310
  maxZoom?: number;
311
+ /** Controlled viewport to be used instead of internal one */
88
312
  viewport?: Viewport;
313
+ /** Sets the initial position and zoom of the viewport.
314
+ *
315
+ * If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
316
+ * @example
317
+ * const initialViewport = {
318
+ * zoom: 0.5,
319
+ * position: { x: 0, y: 0 }
320
+ * };
321
+ */
89
322
  defaultViewport?: Viewport;
323
+ /**
324
+ * Gets called when the viewport changes.
325
+ */
90
326
  onViewportChange?: (viewport: Viewport) => void;
327
+ /** By default the viewport extends infinitely. You can use this prop to set a boundary.
328
+ *
329
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
330
+ * @example [[-1000, -10000], [1000, 1000]]
331
+ */
91
332
  translateExtent?: CoordinateExtent;
333
+ /** Disabling this prop will allow the user to scroll the page even when their pointer is over the flow.
334
+ * @default true
335
+ */
92
336
  preventScrolling?: boolean;
337
+ /** By default nodes can be placed on an infinite flow. You can use this prop to set a boundary.
338
+ *
339
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
340
+ * @example [[-1000, -10000], [1000, 1000]]
341
+ */
93
342
  nodeExtent?: CoordinateExtent;
343
+ /** Color of edge markers
344
+ * @example "#b1b1b7"
345
+ */
94
346
  defaultMarkerColor?: string;
347
+ /** Controls if the viewport should zoom by scrolling inside the container */
95
348
  zoomOnScroll?: boolean;
349
+ /** Controls if the viewport should zoom by pinching on a touch screen */
96
350
  zoomOnPinch?: boolean;
351
+ /** Controls if the viewport should pan by scrolling inside the container
352
+ *
353
+ * Can be limited to a specific direction with panOnScrollMode
354
+ */
97
355
  panOnScroll?: boolean;
356
+ /** Controls how fast viewport should be panned on scroll.
357
+ *
358
+ * Use togther with panOnScroll prop.
359
+ */
98
360
  panOnScrollSpeed?: number;
361
+ /** This prop is used to limit the direction of panning when panOnScroll is enabled.
362
+ *
363
+ * The "free" option allows panning in any direction.
364
+ * @default "free"
365
+ * @example "horizontal" | "vertical"
366
+ */
99
367
  panOnScrollMode?: PanOnScrollMode;
368
+ /** Controls if the viewport should zoom by double clicking somewhere on the flow */
100
369
  zoomOnDoubleClick?: boolean;
101
370
  edgeUpdaterRadius?: number;
102
371
  noDragClassName?: string;
103
372
  noWheelClassName?: string;
104
373
  noPanClassName?: string;
374
+ /** If set, initial viewport will show all nodes & edges */
105
375
  fitView?: boolean;
376
+ /** Options to be used in combination with fitView
377
+ * @example
378
+ * const fitViewOptions = {
379
+ * padding: 0.1,
380
+ * includeHiddenNodes: false,
381
+ * minZoom: 0.1,
382
+ * maxZoom: 1,
383
+ * duration: 200,
384
+ * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
385
+ * };
386
+ */
106
387
  fitViewOptions?: FitViewOptions;
388
+ /**The connectOnClick option lets you click or tap on a source handle to start a connection
389
+ * and then click on a target handle to complete the connection.
390
+ *
391
+ * If you set this option to false, users will need to drag the connection line to the target
392
+ * handle to create a connection.
393
+ */
107
394
  connectOnClick?: boolean;
395
+ /** Set position of the attribution
396
+ * @default 'bottom-right'
397
+ * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
398
+ */
108
399
  attributionPosition?: PanelPosition;
400
+ /** By default, we render a small attribution in the corner of your flows that links back to the project.
401
+ *
402
+ * Anyone is free to remove this attribution whether they're a Pro subscriber or not
403
+ * but we ask that you take a quick look at our {@link https://reactflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide}
404
+ * before doing so.
405
+ */
109
406
  proOptions?: ProOptions;
407
+ /** Enabling this option will raise the z-index of nodes when they are selected.
408
+ * @default true
409
+ */
110
410
  elevateNodesOnSelect?: boolean;
411
+ /** Enabling this option will raise the z-index of edges when they are selected.
412
+ * @default true
413
+ */
111
414
  elevateEdgesOnSelect?: boolean;
415
+ /**
416
+ * Can be set true if built-in keyboard controls should be disabled.
417
+ * @default false
418
+ */
112
419
  disableKeyboardA11y?: boolean;
420
+ /** You can enable this prop to automatically pan the viewport while dragging a node.
421
+ * @default true
422
+ */
113
423
  autoPanOnNodeDrag?: boolean;
424
+ /** You can enable this prop to automatically pan the viewport while dragging a node.
425
+ * @default true
426
+ */
114
427
  autoPanOnConnect?: boolean;
428
+ /** You can enable this prop to automatically pan the viewport while making a new connection.
429
+ * @default true
430
+ */
115
431
  connectionRadius?: number;
432
+ /** Ocassionally something may happen that causes Svelte Flow to throw an error.
433
+ *
434
+ * Instead of exploding your application, we log a message to the console and then call this event handler.
435
+ * You might use it for additional logging or to show a message to the user.
436
+ */
116
437
  onError?: OnError;
438
+ /** This callback can be used to validate a new connection
439
+ *
440
+ * If you return false, the edge will not be added to your flow.
441
+ * If you have custom connection logic its preferred to use this callback over the isValidConnection prop on the handle component for performance reasons.
442
+ * @default (connection: Connection) => true
443
+ */
117
444
  isValidConnection?: IsValidConnection;
445
+ /** With a threshold greater than zero you can control the distinction between node drag and click events.
446
+ *
447
+ * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
448
+ * @default 1
449
+ */
118
450
  nodeDragThreshold?: number;
451
+ /** Sets a fixed width for the flow */
119
452
  width?: number;
453
+ /** Sets a fixed height for the flow */
120
454
  height?: number;
455
+ /** Controls color scheme used for styling the flow
456
+ * @default 'system'
457
+ * @example 'system' | 'light' | 'dark'
458
+ */
121
459
  colorMode?: ColorMode;
122
- };
460
+ }
123
461
  export type ReactFlowRefType = HTMLDivElement;
124
462
  //# sourceMappingURL=component-props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../../../packages/react/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,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,gBAAgB,EAChB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,GAAG;IAC7E,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,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/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CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../../../packages/react/src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAA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iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC"}
@@ -76,13 +76,24 @@ export type EdgeProps<T = any> = Pick<Edge<T>, 'id' | 'animated' | 'data' | 'sty
76
76
  * @public
77
77
  */
78
78
  export type BaseEdgeProps = EdgeLabelOptions & {
79
+ /** Unique id of edge */
79
80
  id?: string;
81
+ /** Additional padding where interacting with an edge is still possible */
80
82
  interactionWidth?: number;
81
83
  className?: string;
84
+ /** The x position of edge label */
82
85
  labelX?: number;
86
+ /** The y position of edge label */
83
87
  labelY?: number;
88
+ /** Marker at start of edge
89
+ * @example 'url(#arrow)'
90
+ */
84
91
  markerStart?: string;
92
+ /** Marker at end of edge
93
+ * @example 'url(#arrow)'
94
+ */
85
95
  markerEnd?: string;
96
+ /** SVG path of the edge */
86
97
  path: string;
87
98
  style?: CSSProperties;
88
99
  };
@@ -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,WAAW,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAA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EAAE,QAAQ,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC,4BAA4B,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
- import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, NodeProps } from '@xyflow/system';
1
+ import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, NodeProps, OnBeforeDeleteBase } 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: Node[]) => void;
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
7
  export type OnEdgesDelete = (edges: Edge[]) => void;
8
8
  export type OnDelete = (params: {
9
9
  nodes: Node[];
@@ -29,17 +29,94 @@ 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
- screenToFlowPosition: (position: XYPosition) => XYPosition;
42
- flowToScreenPosition: (position: XYPosition) => XYPosition;
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>;
45
122
  //# sourceMappingURL=general.d.ts.map