@babylonjs/shared-ui-components 8.1.1 → 8.2.1

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.
Files changed (96) hide show
  1. package/colorPicker/colorComponentEntry.d.ts +1 -1
  2. package/colorPicker/colorPicker.d.ts +1 -1
  3. package/colorPicker/hexColor.d.ts +1 -1
  4. package/components/Button.d.ts +2 -1
  5. package/components/Button.js.map +1 -1
  6. package/components/bars/CommandBarComponent.d.ts +2 -2
  7. package/components/bars/CommandBarComponent.js.map +1 -1
  8. package/components/colorPicker/ColorComponentEntry.d.ts +1 -1
  9. package/components/colorPicker/ColorPicker.d.ts +1 -1
  10. package/components/colorPicker/HexColor.d.ts +1 -1
  11. package/components/layout/DraggableIcon.d.ts +1 -1
  12. package/components/layout/FlexibleColumn.d.ts +2 -2
  13. package/components/layout/FlexibleColumn.js.map +1 -1
  14. package/components/layout/FlexibleDragHandler.d.ts +2 -2
  15. package/components/layout/FlexibleDragHandler.js.map +1 -1
  16. package/components/layout/FlexibleDropZone.d.ts +2 -2
  17. package/components/layout/FlexibleDropZone.js.map +1 -1
  18. package/components/layout/FlexibleGridLayout.d.ts +1 -1
  19. package/components/layout/FlexibleResizeBar.d.ts +1 -1
  20. package/components/layout/FlexibleTab.d.ts +1 -1
  21. package/components/layout/FlexibleTabsContainer.d.ts +1 -1
  22. package/components/layout/LayoutContext.d.ts +1 -1
  23. package/components/layout/utils.d.ts +1 -1
  24. package/components/lines/ColorLineComponent.d.ts +3 -5
  25. package/components/lines/ColorPickerLineComponent.d.ts +2 -4
  26. package/components/lines/NumericInputComponent.d.ts +1 -1
  27. package/components/reactGraphSystem/GraphConnectorHandle.d.ts +2 -2
  28. package/components/reactGraphSystem/GraphConnectorHandle.js +1 -1
  29. package/components/reactGraphSystem/GraphConnectorHandle.js.map +1 -1
  30. package/components/reactGraphSystem/GraphContainer.d.ts +2 -2
  31. package/components/reactGraphSystem/GraphContainer.js.map +1 -1
  32. package/components/reactGraphSystem/GraphLinesContainer.d.ts +2 -2
  33. package/components/reactGraphSystem/GraphLinesContainer.js.map +1 -1
  34. package/components/reactGraphSystem/GraphNode.d.ts +2 -2
  35. package/components/reactGraphSystem/GraphNode.js.map +1 -1
  36. package/components/reactGraphSystem/GraphNodesContainer.d.ts +2 -2
  37. package/components/reactGraphSystem/GraphNodesContainer.js.map +1 -1
  38. package/components/reactGraphSystem/NodeRenderer.d.ts +2 -2
  39. package/components/reactGraphSystem/NodeRenderer.js.map +1 -1
  40. package/components/reactGraphSystem/useGraphContext.d.ts +1 -1
  41. package/lines/checkBoxLineComponent.d.ts +1 -1
  42. package/lines/color3LineComponent.d.ts +2 -2
  43. package/lines/color4LineComponent.d.ts +2 -2
  44. package/lines/colorLineComponent.d.ts +3 -5
  45. package/lines/colorPickerComponent.d.ts +2 -4
  46. package/lines/floatLineComponent.d.ts +2 -2
  47. package/lines/hexLineComponent.d.ts +2 -2
  48. package/lines/lineContainerComponent.d.ts +1 -1
  49. package/lines/matrixLineComponent.d.ts +2 -2
  50. package/lines/numericInputComponent.d.ts +1 -1
  51. package/lines/optionsLineComponent.d.ts +1 -1
  52. package/lines/sliderLineComponent.d.ts +2 -2
  53. package/lines/targetsProxy.d.ts +1 -1
  54. package/lines/textInputLineComponent.d.ts +2 -2
  55. package/lines/vector2LineComponent.d.ts +2 -2
  56. package/lines/vector3LineComponent.d.ts +2 -2
  57. package/lines/vector4LineComponent.d.ts +2 -2
  58. package/nodeGraphSystem/automaticProperties.d.ts +1 -1
  59. package/nodeGraphSystem/frameNodePort.d.ts +6 -6
  60. package/nodeGraphSystem/graphCanvas.d.ts +9 -9
  61. package/nodeGraphSystem/graphFrame.d.ts +4 -4
  62. package/nodeGraphSystem/graphNode.d.ts +7 -7
  63. package/nodeGraphSystem/interfaces/displayManager.d.ts +3 -3
  64. package/nodeGraphSystem/interfaces/nodeContainer.d.ts +2 -2
  65. package/nodeGraphSystem/interfaces/nodeData.d.ts +1 -1
  66. package/nodeGraphSystem/interfaces/portData.d.ts +1 -1
  67. package/nodeGraphSystem/interfaces/propertyComponentProps.d.ts +2 -2
  68. package/nodeGraphSystem/interfaces/selectionChangedOptions.d.ts +5 -5
  69. package/nodeGraphSystem/nodeLink.d.ts +4 -4
  70. package/nodeGraphSystem/nodePort.d.ts +6 -6
  71. package/nodeGraphSystem/propertyLedger.d.ts +1 -1
  72. package/nodeGraphSystem/searchBox.d.ts +1 -1
  73. package/nodeGraphSystem/stateManager.d.ts +9 -9
  74. package/nodeGraphSystem/tools.d.ts +4 -4
  75. package/nodeGraphSystem/typeLedger.d.ts +4 -4
  76. package/nodeGraphSystem/types/framePortData.d.ts +2 -2
  77. package/package.json +3 -3
  78. package/split/splitContainer.d.ts +3 -2
  79. package/split/splitContainer.js.map +1 -1
  80. package/split/splitter.d.ts +1 -1
  81. package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.d.ts +2 -2
  82. package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.d.ts +2 -2
  83. package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.d.ts +2 -2
  84. package/tabs/propertyGrids/gui/controlPropertyGridComponent.d.ts +2 -2
  85. package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.d.ts +2 -2
  86. package/tabs/propertyGrids/gui/gridPropertyGridComponent.d.ts +2 -2
  87. package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.d.ts +2 -2
  88. package/tabs/propertyGrids/gui/imagePropertyGridComponent.d.ts +2 -2
  89. package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.d.ts +2 -2
  90. package/tabs/propertyGrids/gui/linePropertyGridComponent.d.ts +2 -2
  91. package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.d.ts +2 -2
  92. package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.d.ts +2 -2
  93. package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.d.ts +2 -2
  94. package/tabs/propertyGrids/gui/sliderPropertyGridComponent.d.ts +2 -2
  95. package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.d.ts +2 -2
  96. package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.d.ts +2 -2
@@ -2,4 +2,4 @@
2
2
  * utility hook to assist using the graph context
3
3
  * @returns
4
4
  */
5
- export declare const useGraphContext: () => import("./GraphContextManager").IGraphContext;
5
+ export declare const useGraphContext: () => import("./GraphContextManager.js").IGraphContext;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "./../propertyChangedEvent";
3
+ import type { PropertyChangedEvent } from "./../propertyChangedEvent.js";
4
4
  import type { IconDefinition } from "@fortawesome/fontawesome-common-types";
5
5
  export interface ICheckBoxLineComponentProps {
6
6
  label?: string;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  export interface IColor3LineComponentProps {
6
6
  label: string;
7
7
  target: any;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  export interface IColor4LineComponentProps {
6
6
  label: string;
7
7
  target?: any;
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  import { Color4 } from "@babylonjs/core/Maths/math.color.js";
4
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
5
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
4
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
5
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
6
6
  export interface IColorLineProps {
7
7
  label: string;
8
8
  target?: any;
@@ -22,9 +22,7 @@ interface IColorLineComponentState {
22
22
  export declare class ColorLine extends React.Component<IColorLineProps, IColorLineComponentState> {
23
23
  constructor(props: IColorLineProps);
24
24
  shouldComponentUpdate(nextProps: IColorLineProps, nextState: IColorLineComponentState): boolean;
25
- getValue(props?: Readonly<IColorLineProps> & Readonly<{
26
- children?: React.ReactNode | undefined;
27
- }>): Color4;
25
+ getValue(props?: Readonly<IColorLineProps>): Color4;
28
26
  setColorFromString(colorString: string): void;
29
27
  setColor(newColor: Color4): void;
30
28
  switchExpandState(): void;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { Color4, Color3 } from "@babylonjs/core/Maths/math.color.js";
3
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
4
4
  export interface IColorPickerLineProps {
5
5
  value: Color4 | Color3;
6
6
  linearHint?: boolean;
@@ -21,9 +21,7 @@ export declare class ColorPickerLine extends React.Component<IColorPickerLinePro
21
21
  constructor(props: IColorPickerLineProps);
22
22
  syncPositions(): void;
23
23
  shouldComponentUpdate(nextProps: IColorPickerLineProps, nextState: IColorPickerComponentState): boolean;
24
- getHexString(props?: Readonly<IColorPickerLineProps> & Readonly<{
25
- children?: React.ReactNode | undefined;
26
- }>): string;
24
+ getHexString(props?: Readonly<IColorPickerLineProps>): string;
27
25
  componentDidUpdate(): void;
28
26
  componentDidMount(): void;
29
27
  render(): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  interface IFloatLineComponentProps {
6
6
  label: string;
7
7
  target: any;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  interface IHexLineComponentProps {
6
6
  label: string;
7
7
  target: any;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { ISelectedLineContainer } from "./iSelectedLineContainer";
2
+ import type { ISelectedLineContainer } from "./iSelectedLineContainer.js";
3
3
  interface ILineContainerComponentProps {
4
4
  selection?: ISelectedLineContainer;
5
5
  title: string;
@@ -2,8 +2,8 @@ import * as React from "react";
2
2
  import type { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
3
3
  import { Matrix } from "@babylonjs/core/Maths/math.vector.js";
4
4
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
5
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
6
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
5
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
6
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
7
7
  interface IMatrixLineComponentProps {
8
8
  label: string;
9
9
  target: any;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
2
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
3
3
  interface INumericInputProps {
4
4
  label: string;
5
5
  labelTooltip?: string;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
4
  import type { IInspectableOptions } from "@babylonjs/core/Misc/iInspectable.js";
5
5
  export declare const Null_Value: number;
6
6
  export interface IOptionsLineProps {
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  interface ISliderLineComponentProps {
6
6
  label: string;
7
7
  target?: any;
@@ -1,4 +1,4 @@
1
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
1
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  export declare const conflictingValuesPlaceholder = "\u2014";
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
3
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
4
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
3
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
4
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
5
5
  export interface ITextInputLineComponentProps {
6
6
  label?: string;
7
7
  lockObject?: LockObject;
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
3
3
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
4
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
5
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
4
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
5
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
6
6
  interface IVector2LineComponentProps {
7
7
  label: string;
8
8
  target: any;
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
3
3
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
4
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
5
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
4
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
5
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
6
6
  interface IVector3LineComponentProps {
7
7
  label: string;
8
8
  target?: any;
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { Vector4 } from "@babylonjs/core/Maths/math.vector.js";
3
3
  import type { Observable } from "@babylonjs/core/Misc/observable.js";
4
- import type { PropertyChangedEvent } from "../propertyChangedEvent";
5
- import type { LockObject } from "../tabs/propertyGrids/lockObject";
4
+ import type { PropertyChangedEvent } from "../propertyChangedEvent.js";
5
+ import type { LockObject } from "../tabs/propertyGrids/lockObject.js";
6
6
  interface IVector4LineComponentProps {
7
7
  label: string;
8
8
  target?: any;
@@ -1,5 +1,5 @@
1
1
  import type { IEditablePropertyOption } from "@babylonjs/core/Decorators/nodeDecorator.js";
2
- import type { StateManager } from "./stateManager";
2
+ import type { StateManager } from "./stateManager.js";
3
3
  /**
4
4
  * Function used to force a rebuild of the node system
5
5
  * @param source source object
@@ -1,11 +1,11 @@
1
- import type { IDisplayManager } from "./interfaces/displayManager";
1
+ import type { IDisplayManager } from "./interfaces/displayManager.js";
2
2
  import { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
- import type { IPortData } from "./interfaces/portData";
5
- import { NodePort } from "./nodePort";
6
- import type { GraphNode } from "./graphNode";
7
- import type { FramePortPosition } from "./graphFrame";
8
- import type { StateManager } from "./stateManager";
4
+ import type { IPortData } from "./interfaces/portData.js";
5
+ import { NodePort } from "./nodePort.js";
6
+ import type { GraphNode } from "./graphNode.js";
7
+ import type { FramePortPosition } from "./graphFrame.js";
8
+ import type { StateManager } from "./stateManager.js";
9
9
  export declare class FrameNodePort extends NodePort {
10
10
  portData: IPortData;
11
11
  node: GraphNode;
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
- import { GraphNode } from "./graphNode";
2
+ import { GraphNode } from "./graphNode.js";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
- import { NodeLink } from "./nodeLink";
5
- import { NodePort } from "./nodePort";
6
- import { GraphFrame } from "./graphFrame";
7
- import type { IEditorData, IFrameData } from "./interfaces/nodeLocationInfo";
8
- import type { StateManager } from "./stateManager";
9
- import type { INodeData } from "./interfaces/nodeData";
10
- import type { IPortData } from "./interfaces/portData";
11
- import type { INodeContainer } from "./interfaces/nodeContainer";
4
+ import { NodeLink } from "./nodeLink.js";
5
+ import { NodePort } from "./nodePort.js";
6
+ import { GraphFrame } from "./graphFrame.js";
7
+ import type { IEditorData, IFrameData } from "./interfaces/nodeLocationInfo.js";
8
+ import type { StateManager } from "./stateManager.js";
9
+ import type { INodeData } from "./interfaces/nodeData.js";
10
+ import type { IPortData } from "./interfaces/portData.js";
11
+ import type { INodeContainer } from "./interfaces/nodeContainer.js";
12
12
  export interface IGraphCanvasComponentProps {
13
13
  stateManager: StateManager;
14
14
  onEmitNewNode: (nodeData: INodeData) => GraphNode;
@@ -1,10 +1,10 @@
1
- import type { GraphNode } from "./graphNode";
2
- import type { GraphCanvasComponent } from "./graphCanvas";
1
+ import type { GraphNode } from "./graphNode.js";
2
+ import type { GraphCanvasComponent } from "./graphCanvas.js";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
4
  import { Observable } from "@babylonjs/core/Misc/observable.js";
5
5
  import { Color3 } from "@babylonjs/core/Maths/math.color.js";
6
- import { FrameNodePort } from "./frameNodePort";
7
- import type { IFrameData } from "./interfaces/nodeLocationInfo";
6
+ import { FrameNodePort } from "./frameNodePort.js";
7
+ import type { IFrameData } from "./interfaces/nodeLocationInfo.js";
8
8
  export declare enum FramePortPosition {
9
9
  Top = 0,
10
10
  Middle = 1,
@@ -1,11 +1,11 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { GraphCanvasComponent } from "./graphCanvas";
3
- import { NodePort } from "./nodePort";
4
- import type { GraphFrame } from "./graphFrame";
5
- import type { NodeLink } from "./nodeLink";
6
- import type { StateManager } from "./stateManager";
7
- import type { INodeData } from "./interfaces/nodeData";
8
- import type { IPortData } from "./interfaces/portData";
2
+ import type { GraphCanvasComponent } from "./graphCanvas.js";
3
+ import { NodePort } from "./nodePort.js";
4
+ import type { GraphFrame } from "./graphFrame.js";
5
+ import type { NodeLink } from "./nodeLink.js";
6
+ import type { StateManager } from "./stateManager.js";
7
+ import type { INodeData } from "./interfaces/nodeData.js";
8
+ import type { IPortData } from "./interfaces/portData.js";
9
9
  import type { IEditablePropertyOption } from "@babylonjs/core/Decorators/nodeDecorator.js";
10
10
  export declare class GraphNode {
11
11
  content: INodeData;
@@ -1,7 +1,7 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { StateManager } from "../stateManager";
3
- import type { INodeData } from "./nodeData";
4
- import type { IPortData } from "./portData";
2
+ import type { StateManager } from "../stateManager.js";
3
+ import type { INodeData } from "./nodeData.js";
4
+ import type { IPortData } from "./portData.js";
5
5
  export interface VisualContentDescription {
6
6
  [key: string]: HTMLElement;
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { GraphNode } from "../graphNode";
2
- import type { INodeData } from "./nodeData";
1
+ import type { GraphNode } from "../graphNode.js";
2
+ import type { INodeData } from "./nodeData.js";
3
3
  export interface INodeContainer {
4
4
  nodes: GraphNode[];
5
5
  appendNode(data: INodeData): GraphNode;
@@ -1,5 +1,5 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { IPortData } from "./portData";
2
+ import type { IPortData } from "./portData.js";
3
3
  export interface INodeData {
4
4
  data: any;
5
5
  name: string;
@@ -1,5 +1,5 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { GraphNode } from "../graphNode";
2
+ import type { GraphNode } from "../graphNode.js";
3
3
  export declare enum PortDataDirection {
4
4
  /** Input */
5
5
  Input = 0,
@@ -1,5 +1,5 @@
1
- import type { StateManager } from "../stateManager";
2
- import type { INodeData } from "./nodeData";
1
+ import type { StateManager } from "../stateManager.js";
2
+ import type { INodeData } from "./nodeData.js";
3
3
  export interface IPropertyComponentProps {
4
4
  stateManager: StateManager;
5
5
  nodeData: INodeData;
@@ -1,9 +1,9 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { GraphFrame } from "../graphFrame";
3
- import type { GraphNode } from "../graphNode";
4
- import type { NodeLink } from "../nodeLink";
5
- import type { NodePort } from "../nodePort";
6
- import type { FramePortData } from "../types/framePortData";
2
+ import type { GraphFrame } from "../graphFrame.js";
3
+ import type { GraphNode } from "../graphNode.js";
4
+ import type { NodeLink } from "../nodeLink.js";
5
+ import type { NodePort } from "../nodePort.js";
6
+ import type { FramePortData } from "../types/framePortData.js";
7
7
  export interface ISelectionChangedOptions {
8
8
  selection: Nullable<GraphNode | NodeLink | GraphFrame | NodePort | FramePortData>;
9
9
  forceKeepSelection?: boolean;
@@ -1,8 +1,8 @@
1
1
  import { Observable } from "@babylonjs/core/Misc/observable.js";
2
- import type { FrameNodePort } from "./frameNodePort";
3
- import type { NodePort } from "./nodePort";
4
- import type { GraphNode } from "./graphNode";
5
- import type { GraphCanvasComponent } from "./graphCanvas";
2
+ import type { FrameNodePort } from "./frameNodePort.js";
3
+ import type { NodePort } from "./nodePort.js";
4
+ import type { GraphNode } from "./graphNode.js";
5
+ import type { GraphCanvasComponent } from "./graphCanvas.js";
6
6
  export declare class NodeLink {
7
7
  private _graphCanvas;
8
8
  private _portA;
@@ -1,12 +1,12 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
2
  import type { Observer } from "@babylonjs/core/Misc/observable.js";
3
3
  import type { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
4
- import type { GraphNode } from "./graphNode";
5
- import type { StateManager } from "./stateManager";
6
- import type { ISelectionChangedOptions } from "./interfaces/selectionChangedOptions";
7
- import type { FrameNodePort } from "./frameNodePort";
8
- import type { IDisplayManager } from "./interfaces/displayManager";
9
- import { type IPortData } from "./interfaces/portData";
4
+ import type { GraphNode } from "./graphNode.js";
5
+ import type { StateManager } from "./stateManager.js";
6
+ import type { ISelectionChangedOptions } from "./interfaces/selectionChangedOptions.js";
7
+ import type { FrameNodePort } from "./frameNodePort.js";
8
+ import type { IDisplayManager } from "./interfaces/displayManager.js";
9
+ import { type IPortData } from "./interfaces/portData.js";
10
10
  export declare class NodePort {
11
11
  portData: IPortData;
12
12
  node: GraphNode;
@@ -1,5 +1,5 @@
1
1
  import type { ComponentClass } from "react";
2
- import type { IPropertyComponentProps } from "./interfaces/propertyComponentProps";
2
+ import type { IPropertyComponentProps } from "./interfaces/propertyComponentProps.js";
3
3
  export declare class PropertyLedger {
4
4
  static DefaultControl: ComponentClass<IPropertyComponentProps>;
5
5
  static RegisteredControls: {
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { StateManager } from "./stateManager";
2
+ import type { StateManager } from "./stateManager.js";
3
3
  import "./searchBox.scss";
4
4
  export interface ISearchBoxComponentProps {
5
5
  stateManager: StateManager;
@@ -1,15 +1,15 @@
1
1
  import type { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
2
2
  import { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
- import type { FrameNodePort } from "./frameNodePort";
5
- import type { GraphFrame } from "./graphFrame";
6
- import type { GraphNode } from "./graphNode";
7
- import type { INodeContainer } from "./interfaces/nodeContainer";
8
- import type { INodeData } from "./interfaces/nodeData";
9
- import type { IPortData } from "./interfaces/portData";
10
- import type { ISelectionChangedOptions } from "./interfaces/selectionChangedOptions";
11
- import type { NodePort } from "./nodePort";
12
- import type { HistoryStack } from "../historyStack";
4
+ import type { FrameNodePort } from "./frameNodePort.js";
5
+ import type { GraphFrame } from "./graphFrame.js";
6
+ import type { GraphNode } from "./graphNode.js";
7
+ import type { INodeContainer } from "./interfaces/nodeContainer.js";
8
+ import type { INodeData } from "./interfaces/nodeData.js";
9
+ import type { IPortData } from "./interfaces/portData.js";
10
+ import type { ISelectionChangedOptions } from "./interfaces/selectionChangedOptions.js";
11
+ import type { NodePort } from "./nodePort.js";
12
+ import type { HistoryStack } from "../historyStack.js";
13
13
  import type { Scene } from "@babylonjs/core/scene.js";
14
14
  export declare class StateManager {
15
15
  data: any;
@@ -1,7 +1,7 @@
1
- import type { GraphCanvasComponent } from "./graphCanvas";
2
- import type { GraphNode } from "./graphNode";
3
- import type { NodeLink } from "./nodeLink";
4
- import type { FramePortData } from "./types/framePortData";
1
+ import type { GraphCanvasComponent } from "./graphCanvas.js";
2
+ import type { GraphNode } from "./graphNode.js";
3
+ import type { NodeLink } from "./nodeLink.js";
4
+ import type { FramePortData } from "./types/framePortData.js";
5
5
  export declare const IsFramePortData: (variableToCheck: any) => variableToCheck is FramePortData;
6
6
  export declare const RefreshNode: (node: GraphNode, visitedNodes?: Set<GraphNode>, visitedLinks?: Set<NodeLink>, canvas?: GraphCanvasComponent) => void;
7
7
  export declare const BuildFloatUI: (container: HTMLDivElement, document: Document, displayName: string, isInteger: boolean, source: any, propertyName: string, onChange: () => void, min?: number, max?: number, visualPropertiesRefresh?: Array<() => void>, additionalClassName?: string) => void;
@@ -1,7 +1,7 @@
1
- import type { INodeContainer } from "./interfaces/nodeContainer";
2
- import type { INodeData } from "./interfaces/nodeData";
3
- import type { IPortData } from "./interfaces/portData";
4
- import type { NodePort } from "./nodePort";
1
+ import type { INodeContainer } from "./interfaces/nodeContainer.js";
2
+ import type { INodeData } from "./interfaces/nodeData.js";
3
+ import type { IPortData } from "./interfaces/portData.js";
4
+ import type { NodePort } from "./nodePort.js";
5
5
  export declare class TypeLedger {
6
6
  static PortDataBuilder: (port: NodePort, nodeContainer: INodeContainer) => IPortData;
7
7
  static NodeDataBuilder: (data: any, nodeContainer: INodeContainer) => INodeData;
@@ -1,5 +1,5 @@
1
- import type { GraphFrame } from "../graphFrame";
2
- import type { FrameNodePort } from "../frameNodePort";
1
+ import type { GraphFrame } from "../graphFrame.js";
2
+ import type { FrameNodePort } from "../frameNodePort.js";
3
3
  export type FramePortData = {
4
4
  frame: GraphFrame;
5
5
  port: FrameNodePort;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/shared-ui-components",
3
- "version": "8.1.1",
3
+ "version": "8.2.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "peerDependencies": {
29
29
  "@types/dagre": "^0.7.47",
30
30
  "dagre": "^0.8.5",
31
- "react": "^17.0.2",
31
+ "react": "^18.2.0",
32
32
  "react-dnd": "15.0.1",
33
33
  "react-dnd-touch-backend": "15.0.1",
34
- "react-dom": "^17.0.2"
34
+ "react-dom": "^18.2.0"
35
35
  },
36
36
  "keywords": [
37
37
  "3D",
@@ -1,4 +1,5 @@
1
- import { SplitDirection } from "./splitContext";
1
+ import type { PropsWithChildren } from "react";
2
+ import { SplitDirection } from "./splitContext.js";
2
3
  /**
3
4
  * Split container properties
4
5
  */
@@ -54,4 +55,4 @@ export interface ISplitContainerProps {
54
55
  * @param props defines the split container properties
55
56
  * @returns the split container component
56
57
  */
57
- export declare const SplitContainer: React.FC<ISplitContainerProps>;
58
+ export declare const SplitContainer: React.FC<PropsWithChildren<ISplitContainerProps>>;
@@ -1 +1 @@
1
- {"version":3,"file":"splitContainer.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/split/splitContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA8D9E;;;;GAIG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} from \"react\";\r\nimport * as styles from \"./splitContainer.module.scss\";\r\nimport { ControlledSize, SplitDirection, SplitContext } from \"./splitContext\";\r\n\r\n/**\r\n * Split container properties\r\n */\r\nexport interface ISplitContainerProps {\r\n /**\r\n * Unique identifier\r\n */\r\n id?: string;\r\n\r\n /**\r\n * Split direction\r\n */\r\n direction: SplitDirection;\r\n\r\n /**\r\n * Minimum size for the floating elements\r\n */\r\n floatingMinSize?: number;\r\n\r\n /**\r\n * RefObject to the root div element\r\n */\r\n containerRef?: React.RefObject<HTMLDivElement>;\r\n\r\n /**\r\n * Optional class name\r\n */\r\n className?: string;\r\n\r\n /**\r\n * Pointer down\r\n * @param event pointer events\r\n */\r\n onPointerDown?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Pointer move\r\n * @param event pointer events\r\n */\r\n onPointerMove?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Pointer up\r\n * @param event pointer events\r\n */\r\n onPointerUp?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Drop\r\n * @param event drag events\r\n */\r\n onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;\r\n\r\n /**\r\n * Drag over\r\n * @param event drag events\r\n */\r\n onDragOver?: (event: React.DragEvent<HTMLDivElement>) => void;\r\n}\r\n\r\n/**\r\n * Creates a split container component\r\n * @param props defines the split container properties\r\n * @returns the split container component\r\n */\r\nexport const SplitContainer: React.FC<ISplitContainerProps> = (props) => {\r\n const elementRef: React.RefObject<HTMLDivElement> = props.containerRef || useRef(null);\r\n const sizes: number[] = [];\r\n const floatingCells: boolean[] = [];\r\n const noInitialSizes: boolean[] = [];\r\n const floatingMinSize = props.floatingMinSize || 200;\r\n const controllers: number[][] = [];\r\n const minSizes: number[] = [];\r\n const maxSizes: number[] = [];\r\n\r\n const buildGridDefinition = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n const children = elementRef.current.children;\r\n\r\n let gridIndex = 1;\r\n const pickArray = Array.from(children);\r\n let gridDefinition = \"\";\r\n for (const child of children) {\r\n const childElement = child as HTMLElement;\r\n if (child.classList.contains(styles[\"splitter\"])) {\r\n gridDefinition += \"auto \";\r\n } else {\r\n const sourceIndex = pickArray.indexOf(child);\r\n if (floatingCells[sourceIndex] || noInitialSizes[sourceIndex]) {\r\n gridDefinition += \"1fr \";\r\n } else {\r\n gridDefinition += \"auto \";\r\n }\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childElement.style.gridRow = \"1\";\r\n childElement.style.gridColumn = gridIndex.toString();\r\n } else {\r\n childElement.style.gridColumn = \"1\";\r\n childElement.style.gridRow = gridIndex.toString();\r\n }\r\n\r\n gridIndex++;\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n elementRef.current.style.gridTemplateRows = \"100%\";\r\n elementRef.current.style.gridTemplateColumns = gridDefinition;\r\n } else {\r\n elementRef.current.style.gridTemplateColumns = \"100%\";\r\n elementRef.current.style.gridTemplateRows = gridDefinition;\r\n }\r\n };\r\n\r\n const handleResize = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n // Check if we have enough room for everyone\r\n const children = elementRef.current.children;\r\n for (let i = 0; i < children.length; i++) {\r\n if (!floatingCells[i]) {\r\n continue;\r\n }\r\n\r\n const child = children[i] as HTMLElement;\r\n let childsize = 0;\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childsize = child.getBoundingClientRect().width;\r\n } else {\r\n childsize = child.getBoundingClientRect().height;\r\n }\r\n\r\n if (childsize < floatingMinSize) {\r\n const missing = Math.floor(floatingMinSize - childsize);\r\n let done = 0;\r\n\r\n // picking the controller in order and try to reduce their size to fit\r\n for (let j = 0; j < controllers[i].length; j++) {\r\n const controllerIndex = controllers[i][j];\r\n const controller = children[controllerIndex] as HTMLElement;\r\n const currentSize = props.direction === SplitDirection.Horizontal ? controller.getBoundingClientRect().width : controller.getBoundingClientRect().height;\r\n let newSize = currentSize - missing;\r\n if (minSizes[controllerIndex]) {\r\n newSize = Math.max(newSize, minSizes[controllerIndex]);\r\n }\r\n if (props.direction === SplitDirection.Horizontal) {\r\n controller.style.width = `${newSize}px`;\r\n } else {\r\n controller.style.height = `${newSize}px`;\r\n }\r\n\r\n done += currentSize - newSize;\r\n\r\n if (done === missing) {\r\n // We made it\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n buildGridDefinition();\r\n\r\n // Add event listener for window resize\r\n window.addEventListener(\"resize\", handleResize);\r\n\r\n // Cleanup the event listener on component unmount\r\n return () => {\r\n window.removeEventListener(\"resize\", handleResize);\r\n };\r\n }, []);\r\n\r\n const drag = (offset: number, source: HTMLElement, controlledSide: ControlledSize) => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n const children = elementRef.current.children;\r\n const childArray = Array.from(children) as HTMLElement[];\r\n const sourceIndex = childArray.indexOf(source);\r\n if (sourceIndex <= 0) {\r\n return;\r\n }\r\n\r\n let current = 0;\r\n if (controlledSide === ControlledSize.First) {\r\n current = sourceIndex - 1;\r\n } else {\r\n current = sourceIndex + 1;\r\n }\r\n const minSize = minSizes[current] || 0;\r\n const maxSize = maxSizes[current];\r\n\r\n noInitialSizes[current] = false;\r\n buildGridDefinition();\r\n\r\n let newSize = Math.floor(controlledSide === ControlledSize.First ? sizes[current] + offset : sizes[current] - offset);\r\n\r\n // Min size check\r\n if (newSize < minSize) {\r\n newSize = minSize;\r\n }\r\n\r\n // Max size check\r\n if (maxSize && newSize > maxSize) {\r\n newSize = maxSize;\r\n }\r\n\r\n // Max size check across the whole container\r\n const maxContainerSize = sizes.reduce((a, b) => a + b, 0) || 0;\r\n let totalSize = 0;\r\n let totalFloating = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n if (floatingCells[i]) {\r\n totalFloating++;\r\n } else {\r\n totalSize += i === current ? newSize : sizes[i];\r\n }\r\n }\r\n\r\n if (maxContainerSize - totalSize < floatingMinSize * totalFloating) {\r\n newSize = maxContainerSize - floatingMinSize * totalFloating;\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childArray[current].style.width = `${newSize}px`;\r\n } else {\r\n childArray[current].style.height = `${newSize}px`;\r\n }\r\n };\r\n\r\n const beginDrag = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n const children = elementRef.current.children;\r\n sizes.length = 0;\r\n for (const child of children) {\r\n const childElement = child as HTMLElement;\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n sizes.push(childElement.getBoundingClientRect().width);\r\n } else {\r\n sizes.push(childElement.getBoundingClientRect().height);\r\n }\r\n }\r\n };\r\n\r\n const endDrag = () => {\r\n sizes.length = 0;\r\n };\r\n\r\n // We assume splitter are not flagging floating cells in a different way\r\n const sync = (source: HTMLElement, controlledSide: ControlledSize, size?: number, minSize?: number, maxSize?: number) => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n const children = elementRef.current.children;\r\n const childArray = Array.from(children) as HTMLElement[];\r\n const sourceIndex = childArray.indexOf(source);\r\n if (sourceIndex <= 0) {\r\n return;\r\n }\r\n\r\n let current = 0;\r\n let other = 0;\r\n if (controlledSide === ControlledSize.First) {\r\n current = sourceIndex - 1;\r\n other = sourceIndex + 1;\r\n } else {\r\n current = sourceIndex + 1;\r\n other = sourceIndex - 1;\r\n }\r\n\r\n if (size !== undefined) {\r\n const sizeString = `${size | 0}px`;\r\n\r\n if (!childArray[current].style.width) {\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childArray[current].style.width = sizeString;\r\n } else {\r\n childArray[current].style.height = sizeString;\r\n }\r\n }\r\n } else {\r\n noInitialSizes[current] = true;\r\n }\r\n\r\n if (minSize !== undefined) {\r\n minSizes[current] = minSize;\r\n }\r\n\r\n if (maxSize !== undefined) {\r\n maxSizes[current] = maxSize;\r\n }\r\n\r\n if (!controllers[other]) {\r\n controllers[other] = [];\r\n }\r\n controllers[other].push(current);\r\n floatingCells[other] = true;\r\n };\r\n\r\n return (\r\n <SplitContext.Provider value={{ direction: props.direction, drag, beginDrag, endDrag, sync }}>\r\n <div\r\n id={props.id}\r\n className={styles[\"split-container\"] + \" \" + props.className}\r\n ref={elementRef}\r\n onPointerDown={(evt) => props.onPointerDown && props.onPointerDown(evt)}\r\n onPointerMove={(evt) => props.onPointerMove && props.onPointerMove(evt)}\r\n onPointerUp={(evt) => props.onPointerUp && props.onPointerUp(evt)}\r\n onDrop={(evt) => props.onDrop && props.onDrop(evt)}\r\n onDragOver={(evt) => props.onDragOver && props.onDragOver(evt)}\r\n >\r\n {props.children}\r\n </div>\r\n </SplitContext.Provider>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"splitContainer.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/split/splitContainer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA8D9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsD,CAAC,KAAK,EAAE,EAAE;IACvF,MAAM,UAAU,GAAoC,KAAK,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACvF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,aAAa,GAAc,EAAE,CAAC;IACpC,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,GAAG,CAAC;IACrD,MAAM,WAAW,GAAe,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC7B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACtB,OAAO;QACX,CAAC;QACD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,C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,EAC5D,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EACvE,aAAa,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EACvE,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EACjE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAClD,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,YAE7D,KAAK,CAAC,QAAQ,GACb,GACc,CAC3B,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { PropsWithChildren } from \"react\";\r\nimport { useEffect, useRef } from \"react\";\r\nimport * as styles from \"./splitContainer.module.scss\";\r\nimport { ControlledSize, SplitDirection, SplitContext } from \"./splitContext\";\r\n\r\n/**\r\n * Split container properties\r\n */\r\nexport interface ISplitContainerProps {\r\n /**\r\n * Unique identifier\r\n */\r\n id?: string;\r\n\r\n /**\r\n * Split direction\r\n */\r\n direction: SplitDirection;\r\n\r\n /**\r\n * Minimum size for the floating elements\r\n */\r\n floatingMinSize?: number;\r\n\r\n /**\r\n * RefObject to the root div element\r\n */\r\n containerRef?: React.RefObject<HTMLDivElement>;\r\n\r\n /**\r\n * Optional class name\r\n */\r\n className?: string;\r\n\r\n /**\r\n * Pointer down\r\n * @param event pointer events\r\n */\r\n onPointerDown?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Pointer move\r\n * @param event pointer events\r\n */\r\n onPointerMove?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Pointer up\r\n * @param event pointer events\r\n */\r\n onPointerUp?: (event: React.PointerEvent) => void;\r\n\r\n /**\r\n * Drop\r\n * @param event drag events\r\n */\r\n onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;\r\n\r\n /**\r\n * Drag over\r\n * @param event drag events\r\n */\r\n onDragOver?: (event: React.DragEvent<HTMLDivElement>) => void;\r\n}\r\n\r\n/**\r\n * Creates a split container component\r\n * @param props defines the split container properties\r\n * @returns the split container component\r\n */\r\nexport const SplitContainer: React.FC<PropsWithChildren<ISplitContainerProps>> = (props) => {\r\n const elementRef: React.RefObject<HTMLDivElement> = props.containerRef || useRef(null);\r\n const sizes: number[] = [];\r\n const floatingCells: boolean[] = [];\r\n const noInitialSizes: boolean[] = [];\r\n const floatingMinSize = props.floatingMinSize || 200;\r\n const controllers: number[][] = [];\r\n const minSizes: number[] = [];\r\n const maxSizes: number[] = [];\r\n\r\n const buildGridDefinition = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n const children = elementRef.current.children;\r\n\r\n let gridIndex = 1;\r\n const pickArray = Array.from(children);\r\n let gridDefinition = \"\";\r\n for (const child of children) {\r\n const childElement = child as HTMLElement;\r\n if (child.classList.contains(styles[\"splitter\"])) {\r\n gridDefinition += \"auto \";\r\n } else {\r\n const sourceIndex = pickArray.indexOf(child);\r\n if (floatingCells[sourceIndex] || noInitialSizes[sourceIndex]) {\r\n gridDefinition += \"1fr \";\r\n } else {\r\n gridDefinition += \"auto \";\r\n }\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childElement.style.gridRow = \"1\";\r\n childElement.style.gridColumn = gridIndex.toString();\r\n } else {\r\n childElement.style.gridColumn = \"1\";\r\n childElement.style.gridRow = gridIndex.toString();\r\n }\r\n\r\n gridIndex++;\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n elementRef.current.style.gridTemplateRows = \"100%\";\r\n elementRef.current.style.gridTemplateColumns = gridDefinition;\r\n } else {\r\n elementRef.current.style.gridTemplateColumns = \"100%\";\r\n elementRef.current.style.gridTemplateRows = gridDefinition;\r\n }\r\n };\r\n\r\n const handleResize = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n // Check if we have enough room for everyone\r\n const children = elementRef.current.children;\r\n for (let i = 0; i < children.length; i++) {\r\n if (!floatingCells[i]) {\r\n continue;\r\n }\r\n\r\n const child = children[i] as HTMLElement;\r\n let childsize = 0;\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childsize = child.getBoundingClientRect().width;\r\n } else {\r\n childsize = child.getBoundingClientRect().height;\r\n }\r\n\r\n if (childsize < floatingMinSize) {\r\n const missing = Math.floor(floatingMinSize - childsize);\r\n let done = 0;\r\n\r\n // picking the controller in order and try to reduce their size to fit\r\n for (let j = 0; j < controllers[i].length; j++) {\r\n const controllerIndex = controllers[i][j];\r\n const controller = children[controllerIndex] as HTMLElement;\r\n const currentSize = props.direction === SplitDirection.Horizontal ? controller.getBoundingClientRect().width : controller.getBoundingClientRect().height;\r\n let newSize = currentSize - missing;\r\n if (minSizes[controllerIndex]) {\r\n newSize = Math.max(newSize, minSizes[controllerIndex]);\r\n }\r\n if (props.direction === SplitDirection.Horizontal) {\r\n controller.style.width = `${newSize}px`;\r\n } else {\r\n controller.style.height = `${newSize}px`;\r\n }\r\n\r\n done += currentSize - newSize;\r\n\r\n if (done === missing) {\r\n // We made it\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n buildGridDefinition();\r\n\r\n // Add event listener for window resize\r\n window.addEventListener(\"resize\", handleResize);\r\n\r\n // Cleanup the event listener on component unmount\r\n return () => {\r\n window.removeEventListener(\"resize\", handleResize);\r\n };\r\n }, []);\r\n\r\n const drag = (offset: number, source: HTMLElement, controlledSide: ControlledSize) => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n const children = elementRef.current.children;\r\n const childArray = Array.from(children) as HTMLElement[];\r\n const sourceIndex = childArray.indexOf(source);\r\n if (sourceIndex <= 0) {\r\n return;\r\n }\r\n\r\n let current = 0;\r\n if (controlledSide === ControlledSize.First) {\r\n current = sourceIndex - 1;\r\n } else {\r\n current = sourceIndex + 1;\r\n }\r\n const minSize = minSizes[current] || 0;\r\n const maxSize = maxSizes[current];\r\n\r\n noInitialSizes[current] = false;\r\n buildGridDefinition();\r\n\r\n let newSize = Math.floor(controlledSide === ControlledSize.First ? sizes[current] + offset : sizes[current] - offset);\r\n\r\n // Min size check\r\n if (newSize < minSize) {\r\n newSize = minSize;\r\n }\r\n\r\n // Max size check\r\n if (maxSize && newSize > maxSize) {\r\n newSize = maxSize;\r\n }\r\n\r\n // Max size check across the whole container\r\n const maxContainerSize = sizes.reduce((a, b) => a + b, 0) || 0;\r\n let totalSize = 0;\r\n let totalFloating = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n if (floatingCells[i]) {\r\n totalFloating++;\r\n } else {\r\n totalSize += i === current ? newSize : sizes[i];\r\n }\r\n }\r\n\r\n if (maxContainerSize - totalSize < floatingMinSize * totalFloating) {\r\n newSize = maxContainerSize - floatingMinSize * totalFloating;\r\n }\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childArray[current].style.width = `${newSize}px`;\r\n } else {\r\n childArray[current].style.height = `${newSize}px`;\r\n }\r\n };\r\n\r\n const beginDrag = () => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n const children = elementRef.current.children;\r\n sizes.length = 0;\r\n for (const child of children) {\r\n const childElement = child as HTMLElement;\r\n\r\n if (props.direction === SplitDirection.Horizontal) {\r\n sizes.push(childElement.getBoundingClientRect().width);\r\n } else {\r\n sizes.push(childElement.getBoundingClientRect().height);\r\n }\r\n }\r\n };\r\n\r\n const endDrag = () => {\r\n sizes.length = 0;\r\n };\r\n\r\n // We assume splitter are not flagging floating cells in a different way\r\n const sync = (source: HTMLElement, controlledSide: ControlledSize, size?: number, minSize?: number, maxSize?: number) => {\r\n if (!elementRef.current) {\r\n return;\r\n }\r\n\r\n const children = elementRef.current.children;\r\n const childArray = Array.from(children) as HTMLElement[];\r\n const sourceIndex = childArray.indexOf(source);\r\n if (sourceIndex <= 0) {\r\n return;\r\n }\r\n\r\n let current = 0;\r\n let other = 0;\r\n if (controlledSide === ControlledSize.First) {\r\n current = sourceIndex - 1;\r\n other = sourceIndex + 1;\r\n } else {\r\n current = sourceIndex + 1;\r\n other = sourceIndex - 1;\r\n }\r\n\r\n if (size !== undefined) {\r\n const sizeString = `${size | 0}px`;\r\n\r\n if (!childArray[current].style.width) {\r\n if (props.direction === SplitDirection.Horizontal) {\r\n childArray[current].style.width = sizeString;\r\n } else {\r\n childArray[current].style.height = sizeString;\r\n }\r\n }\r\n } else {\r\n noInitialSizes[current] = true;\r\n }\r\n\r\n if (minSize !== undefined) {\r\n minSizes[current] = minSize;\r\n }\r\n\r\n if (maxSize !== undefined) {\r\n maxSizes[current] = maxSize;\r\n }\r\n\r\n if (!controllers[other]) {\r\n controllers[other] = [];\r\n }\r\n controllers[other].push(current);\r\n floatingCells[other] = true;\r\n };\r\n\r\n return (\r\n <SplitContext.Provider value={{ direction: props.direction, drag, beginDrag, endDrag, sync }}>\r\n <div\r\n id={props.id}\r\n className={styles[\"split-container\"] + \" \" + props.className}\r\n ref={elementRef}\r\n onPointerDown={(evt) => props.onPointerDown && props.onPointerDown(evt)}\r\n onPointerMove={(evt) => props.onPointerMove && props.onPointerMove(evt)}\r\n onPointerUp={(evt) => props.onPointerUp && props.onPointerUp(evt)}\r\n onDrop={(evt) => props.onDrop && props.onDrop(evt)}\r\n onDragOver={(evt) => props.onDragOver && props.onDragOver(evt)}\r\n >\r\n {props.children}\r\n </div>\r\n </SplitContext.Provider>\r\n );\r\n};\r\n"]}