@dxos/plugin-navtree 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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.
- package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs → app-graph-builder-6JDBQ25U.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs.map → app-graph-builder-6JDBQ25U.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-TZA65AKW.mjs → chunk-SNGLGBFJ.mjs} +211 -170
- package/dist/lib/browser/chunk-SNGLGBFJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-N35ZIHFD.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs.map → intent-resolver-N35ZIHFD.mjs.map} +3 -3
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-HMTMA33N.mjs} +1 -1
- package/dist/lib/{node-esm/keyboard-MOZWHFUM.mjs.map → browser/keyboard-HMTMA33N.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N2HPMYCU.mjs → react-surface-WKWXMM2N.mjs} +2 -2
- package/dist/lib/browser/{react-surface-N2HPMYCU.mjs.map → react-surface-WKWXMM2N.mjs.map} +1 -1
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-P5DGL7KS.mjs} +1 -1
- package/dist/lib/browser/state-P5DGL7KS.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +2 -2
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +5 -5
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -40
- package/src/NavTreePlugin.tsx +5 -5
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/capabilities/state.ts +3 -2
- package/src/components/CommandsDialog/CommandsDialog.tsx +2 -2
- package/src/components/CommandsDialog/CommandsTrigger.tsx +3 -5
- package/src/components/NavTree/NavTree.stories.tsx +3 -3
- package/src/components/NavTree/NavTree.tsx +3 -3
- package/src/components/NavTreeContainer.tsx +39 -16
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +6 -6
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -7
- package/src/components/Sidebar/L0Menu.tsx +2 -2
- package/src/components/Sidebar/L1Panel.tsx +72 -92
- package/src/components/Sidebar/L1Tabs.tsx +58 -0
- package/src/components/Sidebar/index.ts +1 -0
- package/src/components/index.ts +1 -1
- package/src/components/types.ts +3 -2
- package/src/experimental/Tree.stories.tsx +8 -8
- package/src/experimental/Tree.tsx +15 -16
- package/src/testing/app-graph-builder.ts +1 -1
- package/src/translations.ts +1 -0
- package/src/util.ts +2 -20
- package/dist/lib/browser/chunk-TZA65AKW.mjs.map +0 -7
- package/dist/lib/browser/keyboard-QRS6WOQH.mjs.map +0 -7
- package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs +0 -46
- package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CY7QWR4R.mjs +0 -1429
- package/dist/lib/node-esm/chunk-CY7QWR4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P2JGW3WR.mjs +0 -18
- package/dist/lib/node-esm/chunk-P2JGW3WR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V3QXFDDP.mjs +0 -16
- package/dist/lib/node-esm/chunk-V3QXFDDP.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -150
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs +0 -48
- package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-MOZWHFUM.mjs +0 -52
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs +0 -52
- package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs.map +0 -7
- package/dist/lib/node-esm/state-Z3OTRC2I.mjs +0 -118
- package/dist/lib/node-esm/state-Z3OTRC2I.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.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
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.
|
|
34
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
35
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/echo": "0.8.4-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-menu": "0.8.4-main.
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/react-ui-
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
34
|
+
"effect": "3.17.7",
|
|
35
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
36
|
+
"@dxos/app-graph": "0.8.4-main.fd6878d",
|
|
37
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
38
|
+
"@dxos/debug": "0.8.4-main.fd6878d",
|
|
39
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
40
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
41
|
+
"@dxos/keyboard": "0.8.4-main.fd6878d",
|
|
42
|
+
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
43
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
44
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
45
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d",
|
|
46
|
+
"@dxos/plugin-deck": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/react-ui-list": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/react-ui-attention": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/plugin-observability": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/react-ui-searchlist": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/react-ui-menu": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/react-ui-stack": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/react-ui-tabs": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/util": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/protocols": "0.8.4-main.fd6878d"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@effect-rx/rx-react": "0.38.0",
|
|
60
|
-
"@effect/platform": "0.
|
|
61
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
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
66
|
"vite": "5.4.7",
|
|
67
|
-
"@dxos/echo-signals": "0.8.4-main.
|
|
68
|
-
"@dxos/plugin-attention": "0.8.4-main.
|
|
69
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
70
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
71
|
-
"@dxos/plugin-storybook-layout": "0.8.4-main.
|
|
72
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
73
|
-
"@dxos/random": "0.8.4-main.
|
|
74
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
75
|
-
"@dxos/react-ui
|
|
76
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
67
|
+
"@dxos/echo-signals": "0.8.4-main.fd6878d",
|
|
68
|
+
"@dxos/plugin-attention": "0.8.4-main.fd6878d",
|
|
69
|
+
"@dxos/plugin-client": "0.8.4-main.fd6878d",
|
|
70
|
+
"@dxos/plugin-space": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.fd6878d",
|
|
72
|
+
"@dxos/plugin-theme": "0.8.4-main.fd6878d",
|
|
73
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
74
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
76
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@effect-rx/rx-react": "^0.34.1",
|
|
80
80
|
"@effect/platform": "^0.80.12",
|
|
81
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
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.4-main.
|
|
86
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
85
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
87
86
|
},
|
|
88
87
|
"publishConfig": {
|
|
89
88
|
"access": "public"
|
package/src/NavTreePlugin.tsx
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
9
|
-
import {
|
|
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 {
|
|
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,
|
|
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 {
|
|
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,
|
|
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,
|
|
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 {
|
|
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,
|
|
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 {
|
|
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
|
-
<
|
|
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
|
|
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 {
|
|
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';
|
|
@@ -172,7 +172,7 @@ export const WithClient: Story = {
|
|
|
172
172
|
AttentionPlugin(),
|
|
173
173
|
NavTreePlugin(),
|
|
174
174
|
ClientPlugin({
|
|
175
|
-
onClientInitialized: async (
|
|
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,
|
|
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<
|
|
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
|
-
<
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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';
|
|
@@ -59,10 +60,34 @@ const getItems = (graph: ReadableGraph, node?: Node, disposition?: string) => {
|
|
|
59
60
|
|
|
60
61
|
const useItems = (node?: Node, options?: { disposition?: string; sort?: boolean }) => {
|
|
61
62
|
const { graph } = useAppGraph();
|
|
62
|
-
const connections = useConnections(graph, node?.id ?? ROOT_ID)
|
|
63
|
-
|
|
63
|
+
const connections = useConnections(graph, node?.id ?? ROOT_ID);
|
|
64
|
+
const filtered = connections.filter((node) => filterItems(node, options?.disposition));
|
|
65
|
+
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const useActions = (node: Node): FlattenedActions => {
|
|
69
|
+
const { graph } = useAppGraph();
|
|
70
|
+
const actions = useGraphActions(graph, node.id);
|
|
71
|
+
|
|
72
|
+
return useMemo(
|
|
73
|
+
() =>
|
|
74
|
+
actions.reduce(
|
|
75
|
+
(acc: FlattenedActions, arg) => {
|
|
76
|
+
if (arg.properties.disposition === 'item') {
|
|
77
|
+
return acc;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
acc.actions.push(arg);
|
|
81
|
+
if (!isAction(arg)) {
|
|
82
|
+
const actionGroup = graph.getActions(arg.id);
|
|
83
|
+
acc.groupedActions[arg.id] = actionGroup;
|
|
84
|
+
}
|
|
85
|
+
return acc;
|
|
86
|
+
},
|
|
87
|
+
{ actions: [], groupedActions: {} },
|
|
88
|
+
),
|
|
89
|
+
[actions],
|
|
64
90
|
);
|
|
65
|
-
return options?.sort ? connections.toSorted((a, b) => byPosition(a.properties, b.properties)) : connections;
|
|
66
91
|
};
|
|
67
92
|
|
|
68
93
|
export type NavTreeContainerProps = {
|
|
@@ -78,8 +103,6 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
|
|
|
78
103
|
const layout = useLayout();
|
|
79
104
|
const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
|
|
80
105
|
|
|
81
|
-
const getActions = useCallback((node: Node) => naturalGetActions(graph, node), [graph]);
|
|
82
|
-
|
|
83
106
|
const getProps = useCallback(
|
|
84
107
|
(node: Node, path: string[]): TreeItemDataProps => {
|
|
85
108
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
@@ -270,7 +293,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
|
|
|
270
293
|
() => ({
|
|
271
294
|
useItems,
|
|
272
295
|
tab,
|
|
273
|
-
|
|
296
|
+
useActions,
|
|
274
297
|
loadDescendents,
|
|
275
298
|
renderItemEnd,
|
|
276
299
|
popoverAnchorId,
|
|
@@ -288,7 +311,7 @@ export const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeC
|
|
|
288
311
|
}),
|
|
289
312
|
[
|
|
290
313
|
tab,
|
|
291
|
-
|
|
314
|
+
useActions,
|
|
292
315
|
loadDescendents,
|
|
293
316
|
renderItemEnd,
|
|
294
317
|
popoverAnchorId,
|
|
@@ -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 {
|
|
9
|
-
import { DropdownMenu,
|
|
10
|
-
import { hoverableControlItem, hoverableOpenControlItem
|
|
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={
|
|
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={
|
|
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,
|
|
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
|
|
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 {
|
|
20
|
+
const { useActions, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
20
21
|
|
|
21
22
|
const level = path.length - 2;
|
|
22
|
-
|
|
23
|
-
const
|
|
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 {
|
|
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';
|