@babylonjs/inspector 5.27.1 → 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.
@@ -4621,6 +4621,362 @@ export type LabelProps = {
4621
4621
  };
4622
4622
  export const Label: React.FC<LabelProps>;
4623
4623
 
4624
+ }
4625
+ declare module "@babylonjs/inspector/components/layout/DraggableIcon" {
4626
+ import { FC } from "react";
4627
+ import { ElementTypes, TabDrag } from "@babylonjs/inspector/components/layout/types";
4628
+ /**
4629
+ * Arguments for the DraggableIcon component.
4630
+ */
4631
+ export interface IDraggableIconProps {
4632
+ /**
4633
+ * Icon source
4634
+ */
4635
+ src: string;
4636
+ /**
4637
+ * Object that will be passed to the drag event
4638
+ */
4639
+ item: TabDrag;
4640
+ /**
4641
+ * Type of drag event
4642
+ */
4643
+ type: ElementTypes;
4644
+ }
4645
+ /**
4646
+ * An icon that can be dragged by the user
4647
+ */
4648
+ export const DraggableIcon: FC<IDraggableIconProps>;
4649
+
4650
+ }
4651
+ declare module "@babylonjs/inspector/components/layout/FlexibleColumn" {
4652
+ import { FC } from "react";
4653
+ /**
4654
+ * Arguments for the Column component.
4655
+ */
4656
+ export interface IFlexibleColumnProps {
4657
+ /**
4658
+ * Width of column
4659
+ */
4660
+ width: string;
4661
+ }
4662
+ /**
4663
+ * This component represents a single column in the layout. It receives a width
4664
+ * that it occupies and the content to display
4665
+ * @param props
4666
+ * @returns
4667
+ */
4668
+ export const FlexibleColumn: FC<IFlexibleColumnProps>;
4669
+
4670
+ }
4671
+ declare module "@babylonjs/inspector/components/layout/FlexibleDragHandler" {
4672
+ import { FC } from "react";
4673
+ /**
4674
+ * Arguments for the DragHandler component.
4675
+ */
4676
+ export interface IFlexibleDragHandlerProps {
4677
+ /**
4678
+ * The size of the containing element. Used to calculate the percentage of
4679
+ * space occupied by the component
4680
+ */
4681
+ containerSize: {
4682
+ width: number;
4683
+ height: number;
4684
+ };
4685
+ }
4686
+ /**
4687
+ * This component receives the drop events and updates the layout accordingly
4688
+ */
4689
+ export const FlexibleDragHandler: FC<IFlexibleDragHandlerProps>;
4690
+
4691
+ }
4692
+ declare module "@babylonjs/inspector/components/layout/FlexibleDropZone" {
4693
+ import { FC } from "react";
4694
+ /**
4695
+ * Arguments for the FlexibleDropZone component.
4696
+ */
4697
+ export interface IFlexibleDropZoneProps {
4698
+ /**
4699
+ * The row number of the component in the layout
4700
+ */
4701
+ rowNumber: number;
4702
+ /**
4703
+ * The column number of the component in the layout
4704
+ */
4705
+ columnNumber: number;
4706
+ }
4707
+ /**
4708
+ * This component contains the drag and drop zone for the resize bars that
4709
+ * allow redefining width and height of layout elements
4710
+ */
4711
+ export const FlexibleDropZone: FC<IFlexibleDropZoneProps>;
4712
+
4713
+ }
4714
+ declare module "@babylonjs/inspector/components/layout/FlexibleGridContainer" {
4715
+ import { FC } from "react";
4716
+ /**
4717
+ * Arguments for the GridContainer component.
4718
+ */
4719
+ export interface IFlexibleGridContainerProps {
4720
+ }
4721
+ /**
4722
+ * Component responsible for mapping the layout to the actual components
4723
+ */
4724
+ export const FlexibleGridContainer: FC<IFlexibleGridContainerProps>;
4725
+
4726
+ }
4727
+ declare module "@babylonjs/inspector/components/layout/FlexibleGridLayout" {
4728
+ import { FC } from "react";
4729
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4730
+ /**
4731
+ * Arguments for the Layout component.
4732
+ */
4733
+ export interface IFlexibleGridLayoutProps {
4734
+ /**
4735
+ * A definition of the layout which can be changed by the user
4736
+ */
4737
+ layoutDefinition: Layout;
4738
+ }
4739
+ /**
4740
+ * This component represents a grid layout that can be resized and rearranged
4741
+ * by the user.
4742
+ */
4743
+ export const FlexibleGridLayout: FC<IFlexibleGridLayoutProps>;
4744
+
4745
+ }
4746
+ declare module "@babylonjs/inspector/components/layout/FlexibleResizeBar" {
4747
+ import { FC } from "react";
4748
+ import { ResizeDirections } from "@babylonjs/inspector/components/layout/types";
4749
+ /**
4750
+ * Arguments for the ResizeBar component.
4751
+ */
4752
+ export interface IFlexibleRowResizerProps {
4753
+ /**
4754
+ * Row number of the component that is being resized
4755
+ */
4756
+ rowNumber: number;
4757
+ /**
4758
+ * Column number of the component being resized
4759
+ */
4760
+ columnNumber: number;
4761
+ /**
4762
+ * If the resizing happens in row or column direction
4763
+ */
4764
+ direction: ResizeDirections;
4765
+ }
4766
+ /**
4767
+ * The item that will be sent to the drag event
4768
+ */
4769
+ export type ResizeItem = {
4770
+ /**
4771
+ * If the resizing happens in row or column direction
4772
+ */
4773
+ direction: ResizeDirections;
4774
+ /**
4775
+ * The row number of the component that is being resized
4776
+ */
4777
+ rowNumber: number;
4778
+ /**
4779
+ * the column number of the component being resized
4780
+ */
4781
+ columnNumber: number;
4782
+ };
4783
+ /**
4784
+ * A component that renders a bar that the user can drag to resize.
4785
+ */
4786
+ export const FlexibleResizeBar: FC<IFlexibleRowResizerProps>;
4787
+
4788
+ }
4789
+ declare module "@babylonjs/inspector/components/layout/FlexibleTab" {
4790
+ import { FC } from "react";
4791
+ import { TabDrag } from "@babylonjs/inspector/components/layout/types";
4792
+ /**
4793
+ * Arguments for the FlexibleTab component.
4794
+ */
4795
+ export interface IFlexibleTabProps {
4796
+ /**
4797
+ * The tab's title.
4798
+ */
4799
+ title: string;
4800
+ /**
4801
+ * If the tab is currently selected or not
4802
+ */
4803
+ selected: boolean;
4804
+ /**
4805
+ * What happens when the user clicks on the tab
4806
+ */
4807
+ onClick: () => void;
4808
+ /**
4809
+ * The object that will be sent to the drag event
4810
+ */
4811
+ item: TabDrag;
4812
+ /**
4813
+ * What happens when the user drops another tab after this one
4814
+ */
4815
+ onTabDroppedAction: (item: TabDrag) => void;
4816
+ }
4817
+ /**
4818
+ * A component that renders a tab that the user can click
4819
+ * to activate or drag to reorder. It also listens for
4820
+ * drop events if the user wants to drop another tab
4821
+ * after it.
4822
+ */
4823
+ export const FlexibleTab: FC<IFlexibleTabProps>;
4824
+
4825
+ }
4826
+ declare module "@babylonjs/inspector/components/layout/FlexibleTabsContainer" {
4827
+ import { FC } from "react";
4828
+ import { LayoutTab } from "@babylonjs/inspector/components/layout/types";
4829
+ /**
4830
+ * Arguments for the TabsContainer component.
4831
+ */
4832
+ export interface IFlexibleTabsContainerProps {
4833
+ /**
4834
+ * The tabs to display
4835
+ */
4836
+ tabs: LayoutTab[];
4837
+ /**
4838
+ * Row index of component in layout
4839
+ */
4840
+ rowIndex: number;
4841
+ /**
4842
+ * Column index of component in layout
4843
+ */
4844
+ columnIndex: number;
4845
+ /**
4846
+ * Which tab is selected in the layout
4847
+ */
4848
+ selectedTab?: string;
4849
+ }
4850
+ /**
4851
+ * This component contains a set of tabs of which only one is visible at a time.
4852
+ * The tabs can also be dragged from and to different containers.
4853
+ */
4854
+ export const FlexibleTabsContainer: FC<IFlexibleTabsContainerProps>;
4855
+
4856
+ }
4857
+ declare module "@babylonjs/inspector/components/layout/LayoutContext" {
4858
+ /// <reference types="react" />
4859
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4860
+ export const LayoutContext: import("react").Context<{
4861
+ /**
4862
+ * The layout object
4863
+ */
4864
+ layout: Layout;
4865
+ /**
4866
+ * Function to set the layout object in the context
4867
+ */
4868
+ setLayout: (layout: Layout) => void;
4869
+ }>;
4870
+
4871
+ }
4872
+ declare module "@babylonjs/inspector/components/layout/types" {
4873
+ import { ComponentType } from "react";
4874
+ export type LayoutTab = {
4875
+ /**
4876
+ * Tab id
4877
+ */
4878
+ id: string;
4879
+ /**
4880
+ * React component rendered by tab
4881
+ */
4882
+ component: ComponentType;
4883
+ };
4884
+ export type LayoutTabsRow = {
4885
+ /**
4886
+ * row id
4887
+ */
4888
+ id: string;
4889
+ /**
4890
+ * row height in its containing column
4891
+ */
4892
+ height: string;
4893
+ /**
4894
+ * selected tab in row
4895
+ */
4896
+ selectedTab: string;
4897
+ /**
4898
+ * list of tabs contained in row
4899
+ */
4900
+ tabs: LayoutTab[];
4901
+ };
4902
+ export type LayoutColumn = {
4903
+ /**
4904
+ * column id
4905
+ */
4906
+ id: string;
4907
+ /**
4908
+ * column width in the grid
4909
+ */
4910
+ width: string;
4911
+ /**
4912
+ * column rows
4913
+ */
4914
+ rows: LayoutTabsRow[];
4915
+ };
4916
+ export type Layout = {
4917
+ /**
4918
+ * layout columns
4919
+ */
4920
+ columns?: LayoutColumn[];
4921
+ };
4922
+ export type TabDrag = {
4923
+ /**
4924
+ * row number of the tab being dragged
4925
+ */
4926
+ rowNumber: number;
4927
+ /**
4928
+ * column number of the tab being dragged
4929
+ */
4930
+ columnNumber: number;
4931
+ /**
4932
+ * the tabs being dragged
4933
+ */
4934
+ tabs: {
4935
+ /**
4936
+ * id of tab being dragged
4937
+ */
4938
+ id: string;
4939
+ }[];
4940
+ };
4941
+ export enum ElementTypes {
4942
+ RESIZE_BAR = "0",
4943
+ TAB = "1",
4944
+ TAB_GROUP = "2",
4945
+ NONE = "2"
4946
+ }
4947
+ export enum ResizeDirections {
4948
+ ROW = "row",
4949
+ COLUMN = "column"
4950
+ }
4951
+
4952
+ }
4953
+ declare module "@babylonjs/inspector/components/layout/utils" {
4954
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4955
+ /**
4956
+ * Given a column and row number in the layout, return the corresponding column/row
4957
+ * @param layout
4958
+ * @param column
4959
+ * @param row
4960
+ * @returns
4961
+ */
4962
+ export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => import("@babylonjs/inspector/components/layout/types").LayoutTabsRow | import("./types").LayoutColumn;
4963
+ /**
4964
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
4965
+ * @param layout
4966
+ * @param column
4967
+ * @param row
4968
+ */
4969
+ export const removeLayoutRowAndRedistributePercentages: (layout: Layout, column: number, row: number) => void;
4970
+ /**
4971
+ * Add a percentage string to a number
4972
+ */
4973
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
4974
+ /**
4975
+ * Parses a percentage string into a number
4976
+ * @param p the percentage string
4977
+ */
4978
+ export const parsePercentage: (p: string) => number;
4979
+
4624
4980
  }
4625
4981
  declare module "@babylonjs/inspector/components/lines/ColorLineComponent" {
4626
4982
  import * as React from "react";
@@ -6430,6 +6786,55 @@ const _default: {
6430
6786
  export default _default;
6431
6787
  export const Default: any;
6432
6788
 
6789
+ }
6790
+ declare module "@babylonjs/inspector/stories/layout/FlexibleGridLayout.stories" {
6791
+ /// <reference types="react" />
6792
+ import { IFlexibleGridLayoutProps } from "@babylonjs/inspector/components/layout/FlexibleGridLayout";
6793
+ const _default: {
6794
+ component: import("react").FC<IFlexibleGridLayoutProps>;
6795
+ };
6796
+ export default _default;
6797
+ export const Default: {
6798
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
6799
+ args: {
6800
+ layoutDefinition: {
6801
+ columns: {
6802
+ id: string;
6803
+ width: string;
6804
+ rows: {
6805
+ id: string;
6806
+ height: string;
6807
+ selectedTab: string;
6808
+ tabs: {
6809
+ id: string;
6810
+ component: JSX.Element;
6811
+ }[];
6812
+ }[];
6813
+ }[];
6814
+ };
6815
+ };
6816
+ };
6817
+ export const TwoColumn: {
6818
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
6819
+ args: {
6820
+ layoutDefinition: {
6821
+ columns: {
6822
+ id: string;
6823
+ width: string;
6824
+ rows: {
6825
+ id: string;
6826
+ height: string;
6827
+ selectedTab: string;
6828
+ tabs: {
6829
+ id: string;
6830
+ component: JSX.Element;
6831
+ }[];
6832
+ }[];
6833
+ }[];
6834
+ };
6835
+ };
6836
+ };
6837
+
6433
6838
  }
6434
6839
  declare module "@babylonjs/inspector/stories/lines/ColorLineComponent.stories" {
6435
6840
  /// <reference types="react" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/inspector",
3
- "version": "5.27.1",
3
+ "version": "5.29.0",
4
4
  "module": "dist/babylon.inspector.bundle.max.js",
5
5
  "main": "dist/babylon.inspector.bundle.max.js",
6
6
  "typings": "dist/babylon.inspector.module.d.ts",
@@ -32,12 +32,12 @@
32
32
  "@types/react-dom": ">=16.0.9"
33
33
  },
34
34
  "devDependencies": {
35
- "@babylonjs/core": "^5.27.1",
36
- "@babylonjs/gui": "^5.27.1",
37
- "@babylonjs/gui-editor": "^5.27.1",
38
- "@babylonjs/loaders": "^5.27.1",
39
- "@babylonjs/materials": "^5.27.1",
40
- "@babylonjs/serializers": "^5.27.1",
35
+ "@babylonjs/core": "^5.29.0",
36
+ "@babylonjs/gui": "^5.29.0",
37
+ "@babylonjs/gui-editor": "^5.29.0",
38
+ "@babylonjs/loaders": "^5.29.0",
39
+ "@babylonjs/materials": "^5.29.0",
40
+ "@babylonjs/serializers": "^5.29.0",
41
41
  "@lts/gui": "1.0.0",
42
42
  "react": "^17.0.2",
43
43
  "react-dom": "^17.0.2",