@babylonjs/inspector 9.24.0 → 9.26.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/bin/inspector-bridge.mjs +3 -1
- package/bin/inspector-cli.mjs +3 -1
- package/lib/components/explorer/explorer.d.ts +40 -0
- package/lib/components/{scene/sceneExplorerDragDrop.d.ts → explorer/explorerDragDrop.d.ts} +8 -8
- package/lib/components/explorer/explorerModel.d.ts +359 -0
- package/lib/components/properties/boundProperty.d.ts +15 -0
- package/lib/components/scene/sceneExplorer.d.ts +10 -124
- package/lib/contexts/watcherContext.d.ts +11 -0
- package/lib/{extensionsListService-CKrN2x5A.js → extensionsListService-DVpZa3gV.js} +14 -14
- package/lib/{extensionsListService-CKrN2x5A.js.map → extensionsListService-DVpZa3gV.js.map} +1 -1
- package/lib/hooks/pollingHooks.d.ts +3 -0
- package/lib/{index-CgagLRQT.js → index-C5ggNiyY.js} +24160 -23545
- package/lib/index-C5ggNiyY.js.map +1 -0
- package/lib/index.common.d.ts +88 -0
- package/lib/index.d.ts +2 -87
- package/lib/index.js +15 -15
- package/lib/inspector.common.d.ts +38 -0
- package/lib/inspector.d.ts +3 -39
- package/lib/inspectorHost.d.ts +26 -0
- package/lib/lite/engineContext.d.ts +20 -0
- package/lib/lite/engineExplorerService.d.ts +75 -0
- package/lib/lite/engineSelectionService.d.ts +11 -0
- package/lib/lite/explorerDisplayInfo.d.ts +12 -0
- package/lib/lite/extensionsListService-xgITNk9y.js +216 -0
- package/lib/lite/extensionsListService-xgITNk9y.js.map +1 -0
- package/lib/lite/index-DmQN3QdU.js +8518 -0
- package/lib/lite/index-DmQN3QdU.js.map +1 -0
- package/lib/lite/index.d.ts +6 -0
- package/lib/lite/index.js +21 -0
- package/lib/lite/index.js.map +1 -0
- package/lib/lite/inspector.d.ts +9 -0
- package/lib/lite/services/panes/properties/enginePropertiesService.d.ts +4 -0
- package/lib/lite/services/panes/properties/materialPropertiesService.d.ts +3 -0
- package/lib/lite/services/panes/properties/meshPropertiesService.d.ts +3 -0
- package/lib/lite/services/panes/properties/renderingContextPropertiesService.d.ts +4 -0
- package/lib/lite/services/panes/properties/textLayerPropertiesService.d.ts +4 -0
- package/lib/lite/services/panes/properties/texturePropertiesService.d.ts +3 -0
- package/lib/lite/services/panes/scene/materialExplorerService.d.ts +4 -0
- package/lib/lite/services/panes/scene/meshExplorerService.d.ts +4 -0
- package/lib/lite/services/panes/scene/sceneExplorerSection.d.ts +21 -0
- package/lib/lite/services/panes/scene/sceneResources.d.ts +13 -0
- package/lib/lite/services/panes/scene/textLayerExplorerService.d.ts +3 -0
- package/lib/lite/services/panes/scene/textureExplorerService.d.ts +3 -0
- package/lib/{quickCreateToolsService-C-GqDTqc.js → quickCreateToolsService-0rVa_CjZ.js} +14 -14
- package/lib/{quickCreateToolsService-C-GqDTqc.js.map → quickCreateToolsService-0rVa_CjZ.js.map} +1 -1
- package/lib/{reflectorService-CPunL_Qs.js → reflectorService-pyDncbYA.js} +16 -16
- package/lib/{reflectorService-CPunL_Qs.js.map → reflectorService-pyDncbYA.js.map} +1 -1
- package/lib/services/panes/explorer/explorerPane.d.ts +79 -0
- package/lib/services/panes/explorer/explorerService.d.ts +80 -0
- package/lib/services/panes/scene/sceneExplorerService.d.ts +7 -2
- package/lib/services/sceneSelectionService.d.ts +11 -0
- package/lib/services/selectionService.d.ts +5 -2
- package/lib/services/watcherService.d.ts +46 -3
- package/package.json +12 -1
- package/readme.md +10 -0
- package/lib/index-CgagLRQT.js.map +0 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { T as TextInputPropertyLine, N as NumberInputPropertyLine, j as ButtonLine, k as ToolsServiceIdentity } from './index-
|
|
2
|
+
import { T as TextInputPropertyLine, N as NumberInputPropertyLine, j as ButtonLine, k as ToolsServiceIdentity } from './index-C5ggNiyY.js';
|
|
3
3
|
import { useState, useRef, useCallback } from 'react';
|
|
4
4
|
import { Reflector } from '@babylonjs/core/Misc/reflector.js';
|
|
5
5
|
import { PlugConnectedRegular } from '@fluentui/react-icons';
|
|
6
|
-
import '@fluentui/react-components';
|
|
7
|
-
import '@babylonjs/core/Maths/math.color.js';
|
|
8
|
-
import '@babylonjs/core/Maths/math.vector.js';
|
|
9
6
|
import '@babylonjs/core/Misc/observable.js';
|
|
10
|
-
import '@
|
|
7
|
+
import '@fluentui/react-components';
|
|
11
8
|
import '@babylonjs/core/Misc/dataStorage.js';
|
|
12
9
|
import '@babylonjs/core/Misc/logger.js';
|
|
13
|
-
import '@fluentui/react-motion-components-preview';
|
|
14
10
|
import '@babylonjs/core/Misc/asyncLock.js';
|
|
15
11
|
import '@babylonjs/core/Misc/deferred.js';
|
|
16
12
|
import '@fluentui-contrib/react-resize-handle';
|
|
17
|
-
import '@fluentui
|
|
13
|
+
import '@fluentui/react-motion-components-preview';
|
|
14
|
+
import '@babylonjs/core/Misc/typeStore.js';
|
|
15
|
+
import '@babylonjs/core/Maths/math.scalar.functions.js';
|
|
16
|
+
import 'react-dom/client';
|
|
17
|
+
import '@babylonjs/core/Maths/math.color.js';
|
|
18
|
+
import '@babylonjs/core/Maths/math.vector.js';
|
|
18
19
|
import '@babylonjs/core/Misc/uniqueIdGenerator.js';
|
|
20
|
+
import '@fluentui-contrib/react-virtualizer';
|
|
19
21
|
import '@babylonjs/addons/msdfText/fontAsset.js';
|
|
20
22
|
import '@babylonjs/addons/msdfText/textRenderer.js';
|
|
21
23
|
import '@babylonjs/core/Debug/physicsViewer.js';
|
|
@@ -36,7 +38,6 @@ import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.j
|
|
|
36
38
|
import '@babylonjs/core/Misc/pressureObserverWrapper.js';
|
|
37
39
|
import '@babylonjs/core/Maths/math.scalar.js';
|
|
38
40
|
import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollector.js';
|
|
39
|
-
import '@babylonjs/core/Maths/math.scalar.functions.js';
|
|
40
41
|
import '@babylonjs/core/Engines/abstractEngine.js';
|
|
41
42
|
import '@babylonjs/core/Bones/bone.js';
|
|
42
43
|
import '@babylonjs/core/Cameras/camera.js';
|
|
@@ -48,10 +49,14 @@ import '@babylonjs/core/Gizmos/spatialAudioGizmo.js';
|
|
|
48
49
|
import '@babylonjs/core/Lights/light.js';
|
|
49
50
|
import '@babylonjs/core/Meshes/abstractMesh.js';
|
|
50
51
|
import '@babylonjs/core/node.js';
|
|
51
|
-
import 'react-dom/client';
|
|
52
52
|
import '@babylonjs/core/Misc/screenshotTools.js';
|
|
53
53
|
import '@babylonjs/core/Layers/selectionOutlineLayer.js';
|
|
54
54
|
import '@babylonjs/core/Meshes/GaussianSplatting/gaussianSplattingMesh.js';
|
|
55
|
+
import '@babylonjs/core/SmartAssets/smartAssetManager.pure.js';
|
|
56
|
+
import '@babylonjs/core/Loading/Plugins/babylonFileLoader.js';
|
|
57
|
+
import '@babylonjs/core/Meshes/mesh.js';
|
|
58
|
+
import '@babylonjs/core/Misc/sceneSerializer.js';
|
|
59
|
+
import '@babylonjs/core/SmartAssets/smartAssetSerializer.js';
|
|
55
60
|
import '@babylonjs/core/Animations/animationGroup.js';
|
|
56
61
|
import '@babylonjs/core/Animations/animation.js';
|
|
57
62
|
import '@babylonjs/core/Animations/animationPropertiesOverride.js';
|
|
@@ -70,9 +75,9 @@ import '@babylonjs/core/Cameras/freeCamera.js';
|
|
|
70
75
|
import '@babylonjs/core/Cameras/geospatialCamera.js';
|
|
71
76
|
import '@babylonjs/core/Cameras/targetCamera.js';
|
|
72
77
|
import '@babylonjs/core/scene.js';
|
|
78
|
+
import '@babylonjs/core/FlowGraph/flowGraph.js';
|
|
73
79
|
import '@babylonjs/core/FrameGraph/frameGraph.js';
|
|
74
80
|
import '@babylonjs/core/FrameGraph/Node/nodeRenderGraph.js';
|
|
75
|
-
import '@babylonjs/core/FlowGraph/flowGraph.js';
|
|
76
81
|
import '@babylonjs/core/Lights/Clustered/clusteredLightContainer.js';
|
|
77
82
|
import '@babylonjs/core/Lights/directionalLight.js';
|
|
78
83
|
import '@babylonjs/core/Lights/hemisphericLight.js';
|
|
@@ -99,7 +104,6 @@ import '@babylonjs/core/Materials/PBR/pbrMaterial.js';
|
|
|
99
104
|
import '@babylonjs/core/Materials/Node/Blocks/gradientBlock.js';
|
|
100
105
|
import '@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.js';
|
|
101
106
|
import '@babylonjs/core/Misc/gradients.js';
|
|
102
|
-
import '@babylonjs/core/Meshes/mesh.js';
|
|
103
107
|
import '@babylonjs/core/Debug/skeletonViewer.js';
|
|
104
108
|
import '@babylonjs/core/Meshes/buffer.js';
|
|
105
109
|
import '@babylonjs/core/Meshes/Builders/linesBuilder.js';
|
|
@@ -151,7 +155,6 @@ import '@babylonjs/core/Materials/Textures/renderTargetTexture.js';
|
|
|
151
155
|
import '@babylonjs/core/Materials/Textures/thinTexture.js';
|
|
152
156
|
import '@babylonjs/core/AudioV2/abstractAudio/mainAudioBus.js';
|
|
153
157
|
import '@babylonjs/core/FlowGraph/flowGraphCoordinator.js';
|
|
154
|
-
import '@babylonjs/core/SmartAssets/smartAssetManager.pure.js';
|
|
155
158
|
import '@babylonjs/core/Rendering/boundingBoxRenderer.js';
|
|
156
159
|
import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js';
|
|
157
160
|
import '@babylonjs/core/Sprites/spriteSceneComponent.js';
|
|
@@ -159,10 +162,7 @@ import '@babylonjs/core/Materials/Textures/dynamicTexture.js';
|
|
|
159
162
|
import '@babylonjs/core/Misc/equirectangularCapture.js';
|
|
160
163
|
import '@babylonjs/core/Misc/sceneRecorder.js';
|
|
161
164
|
import '@babylonjs/core/Misc/videoRecorder.js';
|
|
162
|
-
import '@babylonjs/core/Misc/sceneSerializer.js';
|
|
163
165
|
import '@babylonjs/core/Misc/environmentTextureTools.js';
|
|
164
|
-
import '@babylonjs/core/Loading/Plugins/babylonFileLoader.js';
|
|
165
|
-
import '@babylonjs/core/SmartAssets/smartAssetSerializer.js';
|
|
166
166
|
import '@babylonjs/core/Loading/sceneLoader.js';
|
|
167
167
|
import '@babylonjs/core/Misc/filesInput.js';
|
|
168
168
|
import '@babylonjs/loaders/glTF/2.0/glTFLoaderExtensionRegistry.js';
|
|
@@ -209,4 +209,4 @@ var reflectorService = {
|
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
export { ReflectorServiceDefinition, reflectorService as default };
|
|
212
|
-
//# sourceMappingURL=reflectorService-
|
|
212
|
+
//# sourceMappingURL=reflectorService-pyDncbYA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflectorService-
|
|
1
|
+
{"version":3,"file":"reflectorService-pyDncbYA.js","sources":["../../../../../../../../dev/inspector-v2/src/components/tools/reflectorTools.tsx","../../../../../../../../dev/inspector-v2/src/services/panes/tools/reflectorService.tsx"],"sourcesContent":["import { ButtonLine } from \"shared-ui-components/fluent/hoc/buttonLine\";\r\nimport { useState, useCallback, useRef, type FunctionComponent } from \"react\";\r\nimport { type Scene } from \"core/scene\";\r\nimport { TextInputPropertyLine, NumberInputPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/inputPropertyLine\";\r\nimport { Reflector } from \"core/Misc/reflector\";\r\nimport { PlugConnectedRegular } from \"@fluentui/react-icons\";\r\n\r\nexport const ReflectorTools: FunctionComponent<{ scene: Scene }> = ({ scene }) => {\r\n const [hostname, setHostname] = useState(\"localhost\");\r\n const [port, setPort] = useState(1234);\r\n const reflectorRef = useRef<Reflector | null>(null);\r\n\r\n const connectReflector = useCallback(() => {\r\n if (reflectorRef.current) {\r\n reflectorRef.current.close();\r\n }\r\n\r\n reflectorRef.current = new Reflector(scene, hostname, port);\r\n }, [scene, hostname, port]);\r\n\r\n return (\r\n <>\r\n <TextInputPropertyLine label=\"Hostname\" value={hostname} onChange={(value) => setHostname(value)} />\r\n <NumberInputPropertyLine label=\"Port\" value={port} onChange={(value) => setPort(value)} forceInt />\r\n <ButtonLine label=\"Connect\" icon={PlugConnectedRegular} onClick={connectReflector} />\r\n </>\r\n );\r\n};\r\n","import { type ServiceDefinition } from \"shared-ui-components/modularTool/modularity/serviceDefinition\";\r\nimport { ToolsServiceIdentity, type IToolsService } from \"../toolsService\";\r\nimport { type IDisposable } from \"core/scene\";\r\nimport { ReflectorTools } from \"../../../components/tools/reflectorTools\";\r\n\r\nexport const ReflectorServiceDefinition: ServiceDefinition<[], [IToolsService]> = {\r\n friendlyName: \"Reflector Tools\",\r\n consumes: [ToolsServiceIdentity],\r\n factory: (toolsService) => {\r\n const contentRegistrations: IDisposable[] = [];\r\n\r\n // Reflector content\r\n contentRegistrations.push(\r\n toolsService.addSectionContent({\r\n key: \"Reflector\",\r\n section: \"Reflector\",\r\n component: ({ context }) => <ReflectorTools scene={context} />,\r\n })\r\n );\r\n\r\n return {\r\n dispose: () => {\r\n contentRegistrations.forEach((registration) => registration.dispose());\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n serviceDefinitions: [ReflectorServiceDefinition],\r\n} as const;\r\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,cAAc,GAAwC,CAAC,EAAE,KAAK,EAAE,KAAI;IAC7E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;IACrD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;AACtC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAmB,IAAI,CAAC;AAEnD,IAAA,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAK;AACtC,QAAA,IAAI,YAAY,CAAC,OAAO,EAAE;AACtB,YAAA,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QAChC;AAEA,QAAA,YAAY,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC;IAC/D,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AAE3B,IAAA,QACIA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GAAA,CAAC,qBAAqB,IAAC,KAAK,EAAC,UAAU,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,KAAK,CAAC,EAAA,CAAI,EACpGA,GAAA,CAAC,uBAAuB,EAAA,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAA,IAAA,EAAA,CAAG,EACnGA,GAAA,CAAC,UAAU,EAAA,EAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,gBAAgB,EAAA,CAAI,CAAA,EAAA,CACtF;AAEX,CAAC;;ACtBM,MAAM,0BAA0B,GAA2C;AAC9E,IAAA,YAAY,EAAE,iBAAiB;IAC/B,QAAQ,EAAE,CAAC,oBAAoB,CAAC;AAChC,IAAA,OAAO,EAAE,CAAC,YAAY,KAAI;QACtB,MAAM,oBAAoB,GAAkB,EAAE;;AAG9C,QAAA,oBAAoB,CAAC,IAAI,CACrB,YAAY,CAAC,iBAAiB,CAAC;AAC3B,YAAA,GAAG,EAAE,WAAW;AAChB,YAAA,OAAO,EAAE,WAAW;AACpB,YAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAKA,GAAA,CAAC,cAAc,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,CAAI;AACjE,SAAA,CAAC,CACL;QAED,OAAO;YACH,OAAO,EAAE,MAAK;AACV,gBAAA,oBAAoB,CAAC,OAAO,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1E,CAAC;SACJ;IACL,CAAC;;AAGL,uBAAe;IACX,kBAAkB,EAAE,CAAC,0BAA0B,CAAC;CAC1C;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type IDisposable, type IReadonlyObservable, type Nullable } from "@babylonjs/core/index.js";
|
|
2
|
+
import { type ComponentType } from "react";
|
|
3
|
+
import { type ExplorerCommandProvider, type ExplorerNodeDescription } from "../../../components/explorer/explorerModel";
|
|
4
|
+
import { type ExplorerNodeProvider } from "./explorerService";
|
|
5
|
+
import { type ISelectionService } from "../../selectionService";
|
|
6
|
+
import { type IShellService } from "@babylonjs/shared-ui-components/modularTool/services/shellService.js";
|
|
7
|
+
import { type IReadonlyObservableCollection } from "@babylonjs/shared-ui-components/modularTool/misc/observableCollection.js";
|
|
8
|
+
/**
|
|
9
|
+
* Describes an Explorer side pane, including the services it needs and the hierarchy it displays.
|
|
10
|
+
*
|
|
11
|
+
* This is intentionally not a service: products (such as the Full/BJS Inspector's Scene Explorer or the
|
|
12
|
+
* Babylon Lite engine explorer) own their pane directly and use this to share the common pane plumbing.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export type ExplorerPaneOptions = Readonly<{
|
|
16
|
+
/**
|
|
17
|
+
* The unique key of the side pane.
|
|
18
|
+
*/
|
|
19
|
+
key: string;
|
|
20
|
+
/**
|
|
21
|
+
* The title displayed on the side pane.
|
|
22
|
+
*/
|
|
23
|
+
title: string;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the root object of the hierarchy (e.g. a Scene for the Full Inspector, or an engine for
|
|
26
|
+
* the Babylon Lite Inspector). It is displayed as the root node, and nothing is rendered while
|
|
27
|
+
* it is null. This is re-evaluated whenever `onRootChanged` notifies.
|
|
28
|
+
*/
|
|
29
|
+
getRoot: () => Nullable<object>;
|
|
30
|
+
/**
|
|
31
|
+
* The name displayed for the root node (e.g. "Scene" or "Engine").
|
|
32
|
+
*/
|
|
33
|
+
rootLabel: string;
|
|
34
|
+
/**
|
|
35
|
+
* An optional icon component to render for the root node.
|
|
36
|
+
*/
|
|
37
|
+
rootIcon?: ComponentType<{
|
|
38
|
+
entity: object;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* An optional observable that notifies when the object returned by `getRoot` changes. Products
|
|
42
|
+
* with a fixed root (such as the Babylon Lite Inspector, which inspects a single engine for the
|
|
43
|
+
* lifetime of the pane) can omit it.
|
|
44
|
+
*/
|
|
45
|
+
onRootChanged?: IReadonlyObservable<unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* Enumerates the top level nodes of the hierarchy (excluding the root node, which represents the
|
|
48
|
+
* object being inspected and is added automatically). This is re-invoked whenever the Explorer
|
|
49
|
+
* rebuilds its tree, so it should always reflect the current state.
|
|
50
|
+
*/
|
|
51
|
+
getNodes: () => readonly ExplorerNodeDescription[];
|
|
52
|
+
/**
|
|
53
|
+
* An optional observable that notifies when the set of nodes returned by `getNodes` changes
|
|
54
|
+
* (e.g. a new top level node was added). Changes within an already described node are
|
|
55
|
+
* communicated through that node's own change observables instead.
|
|
56
|
+
*/
|
|
57
|
+
onNodesChanged?: IReadonlyObservable<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Optional providers that contribute nodes beneath compatible entity-backed nodes.
|
|
60
|
+
*/
|
|
61
|
+
nodeProviders?: IReadonlyObservableCollection<ExplorerNodeProvider<object>>;
|
|
62
|
+
/**
|
|
63
|
+
* Optional command providers for nodes that represent an entity.
|
|
64
|
+
*/
|
|
65
|
+
itemCommandProviders?: IReadonlyObservableCollection<ExplorerCommandProvider<object>>;
|
|
66
|
+
/**
|
|
67
|
+
* Optional command providers for group nodes (the command context is the group's display name).
|
|
68
|
+
*/
|
|
69
|
+
groupCommandProviders?: IReadonlyObservableCollection<ExplorerCommandProvider<string, "contextMenu">>;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Registers an Explorer side pane that enables browsing a hierarchy and executing commands on its entities.
|
|
73
|
+
* @param shellService The shell service the pane is added to.
|
|
74
|
+
* @param selectionService The selection service used to read and update the selected entity.
|
|
75
|
+
* @param options Options describing the pane, its root object, and the hierarchy it displays.
|
|
76
|
+
* @returns A disposable that removes the pane.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare function CreateExplorerPaneRegistration(shellService: IShellService, selectionService: ISelectionService, options: ExplorerPaneOptions): IDisposable;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type IDisposable, type IReadonlyObservable } from "@babylonjs/core/index.js";
|
|
2
|
+
import { type ExplorerCommandProvider, type ExplorerNodeDescription } from "../../../components/explorer/explorerModel";
|
|
3
|
+
import { type IReadonlyObservableCollection } from "@babylonjs/shared-ui-components/modularTool/misc/observableCollection.js";
|
|
4
|
+
import { type IService } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceDefinition.js";
|
|
5
|
+
/**
|
|
6
|
+
* The unique identity symbol for the product-neutral Explorer service.
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export declare const ExplorerServiceIdentity: unique symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Contributes Explorer nodes beneath compatible entity-backed parent nodes.
|
|
12
|
+
*
|
|
13
|
+
* Providers return ordinary {@link ExplorerNodeDescription}s, so each contribution may contain arbitrary
|
|
14
|
+
* nested groups and items. Providers attach by parent entity rather than node id because structural groups
|
|
15
|
+
* are presentation details owned by product adapters.
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export type ExplorerNodeProvider<T extends object> = Readonly<{
|
|
19
|
+
/** Controls this provider's position relative to other providers attached to the same parent. */
|
|
20
|
+
order?: number;
|
|
21
|
+
/** Returns whether this provider supports the parent entity. */
|
|
22
|
+
predicate: (parent: unknown) => parent is T;
|
|
23
|
+
/** Gets the Explorer nodes contributed beneath the parent entity. */
|
|
24
|
+
getNodes: (parent: T) => readonly ExplorerNodeDescription[];
|
|
25
|
+
/** Optionally notifies when the nodes returned by this provider may have changed. */
|
|
26
|
+
onChanged?: IReadonlyObservable<unknown>;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Allows hierarchy and commands to be contributed to an Explorer without depending on a product-specific API.
|
|
30
|
+
*
|
|
31
|
+
* The item/group terminology intentionally matches `ExplorerNodeKind`. Product adapters may expose
|
|
32
|
+
* domain-specific aliases (such as entity/section), but a generic Explorer group is not necessarily a scene section.
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
export interface IExplorerService extends IService<typeof ExplorerServiceIdentity> {
|
|
36
|
+
/**
|
|
37
|
+
* Adds a provider that contributes nodes beneath compatible entity-backed Explorer nodes.
|
|
38
|
+
* @param provider The node provider to add.
|
|
39
|
+
* @returns A disposable that removes the node provider.
|
|
40
|
+
*/
|
|
41
|
+
addNodeProvider<T extends object>(provider: ExplorerNodeProvider<T>): IDisposable;
|
|
42
|
+
/**
|
|
43
|
+
* Adds a command that can be executed on Explorer item nodes.
|
|
44
|
+
* @param command The command provider to add.
|
|
45
|
+
* @returns A disposable that removes the command provider.
|
|
46
|
+
*/
|
|
47
|
+
addItemCommand<T extends object>(command: ExplorerCommandProvider<T>): IDisposable;
|
|
48
|
+
/**
|
|
49
|
+
* Adds a context-menu command that can be executed on Explorer group nodes.
|
|
50
|
+
* @param command The command provider to add.
|
|
51
|
+
* @returns A disposable that removes the command provider.
|
|
52
|
+
*/
|
|
53
|
+
addGroupCommand<T extends string>(command: ExplorerCommandProvider<T, "contextMenu">): IDisposable;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The shared Explorer service implementation and the command collections consumed by an Explorer pane.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export type ExplorerServiceState = IExplorerService & Readonly<{
|
|
60
|
+
nodeProviders: IReadonlyObservableCollection<ExplorerNodeProvider<object>>;
|
|
61
|
+
itemCommandProviders: IReadonlyObservableCollection<ExplorerCommandProvider<object>>;
|
|
62
|
+
groupCommandProviders: IReadonlyObservableCollection<ExplorerCommandProvider<string, "contextMenu">>;
|
|
63
|
+
dispose: () => void;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Creates the product-neutral Explorer contribution service.
|
|
67
|
+
* @returns The service implementation and its observable contribution collections.
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare function CreateExplorerService(): ExplorerServiceState;
|
|
71
|
+
/**
|
|
72
|
+
* Combines product-owned children with shared provider contributions and recursively enables contributions
|
|
73
|
+
* beneath every entity-backed descendant.
|
|
74
|
+
* @param parent The entity represented by the parent node, if any.
|
|
75
|
+
* @param children The children owned by the product adapter.
|
|
76
|
+
* @param providers The shared node providers registered with the Explorer.
|
|
77
|
+
* @returns The combined child node descriptions.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export declare function GetExplorerNodeChildren(parent: object | undefined, children: readonly ExplorerNodeDescription[], providers: readonly ExplorerNodeProvider<object>[]): readonly ExplorerNodeDescription[];
|
|
@@ -4,12 +4,16 @@ import { type IService, type ServiceDefinition } from "@babylonjs/shared-ui-comp
|
|
|
4
4
|
import { type ISceneContext } from "../../sceneContext";
|
|
5
5
|
import { type ISelectionService } from "../../selectionService";
|
|
6
6
|
import { type IShellService } from "@babylonjs/shared-ui-components/modularTool/services/shellService.js";
|
|
7
|
+
import { type IExplorerService } from "../explorer/explorerService";
|
|
7
8
|
/**
|
|
8
9
|
* The unique identity symbol for the scene explorer service.
|
|
9
10
|
*/
|
|
10
11
|
export declare const SceneExplorerServiceIdentity: unique symbol;
|
|
11
12
|
/**
|
|
12
13
|
* Allows new sections or commands to be added to the scene explorer pane.
|
|
14
|
+
*
|
|
15
|
+
* Entity and section commands are Full Inspector conveniences over the product-neutral item and group command APIs.
|
|
16
|
+
* They remain scene-specific so other Explorer products do not have to model their groups as scene sections.
|
|
13
17
|
*/
|
|
14
18
|
export interface ISceneExplorerService extends IService<typeof SceneExplorerServiceIdentity> {
|
|
15
19
|
/**
|
|
@@ -29,6 +33,7 @@ export interface ISceneExplorerService extends IService<typeof SceneExplorerServ
|
|
|
29
33
|
addSectionCommand<T extends string>(command: SceneExplorerCommandProvider<T, "contextMenu">): IDisposable;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
36
|
+
* Adapts the Babylon.js scene section/entity model onto the generic Explorer, and owns the "Scene Explorer"
|
|
37
|
+
* pane that enables browsing the scene graph and executing commands on entities.
|
|
33
38
|
*/
|
|
34
|
-
export declare const SceneExplorerServiceDefinition: ServiceDefinition<[ISceneExplorerService], [ISceneContext, IShellService, ISelectionService]>;
|
|
39
|
+
export declare const SceneExplorerServiceDefinition: ServiceDefinition<[ISceneExplorerService, IExplorerService], [ISceneContext, IShellService, ISelectionService]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ServiceDefinition } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceDefinition.js";
|
|
2
|
+
import { type ISceneContext } from "./sceneContext";
|
|
3
|
+
import { type ISelectionService } from "./selectionService";
|
|
4
|
+
/**
|
|
5
|
+
* Selects the scene by default when the Babylon.js Inspector starts.
|
|
6
|
+
*
|
|
7
|
+
* The selection service itself is product agnostic (it starts with no selection), so this Babylon.js
|
|
8
|
+
* specific service owns the notion of "the scene is what is selected when nothing else is". It does not
|
|
9
|
+
* produce a service contract: it only wires the scene context to the selection service at startup.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SceneSelectionServiceDefinition: ServiceDefinition<[], [ISceneContext, ISelectionService]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type IReadonlyObservable, type Nullable } from "@babylonjs/core/index.js";
|
|
2
2
|
import { type IService, type ServiceDefinition } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceDefinition.js";
|
|
3
3
|
import { type ISettingsService } from "@babylonjs/shared-ui-components/modularTool/services/settingsService.js";
|
|
4
|
-
import { type ISceneContext } from "./sceneContext";
|
|
5
4
|
import { type ISettingsStore } from "@babylonjs/shared-ui-components/modularTool/services/settingsStore.js";
|
|
6
5
|
import { type IShellService } from "@babylonjs/shared-ui-components/modularTool/services/shellService.js";
|
|
7
6
|
/**
|
|
@@ -21,4 +20,8 @@ export interface ISelectionService extends IService<typeof SelectionServiceIdent
|
|
|
21
20
|
*/
|
|
22
21
|
readonly onSelectedEntityChanged: IReadonlyObservable<void>;
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Tracks the currently selected entity. This service is product agnostic: it starts with no selection,
|
|
25
|
+
* and each product decides which entity (if any) is selected by default.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SelectionServiceDefinition: ServiceDefinition<[ISelectionService], [IShellService, ISettingsStore, ISettingsService]>;
|
|
@@ -4,6 +4,31 @@ import { type ISettingsService } from "@babylonjs/shared-ui-components/modularTo
|
|
|
4
4
|
import { type ISettingsStore } from "@babylonjs/shared-ui-components/modularTool/services/settingsStore.js";
|
|
5
5
|
import { type IShellService } from "@babylonjs/shared-ui-components/modularTool/services/shellService.js";
|
|
6
6
|
import { type IReactContextService } from "@babylonjs/shared-ui-components/modularTool/services/reactContextService.js";
|
|
7
|
+
type InterceptSettings = {
|
|
8
|
+
mode: "intercept";
|
|
9
|
+
};
|
|
10
|
+
type PollingSettings = {
|
|
11
|
+
mode: "polling";
|
|
12
|
+
interval: number;
|
|
13
|
+
};
|
|
14
|
+
type ManualSettings = {
|
|
15
|
+
mode: "manual";
|
|
16
|
+
};
|
|
17
|
+
type WatcherSettings = InterceptSettings | PollingSettings | ManualSettings;
|
|
18
|
+
type WatcherServiceOptions = {
|
|
19
|
+
/**
|
|
20
|
+
* The watcher settings used when no settings have been persisted.
|
|
21
|
+
*/
|
|
22
|
+
defaultSettings?: WatcherSettings;
|
|
23
|
+
/**
|
|
24
|
+
* The watcher modes supported by this Inspector target.
|
|
25
|
+
*/
|
|
26
|
+
supportedModes?: readonly WatcherSettings["mode"][];
|
|
27
|
+
/**
|
|
28
|
+
* The fallback interval for computed values when interception is the preferred mode.
|
|
29
|
+
*/
|
|
30
|
+
computedValuePollingInterval?: number;
|
|
31
|
+
};
|
|
7
32
|
/**
|
|
8
33
|
* The unique identity symbol for the watcher service.
|
|
9
34
|
*/
|
|
@@ -28,11 +53,29 @@ export interface IWatcherService extends IService<typeof WatcherServiceIdentity>
|
|
|
28
53
|
* @returns A disposable that stops watching when disposed.
|
|
29
54
|
*/
|
|
30
55
|
watchProperty<T extends object>(target: T, propertyKey: keyof T, onChanged: (value: unknown) => void): IDisposable;
|
|
56
|
+
/**
|
|
57
|
+
* Watches a computed value and calls the callback whenever it changes. Computed values use fallback
|
|
58
|
+
* polling when interception is preferred, the configured interval in polling mode, and explicit
|
|
59
|
+
* refreshes in manual mode.
|
|
60
|
+
* @param getValue A function that returns the current value.
|
|
61
|
+
* @param onChanged A callback that is called with the new value when it changes.
|
|
62
|
+
* @param equals An optional equality comparison. Defaults to {@link Object.is}.
|
|
63
|
+
* @returns A disposable that stops watching when disposed.
|
|
64
|
+
*/
|
|
65
|
+
watchValue<T>(getValue: () => T, onChanged: (value: T) => void, equals?: (left: T, right: T) => boolean): IDisposable;
|
|
31
66
|
/**
|
|
32
67
|
* Manually triggers a refresh of all watched properties.
|
|
33
68
|
*/
|
|
34
69
|
refresh(): void;
|
|
35
70
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Creates the watcher services for a specific Inspector target.
|
|
73
|
+
* @param options Options that control the default and supported watcher modes.
|
|
74
|
+
* @returns Service definitions for watching values, configuring the watcher, and manually refreshing it.
|
|
75
|
+
*/
|
|
76
|
+
export declare function MakeWatcherServiceDefinitions(options?: WatcherServiceOptions): {
|
|
77
|
+
readonly watcherServiceDefinition: ServiceDefinition<[IWatcherService], [ISettingsStore, IReactContextService]>;
|
|
78
|
+
readonly watcherSettingsServiceDefinition: ServiceDefinition<[], [ISettingsService]>;
|
|
79
|
+
readonly watcherRefreshToolbarServiceDefinition: ServiceDefinition<[], [IWatcherService, ISettingsStore, IShellService]>;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/inspector",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.26.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"esnext": "lib/index.js",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"types": "./lib/index.d.ts",
|
|
11
11
|
"default": "./lib/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./lite": {
|
|
14
|
+
"types": "./lib/lite/index.d.ts",
|
|
15
|
+
"default": "./lib/lite/index.js"
|
|
16
|
+
},
|
|
13
17
|
"./package.json": "./package.json"
|
|
14
18
|
},
|
|
15
19
|
"bin": {
|
|
@@ -36,6 +40,7 @@
|
|
|
36
40
|
"@babylonjs/core": "^9.0.0",
|
|
37
41
|
"@babylonjs/gui": "^9.0.0",
|
|
38
42
|
"@babylonjs/gui-editor": "^9.0.0",
|
|
43
|
+
"@babylonjs/lite": "^1.27.0",
|
|
39
44
|
"@babylonjs/loaders": "^9.0.0",
|
|
40
45
|
"@babylonjs/materials": "^9.0.0",
|
|
41
46
|
"@babylonjs/node-editor": "^9.0.0",
|
|
@@ -53,7 +58,13 @@
|
|
|
53
58
|
"react-dom": ">=16.14.0 <20.0.0",
|
|
54
59
|
"usehooks-ts": "^3.1.1"
|
|
55
60
|
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@babylonjs/lite": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
56
66
|
"devDependencies": {
|
|
67
|
+
"@babylonjs/lite": "1.27.0",
|
|
57
68
|
"@dev/build-tools": "^1.0.0",
|
|
58
69
|
"@dev/inspector": "1.0.0",
|
|
59
70
|
"@rollup/plugin-alias": "^5.1.0",
|
package/readme.md
CHANGED
|
@@ -22,6 +22,16 @@ import { ShowInspector } from "@babylonjs/inspector";
|
|
|
22
22
|
ShowInspector(scene);
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
### Babylon Lite
|
|
26
|
+
|
|
27
|
+
The initial Babylon Lite Inspector can display the surfaces and rendering contexts associated with an engine:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { ShowInspector } from "@babylonjs/inspector/lite";
|
|
31
|
+
|
|
32
|
+
ShowInspector(engine);
|
|
33
|
+
```
|
|
34
|
+
|
|
25
35
|
## Headless Inspectable (No UI)
|
|
26
36
|
|
|
27
37
|
You can make a scene inspectable for the CLI without showing the Inspector UI by calling `StartInspectable`:
|