@babylonjs/gui-editor 5.0.0-beta.7 → 5.0.0-rc.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.
- package/babylon.guiEditor.max.js +1167 -723
- package/babylon.guiEditor.max.js.map +1 -1
- package/babylon.guiEditor.module.d.ts +231 -154
- package/package.json +2 -2
@@ -24,17 +24,84 @@ declare module "@babylonjs/gui-editor/tools" {
|
|
24
24
|
import { Grid } from "@babylonjs/gui/2D/controls/grid";
|
25
25
|
import { Vector2 } from "@babylonjs/core/Maths/math";
|
26
26
|
export class Tools {
|
27
|
-
static
|
27
|
+
static LookForItems(item: any, selectedEntities: any[], firstIteration?: boolean): boolean;
|
28
28
|
private static _RecursiveRemoveHiddenMeshesAndHoistChildren;
|
29
29
|
static SortAndFilter(parent: any, items: any[]): any[];
|
30
30
|
static getCellInfo(grid: Grid, control: Control): Vector2;
|
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
|
+
clone(): Rect;
|
58
|
+
get center(): Vector2;
|
59
|
+
get width(): number;
|
60
|
+
get height(): number;
|
61
|
+
}
|
62
|
+
export class CoordinateHelper {
|
63
|
+
private static _matrixCache;
|
64
|
+
static globalState: GlobalState;
|
65
|
+
/**
|
66
|
+
* Get the scaling of a specific GUI control
|
67
|
+
* @param node the node for which we are getting the scaling
|
68
|
+
* @param relative should we return only the relative scaling (relative to the parent)
|
69
|
+
* @returns an X,Y vector of the scaling
|
70
|
+
*/
|
71
|
+
static getScale(node: Control, relative?: boolean): Vector2;
|
72
|
+
static getRotation(node: Control, relative?: boolean): number;
|
73
|
+
/**
|
74
|
+
* This function calculates a local matrix for a node, including it's full transformation and pivot point
|
75
|
+
*
|
76
|
+
* @param node the node to calculate the matrix for
|
77
|
+
* @param useStoredValues should the stored (cached) values be used to calculate the matrix
|
78
|
+
* @returns a new matrix for the control
|
79
|
+
*/
|
80
|
+
static getNodeMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
81
|
+
/**
|
82
|
+
* Using the node's tree, calculate its world matrix and return it
|
83
|
+
* @param node the node to calculate the matrix for
|
84
|
+
* @param useStoredValuesIfPossible used stored valued (cached when pointer down is clicked)
|
85
|
+
* @returns the world matrix for this node
|
86
|
+
*/
|
87
|
+
static nodeToRTTWorldMatrix(node: Control, storedValues?: Rect): Matrix2D;
|
88
|
+
static nodeToRTTSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
89
|
+
static rttToLocalNodeSpace(node: Control, x: number, y: number, reference?: Vector2, storedValues?: Rect): Vector2;
|
90
|
+
static rttToCanvasSpace(x: number, y: number): Vector2;
|
91
|
+
static mousePointerToRTTSpace(node: Control, x?: number, y?: number): Vector2;
|
92
|
+
private static resetMatrixArray;
|
93
|
+
static computeLocalBounds(node: Control): Rect;
|
94
|
+
/**
|
95
|
+
* converts a node's dimensions to percentage, properties can be specified as a list, or can convert all
|
96
|
+
*/
|
97
|
+
static convertToPercentage(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
|
98
|
+
static round(value: number): number;
|
99
|
+
static convertToPixels(guiControl: Control, properties?: DimensionProperties[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>): void;
|
100
|
+
}
|
101
|
+
}
|
34
102
|
declare module "@babylonjs/gui-editor/diagram/workbench" {
|
35
103
|
import * as React from "react";
|
36
104
|
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
37
|
-
import { Nullable } from "@babylonjs/core/types";
|
38
105
|
import { Control } from "@babylonjs/gui/2D/controls/control";
|
39
106
|
import { Vector2, Vector3 } from "@babylonjs/core/Maths/math.vector";
|
40
107
|
import { Scene } from "@babylonjs/core/scene";
|
@@ -55,33 +122,28 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
55
122
|
private _mouseStartPointX;
|
56
123
|
private _mouseStartPointY;
|
57
124
|
_scene: Scene;
|
58
|
-
private _selectedGuiNodes;
|
59
125
|
private _ctrlKeyIsPressed;
|
60
126
|
private _altKeyIsPressed;
|
61
127
|
private _constraintDirection;
|
62
128
|
private _forcePanning;
|
63
129
|
private _forceZooming;
|
64
130
|
private _forceSelecting;
|
65
|
-
private _outlines;
|
66
131
|
private _panning;
|
67
132
|
private _canvas;
|
68
133
|
private _responsive;
|
69
134
|
private _isOverGUINode;
|
70
|
-
private _clipboard;
|
71
|
-
private _selectAll;
|
72
|
-
private _pasted;
|
73
135
|
private _engine;
|
74
136
|
private _liveRenderObserver;
|
75
137
|
private _guiRenderObserver;
|
76
138
|
private _mainSelection;
|
77
139
|
private _selectionDepth;
|
78
140
|
private _doubleClick;
|
79
|
-
private _lockMainSelection;
|
80
141
|
_liveGuiTextureRerender: boolean;
|
81
142
|
private _anyControlClicked;
|
82
143
|
private _visibleRegionContainer;
|
83
|
-
private _panAndZoomContainer;
|
84
144
|
get visibleRegionContainer(): Container;
|
145
|
+
private _panAndZoomContainer;
|
146
|
+
get panAndZoomContainer(): Container;
|
85
147
|
private _trueRootContainer;
|
86
148
|
set trueRootContainer(value: Container);
|
87
149
|
get trueRootContainer(): Container;
|
@@ -103,12 +165,12 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
103
165
|
private _getParentWithDepth;
|
104
166
|
private _getMaxParent;
|
105
167
|
constructor(props: IWorkbenchComponentProps);
|
106
|
-
determineMouseSelection(selection:
|
168
|
+
determineMouseSelection(selection: Control): void;
|
107
169
|
keyEvent: (evt: KeyboardEvent) => void;
|
108
|
-
private
|
109
|
-
|
110
|
-
|
111
|
-
pasteFromClipboard():
|
170
|
+
private _deleteSelectedNodes;
|
171
|
+
copyToClipboard(copyFn: (content: string) => void): void;
|
172
|
+
cutToClipboard(copyFn: (content: string) => void): void;
|
173
|
+
pasteFromClipboard(clipboardContents: string): boolean;
|
112
174
|
CopyGUIControl(original: Control): void;
|
113
175
|
private selectAllGUI;
|
114
176
|
blurEvent: () => void;
|
@@ -116,7 +178,7 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
116
178
|
loadFromJson(serializationObject: any): void;
|
117
179
|
loadFromSnippet(snippetId: string): Promise<void>;
|
118
180
|
loadToEditor(): void;
|
119
|
-
|
181
|
+
updateNodeOutlines(): void;
|
120
182
|
findNodeFromGuiElement(guiControl: Control): Control;
|
121
183
|
appendBlock(guiElement: Control): Control;
|
122
184
|
private _isMainSelectionParent;
|
@@ -129,7 +191,6 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
129
191
|
isSelected(value: boolean, guiNode: Control): void;
|
130
192
|
clicked: boolean;
|
131
193
|
_onMove(guiControl: Control, evt: Vector2, startPos: Vector2, ignorClick?: boolean): boolean;
|
132
|
-
convertToPercentage(guiControl: Control, includeScale: boolean): void;
|
133
194
|
onMove(evt: React.PointerEvent): void;
|
134
195
|
private _screenToTexturePosition;
|
135
196
|
private getScaledPointerPosition;
|
@@ -140,21 +201,13 @@ declare module "@babylonjs/gui-editor/diagram/workbench" {
|
|
140
201
|
synchronizeLiveGUI(): void;
|
141
202
|
addControls(scene: Scene): void;
|
142
203
|
panning(): void;
|
204
|
+
moveControls(moveHorizontal: boolean, amount: number): void;
|
143
205
|
zoomWheel(event: IWheelEvent): number;
|
144
206
|
zooming(delta: number): void;
|
145
207
|
zeroIfClose(vec: Vector3): void;
|
146
208
|
render(): JSX.Element;
|
147
209
|
}
|
148
210
|
}
|
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
211
|
declare module "@babylonjs/gui-editor/sharedUiComponents/tabs/propertyGrids/lockObject" {
|
159
212
|
/**
|
160
213
|
* Class used to provide lock mechanism
|
@@ -166,107 +219,6 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/tabs/propertyGrids/lock
|
|
166
219
|
lock: boolean;
|
167
220
|
}
|
168
221
|
}
|
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
|
-
declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
|
219
|
-
import { Vector2 } from "@babylonjs/core/Maths/math.vector";
|
220
|
-
import * as React from "react";
|
221
|
-
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
222
|
-
import { Rect } from "@babylonjs/gui-editor/diagram/coordinateHelper";
|
223
|
-
export interface IGuiGizmoProps {
|
224
|
-
globalState: GlobalState;
|
225
|
-
}
|
226
|
-
enum ScalePointPosition {
|
227
|
-
Top = -1,
|
228
|
-
Left = -1,
|
229
|
-
Center = 0,
|
230
|
-
Right = 1,
|
231
|
-
Bottom = 1
|
232
|
-
}
|
233
|
-
interface IScalePoint {
|
234
|
-
position: Vector2;
|
235
|
-
horizontalPosition: ScalePointPosition;
|
236
|
-
verticalPosition: ScalePointPosition;
|
237
|
-
rotation: number;
|
238
|
-
isPivot: boolean;
|
239
|
-
}
|
240
|
-
interface IGuiGizmoState {
|
241
|
-
canvasBounds: Rect;
|
242
|
-
scalePoints: IScalePoint[];
|
243
|
-
scalePointDragging: number;
|
244
|
-
isRotating: boolean;
|
245
|
-
}
|
246
|
-
export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmoState> {
|
247
|
-
private _responsive;
|
248
|
-
private _storedValues;
|
249
|
-
private _localBounds;
|
250
|
-
private _rotation;
|
251
|
-
constructor(props: IGuiGizmoProps);
|
252
|
-
componentDidMount(): void;
|
253
|
-
/**
|
254
|
-
* Update the gizmo's positions
|
255
|
-
* @param force should the update be forced. otherwise it will be updated only when the pointer is down
|
256
|
-
*/
|
257
|
-
updateGizmo(force?: boolean): void;
|
258
|
-
onUp(evt?: React.PointerEvent): void;
|
259
|
-
private _onUp;
|
260
|
-
onMove(evt: React.PointerEvent): void;
|
261
|
-
private _onMove;
|
262
|
-
private _rotate;
|
263
|
-
private _dragLocalBounds;
|
264
|
-
private _updateNodeFromLocalBounds;
|
265
|
-
private _beginDraggingScalePoint;
|
266
|
-
private _beginRotate;
|
267
|
-
render(): JSX.Element | null;
|
268
|
-
}
|
269
|
-
}
|
270
222
|
declare module "@babylonjs/gui-editor/globalState" {
|
271
223
|
import { Nullable } from "@babylonjs/core/types";
|
272
224
|
import { Observable } from "@babylonjs/core/Misc/observable";
|
@@ -278,7 +230,6 @@ declare module "@babylonjs/gui-editor/globalState" {
|
|
278
230
|
import { Scene } from "@babylonjs/core/scene";
|
279
231
|
import { Control } from "@babylonjs/gui/2D/controls/control";
|
280
232
|
import { LockObject } from "@babylonjs/gui-editor/sharedUiComponents/tabs/propertyGrids/lockObject";
|
281
|
-
import { GuiGizmoComponent } from "@babylonjs/gui-editor/diagram/guiGizmo";
|
282
233
|
import { ISize } from "@babylonjs/core/Maths/math";
|
283
234
|
export enum DragOverLocation {
|
284
235
|
ABOVE = 0,
|
@@ -287,13 +238,13 @@ declare module "@babylonjs/gui-editor/globalState" {
|
|
287
238
|
NONE = 3
|
288
239
|
}
|
289
240
|
export class GlobalState {
|
290
|
-
[x: string]: any;
|
291
241
|
liveGuiTexture: Nullable<AdvancedDynamicTexture>;
|
292
242
|
guiTexture: AdvancedDynamicTexture;
|
293
243
|
hostElement: HTMLElement;
|
294
244
|
hostDocument: HTMLDocument;
|
295
245
|
hostWindow: Window;
|
296
|
-
|
246
|
+
selectedControls: Control[];
|
247
|
+
onSelectionChangedObservable: Observable<void>;
|
297
248
|
onResizeObservable: Observable<ISize>;
|
298
249
|
onBuiltObservable: Observable<void>;
|
299
250
|
onResetRequiredObservable: Observable<void>;
|
@@ -305,25 +256,26 @@ declare module "@babylonjs/gui-editor/globalState" {
|
|
305
256
|
onNewSceneObservable: Observable<Nullable<Scene>>;
|
306
257
|
onGuiNodeRemovalObservable: Observable<Control>;
|
307
258
|
onPopupClosedObservable: Observable<void>;
|
308
|
-
_backgroundColor
|
259
|
+
private _backgroundColor;
|
260
|
+
private _outlines;
|
261
|
+
isMultiSelecting: boolean;
|
262
|
+
onOutlineChangedObservable: Observable<void>;
|
309
263
|
blockKeyboardEvents: boolean;
|
310
264
|
controlCamera: boolean;
|
311
265
|
selectionLock: boolean;
|
312
266
|
workbench: WorkbenchComponent;
|
313
|
-
guiGizmo: GuiGizmoComponent;
|
314
267
|
onPropertyChangedObservable: Observable<PropertyChangedEvent>;
|
315
268
|
onZoomObservable: Observable<void>;
|
316
269
|
onFitToWindowObservable: Observable<void>;
|
317
270
|
onPanObservable: Observable<void>;
|
318
271
|
onSelectionButtonObservable: Observable<void>;
|
319
|
-
onMoveObservable: Observable<void>;
|
320
272
|
onLoadObservable: Observable<File>;
|
321
273
|
onSaveObservable: Observable<void>;
|
322
274
|
onSnippetLoadObservable: Observable<void>;
|
323
275
|
onSnippetSaveObservable: Observable<void>;
|
324
|
-
onOutlinesObservable: Observable<void>;
|
325
276
|
onResponsiveChangeObservable: Observable<boolean>;
|
326
277
|
onParentingChangeObservable: Observable<Nullable<Control>>;
|
278
|
+
onDropObservable: Observable<void>;
|
327
279
|
onPropertyGridUpdateRequiredObservable: Observable<void>;
|
328
280
|
onDraggingEndObservable: Observable<void>;
|
329
281
|
onDraggingStartObservable: Observable<void>;
|
@@ -331,8 +283,13 @@ declare module "@babylonjs/gui-editor/globalState" {
|
|
331
283
|
onGizmoUpdateRequireObservable: Observable<void>;
|
332
284
|
onArtBoardUpdateRequiredObservable: Observable<void>;
|
333
285
|
onBackgroundColorChangeObservable: Observable<void>;
|
286
|
+
onPointerMoveObservable: Observable<import("react").PointerEvent<HTMLCanvasElement>>;
|
287
|
+
onPointerUpObservable: Observable<Nullable<PointerEvent | import("react").PointerEvent<HTMLCanvasElement>>>;
|
334
288
|
draggedControl: Nullable<Control>;
|
335
289
|
draggedControlDirection: DragOverLocation;
|
290
|
+
onCopyObservable: Observable<(content: string) => void>;
|
291
|
+
onCutObservable: Observable<(content: string) => void>;
|
292
|
+
onPasteObservable: Observable<string>;
|
336
293
|
isSaving: boolean;
|
337
294
|
lockObject: LockObject;
|
338
295
|
storeEditorData: (serializationObject: any) => void;
|
@@ -345,8 +302,16 @@ declare module "@babylonjs/gui-editor/globalState" {
|
|
345
302
|
action: (data: string) => Promise<string>;
|
346
303
|
};
|
347
304
|
constructor();
|
305
|
+
/** adds copy, cut and paste listeners to the host window */
|
306
|
+
registerEventListeners(): void;
|
307
|
+
private _updateKeys;
|
348
308
|
get backgroundColor(): Color3;
|
349
309
|
set backgroundColor(value: Color3);
|
310
|
+
get outlines(): boolean;
|
311
|
+
set outlines(value: boolean);
|
312
|
+
select(control: Control): void;
|
313
|
+
setSelection(controls: Control[]): void;
|
314
|
+
isMultiSelectable(control: Control): boolean;
|
350
315
|
}
|
351
316
|
}
|
352
317
|
declare module "@babylonjs/gui-editor/sharedUiComponents/lines/buttonLineComponent" {
|
@@ -392,7 +357,7 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/targetsProxy" {
|
|
392
357
|
* @param setter an optional setter function to override the default setter behavior
|
393
358
|
* @returns a proxy object that can be passed as a target into the input
|
394
359
|
*/
|
395
|
-
export function makeTargetsProxy(targets:
|
360
|
+
export function makeTargetsProxy<Type>(targets: Type[], onPropertyChangedObservable?: Observable<PropertyChangedEvent>, getProperty?: (target: Type, property: keyof Type) => any): any;
|
396
361
|
}
|
397
362
|
declare module "@babylonjs/gui-editor/sharedUiComponents/lines/checkBoxLineComponent" {
|
398
363
|
import * as React from "react";
|
@@ -487,6 +452,9 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/floatLineComponen
|
|
487
452
|
icon?: string;
|
488
453
|
iconLabel?: string;
|
489
454
|
defaultValue?: number;
|
455
|
+
unit?: string;
|
456
|
+
onUnitClicked?: () => void;
|
457
|
+
unitLocked?: boolean;
|
490
458
|
}
|
491
459
|
export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
|
492
460
|
value: string;
|
@@ -543,6 +511,19 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/sliderLineCompone
|
|
543
511
|
render(): JSX.Element;
|
544
512
|
}
|
545
513
|
}
|
514
|
+
declare module "@babylonjs/gui-editor/sharedUiComponents/lines/inputArrowsComponent" {
|
515
|
+
import * as React from "react";
|
516
|
+
interface IInputArrowsComponentProps {
|
517
|
+
incrementValue: (amount: number) => void;
|
518
|
+
setDragging: (dragging: boolean) => void;
|
519
|
+
}
|
520
|
+
export class InputArrowsComponent extends React.Component<IInputArrowsComponentProps> {
|
521
|
+
private _arrowsRef;
|
522
|
+
private _drag;
|
523
|
+
private _releaseListener;
|
524
|
+
render(): JSX.Element;
|
525
|
+
}
|
526
|
+
}
|
546
527
|
declare module "@babylonjs/gui-editor/sharedUiComponents/lines/textInputLineComponent" {
|
547
528
|
import * as React from "react";
|
548
529
|
import { Observable } from "@babylonjs/core/Misc/observable";
|
@@ -561,18 +542,28 @@ declare module "@babylonjs/gui-editor/sharedUiComponents/lines/textInputLineComp
|
|
561
542
|
noUnderline?: boolean;
|
562
543
|
numbersOnly?: boolean;
|
563
544
|
delayInput?: boolean;
|
545
|
+
unit?: string;
|
546
|
+
onUnitClicked?: (unit: string) => void;
|
547
|
+
unitLocked?: boolean;
|
548
|
+
arrows?: boolean;
|
549
|
+
arrowsIncrement?: (amount: number) => void;
|
550
|
+
step?: number;
|
564
551
|
}
|
565
552
|
export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
|
566
553
|
value: string;
|
554
|
+
dragging: boolean;
|
567
555
|
}> {
|
568
556
|
private _localChange;
|
569
557
|
constructor(props: ITextInputLineComponentProps);
|
570
558
|
componentWillUnmount(): void;
|
571
559
|
shouldComponentUpdate(nextProps: ITextInputLineComponentProps, nextState: {
|
572
560
|
value: string;
|
561
|
+
dragging: boolean;
|
573
562
|
}): boolean;
|
574
563
|
raiseOnPropertyChanged(newValue: string, previousValue: string): void;
|
575
564
|
updateValue(value: string): void;
|
565
|
+
incrementValue(amount: number): void;
|
566
|
+
onKeyDown(event: React.KeyboardEvent): void;
|
576
567
|
render(): JSX.Element;
|
577
568
|
}
|
578
569
|
}
|
@@ -785,12 +776,13 @@ declare module "@babylonjs/gui-editor/components/propertyTab/propertyGrids/gui/c
|
|
785
776
|
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
786
777
|
}
|
787
778
|
export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps> {
|
788
|
-
private
|
789
|
-
private _height;
|
779
|
+
private _onPropertyChangedObserver;
|
790
780
|
constructor(props: ICommonControlPropertyGridComponentProps);
|
781
|
+
private _getTransformedReferenceCoordinate;
|
791
782
|
private _updateAlignment;
|
792
783
|
private _checkAndUpdateValues;
|
793
784
|
private _markChildrenAsDirty;
|
785
|
+
componentWillUnmount(): void;
|
794
786
|
render(): JSX.Element;
|
795
787
|
}
|
796
788
|
}
|
@@ -975,6 +967,9 @@ declare module "@babylonjs/gui-editor/components/propertyTab/propertyGrids/gui/i
|
|
975
967
|
}
|
976
968
|
export class ImagePropertyGridComponent extends React.Component<IImagePropertyGridComponentProps> {
|
977
969
|
constructor(props: IImagePropertyGridComponentProps);
|
970
|
+
toggleAnimations(on: boolean): void;
|
971
|
+
getMaxCells(): number;
|
972
|
+
updateCellSize(): void;
|
978
973
|
render(): JSX.Element;
|
979
974
|
}
|
980
975
|
}
|
@@ -1197,22 +1192,18 @@ declare module "@babylonjs/gui-editor/guiNodeTools" {
|
|
1197
1192
|
import { ImageBasedSlider } from "@babylonjs/gui/2D/controls/sliders/imageBasedSlider";
|
1198
1193
|
export class GUINodeTools {
|
1199
1194
|
static ImageControlDefaultUrl: string;
|
1200
|
-
static CreateControlFromString(data: string): Grid |
|
1195
|
+
static CreateControlFromString(data: string): Grid | Rectangle | Line | TextBlock | Image | Slider | ImageBasedSlider | RadioButton | InputText | ColorPicker | StackPanel | Ellipse | Checkbox | DisplayGrid;
|
1201
1196
|
}
|
1202
1197
|
}
|
1203
1198
|
declare module "@babylonjs/gui-editor/components/propertyTab/propertyTabComponent" {
|
1204
1199
|
import * as React from "react";
|
1205
1200
|
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
1206
|
-
import { Nullable } from "@babylonjs/core/types";
|
1207
1201
|
import { Control } from "@babylonjs/gui/2D/controls/control";
|
1208
1202
|
import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture";
|
1209
1203
|
interface IPropertyTabComponentProps {
|
1210
1204
|
globalState: GlobalState;
|
1211
1205
|
}
|
1212
|
-
|
1213
|
-
currentNode: Nullable<Control>;
|
1214
|
-
}
|
1215
|
-
export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, IPropertyTabComponentState> {
|
1206
|
+
export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps> {
|
1216
1207
|
private _onBuiltObserver;
|
1217
1208
|
private _timerIntervalId;
|
1218
1209
|
private _lockObject;
|
@@ -1263,13 +1254,20 @@ declare module "@babylonjs/gui-editor/sharedComponents/messageDialog" {
|
|
1263
1254
|
declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemLabelComponent" {
|
1264
1255
|
import * as React from "react";
|
1265
1256
|
interface ITreeItemLabelComponentProps {
|
1266
|
-
label
|
1257
|
+
label?: string;
|
1267
1258
|
onClick?: () => void;
|
1268
|
-
|
1259
|
+
onChange: (newValue: string) => void;
|
1260
|
+
bracket: string;
|
1261
|
+
renaming: boolean;
|
1262
|
+
setRenaming: (renaming: boolean) => void;
|
1263
|
+
}
|
1264
|
+
interface ITreeItemLabelState {
|
1265
|
+
value: string;
|
1269
1266
|
}
|
1270
|
-
export class TreeItemLabelComponent extends React.Component<ITreeItemLabelComponentProps> {
|
1267
|
+
export class TreeItemLabelComponent extends React.Component<ITreeItemLabelComponentProps, ITreeItemLabelState> {
|
1271
1268
|
constructor(props: ITreeItemLabelComponentProps);
|
1272
1269
|
onClick(): void;
|
1270
|
+
onBlur(): void;
|
1273
1271
|
render(): JSX.Element;
|
1274
1272
|
}
|
1275
1273
|
}
|
@@ -1303,16 +1301,18 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/entities/gui/cont
|
|
1303
1301
|
onClick: () => void;
|
1304
1302
|
globalState: GlobalState;
|
1305
1303
|
isHovered: boolean;
|
1306
|
-
|
1304
|
+
isDragOver: boolean;
|
1307
1305
|
dragOverLocation: DragOverLocation;
|
1308
1306
|
}
|
1309
1307
|
export class ControlTreeItemComponent extends React.Component<IControlTreeItemComponentProps, {
|
1310
1308
|
isActive: boolean;
|
1311
1309
|
isVisible: boolean;
|
1310
|
+
isRenaming: boolean;
|
1312
1311
|
}> {
|
1313
1312
|
constructor(props: IControlTreeItemComponentProps);
|
1314
1313
|
highlight(): void;
|
1315
1314
|
switchVisibility(): void;
|
1315
|
+
onRename(name: string): void;
|
1316
1316
|
render(): JSX.Element;
|
1317
1317
|
}
|
1318
1318
|
}
|
@@ -1323,22 +1323,29 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemSelectabl
|
|
1323
1323
|
import { DragOverLocation, GlobalState } from "@babylonjs/gui-editor/globalState";
|
1324
1324
|
export interface ITreeItemSelectableComponentProps {
|
1325
1325
|
entity: any;
|
1326
|
-
|
1326
|
+
selectedEntities: any[];
|
1327
1327
|
mustExpand?: boolean;
|
1328
1328
|
offset: number;
|
1329
1329
|
globalState: GlobalState;
|
1330
1330
|
extensibilityGroups?: IExplorerExtensibilityGroup[];
|
1331
1331
|
filter: Nullable<string>;
|
1332
1332
|
}
|
1333
|
-
export
|
1333
|
+
export interface ITreeItemSelectableComponentState {
|
1334
|
+
dragOver: boolean;
|
1334
1335
|
isSelected: boolean;
|
1335
1336
|
isHovered: boolean;
|
1336
1337
|
dragOverLocation: DragOverLocation;
|
1337
|
-
}
|
1338
|
-
|
1338
|
+
}
|
1339
|
+
export class TreeItemSelectableComponent extends React.Component<ITreeItemSelectableComponentProps, ITreeItemSelectableComponentState> {
|
1339
1340
|
private _onSelectionChangedObservable;
|
1340
1341
|
private _onDraggingEndObservable;
|
1341
1342
|
private _onDraggingStartObservable;
|
1343
|
+
/** flag flipped onDragEnter if dragOver is already true
|
1344
|
+
* prevents dragLeave from immediately setting dragOver to false
|
1345
|
+
* required to make dragging work as expected
|
1346
|
+
* see: see: https://github.com/transformation-dev/matrx/tree/master/packages/dragster
|
1347
|
+
*/
|
1348
|
+
private _secondDragEnter;
|
1342
1349
|
constructor(props: ITreeItemSelectableComponentProps);
|
1343
1350
|
switchExpandedState(): void;
|
1344
1351
|
shouldComponentUpdate(nextProps: ITreeItemSelectableComponentProps, nextState: {
|
@@ -1350,6 +1357,7 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemSelectabl
|
|
1350
1357
|
renderChildren(isExpanded: boolean, offset?: boolean): (JSX.Element | null)[] | null;
|
1351
1358
|
render(): JSX.Element | (JSX.Element | null)[] | null;
|
1352
1359
|
dragOver(event: React.DragEvent<HTMLDivElement>): void;
|
1360
|
+
updateDragOverLocation(event: React.DragEvent<HTMLDivElement>): void;
|
1353
1361
|
drop(): void;
|
1354
1362
|
}
|
1355
1363
|
}
|
@@ -1366,7 +1374,7 @@ declare module "@babylonjs/gui-editor/components/sceneExplorer/treeItemComponent
|
|
1366
1374
|
forceSubitems?: boolean;
|
1367
1375
|
globalState: GlobalState;
|
1368
1376
|
entity?: any;
|
1369
|
-
|
1377
|
+
selectedEntities: any[];
|
1370
1378
|
extensibilityGroups?: IExplorerExtensibilityGroup[];
|
1371
1379
|
contextMenuItems?: {
|
1372
1380
|
label: string;
|
@@ -1476,9 +1484,77 @@ declare module "@babylonjs/gui-editor/components/commandBarComponent" {
|
|
1476
1484
|
private _panning;
|
1477
1485
|
private _zooming;
|
1478
1486
|
private _selecting;
|
1479
|
-
private _outlines;
|
1480
1487
|
constructor(props: ICommandBarComponentProps);
|
1481
|
-
|
1488
|
+
render(): JSX.Element;
|
1489
|
+
}
|
1490
|
+
}
|
1491
|
+
declare module "@babylonjs/gui-editor/diagram/guiGizmo" {
|
1492
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
1493
|
+
import { Vector2 } from "@babylonjs/core/Maths/math.vector";
|
1494
|
+
import * as React from "react";
|
1495
|
+
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
1496
|
+
import { Rect } from "@babylonjs/gui-editor/diagram/coordinateHelper";
|
1497
|
+
export interface IGuiGizmoProps {
|
1498
|
+
globalState: GlobalState;
|
1499
|
+
control: Control;
|
1500
|
+
}
|
1501
|
+
enum ScalePointPosition {
|
1502
|
+
Top = -1,
|
1503
|
+
Left = -1,
|
1504
|
+
Center = 0,
|
1505
|
+
Right = 1,
|
1506
|
+
Bottom = 1
|
1507
|
+
}
|
1508
|
+
interface IScalePoint {
|
1509
|
+
position: Vector2;
|
1510
|
+
horizontalPosition: ScalePointPosition;
|
1511
|
+
verticalPosition: ScalePointPosition;
|
1512
|
+
rotation: number;
|
1513
|
+
isPivot: boolean;
|
1514
|
+
}
|
1515
|
+
interface IGuiGizmoState {
|
1516
|
+
canvasBounds: Rect;
|
1517
|
+
scalePoints: IScalePoint[];
|
1518
|
+
scalePointDragging: number;
|
1519
|
+
isRotating: boolean;
|
1520
|
+
}
|
1521
|
+
export class GuiGizmoComponent extends React.Component<IGuiGizmoProps, IGuiGizmoState> {
|
1522
|
+
private _storedValues;
|
1523
|
+
private _localBounds;
|
1524
|
+
private _rotation;
|
1525
|
+
private _gizmoUpdateObserver;
|
1526
|
+
private _pointerUpObserver;
|
1527
|
+
private _pointerMoveObserver;
|
1528
|
+
constructor(props: IGuiGizmoProps);
|
1529
|
+
componentWillUnmount(): void;
|
1530
|
+
/**
|
1531
|
+
* Update the gizmo's positions
|
1532
|
+
* @param force should the update be forced. otherwise it will be updated only when the pointer is down
|
1533
|
+
*/
|
1534
|
+
updateGizmo(force?: boolean): void;
|
1535
|
+
private _onUp;
|
1536
|
+
private _onMove;
|
1537
|
+
private _rotate;
|
1538
|
+
private _modulo;
|
1539
|
+
private _dragLocalBounds;
|
1540
|
+
private _updateNodeFromLocalBounds;
|
1541
|
+
private _beginDraggingScalePoint;
|
1542
|
+
private _beginRotate;
|
1543
|
+
render(): JSX.Element;
|
1544
|
+
}
|
1545
|
+
}
|
1546
|
+
declare module "@babylonjs/gui-editor/diagram/guiGizmoWrapper" {
|
1547
|
+
import { Nullable } from "@babylonjs/core/types";
|
1548
|
+
import { Observer } from "@babylonjs/core/Misc/observable";
|
1549
|
+
import * as React from "react";
|
1550
|
+
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
1551
|
+
export interface IGizmoWrapperProps {
|
1552
|
+
globalState: GlobalState;
|
1553
|
+
}
|
1554
|
+
export class GizmoWrapper extends React.Component<IGizmoWrapperProps> {
|
1555
|
+
observer: Nullable<Observer<void>>;
|
1556
|
+
componentWillMount(): void;
|
1557
|
+
componentWillUnmount(): void;
|
1482
1558
|
render(): JSX.Element;
|
1483
1559
|
}
|
1484
1560
|
}
|
@@ -1501,6 +1577,7 @@ declare module "@babylonjs/gui-editor/diagram/artBoard" {
|
|
1501
1577
|
declare module "@babylonjs/gui-editor/workbenchEditor" {
|
1502
1578
|
import * as React from "react";
|
1503
1579
|
import { GlobalState } from "@babylonjs/gui-editor/globalState";
|
1580
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
1504
1581
|
interface IGraphEditorProps {
|
1505
1582
|
globalState: GlobalState;
|
1506
1583
|
}
|
@@ -1540,7 +1617,7 @@ declare module "@babylonjs/gui-editor/workbenchEditor" {
|
|
1540
1617
|
subItems?: string[];
|
1541
1618
|
}[];
|
1542
1619
|
createItems(): void;
|
1543
|
-
onCreate(value: string):
|
1620
|
+
onCreate(value: string): Control;
|
1544
1621
|
createToolbar(): JSX.Element;
|
1545
1622
|
}
|
1546
1623
|
}
|