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

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,6 +1,9 @@
1
1
  import { JSX } from "@solidjs/web";
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, Position as Position$1, 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";
2
3
  import { Accessor, ParentComponent, ParentProps, Store, StoreSetter } from "solid-js";
3
- import { Align, Align as Align$1, AriaLabelConfig, AriaLabelConfig as AriaLabelConfig$1, BezierPathOptions, BezierPathOptions as BezierPathOptions$1, Box, ColorMode, ColorMode as ColorMode$1, ColorModeClass, ColorModeClass as ColorModeClass$1, Connection, Connection as Connection$1, ConnectionLineType, ConnectionLineType as ConnectionLineType$1, ConnectionMode, ConnectionMode as ConnectionMode$1, ConnectionState, ControlLinePosition, ControlPosition, ControlPosition as ControlPosition$1, CoordinateExtent, CoordinateExtent as CoordinateExtent$1, DefaultEdgeOptionsBase, Dimensions, EdgeBase, EdgeMarker, EdgeMarkerType, EdgePosition, EdgeToolbarBaseProps, FinalConnectionState, FitBounds, FitBoundsOptions, FitBoundsOptions as FitBoundsOptions$1, FitViewOptionsBase, GetBezierPathParams, GetSmoothStepPathParams, GetStraightPathParams, Handle as Handle$1, HandleConnection, HandleConnection as HandleConnection$1, HandleProps, HandleType, InternalNodeBase, IsValidConnection, MarkerProps, MarkerType, NodeBase, NodeConnection, NodeConnection as NodeConnection$1, NodeOrigin, NodeOrigin as NodeOrigin$1, NodeProps as NodeProps$1, OnBeforeDeleteBase, OnConnect, OnConnectEnd, OnConnectEnd as OnConnectEnd$1, OnConnectStart, OnConnectStart as OnConnectStart$1, OnConnectStartParams, OnError, OnError as OnError$1, OnMove, OnMove as OnMove$1, OnMoveEnd, OnMoveEnd as OnMoveEnd$1, OnMoveStart, OnMoveStart as OnMoveStart$1, OnReconnect, OnReconnect as OnReconnect$1, OnReconnectEnd, OnReconnectEnd as OnReconnectEnd$1, OnReconnectStart, OnReconnectStart as OnReconnectStart$1, OnResize, OnResize as OnResize$1, OnResizeEnd, OnResizeEnd as OnResizeEnd$1, OnResizeStart, OnResizeStart as OnResizeStart$1, OnSelectionDrag, PanOnScrollMode, PanOnScrollMode as PanOnScrollMode$1, PanelPosition, PanelPosition as PanelPosition$1, Position as Position$1, Position as Position$2, ProOptions, ProOptions as ProOptions$1, Rect, Rect as Rect$1, ResizeControlVariant, ResizeControlVariant as ResizeControlVariant$1, ResizeDragEvent, ResizeParams, ResizeParamsWithDirection, SelectionMode, SelectionMode as SelectionMode$1, SelectionRect, SetCenter, SetCenterOptions, SetCenterOptions as SetCenterOptions$1, SetViewport, ShouldResize, ShouldResize as ShouldResize$1, SmoothStepPathOptions, SmoothStepPathOptions as SmoothStepPathOptions$1, SnapGrid, SnapGrid as SnapGrid$1, StepPathOptions, Transform, UpdateNodeInternals, Viewport, Viewport as Viewport$1, ViewportHelperFunctionOptions, ViewportHelperFunctionOptions as ViewportHelperFunctionOptions$1, XYPosition, XYPosition as XYPosition$1, XYZPosition, ZIndexMode, ZoomInOut, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds } from "@xyflow/system";
4
+ //#region src/types/custom.d.ts
5
+ type UnknownStruct = Record<string, unknown>;
6
+ //#endregion
4
7
  //#region src/types/node.d.ts
5
8
  /**
6
9
  * The node data structure that gets used for internal nodes.
@@ -50,9 +53,6 @@ type BuiltInNodeTypes = {
50
53
  group: (props: NodeProps<Record<string, never>, "group">) => JSX.Element;
51
54
  };
52
55
  //#endregion
53
- //#region src/types/custom.d.ts
54
- type UnknownStruct = Record<string, unknown>;
55
- //#endregion
56
56
  //#region src/types/edge.d.ts
57
57
  /**
58
58
  * An `Edge` is the complete description with everything Svelte Flow needs to know in order to
@@ -142,6 +142,13 @@ type EdgeTypes = { [K in string]: {
142
142
  bivarianceHack(props: EdgeProps<Record<string, unknown>, string | undefined>): JSX.Element;
143
143
  }["bivarianceHack"]; };
144
144
  type DefaultEdgeOptions = DefaultEdgeOptionsBase<Edge>;
145
+ type EdgeLayouted<EdgeType extends Edge = Edge> = EdgeType & EdgePosition & {
146
+ sourceNode?: Node;
147
+ targetNode?: Node;
148
+ sourceHandleId?: string | null;
149
+ targetHandleId?: string | null;
150
+ edge: EdgeType;
151
+ };
145
152
  //#endregion
146
153
  //#region src/types/events.d.ts
147
154
  type NodeEventWithPointer<T = PointerEvent, NodeType extends Node = Node> = ({ node, event }: {
@@ -237,9 +244,31 @@ type EdgeReconnectEvents<EdgeType extends Edge = Edge> = {
237
244
  type OnSelectionDrag$1<NodeType extends Node = Node> = (event: MouseEvent, nodes: NodeType[]) => void;
238
245
  //#endregion
239
246
  //#region src/types/general.d.ts
240
- type Position$3 = `${Position$2}`;
247
+ type Position$2 = `${Position$1}`;
241
248
  type ConnectionMode$2 = `${ConnectionMode$1}`;
242
- type ConnectionLineType$3 = `${ConnectionLineType$1}`;
249
+ type ConnectionLineType$2 = `${ConnectionLineType$1}`;
250
+ /**
251
+ * If you want to render a custom component for connection lines, you can set the
252
+ * `connectionLineComponent` prop on the [`<SolidFlow />`](/api-reference/react-flow#connection-connectionLineComponent)
253
+ * component. The `ConnectionLineComponentProps` are passed to your custom component.
254
+ *
255
+ * @public
256
+ */
257
+ type ConnectionLineComponentProps<NodeType extends Node = Node> = {
258
+ readonly connectionLineStyle?: JSX.CSSProperties;
259
+ readonly connectionLineType: ConnectionLineType$2;
260
+ readonly fromNode: InternalNode<NodeType>;
261
+ readonly fromHandle: Handle$1;
262
+ readonly fromX: number;
263
+ readonly fromY: number;
264
+ readonly toX: number;
265
+ readonly toY: number;
266
+ readonly fromPosition: Position$2;
267
+ readonly toPosition: Position$2;
268
+ readonly connectionStatus: "valid" | "invalid" | null;
269
+ readonly toNode: InternalNode<NodeType> | null;
270
+ readonly toHandle: Handle$1 | null;
271
+ };
243
272
  type SelectionMode$2 = `${SelectionMode$1}`;
244
273
  type PanOnScrollMode$2 = `${PanOnScrollMode$1}`;
245
274
  type ResizeControlVariant$2 = `${ResizeControlVariant$1}`;
@@ -282,6 +311,15 @@ type NodeGraph<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
282
311
  };
283
312
  type OnEdgeCreate<EdgeType extends Edge = Edge> = (connection: Connection$1) => EdgeType | Connection$1;
284
313
  //#endregion
314
+ //#region src/components/connection/ConnectionLine.d.ts
315
+ type ConnectionLineProps<NodeType extends Node = Node> = {
316
+ readonly style: JSX.CSSProperties;
317
+ readonly type: ConnectionLineType$2;
318
+ readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
319
+ readonly containerStyle: string | JSX.CSSProperties;
320
+ };
321
+ declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
322
+ //#endregion
285
323
  //#region src/components/container/EdgeRenderer.d.ts
286
324
  type EdgeRendererProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
287
325
  readonly defaultEdgeOptions?: DefaultEdgeOptions;
@@ -341,50 +379,16 @@ type ZoomProps = {
341
379
  };
342
380
  declare const Zoom: (props: ParentProps<ZoomProps>) => JSX.Element;
343
381
  //#endregion
344
- //#region src/components/graph/connection/types.d.ts
345
- type ConnectionLineType$2 = `${ConnectionLineType$1}`;
346
- /**
347
- * If you want to render a custom component for connection lines, you can set the
348
- * `connectionLineComponent` prop on the [`<SolidFlow />`](/api-reference/react-flow#connection-connectionLineComponent)
349
- * component. The `ConnectionLineComponentProps` are passed to your custom component.
350
- *
351
- * @public
352
- */
353
- type ConnectionLineComponentProps<NodeType extends Node = Node> = {
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;
367
- };
368
- //#endregion
369
- //#region src/components/graph/connection/ConnectionLine.d.ts
370
- type ConnectionLineProps<NodeType extends Node = Node> = {
371
- readonly style: JSX.CSSProperties;
372
- readonly type: ConnectionLineType$2;
373
- readonly component: (props: ConnectionLineComponentProps<NodeType>) => JSX.Element;
374
- readonly containerStyle: string | JSX.CSSProperties;
375
- };
376
- declare const ConnectionLine: <NodeType extends Node = Node>(props: ParentProps<Partial<ConnectionLineProps<NodeType>>>) => JSX.Element;
377
- //#endregion
378
- //#region src/components/graph/edge/BaseEdge.d.ts
382
+ //#region src/components/edge/BaseEdge.d.ts
379
383
  declare const BaseEdge: (props: ParentProps<BaseEdgeProps>) => JSX.Element;
380
384
  //#endregion
381
- //#region src/components/graph/edge/BezierEdge.d.ts
385
+ //#region src/components/edge/BezierEdge.d.ts
382
386
  declare const BezierEdge: (props: BezierEdgeProps) => JSX.Element;
383
387
  //#endregion
384
- //#region src/components/graph/edge/BezierEdgeInternal.d.ts
388
+ //#region src/components/edge/BezierEdgeInternal.d.ts
385
389
  declare const BezierEdgeInternal: (props: BezierEdgeProps) => JSX.Element;
386
390
  //#endregion
387
- //#region src/components/graph/edge/EdgeLabel.d.ts
391
+ //#region src/components/edge/EdgeLabel.d.ts
388
392
  type EdgeLabelProps = {
389
393
  readonly x?: number;
390
394
  readonly y?: number;
@@ -396,10 +400,10 @@ type EdgeLabelProps = {
396
400
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
397
401
  declare const EdgeLabel: (props: ParentProps<EdgeLabelProps>) => JSX.Element;
398
402
  //#endregion
399
- //#region src/components/graph/edge/EdgeLabelRenderer.d.ts
403
+ //#region src/components/edge/EdgeLabelRenderer.d.ts
400
404
  declare const EdgeLabelRenderer: (props: ParentProps) => JSX.Element;
401
405
  //#endregion
402
- //#region src/components/graph/edge/EdgeReconnectAnchor.d.ts
406
+ //#region src/components/edge/EdgeReconnectAnchor.d.ts
403
407
  type EdgeReconnectAnchorProps = {
404
408
  readonly type: HandleType;
405
409
  readonly class?: string;
@@ -410,33 +414,33 @@ type EdgeReconnectAnchorProps = {
410
414
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
411
415
  declare const EdgeReconnectAnchor: (props: ParentProps<EdgeReconnectAnchorProps>) => JSX.Element;
412
416
  //#endregion
413
- //#region src/components/graph/edge/EdgeWrapper.d.ts
417
+ //#region src/components/edge/EdgeWrapper.d.ts
414
418
  type EdgeWrapperProps<EdgeType extends Edge = Edge> = EdgeEvents<EdgeType> & {
415
419
  readonly edgeId: string;
416
420
  };
417
421
  declare const EdgeWrapper: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: EdgeWrapperProps<EdgeType>) => JSX.Element;
418
422
  //#endregion
419
- //#region src/components/graph/edge/SmoothStepEdge.d.ts
423
+ //#region src/components/edge/SmoothStepEdge.d.ts
420
424
  declare const SmoothStepEdge: (props: SmoothStepEdgeProps) => JSX.Element;
421
425
  //#endregion
422
- //#region src/components/graph/edge/SmoothStepEdgeInternal.d.ts
426
+ //#region src/components/edge/SmoothStepEdgeInternal.d.ts
423
427
  declare const SmoothStepEdgeInternal: (props: SmoothStepEdgeProps) => JSX.Element;
424
428
  //#endregion
425
- //#region src/components/graph/edge/StepEdge.d.ts
429
+ //#region src/components/edge/StepEdge.d.ts
426
430
  declare const StepEdge: (props: StepEdgeProps) => JSX.Element;
427
431
  //#endregion
428
- //#region src/components/graph/edge/StepEdgeInternal.d.ts
432
+ //#region src/components/edge/StepEdgeInternal.d.ts
429
433
  declare const StepEdgeInternal: (props: StepEdgeProps) => JSX.Element;
430
434
  //#endregion
431
- //#region src/components/graph/edge/StraightEdge.d.ts
435
+ //#region src/components/edge/StraightEdge.d.ts
432
436
  declare const StraightEdge: (props: StraightEdgeProps) => JSX.Element;
433
437
  //#endregion
434
- //#region src/components/graph/edge/StraightEdgeInternal.d.ts
438
+ //#region src/components/edge/StraightEdgeInternal.d.ts
435
439
  declare const StraightEdgeInternal: (props: Omit<StraightEdgeProps, "sourcePosition" | "targetPosition">) => JSX.Element;
436
440
  //#endregion
437
- //#region src/components/graph/handle/Handle.d.ts
441
+ //#region src/components/handle/Handle.d.ts
438
442
  type HandleProps$1 = Omit<HandleProps, "position"> & {
439
- readonly position: Position$3;
443
+ readonly position: Position$2;
440
444
  readonly class?: string;
441
445
  readonly style?: JSX.CSSProperties;
442
446
  readonly onConnect?: (connections: Connection$1[]) => void;
@@ -444,30 +448,30 @@ type HandleProps$1 = Omit<HandleProps, "position"> & {
444
448
  } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
445
449
  declare const Handle: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<HandleProps$1>) => JSX.Element;
446
450
  //#endregion
447
- //#region src/components/graph/marker/Marker.d.ts
451
+ //#region src/components/marker/Marker.d.ts
448
452
  type MarkerProps$1 = MarkerProps & {
449
453
  readonly markerUnits?: "strokeWidth" | "userSpaceOnUse";
450
454
  readonly strokeWidth?: number;
451
455
  };
452
456
  declare const Marker: (props: MarkerProps$1) => JSX.Element;
453
457
  //#endregion
454
- //#region src/components/graph/marker/MarkerDefinition.d.ts
458
+ //#region src/components/marker/MarkerDefinition.d.ts
455
459
  declare const MarkerDefinition: () => JSX.Element;
456
460
  //#endregion
457
- //#region src/components/graph/node/DefaultNode.d.ts
461
+ //#region src/components/node/DefaultNode.d.ts
458
462
  declare const DefaultNode: (props: NodeProps<{
459
463
  label: string;
460
464
  }, "default">) => JSX.Element;
461
465
  //#endregion
462
- //#region src/components/graph/node/GroupNode.d.ts
466
+ //#region src/components/node/GroupNode.d.ts
463
467
  declare const GroupNode: (props: NodeProps<Record<string, never>>) => JSX.Element;
464
468
  //#endregion
465
- //#region src/components/graph/node/InputNode.d.ts
469
+ //#region src/components/node/InputNode.d.ts
466
470
  declare const InputNode: (props: NodeProps<{
467
471
  label: string;
468
472
  }>) => JSX.Element;
469
473
  //#endregion
470
- //#region src/components/graph/node/NodeWrapper.d.ts
474
+ //#region src/components/node/NodeWrapper.d.ts
471
475
  type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
472
476
  readonly nodeId: string;
473
477
  readonly resizeObserver: ResizeObserver | undefined;
@@ -475,249 +479,54 @@ type NodeWrapperProps<NodeType extends Node = Node> = NodeEvents<NodeType> & {
475
479
  };
476
480
  declare const NodeWrapper: <NodeType extends Node = Node>(props: NodeWrapperProps<NodeType>) => JSX.Element;
477
481
  //#endregion
478
- //#region src/components/graph/node/OutputNode.d.ts
482
+ //#region src/components/node/OutputNode.d.ts
479
483
  declare const OutputNode: (props: NodeProps<{
480
484
  label: string;
481
485
  }>) => JSX.Element;
482
486
  //#endregion
483
- //#region src/components/graph/plugins/background/types.d.ts
484
- type BackgroundVariant = "lines" | "dots" | "cross";
487
+ //#region src/components/selection/NodeSelection.d.ts
488
+ type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
489
+ declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
485
490
  //#endregion
486
- //#region src/components/graph/plugins/background/Background.d.ts
487
- type BackgroundProps = {
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;
491
+ //#region src/components/selection/Selection.d.ts
492
+ type SelectionProps = {
493
+ readonly x?: number;
494
+ readonly y?: number;
495
+ readonly width?: number | string;
496
+ readonly height?: number | string;
497
+ readonly isVisible?: boolean;
509
498
  };
510
- declare const Background: (props: BackgroundProps) => JSX.Element;
499
+ declare const Selection: (props: SelectionProps) => JSX.Element;
511
500
  //#endregion
512
- //#region src/components/graph/plugins/controls/ControlButton.d.ts
513
- type ControlButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
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>;
501
+ //#region src/core/flowProps.d.ts
502
+ type SolidFlowInitialProps = {
503
+ readonly initialNodes: Node[];
504
+ readonly initialEdges: Edge[];
505
+ readonly initialWidth: number;
506
+ readonly initialHeight: number;
507
+ readonly fitView: boolean;
508
+ readonly nodeOrigin: NodeOrigin$1;
521
509
  };
522
- declare const ControlButton: (props: ParentProps<ControlButtonProps>) => JSX.Element;
523
- //#endregion
524
- //#region src/components/graph/plugins/controls/Controls.d.ts
525
- type ControlsOrientation = "horizontal" | "vertical";
526
- type ControlsProps = {
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;
548
- } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
549
- declare const Controls: (props: ParentProps<ControlsProps>) => JSX.Element;
550
- //#endregion
551
- //#region src/components/graph/plugins/EdgeToolbar.d.ts
552
- type EdgeToolbarProps = EdgeToolbarBaseProps & {
553
- /** If `true`, clicking the toolbar selects the edge it belongs to. */
554
- readonly selectEdgeOnClick?: boolean;
555
- } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
556
- /**
557
- * The `<EdgeToolbar />` component renders a toolbar or tooltip for an edge.
558
- * It must be used inside a custom edge component. By default it is only
559
- * visible when the edge is selected; pass `isVisible` to control it manually.
560
- *
561
- * The toolbar does not scale with the viewport so that its content is always legible.
562
- */
563
- declare const EdgeToolbar: (props: ParentProps<EdgeToolbarProps>) => JSX.Element;
564
- //#endregion
565
- //#region src/components/graph/plugins/minimap/MiniMap.d.ts
566
- type GetMiniMapNodeAttribute<NodeType extends Node> = (node: NodeType) => string;
567
- type MiniMapProps<NodeType extends Node> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
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
510
+ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
511
+ /**
512
+ * The id of the flow. This is necessary if you want to render multiple flows.
589
513
  */
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 */
514
+ readonly id?: string;
515
+ /** Sets a fixed width for the flow */
596
516
  readonly width?: number;
597
- /** Height of minimap */
517
+ /** Sets a fixed height for the flow */
598
518
  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;
605
- };
606
- declare const MiniMap: <NodeType extends Node>(props: ParentProps<Partial<MiniMapProps<NodeType>>>) => JSX.Element;
607
- //#endregion
608
- //#region src/components/graph/plugins/nodeResizer/NodeResizer.d.ts
609
- type NodeResizerProps = {
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;
644
- } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
645
- declare const NodeResizer: (props: Partial<NodeResizerProps>) => JSX.Element;
646
- //#endregion
647
- //#region src/components/graph/plugins/nodeResizer/ResizeControl.d.ts
648
- type NodeResizerSubProps = Pick<NodeResizerProps, "nodeId" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "autoScale" | "keepAspectRatio" | "shouldResize" | "onResizeStart" | "onResize" | "onResizeEnd">;
649
- type ResizeControlProps = NodeResizerSubProps & {
650
- /** Position of control
651
- * @example ControlPosition.TopLeft, ControlPosition.TopRight,
652
- * ControlPosition.BottomLeft, ControlPosition.BottomRight
653
- */
654
- readonly position?: ControlPosition$1;
655
- /** Variant of control
656
- * @example ResizeControlVariant.Handle, ResizeControlVariant.Line
657
- */
658
- readonly variant?: ResizeControlVariant$2;
659
- readonly color?: string;
660
- readonly style?: JSX.CSSProperties;
661
- } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
662
- declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
663
- //#endregion
664
- //#region src/components/graph/plugins/NodeToolbar.d.ts
665
- type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
666
- /** The id of the node, or array of ids the toolbar should be displayed at */
667
- readonly nodeId: string | string[];
668
- /** Position of the toolbar relative to the node
669
- * @example Position.TopLeft, Position.TopRight,
670
- * Position.BottomLeft, Position.BottomRight
671
- */
672
- readonly position: Position$3;
673
- /** Align the toolbar relative to the node
674
- * @example Align.Start, Align.Center, Align.End
675
- */
676
- readonly align: Align$1;
677
- /** Offset the toolbar from the node */
678
- readonly offset: number;
679
- /** If true, node toolbar is visible even if node is not selected */
680
- readonly isVisible: boolean;
681
- /** Style of the toolbar */
682
- readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
683
- };
684
- declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
685
- //#endregion
686
- //#region src/components/graph/selection/NodeSelection.d.ts
687
- type NodeSelectionProps<NodeType extends Node = Node> = NodeSelectionEvents<NodeType> & Pick<NodeEvents<NodeType>, "onNodeDrag" | "onNodeDragStart" | "onNodeDragStop">;
688
- declare const NodeSelection: <NodeType extends Node = Node>(props: NodeSelectionProps<NodeType>) => JSX.Element;
689
- //#endregion
690
- //#region src/components/graph/selection/Selection.d.ts
691
- type SelectionProps = {
692
- readonly x?: number;
693
- readonly y?: number;
694
- readonly width?: number | string;
695
- readonly height?: number | string;
696
- readonly isVisible?: boolean;
697
- };
698
- declare const Selection: (props: SelectionProps) => JSX.Element;
699
- //#endregion
700
- //#region src/components/SolidFlow/types.d.ts
701
- type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> = NodeEvents<NodeType> & NodeSelectionEvents<NodeType> & EdgeEvents<EdgeType> & DeleteEvents<NodeType, EdgeType> & PaneEvents & {
702
- /**
703
- * The id of the flow. This is necessary if you want to render multiple flows.
704
- */
705
- readonly id?: string;
706
- /** Sets a fixed width for the flow */
707
- readonly width?: number;
708
- /** Sets a fixed height for the flow */
709
- readonly height?: number;
710
- /**
711
- * An store of nodes to render in a flow.
712
- * @example
713
- * const [nodes] = createStore([
714
- * {
715
- * id: 'node-1',
716
- * type: 'input',
717
- * data: { label: 'Node 1' },
718
- * position: { x: 250, y: 50 }
719
- * }
720
- * ]);
519
+ /**
520
+ * An store of nodes to render in a flow.
521
+ * @example
522
+ * const [nodes] = createStore([
523
+ * {
524
+ * id: 'node-1',
525
+ * type: 'input',
526
+ * data: { label: 'Node 1' },
527
+ * position: { x: 250, y: 50 }
528
+ * }
529
+ * ]);
721
530
  */
722
531
  readonly nodes?: Store<NodeType[]>;
723
532
  /**
@@ -974,9 +783,13 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
974
783
  */
975
784
  readonly selectionOnDrag?: boolean;
976
785
  /**
977
- * You can enable this optimization to instruct Solid Flow to only render nodes and edges that would be visible in the viewport.
978
- * This might improve performance when you have a large number of nodes and edges but also adds an overhead.
979
- * @default false
786
+ * Viewport culling: elements outside the (overscanned) viewport are hidden
787
+ * with CSS (`visibility: hidden` + `pointer-events: none`). Everything
788
+ * stays mounted — custom nodes keep their DOM state off-screen, and
789
+ * measurement/fitView/minimap are unaffected. Selected elements are never
790
+ * culled. Set to `false` to keep every element visible; note that culled
791
+ * elements leave the accessibility tree and tab order while off-screen.
792
+ * @default true
980
793
  */
981
794
  readonly onlyRenderVisibleElements?: boolean;
982
795
  /**
@@ -1016,7 +829,7 @@ type SolidFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>
1016
829
  * @example 'straight' | 'default' | 'step' | 'smoothstep' | 'bezier'
1017
830
  * @example ConnectionLineType.Straight | ConnectionLineType.Default | ConnectionLineType.Step | ConnectionLineType.SmoothStep | ConnectionLineType.Bezier
1018
831
  */
1019
- readonly connectionLineType?: ConnectionLineType$3;
832
+ readonly connectionLineType?: ConnectionLineType$2;
1020
833
  /** Enabling this option will raise the z-index of nodes when they are selected.
1021
834
  * @default true
1022
835
  */
@@ -1154,7 +967,7 @@ declare const SolidFlow: <NodeType extends Node = Node, EdgeType extends Edge =
1154
967
  //#region src/components/SolidFlow/provider.d.ts
1155
968
  declare const SolidFlowProvider: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(props: ParentProps<SolidFlowProps<NodeType, EdgeType>>) => JSX.Element;
1156
969
  //#endregion
1157
- //#region src/data/createEdgeStore.d.ts
970
+ //#region src/core/createEdgeStore.d.ts
1158
971
  type ExtractEdgeInfo<T> = T extends ((props: EdgeProps<infer TData, infer TType>) => unknown) ? {
1159
972
  data: TData;
1160
973
  type: TType;
@@ -1239,7 +1052,159 @@ type EdgesInput<TUserEdgeTypes extends EdgeTypes> = { [K in keyof AllEdgeTypes<T
1239
1052
  */
1240
1053
  declare const createEdgeStore: <TUserEdgeTypes extends EdgeTypes = Record<string, never>>(edges: EdgesInput<TUserEdgeTypes>[]) => readonly [Store<EdgesInput<TUserEdgeTypes>[]>, StoreSetter<EdgesInput<TUserEdgeTypes>[]>];
1241
1054
  //#endregion
1242
- //#region src/data/createNodeStore.d.ts
1055
+ //#region src/core/projections/connections.d.ts
1056
+ /**
1057
+ * Lookup keys for the connection index. Each edge is registered under six
1058
+ * keys — for both of its endpoints: the node, the node+handle-type, and (when
1059
+ * a handle id is present) the node+type+handle:
1060
+ * `${nodeId}` · `${nodeId}-${type}` · `${nodeId}-${type}-${handleId}`
1061
+ */
1062
+ declare const connectionKey: (nodeId: string, type?: HandleType, handleId?: string | null) => string;
1063
+ type ConnectionsRecord = Record<string, Record<string, HandleConnection$1>>;
1064
+ //#endregion
1065
+ //#region src/core/flowState.d.ts
1066
+ /**
1067
+ * The current selection, as one object: the pair travels together everywhere
1068
+ * it is consumed (selection change callbacks, deletion, toolbars).
1069
+ */
1070
+ type FlowSelection<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
1071
+ readonly nodes: readonly NodeType[];
1072
+ readonly edges: readonly EdgeType[];
1073
+ };
1074
+ /**
1075
+ * The flow's data graph as one reactive struct — the canonical read surface.
1076
+ *
1077
+ * Every property read in a tracked scope is a live subscription; the struct
1078
+ * itself is a stable identity for the provider's lifetime, so destructuring
1079
+ * `const { flow } = useSolidFlow()` is safe (reactivity lives inside the
1080
+ * property reads, not in the container). Reads in event handlers are
1081
+ * untracked, so `flow.viewport.zoom` inside a handler is already the
1082
+ * "imperative getter" — no extra API needed.
1083
+ *
1084
+ * Keyed lookups are id-keyed records (`flow.internalNodes[id]`) rather than
1085
+ * Maps: reactive property reads, per-key granularity, and the shape the
1086
+ * underlying projections produce natively.
1087
+ */
1088
+ type FlowState<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
1089
+ /** The user node graph. */
1090
+ readonly nodes: readonly NodeType[];
1091
+ /** The user edge graph. */
1092
+ readonly edges: readonly EdgeType[];
1093
+ /** Adopted nodes keyed by id: absolute positions, z order, measured dimensions, handle bounds. */
1094
+ readonly internalNodes: Record<string, InternalNode<NodeType>>;
1095
+ /** Screen-space edge geometry keyed by edge id; edges with missing/unmeasured endpoints have no entry. */
1096
+ readonly layoutedEdges: Record<string, EdgeLayouted<EdgeType>>;
1097
+ /**
1098
+ * The connection index. Keys are built with {@link connectionKey}:
1099
+ * `nodeId`, `nodeId-type`, and `nodeId-type-handleId`; each value maps a
1100
+ * connection pair key to its {@link HandleConnection}.
1101
+ */
1102
+ readonly connections: ConnectionsRecord;
1103
+ /** The currently selected nodes and edges. */
1104
+ readonly selection: FlowSelection<NodeType, EdgeType>;
1105
+ /** True once every non-hidden node has been measured. */
1106
+ readonly nodesInitialized: boolean;
1107
+ /** True once the pan/zoom instance exists. */
1108
+ readonly viewportInitialized: boolean;
1109
+ readonly viewport: Viewport$1;
1110
+ /** The flow container's measured width in px. */
1111
+ readonly width: number;
1112
+ /** The flow container's measured height in px. */
1113
+ readonly height: number;
1114
+ /** The resolved color mode ("system" resolves to the user's preference). */
1115
+ readonly colorMode: ColorModeClass$1;
1116
+ /** The in-progress connection gesture state. */
1117
+ readonly connection: ConnectionState<InternalNode<NodeType>>;
1118
+ /** True while a node drag is in progress. */
1119
+ readonly dragging: boolean;
1120
+ readonly minZoom: number;
1121
+ readonly maxZoom: number;
1122
+ readonly nodesDraggable: boolean;
1123
+ readonly nodesConnectable: boolean;
1124
+ readonly elementsSelectable: boolean;
1125
+ readonly snapGrid: SnapGrid$1 | undefined;
1126
+ };
1127
+ /**
1128
+ * The flow's write surface: every public mutation, viewport motion, and
1129
+ * geometry helper. Commands are stable identities — destructuring
1130
+ * `const { commands } = useSolidFlow()` is safe.
1131
+ */
1132
+ type FlowCommands<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
1133
+ /** Fits the view to the graph (or to `options.nodes`). */
1134
+ readonly fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
1135
+ /** Fits the view to the given bounds. */
1136
+ readonly fitBounds: (bounds: Rect$1, options?: FitBoundsOptions$1) => Promise<boolean>;
1137
+ /** Zooms in by 1.2. */
1138
+ readonly zoomIn: ZoomInOut;
1139
+ /** Zooms out by 1 / 1.2. */
1140
+ readonly zoomOut: ZoomInOut;
1141
+ /** Sets the zoom level. */
1142
+ readonly setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1143
+ /** Centers the view on the given flow position. */
1144
+ readonly setCenter: (x: number, y: number, options?: SetCenterOptions$1) => Promise<boolean>;
1145
+ /** Sets the viewport. */
1146
+ readonly setViewport: (viewport: Viewport$1, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1147
+ /** Pans the viewport by the given delta. */
1148
+ readonly panBy: (delta: XYPosition$1) => Promise<boolean>;
1149
+ /** Converts a screen/client position to a flow position. */
1150
+ readonly screenToFlowPosition: (clientPosition: XYPosition$1, options?: {
1151
+ snapToGrid: boolean;
1152
+ }) => XYPosition$1;
1153
+ /** Converts a flow position to a screen/client position. */
1154
+ readonly flowToScreenPosition: (flowPosition: XYPosition$1) => XYPosition$1;
1155
+ /** Appends one or many nodes. */
1156
+ readonly addNodes: (payload: NodeType[] | NodeType) => void;
1157
+ /** Appends one or many edges. */
1158
+ readonly addEdges: (payload: EdgeType[] | EdgeType) => void;
1159
+ /** Writes the nodes root (canonical Solid store setter — mutate the draft or return a new array). */
1160
+ readonly setNodes: StoreSetter<NodeType[]>;
1161
+ /** Writes the edges root (canonical Solid store setter — mutate the draft or return a new array). */
1162
+ readonly setEdges: StoreSetter<EdgeType[]>;
1163
+ /** Merges (or replaces, with `options.replace`) a node by id. */
1164
+ readonly updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
1165
+ replace: boolean;
1166
+ }) => void;
1167
+ /** Merges (or replaces, with `options.replace`) a node's `data` by id. */
1168
+ readonly updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
1169
+ replace: boolean;
1170
+ }) => void;
1171
+ /** Merges (or replaces, with `options.replace`) an edge by id. */
1172
+ readonly updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
1173
+ replace: boolean;
1174
+ }) => void;
1175
+ /** Deletes the given nodes/edges plus connected edges, honoring `onBeforeDelete`. */
1176
+ readonly deleteElements: (params: {
1177
+ nodes?: (Partial<NodeType> & {
1178
+ id: string;
1179
+ })[];
1180
+ edges?: (Partial<EdgeType> & {
1181
+ id: string;
1182
+ })[];
1183
+ }) => Promise<{
1184
+ deletedNodes: NodeType[];
1185
+ deletedEdges: EdgeType[];
1186
+ }>;
1187
+ /** All nodes intersecting the given node or rect. */
1188
+ readonly getIntersectingNodes: (nodeOrRect: NodeType | {
1189
+ id: NodeType["id"];
1190
+ } | Rect$1, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
1191
+ /** Whether the given node or rect intersects the area. */
1192
+ readonly isNodeIntersecting: (nodeOrRect: NodeType | {
1193
+ id: NodeType["id"];
1194
+ } | Rect$1, area: Rect$1, partially?: boolean) => boolean;
1195
+ /** The bounding rect of the given nodes (or node ids). */
1196
+ readonly getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect$1;
1197
+ /** Requests a DOM re-measure of the given node id(s). */
1198
+ readonly updateNodeInternals: (id: string | string[]) => void;
1199
+ /** The nodes, edges, and viewport as a plain JSON-safe object. */
1200
+ readonly toObject: () => {
1201
+ nodes: NodeType[];
1202
+ edges: EdgeType[];
1203
+ viewport: Viewport$1;
1204
+ };
1205
+ };
1206
+ //#endregion
1207
+ //#region src/core/createNodeStore.d.ts
1243
1208
  type ExtractNodeInfo<T> = T extends ((props: NodeProps<infer TData, infer TType>) => unknown) ? {
1244
1209
  data: TData;
1245
1210
  type: TType;
@@ -1429,265 +1394,265 @@ declare function useNodesData<NodeType extends Node = Node>(nodeIds: Accessor<st
1429
1394
  //#endregion
1430
1395
  //#region src/hooks/useSolidFlow.d.ts
1431
1396
  /**
1432
- * Hook for accessing the SvelteFlow instance.
1397
+ * The canonical flow API: the reactive {@link FlowState} struct plus the
1398
+ * {@link FlowCommands} write surface. Every command is also spread onto the
1399
+ * returned object directly for upstream (React Flow / Svelte Flow)
1400
+ * familiarity — `useSolidFlow().fitView()` and
1401
+ * `useSolidFlow().commands.fitView()` are the same function.
1433
1402
  *
1434
- * @public
1435
- * @returns A set of helper functions
1403
+ * The imperative getters are deprecated: event handlers are untracked scopes
1404
+ * in Solid, so reading `flow.viewport.zoom` (or `flow.internalNodes[id]`)
1405
+ * inside one already IS the imperative read — no wrapper needed — while the
1406
+ * same read in a tracked scope subscribes.
1436
1407
  */
1437
- declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): {
1438
- /**
1439
- * Zooms viewport in by 1.2.
1440
- *
1441
- * @param options.duration - optional duration. If set, a transition will be applied
1442
- */
1443
- zoomIn: ZoomInOut;
1444
- /**
1445
- * Zooms viewport out by 1 / 1.2.
1446
- *
1447
- * @param options.duration - optional duration. If set, a transition will be applied
1448
- */
1449
- zoomOut: ZoomInOut;
1450
- /**
1451
- * Returns an internal node by id.
1452
- *
1453
- * @param id - the node id
1454
- * @returns the node or undefined if no node was found
1455
- */
1456
- getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
1457
- /**
1458
- * Returns a node by id.
1459
- *
1460
- * @param id - the node id
1461
- * @returns the node or undefined if no node was found
1462
- */
1463
- getNode: (id: string) => NodeType | undefined;
1464
- /**
1465
- * Returns nodes.
1466
- *
1467
- * @returns nodes array
1468
- */
1469
- getNodes: (ids?: string[]) => NodeType[];
1470
- /**
1471
- * Returns an edge by id.
1472
- *
1473
- * @param id - the edge id
1474
- * @returns the edge or undefined if no edge was found
1475
- */
1476
- getEdge: (id: string) => EdgeType | undefined;
1477
- /**
1478
- * Returns edges.
1479
- *
1480
- * @returns edges array
1481
- */
1482
- getEdges: (ids?: string[]) => EdgeType[];
1483
- /**
1484
- * Add one or many nodes to your existing nodes array.
1485
- *
1486
- * @param payload - the nodes to add
1487
- */
1488
- addNodes: (payload: NodeType[] | NodeType) => void;
1489
- /**
1490
- * Add one or many edges to your existing edges array.
1491
- *
1492
- * @param payload - the edges to add
1493
- */
1494
- addEdges: (payload: EdgeType[] | EdgeType) => void;
1495
- /**
1496
- * Sets the current zoom level.
1497
- *
1498
- * @param zoomLevel - the zoom level to set
1499
- * @param options.duration - optional duration. If set, a transition will be applied
1500
- */
1501
- setZoom: (zoomLevel: number, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1502
- /**
1503
- * Returns the current zoom level.
1504
- *
1505
- * @returns current zoom as a number
1506
- */
1507
- getZoom: () => number;
1508
- /**
1509
- * Sets the center of the view to the given position.
1510
- *
1511
- * @param x - x position
1512
- * @param y - y position
1513
- * @param options.zoom - optional zoom
1514
- */
1515
- setCenter: (x: number, y: number, options?: SetCenterOptions$1) => Promise<boolean>;
1516
- /**
1517
- * Sets the current viewport.
1518
- *
1519
- * @param viewport - the viewport to set
1520
- * @param options.duration - optional duration. If set, a transition will be applied
1521
- */
1522
- setViewport: (viewport: Viewport$1, options?: ViewportHelperFunctionOptions$1) => Promise<boolean>;
1523
- /**
1524
- * Returns the current viewport.
1525
- *
1526
- * @returns Viewport
1527
- */
1528
- getViewport: () => Viewport$1;
1529
- /**
1530
- * Fits the view.
1531
- *
1532
- * @param options.padding - optional padding
1533
- * @param options.includeHiddenNodes - optional includeHiddenNodes
1534
- * @param options.minZoom - optional minZoom
1535
- * @param options.maxZoom - optional maxZoom
1536
- * @param options.duration - optional duration. If set, a transition will be applied
1537
- * @param options.nodes - optional nodes to fit the view to
1538
- */
1539
- fitView: (options?: FitViewOptions<NodeType>) => Promise<boolean>;
1540
- /**
1541
- * Returns all nodes that intersect with the given node or rect.
1542
- *
1543
- * @param node - the node or rect to check for intersections
1544
- * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect
1545
- * @param nodes - optional nodes array to check for intersections
1546
- *
1547
- * @returns an array of intersecting nodes
1548
- */
1549
- getIntersectingNodes: (nodeOrRect: NodeType | {
1550
- id: NodeType["id"];
1551
- } | Rect$1, partially?: boolean, nodesToIntersect?: NodeType[]) => NodeType[];
1552
- /**
1553
- * Checks if the given node or rect intersects with the passed rect.
1554
- *
1555
- * @param node - the node or rect to check for intersections
1556
- * @param area - the rect to check for intersections
1557
- * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react
1558
- *
1559
- * @returns true if the node or rect intersects with the given area
1560
- */
1561
- isNodeIntersecting: (nodeOrRect: NodeType | {
1562
- id: NodeType["id"];
1563
- } | Rect$1, area: Rect$1, partially?: boolean) => boolean;
1564
- /**
1565
- * Fits the view to the given bounds .
1566
- *
1567
- * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
1568
- * @param options.padding - optional padding
1569
- */
1570
- fitBounds: (bounds: Rect$1, options?: FitBoundsOptions$1) => Promise<boolean>;
1571
- /**
1572
- * Deletes nodes and edges.
1573
- *
1574
- * @param params.nodes - optional nodes array to delete
1575
- * @param params.edges - optional edges array to delete
1576
- *
1577
- * @returns a promise that resolves with the deleted nodes and edges
1578
- */
1579
- deleteElements: ({ nodes, edges }: {
1580
- nodes?: (Partial<NodeType> & {
1581
- id: string;
1582
- })[];
1583
- edges?: (Partial<EdgeType> & {
1584
- id: string;
1585
- })[];
1586
- }) => Promise<{
1587
- deletedNodes: NodeType[];
1588
- deletedEdges: EdgeType[];
1589
- }>;
1590
- /**
1591
- * Converts a screen / client position to a flow position.
1592
- *
1593
- * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1594
- * @param options.snapToGrid - if true, the converted position will be snapped to the grid
1595
- * @returns position as { x: number, y: number }
1596
- *
1597
- * @example
1598
- * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY })
1599
- */
1600
- screenToFlowPosition: (clientPosition: XYPosition$1, options?: {
1601
- snapToGrid: boolean;
1602
- }) => XYPosition$1;
1603
- /**
1604
- * Converts a flow position to a screen / client position.
1605
- *
1606
- * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY
1607
- * @returns position as { x: number, y: number }
1608
- *
1609
- * @example
1610
- * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y })
1611
- */
1612
- flowToScreenPosition: (flowPosition: XYPosition$1) => XYPosition$1;
1613
- /**
1614
- * Updates a node.
1615
- *
1616
- * @param id - id of the node to update
1617
- * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update
1618
- * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged
1619
- *
1620
- * @example
1621
- * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1622
- */
1623
- updateNode: (id: string, nodeUpdate: Partial<NodeType> | ((node: NodeType) => Partial<NodeType>), options?: {
1624
- replace: boolean;
1625
- }) => void;
1626
- /**
1627
- * Updates the data attribute of a node.
1628
- *
1629
- * @param id - id of the node to update
1630
- * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update
1631
- * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged
1632
- *
1633
- * @example
1634
- * updateNodeData('node-1', { label: 'A new label' });
1635
- */
1636
- updateNodeData: (id: string, dataUpdate: Partial<NodeType["data"]> | ((node: NodeType) => Partial<NodeType["data"]>), options?: {
1637
- replace: boolean;
1638
- }) => void;
1639
- /**
1640
- * Returns the nodes, edges and the viewport as a JSON object.
1641
- *
1642
- * @returns the nodes, edges and the viewport as a JSON object
1643
- */
1644
- /**
1645
- * Updates an edge.
1646
- *
1647
- * @param id - id of the edge to update
1648
- * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update
1649
- * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged
1650
- *
1651
- * @example
1652
- * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
1653
- */
1654
- updateEdge: (id: string, edgeUpdate: Partial<EdgeType> | ((edge: EdgeType) => Partial<EdgeType>), options?: {
1655
- replace: boolean;
1656
- }) => void;
1657
- toObject: () => {
1658
- nodes: NodeType[];
1659
- edges: EdgeType[];
1660
- viewport: Viewport$1;
1661
- };
1662
- /**
1663
- * Returns the bounds of the given nodes or node ids.
1664
- *
1665
- * @param nodes - the nodes or node ids to calculate the bounds for
1666
- *
1667
- * @returns the bounds of the given nodes
1668
- */
1669
- getNodesBounds: (nodes: (NodeType | InternalNode<NodeType> | string)[]) => Rect$1;
1670
- /** Gets all connections for a given handle belonging to a specific node.
1671
- *
1672
- * @param type - handle type 'source' or 'target'
1673
- * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle)
1674
- * @param nodeId - the node id the handle belongs to
1675
- * @returns an array with handle connections
1676
- */
1677
- getHandleConnections: ({ type, id, nodeId }: {
1408
+ type UseSolidFlowReturn<NodeType extends Node = Node, EdgeType extends Edge = Edge> = FlowCommands<NodeType, EdgeType> & {
1409
+ /** The flow's data graph as one reactive struct — the canonical read surface. */
1410
+ readonly flow: FlowState<NodeType, EdgeType>;
1411
+ /** The flow's write surface (same functions as the spread members). */
1412
+ readonly commands: FlowCommands<NodeType, EdgeType>;
1413
+ /** @deprecated Read `flow.internalNodes[id]` instead. */
1414
+ readonly getInternalNode: (id: string) => InternalNode<NodeType> | undefined;
1415
+ /** @deprecated Read `flow.internalNodes[id]?.internals.userNode` (or find in `flow.nodes`) instead. */
1416
+ readonly getNode: (id: string) => NodeType | undefined;
1417
+ /** @deprecated Read `flow.nodes` (or map ids over `flow.internalNodes`) instead. */
1418
+ readonly getNodes: (ids?: string[]) => NodeType[];
1419
+ /** @deprecated Read `flow.edges` (or find by id) instead. */
1420
+ readonly getEdge: (id: string) => EdgeType | undefined;
1421
+ /** @deprecated Read `flow.edges` (or filter by ids) instead. */
1422
+ readonly getEdges: (ids?: string[]) => EdgeType[];
1423
+ /** @deprecated Read `flow.viewport` instead. */
1424
+ readonly getViewport: () => Viewport$1;
1425
+ /** @deprecated Read `flow.viewport.zoom` instead. */
1426
+ readonly getZoom: () => number;
1427
+ /** @deprecated Read `flow.connections[connectionKey(nodeId, type, id)]` (or use `useNodeConnections`) instead. */
1428
+ readonly getHandleConnections: (params: {
1678
1429
  type: HandleType;
1679
1430
  nodeId: string;
1680
1431
  id?: string | null;
1681
1432
  }) => HandleConnection$1[];
1682
1433
  };
1434
+ /**
1435
+ * Hook for accessing the flow instance: `{ flow, commands }` plus the
1436
+ * commands spread at the top level for upstream familiarity.
1437
+ *
1438
+ * `flow` and `commands` are stable identities, so destructuring them is safe:
1439
+ * `const { flow, commands } = useSolidFlow()`.
1440
+ *
1441
+ * @public
1442
+ * @returns the flow's read struct, write surface, and deprecated aliases
1443
+ */
1444
+ declare function useSolidFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): UseSolidFlowReturn<NodeType, EdgeType>;
1683
1445
  //#endregion
1684
1446
  //#region src/hooks/useUpdateNodeInternals.d.ts
1685
1447
  /**
1686
- * Hook for updating node internals.
1448
+ * Hook for updating node internals. Sugar for `commands.updateNodeInternals`.
1687
1449
  *
1688
1450
  * @public
1689
1451
  * @returns function for updating node internals
1690
1452
  */
1691
1453
  declare function useUpdateNodeInternals(): UpdateNodeInternals;
1692
1454
  //#endregion
1693
- export { type Align, type AriaLabelConfig, Background, type BackgroundProps, type BackgroundVariant, BaseEdge, BezierEdge, BezierEdgeInternal, type BezierEdgeProps, type BezierPathOptions, type Box, type BuiltInEdge, type BuiltInNode, type BuiltInNodeTypes, type ColorMode, type ColorModeClass, type Connection, ConnectionData, ConnectionLine, type ConnectionLineComponentProps, ConnectionLineType, ConnectionMode, ControlButton, type ControlLinePosition, type ControlPosition, Controls, type CoordinateExtent, type DefaultEdgeOptions, DefaultNode, DeleteEvents, type Dimensions, type Edge, EdgeConnection, EdgeEvents, EdgeLabel, EdgeLabelRenderer, type EdgeMarker, type EdgeMarkerType, type EdgeProps, EdgeReconnectAnchor, EdgeReconnectEvents, EdgeRenderer, EdgeToolbar, EdgeToolbarProps, type EdgeTypes, EdgeWrapper, type FitBounds, type FitBoundsOptions, FitViewOptions, type GetBezierPathParams, type GetSmoothStepPathParams, type GetStraightPathParams, GroupNode, Handle, type HandleConnection, InputNode, type InternalNode, IsValidConnection, KeyDefinition, KeyDefinitionObject, KeyModifier, Marker, MarkerDefinition, MarkerType, MiniMap, type Node, type NodeConnection, NodeEvents, NodeGraph, type NodeOrigin, type NodeProps, NodeRenderer, NodeResizer, NodeSelection, NodeSelectionEvents, NodeToolbar, NodeToolbarProps, type NodeTypes, NodeWrapper, OnBeforeDelete, OnBeforeEdgeConnect, OnBeforeReconnect, type OnConnect, type OnConnectEnd, type OnConnectStart, type OnConnectStartParams, OnDelete, OnEdgeConnect, OnEdgeCreate, type OnError, type OnMove, type OnMoveEnd, type OnMoveStart, type OnReconnect, type OnReconnectEnd, type OnReconnectStart, type OnResize, type OnResizeEnd, type OnResizeStart, OnSelectionChange, OnSelectionDrag, OutputNode, PanOnScrollMode, Pane, PaneEvents, Panel, type PanelPosition, Position$1 as Position, type ProOptions, type Rect, ResizeControl, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Selection, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, type SetViewport, ShortcutModifier, ShortcutModifierDefinition, type ShouldResize, SmoothStepEdge, SmoothStepEdgeInternal, type SmoothStepEdgeProps, type SmoothStepPathOptions, type SnapGrid, SolidFlow, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, type Transform, Viewport, type ViewportHelperFunctionOptions, ViewportPortal, type XYPosition, type XYZPosition, Zoom, addEdge, createEdgeStore, createNodeStore, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, useColorMode, useConnection, useEdges, useHandleEdgeSelect, useInternalNode, useNodeConnections, useNodes, useNodesData, useNodesInitialized, useSolidFlow, useUpdateNodeInternals, useViewport, useViewportInitialized };
1455
+ //#region src/plugins/background/types.d.ts
1456
+ type BackgroundVariant = "lines" | "dots" | "cross";
1457
+ //#endregion
1458
+ //#region src/plugins/background/Background.d.ts
1459
+ type BackgroundProps = {
1460
+ readonly id?: string;
1461
+ /** Variant of the pattern
1462
+ * @example 'lines', 'dots', 'cross'
1463
+ */
1464
+ readonly variant?: BackgroundVariant;
1465
+ /** Color of the background */
1466
+ readonly bgColor?: string;
1467
+ /** Color of the pattern */
1468
+ readonly patternColor?: string;
1469
+ /** Class applied to the pattern */
1470
+ readonly patternClass?: string;
1471
+ /** Class applied to the container */
1472
+ readonly class?: string;
1473
+ /** Gap between repetitions of the pattern */
1474
+ readonly gap?: number | [number, number];
1475
+ /** Size of a single pattern element */
1476
+ readonly size?: number;
1477
+ /** Line width of the Line pattern */
1478
+ readonly lineWidth?: number;
1479
+ /** Style applied to the container */
1480
+ readonly style?: JSX.CSSProperties;
1481
+ };
1482
+ declare const Background: (props: BackgroundProps) => JSX.Element;
1483
+ //#endregion
1484
+ //#region src/plugins/controls/ControlButton.d.ts
1485
+ type ControlButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
1486
+ readonly class?: string;
1487
+ readonly bgColor?: string;
1488
+ readonly bgColorHover?: string;
1489
+ readonly color?: string;
1490
+ readonly colorHover?: string;
1491
+ readonly borderColor?: string;
1492
+ readonly onClick?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
1493
+ };
1494
+ declare const ControlButton: (props: ParentProps<ControlButtonProps>) => JSX.Element;
1495
+ //#endregion
1496
+ //#region src/plugins/controls/Controls.d.ts
1497
+ type ControlsOrientation = "horizontal" | "vertical";
1498
+ type ControlsProps = {
1499
+ /** Position of the controls on the pane
1500
+ * @example PanelPosition.TopLeft, PanelPosition.TopRight,
1501
+ * PanelPosition.BottomLeft, PanelPosition.BottomRight
1502
+ */
1503
+ readonly position?: PanelPosition$1;
1504
+ /** Show button for zoom in/out */
1505
+ readonly showZoom?: boolean;
1506
+ /** Show button for fit view */
1507
+ readonly showFitView?: boolean;
1508
+ /** Show button for toggling interactivity */
1509
+ readonly showLock?: boolean;
1510
+ readonly buttonBgColor?: string;
1511
+ readonly buttonBgColorHover?: string;
1512
+ readonly buttonColor?: string;
1513
+ readonly buttonColorHover?: string;
1514
+ readonly buttonBorderColor?: string;
1515
+ readonly style?: JSX.CSSProperties;
1516
+ readonly orientation?: ControlsOrientation;
1517
+ readonly fitViewOptions?: FitViewOptions;
1518
+ readonly beforeControls?: JSX.Element;
1519
+ readonly afterControls?: JSX.Element;
1520
+ } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
1521
+ declare const Controls: (props: ParentProps<ControlsProps>) => JSX.Element;
1522
+ //#endregion
1523
+ //#region src/plugins/minimap/MiniMap.d.ts
1524
+ type GetMiniMapNodeAttribute<NodeType extends Node> = (node: NodeType) => string;
1525
+ type MiniMapProps<NodeType extends Node> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
1526
+ /** Background color of minimap */
1527
+ readonly bgColor?: string;
1528
+ /** Color of nodes on the minimap */
1529
+ readonly nodeColor?: string | GetMiniMapNodeAttribute<NodeType>;
1530
+ /** Stroke color of nodes on the minimap */
1531
+ readonly nodeStrokeColor?: string | GetMiniMapNodeAttribute<NodeType>;
1532
+ /** Class applied to nodes on the minimap */
1533
+ readonly nodeClass?: string | GetMiniMapNodeAttribute<NodeType>;
1534
+ /** Border radius of nodes on the minimap */
1535
+ readonly nodeBorderRadius?: number;
1536
+ /** Stroke width of nodes on the minimap */
1537
+ readonly nodeStrokeWidth?: number;
1538
+ /** Color of the mask representing viewport */
1539
+ readonly maskColor?: string;
1540
+ /** Stroke color of the mask representing viewport */
1541
+ readonly maskStrokeColor?: string;
1542
+ /** Stroke width of the mask representing viewport */
1543
+ readonly maskStrokeWidth?: number;
1544
+ /** Position of the minimap on the pane
1545
+ * @example PanelPosition.TopLeft, PanelPosition.TopRight,
1546
+ * PanelPosition.BottomLeft, PanelPosition.BottomRight
1547
+ */
1548
+ readonly position?: PanelPosition$1;
1549
+ /** Style applied to container */
1550
+ readonly style?: JSX.CSSProperties;
1551
+ /** The aria-label applied to container */
1552
+ readonly ariaLabel?: string | null;
1553
+ /** Width of minimap */
1554
+ readonly width?: number;
1555
+ /** Height of minimap */
1556
+ readonly height?: number;
1557
+ readonly pannable?: boolean;
1558
+ readonly zoomable?: boolean;
1559
+ /** Invert the direction when panning the minimap viewport */
1560
+ readonly inversePan?: boolean;
1561
+ /** Step size for zooming in/out */
1562
+ readonly zoomStep?: number;
1563
+ };
1564
+ declare const MiniMap: <NodeType extends Node>(props: ParentProps<Partial<MiniMapProps<NodeType>>>) => JSX.Element;
1565
+ //#endregion
1566
+ //#region src/plugins/nodeResizer/NodeResizer.d.ts
1567
+ type NodeResizerProps = {
1568
+ /** Id of the node it is resizing
1569
+ * @remarks optional if used inside custom node
1570
+ */
1571
+ readonly nodeId?: string;
1572
+ /** Class applied to handle */
1573
+ readonly handleClass?: string;
1574
+ /** Style applied to handle */
1575
+ readonly handleStyle?: JSX.CSSProperties;
1576
+ /** Class applied to line */
1577
+ readonly lineClass?: string;
1578
+ /** Style applied to line */
1579
+ readonly lineStyle?: JSX.CSSProperties;
1580
+ /** Are the controls visible */
1581
+ readonly visible?: boolean;
1582
+ /** Minimum width of node */
1583
+ readonly minWidth?: number;
1584
+ /** Minimum height of node */
1585
+ readonly minHeight?: number;
1586
+ /** Maximum width of node */
1587
+ readonly maxWidth?: number;
1588
+ /** Maximum height of node */
1589
+ readonly maxHeight?: number;
1590
+ /** Keep aspect ratio when resizing */
1591
+ readonly keepAspectRatio?: boolean;
1592
+ /** Automatically scale the node when resizing */
1593
+ readonly autoScale?: boolean;
1594
+ /** Callback to determine if node should resize */
1595
+ readonly shouldResize?: ShouldResize$1;
1596
+ /** Callback called when resizing starts */
1597
+ readonly onResizeStart?: OnResizeStart$1;
1598
+ /** Callback called when resizing */
1599
+ readonly onResize?: OnResize$1;
1600
+ /** Callback called when resizing ends */
1601
+ readonly onResizeEnd?: OnResizeEnd$1;
1602
+ } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
1603
+ declare const NodeResizer: (props: Partial<NodeResizerProps>) => JSX.Element;
1604
+ //#endregion
1605
+ //#region src/plugins/nodeResizer/ResizeControl.d.ts
1606
+ type NodeResizerSubProps = Pick<NodeResizerProps, "nodeId" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "autoScale" | "keepAspectRatio" | "shouldResize" | "onResizeStart" | "onResize" | "onResizeEnd">;
1607
+ type ResizeControlProps = NodeResizerSubProps & {
1608
+ /** Position of control
1609
+ * @example ControlPosition.TopLeft, ControlPosition.TopRight,
1610
+ * ControlPosition.BottomLeft, ControlPosition.BottomRight
1611
+ */
1612
+ readonly position?: ControlPosition$1;
1613
+ /** Variant of control
1614
+ * @example ResizeControlVariant.Handle, ResizeControlVariant.Line
1615
+ */
1616
+ readonly variant?: ResizeControlVariant$2;
1617
+ readonly color?: string;
1618
+ readonly style?: JSX.CSSProperties;
1619
+ } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "onResize" | "style">;
1620
+ declare const ResizeControl: <NodeType extends Node = Node>(props: ParentProps<ResizeControlProps>) => JSX.Element;
1621
+ //#endregion
1622
+ //#region src/plugins/toolbar/EdgeToolbar.d.ts
1623
+ type EdgeToolbarProps = EdgeToolbarBaseProps & {
1624
+ /** If `true`, clicking the toolbar selects the edge it belongs to. */
1625
+ readonly selectEdgeOnClick?: boolean;
1626
+ } & Omit<JSX.HTMLAttributes<HTMLDivElement>, "style">;
1627
+ /**
1628
+ * The `<EdgeToolbar />` component renders a toolbar or tooltip for an edge.
1629
+ * It must be used inside a custom edge component. By default it is only
1630
+ * visible when the edge is selected; pass `isVisible` to control it manually.
1631
+ *
1632
+ * The toolbar does not scale with the viewport so that its content is always legible.
1633
+ */
1634
+ declare const EdgeToolbar: (props: ParentProps<EdgeToolbarProps>) => JSX.Element;
1635
+ //#endregion
1636
+ //#region src/plugins/toolbar/NodeToolbar.d.ts
1637
+ type NodeToolbarProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "style"> & {
1638
+ /** The id of the node, or array of ids the toolbar should be displayed at */
1639
+ readonly nodeId: string | string[];
1640
+ /** Position of the toolbar relative to the node
1641
+ * @example Position.TopLeft, Position.TopRight,
1642
+ * Position.BottomLeft, Position.BottomRight
1643
+ */
1644
+ readonly position: Position$2;
1645
+ /** Align the toolbar relative to the node
1646
+ * @example Align.Start, Align.Center, Align.End
1647
+ */
1648
+ readonly align: Align$1;
1649
+ /** Offset the toolbar from the node */
1650
+ readonly offset: number;
1651
+ /** If true, node toolbar is visible even if node is not selected */
1652
+ readonly isVisible: boolean;
1653
+ /** Style of the toolbar */
1654
+ readonly style: Omit<JSX.CSSProperties, "z-index" | "position" | "transform">;
1655
+ };
1656
+ declare const NodeToolbar: ParentComponent<Partial<NodeToolbarProps>>;
1657
+ //#endregion
1658
+ 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, ConnectionLineComponentProps, ConnectionLineType, ConnectionMode, type ConnectionsRecord, 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 FlowCommands, type FlowSelection, type FlowState, 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, 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, type SolidFlowInitialProps, type SolidFlowProps, SolidFlowProvider, StepEdge, StepEdgeInternal, type StepEdgeProps, StraightEdge, StraightEdgeInternal, type StraightEdgeProps, type Transform, UseSolidFlowReturn, Viewport, type ViewportHelperFunctionOptions, ViewportPortal, type XYPosition, type XYZPosition, Zoom, addEdge, connectionKey, 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 };