babylonjs-editor 4.3.0 → 4.4.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.
Files changed (2) hide show
  1. package/index.d.ts +321 -276
  2. package/package.json +10 -10
package/index.d.ts CHANGED
@@ -6,7 +6,6 @@
6
6
  // ../../babylonjs
7
7
  // ../../directory-tree
8
8
  // ../../adm-zip
9
- // ../../dat.gui
10
9
  // ../../@blueprintjs/select
11
10
  // renderer/editor/graph/node.d.ts
12
11
  // ../../xterm
@@ -30,7 +29,6 @@ declare module 'babylonjs-editor' {
30
29
  export { MaterialAssets } from "babylonjs-editor/renderer/editor/assets/materials";
31
30
  export { TextureAssets } from "babylonjs-editor/renderer/editor/assets/textures";
32
31
  export { Inspector, IInspectorProps, IInspectorState, IObjectInspector, IObjectInspectorProps } from "babylonjs-editor/renderer/editor/components/inspector";
33
- export { AbstractInspectorLegacy } from "babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector-legacy";
34
32
  export { AbstractInspector } from "babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector";
35
33
  export { MaterialInspector, IMaterialInspectorState } from "babylonjs-editor/renderer/editor/components/inspectors/materials/material-inspector";
36
34
  export { InspectorColor } from "babylonjs-editor/renderer/editor/gui/inspector/fields/color";
@@ -59,7 +57,6 @@ declare module 'babylonjs-editor' {
59
57
  export { Icon } from "babylonjs-editor/renderer/editor/gui/icon";
60
58
  export { SceneImporterTools, ISceneImporterToolsConfiguration } from "babylonjs-editor/renderer/editor/scene/import-tools";
61
59
  export { Packer, IPackerOptions, PackerStatus } from "babylonjs-editor/renderer/editor/project/packer/packer";
62
- import "./renderer/editor/gui/augmentations/index";
63
60
  }
64
61
 
65
62
  declare module 'babylonjs-editor/renderer/editor/plugins/assets' {
@@ -260,7 +257,6 @@ declare module 'babylonjs-editor/renderer/editor/editor' {
260
257
  import { MainToolbar } from "babylonjs-editor/renderer/editor/components/main-toolbar";
261
258
  import { ToolsToolbar } from "babylonjs-editor/renderer/editor/components/tools-toolbar";
262
259
  import { Console } from "babylonjs-editor/renderer/editor/components/console";
263
- import "./gui/augmentations/index";
264
260
  import "./components/inspectors/scene/scene-inspector";
265
261
  import "./components/inspectors/scene/rendering-inspector";
266
262
  import "./components/inspectors/scene/animation-groups-inspector";
@@ -615,21 +611,17 @@ declare module 'babylonjs-editor/renderer/editor/editor' {
615
611
  * @hidden
616
612
  */
617
613
  _applyPreferences(): Promise<void>;
614
+ /**
615
+ * @hidden
616
+ */
617
+ _applyPreferencesPlugins(): Promise<void>;
618
618
  }
619
619
  }
620
620
 
621
621
  declare module 'babylonjs-editor/renderer/editor/tools/tools' {
622
- import { Engine, Scene, Node, Nullable, Camera, Mesh, Material } from "babylonjs";
622
+ import { Engine, Scene, Node, Camera, Mesh, Material } from "babylonjs";
623
623
  import { ICommonMetadata, IEditorPreferences, IMaterialMetadata, IMeshMetadata, ITransformNodeMetadata } from "babylonjs-editor/renderer/editor/tools/types";
624
624
  export class Tools {
625
- /**
626
- * Initializes the tools.
627
- */
628
- static Init(): Promise<void>;
629
- /**
630
- * Returns the current root path of the app.
631
- */
632
- static GetAppPath(): string;
633
625
  /**
634
626
  * Normalizes the given path according to the current platform.
635
627
  * @param path defines the path to normalize according to the current platform.
@@ -757,22 +749,6 @@ declare module 'babylonjs-editor/renderer/editor/tools/tools' {
757
749
  * @param onProgress callback called while file is loading (if the server supports this mode).
758
750
  */
759
751
  static LoadFile<T = string | ArrayBuffer>(url: string, useArrayBuffer: boolean, onProgress?: (data: any) => void): Promise<T>;
760
- /**
761
- * Opens the save dialog and returns the selected path.
762
- * @param path optional path where to open the save dialog.
763
- */
764
- static ShowSaveDialog(path?: Nullable<string>): Promise<string>;
765
- /**
766
- * Opens the open-file dialog and returns the selected path.
767
- * @param path the path where to start the dialog.
768
- */
769
- static ShowOpenFileDialog(title: string, path?: Nullable<string>): Promise<string>;
770
- /**
771
- * Opens the save file dialog and returns the selected path.
772
- * @param title the title of the save file dialog.
773
- * @param path optional path where to open the save dialog.
774
- */
775
- static ShowSaveFileDialog(title: Nullable<string>, path?: Nullable<string>): Promise<string>;
776
752
  }
777
753
  }
778
754
 
@@ -1216,6 +1192,12 @@ declare module 'babylonjs-editor/renderer/editor/components/assets-browser/files
1216
1192
  * @param to defines the new absolute path to the file being moved.
1217
1193
  */
1218
1194
  abstract moveFile(from: string, to: string): void | Promise<void>;
1195
+ /**
1196
+ * Returns wheter or not the given file can be renamed.
1197
+ * @param from defines the previous absolute path to the file being renamed.
1198
+ * @param to defines the new absolute path to the file being renamed.
1199
+ */
1200
+ canRename(_from: string, _to: string): Promise<boolean>;
1219
1201
  /**
1220
1202
  * Called on the given file is being remvoed.
1221
1203
  * @param path defines the absolute path to the file that is being removed.
@@ -1325,7 +1307,7 @@ declare module 'babylonjs-editor/renderer/editor/components/assets-browser/files
1325
1307
  * @param ev defines the reference to the event object.
1326
1308
  * @param pick defines the picking info generated while dropping in the preview.
1327
1309
  */
1328
- onDropInPreview(_1: React.DragEvent<HTMLElement>, _2: PickingInfo): void;
1310
+ onDropInPreview(_1: DragEvent, _2: PickingInfo): void;
1329
1311
  /**
1330
1312
  * Called on the user drops the asset in a supported inspector field.
1331
1313
  * @param ev defiens the reference to the event object.
@@ -1352,7 +1334,7 @@ declare module 'babylonjs-editor/renderer/editor/assets/materials' {
1352
1334
  import * as React from "react";
1353
1335
  import { Material, PickingInfo, Scene, Node } from "babylonjs";
1354
1336
  import { AbstractAssets, IAssetComponentItem } from "babylonjs-editor/renderer/editor/assets/abstract-assets";
1355
- import "./materials/augmentations";
1337
+ import "../tools/materials/augmentations";
1356
1338
  export class MaterialAssets extends AbstractAssets {
1357
1339
  /**
1358
1340
  * Defines the type of the data transfer data when drag'n'dropping asset.
@@ -1535,9 +1517,8 @@ declare module 'babylonjs-editor/renderer/editor/components/inspector' {
1535
1517
  import * as React from "react";
1536
1518
  import { Editor } from "babylonjs-editor/renderer/editor/editor";
1537
1519
  import { AbstractInspector } from "babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector";
1538
- import { AbstractInspectorLegacy } from "babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector-legacy";
1539
1520
  export interface IObjectInspector {
1540
- ctor: (new (props: IObjectInspectorProps) => AbstractInspectorLegacy<any> | AbstractInspector<any, any>);
1521
+ ctor: (new (props: IObjectInspectorProps) => AbstractInspector<any, any>);
1541
1522
  ctorNames: string[];
1542
1523
  title: string;
1543
1524
  isSupported?: Undefinable<(obj: any) => boolean>;
@@ -1545,7 +1526,7 @@ declare module 'babylonjs-editor/renderer/editor/components/inspector' {
1545
1526
  * The reference to the inspector.
1546
1527
  * @hidden
1547
1528
  */
1548
- _ref?: Undefinable<AbstractInspectorLegacy<any>>;
1529
+ _ref?: Undefinable<AbstractInspector<any, any>>;
1549
1530
  /**
1550
1531
  * @hidden
1551
1532
  */
@@ -1620,10 +1601,6 @@ declare module 'babylonjs-editor/renderer/editor/components/inspector' {
1620
1601
  * Refreshes the inspector.
1621
1602
  */
1622
1603
  refresh(): void;
1623
- /**
1624
- * Refreshes the current display of the current inspector.
1625
- */
1626
- refreshDisplay(): void;
1627
1604
  /**
1628
1605
  * Resizes the inspector.
1629
1606
  */
@@ -1631,150 +1608,6 @@ declare module 'babylonjs-editor/renderer/editor/components/inspector' {
1631
1608
  }
1632
1609
  }
1633
1610
 
1634
- declare module 'babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector-legacy' {
1635
- import * as React from "react";
1636
- import { GUI, GUIController } from "dat.gui";
1637
- import { Color3, Color4, BaseTexture, ISize, Material } from "babylonjs";
1638
- import { Nullable, Undefinable } from "babylonjs-editor/shared/types";
1639
- import { Editor } from "babylonjs-editor/renderer/editor/editor";
1640
- import { SuggestController } from "babylonjs-editor/renderer/editor/gui/augmentations/suggest";
1641
- import { AbstractAssets } from "babylonjs-editor/renderer/editor/assets/abstract-assets";
1642
- import { IAssetsProps } from "babylonjs-editor/renderer/editor/components/assets";
1643
- import { IObjectInspectorProps } from "babylonjs-editor/renderer/editor/components/inspector";
1644
- export abstract class AbstractInspectorLegacy<T> extends React.Component<IObjectInspectorProps> {
1645
- /**
1646
- * Defines the GUI reference.
1647
- */
1648
- tool: Nullable<GUI>;
1649
- /**
1650
- * Defines wether or not undo/redo should be handled by the inspector.
1651
- */
1652
- handleUndoRedo: boolean;
1653
- /**
1654
- * The editor reference.
1655
- */
1656
- protected editor: Editor;
1657
- /**
1658
- * The selected object reference.
1659
- */
1660
- protected selectedObject: T;
1661
- /**
1662
- * Defines the Id of the tool.
1663
- */
1664
- protected _id: string;
1665
- /**
1666
- * Defines the div of the tool.
1667
- */
1668
- protected _div: Nullable<HTMLDivElement>;
1669
- /**
1670
- * Constructor.
1671
- * @param props the component's props.
1672
- */
1673
- constructor(props: IObjectInspectorProps);
1674
- /**
1675
- * Renders the component.
1676
- */
1677
- render(): React.ReactNode;
1678
- /**
1679
- * Called on the component did mount.
1680
- */
1681
- abstract onUpdate(): void;
1682
- /**
1683
- * Called on a controller changes.
1684
- * @param folder the folder containing the modified controller.
1685
- * @param controller the controller that has been modified.
1686
- */
1687
- onControllerChange(_?: GUI, __?: GUIController): void;
1688
- /**
1689
- * Called on a controller finished changes.
1690
- * @param folder the folder containing the modified controller.
1691
- * @param controller the controller that has been modified.
1692
- */
1693
- onControllerFinishChange(_?: GUI, __?: GUIController): void;
1694
- /**
1695
- * Gets wether or not the component is mounted.
1696
- */
1697
- protected get isMounted(): boolean;
1698
- /**
1699
- * Called on the component did moubnt.
1700
- */
1701
- componentDidMount(): void;
1702
- /**
1703
- * Called on the component will unmount.
1704
- */
1705
- componentWillUnmount(): void;
1706
- /**
1707
- * Refreshes the inspector tool.
1708
- */
1709
- refresh(): void;
1710
- /**
1711
- * Refreshes the edition tool.
1712
- */
1713
- refreshDisplay(): void;
1714
- /**
1715
- * Clears the given folder.
1716
- */
1717
- clearFolder(folder: GUI): void;
1718
- /**
1719
- * Clears the whole tool.
1720
- */
1721
- clear(): void;
1722
- /**
1723
- * Resizes the edition tool.
1724
- * @param size defines the size of the panel.
1725
- */
1726
- resize(size?: ISize): void;
1727
- /**
1728
- * Returns the reference to the texture identified by the given editor name.
1729
- * @param editorName the name of the texture to find.
1730
- */
1731
- protected getTexture(editorName: string): Nullable<BaseTexture>;
1732
- /**
1733
- * Returns the reference to the material identified by the given editor name.
1734
- * @param name defines the name of the material to find.
1735
- */
1736
- protected getMaterial(name: string): Nullable<Material>;
1737
- /**
1738
- * Adds a new texture field to the inspector.
1739
- * @param parent the parent folder where to add the texture field.
1740
- * @param object the object to modify.
1741
- * @param property the property to modify in the given object.
1742
- * @param onChange optional callback called on the texture changed.
1743
- */
1744
- protected addTextureList(parent: GUI | undefined, object: any, property: string, onChange?: (texture: Nullable<BaseTexture>) => void): SuggestController;
1745
- /**
1746
- * Adds a new texture field to the inspector.
1747
- * @param parent the parent folder where to add the texture field.
1748
- * @param object the object to modify.
1749
- * @param property the property to modify in the given object.
1750
- * @param onChange optional callback called on the texture changed.
1751
- */
1752
- protected addMaterialList(parent: GUI | undefined, object: any, property: string, onChange?: (material: Nullable<Material>) => void): SuggestController;
1753
- /**
1754
- * Adds a color folder to edit RGB(A)
1755
- * @param parent the parent folder where to add the color folder.
1756
- * @param name the name of the color folder.
1757
- * @param object the base object to modify.
1758
- * @param property the path to the color property.
1759
- * @param onChange optional callback called on the color changed.
1760
- */
1761
- protected addColor(parent: GUI, name: string, object: any, property: string, onChange?: (color: Color3 | Color4) => void): GUI;
1762
- /**
1763
- * Adds a new suggest contoller containg the list of all the civen componet's assets.
1764
- * @param parent defines the parent folder where to add the assets list.
1765
- * @param componentCtor defines the reference to the constructor of the assets component to get its items.
1766
- * @param baseValue defines the base value of the suggest controller to display.
1767
- * @param object defines the reference to the object to modify.
1768
- * @param property defines the path to the property to modify.
1769
- */
1770
- protected addAssetsList(parent: GUI, componentCtor: (new (props: IAssetsProps) => AbstractAssets), baseValue: Undefinable<string>, object: any, property: string): SuggestController;
1771
- /**
1772
- * Called on the tool is mounted to handle onChange & onFinishChange
1773
- */
1774
- protected _handleChanged(root?: GUI): void;
1775
- }
1776
- }
1777
-
1778
1611
  declare module 'babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector' {
1779
1612
  import { Nullable } from "babylonjs-editor/shared/types";
1780
1613
  import * as React from "react";
@@ -2059,6 +1892,10 @@ declare module 'babylonjs-editor/renderer/editor/gui/inspector/fields/number' {
2059
1892
  * Defines wether or not the label should be hidden.
2060
1893
  */
2061
1894
  noLabel?: boolean;
1895
+ /**
1896
+ * Defines the default value of the field in case the editor property doesn't exist.
1897
+ */
1898
+ defaultValue?: number;
2062
1899
  /**
2063
1900
  * Defines wether or not automatic undo/redo should be skipped.
2064
1901
  */
@@ -3004,6 +2841,7 @@ declare module 'babylonjs-editor/renderer/editor/project/files' {
3004
2841
  declare module 'babylonjs-editor/renderer/editor/project/typings' {
3005
2842
  import { Undefinable, IStringDictionary } from "babylonjs-editor/shared/types";
3006
2843
  import { KTXToolsType } from "babylonjs-editor/renderer/editor/tools/ktx";
2844
+ import { IRegisteredPlugin } from "babylonjs-editor/renderer/editor/tools/types";
3007
2845
  /**
3008
2846
  * Defines the type the possible values of the physics engine type string
3009
2847
  * store in the workspace JSON file.
@@ -3085,6 +2923,15 @@ declare module 'babylonjs-editor/renderer/editor/project/typings' {
3085
2923
  */
3086
2924
  keyPath?: string;
3087
2925
  };
2926
+ /**
2927
+ * Defines the options of the custom webserver.
2928
+ */
2929
+ customWebServer?: {
2930
+ /**
2931
+ * Defines the Url of the custom webserver where to start the game.
2932
+ */
2933
+ url: string;
2934
+ };
3088
2935
  /**
3089
2936
  * Defines the options of the KTX2 compression tool.
3090
2937
  */
@@ -3151,6 +2998,10 @@ declare module 'babylonjs-editor/renderer/editor/project/typings' {
3151
2998
  quality: "etcfast" | "etcnormal" | "etcslow";
3152
2999
  };
3153
3000
  };
3001
+ /**
3002
+ * Defines the list of all registered plugins for the workspace.
3003
+ */
3004
+ plugins?: Undefinable<IRegisteredPlugin[]>;
3154
3005
  }
3155
3006
  export interface IProject {
3156
3007
  /**
@@ -3612,9 +3463,23 @@ declare module 'babylonjs-editor/renderer/editor/project/scene-exporter' {
3612
3463
  generateAllCompressedTextureFormats?: boolean;
3613
3464
  }
3614
3465
  export class SceneExporter {
3466
+ /**
3467
+ * Defines the list of all textures file types that are copy-able for the
3468
+ * final assets output folder.
3469
+ */
3615
3470
  static readonly CopyAbleImageTypes: string[];
3616
3471
  /**
3617
- * Defines the list of all files types that are copy-able for the
3472
+ * Defines the list of all video file types that are copy-able for the
3473
+ * final assets output folder.
3474
+ */
3475
+ static readonly CopyAbleVideoTypes: string[];
3476
+ /**
3477
+ * Defines the list of all 3d assets file types that are copy-able for the
3478
+ * final assets output folder.
3479
+ */
3480
+ static readonly CopyAble3dAssetTypes: string[];
3481
+ /**
3482
+ * Defines the list of all file types that are copy-able for the
3618
3483
  * final assets output folder.
3619
3484
  */
3620
3485
  static readonly CopyAbleAssetsTypes: string[];
@@ -4641,6 +4506,8 @@ declare module 'babylonjs-editor/renderer/editor/components/assets-browser' {
4641
4506
  import { IStringDictionary, Nullable } from "babylonjs-editor/shared/types";
4642
4507
  import * as React from "react";
4643
4508
  import { Editor } from "babylonjs-editor/renderer/editor/editor";
4509
+ import { AssetsBrowserTree } from "babylonjs-editor/renderer/editor/components/assets-browser/tree";
4510
+ import { AssetsBrowserFiles } from "babylonjs-editor/renderer/editor/components/assets-browser/files";
4644
4511
  export interface IAssetsBrowserProps {
4645
4512
  /**
4646
4513
  * Defines the reference to the editor.
@@ -4672,6 +4539,14 @@ declare module 'babylonjs-editor/renderer/editor/components/assets-browser' {
4672
4539
  * Defines the reference to the dictionary that stores all the moved assets.
4673
4540
  */
4674
4541
  movedAssetsDictionary: IStringDictionary<string>;
4542
+ /**
4543
+ * @hidden
4544
+ */
4545
+ _tree: Nullable<AssetsBrowserTree>;
4546
+ /**
4547
+ * @hidden
4548
+ */
4549
+ _files: Nullable<AssetsBrowserFiles>;
4675
4550
  /**
4676
4551
  * Constructor.
4677
4552
  * @param props defines the component's props.
@@ -5156,98 +5031,6 @@ declare module 'babylonjs-editor/renderer/editor/workers/workers' {
5156
5031
  }
5157
5032
  }
5158
5033
 
5159
- declare module 'babylonjs-editor/renderer/editor/gui/augmentations/suggest' {
5160
- import { Undefinable } from "babylonjs-editor/shared/types";
5161
- import * as React from "react";
5162
- import * as dat from "dat.gui";
5163
- export interface _IListSuggestProps {
5164
- controller: SuggestController;
5165
- }
5166
- export interface _IListSuggestState {
5167
- list: string[];
5168
- value: string;
5169
- }
5170
- export class _ListSuggest extends React.Component<_IListSuggestProps, _IListSuggestState> {
5171
- /**
5172
- * Constructor.
5173
- * @param props the component's props.
5174
- */
5175
- constructor(props: _IListSuggestProps);
5176
- /**
5177
- * Renders the component.
5178
- */
5179
- render(): React.ReactNode;
5180
- }
5181
- /**
5182
- * Suggest conroller.
5183
- */
5184
- export class SuggestController extends dat.controllers.Controller {
5185
- /**
5186
- * @hidden
5187
- */
5188
- object: any;
5189
- /**
5190
- * @hidden
5191
- */
5192
- property: string;
5193
- /**
5194
- * @hidden
5195
- */
5196
- list: string[];
5197
- /**
5198
- * @hidden
5199
- */
5200
- __onChange: (r: string) => void;
5201
- /**
5202
- * @hidden
5203
- */
5204
- __onFinishChange: (r: string) => void;
5205
- /**
5206
- * @hidden
5207
- */
5208
- __renderer: Undefinable<{
5209
- onShowLabel?: (item: string) => string;
5210
- onShowIcon?: (item: string) => JSX.Element;
5211
- onShowTooltip?: (item: string) => JSX.Element | undefined;
5212
- onUpdate?: () => string[] | Promise<string[]>;
5213
- }>;
5214
- /**
5215
- * Constructor.
5216
- * @param object the object to modify.
5217
- * @param property the property of the object tu get and set changes.
5218
- * @param list the list of suggestions.
5219
- * @param onShowLabel optional callback called when rendering a suggestion item.
5220
- */
5221
- constructor(object: any, property: string, list?: string[], renderer?: {
5222
- onShowLabel?: (item: string) => string;
5223
- onShowIcon?: (item: string) => JSX.Element;
5224
- onUpdate?: () => string[];
5225
- tooltip?: JSX.Element;
5226
- });
5227
- /**
5228
- * Registers the onChange callback.
5229
- */
5230
- onChange(callback: (r: string) => void): SuggestController;
5231
- /**
5232
- * Registers the onFinishChange callback.
5233
- */
5234
- onFinishChange(callback: (r: string) => void): SuggestController;
5235
- /**
5236
- * Updates the current display of the controller.
5237
- */
5238
- updateDisplay(): SuggestController;
5239
- /**
5240
- * Sets a new name for the field.
5241
- * @param name the new name of the field.
5242
- */
5243
- name(name: string): SuggestController;
5244
- /**
5245
- * Disposes the component.
5246
- */
5247
- dispose(): void;
5248
- }
5249
- }
5250
-
5251
5034
  declare module 'babylonjs-editor/renderer/editor/gui/inspector/utils' {
5252
5035
  import { IStringDictionary, Nullable } from "babylonjs-editor/shared/types";
5253
5036
  import { AbstractInspector } from "babylonjs-editor/renderer/editor/components/inspectors/abstract-inspector";
@@ -5673,9 +5456,10 @@ declare module 'babylonjs-editor/renderer/editor/tools/process' {
5673
5456
  * Executes the given command and returns the reference to the newly created editor process object.
5674
5457
  * @param command defines the command to execute in the terminal process.
5675
5458
  * @param readonly defines wether or not the terminal process is in read-only.
5459
+ * @param cwd defines the absolute path to the working directory where to process will be executed.
5676
5460
  * @returns the newly created editor process object that contains the terminal, process, etc.
5677
5461
  */
5678
- static ExecuteCommand(command: string, readonly?: boolean): Nullable<IEditorProcess>;
5462
+ static ExecuteCommand(command: string, readonly?: boolean, cwd?: string): Nullable<IEditorProcess>;
5679
5463
  /**
5680
5464
  * Kills and removes the editor process identified by the given id if exists.
5681
5465
  * @param id defines the id of the editor process to remove if exists.
@@ -5694,6 +5478,153 @@ declare module 'babylonjs-editor/renderer/editor/tools/process' {
5694
5478
  }
5695
5479
  }
5696
5480
 
5481
+ declare module 'babylonjs-editor/renderer/editor/components/assets-browser/tree' {
5482
+ import * as React from "react";
5483
+ import { ITreeNode } from "@blueprintjs/core";
5484
+ import { Editor } from "babylonjs-editor/renderer/editor/editor";
5485
+ export interface IAssetsBrowserFavorite {
5486
+ /**
5487
+ * Defines the id of the favorite.
5488
+ */
5489
+ id: string;
5490
+ /**
5491
+ * Defines the name of the favorite.
5492
+ */
5493
+ name: string;
5494
+ }
5495
+ export interface IAssetsBrowserTreeProps {
5496
+ /**
5497
+ * Defines the reference to the editor.
5498
+ */
5499
+ editor: Editor;
5500
+ /**
5501
+ * Defines the callback called on a directory has been clicked in the tree.
5502
+ */
5503
+ onDirectorySelected: (path: string) => void;
5504
+ /**
5505
+ * Defines the callback called on a favorite has been clicked in the tree.
5506
+ */
5507
+ onFavoriteSelected: (favorite: IAssetsBrowserFavorite) => void;
5508
+ }
5509
+ export interface IAssetsBrowserTreeState {
5510
+ /**
5511
+ * Defines the list of all available nodes in the tree.
5512
+ */
5513
+ nodes: ITreeNode<string>[];
5514
+ }
5515
+ export class AssetsBrowserTree extends React.Component<IAssetsBrowserTreeProps, IAssetsBrowserTreeState> {
5516
+ /**
5517
+ * Defines the id of the node for favorites "Textures".
5518
+ */
5519
+ static readonly TexturesFavorite: IAssetsBrowserFavorite;
5520
+ /**
5521
+ * Defines the id of the node for favorites "Materials".
5522
+ */
5523
+ static readonly MaterialsFavorite: IAssetsBrowserFavorite;
5524
+ /**
5525
+ * Constructor.
5526
+ * @param props defines the component's props.
5527
+ */
5528
+ constructor(props: IAssetsBrowserTreeProps);
5529
+ /**
5530
+ * Renders the component.
5531
+ */
5532
+ render(): React.ReactNode;
5533
+ /**
5534
+ * Sets the new absolute path to the directory to read and draw its items.
5535
+ * @param directoryPath defines the absolute path to the directory to show in the view.
5536
+ */
5537
+ setDirectory(directoryPath: string): Promise<void>;
5538
+ /**
5539
+ * Refreshes the current tree.
5540
+ */
5541
+ refresh(): void;
5542
+ }
5543
+ }
5544
+
5545
+ declare module 'babylonjs-editor/renderer/editor/components/assets-browser/files' {
5546
+ import * as React from "react";
5547
+ import { Editor } from "babylonjs-editor/renderer/editor/editor";
5548
+ import { IAssetsBrowserFavorite } from "babylonjs-editor/renderer/editor/components/assets-browser/tree";
5549
+ import { AssetsBrowserItem } from "babylonjs-editor/renderer/editor/components/assets-browser/files/item";
5550
+ export interface IAssetsBrowserFilesProps {
5551
+ /**
5552
+ * Defines the reference to the editor.
5553
+ */
5554
+ editor: Editor;
5555
+ /**
5556
+ * Defines the callback called on a directory has been clicked in the tree.
5557
+ */
5558
+ onDirectorySelected: (path: string) => void;
5559
+ }
5560
+ export interface IAssetsBrowserFilesState {
5561
+ /**
5562
+ * Defines the current stack of opened folders.
5563
+ */
5564
+ pathStack: string[];
5565
+ /**
5566
+ * Defines the absolute path to the working directory.
5567
+ */
5568
+ currentDirectory: string;
5569
+ /**
5570
+ * Defines the current filter.
5571
+ */
5572
+ filter: string;
5573
+ /**
5574
+ * Defines the current size value for the items.
5575
+ */
5576
+ itemsSize: number;
5577
+ /**
5578
+ * Defines the list of all items drawn in the view.
5579
+ */
5580
+ items: React.ReactNode[];
5581
+ }
5582
+ export class AssetsBrowserFiles extends React.Component<IAssetsBrowserFilesProps, IAssetsBrowserFilesState> {
5583
+ /**
5584
+ * Defines the list of all selected items.
5585
+ */
5586
+ selectedItems: string[];
5587
+ /**
5588
+ * @hidden
5589
+ */
5590
+ _items: AssetsBrowserItem[];
5591
+ /**
5592
+ * Initializes the files component.
5593
+ * @param editor defines the reference to the editor.
5594
+ */
5595
+ static Init(editor: Editor): Promise<void>;
5596
+ /**
5597
+ * Constructor.
5598
+ * @param props defines the component's props.
5599
+ */
5600
+ constructor(props: IAssetsBrowserFilesProps);
5601
+ /**
5602
+ * Renders the component.
5603
+ */
5604
+ render(): React.ReactNode;
5605
+ /**
5606
+ * Sets the new favorite to read and draw its items.
5607
+ * @param favorite defines the id of the favorite to show in the view.
5608
+ */
5609
+ setFavorite(favorite: IAssetsBrowserFavorite): Promise<void>;
5610
+ /**
5611
+ * Sets the new absolute path to the directory to read and draw its items.
5612
+ * @param directoryPath defines the absolute path to the directory to show in the view.
5613
+ */
5614
+ setDirectory(directoryPath: string): Promise<void>;
5615
+ /**
5616
+ * Refreshes the current list of files.
5617
+ */
5618
+ refresh(): Promise<void>;
5619
+ /**
5620
+ * Calls the given function in all the selected items (if exists).
5621
+ * @param methodName defines the name of the function to call.
5622
+ * @hidden
5623
+ */
5624
+ _callSelectedItemsMethod(methodName: string, ...parameters: any[]): Promise<void>;
5625
+ }
5626
+ }
5627
+
5697
5628
  declare module 'babylonjs-editor/renderer/editor/scene/picker' {
5698
5629
  import { Nullable } from "babylonjs-editor/shared/types";
5699
5630
  import { Observable, Node, SubMesh } from "babylonjs";
@@ -5946,6 +5877,120 @@ declare module 'babylonjs-editor/renderer/editor/cinematic/base' {
5946
5877
  }
5947
5878
  }
5948
5879
 
5880
+ declare module 'babylonjs-editor/renderer/editor/components/assets-browser/files/item' {
5881
+ import { IStringDictionary, Nullable } from "babylonjs-editor/shared/types";
5882
+ import * as React from "react";
5883
+ import { Editor } from "babylonjs-editor/renderer/editor/editor";
5884
+ import { AssetsBrowserItemHandler, IItemHandler } from "babylonjs-editor/renderer/editor/components/assets-browser/files/item-handler";
5885
+ import { AssetsBrowserMoveHandler } from "babylonjs-editor/renderer/editor/components/assets-browser/files/move/move-handler";
5886
+ export interface IAssetsBrowserItemProps {
5887
+ /**
5888
+ * Defines the reference to the editor.
5889
+ */
5890
+ editor: Editor;
5891
+ /**
5892
+ * Defines the title of the item.
5893
+ */
5894
+ title: string;
5895
+ /**
5896
+ * Defines the relative path to the item.
5897
+ */
5898
+ relativePath: string;
5899
+ /**
5900
+ * Defines the absolute path to the item.
5901
+ */
5902
+ absolutePath: string;
5903
+ /**
5904
+ * Defines the type of the item (directory or file).
5905
+ */
5906
+ type: "file" | "directory";
5907
+ /**
5908
+ * Defines the size of the item.
5909
+ */
5910
+ size?: number;
5911
+ /**
5912
+ * Defines the callback called each time the item is clicked.
5913
+ */
5914
+ onClick: (item: AssetsBrowserItem, ev: React.MouseEvent<HTMLDivElement>) => void;
5915
+ /**
5916
+ * Callback called on the user double clicks an item.
5917
+ */
5918
+ onDoubleClick: () => void;
5919
+ /**
5920
+ * Defines the callback called on the item is starts being dragged.
5921
+ */
5922
+ onDragStart: (item: AssetsBrowserItem, ev: React.DragEvent<HTMLDivElement>) => void;
5923
+ }
5924
+ export interface IAssetsBrowserItemState {
5925
+ /**
5926
+ * Defines the color applied on the title.
5927
+ */
5928
+ titleColor: string;
5929
+ /**
5930
+ * Defines wether or not the item is selected.
5931
+ */
5932
+ isSelected: boolean;
5933
+ /**
5934
+ * Defines wether or not the file is being renamed.
5935
+ */
5936
+ isRenaming: boolean;
5937
+ /**
5938
+ * Defines the reference to the item handler.
5939
+ */
5940
+ itemHandler: Nullable<React.ReactNode>;
5941
+ /**
5942
+ * Defines the size of the item.
5943
+ */
5944
+ size: number;
5945
+ }
5946
+ export class AssetsBrowserItem extends React.Component<IAssetsBrowserItemProps, IAssetsBrowserItemState> {
5947
+ /**
5948
+ * @hidden
5949
+ */
5950
+ static _ItemHandlers: IStringDictionary<IItemHandler>;
5951
+ /**
5952
+ * @hidden
5953
+ */
5954
+ static _ItemMoveHandlers: AssetsBrowserMoveHandler[];
5955
+ /**
5956
+ * Registers the given item handler.
5957
+ * @param itemHandler defines the reference to the configuration of the item handler.
5958
+ */
5959
+ static RegisterItemHandler(itemHandler: IItemHandler): void;
5960
+ /**
5961
+ * Registers the given item move handler.
5962
+ * @param itemMoveHandler defines the reference to the item move handler.
5963
+ */
5964
+ static RegisterItemMoveHandler(itemMoveHandler: AssetsBrowserMoveHandler): void;
5965
+ /**
5966
+ * Initializes the item renderer.
5967
+ */
5968
+ static Init(editor: Editor): void;
5969
+ /**
5970
+ * @hidden
5971
+ */
5972
+ _itemHandlerRef: Nullable<AssetsBrowserItemHandler>;
5973
+ /**
5974
+ * Constructor.
5975
+ * @param props defines the component's props.
5976
+ */
5977
+ constructor(props: IAssetsBrowserItemProps);
5978
+ /**
5979
+ * Renders the component.
5980
+ */
5981
+ render(): React.ReactNode;
5982
+ /**
5983
+ * Called on the component did mount.
5984
+ */
5985
+ componentDidMount(): void;
5986
+ /**
5987
+ * Sets wether or not the item is selected.
5988
+ * @param isSelected defines wether or not the item is selected.
5989
+ */
5990
+ setSelected(isSelected: boolean): void;
5991
+ }
5992
+ }
5993
+
5949
5994
  declare module 'babylonjs-editor/renderer/editor/scene/icons' {
5950
5995
  import { UtilityLayerRenderer, Observable } from "babylonjs";
5951
5996
  import { Editor } from "babylonjs-editor/renderer/editor/editor";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-editor",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "Babylon.js Editor is a Web Application helping artists to work with Babylon.js",
5
5
  "productName": "Babylon.js Editor",
6
6
  "typings": "index.d.ts",
@@ -22,15 +22,15 @@
22
22
  "@types/react": "16.9.19",
23
23
  "@types/react-dom": "16.9.5",
24
24
  "typescript": "4.6.3",
25
- "babylonjs": "5.9.0",
26
- "babylonjs-gui": "5.9.0",
27
- "babylonjs-inspector": "5.9.0",
28
- "babylonjs-loaders": "5.9.0",
29
- "babylonjs-materials": "5.9.0",
30
- "babylonjs-node-editor": "5.9.0",
31
- "babylonjs-post-process": "5.9.0",
32
- "babylonjs-procedural-textures": "5.9.0",
33
- "babylonjs-serializers": "5.9.0",
25
+ "babylonjs": "5.19.0",
26
+ "babylonjs-gui": "5.19.0",
27
+ "babylonjs-inspector": "5.19.0",
28
+ "babylonjs-loaders": "5.19.0",
29
+ "babylonjs-materials": "5.19.0",
30
+ "babylonjs-node-editor": "5.19.0",
31
+ "babylonjs-post-process": "5.19.0",
32
+ "babylonjs-procedural-textures": "5.19.0",
33
+ "babylonjs-serializers": "5.19.0",
34
34
  "@blueprintjs/core": "3.28.1",
35
35
  "@blueprintjs/select": "3.13.2",
36
36
  "react": "16.12.0",