@babylonjs/inspector 9.2.2 → 9.3.1

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 (26) hide show
  1. package/bin/inspector-bridge.mjs +29 -2
  2. package/bin/inspector-cli.mjs +17 -2
  3. package/lib/{extensionsListService-B_R2ChvJ.js → extensionsListService-DA8_rCpk.js} +2 -2
  4. package/lib/{extensionsListService-B_R2ChvJ.js.map → extensionsListService-DA8_rCpk.js.map} +1 -1
  5. package/lib/{index-DB_fpb1t.js → index-nEGqYbP2.js} +348 -293
  6. package/lib/index-nEGqYbP2.js.map +1 -0
  7. package/lib/index.d.ts +2 -2
  8. package/lib/index.js +1 -1
  9. package/lib/inspectable.d.ts +27 -10
  10. package/lib/inspector.d.ts +7 -2
  11. package/lib/{quickCreateToolsService-DaBqYmZw.js → quickCreateToolsService-_L22btR5.js} +2 -2
  12. package/lib/{quickCreateToolsService-DaBqYmZw.js.map → quickCreateToolsService-_L22btR5.js.map} +1 -1
  13. package/lib/{reflectorService-5IVRhqd-.js → reflectorService-BMLxtZT7.js} +2 -2
  14. package/lib/{reflectorService-5IVRhqd-.js.map → reflectorService-BMLxtZT7.js.map} +1 -1
  15. package/lib/services/cli/entityQueryService.d.ts +2 -2
  16. package/lib/services/cli/perfTraceCommandService.d.ts +2 -2
  17. package/lib/services/cli/screenshotCommandService.d.ts +2 -2
  18. package/lib/services/cli/shaderCommandService.d.ts +2 -2
  19. package/lib/services/cli/statsCommandService.d.ts +2 -2
  20. package/lib/services/cliConnectionStatusService.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/lib/cli/protocol.d.ts +0 -180
  23. package/lib/index-DB_fpb1t.js.map +0 -1
  24. package/lib/services/cli/cliConnectionStatus.d.ts +0 -25
  25. package/lib/services/cli/inspectableBridgeService.d.ts +0 -26
  26. package/lib/services/cli/inspectableCommandRegistry.d.ts +0 -58
package/lib/index.d.ts CHANGED
@@ -51,8 +51,8 @@ export { MakeModularTool } from "@babylonjs/shared-ui-components/modularTool/mod
51
51
  export type { WeaklyTypedServiceDefinition } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceContainer.js";
52
52
  export * from "./inspector";
53
53
  export { StartInspectable, type InspectableToken, type InspectableOptions } from "./inspectable";
54
- export type { IInspectableCommandRegistry, InspectableCommandDescriptor, InspectableCommandArg } from "./services/cli/inspectableCommandRegistry";
55
- export { InspectableCommandRegistryIdentity } from "./services/cli/inspectableCommandRegistry";
54
+ export { type IBridgeCommandRegistry, type BridgeCommandDescriptor, type BridgeCommandArg, type BridgeCommandArgType, BridgeCommandRegistryIdentity, } from "@babylonjs/shared-ui-components/modularTool/services/cli/bridgeCommandRegistry.js";
55
+ export { MakeModularBridge, type ModularBridgeToken, type ModularBridgeOptions } from "@babylonjs/shared-ui-components/modularTool/modularBridge.js";
56
56
  export { ConvertOptions, Inspector } from "./legacy/inspector";
57
57
  export { AttachDebugLayer, DetachDebugLayer } from "./legacy/debugLayer";
58
58
  export * from "@babylonjs/shared-ui-components/fluent/hooks/keyboardHooks.js";
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Accordion, i as AccordionSection, l as AccordionSectionItem, m as AttachDebugLayer, n as BooleanBadgePropertyLine, o as BoundProperty, p as BuiltInsExtensionFeed, B as Button, j as ButtonLine, q as Checkbox, C as CheckboxPropertyLine, r as ChildWindow, s as Collapse, t as Color3GradientComponent, v as Color3GradientList, w as Color3PropertyLine, x as Color4GradientComponent, y as Color4GradientList, z as Color4PropertyLine, D as ColorPickerPopup, E as ColorStepGradientComponent, F as ComboBox, G as ComboBoxPropertyLine, H as ConstructorFactory, I as ConvertOptions, J as DebugServiceIdentity, K as DetachDebugLayer, O as DraggableLine, Q as Dropdown, R as EntitySelector, U as ErrorBoundary, W as ExtensibleAccordion, X as FactorGradientComponent, Y as FactorGradientList, Z as FileUploadLine, _ as GetPropertyDescriptor, $ as GizmoServiceIdentity, a0 as HexPropertyLine, a1 as InfoLabel, a2 as InputHexField, a3 as InputHsvField, a4 as InspectableCommandRegistryIdentity, a5 as Inspector, a6 as InterceptFunction, a7 as InterceptProperty, a8 as IsPropertyReadonly, a9 as LineContainer, L as Link, aa as LinkPropertyLine, c as LinkToEntity, ab as LinkToEntityPropertyLine, ac as List, ad as MakeDialogTeachingMoment, ae as MakeLazyComponent, af as MakeModularTool, ag as MakePopoverTeachingMoment, ah as MakePropertyHook, ai as MakeTeachingMoment, aj as MaterialSelector, M as MessageBar, ak as NodeSelector, al as NumberDropdown, am as NumberDropdownPropertyLine, N as NumberInputPropertyLine, an as ObservableCollection, ao as Pane, ap as PlaceholderPropertyLine, P as Popover, aq as PositionedPopover, ar as PropertiesServiceIdentity, as as Property, at as PropertyContext, au as PropertyLine, av as QuaternionPropertyLine, aw as RotationVectorPropertyLine, f as SceneContextIdentity, ax as SceneExplorerServiceIdentity, ay as SearchBar, az as SearchBox, aA as SelectionServiceDefinition, g as SelectionServiceIdentity, aB as SettingsServiceIdentity, aC as SettingsStore, aD as SettingsStoreIdentity, S as ShellServiceIdentity, aE as ShowInspector, aF as SidePaneContainer, aG as SkeletonSelector, aH as Slider, aI as SpinButton, d as SpinButtonPropertyLine, aJ as StartInspectable, aK as StatsServiceIdentity, aL as StringDropdown, aM as StringDropdownPropertyLine, aN as StringifiedPropertyLine, aO as Switch, aP as SwitchPropertyLine, aQ as SyncedSliderInput, aR as SyncedSliderPropertyLine, aS as TeachingMoment, aT as TextAreaPropertyLine, aU as TextInput, T as TextInputPropertyLine, aV as TextPropertyLine, aW as Textarea, aX as TextureSelector, aY as TextureUpload, aZ as Theme, a_ as ThemeServiceIdentity, a$ as ToastProvider, b0 as ToggleButton, k as ToolsServiceIdentity, b1 as Tooltip, b2 as UploadButton, b3 as Vector2PropertyLine, V as Vector3PropertyLine, b4 as Vector4PropertyLine, b5 as WatcherServiceIdentity, b6 as useAngleConverters, b7 as useAsyncResource, b8 as useColor3Property, b9 as useColor4Property, ba as useEventListener, bb as useEventfulState, b as useInterceptObservable, bc as useKeyListener, bd as useKeyState, be as useObservableCollection, h as useObservableState, bf as useOrderedObservableCollection, bg as usePollingObservable, e as useProperty, bh as usePropertyChangedNotifier, bi as useQuaternionProperty, bj as useResource, bk as useTheme, bl as useThemeMode, a as useToast, bm as useVector3Property } from './index-DB_fpb1t.js';
1
+ export { A as Accordion, i as AccordionSection, l as AccordionSectionItem, m as AttachDebugLayer, n as BooleanBadgePropertyLine, o as BoundProperty, p as BridgeCommandRegistryIdentity, q as BuiltInsExtensionFeed, B as Button, j as ButtonLine, r as Checkbox, C as CheckboxPropertyLine, s as ChildWindow, t as Collapse, v as Color3GradientComponent, w as Color3GradientList, x as Color3PropertyLine, y as Color4GradientComponent, z as Color4GradientList, D as Color4PropertyLine, E as ColorPickerPopup, F as ColorStepGradientComponent, G as ComboBox, H as ComboBoxPropertyLine, I as ConstructorFactory, J as ConvertOptions, K as DebugServiceIdentity, O as DetachDebugLayer, Q as DraggableLine, R as Dropdown, U as EntitySelector, W as ErrorBoundary, X as ExtensibleAccordion, Y as FactorGradientComponent, Z as FactorGradientList, _ as FileUploadLine, $ as GetPropertyDescriptor, a0 as GizmoServiceIdentity, a1 as HexPropertyLine, a2 as InfoLabel, a3 as InputHexField, a4 as InputHsvField, a5 as Inspector, a6 as InterceptFunction, a7 as InterceptProperty, a8 as IsPropertyReadonly, a9 as LineContainer, L as Link, aa as LinkPropertyLine, c as LinkToEntity, ab as LinkToEntityPropertyLine, ac as List, ad as MakeDialogTeachingMoment, ae as MakeLazyComponent, af as MakeModularBridge, ag as MakeModularTool, ah as MakePopoverTeachingMoment, ai as MakePropertyHook, aj as MakeTeachingMoment, ak as MaterialSelector, M as MessageBar, al as NodeSelector, am as NumberDropdown, an as NumberDropdownPropertyLine, N as NumberInputPropertyLine, ao as ObservableCollection, ap as Pane, aq as PlaceholderPropertyLine, P as Popover, ar as PositionedPopover, as as PropertiesServiceIdentity, at as Property, au as PropertyContext, av as PropertyLine, aw as QuaternionPropertyLine, ax as RotationVectorPropertyLine, f as SceneContextIdentity, ay as SceneExplorerServiceIdentity, az as SearchBar, aA as SearchBox, aB as SelectionServiceDefinition, g as SelectionServiceIdentity, aC as SettingsServiceIdentity, aD as SettingsStore, aE as SettingsStoreIdentity, S as ShellServiceIdentity, aF as ShowInspector, aG as SidePaneContainer, aH as SkeletonSelector, aI as Slider, aJ as SpinButton, d as SpinButtonPropertyLine, aK as StartInspectable, aL as StatsServiceIdentity, aM as StringDropdown, aN as StringDropdownPropertyLine, aO as StringifiedPropertyLine, aP as Switch, aQ as SwitchPropertyLine, aR as SyncedSliderInput, aS as SyncedSliderPropertyLine, aT as TeachingMoment, aU as TextAreaPropertyLine, aV as TextInput, T as TextInputPropertyLine, aW as TextPropertyLine, aX as Textarea, aY as TextureSelector, aZ as TextureUpload, a_ as Theme, a$ as ThemeServiceIdentity, b0 as ToastProvider, b1 as ToggleButton, k as ToolsServiceIdentity, b2 as Tooltip, b3 as UploadButton, b4 as Vector2PropertyLine, V as Vector3PropertyLine, b5 as Vector4PropertyLine, b6 as WatcherServiceIdentity, b7 as useAngleConverters, b8 as useAsyncResource, b9 as useColor3Property, ba as useColor4Property, bb as useEventListener, bc as useEventfulState, b as useInterceptObservable, bd as useKeyListener, be as useKeyState, bf as useObservableCollection, h as useObservableState, bg as useOrderedObservableCollection, bh as usePollingObservable, e as useProperty, bi as usePropertyChangedNotifier, bj as useQuaternionProperty, bk as useResource, bl as useTheme, bm as useThemeMode, a as useToast, bn as useVector3Property } from './index-nEGqYbP2.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@fluentui/react-components';
@@ -1,10 +1,30 @@
1
1
  import { type IDisposable } from "@babylonjs/core/index.js";
2
2
  import { type Scene } from "@babylonjs/core/scene.js";
3
3
  import { type WeaklyTypedServiceDefinition, ServiceContainer } from "@babylonjs/shared-ui-components/modularTool/modularity/serviceContainer.js";
4
+ import { type ModularBridgeToken } from "@babylonjs/shared-ui-components/modularTool/modularBridge.js";
4
5
  /**
5
6
  * Options for making a scene inspectable via the Inspector CLI.
6
7
  */
7
8
  export type InspectableOptions = {
9
+ /**
10
+ * Additional service definitions to register with the inspectable container.
11
+ * These are added in a separate call from the built-in services and are removed
12
+ * when the returned token is disposed.
13
+ */
14
+ serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];
15
+ } & ({
16
+ /**
17
+ * An existing modular bridge token whose ServiceContainer will be used as
18
+ * the parent for the inspectable container. The bridge already exists
19
+ * in the bridge token's container, so bridge options are not accepted.
20
+ * @experimental
21
+ */
22
+ bridgeToken: ModularBridgeToken;
23
+ port?: never;
24
+ name?: never;
25
+ autoStart?: never;
26
+ } | {
27
+ bridgeToken?: never;
8
28
  /**
9
29
  * WebSocket port for the bridge's browser port. Defaults to 4400.
10
30
  */
@@ -18,13 +38,7 @@ export type InspectableOptions = {
18
38
  * when the inspectable session is created. Defaults to false.
19
39
  */
20
40
  autoStart?: boolean;
21
- /**
22
- * Additional service definitions to register with the inspectable container.
23
- * These are added in a separate call from the built-in services and are removed
24
- * when the returned token is disposed.
25
- */
26
- serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];
27
- };
41
+ });
28
42
  /**
29
43
  * A token returned by {@link StartInspectable} that can be disposed to disconnect
30
44
  * the scene from the Inspector CLI bridge.
@@ -54,9 +68,12 @@ export type InternalInspectableToken = InspectableToken & {
54
68
  export declare function _StartInspectable(scene: Scene, options?: Partial<InspectableOptions>): InternalInspectableToken;
55
69
  /**
56
70
  * Makes a scene inspectable by connecting it to the Inspector CLI bridge.
57
- * This creates a headless {@link ServiceContainer} (no UI) and registers the
58
- * {@link InspectableBridgeService} which opens a WebSocket to the bridge and
59
- * exposes a command registry for CLI-invocable commands.
71
+ * This creates a headless {@link ServiceContainer} (no UI) that registers
72
+ * scene-specific CLI command services (entity query, screenshot, shader, stats, etc.).
73
+ *
74
+ * When {@link InspectableOptions.bridgeToken} is provided, the inspectable container
75
+ * is created as a child of the CLI container, inheriting the bridge and command registry.
76
+ * When not provided, a bridge container is created internally via {@link MakeModularBridge}.
60
77
  *
61
78
  * Multiple callers may call this for the same scene. Each returned token is
62
79
  * ref-counted — the underlying connection is only torn down when all tokens
@@ -1,4 +1,4 @@
1
- import { type IDisposable, type IReadonlyObservable, type Scene } from "@babylonjs/core/index.js";
1
+ import { type IReadonlyObservable, type Scene } from "@babylonjs/core/index.js";
2
2
  import { type ModularToolOptions } from "@babylonjs/shared-ui-components/modularTool/modularTool.js";
3
3
  type LayoutMode = "inline" | "overlay";
4
4
  /**
@@ -21,7 +21,12 @@ export type InspectorOptions = Omit<ModularToolOptions, "namespace" | "toolbarMo
21
21
  * A token returned by {@link ShowInspector} that can be used to dispose the inspector
22
22
  * and observe its disposal.
23
23
  */
24
- export type InspectorToken = IDisposable & {
24
+ export type InspectorToken = {
25
+ /**
26
+ * Disposes the inspector. The returned promise resolves once all cleanup
27
+ * (including asynchronous React unmount and ServiceContainer disposal) is complete.
28
+ */
29
+ dispose(): Promise<void>;
25
30
  /**
26
31
  * Whether the inspector has been disposed.
27
32
  */
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { P as Popover, a as useToast, b as useInterceptObservable, B as Button, c as LinkToEntity, T as TextInputPropertyLine, d as SpinButtonPropertyLine, C as CheckboxPropertyLine, V as Vector3PropertyLine, e as useProperty, M as MessageBar, S as ShellServiceIdentity, f as SceneContextIdentity, g as SelectionServiceIdentity, h as useObservableState, A as Accordion, i as AccordionSection } from './index-DB_fpb1t.js';
2
+ import { P as Popover, a as useToast, b as useInterceptObservable, B as Button, c as LinkToEntity, T as TextInputPropertyLine, d as SpinButtonPropertyLine, C as CheckboxPropertyLine, V as Vector3PropertyLine, e as useProperty, M as MessageBar, S as ShellServiceIdentity, f as SceneContextIdentity, g as SelectionServiceIdentity, h as useObservableState, A as Accordion, i as AccordionSection } from './index-nEGqYbP2.js';
3
3
  import { SettingsRegular, CollectionsAdd20Regular } from '@fluentui/react-icons';
4
4
  import '@babylonjs/core/Particles/webgl2ParticleSystem.js';
5
5
  import '@babylonjs/core/Rendering/prePassRendererSceneComponent.js';
@@ -772,4 +772,4 @@ var quickCreateToolsService = {
772
772
  };
773
773
 
774
774
  export { CreateToolsServiceDefinition, quickCreateToolsService as default };
775
- //# sourceMappingURL=quickCreateToolsService-DaBqYmZw.js.map
775
+ //# sourceMappingURL=quickCreateToolsService-_L22btR5.js.map