@dschz/solid-flow 0.2.2 → 0.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
- import { JSX, ParentProps, ParentComponent, Accessor } from 'solid-js';
2
- import { NodeProps as NodeProps$1, NodeBase, InternalNodeBase, EdgeBase, EdgePosition, BezierPathOptions, StepPathOptions, SmoothStepPathOptions, DefaultEdgeOptionsBase, OnReconnect, HandleType, FinalConnectionState, PanOnScrollMode as PanOnScrollMode$1, Position as Position$1, FitViewOptionsBase, ResizeControlVariant as ResizeControlVariant$1, ConnectionMode as ConnectionMode$1, SelectionMode as SelectionMode$1, ConnectionLineType as ConnectionLineType$2, Connection, OnBeforeDeleteBase, XYPosition, Handle as Handle$1, PanelPosition, Viewport, OnMove, OnMoveStart, OnMoveEnd, HandleProps as HandleProps$1, MarkerProps as MarkerProps$1, EdgeToolbarBaseProps, ShouldResize, OnResizeStart, OnResize, OnResizeEnd, ControlPosition, Align, NodeOrigin, SnapGrid, CoordinateExtent, ColorMode, ZIndexMode, ProOptions, OnError, OnConnectStart, OnConnectEnd, OnReconnectStart, OnReconnectEnd, AriaLabelConfig, ColorModeClass, ConnectionState, NodeConnection, ZoomInOut, ViewportHelperFunctionOptions, SetCenterOptions, Rect, FitBoundsOptions, HandleConnection, UpdateNodeInternals } from '@xyflow/system';
3
- export { Align, AriaLabelConfig, BezierPathOptions, Box, ColorMode, ColorModeClass, Connection, ConnectionLineType, ConnectionMode, ControlLinePosition, ControlPosition, CoordinateExtent, Dimensions, EdgeMarker, EdgeMarkerType, FitBounds, FitBoundsOptions, GetBezierPathParams, GetSmoothStepPathParams, GetStraightPathParams, HandleConnection, IsValidConnection, MarkerType, NodeConnection, NodeOrigin, OnConnect, OnConnectEnd, OnConnectStart, OnConnectStartParams, OnError, OnMove, OnMoveEnd, OnMoveStart, OnReconnect, OnReconnectEnd, OnReconnectStart, OnResize, OnResizeEnd, OnResizeStart, OnSelectionDrag, PanOnScrollMode, PanelPosition, Position, ProOptions, Rect, ResizeControlVariant, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, SelectionMode, SelectionRect, SetCenter, SetCenterOptions, SetViewport, ShouldResize, SmoothStepPathOptions, SnapGrid, Transform, Viewport, ViewportHelperFunctionOptions, XYPosition, XYZPosition, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from '@xyflow/system';
4
- import { Store, SetStoreFunction } from 'solid-js/store';
5
-
1
+ import { JSX } from "@solidjs/web";
2
+ import { Accessor, ParentComponent, ParentProps, Store, StoreSetter } from "solid-js";
3
+ import { Align, Align as Align$1, AriaLabelConfig, AriaLabelConfig as AriaLabelConfig$1, BezierPathOptions, BezierPathOptions as BezierPathOptions$1, Box, ColorMode, ColorMode as ColorMode$1, ColorModeClass, ColorModeClass as ColorModeClass$1, Connection, Connection as Connection$1, ConnectionLineType, ConnectionLineType as ConnectionLineType$1, ConnectionMode, ConnectionMode as ConnectionMode$1, ConnectionState, ControlLinePosition, ControlPosition, ControlPosition as ControlPosition$1, CoordinateExtent, CoordinateExtent as CoordinateExtent$1, DefaultEdgeOptionsBase, Dimensions, EdgeBase, EdgeMarker, EdgeMarkerType, EdgePosition, EdgeToolbarBaseProps, FinalConnectionState, FitBounds, FitBoundsOptions, FitBoundsOptions as FitBoundsOptions$1, FitViewOptionsBase, GetBezierPathParams, GetSmoothStepPathParams, GetStraightPathParams, Handle as Handle$1, HandleConnection, HandleConnection as HandleConnection$1, HandleProps, HandleType, InternalNodeBase, IsValidConnection, MarkerProps, MarkerType, NodeBase, NodeConnection, NodeConnection as NodeConnection$1, NodeOrigin, NodeOrigin as NodeOrigin$1, NodeProps as NodeProps$1, OnBeforeDeleteBase, OnConnect, OnConnectEnd, OnConnectEnd as OnConnectEnd$1, OnConnectStart, OnConnectStart as OnConnectStart$1, OnConnectStartParams, OnError, OnError as OnError$1, OnMove, OnMove as OnMove$1, OnMoveEnd, OnMoveEnd as OnMoveEnd$1, OnMoveStart, OnMoveStart as OnMoveStart$1, OnReconnect, OnReconnect as OnReconnect$1, OnReconnectEnd, OnReconnectEnd as OnReconnectEnd$1, OnReconnectStart, OnReconnectStart as OnReconnectStart$1, OnResize, OnResize as OnResize$1, OnResizeEnd, OnResizeEnd as OnResizeEnd$1, OnResizeStart, OnResizeStart as OnResizeStart$1, OnSelectionDrag, PanOnScrollMode, PanOnScrollMode as PanOnScrollMode$1, PanelPosition, PanelPosition as PanelPosition$1, Position as Position$1, Position as Position$2, ProOptions, ProOptions as ProOptions$1, Rect, Rect as Rect$1, ResizeControlVariant, ResizeControlVariant as ResizeControlVariant$1, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, SelectionMode, SelectionMode as SelectionMode$1, SelectionRect, SetCenter, SetCenterOptions, SetCenterOptions as SetCenterOptions$1, SetViewport, ShouldResize, ShouldResize as ShouldResize$1, SmoothStepPathOptions, SmoothStepPathOptions as SmoothStepPathOptions$1, SnapGrid, SnapGrid as SnapGrid$1, StepPathOptions, Transform, UpdateNodeInternals, Viewport, Viewport as Viewport$1, ViewportHelperFunctionOptions, ViewportHelperFunctionOptions as ViewportHelperFunctionOptions$1, XYPosition, XYPosition as XYPosition$1, XYZPosition, ZIndexMode, ZoomInOut, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from "@xyflow/system";
4
+ //#region src/types/node.d.ts
6
5
  /**
7
6
  * The node data structure that gets used for internal nodes.
8
7
  * There are some data structures added under node.internal
@@ -15,122 +14,122 @@ type InternalNode<NodeType extends Node = Node> = InternalNodeBase<NodeType>;
15
14
  * @public
16
15
  */
17
16
  type Node<NodeData extends UnknownStruct = UnknownStruct, NodeType extends string | undefined = string | undefined> = NodeBase<NodeData, NodeType> & {
18
- class?: string;
19
- style?: JSX.CSSProperties;
20
- focusable?: boolean;
21
- /**
22
- * The ARIA role attribute for the node element, used for accessibility.
23
- * @default "group"
24
- */
25
- ariaRole?: JSX.HTMLAttributes<HTMLDivElement>["role"];
26
- /**
27
- * General escape hatch for adding custom attributes to the node's DOM element.
28
- */
29
- domAttributes?: Omit<JSX.HTMLAttributes<HTMLDivElement>, "id" | "style" | "class" | "draggable" | "role" | "aria-label" | keyof JSX.HTMLAttributes<HTMLDivElement>>;
17
+ class?: string;
18
+ style?: JSX.CSSProperties;
19
+ focusable?: boolean;
20
+ /**
21
+ * The ARIA role attribute for the node element, used for accessibility.
22
+ * @default "group"
23
+ */
24
+ ariaRole?: JSX.HTMLAttributes<HTMLDivElement>["role"];
25
+ /**
26
+ * General escape hatch for adding custom attributes to the node's DOM element.
27
+ */
28
+ domAttributes?: Omit<JSX.HTMLAttributes<HTMLDivElement>, "id" | "style" | "class" | "draggable" | "role" | "aria-label" | keyof JSX.HTMLAttributes<HTMLDivElement>>;
30
29
  };
31
30
  type NodeProps<TData extends UnknownStruct = UnknownStruct, TType extends string | undefined = string | undefined> = NodeProps$1<Node<TData, TType>>;
32
31
  /**
33
32
  * Map of node types to their components.
34
33
  */
35
- type NodeTypes = {
36
- [K in string]: {
37
- bivarianceHack(props: NodeProps<Record<string, unknown>, string | undefined>): JSX.Element;
38
- }["bivarianceHack"];
39
- };
34
+ type NodeTypes = { [K in string]: {
35
+ bivarianceHack(props: NodeProps<Record<string, unknown>, string | undefined>): JSX.Element;
36
+ }["bivarianceHack"]; };
40
37
  type BuiltInNode = Node<{
41
- label: string;
38
+ label: string;
42
39
  }, "input" | "output" | "default"> | Node<Record<string, never>, "group">;
43
40
  type BuiltInNodeTypes = {
44
- input: (props: NodeProps<{
45
- label: string;
46
- }, "input">) => JSX.Element;
47
- output: (props: NodeProps<{
48
- label: string;
49
- }, "output">) => JSX.Element;
50
- default: (props: NodeProps<{
51
- label: string;
52
- }, "default">) => JSX.Element;
53
- group: (props: NodeProps<Record<string, never>, "group">) => JSX.Element;
41
+ input: (props: NodeProps<{
42
+ label: string;
43
+ }, "input">) => JSX.Element;
44
+ output: (props: NodeProps<{
45
+ label: string;
46
+ }, "output">) => JSX.Element;
47
+ default: (props: NodeProps<{
48
+ label: string;
49
+ }, "default">) => JSX.Element;
50
+ group: (props: NodeProps<Record<string, never>, "group">) => JSX.Element;
54
51
  };
55
-
52
+ //#endregion
53
+ //#region src/types/custom.d.ts
56
54
  type UnknownStruct = Record<string, unknown>;
57
-
55
+ //#endregion
56
+ //#region src/types/edge.d.ts
58
57
  /**
59
58
  * An `Edge` is the complete description with everything Svelte Flow needs to know in order to
60
59
  * render it.
61
60
  * @public
62
61
  */
63
62
  type Edge<EdgeData extends UnknownStruct = UnknownStruct, EdgeType extends string | undefined = string | undefined> = EdgeBase<EdgeData, EdgeType> & {
64
- label?: string;
65
- labelStyle?: JSX.CSSProperties;
66
- style?: JSX.CSSProperties;
67
- class?: string;
68
- focusable?: boolean;
69
- /**
70
- * The ARIA role attribute for the edge, used for accessibility.
71
- * @default "group"
72
- */
73
- ariaRole?: JSX.HTMLAttributes<HTMLElement>["role"];
74
- /**
75
- * General escape hatch for adding custom attributes to the edge's DOM element.
76
- */
77
- domAttributes?: Omit<JSX.SvgSVGAttributes<SVGGElement>, "id" | "style" | "class" | "role" | "aria-label">;
63
+ label?: string;
64
+ labelStyle?: JSX.CSSProperties;
65
+ style?: JSX.CSSProperties;
66
+ class?: string;
67
+ focusable?: boolean;
68
+ /**
69
+ * The ARIA role attribute for the edge, used for accessibility.
70
+ * @default "group"
71
+ */
72
+ ariaRole?: JSX.HTMLAttributes<HTMLElement>["role"];
73
+ /**
74
+ * General escape hatch for adding custom attributes to the edge's DOM element.
75
+ */
76
+ domAttributes?: Omit<JSX.SvgSVGAttributes<SVGGElement>, "id" | "style" | "class" | "role" | "aria-label">;
78
77
  };
79
78
  /**
80
79
  * Props passed to edge components. This is the main interface that custom edge components should implement.
81
80
  */
82
81
  type EdgeProps<EdgeData extends UnknownStruct = UnknownStruct, EdgeType extends string | undefined = string | undefined> = Omit<Edge<EdgeData, EdgeType>, "sourceHandle" | "targetHandle"> & EdgePosition & {
83
- markerStart?: string;
84
- markerEnd?: string;
85
- sourceHandleId?: string | null;
86
- targetHandleId?: string | null;
82
+ markerStart?: string;
83
+ markerEnd?: string;
84
+ sourceHandleId?: string | null;
85
+ targetHandleId?: string | null;
87
86
  };
88
87
  /**
89
88
  * Props for built-in edge components that render the actual SVG path.
90
89
  */
91
90
  type BaseEdgeProps = {
92
- /** SVG path of the edge */
93
- path: string;
94
- /** The x coordinate of the label */
95
- labelX?: number;
96
- /** The y coordinate of the label */
97
- labelY?: number;
98
- /** Marker at start of edge */
99
- markerStart?: string;
100
- /** Marker at end of edge */
101
- markerEnd?: string;
102
- /** CSS class for the edge */
103
- class?: string;
104
- /** Edge label */
105
- label?: string;
106
- /** Styles for the edge label */
107
- labelStyle?: JSX.CSSProperties;
108
- /** Styles for the edge path */
109
- style?: JSX.CSSProperties;
110
- /** Interaction width for edge selection */
111
- interactionWidth?: number;
91
+ /** SVG path of the edge */
92
+ path: string;
93
+ /** The x coordinate of the label */
94
+ labelX?: number;
95
+ /** The y coordinate of the label */
96
+ labelY?: number;
97
+ /** Marker at start of edge */
98
+ markerStart?: string;
99
+ /** Marker at end of edge */
100
+ markerEnd?: string;
101
+ /** CSS class for the edge */
102
+ class?: string;
103
+ /** Edge label */
104
+ label?: string;
105
+ /** Styles for the edge label */
106
+ labelStyle?: JSX.CSSProperties;
107
+ /** Styles for the edge path */
108
+ style?: JSX.CSSProperties;
109
+ /** Interaction width for edge selection */
110
+ interactionWidth?: number;
112
111
  } & JSX.SvgSVGAttributes<SVGPathElement>;
113
112
  /**
114
113
  * Props for built-in edge components (these match the actual component implementations)
115
114
  */
116
115
  type BezierEdgeProps = EdgeProps<Record<string, unknown>, "default"> & {
117
- pathOptions?: BezierPathOptions;
116
+ pathOptions?: BezierPathOptions$1;
118
117
  };
119
118
  type StraightEdgeProps = Omit<EdgeProps<Record<string, unknown>, "straight">, "sourcePosition" | "targetPosition">;
120
119
  type StepEdgeProps = EdgeProps<Record<string, unknown>, "step"> & {
121
- pathOptions?: StepPathOptions;
120
+ pathOptions?: StepPathOptions;
122
121
  };
123
122
  type SmoothStepEdgeProps = EdgeProps<Record<string, unknown>, "smoothstep"> & {
124
- pathOptions?: SmoothStepPathOptions;
123
+ pathOptions?: SmoothStepPathOptions$1;
125
124
  };
126
125
  /**
127
126
  * Built-in edge types with their component signatures
128
127
  */
129
128
  type BuiltInEdgeTypes = {
130
- default: (props: BezierEdgeProps) => JSX.Element;
131
- straight: (props: StraightEdgeProps) => JSX.Element;
132
- step: (props: StepEdgeProps) => JSX.Element;
133
- smoothstep: (props: SmoothStepEdgeProps) => JSX.Element;
129
+ default: (props: BezierEdgeProps) => JSX.Element;
130
+ straight: (props: StraightEdgeProps) => JSX.Element;
131
+ step: (props: StepEdgeProps) => JSX.Element;
132
+ smoothstep: (props: SmoothStepEdgeProps) => JSX.Element;
134
133
  };
135
134
  /**
136
135
  * Union of all built-in edge props
@@ -139,132 +138,132 @@ type BuiltInEdge = BezierEdgeProps | StraightEdgeProps | StepEdgeProps | SmoothS
139
138
  /**
140
139
  * Map of edge types to their components.
141
140
  */
142
- type EdgeTypes = {
143
- [K in string]: {
144
- bivarianceHack(props: EdgeProps<Record<string, unknown>, string | undefined>): JSX.Element;
145
- }["bivarianceHack"];
146
- };
141
+ type EdgeTypes = { [K in string]: {
142
+ bivarianceHack(props: EdgeProps<Record<string, unknown>, string | undefined>): JSX.Element;
143
+ }["bivarianceHack"]; };
147
144
  type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
148
-
149
- type NodeEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ node, event, }: {
150
- node: NodeType;
151
- event: T;
145
+ //#endregion
146
+ //#region src/types/events.d.ts
147
+ type NodeEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ node, event }: {
148
+ node: NodeType;
149
+ event: T;
152
150
  }) => void;
153
- type NodesEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ nodes, event, }: {
154
- nodes: NodeType[];
155
- event: T;
151
+ type NodesEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ nodes, event }: {
152
+ nodes: NodeType[];
153
+ event: T;
156
154
  }) => void;
157
- type NodeTargetEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ targetNode, nodes, event, }: {
158
- targetNode: NodeType | null;
159
- nodes: NodeType[];
160
- event: T;
155
+ type NodeTargetEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ targetNode, nodes, event }: {
156
+ targetNode: NodeType | null;
157
+ nodes: NodeType[];
158
+ event: T;
161
159
  }) => void;
162
160
  type NodeEvents<NodeType extends Node = Node> = {
163
- /** This event handler is called when a user clicks on a node. */
164
- onNodeClick?: NodeEventWithPointer<MouseEvent | TouchEvent, NodeType>;
165
- /** This event handler is called when a user right-clicks on a node. */
166
- onNodeContextMenu?: NodeEventWithPointer<MouseEvent, NodeType>;
167
- /** This event handler is called when a user drags a node. */
168
- onNodeDrag?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
169
- /** This event handler is called when a user starts to drag a node. */
170
- onNodeDragStart?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
171
- /** This event handler is called when a user stops dragging a node. */
172
- onNodeDragStop?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
173
- /** This event handler is called when the pointer of a user enters a node. */
174
- onNodePointerEnter?: NodeEventWithPointer<PointerEvent, NodeType>;
175
- /** This event handler is called when the pointer of a user leaves a node. */
176
- onNodePointerLeave?: NodeEventWithPointer<PointerEvent, NodeType>;
177
- /** This event handler is called when the pointer of a user moves over a node. */
178
- onNodePointerMove?: NodeEventWithPointer<PointerEvent, NodeType>;
161
+ /** This event handler is called when a user clicks on a node. */
162
+ onNodeClick?: NodeEventWithPointer<MouseEvent | TouchEvent, NodeType>;
163
+ /** This event handler is called when a user right-clicks on a node. */
164
+ onNodeContextMenu?: NodeEventWithPointer<MouseEvent, NodeType>;
165
+ /** This event handler is called when a user drags a node. */
166
+ onNodeDrag?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
167
+ /** This event handler is called when a user starts to drag a node. */
168
+ onNodeDragStart?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
169
+ /** This event handler is called when a user stops dragging a node. */
170
+ onNodeDragStop?: NodeTargetEventWithPointer<MouseEvent | TouchEvent, NodeType>;
171
+ /** This event handler is called when the pointer of a user enters a node. */
172
+ onNodePointerEnter?: NodeEventWithPointer<PointerEvent, NodeType>;
173
+ /** This event handler is called when the pointer of a user leaves a node. */
174
+ onNodePointerLeave?: NodeEventWithPointer<PointerEvent, NodeType>;
175
+ /** This event handler is called when the pointer of a user moves over a node. */
176
+ onNodePointerMove?: NodeEventWithPointer<PointerEvent, NodeType>;
179
177
  };
180
178
  type NodeSelectionEvents<NodeType extends Node = Node> = {
181
- /** This event handler is called when a user right-clicks the selection box. */
182
- onSelectionContextMenu?: NodesEventWithPointer<PointerEvent, NodeType>;
183
- /** This event handler is called when a user clicks the selection box. */
184
- onSelectionClick?: NodesEventWithPointer<MouseEvent, NodeType>;
179
+ /** This event handler is called when a user right-clicks the selection box. */
180
+ onSelectionContextMenu?: NodesEventWithPointer<PointerEvent, NodeType>;
181
+ /** This event handler is called when a user clicks the selection box. */
182
+ onSelectionClick?: NodesEventWithPointer<MouseEvent, NodeType>;
185
183
  };
186
184
  type PaneEvents = {
187
- /** This event handler is called when a user clicks the pane. */
188
- onPaneClick?: ({ event }: {
189
- event: MouseEvent;
190
- }) => void;
191
- /** This event handler is called when a user right-clicks the pane. */
192
- onPaneContextMenu?: ({ event }: {
193
- event: PointerEvent;
194
- }) => void;
185
+ /** This event handler is called when a user clicks the pane. */
186
+ onPaneClick?: ({ event }: {
187
+ event: MouseEvent;
188
+ }) => void;
189
+ /** This event handler is called when a user right-clicks the pane. */
190
+ onPaneContextMenu?: ({ event }: {
191
+ event: PointerEvent;
192
+ }) => void;
195
193
  };
196
194
  type EdgeEvents<EdgeType extends Edge = Edge> = {
197
- /** This event handler is called when a user clicks an edge. */
198
- onEdgeClick?: ({ edge, event }: {
199
- edge: EdgeType;
200
- event: MouseEvent;
201
- }) => void;
202
- /** This event handler is called when a user right-clicks an edge. */
203
- onEdgeContextMenu?: ({ edge, event }: {
204
- edge: EdgeType;
205
- event: PointerEvent;
206
- }) => void;
207
- /** This event handler is called when the pointer of a user enters an edge. */
208
- onEdgePointerEnter?: ({ edge, event }: {
209
- edge: EdgeType;
210
- event: PointerEvent;
211
- }) => void;
212
- /** This event handler is called when the pointer of a user enters an edge. */
213
- onEdgePointerLeave?: ({ edge, event }: {
214
- edge: EdgeType;
215
- event: PointerEvent;
216
- }) => void;
195
+ /** This event handler is called when a user clicks an edge. */
196
+ onEdgeClick?: ({ edge, event }: {
197
+ edge: EdgeType;
198
+ event: MouseEvent;
199
+ }) => void;
200
+ /** This event handler is called when a user right-clicks an edge. */
201
+ onEdgeContextMenu?: ({ edge, event }: {
202
+ edge: EdgeType;
203
+ event: PointerEvent;
204
+ }) => void;
205
+ /** This event handler is called when the pointer of a user enters an edge. */
206
+ onEdgePointerEnter?: ({ edge, event }: {
207
+ edge: EdgeType;
208
+ event: PointerEvent;
209
+ }) => void;
210
+ /** This event handler is called when the pointer of a user enters an edge. */
211
+ onEdgePointerLeave?: ({ edge, event }: {
212
+ edge: EdgeType;
213
+ event: PointerEvent;
214
+ }) => void;
217
215
  };
218
216
  type DeleteEvents<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
219
- onNodesDelete?: (nodes: NodeType[]) => void;
220
- onEdgesDelete?: (edges: EdgeType[]) => void;
217
+ onNodesDelete?: (nodes: NodeType[]) => void;
218
+ onEdgesDelete?: (edges: EdgeType[]) => void;
221
219
  };
222
220
  type EdgeReconnectEvents<EdgeType extends Edge = Edge> = {
223
- /**
224
- * This handler is called when the source or target of a reconnectable edge is dragged from the
225
- * current node. It will fire even if the edge's source or target do not end up changing.
226
- * You can use the `reconnectEdge` utility to convert the connection to a new edge.
227
- */
228
- onReconnect?: OnReconnect<EdgeType>;
229
- /**
230
- * This event fires when the user begins dragging the source or target of an editable edge.
231
- */
232
- onReconnectStart?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
233
- /**
234
- * This event fires when the user releases the source or target of an editable edge. It is called
235
- * even if an edge update does not occur.
236
- */
237
- onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
221
+ /**
222
+ * This handler is called when the source or target of a reconnectable edge is dragged from the
223
+ * current node. It will fire even if the edge's source or target do not end up changing.
224
+ * You can use the `reconnectEdge` utility to convert the connection to a new edge.
225
+ */
226
+ onReconnect?: OnReconnect$1<EdgeType>;
227
+ /**
228
+ * This event fires when the user begins dragging the source or target of an editable edge.
229
+ */
230
+ onReconnectStart?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void;
231
+ /**
232
+ * This event fires when the user releases the source or target of an editable edge. It is called
233
+ * even if an edge update does not occur.
234
+ */
235
+ onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void;
238
236
  };
239
- type OnSelectionDrag<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
240
-
241
- type Position = `${Position$1}`;
242
- type ConnectionMode = `${ConnectionMode$1}`;
243
- type ConnectionLineType$1 = `${ConnectionLineType$2}`;
244
- type SelectionMode = `${SelectionMode$1}`;
245
- type PanOnScrollMode = `${PanOnScrollMode$1}`;
246
- type ResizeControlVariant = `${ResizeControlVariant$1}`;
237
+ type OnSelectionDrag$1<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
238
+ //#endregion
239
+ //#region src/types/general.d.ts
240
+ type Position$3 = `${Position$2}`;
241
+ type ConnectionMode$2 = `${ConnectionMode$1}`;
242
+ type ConnectionLineType$3 = `${ConnectionLineType$1}`;
243
+ type SelectionMode$2 = `${SelectionMode$1}`;
244
+ type PanOnScrollMode$2 = `${PanOnScrollMode$1}`;
245
+ type ResizeControlVariant$2 = `${ResizeControlVariant$1}`;
247
246
  type ShortcutModifier = "alt" | "ctrl" | "meta" | "shift";
248
247
  type ShortcutModifierDefinition = null | false | ShortcutModifier | (ShortcutModifier | ShortcutModifier[])[];
249
248
  type KeyModifier = ShortcutModifierDefinition;
250
249
  type KeyDefinitionObject = {
251
- key: string;
252
- modifier?: KeyModifier;
250
+ key: string;
251
+ modifier?: KeyModifier;
253
252
  };
254
253
  type KeyDefinition = string | KeyDefinitionObject;
255
254
  type ConnectionData = {
256
- connectionPosition: XYPosition | null;
257
- connectionStartHandle: Handle$1 | null;
258
- connectionEndHandle: Handle$1 | null;
259
- connectionStatus: string | null;
255
+ connectionPosition: XYPosition$1 | null;
256
+ connectionStartHandle: Handle$1 | null;
257
+ connectionEndHandle: Handle$1 | null;
258
+ connectionStatus: string | null;
260
259
  };
261
260
  type FitViewOptions<NodeType extends Node = Node> = FitViewOptionsBase<NodeType>;
262
261
  type OnDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
263
- nodes: NodeType[];
264
- edges: EdgeType[];
262
+ nodes: NodeType[];
263
+ edges: EdgeType[];
265
264
  }) => void;
266
- type EdgeConnection = Connection & {
267
- id: string;
265
+ type EdgeConnection = Connection$1 & {
266
+ id: string;
268
267
  };
269
268
  /** Callback that gets called before a handle connection is created. */
270
269
  type OnBeforeEdgeConnect<EdgeType extends Edge = Edge> = (connection: EdgeConnection) => EdgeType | EdgeConnection | undefined;
@@ -272,71 +271,78 @@ type OnBeforeEdgeConnect<EdgeType extends Edge = Edge> = (connection: EdgeConnec
272
271
  type OnEdgeConnect = (connection: EdgeConnection) => void;
273
272
  type OnBeforeReconnect<EdgeType extends Edge = Edge> = (newEdge: EdgeType, oldEdge: EdgeType) => EdgeType | undefined;
274
273
  type OnBeforeDelete<NodeType extends Node = Node, EdgeType extends Edge = Edge> = OnBeforeDeleteBase<NodeType, EdgeType>;
275
- type IsValidConnection<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection) => boolean;
274
+ type IsValidConnection$1<EdgeType extends Edge = Edge> = (edge: EdgeType | Connection$1) => boolean;
276
275
  type OnSelectionChange<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (params: {
277
- nodes: NodeType[];
278
- edges: EdgeType[];
276
+ nodes: NodeType[];
277
+ edges: EdgeType[];
279
278
  }) => void;
280
279
  type NodeGraph<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
281
- readonly nodes: NodeType[];
282
- readonly edges: EdgeType[];
280
+ readonly nodes: NodeType[];
281
+ readonly edges: EdgeType[];
283
282
  };
284
- type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection) => EdgeType | Connection;
285
-
283
+ type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection$1) => EdgeType | Connection$1;
284
+ //#endregion
285
+ //#region src/components/container/EdgeRenderer.d.ts
286
286
  type EdgeRendererProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
287
- readonly defaultEdgeOptions?: DefaultEdgeOptions;
288
- readonly reconnectRadius: number;
287
+ readonly defaultEdgeOptions?: DefaultEdgeOptions;
288
+ readonly reconnectRadius: number;
289
289
  };
290
290
  declare const EdgeRenderer: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeRendererProps<EdgeType>) => JSX.Element;
291
-
291
+ //#endregion
292
+ //#region src/components/container/NodeRenderer.d.ts
292
293
  type NodeRendererProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
293
- readonly nodeClickDistance: number;
294
+ readonly nodeClickDistance: number;
294
295
  };
295
296
  declare const NodeRenderer: <NodeType extends Node = Node>(props: NodeRendererProps<NodeType>) => JSX.Element;
296
-
297
+ //#endregion
298
+ //#region src/components/container/Pane.d.ts
297
299
  type PaneProps = PaneEvents & {
298
- readonly panOnDrag?: boolean | number[];
299
- readonly selectionOnDrag?: boolean;
300
- readonly paneClickDistance?: number;
301
- readonly autoPanOnSelection?: boolean;
302
- readonly onSelectionStart?: (event: PointerEvent) => void;
303
- readonly onSelectionEnd?: (event: PointerEvent) => void;
300
+ readonly panOnDrag?: boolean | number[];
301
+ readonly selectionOnDrag?: boolean;
302
+ readonly paneClickDistance?: number;
303
+ readonly autoPanOnSelection?: boolean;
304
+ readonly onSelectionStart?: (event: PointerEvent) => void;
305
+ readonly onSelectionEnd?: (event: PointerEvent) => void;
304
306
  };
305
307
  declare const Pane: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<PaneProps>) => JSX.Element;
306
-
308
+ //#endregion
309
+ //#region src/components/container/Panel.d.ts
307
310
  type PanelProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
308
- /** Set position of the panel
309
- * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
310
- */
311
- readonly position?: PanelPosition;
312
- readonly style?: JSX.CSSProperties;
313
- readonly "data-testid"?: string;
314
- readonly "data-message"?: string;
311
+ /** Set position of the panel
312
+ * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
313
+ */
314
+ readonly position?: PanelPosition$1;
315
+ readonly style?: JSX.CSSProperties;
316
+ readonly "data-testid"?: string;
317
+ readonly "data-message"?: string;
315
318
  };
316
319
  declare const Panel: (props: ParentProps<PanelProps>) => JSX.Element;
317
-
320
+ //#endregion
321
+ //#region src/components/container/ViewportPortal.d.ts
318
322
  declare const ViewportPortal: (props: ParentProps) => JSX.Element;
319
-
323
+ //#endregion
324
+ //#region src/components/container/Zoom.d.ts
320
325
  type ZoomProps = {
321
- readonly initialViewport?: Viewport;
322
- readonly panOnScrollMode: PanOnScrollMode;
323
- readonly onMove?: OnMove;
324
- readonly onMoveStart?: OnMoveStart;
325
- readonly onMoveEnd?: OnMoveEnd;
326
- readonly onViewportInitialized?: () => void;
327
- readonly preventScrolling: boolean;
328
- readonly zoomOnScroll: boolean;
329
- readonly zoomOnDoubleClick: boolean;
330
- readonly zoomOnPinch: boolean;
331
- readonly panOnScroll: boolean;
332
- readonly panOnScrollSpeed: number;
333
- readonly panOnDrag: boolean | number[];
334
- readonly paneClickDistance: number;
335
- readonly selectionOnDrag?: boolean;
326
+ readonly initialViewport?: Viewport$1;
327
+ readonly panOnScrollMode: PanOnScrollMode$2;
328
+ readonly onMove?: OnMove$1;
329
+ readonly onMoveStart?: OnMoveStart$1;
330
+ readonly onMoveEnd?: OnMoveEnd$1;
331
+ readonly onViewportInitialized?: () => void;
332
+ readonly preventScrolling: boolean;
333
+ readonly zoomOnScroll: boolean;
334
+ readonly zoomOnDoubleClick: boolean;
335
+ readonly zoomOnPinch: boolean;
336
+ readonly panOnScroll: boolean;
337
+ readonly panOnScrollSpeed: number;
338
+ readonly panOnDrag: boolean | number[];
339
+ readonly paneClickDistance: number;
340
+ readonly selectionOnDrag?: boolean;
336
341
  };
337
342
  declare const Zoom: (props: ParentProps<ZoomProps>) => JSX.Element;
338
-
339
- type ConnectionLineType = `${ConnectionLineType$2}`;
343
+ //#endregion
344
+ //#region src/components/graph/connection/types.d.ts
345
+ type ConnectionLineType$2 = `${ConnectionLineType$1}`;
340
346
  /**
341
347
  * If you want to render a custom component for connection lines, you can set the
342
348
  * `connectionLineComponent` prop on the [`<SolidFlow />`](/api-reference/react-flow#connection-connectionLineComponent)
@@ -345,180 +351,207 @@ type ConnectionLineType = `${ConnectionLineType$2}`;
345
351
  * @public
346
352
  */
347
353
  type ConnectionLineComponentProps<NodeType extends Node = Node> = {
348
- readonly connectionLineStyle?: JSX.CSSProperties;
349
- readonly connectionLineType: ConnectionLineType;
350
- readonly fromNode: InternalNode<NodeType>;
351
- readonly fromHandle: Handle$1;
352
- readonly fromX: number;
353
- readonly fromY: number;
354
- readonly toX: number;
355
- readonly toY: number;
356
- readonly fromPosition: Position;
357
- readonly toPosition: Position;
358
- readonly connectionStatus: "valid" | "invalid" | null;
359
- readonly toNode: InternalNode<NodeType> | null;
360
- readonly toHandle: Handle$1 | null;
354
+ readonly connectionLineStyle?: JSX.CSSProperties;
355
+ readonly connectionLineType: ConnectionLineType$2;
356
+ readonly fromNode: InternalNode<NodeType>;
357
+ readonly fromHandle: Handle$1;
358
+ readonly fromX: number;
359
+ readonly fromY: number;
360
+ readonly toX: number;
361
+ readonly toY: number;
362
+ readonly fromPosition: Position$3;
363
+ readonly toPosition: Position$3;
364
+ readonly connectionStatus: "valid" | "invalid" | null;
365
+ readonly toNode: InternalNode<NodeType> | null;
366
+ readonly toHandle: Handle$1 | null;
361
367
  };
362
-
368
+ //#endregion
369
+ //#region src/components/graph/connection/ConnectionLine.d.ts
363
370
  type ConnectionLineProps<NodeType extends Node = Node> = {
364
- readonly style: JSX.CSSProperties;
365
- readonly type: ConnectionLineType;
366
- readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
367
- readonly containerStyle: string | JSX.CSSProperties;
371
+ readonly style: JSX.CSSProperties;
372
+ readonly type: ConnectionLineType$2;
373
+ readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
374
+ readonly containerStyle: string | JSX.CSSProperties;
368
375
  };
369
376
  declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
370
-
377
+ //#endregion
378
+ //#region src/components/graph/edge/BaseEdge.d.ts
371
379
  declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) => JSX.Element;
372
-
380
+ //#endregion
381
+ //#region src/components/graph/edge/BezierEdge.d.ts
373
382
  declare const BezierEdge: (props: BezierEdgeProps) => JSX.Element;
374
-
383
+ //#endregion
384
+ //#region src/components/graph/edge/BezierEdgeInternal.d.ts
375
385
  declare const BezierEdgeInternal: (props: BezierEdgeProps) => JSX.Element;
376
-
386
+ //#endregion
387
+ //#region src/components/graph/edge/EdgeLabel.d.ts
377
388
  type EdgeLabelProps = {
378
- readonly x?: number;
379
- readonly y?: number;
380
- readonly width?: number;
381
- readonly height?: number;
382
- readonly selectEdgeOnClick?: boolean;
383
- readonly transparent?: boolean;
384
- readonly style?: JSX.CSSProperties;
389
+ readonly x?: number;
390
+ readonly y?: number;
391
+ readonly width?: number;
392
+ readonly height?: number;
393
+ readonly selectEdgeOnClick?: boolean;
394
+ readonly transparent?: boolean;
395
+ readonly style?: JSX.CSSProperties;
385
396
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
386
397
  declare const EdgeLabel: (props: ParentProps<EdgeLabelProps>) => JSX.Element;
387
-
398
+ //#endregion
399
+ //#region src/components/graph/edge/EdgeLabelRenderer.d.ts
388
400
  declare const EdgeLabelRenderer: (props: ParentProps) => JSX.Element;
389
-
401
+ //#endregion
402
+ //#region src/components/graph/edge/EdgeReconnectAnchor.d.ts
390
403
  type EdgeReconnectAnchorProps = {
391
- readonly type: HandleType;
392
- readonly class?: string;
393
- readonly style?: JSX.CSSProperties;
394
- readonly position?: XYPosition;
395
- readonly size?: number;
396
- readonly reconnecting?: boolean;
404
+ readonly type: HandleType;
405
+ readonly class?: string;
406
+ readonly style?: JSX.CSSProperties;
407
+ readonly position?: XYPosition$1;
408
+ readonly size?: number;
409
+ readonly reconnecting?: boolean;
397
410
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
398
411
  declare const EdgeReconnectAnchor: (props: ParentProps<EdgeReconnectAnchorProps>) => JSX.Element;
399
-
412
+ //#endregion
413
+ //#region src/components/graph/edge/EdgeWrapper.d.ts
400
414
  type EdgeWrapperProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
401
- readonly edgeId: string;
415
+ readonly edgeId: string;
402
416
  };
403
417
  declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) => JSX.Element;
404
-
418
+ //#endregion
419
+ //#region src/components/graph/edge/SmoothStepEdge.d.ts
405
420
  declare const SmoothStepEdge: (props: SmoothStepEdgeProps) => JSX.Element;
406
-
421
+ //#endregion
422
+ //#region src/components/graph/edge/SmoothStepEdgeInternal.d.ts
407
423
  declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) => JSX.Element;
408
-
424
+ //#endregion
425
+ //#region src/components/graph/edge/StepEdge.d.ts
409
426
  declare const StepEdge: (props: StepEdgeProps) => JSX.Element;
410
-
427
+ //#endregion
428
+ //#region src/components/graph/edge/StepEdgeInternal.d.ts
411
429
  declare const StepEdgeInternal: (props: StepEdgeProps) => JSX.Element;
412
-
430
+ //#endregion
431
+ //#region src/components/graph/edge/StraightEdge.d.ts
413
432
  declare const StraightEdge: (props: StraightEdgeProps) => JSX.Element;
414
-
433
+ //#endregion
434
+ //#region src/components/graph/edge/StraightEdgeInternal.d.ts
415
435
  declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) => JSX.Element;
416
-
417
- type HandleProps = Omit<HandleProps$1, "position"> & {
418
- readonly position: Position;
419
- readonly class?: string;
420
- readonly style?: JSX.CSSProperties;
421
- readonly onConnect?: (connections: Connection[]) => void;
422
- readonly onDisconnect?: (connections: Connection[]) => void;
436
+ //#endregion
437
+ //#region src/components/graph/handle/Handle.d.ts
438
+ type HandleProps$1 = Omit<HandleProps, "position"> & {
439
+ readonly position: Position$3;
440
+ readonly class?: string;
441
+ readonly style?: JSX.CSSProperties;
442
+ readonly onConnect?: (connections: Connection$1[]) => void;
443
+ readonly onDisconnect?: (connections: Connection$1[]) => void;
423
444
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
424
- declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps>) => JSX.Element;
425
-
426
- type MarkerProps = MarkerProps$1 & {
427
- readonly markerUnits?: "strokeWidth" | "userSpaceOnUse";
428
- readonly strokeWidth?: number;
445
+ declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps$1>) => JSX.Element;
446
+ //#endregion
447
+ //#region src/components/graph/marker/Marker.d.ts
448
+ type MarkerProps$1 = MarkerProps & {
449
+ readonly markerUnits?: "strokeWidth" | "userSpaceOnUse";
450
+ readonly strokeWidth?: number;
429
451
  };
430
- declare const Marker: (props: MarkerProps) => JSX.Element;
431
-
452
+ declare const Marker: (props: MarkerProps$1) => JSX.Element;
453
+ //#endregion
454
+ //#region src/components/graph/marker/MarkerDefinition.d.ts
432
455
  declare const MarkerDefinition: () => JSX.Element;
433
-
456
+ //#endregion
457
+ //#region src/components/graph/node/DefaultNode.d.ts
434
458
  declare const DefaultNode: (props: NodeProps<{
435
- label: string;
459
+ label: string;
436
460
  }, "default">) => JSX.Element;
437
-
461
+ //#endregion
462
+ //#region src/components/graph/node/GroupNode.d.ts
438
463
  declare const GroupNode: (props: NodeProps<Record<string, never>>) => JSX.Element;
439
-
464
+ //#endregion
465
+ //#region src/components/graph/node/InputNode.d.ts
440
466
  declare const InputNode: (props: NodeProps<{
441
- label: string;
467
+ label: string;
442
468
  }>) => JSX.Element;
443
-
469
+ //#endregion
470
+ //#region src/components/graph/node/NodeWrapper.d.ts
444
471
  type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
445
- readonly nodeId: string;
446
- readonly resizeObserver: ResizeObserver;
447
- readonly nodeClickDistance: number;
472
+ readonly nodeId: string;
473
+ readonly resizeObserver: ResizeObserver | undefined;
474
+ readonly nodeClickDistance: number;
448
475
  };
449
476
  declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) => JSX.Element;
450
-
477
+ //#endregion
478
+ //#region src/components/graph/node/OutputNode.d.ts
451
479
  declare const OutputNode: (props: NodeProps<{
452
- label: string;
480
+ label: string;
453
481
  }>) => JSX.Element;
454
-
482
+ //#endregion
483
+ //#region src/components/graph/plugins/background/types.d.ts
455
484
  type BackgroundVariant = "lines" | "dots" | "cross";
456
-
485
+ //#endregion
486
+ //#region src/components/graph/plugins/background/Background.d.ts
457
487
  type BackgroundProps = {
458
- readonly id?: string;
459
- /** Variant of the pattern
460
- * @example 'lines', 'dots', 'cross'
461
- */
462
- readonly variant?: BackgroundVariant;
463
- /** Color of the background */
464
- readonly bgColor?: string;
465
- /** Color of the pattern */
466
- readonly patternColor?: string;
467
- /** Class applied to the pattern */
468
- readonly patternClass?: string;
469
- /** Class applied to the container */
470
- readonly class?: string;
471
- /** Gap between repetitions of the pattern */
472
- readonly gap?: number | [number, number];
473
- /** Size of a single pattern element */
474
- readonly size?: number;
475
- /** Line width of the Line pattern */
476
- readonly lineWidth?: number;
477
- /** Style applied to the container */
478
- readonly style?: JSX.CSSProperties;
488
+ readonly id?: string;
489
+ /** Variant of the pattern
490
+ * @example 'lines', 'dots', 'cross'
491
+ */
492
+ readonly variant?: BackgroundVariant;
493
+ /** Color of the background */
494
+ readonly bgColor?: string;
495
+ /** Color of the pattern */
496
+ readonly patternColor?: string;
497
+ /** Class applied to the pattern */
498
+ readonly patternClass?: string;
499
+ /** Class applied to the container */
500
+ readonly class?: string;
501
+ /** Gap between repetitions of the pattern */
502
+ readonly gap?: number | [number, number];
503
+ /** Size of a single pattern element */
504
+ readonly size?: number;
505
+ /** Line width of the Line pattern */
506
+ readonly lineWidth?: number;
507
+ /** Style applied to the container */
508
+ readonly style?: JSX.CSSProperties;
479
509
  };
480
510
  declare const Background: (props: BackgroundProps) => JSX.Element;
481
-
511
+ //#endregion
512
+ //#region src/components/graph/plugins/controls/ControlButton.d.ts
482
513
  type ControlButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
483
- readonly class?: string;
484
- readonly bgColor?: string;
485
- readonly bgColorHover?: string;
486
- readonly color?: string;
487
- readonly colorHover?: string;
488
- readonly borderColor?: string;
489
- readonly onClick?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
514
+ readonly class?: string;
515
+ readonly bgColor?: string;
516
+ readonly bgColorHover?: string;
517
+ readonly color?: string;
518
+ readonly colorHover?: string;
519
+ readonly borderColor?: string;
520
+ readonly onClick?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
490
521
  };
491
522
  declare const ControlButton: (props: ParentProps<ControlButtonProps>) => JSX.Element;
492
-
523
+ //#endregion
524
+ //#region src/components/graph/plugins/controls/Controls.d.ts
493
525
  type ControlsOrientation = "horizontal" | "vertical";
494
526
  type ControlsProps = {
495
- /** Position of the controls on the pane
496
- * @example PanelPosition.TopLeft, PanelPosition.TopRight,
497
- * PanelPosition.BottomLeft, PanelPosition.BottomRight
498
- */
499
- readonly position?: PanelPosition;
500
- /** Show button for zoom in/out */
501
- readonly showZoom?: boolean;
502
- /** Show button for fit view */
503
- readonly showFitView?: boolean;
504
- /** Show button for toggling interactivity */
505
- readonly showLock?: boolean;
506
- readonly buttonBgColor?: string;
507
- readonly buttonBgColorHover?: string;
508
- readonly buttonColor?: string;
509
- readonly buttonColorHover?: string;
510
- readonly buttonBorderColor?: string;
511
- readonly style?: JSX.CSSProperties;
512
- readonly orientation?: ControlsOrientation;
513
- readonly fitViewOptions?: FitViewOptions;
514
- readonly beforeControls?: JSX.Element;
515
- readonly afterControls?: JSX.Element;
527
+ /** Position of the controls on the pane
528
+ * @example PanelPosition.TopLeft, PanelPosition.TopRight,
529
+ * PanelPosition.BottomLeft, PanelPosition.BottomRight
530
+ */
531
+ readonly position?: PanelPosition$1;
532
+ /** Show button for zoom in/out */
533
+ readonly showZoom?: boolean;
534
+ /** Show button for fit view */
535
+ readonly showFitView?: boolean;
536
+ /** Show button for toggling interactivity */
537
+ readonly showLock?: boolean;
538
+ readonly buttonBgColor?: string;
539
+ readonly buttonBgColorHover?: string;
540
+ readonly buttonColor?: string;
541
+ readonly buttonColorHover?: string;
542
+ readonly buttonBorderColor?: string;
543
+ readonly style?: JSX.CSSProperties;
544
+ readonly orientation?: ControlsOrientation;
545
+ readonly fitViewOptions?: FitViewOptions;
546
+ readonly beforeControls?: JSX.Element;
547
+ readonly afterControls?: JSX.Element;
516
548
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
517
549
  declare const Controls: (props: ParentProps<ControlsProps>) => JSX.Element;
518
-
550
+ //#endregion
551
+ //#region src/components/graph/plugins/EdgeToolbar.d.ts
519
552
  type EdgeToolbarProps = EdgeToolbarBaseProps & {
520
- /** If `true`, clicking the toolbar selects the edge it belongs to. */
521
- readonly selectEdgeOnClick?: boolean;
553
+ /** If `true`, clicking the toolbar selects the edge it belongs to. */
554
+ readonly selectEdgeOnClick?: boolean;
522
555
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
523
556
  /**
524
557
  * The `<EdgeToolbar />` component renders a toolbar or tooltip for an edge.
@@ -528,597 +561,606 @@ type EdgeToolbarProps = EdgeToolbarBaseProps & {
528
561
  * The toolbar does not scale with the viewport so that its content is always legible.
529
562
  */
530
563
  declare const EdgeToolbar: (props: ParentProps<EdgeToolbarProps>) => JSX.Element;
531
-
564
+ //#endregion
565
+ //#region src/components/graph/plugins/minimap/MiniMap.d.ts
532
566
  type GetMiniMapNodeAttribute<NodeType extends Node> = (node: NodeType) => string;
533
567
  type MiniMapProps<NodeType extends Node> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
534
- /** Background color of minimap */
535
- readonly bgColor?: string;
536
- /** Color of nodes on the minimap */
537
- readonly nodeColor?: string | GetMiniMapNodeAttribute<NodeType>;
538
- /** Stroke color of nodes on the minimap */
539
- readonly nodeStrokeColor?: string | GetMiniMapNodeAttribute<NodeType>;
540
- /** Class applied to nodes on the minimap */
541
- readonly nodeClass?: string | GetMiniMapNodeAttribute<NodeType>;
542
- /** Border radius of nodes on the minimap */
543
- readonly nodeBorderRadius?: number;
544
- /** Stroke width of nodes on the minimap */
545
- readonly nodeStrokeWidth?: number;
546
- /** Color of the mask representing viewport */
547
- readonly maskColor?: string;
548
- /** Stroke color of the mask representing viewport */
549
- readonly maskStrokeColor?: string;
550
- /** Stroke width of the mask representing viewport */
551
- readonly maskStrokeWidth?: number;
552
- /** Position of the minimap on the pane
553
- * @example PanelPosition.TopLeft, PanelPosition.TopRight,
554
- * PanelPosition.BottomLeft, PanelPosition.BottomRight
555
- */
556
- readonly position?: PanelPosition;
557
- /** Style applied to container */
558
- readonly style?: JSX.CSSProperties;
559
- /** The aria-label applied to container */
560
- readonly ariaLabel?: string | null;
561
- /** Width of minimap */
562
- readonly width?: number;
563
- /** Height of minimap */
564
- readonly height?: number;
565
- readonly pannable?: boolean;
566
- readonly zoomable?: boolean;
567
- /** Invert the direction when panning the minimap viewport */
568
- readonly inversePan?: boolean;
569
- /** Step size for zooming in/out */
570
- readonly zoomStep?: number;
568
+ /** Background color of minimap */
569
+ readonly bgColor?: string;
570
+ /** Color of nodes on the minimap */
571
+ readonly nodeColor?: string | GetMiniMapNodeAttribute<NodeType>;
572
+ /** Stroke color of nodes on the minimap */
573
+ readonly nodeStrokeColor?: string | GetMiniMapNodeAttribute<NodeType>;
574
+ /** Class applied to nodes on the minimap */
575
+ readonly nodeClass?: string | GetMiniMapNodeAttribute<NodeType>;
576
+ /** Border radius of nodes on the minimap */
577
+ readonly nodeBorderRadius?: number;
578
+ /** Stroke width of nodes on the minimap */
579
+ readonly nodeStrokeWidth?: number;
580
+ /** Color of the mask representing viewport */
581
+ readonly maskColor?: string;
582
+ /** Stroke color of the mask representing viewport */
583
+ readonly maskStrokeColor?: string;
584
+ /** Stroke width of the mask representing viewport */
585
+ readonly maskStrokeWidth?: number;
586
+ /** Position of the minimap on the pane
587
+ * @example PanelPosition.TopLeft, PanelPosition.TopRight,
588
+ * PanelPosition.BottomLeft, PanelPosition.BottomRight
589
+ */
590
+ readonly position?: PanelPosition$1;
591
+ /** Style applied to container */
592
+ readonly style?: JSX.CSSProperties;
593
+ /** The aria-label applied to container */
594
+ readonly ariaLabel?: string | null;
595
+ /** Width of minimap */
596
+ readonly width?: number;
597
+ /** Height of minimap */
598
+ readonly height?: number;
599
+ readonly pannable?: boolean;
600
+ readonly zoomable?: boolean;
601
+ /** Invert the direction when panning the minimap viewport */
602
+ readonly inversePan?: boolean;
603
+ /** Step size for zooming in/out */
604
+ readonly zoomStep?: number;
571
605
  };
572
606
  declare const MiniMap: <NodeType extends Node>(props: ParentProps<Partial<MiniMapProps<NodeType>>>) => JSX.Element;
573
-
607
+ //#endregion
608
+ //#region src/components/graph/plugins/nodeResizer/NodeResizer.d.ts
574
609
  type NodeResizerProps = {
575
- /** Id of the node it is resizing
576
- * @remarks optional if used inside custom node
577
- */
578
- readonly nodeId?: string;
579
- /** Class applied to handle */
580
- readonly handleClass?: string;
581
- /** Style applied to handle */
582
- readonly handleStyle?: JSX.CSSProperties;
583
- /** Class applied to line */
584
- readonly lineClass?: string;
585
- /** Style applied to line */
586
- readonly lineStyle?: JSX.CSSProperties;
587
- /** Are the controls visible */
588
- readonly visible?: boolean;
589
- /** Minimum width of node */
590
- readonly minWidth?: number;
591
- /** Minimum height of node */
592
- readonly minHeight?: number;
593
- /** Maximum width of node */
594
- readonly maxWidth?: number;
595
- /** Maximum height of node */
596
- readonly maxHeight?: number;
597
- /** Keep aspect ratio when resizing */
598
- readonly keepAspectRatio?: boolean;
599
- /** Automatically scale the node when resizing */
600
- readonly autoScale?: boolean;
601
- /** Callback to determine if node should resize */
602
- readonly shouldResize?: ShouldResize;
603
- /** Callback called when resizing starts */
604
- readonly onResizeStart?: OnResizeStart;
605
- /** Callback called when resizing */
606
- readonly onResize?: OnResize;
607
- /** Callback called when resizing ends */
608
- readonly onResizeEnd?: OnResizeEnd;
610
+ /** Id of the node it is resizing
611
+ * @remarks optional if used inside custom node
612
+ */
613
+ readonly nodeId?: string;
614
+ /** Class applied to handle */
615
+ readonly handleClass?: string;
616
+ /** Style applied to handle */
617
+ readonly handleStyle?: JSX.CSSProperties;
618
+ /** Class applied to line */
619
+ readonly lineClass?: string;
620
+ /** Style applied to line */
621
+ readonly lineStyle?: JSX.CSSProperties;
622
+ /** Are the controls visible */
623
+ readonly visible?: boolean;
624
+ /** Minimum width of node */
625
+ readonly minWidth?: number;
626
+ /** Minimum height of node */
627
+ readonly minHeight?: number;
628
+ /** Maximum width of node */
629
+ readonly maxWidth?: number;
630
+ /** Maximum height of node */
631
+ readonly maxHeight?: number;
632
+ /** Keep aspect ratio when resizing */
633
+ readonly keepAspectRatio?: boolean;
634
+ /** Automatically scale the node when resizing */
635
+ readonly autoScale?: boolean;
636
+ /** Callback to determine if node should resize */
637
+ readonly shouldResize?: ShouldResize$1;
638
+ /** Callback called when resizing starts */
639
+ readonly onResizeStart?: OnResizeStart$1;
640
+ /** Callback called when resizing */
641
+ readonly onResize?: OnResize$1;
642
+ /** Callback called when resizing ends */
643
+ readonly onResizeEnd?: OnResizeEnd$1;
609
644
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
610
645
  declare const NodeResizer: (props: Partial<NodeResizerProps>) => JSX.Element;
611
-
646
+ //#endregion
647
+ //#region src/components/graph/plugins/nodeResizer/ResizeControl.d.ts
612
648
  type NodeResizerSubProps = Pick<NodeResizerProps, "nodeId" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "autoScale" | "keepAspectRatio" | "shouldResize" | "onResizeStart" | "onResize" | "onResizeEnd">;
613
649
  type ResizeControlProps = NodeResizerSubProps & {
614
- /** Position of control
615
- * @example ControlPosition.TopLeft, ControlPosition.TopRight,
616
- * ControlPosition.BottomLeft, ControlPosition.BottomRight
617
- */
618
- readonly position?: ControlPosition;
619
- /** Variant of control
620
- * @example ResizeControlVariant.Handle, ResizeControlVariant.Line
621
- */
622
- readonly variant?: ResizeControlVariant;
623
- readonly style?: JSX.CSSProperties;
650
+ /** Position of control
651
+ * @example ControlPosition.TopLeft, ControlPosition.TopRight,
652
+ * ControlPosition.BottomLeft, ControlPosition.BottomRight
653
+ */
654
+ readonly position?: ControlPosition$1;
655
+ /** Variant of control
656
+ * @example ResizeControlVariant.Handle, ResizeControlVariant.Line
657
+ */
658
+ readonly variant?: ResizeControlVariant$2;
659
+ readonly color?: string;
660
+ readonly style?: JSX.CSSProperties;
624
661
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
625
662
  declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
626
-
663
+ //#endregion
664
+ //#region src/components/graph/plugins/NodeToolbar.d.ts
627
665
  type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
628
- /** The id of the node, or array of ids the toolbar should be displayed at */
629
- readonly nodeId: string | string[];
630
- /** Position of the toolbar relative to the node
631
- * @example Position.TopLeft, Position.TopRight,
632
- * Position.BottomLeft, Position.BottomRight
633
- */
634
- readonly position: Position;
635
- /** Align the toolbar relative to the node
636
- * @example Align.Start, Align.Center, Align.End
637
- */
638
- readonly align: Align;
639
- /** Offset the toolbar from the node */
640
- readonly offset: number;
641
- /** If true, node toolbar is visible even if node is not selected */
642
- readonly isVisible: boolean;
643
- /** Style of the toolbar */
644
- readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
666
+ /** The id of the node, or array of ids the toolbar should be displayed at */
667
+ readonly nodeId: string | string[];
668
+ /** Position of the toolbar relative to the node
669
+ * @example Position.TopLeft, Position.TopRight,
670
+ * Position.BottomLeft, Position.BottomRight
671
+ */
672
+ readonly position: Position$3;
673
+ /** Align the toolbar relative to the node
674
+ * @example Align.Start, Align.Center, Align.End
675
+ */
676
+ readonly align: Align$1;
677
+ /** Offset the toolbar from the node */
678
+ readonly offset: number;
679
+ /** If true, node toolbar is visible even if node is not selected */
680
+ readonly isVisible: boolean;
681
+ /** Style of the toolbar */
682
+ readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
645
683
  };
646
684
  declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
647
-
685
+ //#endregion
686
+ //#region src/components/graph/selection/NodeSelection.d.ts
648
687
  type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
649
688
  declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
650
-
689
+ //#endregion
690
+ //#region src/components/graph/selection/Selection.d.ts
651
691
  type SelectionProps = {
652
- readonly x?: number;
653
- readonly y?: number;
654
- readonly width?: number | string;
655
- readonly height?: number | string;
656
- readonly isVisible?: boolean;
692
+ readonly x?: number;
693
+ readonly y?: number;
694
+ readonly width?: number | string;
695
+ readonly height?: number | string;
696
+ readonly isVisible?: boolean;
657
697
  };
658
698
  declare const Selection: (props: SelectionProps) => JSX.Element;
659
-
699
+ //#endregion
700
+ //#region src/components/SolidFlow/types.d.ts
660
701
  type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
661
- /**
662
- * The id of the flow. This is necessary if you want to render multiple flows.
663
- */
664
- readonly id?: string;
665
- /** Sets a fixed width for the flow */
666
- readonly width?: number;
667
- /** Sets a fixed height for the flow */
668
- readonly height?: number;
669
- /**
670
- * An store of nodes to render in a flow.
671
- * @example
672
- * const [nodes] = createStore([
673
- * {
674
- * id: 'node-1',
675
- * type: 'input',
676
- * data: { label: 'Node 1' },
677
- * position: { x: 250, y: 50 }
678
- * }
679
- * ]);
680
- */
681
- readonly nodes?: Store<NodeType[]>;
682
- /**
683
- * An store of edges to render in a flow.
684
- * @example
685
- * const [edges] = createStore([
686
- * {
687
- * id: 'edge-1-2',
688
- * source: 'node-1',
689
- * target: 'node-2',
690
- * }
691
- * ]);
692
- */
693
- readonly edges?: Store<EdgeType[]>;
694
- /**
695
- * Custom node types to be available in a flow.
696
- * Solid Flow matches a node's type to a component in the nodeTypes object.
697
- * @example
698
- * import CustomNode from './CustomNode';
699
- *
700
- * const nodeTypes = { nameOfNodeType: CustomNode };
701
- */
702
- readonly nodeTypes?: NodeTypes;
703
- /**
704
- * Custom edge types to be available in a flow.
705
- * Solid Flow matches an edge's type to a component in the edgeTypes object.
706
- * @example
707
- * import CustomEdge from './CustomEdge';
708
- *
709
- * const edgeTypes = { nameOfEdgeType: CustomEdge };
710
- */
711
- readonly edgeTypes?: EdgeTypes;
712
- /** Pressing down this key you can select multiple elements with a selection box.
713
- * @default 'Shift'
714
- */
715
- readonly selectionKey?: KeyDefinition | KeyDefinition[] | null;
716
- /** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
717
- *
718
- * By setting this prop to null you can disable this functionality.
719
- * @default 'Space'
720
- */
721
- readonly panActivationKey?: KeyDefinition | KeyDefinition[] | null;
722
- /** Pressing down this key deletes all selected nodes & edges.
723
- * @default 'Backspace'
724
- */
725
- readonly deleteKey?: KeyDefinition | KeyDefinition[] | null;
726
- /** Pressing down this key you can select multiple elements by clicking.
727
- * @default 'Meta' for macOS, "Ctrl" for other systems
728
- */
729
- readonly multiSelectionKey?: KeyDefinition | KeyDefinition[] | null;
730
- /** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
731
- *
732
- * By setting this prop to null you can disable this functionality.
733
- * @default 'Meta' for macOS, "Ctrl" for other systems
734
- * */
735
- readonly zoomActivationKey?: KeyDefinition | KeyDefinition[] | null;
736
- /** If set, initial viewport will show all nodes & edges */
737
- readonly fitView?: boolean;
738
- /**
739
- * Options to be used in combination with fitView
740
- * @example
741
- * const fitViewOptions = {
742
- * padding: 0.1,
743
- * includeHiddenNodes: false,
744
- * minZoom: 0.1,
745
- * maxZoom: 1,
746
- * duration: 200,
747
- * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
748
- * };
749
- */
750
- readonly fitViewOptions?: FitViewOptions<NodeType>;
751
- /**
752
- * Defines nodes relative position to its coordinates
753
- * @default [0, 0]
754
- * @example
755
- * [0, 0] // default, top left
756
- * [0.5, 0.5] // center
757
- * [1, 1] // bottom right
758
- */
759
- readonly nodeOrigin?: NodeOrigin;
760
- /**
761
- * With a threshold greater than zero you can control the distinction between node drag and click events.
762
- * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
763
- * @default 1
764
- */
765
- readonly nodeDragThreshold?: number;
766
- /**
767
- * Distance that the mouse can move between mousedown/up that will trigger a click
768
- * @default 0
769
- */
770
- readonly paneClickDistance?: number;
771
- /** Distance that the mouse can move between mousedown/up that will trigger a click
772
- * @default 0
773
- */
774
- readonly nodeClickDistance?: number;
775
- /**
776
- * The threshold in pixels that the mouse must move before a connection line starts to drag.
777
- * This is useful to prevent accidental connections when clicking on a handle.
778
- * @default 1
779
- */
780
- readonly connectionDragThreshold?: number;
781
- /** Minimum zoom level
782
- * @default 0.5
783
- */
784
- readonly minZoom?: number;
785
- /** Maximum zoom level
786
- * @default 2
787
- */
788
- readonly maxZoom?: number;
789
- /**
790
- * Sets the initial position and zoom of the viewport.
791
- * If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
792
- * @default { zoom: 1, position: { x: 0, y: 0 } }
793
- * @example
794
- * const initialViewport = {
795
- * zoom: 0.5,
796
- * position: { x: 0, y: 0 }
797
- * };
798
- */
799
- readonly initialViewport?: Viewport;
800
- /** Custom viewport to be used instead of internal one */
801
- readonly viewport?: Store<Viewport>;
802
- /**
803
- * The radius around a handle where you drop a connection line to create a new edge.
804
- * @default 20
805
- */
806
- readonly connectionRadius?: number;
807
- /**
808
- * 'strict' connection mode will only allow you to connect source handles to target handles.
809
- * 'loose' connection mode will allow you to connect handles of any type to one another.
810
- * @default 'strict'
811
- */
812
- readonly connectionMode?: ConnectionMode;
813
- /** Provide a custom snippet to be used insted of the default connection line */
814
- readonly connectionLineComponent?: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
815
- /** Styles to be applied to the connection line */
816
- readonly connectionLineStyle?: JSX.CSSProperties;
817
- /** Styles to be applied to the container of the connection line */
818
- readonly connectionLineContainerStyle?: JSX.CSSProperties;
819
- /**
820
- * When set to "partial", when the user creates a selection box by click and dragging
821
- * nodes that are only partially in the box are still selected.
822
- * @default 'full'
823
- */
824
- readonly selectionMode?: SelectionMode;
825
- /**
826
- * Controls if nodes should be automatically selected when being dragged
827
- */
828
- readonly selectNodesOnDrag?: boolean;
829
- /**
830
- * Grid all nodes will snap to
831
- * @example [20, 20]
832
- */
833
- readonly snapGrid?: SnapGrid;
834
- /** Color of edge markers
835
- * You can pass `null` to use the CSS variable `--xy-edge-stroke` for the marker color.
836
- * @example "#b1b1b7"
837
- */
838
- readonly defaultMarkerColor?: string | null;
839
- /**
840
- * Controls if all nodes should be draggable
841
- * @default true
842
- */
843
- readonly nodesDraggable?: boolean;
844
- /**
845
- * When `true`, the viewport will pan when a node is focused.
846
- * @default true
847
- */
848
- readonly autoPanOnNodeFocus?: boolean;
849
- /**
850
- * When `true`, the viewport will pan when a drag selection approaches the edges of the flow container.
851
- * @default true
852
- */
853
- readonly autoPanOnSelection?: boolean;
854
- /**
855
- * Controls if all nodes should be connectable to each other
856
- * @default true
857
- */
858
- readonly nodesConnectable?: boolean;
859
- /** Controls if all elements should (nodes & edges) be selectable
860
- * @default true
861
- */
862
- readonly elementsSelectable?: boolean;
863
- /**
864
- * When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter`
865
- * key. This option can be overridden by individual nodes by setting their `focusable` prop.
866
- * @default true
867
- */
868
- readonly nodesFocusable?: boolean;
869
- /**
870
- * When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter`
871
- * key. This option can be overridden by individual edges by setting their `focusable` prop.
872
- * @default true
873
- */
874
- readonly edgesFocusable?: boolean;
875
- /**
876
- * By default the viewport extends infinitely. You can use this prop to set a boundary.
877
- * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
878
- * @default @default [[-∞, -∞], [+∞, +∞]]
879
- * @example [[-1000, -10000], [1000, 1000]]
880
- */
881
- readonly translateExtent?: CoordinateExtent;
882
- /**
883
- * By default the nodes can be placed anywhere. You can use this prop to set a boundary.
884
- * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
885
- * @default [[-∞, -∞], [+∞, +∞]]
886
- * @example [[-1000, -10000], [1000, 1000]]
887
- */
888
- readonly nodeExtent?: CoordinateExtent;
889
- /**
890
- * Disabling this prop will allow the user to scroll the page even when their pointer is over the flow.
891
- * @default true
892
- */
893
- readonly preventScrolling?: boolean;
894
- /**
895
- * Controls if the viewport should zoom by scrolling inside the container.
896
- * @default true
897
- */
898
- readonly zoomOnScroll?: boolean;
899
- /**
900
- * Controls if the viewport should zoom by double clicking somewhere on the flow
901
- * @default true
902
- */
903
- readonly zoomOnDoubleClick?: boolean;
904
- /**
905
- * Controls if the viewport should zoom by pinching on a touch screen
906
- * @default true
907
- */
908
- readonly zoomOnPinch?: boolean;
909
- /**
910
- * Controls if the viewport should pan by scrolling inside the container
911
- * Can be limited to a specific direction with panOnScrollMode
912
- * @default false
913
- */
914
- readonly panOnScroll?: boolean;
915
- /**
916
- * This prop is used to limit the direction of panning when panOnScroll is enabled.
917
- * The "free" option allows panning in any direction.
918
- * @default "free"
919
- * @example "horizontal" | "vertical"
920
- */
921
- readonly panOnScrollMode?: PanOnScrollMode;
922
- /**
923
- * Enableing this prop allows users to pan the viewport by clicking and dragging.
924
- * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
925
- * @default true
926
- * @example [0, 2] // allows panning with the left and right mouse buttons
927
- * [0, 1, 2, 3, 4] // allows panning with all mouse buttons
928
- */
929
- readonly panOnDrag?: boolean | number[];
930
- /**
931
- * Select multiple elements with a selection box, without pressing down selectionKey.
932
- * @default false
933
- */
934
- readonly selectionOnDrag?: boolean;
935
- /**
936
- * You can enable this optimization to instruct Solid Flow to only render nodes and edges that would be visible in the viewport.
937
- * This might improve performance when you have a large number of nodes and edges but also adds an overhead.
938
- * @default false
939
- */
940
- readonly onlyRenderVisibleElements?: boolean;
941
- /**
942
- * You can enable this prop to automatically pan the viewport while making a new connection.
943
- * @default true
944
- */
945
- readonly autoPanOnConnect?: boolean;
946
- /**
947
- * You can enable this prop to automatically pan the viewport while dragging a node.
948
- * @default true
949
- */
950
- readonly autoPanOnNodeDrag?: boolean;
951
- /**
952
- * Defaults to be applied to all new edges that are added to the flow.
953
- * Properties on a new edge will override these defaults if they exist.
954
- * @example
955
- * const defaultEdgeOptions = {
956
- * type: 'customEdgeType',
957
- * animated: true
958
- * }
959
- */
960
- readonly defaultEdgeOptions?: DefaultEdgeOptions;
961
- /**
962
- * Controls color scheme used for styling the flow
963
- * @default 'system'
964
- * @example 'system' | 'light' | 'dark'
965
- */
966
- readonly colorMode?: ColorMode;
967
- /** Fallback color mode for SSR if colorMode is set to 'system' */
968
- readonly colorModeSSR?: Omit<ColorMode, "system">;
969
- /** Class to be applied to the flow container */
970
- readonly class?: string;
971
- /** Styles to be applied to the flow container */
972
- readonly style?: JSX.CSSProperties;
973
- /** Choose from the built-in edge types to be used for connections
974
- * @default 'default' | ConnectionLineType.Bezier
975
- * @example 'straight' | 'default' | 'step' | 'smoothstep' | 'bezier'
976
- * @example ConnectionLineType.Straight | ConnectionLineType.Default | ConnectionLineType.Step | ConnectionLineType.SmoothStep | ConnectionLineType.Bezier
977
- */
978
- readonly connectionLineType?: ConnectionLineType$1;
979
- /** Enabling this option will raise the z-index of nodes when they are selected.
980
- * @default true
981
- */
982
- readonly elevateNodesOnSelect?: boolean;
983
- /**
984
- * Controls how z-indexes are calculated for nodes and edges.
985
- * 'auto' automatically manages z-indexing for selections and sub flows,
986
- * 'basic' manages z-indexing for selections only, and
987
- * 'manual' does not apply any automatic z-indexing.
988
- * @default "basic"
989
- */
990
- readonly zIndexMode?: ZIndexMode;
991
- /**
992
- * Enabling this option will raise the z-index of edges when they are selected,
993
- * or when the connected nodes are selected.
994
- * @default true
995
- */
996
- readonly elevateEdgesOnSelect?: boolean;
997
- /**
998
- * You can use this prop to disable keyboard accessibility features such as selecting nodes or
999
- * moving selected nodes with the arrow keys.
1000
- * @default false
1001
- */
1002
- readonly disableKeyboardA11y?: boolean;
1003
- /**
1004
- * If a node is draggable, clicking and dragging that node will move it around the canvas. Adding
1005
- * the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that
1006
- * class.
1007
- * @default "nodrag"
1008
- */
1009
- readonly noDragClass?: string;
1010
- /**
1011
- * Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
1012
- * Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
1013
- * allows you to change the name of that class.
1014
- * @default "nowheel"
1015
- */
1016
- readonly noWheelClass?: string;
1017
- /**
1018
- * If an element in the canvas does not stop mouse events from propagating, clicking and dragging
1019
- * that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this
1020
- * prop allows you to change the name of that class.
1021
- * @default "nopan"
1022
- */
1023
- readonly noPanClass?: string;
1024
- /** Toggles ability to make connections via clicking the handles */
1025
- readonly clickConnect?: boolean;
1026
- /**
1027
- * This callback can be used to validate a new connection.
1028
- * If you return `false`, the edge will not be added to your flow.
1029
- * If you have custom connection logic its preferred to use this callback over the
1030
- * `isValidConnection` prop on the handle component for performance reasons.
1031
- */
1032
- /**
1033
- * Set position of the attribution
1034
- * @default 'bottom-right'
1035
- * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
1036
- */
1037
- readonly attributionPosition?: PanelPosition;
1038
- /**
1039
- * By default, we render a small attribution in the corner of your flows that links back to the project.
1040
- * You are free to remove this attribution but we ask that you take a quick look at our
1041
- * {@link https://svelteflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide}
1042
- * before doing so.
1043
- */
1044
- readonly proOptions?: ProOptions;
1045
- readonly isValidConnection?: IsValidConnection<EdgeType>;
1046
- /** This event handler is called when the user begins to pan or zoom the viewport */
1047
- readonly onMoveStart?: OnMoveStart;
1048
- /** This event handler is called when the user pans or zooms the viewport */
1049
- readonly onMove?: OnMove;
1050
- /** This event handler is called when the user stops panning or zooming the viewport */
1051
- readonly onMoveEnd?: OnMoveEnd;
1052
- /**
1053
- * Ocassionally something may happen that causes Solid Flow to throw an error.
1054
- * Instead of exploding your application, we log a message to the console and then call this event handler.
1055
- * You might use it for additional logging or to show a message to the user.
1056
- */
1057
- readonly onFlowError?: OnError;
1058
- /** This handler gets called when the user deletes nodes or edges.
1059
- * @example
1060
- * onDelete={({nodes, edges}) => {
1061
- * console.log('deleted nodes:', nodes);
1062
- * console.log('deleted edges:', edges);
1063
- * }}
1064
- */
1065
- readonly onDelete?: OnDelete<NodeType, EdgeType>;
1066
- /** This handler gets called before the user deletes nodes or edges and provides a way to abort the deletion by returning false. */
1067
- readonly onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
1068
- /** This handler gets called when a new edge is created. You can use it to modify the newly created edge. */
1069
- readonly onBeforeConnect?: OnBeforeEdgeConnect<EdgeType>;
1070
- /** This event gets fired when a connection successfully completes and an edge is created. */
1071
- readonly onConnect?: OnEdgeConnect;
1072
- /** When a user starts to drag a connection line, this event gets fired. */
1073
- readonly onConnectStart?: OnConnectStart;
1074
- /** When a user stops dragging a connection line, this event gets fired. */
1075
- readonly onConnectEnd?: OnConnectEnd;
1076
- /** This event gets fired when after an edge was reconnected*/
1077
- readonly onReconnect?: OnReconnect<EdgeType>;
1078
- /** This event gets fired when a user starts to reconnect an edge */
1079
- readonly onReconnectStart?: OnReconnectStart<EdgeType>;
1080
- /** This event gets fired when a user stops reconnecting an edge */
1081
- readonly onReconnectEnd?: OnReconnectEnd<NodeType, EdgeType>;
1082
- /** This handler gets called when an edge is reconnected. You can use it to modify the edge before the update is applied. */
1083
- readonly onBeforeReconnect?: OnBeforeReconnect<EdgeType>;
1084
- /** A connection is started by clicking on a handle */
1085
- readonly onClickConnectStart?: OnConnectStart;
1086
- /** A connection is finished by clicking on a handle */
1087
- readonly onClickConnectEnd?: OnConnectEnd;
1088
- /** This handler gets called when the flow is finished initializing */
1089
- readonly onInit?: () => void;
1090
- /** This event handler gets called when the selected nodes & edges change */
1091
- readonly onSelectionChange?: OnSelectionChange<NodeType, EdgeType>;
1092
- /** This event handler gets called when a user starts to drag a selection box. */
1093
- readonly onSelectionDragStart?: OnSelectionDrag<NodeType>;
1094
- /** This event handler gets called when a user drags a selection box. */
1095
- readonly onSelectionDrag?: OnSelectionDrag<NodeType>;
1096
- /** This event handler gets called when a user stops dragging a selection box. */
1097
- readonly onSelectionDragStop?: OnSelectionDrag<NodeType>;
1098
- /** This event handler gets called when the user starts to drag a selection box */
1099
- readonly onSelectionStart?: (event: PointerEvent) => void;
1100
- /** This event handler gets called when the user finishes dragging a selection box */
1101
- readonly onSelectionEnd?: (event: PointerEvent) => void;
1102
- /**
1103
- * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults.
1104
- * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings.
1105
- */
1106
- readonly ariaLabelConfig?: Partial<AriaLabelConfig>;
702
+ /**
703
+ * The id of the flow. This is necessary if you want to render multiple flows.
704
+ */
705
+ readonly id?: string;
706
+ /** Sets a fixed width for the flow */
707
+ readonly width?: number;
708
+ /** Sets a fixed height for the flow */
709
+ readonly height?: number;
710
+ /**
711
+ * An store of nodes to render in a flow.
712
+ * @example
713
+ * const [nodes] = createStore([
714
+ * {
715
+ * id: 'node-1',
716
+ * type: 'input',
717
+ * data: { label: 'Node 1' },
718
+ * position: { x: 250, y: 50 }
719
+ * }
720
+ * ]);
721
+ */
722
+ readonly nodes?: Store<NodeType[]>;
723
+ /**
724
+ * An store of edges to render in a flow.
725
+ * @example
726
+ * const [edges] = createStore([
727
+ * {
728
+ * id: 'edge-1-2',
729
+ * source: 'node-1',
730
+ * target: 'node-2',
731
+ * }
732
+ * ]);
733
+ */
734
+ readonly edges?: Store<EdgeType[]>;
735
+ /**
736
+ * Custom node types to be available in a flow.
737
+ * Solid Flow matches a node's type to a component in the nodeTypes object.
738
+ * @example
739
+ * import CustomNode from './CustomNode';
740
+ *
741
+ * const nodeTypes = { nameOfNodeType: CustomNode };
742
+ */
743
+ readonly nodeTypes?: NodeTypes;
744
+ /**
745
+ * Custom edge types to be available in a flow.
746
+ * Solid Flow matches an edge's type to a component in the edgeTypes object.
747
+ * @example
748
+ * import CustomEdge from './CustomEdge';
749
+ *
750
+ * const edgeTypes = { nameOfEdgeType: CustomEdge };
751
+ */
752
+ readonly edgeTypes?: EdgeTypes;
753
+ /** Pressing down this key you can select multiple elements with a selection box.
754
+ * @default 'Shift'
755
+ */
756
+ readonly selectionKey?: KeyDefinition | KeyDefinition[] | null;
757
+ /** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
758
+ *
759
+ * By setting this prop to null you can disable this functionality.
760
+ * @default 'Space'
761
+ */
762
+ readonly panActivationKey?: KeyDefinition | KeyDefinition[] | null;
763
+ /** Pressing down this key deletes all selected nodes & edges.
764
+ * @default 'Backspace'
765
+ */
766
+ readonly deleteKey?: KeyDefinition | KeyDefinition[] | null;
767
+ /** Pressing down this key you can select multiple elements by clicking.
768
+ * @default 'Meta' for macOS, "Ctrl" for other systems
769
+ */
770
+ readonly multiSelectionKey?: KeyDefinition | KeyDefinition[] | null;
771
+ /** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
772
+ *
773
+ * By setting this prop to null you can disable this functionality.
774
+ * @default 'Meta' for macOS, "Ctrl" for other systems
775
+ * */
776
+ readonly zoomActivationKey?: KeyDefinition | KeyDefinition[] | null;
777
+ /** If set, initial viewport will show all nodes & edges */
778
+ readonly fitView?: boolean;
779
+ /**
780
+ * Options to be used in combination with fitView
781
+ * @example
782
+ * const fitViewOptions = {
783
+ * padding: 0.1,
784
+ * includeHiddenNodes: false,
785
+ * minZoom: 0.1,
786
+ * maxZoom: 1,
787
+ * duration: 200,
788
+ * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
789
+ * };
790
+ */
791
+ readonly fitViewOptions?: FitViewOptions<NodeType>;
792
+ /**
793
+ * Defines nodes relative position to its coordinates
794
+ * @default [0, 0]
795
+ * @example
796
+ * [0, 0] // default, top left
797
+ * [0.5, 0.5] // center
798
+ * [1, 1] // bottom right
799
+ */
800
+ readonly nodeOrigin?: NodeOrigin$1;
801
+ /**
802
+ * With a threshold greater than zero you can control the distinction between node drag and click events.
803
+ * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
804
+ * @default 1
805
+ */
806
+ readonly nodeDragThreshold?: number;
807
+ /**
808
+ * Distance that the mouse can move between mousedown/up that will trigger a click
809
+ * @default 0
810
+ */
811
+ readonly paneClickDistance?: number;
812
+ /** Distance that the mouse can move between mousedown/up that will trigger a click
813
+ * @default 0
814
+ */
815
+ readonly nodeClickDistance?: number;
816
+ /**
817
+ * The threshold in pixels that the mouse must move before a connection line starts to drag.
818
+ * This is useful to prevent accidental connections when clicking on a handle.
819
+ * @default 1
820
+ */
821
+ readonly connectionDragThreshold?: number;
822
+ /** Minimum zoom level
823
+ * @default 0.5
824
+ */
825
+ readonly minZoom?: number;
826
+ /** Maximum zoom level
827
+ * @default 2
828
+ */
829
+ readonly maxZoom?: number;
830
+ /**
831
+ * Sets the initial position and zoom of the viewport.
832
+ * If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
833
+ * @default { zoom: 1, position: { x: 0, y: 0 } }
834
+ * @example
835
+ * const initialViewport = {
836
+ * zoom: 0.5,
837
+ * position: { x: 0, y: 0 }
838
+ * };
839
+ */
840
+ readonly initialViewport?: Viewport$1;
841
+ /** Custom viewport to be used instead of internal one */
842
+ readonly viewport?: Store<Viewport$1>;
843
+ /**
844
+ * The radius around a handle where you drop a connection line to create a new edge.
845
+ * @default 20
846
+ */
847
+ readonly connectionRadius?: number;
848
+ /**
849
+ * 'strict' connection mode will only allow you to connect source handles to target handles.
850
+ * 'loose' connection mode will allow you to connect handles of any type to one another.
851
+ * @default 'strict'
852
+ */
853
+ readonly connectionMode?: ConnectionMode$2;
854
+ /** Provide a custom snippet to be used insted of the default connection line */
855
+ readonly connectionLineComponent?: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
856
+ /** Styles to be applied to the connection line */
857
+ readonly connectionLineStyle?: JSX.CSSProperties;
858
+ /** Styles to be applied to the container of the connection line */
859
+ readonly connectionLineContainerStyle?: JSX.CSSProperties;
860
+ /**
861
+ * When set to "partial", when the user creates a selection box by click and dragging
862
+ * nodes that are only partially in the box are still selected.
863
+ * @default 'full'
864
+ */
865
+ readonly selectionMode?: SelectionMode$2;
866
+ /**
867
+ * Controls if nodes should be automatically selected when being dragged
868
+ */
869
+ readonly selectNodesOnDrag?: boolean;
870
+ /**
871
+ * Grid all nodes will snap to
872
+ * @example [20, 20]
873
+ */
874
+ readonly snapGrid?: SnapGrid$1;
875
+ /** Color of edge markers
876
+ * You can pass `null` to use the CSS variable `--xy-edge-stroke` for the marker color.
877
+ * @example "#b1b1b7"
878
+ */
879
+ readonly defaultMarkerColor?: string | null;
880
+ /**
881
+ * Controls if all nodes should be draggable
882
+ * @default true
883
+ */
884
+ readonly nodesDraggable?: boolean;
885
+ /**
886
+ * When `true`, the viewport will pan when a node is focused.
887
+ * @default true
888
+ */
889
+ readonly autoPanOnNodeFocus?: boolean;
890
+ /**
891
+ * When `true`, the viewport will pan when a drag selection approaches the edges of the flow container.
892
+ * @default true
893
+ */
894
+ readonly autoPanOnSelection?: boolean;
895
+ /**
896
+ * Controls if all nodes should be connectable to each other
897
+ * @default true
898
+ */
899
+ readonly nodesConnectable?: boolean;
900
+ /** Controls if all elements should (nodes & edges) be selectable
901
+ * @default true
902
+ */
903
+ readonly elementsSelectable?: boolean;
904
+ /**
905
+ * When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter`
906
+ * key. This option can be overridden by individual nodes by setting their `focusable` prop.
907
+ * @default true
908
+ */
909
+ readonly nodesFocusable?: boolean;
910
+ /**
911
+ * When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter`
912
+ * key. This option can be overridden by individual edges by setting their `focusable` prop.
913
+ * @default true
914
+ */
915
+ readonly edgesFocusable?: boolean;
916
+ /**
917
+ * By default the viewport extends infinitely. You can use this prop to set a boundary.
918
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
919
+ * @default @default [[-∞, -∞], [+∞, +∞]]
920
+ * @example [[-1000, -10000], [1000, 1000]]
921
+ */
922
+ readonly translateExtent?: CoordinateExtent$1;
923
+ /**
924
+ * By default the nodes can be placed anywhere. You can use this prop to set a boundary.
925
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
926
+ * @default [[-∞, -∞], [+∞, +∞]]
927
+ * @example [[-1000, -10000], [1000, 1000]]
928
+ */
929
+ readonly nodeExtent?: CoordinateExtent$1;
930
+ /**
931
+ * Disabling this prop will allow the user to scroll the page even when their pointer is over the flow.
932
+ * @default true
933
+ */
934
+ readonly preventScrolling?: boolean;
935
+ /**
936
+ * Controls if the viewport should zoom by scrolling inside the container.
937
+ * @default true
938
+ */
939
+ readonly zoomOnScroll?: boolean;
940
+ /**
941
+ * Controls if the viewport should zoom by double clicking somewhere on the flow
942
+ * @default true
943
+ */
944
+ readonly zoomOnDoubleClick?: boolean;
945
+ /**
946
+ * Controls if the viewport should zoom by pinching on a touch screen
947
+ * @default true
948
+ */
949
+ readonly zoomOnPinch?: boolean;
950
+ /**
951
+ * Controls if the viewport should pan by scrolling inside the container
952
+ * Can be limited to a specific direction with panOnScrollMode
953
+ * @default false
954
+ */
955
+ readonly panOnScroll?: boolean;
956
+ /**
957
+ * This prop is used to limit the direction of panning when panOnScroll is enabled.
958
+ * The "free" option allows panning in any direction.
959
+ * @default "free"
960
+ * @example "horizontal" | "vertical"
961
+ */
962
+ readonly panOnScrollMode?: PanOnScrollMode$2;
963
+ /**
964
+ * Enableing this prop allows users to pan the viewport by clicking and dragging.
965
+ * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
966
+ * @default true
967
+ * @example [0, 2] // allows panning with the left and right mouse buttons
968
+ * [0, 1, 2, 3, 4] // allows panning with all mouse buttons
969
+ */
970
+ readonly panOnDrag?: boolean | number[];
971
+ /**
972
+ * Select multiple elements with a selection box, without pressing down selectionKey.
973
+ * @default false
974
+ */
975
+ readonly selectionOnDrag?: boolean;
976
+ /**
977
+ * You can enable this optimization to instruct Solid Flow to only render nodes and edges that would be visible in the viewport.
978
+ * This might improve performance when you have a large number of nodes and edges but also adds an overhead.
979
+ * @default false
980
+ */
981
+ readonly onlyRenderVisibleElements?: boolean;
982
+ /**
983
+ * You can enable this prop to automatically pan the viewport while making a new connection.
984
+ * @default true
985
+ */
986
+ readonly autoPanOnConnect?: boolean;
987
+ /**
988
+ * You can enable this prop to automatically pan the viewport while dragging a node.
989
+ * @default true
990
+ */
991
+ readonly autoPanOnNodeDrag?: boolean;
992
+ /**
993
+ * Defaults to be applied to all new edges that are added to the flow.
994
+ * Properties on a new edge will override these defaults if they exist.
995
+ * @example
996
+ * const defaultEdgeOptions = {
997
+ * type: 'customEdgeType',
998
+ * animated: true
999
+ * }
1000
+ */
1001
+ readonly defaultEdgeOptions?: DefaultEdgeOptions;
1002
+ /**
1003
+ * Controls color scheme used for styling the flow
1004
+ * @default 'system'
1005
+ * @example 'system' | 'light' | 'dark'
1006
+ */
1007
+ readonly colorMode?: ColorMode$1;
1008
+ /** Fallback color mode for SSR if colorMode is set to 'system' */
1009
+ readonly colorModeSSR?: Omit<ColorMode$1, "system">;
1010
+ /** Class to be applied to the flow container */
1011
+ readonly class?: string;
1012
+ /** Styles to be applied to the flow container */
1013
+ readonly style?: JSX.CSSProperties;
1014
+ /** Choose from the built-in edge types to be used for connections
1015
+ * @default 'default' | ConnectionLineType.Bezier
1016
+ * @example 'straight' | 'default' | 'step' | 'smoothstep' | 'bezier'
1017
+ * @example ConnectionLineType.Straight | ConnectionLineType.Default | ConnectionLineType.Step | ConnectionLineType.SmoothStep | ConnectionLineType.Bezier
1018
+ */
1019
+ readonly connectionLineType?: ConnectionLineType$3;
1020
+ /** Enabling this option will raise the z-index of nodes when they are selected.
1021
+ * @default true
1022
+ */
1023
+ readonly elevateNodesOnSelect?: boolean;
1024
+ /**
1025
+ * Controls how z-indexes are calculated for nodes and edges.
1026
+ * 'auto' automatically manages z-indexing for selections and sub flows,
1027
+ * 'basic' manages z-indexing for selections only, and
1028
+ * 'manual' does not apply any automatic z-indexing.
1029
+ * @default "basic"
1030
+ */
1031
+ readonly zIndexMode?: ZIndexMode;
1032
+ /**
1033
+ * Enabling this option will raise the z-index of edges when they are selected,
1034
+ * or when the connected nodes are selected.
1035
+ * @default true
1036
+ */
1037
+ readonly elevateEdgesOnSelect?: boolean;
1038
+ /**
1039
+ * You can use this prop to disable keyboard accessibility features such as selecting nodes or
1040
+ * moving selected nodes with the arrow keys.
1041
+ * @default false
1042
+ */
1043
+ readonly disableKeyboardA11y?: boolean;
1044
+ /**
1045
+ * If a node is draggable, clicking and dragging that node will move it around the canvas. Adding
1046
+ * the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that
1047
+ * class.
1048
+ * @default "nodrag"
1049
+ */
1050
+ readonly noDragClass?: string;
1051
+ /**
1052
+ * Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
1053
+ * Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
1054
+ * allows you to change the name of that class.
1055
+ * @default "nowheel"
1056
+ */
1057
+ readonly noWheelClass?: string;
1058
+ /**
1059
+ * If an element in the canvas does not stop mouse events from propagating, clicking and dragging
1060
+ * that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this
1061
+ * prop allows you to change the name of that class.
1062
+ * @default "nopan"
1063
+ */
1064
+ readonly noPanClass?: string;
1065
+ /** Toggles ability to make connections via clicking the handles */
1066
+ readonly clickConnect?: boolean;
1067
+ /**
1068
+ * This callback can be used to validate a new connection.
1069
+ * If you return `false`, the edge will not be added to your flow.
1070
+ * If you have custom connection logic its preferred to use this callback over the
1071
+ * `isValidConnection` prop on the handle component for performance reasons.
1072
+ */
1073
+ /**
1074
+ * Set position of the attribution
1075
+ * @default 'bottom-right'
1076
+ * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
1077
+ */
1078
+ readonly attributionPosition?: PanelPosition$1;
1079
+ /**
1080
+ * By default, we render a small attribution in the corner of your flows that links back to the project.
1081
+ * You are free to remove this attribution but we ask that you take a quick look at our
1082
+ * {@link https://svelteflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide}
1083
+ * before doing so.
1084
+ */
1085
+ readonly proOptions?: ProOptions$1;
1086
+ readonly isValidConnection?: IsValidConnection$1<EdgeType>;
1087
+ /** This event handler is called when the user begins to pan or zoom the viewport */
1088
+ readonly onMoveStart?: OnMoveStart$1;
1089
+ /** This event handler is called when the user pans or zooms the viewport */
1090
+ readonly onMove?: OnMove$1;
1091
+ /** This event handler is called when the user stops panning or zooming the viewport */
1092
+ readonly onMoveEnd?: OnMoveEnd$1;
1093
+ /**
1094
+ * Ocassionally something may happen that causes Solid Flow to throw an error.
1095
+ * Instead of exploding your application, we log a message to the console and then call this event handler.
1096
+ * You might use it for additional logging or to show a message to the user.
1097
+ */
1098
+ readonly onFlowError?: OnError$1;
1099
+ /** This handler gets called when the user deletes nodes or edges.
1100
+ * @example
1101
+ * onDelete={({nodes, edges}) => {
1102
+ * console.log('deleted nodes:', nodes);
1103
+ * console.log('deleted edges:', edges);
1104
+ * }}
1105
+ */
1106
+ readonly onDelete?: OnDelete<NodeType, EdgeType>;
1107
+ /** This handler gets called before the user deletes nodes or edges and provides a way to abort the deletion by returning false. */
1108
+ readonly onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
1109
+ /** This handler gets called when a new edge is created. You can use it to modify the newly created edge. */
1110
+ readonly onBeforeConnect?: OnBeforeEdgeConnect<EdgeType>;
1111
+ /** This event gets fired when a connection successfully completes and an edge is created. */
1112
+ readonly onConnect?: OnEdgeConnect;
1113
+ /** When a user starts to drag a connection line, this event gets fired. */
1114
+ readonly onConnectStart?: OnConnectStart$1;
1115
+ /** When a user stops dragging a connection line, this event gets fired. */
1116
+ readonly onConnectEnd?: OnConnectEnd$1;
1117
+ /** This event gets fired when after an edge was reconnected*/
1118
+ readonly onReconnect?: OnReconnect$1<EdgeType>;
1119
+ /** This event gets fired when a user starts to reconnect an edge */
1120
+ readonly onReconnectStart?: OnReconnectStart$1<EdgeType>;
1121
+ /** This event gets fired when a user stops reconnecting an edge */
1122
+ readonly onReconnectEnd?: OnReconnectEnd$1<NodeType, EdgeType>;
1123
+ /** This handler gets called when an edge is reconnected. You can use it to modify the edge before the update is applied. */
1124
+ readonly onBeforeReconnect?: OnBeforeReconnect<EdgeType>;
1125
+ /** A connection is started by clicking on a handle */
1126
+ readonly onClickConnectStart?: OnConnectStart$1;
1127
+ /** A connection is finished by clicking on a handle */
1128
+ readonly onClickConnectEnd?: OnConnectEnd$1;
1129
+ /** This handler gets called when the flow is finished initializing */
1130
+ readonly onInit?: () => void;
1131
+ /** This event handler gets called when the selected nodes & edges change */
1132
+ readonly onSelectionChange?: OnSelectionChange<NodeType, EdgeType>;
1133
+ /** This event handler gets called when a user starts to drag a selection box. */
1134
+ readonly onSelectionDragStart?: OnSelectionDrag$1<NodeType>;
1135
+ /** This event handler gets called when a user drags a selection box. */
1136
+ readonly onSelectionDrag?: OnSelectionDrag$1<NodeType>;
1137
+ /** This event handler gets called when a user stops dragging a selection box. */
1138
+ readonly onSelectionDragStop?: OnSelectionDrag$1<NodeType>;
1139
+ /** This event handler gets called when the user starts to drag a selection box */
1140
+ readonly onSelectionStart?: (event: PointerEvent) => void;
1141
+ /** This event handler gets called when the user finishes dragging a selection box */
1142
+ readonly onSelectionEnd?: (event: PointerEvent) => void;
1143
+ /**
1144
+ * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults.
1145
+ * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings.
1146
+ */
1147
+ readonly ariaLabelConfig?: Partial<AriaLabelConfig$1>;
1107
1148
  };
1108
-
1149
+ //#endregion
1150
+ //#region src/components/SolidFlow/component.d.ts
1109
1151
  type SolidFlowComponentProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ParentProps<SolidFlowProps<NodeType, EdgeType>> & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style" | "onselectionchange" | "onSelectionChange">;
1110
1152
  declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: SolidFlowComponentProps<NodeType, EdgeType>) => JSX.Element;
1111
-
1153
+ //#endregion
1154
+ //#region src/components/SolidFlow/provider.d.ts
1112
1155
  declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) => JSX.Element;
1113
-
1114
- type ExtractEdgeInfo<T> = T extends (props: EdgeProps<infer TData, infer TType>) => unknown ? {
1115
- data: TData;
1116
- type: TType;
1156
+ //#endregion
1157
+ //#region src/data/createEdgeStore.d.ts
1158
+ type ExtractEdgeInfo<T> = T extends ((props: EdgeProps<infer TData, infer TType>) => unknown) ? {
1159
+ data: TData;
1160
+ type: TType;
1117
1161
  } : never;
1118
1162
  type AllEdgeTypes<TUserEdgeTypes extends EdgeTypes> = TUserEdgeTypes extends Record<string, never> ? BuiltInEdgeTypes : BuiltInEdgeTypes & TUserEdgeTypes;
1119
- type EdgesInput<TUserEdgeTypes extends EdgeTypes> = {
1120
- [K in keyof AllEdgeTypes<TUserEdgeTypes>]: Edge<ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["data"], ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["type"]>;
1121
- }[keyof AllEdgeTypes<TUserEdgeTypes>];
1163
+ type EdgesInput<TUserEdgeTypes extends EdgeTypes> = { [K in keyof AllEdgeTypes<TUserEdgeTypes>]: Edge<ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["data"], ExtractEdgeInfo<AllEdgeTypes<TUserEdgeTypes>[K]>["type"]>; }[keyof AllEdgeTypes<TUserEdgeTypes>];
1122
1164
  /**
1123
1165
  * Creates a type-safe reactive store of edges for use in Solid Flow.
1124
1166
  *
@@ -1195,16 +1237,15 @@ type EdgesInput<TUserEdgeTypes extends EdgeTypes> = {
1195
1237
  * - Works seamlessly with both built-in and custom node types
1196
1238
  * - Type errors prevent invalid type names or incorrect data structures
1197
1239
  */
1198
- declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string, never>>(edges: EdgesInput<TUserEdgeTypes>[]) => readonly [Store<EdgesInput<TUserEdgeTypes>[]>, SetStoreFunction<EdgesInput<TUserEdgeTypes>[]>];
1199
-
1200
- type ExtractNodeInfo<T> = T extends (props: NodeProps<infer TData, infer TType>) => unknown ? {
1201
- data: TData;
1202
- type: TType;
1240
+ declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string, never>>(edges: EdgesInput<TUserEdgeTypes>[]) => readonly [Store<EdgesInput<TUserEdgeTypes>[]>, StoreSetter<EdgesInput<TUserEdgeTypes>[]>];
1241
+ //#endregion
1242
+ //#region src/data/createNodeStore.d.ts
1243
+ type ExtractNodeInfo<T> = T extends ((props: NodeProps<infer TData, infer TType>) => unknown) ? {
1244
+ data: TData;
1245
+ type: TType;
1203
1246
  } : never;
1204
1247
  type AllNodeTypes<TUserNodeTypes extends NodeTypes> = TUserNodeTypes extends Record<string, never> ? BuiltInNodeTypes : BuiltInNodeTypes & TUserNodeTypes;
1205
- type NodesInput<TUserNodeTypes extends NodeTypes> = {
1206
- [K in keyof AllNodeTypes<TUserNodeTypes>]: Node<ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["data"], ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["type"]>;
1207
- }[keyof AllNodeTypes<TUserNodeTypes>];
1248
+ type NodesInput<TUserNodeTypes extends NodeTypes> = { [K in keyof AllNodeTypes<TUserNodeTypes>]: Node<ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["data"], ExtractNodeInfo<AllNodeTypes<TUserNodeTypes>[K]>["type"]>; }[keyof AllNodeTypes<TUserNodeTypes>];
1208
1249
  /**
1209
1250
  * Creates a type-safe reactive store of nodes for use in Solid Flow.
1210
1251
  *
@@ -1276,8 +1317,9 @@ type NodesInput<TUserNodeTypes extends NodeTypes> = {
1276
1317
  * - Works seamlessly with both built-in and custom node types
1277
1318
  * - Type errors prevent invalid type names or incorrect data structures
1278
1319
  */
1279
- declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string, never>>(nodes: NodesInput<TUserNodeTypes>[]) => readonly [Store<NodesInput<TUserNodeTypes>[]>, SetStoreFunction<NodesInput<TUserNodeTypes>[]>];
1280
-
1320
+ declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string, never>>(nodes: NodesInput<TUserNodeTypes>[]) => readonly [Store<NodesInput<TUserNodeTypes>[]>, StoreSetter<NodesInput<TUserNodeTypes>[]>];
1321
+ //#endregion
1322
+ //#region src/hooks/useColorMode.d.ts
1281
1323
  /**
1282
1324
  * Hook for receiving the current color mode class ('dark' or 'light').
1283
1325
  *
@@ -1287,8 +1329,9 @@ declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string
1287
1329
  * @public
1288
1330
  * @returns an accessor for the current color mode class
1289
1331
  */
1290
- declare function useColorMode(): () => ColorModeClass;
1291
-
1332
+ declare function useColorMode(): () => ColorModeClass$1;
1333
+ //#endregion
1334
+ //#region src/hooks/useConnection.d.ts
1292
1335
  /**
1293
1336
  * Hook for receiving the current connection.
1294
1337
  *
@@ -1296,7 +1339,8 @@ declare function useColorMode(): () => ColorModeClass;
1296
1339
  * @returns current connection as a readable store
1297
1340
  */
1298
1341
  declare function useConnection(): Accessor<ConnectionState>;
1299
-
1342
+ //#endregion
1343
+ //#region src/hooks/useGraph.d.ts
1300
1344
  /**
1301
1345
  * Hook for getting the current nodes from the store.
1302
1346
  *
@@ -1317,10 +1361,12 @@ declare function useEdges<EdgeType extends Edge = Edge>(): Accessor<EdgeType[]>;
1317
1361
  * @public
1318
1362
  * @returns store with the viewport object
1319
1363
  */
1320
- declare function useViewport(): Accessor<Viewport>;
1321
-
1364
+ declare function useViewport(): Accessor<Viewport$1>;
1365
+ //#endregion
1366
+ //#region src/hooks/useHandleEdgeSelect.d.ts
1322
1367
  declare function useHandleEdgeSelect(): (id: string) => void;
1323
-
1368
+ //#endregion
1369
+ //#region src/hooks/useInitialized.d.ts
1324
1370
  /**
1325
1371
  * Hook for seeing if all nodes have been measured.
1326
1372
  *
@@ -1340,7 +1386,8 @@ declare function useNodesInitialized(): Accessor<boolean>;
1340
1386
  * @returns an accessor that indicates whether the viewport is initialized
1341
1387
  */
1342
1388
  declare function useViewportInitialized(): Accessor<boolean>;
1343
-
1389
+ //#endregion
1390
+ //#region src/hooks/useInternalNode.d.ts
1344
1391
  /**
1345
1392
  * Hook to get an internal node by id.
1346
1393
  *
@@ -1349,11 +1396,12 @@ declare function useViewportInitialized(): Accessor<boolean>;
1349
1396
  * @returns an accessor with an internal node or undefined
1350
1397
  */
1351
1398
  declare function useInternalNode(id: Accessor<string>): Accessor<InternalNode | undefined>;
1352
-
1399
+ //#endregion
1400
+ //#region src/hooks/useNodeConnections.d.ts
1353
1401
  type UseNodeConnectionsParams = {
1354
- id?: string;
1355
- handleType?: HandleType;
1356
- handleId?: string;
1402
+ id?: string;
1403
+ handleType?: HandleType;
1404
+ handleId?: string;
1357
1405
  };
1358
1406
  /**
1359
1407
  * Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.
@@ -1366,8 +1414,9 @@ type UseNodeConnectionsParams = {
1366
1414
  * @todo @param param.onDisconnect - gets called when a connection is removed
1367
1415
  * @returns an array with connections
1368
1416
  */
1369
- declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection[]>;
1370
-
1417
+ declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection$1[]>;
1418
+ //#endregion
1419
+ //#region src/hooks/useNodesData.d.ts
1371
1420
  type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
1372
1421
  /**
1373
1422
  * Hook for receiving data of one or multiple nodes
@@ -1377,7 +1426,8 @@ type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
1377
1426
  */
1378
1427
  declare function useNodesData<NodeType extends Node = Node>(nodeId: Accessor<string | undefined | null>): Accessor<NodeData<NodeType> | undefined>;
1379
1428
  declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<string[] | undefined | null>): Accessor<NodeData<NodeType>[]>;
1380
-
1429
+ //#endregion
1430
+ //#region src/hooks/useSolidFlow.d.ts
1381
1431
  /**
1382
1432
  * Hook for accessing the SvelteFlow instance.
1383
1433
  *
@@ -1385,252 +1435,253 @@ declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<st
1385
1435
  * @returns A set of helper functions
1386
1436
  */
1387
1437
  declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): {
1388
- /**
1389
- * Zooms viewport in by 1.2.
1390
- *
1391
- * @param options.duration - optional duration. If set, a transition will be applied
1392
- */
1393
- zoomIn: ZoomInOut;
1394
- /**
1395
- * Zooms viewport out by 1 / 1.2.
1396
- *
1397
- * @param options.duration - optional duration. If set, a transition will be applied
1398
- */
1399
- zoomOut: ZoomInOut;
1400
- /**
1401
- * Returns an internal node by id.
1402
- *
1403
- * @param id - the node id
1404
- * @returns the node or undefined if no node was found
1405
- */
1406
- getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
1407
- /**
1408
- * Returns a node by id.
1409
- *
1410
- * @param id - the node id
1411
- * @returns the node or undefined if no node was found
1412
- */
1413
- getNode: (id: string) => NodeType | undefined;
1414
- /**
1415
- * Returns nodes.
1416
- *
1417
- * @returns nodes array
1418
- */
1419
- getNodes: (ids?: string[]) => NodeType[];
1420
- /**
1421
- * Returns an edge by id.
1422
- *
1423
- * @param id - the edge id
1424
- * @returns the edge or undefined if no edge was found
1425
- */
1426
- getEdge: (id: string) => EdgeType | undefined;
1427
- /**
1428
- * Returns edges.
1429
- *
1430
- * @returns edges array
1431
- */
1432
- getEdges: (ids?: string[]) => EdgeType[];
1433
- /**
1434
- * Add one or many nodes to your existing nodes array.
1435
- *
1436
- * @param payload - the nodes to add
1437
- */
1438
- addNodes: (payload: NodeType[] | NodeType) => void;
1439
- /**
1440
- * Add one or many edges to your existing edges array.
1441
- *
1442
- * @param payload - the edges to add
1443
- */
1444
- addEdges: (payload: EdgeType[] | EdgeType) => void;
1445
- /**
1446
- * Sets the current zoom level.
1447
- *
1448
- * @param zoomLevel - the zoom level to set
1449
- * @param options.duration - optional duration. If set, a transition will be applied
1450
- */
1451
- setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
1452
- /**
1453
- * Returns the current zoom level.
1454
- *
1455
- * @returns current zoom as a number
1456
- */
1457
- getZoom: () => number;
1458
- /**
1459
- * Sets the center of the view to the given position.
1460
- *
1461
- * @param x - x position
1462
- * @param y - y position
1463
- * @param options.zoom - optional zoom
1464
- */
1465
- setCenter: (x: number, y: number, options?: SetCenterOptions) => Promise<boolean>;
1466
- /**
1467
- * Sets the current viewport.
1468
- *
1469
- * @param viewport - the viewport to set
1470
- * @param options.duration - optional duration. If set, a transition will be applied
1471
- */
1472
- setViewport: (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise<boolean>;
1473
- /**
1474
- * Returns the current viewport.
1475
- *
1476
- * @returns Viewport
1477
- */
1478
- getViewport: () => Viewport;
1479
- /**
1480
- * Fits the view.
1481
- *
1482
- * @param options.padding - optional padding
1483
- * @param options.includeHiddenNodes - optional includeHiddenNodes
1484
- * @param options.minZoom - optional minZoom
1485
- * @param options.maxZoom - optional maxZoom
1486
- * @param options.duration - optional duration. If set, a transition will be applied
1487
- * @param options.nodes - optional nodes to fit the view to
1488
- */
1489
- fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
1490
- /**
1491
- * Returns all nodes that intersect with the given node or rect.
1492
- *
1493
- * @param node - the node or rect to check for intersections
1494
- * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
1495
- * @param nodes - optional nodes array to check for intersections
1496
- *
1497
- * @returns an array of intersecting nodes
1498
- */
1499
- getIntersectingNodes: (nodeOrRect: NodeType | {
1500
- id: NodeType["id"];
1501
- } | Rect, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
1502
- /**
1503
- * Checks if the given node or rect intersects with the passed rect.
1504
- *
1505
- * @param node - the node or rect to check for intersections
1506
- * @param area - the rect to check for intersections
1507
- * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
1508
- *
1509
- * @returns true if the node or rect intersects with the given area
1510
- */
1511
- isNodeIntersecting: (nodeOrRect: NodeType | {
1512
- id: NodeType["id"];
1513
- } | Rect, area: Rect, partially?: boolean) => boolean;
1514
- /**
1515
- * Fits the view to the given bounds .
1516
- *
1517
- * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
1518
- * @param options.padding - optional padding
1519
- */
1520
- fitBounds: (bounds: Rect, options?: FitBoundsOptions) => Promise<boolean>;
1521
- /**
1522
- * Deletes nodes and edges.
1523
- *
1524
- * @param params.nodes - optional nodes array to delete
1525
- * @param params.edges - optional edges array to delete
1526
- *
1527
- * @returns a promise that resolves with the deleted nodes and edges
1528
- */
1529
- deleteElements: ({ nodes, edges, }: {
1530
- nodes?: (Partial<NodeType> & {
1531
- id: string;
1532
- })[];
1533
- edges?: (Partial<EdgeType> & {
1534
- id: string;
1535
- })[];
1536
- }) => Promise<{
1537
- deletedNodes: NodeType[];
1538
- deletedEdges: EdgeType[];
1539
- }>;
1540
- /**
1541
- * Converts a screen / client position to a flow position.
1542
- *
1543
- * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1544
- * @param options.snapToGrid - if true, the converted position will be snapped to the grid
1545
- * @returns position as { x: number, y: number }
1546
- *
1547
- * @example
1548
- * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
1549
- */
1550
- screenToFlowPosition: (clientPosition: XYPosition, options?: {
1551
- snapToGrid: boolean;
1552
- }) => XYPosition;
1553
- /**
1554
- * Converts a flow position to a screen / client position.
1555
- *
1556
- * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1557
- * @returns position as { x: number, y: number }
1558
- *
1559
- * @example
1560
- * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
1561
- */
1562
- flowToScreenPosition: (flowPosition: XYPosition) => XYPosition;
1563
- /**
1564
- * Updates a node.
1565
- *
1566
- * @param id - id of the node to update
1567
- * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
1568
- * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
1569
- *
1570
- * @example
1571
- * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1572
- */
1573
- updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
1574
- replace: boolean;
1575
- }) => void;
1576
- /**
1577
- * Updates the data attribute of a node.
1578
- *
1579
- * @param id - id of the node to update
1580
- * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
1581
- * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
1582
- *
1583
- * @example
1584
- * updateNodeData('node-1', { label: 'A new label' });
1585
- */
1586
- updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
1587
- replace: boolean;
1588
- }) => void;
1589
- /**
1590
- * Returns the nodes, edges and the viewport as a JSON object.
1591
- *
1592
- * @returns the nodes, edges and the viewport as a JSON object
1593
- */
1594
- /**
1595
- * Updates an edge.
1596
- *
1597
- * @param id - id of the edge to update
1598
- * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update
1599
- * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged
1600
- *
1601
- * @example
1602
- * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1603
- */
1604
- updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
1605
- replace: boolean;
1606
- }) => void;
1607
- toObject: () => {
1608
- nodes: NodeType[];
1609
- edges: EdgeType[];
1610
- viewport: Viewport;
1611
- };
1612
- /**
1613
- * Returns the bounds of the given nodes or node ids.
1614
- *
1615
- * @param nodes - the nodes or node ids to calculate the bounds for
1616
- *
1617
- * @returns the bounds of the given nodes
1618
- */
1619
- getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect;
1620
- /** Gets all connections for a given handle belonging to a specific node.
1621
- *
1622
- * @param type - handle type 'source' or 'target'
1623
- * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle)
1624
- * @param nodeId - the node id the handle belongs to
1625
- * @returns an array with handle connections
1626
- */
1627
- getHandleConnections: ({ type, id, nodeId, }: {
1628
- type: HandleType;
1629
- nodeId: string;
1630
- id?: string | null;
1631
- }) => HandleConnection[];
1438
+ /**
1439
+ * Zooms viewport in by 1.2.
1440
+ *
1441
+ * @param options.duration - optional duration. If set, a transition will be applied
1442
+ */
1443
+ zoomIn: ZoomInOut;
1444
+ /**
1445
+ * Zooms viewport out by 1 / 1.2.
1446
+ *
1447
+ * @param options.duration - optional duration. If set, a transition will be applied
1448
+ */
1449
+ zoomOut: ZoomInOut;
1450
+ /**
1451
+ * Returns an internal node by id.
1452
+ *
1453
+ * @param id - the node id
1454
+ * @returns the node or undefined if no node was found
1455
+ */
1456
+ getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
1457
+ /**
1458
+ * Returns a node by id.
1459
+ *
1460
+ * @param id - the node id
1461
+ * @returns the node or undefined if no node was found
1462
+ */
1463
+ getNode: (id: string) => NodeType | undefined;
1464
+ /**
1465
+ * Returns nodes.
1466
+ *
1467
+ * @returns nodes array
1468
+ */
1469
+ getNodes: (ids?: string[]) => NodeType[];
1470
+ /**
1471
+ * Returns an edge by id.
1472
+ *
1473
+ * @param id - the edge id
1474
+ * @returns the edge or undefined if no edge was found
1475
+ */
1476
+ getEdge: (id: string) => EdgeType | undefined;
1477
+ /**
1478
+ * Returns edges.
1479
+ *
1480
+ * @returns edges array
1481
+ */
1482
+ getEdges: (ids?: string[]) => EdgeType[];
1483
+ /**
1484
+ * Add one or many nodes to your existing nodes array.
1485
+ *
1486
+ * @param payload - the nodes to add
1487
+ */
1488
+ addNodes: (payload: NodeType[] | NodeType) => void;
1489
+ /**
1490
+ * Add one or many edges to your existing edges array.
1491
+ *
1492
+ * @param payload - the edges to add
1493
+ */
1494
+ addEdges: (payload: EdgeType[] | EdgeType) => void;
1495
+ /**
1496
+ * Sets the current zoom level.
1497
+ *
1498
+ * @param zoomLevel - the zoom level to set
1499
+ * @param options.duration - optional duration. If set, a transition will be applied
1500
+ */
1501
+ setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1502
+ /**
1503
+ * Returns the current zoom level.
1504
+ *
1505
+ * @returns current zoom as a number
1506
+ */
1507
+ getZoom: () => number;
1508
+ /**
1509
+ * Sets the center of the view to the given position.
1510
+ *
1511
+ * @param x - x position
1512
+ * @param y - y position
1513
+ * @param options.zoom - optional zoom
1514
+ */
1515
+ setCenter: (x: number, y: number, options?: SetCenterOptions$1) => Promise<boolean>;
1516
+ /**
1517
+ * Sets the current viewport.
1518
+ *
1519
+ * @param viewport - the viewport to set
1520
+ * @param options.duration - optional duration. If set, a transition will be applied
1521
+ */
1522
+ setViewport: (viewport: Viewport$1, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1523
+ /**
1524
+ * Returns the current viewport.
1525
+ *
1526
+ * @returns Viewport
1527
+ */
1528
+ getViewport: () => Viewport$1;
1529
+ /**
1530
+ * Fits the view.
1531
+ *
1532
+ * @param options.padding - optional padding
1533
+ * @param options.includeHiddenNodes - optional includeHiddenNodes
1534
+ * @param options.minZoom - optional minZoom
1535
+ * @param options.maxZoom - optional maxZoom
1536
+ * @param options.duration - optional duration. If set, a transition will be applied
1537
+ * @param options.nodes - optional nodes to fit the view to
1538
+ */
1539
+ fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
1540
+ /**
1541
+ * Returns all nodes that intersect with the given node or rect.
1542
+ *
1543
+ * @param node - the node or rect to check for intersections
1544
+ * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
1545
+ * @param nodes - optional nodes array to check for intersections
1546
+ *
1547
+ * @returns an array of intersecting nodes
1548
+ */
1549
+ getIntersectingNodes: (nodeOrRect: NodeType | {
1550
+ id: NodeType["id"];
1551
+ } | Rect$1, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
1552
+ /**
1553
+ * Checks if the given node or rect intersects with the passed rect.
1554
+ *
1555
+ * @param node - the node or rect to check for intersections
1556
+ * @param area - the rect to check for intersections
1557
+ * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
1558
+ *
1559
+ * @returns true if the node or rect intersects with the given area
1560
+ */
1561
+ isNodeIntersecting: (nodeOrRect: NodeType | {
1562
+ id: NodeType["id"];
1563
+ } | Rect$1, area: Rect$1, partially?: boolean) => boolean;
1564
+ /**
1565
+ * Fits the view to the given bounds .
1566
+ *
1567
+ * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
1568
+ * @param options.padding - optional padding
1569
+ */
1570
+ fitBounds: (bounds: Rect$1, options?: FitBoundsOptions$1) => Promise<boolean>;
1571
+ /**
1572
+ * Deletes nodes and edges.
1573
+ *
1574
+ * @param params.nodes - optional nodes array to delete
1575
+ * @param params.edges - optional edges array to delete
1576
+ *
1577
+ * @returns a promise that resolves with the deleted nodes and edges
1578
+ */
1579
+ deleteElements: ({ nodes, edges }: {
1580
+ nodes?: (Partial<NodeType> & {
1581
+ id: string;
1582
+ })[];
1583
+ edges?: (Partial<EdgeType> & {
1584
+ id: string;
1585
+ })[];
1586
+ }) => Promise<{
1587
+ deletedNodes: NodeType[];
1588
+ deletedEdges: EdgeType[];
1589
+ }>;
1590
+ /**
1591
+ * Converts a screen / client position to a flow position.
1592
+ *
1593
+ * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1594
+ * @param options.snapToGrid - if true, the converted position will be snapped to the grid
1595
+ * @returns position as { x: number, y: number }
1596
+ *
1597
+ * @example
1598
+ * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
1599
+ */
1600
+ screenToFlowPosition: (clientPosition: XYPosition$1, options?: {
1601
+ snapToGrid: boolean;
1602
+ }) => XYPosition$1;
1603
+ /**
1604
+ * Converts a flow position to a screen / client position.
1605
+ *
1606
+ * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1607
+ * @returns position as { x: number, y: number }
1608
+ *
1609
+ * @example
1610
+ * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
1611
+ */
1612
+ flowToScreenPosition: (flowPosition: XYPosition$1) => XYPosition$1;
1613
+ /**
1614
+ * Updates a node.
1615
+ *
1616
+ * @param id - id of the node to update
1617
+ * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
1618
+ * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
1619
+ *
1620
+ * @example
1621
+ * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1622
+ */
1623
+ updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
1624
+ replace: boolean;
1625
+ }) => void;
1626
+ /**
1627
+ * Updates the data attribute of a node.
1628
+ *
1629
+ * @param id - id of the node to update
1630
+ * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
1631
+ * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
1632
+ *
1633
+ * @example
1634
+ * updateNodeData('node-1', { label: 'A new label' });
1635
+ */
1636
+ updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
1637
+ replace: boolean;
1638
+ }) => void;
1639
+ /**
1640
+ * Returns the nodes, edges and the viewport as a JSON object.
1641
+ *
1642
+ * @returns the nodes, edges and the viewport as a JSON object
1643
+ */
1644
+ /**
1645
+ * Updates an edge.
1646
+ *
1647
+ * @param id - id of the edge to update
1648
+ * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update
1649
+ * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged
1650
+ *
1651
+ * @example
1652
+ * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1653
+ */
1654
+ updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
1655
+ replace: boolean;
1656
+ }) => void;
1657
+ toObject: () => {
1658
+ nodes: NodeType[];
1659
+ edges: EdgeType[];
1660
+ viewport: Viewport$1;
1661
+ };
1662
+ /**
1663
+ * Returns the bounds of the given nodes or node ids.
1664
+ *
1665
+ * @param nodes - the nodes or node ids to calculate the bounds for
1666
+ *
1667
+ * @returns the bounds of the given nodes
1668
+ */
1669
+ getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect$1;
1670
+ /** Gets all connections for a given handle belonging to a specific node.
1671
+ *
1672
+ * @param type - handle type 'source' or 'target'
1673
+ * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle)
1674
+ * @param nodeId - the node id the handle belongs to
1675
+ * @returns an array with handle connections
1676
+ */
1677
+ getHandleConnections: ({ type, id, nodeId }: {
1678
+ type: HandleType;
1679
+ nodeId: string;
1680
+ id?: string | null;
1681
+ }) => HandleConnection$1[];
1632
1682
  };
1633
-
1683
+ //#endregion
1684
+ //#region src/hooks/useUpdateNodeInternals.d.ts
1634
1685
  /**
1635
1686
  * Hook for updating node internals.
1636
1687
  *
@@ -1638,5 +1689,5 @@ declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edg
1638
1689
  * @returns function for updating node internals
1639
1690
  */
1640
1691
  declare function useUpdateNodeInternals(): UpdateNodeInternals;
1641
-
1642
- export { Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, type ConnectionData, ConnectionLine, type ConnectionLineComponentProps, ControlButton, Controls, type DefaultEdgeOptions, DefaultNode, type DeleteEvents, type Edge, type EdgeConnection, type EdgeEvents, EdgeLabel, EdgeLabelRenderer, type EdgeProps, EdgeReconnectAnchor, type EdgeReconnectEvents, EdgeRenderer, EdgeToolbar, type EdgeToolbarProps, type EdgeTypes, EdgeWrapper, type FitViewOptions, GroupNode, Handle, InputNode, type InternalNode, type KeyDefinition, type KeyDefinitionObject, type KeyModifier, Marker, MarkerDefinition, MiniMap, type Node, type NodeEvents, type NodeGraph, type NodeProps, NodeRenderer, NodeResizer, NodeSelection, type NodeSelectionEvents, NodeToolbar, type NodeToolbarProps, type NodeTypes, NodeWrapper, type OnBeforeDelete, type OnBeforeEdgeConnect, type OnBeforeReconnect, type OnDelete, type OnEdgeConnect, type OnEdgeCreate, type OnSelectionChange, OutputNode, Pane, type PaneEvents, Panel, ResizeControl, Selection, type ShortcutModifier, type ShortcutModifierDefinition, SmoothStepEdge, SmoothStepEdgeInternal, type SmoothStepEdgeProps, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, ViewportPortal, Zoom, createEdgeStore, createNodeStore, useColorMode, useConnection, useEdges, useHandleEdgeSelect, useInternalNode, useNodeConnections, useNodes, useNodesData, useNodesInitialized, useSolidFlow, useUpdateNodeInternals, useViewport, useViewportInitialized };
1692
+ //#endregion
1693
+ export { type Align, type AriaLabelConfig, Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, type BezierPathOptions, type Box, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, type ColorMode, type ColorModeClass, type Connection, ConnectionData, ConnectionLine, type ConnectionLineComponentProps, ConnectionLineType, ConnectionMode, ControlButton, type ControlLinePosition, type ControlPosition, Controls, type CoordinateExtent, type DefaultEdgeOptions, DefaultNode, DeleteEvents, type Dimensions, type Edge, EdgeConnection, EdgeEvents, EdgeLabel, EdgeLabelRenderer, type EdgeMarker, type EdgeMarkerType, type EdgeProps, EdgeReconnectAnchor, EdgeReconnectEvents, EdgeRenderer, EdgeToolbar, EdgeToolbarProps, type EdgeTypes, EdgeWrapper, type FitBounds, type FitBoundsOptions, FitViewOptions, type GetBezierPathParams, type GetSmoothStepPathParams, type GetStraightPathParams, GroupNode, Handle, type HandleConnection, InputNode, type InternalNode, IsValidConnection, KeyDefinition, KeyDefinitionObject, KeyModifier, Marker, MarkerDefinition, MarkerType, MiniMap, type Node, type NodeConnection, NodeEvents, NodeGraph, type NodeOrigin, type NodeProps, NodeRenderer, NodeResizer, NodeSelection, NodeSelectionEvents, NodeToolbar, NodeToolbarProps, type NodeTypes, NodeWrapper, OnBeforeDelete, OnBeforeEdgeConnect, OnBeforeReconnect, type OnConnect, type OnConnectEnd, type OnConnectStart, type OnConnectStartParams, OnDelete, OnEdgeConnect, OnEdgeCreate, type OnError, type OnMove, type OnMoveEnd, type OnMoveStart, type OnReconnect, type OnReconnectEnd, type OnReconnectStart, type OnResize, type OnResizeEnd, type OnResizeStart, OnSelectionChange, OnSelectionDrag, OutputNode, PanOnScrollMode, Pane, PaneEvents, Panel, type PanelPosition, Position$1 as Position, type ProOptions, type Rect, ResizeControl, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Selection, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, type SetViewport, ShortcutModifier, ShortcutModifierDefinition, type ShouldResize, SmoothStepEdge, SmoothStepEdgeInternal, type SmoothStepEdgeProps, type SmoothStepPathOptions, type SnapGrid, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, type Transform, Viewport, type ViewportHelperFunctionOptions, ViewportPortal, type XYPosition, type XYZPosition, Zoom, addEdge, createEdgeStore, createNodeStore, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, useColorMode, useConnection, useEdges, useHandleEdgeSelect, useInternalNode, useNodeConnections, useNodes, useNodesData, useNodesInitialized, useSolidFlow, useUpdateNodeInternals, useViewport, useViewportInitialized };