@babylonjs/inspector 8.27.2 → 8.28.1-preview

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/lib/index.d.ts ADDED
@@ -0,0 +1,193 @@
1
+ import { IInspectorOptions } from '@babylonjs/core/Debug/debugLayer.js';
2
+ import { Scene } from '@babylonjs/core/scene.js';
3
+ import { IDisposable } from '@babylonjs/core/index.js';
4
+
5
+ declare const Contract: unique symbol;
6
+ /**
7
+ * This interface must be implemented by all service contracts.
8
+ */
9
+ interface IService<ContractIdentity extends symbol> {
10
+ /**
11
+ * @internal
12
+ */
13
+ readonly [Contract]?: ContractIdentity;
14
+ }
15
+ type ExtractContractIdentity<ServiceContract extends IService<symbol>> = ServiceContract extends IService<infer ContractIdentity> ? ContractIdentity : never;
16
+ type ExtractContractIdentities<ServiceContracts extends IService<symbol>[]> = {
17
+ [Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
18
+ };
19
+ type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
20
+ type MaybePromise<T> = T | Promise<T>;
21
+ /**
22
+ * A factory function responsible for creating a service instance.
23
+ * Consumed services are passed as arguments to the factory function.
24
+ * The returned value must implement all produced services, and may IDisposable.
25
+ * If not services are produced, the returned value may implement IDisposable, otherwise it may return void.
26
+ */
27
+ type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes, abortSignal?: AbortSignal]) => MaybePromise<Produces extends [] ? Partial<IDisposable> | void : Partial<IDisposable> & UnionToIntersection<Produces[number]>>;
28
+ /**
29
+ * Defines a service, which is a logical unit that consumes other services (dependencies), and optionally produces services that can be consumed by other services (dependents).
30
+ */
31
+ type ServiceDefinition<Produces extends IService<symbol>[] = [], Consumes extends IService<symbol>[] = []> = {
32
+ /**
33
+ * A human readable name for the service to help with debugging.
34
+ */
35
+ friendlyName: string;
36
+ /**
37
+ * A function that instantiates the service.
38
+ */
39
+ factory: ServiceFactory<Produces, Consumes>;
40
+ } & (Produces extends [] ? {
41
+ /**
42
+ * An empty list or undefined, since the type specification has indicated no contracts are produced.
43
+ */
44
+ produces?: [];
45
+ } : {
46
+ /**
47
+ * The list of contract identities that this service produces for consumption by other services.
48
+ */
49
+ produces: ExtractContractIdentities<Produces>;
50
+ }) & (Consumes extends [] ? {
51
+ /**
52
+ * An empty list or undefined, since the type specification has indicated that no other services are consumed.
53
+ */
54
+ consumes?: [];
55
+ } : {
56
+ /**
57
+ * The list of contract identities of other services that this service consumes.
58
+ */
59
+ consumes: ExtractContractIdentities<Consumes>;
60
+ });
61
+
62
+ type WeaklyTypedServiceDefinition = Omit<ServiceDefinition<IService<symbol>[] | [], IService<symbol>[] | []>, "factory"> & {
63
+ /**
64
+ * A factory function responsible for creating a service instance.
65
+ */
66
+ factory: (...args: any) => ReturnType<ServiceDefinition<IService<symbol>[] | [], IService<symbol>[] | []>["factory"]>;
67
+ };
68
+
69
+ type ExtensionMetadata = {
70
+ /**
71
+ * The name of the extension.
72
+ */
73
+ readonly name: string;
74
+ /**
75
+ * The description of the extension.
76
+ */
77
+ readonly description: string;
78
+ /**
79
+ * The keywords of the extension.
80
+ */
81
+ readonly keywords: readonly string[];
82
+ };
83
+ type ExtensionModule = {
84
+ /**
85
+ * The default export of the module (e.g. export default).
86
+ */
87
+ default: {
88
+ /**
89
+ * The services that are included with the extension.
90
+ */
91
+ serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];
92
+ };
93
+ };
94
+ /**
95
+ * Represents a query to fetch subset ranges of extension metadata from a feed.
96
+ */
97
+ interface IExtensionMetadataQuery {
98
+ /**
99
+ * The total number of extensions that satisfy the query.
100
+ */
101
+ readonly totalCount: number;
102
+ /**
103
+ * Fetches a range of extension metadata from the feed.
104
+ * @param index The index of the first extension to fetch.
105
+ * @param count The number of extensions to fetch.
106
+ * @returns A promise that resolves to the extension metadata.
107
+ */
108
+ getExtensionMetadataAsync(index: number, count: number): Promise<readonly ExtensionMetadata[]>;
109
+ }
110
+ /**
111
+ * Represents a feed/source of extensions.
112
+ */
113
+ interface IExtensionFeed {
114
+ /**
115
+ * The name of the feed.
116
+ */
117
+ readonly name: string;
118
+ /**
119
+ * Creates an extension metadata query given a filter.
120
+ * @param filter The filter to apply to the query.
121
+ * @returns A promise that resolves to the extension metadata query.
122
+ */
123
+ queryExtensionsAsync(filter?: string): Promise<IExtensionMetadataQuery>;
124
+ /**
125
+ * Gets the extension module for the specified extension.
126
+ * @param name The name of the extension.
127
+ * @returns A promise that resolves to the extension module.
128
+ */
129
+ getExtensionModuleAsync(name: string): Promise<ExtensionModule | undefined>;
130
+ }
131
+
132
+ type ToolbarMode = "full" | "compact";
133
+ /**
134
+ * Options for configuring the shell service.
135
+ */
136
+ type ShellServiceOptions = {
137
+ /**
138
+ * The default width of the left side pane.
139
+ */
140
+ leftPaneDefaultWidth?: number;
141
+ /**
142
+ * The minimum width of the left side pane.
143
+ */
144
+ leftPaneMinWidth?: number;
145
+ /**
146
+ * The default width of the right side pane.
147
+ */
148
+ rightPaneDefaultWidth?: number;
149
+ /**
150
+ * The minimum width of the right side pane.
151
+ */
152
+ rightPaneMinWidth?: number;
153
+ /**
154
+ * The mode of the toolbars.
155
+ * Can be either "full" (default) or "compact".
156
+ * In "full" mode, toolbars are displayed above and below the side panes.
157
+ * In "compact" mode, toolbars are displayed at the top and bottom of the left and right side panes.
158
+ */
159
+ toolbarMode?: ToolbarMode;
160
+ };
161
+
162
+ type ModularToolOptions = {
163
+ /**
164
+ * The container element where the tool will be rendered.
165
+ */
166
+ containerElement: HTMLElement;
167
+ /**
168
+ * The service definitions to be registered with the tool.
169
+ */
170
+ serviceDefinitions: readonly WeaklyTypedServiceDefinition[];
171
+ /**
172
+ * Whether the tool should allow user selection of the theme (e.g. dark/light/system).
173
+ */
174
+ isThemeable?: boolean;
175
+ /**
176
+ * The extension feeds that provide optional extensions the user can install.
177
+ */
178
+ extensionFeeds?: readonly IExtensionFeed[];
179
+ } & ShellServiceOptions;
180
+
181
+ type InspectorV2Options = Pick<ModularToolOptions, "serviceDefinitions" | "isThemeable"> & {
182
+ isExtensible?: boolean;
183
+ };
184
+ declare function IsInspectorVisible(): boolean;
185
+ declare function ShowInspector(scene: Scene, options?: Partial<IInspectorOptions & InspectorV2Options>): void;
186
+ declare function HideInspector(): void;
187
+ declare class Inspector {
188
+ static get IsVisible(): boolean;
189
+ static Show(scene: Scene, userOptions: Partial<IInspectorOptions>): void;
190
+ static Hide(): void;
191
+ }
192
+
193
+ export { HideInspector, Inspector, IsInspectorVisible, ShowInspector };
package/lib/index.js ADDED
@@ -0,0 +1,102 @@
1
+ export { H as HideInspector, e as Inspector, I as IsInspectorVisible, d as ShowInspector } from './index-BTnAB6ls.js';
2
+ import 'react/jsx-runtime';
3
+ import '@fluentui/react-components';
4
+ import '@babylonjs/core/Engines/engineStore.js';
5
+ import '@babylonjs/core/Misc/observable.js';
6
+ import 'react';
7
+ import '@fluentui/react-icons';
8
+ import 'react-dom/client';
9
+ import 'usehooks-ts';
10
+ import '@babylonjs/core/Misc/logger.js';
11
+ import '@babylonjs/core/Misc/deferred.js';
12
+ import '@babylonjs/core/Misc/asyncLock.js';
13
+ import '@fluentui/react-motion-components-preview';
14
+ import '@babylonjs/core/FrameGraph/frameGraphUtils.js';
15
+ import '@babylonjs/core/Gizmos/cameraGizmo.js';
16
+ import '@babylonjs/core/Gizmos/lightGizmo.js';
17
+ import '@babylonjs/core/Rendering/utilityLayerRenderer.js';
18
+ import '@babylonjs/core/Bones/bone.js';
19
+ import '@babylonjs/core/Cameras/camera.js';
20
+ import '@babylonjs/core/Gizmos/gizmoManager.js';
21
+ import '@babylonjs/core/Lights/light.js';
22
+ import '@babylonjs/core/Meshes/abstractMesh.js';
23
+ import '@babylonjs/core/node.js';
24
+ import '@babylonjs/core/Maths/math.color.js';
25
+ import '@babylonjs/core/Maths/math.vector.js';
26
+ import '@babylonjs/addons/msdfText/fontAsset.js';
27
+ import '@babylonjs/addons/msdfText/textRenderer.js';
28
+ import '@babylonjs/core/Debug/physicsViewer.js';
29
+ import '@babylonjs/core/Materials/Textures/texture.js';
30
+ import '@babylonjs/core/Materials/materialFlags.js';
31
+ import '@babylonjs/core/Materials/standardMaterial.js';
32
+ import '@babylonjs/core/Meshes/Builders/groundBuilder.js';
33
+ import '@babylonjs/core/Misc/tools.js';
34
+ import '@babylonjs/materials/grid/gridMaterial.js';
35
+ import '@babylonjs/core/Misc/typeStore.js';
36
+ import '@babylonjs/core/Animations/animationGroup.js';
37
+ import '@babylonjs/core/Animations/animationPropertiesOverride.js';
38
+ import '@babylonjs/core/Cameras/arcRotateCamera.js';
39
+ import '@babylonjs/core/Cameras/followCamera.js';
40
+ import '@babylonjs/core/Cameras/freeCamera.js';
41
+ import '@babylonjs/core/Cameras/targetCamera.js';
42
+ import '@babylonjs/core/scene.js';
43
+ import '@babylonjs/core/FrameGraph/frameGraph.js';
44
+ import '@babylonjs/core/Lights/directionalLight.js';
45
+ import '@babylonjs/core/Lights/hemisphericLight.js';
46
+ import '@babylonjs/core/Lights/pointLight.js';
47
+ import '@babylonjs/core/Lights/rectAreaLight.js';
48
+ import '@babylonjs/core/Lights/shadowLight.js';
49
+ import '@babylonjs/core/Lights/spotLight.js';
50
+ import '@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js';
51
+ import '@babylonjs/core/Lights/Shadows/shadowGenerator.js';
52
+ import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js';
53
+ import '@babylonjs/core/Materials/material.js';
54
+ import '@babylonjs/core/Materials/multiMaterial.js';
55
+ import '@babylonjs/core/Materials/PBR/pbrBaseMaterial.js';
56
+ import '@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js';
57
+ import '@babylonjs/core/Materials/PBR/pbrMaterial.js';
58
+ import '@babylonjs/materials/sky/skyMaterial.js';
59
+ import '@babylonjs/core/Engines/engine.js';
60
+ import '@babylonjs/core/Engines/constants.js';
61
+ import '@babylonjs/core/Particles/particleSystem.js';
62
+ import '@babylonjs/core/Misc/fileTools.js';
63
+ import '@babylonjs/core/Meshes/mesh.js';
64
+ import '@babylonjs/core/Debug/skeletonViewer.js';
65
+ import '@babylonjs/core/Meshes/buffer.js';
66
+ import '@babylonjs/core/Meshes/Builders/linesBuilder.js';
67
+ import '@babylonjs/core/Meshes/instancedMesh.js';
68
+ import '@babylonjs/core/Rendering/renderingManager.js';
69
+ import '@babylonjs/core/Rendering/edgesRenderer.js';
70
+ import '@babylonjs/core/Rendering/outlineRenderer.js';
71
+ import '@babylonjs/core/Misc/gradients.js';
72
+ import '@babylonjs/core/Materials/Node/Blocks/gradientBlock.js';
73
+ import '@babylonjs/core/Particles/attractor.js';
74
+ import '@babylonjs/core/Meshes/Builders/sphereBuilder.js';
75
+ import '@babylonjs/core/Meshes/transformNode.js';
76
+ import '@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js';
77
+ import '@babylonjs/core/Physics/v2/physicsEngineComponent.js';
78
+ import '@babylonjs/core/PostProcesses/postProcess.js';
79
+ import '@babylonjs/core/Materials/Textures/cubeTexture.js';
80
+ import '@babylonjs/core/Materials/imageProcessingConfiguration.js';
81
+ import '@babylonjs/core/Bones/skeleton.js';
82
+ import '@babylonjs/core/Sprites/sprite.js';
83
+ import '@babylonjs/core/Materials/Textures/baseTexture.js';
84
+ import '@babylonjs/core/Materials/Textures/multiRenderTarget.js';
85
+ import '@babylonjs/core/Materials/Textures/renderTargetTexture.js';
86
+ import '@babylonjs/core/Materials/Textures/thinTexture.js';
87
+ import '@fluentui-contrib/react-virtualizer';
88
+ import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js';
89
+ import '@babylonjs/core/Sprites/spriteSceneComponent.js';
90
+ import '@babylonjs/core/Materials/Textures/dynamicTexture.js';
91
+ import '@babylonjs/core/Misc/dataStorage.js';
92
+ import '@babylonjs/core/Instrumentation/engineInstrumentation.js';
93
+ import '@babylonjs/core/Instrumentation/sceneInstrumentation.js';
94
+ import '@babylonjs/core/Engines/AbstractEngine/abstractEngine.timeQuery.js';
95
+ import '@babylonjs/core/Engines/Extensions/engine.query.js';
96
+ import '@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js';
97
+ import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js';
98
+ import '@babylonjs/core/Misc/pressureObserverWrapper.js';
99
+ import '@babylonjs/core/Engines/abstractEngine.js';
100
+ import '@babylonjs/core/Events/pointerEvents.js';
101
+ import '@babylonjs/addons/atmosphere/atmosphere.js';
102
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,59 +1,43 @@
1
1
  {
2
2
  "name": "@babylonjs/inspector",
3
- "version": "8.27.2",
4
- "module": "dist/babylon.inspector.bundle.js",
5
- "main": "dist/babylon.inspector.bundle.js",
6
- "esnext": "dist/babylon.inspector.bundle.js",
7
- "typings": "dist/babylon.inspector.module.d.ts",
3
+ "version": "8.28.1-preview",
4
+ "type": "module",
5
+ "main": "lib/index.js",
6
+ "module": "lib/index.js",
7
+ "esnext": "lib/index.js",
8
+ "types": "lib/index.d.ts",
8
9
  "files": [
9
- "dist/**/*.*",
10
+ "lib/**/*.js",
11
+ "lib/**/*.d.ts",
12
+ "lib/**/*.map",
10
13
  "readme.md",
11
14
  "license.md"
12
15
  ],
13
- "scripts": {
14
- "build": "npm run clean && npm run build:prod && npm run build:declaration",
15
- "build:dev": "webpack --env development",
16
- "build:prod": "webpack --env production",
17
- "build:declaration": "build-tools -c pud --config ./config.json",
18
- "clean": "rimraf dist"
19
- },
20
- "dependencies": {
21
- "@fortawesome/fontawesome-svg-core": "^6.1.0",
22
- "@fortawesome/free-regular-svg-icons": "^6.0.0",
23
- "@fortawesome/free-solid-svg-icons": "^6.0.0"
24
- },
25
16
  "peerDependencies": {
26
17
  "@babylonjs/addons": "^8.0.0",
27
18
  "@babylonjs/core": "^8.0.0",
28
19
  "@babylonjs/gui": "^8.0.0",
29
- "@babylonjs/gui-editor": "^8.0.0",
30
20
  "@babylonjs/loaders": "^8.0.0",
31
21
  "@babylonjs/materials": "^8.0.0",
32
22
  "@babylonjs/serializers": "^8.0.0",
33
- "@types/react": ">=16.7.3",
34
- "@types/react-dom": ">=16.0.9"
35
- },
36
- "devDependencies": {
37
- "@babylonjs/addons": "^8.27.2",
38
- "@babylonjs/core": "^8.27.2",
39
- "@babylonjs/gui": "^8.27.2",
40
- "@babylonjs/gui-editor": "^8.27.2",
41
- "@babylonjs/loaders": "^8.27.2",
42
- "@babylonjs/materials": "^8.27.2",
43
- "@babylonjs/serializers": "^8.27.2",
44
- "@lts/gui": "1.0.0",
23
+ "@fluentui-contrib/react-virtualizer": "^0.1.0",
24
+ "@fluentui/react-components": "^9.62.0",
25
+ "@fluentui/react-icons": "^2.0.271",
45
26
  "react": "^18.2.0",
46
- "react-dom": "^18.2.0"
27
+ "react-dom": "^18.2.0",
28
+ "usehooks-ts": "^3.1.1"
47
29
  },
48
30
  "keywords": [
49
31
  "3D",
50
32
  "javascript",
51
33
  "html5",
52
34
  "webgl",
53
- "babylon.js"
35
+ "babylon.js",
36
+ "inspector",
37
+ "diagnostic",
38
+ "debug"
54
39
  ],
55
40
  "license": "Apache-2.0",
56
- "sideEffects": true,
57
41
  "homepage": "https://www.babylonjs.com",
58
42
  "repository": {
59
43
  "type": "git",
@@ -62,4 +46,4 @@
62
46
  "bugs": {
63
47
  "url": "https://github.com/BabylonJS/Babylon.js/issues"
64
48
  }
65
- }
49
+ }
package/readme.md CHANGED
@@ -1,26 +1,23 @@
1
- # Babylon.js inspector module
1
+ # BabylonJS Inspector
2
2
 
3
- For usage documentation please visit https://doc.babylonjs.com/how_to/debug_layer.
3
+ The Babylon Inspector is a diagnostic tool that makes it possible to view and edit the scene graph, properties of entities within the scene, and more.
4
4
 
5
- # Installation instructions
5
+ Documentation and samples coming soon!
6
6
 
7
- To install using npm :
7
+ ## Installation
8
8
 
9
- ```shell
10
- npm install @babylonjs/core @babylonjs/inspector
11
- ```
12
-
13
- # How to use
14
-
15
- Afterwards it can be imported to your project using:
9
+ Install the package using npm:
16
10
 
17
- ```javascript
18
- import "@babylonjs/core/Debug/debugLayer";
19
- import "@babylonjs/inspector";
11
+ ```bash
12
+ npm install @babylonjs/inspector@preview
20
13
  ```
21
14
 
22
- The first line will ensure you can access the property debugLayer of the scene while the second will ensure the inspector can be used within your scene.
15
+ The simplest way to use the `Inspector` is to call the `ShowInspector` function, passing in your scene:
23
16
 
24
- This is a great example where code splitting or conditional loading could be used to ensure you are not delivering the inspector if not part of your final app.
17
+ ```ts
18
+ import { ShowInspector } from "@babylonjs/inspector";
25
19
 
26
- For more information you can have a look at our [ES6 dedicated documentation](https://doc.babylonjs.com/features/es6_support).
20
+ // Your code that sets up a Babylon.js scene
21
+
22
+ ShowInspector(scene);
23
+ ```