@babylonjs/inspector 8.37.1-preview → 8.37.2-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.
@@ -3,7 +3,7 @@ import { useMemo, useEffect, useState, useRef, useCallback, forwardRef, createCo
3
3
  import { Color3, Color4 } from '@babylonjs/core/Maths/math.color.js';
4
4
  import { Vector3, Quaternion, Matrix, Vector2, Vector4, TmpVectors } from '@babylonjs/core/Maths/math.vector.js';
5
5
  import { Observable } from '@babylonjs/core/Misc/observable.js';
6
- import { makeStyles, Link as Link$1, Body1, ToggleButton as ToggleButton$1, Button as Button$1, tokens, InfoLabel as InfoLabel$1, Body1Strong, Checkbox as Checkbox$1, mergeClasses, Accordion as Accordion$1, AccordionItem, AccordionHeader, Subtitle2Stronger, AccordionPanel, Divider, TeachingPopover, TeachingPopoverSurface, TeachingPopoverHeader, TeachingPopoverBody, createLightTheme, createDarkTheme, FluentProvider, Tooltip, Menu, MenuTrigger, SplitButton, MenuPopover, MenuList, MenuItem, Toolbar as Toolbar$1, Portal, RendererProvider, ToolbarRadioButton, createDOMRenderer, MenuGroup, MenuGroupHeader, SearchBox as SearchBox$1, FlatTree, FlatTreeItem, TreeItemLayout, treeItemLevelToken, MenuDivider, MenuItemCheckbox, Switch as Switch$1, PresenceBadge, useId, SpinButton as SpinButton$1, Slider, Input, Dropdown as Dropdown$1, Option, Popover, PopoverTrigger, ColorSwatch, PopoverSurface, ColorPicker, ColorArea, ColorSlider, AlphaSlider, MenuItemRadio, Dialog, DialogSurface, DialogBody, DialogTitle, DialogContent, DialogActions, List as List$1, ListItem, Spinner, Badge, MessageBar as MessageBar$1, MessageBarBody, MessageBarTitle, Textarea as Textarea$1, ToolbarButton, useComboboxFilter, Combobox, Field } from '@fluentui/react-components';
6
+ import { makeStyles, Link as Link$1, Body1, ToggleButton as ToggleButton$1, Button as Button$1, tokens, InfoLabel as InfoLabel$1, Body1Strong, Checkbox as Checkbox$1, mergeClasses, Accordion as Accordion$1, AccordionItem, AccordionHeader, Subtitle2Stronger, AccordionPanel, Divider, TeachingPopover, TeachingPopoverSurface, TeachingPopoverHeader, TeachingPopoverBody, createLightTheme, createDarkTheme, FluentProvider, Tooltip, Menu, MenuTrigger, SplitButton, MenuPopover, MenuList, MenuItem, Toolbar as Toolbar$1, Portal, RendererProvider, ToolbarRadioButton, createDOMRenderer, MenuGroup, MenuGroupHeader, SearchBox as SearchBox$1, FlatTree, FlatTreeItem, TreeItemLayout, MenuDivider, treeItemLevelToken, MenuItemCheckbox, Switch as Switch$1, PresenceBadge, useId, SpinButton as SpinButton$1, Slider, Input, Dropdown as Dropdown$1, Option, Popover, PopoverTrigger, ColorSwatch, PopoverSurface, ColorPicker, ColorArea, ColorSlider, AlphaSlider, MenuItemRadio, Dialog, DialogSurface, DialogBody, DialogTitle, DialogContent, DialogActions, List as List$1, ListItem, Spinner, Badge, MessageBar as MessageBar$1, MessageBarBody, MessageBarTitle, Textarea as Textarea$1, ToolbarButton, useComboboxFilter, Combobox, Field } from '@fluentui/react-components';
7
7
  import { ChevronCircleRight16Regular, ChevronCircleRight20Regular, ChevronCircleDown16Regular, ChevronCircleDown20Regular, Copy16Regular, Copy20Regular, PanelLeftExpandRegular, PanelRightExpandRegular, PanelLeftContractRegular, PanelRightContractRegular, PictureInPictureEnterRegular, MoreHorizontalRegular, LayoutColumnTwoFocusLeftFilled, LayoutColumnTwoSplitLeftFocusTopLeftFilled, LayoutColumnTwoSplitLeftFocusBottomLeftFilled, LayoutColumnTwoFocusRightFilled, LayoutColumnTwoSplitRightFocusTopRightFilled, LayoutColumnTwoSplitRightFocusBottomRightFilled, DocumentTextRegular, createFluentIcon, FilterRegular, GlobeRegular, ArrowExpandAllRegular, ArrowCollapseAllRegular, CubeTreeRegular, BugRegular, SettingsRegular, ArrowUploadRegular, DataBarHorizontalRegular, WrenchRegular, WeatherSunnyRegular, WeatherMoonRegular, ErrorCircleRegular, ArrowRotateClockwiseRegular, ArrowExpandRegular, SelectObjectRegular, CubeRegular, SaveRegular, ArrowUndoRegular, BracesRegular, BracesDismiss16Regular, CopyRegular, DeleteRegular, EyeOffFilled, EyeFilled, ArrowMoveFilled, StopFilled, PlayFilled, StackRegular, FilmstripRegular, PauseFilled, WeatherSunnyLowFilled, LayerRegular, FrameRegular, PlayRegular, AppGenericRegular, MyLocationRegular, CameraRegular, LightbulbRegular, BorderOutsideRegular, BorderNoneRegular, EyeRegular, EyeOffRegular, VideoFilled, VideoRegular, FlashlightRegular, FlashlightOffRegular, DropRegular, BlurRegular, PipelineRegular, PersonWalkingRegular, DataLineRegular, PersonSquareRegular, LayerDiagonalPersonRegular, ImageEditRegular, ImageRegular, TargetRegular, PersonFeedbackRegular, BranchRegular, DeleteFilled } from '@fluentui/react-icons';
8
8
  import { Collapse as Collapse$1, Fade } from '@fluentui/react-motion-components-preview';
9
9
  import '@babylonjs/core/Misc/typeStore.js';
@@ -2337,6 +2337,41 @@ function ExpandOrCollapseAll(treeItem, open, openItems) {
2337
2337
  const addOrRemove = open ? openItems.add.bind(openItems) : openItems.delete.bind(openItems);
2338
2338
  TraverseGraph([treeItem], (treeItem) => treeItem.children, (treeItem) => addOrRemove(treeItem.type === "entity" ? treeItem.entity.uniqueId : treeItem.sectionName));
2339
2339
  }
2340
+ function useCommandContextMenuState(commands) {
2341
+ const [checkedContextMenuItems, setCheckedContextMenuItems] = useState({ toggleCommands: [] });
2342
+ useEffect(() => {
2343
+ const updateCheckedItems = () => {
2344
+ const checkedItems = [];
2345
+ for (const command of commands) {
2346
+ if (command.type === "toggle" && command.isEnabled) {
2347
+ checkedItems.push(command.displayName);
2348
+ }
2349
+ }
2350
+ setCheckedContextMenuItems({ toggleCommands: checkedItems });
2351
+ };
2352
+ updateCheckedItems();
2353
+ const observers = commands
2354
+ .map((command) => command.onChange)
2355
+ .filter((onChange) => !!onChange)
2356
+ .map((onChange) => onChange.add(updateCheckedItems));
2357
+ return () => {
2358
+ for (const observer of observers) {
2359
+ observer.remove();
2360
+ }
2361
+ };
2362
+ }, [commands]);
2363
+ const onContextMenuCheckedValueChange = useCallback((e, data) => {
2364
+ for (const command of commands) {
2365
+ if (command.type === "toggle") {
2366
+ command.isEnabled = data.checkedItems.includes(command.displayName);
2367
+ }
2368
+ }
2369
+ }, [commands]);
2370
+ const contextMenuItems = commands.map((command) => command.type === "action" ? (jsx(MenuItem, { icon: command.icon ? jsx(command.icon, {}) : undefined, onClick: () => command.execute(), children: command.displayName }, command.displayName)) : (jsx(MenuItemCheckbox, {
2371
+ // Don't show both a checkmark and an icon. null means no checkmark, undefined means default (checkmark).
2372
+ checkmark: command.icon ? null : undefined, icon: command.icon ? jsx(command.icon, {}) : undefined, name: "toggleCommands", value: command.displayName, children: command.displayName }, command.displayName)));
2373
+ return [checkedContextMenuItems, onContextMenuCheckedValueChange, contextMenuItems];
2374
+ }
2340
2375
  // eslint-disable-next-line @typescript-eslint/naming-convention
2341
2376
  const useStyles$b = makeStyles({
2342
2377
  rootDiv: {
@@ -2412,12 +2447,21 @@ const SceneTreeItem = (props) => {
2412
2447
  return (jsx(FlatTreeItem, { value: "scene", itemType: "leaf", parentValue: undefined, "aria-level": 1, "aria-setsize": 1, "aria-posinset": 1, onClick: select, children: jsx(TreeItemLayout, { iconBefore: jsx(GlobeRegular, {}), className: treeItemLayoutClass, style: isSelected ? { backgroundColor: tokens.colorNeutralBackground1Selected } : undefined, children: jsx(Body1Strong, { wrap: false, truncate: true, children: "Scene" }) }) }, "scene"));
2413
2448
  };
2414
2449
  const SectionTreeItem = (props) => {
2415
- const { section, isFiltering, expandAll, collapseAll } = props;
2450
+ const { section, isFiltering, commandProviders, expandAll, collapseAll } = props;
2416
2451
  const classes = useStyles$b();
2417
2452
  const [compactMode] = useCompactMode();
2418
- return (jsxs(Menu, { openOnContext: true, children: [jsx(MenuTrigger, { disableButtonEnhancement: true, children: jsx(FlatTreeItem, { value: section.sectionName,
2453
+ // Get the commands that apply to this section.
2454
+ const commands = useResource(useCallback(() => {
2455
+ const commands = [...commandProviders].filter((provider) => provider.predicate(section.sectionName)).map((provider) => provider.getCommand(section.sectionName));
2456
+ return Object.assign(commands, {
2457
+ dispose: () => commands.forEach((command) => command.dispose?.()),
2458
+ });
2459
+ }, [section.sectionName, commandProviders]));
2460
+ const hasChildren = section.children.length > 0;
2461
+ const [checkedContextMenuItems, onContextMenuCheckedValueChange, contextMenuItems] = useCommandContextMenuState(commands);
2462
+ return (jsxs(Menu, { openOnContext: true, checkedValues: checkedContextMenuItems, onCheckedValueChange: onContextMenuCheckedValueChange, children: [jsx(MenuTrigger, { disableButtonEnhancement: true, children: jsx(FlatTreeItem, { value: section.sectionName,
2419
2463
  // Disable manual expand/collapse when a filter is active.
2420
- itemType: !isFiltering && section.children.length > 0 ? "branch" : "leaf", parentValue: undefined, "aria-level": 1, "aria-setsize": 1, "aria-posinset": 1, children: jsx(TreeItemLayout, { className: compactMode ? classes.treeItemLayoutCompact : undefined, children: jsx(Body1Strong, { wrap: false, truncate: true, children: section.sectionName.substring(0, 100) }) }) }, section.sectionName) }), jsx(MenuPopover, { hidden: !section.children.length, children: jsxs(MenuList, { children: [jsx(MenuItem, { onClick: expandAll, children: jsx(Body1, { children: "Expand All" }) }), jsx(MenuItem, { onClick: collapseAll, children: jsx(Body1, { children: "Collapse All" }) })] }) })] }));
2464
+ itemType: !isFiltering && section.children.length > 0 ? "branch" : "leaf", parentValue: undefined, "aria-level": 1, "aria-setsize": 1, "aria-posinset": 1, children: jsx(TreeItemLayout, { className: compactMode ? classes.treeItemLayoutCompact : undefined, children: jsx(Body1Strong, { wrap: false, truncate: true, children: section.sectionName.substring(0, 100) }) }) }, section.sectionName) }), jsx(MenuPopover, { hidden: !hasChildren && commands.length === 0, children: jsxs(MenuList, { children: [hasChildren && (jsxs(Fragment, { children: [jsx(MenuItem, { onClick: expandAll, children: jsx(Body1, { children: "Expand All" }) }), jsx(MenuItem, { onClick: collapseAll, children: jsx(Body1, { children: "Collapse All" }) })] })), hasChildren && commands.length > 0 && jsx(MenuDivider, {}), contextMenuItems] }) })] }));
2421
2465
  };
2422
2466
  const EntityTreeItem = (props) => {
2423
2467
  const { entityItem, isSelected, select, isFiltering, commandProviders, expandAll, collapseAll } = props;
@@ -2501,35 +2545,7 @@ const EntityTreeItem = (props) => {
2501
2545
  };
2502
2546
  }, [inlineCommands]);
2503
2547
  const contextMenuCommands = useMemo(() => commands.filter((command) => command.mode === "contextMenu"), [commands]);
2504
- const [checkedContextMenuItems, setCheckedContextMenuItems] = useState({ toggleCommands: [] });
2505
- useEffect(() => {
2506
- const updateCheckedItems = () => {
2507
- const checkedItems = [];
2508
- for (const command of contextMenuCommands) {
2509
- if (command.type === "toggle" && command.isEnabled) {
2510
- checkedItems.push(command.displayName);
2511
- }
2512
- }
2513
- setCheckedContextMenuItems({ toggleCommands: checkedItems });
2514
- };
2515
- updateCheckedItems();
2516
- const observers = contextMenuCommands
2517
- .map((command) => command.onChange)
2518
- .filter((onChange) => !!onChange)
2519
- .map((onChange) => onChange.add(updateCheckedItems));
2520
- return () => {
2521
- for (const observer of observers) {
2522
- observer.remove();
2523
- }
2524
- };
2525
- }, [contextMenuCommands]);
2526
- const onContextMenuCheckedValueChange = useCallback((e, data) => {
2527
- for (const command of contextMenuCommands) {
2528
- if (command.type === "toggle") {
2529
- command.isEnabled = data.checkedItems.includes(command.displayName);
2530
- }
2531
- }
2532
- }, [contextMenuCommands]);
2548
+ const [checkedContextMenuItems, onContextMenuCheckedValueChange, contextMenuItems] = useCommandContextMenuState(contextMenuCommands);
2533
2549
  return (jsxs(Menu, { openOnContext: true, checkedValues: checkedContextMenuItems, onCheckedValueChange: onContextMenuCheckedValueChange, children: [jsx(MenuTrigger, { disableButtonEnhancement: true, children: jsx(FlatTreeItem, { value: entityItem.entity.uniqueId,
2534
2550
  // Disable manual expand/collapse when a filter is active.
2535
2551
  itemType: !isFiltering && hasChildren ? "branch" : "leaf", parentValue: entityItem.parent.type === "section" ? entityItem.parent.sectionName : entityItem.entity.uniqueId, "aria-level": entityItem.depth, "aria-setsize": 1, "aria-posinset": 1, onClick: select, style: { [treeItemLevelToken]: entityItem.depth }, children: jsx(TreeItemLayout, { iconBefore: entityItem.icon ? jsx(entityItem.icon, { entity: entityItem.entity }) : null, className: compactMode ? classes.treeItemLayoutCompact : undefined, style: isSelected ? { backgroundColor: tokens.colorNeutralBackground1Selected } : undefined, actions: actions, aside: {
@@ -2539,13 +2555,11 @@ const EntityTreeItem = (props) => {
2539
2555
  }, main: {
2540
2556
  // Prevent the "main" content (the Body1 below) from growing too large and pushing the actions/aside out of view.
2541
2557
  className: classes.treeItemLayoutMain,
2542
- }, children: jsx(Body1, { wrap: false, truncate: true, children: name }) }) }, entityItem.entity.uniqueId) }), jsx(MenuPopover, { hidden: !hasChildren && contextMenuCommands.length === 0, children: jsxs(MenuList, { children: [hasChildren && (jsxs(Fragment, { children: [jsx(MenuItem, { icon: jsx(ArrowExpandAllRegular, {}), onClick: expandAll, children: jsx(Body1, { children: "Expand All" }) }), jsx(MenuItem, { icon: jsx(ArrowCollapseAllRegular, {}), onClick: collapseAll, children: jsx(Body1, { children: "Collapse All" }) })] })), hasChildren && contextMenuCommands.length > 0 && jsx(MenuDivider, {}), contextMenuCommands.map((command) => command.type === "action" ? (jsx(MenuItem, { icon: command.icon ? jsx(command.icon, {}) : undefined, onClick: () => command.execute(), children: command.displayName }, command.displayName)) : (jsx(MenuItemCheckbox, {
2543
- // Don't show both a checkmark and an icon. null means no checkmark, undefined means default (checkmark).
2544
- checkmark: command.icon ? null : undefined, icon: command.icon ? jsx(command.icon, {}) : undefined, name: "toggleCommands", value: command.displayName, children: command.displayName }, command.displayName)))] }) })] }));
2558
+ }, children: jsx(Body1, { wrap: false, truncate: true, children: name }) }) }, entityItem.entity.uniqueId) }), jsx(MenuPopover, { hidden: !hasChildren && contextMenuCommands.length === 0, children: jsxs(MenuList, { children: [hasChildren && (jsxs(Fragment, { children: [jsx(MenuItem, { icon: jsx(ArrowExpandAllRegular, {}), onClick: expandAll, children: jsx(Body1, { children: "Expand All" }) }), jsx(MenuItem, { icon: jsx(ArrowCollapseAllRegular, {}), onClick: collapseAll, children: jsx(Body1, { children: "Collapse All" }) })] })), hasChildren && contextMenuCommands.length > 0 && jsx(MenuDivider, {}), contextMenuItems] }) })] }));
2545
2559
  };
2546
2560
  const SceneExplorer = (props) => {
2547
2561
  const classes = useStyles$b();
2548
- const { sections, commandProviders, scene, selectedEntity } = props;
2562
+ const { sections, entityCommandProviders, sectionCommandProviders, scene, selectedEntity } = props;
2549
2563
  const [openItems, setOpenItems] = useState(new Set());
2550
2564
  const [sceneVersion, setSceneVersion] = useState(0);
2551
2565
  const scrollViewRef = useRef(null);
@@ -2787,10 +2801,10 @@ const SceneExplorer = (props) => {
2787
2801
  return (jsx(SceneTreeItem, { scene: scene, isSelected: selectedEntity === scene, select: () => setSelectedEntity?.(scene), isFiltering: !!itemsFilter }, "scene"));
2788
2802
  }
2789
2803
  else if (item.type === "section") {
2790
- return (jsx(SectionTreeItem, { scene: scene, section: item, isFiltering: !!itemsFilter, expandAll: () => expandAll(item), collapseAll: () => collapseAll(item) }, item.sectionName));
2804
+ return (jsx(SectionTreeItem, { scene: scene, section: item, isFiltering: !!itemsFilter, commandProviders: sectionCommandProviders, expandAll: () => expandAll(item), collapseAll: () => collapseAll(item) }, item.sectionName));
2791
2805
  }
2792
2806
  else {
2793
- return (jsx(EntityTreeItem, { scene: scene, entityItem: item, isSelected: selectedEntity === item.entity, select: () => setSelectedEntity?.(item.entity), isFiltering: !!itemsFilter, commandProviders: commandProviders, expandAll: () => expandAll(item), collapseAll: () => collapseAll(item) }, item.entity.uniqueId));
2807
+ return (jsx(EntityTreeItem, { scene: scene, entityItem: item, isSelected: selectedEntity === item.entity, select: () => setSelectedEntity?.(item.entity), isFiltering: !!itemsFilter, commandProviders: entityCommandProviders, expandAll: () => expandAll(item), collapseAll: () => collapseAll(item) }, item.entity.uniqueId));
2794
2808
  }
2795
2809
  } }) })] }));
2796
2810
  };
@@ -2807,7 +2821,8 @@ const SceneExplorerServiceDefinition = {
2807
2821
  consumes: [SceneContextIdentity, ShellServiceIdentity, SelectionServiceIdentity],
2808
2822
  factory: (sceneContext, shellService, selectionService) => {
2809
2823
  const sectionsCollection = new ObservableCollection();
2810
- const commandsCollection = new ObservableCollection();
2824
+ const entityCommandsCollection = new ObservableCollection();
2825
+ const sectionCommandsCollection = new ObservableCollection();
2811
2826
  const registration = shellService.addSidePane({
2812
2827
  key: "Scene Explorer",
2813
2828
  title: "Scene Explorer",
@@ -2817,15 +2832,17 @@ const SceneExplorerServiceDefinition = {
2817
2832
  suppressTeachingMoment: true,
2818
2833
  content: () => {
2819
2834
  const sections = useOrderedObservableCollection(sectionsCollection);
2820
- const commands = useOrderedObservableCollection(commandsCollection);
2835
+ const entityCommands = useOrderedObservableCollection(entityCommandsCollection);
2836
+ const sectionCommands = useOrderedObservableCollection(sectionCommandsCollection);
2821
2837
  const scene = useObservableState(() => sceneContext.currentScene, sceneContext.currentSceneObservable);
2822
2838
  const entity = useObservableState(() => selectionService.selectedEntity, selectionService.onSelectedEntityChanged);
2823
- return (jsx(Fragment, { children: scene && (jsx(SceneExplorer, { sections: sections, commandProviders: commands, scene: scene, selectedEntity: entity, setSelectedEntity: (entity) => (selectionService.selectedEntity = entity) })) }));
2839
+ return (jsx(Fragment, { children: scene && (jsx(SceneExplorer, { sections: sections, entityCommandProviders: entityCommands, sectionCommandProviders: sectionCommands, scene: scene, selectedEntity: entity, setSelectedEntity: (entity) => (selectionService.selectedEntity = entity) })) }));
2824
2840
  },
2825
2841
  });
2826
2842
  return {
2827
2843
  addSection: (section) => sectionsCollection.add(section),
2828
- addCommand: (command) => commandsCollection.add(command),
2844
+ addEntityCommand: (command) => entityCommandsCollection.add(command),
2845
+ addSectionCommand: (command) => sectionCommandsCollection.add(command),
2829
2846
  dispose: () => registration.dispose(),
2830
2847
  };
2831
2848
  },
@@ -3506,7 +3523,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
3506
3523
  keywords: ["export", "gltf", "glb", "babylon", "exporter", "tools"],
3507
3524
  ...BabylonWebResources,
3508
3525
  author: { name: "Alex Chuber", forumUserName: "alexchuber" },
3509
- getExtensionModuleAsync: async () => await import('./exportService-BGS52fVw.js'),
3526
+ getExtensionModuleAsync: async () => await import('./exportService-B2rCoOC_.js'),
3510
3527
  },
3511
3528
  {
3512
3529
  name: "Capture Tools",
@@ -3514,7 +3531,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
3514
3531
  keywords: ["capture", "screenshot", "gif", "video", "tools"],
3515
3532
  ...BabylonWebResources,
3516
3533
  author: { name: "Alex Chuber", forumUserName: "alexchuber" },
3517
- getExtensionModuleAsync: async () => await import('./captureService-DlzvwY4k.js'),
3534
+ getExtensionModuleAsync: async () => await import('./captureService-CS2uW-yq.js'),
3518
3535
  },
3519
3536
  {
3520
3537
  name: "Import Tools",
@@ -3522,7 +3539,7 @@ const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspector", [
3522
3539
  keywords: ["import", "tools"],
3523
3540
  ...BabylonWebResources,
3524
3541
  author: { name: "Alex Chuber", forumUserName: "alexchuber" },
3525
- getExtensionModuleAsync: async () => await import('./importService-nyYXNIoV.js'),
3542
+ getExtensionModuleAsync: async () => await import('./importService-BSl7VIci.js'),
3526
3543
  },
3527
3544
  ]);
3528
3545
 
@@ -4630,7 +4647,7 @@ function MakeModularTool(options) {
4630
4647
  });
4631
4648
  // Register the extension list service (for browsing/installing extensions) if extension feeds are provided.
4632
4649
  if (extensionFeeds.length > 0) {
4633
- const { ExtensionListServiceDefinition } = await import('./extensionsListService-Ch91ejP8.js');
4650
+ const { ExtensionListServiceDefinition } = await import('./extensionsListService-CyDEpF1t.js');
4634
4651
  await serviceContainer.addServiceAsync(ExtensionListServiceDefinition);
4635
4652
  }
4636
4653
  // Register the theme selector service (for selecting the theme) if theming is configured.
@@ -8374,7 +8391,7 @@ const AnimationGroupExplorerServiceDefinition = {
8374
8391
  getEntityAddedObservables: () => [scene.onNewAnimationGroupAddedObservable],
8375
8392
  getEntityRemovedObservables: () => [scene.onAnimationGroupRemovedObservable],
8376
8393
  });
8377
- const animationPlayPauseCommandRegistration = sceneExplorerService.addCommand({
8394
+ const animationPlayPauseCommandRegistration = sceneExplorerService.addEntityCommand({
8378
8395
  predicate: (entity) => entity instanceof AnimationGroup,
8379
8396
  order: 900 /* DefaultCommandsOrder.AnimationGroupPlay */,
8380
8397
  getCommand: (animationGroup) => {
@@ -8512,7 +8529,7 @@ const FrameGraphExplorerServiceDefinition = {
8512
8529
  return undefined;
8513
8530
  }
8514
8531
  const sectionRegistration = sceneExplorerService.addSection({
8515
- displayName: "Frame Graph",
8532
+ displayName: "Frame Graphs",
8516
8533
  order: 1200 /* DefaultSectionsOrder.FrameGraphs */,
8517
8534
  getRootEntities: () => scene.frameGraphs,
8518
8535
  getEntityDisplayInfo: (frameGraph) => {
@@ -8537,7 +8554,7 @@ const FrameGraphExplorerServiceDefinition = {
8537
8554
  getEntityAddedObservables: () => [scene.onNewFrameGraphAddedObservable],
8538
8555
  getEntityRemovedObservables: () => [scene.onFrameGraphRemovedObservable],
8539
8556
  });
8540
- const activeFrameGraphCommandRegistration = sceneExplorerService.addCommand({
8557
+ const activeFrameGraphCommandRegistration = sceneExplorerService.addEntityCommand({
8541
8558
  predicate: (entity) => entity instanceof FrameGraph,
8542
8559
  order: 900 /* DefaultCommandsOrder.FrameGraphPlay */,
8543
8560
  getCommand: (frameGraph) => {
@@ -8713,7 +8730,7 @@ const NodeExplorerServiceDefinition = {
8713
8730
  ],
8714
8731
  getEntityMovedObservables: () => [nodeMovedObservable],
8715
8732
  });
8716
- const abstractMeshBoundingBoxCommandRegistration = sceneExplorerService.addCommand({
8733
+ const abstractMeshBoundingBoxCommandRegistration = sceneExplorerService.addEntityCommand({
8717
8734
  predicate: (entity) => entity instanceof AbstractMesh && entity.getTotalVertices() > 0,
8718
8735
  order: 1000 /* DefaultCommandsOrder.MeshBoundingBox */,
8719
8736
  getCommand: (mesh) => {
@@ -8741,7 +8758,7 @@ const NodeExplorerServiceDefinition = {
8741
8758
  };
8742
8759
  },
8743
8760
  });
8744
- const abstractMeshVisibilityCommandRegistration = sceneExplorerService.addCommand({
8761
+ const abstractMeshVisibilityCommandRegistration = sceneExplorerService.addEntityCommand({
8745
8762
  predicate: (entity) => entity instanceof AbstractMesh && entity.getTotalVertices() > 0,
8746
8763
  order: 1100 /* DefaultCommandsOrder.MeshVisibility */,
8747
8764
  getCommand: (mesh) => {
@@ -8769,7 +8786,7 @@ const NodeExplorerServiceDefinition = {
8769
8786
  };
8770
8787
  },
8771
8788
  });
8772
- const activeCameraCommandRegistration = sceneExplorerService.addCommand({
8789
+ const activeCameraCommandRegistration = sceneExplorerService.addEntityCommand({
8773
8790
  predicate: (entity) => entity instanceof Camera,
8774
8791
  order: 700 /* DefaultCommandsOrder.CameraActive */,
8775
8792
  getCommand: (camera) => {
@@ -8801,7 +8818,7 @@ const NodeExplorerServiceDefinition = {
8801
8818
  },
8802
8819
  });
8803
8820
  function addGizmoCommand(nodeClass, getGizmoRef) {
8804
- return sceneExplorerService.addCommand({
8821
+ return sceneExplorerService.addEntityCommand({
8805
8822
  predicate: (entity) => entity instanceof nodeClass,
8806
8823
  order: 800 /* DefaultCommandsOrder.GizmoActive */,
8807
8824
  getCommand: (node) => {
@@ -8840,7 +8857,7 @@ const NodeExplorerServiceDefinition = {
8840
8857
  });
8841
8858
  }
8842
8859
  const cameraGizmoCommandRegistration = addGizmoCommand(Camera, gizmoService.getCameraGizmo.bind(gizmoService));
8843
- const lightEnabledCommandRegistration = sceneExplorerService.addCommand({
8860
+ const lightEnabledCommandRegistration = sceneExplorerService.addEntityCommand({
8844
8861
  predicate: (entity) => entity instanceof Light,
8845
8862
  order: 700 /* DefaultCommandsOrder.LightActive */,
8846
8863
  getCommand: (light) => {
@@ -9075,7 +9092,7 @@ const SpriteManagerExplorerServiceDefinition = {
9075
9092
  getEntityAddedObservables: () => [scene.onNewSpriteManagerAddedObservable],
9076
9093
  getEntityRemovedObservables: () => [scene.onSpriteManagerRemovedObservable],
9077
9094
  });
9078
- const spritePlayStopCommandRegistration = sceneExplorerService.addCommand({
9095
+ const spritePlayStopCommandRegistration = sceneExplorerService.addEntityCommand({
9079
9096
  predicate: (entity) => entity instanceof Sprite,
9080
9097
  order: 600 /* DefaultCommandsOrder.SpritePlay */,
9081
9098
  getCommand: (sprite) => {
@@ -9497,7 +9514,7 @@ function ConvertOptions(v1Options) {
9497
9514
  }
9498
9515
  })();
9499
9516
  const initialTabServiceDefinition = {
9500
- friendlyName: "Initial Tab Selector",
9517
+ friendlyName: "Initial Tab Selector (Backward Compatibility)",
9501
9518
  consumes: [ShellServiceIdentity],
9502
9519
  factory: (shellService) => {
9503
9520
  // Just find and select the requested initial tab.
@@ -9509,7 +9526,7 @@ function ConvertOptions(v1Options) {
9509
9526
  if (v1Options.additionalNodes && v1Options.additionalNodes.length > 0) {
9510
9527
  const { additionalNodes } = v1Options;
9511
9528
  const additionalNodesServiceDefinition = {
9512
- friendlyName: "Additional Nodes",
9529
+ friendlyName: "Additional Nodes (Backward Compatibility)",
9513
9530
  consumes: [SceneExplorerServiceIdentity],
9514
9531
  factory: (sceneExplorerService) => {
9515
9532
  const sceneExplorerSectionRegistrations = additionalNodes.map((node) => sceneExplorerService.addSection({
@@ -9559,10 +9576,10 @@ function ConvertOptions(v1Options) {
9559
9576
  if (v1Options.explorerExtensibility && v1Options.explorerExtensibility.length > 0) {
9560
9577
  const { explorerExtensibility } = v1Options;
9561
9578
  const explorerExtensibilityServiceDefinition = {
9562
- friendlyName: "Explorer Extensibility",
9579
+ friendlyName: "Explorer Extensibility (Backward Compatibility)",
9563
9580
  consumes: [SceneExplorerServiceIdentity],
9564
9581
  factory: (sceneExplorerService) => {
9565
- const sceneExplorerCommandRegistrations = explorerExtensibility.flatMap((command) => command.entries.map((entry) => sceneExplorerService.addCommand({
9582
+ const sceneExplorerCommandRegistrations = explorerExtensibility.flatMap((command) => command.entries.map((entry) => sceneExplorerService.addEntityCommand({
9566
9583
  predicate: (entity) => command.predicate(entity),
9567
9584
  getCommand: (entity) => {
9568
9585
  return {
@@ -9582,6 +9599,43 @@ function ConvertOptions(v1Options) {
9582
9599
  };
9583
9600
  serviceDefinitions.push(explorerExtensibilityServiceDefinition);
9584
9601
  }
9602
+ if (v1Options.contextMenu) {
9603
+ const { contextMenu } = v1Options;
9604
+ const sections = Object.entries(contextMenu);
9605
+ if (sections.length > 0) {
9606
+ const legacySectionMapping = {
9607
+ pipeline: "Rendering Pipelines",
9608
+ node: "Nodes",
9609
+ materials: "Materials",
9610
+ spriteManagers: "Sprite Managers",
9611
+ particleSystems: "Particle Systems",
9612
+ frameGraphs: "Frame Graphs",
9613
+ };
9614
+ const sectionContextMenuServiceDefinition = {
9615
+ friendlyName: "Context Menu (Backward Compatibility)",
9616
+ consumes: [SceneExplorerServiceIdentity],
9617
+ factory: (sceneExplorerService) => {
9618
+ const sceneExlplorerCommandRegistrations = sections.flatMap(([sectionName, entries]) => entries.map((entry) => sceneExplorerService.addSectionCommand({
9619
+ predicate: (section) => legacySectionMapping[sectionName] === section,
9620
+ getCommand: () => {
9621
+ return {
9622
+ displayName: entry.label,
9623
+ type: "action",
9624
+ mode: "contextMenu",
9625
+ execute: () => entry.action(),
9626
+ };
9627
+ },
9628
+ })));
9629
+ return {
9630
+ dispose: () => {
9631
+ sceneExlplorerCommandRegistrations.forEach((registration) => registration.dispose());
9632
+ },
9633
+ };
9634
+ },
9635
+ };
9636
+ serviceDefinitions.push(sectionContextMenuServiceDefinition);
9637
+ }
9638
+ }
9585
9639
  const v2Options = {
9586
9640
  containerElement: v1Options.globalRoot,
9587
9641
  layoutMode: v1Options.overlay ? "overlay" : "inline",
@@ -9918,4 +9972,4 @@ const TextAreaPropertyLine = (props) => {
9918
9972
  };
9919
9973
 
9920
9974
  export { SettingsContextIdentity as $, useAsyncResource as A, ButtonLine as B, Collapse as C, DebugServiceIdentity as D, ExtensibleAccordion as E, FileUploadLine as F, useCompactMode as G, useSidePaneDockOverrides as H, Inspector as I, useAngleConverters as J, MakeTeachingMoment as K, Link as L, MakeLazyComponent as M, NumberDropdownPropertyLine as N, MakeDialogTeachingMoment as O, PropertiesServiceIdentity as P, InterceptFunction as Q, GetPropertyDescriptor as R, SwitchPropertyLine as S, ToolsServiceIdentity as T, IsPropertyReadonly as U, InterceptProperty as V, ObservableCollection as W, ConstructorFactory as X, SceneContextIdentity as Y, SelectionServiceIdentity as Z, SelectionServiceDefinition as _, SyncedSliderPropertyLine as a, ShowInspector as a0, AccordionSection as a1, Accordion as a2, Button as a3, Checkbox as a4, ColorPickerPopup as a5, InputHexField as a6, InputHsvField as a7, ComboBox as a8, DraggableLine as a9, Color4PropertyLine as aA, HexPropertyLine as aB, TextInputPropertyLine as aC, NumberInputPropertyLine as aD, LinkPropertyLine as aE, PropertyLine as aF, LineContainer as aG, PlaceholderPropertyLine as aH, SpinButtonPropertyLine as aI, StringifiedPropertyLine as aJ, TextAreaPropertyLine as aK, TextPropertyLine as aL, RotationVectorPropertyLine as aM, QuaternionPropertyLine as aN, Vector2PropertyLine as aO, Vector3PropertyLine as aP, Vector4PropertyLine as aQ, Dropdown as aa, NumberDropdown as ab, StringDropdown as ac, FactorGradientComponent as ad, Color3GradientComponent as ae, Color4GradientComponent as af, ColorStepGradientComponent as ag, InfoLabel as ah, List as ai, MessageBar as aj, PositionedPopover as ak, SearchBar as al, SearchBox as am, SpinButton as an, Switch as ao, SyncedSliderInput as ap, Textarea as aq, TextInput as ar, ToggleButton as as, FactorGradientList as at, Color3GradientList as au, Color4GradientList as av, Pane as aw, BooleanBadgePropertyLine as ax, CheckboxPropertyLine as ay, Color3PropertyLine as az, ShellServiceIdentity as b, MakePopoverTeachingMoment as c, TeachingMoment as d, SidePaneContainer as e, SceneExplorerServiceIdentity as f, SettingsServiceIdentity as g, StatsServiceIdentity as h, StringDropdownPropertyLine as i, BoundProperty as j, LinkToEntityPropertyLine as k, BuiltInsExtensionFeed as l, useProperty as m, useVector3Property as n, useColor3Property as o, useColor4Property as p, useQuaternionProperty as q, MakePropertyHook as r, useInterceptObservable as s, useEventfulState as t, useExtensionManager as u, useObservableState as v, useObservableCollection as w, useOrderedObservableCollection as x, usePollingObservable as y, useResource as z };
9921
- //# sourceMappingURL=index-ByzP7-y_.js.map
9975
+ //# sourceMappingURL=index-DE0QdD6v.js.map