@babylonjs/gui-editor 5.0.0-beta.7 → 5.0.0-beta.8
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.
- package/babylon.guiEditor.max.js +312 -146
- package/babylon.guiEditor.max.js.map +1 -1
- package/babylon.guiEditor.module.d.ts +92 -67
- package/package.json +2 -2
@@ -31,6 +31,73 @@ declare module "@babylonjs/gui-editor/tools" {
|
|
31
31
|
static reorderGrid(grid: Grid, index: number, control: Control, cell: Vector2): void;
|
32
32
|
}
|
33
33
|
}
|
34
|
+
declare module "@babylonjs/gui-editor/sharedUiComponents/propertyChangedEvent" {
|
35
|
+
export class PropertyChangedEvent {
|
36
|
+
object: any;
|
37
|
+
property: string;
|
38
|
+
value: any;
|
39
|
+
initialValue: any;
|
40
|
+
allowNullValue?: boolean;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
declare module "@babylonjs/gui-editor/diagram/coordinateHelper" {
|
44
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
45
|
+
import { Matrix2D } from "@babylonjs/gui/2D/math2D";
|
46
|
+
import { Vector2 } from "@babylonjs/core/Maths/math.vector";
|
47
|
+
import { Observable } from "@babylonjs/core/Misc/observable";
|
48
|
+
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
49
|
+
import { PropertyChangedEvent } from "@babylonjs/gui-editor/sharedUiComponents/propertyChangedEvent";
|
50
|
+
export type DimensionProperties = "width" | "left" | "height" | "top" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom";
|
51
|
+
export class Rect {
|
52
|
+
top: number;
|
53
|
+
left: number;
|
54
|
+
right: number;
|
55
|
+
bottom: number;
|
56
|
+
constructor(left: number, top: number, right: number, bottom: number);
|
57
|
+
get center(): Vector2;
|
58
|
+
get width(): number;
|
59
|
+
get height(): number;
|
60
|
+
}
|
61
|
+
export class CoordinateHelper {
|
62
|
+
private static _matrixCache;
|
63
|
+
static globalState: GlobalState;
|
64
|
+
/**
|
65
|
+
* Get the scaling of a specific GUI control
|
66
|
+
* @param node the node for which we are getting the scaling
|
67
|
+
* @param relative should we return only the relative scaling (relative to the parent)
|
68
|
+
* @returns an X,Y vector of the scaling
|
69
|
+
*/
|
70
|
+
static getScale(node: Control, relative?: boolean): Vector2;
|
71
|
+
static getRotation(node: Control, relative?: boolean): number;
|
72
|
+
/**
|
73
|
+
* This function calculates a local matrix for a node, including it's full transformation and pivot point
|
74
|
+
*
|
75
|
+
* @param node the node to calculate the matrix for
|
76
|
+
* @param useStoredValues should the stored (cached) values be used to calculate the matrix
|
77
|
+
* @returns a new matrix for the control
|
78
|
+
*/
|
79
|
+
static getNodeMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
80
|
+
/**
|
81
|
+
* Using the node's tree, calculate its world matrix and return it
|
82
|
+
* @param node the node to calculate the matrix for
|
83
|
+
* @param useStoredValuesIfPossible used stored valued (cached when pointer down is clicked)
|
84
|
+
* @returns the world matrix for this node
|
85
|
+
*/
|
86
|
+
static nodeToRTTWorldMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
87
|
+
static nodeToRTTSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
88
|
+
static rttToLocalNodeSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
89
|
+
static rttToCanvasSpace(x: number, y: number): Vector2;
|
90
|
+
static mousePointerToRTTSpace(node: Control, x?: number, y?: number): Vector2;
|
91
|
+
private static resetMatrixArray;
|
92
|
+
static computeLocalBounds(node: Control): Rect;
|
93
|
+
/**
|
94
|
+
* converts a node's dimensions to percentage, properties can be specified as a list, or can convert all
|
95
|
+
*/
|
96
|
+
static convertToPercentage(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
|
97
|
+
static round(value: number): number;
|
98
|
+
static convertToPixels(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
|
99
|
+
}
|
100
|
+
}
|
34
101
|
declare module "@babylonjs/gui-editor/diagram/workbench" {
|
35
102
|
import * as React from "react";
|
36
103
|
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
@@ -80,8 +147,9 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
80
147
|
_liveGuiTextureRerender: boolean;
|
81
148
|
private _anyControlClicked;
|
82
149
|
private _visibleRegionContainer;
|
83
|
-
private _panAndZoomContainer;
|
84
150
|
get visibleRegionContainer(): Container;
|
151
|
+
private _panAndZoomContainer;
|
152
|
+
get panAndZoomContainer(): Container;
|
85
153
|
private _trueRootContainer;
|
86
154
|
set trueRootContainer(value: Container);
|
87
155
|
get trueRootContainer(): Container;
|
@@ -129,7 +197,6 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
129
197
|
isSelected(value: boolean, guiNode: Control): void;
|
130
198
|
clicked: boolean;
|
131
199
|
_onMove(guiControl: Control, evt: Vector2, startPos: Vector2, ignorClick?: boolean): boolean;
|
132
|
-
convertToPercentage(guiControl: Control, includeScale: boolean): void;
|
133
200
|
onMove(evt: React.PointerEvent): void;
|
134
201
|
private _screenToTexturePosition;
|
135
202
|
private getScaledPointerPosition;
|
@@ -146,15 +213,6 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
146
213
|
render(): JSX.Element;
|
147
214
|
}
|
148
215
|
}
|
149
|
-
declare module "@babylonjs/gui-editor/sharedUiComponents/propertyChangedEvent" {
|
150
|
-
export class PropertyChangedEvent {
|
151
|
-
object: any;
|
152
|
-
property: string;
|
153
|
-
value: any;
|
154
|
-
initialValue: any;
|
155
|
-
allowNullValue?: boolean;
|
156
|
-
}
|
157
|
-
}
|
158
216
|
declare module "@babylonjs/gui-editor/sharedUiComponents/tabs/propertyGrids/lockObject" {
|
159
217
|
/**
|
160
218
|
* Class used to provide lock mechanism
|
@@ -166,55 +224,6 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/tabs/propertyGrids/lock
|
|
166
224
|
lock: boolean;
|
167
225
|
}
|
168
226
|
}
|
169
|
-
declare module "@babylonjs/gui-editor/diagram/coordinateHelper" {
|
170
|
-
import { Control } from "@babylonjs/gui/2D/controls/control";
|
171
|
-
import { Matrix2D } from "@babylonjs/gui/2D/math2D";
|
172
|
-
import { Vector2 } from "@babylonjs/core/Maths/math.vector";
|
173
|
-
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
174
|
-
export class Rect {
|
175
|
-
top: number;
|
176
|
-
left: number;
|
177
|
-
right: number;
|
178
|
-
bottom: number;
|
179
|
-
constructor(left: number, top: number, right: number, bottom: number);
|
180
|
-
get center(): Vector2;
|
181
|
-
get width(): number;
|
182
|
-
get height(): number;
|
183
|
-
}
|
184
|
-
export class CoordinateHelper {
|
185
|
-
private static _matrixCache;
|
186
|
-
static globalState: GlobalState;
|
187
|
-
/**
|
188
|
-
* Get the scaling of a specific GUI control
|
189
|
-
* @param node the node for which we are getting the scaling
|
190
|
-
* @param relative should we return only the relative scaling (relative to the parent)
|
191
|
-
* @returns an X,Y vector of the scaling
|
192
|
-
*/
|
193
|
-
static getScale(node: Control, relative?: boolean): Vector2;
|
194
|
-
static getRotation(node: Control, relative?: boolean): number;
|
195
|
-
/**
|
196
|
-
* This function calculates a local matrix for a node, including it's full transformation and pivot point
|
197
|
-
*
|
198
|
-
* @param node the node to calculate the matrix for
|
199
|
-
* @param useStoredValues should the stored (cached) values be used to calculate the matrix
|
200
|
-
* @returns a new matrix for the control
|
201
|
-
*/
|
202
|
-
static getNodeMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
203
|
-
/**
|
204
|
-
* Using the node's tree, calculate its world matrix and return it
|
205
|
-
* @param node the node to calculate the matrix for
|
206
|
-
* @param useStoredValuesIfPossible used stored valued (cached when pointer down is clicked)
|
207
|
-
* @returns the world matrix for this node
|
208
|
-
*/
|
209
|
-
static nodeToRTTWorldMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
210
|
-
static nodeToRTTSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
211
|
-
static rttToLocalNodeSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
212
|
-
static rttToCanvasSpace(x: number, y: number): Vector2;
|
213
|
-
static mousePointerToRTTSpace(node: Control, x?: number, y?: number): Vector2;
|
214
|
-
private static resetMatrixArray;
|
215
|
-
static computeLocalBounds(node: Control): Rect;
|
216
|
-
}
|
217
|
-
}
|
218
227
|
declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
|
219
228
|
import { Vector2 } from "@babylonjs/core/Maths/math.vector";
|
220
229
|
import * as React from "react";
|
@@ -392,7 +401,7 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/targetsProxy" {
|
|
392
401
|
* @param setter an optional setter function to override the default setter behavior
|
393
402
|
* @returns a proxy object that can be passed as a target into the input
|
394
403
|
*/
|
395
|
-
export function makeTargetsProxy(targets:
|
404
|
+
export function makeTargetsProxy<Type>(targets: Type[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>, getProperty?: (target: Type, property: keyof Type) => any): any;
|
396
405
|
}
|
397
406
|
declare module "@babylonjs/gui-editor/sharedUiComponents/lines/checkBoxLineComponent" {
|
398
407
|
import * as React from "react";
|
@@ -487,6 +496,9 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/floatLineComponen
|
|
487
496
|
icon?: string;
|
488
497
|
iconLabel?: string;
|
489
498
|
defaultValue?: number;
|
499
|
+
unit?: string;
|
500
|
+
onUnitClicked?: () => void;
|
501
|
+
unitLocked?: boolean;
|
490
502
|
}
|
491
503
|
export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
|
492
504
|
value: string;
|
@@ -561,6 +573,9 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/textInputLineComp
|
|
561
573
|
noUnderline?: boolean;
|
562
574
|
numbersOnly?: boolean;
|
563
575
|
delayInput?: boolean;
|
576
|
+
unit?: string;
|
577
|
+
onUnitClicked?: (unit: string) => void;
|
578
|
+
unitLocked?: boolean;
|
564
579
|
}
|
565
580
|
export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
|
566
581
|
value: string;
|
@@ -785,8 +800,6 @@ declare module "@babylonjs/gui-editor/components/propertyTab/propertyGrids/gui/c
|
|
785
800
|
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
786
801
|
}
|
787
802
|
export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps> {
|
788
|
-
private _width;
|
789
|
-
private _height;
|
790
803
|
constructor(props: ICommonControlPropertyGridComponentProps);
|
791
804
|
private _updateAlignment;
|
792
805
|
private _checkAndUpdateValues;
|
@@ -975,6 +988,9 @@ declare module "@babylonjs/gui-editor/components/propertyTab/propertyGrids/gui/i
|
|
975
988
|
}
|
976
989
|
export class ImagePropertyGridComponent extends React.Component<IImagePropertyGridComponentProps> {
|
977
990
|
constructor(props: IImagePropertyGridComponentProps);
|
991
|
+
toggleAnimations(on: boolean): void;
|
992
|
+
getMaxCells(): number;
|
993
|
+
updateCellSize(): void;
|
978
994
|
render(): JSX.Element;
|
979
995
|
}
|
980
996
|
}
|
@@ -1197,7 +1213,7 @@ declare module "@babylonjs/gui-editor/guiNodeTools" {
|
|
1197
1213
|
import { ImageBasedSlider } from "@babylonjs/gui/2D/controls/sliders/imageBasedSlider";
|
1198
1214
|
export class GUINodeTools {
|
1199
1215
|
static ImageControlDefaultUrl: string;
|
1200
|
-
static CreateControlFromString(data: string): Grid |
|
1216
|
+
static CreateControlFromString(data: string): Grid | Rectangle | Line | Image | TextBlock | Slider | ImageBasedSlider | RadioButton | InputText | ColorPicker | StackPanel | Ellipse | Checkbox | DisplayGrid;
|
1201
1217
|
}
|
1202
1218
|
}
|
1203
1219
|
declare module "@babylonjs/gui-editor/components/propertyTab/propertyTabComponent" {
|
@@ -1263,13 +1279,20 @@ declare module "@babylonjs/gui-editor/sharedComponents/messageDialog" {
|
|
1263
1279
|
declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemLabelComponent" {
|
1264
1280
|
import * as React from "react";
|
1265
1281
|
interface ITreeItemLabelComponentProps {
|
1266
|
-
label
|
1282
|
+
label?: string;
|
1267
1283
|
onClick?: () => void;
|
1268
|
-
|
1284
|
+
onChange: (newValue: string) => void;
|
1285
|
+
bracket: string;
|
1286
|
+
renaming: boolean;
|
1287
|
+
setRenaming: (renaming: boolean) => void;
|
1269
1288
|
}
|
1270
|
-
|
1289
|
+
interface ITreeItemLabelState {
|
1290
|
+
value: string;
|
1291
|
+
}
|
1292
|
+
export class TreeItemLabelComponent extends React.Component<ITreeItemLabelComponentProps, ITreeItemLabelState> {
|
1271
1293
|
constructor(props: ITreeItemLabelComponentProps);
|
1272
1294
|
onClick(): void;
|
1295
|
+
onBlur(): void;
|
1273
1296
|
render(): JSX.Element;
|
1274
1297
|
}
|
1275
1298
|
}
|
@@ -1309,10 +1332,12 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/entities/gui/cont
|
|
1309
1332
|
export class ControlTreeItemComponent extends React.Component<IControlTreeItemComponentProps, {
|
1310
1333
|
isActive: boolean;
|
1311
1334
|
isVisible: boolean;
|
1335
|
+
isRenaming: boolean;
|
1312
1336
|
}> {
|
1313
1337
|
constructor(props: IControlTreeItemComponentProps);
|
1314
1338
|
highlight(): void;
|
1315
1339
|
switchVisibility(): void;
|
1340
|
+
onRename(name: string): void;
|
1316
1341
|
render(): JSX.Element;
|
1317
1342
|
}
|
1318
1343
|
}
|
package/package.json
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
},
|
5
5
|
"name": "@babylonjs/gui-editor",
|
6
6
|
"description": "The Babylon.js GUI editor.",
|
7
|
-
"version": "5.0.0-beta.
|
7
|
+
"version": "5.0.0-beta.8",
|
8
8
|
"repository": {
|
9
9
|
"type": "git",
|
10
10
|
"url": "https://github.com/BabylonJS/Babylon.js.git"
|
11
11
|
},
|
12
12
|
"license": "Apache-2.0",
|
13
13
|
"dependencies": {
|
14
|
-
"@babylonjs/core": "5.0.0-beta.
|
14
|
+
"@babylonjs/core": "5.0.0-beta.8",
|
15
15
|
"tslib": "^2.3.1"
|
16
16
|
},
|
17
17
|
"files": [
|