@babylonjs/node-editor 5.31.1 → 5.32.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.
@@ -1439,8 +1439,9 @@ export type ButtonProps = {
1439
1439
  active?: boolean;
1440
1440
  onClick?: () => void;
1441
1441
  color: "light" | "dark";
1442
- size: "default" | "small" | "wide";
1442
+ size: "default" | "small" | "wide" | "smaller";
1443
1443
  title?: string;
1444
+ backgroundColor?: string;
1444
1445
  };
1445
1446
  export const Button: React.FC<ButtonProps>;
1446
1447
 
@@ -2050,6 +2051,29 @@ export class NumericInputComponent extends React.Component<INumericInputComponen
2050
2051
  }
2051
2052
  export {};
2052
2053
 
2054
+ }
2055
+ declare module "@babylonjs/node-editor/components/lines/OptionsLineComponent" {
2056
+ /// <reference types="react" />
2057
+ /**
2058
+ * This components represents an options menu with optional
2059
+ * customizable properties. Option IDs should be unique.
2060
+ */
2061
+ export interface IOption {
2062
+ label: string;
2063
+ value: string;
2064
+ id: string;
2065
+ }
2066
+ export interface IOptionsLineComponentProps {
2067
+ options: IOption[];
2068
+ addOptionPlaceholder?: string;
2069
+ onOptionAdded?: (newOption: IOption) => void;
2070
+ onOptionSelected: (selectedOptionValue: string) => void;
2071
+ selectedOptionValue: string;
2072
+ validateNewOptionValue?: (newOptionValue: string) => boolean;
2073
+ addOptionText?: string;
2074
+ }
2075
+ export const OptionsLineComponent: (props: IOptionsLineComponentProps) => JSX.Element;
2076
+
2053
2077
  }
2054
2078
  declare module "@babylonjs/node-editor/components/MessageDialog" {
2055
2079
  import * as React from "react";
@@ -2060,6 +2084,21 @@ export interface MessageDialogProps {
2060
2084
  }
2061
2085
  export const MessageDialog: React.FC<MessageDialogProps>;
2062
2086
 
2087
+ }
2088
+ declare module "@babylonjs/node-editor/components/TextInputWithSubmit" {
2089
+ /// <reference types="react" />
2090
+ export interface ITextInputProps {
2091
+ label?: string;
2092
+ placeholder?: string;
2093
+ submitValue: (newValue: string) => void;
2094
+ validateValue?: (value: string) => boolean;
2095
+ cancelSubmit?: () => void;
2096
+ }
2097
+ /**
2098
+ * This component represents a text input that can be submitted or cancelled on buttons
2099
+ */
2100
+ export const TextInputWithSubmit: (props: ITextInputProps) => JSX.Element;
2101
+
2063
2102
  }
2064
2103
  declare module "@babylonjs/node-editor/components/Toggle" {
2065
2104
  /// <reference types="react" />
@@ -2615,14 +2654,9 @@ export interface IOptionsLineComponentProps {
2615
2654
  target: any;
2616
2655
  propertyName: string;
2617
2656
  options: IInspectableOptions[];
2618
- addInput?: boolean;
2619
2657
  noDirectUpdate?: boolean;
2620
2658
  onSelect?: (value: number | string) => void;
2621
2659
  extractValue?: (target: any) => number | string;
2622
- addVal?: (newVal: {
2623
- label: string;
2624
- value: number;
2625
- }, prevVal: number) => void;
2626
2660
  onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
2627
2661
  allowNullValue?: boolean;
2628
2662
  icon?: string;
@@ -2630,13 +2664,9 @@ export interface IOptionsLineComponentProps {
2630
2664
  className?: string;
2631
2665
  valuesAreStrings?: boolean;
2632
2666
  defaultIfNull?: number;
2633
- fromFontDropdown?: boolean;
2634
- valueProp?: number;
2635
- fallbackValue?: number;
2636
2667
  }
2637
2668
  export class OptionsLineComponent extends React.Component<IOptionsLineComponentProps, {
2638
2669
  value: number | string;
2639
- addCustom: boolean;
2640
2670
  }> {
2641
2671
  private _localChange;
2642
2672
  private _remapValueIn;
@@ -2645,12 +2675,10 @@ export class OptionsLineComponent extends React.Component<IOptionsLineComponentP
2645
2675
  constructor(props: IOptionsLineComponentProps);
2646
2676
  shouldComponentUpdate(nextProps: IOptionsLineComponentProps, nextState: {
2647
2677
  value: number;
2648
- addCustom: boolean;
2649
2678
  }): boolean;
2650
2679
  raiseOnPropertyChanged(newValue: number, previousValue: number): void;
2651
2680
  setValue(value: string | number): void;
2652
2681
  updateValue(valueString: string): void;
2653
- updateCustomValue(): void;
2654
2682
  render(): JSX.Element;
2655
2683
  }
2656
2684
 
@@ -3665,25 +3693,25 @@ export class PropertyChangedEvent {
3665
3693
  }
3666
3694
  declare module "@babylonjs/node-editor/stories/bars/CommandBarComponent.stories" {
3667
3695
  /// <reference types="react" />
3696
+ import { CommandBarComponent } from "@babylonjs/node-editor/components/bars/CommandBarComponent";
3697
+
3668
3698
  const _default: {
3669
3699
 
3670
3700
  };
3671
3701
  export default _default;
3672
- export const Default: {};
3673
- export const WithArtboardColor: {
3674
- parameters: {
3675
- onArtboardColorChanged: (color: string) => void;
3676
- };
3677
- };
3702
+ export const Default: StoryObj<typeof CommandBarComponent>;
3703
+ export const WithArtboardColor: StoryObj<typeof CommandBarComponent>;
3678
3704
 
3679
3705
  }
3680
3706
  declare module "@babylonjs/node-editor/stories/bars/CommandButtonComponent.stories" {
3681
3707
  /// <reference types="react" />
3708
+ import { CommandButtonComponent } from "@babylonjs/node-editor/components/bars/CommandButtonComponent";
3709
+
3682
3710
  const _default: {
3683
3711
 
3684
3712
  };
3685
3713
  export default _default;
3686
- export const Default: {};
3714
+ export const Default: StoryObj<typeof CommandButtonComponent>;
3687
3715
 
3688
3716
  }
3689
3717
  declare module "@babylonjs/node-editor/stories/Button.stories" {
@@ -3700,17 +3728,13 @@ export const Small: any;
3700
3728
 
3701
3729
  }
3702
3730
  declare module "@babylonjs/node-editor/stories/colorPicker/ColorPicker.stories" {
3703
- import { Color3 } from "@babylonjs/core/Maths/math.color";
3704
3731
  import { ColorPicker } from "@babylonjs/node-editor/components/colorPicker/ColorPicker";
3732
+
3705
3733
  const _default: {
3706
3734
  component: typeof ColorPicker;
3707
3735
  };
3708
3736
  export default _default;
3709
- export const Default: {
3710
- args: {
3711
- color: Color3;
3712
- };
3713
- };
3737
+ export const Default: StoryObj<typeof ColorPicker>;
3714
3738
 
3715
3739
  }
3716
3740
  declare module "@babylonjs/node-editor/stories/Icon.stories" {
@@ -3739,114 +3763,67 @@ export const Default: any;
3739
3763
  declare module "@babylonjs/node-editor/stories/layout/FlexibleGridLayout.stories" {
3740
3764
  /// <reference types="react" />
3741
3765
  import { IFlexibleGridLayoutProps } from "@babylonjs/node-editor/components/layout/FlexibleGridLayout";
3766
+ import { FlexibleGridLayout } from "@babylonjs/node-editor/components/layout/FlexibleGridLayout";
3767
+
3742
3768
  const _default: {
3743
3769
  component: import("react").FC<IFlexibleGridLayoutProps>;
3744
3770
  };
3745
3771
  export default _default;
3746
- export const Default: {
3747
- render: (props: IFlexibleGridLayoutProps) => JSX.Element;
3748
- args: {
3749
- layoutDefinition: {
3750
- columns: {
3751
- id: string;
3752
- width: string;
3753
- rows: {
3754
- id: string;
3755
- height: string;
3756
- selectedTab: string;
3757
- tabs: {
3758
- id: string;
3759
- component: JSX.Element;
3760
- }[];
3761
- }[];
3762
- }[];
3763
- };
3764
- };
3765
- };
3766
- export const TwoColumn: {
3767
- render: (props: IFlexibleGridLayoutProps) => JSX.Element;
3768
- args: {
3769
- layoutDefinition: {
3770
- columns: {
3771
- id: string;
3772
- width: string;
3773
- rows: {
3774
- id: string;
3775
- height: string;
3776
- selectedTab: string;
3777
- tabs: {
3778
- id: string;
3779
- component: JSX.Element;
3780
- }[];
3781
- }[];
3782
- }[];
3783
- };
3784
- };
3785
- };
3772
+ export const Default: StoryObj<typeof FlexibleGridLayout>;
3773
+ export const TwoColumn: StoryObj<typeof FlexibleGridLayout>;
3786
3774
 
3787
3775
  }
3788
3776
  declare module "@babylonjs/node-editor/stories/lines/ColorLineComponent.stories" {
3789
- /// <reference types="react" />
3790
- import { Observable } from "@babylonjs/core/Misc/observable";
3791
- import { PropertyChangedEvent } from "@babylonjs/node-editor/propertyChangedEvent";
3792
- import { IColorLineComponentProps } from "@babylonjs/node-editor/components/lines/ColorLineComponent";
3793
3777
  import { ColorLineComponent } from "@babylonjs/node-editor/components/lines/ColorLineComponent";
3778
+
3794
3779
  const _default: {
3795
3780
  component: typeof ColorLineComponent;
3796
3781
  };
3797
3782
  export default _default;
3798
- export const Default: {
3799
- render: (args: IColorLineComponentProps) => JSX.Element;
3800
- args: {
3801
- target: {};
3802
- label: string;
3803
- propertyName: string;
3804
- lockObject: {
3805
- lock: boolean;
3806
- };
3807
- onPropertyChangedObservable: Observable<PropertyChangedEvent>;
3808
- };
3809
- };
3783
+ export const Default: StoryObj<typeof ColorLineComponent>;
3810
3784
 
3811
3785
  }
3812
3786
  declare module "@babylonjs/node-editor/stories/lines/ColorPickerLineComponent.stories" {
3813
- /// <reference types="react" />
3814
- import { Color3 } from "@babylonjs/core/Maths/math.color";
3815
- import { IColorPickerComponentProps } from "@babylonjs/node-editor/components/lines/ColorPickerLineComponent";
3816
3787
  import { ColorPickerLineComponent } from "@babylonjs/node-editor/components/lines/ColorPickerLineComponent";
3788
+
3817
3789
  const _default: {
3818
3790
  component: typeof ColorPickerLineComponent;
3819
3791
  };
3820
3792
  export default _default;
3821
- export const Default: {
3822
- render: (args: IColorPickerComponentProps) => JSX.Element;
3823
- args: {
3824
- value: Color3;
3825
- };
3826
- };
3793
+ export const Default: StoryObj<typeof ColorPickerLineComponent>;
3827
3794
 
3828
3795
  }
3829
3796
  declare module "@babylonjs/node-editor/stories/lines/FileButtonLineComponent.stories" {
3830
3797
  import { FileButtonLineComponent } from "@babylonjs/node-editor/components/lines/FileButtonLineComponent";
3798
+
3831
3799
  const _default: {
3832
3800
  component: typeof FileButtonLineComponent;
3833
3801
  };
3834
3802
  export default _default;
3835
- export const Default: {};
3803
+ export const Default: StoryObj<typeof FileButtonLineComponent>;
3836
3804
 
3837
3805
  }
3838
3806
  declare module "@babylonjs/node-editor/stories/lines/NumericInputComponent.stories" {
3839
3807
  import { NumericInputComponent } from "@babylonjs/node-editor/components/lines/NumericInputComponent";
3808
+
3840
3809
  const _default: {
3841
3810
  component: typeof NumericInputComponent;
3842
3811
  };
3843
3812
  export default _default;
3844
- export const Default: {
3845
- args: {
3846
- label: string;
3847
- value: number;
3848
- };
3813
+ export const Default: StoryObj<typeof NumericInputComponent>;
3814
+
3815
+ }
3816
+ declare module "@babylonjs/node-editor/stories/lines/OptionsLineComponent.stories" {
3817
+ /// <reference types="react" />
3818
+
3819
+ const _default: {
3820
+ component: (props: import("@babylonjs/node-editor/components/lines/OptionsLineComponent").IOptionsLineComponentProps) => JSX.Element;
3849
3821
  };
3822
+ export default _default;
3823
+ const RenderComponent: (args: any) => JSX.Element;
3824
+ export const Default: StoryObj<typeof RenderComponent>;
3825
+ export const WithCustomOptions: StoryObj<typeof RenderComponent>;
3826
+ export const WithValidation: StoryObj<typeof RenderComponent>;
3850
3827
 
3851
3828
  }
3852
3829
  declare module "@babylonjs/node-editor/stories/MessageDialog.stories" {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/node-editor",
3
- "version": "5.31.1",
3
+ "version": "5.32.0",
4
4
  "main": "dist/babylon.nodeEditor.max.js",
5
5
  "module": "dist/babylon.nodeEditor.max.js",
6
6
  "esnext": "dist/babylon.nodeEditor.max.js",
@@ -23,7 +23,7 @@
23
23
  "@types/react-dom": ">=16.0.9"
24
24
  },
25
25
  "devDependencies": {
26
- "@babylonjs/core": "^5.31.1",
26
+ "@babylonjs/core": "^5.32.0",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2",
29
29
  "rimraf": "^3.0.2",