@babylonjs/inspector 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.
@@ -3905,8 +3905,10 @@ import { IExplorerExtensibilityGroup } from "@babylonjs/core/Debug/debugLayer";
3905
3905
  import { Scene } from "@babylonjs/core/scene";
3906
3906
  import * as React from "react";
3907
3907
  import { GlobalState } from "@babylonjs/inspector/components/globalState";
3908
+ import { Camera } from "@babylonjs/core/Cameras/camera";
3908
3909
  interface ISceneTreeItemComponentProps {
3909
3910
  scene: Scene;
3911
+ gizmoCamera?: Camera;
3910
3912
  onRefresh: () => void;
3911
3913
  selectedEntity?: any;
3912
3914
  extensibilityGroups?: IExplorerExtensibilityGroup[];
@@ -4080,6 +4082,7 @@ import { Nullable } from "@babylonjs/core/types";
4080
4082
  import { IExplorerAdditionalNode, IExplorerExtensibilityGroup } from "@babylonjs/core/Debug/debugLayer";
4081
4083
  import { Scene } from "@babylonjs/core/scene";
4082
4084
  import { GlobalState } from "@babylonjs/inspector/components/globalState";
4085
+ import { Camera } from "@babylonjs/core/Cameras/camera";
4083
4086
  import "@babylonjs/core/Sprites/spriteSceneComponent";
4084
4087
  import "@babylonjs/core/Audio/audioSceneComponent";
4085
4088
  import "@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
@@ -4093,6 +4096,7 @@ export class SceneExplorerFilterComponent extends React.Component<ISceneExplorer
4093
4096
  }
4094
4097
  interface ISceneExplorerComponentProps {
4095
4098
  scene: Scene;
4099
+ gizmoCamera?: Camera;
4096
4100
  noCommands?: boolean;
4097
4101
  noHeader?: boolean;
4098
4102
  noExpand?: boolean;
@@ -4621,6 +4625,366 @@ export type LabelProps = {
4621
4625
  };
4622
4626
  export const Label: React.FC<LabelProps>;
4623
4627
 
4628
+ }
4629
+ declare module "@babylonjs/inspector/components/layout/DraggableIcon" {
4630
+ import { FC } from "react";
4631
+ import { ElementTypes, TabDrag } from "@babylonjs/inspector/components/layout/types";
4632
+ /**
4633
+ * Arguments for the DraggableIcon component.
4634
+ */
4635
+ export interface IDraggableIconProps {
4636
+ /**
4637
+ * Icon source
4638
+ */
4639
+ src: string;
4640
+ /**
4641
+ * Object that will be passed to the drag event
4642
+ */
4643
+ item: TabDrag;
4644
+ /**
4645
+ * Type of drag event
4646
+ */
4647
+ type: ElementTypes;
4648
+ }
4649
+ /**
4650
+ * An icon that can be dragged by the user
4651
+ */
4652
+ export const DraggableIcon: FC<IDraggableIconProps>;
4653
+
4654
+ }
4655
+ declare module "@babylonjs/inspector/components/layout/FlexibleColumn" {
4656
+ import { FC } from "react";
4657
+ /**
4658
+ * Arguments for the Column component.
4659
+ */
4660
+ export interface IFlexibleColumnProps {
4661
+ /**
4662
+ * Width of column
4663
+ */
4664
+ width: string;
4665
+ }
4666
+ /**
4667
+ * This component represents a single column in the layout. It receives a width
4668
+ * that it occupies and the content to display
4669
+ * @param props
4670
+ * @returns
4671
+ */
4672
+ export const FlexibleColumn: FC<IFlexibleColumnProps>;
4673
+
4674
+ }
4675
+ declare module "@babylonjs/inspector/components/layout/FlexibleDragHandler" {
4676
+ import { FC } from "react";
4677
+ /**
4678
+ * Arguments for the DragHandler component.
4679
+ */
4680
+ export interface IFlexibleDragHandlerProps {
4681
+ /**
4682
+ * The size of the containing element. Used to calculate the percentage of
4683
+ * space occupied by the component
4684
+ */
4685
+ containerSize: {
4686
+ width: number;
4687
+ height: number;
4688
+ };
4689
+ }
4690
+ /**
4691
+ * This component receives the drop events and updates the layout accordingly
4692
+ */
4693
+ export const FlexibleDragHandler: FC<IFlexibleDragHandlerProps>;
4694
+
4695
+ }
4696
+ declare module "@babylonjs/inspector/components/layout/FlexibleDropZone" {
4697
+ import { FC } from "react";
4698
+ /**
4699
+ * Arguments for the FlexibleDropZone component.
4700
+ */
4701
+ export interface IFlexibleDropZoneProps {
4702
+ /**
4703
+ * The row number of the component in the layout
4704
+ */
4705
+ rowNumber: number;
4706
+ /**
4707
+ * The column number of the component in the layout
4708
+ */
4709
+ columnNumber: number;
4710
+ }
4711
+ /**
4712
+ * This component contains the drag and drop zone for the resize bars that
4713
+ * allow redefining width and height of layout elements
4714
+ */
4715
+ export const FlexibleDropZone: FC<IFlexibleDropZoneProps>;
4716
+
4717
+ }
4718
+ declare module "@babylonjs/inspector/components/layout/FlexibleGridContainer" {
4719
+ import { FC } from "react";
4720
+ /**
4721
+ * Arguments for the GridContainer component.
4722
+ */
4723
+ export interface IFlexibleGridContainerProps {
4724
+ }
4725
+ /**
4726
+ * Component responsible for mapping the layout to the actual components
4727
+ */
4728
+ export const FlexibleGridContainer: FC<IFlexibleGridContainerProps>;
4729
+
4730
+ }
4731
+ declare module "@babylonjs/inspector/components/layout/FlexibleGridLayout" {
4732
+ import { FC } from "react";
4733
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4734
+ /**
4735
+ * Arguments for the Layout component.
4736
+ */
4737
+ export interface IFlexibleGridLayoutProps {
4738
+ /**
4739
+ * A definition of the layout which can be changed by the user
4740
+ */
4741
+ layoutDefinition: Layout;
4742
+ }
4743
+ /**
4744
+ * This component represents a grid layout that can be resized and rearranged
4745
+ * by the user.
4746
+ */
4747
+ export const FlexibleGridLayout: FC<IFlexibleGridLayoutProps>;
4748
+
4749
+ }
4750
+ declare module "@babylonjs/inspector/components/layout/FlexibleResizeBar" {
4751
+ import { FC } from "react";
4752
+ import { ResizeDirections } from "@babylonjs/inspector/components/layout/types";
4753
+ /**
4754
+ * Arguments for the ResizeBar component.
4755
+ */
4756
+ export interface IFlexibleRowResizerProps {
4757
+ /**
4758
+ * Row number of the component that is being resized
4759
+ */
4760
+ rowNumber: number;
4761
+ /**
4762
+ * Column number of the component being resized
4763
+ */
4764
+ columnNumber: number;
4765
+ /**
4766
+ * If the resizing happens in row or column direction
4767
+ */
4768
+ direction: ResizeDirections;
4769
+ }
4770
+ /**
4771
+ * The item that will be sent to the drag event
4772
+ */
4773
+ export type ResizeItem = {
4774
+ /**
4775
+ * If the resizing happens in row or column direction
4776
+ */
4777
+ direction: ResizeDirections;
4778
+ /**
4779
+ * The row number of the component that is being resized
4780
+ */
4781
+ rowNumber: number;
4782
+ /**
4783
+ * the column number of the component being resized
4784
+ */
4785
+ columnNumber: number;
4786
+ };
4787
+ /**
4788
+ * A component that renders a bar that the user can drag to resize.
4789
+ */
4790
+ export const FlexibleResizeBar: FC<IFlexibleRowResizerProps>;
4791
+
4792
+ }
4793
+ declare module "@babylonjs/inspector/components/layout/FlexibleTab" {
4794
+ import { FC } from "react";
4795
+ import { TabDrag } from "@babylonjs/inspector/components/layout/types";
4796
+ /**
4797
+ * Arguments for the FlexibleTab component.
4798
+ */
4799
+ export interface IFlexibleTabProps {
4800
+ /**
4801
+ * The tab's title.
4802
+ */
4803
+ title: string;
4804
+ /**
4805
+ * If the tab is currently selected or not
4806
+ */
4807
+ selected: boolean;
4808
+ /**
4809
+ * What happens when the user clicks on the tab
4810
+ */
4811
+ onClick: () => void;
4812
+ /**
4813
+ * The object that will be sent to the drag event
4814
+ */
4815
+ item: TabDrag;
4816
+ /**
4817
+ * What happens when the user drops another tab after this one
4818
+ */
4819
+ onTabDroppedAction: (item: TabDrag) => void;
4820
+ }
4821
+ /**
4822
+ * A component that renders a tab that the user can click
4823
+ * to activate or drag to reorder. It also listens for
4824
+ * drop events if the user wants to drop another tab
4825
+ * after it.
4826
+ */
4827
+ export const FlexibleTab: FC<IFlexibleTabProps>;
4828
+
4829
+ }
4830
+ declare module "@babylonjs/inspector/components/layout/FlexibleTabsContainer" {
4831
+ import { FC } from "react";
4832
+ import { LayoutTab } from "@babylonjs/inspector/components/layout/types";
4833
+ /**
4834
+ * Arguments for the TabsContainer component.
4835
+ */
4836
+ export interface IFlexibleTabsContainerProps {
4837
+ /**
4838
+ * The tabs to display
4839
+ */
4840
+ tabs: LayoutTab[];
4841
+ /**
4842
+ * Row index of component in layout
4843
+ */
4844
+ rowIndex: number;
4845
+ /**
4846
+ * Column index of component in layout
4847
+ */
4848
+ columnIndex: number;
4849
+ /**
4850
+ * Which tab is selected in the layout
4851
+ */
4852
+ selectedTab?: string;
4853
+ }
4854
+ /**
4855
+ * This component contains a set of tabs of which only one is visible at a time.
4856
+ * The tabs can also be dragged from and to different containers.
4857
+ */
4858
+ export const FlexibleTabsContainer: FC<IFlexibleTabsContainerProps>;
4859
+
4860
+ }
4861
+ declare module "@babylonjs/inspector/components/layout/LayoutContext" {
4862
+ /// <reference types="react" />
4863
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4864
+ export const LayoutContext: import("react").Context<{
4865
+ /**
4866
+ * The layout object
4867
+ */
4868
+ layout: Layout;
4869
+ /**
4870
+ * Function to set the layout object in the context
4871
+ */
4872
+ setLayout: (layout: Layout) => void;
4873
+ }>;
4874
+
4875
+ }
4876
+ declare module "@babylonjs/inspector/components/layout/types" {
4877
+ import { ReactElement } from "react";
4878
+ export type LayoutTab = {
4879
+ /**
4880
+ * Tab id
4881
+ */
4882
+ id: string;
4883
+ /**
4884
+ * React component rendered by tab
4885
+ */
4886
+ component: ReactElement;
4887
+ /**
4888
+ * Tab title
4889
+ */
4890
+ title: string;
4891
+ };
4892
+ export type LayoutTabsRow = {
4893
+ /**
4894
+ * row id
4895
+ */
4896
+ id: string;
4897
+ /**
4898
+ * row height in its containing column
4899
+ */
4900
+ height: string;
4901
+ /**
4902
+ * selected tab in row
4903
+ */
4904
+ selectedTab: string;
4905
+ /**
4906
+ * list of tabs contained in row
4907
+ */
4908
+ tabs: LayoutTab[];
4909
+ };
4910
+ export type LayoutColumn = {
4911
+ /**
4912
+ * column id
4913
+ */
4914
+ id: string;
4915
+ /**
4916
+ * column width in the grid
4917
+ */
4918
+ width: string;
4919
+ /**
4920
+ * column rows
4921
+ */
4922
+ rows: LayoutTabsRow[];
4923
+ };
4924
+ export type Layout = {
4925
+ /**
4926
+ * layout columns
4927
+ */
4928
+ columns?: LayoutColumn[];
4929
+ };
4930
+ export type TabDrag = {
4931
+ /**
4932
+ * row number of the tab being dragged
4933
+ */
4934
+ rowNumber: number;
4935
+ /**
4936
+ * column number of the tab being dragged
4937
+ */
4938
+ columnNumber: number;
4939
+ /**
4940
+ * the tabs being dragged
4941
+ */
4942
+ tabs: {
4943
+ /**
4944
+ * id of tab being dragged
4945
+ */
4946
+ id: string;
4947
+ }[];
4948
+ };
4949
+ export enum ElementTypes {
4950
+ RESIZE_BAR = "0",
4951
+ TAB = "1",
4952
+ TAB_GROUP = "2",
4953
+ NONE = "2"
4954
+ }
4955
+ export enum ResizeDirections {
4956
+ ROW = "row",
4957
+ COLUMN = "column"
4958
+ }
4959
+
4960
+ }
4961
+ declare module "@babylonjs/inspector/components/layout/utils" {
4962
+ import { Layout } from "@babylonjs/inspector/components/layout/types";
4963
+ /**
4964
+ * Given a column and row number in the layout, return the corresponding column/row
4965
+ * @param layout
4966
+ * @param column
4967
+ * @param row
4968
+ * @returns
4969
+ */
4970
+ export const getPosInLayout: (layout: Layout, column: number, row?: number | undefined) => import("@babylonjs/inspector/components/layout/types").LayoutTabsRow | import("./types").LayoutColumn;
4971
+ /**
4972
+ * Remove a row in position row, column from the layout, and redistribute heights of remaining rows
4973
+ * @param layout
4974
+ * @param column
4975
+ * @param row
4976
+ */
4977
+ export const removeLayoutRowAndRedistributePercentages: (layout: Layout, column: number, row: number) => void;
4978
+ /**
4979
+ * Add a percentage string to a number
4980
+ */
4981
+ export const addPercentageStringToNumber: (p1: string, p2: number) => number;
4982
+ /**
4983
+ * Parses a percentage string into a number
4984
+ * @param p the percentage string
4985
+ */
4986
+ export const parsePercentage: (p: string) => number;
4987
+
4624
4988
  }
4625
4989
  declare module "@babylonjs/inspector/components/lines/ColorLineComponent" {
4626
4990
  import * as React from "react";
@@ -5730,11 +6094,17 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
5730
6094
  static readonly NodeWidth: number;
5731
6095
  private readonly _minZoom;
5732
6096
  private readonly _maxZoom;
6097
+ private _hostCanvasRef;
5733
6098
  private _hostCanvas;
6099
+ private _graphCanvasRef;
5734
6100
  private _graphCanvas;
6101
+ private _selectionContainerRef;
5735
6102
  private _selectionContainer;
6103
+ private _frameContainerRef;
5736
6104
  private _frameContainer;
6105
+ private _svgCanvasRef;
5737
6106
  private _svgCanvas;
6107
+ private _rootContainerRef;
5738
6108
  private _rootContainer;
5739
6109
  private _nodes;
5740
6110
  private _links;
@@ -6022,6 +6392,8 @@ export class GraphNode {
6022
6392
  private _displayManager;
6023
6393
  private _isVisible;
6024
6394
  private _enclosingFrameId;
6395
+ addClassToVisual(className: string): void;
6396
+ removeClassFromVisual(className: string): void;
6025
6397
  get isVisible(): boolean;
6026
6398
  set isVisible(value: boolean);
6027
6399
  private _upateNodePortNames;
@@ -6430,6 +6802,55 @@ const _default: {
6430
6802
  export default _default;
6431
6803
  export const Default: any;
6432
6804
 
6805
+ }
6806
+ declare module "@babylonjs/inspector/stories/layout/FlexibleGridLayout.stories" {
6807
+ /// <reference types="react" />
6808
+ import { IFlexibleGridLayoutProps } from "@babylonjs/inspector/components/layout/FlexibleGridLayout";
6809
+ const _default: {
6810
+ component: import("react").FC<IFlexibleGridLayoutProps>;
6811
+ };
6812
+ export default _default;
6813
+ export const Default: {
6814
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
6815
+ args: {
6816
+ layoutDefinition: {
6817
+ columns: {
6818
+ id: string;
6819
+ width: string;
6820
+ rows: {
6821
+ id: string;
6822
+ height: string;
6823
+ selectedTab: string;
6824
+ tabs: {
6825
+ id: string;
6826
+ component: JSX.Element;
6827
+ }[];
6828
+ }[];
6829
+ }[];
6830
+ };
6831
+ };
6832
+ };
6833
+ export const TwoColumn: {
6834
+ render: (props: IFlexibleGridLayoutProps) => JSX.Element;
6835
+ args: {
6836
+ layoutDefinition: {
6837
+ columns: {
6838
+ id: string;
6839
+ width: string;
6840
+ rows: {
6841
+ id: string;
6842
+ height: string;
6843
+ selectedTab: string;
6844
+ tabs: {
6845
+ id: string;
6846
+ component: JSX.Element;
6847
+ }[];
6848
+ }[];
6849
+ }[];
6850
+ };
6851
+ };
6852
+ };
6853
+
6433
6854
  }
6434
6855
  declare module "@babylonjs/inspector/stories/lines/ColorLineComponent.stories" {
6435
6856
  /// <reference types="react" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/inspector",
3
- "version": "5.28.0",
3
+ "version": "5.30.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.28.0",
36
- "@babylonjs/gui": "^5.28.0",
37
- "@babylonjs/gui-editor": "^5.28.0",
38
- "@babylonjs/loaders": "^5.28.0",
39
- "@babylonjs/materials": "^5.28.0",
40
- "@babylonjs/serializers": "^5.28.0",
35
+ "@babylonjs/core": "^5.30.0",
36
+ "@babylonjs/gui": "^5.30.0",
37
+ "@babylonjs/gui-editor": "^5.30.0",
38
+ "@babylonjs/loaders": "^5.30.0",
39
+ "@babylonjs/materials": "^5.30.0",
40
+ "@babylonjs/serializers": "^5.30.0",
41
41
  "@lts/gui": "1.0.0",
42
42
  "react": "^17.0.2",
43
43
  "react-dom": "^17.0.2",