@babylonjs/gui-editor 5.0.0-rc.10 → 5.0.0-rc.13

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;
@@ -953,15 +950,8 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
953
950
  private _setConstraintDirection;
954
951
  private _mouseStartPoint;
955
952
  _scene: Scene;
956
- private _ctrlKeyIsPressed;
957
- private _altKeyIsPressed;
958
953
  private _constraintDirection;
959
- private _forcePanning;
960
- private _forceZooming;
961
- private _forceSelecting;
962
954
  private _panning;
963
- private _canvas;
964
- private _responsive;
965
955
  private _isOverGUINode;
966
956
  private _engine;
967
957
  private _liveRenderObserver;
@@ -997,7 +987,7 @@ export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps
997
987
  pasteFromClipboard(clipboardContents: string): boolean;
998
988
  CopyGUIControl(original: Control): void;
999
989
  blurEvent: () => void;
1000
- componentWillUnmount(): void;
990
+ dispose(): void;
1001
991
  loadFromJson(serializationObject: any): void;
1002
992
  loadFromSnippet(snippetId: string): Promise<void>;
1003
993
  loadToEditor(): void;
@@ -1045,12 +1035,18 @@ import { Scene } from "@babylonjs/core/scene";
1045
1035
  import { Control } from "@babylonjs/gui/2D/controls/control";
1046
1036
  import { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObject";
1047
1037
  import { ISize } from "@babylonjs/core/Maths/math";
1038
+ import { KeyboardManager } from "@babylonjs/gui-editor/keyboardManager";
1048
1039
  export enum DragOverLocation {
1049
1040
  ABOVE = 0,
1050
1041
  BELOW = 1,
1051
1042
  CENTER = 2,
1052
1043
  NONE = 3
1053
1044
  }
1045
+ export enum GUIEditorTool {
1046
+ SELECT = 0,
1047
+ PAN = 1,
1048
+ ZOOM = 2
1049
+ }
1054
1050
  export class GlobalState {
1055
1051
  liveGuiTexture: Nullable<AdvancedDynamicTexture>;
1056
1052
  guiTexture: AdvancedDynamicTexture;
@@ -1072,17 +1068,19 @@ export class GlobalState {
1072
1068
  onPopupClosedObservable: Observable<void>;
1073
1069
  private _backgroundColor;
1074
1070
  private _outlines;
1075
- isMultiSelecting: boolean;
1076
- onOutlineChangedObservable: Observable<void>;
1071
+ keys: KeyboardManager;
1072
+ /** DO NOT USE: in the process of removing */
1077
1073
  blockKeyboardEvents: boolean;
1074
+ onOutlineChangedObservable: Observable<void>;
1078
1075
  controlCamera: boolean;
1079
1076
  selectionLock: boolean;
1080
1077
  workbench: WorkbenchComponent;
1081
1078
  onPropertyChangedObservable: Observable<PropertyChangedEvent>;
1082
- onZoomObservable: Observable<void>;
1079
+ private _tool;
1080
+ onToolChangeObservable: Observable<void>;
1081
+ get tool(): GUIEditorTool;
1082
+ set tool(newTool: GUIEditorTool);
1083
1083
  onFitToWindowObservable: Observable<void>;
1084
- onPanObservable: Observable<void>;
1085
- onSelectionButtonObservable: Observable<void>;
1086
1084
  onLoadObservable: Observable<File>;
1087
1085
  onSaveObservable: Observable<void>;
1088
1086
  onSnippetLoadObservable: Observable<void>;
@@ -1118,7 +1116,6 @@ export class GlobalState {
1118
1116
  constructor();
1119
1117
  /** adds copy, cut and paste listeners to the host window */
1120
1118
  registerEventListeners(): void;
1121
- private _updateKeys;
1122
1119
  get backgroundColor(): Color3;
1123
1120
  set backgroundColor(value: Color3);
1124
1121
  get outlines(): boolean;
@@ -1127,6 +1124,7 @@ export class GlobalState {
1127
1124
  setSelection(controls: Control[]): void;
1128
1125
  deleteSelectedNodes(): void;
1129
1126
  isMultiSelectable(control: Control): boolean;
1127
+ dispose(): void;
1130
1128
  }
1131
1129
 
1132
1130
  }
@@ -1187,6 +1185,26 @@ export class GUINodeTools {
1187
1185
  declare module "@babylonjs/gui-editor/index" {
1188
1186
  export * from "@babylonjs/gui-editor/guiEditor";
1189
1187
 
1188
+ }
1189
+ declare module "@babylonjs/gui-editor/keyboardManager" {
1190
+ import { Observable } from "@babylonjs/core/Misc/observable";
1191
+ type Key = "control" | "shift" | "alt" | "space" | "meta";
1192
+ export class KeyboardManager {
1193
+ private _hostElement;
1194
+ private _kdListener;
1195
+ private _kuListener;
1196
+ private _moveListener;
1197
+ private _keys;
1198
+ onKeyPressedObservable: Observable<Key>;
1199
+ constructor(hostElement: HTMLElement | HTMLDocument);
1200
+ private _keyEvent;
1201
+ private _updateModifierKeys;
1202
+ private _setKeyDown;
1203
+ isKeyDown(key: Key): boolean;
1204
+ dispose(): void;
1205
+ }
1206
+ export {};
1207
+
1190
1208
  }
1191
1209
  declare module "@babylonjs/gui-editor/legacy/legacy" {
1192
1210
  export * from "@babylonjs/gui-editor/index";
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.
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@babylonjs/gui-editor",
3
- "version": "5.0.0-rc.10",
3
+ "version": "5.0.0-rc.13",
4
4
  "main": "dist/babylon.guiEditor.max.js",
5
5
  "module": "dist/babylon.guiEditor.max.js",
6
6
  "esnext": "dist/babylon.guiEditor.max.js",
7
7
  "typings": "dist/babylon.guiEditor.module.d.ts",
8
8
  "files": [
9
9
  "dist",
10
- "readme.md"
10
+ "readme.md",
11
+ "license.md"
11
12
  ],
12
13
  "scripts": {
13
14
  "build": "npm run clean && npm run build:dev && npm run build:prod && npm run build:declaration",
@@ -17,19 +18,34 @@
17
18
  "clean": "rimraf dist"
18
19
  },
19
20
  "dependencies": {
20
- "@babylonjs/core": "^5.0.0-rc.10",
21
- "@babylonjs/gui": "^5.0.0-rc.10",
22
- "react": "^17.0.2",
23
- "react-dom": "^17.0.2",
24
- "tslib": "^2.3.1"
21
+ "@babylonjs/core": "^5.0.0-rc.13",
22
+ "@babylonjs/gui": "^5.0.0-rc.13"
25
23
  },
26
24
  "peerDependencies": {
27
25
  "@types/react": ">=16.7.3",
28
26
  "@types/react-dom": ">=16.0.9"
29
27
  },
30
28
  "devDependencies": {
29
+ "react": "^17.0.2",
30
+ "react-dom": "^17.0.2",
31
31
  "rimraf": "^3.0.2",
32
32
  "typescript": "^4.4.4"
33
33
  },
34
- "sideEffects": true
34
+ "keywords": [
35
+ "3D",
36
+ "javascript",
37
+ "html5",
38
+ "webgl",
39
+ "babylon.js"
40
+ ],
41
+ "license": "Apache-2.0",
42
+ "sideEffects": true,
43
+ "homepage": "https://www.babylonjs.com",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/BabylonJS/Babylon.js.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/BabylonJS/Babylon.js/issues"
50
+ }
35
51
  }