@dxos/plugin-navtree 0.8.4-main.f9ba587 → 0.8.4-main.fffef41
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-OHSCN3GX.mjs} +13 -12
- package/dist/lib/browser/app-graph-builder-OHSCN3GX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WCARAZ7J.mjs → chunk-5VLWX4PK.mjs} +4 -4
- package/dist/lib/browser/chunk-5VLWX4PK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TZA65AKW.mjs → chunk-7D2MPHXV.mjs} +317 -262
- package/dist/lib/browser/chunk-7D2MPHXV.mjs.map +7 -0
- package/dist/lib/browser/chunk-E6MZBCU5.mjs +19 -0
- package/dist/lib/browser/chunk-E6MZBCU5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-YUVXVPHG.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-YUVXVPHG.mjs.map +7 -0
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-YYTYJW4M.mjs} +4 -4
- package/dist/lib/{node-esm/keyboard-MOZWHFUM.mjs.map → browser/keyboard-YYTYJW4M.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N2HPMYCU.mjs → react-surface-J7MWWAGD.mjs} +10 -10
- package/dist/lib/browser/react-surface-J7MWWAGD.mjs.map +7 -0
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-EUSVT6BI.mjs} +7 -7
- package/dist/lib/browser/state-EUSVT6BI.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts +1 -1
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +18 -15
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog/CommandsDialog.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 +26 -4
- 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/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -4
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +2 -2
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts +2 -0
- 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/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -5
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.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/events.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +4 -5
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts +7 -4
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +1 -1
- package/dist/types/src/testing/generator.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/types.d.ts +4 -3
- package/dist/types/src/types.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 +49 -50
- package/src/NavTreePlugin.tsx +75 -76
- package/src/capabilities/app-graph-builder.ts +10 -9
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/state.ts +4 -3
- package/src/components/CommandsDialog/CommandsDialog.tsx +15 -7
- package/src/components/CommandsDialog/CommandsTrigger.tsx +6 -7
- package/src/components/NavTree/NavTree.stories.tsx +67 -53
- package/src/components/NavTree/NavTree.tsx +7 -3
- package/src/components/NavTreeContainer.tsx +91 -36
- package/src/components/NavTreeDocumentTitle.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +11 -10
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +33 -27
- package/src/components/Sidebar/L0Menu.tsx +56 -55
- package/src/components/Sidebar/L1Panel.tsx +72 -97
- package/src/components/Sidebar/L1Tabs.tsx +58 -0
- package/src/components/Sidebar/index.ts +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
- package/src/components/index.ts +1 -1
- package/src/components/types.ts +3 -2
- package/src/events.ts +2 -2
- package/src/experimental/Tree.stories.tsx +36 -38
- package/src/experimental/Tree.tsx +17 -35
- package/src/meta.ts +10 -7
- package/src/testing/app-graph-builder.ts +20 -19
- package/src/testing/generator.ts +2 -2
- package/src/translations.ts +1 -0
- package/src/types.ts +4 -3
- package/src/util.ts +2 -20
- package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
- package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
- package/dist/lib/browser/chunk-TZA65AKW.mjs.map +0 -7
- package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3XYN2CBU.mjs.map +0 -7
- package/dist/lib/browser/keyboard-QRS6WOQH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-N2HPMYCU.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.fffef41",
|
|
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
|
}
|
|
@@ -26,64 +27,62 @@
|
|
|
26
27
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
27
28
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
28
29
|
"@preact-signals/safe-react": "^0.9.0",
|
|
29
|
-
"@preact/signals-core": "^1.
|
|
30
|
+
"@preact/signals-core": "^1.12.1",
|
|
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
|
-
"
|
|
34
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/react-ui-tabs": "0.8.4-main.
|
|
56
|
-
"@dxos/util": "0.8.4-main.f9ba587"
|
|
34
|
+
"@dxos/app-graph": "0.8.4-main.fffef41",
|
|
35
|
+
"@dxos/app-framework": "0.8.4-main.fffef41",
|
|
36
|
+
"@dxos/async": "0.8.4-main.fffef41",
|
|
37
|
+
"@dxos/echo": "0.8.4-main.fffef41",
|
|
38
|
+
"@dxos/invariant": "0.8.4-main.fffef41",
|
|
39
|
+
"@dxos/keyboard": "0.8.4-main.fffef41",
|
|
40
|
+
"@dxos/debug": "0.8.4-main.fffef41",
|
|
41
|
+
"@dxos/live-object": "0.8.4-main.fffef41",
|
|
42
|
+
"@dxos/local-storage": "0.8.4-main.fffef41",
|
|
43
|
+
"@dxos/log": "0.8.4-main.fffef41",
|
|
44
|
+
"@dxos/plugin-deck": "0.8.4-main.fffef41",
|
|
45
|
+
"@dxos/lit-ui": "0.8.4-main.fffef41",
|
|
46
|
+
"@dxos/plugin-observability": "0.8.4-main.fffef41",
|
|
47
|
+
"@dxos/plugin-graph": "0.8.4-main.fffef41",
|
|
48
|
+
"@dxos/protocols": "0.8.4-main.fffef41",
|
|
49
|
+
"@dxos/react-client": "0.8.4-main.fffef41",
|
|
50
|
+
"@dxos/react-ui-attention": "0.8.4-main.fffef41",
|
|
51
|
+
"@dxos/react-ui-list": "0.8.4-main.fffef41",
|
|
52
|
+
"@dxos/react-ui-menu": "0.8.4-main.fffef41",
|
|
53
|
+
"@dxos/react-ui-searchlist": "0.8.4-main.fffef41",
|
|
54
|
+
"@dxos/react-ui-stack": "0.8.4-main.fffef41",
|
|
55
|
+
"@dxos/util": "0.8.4-main.fffef41",
|
|
56
|
+
"@dxos/react-ui-tabs": "0.8.4-main.fffef41"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@effect-
|
|
60
|
-
"@effect/platform": "0.
|
|
61
|
-
"@
|
|
62
|
-
"@types/react": "~
|
|
63
|
-
"
|
|
64
|
-
"react": "~
|
|
65
|
-
"react-dom": "~
|
|
66
|
-
"vite": "
|
|
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.
|
|
59
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
60
|
+
"@effect/platform": "0.92.1",
|
|
61
|
+
"@types/react": "~19.2.2",
|
|
62
|
+
"@types/react-dom": "~19.2.2",
|
|
63
|
+
"effect": "3.18.3",
|
|
64
|
+
"react": "~19.2.0",
|
|
65
|
+
"react-dom": "~19.2.0",
|
|
66
|
+
"vite": "7.1.9",
|
|
67
|
+
"@dxos/echo-signals": "0.8.4-main.fffef41",
|
|
68
|
+
"@dxos/plugin-attention": "0.8.4-main.fffef41",
|
|
69
|
+
"@dxos/plugin-client": "0.8.4-main.fffef41",
|
|
70
|
+
"@dxos/plugin-space": "0.8.4-main.fffef41",
|
|
71
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.fffef41",
|
|
72
|
+
"@dxos/plugin-theme": "0.8.4-main.fffef41",
|
|
73
|
+
"@dxos/random": "0.8.4-main.fffef41",
|
|
74
|
+
"@dxos/react-ui-theme": "0.8.4-main.fffef41",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.fffef41",
|
|
76
|
+
"@dxos/storybook-utils": "0.8.4-main.fffef41"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@effect-
|
|
79
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
80
80
|
"@effect/platform": "^0.80.12",
|
|
81
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
82
81
|
"effect": "^3.13.3",
|
|
83
|
-
"react": "
|
|
84
|
-
"react-dom": "
|
|
85
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
86
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
82
|
+
"react": "^19.0.0",
|
|
83
|
+
"react-dom": "^19.0.0",
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.fffef41",
|
|
85
|
+
"@dxos/react-ui-theme": "0.8.4-main.fffef41"
|
|
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
|
|
|
@@ -20,76 +20,75 @@ import { NavTreeEvents } from './events';
|
|
|
20
20
|
import { meta } from './meta';
|
|
21
21
|
import { translations } from './translations';
|
|
22
22
|
|
|
23
|
-
export const NavTreePlugin = () =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
},
|
|
23
|
+
export const NavTreePlugin = definePlugin(meta, () => [
|
|
24
|
+
defineModule({
|
|
25
|
+
id: `${meta.id}/module/state`,
|
|
26
|
+
activatesOn: Events.LayoutReady,
|
|
27
|
+
activatesAfter: [NavTreeEvents.StateReady],
|
|
28
|
+
activate: State,
|
|
29
|
+
}),
|
|
30
|
+
defineModule({
|
|
31
|
+
id: `${meta.id}/module/translations`,
|
|
32
|
+
activatesOn: Events.SetupTranslations,
|
|
33
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
34
|
+
}),
|
|
35
|
+
defineModule({
|
|
36
|
+
id: `${meta.id}/module/metadata`,
|
|
37
|
+
activatesOn: Events.SetupMetadata,
|
|
38
|
+
activate: () =>
|
|
39
|
+
contributes(Capabilities.Metadata, {
|
|
40
|
+
id: NODE_TYPE,
|
|
41
|
+
metadata: {
|
|
42
|
+
parse: ({ item }: TreeData, type: string) => {
|
|
43
|
+
switch (type) {
|
|
44
|
+
case 'node':
|
|
45
|
+
return item;
|
|
46
|
+
case 'object':
|
|
47
|
+
return item.data;
|
|
48
|
+
case 'view-object':
|
|
49
|
+
return { id: `${item.id}-view`, object: item.data };
|
|
50
|
+
}
|
|
53
51
|
},
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
defineModule({
|
|
56
|
+
id: `${meta.id}/module/expose`,
|
|
57
|
+
activatesOn: allOf(Events.DispatcherReady, Events.AppGraphReady, Events.LayoutReady, NavTreeEvents.StateReady),
|
|
58
|
+
activate: async (context) => {
|
|
59
|
+
const layout = context.getCapability(Capabilities.Layout);
|
|
60
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
61
|
+
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
62
|
+
if (dispatch && layout.active.length === 1) {
|
|
63
|
+
// TODO(wittjosiah): This should really be fired once the navtree renders for the first time.
|
|
64
|
+
// That is the point at which the graph is expanded and the path should be available.
|
|
65
|
+
void graph
|
|
66
|
+
.waitForPath({ target: layout.active[0] }, { timeout: 30_000 })
|
|
67
|
+
.then(() => dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: layout.active[0] })))
|
|
68
|
+
.catch(() => {});
|
|
69
|
+
}
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
return [];
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
defineModule({
|
|
75
|
+
id: `${meta.id}/module/keyboard`,
|
|
76
|
+
activatesOn: Events.AppGraphReady,
|
|
77
|
+
activate: Keyboard,
|
|
78
|
+
}),
|
|
79
|
+
defineModule({
|
|
80
|
+
id: `${meta.id}/module/react-surface`,
|
|
81
|
+
activatesOn: Events.SetupReactSurface,
|
|
82
|
+
activate: ReactSurface,
|
|
83
|
+
}),
|
|
84
|
+
defineModule({
|
|
85
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
86
|
+
activatesOn: Events.SetupIntentResolver,
|
|
87
|
+
activate: IntentResolver,
|
|
88
|
+
}),
|
|
89
|
+
defineModule({
|
|
90
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
91
|
+
activatesOn: Events.SetupAppGraph,
|
|
92
|
+
activate: AppGraphBuilder,
|
|
93
|
+
}),
|
|
94
|
+
]);
|
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
9
|
+
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
+
import { ROOT_ID, createExtension } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
|
-
import { COMMANDS_DIALOG,
|
|
12
|
+
import { COMMANDS_DIALOG, meta } from '../meta';
|
|
12
13
|
|
|
13
14
|
export default (context: PluginContext) =>
|
|
14
15
|
contributes(
|
|
15
16
|
Capabilities.AppGraphBuilder,
|
|
16
17
|
createExtension({
|
|
17
|
-
id:
|
|
18
|
+
id: meta.id,
|
|
18
19
|
actions: (node) =>
|
|
19
|
-
|
|
20
|
-
pipe(
|
|
20
|
+
Atom.make((get) =>
|
|
21
|
+
Function.pipe(
|
|
21
22
|
get(node),
|
|
22
23
|
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
23
24
|
Option.map(() => [
|
|
@@ -36,7 +37,7 @@ export default (context: PluginContext) =>
|
|
|
36
37
|
);
|
|
37
38
|
},
|
|
38
39
|
properties: {
|
|
39
|
-
label: ['open commands label', { ns:
|
|
40
|
+
label: ['open commands label', { ns: meta.id }],
|
|
40
41
|
icon: 'ph--magnifying-glass--regular',
|
|
41
42
|
keyBinding: {
|
|
42
43
|
macos: 'meta+k',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
6
|
import { type Live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { meta } from '../meta';
|
|
9
9
|
import { type NavTreeItemGraphNode } from '../types';
|
|
10
10
|
|
|
11
11
|
export namespace NavTreeCapabilities {
|
|
@@ -16,5 +16,5 @@ export namespace NavTreeCapabilities {
|
|
|
16
16
|
isOpen: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
17
17
|
isCurrent: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
18
18
|
isAlternateTree: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
19
|
-
}>(`${
|
|
19
|
+
}>(`${meta.id}/capability/state`);
|
|
20
20
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
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,8 +7,8 @@ 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,
|
|
11
|
-
import { COMMANDS_DIALOG,
|
|
10
|
+
import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '../components';
|
|
11
|
+
import { COMMANDS_DIALOG, meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export default () =>
|
|
14
14
|
contributes(Capabilities.ReactSurface, [
|
|
@@ -19,7 +19,7 @@ export default () =>
|
|
|
19
19
|
component: ({ data }) => <CommandsDialogContent {...data.props} />,
|
|
20
20
|
}),
|
|
21
21
|
createSurface({
|
|
22
|
-
id: `${
|
|
22
|
+
id: `${meta.id}/navigation`,
|
|
23
23
|
role: 'navigation',
|
|
24
24
|
filter: (data): data is { popoverAnchorId?: string; topbar: boolean; current: string } =>
|
|
25
25
|
typeof data.current === 'string',
|
|
@@ -32,12 +32,12 @@ export default () =>
|
|
|
32
32
|
),
|
|
33
33
|
}),
|
|
34
34
|
createSurface({
|
|
35
|
-
id: `${
|
|
35
|
+
id: `${meta.id}/document-title`,
|
|
36
36
|
role: 'document-title',
|
|
37
37
|
component: ({ data }) => <NavTreeDocumentTitle node={isGraphNode(data.subject) ? data.subject : undefined} />,
|
|
38
38
|
}),
|
|
39
39
|
createSurface({
|
|
40
|
-
id: `${
|
|
40
|
+
id: `${meta.id}/search-input`,
|
|
41
41
|
role: 'search-input',
|
|
42
42
|
position: 'fallback',
|
|
43
43
|
component: () => <CommandsTrigger />,
|
|
@@ -4,15 +4,16 @@
|
|
|
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 { meta } from '../meta';
|
|
13
|
+
|
|
12
14
|
import { NavTreeCapabilities } from './capabilities';
|
|
13
|
-
import { NAVTREE_PLUGIN } from '../meta';
|
|
14
15
|
|
|
15
|
-
const KEY = `${
|
|
16
|
+
const KEY = `${meta.id}/state/v1`;
|
|
16
17
|
|
|
17
18
|
const getInitialState = () => {
|
|
18
19
|
const stringified = localStorage.getItem(KEY);
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useAppGraph, useIntentDispatcher } from '@dxos/app-framework/react';
|
|
8
9
|
import { type ActionLike, isAction, isActionGroup } from '@dxos/app-graph';
|
|
9
10
|
import { Keyboard, keySymbols } from '@dxos/keyboard';
|
|
10
11
|
import { useActions } from '@dxos/plugin-graph';
|
|
11
|
-
import { Button, Dialog, Icon,
|
|
12
|
+
import { Button, Dialog, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
12
13
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
14
|
import {
|
|
14
15
|
cardDialogContent,
|
|
@@ -19,11 +20,11 @@ import {
|
|
|
19
20
|
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
20
21
|
import { getHostPlatform } from '@dxos/util';
|
|
21
22
|
|
|
22
|
-
import { KEY_BINDING,
|
|
23
|
+
import { KEY_BINDING, meta } from '../../meta';
|
|
23
24
|
|
|
24
25
|
// TODO(wittjosiah): This probably deserves its own plugin but for now it lives here w/ other navigation UI.
|
|
25
26
|
export const CommandsDialogContent = ({ selected: initial }: { selected?: string }) => {
|
|
26
|
-
const { t } = useTranslation(
|
|
27
|
+
const { t } = useTranslation(meta.id);
|
|
27
28
|
const [selected, setSelected] = useState<string | undefined>(initial);
|
|
28
29
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
29
30
|
const { graph } = useAppGraph();
|
|
@@ -63,7 +64,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
63
64
|
|
|
64
65
|
return (
|
|
65
66
|
<Dialog.Content classNames={cardDialogContent}>
|
|
66
|
-
<Dialog.Title classNames={cardDialogHeader}>{t('commands dialog title', { ns:
|
|
67
|
+
<Dialog.Title classNames={cardDialogHeader}>{t('commands dialog title', { ns: meta.id })}</Dialog.Title>
|
|
67
68
|
|
|
68
69
|
{/* TODO(burdon): BUG: Overscrolls container. */}
|
|
69
70
|
<SearchList.Root label={t('command list input placeholder')} classNames={cardDialogSearchListRoot}>
|
|
@@ -89,7 +90,12 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
void dispatch(
|
|
93
|
+
void dispatch(
|
|
94
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
95
|
+
part: 'dialog',
|
|
96
|
+
options: { state: false },
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
93
99
|
setTimeout(() => {
|
|
94
100
|
const node = graph.getConnections(group?.id ?? action.id, 'inbound')[0];
|
|
95
101
|
void (node && isAction(action) && action.data({ parent: node, caller: KEY_BINDING }));
|
|
@@ -97,7 +103,9 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
97
103
|
}}
|
|
98
104
|
classNames='flex items-center gap-2'
|
|
99
105
|
disabled={action.properties.disabled}
|
|
100
|
-
{...(action.properties?.testId && {
|
|
106
|
+
{...(action.properties?.testId && {
|
|
107
|
+
'data-testid': action.properties.testId,
|
|
108
|
+
})}
|
|
101
109
|
>
|
|
102
110
|
<Icon icon={action.properties.icon} size={4} />
|
|
103
111
|
<span className='grow truncate'>{label}</span>
|
|
@@ -2,19 +2,18 @@
|
|
|
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 {
|
|
10
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
|
+
import { Button, Icon, useTranslation } from '@dxos/react-ui';
|
|
11
10
|
|
|
12
|
-
import { COMMANDS_DIALOG,
|
|
11
|
+
import { COMMANDS_DIALOG, meta } from '../../meta';
|
|
13
12
|
|
|
14
13
|
// TODO(thure): Refactor to be handled by a more appropriate plugin.
|
|
15
14
|
export const CommandsTrigger = () => {
|
|
16
15
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
17
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
18
17
|
return (
|
|
19
18
|
<Button
|
|
20
19
|
classNames='m-1 pli-1 lg:pli-2'
|
|
@@ -31,7 +30,7 @@ export const CommandsTrigger = () => {
|
|
|
31
30
|
}
|
|
32
31
|
>
|
|
33
32
|
<span className='text-description font-normal grow text-start'>{t('command list input placeholder')}</span>
|
|
34
|
-
<
|
|
33
|
+
<Icon icon='ph--magnifying-glass--regular' size={5} />
|
|
35
34
|
</Button>
|
|
36
35
|
);
|
|
37
36
|
};
|