babylonjs-node-editor 5.28.0 → 5.30.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.
@@ -1239,6 +1239,409 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
1239
1239
 
1240
1240
 
1241
1241
 
1242
+ }
1243
+ declare module BABYLON.NodeEditor {
1244
+
1245
+ }
1246
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1247
+ /**
1248
+ * Arguments for the DraggableIcon component.
1249
+ */
1250
+ export interface IDraggableIconProps {
1251
+ /**
1252
+ * Icon source
1253
+ */
1254
+ src: string;
1255
+ /**
1256
+ * Object that will be passed to the drag event
1257
+ */
1258
+ item: BABYLON.NodeEditor.SharedUIComponents.TabDrag;
1259
+ /**
1260
+ * Type of drag event
1261
+ */
1262
+ type: BABYLON.NodeEditor.SharedUIComponents.ElementTypes;
1263
+ }
1264
+ /**
1265
+ * An icon that can be dragged by the user
1266
+ */
1267
+ export var DraggableIcon: React.FC<IDraggableIconProps>;
1268
+
1269
+
1270
+
1271
+ }
1272
+ declare module BABYLON.NodeEditor {
1273
+
1274
+ }
1275
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1276
+ /**
1277
+ * Arguments for the Column component.
1278
+ */
1279
+ export interface IFlexibleColumnProps {
1280
+ /**
1281
+ * Width of column
1282
+ */
1283
+ width: string;
1284
+ }
1285
+ /**
1286
+ * This component represents a single column in the layout. It receives a width
1287
+ * that it occupies and the content to display
1288
+ * @param props
1289
+ * @returns
1290
+ */
1291
+ export var FlexibleColumn: React.FC<IFlexibleColumnProps>;
1292
+
1293
+
1294
+
1295
+ }
1296
+ declare module BABYLON.NodeEditor {
1297
+
1298
+ }
1299
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1300
+ /**
1301
+ * Arguments for the DragHandler component.
1302
+ */
1303
+ export interface IFlexibleDragHandlerProps {
1304
+ /**
1305
+ * The size of the containing element. Used to calculate the percentage of
1306
+ * space occupied by the component
1307
+ */
1308
+ containerSize: {
1309
+ width: number;
1310
+ height: number;
1311
+ };
1312
+ }
1313
+ /**
1314
+ * This component receives the drop events and updates the layout accordingly
1315
+ */
1316
+ export var FlexibleDragHandler: React.FC<IFlexibleDragHandlerProps>;
1317
+
1318
+
1319
+
1320
+ }
1321
+ declare module BABYLON.NodeEditor {
1322
+
1323
+ }
1324
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1325
+ /**
1326
+ * Arguments for the FlexibleDropZone component.
1327
+ */
1328
+ export interface IFlexibleDropZoneProps {
1329
+ /**
1330
+ * The row number of the component in the layout
1331
+ */
1332
+ rowNumber: number;
1333
+ /**
1334
+ * The column number of the component in the layout
1335
+ */
1336
+ columnNumber: number;
1337
+ }
1338
+ /**
1339
+ * This component contains the drag and drop zone for the resize bars that
1340
+ * allow redefining width and height of layout elements
1341
+ */
1342
+ export var FlexibleDropZone: React.FC<IFlexibleDropZoneProps>;
1343
+
1344
+
1345
+
1346
+ }
1347
+ declare module BABYLON.NodeEditor {
1348
+
1349
+ }
1350
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1351
+ /**
1352
+ * Arguments for the GridContainer component.
1353
+ */
1354
+ export interface IFlexibleGridContainerProps {
1355
+ }
1356
+ /**
1357
+ * Component responsible for mapping the layout to the actual components
1358
+ */
1359
+ export var FlexibleGridContainer: React.FC<IFlexibleGridContainerProps>;
1360
+
1361
+
1362
+
1363
+ }
1364
+ declare module BABYLON.NodeEditor {
1365
+
1366
+ }
1367
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1368
+ /**
1369
+ * Arguments for the BABYLON.NodeEditor.SharedUIComponents.Layout component.
1370
+ */
1371
+ export interface IFlexibleGridLayoutProps {
1372
+ /**
1373
+ * A definition of the layout which can be changed by the user
1374
+ */
1375
+ layoutDefinition: BABYLON.NodeEditor.SharedUIComponents.Layout;
1376
+ }
1377
+ /**
1378
+ * This component represents a grid layout that can be resized and rearranged
1379
+ * by the user.
1380
+ */
1381
+ export var FlexibleGridLayout: React.FC<IFlexibleGridLayoutProps>;
1382
+
1383
+
1384
+
1385
+ }
1386
+ declare module BABYLON.NodeEditor {
1387
+
1388
+ }
1389
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1390
+ /**
1391
+ * Arguments for the ResizeBar component.
1392
+ */
1393
+ export interface IFlexibleRowResizerProps {
1394
+ /**
1395
+ * Row number of the component that is being resized
1396
+ */
1397
+ rowNumber: number;
1398
+ /**
1399
+ * Column number of the component being resized
1400
+ */
1401
+ columnNumber: number;
1402
+ /**
1403
+ * If the resizing happens in row or column direction
1404
+ */
1405
+ direction: BABYLON.NodeEditor.SharedUIComponents.ResizeDirections;
1406
+ }
1407
+ /**
1408
+ * The item that will be sent to the drag event
1409
+ */
1410
+ export type ResizeItem = {
1411
+ /**
1412
+ * If the resizing happens in row or column direction
1413
+ */
1414
+ direction: BABYLON.NodeEditor.SharedUIComponents.ResizeDirections;
1415
+ /**
1416
+ * The row number of the component that is being resized
1417
+ */
1418
+ rowNumber: number;
1419
+ /**
1420
+ * the column number of the component being resized
1421
+ */
1422
+ columnNumber: number;
1423
+ };
1424
+ /**
1425
+ * A component that renders a bar that the user can drag to resize.
1426
+ */
1427
+ export var FlexibleResizeBar: React.FC<IFlexibleRowResizerProps>;
1428
+
1429
+
1430
+
1431
+ }
1432
+ declare module BABYLON.NodeEditor {
1433
+
1434
+ }
1435
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1436
+ /**
1437
+ * Arguments for the FlexibleTab component.
1438
+ */
1439
+ export interface IFlexibleTabProps {
1440
+ /**
1441
+ * The tab's title.
1442
+ */
1443
+ title: string;
1444
+ /**
1445
+ * If the tab is currently selected or not
1446
+ */
1447
+ selected: boolean;
1448
+ /**
1449
+ * What happens when the user clicks on the tab
1450
+ */
1451
+ onClick: () => void;
1452
+ /**
1453
+ * The object that will be sent to the drag event
1454
+ */
1455
+ item: BABYLON.NodeEditor.SharedUIComponents.TabDrag;
1456
+ /**
1457
+ * What happens when the user drops another tab after this one
1458
+ */
1459
+ onTabDroppedAction: (item: BABYLON.NodeEditor.SharedUIComponents.TabDrag) => void;
1460
+ }
1461
+ /**
1462
+ * A component that renders a tab that the user can click
1463
+ * to activate or drag to reorder. It also listens for
1464
+ * drop events if the user wants to drop another tab
1465
+ * after it.
1466
+ */
1467
+ export var FlexibleTab: React.FC<IFlexibleTabProps>;
1468
+
1469
+
1470
+
1471
+ }
1472
+ declare module BABYLON.NodeEditor {
1473
+
1474
+ }
1475
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1476
+ /**
1477
+ * Arguments for the TabsContainer component.
1478
+ */
1479
+ export interface IFlexibleTabsContainerProps {
1480
+ /**
1481
+ * The tabs to display
1482
+ */
1483
+ tabs: BABYLON.NodeEditor.SharedUIComponents.LayoutTab[];
1484
+ /**
1485
+ * Row index of component in layout
1486
+ */
1487
+ rowIndex: number;
1488
+ /**
1489
+ * Column index of component in layout
1490
+ */
1491
+ columnIndex: number;
1492
+ /**
1493
+ * Which tab is selected in the layout
1494
+ */
1495
+ selectedTab?: string;
1496
+ }
1497
+ /**
1498
+ * This component contains a set of tabs of which only one is visible at a time.
1499
+ * The tabs can also be dragged from and to different containers.
1500
+ */
1501
+ export var FlexibleTabsContainer: React.FC<IFlexibleTabsContainerProps>;
1502
+
1503
+
1504
+
1505
+ }
1506
+ declare module BABYLON.NodeEditor {
1507
+
1508
+ }
1509
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1510
+ /// <reference types="react" />
1511
+ export var LayoutContext: import("react").Context<{
1512
+ /**
1513
+ * The layout object
1514
+ */
1515
+ layout: BABYLON.NodeEditor.SharedUIComponents.Layout;
1516
+ /**
1517
+ * Function to set the layout object in the context
1518
+ */
1519
+ setLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout) => void;
1520
+ }>;
1521
+
1522
+
1523
+
1524
+ }
1525
+ declare module BABYLON.NodeEditor {
1526
+
1527
+ }
1528
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1529
+ export type LayoutTab = {
1530
+ /**
1531
+ * Tab id
1532
+ */
1533
+ id: string;
1534
+ /**
1535
+ * React component rendered by tab
1536
+ */
1537
+ component: React.ReactElement;
1538
+ /**
1539
+ * Tab title
1540
+ */
1541
+ title: string;
1542
+ };
1543
+ export type LayoutTabsRow = {
1544
+ /**
1545
+ * row id
1546
+ */
1547
+ id: string;
1548
+ /**
1549
+ * row height in its containing column
1550
+ */
1551
+ height: string;
1552
+ /**
1553
+ * selected tab in row
1554
+ */
1555
+ selectedTab: string;
1556
+ /**
1557
+ * list of tabs contained in row
1558
+ */
1559
+ tabs: LayoutTab[];
1560
+ };
1561
+ export type LayoutColumn = {
1562
+ /**
1563
+ * column id
1564
+ */
1565
+ id: string;
1566
+ /**
1567
+ * column width in the grid
1568
+ */
1569
+ width: string;
1570
+ /**
1571
+ * column rows
1572
+ */
1573
+ rows: LayoutTabsRow[];
1574
+ };
1575
+ export type Layout = {
1576
+ /**
1577
+ * layout columns
1578
+ */
1579
+ columns?: LayoutColumn[];
1580
+ };
1581
+ export type TabDrag = {
1582
+ /**
1583
+ * row number of the tab being dragged
1584
+ */
1585
+ rowNumber: number;
1586
+ /**
1587
+ * column number of the tab being dragged
1588
+ */
1589
+ columnNumber: number;
1590
+ /**
1591
+ * the tabs being dragged
1592
+ */
1593
+ tabs: {
1594
+ /**
1595
+ * id of tab being dragged
1596
+ */
1597
+ id: string;
1598
+ }[];
1599
+ };
1600
+ export enum ElementTypes {
1601
+ RESIZE_BAR = "0",
1602
+ TAB = "1",
1603
+ TAB_GROUP = "2",
1604
+ NONE = "2"
1605
+ }
1606
+ export enum ResizeDirections {
1607
+ ROW = "row",
1608
+ COLUMN = "column"
1609
+ }
1610
+
1611
+
1612
+
1613
+ }
1614
+ declare module BABYLON.NodeEditor {
1615
+
1616
+ }
1617
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1618
+ /**
1619
+ * Given a column and row number in the layout, return the corresponding column/row
1620
+ * @param layout
1621
+ * @param column
1622
+ * @param row
1623
+ * @returns
1624
+ */
1625
+ export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
1626
+ /**
1627
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1628
+ * @param layout
1629
+ * @param column
1630
+ * @param row
1631
+ */
1632
+ export const removeLayoutRowAndRedistributePercentages: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row: number) => void;
1633
+ /**
1634
+ * Add a percentage string to a number
1635
+ */
1636
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
1637
+ /**
1638
+ * Parses a percentage string into a number
1639
+ * @param p the percentage string
1640
+ */
1641
+ export const parsePercentage: (p: string) => number;
1642
+
1643
+
1644
+
1242
1645
  }
1243
1646
  declare module BABYLON.NodeEditor {
1244
1647
 
@@ -2421,11 +2824,17 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
2421
2824
  static readonly NodeWidth = 100;
2422
2825
  private readonly _minZoom;
2423
2826
  private readonly _maxZoom;
2827
+ private _hostCanvasRef;
2424
2828
  private _hostCanvas;
2829
+ private _graphCanvasRef;
2425
2830
  private _graphCanvas;
2831
+ private _selectionContainerRef;
2426
2832
  private _selectionContainer;
2833
+ private _frameContainerRef;
2427
2834
  private _frameContainer;
2835
+ private _svgCanvasRef;
2428
2836
  private _svgCanvas;
2837
+ private _rootContainerRef;
2429
2838
  private _rootContainer;
2430
2839
  private _nodes;
2431
2840
  private _links;
@@ -2708,6 +3117,8 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
2708
3117
  private _displayManager;
2709
3118
  private _isVisible;
2710
3119
  private _enclosingFrameId;
3120
+ addClassToVisual(className: string): void;
3121
+ removeClassFromVisual(className: string): void;
2711
3122
  get isVisible(): boolean;
2712
3123
  set isVisible(value: boolean);
2713
3124
  private _upateNodePortNames;