@babylonjs/node-editor 5.32.1 → 5.32.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.
@@ -2084,6 +2084,248 @@ export interface MessageDialogProps {
2084
2084
  }
2085
2085
  export const MessageDialog: React.FC<MessageDialogProps>;
2086
2086
 
2087
+ }
2088
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphConnectorHandle" {
2089
+ import { FC } from "react";
2090
+ /**
2091
+ * Props for the connector
2092
+ */
2093
+ export interface IGraphConnectorHandlerProps {
2094
+ /**
2095
+ * id of the parent node
2096
+ */
2097
+ parentId: string;
2098
+ /**
2099
+ * x position of the parent node
2100
+ */
2101
+ parentX: number;
2102
+ /**
2103
+ * y position of the parent node
2104
+ */
2105
+ parentY: number;
2106
+ /**
2107
+ * x position of the connector relative to the parent node
2108
+ */
2109
+ offsetX?: number;
2110
+ /**
2111
+ * y position of the connector relative to the parent node
2112
+ */
2113
+ offsetY?: number;
2114
+ /**
2115
+ * width of the parent node
2116
+ */
2117
+ parentWidth: number;
2118
+ /**
2119
+ * height of the parent node
2120
+ */
2121
+ parentHeight: number;
2122
+ /**
2123
+ * id of the container where its parent node is
2124
+ */
2125
+ parentContainerId: string;
2126
+ }
2127
+ /**
2128
+ * This component is used to initiate a connection between two nodes. Simply
2129
+ * drag the handle in a node and drop it in another node to create a connection.
2130
+ */
2131
+ export const GraphConnectorHandler: FC<IGraphConnectorHandlerProps>;
2132
+
2133
+ }
2134
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphContainer" {
2135
+ import { FC } from "react";
2136
+ export interface IGraphContainerProps {
2137
+ }
2138
+ /**
2139
+ * This component is just a simple container to keep the nodes and lines containers
2140
+ * together
2141
+ * @param props
2142
+ * @returns
2143
+ */
2144
+ export const GraphContainer: FC<IGraphContainerProps>;
2145
+
2146
+ }
2147
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphContextManager" {
2148
+ /// <reference types="react" />
2149
+ /**
2150
+ * this context is used to pass callbacks to the graph nodes and connections
2151
+ */
2152
+ export interface IGraphContext {
2153
+ onNodesConnected?: (sourceId: string, targetId: string) => void;
2154
+ onLineSelected?: (lineId: string) => void;
2155
+ onNodeSelected?: (nodeId: string) => void;
2156
+ }
2157
+ export const GraphContextManager: import("react").Context<IGraphContext>;
2158
+
2159
+ }
2160
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphLine" {
2161
+ import { FC } from "react";
2162
+ /**
2163
+ * props for the GraphLine component
2164
+ */
2165
+ export interface IGraphLineProps {
2166
+ /**
2167
+ * id of the line. temporary lines can have no id
2168
+ */
2169
+ id?: string;
2170
+ /**
2171
+ * starting x pos of the line
2172
+ */
2173
+ x1: number;
2174
+ /**
2175
+ * ending x pos of the line
2176
+ */
2177
+ x2: number;
2178
+ /**
2179
+ * starting y pos of the line
2180
+ */
2181
+ y1: number;
2182
+ /**
2183
+ * ending y pos of the line
2184
+ */
2185
+ y2: number;
2186
+ /**
2187
+ * is the line selected
2188
+ */
2189
+ selected?: boolean;
2190
+ /**
2191
+ * does the line have a direction
2192
+ */
2193
+ directional?: boolean;
2194
+ }
2195
+ export const MarkerArrowId = "arrow";
2196
+ /**
2197
+ * This component draws a SVG line between two points, with an optional marker
2198
+ * indicating direction
2199
+ */
2200
+ export const GraphLine: FC<IGraphLineProps>;
2201
+
2202
+ }
2203
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphLinesContainer" {
2204
+ import { FC } from "react";
2205
+ /**
2206
+ * props for the GraphLineContainer
2207
+ */
2208
+ export interface IGraphLinesContainerProps {
2209
+ /**
2210
+ * id of the container
2211
+ */
2212
+ id: string;
2213
+ }
2214
+ /**
2215
+ * this component handles the dragging of new connections
2216
+ * @param props
2217
+ * @returns
2218
+ */
2219
+ export const GraphLinesContainer: FC<IGraphLinesContainerProps>;
2220
+
2221
+ }
2222
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphNode" {
2223
+ import { FC } from "react";
2224
+ export interface IGraphNodeProps {
2225
+ id: string;
2226
+ name: string;
2227
+ x: number;
2228
+ y: number;
2229
+ selected?: boolean;
2230
+ width?: number;
2231
+ height?: number;
2232
+ highlighted?: boolean;
2233
+ parentContainerId: string;
2234
+ }
2235
+ export const GraphNode: FC<IGraphNodeProps>;
2236
+
2237
+ }
2238
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/GraphNodesContainer" {
2239
+ import { FC } from "react";
2240
+ export interface IGraphContainerProps {
2241
+ onNodeMoved: (id: string, x: number, y: number) => void;
2242
+ id: string;
2243
+ }
2244
+ /**
2245
+ * This component contains all the nodes and handles their dragging
2246
+ */
2247
+ export const GraphNodesContainer: FC<IGraphContainerProps>;
2248
+
2249
+ }
2250
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/NodeRenderer" {
2251
+ import { ComponentType } from "react";
2252
+ import { Nullable } from "@babylonjs/core/types";
2253
+ export type IVisualRecordsType = Record<string, {
2254
+ x: number;
2255
+ y: number;
2256
+ }>;
2257
+ export type IConnectionType = {
2258
+ id: string;
2259
+ sourceId: string;
2260
+ targetId: string;
2261
+ };
2262
+ export type ICustomDataType = {
2263
+ type: string;
2264
+ value: any;
2265
+ };
2266
+ export type INodeType = {
2267
+ id: string;
2268
+ label: string;
2269
+ customData?: ICustomDataType;
2270
+ };
2271
+ /**
2272
+ * props for the node renderer
2273
+ */
2274
+ export interface INodeRendererProps {
2275
+ /**
2276
+ * array of connections between nodes
2277
+ */
2278
+ connections: IConnectionType[];
2279
+ /**
2280
+ * function called when a new connection is created
2281
+ */
2282
+ updateConnections: (sourceId: string, targetId: string) => void;
2283
+ /**
2284
+ * function called when a connection is deleted
2285
+ */
2286
+ deleteLine: (lineId: string) => void;
2287
+ /**
2288
+ * function called when a node is deleted
2289
+ */
2290
+ deleteNode: (nodeId: string) => void;
2291
+ /**
2292
+ * array of all nodes
2293
+ */
2294
+ nodes: INodeType[];
2295
+ /**
2296
+ * id of the node to highlight
2297
+ */
2298
+ highlightedNode?: Nullable<string>;
2299
+ /**
2300
+ * function to be called if a node is selected
2301
+ */
2302
+ selectNode?: (nodeId: Nullable<string>) => void;
2303
+ /**
2304
+ * id of this renderer
2305
+ */
2306
+ id: string;
2307
+ /**
2308
+ * optional list of custom components to be rendered inside nodes of
2309
+ * a certain type
2310
+ */
2311
+ customComponents?: Record<string, ComponentType<any>>;
2312
+ }
2313
+ /**
2314
+ * This component is a bridge between the app logic related to the graph, and the actual rendering
2315
+ * of it. It manages the nodes' positions and selection states.
2316
+ * @param props
2317
+ * @returns
2318
+ */
2319
+ export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
2320
+
2321
+ }
2322
+ declare module "@babylonjs/node-editor/components/reactGraphSystem/useGraphContext" {
2323
+ /**
2324
+ * utility hook to assist using the graph context
2325
+ * @returns
2326
+ */
2327
+ export const useGraphContext: () => import("@babylonjs/node-editor/components/reactGraphSystem/GraphContextManager").IGraphContext;
2328
+
2087
2329
  }
2088
2330
  declare module "@babylonjs/node-editor/components/TextInputWithSubmit" {
2089
2331
  /// <reference types="react" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/node-editor",
3
- "version": "5.32.1",
3
+ "version": "5.32.2",
4
4
  "main": "dist/babylon.nodeEditor.max.js",
5
5
  "module": "dist/babylon.nodeEditor.max.js",
6
6
  "esnext": "dist/babylon.nodeEditor.max.js",
@@ -23,7 +23,7 @@
23
23
  "@types/react-dom": ">=16.0.9"
24
24
  },
25
25
  "devDependencies": {
26
- "@babylonjs/core": "^5.32.1",
26
+ "@babylonjs/core": "^5.32.2",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2",
29
29
  "rimraf": "^3.0.2",