@dxos/plugin-navtree 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb

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 (63) hide show
  1. package/dist/lib/browser/{app-graph-builder-RSMA6I22.mjs → app-graph-builder-XGA4GPGL.mjs} +5 -4
  2. package/dist/lib/browser/app-graph-builder-XGA4GPGL.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-6YPQ625I.mjs → chunk-63YLDLLE.mjs} +178 -98
  4. package/dist/lib/browser/chunk-63YLDLLE.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-AGQDZBPL.mjs → chunk-X2HDG62A.mjs} +3 -3
  6. package/dist/lib/browser/{chunk-AGQDZBPL.mjs.map → chunk-X2HDG62A.mjs.map} +3 -3
  7. package/dist/lib/browser/index.mjs +31 -30
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/{keyboard-32EH3N4K.mjs → keyboard-46XQHY2O.mjs} +6 -5
  10. package/dist/lib/browser/keyboard-46XQHY2O.mjs.map +7 -0
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{operation-resolver-IB75DC5O.mjs → operation-resolver-NNNDII45.mjs} +8 -7
  13. package/dist/lib/browser/operation-resolver-NNNDII45.mjs.map +7 -0
  14. package/dist/lib/browser/{react-surface-F6CVMS3Y.mjs → react-surface-APSEG23H.mjs} +10 -9
  15. package/dist/lib/browser/react-surface-APSEG23H.mjs.map +7 -0
  16. package/dist/lib/browser/{state-EVYQOUI3.mjs → state-M5YUCIQU.mjs} +6 -5
  17. package/dist/lib/browser/state-M5YUCIQU.mjs.map +7 -0
  18. package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
  19. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
  22. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
  23. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
  24. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  26. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  28. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  30. package/dist/types/src/components/CommandsDialog/CommandsDialog.d.ts.map +1 -1
  31. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  32. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  33. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  34. package/dist/types/src/components/Sidebar/L1Panel.d.ts +1 -1
  35. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  36. package/dist/types/src/experimental/Tree.stories.d.ts +18 -4
  37. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  38. package/dist/types/src/types/events.d.ts.map +1 -1
  39. package/dist/types/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +42 -41
  41. package/src/NavTreePlugin.tsx +21 -23
  42. package/src/capabilities/app-graph-builder/app-graph-builder.ts +4 -3
  43. package/src/capabilities/keyboard/keyboard.ts +5 -4
  44. package/src/capabilities/operation-resolver/operation-resolver.ts +5 -4
  45. package/src/capabilities/react-surface/react-surface.tsx +7 -6
  46. package/src/capabilities/state/state.ts +4 -3
  47. package/src/components/CommandsDialog/CommandsDialog.tsx +43 -44
  48. package/src/components/CommandsDialog/CommandsTrigger.tsx +3 -3
  49. package/src/components/NavTree/NavTree.stories.tsx +9 -8
  50. package/src/components/NavTreeContainer.tsx +12 -11
  51. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +1 -1
  52. package/src/components/Sidebar/L0Menu.tsx +2 -5
  53. package/src/components/Sidebar/L1Panel.tsx +146 -67
  54. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +1 -1
  55. package/src/experimental/Tree.stories.tsx +43 -49
  56. package/src/hooks.ts +1 -1
  57. package/src/types/events.ts +3 -2
  58. package/dist/lib/browser/app-graph-builder-RSMA6I22.mjs.map +0 -7
  59. package/dist/lib/browser/chunk-6YPQ625I.mjs.map +0 -7
  60. package/dist/lib/browser/keyboard-32EH3N4K.mjs.map +0 -7
  61. package/dist/lib/browser/operation-resolver-IB75DC5O.mjs.map +0 -7
  62. package/dist/lib/browser/react-surface-F6CVMS3Y.mjs.map +0 -7
  63. package/dist/lib/browser/state-EVYQOUI3.mjs.map +0 -7
@@ -5,7 +5,8 @@ import {
5
5
 
6
6
  // src/capabilities/app-graph-builder/app-graph-builder.ts
7
7
  import * as Effect from "effect/Effect";
8
- import { Capability, Common } from "@dxos/app-framework";
8
+ import { Capability } from "@dxos/app-framework";
9
+ import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
9
10
  import { Operation } from "@dxos/operation";
10
11
  import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
11
12
  var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
@@ -15,7 +16,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
15
16
  actions: () => Effect.succeed([
16
17
  {
17
18
  id: COMMANDS_DIALOG,
18
- data: () => Operation.invoke(Common.LayoutOperation.UpdateDialog, {
19
+ data: () => Operation.invoke(LayoutOperation.UpdateDialog, {
19
20
  subject: COMMANDS_DIALOG,
20
21
  blockAlign: "start"
21
22
  }),
@@ -35,9 +36,9 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
35
36
  }
36
37
  ])
37
38
  });
38
- return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
39
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
39
40
  }));
40
41
  export {
41
42
  app_graph_builder_default as default
42
43
  };
43
- //# sourceMappingURL=app-graph-builder-RSMA6I22.mjs.map
44
+ //# sourceMappingURL=app-graph-builder-XGA4GPGL.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: COMMANDS_DIALOG,\n data: () =>\n Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: COMMANDS_DIALOG,\n blockAlign: 'start',\n }),\n properties: {\n label: ['open commands label', { ns: meta.id }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n },\n ]),\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,mBAAmB;AAI1C,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAOC,aAAaC,gBAAgB;IACrDC,IAAIC,KAAKD;IACTE,OAAOC,YAAYC;IACnBC,SAAS,MACAC,eAAQ;MACb;QACEN,IAAIO;QACJC,MAAM,MACJC,UAAUC,OAAOC,gBAAgBC,cAAc;UAC7CC,SAASN;UACTO,YAAY;QACd,CAAA;QACFC,YAAY;UACVC,OAAO;YAAC;YAAuB;cAAEC,IAAIhB,KAAKD;YAAG;;UAC7CkB,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;KACD;EACL,CAAA;AAEA,SAAO3B,WAAW4B,YAAYC,gBAAgBC,iBAAiB3B,UAAAA;AACjE,CAAA,CAAA;",
6
+ "names": ["Effect", "Capability", "AppCapabilities", "LayoutOperation", "Operation", "GraphBuilder", "NodeMatcher", "Capability", "makeModule", "fnUntraced", "extensions", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "COMMANDS_DIALOG", "data", "Operation", "invoke", "LayoutOperation", "UpdateDialog", "subject", "blockAlign", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "contributes", "AppCapabilities", "AppGraphBuilder"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NavTreeCapabilities
3
- } from "./chunk-AGQDZBPL.mjs";
3
+ } from "./chunk-X2HDG62A.mjs";
4
4
  import {
5
5
  COMMANDS_DIALOG,
6
6
  KEY_BINDING,
@@ -9,8 +9,9 @@ import {
9
9
 
10
10
  // src/components/CommandsDialog/CommandsDialog.tsx
11
11
  import React, { forwardRef, useMemo, useState } from "react";
12
- import { Common } from "@dxos/app-framework";
13
- import { useAppGraph, useOperationInvoker } from "@dxos/app-framework/react";
12
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
13
+ import { LayoutOperation } from "@dxos/app-toolkit";
14
+ import { useAppGraph } from "@dxos/app-toolkit/ui";
14
15
  import { Keyboard, keySymbols } from "@dxos/keyboard";
15
16
  import { Graph, Node, useActionRunner } from "@dxos/plugin-graph";
16
17
  import { useActions } from "@dxos/plugin-graph";
@@ -56,13 +57,9 @@ var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, f
56
57
  ns: meta.id
57
58
  })), /* @__PURE__ */ React.createElement(SearchList.Root, {
58
59
  onSearch: handleSearch
59
- }, /* @__PURE__ */ React.createElement("div", {
60
- "aria-label": t("command list input placeholder"),
61
- role: "combobox",
62
- "aria-expanded": "true"
63
- }, /* @__PURE__ */ React.createElement(SearchList.Input, {
60
+ }, /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(SearchList.Input, {
64
61
  placeholder: t("command list input placeholder")
65
- }), /* @__PURE__ */ React.createElement(SearchList.Content, null, /* @__PURE__ */ React.createElement(SearchList.Viewport, null, results.map((action) => {
62
+ }), /* @__PURE__ */ React.createElement(SearchList.Viewport, null, results.map((action) => {
66
63
  const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[getHostPlatform()];
67
64
  return /* @__PURE__ */ React.createElement(SearchList.Item, {
68
65
  value: action.id,
@@ -78,7 +75,7 @@ var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, f
78
75
  setSelected(action.id);
79
76
  return;
80
77
  }
81
- invokeSync(Common.LayoutOperation.UpdateDialog, {
78
+ invokeSync(LayoutOperation.UpdateDialog, {
82
79
  state: false
83
80
  });
84
81
  setTimeout(() => {
@@ -97,7 +94,7 @@ var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, f
97
94
  "data-testid": action.properties.testId
98
95
  }
99
96
  });
100
- }))))), /* @__PURE__ */ React.createElement("div", {
97
+ })))), /* @__PURE__ */ React.createElement("div", {
101
98
  role: "none",
102
99
  className: "pli-cardSpacingInline pbe-cardSpacingBlock"
103
100
  }, /* @__PURE__ */ React.createElement(Dialog.Close, {
@@ -111,15 +108,15 @@ var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, f
111
108
 
112
109
  // src/components/CommandsDialog/CommandsTrigger.tsx
113
110
  import React2 from "react";
114
- import { Common as Common2 } from "@dxos/app-framework";
115
- import { useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/react";
111
+ import { useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
112
+ import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
116
113
  import { Button as Button2, Icon, useTranslation as useTranslation2 } from "@dxos/react-ui";
117
114
  var CommandsTrigger = () => {
118
115
  const { invokeSync } = useOperationInvoker2();
119
116
  const { t } = useTranslation2(meta.id);
120
117
  return /* @__PURE__ */ React2.createElement(Button2, {
121
118
  classNames: "m-1 pli-1 lg:pli-2",
122
- onClick: () => invokeSync(Common2.LayoutOperation.UpdateDialog, {
119
+ onClick: () => invokeSync(LayoutOperation2.UpdateDialog, {
123
120
  subject: COMMANDS_DIALOG,
124
121
  blockAlign: "start"
125
122
  })
@@ -194,10 +191,11 @@ var l0ItemType = (item) => {
194
191
  import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
195
192
  import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
196
193
  import React10, { forwardRef as forwardRef4, memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
197
- import { Common as Common3 } from "@dxos/app-framework";
198
- import { Surface, useAppGraph as useAppGraph2, useLayout, useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/react";
194
+ import { Surface, useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
195
+ import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
196
+ import { useAppGraph as useAppGraph2, useLayout } from "@dxos/app-toolkit/ui";
199
197
  import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
200
- import { Graph as Graph3, Node as Node4, useActionRunner as useActionRunner4 } from "@dxos/plugin-graph";
198
+ import { Graph as Graph3, Node as Node5, useActionRunner as useActionRunner5 } from "@dxos/plugin-graph";
201
199
  import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
202
200
  import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
203
201
  import { isTreeData } from "@dxos/react-ui-list";
@@ -207,7 +205,7 @@ import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
207
205
  // src/hooks.ts
208
206
  import { useAtomValue } from "@effect-atom/atom-react";
209
207
  import { useEffect as useEffect2, useMemo as useMemo5 } from "react";
210
- import { useCapability } from "@dxos/app-framework/react";
208
+ import { useCapability } from "@dxos/app-framework/ui";
211
209
 
212
210
  // src/components/NavTree/NavTree.tsx
213
211
  import React9, { forwardRef as forwardRef3, useMemo as useMemo4 } from "react";
@@ -518,11 +516,14 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
518
516
  className: mx(l0ItemRoot, "grid place-items-center dx-focus-ring-group", '[body[data-platform="macos"]_&]:mt-[30px]')
519
517
  }, /* @__PURE__ */ React4.createElement("div", {
520
518
  role: "none",
521
- className: mx(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
519
+ className: mx(l0ItemContent, "bs-[--rail-action] is-[--rail-action] group-hover/l0item:bg-hoverSurface")
522
520
  }, /* @__PURE__ */ React4.createElement(Icon2, {
523
521
  icon: "ph--list--regular",
524
522
  size: 5
525
- }))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
523
+ }))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, {
524
+ thin: true,
525
+ orientation: "vertical"
526
+ }, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
526
527
  role: "none",
527
528
  className: mx([
528
529
  "flex flex-col gap-1 pbs-1",
@@ -537,9 +538,7 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
537
538
  ...hasRearrangeableItems && {
538
539
  onRearrange: handleRearrange
539
540
  }
540
- }))), /* @__PURE__ */ React4.createElement(ScrollArea.Scrollbar, {
541
- orientation: "vertical"
542
- }, /* @__PURE__ */ React4.createElement(ScrollArea.Thumb, null)))), /* @__PURE__ */ React4.createElement("div", {
541
+ }))))), /* @__PURE__ */ React4.createElement("div", {
543
542
  role: "none",
544
543
  className: "grid grid-cols-1 auto-rows-[--rail-action] pbs-2"
545
544
  }, pinnedItems.map((item) => /* @__PURE__ */ React4.createElement(L0Item, {
@@ -566,9 +565,13 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
566
565
  };
567
566
 
568
567
  // src/components/Sidebar/L1Panel.tsx
568
+ import * as Effect from "effect/Effect";
569
569
  import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
570
- import { DensityProvider, IconButton as IconButton2, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
570
+ import { Node as Node4 } from "@dxos/app-graph";
571
+ import { useActionRunner as useActionRunner4 } from "@dxos/plugin-graph";
572
+ import { DensityProvider, IconButton as IconButton2, ScrollArea as ScrollArea2, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
571
573
  import { Tree } from "@dxos/react-ui-list";
574
+ import { DropdownMenu as DropdownMenu3, MenuProvider as MenuProvider3 } from "@dxos/react-ui-menu";
572
575
  import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
573
576
  import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/ui-theme";
574
577
 
@@ -767,10 +770,10 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
767
770
  item,
768
771
  currentItemId,
769
772
  onBack
770
- }), /* @__PURE__ */ React7.createElement("div", {
771
- role: "none",
772
- className: "overflow-y-auto"
773
- }, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
773
+ }), /* @__PURE__ */ React7.createElement(ScrollArea2.Root, {
774
+ thin: true,
775
+ orientation: "vertical"
776
+ }, /* @__PURE__ */ React7.createElement(ScrollArea2.Viewport, null, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
774
777
  ...navTreeContext,
775
778
  id: alternateTree.id,
776
779
  root: alternateTree,
@@ -788,12 +791,81 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
788
791
  gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
789
792
  renderColumns: NavTreeItemColumns,
790
793
  draggable: true
791
- }))));
794
+ })))));
792
795
  };
793
796
  var L1PanelHeader = ({ item, path, onBack }) => {
794
797
  const { t } = useTranslation6(meta.id);
795
- const { setAlternateTree, ...navTreeContext } = useNavTreeContext();
798
+ const { renderItemEnd: ItemEnd } = useNavTreeContext();
796
799
  const title = toLocalizedString5(item.properties.label, t);
800
+ const { primaryAction, groupedActions, menuActions, onAction } = useL1MenuActions({
801
+ item,
802
+ path
803
+ });
804
+ useLoadDescendents(item);
805
+ return /* @__PURE__ */ React7.createElement("div", {
806
+ className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
807
+ }, /* @__PURE__ */ React7.createElement("div", {
808
+ className: "is-6"
809
+ }), /* @__PURE__ */ React7.createElement("h2", {
810
+ className: "flex-1 truncate min-is-0"
811
+ }, title), /* @__PURE__ */ React7.createElement("div", {
812
+ role: "none",
813
+ className: "contents app-no-drag"
814
+ }, primaryAction?.properties?.disposition === "list-item-primary" && !primaryAction?.properties?.disabled && /* @__PURE__ */ React7.createElement(NavTreeItemAction, {
815
+ testId: primaryAction.properties?.testId,
816
+ label: toLocalizedString5(primaryAction.properties?.label, t),
817
+ icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
818
+ parent: item,
819
+ monolithic: Node4.isAction(primaryAction),
820
+ menuActions: Node4.isAction(primaryAction) ? [
821
+ primaryAction
822
+ ] : groupedActions[primaryAction?.id ?? ""],
823
+ menuType: primaryAction.properties?.menuType,
824
+ caller: NAV_TREE_ITEM
825
+ }), menuActions.length === 1 && /* @__PURE__ */ React7.createElement(IconButton2, {
826
+ size: 5,
827
+ density: "coarse",
828
+ classNames: [
829
+ "shrink-0 pli-2 pointer-fine:pli-1",
830
+ hoverableControlItem2,
831
+ hoverableOpenControlItem2
832
+ ],
833
+ variant: "ghost",
834
+ icon: menuActions[0].properties?.icon ?? "ph--placeholder--regular",
835
+ iconOnly: true,
836
+ label: toLocalizedString5(menuActions[0].properties?.label, t),
837
+ "data-testid": menuActions[0].properties?.testId,
838
+ onClick: () => onAction(menuActions[0])
839
+ }), menuActions.length > 1 && /* @__PURE__ */ React7.createElement(MenuProvider3, {
840
+ onAction
841
+ }, /* @__PURE__ */ React7.createElement(DropdownMenu3.Root, {
842
+ group: item,
843
+ items: menuActions,
844
+ caller: NAV_TREE_ITEM
845
+ }, /* @__PURE__ */ React7.createElement(DropdownMenu3.Trigger, {
846
+ asChild: true
847
+ }, /* @__PURE__ */ React7.createElement(IconButton2, {
848
+ size: 5,
849
+ density: "coarse",
850
+ classNames: [
851
+ "shrink-0 pli-2 pointer-fine:pli-1",
852
+ hoverableControlItem2,
853
+ hoverableOpenControlItem2
854
+ ],
855
+ variant: "ghost",
856
+ icon: "ph--dots-three-vertical--regular",
857
+ iconOnly: true,
858
+ label: t("tree item actions label"),
859
+ "data-testid": "navtree.treeItem.actionsLevel0"
860
+ })))), ItemEnd && /* @__PURE__ */ React7.createElement(ItemEnd, {
861
+ node: item,
862
+ open: true
863
+ })));
864
+ };
865
+ var useL1MenuActions = ({ item, path }) => {
866
+ const { t } = useTranslation6(meta.id);
867
+ const { setAlternateTree, useActions: useActions3, ...navTreeContext } = useNavTreeContext();
868
+ const runAction = useActionRunner4();
797
869
  const alternateTree = navTreeContext.useItems(item, {
798
870
  disposition: "alternate-tree"
799
871
  })[0];
@@ -805,61 +877,69 @@ var L1PanelHeader = ({ item, path, onBack }) => {
805
877
  path
806
878
  ]);
807
879
  const isAlternate = useIsAlternateTree(alternatePath, item);
808
- const backCapable = item.id.startsWith("!") || isAlternate;
809
- const handleOpen = useCallback2(() => {
810
- setAlternateTree?.(alternatePath, true);
880
+ const { actions: _actions, groupedActions } = useActions3(item);
881
+ const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
882
+ const graphMenuActions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => Node4.isAction(action) ? [
883
+ action
884
+ ] : []).filter((a) => [
885
+ "list-item",
886
+ "list-item-primary"
887
+ ].includes(a.properties?.disposition));
888
+ const settingsActionId = `${item.id}~settings`;
889
+ const settingsAction = useMemo3(() => {
890
+ if (!alternateTree) {
891
+ return void 0;
892
+ }
893
+ return {
894
+ id: settingsActionId,
895
+ type: Node4.ActionType,
896
+ data: () => Effect.void,
897
+ properties: {
898
+ label: isAlternate ? [
899
+ "button back",
900
+ {
901
+ ns: meta.id
902
+ }
903
+ ] : alternateTree.properties.label ?? alternateTree.id,
904
+ icon: isAlternate ? "ph--arrow-u-down-left--regular" : alternateTree.properties.icon ?? "ph--placeholder--regular",
905
+ disposition: "list-item",
906
+ testId: isAlternate ? "navtree.backToSpace" : "navtree.spaceSettings"
907
+ }
908
+ };
811
909
  }, [
812
- alternatePath,
813
- setAlternateTree
910
+ alternateTree,
911
+ isAlternate,
912
+ settingsActionId,
913
+ t
814
914
  ]);
815
- const handleBack = useCallback2(() => {
816
- if (isAlternate) {
817
- setAlternateTree?.(alternatePath, false);
915
+ const menuActions = useMemo3(() => [
916
+ ...graphMenuActions,
917
+ ...settingsAction ? [
918
+ settingsAction
919
+ ] : []
920
+ ], [
921
+ graphMenuActions,
922
+ settingsAction
923
+ ]);
924
+ const onAction = useCallback2((action, params) => {
925
+ if (action.id === settingsActionId) {
926
+ setAlternateTree?.(alternatePath, !isAlternate);
818
927
  } else {
819
- onBack?.();
928
+ void runAction(action, params);
820
929
  }
821
930
  }, [
822
- isAlternate,
823
- alternatePath,
931
+ settingsActionId,
824
932
  setAlternateTree,
825
- onBack
933
+ alternatePath,
934
+ isAlternate,
935
+ runAction
826
936
  ]);
827
- return /* @__PURE__ */ React7.createElement("div", {
828
- className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
829
- }, /* @__PURE__ */ React7.createElement("div", {
830
- className: "is-6"
831
- }), /* @__PURE__ */ React7.createElement("h2", {
832
- className: "flex-1 truncate min-is-0"
833
- }, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
834
- "data-testid": "treeView.primaryTreeButton",
835
- variant: "ghost",
836
- icon: "ph--arrow-u-down-left--regular",
837
- iconOnly: true,
838
- label: t("button back"),
839
- classNames: [
840
- hoverableControlItem2,
841
- hoverableOpenControlItem2,
842
- "pointer-fine:pli-1"
843
- ],
844
- onClick: handleBack
845
- }) || alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
846
- "data-testid": "treeView.alternateTreeButton",
847
- variant: "ghost",
848
- icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
849
- iconOnly: true,
850
- label: toLocalizedString5(alternateTree.properties.label ?? alternateTree.id, t),
851
- classNames: [
852
- hoverableControlItem2,
853
- hoverableOpenControlItem2,
854
- "pointer-fine:pli-1"
855
- ],
856
- onClick: handleOpen
857
- }), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
858
- open: true,
859
- path,
860
- item,
861
- density: "coarse"
862
- }));
937
+ return {
938
+ primaryAction,
939
+ groupedActions,
940
+ menuActions,
941
+ onAction
942
+ };
863
943
  };
864
944
 
865
945
  // src/components/Sidebar/L1Tabs.tsx
@@ -1000,7 +1080,7 @@ var useIsAlternateTree = (path, _item) => {
1000
1080
 
1001
1081
  // src/components/NavTreeContainer.tsx
1002
1082
  var NODE_TYPE = "dxos/app-graph/node";
1003
- var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
1083
+ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface.Surface, {
1004
1084
  role: "navtree-item-end",
1005
1085
  data: {
1006
1086
  id: node.id,
@@ -1009,23 +1089,23 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Su
1009
1089
  },
1010
1090
  limit: 1
1011
1091
  });
1012
- var getChildrenFilter = (node) => !Node4.isActionLike(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden";
1092
+ var getChildrenFilter = (node) => !Node5.isActionLike(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden";
1013
1093
  var filterItems = (node, disposition) => {
1014
1094
  if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
1015
1095
  return false;
1016
1096
  } else if (!disposition) {
1017
- const action = Node4.isAction(node);
1097
+ const action = Node5.isAction(node);
1018
1098
  return !action || node.properties.disposition === "item";
1019
1099
  } else {
1020
1100
  return node.properties.disposition === disposition;
1021
1101
  }
1022
1102
  };
1023
1103
  var getItems = (graph, node, disposition) => {
1024
- return Graph3.getConnections(graph, node?.id ?? Node4.RootId, "outbound").filter((node2) => filterItems(node2, disposition));
1104
+ return Graph3.getConnections(graph, node?.id ?? Node5.RootId, "outbound").filter((node2) => filterItems(node2, disposition));
1025
1105
  };
1026
1106
  var useItems = (node, options) => {
1027
1107
  const { graph } = useAppGraph2();
1028
- const connections = useConnections(graph, node?.id ?? Node4.RootId);
1108
+ const connections = useConnections(graph, node?.id ?? Node5.RootId);
1029
1109
  const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
1030
1110
  return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
1031
1111
  };
@@ -1037,7 +1117,7 @@ var useActions2 = (node) => {
1037
1117
  return acc;
1038
1118
  }
1039
1119
  acc.actions.push(arg);
1040
- if (!Node4.isAction(arg)) {
1120
+ if (!Node5.isAction(arg)) {
1041
1121
  const actionGroup = Graph3.getActions(graph, arg.id);
1042
1122
  acc.groupedActions[arg.id] = actionGroup;
1043
1123
  }
@@ -1052,7 +1132,7 @@ var useActions2 = (node) => {
1052
1132
  var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, topbar }, forwardedRef) => {
1053
1133
  const [isLg] = useMediaQuery2("lg");
1054
1134
  const { invokeSync, invokePromise } = useOperationInvoker3();
1055
- const runAction = useActionRunner4();
1135
+ const runAction = useActionRunner5();
1056
1136
  const { graph } = useAppGraph2();
1057
1137
  const { getItem, setItem } = useNavTreeState();
1058
1138
  const layout = useLayout();
@@ -1089,16 +1169,16 @@ var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, top
1089
1169
  graph
1090
1170
  ]);
1091
1171
  const handleTabChange = useCallback3((node) => {
1092
- invokeSync(Common3.LayoutOperation.UpdateSidebar, {
1172
+ invokeSync(LayoutOperation3.UpdateSidebar, {
1093
1173
  state: node.id === tab ? navigationSidebarState === "expanded" ? isLg ? "collapsed" : "closed" : "expanded" : "expanded"
1094
1174
  });
1095
- invokeSync(Common3.LayoutOperation.SwitchWorkspace, {
1175
+ invokeSync(LayoutOperation3.SwitchWorkspace, {
1096
1176
  subject: node.id
1097
1177
  });
1098
1178
  if (layout.active.length === 0) {
1099
- const [item] = getItems(graph, node).filter((node2) => !Node4.isActionLike(node2));
1179
+ const [item] = getItems(graph, node).filter((node2) => !Node5.isActionLike(node2));
1100
1180
  if (item && item.data) {
1101
- invokeSync(Common3.LayoutOperation.Open, {
1181
+ invokeSync(LayoutOperation3.Open, {
1102
1182
  subject: [
1103
1183
  item.id
1104
1184
  ]
@@ -1125,7 +1205,7 @@ var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, top
1125
1205
  if (!node.data) {
1126
1206
  return;
1127
1207
  }
1128
- if (Node4.isAction(node)) {
1208
+ if (Node5.isAction(node)) {
1129
1209
  const [parent] = Graph3.getConnections(graph, node.id, "inbound");
1130
1210
  if (parent) {
1131
1211
  void runAction(node, {
@@ -1137,29 +1217,29 @@ var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, top
1137
1217
  }
1138
1218
  const current = getItem(path).current;
1139
1219
  if (!current) {
1140
- invokeSync(Common3.LayoutOperation.Open, {
1220
+ invokeSync(LayoutOperation3.Open, {
1141
1221
  subject: [
1142
1222
  node.id
1143
1223
  ],
1144
1224
  key: node.properties.key
1145
1225
  });
1146
1226
  } else if (option) {
1147
- invokeSync(Common3.LayoutOperation.Close, {
1227
+ invokeSync(LayoutOperation3.Close, {
1148
1228
  subject: [
1149
1229
  node.id
1150
1230
  ]
1151
1231
  });
1152
1232
  } else {
1153
- void invokePromise(Common3.LayoutOperation.ScrollIntoView, {
1233
+ void invokePromise(LayoutOperation3.ScrollIntoView, {
1154
1234
  subject: node.id
1155
1235
  });
1156
1236
  }
1157
1237
  const defaultAction = Graph3.getActions(graph, node.id).find((action) => action.properties?.disposition === "default");
1158
- if (Node4.isAction(defaultAction)) {
1238
+ if (Node5.isAction(defaultAction)) {
1159
1239
  void runAction(defaultAction);
1160
1240
  }
1161
1241
  if (!isLg) {
1162
- invokeSync(Common3.LayoutOperation.UpdateSidebar, {
1242
+ invokeSync(LayoutOperation3.UpdateSidebar, {
1163
1243
  state: "closed"
1164
1244
  });
1165
1245
  }
@@ -1171,7 +1251,7 @@ var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, top
1171
1251
  isLg,
1172
1252
  runAction
1173
1253
  ]);
1174
- const handleBack = useCallback3(() => invokeSync(Common3.LayoutOperation.RevertWorkspace), [
1254
+ const handleBack = useCallback3(() => invokeSync(LayoutOperation3.RevertWorkspace), [
1175
1255
  invokeSync
1176
1256
  ]);
1177
1257
  useEffect3(() => {
@@ -1269,7 +1349,7 @@ var NavTreeContainer$ = /* @__PURE__ */ forwardRef4(({ tab, popoverAnchorId, top
1269
1349
  return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
1270
1350
  value: navTreeContextValue
1271
1351
  }, /* @__PURE__ */ React10.createElement(NavTree, {
1272
- id: Node4.RootId,
1352
+ id: Node5.RootId,
1273
1353
  root: Graph3.getRoot(graph),
1274
1354
  open: layout.sidebarOpen,
1275
1355
  ref: forwardedRef
@@ -1290,4 +1370,4 @@ export {
1290
1370
  NavTreeContainer,
1291
1371
  NavTreeDocumentTitle
1292
1372
  };
1293
- //# sourceMappingURL=chunk-6YPQ625I.mjs.map
1373
+ //# sourceMappingURL=chunk-63YLDLLE.mjs.map