@dxos/plugin-navtree 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77

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 (129) hide show
  1. package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs → app-graph-builder-BCXDEDN7.mjs} +9 -9
  2. package/dist/lib/browser/app-graph-builder-BCXDEDN7.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-TZA65AKW.mjs → chunk-6AZKY5WZ.mjs} +279 -237
  4. package/dist/lib/browser/chunk-6AZKY5WZ.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-WCARAZ7J.mjs → chunk-LPAREX6J.mjs} +4 -4
  6. package/dist/lib/browser/chunk-LPAREX6J.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-ZENLR72O.mjs +14 -0
  8. package/dist/lib/browser/chunk-ZENLR72O.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +8 -11
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-G6COWRWW.mjs} +6 -6
  12. package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs.map → intent-resolver-G6COWRWW.mjs.map} +3 -3
  13. package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-AHSAWKXA.mjs} +4 -4
  14. package/dist/lib/{node-esm/keyboard-MOZWHFUM.mjs.map → browser/keyboard-AHSAWKXA.mjs.map} +2 -2
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/{react-surface-N2HPMYCU.mjs → react-surface-FOCB4Y5R.mjs} +10 -10
  17. package/dist/lib/browser/react-surface-FOCB4Y5R.mjs.map +7 -0
  18. package/dist/lib/browser/{state-54DY3DOY.mjs → state-2Q623V7U.mjs} +7 -7
  19. package/dist/lib/browser/state-2Q623V7U.mjs.map +7 -0
  20. package/dist/types/src/NavTreePlugin.d.ts +1 -1
  21. package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  23. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/index.d.ts +6 -6
  26. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  28. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/keyboard.d.ts +1 -1
  30. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  31. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  32. package/dist/types/src/capabilities/state.d.ts +2 -2
  33. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  34. package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
  35. package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
  36. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  37. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +26 -3
  38. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  40. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -4
  41. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +1 -1
  43. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
  44. package/dist/types/src/components/Sidebar/L0Menu.d.ts +2 -0
  45. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  46. package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
  47. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  48. package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
  49. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
  50. package/dist/types/src/components/Sidebar/index.d.ts +1 -0
  51. package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
  52. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
  53. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -5
  54. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/index.d.ts +1 -1
  56. package/dist/types/src/components/index.d.ts.map +1 -1
  57. package/dist/types/src/components/types.d.ts +2 -2
  58. package/dist/types/src/components/types.d.ts.map +1 -1
  59. package/dist/types/src/events.d.ts.map +1 -1
  60. package/dist/types/src/experimental/Tree.d.ts +4 -5
  61. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  62. package/dist/types/src/experimental/Tree.stories.d.ts +10 -4
  63. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  64. package/dist/types/src/meta.d.ts +2 -3
  65. package/dist/types/src/meta.d.ts.map +1 -1
  66. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  67. package/dist/types/src/translations.d.ts +1 -0
  68. package/dist/types/src/translations.d.ts.map +1 -1
  69. package/dist/types/src/util.d.ts +1 -2
  70. package/dist/types/src/util.d.ts.map +1 -1
  71. package/dist/types/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +49 -49
  73. package/src/NavTreePlugin.tsx +75 -76
  74. package/src/capabilities/app-graph-builder.ts +5 -5
  75. package/src/capabilities/capabilities.ts +2 -2
  76. package/src/capabilities/intent-resolver.ts +1 -1
  77. package/src/capabilities/keyboard.ts +2 -2
  78. package/src/capabilities/react-surface.tsx +5 -5
  79. package/src/capabilities/state.ts +4 -3
  80. package/src/components/CommandsDialog/CommandsDialog.tsx +5 -5
  81. package/src/components/CommandsDialog/CommandsTrigger.tsx +5 -7
  82. package/src/components/NavTree/NavTree.stories.tsx +21 -18
  83. package/src/components/NavTree/NavTree.tsx +7 -3
  84. package/src/components/NavTreeContainer.tsx +43 -18
  85. package/src/components/NavTreeDocumentTitle.tsx +2 -2
  86. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
  87. package/src/components/NavTreeItem/NavTreeItemAction.tsx +9 -9
  88. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +9 -9
  89. package/src/components/Sidebar/L0Menu.tsx +51 -50
  90. package/src/components/Sidebar/L1Panel.tsx +71 -93
  91. package/src/components/Sidebar/L1Tabs.tsx +58 -0
  92. package/src/components/Sidebar/index.ts +1 -0
  93. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
  94. package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
  95. package/src/components/index.ts +1 -1
  96. package/src/components/types.ts +3 -2
  97. package/src/events.ts +2 -2
  98. package/src/experimental/Tree.stories.tsx +37 -36
  99. package/src/experimental/Tree.tsx +16 -34
  100. package/src/meta.ts +5 -7
  101. package/src/testing/app-graph-builder.ts +1 -1
  102. package/src/translations.ts +1 -0
  103. package/src/util.ts +2 -20
  104. package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
  106. package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
  107. package/dist/lib/browser/chunk-TZA65AKW.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
  109. package/dist/lib/browser/keyboard-QRS6WOQH.mjs.map +0 -7
  110. package/dist/lib/browser/react-surface-N2HPMYCU.mjs.map +0 -7
  111. package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
  112. package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs +0 -46
  113. package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-CY7QWR4R.mjs +0 -1429
  115. package/dist/lib/node-esm/chunk-CY7QWR4R.mjs.map +0 -7
  116. package/dist/lib/node-esm/chunk-P2JGW3WR.mjs +0 -18
  117. package/dist/lib/node-esm/chunk-P2JGW3WR.mjs.map +0 -7
  118. package/dist/lib/node-esm/chunk-V3QXFDDP.mjs +0 -16
  119. package/dist/lib/node-esm/chunk-V3QXFDDP.mjs.map +0 -7
  120. package/dist/lib/node-esm/index.mjs +0 -150
  121. package/dist/lib/node-esm/index.mjs.map +0 -7
  122. package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs +0 -48
  123. package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs.map +0 -7
  124. package/dist/lib/node-esm/keyboard-MOZWHFUM.mjs +0 -52
  125. package/dist/lib/node-esm/meta.json +0 -1
  126. package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs +0 -52
  127. package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs.map +0 -7
  128. package/dist/lib/node-esm/state-Z3OTRC2I.mjs +0 -118
  129. package/dist/lib/node-esm/state-Z3OTRC2I.mjs.map +0 -7
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  NavTreeCapabilities
3
- } from "./chunk-WCARAZ7J.mjs";
3
+ } from "./chunk-LPAREX6J.mjs";
4
4
  import {
5
5
  COMMANDS_DIALOG,
6
6
  KEY_BINDING,
7
- NAVTREE_PLUGIN
8
- } from "./chunk-ERDGQTH5.mjs";
7
+ meta
8
+ } from "./chunk-ZENLR72O.mjs";
9
9
 
10
10
  // src/components/CommandsDialog/CommandsDialog.tsx
11
11
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
12
12
  import React, { useMemo, useState } from "react";
13
- import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
13
+ import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
14
14
  import { isAction, isActionGroup } from "@dxos/app-graph";
15
15
  import { Keyboard, keySymbols } from "@dxos/keyboard";
16
16
  import { useActions } from "@dxos/plugin-graph";
17
- import { Button, Dialog, Icon, useTranslation, toLocalizedString } from "@dxos/react-ui";
17
+ import { Button, Dialog, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
18
18
  import { SearchList } from "@dxos/react-ui-searchlist";
19
19
  import { cardDialogContent, cardDialogHeader, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
20
20
  import { descriptionText, mx } from "@dxos/react-ui-theme";
@@ -22,7 +22,7 @@ import { getHostPlatform } from "@dxos/util";
22
22
  var CommandsDialogContent = ({ selected: initial }) => {
23
23
  var _effect = _useSignals();
24
24
  try {
25
- const { t } = useTranslation(NAVTREE_PLUGIN);
25
+ const { t } = useTranslation(meta.id);
26
26
  const [selected, setSelected] = useState(initial);
27
27
  const { dispatchPromise: dispatch } = useIntentDispatcher();
28
28
  const { graph } = useAppGraph();
@@ -53,7 +53,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
53
53
  }, /* @__PURE__ */ React.createElement(Dialog.Title, {
54
54
  classNames: cardDialogHeader
55
55
  }, t("commands dialog title", {
56
- ns: NAVTREE_PLUGIN
56
+ ns: meta.id
57
57
  })), /* @__PURE__ */ React.createElement(SearchList.Root, {
58
58
  label: t("command list input placeholder"),
59
59
  classNames: cardDialogSearchListRoot
@@ -119,16 +119,14 @@ var CommandsDialogContent = ({ selected: initial }) => {
119
119
 
120
120
  // src/components/CommandsDialog/CommandsTrigger.tsx
121
121
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
122
- import { MagnifyingGlass } from "@phosphor-icons/react";
123
122
  import React2 from "react";
124
- import { createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
125
- import { Button as Button2, useTranslation as useTranslation2 } from "@dxos/react-ui";
126
- import { getSize } from "@dxos/react-ui-theme";
123
+ import { LayoutAction as LayoutAction2, createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
124
+ import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
127
125
  var CommandsTrigger = () => {
128
126
  var _effect = _useSignals2();
129
127
  try {
130
128
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
131
- const { t } = useTranslation2(NAVTREE_PLUGIN);
129
+ const { t } = useTranslation2(meta.id);
132
130
  return /* @__PURE__ */ React2.createElement(Button2, {
133
131
  classNames: "m-1 pli-1 lg:pli-2",
134
132
  onClick: () => dispatch(createIntent2(LayoutAction2.UpdateDialog, {
@@ -140,8 +138,9 @@ var CommandsTrigger = () => {
140
138
  }))
141
139
  }, /* @__PURE__ */ React2.createElement("span", {
142
140
  className: "text-description font-normal grow text-start"
143
- }, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(MagnifyingGlass, {
144
- className: getSize(5)
141
+ }, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(Icon2, {
142
+ icon: "ph--magnifying-glass--regular",
143
+ size: 5
145
144
  }));
146
145
  } finally {
147
146
  _effect.f();
@@ -149,7 +148,7 @@ var CommandsTrigger = () => {
149
148
  };
150
149
 
151
150
  // src/util.ts
152
- import { isAction as isAction2, isActionLike } from "@dxos/app-graph";
151
+ import { isActionLike } from "@dxos/app-graph";
153
152
  import { isNonNullable } from "@dxos/util";
154
153
  var getParent = (graph, node, path) => {
155
154
  const parentId = path[path.length - 2];
@@ -199,22 +198,6 @@ var getChildren = (graph, node, path = []) => {
199
198
  return nextPath.includes(n.id) ? void 0 : n;
200
199
  }).filter(isNonNullable);
201
200
  };
202
- var getActions = (graph, node) => {
203
- return graph.getActions(node.id).reduce((acc, arg) => {
204
- if (arg.properties.disposition === "item") {
205
- return acc;
206
- }
207
- acc.actions.push(arg);
208
- if (!isAction2(arg)) {
209
- const actionGroup = graph.getActions(arg.id);
210
- acc.groupedActions[arg.id] = actionGroup;
211
- }
212
- return acc;
213
- }, {
214
- actions: [],
215
- groupedActions: {}
216
- });
217
- };
218
201
  var l0ItemType = (item) => {
219
202
  if (item.properties.disposition === "collection") {
220
203
  return "collection";
@@ -228,23 +211,31 @@ var l0ItemType = (item) => {
228
211
  };
229
212
 
230
213
  // src/components/NavTreeContainer.tsx
231
- import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
214
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
232
215
  import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
233
216
  import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
234
217
  import { untracked } from "@preact/signals-core";
235
- import React9, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo5 } from "react";
236
- import { createIntent as createIntent3, LayoutAction as LayoutAction3, Surface, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
237
- import { isAction as isAction4, isActionLike as isActionLike2, ROOT_ID } from "@dxos/app-graph";
218
+ import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
219
+ import { LayoutAction as LayoutAction3, Surface, createIntent as createIntent3, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
220
+ import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
238
221
  import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
239
- import { useConnections } from "@dxos/plugin-graph";
222
+ import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
240
223
  import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
241
224
  import { isTreeData } from "@dxos/react-ui-list";
242
- import { mx as mx5 } from "@dxos/react-ui-theme";
225
+ import { mx as mx3 } from "@dxos/react-ui-theme";
243
226
  import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
244
227
 
228
+ // src/capabilities/index.ts
229
+ import { lazy } from "@dxos/app-framework";
230
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-BCXDEDN7.mjs"));
231
+ var IntentResolver = lazy(() => import("./intent-resolver-G6COWRWW.mjs"));
232
+ var Keyboard2 = lazy(() => import("./keyboard-AHSAWKXA.mjs"));
233
+ var ReactSurface = lazy(() => import("./react-surface-FOCB4Y5R.mjs"));
234
+ var State = lazy(() => import("./state-2Q623V7U.mjs"));
235
+
245
236
  // src/components/NavTree/NavTree.tsx
246
- import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
247
- import React8, { useMemo as useMemo4 } from "react";
237
+ import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
238
+ import React9, { useMemo as useMemo5 } from "react";
248
239
  import { Tabs as Tabs3 } from "@dxos/react-ui-tabs";
249
240
 
250
241
  // src/hooks.ts
@@ -260,7 +251,7 @@ var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Mis
260
251
  import { useEffect } from "react";
261
252
  import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
262
253
  var NavTreeDocumentTitle = ({ node }) => {
263
- const { t } = useTranslation3(NAVTREE_PLUGIN);
254
+ const { t } = useTranslation3(meta.id);
264
255
  useEffect(() => {
265
256
  document.title = node ? toLocalizedString2(node.properties.label, t) : t("current app name", {
266
257
  ns: "appkit"
@@ -295,11 +286,12 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
295
286
  import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
296
287
  import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
297
288
  import { invariant } from "@dxos/invariant";
298
- import { Icon as Icon2, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
299
- import { MenuProvider, DropdownMenu } from "@dxos/react-ui-menu";
289
+ import { DxAvatar } from "@dxos/lit-ui/react";
290
+ import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
291
+ import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
300
292
  import { Tabs } from "@dxos/react-ui-tabs";
301
293
  import { mx as mx2 } from "@dxos/react-ui-theme";
302
- import { arrayMove, getFirstTwoRenderableChars } from "@dxos/util";
294
+ import { arrayMove } from "@dxos/util";
303
295
 
304
296
  // src/components/UserAccountAvatar/UserAccountAvatar.tsx
305
297
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
@@ -310,8 +302,10 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
310
302
  var _effect = _useSignals3();
311
303
  try {
312
304
  const fallbackValue = hexToFallback(userId ?? "0");
313
- return /* @__PURE__ */ React3.createElement("div", {
314
- className: "grid place-items-center",
305
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(L0ItemActiveTabIndicator, {
306
+ classNames: "inset-block-6"
307
+ }), /* @__PURE__ */ React3.createElement("div", {
308
+ className: "grid place-items-center dx-focus-ring-group-indicator rounded-full",
315
309
  "data-joyride": "welcome/account"
316
310
  }, /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Avatar.Content, {
317
311
  variant: "circle",
@@ -320,7 +314,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
320
314
  hue: hue || fallbackValue.hue,
321
315
  fallback: emoji || fallbackValue.emoji,
322
316
  "data-testid": "treeView.userAccount"
323
- })));
317
+ }))));
324
318
  } finally {
325
319
  _effect.f();
326
320
  }
@@ -383,7 +377,7 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
383
377
  item.id,
384
378
  path
385
379
  ]);
386
- const { t } = useTranslation4(NAVTREE_PLUGIN);
380
+ const { t } = useTranslation4(meta.id);
387
381
  const localizedString = toLocalizedString3(item.properties.label, t);
388
382
  const handleClick = useL0ItemClick({
389
383
  item,
@@ -401,15 +395,15 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
401
395
  "data-testid": testId,
402
396
  "data-itemid": id
403
397
  } : {
404
- onClick: handleClick
398
+ onClick: handleClick,
399
+ role: "button"
405
400
  };
406
- const Root = type === "collection" ? "h2" : type === "tab" ? Tabs.TabPrimitive : "button";
407
401
  return /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
408
402
  asChild: true,
409
403
  delayDuration: 0,
410
404
  side: "right",
411
405
  content: localizedString
412
- }, /* @__PURE__ */ React4.createElement(Root, {
406
+ }, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
413
407
  ...rootProps,
414
408
  "data-type": type,
415
409
  className: mx2(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint]),
@@ -419,28 +413,13 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
419
413
  _effect.f();
420
414
  }
421
415
  });
422
- var L0Avatar = ({ item }) => {
416
+ var L0ItemActiveTabIndicator = ({ classNames }) => {
423
417
  var _effect = _useSignals4();
424
418
  try {
425
- const { t } = useTranslation4(NAVTREE_PLUGIN);
426
- const type = l0ItemType(item);
427
- const hue = item.properties.hue ?? null;
428
- const hueFgStyle = hue && {
429
- style: {
430
- color: `var(--dx-${hue}SurfaceText)`
431
- }
432
- };
433
- const localizedString = toLocalizedString3(item.properties.label, t);
434
- const avatarValue = useMemo2(() => type === "tab" ? getFirstTwoRenderableChars(localizedString).join("").toUpperCase() : [], [
435
- type,
436
- item.properties.label,
437
- t
438
- ]);
439
- return /* @__PURE__ */ React4.createElement("span", {
440
- role: "img",
441
- className: "place-self-center text-xl font-light",
442
- ...hueFgStyle
443
- }, avatarValue);
419
+ return /* @__PURE__ */ React4.createElement("div", {
420
+ role: "none",
421
+ className: mx2("hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie", classNames)
422
+ });
444
423
  } finally {
445
424
  _effect.f();
446
425
  }
@@ -448,7 +427,7 @@ var L0Avatar = ({ item }) => {
448
427
  var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
449
428
  var _effect = _useSignals4();
450
429
  try {
451
- const { t } = useTranslation4(NAVTREE_PLUGIN);
430
+ const { t } = useTranslation4(meta.id);
452
431
  const itemElement = useRef(null);
453
432
  const [closestEdge, setEdge] = useState2(null);
454
433
  const localizedString = toLocalizedString3(item.properties.label, t);
@@ -537,10 +516,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
537
516
  className: mx2(l0ItemContent, pinned ? "p-2 group-hover/l0item:bg-activeSurface" : "is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface")
538
517
  }, /* @__PURE__ */ React4.createElement(ItemAvatar, {
539
518
  item
540
- })), /* @__PURE__ */ React4.createElement("div", {
541
- role: "none",
542
- className: "hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie"
543
- }), /* @__PURE__ */ React4.createElement("span", {
519
+ })), /* @__PURE__ */ React4.createElement(L0ItemActiveTabIndicator, null), /* @__PURE__ */ React4.createElement("span", {
544
520
  id: `${item.id}__label`,
545
521
  className: "sr-only"
546
522
  }, localizedString), closestEdge && /* @__PURE__ */ React4.createElement(ListItem.DropIndicator, {
@@ -553,6 +529,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
553
529
  var ItemAvatar = ({ item }) => {
554
530
  var _effect = _useSignals4();
555
531
  try {
532
+ const { t } = useTranslation4(meta.id);
556
533
  const type = l0ItemType(item);
557
534
  if (item.properties.icon) {
558
535
  const hue = item.properties.hue ?? null;
@@ -561,15 +538,21 @@ var ItemAvatar = ({ item }) => {
561
538
  color: `var(--dx-${hue}SurfaceText)`
562
539
  }
563
540
  };
564
- return /* @__PURE__ */ React4.createElement(Icon2, {
541
+ return /* @__PURE__ */ React4.createElement(Icon3, {
565
542
  icon: item.properties.icon,
566
- size: 5,
543
+ size: 6,
567
544
  ...hueFgStyle
568
545
  });
569
546
  }
570
547
  if (type === "tab" && item.properties.disposition !== "pin-end") {
571
- return /* @__PURE__ */ React4.createElement(L0Avatar, {
572
- item
548
+ const hue = item.properties.hue ?? null;
549
+ const localizedString = toLocalizedString3(item.properties.label, t);
550
+ return /* @__PURE__ */ React4.createElement(DxAvatar, {
551
+ hue,
552
+ hueVariant: "surface",
553
+ variant: "square",
554
+ size: 12,
555
+ fallback: localizedString
573
556
  });
574
557
  }
575
558
  return null;
@@ -634,7 +617,7 @@ var L0Collection = ({ item, path }) => {
634
617
  var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }) => {
635
618
  var _effect = _useSignals4();
636
619
  try {
637
- const { t } = useTranslation4(NAVTREE_PLUGIN);
620
+ const { t } = useTranslation4(meta.id);
638
621
  return /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
639
622
  classNames: [
640
623
  "group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is",
@@ -648,16 +631,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
648
631
  content: t("app menu label"),
649
632
  side: "right",
650
633
  asChild: true
634
+ }, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
635
+ value: "options",
636
+ asChild: true,
637
+ role: "button"
651
638
  }, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
652
639
  "data-testid": "spacePlugin.addSpace",
653
- className: mx2(l0ItemRoot, "grid place-items-center")
640
+ className: mx2(l0ItemRoot, "grid place-items-center dx-focus-ring-group")
654
641
  }, /* @__PURE__ */ React4.createElement("div", {
655
642
  role: "none",
656
643
  className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
657
- }, /* @__PURE__ */ React4.createElement(Icon2, {
644
+ }, /* @__PURE__ */ React4.createElement(Icon3, {
658
645
  icon: "ph--list--regular",
659
646
  size: 5
660
- })))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
647
+ }))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
661
648
  role: "none",
662
649
  className: mx2([
663
650
  "flex flex-col gap-1 pbs-1",
@@ -720,17 +707,17 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
720
707
  // src/components/Sidebar/L1Panel.tsx
721
708
  import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
722
709
  import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
723
- import { Button as Button3, Icon as Icon3, IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
710
+ import { IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
724
711
  import { Tree } from "@dxos/react-ui-list";
725
712
  import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
726
- import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2, mx as mx4 } from "@dxos/react-ui-theme";
713
+ import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
727
714
 
728
715
  // src/components/NavTreeItem/NavTreeItemAction.tsx
729
716
  import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
730
717
  import React5 from "react";
731
- import { useTranslation as useTranslation5, toLocalizedString as toLocalizedString4, IconButton, useDensityContext } from "@dxos/react-ui";
718
+ import { IconButton, toLocalizedString as toLocalizedString4, useDensityContext, useTranslation as useTranslation5 } from "@dxos/react-ui";
732
719
  import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
733
- import { hoverableControlItem, hoverableOpenControlItem, mx as mx3 } from "@dxos/react-ui-theme";
720
+ import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
734
721
  var fallbackIcon = "ph--placeholder--regular";
735
722
  var fineActionButtonProps = {
736
723
  size: 4,
@@ -743,7 +730,7 @@ var coarseActionButtonProps = {
743
730
  var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions, caller }) => {
744
731
  var _effect = _useSignals5();
745
732
  try {
746
- const { t } = useTranslation5(NAVTREE_PLUGIN);
733
+ const { t } = useTranslation5(meta.id);
747
734
  const density = useDensityContext();
748
735
  return /* @__PURE__ */ React5.createElement(MenuProvider2, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, {
749
736
  group: parent,
@@ -753,7 +740,11 @@ var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions,
753
740
  asChild: true
754
741
  }, /* @__PURE__ */ React5.createElement(IconButton, {
755
742
  ...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
756
- classNames: mx3("shrink-0 pli-2 pointer-fine:pli-1", hoverableControlItem, hoverableOpenControlItem),
743
+ classNames: [
744
+ "shrink-0 pli-2 pointer-fine:pli-1",
745
+ hoverableControlItem,
746
+ hoverableOpenControlItem
747
+ ],
757
748
  variant: "ghost",
758
749
  icon: icon ?? fallbackIcon,
759
750
  iconOnly: true,
@@ -773,7 +764,12 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
773
764
  return /* @__PURE__ */ React5.createElement(IconButton, {
774
765
  ...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
775
766
  variant,
776
- classNames: mx3("shrink-0", hoverableControlItem, hoverableOpenControlItem, iconOnly ? "pli-2 pointer-fine:pli-1" : "p-2 pointer-fine:p-2 mie-1"),
767
+ classNames: [
768
+ "shrink-0",
769
+ hoverableControlItem,
770
+ hoverableOpenControlItem,
771
+ iconOnly ? "pli-2 pointer-fine:pli-1" : "p-2 pointer-fine:p-2 mie-1"
772
+ ],
777
773
  icon: icon ?? fallbackIcon,
778
774
  iconOnly,
779
775
  label: baseLabel,
@@ -799,7 +795,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
799
795
  var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
800
796
  var _effect = _useSignals5();
801
797
  try {
802
- const { t } = useTranslation5(NAVTREE_PLUGIN);
798
+ const { t } = useTranslation5(meta.id);
803
799
  const monolithicAction = menuActions?.length === 1 && menuActions[0];
804
800
  const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
805
801
  return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
@@ -820,17 +816,17 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
820
816
  // src/components/NavTreeItem/NavTreeItemColumns.tsx
821
817
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
822
818
  import React6, { Fragment, memo } from "react";
823
- import { isAction as isAction3 } from "@dxos/app-graph";
824
- import { DensityProvider, Popover, toLocalizedString as toLocalizedString5, Treegrid, useTranslation as useTranslation6 } from "@dxos/react-ui";
819
+ import { isAction as isAction2 } from "@dxos/app-graph";
820
+ import { DensityProvider, Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
825
821
  var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fine" }) => {
826
822
  var _effect = _useSignals6();
827
823
  try {
828
- const { t } = useTranslation6(NAVTREE_PLUGIN);
829
- const { getActions: getActions2, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
824
+ const { t } = useTranslation6(meta.id);
825
+ const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
830
826
  const level = path.length - 2;
831
- const { actions: _actions, groupedActions } = getActions2(item);
832
- const [primaryAction, ...secondaryActions] = _actions.toSorted((a, b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
833
- const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction3(action) ? [
827
+ const { actions: _actions, groupedActions } = useActions3(item);
828
+ const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
829
+ const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
834
830
  action
835
831
  ] : []).filter((a) => [
836
832
  "list-item",
@@ -838,7 +834,7 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
838
834
  ].includes(a.properties?.disposition));
839
835
  const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
840
836
  useLoadDescendents(item);
841
- useLoadDescendents(primaryAction && !isAction3(primaryAction) ? primaryAction : void 0);
837
+ useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
842
838
  return /* @__PURE__ */ React6.createElement(DensityProvider, {
843
839
  density
844
840
  }, /* @__PURE__ */ React6.createElement("div", {
@@ -849,8 +845,8 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
849
845
  label: toLocalizedString5(primaryAction.properties?.label, t),
850
846
  icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
851
847
  parent: item,
852
- monolithic: isAction3(primaryAction),
853
- menuActions: isAction3(primaryAction) ? [
848
+ monolithic: isAction2(primaryAction),
849
+ menuActions: isAction2(primaryAction) ? [
854
850
  primaryAction
855
851
  ] : groupedActions[primaryAction.id],
856
852
  menuType: primaryAction.properties?.menuType,
@@ -873,30 +869,14 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
873
869
  });
874
870
 
875
871
  // src/components/Sidebar/L1Panel.tsx
876
- var headingBackButtonLabel = "inset-0 min-is-0 truncate flex items-center pis-2";
877
- var TitleButton = ({ title, onClick }) => {
878
- var _effect = _useSignals7();
879
- try {
880
- return /* @__PURE__ */ React7.createElement(Button3, {
881
- variant: "ghost",
882
- classNames: "pli-1 flex-1 group text-start justify-start bs-[--rail-action] font-normal",
883
- onClick
884
- }, /* @__PURE__ */ React7.createElement(Icon3, {
885
- icon: "ph--caret-left--bold",
886
- size: 3
887
- }), /* @__PURE__ */ React7.createElement("span", {
888
- className: mx4(headingBackButtonLabel)
889
- }, title));
890
- } finally {
891
- _effect.f();
892
- }
893
- };
894
- var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
872
+ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
895
873
  var _effect = _useSignals7();
896
874
  try {
897
- const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
898
- const { t } = useTranslation7(NAVTREE_PLUGIN);
899
- const alternateTree = navTreeContext.useItems(item, {
875
+ const { t } = useTranslation7(meta.id);
876
+ const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
877
+ const { useItems: useItems2 } = navTreeContext;
878
+ const title = toLocalizedString6(item.properties.label, t);
879
+ const alternateTree = useItems2(item, {
900
880
  disposition: "alternate-tree"
901
881
  })[0];
902
882
  const alternatePath = useMemo3(() => [
@@ -906,34 +886,16 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
906
886
  item.id,
907
887
  path
908
888
  ]);
909
- const handleOpen = useCallback2(() => setAlternateTree?.(alternatePath, true), [
910
- alternatePath,
911
- setAlternateTree
912
- ]);
913
889
  const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
914
890
  const useAlternateItems = useCallback2((node, { disposition } = {}) => {
915
- return navTreeContext.useItems(node, {
891
+ return useItems2(node, {
916
892
  disposition,
917
893
  sort: node?.id === alternateTree.id
918
894
  });
919
895
  }, [
920
- navTreeContext,
921
- alternateTree
896
+ alternateTree,
897
+ useItems2
922
898
  ]);
923
- const handleBack = useCallback2(() => {
924
- if (isAlternate) {
925
- setAlternateTree?.(alternatePath, false);
926
- } else {
927
- onBack?.();
928
- }
929
- }, [
930
- isAlternate,
931
- onBack,
932
- alternatePath,
933
- setAlternateTree
934
- ]);
935
- const title = toLocalizedString6(item.properties.label, t);
936
- const backCapable = item.id.startsWith("!") || isAlternate;
937
899
  return /* @__PURE__ */ React7.createElement(Tabs2.Tabpanel, {
938
900
  key: item.id,
939
901
  value: item.id,
@@ -946,30 +908,14 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
946
908
  tabIndex: -1,
947
909
  "aria-label": title,
948
910
  ...!open && {
949
- inert: "true"
911
+ inert: true
950
912
  }
951
- }, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("h2", {
952
- className: "flex items-center border-be border-subduedSeparator app-drag pli-1 density-coarse"
953
- }, backCapable ? /* @__PURE__ */ React7.createElement(TitleButton, {
954
- title,
955
- onClick: handleBack
956
- }) : /* @__PURE__ */ React7.createElement("span", {
957
- className: "flex-1 truncate min-is-0 pis-6"
958
- }, title), alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
959
- variant: "ghost",
960
- classNames: mx4("shrink-0", hoverableControlItem2, hoverableOpenControlItem2, "pli-2 pointer-fine:pli-1"),
961
- iconOnly: true,
962
- size: 5,
963
- icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
964
- label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
965
- "data-testid": "treeView.alternateTreeButton",
966
- onClick: handleOpen
967
- }), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
913
+ }, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
968
914
  path,
969
915
  item,
970
- open: true,
971
- density: "coarse"
972
- })), /* @__PURE__ */ React7.createElement("div", {
916
+ currentItemId,
917
+ onBack
918
+ }), /* @__PURE__ */ React7.createElement("div", {
973
919
  role: "none",
974
920
  className: "overflow-y-auto"
975
921
  }, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
@@ -995,48 +941,106 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
995
941
  _effect.f();
996
942
  }
997
943
  };
998
- var L1PanelCollection = ({ item, path, ...props }) => {
944
+ var L1PanelHeader = ({ item, path, onBack }) => {
999
945
  var _effect = _useSignals7();
1000
946
  try {
1001
- const { useItems: useItems2 } = useNavTreeContext();
1002
- useLoadDescendents(item);
1003
- const collectionItems = useItems2(item);
1004
- const groupPath = useMemo3(() => [
947
+ const { t } = useTranslation7(meta.id);
948
+ const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
949
+ const title = toLocalizedString6(item.properties.label, t);
950
+ const alternateTree = navTreeContext.useItems(item, {
951
+ disposition: "alternate-tree"
952
+ })[0];
953
+ const alternatePath = useMemo3(() => [
1005
954
  ...path,
1006
955
  item.id
1007
956
  ], [
1008
957
  item.id,
1009
958
  path
1010
959
  ]);
1011
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, collectionItems.filter((item2) => l0ItemType(item2) === "tab").map((item2) => /* @__PURE__ */ React7.createElement(L1Panel, {
1012
- key: item2.id,
1013
- item: item2,
1014
- path: groupPath,
1015
- ...props
1016
- })));
960
+ const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
961
+ const backCapable = item.id.startsWith("!") || isAlternate;
962
+ const handleOpen = useCallback2(() => {
963
+ setAlternateTree?.(alternatePath, true);
964
+ }, [
965
+ alternatePath,
966
+ setAlternateTree
967
+ ]);
968
+ const handleBack = useCallback2(() => {
969
+ if (isAlternate) {
970
+ setAlternateTree?.(alternatePath, false);
971
+ } else {
972
+ onBack?.();
973
+ }
974
+ }, [
975
+ isAlternate,
976
+ alternatePath,
977
+ setAlternateTree,
978
+ onBack
979
+ ]);
980
+ return /* @__PURE__ */ React7.createElement("div", {
981
+ className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
982
+ }, /* @__PURE__ */ React7.createElement("div", {
983
+ className: "is-6"
984
+ }), /* @__PURE__ */ React7.createElement("h2", {
985
+ className: "flex-1 truncate min-is-0"
986
+ }, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
987
+ variant: "ghost",
988
+ icon: "ph--arrow-u-down-left--regular",
989
+ iconOnly: true,
990
+ size: 5,
991
+ label: t("button back"),
992
+ classNames: [
993
+ hoverableControlItem2,
994
+ hoverableOpenControlItem2,
995
+ "pointer-fine:pli-1"
996
+ ],
997
+ onClick: handleBack
998
+ }) || alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
999
+ "data-testid": "treeView.alternateTreeButton",
1000
+ variant: "ghost",
1001
+ icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
1002
+ iconOnly: true,
1003
+ size: 5,
1004
+ label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
1005
+ classNames: [
1006
+ hoverableControlItem2,
1007
+ hoverableOpenControlItem2,
1008
+ "pointer-fine:pli-1"
1009
+ ],
1010
+ onClick: handleOpen
1011
+ }), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
1012
+ open: true,
1013
+ path,
1014
+ item,
1015
+ density: "coarse"
1016
+ }));
1017
1017
  } finally {
1018
1018
  _effect.f();
1019
1019
  }
1020
1020
  };
1021
- var L1Panels = ({ topLevelItems, onBack, ...props }) => {
1022
- var _effect = _useSignals7();
1021
+
1022
+ // src/components/Sidebar/L1Tabs.tsx
1023
+ import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
1024
+ import React8, { useMemo as useMemo4 } from "react";
1025
+ var L1Tabs = ({ topLevelItems, onBack, ...props }) => {
1026
+ var _effect = _useSignals8();
1023
1027
  try {
1024
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, topLevelItems.map((item) => {
1028
+ return /* @__PURE__ */ React8.createElement(React8.Fragment, null, topLevelItems.map((item) => {
1025
1029
  const type = l0ItemType(item);
1026
1030
  switch (type) {
1027
- case "collection":
1028
- return /* @__PURE__ */ React7.createElement(L1PanelCollection, {
1029
- key: item.id,
1030
- item,
1031
- ...props
1032
- });
1033
1031
  case "tab":
1034
- return /* @__PURE__ */ React7.createElement(L1Panel, {
1032
+ return /* @__PURE__ */ React8.createElement(L1Panel, {
1035
1033
  key: item.id,
1036
1034
  item,
1037
1035
  ...props,
1038
1036
  onBack
1039
1037
  });
1038
+ case "collection":
1039
+ return /* @__PURE__ */ React8.createElement(L1PanelCollection, {
1040
+ key: item.id,
1041
+ item,
1042
+ ...props
1043
+ });
1040
1044
  default:
1041
1045
  return null;
1042
1046
  }
@@ -1045,11 +1049,34 @@ var L1Panels = ({ topLevelItems, onBack, ...props }) => {
1045
1049
  _effect.f();
1046
1050
  }
1047
1051
  };
1052
+ var L1PanelCollection = ({ item, path, ...props }) => {
1053
+ var _effect = _useSignals8();
1054
+ try {
1055
+ const { useItems: useItems2 } = useNavTreeContext();
1056
+ useLoadDescendents(item);
1057
+ const collectionItems = useItems2(item);
1058
+ const groupPath = useMemo4(() => [
1059
+ ...path,
1060
+ item.id
1061
+ ], [
1062
+ item.id,
1063
+ path
1064
+ ]);
1065
+ return /* @__PURE__ */ React8.createElement(React8.Fragment, null, collectionItems.filter((item2) => l0ItemType(item2) === "tab").map((item2) => /* @__PURE__ */ React8.createElement(L1Panel, {
1066
+ key: item2.id,
1067
+ item: item2,
1068
+ path: groupPath,
1069
+ ...props
1070
+ })));
1071
+ } finally {
1072
+ _effect.f();
1073
+ }
1074
+ };
1048
1075
 
1049
1076
  // src/components/NavTree/NavTree.tsx
1050
1077
  var NAV_TREE_ITEM = "NavTreeItem";
1051
1078
  var NavTree = ({ id, root, ...props }) => {
1052
- var _effect = _useSignals8();
1079
+ var _effect = _useSignals9();
1053
1080
  try {
1054
1081
  const { tab, useItems: useItems2, onBack } = useNavTreeContext();
1055
1082
  const topLevelActions = useItems2(root, {
@@ -1065,7 +1092,7 @@ var NavTree = ({ id, root, ...props }) => {
1065
1092
  const topLevelNavigation = useItems2(root, {
1066
1093
  disposition: "navigation"
1067
1094
  });
1068
- const l0Items = useMemo4(() => [
1095
+ const l0Items = useMemo5(() => [
1069
1096
  // prettier-ignore
1070
1097
  ...topLevelCollections,
1071
1098
  ...topLevelWorkspaces,
@@ -1082,7 +1109,7 @@ var NavTree = ({ id, root, ...props }) => {
1082
1109
  const userAccountItem = useItems2(root, {
1083
1110
  disposition: "user-account"
1084
1111
  })[0];
1085
- const topLevelItems = useMemo4(() => [
1112
+ const topLevelItems = useMemo5(() => [
1086
1113
  // prettier-ignore
1087
1114
  ...l0Items,
1088
1115
  ...pinnedItems,
@@ -1095,46 +1122,44 @@ var NavTree = ({ id, root, ...props }) => {
1095
1122
  userAccountItem
1096
1123
  ]);
1097
1124
  useLoadDescendents(root);
1098
- const path = useMemo4(() => [
1125
+ const path = useMemo5(() => [
1099
1126
  id
1100
1127
  ], [
1101
1128
  id
1102
1129
  ]);
1103
- return /* @__PURE__ */ React8.createElement(Tabs3.Root, {
1104
- value: tab,
1105
- orientation: "vertical",
1106
- verticalVariant: "stateless",
1107
- classNames: "relative"
1108
- }, /* @__PURE__ */ React8.createElement(L0Menu, {
1109
- menuActions: topLevelActions,
1110
- topLevelItems: l0Items,
1111
- pinnedItems,
1112
- userAccountItem,
1113
- path,
1114
- parent: root
1115
- }), /* @__PURE__ */ React8.createElement(L1Panels, {
1116
- topLevelItems,
1117
- path,
1118
- currentItemId: tab,
1119
- onBack,
1120
- ...props
1121
- }));
1130
+ return (
1131
+ // TODO(thure): `Tabs.Root` forces all items that should be able to receive focus to use `Tabs.Tab(Primitive)` since
1132
+ // it uses RovingFocus and doesn’t support moving focus to an item that is not a tab. Assess whether this situation
1133
+ // should change including whether it should motivate a change in the design/taxonomy, or if this means this should
1134
+ // not use `react-ui-tabs` at all.
1135
+ /* @__PURE__ */ React9.createElement(Tabs3.Root, {
1136
+ value: tab,
1137
+ orientation: "vertical",
1138
+ verticalVariant: "stateless",
1139
+ classNames: "relative"
1140
+ }, /* @__PURE__ */ React9.createElement(L0Menu, {
1141
+ menuActions: topLevelActions,
1142
+ topLevelItems: l0Items,
1143
+ pinnedItems,
1144
+ userAccountItem,
1145
+ path,
1146
+ parent: root
1147
+ }), /* @__PURE__ */ React9.createElement(L1Tabs, {
1148
+ topLevelItems,
1149
+ path,
1150
+ currentItemId: tab,
1151
+ onBack,
1152
+ ...props
1153
+ }))
1154
+ );
1122
1155
  } finally {
1123
1156
  _effect.f();
1124
1157
  }
1125
1158
  };
1126
1159
 
1127
- // src/capabilities/index.ts
1128
- import { lazy } from "@dxos/app-framework";
1129
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-5J4LRWDX.mjs"));
1130
- var IntentResolver = lazy(() => import("./intent-resolver-3XYN2CBU.mjs"));
1131
- var Keyboard2 = lazy(() => import("./keyboard-QRS6WOQH.mjs"));
1132
- var ReactSurface = lazy(() => import("./react-surface-N2HPMYCU.mjs"));
1133
- var State = lazy(() => import("./state-54DY3DOY.mjs"));
1134
-
1135
1160
  // src/components/NavTreeContainer.tsx
1136
1161
  var NODE_TYPE = "dxos/app-graph/node";
1137
- var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React9.createElement(Surface, {
1162
+ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
1138
1163
  role: "navtree-item-end",
1139
1164
  data: {
1140
1165
  id: node.id,
@@ -1143,12 +1168,12 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React9.createElement(Sur
1143
1168
  },
1144
1169
  limit: 1
1145
1170
  });
1146
- var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE);
1171
+ var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden");
1147
1172
  var filterItems = (node, disposition) => {
1148
1173
  if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
1149
1174
  return false;
1150
1175
  } else if (!disposition) {
1151
- const action = isAction4(node);
1176
+ const action = isAction3(node);
1152
1177
  return !action || node.properties.disposition === "item";
1153
1178
  } else {
1154
1179
  return node.properties.disposition === disposition;
@@ -1159,11 +1184,32 @@ var getItems = (graph, node, disposition) => {
1159
1184
  };
1160
1185
  var useItems = (node, options) => {
1161
1186
  const { graph } = useAppGraph2();
1162
- const connections = useConnections(graph, node?.id ?? ROOT_ID).filter((node2) => filterItems(node2, options?.disposition));
1163
- return options?.sort ? connections.toSorted((a, b) => byPosition(a.properties, b.properties)) : connections;
1187
+ const connections = useConnections(graph, node?.id ?? ROOT_ID);
1188
+ const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
1189
+ return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
1190
+ };
1191
+ var useActions2 = (node) => {
1192
+ const { graph } = useAppGraph2();
1193
+ const actions = useGraphActions(graph, node.id);
1194
+ return useMemo6(() => actions.reduce((acc, arg) => {
1195
+ if (arg.properties.disposition === "item") {
1196
+ return acc;
1197
+ }
1198
+ acc.actions.push(arg);
1199
+ if (!isAction3(arg)) {
1200
+ const actionGroup = graph.getActions(arg.id);
1201
+ acc.groupedActions[arg.id] = actionGroup;
1202
+ }
1203
+ return acc;
1204
+ }, {
1205
+ actions: [],
1206
+ groupedActions: {}
1207
+ }), [
1208
+ actions
1209
+ ]);
1164
1210
  };
1165
1211
  var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
1166
- var _effect = _useSignals9();
1212
+ var _effect = _useSignals10();
1167
1213
  try {
1168
1214
  const [isLg] = useMediaQuery2("lg", {
1169
1215
  ssr: false
@@ -1172,10 +1218,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1172
1218
  const { graph } = useAppGraph2();
1173
1219
  const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
1174
1220
  const layout = useLayout();
1175
- const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
1176
- const getActions2 = useCallback3((node) => getActions(graph, node), [
1177
- graph
1178
- ]);
1221
+ const { navigationSidebarState } = useSidebars(meta.id);
1179
1222
  const getProps = useCallback3((node, path) => {
1180
1223
  const children = getChildren(graph, node, path).filter(getChildrenFilter);
1181
1224
  const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
@@ -1185,7 +1228,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1185
1228
  parentOf,
1186
1229
  icon: node.properties.icon,
1187
1230
  disabled: node.properties.disabled,
1188
- className: mx5(node.properties.modified && "italic", node.properties.className),
1231
+ className: mx3(node.properties.modified && "italic", node.properties.className),
1189
1232
  headingClassName: node.properties.headingClassName,
1190
1233
  testId: node.properties.testId
1191
1234
  };
@@ -1242,7 +1285,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1242
1285
  if (!node.data) {
1243
1286
  return;
1244
1287
  }
1245
- if (isAction4(node)) {
1288
+ if (isAction3(node)) {
1246
1289
  const [parent] = graph.getConnections(node.id, "inbound");
1247
1290
  void (parent && node.data({
1248
1291
  parent,
@@ -1278,7 +1321,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1278
1321
  }));
1279
1322
  }
1280
1323
  const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
1281
- if (isAction4(defaultAction)) {
1324
+ if (isAction3(defaultAction)) {
1282
1325
  void defaultAction.data();
1283
1326
  }
1284
1327
  if (!isLg) {
@@ -1358,10 +1401,10 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1358
1401
  }, [
1359
1402
  setItem
1360
1403
  ]);
1361
- const navTreeContextValue = useMemo5(() => ({
1404
+ const navTreeContextValue = useMemo6(() => ({
1362
1405
  useItems,
1363
1406
  tab,
1364
- getActions: getActions2,
1407
+ useActions: useActions2,
1365
1408
  loadDescendents,
1366
1409
  renderItemEnd,
1367
1410
  popoverAnchorId,
@@ -1378,7 +1421,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1378
1421
  onBack: handleBack
1379
1422
  }), [
1380
1423
  tab,
1381
- getActions2,
1424
+ useActions2,
1382
1425
  loadDescendents,
1383
1426
  renderItemEnd,
1384
1427
  popoverAnchorId,
@@ -1394,9 +1437,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1394
1437
  handleSelect,
1395
1438
  handleBack
1396
1439
  ]);
1397
- return /* @__PURE__ */ React9.createElement(NavTreeContext.Provider, {
1440
+ return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
1398
1441
  value: navTreeContextValue
1399
- }, /* @__PURE__ */ React9.createElement(NavTree, {
1442
+ }, /* @__PURE__ */ React10.createElement(NavTree, {
1400
1443
  id: ROOT_ID,
1401
1444
  root: graph.root,
1402
1445
  open: layout.sidebarOpen
@@ -1414,7 +1457,6 @@ export {
1414
1457
  resolveMigrationOperation,
1415
1458
  sortActions,
1416
1459
  getChildren,
1417
- getActions,
1418
1460
  l0ItemType,
1419
1461
  NODE_TYPE,
1420
1462
  NavTreeContainer,
@@ -1425,4 +1467,4 @@ export {
1425
1467
  ReactSurface,
1426
1468
  State
1427
1469
  };
1428
- //# sourceMappingURL=chunk-TZA65AKW.mjs.map
1470
+ //# sourceMappingURL=chunk-6AZKY5WZ.mjs.map