@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.
@@ -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/core/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" />
|
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": "dist/babylon.guiEditor.max.js",
|
5
5
|
"module": "dist/babylon.guiEditor.max.js",
|
6
6
|
"esnext": "dist/babylon.guiEditor.max.js",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"@types/react-dom": ">=16.0.9"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
|
-
"@babylonjs/core": "^5.
|
28
|
-
"@babylonjs/gui": "^5.
|
27
|
+
"@babylonjs/core": "^5.33.0",
|
28
|
+
"@babylonjs/gui": "^5.33.0",
|
29
29
|
"react": "^17.0.2",
|
30
30
|
"react-dom": "^17.0.2",
|
31
31
|
"rimraf": "^3.0.2",
|