@dxos/plugin-navtree 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a

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 (89) hide show
  1. package/dist/lib/browser/{app-graph-builder-6JDBQ25U.mjs → app-graph-builder-YAPMENYT.mjs} +10 -9
  2. package/dist/lib/browser/app-graph-builder-YAPMENYT.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-ZKVY35IG.mjs → chunk-IMFXKPSB.mjs} +115 -102
  4. package/dist/lib/browser/chunk-IMFXKPSB.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 +5 -7
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/{intent-resolver-N35ZIHFD.mjs → intent-resolver-TCQXGF6U.mjs} +6 -6
  12. package/dist/lib/browser/intent-resolver-TCQXGF6U.mjs.map +7 -0
  13. package/dist/lib/browser/{keyboard-HMTMA33N.mjs → keyboard-AHSAWKXA.mjs} +4 -4
  14. package/dist/lib/browser/{keyboard-HMTMA33N.mjs.map → keyboard-AHSAWKXA.mjs.map} +1 -1
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/{react-surface-5PZ4XJT7.mjs → react-surface-AH2TP73M.mjs} +10 -10
  17. package/dist/lib/browser/react-surface-AH2TP73M.mjs.map +7 -0
  18. package/dist/lib/browser/{state-P5DGL7KS.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.map +1 -1
  23. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/index.d.ts +12 -9
  25. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  27. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  28. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +1 -2
  29. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  30. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  31. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
  32. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -2
  33. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  34. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +1 -1
  35. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
  36. package/dist/types/src/components/Sidebar/L0Menu.d.ts +2 -0
  37. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  38. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  39. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
  40. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +1 -2
  41. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  42. package/dist/types/src/events.d.ts.map +1 -1
  43. package/dist/types/src/experimental/Tree.d.ts +1 -2
  44. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  45. package/dist/types/src/experimental/Tree.stories.d.ts +2 -3
  46. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  47. package/dist/types/src/meta.d.ts +2 -3
  48. package/dist/types/src/meta.d.ts.map +1 -1
  49. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  50. package/dist/types/src/testing/generator.d.ts +1 -1
  51. package/dist/types/src/testing/generator.d.ts.map +1 -1
  52. package/dist/types/src/types.d.ts +4 -3
  53. package/dist/types/src/types.d.ts.map +1 -1
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +47 -47
  56. package/src/NavTreePlugin.tsx +70 -71
  57. package/src/capabilities/app-graph-builder.ts +6 -5
  58. package/src/capabilities/capabilities.ts +2 -2
  59. package/src/capabilities/intent-resolver.ts +1 -1
  60. package/src/capabilities/react-surface.tsx +4 -4
  61. package/src/capabilities/state.ts +2 -2
  62. package/src/components/CommandsDialog/CommandsDialog.tsx +3 -3
  63. package/src/components/CommandsDialog/CommandsTrigger.tsx +2 -2
  64. package/src/components/NavTree/NavTree.stories.tsx +61 -47
  65. package/src/components/NavTree/NavTree.tsx +4 -0
  66. package/src/components/NavTreeContainer.tsx +13 -6
  67. package/src/components/NavTreeDocumentTitle.tsx +2 -2
  68. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +2 -4
  69. package/src/components/NavTreeItem/NavTreeItemAction.tsx +5 -4
  70. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +27 -21
  71. package/src/components/Sidebar/L0Menu.tsx +50 -49
  72. package/src/components/Sidebar/L1Panel.tsx +7 -8
  73. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +3 -4
  74. package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
  75. package/src/events.ts +2 -2
  76. package/src/experimental/Tree.stories.tsx +24 -28
  77. package/src/experimental/Tree.tsx +5 -22
  78. package/src/meta.ts +5 -7
  79. package/src/testing/app-graph-builder.ts +9 -8
  80. package/src/testing/generator.ts +2 -2
  81. package/src/types.ts +4 -3
  82. package/dist/lib/browser/app-graph-builder-6JDBQ25U.mjs.map +0 -7
  83. package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
  84. package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
  85. package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
  86. package/dist/lib/browser/chunk-ZKVY35IG.mjs.map +0 -7
  87. package/dist/lib/browser/intent-resolver-N35ZIHFD.mjs.map +0 -7
  88. package/dist/lib/browser/react-surface-5PZ4XJT7.mjs.map +0 -7
  89. package/dist/lib/browser/state-P5DGL7KS.mjs.map +0 -7
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  COMMANDS_DIALOG,
3
- NAVTREE_PLUGIN
4
- } from "./chunk-ERDGQTH5.mjs";
3
+ meta
4
+ } from "./chunk-ZENLR72O.mjs";
5
5
 
6
6
  // src/capabilities/app-graph-builder.ts
7
7
  import { Rx } from "@effect-rx/rx-react";
8
- import { Option, pipe } from "effect";
8
+ import * as Function from "effect/Function";
9
+ import * as Option from "effect/Option";
9
10
  import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
10
11
  import { ROOT_ID, createExtension } from "@dxos/plugin-graph";
11
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
12
- id: NAVTREE_PLUGIN,
13
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
12
+ var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, createExtension({
13
+ id: meta.id,
14
+ actions: (node) => Rx.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
14
15
  {
15
16
  id: COMMANDS_DIALOG,
16
17
  data: async () => {
@@ -27,7 +28,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
27
28
  label: [
28
29
  "open commands label",
29
30
  {
30
- ns: NAVTREE_PLUGIN
31
+ ns: meta.id
31
32
  }
32
33
  ],
33
34
  icon: "ph--magnifying-glass--regular",
@@ -38,8 +39,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
38
39
  }
39
40
  }
40
41
  ]), Option.getOrElse(() => [])))
41
- }));
42
+ })));
42
43
  export {
43
44
  app_graph_builder_default as default
44
45
  };
45
- //# sourceMappingURL=app-graph-builder-6JDBQ25U.mjs.map
46
+ //# sourceMappingURL=app-graph-builder-YAPMENYT.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { ROOT_ID, createExtension } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: meta.id,\n actions: (node) =>\n Rx.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: COMMANDS_DIALOG,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: COMMANDS_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n );\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,UAAU;AACnB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,cAAcC,cAAkCC,aAAaC,oBAAoB;AAC1F,SAASC,SAASC,uBAAuB;AAIzC,IAAA,6BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC,KAAKD;EACTE,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACEC,cACPD,IAAIH,IAAAA,GACGK,eAAQ,CAACL,UAAUA,MAAKH,OAAOS,UAAiBC,YAAKP,KAAAA,IAAeQ,YAAI,CAAA,GACxEC,WAAI,MAAM;IACf;MACEZ,IAAIa;MACJC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKrB,QAAQsB,cAAcpB,aAAaqB,gBAAgB;AACzF,cAAMF,SACJG,aAAaC,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASV;UACTW,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAC,YAAY;QACVC,OAAO;UAAC;UAAuB;YAAEC,IAAI3B,KAAKD;UAAG;;QAC7C6B,MAAM;QACNC,YAAY;UACVC,OAAO;UACPC,SAAS;QACX;MACF;IACF;GACD,GACMC,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
6
+ "names": ["Rx", "Function", "Option", "Capabilities", "LayoutAction", "contributes", "createIntent", "ROOT_ID", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Rx", "make", "get", "pipe", "flatMap", "ROOT_ID", "some", "none", "map", "COMMANDS_DIALOG", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "LayoutAction", "UpdateDialog", "part", "subject", "options", "blockAlign", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "getOrElse"]
7
+ }
@@ -1,12 +1,11 @@
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
7
  meta
9
- } from "./chunk-ERDGQTH5.mjs";
8
+ } from "./chunk-ZENLR72O.mjs";
10
9
 
11
10
  // src/components/CommandsDialog/CommandsDialog.tsx
12
11
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
@@ -23,7 +22,7 @@ import { getHostPlatform } from "@dxos/util";
23
22
  var CommandsDialogContent = ({ selected: initial }) => {
24
23
  var _effect = _useSignals();
25
24
  try {
26
- const { t } = useTranslation(NAVTREE_PLUGIN);
25
+ const { t } = useTranslation(meta.id);
27
26
  const [selected, setSelected] = useState(initial);
28
27
  const { dispatchPromise: dispatch } = useIntentDispatcher();
29
28
  const { graph } = useAppGraph();
@@ -54,7 +53,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
54
53
  }, /* @__PURE__ */ React.createElement(Dialog.Title, {
55
54
  classNames: cardDialogHeader
56
55
  }, t("commands dialog title", {
57
- ns: NAVTREE_PLUGIN
56
+ ns: meta.id
58
57
  })), /* @__PURE__ */ React.createElement(SearchList.Root, {
59
58
  label: t("command list input placeholder"),
60
59
  classNames: cardDialogSearchListRoot
@@ -127,7 +126,7 @@ var CommandsTrigger = () => {
127
126
  var _effect = _useSignals2();
128
127
  try {
129
128
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
130
- const { t } = useTranslation2(NAVTREE_PLUGIN);
129
+ const { t } = useTranslation2(meta.id);
131
130
  return /* @__PURE__ */ React2.createElement(Button2, {
132
131
  classNames: "m-1 pli-1 lg:pli-2",
133
132
  onClick: () => dispatch(createIntent2(LayoutAction2.UpdateDialog, {
@@ -228,11 +227,11 @@ import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
228
227
 
229
228
  // src/capabilities/index.ts
230
229
  import { lazy } from "@dxos/app-framework";
231
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-6JDBQ25U.mjs"));
232
- var IntentResolver = lazy(() => import("./intent-resolver-N35ZIHFD.mjs"));
233
- var Keyboard2 = lazy(() => import("./keyboard-HMTMA33N.mjs"));
234
- var ReactSurface = lazy(() => import("./react-surface-5PZ4XJT7.mjs"));
235
- var State = lazy(() => import("./state-P5DGL7KS.mjs"));
230
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-YAPMENYT.mjs"));
231
+ var IntentResolver = lazy(() => import("./intent-resolver-TCQXGF6U.mjs"));
232
+ var Keyboard2 = lazy(() => import("./keyboard-AHSAWKXA.mjs"));
233
+ var ReactSurface = lazy(() => import("./react-surface-AH2TP73M.mjs"));
234
+ var State = lazy(() => import("./state-2Q623V7U.mjs"));
236
235
 
237
236
  // src/components/NavTree/NavTree.tsx
238
237
  import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
@@ -252,7 +251,7 @@ var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Mis
252
251
  import { useEffect } from "react";
253
252
  import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
254
253
  var NavTreeDocumentTitle = ({ node }) => {
255
- const { t } = useTranslation3(NAVTREE_PLUGIN);
254
+ const { t } = useTranslation3(meta.id);
256
255
  useEffect(() => {
257
256
  document.title = node ? toLocalizedString2(node.properties.label, t) : t("current app name", {
258
257
  ns: "appkit"
@@ -287,11 +286,12 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
287
286
  import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
288
287
  import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
289
288
  import { invariant } from "@dxos/invariant";
289
+ import { DxAvatar } from "@dxos/lit-ui/react";
290
290
  import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
291
291
  import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
292
292
  import { Tabs } from "@dxos/react-ui-tabs";
293
293
  import { mx as mx2 } from "@dxos/react-ui-theme";
294
- import { arrayMove, getFirstTwoRenderableChars } from "@dxos/util";
294
+ import { arrayMove } from "@dxos/util";
295
295
 
296
296
  // src/components/UserAccountAvatar/UserAccountAvatar.tsx
297
297
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
@@ -302,8 +302,10 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
302
302
  var _effect = _useSignals3();
303
303
  try {
304
304
  const fallbackValue = hexToFallback(userId ?? "0");
305
- return /* @__PURE__ */ React3.createElement("div", {
306
- 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",
307
309
  "data-joyride": "welcome/account"
308
310
  }, /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Avatar.Content, {
309
311
  variant: "circle",
@@ -312,7 +314,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
312
314
  hue: hue || fallbackValue.hue,
313
315
  fallback: emoji || fallbackValue.emoji,
314
316
  "data-testid": "treeView.userAccount"
315
- })));
317
+ }))));
316
318
  } finally {
317
319
  _effect.f();
318
320
  }
@@ -322,9 +324,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
322
324
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-navtree/src/components/Sidebar/L0Menu.tsx";
323
325
  var useL0ItemClick = ({ item, parent, path }, type) => {
324
326
  const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();
325
- const [isLg] = useMediaQuery("lg", {
326
- ssr: false
327
- });
327
+ const [isLg] = useMediaQuery("lg");
328
328
  return useCallback((event) => {
329
329
  switch (type) {
330
330
  case "action": {
@@ -375,7 +375,7 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
375
375
  item.id,
376
376
  path
377
377
  ]);
378
- const { t } = useTranslation4(NAVTREE_PLUGIN);
378
+ const { t } = useTranslation4(meta.id);
379
379
  const localizedString = toLocalizedString3(item.properties.label, t);
380
380
  const handleClick = useL0ItemClick({
381
381
  item,
@@ -393,15 +393,15 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
393
393
  "data-testid": testId,
394
394
  "data-itemid": id
395
395
  } : {
396
- onClick: handleClick
396
+ onClick: handleClick,
397
+ role: "button"
397
398
  };
398
- const Root = type === "collection" ? "h2" : type === "tab" ? Tabs.TabPrimitive : "button";
399
399
  return /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
400
400
  asChild: true,
401
401
  delayDuration: 0,
402
402
  side: "right",
403
403
  content: localizedString
404
- }, /* @__PURE__ */ React4.createElement(Root, {
404
+ }, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
405
405
  ...rootProps,
406
406
  "data-type": type,
407
407
  className: mx2(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint]),
@@ -411,28 +411,13 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
411
411
  _effect.f();
412
412
  }
413
413
  });
414
- var L0Avatar = ({ item }) => {
414
+ var L0ItemActiveTabIndicator = ({ classNames }) => {
415
415
  var _effect = _useSignals4();
416
416
  try {
417
- const { t } = useTranslation4(NAVTREE_PLUGIN);
418
- const type = l0ItemType(item);
419
- const hue = item.properties.hue ?? null;
420
- const hueFgStyle = hue && {
421
- style: {
422
- color: `var(--dx-${hue}SurfaceText)`
423
- }
424
- };
425
- const localizedString = toLocalizedString3(item.properties.label, t);
426
- const avatarValue = useMemo2(() => type === "tab" ? getFirstTwoRenderableChars(localizedString).join("").toUpperCase() : [], [
427
- type,
428
- item.properties.label,
429
- t
430
- ]);
431
- return /* @__PURE__ */ React4.createElement("span", {
432
- role: "img",
433
- className: "place-self-center text-xl font-light",
434
- ...hueFgStyle
435
- }, avatarValue);
417
+ return /* @__PURE__ */ React4.createElement("div", {
418
+ role: "none",
419
+ className: mx2("hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie", classNames)
420
+ });
436
421
  } finally {
437
422
  _effect.f();
438
423
  }
@@ -440,7 +425,7 @@ var L0Avatar = ({ item }) => {
440
425
  var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
441
426
  var _effect = _useSignals4();
442
427
  try {
443
- const { t } = useTranslation4(NAVTREE_PLUGIN);
428
+ const { t } = useTranslation4(meta.id);
444
429
  const itemElement = useRef(null);
445
430
  const [closestEdge, setEdge] = useState2(null);
446
431
  const localizedString = toLocalizedString3(item.properties.label, t);
@@ -529,10 +514,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
529
514
  className: mx2(l0ItemContent, pinned ? "p-2 group-hover/l0item:bg-activeSurface" : "is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface")
530
515
  }, /* @__PURE__ */ React4.createElement(ItemAvatar, {
531
516
  item
532
- })), /* @__PURE__ */ React4.createElement("div", {
533
- role: "none",
534
- className: "hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie"
535
- }), /* @__PURE__ */ React4.createElement("span", {
517
+ })), /* @__PURE__ */ React4.createElement(L0ItemActiveTabIndicator, null), /* @__PURE__ */ React4.createElement("span", {
536
518
  id: `${item.id}__label`,
537
519
  className: "sr-only"
538
520
  }, localizedString), closestEdge && /* @__PURE__ */ React4.createElement(ListItem.DropIndicator, {
@@ -545,6 +527,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
545
527
  var ItemAvatar = ({ item }) => {
546
528
  var _effect = _useSignals4();
547
529
  try {
530
+ const { t } = useTranslation4(meta.id);
548
531
  const type = l0ItemType(item);
549
532
  if (item.properties.icon) {
550
533
  const hue = item.properties.hue ?? null;
@@ -555,13 +538,19 @@ var ItemAvatar = ({ item }) => {
555
538
  };
556
539
  return /* @__PURE__ */ React4.createElement(Icon3, {
557
540
  icon: item.properties.icon,
558
- size: 5,
541
+ size: 6,
559
542
  ...hueFgStyle
560
543
  });
561
544
  }
562
545
  if (type === "tab" && item.properties.disposition !== "pin-end") {
563
- return /* @__PURE__ */ React4.createElement(L0Avatar, {
564
- item
546
+ const hue = item.properties.hue ?? null;
547
+ const localizedString = toLocalizedString3(item.properties.label, t);
548
+ return /* @__PURE__ */ React4.createElement(DxAvatar, {
549
+ hue,
550
+ hueVariant: "surface",
551
+ variant: "square",
552
+ size: 12,
553
+ fallback: localizedString
565
554
  });
566
555
  }
567
556
  return null;
@@ -626,7 +615,7 @@ var L0Collection = ({ item, path }) => {
626
615
  var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }) => {
627
616
  var _effect = _useSignals4();
628
617
  try {
629
- const { t } = useTranslation4(NAVTREE_PLUGIN);
618
+ const { t } = useTranslation4(meta.id);
630
619
  return /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
631
620
  classNames: [
632
621
  "group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is",
@@ -640,16 +629,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
640
629
  content: t("app menu label"),
641
630
  side: "right",
642
631
  asChild: true
632
+ }, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
633
+ value: "options",
634
+ asChild: true,
635
+ role: "button"
643
636
  }, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
644
637
  "data-testid": "spacePlugin.addSpace",
645
- className: mx2(l0ItemRoot, "grid place-items-center")
638
+ className: mx2(l0ItemRoot, "grid place-items-center dx-focus-ring-group")
646
639
  }, /* @__PURE__ */ React4.createElement("div", {
647
640
  role: "none",
648
641
  className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
649
642
  }, /* @__PURE__ */ React4.createElement(Icon3, {
650
643
  icon: "ph--list--regular",
651
644
  size: 5
652
- })))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
645
+ }))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
653
646
  role: "none",
654
647
  className: mx2([
655
648
  "flex flex-col gap-1 pbs-1",
@@ -712,7 +705,7 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
712
705
  // src/components/Sidebar/L1Panel.tsx
713
706
  import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
714
707
  import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
715
- import { IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
708
+ import { DensityProvider, IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
716
709
  import { Tree } from "@dxos/react-ui-list";
717
710
  import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
718
711
  import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
@@ -735,7 +728,7 @@ var coarseActionButtonProps = {
735
728
  var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions, caller }) => {
736
729
  var _effect = _useSignals5();
737
730
  try {
738
- const { t } = useTranslation5(NAVTREE_PLUGIN);
731
+ const { t } = useTranslation5(meta.id);
739
732
  const density = useDensityContext();
740
733
  return /* @__PURE__ */ React5.createElement(MenuProvider2, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, {
741
734
  group: parent,
@@ -780,10 +773,10 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
780
773
  label: baseLabel,
781
774
  disabled,
782
775
  onClick: (event) => {
776
+ event.stopPropagation();
783
777
  if (disabled) {
784
778
  return;
785
779
  }
786
- event.stopPropagation();
787
780
  void invoke?.(caller ? {
788
781
  parent,
789
782
  caller
@@ -800,7 +793,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
800
793
  var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
801
794
  var _effect = _useSignals5();
802
795
  try {
803
- const { t } = useTranslation5(NAVTREE_PLUGIN);
796
+ const { t } = useTranslation5(meta.id);
804
797
  const monolithicAction = menuActions?.length === 1 && menuActions[0];
805
798
  const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
806
799
  return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
@@ -822,11 +815,11 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
822
815
  import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
823
816
  import React6, { Fragment, memo } from "react";
824
817
  import { isAction as isAction2 } from "@dxos/app-graph";
825
- import { DensityProvider, Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
826
- var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fine" }) => {
818
+ import { Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
819
+ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open }) => {
827
820
  var _effect = _useSignals6();
828
821
  try {
829
- const { t } = useTranslation6(NAVTREE_PLUGIN);
822
+ const { t } = useTranslation6(meta.id);
830
823
  const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
831
824
  const level = path.length - 2;
832
825
  const { actions: _actions, groupedActions } = useActions3(item);
@@ -837,15 +830,15 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
837
830
  "list-item",
838
831
  "list-item-primary"
839
832
  ].includes(a.properties?.disposition));
840
- const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
841
833
  useLoadDescendents(item);
842
834
  useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
843
- return /* @__PURE__ */ React6.createElement(DensityProvider, {
844
- density
845
- }, /* @__PURE__ */ React6.createElement("div", {
835
+ const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
836
+ return /* @__PURE__ */ React6.createElement("div", {
846
837
  role: "none",
847
838
  className: "contents app-no-drag"
848
- }, primaryAction?.properties?.disposition === "list-item-primary" && !primaryAction?.properties?.disabled ? /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
839
+ }, primaryAction?.properties?.disposition === "list-item-primary" && !primaryAction?.properties?.disabled ? /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
840
+ classNames: "contents"
841
+ }, /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
849
842
  testId: primaryAction.properties?.testId,
850
843
  label: toLocalizedString5(primaryAction.properties?.label, t),
851
844
  icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
@@ -856,7 +849,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
856
849
  ] : groupedActions[primaryAction.id],
857
850
  menuType: primaryAction.properties?.menuType,
858
851
  caller: NAV_TREE_ITEM
859
- }) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, null), /* @__PURE__ */ React6.createElement(ActionRoot, null, actions.length > 0 ? /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
852
+ })) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
853
+ role: "none"
854
+ }), /* @__PURE__ */ React6.createElement(ActionRoot, null, actions.length > 0 ? /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
855
+ classNames: "contents"
856
+ }, /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
860
857
  testId: `navtree.treeItem.actionsLevel${level}`,
861
858
  label: t("tree item actions label"),
862
859
  icon: "ph--dots-three-vertical--regular",
@@ -864,7 +861,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
864
861
  menuActions: actions,
865
862
  menuType: "dropdown",
866
863
  caller: NAV_TREE_ITEM
867
- }) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, null)), ItemEnd && /* @__PURE__ */ React6.createElement(ItemEnd, {
864
+ })) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
865
+ role: "none"
866
+ })), ItemEnd && /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
867
+ classNames: "contents"
868
+ }, /* @__PURE__ */ React6.createElement(ItemEnd, {
868
869
  node: item,
869
870
  open
870
871
  })));
@@ -879,8 +880,8 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
879
880
  try {
880
881
  const { t } = useTranslation7(meta.id);
881
882
  const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
882
- const { useItems: useItems2 } = navTreeContext;
883
883
  const title = toLocalizedString6(item.properties.label, t);
884
+ const { useItems: useItems2 } = navTreeContext;
884
885
  const alternateTree = useItems2(item, {
885
886
  disposition: "alternate-tree"
886
887
  })[0];
@@ -913,9 +914,11 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
913
914
  tabIndex: -1,
914
915
  "aria-label": title,
915
916
  ...!open && {
916
- inert: "true"
917
+ inert: true
917
918
  }
918
- }, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
919
+ }, item.id === currentItemId && /* @__PURE__ */ React7.createElement(DensityProvider, {
920
+ density: "fine"
921
+ }, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
919
922
  path,
920
923
  item,
921
924
  currentItemId,
@@ -925,22 +928,22 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
925
928
  className: "overflow-y-auto"
926
929
  }, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
927
930
  ...navTreeContext,
928
- useItems: useAlternateItems,
929
931
  id: alternateTree.id,
930
932
  root: alternateTree,
931
933
  path: alternatePath,
932
934
  levelOffset: 5,
933
935
  gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
934
- renderColumns: NavTreeItemColumns
936
+ renderColumns: NavTreeItemColumns,
937
+ useItems: useAlternateItems
935
938
  }) : /* @__PURE__ */ React7.createElement(Tree, {
936
939
  ...navTreeContext,
937
940
  id: item.id,
938
941
  root: item,
939
942
  path,
940
943
  levelOffset: 5,
941
- draggable: true,
942
944
  gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
943
- renderColumns: NavTreeItemColumns
945
+ renderColumns: NavTreeItemColumns,
946
+ draggable: true
944
947
  }))));
945
948
  } finally {
946
949
  _effect.f();
@@ -1132,25 +1135,31 @@ var NavTree = ({ id, root, ...props }) => {
1132
1135
  ], [
1133
1136
  id
1134
1137
  ]);
1135
- return /* @__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
- }));
1138
+ return (
1139
+ // TODO(thure): `Tabs.Root` forces all items that should be able to receive focus to use `Tabs.Tab(Primitive)` since
1140
+ // it uses RovingFocus and doesn’t support moving focus to an item that is not a tab. Assess whether this situation
1141
+ // should change including whether it should motivate a change in the design/taxonomy, or if this means this should
1142
+ // not use `react-ui-tabs` at all.
1143
+ /* @__PURE__ */ React9.createElement(Tabs3.Root, {
1144
+ value: tab,
1145
+ orientation: "vertical",
1146
+ verticalVariant: "stateless",
1147
+ classNames: "relative"
1148
+ }, /* @__PURE__ */ React9.createElement(L0Menu, {
1149
+ menuActions: topLevelActions,
1150
+ topLevelItems: l0Items,
1151
+ pinnedItems,
1152
+ userAccountItem,
1153
+ path,
1154
+ parent: root
1155
+ }), /* @__PURE__ */ React9.createElement(L1Tabs, {
1156
+ topLevelItems,
1157
+ path,
1158
+ currentItemId: tab,
1159
+ onBack,
1160
+ ...props
1161
+ }))
1162
+ );
1154
1163
  } finally {
1155
1164
  _effect.f();
1156
1165
  }
@@ -1210,25 +1219,24 @@ var useActions2 = (node) => {
1210
1219
  var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
1211
1220
  var _effect = _useSignals10();
1212
1221
  try {
1213
- const [isLg] = useMediaQuery2("lg", {
1214
- ssr: false
1215
- });
1222
+ const [isLg] = useMediaQuery2("lg");
1216
1223
  const { dispatchPromise: dispatch } = useIntentDispatcher3();
1217
1224
  const { graph } = useAppGraph2();
1218
1225
  const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
1219
1226
  const layout = useLayout();
1220
- const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
1227
+ const { navigationSidebarState } = useSidebars(meta.id);
1221
1228
  const getProps = useCallback3((node, path) => {
1222
1229
  const children = getChildren(graph, node, path).filter(getChildrenFilter);
1223
1230
  const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
1224
1231
  return {
1225
1232
  id: node.id,
1226
- label: node.properties.label ?? node.id,
1227
1233
  parentOf,
1228
- icon: node.properties.icon,
1229
1234
  disabled: node.properties.disabled,
1230
- className: mx3(node.properties.modified && "italic", node.properties.className),
1235
+ label: node.properties.label ?? node.id,
1236
+ className: mx3(node.properties.className, node.properties.modified && "italic"),
1231
1237
  headingClassName: node.properties.headingClassName,
1238
+ icon: node.properties.icon,
1239
+ iconClassName: node.properties.iconClassName,
1232
1240
  testId: node.properties.testId
1233
1241
  };
1234
1242
  }, [
@@ -1280,6 +1288,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1280
1288
  const canDrop = useCallback3(({ source, target }) => {
1281
1289
  return target.item.properties.canDrop?.(source) ?? false;
1282
1290
  }, []);
1291
+ const canSelect = useCallback3(({ item }) => {
1292
+ return item.properties.selectable ?? true;
1293
+ }, []);
1283
1294
  const handleSelect = useCallback3(({ item: node, path, option }) => {
1284
1295
  if (!node.data) {
1285
1296
  return;
@@ -1412,6 +1423,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1412
1423
  isCurrent,
1413
1424
  isOpen,
1414
1425
  canDrop,
1426
+ canSelect,
1415
1427
  isAlternateTree,
1416
1428
  setAlternateTree,
1417
1429
  onTabChange: handleTabChange,
@@ -1429,6 +1441,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
1429
1441
  isCurrent,
1430
1442
  isOpen,
1431
1443
  canDrop,
1444
+ canSelect,
1432
1445
  isAlternateTree,
1433
1446
  setAlternateTree,
1434
1447
  handleTabChange,
@@ -1466,4 +1479,4 @@ export {
1466
1479
  ReactSurface,
1467
1480
  State
1468
1481
  };
1469
- //# sourceMappingURL=chunk-ZKVY35IG.mjs.map
1482
+ //# sourceMappingURL=chunk-IMFXKPSB.mjs.map