@theclearsky/react-blender-nodes 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { ClassProp } from 'class-variance-authority/types';
3
3
  import { ClassValue } from 'clsx';
4
4
  import { ComponentProps } from 'react';
5
5
  import { Connection } from '@xyflow/react';
6
+ import { Context } from 'react';
6
7
  import { ControlLinePosition } from '@xyflow/react';
7
8
  import { ControlPosition } from '@xyflow/react';
8
9
  import { Edge } from '@xyflow/react';
@@ -10,7 +11,9 @@ import { EdgeChange } from '@xyflow/react';
10
11
  import { EdgeLabelOptions } from '@xyflow/react';
11
12
  import { EdgePosition } from '@xyflow/system';
12
13
  import { EdgeProps } from '@xyflow/react';
14
+ import { FC } from 'react';
13
15
  import { ForwardRefExoticComponent } from 'react';
16
+ import { HandleShape as HandleShape_2 } from '../..';
14
17
  import { HandleType } from '@xyflow/react';
15
18
  import { HTMLAttributes } from 'react';
16
19
  import { JSX } from 'react/jsx-runtime';
@@ -23,7 +26,10 @@ import { ReactNode } from 'react';
23
26
  import { RefAttributes } from 'react';
24
27
  import { RefObject } from 'react';
25
28
  import { ResizeControlDirection } from '@xyflow/system';
29
+ import * as SelectPrimitive from '@radix-ui/react-select';
30
+ import { TypeOfNode as TypeOfNode_2 } from './types';
26
31
  import { VariantProps } from 'class-variance-authority';
32
+ import { Viewport } from '@xyflow/react';
27
33
  import { XYPosition } from '@xyflow/react';
28
34
  import { z } from 'zod';
29
35
 
@@ -40,7 +46,7 @@ export declare type Action<DataTypeUniqueId extends string = string, NodeTypeUni
40
46
  type: typeof actionTypesMap.ADD_NODE;
41
47
  payload: {
42
48
  /** Type of node to add */
43
- type: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodeIdToNodeType'][string];
49
+ type: NodeTypeUniqueId;
44
50
  /** Position where to place the node */
45
51
  position: XYPosition;
46
52
  };
@@ -49,7 +55,7 @@ export declare type Action<DataTypeUniqueId extends string = string, NodeTypeUni
49
55
  type: typeof actionTypesMap.ADD_NODE_AND_SELECT;
50
56
  payload: {
51
57
  /** Type of node to add */
52
- type: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodeIdToNodeType'][string];
58
+ type: NodeTypeUniqueId;
53
59
  /** Position where to place the node */
54
60
  position: XYPosition;
55
61
  };
@@ -58,7 +64,7 @@ export declare type Action<DataTypeUniqueId extends string = string, NodeTypeUni
58
64
  type: typeof actionTypesMap.UPDATE_NODE_BY_REACT_FLOW;
59
65
  payload: {
60
66
  /** Array of node changes from ReactFlow */
61
- changes: NodeChanges<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
67
+ changes: NodeChanges<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>;
62
68
  };
63
69
  } | {
64
70
  /** Update edges based on ReactFlow changes */
@@ -85,6 +91,29 @@ export declare type Action<DataTypeUniqueId extends string = string, NodeTypeUni
85
91
  /** New value for the input */
86
92
  value: string | number;
87
93
  };
94
+ } | {
95
+ /** Open a node group and push it onto the openedNodeGroupStack */
96
+ type: typeof actionTypesMap.OPEN_NODE_GROUP;
97
+ payload: {
98
+ /** ID of the node to open */
99
+ nodeId: string;
100
+ } | {
101
+ /** Type of node to open */
102
+ nodeType: NodeTypeUniqueId;
103
+ };
104
+ } | {
105
+ /** Close a node group and pop it from the openedNodeGroupStack */
106
+ type: typeof actionTypesMap.CLOSE_NODE_GROUP;
107
+ } | {
108
+ /** Add a new node group to the graph */
109
+ type: typeof actionTypesMap.ADD_NODE_GROUP;
110
+ } | {
111
+ /** Set the viewport of the graph */
112
+ type: typeof actionTypesMap.SET_VIEWPORT;
113
+ payload: {
114
+ /** Current viewport of the graph */
115
+ viewport: Viewport;
116
+ };
88
117
  };
89
118
 
90
119
  /** Map of action types for type-safe action dispatching */
@@ -95,8 +124,14 @@ export declare const actionTypesMap: {
95
124
  readonly UPDATE_EDGES_BY_REACT_FLOW: "UPDATE_EDGES_BY_REACT_FLOW";
96
125
  readonly ADD_EDGE_BY_REACT_FLOW: "ADD_EDGE_BY_REACT_FLOW";
97
126
  readonly UPDATE_INPUT_VALUE: "UPDATE_INPUT_VALUE";
127
+ readonly OPEN_NODE_GROUP: "OPEN_NODE_GROUP";
128
+ readonly CLOSE_NODE_GROUP: "CLOSE_NODE_GROUP";
129
+ readonly ADD_NODE_GROUP: "ADD_NODE_GROUP";
130
+ readonly SET_VIEWPORT: "SET_VIEWPORT";
98
131
  };
99
132
 
133
+ export declare function addAnInputOrOutputToAllNodesOfANodeTypeAcrossStateIncludingSubtrees<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, nodeType: NodeTypeUniqueId, typeOfInputOrOutput: TypeOfInput<DataTypeUniqueId>, addAtIndex: HandleIndices, beforeOrAfterIndex?: 'before' | 'after'): Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes' | 'nodes' | 'edges'>;
134
+
100
135
  /**
101
136
  * Adds a new edge between two handles with type checking and inference
102
137
  *
@@ -120,9 +155,7 @@ export declare const actionTypesMap: {
120
155
  * @param enableComplexTypeChecking - Whether to enable complex type checking
121
156
  * @returns Object containing updated nodes, edges, and validation result
122
157
  */
123
- export declare function addEdgeWithTypeChecking<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(newEdgeSourceNodeId: string, newEdgeSourceHandleId: string, newEdgeTargetNodeId: string, newEdgeTargetHandleId: string, state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): {
124
- updatedNodes: Nodes<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
125
- updatedEdges: Edges;
158
+ export declare function addEdgeWithTypeChecking<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(newEdgeSourceNodeId: string, newEdgeSourceHandleId: string, newEdgeTargetNodeId: string, newEdgeTargetHandleId: string, state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, groupInputNodeId: string | undefined, groupOutputNodeId: string | undefined, unmodifiedState: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): {
126
159
  validation: ConnectionValidationResult;
127
160
  };
128
161
 
@@ -375,6 +408,14 @@ outputs?: ConfigurableNodeOutput<"string" | "number" | "complex" | "noEquivalent
375
408
  isCurrentlyInsideReactFlow?: boolean;
376
409
  /** Props for the node resizer component */
377
410
  nodeResizerProps?: NodeResizerWithMoreControlsProps;
411
+ /** Node type unique id */
412
+ nodeTypeUniqueId?: string | undefined;
413
+ /**
414
+ * Whether to show the node open button (square mouse pointer icon)
415
+ * - Used by full graph for node groups
416
+ * @default false
417
+ */
418
+ showNodeOpenButton?: boolean;
378
419
  } & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
379
420
 
380
421
  /**
@@ -472,7 +513,7 @@ export declare type ConfigurableNodeOutput<UnderlyingType extends SupportedUnder
472
513
  * Defines the complete configuration for a customizable node with inputs, outputs,
473
514
  * and optional panels. Supports both standalone usage and ReactFlow integration.
474
515
  */
475
- export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = {
516
+ export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = {
476
517
  /** Display name of the node */
477
518
  name?: string;
478
519
  /** Background color of the node header */
@@ -485,6 +526,14 @@ export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderl
485
526
  isCurrentlyInsideReactFlow?: boolean;
486
527
  /** Props for the node resizer component */
487
528
  nodeResizerProps?: NodeResizerWithMoreControlsProps;
529
+ /** Node type unique id */
530
+ nodeTypeUniqueId?: NodeTypeUniqueId;
531
+ /**
532
+ * Whether to show the node open button (square mouse pointer icon)
533
+ * - Used by full graph for node groups
534
+ * @default false
535
+ */
536
+ showNodeOpenButton?: boolean;
488
537
  } & HTMLAttributes<HTMLDivElement>;
489
538
 
490
539
  /**
@@ -530,15 +579,15 @@ export declare type ConfigurableNodeProps<UnderlyingType extends SupportedUnderl
530
579
  * />
531
580
  * ```
532
581
  */
533
- export declare const ConfigurableNodeReactFlowWrapper: ForwardRefExoticComponent<Omit<ConfigurableNodeReactFlowWrapperProps<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never, string>, "position"> & RefAttributes<HTMLDivElement>>;
582
+ export declare const ConfigurableNodeReactFlowWrapper: ForwardRefExoticComponent<Omit<ConfigurableNodeReactFlowWrapperProps<"string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", string, never, string>, "position"> & RefAttributes<HTMLDivElement>>;
534
583
 
535
584
  /** Props for the ConfigurableNodeReactFlowWrapper component */
536
- export declare type ConfigurableNodeReactFlowWrapperProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = NodeProps<ConfigurableNodeState<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>> & {
585
+ export declare type ConfigurableNodeReactFlowWrapperProps<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = NodeProps<ConfigurableNodeState<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>> & {
537
586
  position: XYPosition;
538
587
  };
539
588
 
540
589
  /** State type for configurable nodes in ReactFlow */
541
- export declare type ConfigurableNodeState<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = Node_2<Omit<ConfigurableNodeProps<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>, 'isCurrentlyInsideReactFlow'>, 'configurableNode'>;
590
+ export declare type ConfigurableNodeState<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = Node_2<Omit<ConfigurableNodeProps<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>, 'isCurrentlyInsideReactFlow'>, 'configurableNode'>;
542
591
 
543
592
  /**
544
593
  * Type for connection validation result
@@ -586,7 +635,7 @@ declare type ConnectionValidationResult = {
586
635
  * );
587
636
  * ```
588
637
  */
589
- export declare function constructInputOrOutputOfType<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(typeOfDataTypeInNode: TypeOfInput<DataTypeUniqueId> | TypeOfNode<DataTypeUniqueId>['outputs'][number], allDataTypes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['dataTypes']): ConfigurableNodeInput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | ConfigurableNodeOutput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
638
+ export declare function constructInputOrOutputOfType<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(typeOfDataTypeInNode: TypeOfInput<DataTypeUniqueId> | TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['outputs'][number], allDataTypes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['dataTypes']): ConfigurableNodeInput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | ConfigurableNodeOutput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
590
639
 
591
640
  /**
592
641
  * Constructs a ConfigurableNodeInputPanel from a type definition
@@ -663,7 +712,6 @@ export declare function constructInputPanelOfType<DataTypeUniqueId extends strin
663
712
  * import {
664
713
  * constructNodeOfType,
665
714
  * makeStateWithAutoInfer,
666
- * makeNodeIdToNodeTypeWithAutoInfer,
667
715
  * makeTypeOfNodeWithAutoInfer,
668
716
  * makeDataTypeWithAutoInfer
669
717
  * } from 'react-blender-nodes';
@@ -840,6 +888,45 @@ export declare type ContextAwareInputProps = {
840
888
  isCurrentlyInsideReactFlow: boolean;
841
889
  };
842
890
 
891
+ /**
892
+ * Context-aware open button component that handles both ReactFlow and standalone contexts
893
+ *
894
+ * This component intelligently renders either a ReactFlow-aware button (for ReactFlow context)
895
+ * or a simple button (for standalone usage) based on the context.
896
+ *
897
+ * Features:
898
+ * - Automatically detects ReactFlow context
899
+ * - Renders appropriate button based on context
900
+ * - Integrates with FullGraph's dispatch system
901
+ * - Supports conditional rendering
902
+ *
903
+ * @param props - The component props
904
+ * @returns JSX element containing the appropriate open button
905
+ *
906
+ * @example
907
+ * ```tsx
908
+ * <ContextAwareOpenButton
909
+ * nodeId="node-123"
910
+ * showButton={true}
911
+ * isCurrentlyInsideReactFlow={true}
912
+ * />
913
+ * ```
914
+ */
915
+ export declare const ContextAwareOpenButton: ({ showButton, isCurrentlyInsideReactFlow, }: ContextAwareOpenButtonProps) => JSX.Element;
916
+
917
+ /**
918
+ * Props for the ContextAwareOpenButton component
919
+ */
920
+ export declare type ContextAwareOpenButtonProps = {
921
+ /**
922
+ * Whether the button should be shown
923
+ * @default false
924
+ */
925
+ showButton?: boolean;
926
+ /** Whether the component is currently inside a ReactFlow context */
927
+ isCurrentlyInsideReactFlow: boolean;
928
+ };
929
+
843
930
  /**
844
931
  * A context menu component with nested submenu support
845
932
  *
@@ -975,7 +1062,7 @@ export declare type Coordinate = {
975
1062
  * @param contextMenuPosition - The position where the context menu was opened
976
1063
  * @returns ContextMenuItem array for the context menu
977
1064
  */
978
- export declare function createNodeContextMenu<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>({ typeOfNodes, dispatch, setContextMenu, contextMenuPosition, }: CreateNodeContextMenuProps<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): ContextMenuItem[];
1065
+ export declare function createNodeContextMenu<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>({ typeOfNodes, dispatch, setContextMenu, contextMenuPosition, isRecursionAllowed, currentNodeType, }: CreateNodeContextMenuProps<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): ContextMenuItem[];
979
1066
 
980
1067
  export declare type CreateNodeContextMenuProps<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? any : never = never> = {
981
1068
  typeOfNodes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['typeOfNodes'];
@@ -987,6 +1074,16 @@ export declare type CreateNodeContextMenuProps<DataTypeUniqueId extends string =
987
1074
  position: XYPosition;
988
1075
  }) => void;
989
1076
  contextMenuPosition: XYPosition;
1077
+ /**
1078
+ * Whether to allow recursion
1079
+ * - If not provided, is considered true
1080
+ * - When true, the recursion is checked, and nesting of node groups is not allowed if it creates a recursion
1081
+ * - When false, the recursion is not checked, and all nesting of node groups is allowed
1082
+ *
1083
+ * @default true
1084
+ */
1085
+ isRecursionAllowed?: boolean;
1086
+ currentNodeType?: NodeTypeUniqueId;
990
1087
  };
991
1088
 
992
1089
  /**
@@ -1060,7 +1157,6 @@ export declare type Edges = ConfigurableEdgeState[];
1060
1157
  * FullGraph,
1061
1158
  * useFullGraph,
1062
1159
  * makeStateWithAutoInfer,
1063
- * makeNodeIdToNodeTypeWithAutoInfer,
1064
1160
  * makeTypeOfNodeWithAutoInfer,
1065
1161
  * makeDataTypeWithAutoInfer
1066
1162
  * } from 'react-blender-nodes';
@@ -1102,17 +1198,10 @@ export declare type Edges = ConfigurableEdgeState[];
1102
1198
  * }),
1103
1199
  * };
1104
1200
  *
1105
- * // Define node ID to type mapping with auto-infer
1106
- * const nodeIdToNodeType = makeNodeIdToNodeTypeWithAutoInfer({
1107
- * 'node-1': 'inputNode',
1108
- * 'node-2': 'outputNode',
1109
- * });
1110
- *
1111
1201
  * // Create state with auto-infer for complete type safety
1112
1202
  * const initialState = makeStateWithAutoInfer({
1113
1203
  * dataTypes,
1114
1204
  * typeOfNodes,
1115
- * nodeIdToNodeType,
1116
1205
  * nodes: [],
1117
1206
  * edges: [],
1118
1207
  * });
@@ -1129,6 +1218,10 @@ export declare type Edges = ConfigurableEdgeState[];
1129
1218
  */
1130
1219
  export declare function FullGraph<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>({ state, dispatch, }: FullGraphProps<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): JSX.Element;
1131
1220
 
1221
+ export declare const FullGraphContext: Context< {
1222
+ allProps: FullGraphProps;
1223
+ }>;
1224
+
1132
1225
  /**
1133
1226
  * Props for the FullGraph component
1134
1227
  *
@@ -1146,6 +1239,62 @@ export declare type FullGraphProps<DataTypeUniqueId extends string = string, Nod
1146
1239
  ]>;
1147
1240
  };
1148
1241
 
1242
+ /**
1243
+ * Gets all the dependencies of a node type recursively
1244
+ * - Basically, it returns the node types that this node type directly depends on and all their dependencies recursively
1245
+ * - Includes itself
1246
+ *
1247
+ * @param stateOrNodeToNodeDependencies - The state or the node to node dependencies
1248
+ * @param nodeType - The node type
1249
+ * @returns All dependencies of the node type as a set
1250
+ */
1251
+ export declare function getAllDependenciesOfNodeTypeRecursively<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(stateOrNodeToNodeDependencies: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'> | Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>, nodeType: NodeTypeUniqueId): Set<NodeTypeUniqueId>;
1252
+
1253
+ /**
1254
+ * Gets all the dependents of a node type recursively
1255
+ * - Basically, it returns the node types that are dependent on the given node type and all their dependents recursively
1256
+ * - Includes itself
1257
+ *
1258
+ * @param stateOrNodeToNodeDependents - The state or the node to node dependents
1259
+ * @param nodeType - The node type
1260
+ * @returns All dependents of the node type as a set
1261
+ */
1262
+ export declare function getAllDependentsOfNodeTypeRecursively<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(stateOrNodeToNodeDependents: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'> | Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>, nodeType: NodeTypeUniqueId): Set<NodeTypeUniqueId>;
1263
+
1264
+ export declare function getCurrentNodesAndEdgesFromState<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): {
1265
+ nodes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodes'];
1266
+ edges: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges'];
1267
+ inputNodeId?: string;
1268
+ outputNodeId?: string;
1269
+ };
1270
+
1271
+ export declare function getDependencyGraphBetweenNodeTypes<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'>): {
1272
+ nodeToNodeDependents: Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>;
1273
+ nodeToNodeDependencies: Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>;
1274
+ };
1275
+
1276
+ /**
1277
+ * Gets the direct dependencies of a node type
1278
+ * - Basically, it returns the node types that this node type directly depends on
1279
+ * - Doesn't include itself
1280
+ *
1281
+ * @param stateOrNodeToNodeDependencies - The state or the node to node dependencies
1282
+ * @param nodeType - The node type
1283
+ * @returns The direct dependencies of the node type as a set
1284
+ */
1285
+ export declare function getDirectDependenciesOfNodeType<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(stateOrNodeToNodeDependencies: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'> | Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>, nodeType: NodeTypeUniqueId): Set<NodeTypeUniqueId>;
1286
+
1287
+ /**
1288
+ * Gets the direct dependents of a node type
1289
+ * - Basically, it returns the node types that are directly dependent on the given node type
1290
+ * - Doesn't include itself
1291
+ *
1292
+ * @param stateOrNodeToNodeDependents - The state or the node to node dependents
1293
+ * @param nodeType - The node type
1294
+ * @returns The direct dependents of the node type as a set
1295
+ */
1296
+ export declare function getDirectDependentsOfNodeType<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(stateOrNodeToNodeDependents: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'typeOfNodes'> | Partial<Record<NodeTypeUniqueId, Set<NodeTypeUniqueId>>>, nodeType: NodeTypeUniqueId): Set<NodeTypeUniqueId>;
1297
+
1149
1298
  export declare function getResultantDataTypeOfHandleConsideringInferredType<DataTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(handle: ConfigurableNodeInput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | ConfigurableNodeOutput<UnderlyingType, ComplexSchemaType, DataTypeUniqueId> | undefined): {
1150
1299
  dataTypeObject: DataType<UnderlyingType, ComplexSchemaType>;
1151
1300
  dataTypeUniqueId: DataTypeUniqueId;
@@ -1305,11 +1454,6 @@ export declare function isSupportedUnderlyingType(type: string): type is Support
1305
1454
  */
1306
1455
  export declare function isValidDataTypeId<DataTypeUniqueId extends string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(id: string, dataTypes: Record<DataTypeUniqueId, DataType<UnderlyingType, ComplexSchemaType>>): id is DataTypeUniqueId;
1307
1456
 
1308
- /**
1309
- * Type guard to check if a string is a valid NodeTypeUniqueId
1310
- */
1311
- export declare function isValidNodeTypeUniqueId<NodeTypeUniqueId extends string>(id: string, nodeIdToNodeType: Record<string, NodeTypeUniqueId>): id is NodeTypeUniqueId;
1312
-
1313
1457
  /**
1314
1458
  * Main reducer function for managing graph state
1315
1459
  *
@@ -1330,7 +1474,6 @@ export declare function isValidNodeTypeUniqueId<NodeTypeUniqueId extends string>
1330
1474
  * import {
1331
1475
  * mainReducer,
1332
1476
  * makeStateWithAutoInfer,
1333
- * makeNodeIdToNodeTypeWithAutoInfer,
1334
1477
  * makeTypeOfNodeWithAutoInfer,
1335
1478
  * makeDataTypeWithAutoInfer
1336
1479
  * } from 'react-blender-nodes';
@@ -1353,14 +1496,9 @@ export declare function isValidNodeTypeUniqueId<NodeTypeUniqueId extends string>
1353
1496
  * }),
1354
1497
  * };
1355
1498
  *
1356
- * const nodeIdToNodeType = makeNodeIdToNodeTypeWithAutoInfer({
1357
- * 'node-1': 'inputNode',
1358
- * });
1359
- *
1360
1499
  * const state = makeStateWithAutoInfer({
1361
1500
  * dataTypes,
1362
1501
  * typeOfNodes,
1363
- * nodeIdToNodeType,
1364
1502
  * nodes: [],
1365
1503
  * edges: [],
1366
1504
  * });
@@ -1448,34 +1586,6 @@ export declare function makeAllowedConversionsBetweenDataTypesWithAutoInfer<Data
1448
1586
  */
1449
1587
  export declare function makeDataTypeWithAutoInfer<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(input: DataType<UnderlyingType, ComplexSchemaType>): DataType<UnderlyingType, ComplexSchemaType>;
1450
1588
 
1451
- /**
1452
- * Helper function to create a node ID to node type mapping with automatic type inference
1453
- *
1454
- * This function is essential for type safety when mapping node IDs to their types.
1455
- * It ensures that TypeScript can validate that all node type references are valid,
1456
- * preventing runtime errors when dispatching actions and providing better IDE support.
1457
- *
1458
- * @template NodeTypeUniqueId - Unique identifier type for node types
1459
- * @param input - The node ID to node type mapping
1460
- * @returns The mapping with proper typing
1461
- *
1462
- * @example
1463
- * ```tsx
1464
- * // ✅ Type-safe - TypeScript will validate node type references
1465
- * const nodeIdToNodeType = makeNodeIdToNodeTypeWithAutoInfer({
1466
- * 'node-1': 'inputNode',
1467
- * 'node-2': 'outputNode',
1468
- * });
1469
- *
1470
- * // ❌ Without auto-infer - TypeScript can't validate node type references
1471
- * const nodeIdToNodeType = {
1472
- * 'node-1': 'inputNode',
1473
- * 'node-2': 'outputNode',
1474
- * };
1475
- * ```
1476
- */
1477
- export declare function makeNodeIdToNodeTypeWithAutoInfer<NodeTypeUniqueId extends string = string>(input: NodeIdToNodeType<NodeTypeUniqueId>): NodeIdToNodeType<NodeTypeUniqueId>;
1478
-
1479
1589
  /**
1480
1590
  * Helper function to create a state with automatic type inference
1481
1591
  *
@@ -1508,7 +1618,6 @@ export declare function makeNodeIdToNodeTypeWithAutoInfer<NodeTypeUniqueId exten
1508
1618
  * outputs: []
1509
1619
  * })
1510
1620
  * },
1511
- * nodeIdToNodeType: makeNodeIdToNodeTypeWithAutoInfer({}),
1512
1621
  * nodes: [],
1513
1622
  * edges: [],
1514
1623
  * });
@@ -1518,7 +1627,6 @@ export declare function makeNodeIdToNodeTypeWithAutoInfer<NodeTypeUniqueId exten
1518
1627
  * dataTypes: { stringType: { name: 'String', underlyingType: 'string', color: '#4A90E2' } },
1519
1628
  * typeOfNodes: { inputNode: { name: 'Input', inputs: [], outputs: [] } },
1520
1629
  * nodes: [],
1521
- * nodeIdToNodeType: {},
1522
1630
  * edges: [],
1523
1631
  * };
1524
1632
  * ```
@@ -1555,19 +1663,12 @@ export declare function makeStateWithAutoInfer<DataTypeUniqueId extends string =
1555
1663
  * };
1556
1664
  * ```
1557
1665
  */
1558
- export declare function makeTypeOfNodeWithAutoInfer<DataTypeUniqueId extends string = string>(input: TypeOfNode<DataTypeUniqueId>): TypeOfNode<DataTypeUniqueId>;
1666
+ export declare function makeTypeOfNodeWithAutoInfer<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(input: TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>): TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
1559
1667
 
1560
1668
  /**
1561
1669
  * Array of node changes for ReactFlow
1562
1670
  */
1563
- export declare type NodeChanges<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = NodeChange<Optional<ConfigurableNodeReactFlowWrapperProps<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>, NodeOptionalKeys>>[];
1564
-
1565
- /**
1566
- * Mapping from node IDs to their node types
1567
- *
1568
- * @template NodeTypeUniqueId - Unique identifier type for node types
1569
- */
1570
- export declare type NodeIdToNodeType<NodeTypeUniqueId extends string = string> = Record<string, NodeTypeUniqueId>;
1671
+ export declare type NodeChanges<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = NodeChange<Optional<ConfigurableNodeReactFlowWrapperProps<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>, NodeOptionalKeys>>[];
1571
1672
 
1572
1673
  declare type NodeOptionalKeys = 'draggable' | 'zIndex' | 'selectable' | 'deletable' | 'dragging' | 'selected' | 'isConnectable' | 'positionAbsoluteX' | 'positionAbsoluteY';
1573
1674
 
@@ -1639,10 +1740,12 @@ export declare type NodeResizerWithMoreControlsProps = NodeResizerProps & {
1639
1740
  /**
1640
1741
  * Array of configurable nodes in the graph
1641
1742
  */
1642
- export declare type Nodes<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = Optional<ConfigurableNodeReactFlowWrapperProps<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>, NodeOptionalKeys>[];
1743
+ export declare type Nodes<UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, NodeTypeUniqueId extends string = string, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never, DataTypeUniqueId extends string = string> = Optional<ConfigurableNodeReactFlowWrapperProps<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>, NodeOptionalKeys>[];
1643
1744
 
1644
1745
  declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
1645
1746
 
1747
+ declare type Orientation = 'horizontal' | 'vertical';
1748
+
1646
1749
  /**
1647
1750
  * ReactFlow-aware input component that automatically updates node data
1648
1751
  *
@@ -1663,6 +1766,22 @@ export declare type ReactFlowAwareInputProps = {
1663
1766
  input: ConfigurableNodeInput;
1664
1767
  };
1665
1768
 
1769
+ /**
1770
+ * ReactFlow-aware open button component that dispatches open node group action
1771
+ *
1772
+ * This component renders the open button and dispatches the OPEN_NODE_GROUP action
1773
+ * when clicked. It integrates with the ReactFlow context to maintain state consistency.
1774
+ *
1775
+ * @param props - The component props
1776
+ * @returns JSX element containing the open button
1777
+ */
1778
+ export declare const ReactFlowAwareOpenButton: ({}: ReactFlowAwareOpenButtonProps) => JSX.Element;
1779
+
1780
+ /**
1781
+ * Props for the ReactFlowAwareOpenButton component
1782
+ */
1783
+ export declare type ReactFlowAwareOpenButtonProps = {};
1784
+
1666
1785
  /**
1667
1786
  * Removes an edge between two handles with type checking and inference
1668
1787
  *
@@ -1686,8 +1805,8 @@ export declare type ReactFlowAwareInputProps = {
1686
1805
  * @param enableComplexTypeChecking - Whether to enable complex type checking
1687
1806
  * @returns Object containing updated nodes, edges, and validation result
1688
1807
  */
1689
- export declare function removeEdgeWithTypeChecking<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(removedEdge: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges'][number], state: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, removedEdgeChange: EdgeChange<ConfigurableEdgeState>): {
1690
- updatedNodes: Nodes<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
1808
+ export declare function removeEdgeWithTypeChecking<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(removedEdge: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges'][number], state: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'nodes' | 'edges' | 'enableTypeInference' | 'enableComplexTypeChecking' | 'allowedConversionsBetweenDataTypes' | 'dataTypes' | 'typeOfNodes'>, removedEdgeChange: EdgeChange<ConfigurableEdgeState>): {
1809
+ updatedNodes: Nodes<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>;
1691
1810
  updatedEdges: Edges;
1692
1811
  validation: ConnectionValidationResult;
1693
1812
  };
@@ -1700,6 +1819,286 @@ export declare function removeEdgeWithTypeChecking<DataTypeUniqueId extends stri
1700
1819
  */
1701
1820
  export declare function sanitizeNumberToShowAsText(value: number, numberOfDecimals: number): string;
1702
1821
 
1822
+ export declare const ScrollableButtonContainer: ForwardRefExoticComponent<ScrollableButtonContainerProps & RefAttributes<HTMLDivElement>>;
1823
+
1824
+ export declare type ScrollableButtonContainerProps = {
1825
+ children?: React.ReactNode;
1826
+ orientation?: Orientation;
1827
+ className?: string;
1828
+ scrollAreaClassName?: string;
1829
+ showArrows?: boolean;
1830
+ disabled?: boolean;
1831
+ ariaLabel?: string;
1832
+ scrollSpeedPxPerFrame?: number;
1833
+ reserveArrowSpace?: boolean;
1834
+ observeChildren?: boolean;
1835
+ };
1836
+
1837
+ /**
1838
+ * Root Select component that provides context for all sub-components
1839
+ *
1840
+ * This component manages the overall state and provides context for all
1841
+ * Select sub-components. It supports both controlled and uncontrolled usage
1842
+ * with proper accessibility features.
1843
+ *
1844
+ * @param props - The component props
1845
+ * @returns JSX element containing the select context
1846
+ */
1847
+ export declare const Select: FC<SelectPrimitive.SelectProps>;
1848
+
1849
+ /**
1850
+ * The dropdown content container that holds all select options
1851
+ *
1852
+ * This component renders the dropdown panel that contains all the selectable
1853
+ * options. It includes proper positioning, scrolling, and keyboard navigation
1854
+ * support with Blender-inspired styling.
1855
+ *
1856
+ * Features:
1857
+ * - Automatic positioning and collision detection
1858
+ * - Scrollable content with scroll indicators
1859
+ * - Keyboard navigation support
1860
+ * - Blender-inspired dark theme styling
1861
+ * - Proper focus management
1862
+ *
1863
+ * @param props - The component props
1864
+ * @param ref - Forwarded ref to the content element
1865
+ * @returns JSX element containing the select content
1866
+ *
1867
+ * @example
1868
+ * ```tsx
1869
+ * <SelectContent>
1870
+ * <SelectGroup>
1871
+ * <SelectLabel>Fruits</SelectLabel>
1872
+ * <SelectItem value="apple">Apple</SelectItem>
1873
+ * <SelectItem value="banana">Banana</SelectItem>
1874
+ * </SelectGroup>
1875
+ * </SelectContent>
1876
+ * ```
1877
+ */
1878
+ export declare const SelectContent: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1879
+
1880
+ /**
1881
+ * Props for the SelectContent component
1882
+ */
1883
+ export declare type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
1884
+
1885
+ /**
1886
+ * Container for grouping related select options with optional labels
1887
+ *
1888
+ * This component provides a semantic container for grouping related select
1889
+ * options. It can include a SelectLabel for the group and helps organize
1890
+ * options logically.
1891
+ *
1892
+ * Features:
1893
+ * - Semantic grouping of options
1894
+ * - Optional group labels
1895
+ * - Proper accessibility structure
1896
+ * - Blender-inspired styling
1897
+ *
1898
+ * @param props - The component props
1899
+ * @returns JSX element containing the select group
1900
+ *
1901
+ * @example
1902
+ * ```tsx
1903
+ * <SelectGroup>
1904
+ * <SelectLabel>Fruits</SelectLabel>
1905
+ * <SelectItem value="apple">Apple</SelectItem>
1906
+ * <SelectItem value="banana">Banana</SelectItem>
1907
+ * </SelectGroup>
1908
+ * ```
1909
+ */
1910
+ export declare const SelectGroup: ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & RefAttributes<HTMLDivElement>>;
1911
+
1912
+ /**
1913
+ * Individual selectable option within the select dropdown
1914
+ *
1915
+ * This component represents a single selectable option within the select
1916
+ * dropdown. It includes hover states, selection indicators, and proper
1917
+ * keyboard navigation support.
1918
+ *
1919
+ * Features:
1920
+ * - Hover and focus states
1921
+ * - Selection indicator (checkmark)
1922
+ * - Keyboard navigation support
1923
+ * - Blender-inspired styling
1924
+ * - Proper accessibility attributes
1925
+ *
1926
+ * @param props - The component props
1927
+ * @param ref - Forwarded ref to the item element
1928
+ * @returns JSX element containing the select item
1929
+ *
1930
+ * @example
1931
+ * ```tsx
1932
+ * <SelectItem value="apple">Apple</SelectItem>
1933
+ * <SelectItem value="banana">Banana</SelectItem>
1934
+ * ```
1935
+ */
1936
+ export declare const SelectItem: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1937
+
1938
+ /**
1939
+ * Props for the SelectItem component
1940
+ */
1941
+ export declare type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;
1942
+
1943
+ /**
1944
+ * Label component for grouping select options
1945
+ *
1946
+ * This component provides a label for grouping related select options.
1947
+ * It's typically used within a SelectGroup to create visual separation
1948
+ * and organization of options.
1949
+ *
1950
+ * Features:
1951
+ * - Semantic grouping of options
1952
+ * - Blender-inspired styling
1953
+ * - Proper accessibility attributes
1954
+ *
1955
+ * @param props - The component props
1956
+ * @param ref - Forwarded ref to the label element
1957
+ * @returns JSX element containing the select label
1958
+ *
1959
+ * @example
1960
+ * ```tsx
1961
+ * <SelectGroup>
1962
+ * <SelectLabel>Fruits</SelectLabel>
1963
+ * <SelectItem value="apple">Apple</SelectItem>
1964
+ * <SelectItem value="banana">Banana</SelectItem>
1965
+ * </SelectGroup>
1966
+ * ```
1967
+ */
1968
+ export declare const SelectLabel: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1969
+
1970
+ /**
1971
+ * Props for the SelectLabel component
1972
+ */
1973
+ export declare type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
1974
+
1975
+ /**
1976
+ * Button for scrolling down in the select content when there are many options
1977
+ *
1978
+ * This component provides a scroll down button that appears when the select
1979
+ * content is scrollable and there are more options below.
1980
+ *
1981
+ * @param props - The component props
1982
+ * @param ref - Forwarded ref to the button element
1983
+ * @returns JSX element containing the scroll down button
1984
+ */
1985
+ export declare const SelectScrollDownButton: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1986
+
1987
+ /**
1988
+ * Props for the SelectScrollDownButton component
1989
+ */
1990
+ export declare type SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;
1991
+
1992
+ /**
1993
+ * Button for scrolling up in the select content when there are many options
1994
+ *
1995
+ * This component provides a scroll up button that appears when the select
1996
+ * content is scrollable and the user has scrolled down.
1997
+ *
1998
+ * @param props - The component props
1999
+ * @param ref - Forwarded ref to the button element
2000
+ * @returns JSX element containing the scroll up button
2001
+ */
2002
+ export declare const SelectScrollUpButton: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
2003
+
2004
+ /**
2005
+ * Props for the SelectScrollUpButton component
2006
+ */
2007
+ export declare type SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;
2008
+
2009
+ /**
2010
+ * Visual separator between groups of select options
2011
+ *
2012
+ * This component provides a visual separator line between different groups
2013
+ * of select options, helping to organize and visually separate related items.
2014
+ *
2015
+ * Features:
2016
+ * - Visual separation between option groups
2017
+ * - Blender-inspired styling
2018
+ * - Proper accessibility attributes
2019
+ *
2020
+ * @param props - The component props
2021
+ * @param ref - Forwarded ref to the separator element
2022
+ * @returns JSX element containing the select separator
2023
+ *
2024
+ * @example
2025
+ * ```tsx
2026
+ * <SelectItem value="apple">Apple</SelectItem>
2027
+ * <SelectSeparator />
2028
+ * <SelectItem value="orange">Orange</SelectItem>
2029
+ * ```
2030
+ */
2031
+ export declare const SelectSeparator: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
2032
+
2033
+ /**
2034
+ * Props for the SelectSeparator component
2035
+ */
2036
+ export declare type SelectSeparatorProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;
2037
+
2038
+ /**
2039
+ * The trigger button that opens the select dropdown
2040
+ *
2041
+ * This component renders the button that users click to open the select dropdown.
2042
+ * It displays the currently selected value or placeholder text and includes
2043
+ * proper accessibility attributes.
2044
+ *
2045
+ * Features:
2046
+ * - Displays selected value or placeholder
2047
+ * - Keyboard navigation support
2048
+ * - Blender-inspired dark theme styling
2049
+ * - Proper ARIA attributes
2050
+ *
2051
+ * @param props - The component props
2052
+ * @param ref - Forwarded ref to the button element
2053
+ * @returns JSX element containing the select trigger
2054
+ *
2055
+ * @example
2056
+ * ```tsx
2057
+ * <SelectTrigger className="w-[180px]">
2058
+ * <SelectValue placeholder="Select a fruit" />
2059
+ * </SelectTrigger>
2060
+ * ```
2061
+ */
2062
+ export declare const SelectTrigger: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & RefAttributes<HTMLButtonElement>, "ref"> & RefAttributes<HTMLButtonElement>>;
2063
+
2064
+ /**
2065
+ * Props for the SelectTrigger component
2066
+ */
2067
+ export declare type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
2068
+
2069
+ /**
2070
+ * Component that displays the currently selected value or placeholder
2071
+ *
2072
+ * This component is used within SelectTrigger to display the currently
2073
+ * selected value or a placeholder when no value is selected. It provides
2074
+ * proper text handling and accessibility.
2075
+ *
2076
+ * Features:
2077
+ * - Displays selected value or placeholder
2078
+ * - Proper text truncation
2079
+ * - Accessibility support
2080
+ * - Blender-inspired styling
2081
+ *
2082
+ * @param props - The component props
2083
+ * @param ref - Forwarded ref to the value element
2084
+ * @returns JSX element containing the select value
2085
+ *
2086
+ * @example
2087
+ * ```tsx
2088
+ * <SelectTrigger>
2089
+ * <SelectValue placeholder="Select a fruit" />
2090
+ * </SelectTrigger>
2091
+ * ```
2092
+ */
2093
+ export declare const SelectValue: ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & RefAttributes<HTMLSpanElement>, "ref"> & RefAttributes<HTMLSpanElement>>;
2094
+
2095
+ /**
2096
+ * Props for the SelectValue component
2097
+ */
2098
+ export declare type SelectValueProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
2099
+
2100
+ export declare function setCurrentNodesAndEdgesToStateWithMutatingState<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never>(state: Pick<State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>, 'nodes' | 'edges' | 'typeOfNodes' | 'openedNodeGroupStack' | 'dataTypes'>, nodes?: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodes'], edges?: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges']): State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>;
2101
+
1703
2102
  /**
1704
2103
  * A combined slider and number input component with drag functionality
1705
2104
  *
@@ -1771,6 +2170,44 @@ export declare type SliderNumberInputProps = {
1771
2170
  step?: number;
1772
2171
  };
1773
2172
 
2173
+ export declare const standardDataTypeNames: readonly ["newGroupInput", "newGroupOutput"];
2174
+
2175
+ export declare const standardDataTypeNamesMap: {
2176
+ readonly newGroupInput: "newGroupInput";
2177
+ readonly newGroupOutput: "newGroupOutput";
2178
+ };
2179
+
2180
+ export declare const standardDataTypes: {
2181
+ newGroupInput: {
2182
+ name: string;
2183
+ underlyingType: "inferFromConnection";
2184
+ complexSchema?: undefined;
2185
+ color: string;
2186
+ shape?: HandleShape_2;
2187
+ allowInput?: boolean;
2188
+ };
2189
+ newGroupOutput: {
2190
+ name: string;
2191
+ underlyingType: "inferFromConnection";
2192
+ complexSchema?: undefined;
2193
+ color: string;
2194
+ shape?: HandleShape_2;
2195
+ allowInput?: boolean;
2196
+ };
2197
+ };
2198
+
2199
+ export declare const standardNodeTypeNames: readonly ["groupInput", "groupOutput"];
2200
+
2201
+ export declare const standardNodeTypeNamesMap: {
2202
+ readonly groupInput: "groupInput";
2203
+ readonly groupOutput: "groupOutput";
2204
+ };
2205
+
2206
+ export declare const standardNodeTypes: {
2207
+ groupInput: TypeOfNode_2<"newGroupInput" | "newGroupOutput", string, "string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never>;
2208
+ groupOutput: TypeOfNode_2<"newGroupInput" | "newGroupOutput", string, "string" | "number" | "complex" | "noEquivalent" | "inferFromConnection", never>;
2209
+ };
2210
+
1774
2211
  /**
1775
2212
  * Complete state definition for the graph system
1776
2213
  *
@@ -1780,14 +2217,25 @@ export declare type SliderNumberInputProps = {
1780
2217
  * @template ComplexSchemaType - Zod schema type for complex data types
1781
2218
  */
1782
2219
  export declare type State<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never> = {
2220
+ openedNodeGroupStack?: ({
2221
+ nodeType: NodeTypeUniqueId;
2222
+ previousViewport?: Viewport;
2223
+ } | {
2224
+ nodeType: NodeTypeUniqueId;
2225
+ /**
2226
+ * If not provided, it means that this node group isn't instantiated yet and we are editing the original node group
2227
+ */
2228
+ nodeId: string;
2229
+ previousViewport?: Viewport;
2230
+ })[];
1783
2231
  /** Map of data type definitions */
1784
2232
  dataTypes: Record<DataTypeUniqueId, DataType<UnderlyingType, ComplexSchemaType>>;
2233
+ /** Current viewport of the graph */
2234
+ viewport?: Viewport;
1785
2235
  /** Map of node type definitions */
1786
- typeOfNodes: Record<NodeTypeUniqueId, TypeOfNode<DataTypeUniqueId>>;
2236
+ typeOfNodes: Record<NodeTypeUniqueId, TypeOfNode<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>>;
1787
2237
  /** Array of nodes in the graph */
1788
- nodes: Nodes<UnderlyingType, ComplexSchemaType, DataTypeUniqueId>;
1789
- /** Mapping from node IDs to their types */
1790
- nodeIdToNodeType: NodeIdToNodeType<NodeTypeUniqueId>;
2238
+ nodes: Nodes<UnderlyingType, NodeTypeUniqueId, ComplexSchemaType, DataTypeUniqueId>;
1791
2239
  /** Array of edges in the graph */
1792
2240
  edges: Edges;
1793
2241
  /**
@@ -1838,6 +2286,15 @@ export declare type State<DataTypeUniqueId extends string = string, NodeTypeUniq
1838
2286
  * @default undefined
1839
2287
  */
1840
2288
  enableCycleChecking?: boolean;
2289
+ /**
2290
+ * Whether to enable recursion checking
2291
+ * - If not provided, is considered disabled
2292
+ * - When disabled, the recursion is not checked, all nesting of node groups is allowed
2293
+ * - When enabled, the recursion is checked, and nesting of node groups is not allowed if it creates a recursion
2294
+ *
2295
+ * @default undefined
2296
+ */
2297
+ enableRecursionChecking?: boolean;
1841
2298
  };
1842
2299
 
1843
2300
  /**
@@ -1892,7 +2349,7 @@ export declare type TypeOfInputPanel<DataTypeUniqueId extends string = string> =
1892
2349
  *
1893
2350
  * @template DataTypeUniqueId - Unique identifier type for data types
1894
2351
  */
1895
- export declare type TypeOfNode<DataTypeUniqueId extends string = string> = {
2352
+ export declare type TypeOfNode<DataTypeUniqueId extends string = string, NodeTypeUniqueId extends string = string, UnderlyingType extends SupportedUnderlyingTypes = SupportedUnderlyingTypes, ComplexSchemaType extends UnderlyingType extends 'complex' ? z.ZodType : never = never> = {
1896
2353
  /** Display name of the node type */
1897
2354
  name: string;
1898
2355
  /** Color used for the node header */
@@ -1901,6 +2358,28 @@ export declare type TypeOfNode<DataTypeUniqueId extends string = string> = {
1901
2358
  inputs: (TypeOfInput<DataTypeUniqueId> | TypeOfInputPanel<DataTypeUniqueId>)[];
1902
2359
  /** Array of outputs */
1903
2360
  outputs: TypeOfInput<DataTypeUniqueId>[];
2361
+ /** Subtree of the node type (if this exists, this is a node group) */
2362
+ subtree?: {
2363
+ nodes: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['nodes'];
2364
+ edges: State<DataTypeUniqueId, NodeTypeUniqueId, UnderlyingType, ComplexSchemaType>['edges'];
2365
+ /**
2366
+ * Number of references to this node group
2367
+ * This subtree can only be edited or deleted if there are no references to it
2368
+ */
2369
+ numberOfReferences: number;
2370
+ /**
2371
+ * Input node id of the node group
2372
+ * - It is used to connect the node group to the rest of the graph
2373
+ * - Not allowed to be deleted or duplicated, must always be one
2374
+ */
2375
+ inputNodeId: string;
2376
+ /**
2377
+ * Output node id of the node group
2378
+ * - It is used to connect the node group to the rest of the graph
2379
+ * - Not allowed to be deleted or duplicated, must always be one
2380
+ */
2381
+ outputNodeId: string;
2382
+ };
1904
2383
  };
1905
2384
 
1906
2385
  /**
@@ -2020,7 +2499,6 @@ export declare type UseDragReturn = {
2020
2499
  * import {
2021
2500
  * useFullGraph,
2022
2501
  * makeStateWithAutoInfer,
2023
- * makeNodeIdToNodeTypeWithAutoInfer,
2024
2502
  * makeTypeOfNodeWithAutoInfer,
2025
2503
  * makeDataTypeWithAutoInfer
2026
2504
  * } from 'react-blender-nodes';
@@ -2053,16 +2531,10 @@ export declare type UseDragReturn = {
2053
2531
  * }),
2054
2532
  * };
2055
2533
  *
2056
- * // Define node ID to type mapping with auto-infer
2057
- * const nodeIdToNodeType = makeNodeIdToNodeTypeWithAutoInfer({
2058
- * 'node-1': 'inputNode',
2059
- * });
2060
- *
2061
2534
  * // Create state with auto-infer for complete type safety
2062
2535
  * const initialState = makeStateWithAutoInfer({
2063
2536
  * dataTypes,
2064
2537
  * typeOfNodes,
2065
- * nodeIdToNodeType,
2066
2538
  * nodes: [],
2067
2539
  * edges: [],
2068
2540
  * });
@@ -2071,7 +2543,7 @@ export declare type UseDragReturn = {
2071
2543
  *
2072
2544
  * // Add a new node (type-safe!)
2073
2545
  * dispatch({
2074
- * type: 'ADD_NODE',
2546
+ * type: actionTypesMap.ADD_NODE,
2075
2547
  * payload: { type: 'inputNode', position: { x: 100, y: 100 } },
2076
2548
  * });
2077
2549
  * ```