@babylonjs/gui-editor 5.0.0-rc.9 → 5.0.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.
@@ -7,9 +7,6 @@ interface ICommandBarComponentProps {
7
7
  globalState: GlobalState;
8
8
  }
9
9
  export class CommandBarComponent extends React.Component<ICommandBarComponentProps> {
10
- private _panning;
11
- private _zooming;
12
- private _selecting;
13
10
  private _sizeOption;
14
11
  constructor(props: ICommandBarComponentProps);
15
12
  render(): JSX.Element;
@@ -198,6 +195,7 @@ interface ICommonControlPropertyGridComponentProps {
198
195
  controls: Control[];
199
196
  lockObject: LockObject;
200
197
  onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
198
+ hideDimensions?: boolean;
201
199
  }
202
200
  export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps> {
203
201
  private _onPropertyChangedObserver;
@@ -349,7 +347,11 @@ interface IImagePropertyGridComponentProps {
349
347
  onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
350
348
  }
351
349
  export class ImagePropertyGridComponent extends React.Component<IImagePropertyGridComponentProps> {
350
+ private _observers;
352
351
  constructor(props: IImagePropertyGridComponentProps);
352
+ shouldComponentUpdate(nextProps: IImagePropertyGridComponentProps): boolean;
353
+ updateObservers(oldImages: Image[], newImages: Image[]): void;
354
+ componentWillUnmount(): void;
353
355
  toggleAnimations(on: boolean): void;
354
356
  getMaxCells(): number;
355
357
  updateCellSize(): void;
@@ -561,7 +563,8 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/entities/gui/cont
561
563
  import { IExplorerExtensibilityGroup } from "@babylonjs/core/Debug/debugLayer";
562
564
  import { Control } from "@babylonjs/gui/2D/controls/control";
563
565
  import * as React from "react";
564
- import { DragOverLocation, GlobalState } from "@babylonjs/gui-editor/globalState";
566
+ import { GlobalState } from "@babylonjs/gui-editor/globalState";
567
+ import { DragOverLocation } from "@babylonjs/gui-editor/globalState";
565
568
  interface IControlTreeItemComponentProps {
566
569
  control: Control;
567
570
  extensibilityGroups?: IExplorerExtensibilityGroup[];
@@ -720,7 +723,8 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemSelectabl
720
723
  import { Nullable } from "@babylonjs/core/types";
721
724
  import { IExplorerExtensibilityGroup } from "@babylonjs/core/Debug/debugLayer";
722
725
  import * as React from "react";
723
- import { DragOverLocation, GlobalState } from "@babylonjs/gui-editor/globalState";
726
+ import { GlobalState } from "@babylonjs/gui-editor/globalState";
727
+ import { DragOverLocation } from "@babylonjs/gui-editor/globalState";
724
728
  export interface ITreeItemSelectableComponentProps {
725
729
  entity: any;
726
730
  selectedEntities: any[];
@@ -847,42 +851,27 @@ export class CoordinateHelper {
847
851
  */
848
852
  static ConvertToPercentage(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
849
853
  static Round(value: number): number;
850
- static ConvertToPixels(guiControl: Control, properties?: DimensionProperties[]): void;
854
+ static ConvertToPixels(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
851
855
  }
852
856
 
853
857
  }
854
- declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
858
+ declare module "@babylonjs/gui-editor/diagram/gizmoGeneric" {
855
859
  import { Control } from "@babylonjs/gui/2D/controls/control";
856
- import { Vector2 } from "@babylonjs/core/Maths/math.vector";
857
860
  import * as React from "react";
858
861
  import { GlobalState } from "@babylonjs/gui-editor/globalState";
859
862
  import { Rect } from "@babylonjs/gui-editor/diagram/coordinateHelper";
860
- import "@babylonjs/gui-editor/diagram/workbenchCanvas.scss";
863
+ import { IScalePoint } from "@babylonjs/gui-editor/diagram/gizmoScalePoint";
861
864
  export interface IGuiGizmoProps {
862
865
  globalState: GlobalState;
863
866
  control: Control;
864
867
  }
865
- enum ScalePointPosition {
866
- Top = -1,
867
- Left = -1,
868
- Center = 0,
869
- Right = 1,
870
- Bottom = 1
871
- }
872
- interface IScalePoint {
873
- position: Vector2;
874
- horizontalPosition: ScalePointPosition;
875
- verticalPosition: ScalePointPosition;
876
- rotation: number;
877
- isPivot: boolean;
878
- }
879
868
  interface IGuiGizmoState {
880
869
  canvasBounds: Rect;
881
870
  scalePoints: IScalePoint[];
882
871
  scalePointDragging: number;
883
872
  isRotating: boolean;
884
873
  }
885
- export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmoState> {
874
+ export class GizmoGeneric extends React.Component<IGuiGizmoProps, IGuiGizmoState> {
886
875
  private _storedValues;
887
876
  private _localBounds;
888
877
  private _rotation;
@@ -890,15 +879,16 @@ export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmo
890
879
  private _pointerUpObserver;
891
880
  private _pointerMoveObserver;
892
881
  constructor(props: IGuiGizmoProps);
882
+ componentDidMount(): void;
893
883
  componentWillUnmount(): void;
894
884
  /**
895
885
  * Update the gizmo's positions
886
+ * @param force should the update be forced. otherwise it will be updated only when the pointer is down
896
887
  */
897
888
  updateGizmo(): void;
898
889
  private _onUp;
899
890
  private _onMove;
900
891
  private _rotate;
901
- private _modulo;
902
892
  private _dragLocalBounds;
903
893
  private _updateNodeFromLocalBounds;
904
894
  private _beginDraggingScalePoint;
@@ -908,7 +898,51 @@ export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmo
908
898
  export {};
909
899
 
910
900
  }
911
- declare module "@babylonjs/gui-editor/diagram/guiGizmoWrapper" {
901
+ declare module "@babylonjs/gui-editor/diagram/gizmoLine" {
902
+ /// <reference types="react" />
903
+ import { GlobalState } from "@babylonjs/gui-editor/globalState";
904
+ import { Line } from "@babylonjs/gui/2D/controls/line";
905
+ interface IGizmoLineProps {
906
+ globalState: GlobalState;
907
+ control: Line;
908
+ }
909
+ export function GizmoLine(props: IGizmoLineProps): JSX.Element;
910
+ export {};
911
+
912
+ }
913
+ declare module "@babylonjs/gui-editor/diagram/gizmoScalePoint" {
914
+ /// <reference types="react" />
915
+ import { Vector2 } from "@babylonjs/core/Maths/math";
916
+ export enum ScalePointPosition {
917
+ Top = -1,
918
+ Left = -1,
919
+ Center = 0,
920
+ Right = 1,
921
+ Bottom = 1
922
+ }
923
+ export interface IScalePoint {
924
+ position: Vector2;
925
+ horizontalPosition: ScalePointPosition;
926
+ verticalPosition: ScalePointPosition;
927
+ rotation: number;
928
+ isPivot: boolean;
929
+ defaultRotation: number;
930
+ }
931
+ interface IGizmoScalePointProps {
932
+ scalePoint: IScalePoint;
933
+ clickable: boolean;
934
+ key: number;
935
+ onDrag: () => void;
936
+ onRotate: () => void;
937
+ onUp: () => void;
938
+ overrideCursor?: string;
939
+ canRotate: boolean;
940
+ }
941
+ export function GizmoScalePoint(props: IGizmoScalePointProps): JSX.Element;
942
+ export {};
943
+
944
+ }
945
+ declare module "@babylonjs/gui-editor/diagram/gizmoWrapper" {
912
946
  import { Nullable } from "@babylonjs/core/types";
913
947
  import { Observer } from "@babylonjs/core/Misc/observable";
914
948
  import * as React from "react";
@@ -946,15 +980,8 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
946
980
  private _setConstraintDirection;
947
981
  private _mouseStartPoint;
948
982
  _scene: Scene;
949
- private _ctrlKeyIsPressed;
950
- private _altKeyIsPressed;
951
983
  private _constraintDirection;
952
- private _forcePanning;
953
- private _forceZooming;
954
- private _forceSelecting;
955
984
  private _panning;
956
- private _canvas;
957
- private _responsive;
958
985
  private _isOverGUINode;
959
986
  private _engine;
960
987
  private _liveRenderObserver;
@@ -990,7 +1017,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
990
1017
  pasteFromClipboard(clipboardContents: string): boolean;
991
1018
  CopyGUIControl(original: Control): void;
992
1019
  blurEvent: () => void;
993
- componentWillUnmount(): void;
1020
+ dispose(): void;
994
1021
  loadFromJson(serializationObject: any): void;
995
1022
  loadFromSnippet(snippetId: string): Promise<void>;
996
1023
  loadToEditor(): void;
@@ -998,13 +1025,12 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
998
1025
  appendBlock(guiElement: Control): Control;
999
1026
  createNewGuiNode(guiControl: Control): Control;
1000
1027
  private parent;
1001
- private _convertToPixels;
1002
1028
  private _reorderGrid;
1003
1029
  private _isNotChildInsert;
1004
1030
  private _adjustParentingIndex;
1005
1031
  isSelected(value: boolean, guiNode: Control): void;
1006
1032
  clicked: boolean;
1007
- _onMove(guiControl: Control, evt: Vector2, startPos: Vector2): boolean;
1033
+ _onMove(guiControl: Control, evt: Vector2, startPos: Vector2): void;
1008
1034
  onMove(evt: React.PointerEvent): void;
1009
1035
  private _screenToTexturePosition;
1010
1036
  private getScaledPointerPosition;
@@ -1038,12 +1064,18 @@ import { Scene } from "@babylonjs/core/scene";
1038
1064
  import { Control } from "@babylonjs/gui/2D/controls/control";
1039
1065
  import { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObject";
1040
1066
  import { ISize } from "@babylonjs/core/Maths/math";
1067
+ import { KeyboardManager } from "@babylonjs/gui-editor/keyboardManager";
1041
1068
  export enum DragOverLocation {
1042
1069
  ABOVE = 0,
1043
1070
  BELOW = 1,
1044
1071
  CENTER = 2,
1045
1072
  NONE = 3
1046
1073
  }
1074
+ export enum GUIEditorTool {
1075
+ SELECT = 0,
1076
+ PAN = 1,
1077
+ ZOOM = 2
1078
+ }
1047
1079
  export class GlobalState {
1048
1080
  liveGuiTexture: Nullable<AdvancedDynamicTexture>;
1049
1081
  guiTexture: AdvancedDynamicTexture;
@@ -1065,17 +1097,19 @@ export class GlobalState {
1065
1097
  onPopupClosedObservable: Observable<void>;
1066
1098
  private _backgroundColor;
1067
1099
  private _outlines;
1068
- isMultiSelecting: boolean;
1069
- onOutlineChangedObservable: Observable<void>;
1100
+ keys: KeyboardManager;
1101
+ /** DO NOT USE: in the process of removing */
1070
1102
  blockKeyboardEvents: boolean;
1103
+ onOutlineChangedObservable: Observable<void>;
1071
1104
  controlCamera: boolean;
1072
1105
  selectionLock: boolean;
1073
1106
  workbench: WorkbenchComponent;
1074
1107
  onPropertyChangedObservable: Observable<PropertyChangedEvent>;
1075
- onZoomObservable: Observable<void>;
1108
+ private _tool;
1109
+ onToolChangeObservable: Observable<void>;
1110
+ get tool(): GUIEditorTool;
1111
+ set tool(newTool: GUIEditorTool);
1076
1112
  onFitToWindowObservable: Observable<void>;
1077
- onPanObservable: Observable<void>;
1078
- onSelectionButtonObservable: Observable<void>;
1079
1113
  onLoadObservable: Observable<File>;
1080
1114
  onSaveObservable: Observable<void>;
1081
1115
  onSnippetLoadObservable: Observable<void>;
@@ -1111,7 +1145,6 @@ export class GlobalState {
1111
1145
  constructor();
1112
1146
  /** adds copy, cut and paste listeners to the host window */
1113
1147
  registerEventListeners(): void;
1114
- private _updateKeys;
1115
1148
  get backgroundColor(): Color3;
1116
1149
  set backgroundColor(value: Color3);
1117
1150
  get outlines(): boolean;
@@ -1120,6 +1153,7 @@ export class GlobalState {
1120
1153
  setSelection(controls: Control[]): void;
1121
1154
  deleteSelectedNodes(): void;
1122
1155
  isMultiSelectable(control: Control): boolean;
1156
+ dispose(): void;
1123
1157
  }
1124
1158
 
1125
1159
  }
@@ -1173,13 +1207,35 @@ import { RadioButton } from "@babylonjs/gui/2D/controls/radioButton";
1173
1207
  import { ImageBasedSlider } from "@babylonjs/gui/2D/controls/sliders/imageBasedSlider";
1174
1208
  export class GUINodeTools {
1175
1209
  static ImageControlDefaultUrl: string;
1176
- static CreateControlFromString(data: string): Grid | Rectangle | Line | TextBlock | Image | Slider | ImageBasedSlider | RadioButton | InputText | ColorPicker | StackPanel | Ellipse | Checkbox | DisplayGrid;
1210
+ static CreateControlFromString(data: string): Grid | Rectangle | StackPanel | Line | TextBlock | Image | Slider | ImageBasedSlider | RadioButton | InputText | ColorPicker | Ellipse | Checkbox | DisplayGrid;
1177
1211
  }
1178
1212
 
1179
1213
  }
1180
1214
  declare module "@babylonjs/gui-editor/index" {
1181
1215
  export * from "@babylonjs/gui-editor/guiEditor";
1182
1216
 
1217
+ }
1218
+ declare module "@babylonjs/gui-editor/keyboardManager" {
1219
+ import { Observable } from "@babylonjs/core/Misc/observable";
1220
+ type Key = "control" | "shift" | "alt" | "space" | "meta";
1221
+ export class KeyboardManager {
1222
+ private _hostElement;
1223
+ private _kdListener;
1224
+ private _kuListener;
1225
+ private _moveListener;
1226
+ private _focusOutListener;
1227
+ private _keys;
1228
+ onKeyPressedObservable: Observable<Key>;
1229
+ constructor(hostElement: HTMLElement | HTMLDocument);
1230
+ private _keyEvent;
1231
+ private _updateModifierKeys;
1232
+ private _setKeyDown;
1233
+ private _clearKeys;
1234
+ isKeyDown(key: Key): boolean;
1235
+ dispose(): void;
1236
+ }
1237
+ export {};
1238
+
1183
1239
  }
1184
1240
  declare module "@babylonjs/gui-editor/legacy/legacy" {
1185
1241
  export * from "@babylonjs/gui-editor/index";
@@ -1225,68 +1281,6 @@ export class Portal extends React.Component<IPortalProps> {
1225
1281
  }
1226
1282
  export {};
1227
1283
 
1228
- }
1229
- declare module "@babylonjs/gui-editor/sharedComponents/floatLineComponent" {
1230
- import * as React from "react";
1231
- import { Observable } from "@babylonjs/core/Misc/observable";
1232
- import { PropertyChangedEvent } from "@babylonjs/gui-editor/sharedComponents/propertyChangedEvent";
1233
- import { GlobalState } from "@babylonjs/gui-editor/globalState";
1234
- interface IFloatLineComponentProps {
1235
- label: string;
1236
- target: any;
1237
- propertyName: string;
1238
- onChange?: (newValue: number) => void;
1239
- isInteger?: boolean;
1240
- onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
1241
- additionalClass?: string;
1242
- step?: string;
1243
- digits?: number;
1244
- globalState: GlobalState;
1245
- min?: number;
1246
- max?: number;
1247
- smallUI?: boolean;
1248
- onEnter?: (newValue: number) => void;
1249
- }
1250
- export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
1251
- value: string;
1252
- }> {
1253
- private _localChange;
1254
- private _store;
1255
- private _regExp;
1256
- private _digits;
1257
- constructor(props: IFloatLineComponentProps);
1258
- shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: {
1259
- value: string;
1260
- }): boolean;
1261
- raiseOnPropertyChanged(newValue: number, previousValue: number): void;
1262
- updateValue(valueString: string): void;
1263
- render(): JSX.Element;
1264
- }
1265
- export {};
1266
-
1267
- }
1268
- declare module "@babylonjs/gui-editor/sharedComponents/lineWithFileButtonComponent" {
1269
- import * as React from "react";
1270
- interface ILineWithFileButtonComponentProps {
1271
- title: string;
1272
- closed?: boolean;
1273
- label: string;
1274
- iconImage: any;
1275
- onIconClick: (file: File) => void;
1276
- accept: string;
1277
- uploadName?: string;
1278
- }
1279
- export class LineWithFileButtonComponent extends React.Component<ILineWithFileButtonComponentProps, {
1280
- isExpanded: boolean;
1281
- }> {
1282
- private _uploadRef;
1283
- constructor(props: ILineWithFileButtonComponentProps);
1284
- onChange(evt: any): void;
1285
- switchExpandedState(): void;
1286
- render(): JSX.Element;
1287
- }
1288
- export {};
1289
-
1290
1284
  }
1291
1285
  declare module "@babylonjs/gui-editor/sharedComponents/messageDialog" {
1292
1286
  import * as React from "react";
@@ -1303,109 +1297,6 @@ export class MessageDialogComponent extends React.Component<IMessageDialogCompon
1303
1297
  }
1304
1298
  export {};
1305
1299
 
1306
- }
1307
- declare module "@babylonjs/gui-editor/sharedComponents/numericInputComponent" {
1308
- import * as React from "react";
1309
- import { GlobalState } from "@babylonjs/gui-editor/globalState";
1310
- interface INumericInputComponentProps {
1311
- label: string;
1312
- value: number;
1313
- step?: number;
1314
- onChange: (value: number) => void;
1315
- globalState: GlobalState;
1316
- }
1317
- export class NumericInputComponent extends React.Component<INumericInputComponentProps, {
1318
- value: string;
1319
- }> {
1320
- static defaultProps: {
1321
- step: number;
1322
- };
1323
- private _localChange;
1324
- constructor(props: INumericInputComponentProps);
1325
- shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
1326
- value: string;
1327
- }): boolean;
1328
- updateValue(evt: any): void;
1329
- render(): JSX.Element;
1330
- }
1331
- export {};
1332
-
1333
- }
1334
- declare module "@babylonjs/gui-editor/sharedComponents/propertyChangedEvent" {
1335
- export class PropertyChangedEvent {
1336
- object: any;
1337
- property: string;
1338
- value: any;
1339
- initialValue: any;
1340
- }
1341
-
1342
- }
1343
- declare module "@babylonjs/gui-editor/sharedComponents/sliderLineComponent" {
1344
- import * as React from "react";
1345
- import { Observable } from "@babylonjs/core/Misc/observable";
1346
- import { PropertyChangedEvent } from "@babylonjs/gui-editor/sharedComponents/propertyChangedEvent";
1347
- import { GlobalState } from "@babylonjs/gui-editor/globalState";
1348
- interface ISliderLineComponentProps {
1349
- label: string;
1350
- target?: any;
1351
- propertyName?: string;
1352
- minimum: number;
1353
- maximum: number;
1354
- step: number;
1355
- directValue?: number;
1356
- useEuler?: boolean;
1357
- onChange?: (value: number) => void;
1358
- onInput?: (value: number) => void;
1359
- onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
1360
- decimalCount?: number;
1361
- globalState: GlobalState;
1362
- }
1363
- export class SliderLineComponent extends React.Component<ISliderLineComponentProps, {
1364
- value: number;
1365
- }> {
1366
- private _localChange;
1367
- constructor(props: ISliderLineComponentProps);
1368
- shouldComponentUpdate(nextProps: ISliderLineComponentProps, nextState: {
1369
- value: number;
1370
- }): boolean;
1371
- onChange(newValueString: any): void;
1372
- onInput(newValueString: any): void;
1373
- prepareDataToRead(value: number): number;
1374
- render(): JSX.Element;
1375
- }
1376
- export {};
1377
-
1378
- }
1379
- declare module "@babylonjs/gui-editor/sharedComponents/textInputLineComponent" {
1380
- import * as React from "react";
1381
- import { Observable } from "@babylonjs/core/Misc/observable";
1382
- import { PropertyChangedEvent } from "@babylonjs/gui-editor/sharedComponents/propertyChangedEvent";
1383
- import { GlobalState } from "@babylonjs/gui-editor/globalState";
1384
- interface ITextInputLineComponentProps {
1385
- label: string;
1386
- globalState: GlobalState;
1387
- target?: any;
1388
- propertyName?: string;
1389
- value?: string;
1390
- multilines?: boolean;
1391
- onChange?: (value: string) => void;
1392
- validator?: (value: string) => boolean;
1393
- onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
1394
- }
1395
- export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
1396
- value: string;
1397
- }> {
1398
- private _localChange;
1399
- constructor(props: ITextInputLineComponentProps);
1400
- shouldComponentUpdate(nextProps: ITextInputLineComponentProps, nextState: {
1401
- value: string;
1402
- }): boolean;
1403
- raiseOnPropertyChanged(newValue: string, previousValue: string): void;
1404
- updateValue(value: string, raisePropertyChanged: boolean): void;
1405
- render(): JSX.Element;
1406
- }
1407
- export {};
1408
-
1409
1300
  }
1410
1301
  declare module "@babylonjs/gui-editor/tools" {
1411
1302
  import { Control } from "@babylonjs/gui/2D/controls/control";
@@ -1586,6 +1477,7 @@ export interface ICheckBoxLineComponentProps {
1586
1477
  enabled: IconDefinition;
1587
1478
  disabled: IconDefinition;
1588
1479
  };
1480
+ large?: boolean;
1589
1481
  }
1590
1482
  export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponentProps, {
1591
1483
  isSelected: boolean;
@@ -1797,12 +1689,12 @@ interface IFloatLineComponentProps {
1797
1689
  icon?: string;
1798
1690
  iconLabel?: string;
1799
1691
  defaultValue?: number;
1800
- unit?: string;
1801
- onUnitClicked?: () => void;
1802
- unitLocked?: boolean;
1692
+ arrows?: boolean;
1693
+ unit?: React.ReactNode;
1803
1694
  }
1804
1695
  export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
1805
1696
  value: string;
1697
+ dragging: boolean;
1806
1698
  }> {
1807
1699
  private _localChange;
1808
1700
  private _store;
@@ -1811,11 +1703,14 @@ export class FloatLineComponent extends React.Component<IFloatLineComponentProps
1811
1703
  getValueString(value: any): string;
1812
1704
  shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: {
1813
1705
  value: string;
1706
+ dragging: boolean;
1814
1707
  }): boolean;
1815
1708
  raiseOnPropertyChanged(newValue: number, previousValue: number): void;
1816
1709
  updateValue(valueString: string): void;
1817
1710
  lock(): void;
1818
1711
  unlock(): void;
1712
+ incrementValue(amount: number): void;
1713
+ onKeyDown(event: React.KeyboardEvent): void;
1819
1714
  render(): JSX.Element;
1820
1715
  }
1821
1716
  export {};
@@ -1919,6 +1814,7 @@ export class InputArrowsComponent extends React.Component<IInputArrowsComponentP
1919
1814
  private _arrowsRef;
1920
1815
  private _drag;
1921
1816
  private _releaseListener;
1817
+ private _lockChangeListener;
1922
1818
  render(): JSX.Element;
1923
1819
  }
1924
1820
  export {};
@@ -2104,6 +2000,7 @@ interface ISliderLineComponentProps {
2104
2000
  icon?: string;
2105
2001
  iconLabel?: string;
2106
2002
  lockObject?: LockObject;
2003
+ unit?: React.ReactNode;
2107
2004
  }
2108
2005
  export class SliderLineComponent extends React.Component<ISliderLineComponentProps, {
2109
2006
  value: number;
@@ -2140,7 +2037,7 @@ import * as React from "react";
2140
2037
  import { Observable } from "@babylonjs/core/Misc/observable";
2141
2038
  import { PropertyChangedEvent } from "shared-ui-components/propertyChangedEvent";
2142
2039
  import { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObject";
2143
- interface ITextInputLineComponentProps {
2040
+ export interface ITextInputLineComponentProps {
2144
2041
  label?: string;
2145
2042
  lockObject?: LockObject;
2146
2043
  target?: any;
@@ -2153,9 +2050,6 @@ interface ITextInputLineComponentProps {
2153
2050
  noUnderline?: boolean;
2154
2051
  numbersOnly?: boolean;
2155
2052
  delayInput?: boolean;
2156
- unit?: string;
2157
- onUnitClicked?: (unit: string) => void;
2158
- unitLocked?: boolean;
2159
2053
  arrows?: boolean;
2160
2054
  arrowsIncrement?: (amount: number) => void;
2161
2055
  step?: number;
@@ -2164,6 +2058,7 @@ interface ITextInputLineComponentProps {
2164
2058
  min?: number;
2165
2059
  max?: number;
2166
2060
  placeholder?: string;
2061
+ unit?: React.ReactNode;
2167
2062
  }
2168
2063
  export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
2169
2064
  value: string;
@@ -2177,12 +2072,12 @@ export class TextInputLineComponent extends React.Component<ITextInputLineCompon
2177
2072
  dragging: boolean;
2178
2073
  }): boolean;
2179
2074
  raiseOnPropertyChanged(newValue: string, previousValue: string): void;
2075
+ getCurrentNumericValue(value: string): number;
2180
2076
  updateValue(value: string): void;
2181
2077
  incrementValue(amount: number): void;
2182
2078
  onKeyDown(event: React.KeyboardEvent): void;
2183
2079
  render(): JSX.Element;
2184
2080
  }
2185
- export {};
2186
2081
 
2187
2082
  }
2188
2083
  declare module "shared-ui-components/lines/textLineComponent" {
@@ -2208,6 +2103,17 @@ export class TextLineComponent extends React.Component<ITextLineComponentProps>
2208
2103
  }
2209
2104
  export {};
2210
2105
 
2106
+ }
2107
+ declare module "shared-ui-components/lines/unitButton" {
2108
+ /// <reference types="react" />
2109
+ interface IUnitButtonProps {
2110
+ unit: string;
2111
+ locked?: boolean;
2112
+ onClick?: (unit: string) => void;
2113
+ }
2114
+ export function UnitButton(props: IUnitButtonProps): JSX.Element;
2115
+ export {};
2116
+
2211
2117
  }
2212
2118
  declare module "shared-ui-components/lines/valueLineComponent" {
2213
2119
  import * as React from "react";
package/license.md ADDED
@@ -0,0 +1,71 @@
1
+ # Apache License 2.0 (Apache)
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ <http://www.apache.org/licenses/>
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ ## Definitions
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
+
17
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
+
19
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
+
21
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
+
23
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
+
25
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
+
27
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
+
29
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
+
31
+ ## Grant of Copyright License
32
+
33
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
34
+
35
+ ## Grant of Patent License
36
+
37
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
38
+
39
+ ## Redistribution
40
+
41
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
42
+
43
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
44
+
45
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
46
+
47
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
48
+
49
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
50
+
51
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
52
+
53
+ ## Submission of Contributions
54
+
55
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
56
+
57
+ ## Trademarks
58
+
59
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
60
+
61
+ ## Disclaimer of Warranty
62
+
63
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
64
+
65
+ ## Limitation of Liability
66
+
67
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
68
+
69
+ ## Accepting Warranty or Additional Liability
70
+
71
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.