babylonjs-gui-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.
@@ -157,6 +157,8 @@ declare module BABYLON {
157
157
  interface ICommonControlPropertyGridComponentState {
158
158
  fontFamilyOptions: IInspectableOptions[];
159
159
  value: number;
160
+ invalidFonts: string[];
161
+ invalidFontAlertName?: string;
160
162
  }
161
163
  export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps, ICommonControlPropertyGridComponentState> {
162
164
  private _onPropertyChangedObserver;
@@ -1447,6 +1449,409 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
1447
1449
 
1448
1450
 
1449
1451
 
1452
+ }
1453
+ declare module BABYLON {
1454
+
1455
+ }
1456
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1457
+ /**
1458
+ * Arguments for the DraggableIcon component.
1459
+ */
1460
+ export interface IDraggableIconProps {
1461
+ /**
1462
+ * Icon source
1463
+ */
1464
+ src: string;
1465
+ /**
1466
+ * Object that will be passed to the drag event
1467
+ */
1468
+ item: BABYLON.GuiEditor.SharedUIComponents.TabDrag;
1469
+ /**
1470
+ * Type of drag event
1471
+ */
1472
+ type: BABYLON.GuiEditor.SharedUIComponents.ElementTypes;
1473
+ }
1474
+ /**
1475
+ * An icon that can be dragged by the user
1476
+ */
1477
+ export var DraggableIcon: React.FC<IDraggableIconProps>;
1478
+
1479
+
1480
+
1481
+ }
1482
+ declare module BABYLON {
1483
+
1484
+ }
1485
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1486
+ /**
1487
+ * Arguments for the Column component.
1488
+ */
1489
+ export interface IFlexibleColumnProps {
1490
+ /**
1491
+ * Width of column
1492
+ */
1493
+ width: string;
1494
+ }
1495
+ /**
1496
+ * This component represents a single column in the layout. It receives a width
1497
+ * that it occupies and the content to display
1498
+ * @param props
1499
+ * @returns
1500
+ */
1501
+ export var FlexibleColumn: React.FC<IFlexibleColumnProps>;
1502
+
1503
+
1504
+
1505
+ }
1506
+ declare module BABYLON {
1507
+
1508
+ }
1509
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1510
+ /**
1511
+ * Arguments for the DragHandler component.
1512
+ */
1513
+ export interface IFlexibleDragHandlerProps {
1514
+ /**
1515
+ * The size of the containing element. Used to calculate the percentage of
1516
+ * space occupied by the component
1517
+ */
1518
+ containerSize: {
1519
+ width: number;
1520
+ height: number;
1521
+ };
1522
+ }
1523
+ /**
1524
+ * This component receives the drop events and updates the layout accordingly
1525
+ */
1526
+ export var FlexibleDragHandler: React.FC<IFlexibleDragHandlerProps>;
1527
+
1528
+
1529
+
1530
+ }
1531
+ declare module BABYLON {
1532
+
1533
+ }
1534
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1535
+ /**
1536
+ * Arguments for the FlexibleDropZone component.
1537
+ */
1538
+ export interface IFlexibleDropZoneProps {
1539
+ /**
1540
+ * The row number of the component in the layout
1541
+ */
1542
+ rowNumber: number;
1543
+ /**
1544
+ * The column number of the component in the layout
1545
+ */
1546
+ columnNumber: number;
1547
+ }
1548
+ /**
1549
+ * This component contains the drag and drop zone for the resize bars that
1550
+ * allow redefining width and height of layout elements
1551
+ */
1552
+ export var FlexibleDropZone: React.FC<IFlexibleDropZoneProps>;
1553
+
1554
+
1555
+
1556
+ }
1557
+ declare module BABYLON {
1558
+
1559
+ }
1560
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1561
+ /**
1562
+ * Arguments for the GridContainer component.
1563
+ */
1564
+ export interface IFlexibleGridContainerProps {
1565
+ }
1566
+ /**
1567
+ * Component responsible for mapping the layout to the actual components
1568
+ */
1569
+ export var FlexibleGridContainer: React.FC<IFlexibleGridContainerProps>;
1570
+
1571
+
1572
+
1573
+ }
1574
+ declare module BABYLON {
1575
+
1576
+ }
1577
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1578
+ /**
1579
+ * Arguments for the BABYLON.GuiEditor.SharedUIComponents.Layout component.
1580
+ */
1581
+ export interface IFlexibleGridLayoutProps {
1582
+ /**
1583
+ * A definition of the layout which can be changed by the user
1584
+ */
1585
+ layoutDefinition: BABYLON.GuiEditor.SharedUIComponents.Layout;
1586
+ }
1587
+ /**
1588
+ * This component represents a grid layout that can be resized and rearranged
1589
+ * by the user.
1590
+ */
1591
+ export var FlexibleGridLayout: React.FC<IFlexibleGridLayoutProps>;
1592
+
1593
+
1594
+
1595
+ }
1596
+ declare module BABYLON {
1597
+
1598
+ }
1599
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1600
+ /**
1601
+ * Arguments for the ResizeBar component.
1602
+ */
1603
+ export interface IFlexibleRowResizerProps {
1604
+ /**
1605
+ * Row number of the component that is being resized
1606
+ */
1607
+ rowNumber: number;
1608
+ /**
1609
+ * Column number of the component being resized
1610
+ */
1611
+ columnNumber: number;
1612
+ /**
1613
+ * If the resizing happens in row or column direction
1614
+ */
1615
+ direction: BABYLON.GuiEditor.SharedUIComponents.ResizeDirections;
1616
+ }
1617
+ /**
1618
+ * The item that will be sent to the drag event
1619
+ */
1620
+ export type ResizeItem = {
1621
+ /**
1622
+ * If the resizing happens in row or column direction
1623
+ */
1624
+ direction: BABYLON.GuiEditor.SharedUIComponents.ResizeDirections;
1625
+ /**
1626
+ * The row number of the component that is being resized
1627
+ */
1628
+ rowNumber: number;
1629
+ /**
1630
+ * the column number of the component being resized
1631
+ */
1632
+ columnNumber: number;
1633
+ };
1634
+ /**
1635
+ * A component that renders a bar that the user can drag to resize.
1636
+ */
1637
+ export var FlexibleResizeBar: React.FC<IFlexibleRowResizerProps>;
1638
+
1639
+
1640
+
1641
+ }
1642
+ declare module BABYLON {
1643
+
1644
+ }
1645
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1646
+ /**
1647
+ * Arguments for the FlexibleTab component.
1648
+ */
1649
+ export interface IFlexibleTabProps {
1650
+ /**
1651
+ * The tab's title.
1652
+ */
1653
+ title: string;
1654
+ /**
1655
+ * If the tab is currently selected or not
1656
+ */
1657
+ selected: boolean;
1658
+ /**
1659
+ * What happens when the user clicks on the tab
1660
+ */
1661
+ onClick: () => void;
1662
+ /**
1663
+ * The object that will be sent to the drag event
1664
+ */
1665
+ item: BABYLON.GuiEditor.SharedUIComponents.TabDrag;
1666
+ /**
1667
+ * What happens when the user drops another tab after this one
1668
+ */
1669
+ onTabDroppedAction: (item: BABYLON.GuiEditor.SharedUIComponents.TabDrag) => void;
1670
+ }
1671
+ /**
1672
+ * A component that renders a tab that the user can click
1673
+ * to activate or drag to reorder. It also listens for
1674
+ * drop events if the user wants to drop another tab
1675
+ * after it.
1676
+ */
1677
+ export var FlexibleTab: React.FC<IFlexibleTabProps>;
1678
+
1679
+
1680
+
1681
+ }
1682
+ declare module BABYLON {
1683
+
1684
+ }
1685
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1686
+ /**
1687
+ * Arguments for the TabsContainer component.
1688
+ */
1689
+ export interface IFlexibleTabsContainerProps {
1690
+ /**
1691
+ * The tabs to display
1692
+ */
1693
+ tabs: BABYLON.GuiEditor.SharedUIComponents.LayoutTab[];
1694
+ /**
1695
+ * Row index of component in layout
1696
+ */
1697
+ rowIndex: number;
1698
+ /**
1699
+ * Column index of component in layout
1700
+ */
1701
+ columnIndex: number;
1702
+ /**
1703
+ * Which tab is selected in the layout
1704
+ */
1705
+ selectedTab?: string;
1706
+ }
1707
+ /**
1708
+ * This component contains a set of tabs of which only one is visible at a time.
1709
+ * The tabs can also be dragged from and to different containers.
1710
+ */
1711
+ export var FlexibleTabsContainer: React.FC<IFlexibleTabsContainerProps>;
1712
+
1713
+
1714
+
1715
+ }
1716
+ declare module BABYLON {
1717
+
1718
+ }
1719
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1720
+ /// <reference types="react" />
1721
+ export var LayoutContext: import("react").Context<{
1722
+ /**
1723
+ * The layout object
1724
+ */
1725
+ layout: BABYLON.GuiEditor.SharedUIComponents.Layout;
1726
+ /**
1727
+ * Function to set the layout object in the context
1728
+ */
1729
+ setLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout) => void;
1730
+ }>;
1731
+
1732
+
1733
+
1734
+ }
1735
+ declare module BABYLON {
1736
+
1737
+ }
1738
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1739
+ export type LayoutTab = {
1740
+ /**
1741
+ * Tab id
1742
+ */
1743
+ id: string;
1744
+ /**
1745
+ * React component rendered by tab
1746
+ */
1747
+ component: React.ReactElement;
1748
+ /**
1749
+ * Tab title
1750
+ */
1751
+ title: string;
1752
+ };
1753
+ export type LayoutTabsRow = {
1754
+ /**
1755
+ * row id
1756
+ */
1757
+ id: string;
1758
+ /**
1759
+ * row height in its containing column
1760
+ */
1761
+ height: string;
1762
+ /**
1763
+ * selected tab in row
1764
+ */
1765
+ selectedTab: string;
1766
+ /**
1767
+ * list of tabs contained in row
1768
+ */
1769
+ tabs: LayoutTab[];
1770
+ };
1771
+ export type LayoutColumn = {
1772
+ /**
1773
+ * column id
1774
+ */
1775
+ id: string;
1776
+ /**
1777
+ * column width in the grid
1778
+ */
1779
+ width: string;
1780
+ /**
1781
+ * column rows
1782
+ */
1783
+ rows: LayoutTabsRow[];
1784
+ };
1785
+ export type Layout = {
1786
+ /**
1787
+ * layout columns
1788
+ */
1789
+ columns?: LayoutColumn[];
1790
+ };
1791
+ export type TabDrag = {
1792
+ /**
1793
+ * row number of the tab being dragged
1794
+ */
1795
+ rowNumber: number;
1796
+ /**
1797
+ * column number of the tab being dragged
1798
+ */
1799
+ columnNumber: number;
1800
+ /**
1801
+ * the tabs being dragged
1802
+ */
1803
+ tabs: {
1804
+ /**
1805
+ * id of tab being dragged
1806
+ */
1807
+ id: string;
1808
+ }[];
1809
+ };
1810
+ export enum ElementTypes {
1811
+ RESIZE_BAR = "0",
1812
+ TAB = "1",
1813
+ TAB_GROUP = "2",
1814
+ NONE = "2"
1815
+ }
1816
+ export enum ResizeDirections {
1817
+ ROW = "row",
1818
+ COLUMN = "column"
1819
+ }
1820
+
1821
+
1822
+
1823
+ }
1824
+ declare module BABYLON {
1825
+
1826
+ }
1827
+ declare module BABYLON.GuiEditor.SharedUIComponents {
1828
+ /**
1829
+ * Given a column and row number in the layout, return the corresponding column/row
1830
+ * @param layout
1831
+ * @param column
1832
+ * @param row
1833
+ * @returns
1834
+ */
1835
+ export const getPosInLayout: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row?: number | undefined) => LayoutColumn;
1836
+ /**
1837
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
1838
+ * @param layout
1839
+ * @param column
1840
+ * @param row
1841
+ */
1842
+ export const removeLayoutRowAndRedistributePercentages: (layout: BABYLON.GuiEditor.SharedUIComponents.Layout, column: number, row: number) => void;
1843
+ /**
1844
+ * Add a percentage string to a number
1845
+ */
1846
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
1847
+ /**
1848
+ * Parses a percentage string into a number
1849
+ * @param p the percentage string
1850
+ */
1851
+ export const parsePercentage: (p: string) => number;
1852
+
1853
+
1854
+
1450
1855
  }
1451
1856
  declare module BABYLON {
1452
1857
 
@@ -2629,11 +3034,17 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
2629
3034
  static readonly NodeWidth = 100;
2630
3035
  private readonly _minZoom;
2631
3036
  private readonly _maxZoom;
3037
+ private _hostCanvasRef;
2632
3038
  private _hostCanvas;
3039
+ private _graphCanvasRef;
2633
3040
  private _graphCanvas;
3041
+ private _selectionContainerRef;
2634
3042
  private _selectionContainer;
3043
+ private _frameContainerRef;
2635
3044
  private _frameContainer;
3045
+ private _svgCanvasRef;
2636
3046
  private _svgCanvas;
3047
+ private _rootContainerRef;
2637
3048
  private _rootContainer;
2638
3049
  private _nodes;
2639
3050
  private _links;
@@ -2916,6 +3327,8 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
2916
3327
  private _displayManager;
2917
3328
  private _isVisible;
2918
3329
  private _enclosingFrameId;
3330
+ addClassToVisual(className: string): void;
3331
+ removeClassFromVisual(className: string): void;
2919
3332
  get isVisible(): boolean;
2920
3333
  set isVisible(value: boolean);
2921
3334
  private _upateNodePortNames;
@@ -3367,6 +3780,58 @@ declare module BABYLON.GuiEditor.SharedUIComponents {
3367
3780
 
3368
3781
 
3369
3782
 
3783
+ }
3784
+ declare module BABYLON {
3785
+
3786
+ }
3787
+ declare module BABYLON.GuiEditor.SharedUIComponents {
3788
+ /// <reference types="react" />
3789
+ var _default: {
3790
+ component: import("react").FC<BABYLON.GuiEditor.SharedUIComponents.IFlexibleGridLayoutProps>;
3791
+ };
3792
+ export var Default: {
3793
+ render: (props: BABYLON.GuiEditor.SharedUIComponents.IFlexibleGridLayoutProps) => JSX.Element;
3794
+ args: {
3795
+ layoutDefinition: {
3796
+ columns: {
3797
+ id: string;
3798
+ width: string;
3799
+ rows: {
3800
+ id: string;
3801
+ height: string;
3802
+ selectedTab: string;
3803
+ tabs: {
3804
+ id: string;
3805
+ component: JSX.Element;
3806
+ }[];
3807
+ }[];
3808
+ }[];
3809
+ };
3810
+ };
3811
+ };
3812
+ export var TwoColumn: {
3813
+ render: (props: BABYLON.GuiEditor.SharedUIComponents.IFlexibleGridLayoutProps) => JSX.Element;
3814
+ args: {
3815
+ layoutDefinition: {
3816
+ columns: {
3817
+ id: string;
3818
+ width: string;
3819
+ rows: {
3820
+ id: string;
3821
+ height: string;
3822
+ selectedTab: string;
3823
+ tabs: {
3824
+ id: string;
3825
+ component: JSX.Element;
3826
+ }[];
3827
+ }[];
3828
+ }[];
3829
+ };
3830
+ };
3831
+ };
3832
+
3833
+
3834
+
3370
3835
  }
3371
3836
  declare module BABYLON {
3372
3837