babylonjs-gui-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.
- package/babylon.guiEditor.d.ts +280 -1
- package/babylon.guiEditor.module.d.ts +524 -3
- package/package.json +3 -3
package/babylon.guiEditor.d.ts
CHANGED
|
@@ -1834,7 +1834,7 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
|
1834
1834
|
* @param row
|
|
1835
1835
|
* @returns
|
|
1836
1836
|
*/
|
|
1837
|
-
export const getPosInLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
|
|
1837
|
+
export const getPosInLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => BABYLON.GuiEditor.SharedUIComponents.LayoutColumn | BABYLON.GuiEditor.SharedUIComponents.LayoutTabsRow;
|
|
1838
1838
|
/**
|
|
1839
1839
|
* Remove a row in position row, column from the layout, and redistribute heights of remaining rows
|
|
1840
1840
|
* @param layout
|
|
@@ -2034,6 +2034,285 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
|
2034
2034
|
|
|
2035
2035
|
|
|
2036
2036
|
|
|
2037
|
+
}
|
|
2038
|
+
declare module BABYLON {
|
|
2039
|
+
|
|
2040
|
+
}
|
|
2041
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2042
|
+
/**
|
|
2043
|
+
* Props for the connector
|
|
2044
|
+
*/
|
|
2045
|
+
export interface IGraphConnectorHandlerProps {
|
|
2046
|
+
/**
|
|
2047
|
+
* id of the parent node
|
|
2048
|
+
*/
|
|
2049
|
+
parentId: string;
|
|
2050
|
+
/**
|
|
2051
|
+
* x position of the parent node
|
|
2052
|
+
*/
|
|
2053
|
+
parentX: number;
|
|
2054
|
+
/**
|
|
2055
|
+
* y position of the parent node
|
|
2056
|
+
*/
|
|
2057
|
+
parentY: number;
|
|
2058
|
+
/**
|
|
2059
|
+
* x position of the connector relative to the parent node
|
|
2060
|
+
*/
|
|
2061
|
+
offsetX?: number;
|
|
2062
|
+
/**
|
|
2063
|
+
* y position of the connector relative to the parent node
|
|
2064
|
+
*/
|
|
2065
|
+
offsetY?: number;
|
|
2066
|
+
/**
|
|
2067
|
+
* width of the parent node
|
|
2068
|
+
*/
|
|
2069
|
+
parentWidth: number;
|
|
2070
|
+
/**
|
|
2071
|
+
* height of the parent node
|
|
2072
|
+
*/
|
|
2073
|
+
parentHeight: number;
|
|
2074
|
+
/**
|
|
2075
|
+
* id of the container where its parent node is
|
|
2076
|
+
*/
|
|
2077
|
+
parentContainerId: string;
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* This component is used to initiate a connection between two nodes. Simply
|
|
2081
|
+
* drag the handle in a node and drop it in another node to create a connection.
|
|
2082
|
+
*/
|
|
2083
|
+
export var GraphConnectorHandler: React.FC<IGraphConnectorHandlerProps>;
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
|
|
2087
|
+
}
|
|
2088
|
+
declare module BABYLON {
|
|
2089
|
+
|
|
2090
|
+
}
|
|
2091
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2092
|
+
export interface IGraphContainerProps {
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* This component is just a simple container to keep the nodes and lines containers
|
|
2096
|
+
* together
|
|
2097
|
+
* @param props
|
|
2098
|
+
* @returns
|
|
2099
|
+
*/
|
|
2100
|
+
export var GraphContainer: React.FC<IGraphContainerProps>;
|
|
2101
|
+
|
|
2102
|
+
|
|
2103
|
+
|
|
2104
|
+
}
|
|
2105
|
+
declare module BABYLON {
|
|
2106
|
+
|
|
2107
|
+
}
|
|
2108
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2109
|
+
/// <reference types="react" />
|
|
2110
|
+
/**
|
|
2111
|
+
* this context is used to pass callbacks to the graph nodes and connections
|
|
2112
|
+
*/
|
|
2113
|
+
export interface IGraphContext {
|
|
2114
|
+
onNodesConnected?: (sourceId: string, targetId: string) => void;
|
|
2115
|
+
onLineSelected?: (lineId: string) => void;
|
|
2116
|
+
onNodeSelected?: (nodeId: string) => void;
|
|
2117
|
+
}
|
|
2118
|
+
export var GraphContextManager: import("react").Context<IGraphContext>;
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
|
|
2122
|
+
}
|
|
2123
|
+
declare module BABYLON {
|
|
2124
|
+
|
|
2125
|
+
}
|
|
2126
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2127
|
+
/**
|
|
2128
|
+
* props for the GraphLine component
|
|
2129
|
+
*/
|
|
2130
|
+
export interface IGraphLineProps {
|
|
2131
|
+
/**
|
|
2132
|
+
* id of the line. temporary lines can have no id
|
|
2133
|
+
*/
|
|
2134
|
+
id?: string;
|
|
2135
|
+
/**
|
|
2136
|
+
* starting x pos of the line
|
|
2137
|
+
*/
|
|
2138
|
+
x1: number;
|
|
2139
|
+
/**
|
|
2140
|
+
* ending x pos of the line
|
|
2141
|
+
*/
|
|
2142
|
+
x2: number;
|
|
2143
|
+
/**
|
|
2144
|
+
* starting y pos of the line
|
|
2145
|
+
*/
|
|
2146
|
+
y1: number;
|
|
2147
|
+
/**
|
|
2148
|
+
* ending y pos of the line
|
|
2149
|
+
*/
|
|
2150
|
+
y2: number;
|
|
2151
|
+
/**
|
|
2152
|
+
* is the line selected
|
|
2153
|
+
*/
|
|
2154
|
+
selected?: boolean;
|
|
2155
|
+
/**
|
|
2156
|
+
* does the line have a direction
|
|
2157
|
+
*/
|
|
2158
|
+
directional?: boolean;
|
|
2159
|
+
}
|
|
2160
|
+
export const MarkerArrowId = "arrow";
|
|
2161
|
+
/**
|
|
2162
|
+
* This component draws a SVG line between two points, with an optional marker
|
|
2163
|
+
* indicating direction
|
|
2164
|
+
*/
|
|
2165
|
+
export var GraphLine: React.FC<IGraphLineProps>;
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
}
|
|
2170
|
+
declare module BABYLON {
|
|
2171
|
+
|
|
2172
|
+
}
|
|
2173
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2174
|
+
/**
|
|
2175
|
+
* props for the GraphLineContainer
|
|
2176
|
+
*/
|
|
2177
|
+
export interface IGraphLinesContainerProps {
|
|
2178
|
+
/**
|
|
2179
|
+
* id of the container
|
|
2180
|
+
*/
|
|
2181
|
+
id: string;
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* this component handles the dragging of new connections
|
|
2185
|
+
* @param props
|
|
2186
|
+
* @returns
|
|
2187
|
+
*/
|
|
2188
|
+
export var GraphLinesContainer: React.FC<IGraphLinesContainerProps>;
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
|
|
2192
|
+
}
|
|
2193
|
+
declare module BABYLON {
|
|
2194
|
+
|
|
2195
|
+
}
|
|
2196
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2197
|
+
export interface IGraphNodeProps {
|
|
2198
|
+
id: string;
|
|
2199
|
+
name: string;
|
|
2200
|
+
x: number;
|
|
2201
|
+
y: number;
|
|
2202
|
+
selected?: boolean;
|
|
2203
|
+
width?: number;
|
|
2204
|
+
height?: number;
|
|
2205
|
+
highlighted?: boolean;
|
|
2206
|
+
parentContainerId: string;
|
|
2207
|
+
}
|
|
2208
|
+
export var GraphNode: React.FC<IGraphNodeProps>;
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
}
|
|
2213
|
+
declare module BABYLON {
|
|
2214
|
+
|
|
2215
|
+
}
|
|
2216
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2217
|
+
export interface IGraphContainerProps {
|
|
2218
|
+
onNodeMoved: (id: string, x: number, y: number) => void;
|
|
2219
|
+
id: string;
|
|
2220
|
+
}
|
|
2221
|
+
/**
|
|
2222
|
+
* This component contains all the nodes and handles their dragging
|
|
2223
|
+
*/
|
|
2224
|
+
export var GraphNodesContainer: React.FC<IGraphContainerProps>;
|
|
2225
|
+
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
}
|
|
2229
|
+
declare module BABYLON {
|
|
2230
|
+
|
|
2231
|
+
}
|
|
2232
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2233
|
+
export type IVisualRecordsType = Record<string, {
|
|
2234
|
+
x: number;
|
|
2235
|
+
y: number;
|
|
2236
|
+
}>;
|
|
2237
|
+
export type IConnectionType = {
|
|
2238
|
+
id: string;
|
|
2239
|
+
sourceId: string;
|
|
2240
|
+
targetId: string;
|
|
2241
|
+
};
|
|
2242
|
+
export type ICustomDataType = {
|
|
2243
|
+
type: string;
|
|
2244
|
+
value: any;
|
|
2245
|
+
};
|
|
2246
|
+
export type INodeType = {
|
|
2247
|
+
id: string;
|
|
2248
|
+
label: string;
|
|
2249
|
+
customData?: ICustomDataType;
|
|
2250
|
+
};
|
|
2251
|
+
/**
|
|
2252
|
+
* props for the node renderer
|
|
2253
|
+
*/
|
|
2254
|
+
export interface INodeRendererProps {
|
|
2255
|
+
/**
|
|
2256
|
+
* array of connections between nodes
|
|
2257
|
+
*/
|
|
2258
|
+
connections: IConnectionType[];
|
|
2259
|
+
/**
|
|
2260
|
+
* function called when a new connection is created
|
|
2261
|
+
*/
|
|
2262
|
+
updateConnections: (sourceId: string, targetId: string) => void;
|
|
2263
|
+
/**
|
|
2264
|
+
* function called when a connection is deleted
|
|
2265
|
+
*/
|
|
2266
|
+
deleteLine: (lineId: string) => void;
|
|
2267
|
+
/**
|
|
2268
|
+
* function called when a node is deleted
|
|
2269
|
+
*/
|
|
2270
|
+
deleteNode: (nodeId: string) => void;
|
|
2271
|
+
/**
|
|
2272
|
+
* array of all nodes
|
|
2273
|
+
*/
|
|
2274
|
+
nodes: INodeType[];
|
|
2275
|
+
/**
|
|
2276
|
+
* id of the node to highlight
|
|
2277
|
+
*/
|
|
2278
|
+
highlightedNode?: Nullable<string>;
|
|
2279
|
+
/**
|
|
2280
|
+
* function to be called if a node is selected
|
|
2281
|
+
*/
|
|
2282
|
+
selectNode?: (nodeId: Nullable<string>) => void;
|
|
2283
|
+
/**
|
|
2284
|
+
* id of this renderer
|
|
2285
|
+
*/
|
|
2286
|
+
id: string;
|
|
2287
|
+
/**
|
|
2288
|
+
* optional list of custom components to be rendered inside nodes of
|
|
2289
|
+
* a certain type
|
|
2290
|
+
*/
|
|
2291
|
+
customComponents?: Record<string, React.ComponentType<any>>;
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* This component is a bridge between the app logic related to the graph, and the actual rendering
|
|
2295
|
+
* of it. It manages the nodes' positions and selection states.
|
|
2296
|
+
* @param props
|
|
2297
|
+
* @returns
|
|
2298
|
+
*/
|
|
2299
|
+
export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
}
|
|
2304
|
+
declare module BABYLON {
|
|
2305
|
+
|
|
2306
|
+
}
|
|
2307
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
2308
|
+
/**
|
|
2309
|
+
* utility hook to assist using the graph context
|
|
2310
|
+
* @returns
|
|
2311
|
+
*/
|
|
2312
|
+
export const useGraphContext: () => IGraphContext;
|
|
2313
|
+
|
|
2314
|
+
|
|
2315
|
+
|
|
2037
2316
|
}
|
|
2038
2317
|
declare module BABYLON {
|
|
2039
2318
|
|
|
@@ -2065,7 +2065,7 @@ export enum ResizeDirections {
|
|
|
2065
2065
|
|
|
2066
2066
|
}
|
|
2067
2067
|
declare module "babylonjs-gui-editor/components/layout/utils" {
|
|
2068
|
-
import { Layout } from "babylonjs-gui-editor/components/layout/types";
|
|
2068
|
+
import { Layout, LayoutColumn, LayoutTabsRow } from "babylonjs-gui-editor/components/layout/types";
|
|
2069
2069
|
/**
|
|
2070
2070
|
* Given a column and row number in the layout, return the corresponding column/row
|
|
2071
2071
|
* @param layout
|
|
@@ -2073,7 +2073,7 @@ import { Layout } from "babylonjs-gui-editor/components/layout/types";
|
|
|
2073
2073
|
* @param row
|
|
2074
2074
|
* @returns
|
|
2075
2075
|
*/
|
|
2076
|
-
export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) =>
|
|
2076
|
+
export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => LayoutColumn | LayoutTabsRow;
|
|
2077
2077
|
/**
|
|
2078
2078
|
* Remove a row in position row, column from the layout, and redistribute heights of remaining rows
|
|
2079
2079
|
* @param layout
|
|
@@ -2256,6 +2256,248 @@ export interface MessageDialogProps {
|
|
|
2256
2256
|
}
|
|
2257
2257
|
export const MessageDialog: React.FC<MessageDialogProps>;
|
|
2258
2258
|
|
|
2259
|
+
}
|
|
2260
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphConnectorHandle" {
|
|
2261
|
+
import { FC } from "react";
|
|
2262
|
+
/**
|
|
2263
|
+
* Props for the connector
|
|
2264
|
+
*/
|
|
2265
|
+
export interface IGraphConnectorHandlerProps {
|
|
2266
|
+
/**
|
|
2267
|
+
* id of the parent node
|
|
2268
|
+
*/
|
|
2269
|
+
parentId: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* x position of the parent node
|
|
2272
|
+
*/
|
|
2273
|
+
parentX: number;
|
|
2274
|
+
/**
|
|
2275
|
+
* y position of the parent node
|
|
2276
|
+
*/
|
|
2277
|
+
parentY: number;
|
|
2278
|
+
/**
|
|
2279
|
+
* x position of the connector relative to the parent node
|
|
2280
|
+
*/
|
|
2281
|
+
offsetX?: number;
|
|
2282
|
+
/**
|
|
2283
|
+
* y position of the connector relative to the parent node
|
|
2284
|
+
*/
|
|
2285
|
+
offsetY?: number;
|
|
2286
|
+
/**
|
|
2287
|
+
* width of the parent node
|
|
2288
|
+
*/
|
|
2289
|
+
parentWidth: number;
|
|
2290
|
+
/**
|
|
2291
|
+
* height of the parent node
|
|
2292
|
+
*/
|
|
2293
|
+
parentHeight: number;
|
|
2294
|
+
/**
|
|
2295
|
+
* id of the container where its parent node is
|
|
2296
|
+
*/
|
|
2297
|
+
parentContainerId: string;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* This component is used to initiate a connection between two nodes. Simply
|
|
2301
|
+
* drag the handle in a node and drop it in another node to create a connection.
|
|
2302
|
+
*/
|
|
2303
|
+
export const GraphConnectorHandler: FC<IGraphConnectorHandlerProps>;
|
|
2304
|
+
|
|
2305
|
+
}
|
|
2306
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphContainer" {
|
|
2307
|
+
import { FC } from "react";
|
|
2308
|
+
export interface IGraphContainerProps {
|
|
2309
|
+
}
|
|
2310
|
+
/**
|
|
2311
|
+
* This component is just a simple container to keep the nodes and lines containers
|
|
2312
|
+
* together
|
|
2313
|
+
* @param props
|
|
2314
|
+
* @returns
|
|
2315
|
+
*/
|
|
2316
|
+
export const GraphContainer: FC<IGraphContainerProps>;
|
|
2317
|
+
|
|
2318
|
+
}
|
|
2319
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphContextManager" {
|
|
2320
|
+
/// <reference types="react" />
|
|
2321
|
+
/**
|
|
2322
|
+
* this context is used to pass callbacks to the graph nodes and connections
|
|
2323
|
+
*/
|
|
2324
|
+
export interface IGraphContext {
|
|
2325
|
+
onNodesConnected?: (sourceId: string, targetId: string) => void;
|
|
2326
|
+
onLineSelected?: (lineId: string) => void;
|
|
2327
|
+
onNodeSelected?: (nodeId: string) => void;
|
|
2328
|
+
}
|
|
2329
|
+
export const GraphContextManager: import("react").Context<IGraphContext>;
|
|
2330
|
+
|
|
2331
|
+
}
|
|
2332
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphLine" {
|
|
2333
|
+
import { FC } from "react";
|
|
2334
|
+
/**
|
|
2335
|
+
* props for the GraphLine component
|
|
2336
|
+
*/
|
|
2337
|
+
export interface IGraphLineProps {
|
|
2338
|
+
/**
|
|
2339
|
+
* id of the line. temporary lines can have no id
|
|
2340
|
+
*/
|
|
2341
|
+
id?: string;
|
|
2342
|
+
/**
|
|
2343
|
+
* starting x pos of the line
|
|
2344
|
+
*/
|
|
2345
|
+
x1: number;
|
|
2346
|
+
/**
|
|
2347
|
+
* ending x pos of the line
|
|
2348
|
+
*/
|
|
2349
|
+
x2: number;
|
|
2350
|
+
/**
|
|
2351
|
+
* starting y pos of the line
|
|
2352
|
+
*/
|
|
2353
|
+
y1: number;
|
|
2354
|
+
/**
|
|
2355
|
+
* ending y pos of the line
|
|
2356
|
+
*/
|
|
2357
|
+
y2: number;
|
|
2358
|
+
/**
|
|
2359
|
+
* is the line selected
|
|
2360
|
+
*/
|
|
2361
|
+
selected?: boolean;
|
|
2362
|
+
/**
|
|
2363
|
+
* does the line have a direction
|
|
2364
|
+
*/
|
|
2365
|
+
directional?: boolean;
|
|
2366
|
+
}
|
|
2367
|
+
export const MarkerArrowId = "arrow";
|
|
2368
|
+
/**
|
|
2369
|
+
* This component draws a SVG line between two points, with an optional marker
|
|
2370
|
+
* indicating direction
|
|
2371
|
+
*/
|
|
2372
|
+
export const GraphLine: FC<IGraphLineProps>;
|
|
2373
|
+
|
|
2374
|
+
}
|
|
2375
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphLinesContainer" {
|
|
2376
|
+
import { FC } from "react";
|
|
2377
|
+
/**
|
|
2378
|
+
* props for the GraphLineContainer
|
|
2379
|
+
*/
|
|
2380
|
+
export interface IGraphLinesContainerProps {
|
|
2381
|
+
/**
|
|
2382
|
+
* id of the container
|
|
2383
|
+
*/
|
|
2384
|
+
id: string;
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* this component handles the dragging of new connections
|
|
2388
|
+
* @param props
|
|
2389
|
+
* @returns
|
|
2390
|
+
*/
|
|
2391
|
+
export const GraphLinesContainer: FC<IGraphLinesContainerProps>;
|
|
2392
|
+
|
|
2393
|
+
}
|
|
2394
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphNode" {
|
|
2395
|
+
import { FC } from "react";
|
|
2396
|
+
export interface IGraphNodeProps {
|
|
2397
|
+
id: string;
|
|
2398
|
+
name: string;
|
|
2399
|
+
x: number;
|
|
2400
|
+
y: number;
|
|
2401
|
+
selected?: boolean;
|
|
2402
|
+
width?: number;
|
|
2403
|
+
height?: number;
|
|
2404
|
+
highlighted?: boolean;
|
|
2405
|
+
parentContainerId: string;
|
|
2406
|
+
}
|
|
2407
|
+
export const GraphNode: FC<IGraphNodeProps>;
|
|
2408
|
+
|
|
2409
|
+
}
|
|
2410
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/GraphNodesContainer" {
|
|
2411
|
+
import { FC } from "react";
|
|
2412
|
+
export interface IGraphContainerProps {
|
|
2413
|
+
onNodeMoved: (id: string, x: number, y: number) => void;
|
|
2414
|
+
id: string;
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* This component contains all the nodes and handles their dragging
|
|
2418
|
+
*/
|
|
2419
|
+
export const GraphNodesContainer: FC<IGraphContainerProps>;
|
|
2420
|
+
|
|
2421
|
+
}
|
|
2422
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/NodeRenderer" {
|
|
2423
|
+
import { ComponentType } from "react";
|
|
2424
|
+
import { Nullable } from "babylonjs/types";
|
|
2425
|
+
export type IVisualRecordsType = Record<string, {
|
|
2426
|
+
x: number;
|
|
2427
|
+
y: number;
|
|
2428
|
+
}>;
|
|
2429
|
+
export type IConnectionType = {
|
|
2430
|
+
id: string;
|
|
2431
|
+
sourceId: string;
|
|
2432
|
+
targetId: string;
|
|
2433
|
+
};
|
|
2434
|
+
export type ICustomDataType = {
|
|
2435
|
+
type: string;
|
|
2436
|
+
value: any;
|
|
2437
|
+
};
|
|
2438
|
+
export type INodeType = {
|
|
2439
|
+
id: string;
|
|
2440
|
+
label: string;
|
|
2441
|
+
customData?: ICustomDataType;
|
|
2442
|
+
};
|
|
2443
|
+
/**
|
|
2444
|
+
* props for the node renderer
|
|
2445
|
+
*/
|
|
2446
|
+
export interface INodeRendererProps {
|
|
2447
|
+
/**
|
|
2448
|
+
* array of connections between nodes
|
|
2449
|
+
*/
|
|
2450
|
+
connections: IConnectionType[];
|
|
2451
|
+
/**
|
|
2452
|
+
* function called when a new connection is created
|
|
2453
|
+
*/
|
|
2454
|
+
updateConnections: (sourceId: string, targetId: string) => void;
|
|
2455
|
+
/**
|
|
2456
|
+
* function called when a connection is deleted
|
|
2457
|
+
*/
|
|
2458
|
+
deleteLine: (lineId: string) => void;
|
|
2459
|
+
/**
|
|
2460
|
+
* function called when a node is deleted
|
|
2461
|
+
*/
|
|
2462
|
+
deleteNode: (nodeId: string) => void;
|
|
2463
|
+
/**
|
|
2464
|
+
* array of all nodes
|
|
2465
|
+
*/
|
|
2466
|
+
nodes: INodeType[];
|
|
2467
|
+
/**
|
|
2468
|
+
* id of the node to highlight
|
|
2469
|
+
*/
|
|
2470
|
+
highlightedNode?: Nullable<string>;
|
|
2471
|
+
/**
|
|
2472
|
+
* function to be called if a node is selected
|
|
2473
|
+
*/
|
|
2474
|
+
selectNode?: (nodeId: Nullable<string>) => void;
|
|
2475
|
+
/**
|
|
2476
|
+
* id of this renderer
|
|
2477
|
+
*/
|
|
2478
|
+
id: string;
|
|
2479
|
+
/**
|
|
2480
|
+
* optional list of custom components to be rendered inside nodes of
|
|
2481
|
+
* a certain type
|
|
2482
|
+
*/
|
|
2483
|
+
customComponents?: Record<string, ComponentType<any>>;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* This component is a bridge between the app logic related to the graph, and the actual rendering
|
|
2487
|
+
* of it. It manages the nodes' positions and selection states.
|
|
2488
|
+
* @param props
|
|
2489
|
+
* @returns
|
|
2490
|
+
*/
|
|
2491
|
+
export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
|
|
2492
|
+
|
|
2493
|
+
}
|
|
2494
|
+
declare module "babylonjs-gui-editor/components/reactGraphSystem/useGraphContext" {
|
|
2495
|
+
/**
|
|
2496
|
+
* utility hook to assist using the graph context
|
|
2497
|
+
* @returns
|
|
2498
|
+
*/
|
|
2499
|
+
export const useGraphContext: () => import("babylonjs-gui-editor/components/reactGraphSystem/GraphContextManager").IGraphContext;
|
|
2500
|
+
|
|
2259
2501
|
}
|
|
2260
2502
|
declare module "babylonjs-gui-editor/components/TextInputWithSubmit" {
|
|
2261
2503
|
/// <reference types="react" />
|
|
@@ -6182,7 +6424,7 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
|
6182
6424
|
* @param row
|
|
6183
6425
|
* @returns
|
|
6184
6426
|
*/
|
|
6185
|
-
export const getPosInLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
|
|
6427
|
+
export const getPosInLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => BABYLON.GuiEditor.SharedUIComponents.LayoutColumn | BABYLON.GuiEditor.SharedUIComponents.LayoutTabsRow;
|
|
6186
6428
|
/**
|
|
6187
6429
|
* Remove a row in position row, column from the layout, and redistribute heights of remaining rows
|
|
6188
6430
|
* @param layout
|
|
@@ -6382,6 +6624,285 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
|
6382
6624
|
|
|
6383
6625
|
|
|
6384
6626
|
|
|
6627
|
+
}
|
|
6628
|
+
declare module BABYLON {
|
|
6629
|
+
|
|
6630
|
+
}
|
|
6631
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6632
|
+
/**
|
|
6633
|
+
* Props for the connector
|
|
6634
|
+
*/
|
|
6635
|
+
export interface IGraphConnectorHandlerProps {
|
|
6636
|
+
/**
|
|
6637
|
+
* id of the parent node
|
|
6638
|
+
*/
|
|
6639
|
+
parentId: string;
|
|
6640
|
+
/**
|
|
6641
|
+
* x position of the parent node
|
|
6642
|
+
*/
|
|
6643
|
+
parentX: number;
|
|
6644
|
+
/**
|
|
6645
|
+
* y position of the parent node
|
|
6646
|
+
*/
|
|
6647
|
+
parentY: number;
|
|
6648
|
+
/**
|
|
6649
|
+
* x position of the connector relative to the parent node
|
|
6650
|
+
*/
|
|
6651
|
+
offsetX?: number;
|
|
6652
|
+
/**
|
|
6653
|
+
* y position of the connector relative to the parent node
|
|
6654
|
+
*/
|
|
6655
|
+
offsetY?: number;
|
|
6656
|
+
/**
|
|
6657
|
+
* width of the parent node
|
|
6658
|
+
*/
|
|
6659
|
+
parentWidth: number;
|
|
6660
|
+
/**
|
|
6661
|
+
* height of the parent node
|
|
6662
|
+
*/
|
|
6663
|
+
parentHeight: number;
|
|
6664
|
+
/**
|
|
6665
|
+
* id of the container where its parent node is
|
|
6666
|
+
*/
|
|
6667
|
+
parentContainerId: string;
|
|
6668
|
+
}
|
|
6669
|
+
/**
|
|
6670
|
+
* This component is used to initiate a connection between two nodes. Simply
|
|
6671
|
+
* drag the handle in a node and drop it in another node to create a connection.
|
|
6672
|
+
*/
|
|
6673
|
+
export var GraphConnectorHandler: React.FC<IGraphConnectorHandlerProps>;
|
|
6674
|
+
|
|
6675
|
+
|
|
6676
|
+
|
|
6677
|
+
}
|
|
6678
|
+
declare module BABYLON {
|
|
6679
|
+
|
|
6680
|
+
}
|
|
6681
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6682
|
+
export interface IGraphContainerProps {
|
|
6683
|
+
}
|
|
6684
|
+
/**
|
|
6685
|
+
* This component is just a simple container to keep the nodes and lines containers
|
|
6686
|
+
* together
|
|
6687
|
+
* @param props
|
|
6688
|
+
* @returns
|
|
6689
|
+
*/
|
|
6690
|
+
export var GraphContainer: React.FC<IGraphContainerProps>;
|
|
6691
|
+
|
|
6692
|
+
|
|
6693
|
+
|
|
6694
|
+
}
|
|
6695
|
+
declare module BABYLON {
|
|
6696
|
+
|
|
6697
|
+
}
|
|
6698
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6699
|
+
/// <reference types="react" />
|
|
6700
|
+
/**
|
|
6701
|
+
* this context is used to pass callbacks to the graph nodes and connections
|
|
6702
|
+
*/
|
|
6703
|
+
export interface IGraphContext {
|
|
6704
|
+
onNodesConnected?: (sourceId: string, targetId: string) => void;
|
|
6705
|
+
onLineSelected?: (lineId: string) => void;
|
|
6706
|
+
onNodeSelected?: (nodeId: string) => void;
|
|
6707
|
+
}
|
|
6708
|
+
export var GraphContextManager: import("react").Context<IGraphContext>;
|
|
6709
|
+
|
|
6710
|
+
|
|
6711
|
+
|
|
6712
|
+
}
|
|
6713
|
+
declare module BABYLON {
|
|
6714
|
+
|
|
6715
|
+
}
|
|
6716
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6717
|
+
/**
|
|
6718
|
+
* props for the GraphLine component
|
|
6719
|
+
*/
|
|
6720
|
+
export interface IGraphLineProps {
|
|
6721
|
+
/**
|
|
6722
|
+
* id of the line. temporary lines can have no id
|
|
6723
|
+
*/
|
|
6724
|
+
id?: string;
|
|
6725
|
+
/**
|
|
6726
|
+
* starting x pos of the line
|
|
6727
|
+
*/
|
|
6728
|
+
x1: number;
|
|
6729
|
+
/**
|
|
6730
|
+
* ending x pos of the line
|
|
6731
|
+
*/
|
|
6732
|
+
x2: number;
|
|
6733
|
+
/**
|
|
6734
|
+
* starting y pos of the line
|
|
6735
|
+
*/
|
|
6736
|
+
y1: number;
|
|
6737
|
+
/**
|
|
6738
|
+
* ending y pos of the line
|
|
6739
|
+
*/
|
|
6740
|
+
y2: number;
|
|
6741
|
+
/**
|
|
6742
|
+
* is the line selected
|
|
6743
|
+
*/
|
|
6744
|
+
selected?: boolean;
|
|
6745
|
+
/**
|
|
6746
|
+
* does the line have a direction
|
|
6747
|
+
*/
|
|
6748
|
+
directional?: boolean;
|
|
6749
|
+
}
|
|
6750
|
+
export const MarkerArrowId = "arrow";
|
|
6751
|
+
/**
|
|
6752
|
+
* This component draws a SVG line between two points, with an optional marker
|
|
6753
|
+
* indicating direction
|
|
6754
|
+
*/
|
|
6755
|
+
export var GraphLine: React.FC<IGraphLineProps>;
|
|
6756
|
+
|
|
6757
|
+
|
|
6758
|
+
|
|
6759
|
+
}
|
|
6760
|
+
declare module BABYLON {
|
|
6761
|
+
|
|
6762
|
+
}
|
|
6763
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6764
|
+
/**
|
|
6765
|
+
* props for the GraphLineContainer
|
|
6766
|
+
*/
|
|
6767
|
+
export interface IGraphLinesContainerProps {
|
|
6768
|
+
/**
|
|
6769
|
+
* id of the container
|
|
6770
|
+
*/
|
|
6771
|
+
id: string;
|
|
6772
|
+
}
|
|
6773
|
+
/**
|
|
6774
|
+
* this component handles the dragging of new connections
|
|
6775
|
+
* @param props
|
|
6776
|
+
* @returns
|
|
6777
|
+
*/
|
|
6778
|
+
export var GraphLinesContainer: React.FC<IGraphLinesContainerProps>;
|
|
6779
|
+
|
|
6780
|
+
|
|
6781
|
+
|
|
6782
|
+
}
|
|
6783
|
+
declare module BABYLON {
|
|
6784
|
+
|
|
6785
|
+
}
|
|
6786
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6787
|
+
export interface IGraphNodeProps {
|
|
6788
|
+
id: string;
|
|
6789
|
+
name: string;
|
|
6790
|
+
x: number;
|
|
6791
|
+
y: number;
|
|
6792
|
+
selected?: boolean;
|
|
6793
|
+
width?: number;
|
|
6794
|
+
height?: number;
|
|
6795
|
+
highlighted?: boolean;
|
|
6796
|
+
parentContainerId: string;
|
|
6797
|
+
}
|
|
6798
|
+
export var GraphNode: React.FC<IGraphNodeProps>;
|
|
6799
|
+
|
|
6800
|
+
|
|
6801
|
+
|
|
6802
|
+
}
|
|
6803
|
+
declare module BABYLON {
|
|
6804
|
+
|
|
6805
|
+
}
|
|
6806
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6807
|
+
export interface IGraphContainerProps {
|
|
6808
|
+
onNodeMoved: (id: string, x: number, y: number) => void;
|
|
6809
|
+
id: string;
|
|
6810
|
+
}
|
|
6811
|
+
/**
|
|
6812
|
+
* This component contains all the nodes and handles their dragging
|
|
6813
|
+
*/
|
|
6814
|
+
export var GraphNodesContainer: React.FC<IGraphContainerProps>;
|
|
6815
|
+
|
|
6816
|
+
|
|
6817
|
+
|
|
6818
|
+
}
|
|
6819
|
+
declare module BABYLON {
|
|
6820
|
+
|
|
6821
|
+
}
|
|
6822
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6823
|
+
export type IVisualRecordsType = Record<string, {
|
|
6824
|
+
x: number;
|
|
6825
|
+
y: number;
|
|
6826
|
+
}>;
|
|
6827
|
+
export type IConnectionType = {
|
|
6828
|
+
id: string;
|
|
6829
|
+
sourceId: string;
|
|
6830
|
+
targetId: string;
|
|
6831
|
+
};
|
|
6832
|
+
export type ICustomDataType = {
|
|
6833
|
+
type: string;
|
|
6834
|
+
value: any;
|
|
6835
|
+
};
|
|
6836
|
+
export type INodeType = {
|
|
6837
|
+
id: string;
|
|
6838
|
+
label: string;
|
|
6839
|
+
customData?: ICustomDataType;
|
|
6840
|
+
};
|
|
6841
|
+
/**
|
|
6842
|
+
* props for the node renderer
|
|
6843
|
+
*/
|
|
6844
|
+
export interface INodeRendererProps {
|
|
6845
|
+
/**
|
|
6846
|
+
* array of connections between nodes
|
|
6847
|
+
*/
|
|
6848
|
+
connections: IConnectionType[];
|
|
6849
|
+
/**
|
|
6850
|
+
* function called when a new connection is created
|
|
6851
|
+
*/
|
|
6852
|
+
updateConnections: (sourceId: string, targetId: string) => void;
|
|
6853
|
+
/**
|
|
6854
|
+
* function called when a connection is deleted
|
|
6855
|
+
*/
|
|
6856
|
+
deleteLine: (lineId: string) => void;
|
|
6857
|
+
/**
|
|
6858
|
+
* function called when a node is deleted
|
|
6859
|
+
*/
|
|
6860
|
+
deleteNode: (nodeId: string) => void;
|
|
6861
|
+
/**
|
|
6862
|
+
* array of all nodes
|
|
6863
|
+
*/
|
|
6864
|
+
nodes: INodeType[];
|
|
6865
|
+
/**
|
|
6866
|
+
* id of the node to highlight
|
|
6867
|
+
*/
|
|
6868
|
+
highlightedNode?: Nullable<string>;
|
|
6869
|
+
/**
|
|
6870
|
+
* function to be called if a node is selected
|
|
6871
|
+
*/
|
|
6872
|
+
selectNode?: (nodeId: Nullable<string>) => void;
|
|
6873
|
+
/**
|
|
6874
|
+
* id of this renderer
|
|
6875
|
+
*/
|
|
6876
|
+
id: string;
|
|
6877
|
+
/**
|
|
6878
|
+
* optional list of custom components to be rendered inside nodes of
|
|
6879
|
+
* a certain type
|
|
6880
|
+
*/
|
|
6881
|
+
customComponents?: Record<string, React.ComponentType<any>>;
|
|
6882
|
+
}
|
|
6883
|
+
/**
|
|
6884
|
+
* This component is a bridge between the app logic related to the graph, and the actual rendering
|
|
6885
|
+
* of it. It manages the nodes' positions and selection states.
|
|
6886
|
+
* @param props
|
|
6887
|
+
* @returns
|
|
6888
|
+
*/
|
|
6889
|
+
export const NodeRenderer: (props: INodeRendererProps) => JSX.Element;
|
|
6890
|
+
|
|
6891
|
+
|
|
6892
|
+
|
|
6893
|
+
}
|
|
6894
|
+
declare module BABYLON {
|
|
6895
|
+
|
|
6896
|
+
}
|
|
6897
|
+
declare module BABYLON.GuiEditor.SharedUIComponents {
|
|
6898
|
+
/**
|
|
6899
|
+
* utility hook to assist using the graph context
|
|
6900
|
+
* @returns
|
|
6901
|
+
*/
|
|
6902
|
+
export const useGraphContext: () => IGraphContext;
|
|
6903
|
+
|
|
6904
|
+
|
|
6905
|
+
|
|
6385
6906
|
}
|
|
6386
6907
|
declare module BABYLON {
|
|
6387
6908
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-gui-editor",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.0",
|
|
4
4
|
"main": "babylon.guiEditor.max.js",
|
|
5
5
|
"types": "babylon.guiEditor.module.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"clean": "rimraf dist && rimraf babylon*.*"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"babylonjs": "^5.
|
|
18
|
-
"babylonjs-gui": "^5.
|
|
17
|
+
"babylonjs": "^5.33.0",
|
|
18
|
+
"babylonjs-gui": "^5.33.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@dev/build-tools": "1.0.0",
|