@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.
@@ -217,6 +217,8 @@ interface ICommonControlPropertyGridComponentProps {
217
217
  interface ICommonControlPropertyGridComponentState {
218
218
  fontFamilyOptions: IInspectableOptions[];
219
219
  value: number;
220
+ invalidFonts: string[];
221
+ invalidFontAlertName?: string;
220
222
  }
221
223
  export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps, ICommonControlPropertyGridComponentState> {
222
224
  private _onPropertyChangedObserver;
@@ -1727,6 +1729,366 @@ export type LabelProps = {
1727
1729
  };
1728
1730
  export const Label: React.FC<LabelProps>;
1729
1731
 
1732
+ }
1733
+ declare module "@babylonjs/gui-editor/components/layout/DraggableIcon" {
1734
+ import { FC } from "react";
1735
+ import { ElementTypes, TabDrag } from "@babylonjs/gui-editor/components/layout/types";
1736
+ /**
1737
+ * Arguments for the DraggableIcon component.
1738
+ */
1739
+ export interface IDraggableIconProps {
1740
+ /**
1741
+ * Icon source
1742
+ */
1743
+ src: string;
1744
+ /**
1745
+ * Object that will be passed to the drag event
1746
+ */
1747
+ item: TabDrag;
1748
+ /**
1749
+ * Type of drag event
1750
+ */
1751
+ type: ElementTypes;
1752
+ }
1753
+ /**
1754
+ * An icon that can be dragged by the user
1755
+ */
1756
+ export const DraggableIcon: FC<IDraggableIconProps>;
1757
+
1758
+ }
1759
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleColumn" {
1760
+ import { FC } from "react";
1761
+ /**
1762
+ * Arguments for the Column component.
1763
+ */
1764
+ export interface IFlexibleColumnProps {
1765
+ /**
1766
+ * Width of column
1767
+ */
1768
+ width: string;
1769
+ }
1770
+ /**
1771
+ * This component represents a single column in the layout. It receives a width
1772
+ * that it occupies and the content to display
1773
+ * @param props
1774
+ * @returns
1775
+ */
1776
+ export const FlexibleColumn: FC<IFlexibleColumnProps>;
1777
+
1778
+ }
1779
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleDragHandler" {
1780
+ import { FC } from "react";
1781
+ /**
1782
+ * Arguments for the DragHandler component.
1783
+ */
1784
+ export interface IFlexibleDragHandlerProps {
1785
+ /**
1786
+ * The size of the containing element. Used to calculate the percentage of
1787
+ * space occupied by the component
1788
+ */
1789
+ containerSize: {
1790
+ width: number;
1791
+ height: number;
1792
+ };
1793
+ }
1794
+ /**
1795
+ * This component receives the drop events and updates the layout accordingly
1796
+ */
1797
+ export const FlexibleDragHandler: FC<IFlexibleDragHandlerProps>;
1798
+
1799
+ }
1800
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleDropZone" {
1801
+ import { FC } from "react";
1802
+ /**
1803
+ * Arguments for the FlexibleDropZone component.
1804
+ */
1805
+ export interface IFlexibleDropZoneProps {
1806
+ /**
1807
+ * The row number of the component in the layout
1808
+ */
1809
+ rowNumber: number;
1810
+ /**
1811
+ * The column number of the component in the layout
1812
+ */
1813
+ columnNumber: number;
1814
+ }
1815
+ /**
1816
+ * This component contains the drag and drop zone for the resize bars that
1817
+ * allow redefining width and height of layout elements
1818
+ */
1819
+ export const FlexibleDropZone: FC<IFlexibleDropZoneProps>;
1820
+
1821
+ }
1822
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleGridContainer" {
1823
+ import { FC } from "react";
1824
+ /**
1825
+ * Arguments for the GridContainer component.
1826
+ */
1827
+ export interface IFlexibleGridContainerProps {
1828
+ }
1829
+ /**
1830
+ * Component responsible for mapping the layout to the actual components
1831
+ */
1832
+ export const FlexibleGridContainer: FC<IFlexibleGridContainerProps>;
1833
+
1834
+ }
1835
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleGridLayout" {
1836
+ import { FC } from "react";
1837
+ import { Layout } from "@babylonjs/gui-editor/components/layout/types";
1838
+ /**
1839
+ * Arguments for the Layout component.
1840
+ */
1841
+ export interface IFlexibleGridLayoutProps {
1842
+ /**
1843
+ * A definition of the layout which can be changed by the user
1844
+ */
1845
+ layoutDefinition: Layout;
1846
+ }
1847
+ /**
1848
+ * This component represents a grid layout that can be resized and rearranged
1849
+ * by the user.
1850
+ */
1851
+ export const FlexibleGridLayout: FC<IFlexibleGridLayoutProps>;
1852
+
1853
+ }
1854
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleResizeBar" {
1855
+ import { FC } from "react";
1856
+ import { ResizeDirections } from "@babylonjs/gui-editor/components/layout/types";
1857
+ /**
1858
+ * Arguments for the ResizeBar component.
1859
+ */
1860
+ export interface IFlexibleRowResizerProps {
1861
+ /**
1862
+ * Row number of the component that is being resized
1863
+ */
1864
+ rowNumber: number;
1865
+ /**
1866
+ * Column number of the component being resized
1867
+ */
1868
+ columnNumber: number;
1869
+ /**
1870
+ * If the resizing happens in row or column direction
1871
+ */
1872
+ direction: ResizeDirections;
1873
+ }
1874
+ /**
1875
+ * The item that will be sent to the drag event
1876
+ */
1877
+ export type ResizeItem = {
1878
+ /**
1879
+ * If the resizing happens in row or column direction
1880
+ */
1881
+ direction: ResizeDirections;
1882
+ /**
1883
+ * The row number of the component that is being resized
1884
+ */
1885
+ rowNumber: number;
1886
+ /**
1887
+ * the column number of the component being resized
1888
+ */
1889
+ columnNumber: number;
1890
+ };
1891
+ /**
1892
+ * A component that renders a bar that the user can drag to resize.
1893
+ */
1894
+ export const FlexibleResizeBar: FC<IFlexibleRowResizerProps>;
1895
+
1896
+ }
1897
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleTab" {
1898
+ import { FC } from "react";
1899
+ import { TabDrag } from "@babylonjs/gui-editor/components/layout/types";
1900
+ /**
1901
+ * Arguments for the FlexibleTab component.
1902
+ */
1903
+ export interface IFlexibleTabProps {
1904
+ /**
1905
+ * The tab's title.
1906
+ */
1907
+ title: string;
1908
+ /**
1909
+ * If the tab is currently selected or not
1910
+ */
1911
+ selected: boolean;
1912
+ /**
1913
+ * What happens when the user clicks on the tab
1914
+ */
1915
+ onClick: () => void;
1916
+ /**
1917
+ * The object that will be sent to the drag event
1918
+ */
1919
+ item: TabDrag;
1920
+ /**
1921
+ * What happens when the user drops another tab after this one
1922
+ */
1923
+ onTabDroppedAction: (item: TabDrag) => void;
1924
+ }
1925
+ /**
1926
+ * A component that renders a tab that the user can click
1927
+ * to activate or drag to reorder. It also listens for
1928
+ * drop events if the user wants to drop another tab
1929
+ * after it.
1930
+ */
1931
+ export const FlexibleTab: FC<IFlexibleTabProps>;
1932
+
1933
+ }
1934
+ declare module "@babylonjs/gui-editor/components/layout/FlexibleTabsContainer" {
1935
+ import { FC } from "react";
1936
+ import { LayoutTab } from "@babylonjs/gui-editor/components/layout/types";
1937
+ /**
1938
+ * Arguments for the TabsContainer component.
1939
+ */
1940
+ export interface IFlexibleTabsContainerProps {
1941
+ /**
1942
+ * The tabs to display
1943
+ */
1944
+ tabs: LayoutTab[];
1945
+ /**
1946
+ * Row index of component in layout
1947
+ */
1948
+ rowIndex: number;
1949
+ /**
1950
+ * Column index of component in layout
1951
+ */
1952
+ columnIndex: number;
1953
+ /**
1954
+ * Which tab is selected in the layout
1955
+ */
1956
+ selectedTab?: string;
1957
+ }
1958
+ /**
1959
+ * This component contains a set of tabs of which only one is visible at a time.
1960
+ * The tabs can also be dragged from and to different containers.
1961
+ */
1962
+ export const FlexibleTabsContainer: FC<IFlexibleTabsContainerProps>;
1963
+
1964
+ }
1965
+ declare module "@babylonjs/gui-editor/components/layout/LayoutContext" {
1966
+ /// <reference types="react" />
1967
+ import { Layout } from "@babylonjs/gui-editor/components/layout/types";
1968
+ export const LayoutContext: import("react").Context<{
1969
+ /**
1970
+ * The layout object
1971
+ */
1972
+ layout: Layout;
1973
+ /**
1974
+ * Function to set the layout object in the context
1975
+ */
1976
+ setLayout: (layout: Layout) => void;
1977
+ }>;
1978
+
1979
+ }
1980
+ declare module "@babylonjs/gui-editor/components/layout/types" {
1981
+ import { ReactElement } from "react";
1982
+ export type LayoutTab = {
1983
+ /**
1984
+ * Tab id
1985
+ */
1986
+ id: string;
1987
+ /**
1988
+ * React component rendered by tab
1989
+ */
1990
+ component: ReactElement;
1991
+ /**
1992
+ * Tab title
1993
+ */
1994
+ title: string;
1995
+ };
1996
+ export type LayoutTabsRow = {
1997
+ /**
1998
+ * row id
1999
+ */
2000
+ id: string;
2001
+ /**
2002
+ * row height in its containing column
2003
+ */
2004
+ height: string;
2005
+ /**
2006
+ * selected tab in row
2007
+ */
2008
+ selectedTab: string;
2009
+ /**
2010
+ * list of tabs contained in row
2011
+ */
2012
+ tabs: LayoutTab[];
2013
+ };
2014
+ export type LayoutColumn = {
2015
+ /**
2016
+ * column id
2017
+ */
2018
+ id: string;
2019
+ /**
2020
+ * column width in the grid
2021
+ */
2022
+ width: string;
2023
+ /**
2024
+ * column rows
2025
+ */
2026
+ rows: LayoutTabsRow[];
2027
+ };
2028
+ export type Layout = {
2029
+ /**
2030
+ * layout columns
2031
+ */
2032
+ columns?: LayoutColumn[];
2033
+ };
2034
+ export type TabDrag = {
2035
+ /**
2036
+ * row number of the tab being dragged
2037
+ */
2038
+ rowNumber: number;
2039
+ /**
2040
+ * column number of the tab being dragged
2041
+ */
2042
+ columnNumber: number;
2043
+ /**
2044
+ * the tabs being dragged
2045
+ */
2046
+ tabs: {
2047
+ /**
2048
+ * id of tab being dragged
2049
+ */
2050
+ id: string;
2051
+ }[];
2052
+ };
2053
+ export enum ElementTypes {
2054
+ RESIZE_BAR = "0",
2055
+ TAB = "1",
2056
+ TAB_GROUP = "2",
2057
+ NONE = "2"
2058
+ }
2059
+ export enum ResizeDirections {
2060
+ ROW = "row",
2061
+ COLUMN = "column"
2062
+ }
2063
+
2064
+ }
2065
+ declare module "@babylonjs/gui-editor/components/layout/utils" {
2066
+ import { Layout } from "@babylonjs/gui-editor/components/layout/types";
2067
+ /**
2068
+ * Given a column and row number in the layout, return the corresponding column/row
2069
+ * @param layout
2070
+ * @param column
2071
+ * @param row
2072
+ * @returns
2073
+ */
2074
+ export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => import("@babylonjs/gui-editor/components/layout/types").LayoutTabsRow | import("./types").LayoutColumn;
2075
+ /**
2076
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
2077
+ * @param layout
2078
+ * @param column
2079
+ * @param row
2080
+ */
2081
+ export const removeLayoutRowAndRedistributePercentages: (layout: Layout, column: number, row: number) => void;
2082
+ /**
2083
+ * Add a percentage string to a number
2084
+ */
2085
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
2086
+ /**
2087
+ * Parses a percentage string into a number
2088
+ * @param p the percentage string
2089
+ */
2090
+ export const parsePercentage: (p: string) => number;
2091
+
1730
2092
  }
1731
2093
  declare module "@babylonjs/gui-editor/components/lines/ColorLineComponent" {
1732
2094
  import * as React from "react";
@@ -2836,11 +3198,17 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
2836
3198
  static readonly NodeWidth: number;
2837
3199
  private readonly _minZoom;
2838
3200
  private readonly _maxZoom;
3201
+ private _hostCanvasRef;
2839
3202
  private _hostCanvas;
3203
+ private _graphCanvasRef;
2840
3204
  private _graphCanvas;
3205
+ private _selectionContainerRef;
2841
3206
  private _selectionContainer;
3207
+ private _frameContainerRef;
2842
3208
  private _frameContainer;
3209
+ private _svgCanvasRef;
2843
3210
  private _svgCanvas;
3211
+ private _rootContainerRef;
2844
3212
  private _rootContainer;
2845
3213
  private _nodes;
2846
3214
  private _links;
@@ -3128,6 +3496,8 @@ export class GraphNode {
3128
3496
  private _displayManager;
3129
3497
  private _isVisible;
3130
3498
  private _enclosingFrameId;
3499
+ addClassToVisual(className: string): void;
3500
+ removeClassFromVisual(className: string): void;
3131
3501
  get isVisible(): boolean;
3132
3502
  set isVisible(value: boolean);
3133
3503
  private _upateNodePortNames;
@@ -3536,6 +3906,55 @@ const _default: {
3536
3906
  export default _default;
3537
3907
  export const Default: any;
3538
3908
 
3909
+ }
3910
+ declare module "@babylonjs/gui-editor/stories/layout/FlexibleGridLayout.stories" {
3911
+ /// <reference types="react" />
3912
+ import { IFlexibleGridLayoutProps } from "@babylonjs/gui-editor/components/layout/FlexibleGridLayout";
3913
+ const _default: {
3914
+ component: import("react").FC<IFlexibleGridLayoutProps>;
3915
+ };
3916
+ export default _default;
3917
+ export const Default: {
3918
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
3919
+ args: {
3920
+ layoutDefinition: {
3921
+ columns: {
3922
+ id: string;
3923
+ width: string;
3924
+ rows: {
3925
+ id: string;
3926
+ height: string;
3927
+ selectedTab: string;
3928
+ tabs: {
3929
+ id: string;
3930
+ component: JSX.Element;
3931
+ }[];
3932
+ }[];
3933
+ }[];
3934
+ };
3935
+ };
3936
+ };
3937
+ export const TwoColumn: {
3938
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
3939
+ args: {
3940
+ layoutDefinition: {
3941
+ columns: {
3942
+ id: string;
3943
+ width: string;
3944
+ rows: {
3945
+ id: string;
3946
+ height: string;
3947
+ selectedTab: string;
3948
+ tabs: {
3949
+ id: string;
3950
+ component: JSX.Element;
3951
+ }[];
3952
+ }[];
3953
+ }[];
3954
+ };
3955
+ };
3956
+ };
3957
+
3539
3958
  }
3540
3959
  declare module "@babylonjs/gui-editor/stories/lines/ColorLineComponent.stories" {
3541
3960
  /// <reference types="react" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/gui-editor",
3
- "version": "5.28.0",
3
+ "version": "5.30.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.0",
28
- "@babylonjs/gui": "^5.28.0",
27
+ "@babylonjs/core": "^5.30.0",
28
+ "@babylonjs/gui": "^5.30.0",
29
29
  "react": "^17.0.2",
30
30
  "react-dom": "^17.0.2",
31
31
  "rimraf": "^3.0.2",