@dxos/plugin-navtree 0.8.4-main.c1de068 → 0.8.4-main.e098934

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 (81) hide show
  1. package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs → app-graph-builder-6JDBQ25U.mjs} +3 -3
  2. package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs.map → app-graph-builder-6JDBQ25U.mjs.map} +3 -3
  3. package/dist/lib/browser/{chunk-SICQTLXC.mjs → chunk-ZKVY35IG.mjs} +190 -163
  4. package/dist/lib/browser/chunk-ZKVY35IG.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +4 -5
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-N35ZIHFD.mjs} +2 -2
  8. package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs.map → intent-resolver-N35ZIHFD.mjs.map} +3 -3
  9. package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-HMTMA33N.mjs} +1 -1
  10. package/dist/lib/browser/{keyboard-QRS6WOQH.mjs.map → keyboard-HMTMA33N.mjs.map} +2 -2
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/{react-surface-WURHCBQQ.mjs → react-surface-5PZ4XJT7.mjs} +2 -2
  13. package/dist/lib/browser/{react-surface-WURHCBQQ.mjs.map → react-surface-5PZ4XJT7.mjs.map} +1 -1
  14. package/dist/lib/browser/{state-54DY3DOY.mjs → state-P5DGL7KS.mjs} +1 -1
  15. package/dist/lib/browser/state-P5DGL7KS.mjs.map +7 -0
  16. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  17. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/index.d.ts +6 -6
  19. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  21. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/keyboard.d.ts +1 -1
  23. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  25. package/dist/types/src/capabilities/state.d.ts +2 -2
  26. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  27. package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
  28. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  29. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +25 -2
  30. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  32. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -3
  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.map +1 -1
  37. package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
  38. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  39. package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
  40. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
  41. package/dist/types/src/components/Sidebar/index.d.ts +1 -0
  42. package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
  43. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -4
  44. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/types.d.ts +2 -2
  46. package/dist/types/src/components/types.d.ts.map +1 -1
  47. package/dist/types/src/experimental/Tree.stories.d.ts +6 -2
  48. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  49. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  50. package/dist/types/src/translations.d.ts +1 -0
  51. package/dist/types/src/translations.d.ts.map +1 -1
  52. package/dist/types/src/util.d.ts +1 -2
  53. package/dist/types/src/util.d.ts.map +1 -1
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +40 -39
  56. package/src/NavTreePlugin.tsx +5 -5
  57. package/src/capabilities/app-graph-builder.ts +2 -2
  58. package/src/capabilities/intent-resolver.ts +1 -1
  59. package/src/capabilities/keyboard.ts +2 -2
  60. package/src/capabilities/react-surface.tsx +1 -1
  61. package/src/capabilities/state.ts +3 -2
  62. package/src/components/CommandsDialog/CommandsDialog.tsx +2 -2
  63. package/src/components/CommandsDialog/CommandsTrigger.tsx +1 -1
  64. package/src/components/NavTree/NavTree.stories.tsx +5 -5
  65. package/src/components/NavTree/NavTree.tsx +3 -3
  66. package/src/components/NavTreeContainer.tsx +40 -14
  67. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +2 -2
  68. package/src/components/NavTreeItem/NavTreeItemAction.tsx +2 -2
  69. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -7
  70. package/src/components/Sidebar/L0Menu.tsx +2 -2
  71. package/src/components/Sidebar/L1Panel.tsx +70 -92
  72. package/src/components/Sidebar/L1Tabs.tsx +58 -0
  73. package/src/components/Sidebar/index.ts +1 -0
  74. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +6 -4
  75. package/src/components/types.ts +3 -2
  76. package/src/experimental/Tree.stories.tsx +5 -3
  77. package/src/testing/app-graph-builder.ts +1 -1
  78. package/src/translations.ts +1 -0
  79. package/src/util.ts +2 -20
  80. package/dist/lib/browser/chunk-SICQTLXC.mjs.map +0 -7
  81. package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-navtree",
3
- "version": "0.8.4-main.c1de068",
3
+ "version": "0.8.4-main.e098934",
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,49 +31,49 @@
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.17.0",
34
- "@dxos/app-framework": "0.8.4-main.c1de068",
35
- "@dxos/debug": "0.8.4-main.c1de068",
36
- "@dxos/app-graph": "0.8.4-main.c1de068",
37
- "@dxos/async": "0.8.4-main.c1de068",
38
- "@dxos/echo": "0.8.4-main.c1de068",
39
- "@dxos/echo-schema": "0.8.4-main.c1de068",
40
- "@dxos/invariant": "0.8.4-main.c1de068",
41
- "@dxos/live-object": "0.8.4-main.c1de068",
42
- "@dxos/keyboard": "0.8.4-main.c1de068",
43
- "@dxos/local-storage": "0.8.4-main.c1de068",
44
- "@dxos/plugin-deck": "0.8.4-main.c1de068",
45
- "@dxos/log": "0.8.4-main.c1de068",
46
- "@dxos/plugin-graph": "0.8.4-main.c1de068",
47
- "@dxos/protocols": "0.8.4-main.c1de068",
48
- "@dxos/plugin-observability": "0.8.4-main.c1de068",
49
- "@dxos/react-ui-attention": "0.8.4-main.c1de068",
50
- "@dxos/react-client": "0.8.4-main.c1de068",
51
- "@dxos/react-ui-list": "0.8.4-main.c1de068",
52
- "@dxos/react-ui-searchlist": "0.8.4-main.c1de068",
53
- "@dxos/react-ui-menu": "0.8.4-main.c1de068",
54
- "@dxos/react-ui-tabs": "0.8.4-main.c1de068",
55
- "@dxos/react-ui-stack": "0.8.4-main.c1de068",
56
- "@dxos/util": "0.8.4-main.c1de068"
34
+ "effect": "3.17.7",
35
+ "@dxos/app-framework": "0.8.4-main.e098934",
36
+ "@dxos/app-graph": "0.8.4-main.e098934",
37
+ "@dxos/async": "0.8.4-main.e098934",
38
+ "@dxos/debug": "0.8.4-main.e098934",
39
+ "@dxos/echo": "0.8.4-main.e098934",
40
+ "@dxos/echo-schema": "0.8.4-main.e098934",
41
+ "@dxos/keyboard": "0.8.4-main.e098934",
42
+ "@dxos/live-object": "0.8.4-main.e098934",
43
+ "@dxos/invariant": "0.8.4-main.e098934",
44
+ "@dxos/local-storage": "0.8.4-main.e098934",
45
+ "@dxos/log": "0.8.4-main.e098934",
46
+ "@dxos/plugin-observability": "0.8.4-main.e098934",
47
+ "@dxos/plugin-deck": "0.8.4-main.e098934",
48
+ "@dxos/protocols": "0.8.4-main.e098934",
49
+ "@dxos/react-client": "0.8.4-main.e098934",
50
+ "@dxos/plugin-graph": "0.8.4-main.e098934",
51
+ "@dxos/react-ui-attention": "0.8.4-main.e098934",
52
+ "@dxos/react-ui-list": "0.8.4-main.e098934",
53
+ "@dxos/react-ui-menu": "0.8.4-main.e098934",
54
+ "@dxos/react-ui-searchlist": "0.8.4-main.e098934",
55
+ "@dxos/react-ui-stack": "0.8.4-main.e098934",
56
+ "@dxos/react-ui-tabs": "0.8.4-main.e098934",
57
+ "@dxos/util": "0.8.4-main.e098934"
57
58
  },
58
59
  "devDependencies": {
59
60
  "@effect-rx/rx-react": "0.38.0",
60
- "@effect/platform": "0.89.0",
61
+ "@effect/platform": "0.90.2",
61
62
  "@types/react": "~18.2.0",
62
63
  "@types/react-dom": "~18.2.0",
63
64
  "react": "~18.2.0",
64
65
  "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/echo-signals": "0.8.4-main.c1de068",
67
- "@dxos/plugin-attention": "0.8.4-main.c1de068",
68
- "@dxos/plugin-space": "0.8.4-main.c1de068",
69
- "@dxos/plugin-client": "0.8.4-main.c1de068",
70
- "@dxos/plugin-storybook-layout": "0.8.4-main.c1de068",
71
- "@dxos/plugin-theme": "0.8.4-main.c1de068",
72
- "@dxos/random": "0.8.4-main.c1de068",
73
- "@dxos/react-ui": "0.8.4-main.c1de068",
74
- "@dxos/react-ui-theme": "0.8.4-main.c1de068",
75
- "@dxos/storybook-utils": "0.8.4-main.c1de068"
66
+ "vite": "7.1.1",
67
+ "@dxos/plugin-client": "0.8.4-main.e098934",
68
+ "@dxos/echo-signals": "0.8.4-main.e098934",
69
+ "@dxos/plugin-space": "0.8.4-main.e098934",
70
+ "@dxos/plugin-theme": "0.8.4-main.e098934",
71
+ "@dxos/plugin-storybook-layout": "0.8.4-main.e098934",
72
+ "@dxos/react-ui": "0.8.4-main.e098934",
73
+ "@dxos/react-ui-theme": "0.8.4-main.e098934",
74
+ "@dxos/random": "0.8.4-main.e098934",
75
+ "@dxos/storybook-utils": "0.8.4-main.e098934",
76
+ "@dxos/plugin-attention": "0.8.4-main.e098934"
76
77
  },
77
78
  "peerDependencies": {
78
79
  "@effect-rx/rx-react": "^0.34.1",
@@ -80,8 +81,8 @@
80
81
  "effect": "^3.13.3",
81
82
  "react": "~18.2.0",
82
83
  "react-dom": "~18.2.0",
83
- "@dxos/react-ui": "0.8.4-main.c1de068",
84
- "@dxos/react-ui-theme": "0.8.4-main.c1de068"
84
+ "@dxos/react-ui": "0.8.4-main.e098934",
85
+ "@dxos/react-ui-theme": "0.8.4-main.e098934"
85
86
  },
86
87
  "publishConfig": {
87
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
 
@@ -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,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
7
+ import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { Button, Icon, useTranslation } from '@dxos/react-ui';
9
9
 
10
10
  import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../../meta';
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type StoryObj, type Meta } from '@storybook/react-vite';
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,7 +28,7 @@ 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';
@@ -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')) {
@@ -64,6 +67,31 @@ const useItems = (node?: Node, options?: { disposition?: string; sort?: boolean
64
67
  return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
65
68
  };
66
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],
92
+ );
93
+ };
94
+
67
95
  export type NavTreeContainerProps = {
68
96
  popoverAnchorId?: string;
69
97
  topbar?: boolean;
@@ -77,8 +105,6 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
77
105
  const layout = useLayout();
78
106
  const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
79
107
 
80
- const getActions = useCallback((node: Node) => naturalGetActions(graph, node), [graph]);
81
-
82
108
  const getProps = useCallback(
83
109
  (node: Node, path: string[]): TreeItemDataProps => {
84
110
  const children = getChildren(graph, node, path).filter(getChildrenFilter);
@@ -269,7 +295,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
269
295
  () => ({
270
296
  useItems,
271
297
  tab,
272
- getActions,
298
+ useActions,
273
299
  loadDescendents,
274
300
  renderItemEnd,
275
301
  popoverAnchorId,
@@ -287,7 +313,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
287
313
  }),
288
314
  [
289
315
  tab,
290
- getActions,
316
+ useActions,
291
317
  loadDescendents,
292
318
  renderItemEnd,
293
319
  popoverAnchorId,
@@ -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,8 +5,8 @@
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';
8
+ import { IconButton, toLocalizedString, useDensityContext, useTranslation } from '@dxos/react-ui';
9
+ import { DropdownMenu, type MenuItem, MenuProvider } from '@dxos/react-ui-menu';
10
10
  import { hoverableControlItem, hoverableOpenControlItem } from '@dxos/react-ui-theme';
11
11
 
12
12
  import { NAVTREE_PLUGIN } from '../../meta';
@@ -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';