babylonjs-node-editor 5.28.0 → 5.29.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,405 @@ 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.ComponentType;
1538
+ };
1539
+ export type LayoutTabsRow = {
1540
+ /**
1541
+ * row id
1542
+ */
1543
+ id: string;
1544
+ /**
1545
+ * row height in its containing column
1546
+ */
1547
+ height: string;
1548
+ /**
1549
+ * selected tab in row
1550
+ */
1551
+ selectedTab: string;
1552
+ /**
1553
+ * list of tabs contained in row
1554
+ */
1555
+ tabs: LayoutTab[];
1556
+ };
1557
+ export type LayoutColumn = {
1558
+ /**
1559
+ * column id
1560
+ */
1561
+ id: string;
1562
+ /**
1563
+ * column width in the grid
1564
+ */
1565
+ width: string;
1566
+ /**
1567
+ * column rows
1568
+ */
1569
+ rows: LayoutTabsRow[];
1570
+ };
1571
+ export type Layout = {
1572
+ /**
1573
+ * layout columns
1574
+ */
1575
+ columns?: LayoutColumn[];
1576
+ };
1577
+ export type TabDrag = {
1578
+ /**
1579
+ * row number of the tab being dragged
1580
+ */
1581
+ rowNumber: number;
1582
+ /**
1583
+ * column number of the tab being dragged
1584
+ */
1585
+ columnNumber: number;
1586
+ /**
1587
+ * the tabs being dragged
1588
+ */
1589
+ tabs: {
1590
+ /**
1591
+ * id of tab being dragged
1592
+ */
1593
+ id: string;
1594
+ }[];
1595
+ };
1596
+ export enum ElementTypes {
1597
+ RESIZE_BAR = "0",
1598
+ TAB = "1",
1599
+ TAB_GROUP = "2",
1600
+ NONE = "2"
1601
+ }
1602
+ export enum ResizeDirections {
1603
+ ROW = "row",
1604
+ COLUMN = "column"
1605
+ }
1606
+
1607
+
1608
+
1609
+ }
1610
+ declare module BABYLON.NodeEditor {
1611
+
1612
+ }
1613
+ declare module BABYLON.NodeEditor.SharedUIComponents {
1614
+ /**
1615
+ * Given a column and row number in the layout, return the corresponding column/row
1616
+ * @param layout
1617
+ * @param column
1618
+ * @param row
1619
+ * @returns
1620
+ */
1621
+ export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
1622
+ /**
1623
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1624
+ * @param layout
1625
+ * @param column
1626
+ * @param row
1627
+ */
1628
+ export const removeLayoutRowAndRedistributePercentages: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row: number) => void;
1629
+ /**
1630
+ * Add a percentage string to a number
1631
+ */
1632
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
1633
+ /**
1634
+ * Parses a percentage string into a number
1635
+ * @param p the percentage string
1636
+ */
1637
+ export const parsePercentage: (p: string) => number;
1638
+
1639
+
1640
+
1242
1641
  }
1243
1642
  declare module BABYLON.NodeEditor {
1244
1643
 
@@ -1558,6 +1558,362 @@ export type LabelProps = {
1558
1558
  };
1559
1559
  export const Label: React.FC<LabelProps>;
1560
1560
 
1561
+ }
1562
+ declare module "babylonjs-node-editor/components/layout/DraggableIcon" {
1563
+ import { FC } from "react";
1564
+ import { ElementTypes, TabDrag } from "babylonjs-node-editor/components/layout/types";
1565
+ /**
1566
+ * Arguments for the DraggableIcon component.
1567
+ */
1568
+ export interface IDraggableIconProps {
1569
+ /**
1570
+ * Icon source
1571
+ */
1572
+ src: string;
1573
+ /**
1574
+ * Object that will be passed to the drag event
1575
+ */
1576
+ item: TabDrag;
1577
+ /**
1578
+ * Type of drag event
1579
+ */
1580
+ type: ElementTypes;
1581
+ }
1582
+ /**
1583
+ * An icon that can be dragged by the user
1584
+ */
1585
+ export const DraggableIcon: FC<IDraggableIconProps>;
1586
+
1587
+ }
1588
+ declare module "babylonjs-node-editor/components/layout/FlexibleColumn" {
1589
+ import { FC } from "react";
1590
+ /**
1591
+ * Arguments for the Column component.
1592
+ */
1593
+ export interface IFlexibleColumnProps {
1594
+ /**
1595
+ * Width of column
1596
+ */
1597
+ width: string;
1598
+ }
1599
+ /**
1600
+ * This component represents a single column in the layout. It receives a width
1601
+ * that it occupies and the content to display
1602
+ * @param props
1603
+ * @returns
1604
+ */
1605
+ export const FlexibleColumn: FC<IFlexibleColumnProps>;
1606
+
1607
+ }
1608
+ declare module "babylonjs-node-editor/components/layout/FlexibleDragHandler" {
1609
+ import { FC } from "react";
1610
+ /**
1611
+ * Arguments for the DragHandler component.
1612
+ */
1613
+ export interface IFlexibleDragHandlerProps {
1614
+ /**
1615
+ * The size of the containing element. Used to calculate the percentage of
1616
+ * space occupied by the component
1617
+ */
1618
+ containerSize: {
1619
+ width: number;
1620
+ height: number;
1621
+ };
1622
+ }
1623
+ /**
1624
+ * This component receives the drop events and updates the layout accordingly
1625
+ */
1626
+ export const FlexibleDragHandler: FC<IFlexibleDragHandlerProps>;
1627
+
1628
+ }
1629
+ declare module "babylonjs-node-editor/components/layout/FlexibleDropZone" {
1630
+ import { FC } from "react";
1631
+ /**
1632
+ * Arguments for the FlexibleDropZone component.
1633
+ */
1634
+ export interface IFlexibleDropZoneProps {
1635
+ /**
1636
+ * The row number of the component in the layout
1637
+ */
1638
+ rowNumber: number;
1639
+ /**
1640
+ * The column number of the component in the layout
1641
+ */
1642
+ columnNumber: number;
1643
+ }
1644
+ /**
1645
+ * This component contains the drag and drop zone for the resize bars that
1646
+ * allow redefining width and height of layout elements
1647
+ */
1648
+ export const FlexibleDropZone: FC<IFlexibleDropZoneProps>;
1649
+
1650
+ }
1651
+ declare module "babylonjs-node-editor/components/layout/FlexibleGridContainer" {
1652
+ import { FC } from "react";
1653
+ /**
1654
+ * Arguments for the GridContainer component.
1655
+ */
1656
+ export interface IFlexibleGridContainerProps {
1657
+ }
1658
+ /**
1659
+ * Component responsible for mapping the layout to the actual components
1660
+ */
1661
+ export const FlexibleGridContainer: FC<IFlexibleGridContainerProps>;
1662
+
1663
+ }
1664
+ declare module "babylonjs-node-editor/components/layout/FlexibleGridLayout" {
1665
+ import { FC } from "react";
1666
+ import { Layout } from "babylonjs-node-editor/components/layout/types";
1667
+ /**
1668
+ * Arguments for the Layout component.
1669
+ */
1670
+ export interface IFlexibleGridLayoutProps {
1671
+ /**
1672
+ * A definition of the layout which can be changed by the user
1673
+ */
1674
+ layoutDefinition: Layout;
1675
+ }
1676
+ /**
1677
+ * This component represents a grid layout that can be resized and rearranged
1678
+ * by the user.
1679
+ */
1680
+ export const FlexibleGridLayout: FC<IFlexibleGridLayoutProps>;
1681
+
1682
+ }
1683
+ declare module "babylonjs-node-editor/components/layout/FlexibleResizeBar" {
1684
+ import { FC } from "react";
1685
+ import { ResizeDirections } from "babylonjs-node-editor/components/layout/types";
1686
+ /**
1687
+ * Arguments for the ResizeBar component.
1688
+ */
1689
+ export interface IFlexibleRowResizerProps {
1690
+ /**
1691
+ * Row number of the component that is being resized
1692
+ */
1693
+ rowNumber: number;
1694
+ /**
1695
+ * Column number of the component being resized
1696
+ */
1697
+ columnNumber: number;
1698
+ /**
1699
+ * If the resizing happens in row or column direction
1700
+ */
1701
+ direction: ResizeDirections;
1702
+ }
1703
+ /**
1704
+ * The item that will be sent to the drag event
1705
+ */
1706
+ export type ResizeItem = {
1707
+ /**
1708
+ * If the resizing happens in row or column direction
1709
+ */
1710
+ direction: ResizeDirections;
1711
+ /**
1712
+ * The row number of the component that is being resized
1713
+ */
1714
+ rowNumber: number;
1715
+ /**
1716
+ * the column number of the component being resized
1717
+ */
1718
+ columnNumber: number;
1719
+ };
1720
+ /**
1721
+ * A component that renders a bar that the user can drag to resize.
1722
+ */
1723
+ export const FlexibleResizeBar: FC<IFlexibleRowResizerProps>;
1724
+
1725
+ }
1726
+ declare module "babylonjs-node-editor/components/layout/FlexibleTab" {
1727
+ import { FC } from "react";
1728
+ import { TabDrag } from "babylonjs-node-editor/components/layout/types";
1729
+ /**
1730
+ * Arguments for the FlexibleTab component.
1731
+ */
1732
+ export interface IFlexibleTabProps {
1733
+ /**
1734
+ * The tab's title.
1735
+ */
1736
+ title: string;
1737
+ /**
1738
+ * If the tab is currently selected or not
1739
+ */
1740
+ selected: boolean;
1741
+ /**
1742
+ * What happens when the user clicks on the tab
1743
+ */
1744
+ onClick: () => void;
1745
+ /**
1746
+ * The object that will be sent to the drag event
1747
+ */
1748
+ item: TabDrag;
1749
+ /**
1750
+ * What happens when the user drops another tab after this one
1751
+ */
1752
+ onTabDroppedAction: (item: TabDrag) => void;
1753
+ }
1754
+ /**
1755
+ * A component that renders a tab that the user can click
1756
+ * to activate or drag to reorder. It also listens for
1757
+ * drop events if the user wants to drop another tab
1758
+ * after it.
1759
+ */
1760
+ export const FlexibleTab: FC<IFlexibleTabProps>;
1761
+
1762
+ }
1763
+ declare module "babylonjs-node-editor/components/layout/FlexibleTabsContainer" {
1764
+ import { FC } from "react";
1765
+ import { LayoutTab } from "babylonjs-node-editor/components/layout/types";
1766
+ /**
1767
+ * Arguments for the TabsContainer component.
1768
+ */
1769
+ export interface IFlexibleTabsContainerProps {
1770
+ /**
1771
+ * The tabs to display
1772
+ */
1773
+ tabs: LayoutTab[];
1774
+ /**
1775
+ * Row index of component in layout
1776
+ */
1777
+ rowIndex: number;
1778
+ /**
1779
+ * Column index of component in layout
1780
+ */
1781
+ columnIndex: number;
1782
+ /**
1783
+ * Which tab is selected in the layout
1784
+ */
1785
+ selectedTab?: string;
1786
+ }
1787
+ /**
1788
+ * This component contains a set of tabs of which only one is visible at a time.
1789
+ * The tabs can also be dragged from and to different containers.
1790
+ */
1791
+ export const FlexibleTabsContainer: FC<IFlexibleTabsContainerProps>;
1792
+
1793
+ }
1794
+ declare module "babylonjs-node-editor/components/layout/LayoutContext" {
1795
+ /// <reference types="react" />
1796
+ import { Layout } from "babylonjs-node-editor/components/layout/types";
1797
+ export const LayoutContext: import("react").Context<{
1798
+ /**
1799
+ * The layout object
1800
+ */
1801
+ layout: Layout;
1802
+ /**
1803
+ * Function to set the layout object in the context
1804
+ */
1805
+ setLayout: (layout: Layout) => void;
1806
+ }>;
1807
+
1808
+ }
1809
+ declare module "babylonjs-node-editor/components/layout/types" {
1810
+ import { ComponentType } from "react";
1811
+ export type LayoutTab = {
1812
+ /**
1813
+ * Tab id
1814
+ */
1815
+ id: string;
1816
+ /**
1817
+ * React component rendered by tab
1818
+ */
1819
+ component: ComponentType;
1820
+ };
1821
+ export type LayoutTabsRow = {
1822
+ /**
1823
+ * row id
1824
+ */
1825
+ id: string;
1826
+ /**
1827
+ * row height in its containing column
1828
+ */
1829
+ height: string;
1830
+ /**
1831
+ * selected tab in row
1832
+ */
1833
+ selectedTab: string;
1834
+ /**
1835
+ * list of tabs contained in row
1836
+ */
1837
+ tabs: LayoutTab[];
1838
+ };
1839
+ export type LayoutColumn = {
1840
+ /**
1841
+ * column id
1842
+ */
1843
+ id: string;
1844
+ /**
1845
+ * column width in the grid
1846
+ */
1847
+ width: string;
1848
+ /**
1849
+ * column rows
1850
+ */
1851
+ rows: LayoutTabsRow[];
1852
+ };
1853
+ export type Layout = {
1854
+ /**
1855
+ * layout columns
1856
+ */
1857
+ columns?: LayoutColumn[];
1858
+ };
1859
+ export type TabDrag = {
1860
+ /**
1861
+ * row number of the tab being dragged
1862
+ */
1863
+ rowNumber: number;
1864
+ /**
1865
+ * column number of the tab being dragged
1866
+ */
1867
+ columnNumber: number;
1868
+ /**
1869
+ * the tabs being dragged
1870
+ */
1871
+ tabs: {
1872
+ /**
1873
+ * id of tab being dragged
1874
+ */
1875
+ id: string;
1876
+ }[];
1877
+ };
1878
+ export enum ElementTypes {
1879
+ RESIZE_BAR = "0",
1880
+ TAB = "1",
1881
+ TAB_GROUP = "2",
1882
+ NONE = "2"
1883
+ }
1884
+ export enum ResizeDirections {
1885
+ ROW = "row",
1886
+ COLUMN = "column"
1887
+ }
1888
+
1889
+ }
1890
+ declare module "babylonjs-node-editor/components/layout/utils" {
1891
+ import { Layout } from "babylonjs-node-editor/components/layout/types";
1892
+ /**
1893
+ * Given a column and row number in the layout, return the corresponding column/row
1894
+ * @param layout
1895
+ * @param column
1896
+ * @param row
1897
+ * @returns
1898
+ */
1899
+ export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => import("babylonjs-node-editor/components/layout/types").LayoutTabsRow | import("./types").LayoutColumn;
1900
+ /**
1901
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1902
+ * @param layout
1903
+ * @param column
1904
+ * @param row
1905
+ */
1906
+ export const removeLayoutRowAndRedistributePercentages: (layout: Layout, column: number, row: number) => void;
1907
+ /**
1908
+ * Add a percentage string to a number
1909
+ */
1910
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
1911
+ /**
1912
+ * Parses a percentage string into a number
1913
+ * @param p the percentage string
1914
+ */
1915
+ export const parsePercentage: (p: string) => number;
1916
+
1561
1917
  }
1562
1918
  declare module "babylonjs-node-editor/components/lines/ColorLineComponent" {
1563
1919
  import * as React from "react";
@@ -4860,6 +5216,405 @@ declare module BABYLON.NodeEditor.SharedUIComponents {
4860
5216
 
4861
5217
 
4862
5218
 
5219
+ }
5220
+ declare module BABYLON.NodeEditor {
5221
+
5222
+ }
5223
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5224
+ /**
5225
+ * Arguments for the DraggableIcon component.
5226
+ */
5227
+ export interface IDraggableIconProps {
5228
+ /**
5229
+ * Icon source
5230
+ */
5231
+ src: string;
5232
+ /**
5233
+ * Object that will be passed to the drag event
5234
+ */
5235
+ item: BABYLON.NodeEditor.SharedUIComponents.TabDrag;
5236
+ /**
5237
+ * Type of drag event
5238
+ */
5239
+ type: BABYLON.NodeEditor.SharedUIComponents.ElementTypes;
5240
+ }
5241
+ /**
5242
+ * An icon that can be dragged by the user
5243
+ */
5244
+ export var DraggableIcon: React.FC<IDraggableIconProps>;
5245
+
5246
+
5247
+
5248
+ }
5249
+ declare module BABYLON.NodeEditor {
5250
+
5251
+ }
5252
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5253
+ /**
5254
+ * Arguments for the Column component.
5255
+ */
5256
+ export interface IFlexibleColumnProps {
5257
+ /**
5258
+ * Width of column
5259
+ */
5260
+ width: string;
5261
+ }
5262
+ /**
5263
+ * This component represents a single column in the layout. It receives a width
5264
+ * that it occupies and the content to display
5265
+ * @param props
5266
+ * @returns
5267
+ */
5268
+ export var FlexibleColumn: React.FC<IFlexibleColumnProps>;
5269
+
5270
+
5271
+
5272
+ }
5273
+ declare module BABYLON.NodeEditor {
5274
+
5275
+ }
5276
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5277
+ /**
5278
+ * Arguments for the DragHandler component.
5279
+ */
5280
+ export interface IFlexibleDragHandlerProps {
5281
+ /**
5282
+ * The size of the containing element. Used to calculate the percentage of
5283
+ * space occupied by the component
5284
+ */
5285
+ containerSize: {
5286
+ width: number;
5287
+ height: number;
5288
+ };
5289
+ }
5290
+ /**
5291
+ * This component receives the drop events and updates the layout accordingly
5292
+ */
5293
+ export var FlexibleDragHandler: React.FC<IFlexibleDragHandlerProps>;
5294
+
5295
+
5296
+
5297
+ }
5298
+ declare module BABYLON.NodeEditor {
5299
+
5300
+ }
5301
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5302
+ /**
5303
+ * Arguments for the FlexibleDropZone component.
5304
+ */
5305
+ export interface IFlexibleDropZoneProps {
5306
+ /**
5307
+ * The row number of the component in the layout
5308
+ */
5309
+ rowNumber: number;
5310
+ /**
5311
+ * The column number of the component in the layout
5312
+ */
5313
+ columnNumber: number;
5314
+ }
5315
+ /**
5316
+ * This component contains the drag and drop zone for the resize bars that
5317
+ * allow redefining width and height of layout elements
5318
+ */
5319
+ export var FlexibleDropZone: React.FC<IFlexibleDropZoneProps>;
5320
+
5321
+
5322
+
5323
+ }
5324
+ declare module BABYLON.NodeEditor {
5325
+
5326
+ }
5327
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5328
+ /**
5329
+ * Arguments for the GridContainer component.
5330
+ */
5331
+ export interface IFlexibleGridContainerProps {
5332
+ }
5333
+ /**
5334
+ * Component responsible for mapping the layout to the actual components
5335
+ */
5336
+ export var FlexibleGridContainer: React.FC<IFlexibleGridContainerProps>;
5337
+
5338
+
5339
+
5340
+ }
5341
+ declare module BABYLON.NodeEditor {
5342
+
5343
+ }
5344
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5345
+ /**
5346
+ * Arguments for the BABYLON.NodeEditor.SharedUIComponents.Layout component.
5347
+ */
5348
+ export interface IFlexibleGridLayoutProps {
5349
+ /**
5350
+ * A definition of the layout which can be changed by the user
5351
+ */
5352
+ layoutDefinition: BABYLON.NodeEditor.SharedUIComponents.Layout;
5353
+ }
5354
+ /**
5355
+ * This component represents a grid layout that can be resized and rearranged
5356
+ * by the user.
5357
+ */
5358
+ export var FlexibleGridLayout: React.FC<IFlexibleGridLayoutProps>;
5359
+
5360
+
5361
+
5362
+ }
5363
+ declare module BABYLON.NodeEditor {
5364
+
5365
+ }
5366
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5367
+ /**
5368
+ * Arguments for the ResizeBar component.
5369
+ */
5370
+ export interface IFlexibleRowResizerProps {
5371
+ /**
5372
+ * Row number of the component that is being resized
5373
+ */
5374
+ rowNumber: number;
5375
+ /**
5376
+ * Column number of the component being resized
5377
+ */
5378
+ columnNumber: number;
5379
+ /**
5380
+ * If the resizing happens in row or column direction
5381
+ */
5382
+ direction: BABYLON.NodeEditor.SharedUIComponents.ResizeDirections;
5383
+ }
5384
+ /**
5385
+ * The item that will be sent to the drag event
5386
+ */
5387
+ export type ResizeItem = {
5388
+ /**
5389
+ * If the resizing happens in row or column direction
5390
+ */
5391
+ direction: BABYLON.NodeEditor.SharedUIComponents.ResizeDirections;
5392
+ /**
5393
+ * The row number of the component that is being resized
5394
+ */
5395
+ rowNumber: number;
5396
+ /**
5397
+ * the column number of the component being resized
5398
+ */
5399
+ columnNumber: number;
5400
+ };
5401
+ /**
5402
+ * A component that renders a bar that the user can drag to resize.
5403
+ */
5404
+ export var FlexibleResizeBar: React.FC<IFlexibleRowResizerProps>;
5405
+
5406
+
5407
+
5408
+ }
5409
+ declare module BABYLON.NodeEditor {
5410
+
5411
+ }
5412
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5413
+ /**
5414
+ * Arguments for the FlexibleTab component.
5415
+ */
5416
+ export interface IFlexibleTabProps {
5417
+ /**
5418
+ * The tab's title.
5419
+ */
5420
+ title: string;
5421
+ /**
5422
+ * If the tab is currently selected or not
5423
+ */
5424
+ selected: boolean;
5425
+ /**
5426
+ * What happens when the user clicks on the tab
5427
+ */
5428
+ onClick: () => void;
5429
+ /**
5430
+ * The object that will be sent to the drag event
5431
+ */
5432
+ item: BABYLON.NodeEditor.SharedUIComponents.TabDrag;
5433
+ /**
5434
+ * What happens when the user drops another tab after this one
5435
+ */
5436
+ onTabDroppedAction: (item: BABYLON.NodeEditor.SharedUIComponents.TabDrag) => void;
5437
+ }
5438
+ /**
5439
+ * A component that renders a tab that the user can click
5440
+ * to activate or drag to reorder. It also listens for
5441
+ * drop events if the user wants to drop another tab
5442
+ * after it.
5443
+ */
5444
+ export var FlexibleTab: React.FC<IFlexibleTabProps>;
5445
+
5446
+
5447
+
5448
+ }
5449
+ declare module BABYLON.NodeEditor {
5450
+
5451
+ }
5452
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5453
+ /**
5454
+ * Arguments for the TabsContainer component.
5455
+ */
5456
+ export interface IFlexibleTabsContainerProps {
5457
+ /**
5458
+ * The tabs to display
5459
+ */
5460
+ tabs: BABYLON.NodeEditor.SharedUIComponents.LayoutTab[];
5461
+ /**
5462
+ * Row index of component in layout
5463
+ */
5464
+ rowIndex: number;
5465
+ /**
5466
+ * Column index of component in layout
5467
+ */
5468
+ columnIndex: number;
5469
+ /**
5470
+ * Which tab is selected in the layout
5471
+ */
5472
+ selectedTab?: string;
5473
+ }
5474
+ /**
5475
+ * This component contains a set of tabs of which only one is visible at a time.
5476
+ * The tabs can also be dragged from and to different containers.
5477
+ */
5478
+ export var FlexibleTabsContainer: React.FC<IFlexibleTabsContainerProps>;
5479
+
5480
+
5481
+
5482
+ }
5483
+ declare module BABYLON.NodeEditor {
5484
+
5485
+ }
5486
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5487
+ /// <reference types="react" />
5488
+ export var LayoutContext: import("react").Context<{
5489
+ /**
5490
+ * The layout object
5491
+ */
5492
+ layout: BABYLON.NodeEditor.SharedUIComponents.Layout;
5493
+ /**
5494
+ * Function to set the layout object in the context
5495
+ */
5496
+ setLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout) => void;
5497
+ }>;
5498
+
5499
+
5500
+
5501
+ }
5502
+ declare module BABYLON.NodeEditor {
5503
+
5504
+ }
5505
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5506
+ export type LayoutTab = {
5507
+ /**
5508
+ * Tab id
5509
+ */
5510
+ id: string;
5511
+ /**
5512
+ * React component rendered by tab
5513
+ */
5514
+ component: React.ComponentType;
5515
+ };
5516
+ export type LayoutTabsRow = {
5517
+ /**
5518
+ * row id
5519
+ */
5520
+ id: string;
5521
+ /**
5522
+ * row height in its containing column
5523
+ */
5524
+ height: string;
5525
+ /**
5526
+ * selected tab in row
5527
+ */
5528
+ selectedTab: string;
5529
+ /**
5530
+ * list of tabs contained in row
5531
+ */
5532
+ tabs: LayoutTab[];
5533
+ };
5534
+ export type LayoutColumn = {
5535
+ /**
5536
+ * column id
5537
+ */
5538
+ id: string;
5539
+ /**
5540
+ * column width in the grid
5541
+ */
5542
+ width: string;
5543
+ /**
5544
+ * column rows
5545
+ */
5546
+ rows: LayoutTabsRow[];
5547
+ };
5548
+ export type Layout = {
5549
+ /**
5550
+ * layout columns
5551
+ */
5552
+ columns?: LayoutColumn[];
5553
+ };
5554
+ export type TabDrag = {
5555
+ /**
5556
+ * row number of the tab being dragged
5557
+ */
5558
+ rowNumber: number;
5559
+ /**
5560
+ * column number of the tab being dragged
5561
+ */
5562
+ columnNumber: number;
5563
+ /**
5564
+ * the tabs being dragged
5565
+ */
5566
+ tabs: {
5567
+ /**
5568
+ * id of tab being dragged
5569
+ */
5570
+ id: string;
5571
+ }[];
5572
+ };
5573
+ export enum ElementTypes {
5574
+ RESIZE_BAR = "0",
5575
+ TAB = "1",
5576
+ TAB_GROUP = "2",
5577
+ NONE = "2"
5578
+ }
5579
+ export enum ResizeDirections {
5580
+ ROW = "row",
5581
+ COLUMN = "column"
5582
+ }
5583
+
5584
+
5585
+
5586
+ }
5587
+ declare module BABYLON.NodeEditor {
5588
+
5589
+ }
5590
+ declare module BABYLON.NodeEditor.SharedUIComponents {
5591
+ /**
5592
+ * Given a column and row number in the layout, return the corresponding column/row
5593
+ * @param layout
5594
+ * @param column
5595
+ * @param row
5596
+ * @returns
5597
+ */
5598
+ export const getPosInLayout: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
5599
+ /**
5600
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
5601
+ * @param layout
5602
+ * @param column
5603
+ * @param row
5604
+ */
5605
+ export const removeLayoutRowAndRedistributePercentages: (layout: BABYLON.NodeEditor.SharedUIComponents.Layout, column: number, row: number) => void;
5606
+ /**
5607
+ * Add a percentage string to a number
5608
+ */
5609
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
5610
+ /**
5611
+ * Parses a percentage string into a number
5612
+ * @param p the percentage string
5613
+ */
5614
+ export const parsePercentage: (p: string) => number;
5615
+
5616
+
5617
+
4863
5618
  }
4864
5619
  declare module BABYLON.NodeEditor {
4865
5620
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-node-editor",
3
- "version": "5.28.0",
3
+ "version": "5.29.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.28.0"
17
+ "babylonjs": "^5.29.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@dev/build-tools": "1.0.0",