@dschz/solid-flow 0.2.2 → 0.2.4

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 { Accessor, JSX, ParentComponent, ParentProps } from "solid-js";
2
+ 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";
3
+ import { SetStoreFunction, Store } from "solid-js/store";
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,605 @@ 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 style?: JSX.CSSProperties;
624
660
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
625
661
  declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
626
-
662
+ //#endregion
663
+ //#region src/components/graph/plugins/NodeToolbar.d.ts
627
664
  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">;
665
+ /** The id of the node, or array of ids the toolbar should be displayed at */
666
+ readonly nodeId: string | string[];
667
+ /** Position of the toolbar relative to the node
668
+ * @example Position.TopLeft, Position.TopRight,
669
+ * Position.BottomLeft, Position.BottomRight
670
+ */
671
+ readonly position: Position$3;
672
+ /** Align the toolbar relative to the node
673
+ * @example Align.Start, Align.Center, Align.End
674
+ */
675
+ readonly align: Align$1;
676
+ /** Offset the toolbar from the node */
677
+ readonly offset: number;
678
+ /** If true, node toolbar is visible even if node is not selected */
679
+ readonly isVisible: boolean;
680
+ /** Style of the toolbar */
681
+ readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
645
682
  };
646
683
  declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
647
-
684
+ //#endregion
685
+ //#region src/components/graph/selection/NodeSelection.d.ts
648
686
  type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
649
687
  declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
650
-
688
+ //#endregion
689
+ //#region src/components/graph/selection/Selection.d.ts
651
690
  type SelectionProps = {
652
- readonly x?: number;
653
- readonly y?: number;
654
- readonly width?: number | string;
655
- readonly height?: number | string;
656
- readonly isVisible?: boolean;
691
+ readonly x?: number;
692
+ readonly y?: number;
693
+ readonly width?: number | string;
694
+ readonly height?: number | string;
695
+ readonly isVisible?: boolean;
657
696
  };
658
697
  declare const Selection: (props: SelectionProps) => JSX.Element;
659
-
698
+ //#endregion
699
+ //#region src/components/SolidFlow/types.d.ts
660
700
  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>;
701
+ /**
702
+ * The id of the flow. This is necessary if you want to render multiple flows.
703
+ */
704
+ readonly id?: string;
705
+ /** Sets a fixed width for the flow */
706
+ readonly width?: number;
707
+ /** Sets a fixed height for the flow */
708
+ readonly height?: number;
709
+ /**
710
+ * An store of nodes to render in a flow.
711
+ * @example
712
+ * const [nodes] = createStore([
713
+ * {
714
+ * id: 'node-1',
715
+ * type: 'input',
716
+ * data: { label: 'Node 1' },
717
+ * position: { x: 250, y: 50 }
718
+ * }
719
+ * ]);
720
+ */
721
+ readonly nodes?: Store<NodeType[]>;
722
+ /**
723
+ * An store of edges to render in a flow.
724
+ * @example
725
+ * const [edges] = createStore([
726
+ * {
727
+ * id: 'edge-1-2',
728
+ * source: 'node-1',
729
+ * target: 'node-2',
730
+ * }
731
+ * ]);
732
+ */
733
+ readonly edges?: Store<EdgeType[]>;
734
+ /**
735
+ * Custom node types to be available in a flow.
736
+ * Solid Flow matches a node's type to a component in the nodeTypes object.
737
+ * @example
738
+ * import CustomNode from './CustomNode';
739
+ *
740
+ * const nodeTypes = { nameOfNodeType: CustomNode };
741
+ */
742
+ readonly nodeTypes?: NodeTypes;
743
+ /**
744
+ * Custom edge types to be available in a flow.
745
+ * Solid Flow matches an edge's type to a component in the edgeTypes object.
746
+ * @example
747
+ * import CustomEdge from './CustomEdge';
748
+ *
749
+ * const edgeTypes = { nameOfEdgeType: CustomEdge };
750
+ */
751
+ readonly edgeTypes?: EdgeTypes;
752
+ /** Pressing down this key you can select multiple elements with a selection box.
753
+ * @default 'Shift'
754
+ */
755
+ readonly selectionKey?: KeyDefinition | KeyDefinition[] | null;
756
+ /** If a key is set, you can pan the viewport while that key is held down even if panOnScroll is set to false.
757
+ *
758
+ * By setting this prop to null you can disable this functionality.
759
+ * @default 'Space'
760
+ */
761
+ readonly panActivationKey?: KeyDefinition | KeyDefinition[] | null;
762
+ /** Pressing down this key deletes all selected nodes & edges.
763
+ * @default 'Backspace'
764
+ */
765
+ readonly deleteKey?: KeyDefinition | KeyDefinition[] | null;
766
+ /** Pressing down this key you can select multiple elements by clicking.
767
+ * @default 'Meta' for macOS, "Ctrl" for other systems
768
+ */
769
+ readonly multiSelectionKey?: KeyDefinition | KeyDefinition[] | null;
770
+ /** If a key is set, you can zoom the viewport while that key is held down even if panOnScroll is set to false.
771
+ *
772
+ * By setting this prop to null you can disable this functionality.
773
+ * @default 'Meta' for macOS, "Ctrl" for other systems
774
+ * */
775
+ readonly zoomActivationKey?: KeyDefinition | KeyDefinition[] | null;
776
+ /** If set, initial viewport will show all nodes & edges */
777
+ readonly fitView?: boolean;
778
+ /**
779
+ * Options to be used in combination with fitView
780
+ * @example
781
+ * const fitViewOptions = {
782
+ * padding: 0.1,
783
+ * includeHiddenNodes: false,
784
+ * minZoom: 0.1,
785
+ * maxZoom: 1,
786
+ * duration: 200,
787
+ * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit
788
+ * };
789
+ */
790
+ readonly fitViewOptions?: FitViewOptions<NodeType>;
791
+ /**
792
+ * Defines nodes relative position to its coordinates
793
+ * @default [0, 0]
794
+ * @example
795
+ * [0, 0] // default, top left
796
+ * [0.5, 0.5] // center
797
+ * [1, 1] // bottom right
798
+ */
799
+ readonly nodeOrigin?: NodeOrigin$1;
800
+ /**
801
+ * With a threshold greater than zero you can control the distinction between node drag and click events.
802
+ * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired.
803
+ * @default 1
804
+ */
805
+ readonly nodeDragThreshold?: number;
806
+ /**
807
+ * Distance that the mouse can move between mousedown/up that will trigger a click
808
+ * @default 0
809
+ */
810
+ readonly paneClickDistance?: number;
811
+ /** Distance that the mouse can move between mousedown/up that will trigger a click
812
+ * @default 0
813
+ */
814
+ readonly nodeClickDistance?: number;
815
+ /**
816
+ * The threshold in pixels that the mouse must move before a connection line starts to drag.
817
+ * This is useful to prevent accidental connections when clicking on a handle.
818
+ * @default 1
819
+ */
820
+ readonly connectionDragThreshold?: number;
821
+ /** Minimum zoom level
822
+ * @default 0.5
823
+ */
824
+ readonly minZoom?: number;
825
+ /** Maximum zoom level
826
+ * @default 2
827
+ */
828
+ readonly maxZoom?: number;
829
+ /**
830
+ * Sets the initial position and zoom of the viewport.
831
+ * If a default viewport is provided but fitView is enabled, the default viewport will be ignored.
832
+ * @default { zoom: 1, position: { x: 0, y: 0 } }
833
+ * @example
834
+ * const initialViewport = {
835
+ * zoom: 0.5,
836
+ * position: { x: 0, y: 0 }
837
+ * };
838
+ */
839
+ readonly initialViewport?: Viewport$1;
840
+ /** Custom viewport to be used instead of internal one */
841
+ readonly viewport?: Store<Viewport$1>;
842
+ /**
843
+ * The radius around a handle where you drop a connection line to create a new edge.
844
+ * @default 20
845
+ */
846
+ readonly connectionRadius?: number;
847
+ /**
848
+ * 'strict' connection mode will only allow you to connect source handles to target handles.
849
+ * 'loose' connection mode will allow you to connect handles of any type to one another.
850
+ * @default 'strict'
851
+ */
852
+ readonly connectionMode?: ConnectionMode$2;
853
+ /** Provide a custom snippet to be used insted of the default connection line */
854
+ readonly connectionLineComponent?: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
855
+ /** Styles to be applied to the connection line */
856
+ readonly connectionLineStyle?: JSX.CSSProperties;
857
+ /** Styles to be applied to the container of the connection line */
858
+ readonly connectionLineContainerStyle?: JSX.CSSProperties;
859
+ /**
860
+ * When set to "partial", when the user creates a selection box by click and dragging
861
+ * nodes that are only partially in the box are still selected.
862
+ * @default 'full'
863
+ */
864
+ readonly selectionMode?: SelectionMode$2;
865
+ /**
866
+ * Controls if nodes should be automatically selected when being dragged
867
+ */
868
+ readonly selectNodesOnDrag?: boolean;
869
+ /**
870
+ * Grid all nodes will snap to
871
+ * @example [20, 20]
872
+ */
873
+ readonly snapGrid?: SnapGrid$1;
874
+ /** Color of edge markers
875
+ * You can pass `null` to use the CSS variable `--xy-edge-stroke` for the marker color.
876
+ * @example "#b1b1b7"
877
+ */
878
+ readonly defaultMarkerColor?: string | null;
879
+ /**
880
+ * Controls if all nodes should be draggable
881
+ * @default true
882
+ */
883
+ readonly nodesDraggable?: boolean;
884
+ /**
885
+ * When `true`, the viewport will pan when a node is focused.
886
+ * @default true
887
+ */
888
+ readonly autoPanOnNodeFocus?: boolean;
889
+ /**
890
+ * When `true`, the viewport will pan when a drag selection approaches the edges of the flow container.
891
+ * @default true
892
+ */
893
+ readonly autoPanOnSelection?: boolean;
894
+ /**
895
+ * Controls if all nodes should be connectable to each other
896
+ * @default true
897
+ */
898
+ readonly nodesConnectable?: boolean;
899
+ /** Controls if all elements should (nodes & edges) be selectable
900
+ * @default true
901
+ */
902
+ readonly elementsSelectable?: boolean;
903
+ /**
904
+ * When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter`
905
+ * key. This option can be overridden by individual nodes by setting their `focusable` prop.
906
+ * @default true
907
+ */
908
+ readonly nodesFocusable?: boolean;
909
+ /**
910
+ * When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter`
911
+ * key. This option can be overridden by individual edges by setting their `focusable` prop.
912
+ * @default true
913
+ */
914
+ readonly edgesFocusable?: boolean;
915
+ /**
916
+ * By default the viewport extends infinitely. You can use this prop to set a boundary.
917
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
918
+ * @default @default [[-∞, -∞], [+∞, +∞]]
919
+ * @example [[-1000, -10000], [1000, 1000]]
920
+ */
921
+ readonly translateExtent?: CoordinateExtent$1;
922
+ /**
923
+ * By default the nodes can be placed anywhere. You can use this prop to set a boundary.
924
+ * The first pair of coordinates is the top left boundary and the second pair is the bottom right.
925
+ * @default [[-∞, -∞], [+∞, +∞]]
926
+ * @example [[-1000, -10000], [1000, 1000]]
927
+ */
928
+ readonly nodeExtent?: CoordinateExtent$1;
929
+ /**
930
+ * Disabling this prop will allow the user to scroll the page even when their pointer is over the flow.
931
+ * @default true
932
+ */
933
+ readonly preventScrolling?: boolean;
934
+ /**
935
+ * Controls if the viewport should zoom by scrolling inside the container.
936
+ * @default true
937
+ */
938
+ readonly zoomOnScroll?: boolean;
939
+ /**
940
+ * Controls if the viewport should zoom by double clicking somewhere on the flow
941
+ * @default true
942
+ */
943
+ readonly zoomOnDoubleClick?: boolean;
944
+ /**
945
+ * Controls if the viewport should zoom by pinching on a touch screen
946
+ * @default true
947
+ */
948
+ readonly zoomOnPinch?: boolean;
949
+ /**
950
+ * Controls if the viewport should pan by scrolling inside the container
951
+ * Can be limited to a specific direction with panOnScrollMode
952
+ * @default false
953
+ */
954
+ readonly panOnScroll?: boolean;
955
+ /**
956
+ * This prop is used to limit the direction of panning when panOnScroll is enabled.
957
+ * The "free" option allows panning in any direction.
958
+ * @default "free"
959
+ * @example "horizontal" | "vertical"
960
+ */
961
+ readonly panOnScrollMode?: PanOnScrollMode$2;
962
+ /**
963
+ * Enableing this prop allows users to pan the viewport by clicking and dragging.
964
+ * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning.
965
+ * @default true
966
+ * @example [0, 2] // allows panning with the left and right mouse buttons
967
+ * [0, 1, 2, 3, 4] // allows panning with all mouse buttons
968
+ */
969
+ readonly panOnDrag?: boolean | number[];
970
+ /**
971
+ * Select multiple elements with a selection box, without pressing down selectionKey.
972
+ * @default false
973
+ */
974
+ readonly selectionOnDrag?: boolean;
975
+ /**
976
+ * You can enable this optimization to instruct Solid Flow to only render nodes and edges that would be visible in the viewport.
977
+ * This might improve performance when you have a large number of nodes and edges but also adds an overhead.
978
+ * @default false
979
+ */
980
+ readonly onlyRenderVisibleElements?: boolean;
981
+ /**
982
+ * You can enable this prop to automatically pan the viewport while making a new connection.
983
+ * @default true
984
+ */
985
+ readonly autoPanOnConnect?: boolean;
986
+ /**
987
+ * You can enable this prop to automatically pan the viewport while dragging a node.
988
+ * @default true
989
+ */
990
+ readonly autoPanOnNodeDrag?: boolean;
991
+ /**
992
+ * Defaults to be applied to all new edges that are added to the flow.
993
+ * Properties on a new edge will override these defaults if they exist.
994
+ * @example
995
+ * const defaultEdgeOptions = {
996
+ * type: 'customEdgeType',
997
+ * animated: true
998
+ * }
999
+ */
1000
+ readonly defaultEdgeOptions?: DefaultEdgeOptions;
1001
+ /**
1002
+ * Controls color scheme used for styling the flow
1003
+ * @default 'system'
1004
+ * @example 'system' | 'light' | 'dark'
1005
+ */
1006
+ readonly colorMode?: ColorMode$1;
1007
+ /** Fallback color mode for SSR if colorMode is set to 'system' */
1008
+ readonly colorModeSSR?: Omit<ColorMode$1, "system">;
1009
+ /** Class to be applied to the flow container */
1010
+ readonly class?: string;
1011
+ /** Styles to be applied to the flow container */
1012
+ readonly style?: JSX.CSSProperties;
1013
+ /** Choose from the built-in edge types to be used for connections
1014
+ * @default 'default' | ConnectionLineType.Bezier
1015
+ * @example 'straight' | 'default' | 'step' | 'smoothstep' | 'bezier'
1016
+ * @example ConnectionLineType.Straight | ConnectionLineType.Default | ConnectionLineType.Step | ConnectionLineType.SmoothStep | ConnectionLineType.Bezier
1017
+ */
1018
+ readonly connectionLineType?: ConnectionLineType$3;
1019
+ /** Enabling this option will raise the z-index of nodes when they are selected.
1020
+ * @default true
1021
+ */
1022
+ readonly elevateNodesOnSelect?: boolean;
1023
+ /**
1024
+ * Controls how z-indexes are calculated for nodes and edges.
1025
+ * 'auto' automatically manages z-indexing for selections and sub flows,
1026
+ * 'basic' manages z-indexing for selections only, and
1027
+ * 'manual' does not apply any automatic z-indexing.
1028
+ * @default "basic"
1029
+ */
1030
+ readonly zIndexMode?: ZIndexMode;
1031
+ /**
1032
+ * Enabling this option will raise the z-index of edges when they are selected,
1033
+ * or when the connected nodes are selected.
1034
+ * @default true
1035
+ */
1036
+ readonly elevateEdgesOnSelect?: boolean;
1037
+ /**
1038
+ * You can use this prop to disable keyboard accessibility features such as selecting nodes or
1039
+ * moving selected nodes with the arrow keys.
1040
+ * @default false
1041
+ */
1042
+ readonly disableKeyboardA11y?: boolean;
1043
+ /**
1044
+ * If a node is draggable, clicking and dragging that node will move it around the canvas. Adding
1045
+ * the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that
1046
+ * class.
1047
+ * @default "nodrag"
1048
+ */
1049
+ readonly noDragClass?: string;
1050
+ /**
1051
+ * Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
1052
+ * Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
1053
+ * allows you to change the name of that class.
1054
+ * @default "nowheel"
1055
+ */
1056
+ readonly noWheelClass?: string;
1057
+ /**
1058
+ * If an element in the canvas does not stop mouse events from propagating, clicking and dragging
1059
+ * that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this
1060
+ * prop allows you to change the name of that class.
1061
+ * @default "nopan"
1062
+ */
1063
+ readonly noPanClass?: string;
1064
+ /** Toggles ability to make connections via clicking the handles */
1065
+ readonly clickConnect?: boolean;
1066
+ /**
1067
+ * This callback can be used to validate a new connection.
1068
+ * If you return `false`, the edge will not be added to your flow.
1069
+ * If you have custom connection logic its preferred to use this callback over the
1070
+ * `isValidConnection` prop on the handle component for performance reasons.
1071
+ */
1072
+ /**
1073
+ * Set position of the attribution
1074
+ * @default 'bottom-right'
1075
+ * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
1076
+ */
1077
+ readonly attributionPosition?: PanelPosition$1;
1078
+ /**
1079
+ * By default, we render a small attribution in the corner of your flows that links back to the project.
1080
+ * You are free to remove this attribution but we ask that you take a quick look at our
1081
+ * {@link https://svelteflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide}
1082
+ * before doing so.
1083
+ */
1084
+ readonly proOptions?: ProOptions$1;
1085
+ readonly isValidConnection?: IsValidConnection$1<EdgeType>;
1086
+ /** This event handler is called when the user begins to pan or zoom the viewport */
1087
+ readonly onMoveStart?: OnMoveStart$1;
1088
+ /** This event handler is called when the user pans or zooms the viewport */
1089
+ readonly onMove?: OnMove$1;
1090
+ /** This event handler is called when the user stops panning or zooming the viewport */
1091
+ readonly onMoveEnd?: OnMoveEnd$1;
1092
+ /**
1093
+ * Ocassionally something may happen that causes Solid Flow to throw an error.
1094
+ * Instead of exploding your application, we log a message to the console and then call this event handler.
1095
+ * You might use it for additional logging or to show a message to the user.
1096
+ */
1097
+ readonly onFlowError?: OnError$1;
1098
+ /** This handler gets called when the user deletes nodes or edges.
1099
+ * @example
1100
+ * onDelete={({nodes, edges}) => {
1101
+ * console.log('deleted nodes:', nodes);
1102
+ * console.log('deleted edges:', edges);
1103
+ * }}
1104
+ */
1105
+ readonly onDelete?: OnDelete<NodeType, EdgeType>;
1106
+ /** This handler gets called before the user deletes nodes or edges and provides a way to abort the deletion by returning false. */
1107
+ readonly onBeforeDelete?: OnBeforeDelete<NodeType, EdgeType>;
1108
+ /** This handler gets called when a new edge is created. You can use it to modify the newly created edge. */
1109
+ readonly onBeforeConnect?: OnBeforeEdgeConnect<EdgeType>;
1110
+ /** This event gets fired when a connection successfully completes and an edge is created. */
1111
+ readonly onConnect?: OnEdgeConnect;
1112
+ /** When a user starts to drag a connection line, this event gets fired. */
1113
+ readonly onConnectStart?: OnConnectStart$1;
1114
+ /** When a user stops dragging a connection line, this event gets fired. */
1115
+ readonly onConnectEnd?: OnConnectEnd$1;
1116
+ /** This event gets fired when after an edge was reconnected*/
1117
+ readonly onReconnect?: OnReconnect$1<EdgeType>;
1118
+ /** This event gets fired when a user starts to reconnect an edge */
1119
+ readonly onReconnectStart?: OnReconnectStart$1<EdgeType>;
1120
+ /** This event gets fired when a user stops reconnecting an edge */
1121
+ readonly onReconnectEnd?: OnReconnectEnd$1<NodeType, EdgeType>;
1122
+ /** This handler gets called when an edge is reconnected. You can use it to modify the edge before the update is applied. */
1123
+ readonly onBeforeReconnect?: OnBeforeReconnect<EdgeType>;
1124
+ /** A connection is started by clicking on a handle */
1125
+ readonly onClickConnectStart?: OnConnectStart$1;
1126
+ /** A connection is finished by clicking on a handle */
1127
+ readonly onClickConnectEnd?: OnConnectEnd$1;
1128
+ /** This handler gets called when the flow is finished initializing */
1129
+ readonly onInit?: () => void;
1130
+ /** This event handler gets called when the selected nodes & edges change */
1131
+ readonly onSelectionChange?: OnSelectionChange<NodeType, EdgeType>;
1132
+ /** This event handler gets called when a user starts to drag a selection box. */
1133
+ readonly onSelectionDragStart?: OnSelectionDrag$1<NodeType>;
1134
+ /** This event handler gets called when a user drags a selection box. */
1135
+ readonly onSelectionDrag?: OnSelectionDrag$1<NodeType>;
1136
+ /** This event handler gets called when a user stops dragging a selection box. */
1137
+ readonly onSelectionDragStop?: OnSelectionDrag$1<NodeType>;
1138
+ /** This event handler gets called when the user starts to drag a selection box */
1139
+ readonly onSelectionStart?: (event: PointerEvent) => void;
1140
+ /** This event handler gets called when the user finishes dragging a selection box */
1141
+ readonly onSelectionEnd?: (event: PointerEvent) => void;
1142
+ /**
1143
+ * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults.
1144
+ * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings.
1145
+ */
1146
+ readonly ariaLabelConfig?: Partial<AriaLabelConfig$1>;
1107
1147
  };
1108
-
1148
+ //#endregion
1149
+ //#region src/components/SolidFlow/component.d.ts
1109
1150
  type SolidFlowComponentProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = ParentProps<SolidFlowProps<NodeType, EdgeType>> & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style" | "onselectionchange" | "onSelectionChange">;
1110
1151
  declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: SolidFlowComponentProps<NodeType, EdgeType>) => JSX.Element;
1111
-
1152
+ //#endregion
1153
+ //#region src/components/SolidFlow/provider.d.ts
1112
1154
  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;
1155
+ //#endregion
1156
+ //#region src/data/createEdgeStore.d.ts
1157
+ type ExtractEdgeInfo<T> = T extends ((props: EdgeProps<infer TData, infer TType>) => unknown) ? {
1158
+ data: TData;
1159
+ type: TType;
1117
1160
  } : never;
1118
1161
  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>];
1162
+ 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
1163
  /**
1123
1164
  * Creates a type-safe reactive store of edges for use in Solid Flow.
1124
1165
  *
@@ -1196,15 +1237,14 @@ type EdgesInput<TUserEdgeTypes extends EdgeTypes> = {
1196
1237
  * - Type errors prevent invalid type names or incorrect data structures
1197
1238
  */
1198
1239
  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
+ //#endregion
1241
+ //#region src/data/createNodeStore.d.ts
1242
+ type ExtractNodeInfo<T> = T extends ((props: NodeProps<infer TData, infer TType>) => unknown) ? {
1243
+ data: TData;
1244
+ type: TType;
1203
1245
  } : never;
1204
1246
  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>];
1247
+ 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
1248
  /**
1209
1249
  * Creates a type-safe reactive store of nodes for use in Solid Flow.
1210
1250
  *
@@ -1277,7 +1317,8 @@ type NodesInput<TUserNodeTypes extends NodeTypes> = {
1277
1317
  * - Type errors prevent invalid type names or incorrect data structures
1278
1318
  */
1279
1319
  declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string, never>>(nodes: NodesInput<TUserNodeTypes>[]) => readonly [Store<NodesInput<TUserNodeTypes>[]>, SetStoreFunction<NodesInput<TUserNodeTypes>[]>];
1280
-
1320
+ //#endregion
1321
+ //#region src/hooks/useColorMode.d.ts
1281
1322
  /**
1282
1323
  * Hook for receiving the current color mode class ('dark' or 'light').
1283
1324
  *
@@ -1287,8 +1328,9 @@ declare const createNodeStore: <TUserNodeTypes extends NodeTypes = Record<string
1287
1328
  * @public
1288
1329
  * @returns an accessor for the current color mode class
1289
1330
  */
1290
- declare function useColorMode(): () => ColorModeClass;
1291
-
1331
+ declare function useColorMode(): () => ColorModeClass$1;
1332
+ //#endregion
1333
+ //#region src/hooks/useConnection.d.ts
1292
1334
  /**
1293
1335
  * Hook for receiving the current connection.
1294
1336
  *
@@ -1296,7 +1338,8 @@ declare function useColorMode(): () => ColorModeClass;
1296
1338
  * @returns current connection as a readable store
1297
1339
  */
1298
1340
  declare function useConnection(): Accessor<ConnectionState>;
1299
-
1341
+ //#endregion
1342
+ //#region src/hooks/useGraph.d.ts
1300
1343
  /**
1301
1344
  * Hook for getting the current nodes from the store.
1302
1345
  *
@@ -1317,10 +1360,12 @@ declare function useEdges<EdgeType extends Edge = Edge>(): Accessor<EdgeType[]>;
1317
1360
  * @public
1318
1361
  * @returns store with the viewport object
1319
1362
  */
1320
- declare function useViewport(): Accessor<Viewport>;
1321
-
1363
+ declare function useViewport(): Accessor<Viewport$1>;
1364
+ //#endregion
1365
+ //#region src/hooks/useHandleEdgeSelect.d.ts
1322
1366
  declare function useHandleEdgeSelect(): (id: string) => void;
1323
-
1367
+ //#endregion
1368
+ //#region src/hooks/useInitialized.d.ts
1324
1369
  /**
1325
1370
  * Hook for seeing if all nodes have been measured.
1326
1371
  *
@@ -1340,7 +1385,8 @@ declare function useNodesInitialized(): Accessor<boolean>;
1340
1385
  * @returns an accessor that indicates whether the viewport is initialized
1341
1386
  */
1342
1387
  declare function useViewportInitialized(): Accessor<boolean>;
1343
-
1388
+ //#endregion
1389
+ //#region src/hooks/useInternalNode.d.ts
1344
1390
  /**
1345
1391
  * Hook to get an internal node by id.
1346
1392
  *
@@ -1349,11 +1395,12 @@ declare function useViewportInitialized(): Accessor<boolean>;
1349
1395
  * @returns an accessor with an internal node or undefined
1350
1396
  */
1351
1397
  declare function useInternalNode(id: Accessor<string>): Accessor<InternalNode | undefined>;
1352
-
1398
+ //#endregion
1399
+ //#region src/hooks/useNodeConnections.d.ts
1353
1400
  type UseNodeConnectionsParams = {
1354
- id?: string;
1355
- handleType?: HandleType;
1356
- handleId?: string;
1401
+ id?: string;
1402
+ handleType?: HandleType;
1403
+ handleId?: string;
1357
1404
  };
1358
1405
  /**
1359
1406
  * Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.
@@ -1366,8 +1413,9 @@ type UseNodeConnectionsParams = {
1366
1413
  * @todo @param param.onDisconnect - gets called when a connection is removed
1367
1414
  * @returns an array with connections
1368
1415
  */
1369
- declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection[]>;
1370
-
1416
+ declare const useNodeConnections: (params: Accessor<UseNodeConnectionsParams>) => Accessor<NodeConnection$1[]>;
1417
+ //#endregion
1418
+ //#region src/hooks/useNodesData.d.ts
1371
1419
  type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
1372
1420
  /**
1373
1421
  * Hook for receiving data of one or multiple nodes
@@ -1377,7 +1425,8 @@ type NodeData<NodeType extends Node> = Pick<NodeType, "id" | "data" | "type">;
1377
1425
  */
1378
1426
  declare function useNodesData<NodeType extends Node = Node>(nodeId: Accessor<string | undefined | null>): Accessor<NodeData<NodeType> | undefined>;
1379
1427
  declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<string[] | undefined | null>): Accessor<NodeData<NodeType>[]>;
1380
-
1428
+ //#endregion
1429
+ //#region src/hooks/useSolidFlow.d.ts
1381
1430
  /**
1382
1431
  * Hook for accessing the SvelteFlow instance.
1383
1432
  *
@@ -1385,252 +1434,253 @@ declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<st
1385
1434
  * @returns A set of helper functions
1386
1435
  */
1387
1436
  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[];
1437
+ /**
1438
+ * Zooms viewport in by 1.2.
1439
+ *
1440
+ * @param options.duration - optional duration. If set, a transition will be applied
1441
+ */
1442
+ zoomIn: ZoomInOut;
1443
+ /**
1444
+ * Zooms viewport out by 1 / 1.2.
1445
+ *
1446
+ * @param options.duration - optional duration. If set, a transition will be applied
1447
+ */
1448
+ zoomOut: ZoomInOut;
1449
+ /**
1450
+ * Returns an internal node by id.
1451
+ *
1452
+ * @param id - the node id
1453
+ * @returns the node or undefined if no node was found
1454
+ */
1455
+ getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
1456
+ /**
1457
+ * Returns a node by id.
1458
+ *
1459
+ * @param id - the node id
1460
+ * @returns the node or undefined if no node was found
1461
+ */
1462
+ getNode: (id: string) => NodeType | undefined;
1463
+ /**
1464
+ * Returns nodes.
1465
+ *
1466
+ * @returns nodes array
1467
+ */
1468
+ getNodes: (ids?: string[]) => NodeType[];
1469
+ /**
1470
+ * Returns an edge by id.
1471
+ *
1472
+ * @param id - the edge id
1473
+ * @returns the edge or undefined if no edge was found
1474
+ */
1475
+ getEdge: (id: string) => EdgeType | undefined;
1476
+ /**
1477
+ * Returns edges.
1478
+ *
1479
+ * @returns edges array
1480
+ */
1481
+ getEdges: (ids?: string[]) => EdgeType[];
1482
+ /**
1483
+ * Add one or many nodes to your existing nodes array.
1484
+ *
1485
+ * @param payload - the nodes to add
1486
+ */
1487
+ addNodes: (payload: NodeType[] | NodeType) => void;
1488
+ /**
1489
+ * Add one or many edges to your existing edges array.
1490
+ *
1491
+ * @param payload - the edges to add
1492
+ */
1493
+ addEdges: (payload: EdgeType[] | EdgeType) => void;
1494
+ /**
1495
+ * Sets the current zoom level.
1496
+ *
1497
+ * @param zoomLevel - the zoom level to set
1498
+ * @param options.duration - optional duration. If set, a transition will be applied
1499
+ */
1500
+ setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1501
+ /**
1502
+ * Returns the current zoom level.
1503
+ *
1504
+ * @returns current zoom as a number
1505
+ */
1506
+ getZoom: () => number;
1507
+ /**
1508
+ * Sets the center of the view to the given position.
1509
+ *
1510
+ * @param x - x position
1511
+ * @param y - y position
1512
+ * @param options.zoom - optional zoom
1513
+ */
1514
+ setCenter: (x: number, y: number, options?: SetCenterOptions$1) => Promise<boolean>;
1515
+ /**
1516
+ * Sets the current viewport.
1517
+ *
1518
+ * @param viewport - the viewport to set
1519
+ * @param options.duration - optional duration. If set, a transition will be applied
1520
+ */
1521
+ setViewport: (viewport: Viewport$1, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1522
+ /**
1523
+ * Returns the current viewport.
1524
+ *
1525
+ * @returns Viewport
1526
+ */
1527
+ getViewport: () => Viewport$1;
1528
+ /**
1529
+ * Fits the view.
1530
+ *
1531
+ * @param options.padding - optional padding
1532
+ * @param options.includeHiddenNodes - optional includeHiddenNodes
1533
+ * @param options.minZoom - optional minZoom
1534
+ * @param options.maxZoom - optional maxZoom
1535
+ * @param options.duration - optional duration. If set, a transition will be applied
1536
+ * @param options.nodes - optional nodes to fit the view to
1537
+ */
1538
+ fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
1539
+ /**
1540
+ * Returns all nodes that intersect with the given node or rect.
1541
+ *
1542
+ * @param node - the node or rect to check for intersections
1543
+ * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
1544
+ * @param nodes - optional nodes array to check for intersections
1545
+ *
1546
+ * @returns an array of intersecting nodes
1547
+ */
1548
+ getIntersectingNodes: (nodeOrRect: NodeType | {
1549
+ id: NodeType["id"];
1550
+ } | Rect$1, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
1551
+ /**
1552
+ * Checks if the given node or rect intersects with the passed rect.
1553
+ *
1554
+ * @param node - the node or rect to check for intersections
1555
+ * @param area - the rect to check for intersections
1556
+ * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
1557
+ *
1558
+ * @returns true if the node or rect intersects with the given area
1559
+ */
1560
+ isNodeIntersecting: (nodeOrRect: NodeType | {
1561
+ id: NodeType["id"];
1562
+ } | Rect$1, area: Rect$1, partially?: boolean) => boolean;
1563
+ /**
1564
+ * Fits the view to the given bounds .
1565
+ *
1566
+ * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
1567
+ * @param options.padding - optional padding
1568
+ */
1569
+ fitBounds: (bounds: Rect$1, options?: FitBoundsOptions$1) => Promise<boolean>;
1570
+ /**
1571
+ * Deletes nodes and edges.
1572
+ *
1573
+ * @param params.nodes - optional nodes array to delete
1574
+ * @param params.edges - optional edges array to delete
1575
+ *
1576
+ * @returns a promise that resolves with the deleted nodes and edges
1577
+ */
1578
+ deleteElements: ({ nodes, edges }: {
1579
+ nodes?: (Partial<NodeType> & {
1580
+ id: string;
1581
+ })[];
1582
+ edges?: (Partial<EdgeType> & {
1583
+ id: string;
1584
+ })[];
1585
+ }) => Promise<{
1586
+ deletedNodes: NodeType[];
1587
+ deletedEdges: EdgeType[];
1588
+ }>;
1589
+ /**
1590
+ * Converts a screen / client position to a flow position.
1591
+ *
1592
+ * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1593
+ * @param options.snapToGrid - if true, the converted position will be snapped to the grid
1594
+ * @returns position as { x: number, y: number }
1595
+ *
1596
+ * @example
1597
+ * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
1598
+ */
1599
+ screenToFlowPosition: (clientPosition: XYPosition$1, options?: {
1600
+ snapToGrid: boolean;
1601
+ }) => XYPosition$1;
1602
+ /**
1603
+ * Converts a flow position to a screen / client position.
1604
+ *
1605
+ * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1606
+ * @returns position as { x: number, y: number }
1607
+ *
1608
+ * @example
1609
+ * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
1610
+ */
1611
+ flowToScreenPosition: (flowPosition: XYPosition$1) => XYPosition$1;
1612
+ /**
1613
+ * Updates a node.
1614
+ *
1615
+ * @param id - id of the node to update
1616
+ * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
1617
+ * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
1618
+ *
1619
+ * @example
1620
+ * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1621
+ */
1622
+ updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
1623
+ replace: boolean;
1624
+ }) => void;
1625
+ /**
1626
+ * Updates the data attribute of a node.
1627
+ *
1628
+ * @param id - id of the node to update
1629
+ * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
1630
+ * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
1631
+ *
1632
+ * @example
1633
+ * updateNodeData('node-1', { label: 'A new label' });
1634
+ */
1635
+ updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
1636
+ replace: boolean;
1637
+ }) => void;
1638
+ /**
1639
+ * Returns the nodes, edges and the viewport as a JSON object.
1640
+ *
1641
+ * @returns the nodes, edges and the viewport as a JSON object
1642
+ */
1643
+ /**
1644
+ * Updates an edge.
1645
+ *
1646
+ * @param id - id of the edge to update
1647
+ * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update
1648
+ * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged
1649
+ *
1650
+ * @example
1651
+ * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1652
+ */
1653
+ updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
1654
+ replace: boolean;
1655
+ }) => void;
1656
+ toObject: () => {
1657
+ nodes: NodeType[];
1658
+ edges: EdgeType[];
1659
+ viewport: Viewport$1;
1660
+ };
1661
+ /**
1662
+ * Returns the bounds of the given nodes or node ids.
1663
+ *
1664
+ * @param nodes - the nodes or node ids to calculate the bounds for
1665
+ *
1666
+ * @returns the bounds of the given nodes
1667
+ */
1668
+ getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect$1;
1669
+ /** Gets all connections for a given handle belonging to a specific node.
1670
+ *
1671
+ * @param type - handle type 'source' or 'target'
1672
+ * @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)
1673
+ * @param nodeId - the node id the handle belongs to
1674
+ * @returns an array with handle connections
1675
+ */
1676
+ getHandleConnections: ({ type, id, nodeId }: {
1677
+ type: HandleType;
1678
+ nodeId: string;
1679
+ id?: string | null;
1680
+ }) => HandleConnection$1[];
1632
1681
  };
1633
-
1682
+ //#endregion
1683
+ //#region src/hooks/useUpdateNodeInternals.d.ts
1634
1684
  /**
1635
1685
  * Hook for updating node internals.
1636
1686
  *
@@ -1638,5 +1688,5 @@ declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edg
1638
1688
  * @returns function for updating node internals
1639
1689
  */
1640
1690
  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 };
1691
+ //#endregion
1692
+ 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 };