@dxos/plugin-navtree 0.8.3 → 0.8.4-main.1da679c

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 (92) hide show
  1. package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs → app-graph-builder-DU57YHO5.mjs} +7 -7
  2. package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs.map → app-graph-builder-DU57YHO5.mjs.map} +3 -3
  3. package/dist/lib/browser/{chunk-ZJPL4XJD.mjs → chunk-EMIN6D7Q.mjs} +233 -193
  4. package/dist/lib/browser/chunk-EMIN6D7Q.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-IEW3JD5C.mjs → chunk-ERDGQTH5.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-33VLL4IJ.mjs → chunk-WCARAZ7J.mjs} +3 -3
  7. package/dist/lib/browser/index.mjs +13 -14
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs → intent-resolver-RPZ5O7AJ.mjs} +8 -8
  10. package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs.map → intent-resolver-RPZ5O7AJ.mjs.map} +3 -3
  11. package/dist/lib/browser/{keyboard-DDFATRUG.mjs → keyboard-R2APW7UM.mjs} +5 -5
  12. package/dist/lib/browser/{keyboard-DDFATRUG.mjs.map → keyboard-R2APW7UM.mjs.map} +2 -2
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/{react-surface-H3JRTVNU.mjs → react-surface-DF7FNA34.mjs} +7 -7
  15. package/dist/lib/browser/{react-surface-H3JRTVNU.mjs.map → react-surface-DF7FNA34.mjs.map} +2 -2
  16. package/dist/lib/browser/{state-J6AKZRB4.mjs → state-W5JDWIJL.mjs} +6 -6
  17. package/dist/lib/browser/state-W5JDWIJL.mjs.map +7 -0
  18. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  19. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/index.d.ts +6 -6
  21. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  23. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/keyboard.d.ts +1 -1
  25. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  27. package/dist/types/src/capabilities/state.d.ts +2 -2
  28. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  29. package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
  30. package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
  31. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  32. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +25 -2
  33. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  34. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  35. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -3
  36. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +1 -1
  38. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
  39. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  40. package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
  41. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  42. package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
  43. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
  44. package/dist/types/src/components/Sidebar/index.d.ts +1 -0
  45. package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
  46. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -4
  47. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  48. package/dist/types/src/components/index.d.ts +1 -1
  49. package/dist/types/src/components/index.d.ts.map +1 -1
  50. package/dist/types/src/components/types.d.ts +2 -2
  51. package/dist/types/src/components/types.d.ts.map +1 -1
  52. package/dist/types/src/experimental/Tree.d.ts +5 -5
  53. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  54. package/dist/types/src/experimental/Tree.stories.d.ts +6 -2
  55. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  56. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  57. package/dist/types/src/translations.d.ts +14 -13
  58. package/dist/types/src/translations.d.ts.map +1 -1
  59. package/dist/types/src/util.d.ts +1 -2
  60. package/dist/types/src/util.d.ts.map +1 -1
  61. package/dist/types/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +42 -43
  63. package/src/NavTreePlugin.tsx +6 -6
  64. package/src/capabilities/app-graph-builder.ts +2 -2
  65. package/src/capabilities/intent-resolver.ts +1 -1
  66. package/src/capabilities/keyboard.ts +2 -2
  67. package/src/capabilities/react-surface.tsx +1 -1
  68. package/src/capabilities/state.ts +3 -2
  69. package/src/components/CommandsDialog/CommandsDialog.tsx +2 -2
  70. package/src/components/CommandsDialog/CommandsTrigger.tsx +3 -5
  71. package/src/components/NavTree/NavTree.stories.tsx +6 -6
  72. package/src/components/NavTree/NavTree.tsx +3 -3
  73. package/src/components/NavTreeContainer.tsx +42 -17
  74. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +3 -3
  75. package/src/components/NavTreeItem/NavTreeItemAction.tsx +6 -6
  76. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -7
  77. package/src/components/Sidebar/L0Menu.tsx +2 -2
  78. package/src/components/Sidebar/L1Panel.tsx +70 -93
  79. package/src/components/Sidebar/L1Tabs.tsx +58 -0
  80. package/src/components/Sidebar/index.ts +1 -0
  81. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +6 -4
  82. package/src/components/index.ts +1 -1
  83. package/src/components/types.ts +3 -2
  84. package/src/experimental/Tree.stories.tsx +13 -11
  85. package/src/experimental/Tree.tsx +15 -16
  86. package/src/testing/app-graph-builder.ts +1 -1
  87. package/src/translations.ts +7 -4
  88. package/src/util.ts +2 -20
  89. package/dist/lib/browser/chunk-ZJPL4XJD.mjs.map +0 -7
  90. package/dist/lib/browser/state-J6AKZRB4.mjs.map +0 -7
  91. /package/dist/lib/browser/{chunk-IEW3JD5C.mjs.map → chunk-ERDGQTH5.mjs.map} +0 -0
  92. /package/dist/lib/browser/{chunk-33VLL4IJ.mjs.map → chunk-WCARAZ7J.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-navtree",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.1da679c",
4
4
  "description": "DXOS Surface plugin for a tree view visualization of the graph.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,6 +10,7 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs"
15
16
  }
@@ -30,60 +31,58 @@
30
31
  "@radix-ui/react-dismissable-layer": "1.1.5",
31
32
  "@radix-ui/react-use-controllable-state": "1.1.0",
32
33
  "date-fns": "^3.3.1",
33
- "effect": "^3.13.3",
34
- "@dxos/app-framework": "0.8.3",
35
- "@dxos/echo": "0.8.3",
36
- "@dxos/echo-schema": "0.8.3",
37
- "@dxos/invariant": "0.8.3",
38
- "@dxos/keyboard": "0.8.3",
39
- "@dxos/live-object": "0.8.3",
40
- "@dxos/local-storage": "0.8.3",
41
- "@dxos/log": "0.8.3",
42
- "@dxos/app-graph": "0.8.3",
43
- "@dxos/plugin-deck": "0.8.3",
44
- "@dxos/plugin-graph": "0.8.3",
45
- "@dxos/plugin-observability": "0.8.3",
46
- "@dxos/react-client": "0.8.3",
47
- "@dxos/protocols": "0.8.3",
48
- "@dxos/react-ui-attention": "0.8.3",
49
- "@dxos/react-ui-list": "0.8.3",
50
- "@dxos/react-ui-menu": "0.8.3",
51
- "@dxos/react-ui-stack": "0.8.3",
52
- "@dxos/react-ui-searchlist": "0.8.3",
53
- "@dxos/react-ui-tabs": "0.8.3",
54
- "@dxos/async": "0.8.3",
55
- "@dxos/util": "0.8.3",
56
- "@dxos/debug": "0.8.3"
34
+ "effect": "3.17.7",
35
+ "@dxos/app-framework": "0.8.4-main.1da679c",
36
+ "@dxos/app-graph": "0.8.4-main.1da679c",
37
+ "@dxos/async": "0.8.4-main.1da679c",
38
+ "@dxos/debug": "0.8.4-main.1da679c",
39
+ "@dxos/echo-schema": "0.8.4-main.1da679c",
40
+ "@dxos/invariant": "0.8.4-main.1da679c",
41
+ "@dxos/live-object": "0.8.4-main.1da679c",
42
+ "@dxos/echo": "0.8.4-main.1da679c",
43
+ "@dxos/local-storage": "0.8.4-main.1da679c",
44
+ "@dxos/log": "0.8.4-main.1da679c",
45
+ "@dxos/plugin-deck": "0.8.4-main.1da679c",
46
+ "@dxos/plugin-graph": "0.8.4-main.1da679c",
47
+ "@dxos/keyboard": "0.8.4-main.1da679c",
48
+ "@dxos/plugin-observability": "0.8.4-main.1da679c",
49
+ "@dxos/protocols": "0.8.4-main.1da679c",
50
+ "@dxos/react-ui-attention": "0.8.4-main.1da679c",
51
+ "@dxos/react-ui-list": "0.8.4-main.1da679c",
52
+ "@dxos/react-client": "0.8.4-main.1da679c",
53
+ "@dxos/react-ui-menu": "0.8.4-main.1da679c",
54
+ "@dxos/react-ui-searchlist": "0.8.4-main.1da679c",
55
+ "@dxos/react-ui-tabs": "0.8.4-main.1da679c",
56
+ "@dxos/util": "0.8.4-main.1da679c",
57
+ "@dxos/react-ui-stack": "0.8.4-main.1da679c"
57
58
  },
58
59
  "devDependencies": {
59
- "@effect-rx/rx-react": "^0.34.1",
60
- "@effect/platform": "0.80.12",
61
- "@phosphor-icons/react": "^2.1.5",
60
+ "@effect-rx/rx-react": "0.38.0",
61
+ "@effect/platform": "0.90.2",
62
62
  "@types/react": "~18.2.0",
63
63
  "@types/react-dom": "~18.2.0",
64
64
  "react": "~18.2.0",
65
65
  "react-dom": "~18.2.0",
66
- "vite": "5.4.7",
67
- "@dxos/plugin-attention": "0.8.3",
68
- "@dxos/plugin-client": "0.8.3",
69
- "@dxos/plugin-space": "0.8.3",
70
- "@dxos/echo-signals": "0.8.3",
71
- "@dxos/plugin-storybook-layout": "0.8.3",
72
- "@dxos/plugin-theme": "0.8.3",
73
- "@dxos/random": "0.8.3",
74
- "@dxos/react-ui": "0.8.3",
75
- "@dxos/react-ui-theme": "0.8.3",
76
- "@dxos/storybook-utils": "0.8.3"
66
+ "vite": "7.1.1",
67
+ "@dxos/echo-signals": "0.8.4-main.1da679c",
68
+ "@dxos/plugin-attention": "0.8.4-main.1da679c",
69
+ "@dxos/plugin-client": "0.8.4-main.1da679c",
70
+ "@dxos/plugin-space": "0.8.4-main.1da679c",
71
+ "@dxos/plugin-storybook-layout": "0.8.4-main.1da679c",
72
+ "@dxos/random": "0.8.4-main.1da679c",
73
+ "@dxos/plugin-theme": "0.8.4-main.1da679c",
74
+ "@dxos/react-ui": "0.8.4-main.1da679c",
75
+ "@dxos/react-ui-theme": "0.8.4-main.1da679c",
76
+ "@dxos/storybook-utils": "0.8.4-main.1da679c"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@effect-rx/rx-react": "^0.34.1",
80
- "@effect/platform": "0.80.12",
81
- "@phosphor-icons/react": "^2.1.5",
80
+ "@effect/platform": "^0.80.12",
82
81
  "effect": "^3.13.3",
83
82
  "react": "~18.2.0",
84
83
  "react-dom": "~18.2.0",
85
- "@dxos/react-ui": "0.8.3",
86
- "@dxos/react-ui-theme": "0.8.3"
84
+ "@dxos/react-ui": "0.8.4-main.1da679c",
85
+ "@dxos/react-ui-theme": "0.8.4-main.1da679c"
87
86
  },
88
87
  "publishConfig": {
89
88
  "access": "public"
@@ -3,14 +3,14 @@
3
3
  //
4
4
 
5
5
  import {
6
- definePlugin,
7
- defineModule,
8
- Events,
9
- contributes,
10
6
  Capabilities,
7
+ Events,
8
+ LayoutAction,
11
9
  allOf,
10
+ contributes,
12
11
  createIntent,
13
- LayoutAction,
12
+ defineModule,
13
+ definePlugin,
14
14
  } from '@dxos/app-framework';
15
15
  import { type TreeData } from '@dxos/react-ui-list';
16
16
 
@@ -18,7 +18,7 @@ import { AppGraphBuilder, IntentResolver, Keyboard, ReactSurface, State } from '
18
18
  import { NODE_TYPE } from './components';
19
19
  import { NavTreeEvents } from './events';
20
20
  import { meta } from './meta';
21
- import translations from './translations';
21
+ import { translations } from './translations';
22
22
 
23
23
  export const NavTreePlugin = () =>
24
24
  definePlugin(meta, [
@@ -5,8 +5,8 @@
5
5
  import { Rx } from '@effect-rx/rx-react';
6
6
  import { Option, pipe } from 'effect';
7
7
 
8
- import { Capabilities, contributes, type PluginContext, createIntent, LayoutAction } from '@dxos/app-framework';
9
- import { createExtension, ROOT_ID } from '@dxos/plugin-graph';
8
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
9
+ import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
10
10
 
11
11
  import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';
12
12
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { Schema } from 'effect';
6
6
 
7
- import { contributes, type PluginContext, Capabilities, createResolver, LayoutAction } from '@dxos/app-framework';
7
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
8
8
  import { log } from '@dxos/log';
9
9
 
10
10
  import { NavTreeCapabilities } from './capabilities';
@@ -2,10 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities as AppCapabilities, contributes, type PluginContext } from '@dxos/app-framework';
5
+ import { Capabilities as AppCapabilities, type PluginContext, contributes } from '@dxos/app-framework';
6
6
  import { debounce } from '@dxos/async';
7
7
  import { Keyboard } from '@dxos/keyboard';
8
- import { isAction, type Node } from '@dxos/plugin-graph';
8
+ import { type Node, isAction } from '@dxos/plugin-graph';
9
9
  import { getHostPlatform } from '@dxos/util';
10
10
 
11
11
  import { KEY_BINDING } from '../meta';
@@ -7,7 +7,7 @@ import React from 'react';
7
7
  import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
8
  import { isGraphNode } from '@dxos/plugin-graph';
9
9
 
10
- import { CommandsDialogContent, CommandsTrigger, NavTreeDocumentTitle, NavTreeContainer } from '../components';
10
+ import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '../components';
11
11
  import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';
12
12
 
13
13
  export default () =>
@@ -4,14 +4,15 @@
4
4
 
5
5
  import { effect, untracked } from '@preact/signals-core';
6
6
 
7
- import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
7
+ import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
8
8
  import { type Live } from '@dxos/echo';
9
9
  import { live } from '@dxos/live-object';
10
10
  import { Path } from '@dxos/react-ui-list';
11
11
 
12
- import { NavTreeCapabilities } from './capabilities';
13
12
  import { NAVTREE_PLUGIN } from '../meta';
14
13
 
14
+ import { NavTreeCapabilities } from './capabilities';
15
+
15
16
  const KEY = `${NAVTREE_PLUGIN}/state/v1`;
16
17
 
17
18
  const getInitialState = () => {
@@ -4,11 +4,11 @@
4
4
 
5
5
  import React, { useMemo, useState } from 'react';
6
6
 
7
- import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
7
+ import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { type ActionLike, isAction, isActionGroup } from '@dxos/app-graph';
9
9
  import { Keyboard, keySymbols } from '@dxos/keyboard';
10
10
  import { useActions } from '@dxos/plugin-graph';
11
- import { Button, Dialog, Icon, useTranslation, toLocalizedString } from '@dxos/react-ui';
11
+ import { Button, Dialog, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
12
12
  import { SearchList } from '@dxos/react-ui-searchlist';
13
13
  import {
14
14
  cardDialogContent,
@@ -2,12 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { MagnifyingGlass } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
8
- import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
9
- import { Button, useTranslation } from '@dxos/react-ui';
10
- import { getSize } from '@dxos/react-ui-theme';
7
+ import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
8
+ import { Button, Icon, useTranslation } from '@dxos/react-ui';
11
9
 
12
10
  import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../../meta';
13
11
 
@@ -31,7 +29,7 @@ export const CommandsTrigger = () => {
31
29
  }
32
30
  >
33
31
  <span className='text-description font-normal grow text-start'>{t('command list input placeholder')}</span>
34
- <MagnifyingGlass className={getSize(5)} />
32
+ <Icon icon='ph--magnifying-glass--regular' size={5} />
35
33
  </Button>
36
34
  );
37
35
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type StoryObj, type Meta } from '@storybook/react';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
  import { Schema } from 'effect';
9
9
  import React from 'react';
10
10
 
@@ -28,14 +28,14 @@ import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
28
28
  import { ThemePlugin } from '@dxos/plugin-theme';
29
29
  import { faker } from '@dxos/random';
30
30
  import { IconButton, Input, Main, Toolbar } from '@dxos/react-ui';
31
- import { useAttentionAttributes, useAttention } from '@dxos/react-ui-attention';
31
+ import { useAttention, useAttentionAttributes } from '@dxos/react-ui-attention';
32
32
  import { Stack, StackItem } from '@dxos/react-ui-stack';
33
33
  import { defaultTx, mx } from '@dxos/react-ui-theme';
34
34
  import { withLayout } from '@dxos/storybook-utils';
35
35
 
36
36
  import { NavTreePlugin } from '../../NavTreePlugin';
37
37
  import { storybookGraphBuilders } from '../../testing';
38
- import translations from '../../translations';
38
+ import { translations } from '../../translations';
39
39
  import { NavTreeContainer } from '../NavTreeContainer';
40
40
 
41
41
  faker.seed(1234);
@@ -116,7 +116,7 @@ const DefaultStory = () => {
116
116
  );
117
117
  };
118
118
 
119
- const meta: Meta<typeof NavTreeContainer> = {
119
+ const meta = {
120
120
  title: 'plugins/plugin-navtree/NavTree',
121
121
  component: NavTreeContainer,
122
122
  render: DefaultStory,
@@ -152,7 +152,7 @@ const meta: Meta<typeof NavTreeContainer> = {
152
152
  parameters: {
153
153
  translations,
154
154
  },
155
- };
155
+ } satisfies Meta<typeof NavTreeContainer>;
156
156
 
157
157
  export default meta;
158
158
 
@@ -172,7 +172,7 @@ export const WithClient: Story = {
172
172
  AttentionPlugin(),
173
173
  NavTreePlugin(),
174
174
  ClientPlugin({
175
- onClientInitialized: async (_, client) => {
175
+ onClientInitialized: async ({ client }) => {
176
176
  await client.halo.createIdentity();
177
177
  },
178
178
  }),
@@ -10,11 +10,11 @@ import { Tabs } from '@dxos/react-ui-tabs';
10
10
  import { useLoadDescendents } from '../../hooks';
11
11
  import { type NavTreeItemGraphNode } from '../../types';
12
12
  import { useNavTreeContext } from '../NavTreeContext';
13
- import { L0Menu, L1Panels, type L1PanelsProps } from '../Sidebar';
13
+ import { L0Menu, L1Tabs, type L1TabsProps } from '../Sidebar';
14
14
 
15
15
  export const NAV_TREE_ITEM = 'NavTreeItem';
16
16
 
17
- export type NavTreeProps = Pick<TreeProps<NavTreeItemGraphNode>, 'id' | 'root'> & Pick<L1PanelsProps, 'open'>;
17
+ export type NavTreeProps = Pick<TreeProps<NavTreeItemGraphNode>, 'id' | 'root'> & Pick<L1TabsProps, 'open'>;
18
18
 
19
19
  export const NavTree = ({ id, root, ...props }: NavTreeProps) => {
20
20
  const { tab, useItems, onBack } = useNavTreeContext();
@@ -56,7 +56,7 @@ export const NavTree = ({ id, root, ...props }: NavTreeProps) => {
56
56
  path={path}
57
57
  parent={root}
58
58
  />
59
- <L1Panels topLevelItems={topLevelItems} path={path} currentItemId={tab} onBack={onBack} {...props} />
59
+ <L1Tabs topLevelItems={topLevelItems} path={path} currentItemId={tab} onBack={onBack} {...props} />
60
60
  </Tabs.Root>
61
61
  );
62
62
  };
@@ -3,34 +3,35 @@
3
3
  //
4
4
 
5
5
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
6
- import { extractInstruction, type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
6
+ import { type Instruction, extractInstruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
7
7
  import { untracked } from '@preact/signals-core';
8
8
  import React, { memo, useCallback, useEffect, useMemo } from 'react';
9
9
 
10
10
  import {
11
- createIntent,
12
11
  LayoutAction,
13
12
  Surface,
13
+ createIntent,
14
14
  useAppGraph,
15
15
  useCapability,
16
16
  useIntentDispatcher,
17
17
  useLayout,
18
18
  } from '@dxos/app-framework';
19
- import { isAction, isActionLike, ROOT_ID, type Node, type ReadableGraph } from '@dxos/app-graph';
19
+ import { type Node, ROOT_ID, type ReadableGraph, isAction, isActionLike } from '@dxos/app-graph';
20
20
  import { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
21
- import { useConnections } from '@dxos/plugin-graph';
21
+ import { useConnections, useActions as useGraphActions } from '@dxos/plugin-graph';
22
22
  import { useMediaQuery, useSidebars } from '@dxos/react-ui';
23
- import { isTreeData, type TreeItemDataProps, type TreeData } from '@dxos/react-ui-list';
23
+ import { type TreeData, type TreeItemDataProps, isTreeData } from '@dxos/react-ui-list';
24
24
  import { mx } from '@dxos/react-ui-theme';
25
25
  import { arrayMove, byPosition } from '@dxos/util';
26
26
 
27
+ import { NavTreeCapabilities } from '../capabilities';
28
+ import { NAVTREE_PLUGIN } from '../meta';
29
+ import { type FlattenedActions, type NavTreeItemGraphNode } from '../types';
30
+ import { getChildren, getParent, resolveMigrationOperation } from '../util';
31
+
27
32
  import { NAV_TREE_ITEM, NavTree } from './NavTree';
28
33
  import { NavTreeContext } from './NavTreeContext';
29
34
  import { type NavTreeContextValue } from './types';
30
- import { NavTreeCapabilities } from '../capabilities';
31
- import { NAVTREE_PLUGIN } from '../meta';
32
- import { type NavTreeItemGraphNode } from '../types';
33
- import { getChildren, getParent, getActions as naturalGetActions, resolveMigrationOperation } from '../util';
34
35
 
35
36
  // TODO(thure): Is NavTree truly authoritative in this regard?
36
37
  export const NODE_TYPE = 'dxos/app-graph/node';
@@ -40,7 +41,9 @@ const renderItemEnd = ({ node, open }: { node: Node; open: boolean }) => (
40
41
  );
41
42
 
42
43
  const getChildrenFilter = (node: Node): node is Node =>
43
- untracked(() => !isActionLike(node) && node.type !== PLANK_COMPANION_TYPE);
44
+ untracked(
45
+ () => !isActionLike(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== 'hidden',
46
+ );
44
47
 
45
48
  const filterItems = (node: Node, disposition?: string) => {
46
49
  if (!disposition && (node.properties.disposition === 'hidden' || node.properties.disposition === 'alternate-tree')) {
@@ -59,10 +62,34 @@ const getItems = (graph: ReadableGraph, node?: Node, disposition?: string) => {
59
62
 
60
63
  const useItems = (node?: Node, options?: { disposition?: string; sort?: boolean }) => {
61
64
  const { graph } = useAppGraph();
62
- const connections = useConnections(graph, node?.id ?? ROOT_ID).filter((node) =>
63
- filterItems(node, options?.disposition),
65
+ const connections = useConnections(graph, node?.id ?? ROOT_ID);
66
+ const filtered = connections.filter((node) => filterItems(node, options?.disposition));
67
+ return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
68
+ };
69
+
70
+ const useActions = (node: Node): FlattenedActions => {
71
+ const { graph } = useAppGraph();
72
+ const actions = useGraphActions(graph, node.id);
73
+
74
+ return useMemo(
75
+ () =>
76
+ actions.reduce(
77
+ (acc: FlattenedActions, arg) => {
78
+ if (arg.properties.disposition === 'item') {
79
+ return acc;
80
+ }
81
+
82
+ acc.actions.push(arg);
83
+ if (!isAction(arg)) {
84
+ const actionGroup = graph.getActions(arg.id);
85
+ acc.groupedActions[arg.id] = actionGroup;
86
+ }
87
+ return acc;
88
+ },
89
+ { actions: [], groupedActions: {} },
90
+ ),
91
+ [actions],
64
92
  );
65
- return options?.sort ? connections.toSorted((a, b) => byPosition(a.properties, b.properties)) : connections;
66
93
  };
67
94
 
68
95
  export type NavTreeContainerProps = {
@@ -78,8 +105,6 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
78
105
  const layout = useLayout();
79
106
  const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
80
107
 
81
- const getActions = useCallback((node: Node) => naturalGetActions(graph, node), [graph]);
82
-
83
108
  const getProps = useCallback(
84
109
  (node: Node, path: string[]): TreeItemDataProps => {
85
110
  const children = getChildren(graph, node, path).filter(getChildrenFilter);
@@ -270,7 +295,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
270
295
  () => ({
271
296
  useItems,
272
297
  tab,
273
- getActions,
298
+ useActions,
274
299
  loadDescendents,
275
300
  renderItemEnd,
276
301
  popoverAnchorId,
@@ -288,7 +313,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
288
313
  }),
289
314
  [
290
315
  tab,
291
- getActions,
316
+ useActions,
292
317
  loadDescendents,
293
318
  renderItemEnd,
294
319
  popoverAnchorId,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta, type StoryObj } from '@storybook/react';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
 
9
9
  import { type NodeArg } from '@dxos/app-graph';
10
10
  import { faker } from '@dxos/random';
@@ -39,7 +39,7 @@ const menuActions = faker.helpers.multiple(
39
39
  { count: 20 },
40
40
  );
41
41
 
42
- const meta: Meta<typeof NavTreeItemAction> = {
42
+ const meta = {
43
43
  title: 'plugins/plugin-navtree/NavTreeItemAction',
44
44
  component: NavTreeItemAction,
45
45
  decorators: [withTheme, withLayout()],
@@ -52,7 +52,7 @@ const meta: Meta<typeof NavTreeItemAction> = {
52
52
  parameters: {
53
53
  layout: 'centered',
54
54
  },
55
- };
55
+ } satisfies Meta<typeof NavTreeItemAction>;
56
56
 
57
57
  export default meta;
58
58
 
@@ -5,9 +5,9 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { type Action, type Node } from '@dxos/app-graph';
8
- import { useTranslation, toLocalizedString, IconButton, useDensityContext } from '@dxos/react-ui';
9
- import { DropdownMenu, MenuProvider, type MenuItem } from '@dxos/react-ui-menu';
10
- import { hoverableControlItem, hoverableOpenControlItem, mx } from '@dxos/react-ui-theme';
8
+ import { IconButton, toLocalizedString, useDensityContext, useTranslation } from '@dxos/react-ui';
9
+ import { DropdownMenu, type MenuItem, MenuProvider } from '@dxos/react-ui-menu';
10
+ import { hoverableControlItem, hoverableOpenControlItem } from '@dxos/react-ui-theme';
11
11
 
12
12
  import { NAVTREE_PLUGIN } from '../../meta';
13
13
  import { type ActionProperties } from '../../types';
@@ -46,7 +46,7 @@ export const NavTreeItemActionDropdownMenu = ({
46
46
  <DropdownMenu.Trigger asChild>
47
47
  <IconButton
48
48
  {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}
49
- classNames={mx('shrink-0 pli-2 pointer-fine:pli-1', hoverableControlItem, hoverableOpenControlItem)}
49
+ classNames={['shrink-0 pli-2 pointer-fine:pli-1', hoverableControlItem, hoverableOpenControlItem]}
50
50
  variant='ghost'
51
51
  icon={icon ?? fallbackIcon}
52
52
  iconOnly
@@ -70,12 +70,12 @@ export const NavTreeItemMonolithicAction = ({
70
70
  <IconButton
71
71
  {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}
72
72
  variant={variant}
73
- classNames={mx(
73
+ classNames={[
74
74
  'shrink-0',
75
75
  hoverableControlItem,
76
76
  hoverableOpenControlItem,
77
77
  iconOnly ? 'pli-2 pointer-fine:pli-1' : 'p-2 pointer-fine:p-2 mie-1',
78
- )}
78
+ ]}
79
79
  icon={icon ?? fallbackIcon}
80
80
  iconOnly={iconOnly}
81
81
  label={baseLabel}
@@ -5,23 +5,23 @@
5
5
  import React, { Fragment, memo } from 'react';
6
6
 
7
7
  import { isAction } from '@dxos/app-graph';
8
- import { DensityProvider, Popover, toLocalizedString, Treegrid, useTranslation } from '@dxos/react-ui';
8
+ import { DensityProvider, Popover, Treegrid, toLocalizedString, useTranslation } from '@dxos/react-ui';
9
9
 
10
- import { NavTreeItemAction } from './NavTreeItemAction';
11
10
  import { useLoadDescendents } from '../../hooks';
12
11
  import { NAVTREE_PLUGIN } from '../../meta';
13
12
  import { NAV_TREE_ITEM } from '../NavTree';
14
13
  import { useNavTreeContext } from '../NavTreeContext';
15
- import type { NavTreeItemColumnsProps } from '../types';
14
+ import { type NavTreeItemColumnsProps } from '../types';
15
+
16
+ import { NavTreeItemAction } from './NavTreeItemAction';
16
17
 
17
18
  export const NavTreeItemColumns = memo(({ path, item, open, density = 'fine' }: NavTreeItemColumnsProps) => {
18
19
  const { t } = useTranslation(NAVTREE_PLUGIN);
19
- const { getActions, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
20
+ const { useActions, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
20
21
 
21
22
  const level = path.length - 2;
22
-
23
- const { actions: _actions, groupedActions } = getActions(item);
24
- const [primaryAction, ...secondaryActions] = _actions.toSorted((a, b) =>
23
+ const { actions: _actions, groupedActions } = useActions(item);
24
+ const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) =>
25
25
  a.properties?.disposition === 'list-item-primary' ? -1 : 1,
26
26
  );
27
27
 
@@ -12,9 +12,9 @@ import {
12
12
  extractClosestEdge,
13
13
  } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
14
14
  import React, {
15
- forwardRef,
16
15
  type MouseEvent,
17
16
  type PropsWithChildren,
17
+ forwardRef,
18
18
  useCallback,
19
19
  useLayoutEffect,
20
20
  useMemo,
@@ -25,7 +25,7 @@ import React, {
25
25
  import { type Node } from '@dxos/app-graph';
26
26
  import { invariant } from '@dxos/invariant';
27
27
  import { Icon, ListItem, ScrollArea, Tooltip, toLocalizedString, useMediaQuery, useTranslation } from '@dxos/react-ui';
28
- import { MenuProvider, DropdownMenu, type MenuItem } from '@dxos/react-ui-menu';
28
+ import { DropdownMenu, type MenuItem, MenuProvider } from '@dxos/react-ui-menu';
29
29
  import type { StackItemRearrangeHandler } from '@dxos/react-ui-stack';
30
30
  import { Tabs } from '@dxos/react-ui-tabs';
31
31
  import { mx } from '@dxos/react-ui-theme';