babylonjs-node-editor 5.32.1 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1623,7 +1623,7 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
1623
1623
  * @param row
1624
1624
  * @returns
1625
1625
  */
1626
- export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
1626
+ export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => BABYLON.NodeEditor.SharedUIComponents.LayoutColumn | BABYLON.NodeEditor.SharedUIComponents.LayoutTabsRow;
1627
1627
  /**
1628
1628
  * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1629
1629
  * @param layout
@@ -1823,6 +1823,285 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
1823
1823
 
1824
1824
 
1825
1825
 
1826
+ }
1827
+ declare module BABYLON.NodeEditor {
1828
+
1829
+ }
1830
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1831
+ /**
1832
+ * Props for the connector
1833
+ */
1834
+ export interface IGraphConnectorHandlerProps {
1835
+ /**
1836
+ * id of the parent node
1837
+ */
1838
+ parentId: string;
1839
+ /**
1840
+ * x position of the parent node
1841
+ */
1842
+ parentX: number;
1843
+ /**
1844
+ * y position of the parent node
1845
+ */
1846
+ parentY: number;
1847
+ /**
1848
+ * x position of the connector relative to the parent node
1849
+ */
1850
+ offsetX?: number;
1851
+ /**
1852
+ * y position of the connector relative to the parent node
1853
+ */
1854
+ offsetY?: number;
1855
+ /**
1856
+ * width of the parent node
1857
+ */
1858
+ parentWidth: number;
1859
+ /**
1860
+ * height of the parent node
1861
+ */
1862
+ parentHeight: number;
1863
+ /**
1864
+ * id of the container where its parent node is
1865
+ */
1866
+ parentContainerId: string;
1867
+ }
1868
+ /**
1869
+ * This component is used to initiate a connection between two nodes. Simply
1870
+ * drag the handle in a node and drop it in another node to create a connection.
1871
+ */
1872
+ export var GraphConnectorHandler: React.FC<IGraphConnectorHandlerProps>;
1873
+
1874
+
1875
+
1876
+ }
1877
+ declare module BABYLON.NodeEditor {
1878
+
1879
+ }
1880
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1881
+ export interface IGraphContainerProps {
1882
+ }
1883
+ /**
1884
+ * This component is just a simple container to keep the nodes and lines containers
1885
+ * together
1886
+ * @param props
1887
+ * @returns
1888
+ */
1889
+ export var GraphContainer: React.FC<IGraphContainerProps>;
1890
+
1891
+
1892
+
1893
+ }
1894
+ declare module BABYLON.NodeEditor {
1895
+
1896
+ }
1897
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1898
+ /// <reference types="react" />
1899
+ /**
1900
+ * this context is used to pass callbacks to the graph nodes and connections
1901
+ */
1902
+ export interface IGraphContext {
1903
+ onNodesConnected?: (sourceId: string, targetId: string) => void;
1904
+ onLineSelected?: (lineId: string) => void;
1905
+ onNodeSelected?: (nodeId: string) => void;
1906
+ }
1907
+ export var GraphContextManager: import("react").Context<IGraphContext>;
1908
+
1909
+
1910
+
1911
+ }
1912
+ declare module BABYLON.NodeEditor {
1913
+
1914
+ }
1915
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1916
+ /**
1917
+ * props for the GraphLine component
1918
+ */
1919
+ export interface IGraphLineProps {
1920
+ /**
1921
+ * id of the line. temporary lines can have no id
1922
+ */
1923
+ id?: string;
1924
+ /**
1925
+ * starting x pos of the line
1926
+ */
1927
+ x1: number;
1928
+ /**
1929
+ * ending x pos of the line
1930
+ */
1931
+ x2: number;
1932
+ /**
1933
+ * starting y pos of the line
1934
+ */
1935
+ y1: number;
1936
+ /**
1937
+ * ending y pos of the line
1938
+ */
1939
+ y2: number;
1940
+ /**
1941
+ * is the line selected
1942
+ */
1943
+ selected?: boolean;
1944
+ /**
1945
+ * does the line have a direction
1946
+ */
1947
+ directional?: boolean;
1948
+ }
1949
+ export const MarkerArrowId = "arrow";
1950
+ /**
1951
+ * This component draws a SVG line between two points, with an optional marker
1952
+ * indicating direction
1953
+ */
1954
+ export var GraphLine: React.FC<IGraphLineProps>;
1955
+
1956
+
1957
+
1958
+ }
1959
+ declare module BABYLON.NodeEditor {
1960
+
1961
+ }
1962
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1963
+ /**
1964
+ * props for the GraphLineContainer
1965
+ */
1966
+ export interface IGraphLinesContainerProps {
1967
+ /**
1968
+ * id of the container
1969
+ */
1970
+ id: string;
1971
+ }
1972
+ /**
1973
+ * this component handles the dragging of new connections
1974
+ * @param props
1975
+ * @returns
1976
+ */
1977
+ export var GraphLinesContainer: React.FC<IGraphLinesContainerProps>;
1978
+
1979
+
1980
+
1981
+ }
1982
+ declare module BABYLON.NodeEditor {
1983
+
1984
+ }
1985
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1986
+ export interface IGraphNodeProps {
1987
+ id: string;
1988
+ name: string;
1989
+ x: number;
1990
+ y: number;
1991
+ selected?: boolean;
1992
+ width?: number;
1993
+ height?: number;
1994
+ highlighted?: boolean;
1995
+ parentContainerId: string;
1996
+ }
1997
+ export var GraphNode: React.FC<IGraphNodeProps>;
1998
+
1999
+
2000
+
2001
+ }
2002
+ declare module BABYLON.NodeEditor {
2003
+
2004
+ }
2005
+ declare module BABYLON.NodeEditor.SharedUIComponents {
2006
+ export interface IGraphContainerProps {
2007
+ onNodeMoved: (id: string, x: number, y: number) => void;
2008
+ id: string;
2009
+ }
2010
+ /**
2011
+ * This component contains all the nodes and handles their dragging
2012
+ */
2013
+ export var GraphNodesContainer: React.FC<IGraphContainerProps>;
2014
+
2015
+
2016
+
2017
+ }
2018
+ declare module BABYLON.NodeEditor {
2019
+
2020
+ }
2021
+ declare module BABYLON.NodeEditor.SharedUIComponents {
2022
+ export type IVisualRecordsType = Record<string, {
2023
+ x: number;
2024
+ y: number;
2025
+ }>;
2026
+ export type IConnectionType = {
2027
+ id: string;
2028
+ sourceId: string;
2029
+ targetId: string;
2030
+ };
2031
+ export type ICustomDataType = {
2032
+ type: string;
2033
+ value: any;
2034
+ };
2035
+ export type INodeType = {
2036
+ id: string;
2037
+ label: string;
2038
+ customData?: ICustomDataType;
2039
+ };
2040
+ /**
2041
+ * props for the node renderer
2042
+ */
2043
+ export interface INodeRendererProps {
2044
+ /**
2045
+ * array of connections between nodes
2046
+ */
2047
+ connections: IConnectionType[];
2048
+ /**
2049
+ * function called when a new connection is created
2050
+ */
2051
+ updateConnections: (sourceId: string, targetId: string) => void;
2052
+ /**
2053
+ * function called when a connection is deleted
2054
+ */
2055
+ deleteLine: (lineId: string) => void;
2056
+ /**
2057
+ * function called when a node is deleted
2058
+ */
2059
+ deleteNode: (nodeId: string) => void;
2060
+ /**
2061
+ * array of all nodes
2062
+ */
2063
+ nodes: INodeType[];
2064
+ /**
2065
+ * id of the node to highlight
2066
+ */
2067
+ highlightedNode?: BABYLON.Nullable<string>;
2068
+ /**
2069
+ * function to be called if a node is selected
2070
+ */
2071
+ selectNode?: (nodeId: BABYLON.Nullable<string>) => void;
2072
+ /**
2073
+ * id of this renderer
2074
+ */
2075
+ id: string;
2076
+ /**
2077
+ * optional list of custom components to be rendered inside nodes of
2078
+ * a certain type
2079
+ */
2080
+ customComponents?: Record<string, React.ComponentType<any>>;
2081
+ }
2082
+ /**
2083
+ * This component is a bridge between the app logic related to the graph, and the actual rendering
2084
+ * of it. It manages the nodes' positions and selection states.
2085
+ * @param props
2086
+ * @returns
2087
+ */
2088
+ export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
2089
+
2090
+
2091
+
2092
+ }
2093
+ declare module BABYLON.NodeEditor {
2094
+
2095
+ }
2096
+ declare module BABYLON.NodeEditor.SharedUIComponents {
2097
+ /**
2098
+ * utility hook to assist using the graph context
2099
+ * @returns
2100
+ */
2101
+ export const useGraphContext: () => IGraphContext;
2102
+
2103
+
2104
+
1826
2105
  }
1827
2106
  declare module BABYLON.NodeEditor {
1828
2107
 
@@ -1893,7 +1893,7 @@ export enum ResizeDirections {
1893
1893
 
1894
1894
  }
1895
1895
  declare module "babylonjs-node-editor/components/layout/utils" {
1896
- import { Layout } from "babylonjs-node-editor/components/layout/types";
1896
+ import { Layout, LayoutColumn, LayoutTabsRow } from "babylonjs-node-editor/components/layout/types";
1897
1897
  /**
1898
1898
  * Given a column and row number in the layout, return the corresponding column/row
1899
1899
  * @param layout
@@ -1901,7 +1901,7 @@ import { Layout } from "babylonjs-node-editor/components/layout/types";
1901
1901
  * @param row
1902
1902
  * @returns
1903
1903
  */
1904
- export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => import("babylonjs-node-editor/components/layout/types").LayoutTabsRow | import("./types").LayoutColumn;
1904
+ export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => LayoutColumn | LayoutTabsRow;
1905
1905
  /**
1906
1906
  * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1907
1907
  * @param layout
@@ -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/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" />
@@ -5640,7 +5882,7 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
5640
5882
  * @param row
5641
5883
  * @returns
5642
5884
  */
5643
- export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
5885
+ export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => BABYLON.NodeEditor.SharedUIComponents.LayoutColumn | BABYLON.NodeEditor.SharedUIComponents.LayoutTabsRow;
5644
5886
  /**
5645
5887
  * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
5646
5888
  * @param layout
@@ -5840,6 +6082,285 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
5840
6082
 
5841
6083
 
5842
6084
 
6085
+ }
6086
+ declare module BABYLON.NodeEditor {
6087
+
6088
+ }
6089
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6090
+ /**
6091
+ * Props for the connector
6092
+ */
6093
+ export interface IGraphConnectorHandlerProps {
6094
+ /**
6095
+ * id of the parent node
6096
+ */
6097
+ parentId: string;
6098
+ /**
6099
+ * x position of the parent node
6100
+ */
6101
+ parentX: number;
6102
+ /**
6103
+ * y position of the parent node
6104
+ */
6105
+ parentY: number;
6106
+ /**
6107
+ * x position of the connector relative to the parent node
6108
+ */
6109
+ offsetX?: number;
6110
+ /**
6111
+ * y position of the connector relative to the parent node
6112
+ */
6113
+ offsetY?: number;
6114
+ /**
6115
+ * width of the parent node
6116
+ */
6117
+ parentWidth: number;
6118
+ /**
6119
+ * height of the parent node
6120
+ */
6121
+ parentHeight: number;
6122
+ /**
6123
+ * id of the container where its parent node is
6124
+ */
6125
+ parentContainerId: string;
6126
+ }
6127
+ /**
6128
+ * This component is used to initiate a connection between two nodes. Simply
6129
+ * drag the handle in a node and drop it in another node to create a connection.
6130
+ */
6131
+ export var GraphConnectorHandler: React.FC<IGraphConnectorHandlerProps>;
6132
+
6133
+
6134
+
6135
+ }
6136
+ declare module BABYLON.NodeEditor {
6137
+
6138
+ }
6139
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6140
+ export interface IGraphContainerProps {
6141
+ }
6142
+ /**
6143
+ * This component is just a simple container to keep the nodes and lines containers
6144
+ * together
6145
+ * @param props
6146
+ * @returns
6147
+ */
6148
+ export var GraphContainer: React.FC<IGraphContainerProps>;
6149
+
6150
+
6151
+
6152
+ }
6153
+ declare module BABYLON.NodeEditor {
6154
+
6155
+ }
6156
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6157
+ /// <reference types="react" />
6158
+ /**
6159
+ * this context is used to pass callbacks to the graph nodes and connections
6160
+ */
6161
+ export interface IGraphContext {
6162
+ onNodesConnected?: (sourceId: string, targetId: string) => void;
6163
+ onLineSelected?: (lineId: string) => void;
6164
+ onNodeSelected?: (nodeId: string) => void;
6165
+ }
6166
+ export var GraphContextManager: import("react").Context<IGraphContext>;
6167
+
6168
+
6169
+
6170
+ }
6171
+ declare module BABYLON.NodeEditor {
6172
+
6173
+ }
6174
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6175
+ /**
6176
+ * props for the GraphLine component
6177
+ */
6178
+ export interface IGraphLineProps {
6179
+ /**
6180
+ * id of the line. temporary lines can have no id
6181
+ */
6182
+ id?: string;
6183
+ /**
6184
+ * starting x pos of the line
6185
+ */
6186
+ x1: number;
6187
+ /**
6188
+ * ending x pos of the line
6189
+ */
6190
+ x2: number;
6191
+ /**
6192
+ * starting y pos of the line
6193
+ */
6194
+ y1: number;
6195
+ /**
6196
+ * ending y pos of the line
6197
+ */
6198
+ y2: number;
6199
+ /**
6200
+ * is the line selected
6201
+ */
6202
+ selected?: boolean;
6203
+ /**
6204
+ * does the line have a direction
6205
+ */
6206
+ directional?: boolean;
6207
+ }
6208
+ export const MarkerArrowId = "arrow";
6209
+ /**
6210
+ * This component draws a SVG line between two points, with an optional marker
6211
+ * indicating direction
6212
+ */
6213
+ export var GraphLine: React.FC<IGraphLineProps>;
6214
+
6215
+
6216
+
6217
+ }
6218
+ declare module BABYLON.NodeEditor {
6219
+
6220
+ }
6221
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6222
+ /**
6223
+ * props for the GraphLineContainer
6224
+ */
6225
+ export interface IGraphLinesContainerProps {
6226
+ /**
6227
+ * id of the container
6228
+ */
6229
+ id: string;
6230
+ }
6231
+ /**
6232
+ * this component handles the dragging of new connections
6233
+ * @param props
6234
+ * @returns
6235
+ */
6236
+ export var GraphLinesContainer: React.FC<IGraphLinesContainerProps>;
6237
+
6238
+
6239
+
6240
+ }
6241
+ declare module BABYLON.NodeEditor {
6242
+
6243
+ }
6244
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6245
+ export interface IGraphNodeProps {
6246
+ id: string;
6247
+ name: string;
6248
+ x: number;
6249
+ y: number;
6250
+ selected?: boolean;
6251
+ width?: number;
6252
+ height?: number;
6253
+ highlighted?: boolean;
6254
+ parentContainerId: string;
6255
+ }
6256
+ export var GraphNode: React.FC<IGraphNodeProps>;
6257
+
6258
+
6259
+
6260
+ }
6261
+ declare module BABYLON.NodeEditor {
6262
+
6263
+ }
6264
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6265
+ export interface IGraphContainerProps {
6266
+ onNodeMoved: (id: string, x: number, y: number) => void;
6267
+ id: string;
6268
+ }
6269
+ /**
6270
+ * This component contains all the nodes and handles their dragging
6271
+ */
6272
+ export var GraphNodesContainer: React.FC<IGraphContainerProps>;
6273
+
6274
+
6275
+
6276
+ }
6277
+ declare module BABYLON.NodeEditor {
6278
+
6279
+ }
6280
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6281
+ export type IVisualRecordsType = Record<string, {
6282
+ x: number;
6283
+ y: number;
6284
+ }>;
6285
+ export type IConnectionType = {
6286
+ id: string;
6287
+ sourceId: string;
6288
+ targetId: string;
6289
+ };
6290
+ export type ICustomDataType = {
6291
+ type: string;
6292
+ value: any;
6293
+ };
6294
+ export type INodeType = {
6295
+ id: string;
6296
+ label: string;
6297
+ customData?: ICustomDataType;
6298
+ };
6299
+ /**
6300
+ * props for the node renderer
6301
+ */
6302
+ export interface INodeRendererProps {
6303
+ /**
6304
+ * array of connections between nodes
6305
+ */
6306
+ connections: IConnectionType[];
6307
+ /**
6308
+ * function called when a new connection is created
6309
+ */
6310
+ updateConnections: (sourceId: string, targetId: string) => void;
6311
+ /**
6312
+ * function called when a connection is deleted
6313
+ */
6314
+ deleteLine: (lineId: string) => void;
6315
+ /**
6316
+ * function called when a node is deleted
6317
+ */
6318
+ deleteNode: (nodeId: string) => void;
6319
+ /**
6320
+ * array of all nodes
6321
+ */
6322
+ nodes: INodeType[];
6323
+ /**
6324
+ * id of the node to highlight
6325
+ */
6326
+ highlightedNode?: BABYLON.Nullable<string>;
6327
+ /**
6328
+ * function to be called if a node is selected
6329
+ */
6330
+ selectNode?: (nodeId: BABYLON.Nullable<string>) => void;
6331
+ /**
6332
+ * id of this renderer
6333
+ */
6334
+ id: string;
6335
+ /**
6336
+ * optional list of custom components to be rendered inside nodes of
6337
+ * a certain type
6338
+ */
6339
+ customComponents?: Record<string, React.ComponentType<any>>;
6340
+ }
6341
+ /**
6342
+ * This component is a bridge between the app logic related to the graph, and the actual rendering
6343
+ * of it. It manages the nodes' positions and selection states.
6344
+ * @param props
6345
+ * @returns
6346
+ */
6347
+ export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
6348
+
6349
+
6350
+
6351
+ }
6352
+ declare module BABYLON.NodeEditor {
6353
+
6354
+ }
6355
+ declare module BABYLON.NodeEditor.SharedUIComponents {
6356
+ /**
6357
+ * utility hook to assist using the graph context
6358
+ * @returns
6359
+ */
6360
+ export const useGraphContext: () => IGraphContext;
6361
+
6362
+
6363
+
5843
6364
  }
5844
6365
  declare module BABYLON.NodeEditor {
5845
6366
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-node-editor",
3
- "version": "5.32.1",
3
+ "version": "5.33.0",
4
4
  "main": "babylon.nodeEditor.js",
5
5
  "types": "babylon.nodeEditor.module.d.ts",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "clean": "rimraf dist && rimraf babylon*.*"
15
15
  },
16
16
  "dependencies": {
17
- "babylonjs": "^5.32.1"
17
+ "babylonjs": "^5.33.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@dev/build-tools": "1.0.0",