@dxos/plugin-navtree 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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/index.mjs +137 -72
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +7 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +5 -0
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +6 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/NavTree/NavTree.d.ts +10 -32
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +10 -14
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/{NavTreeContext.d.ts → NavTreeContext/NavTreeContext.d.ts} +1 -1
- package/dist/types/src/components/NavTreeContext/NavTreeContext.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeContext/index.d.ts +2 -0
- package/dist/types/src/components/NavTreeContext/index.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +11 -3
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts +4 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Panel.d.ts +3 -6
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts +3 -2
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +5 -13
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/{components/CommandsDialog/CommandsDialog.d.ts → containers/CommandsDialogContent/CommandsDialogContent.d.ts} +1 -1
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.d.ts.map +1 -0
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts +29 -0
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/CommandsDialogContent/index.d.ts +3 -0
- package/dist/types/src/containers/CommandsDialogContent/index.d.ts.map +1 -0
- package/dist/types/src/containers/CommandsTrigger/CommandsTrigger.d.ts.map +1 -0
- package/dist/types/src/containers/CommandsTrigger/index.d.ts +3 -0
- package/dist/types/src/containers/CommandsTrigger/index.d.ts.map +1 -0
- package/dist/types/src/containers/NavTreeContainer/NavTreeContainer.d.ts +9 -0
- package/dist/types/src/containers/NavTreeContainer/NavTreeContainer.d.ts.map +1 -0
- package/dist/types/src/containers/NavTreeContainer/index.d.ts +3 -0
- package/dist/types/src/containers/NavTreeContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.d.ts.map +1 -0
- package/dist/types/src/containers/NavTreeDocumentTitle/index.d.ts +3 -0
- package/dist/types/src/containers/NavTreeDocumentTitle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/experimental/Tree.stories.d.ts +18 -4
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useActions.d.ts +5 -0
- package/dist/types/src/hooks/useActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useLoadDescendents.d.ts +6 -0
- package/dist/types/src/hooks/useLoadDescendents.d.ts.map +1 -0
- package/dist/types/src/hooks/useNavTreeModel.d.ts +7 -0
- package/dist/types/src/hooks/useNavTreeModel.d.ts.map +1 -0
- package/dist/types/src/{hooks.d.ts → hooks/useNavTreeState.d.ts} +2 -14
- package/dist/types/src/hooks/useNavTreeState.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/expose.d.ts +5 -0
- package/dist/types/src/operations/expose.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +3 -3
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -43
- package/src/NavTreePlugin.tsx +26 -27
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +6 -5
- package/src/capabilities/index.ts +11 -5
- package/src/capabilities/{keyboard/keyboard.ts → keyboard.ts} +7 -6
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +13 -14
- package/src/capabilities/{state/state.ts → state.ts} +43 -15
- package/src/components/NavTree/NavTree.stories.tsx +26 -24
- package/src/components/NavTree/NavTree.tsx +63 -22
- package/src/components/{NavTreeContext.tsx → NavTreeContext/NavTreeContext.tsx} +1 -1
- package/src/components/NavTreeContext/index.ts +5 -0
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +1 -3
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +56 -39
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +42 -16
- package/src/components/Sidebar/L0Menu.tsx +99 -109
- package/src/components/Sidebar/L1Panel.tsx +252 -94
- package/src/components/Sidebar/L1Tabs.tsx +13 -3
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +2 -3
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +1 -1
- package/src/components/index.ts +0 -3
- package/src/components/types.ts +12 -17
- package/src/containers/CommandsDialogContent/CommandsDialogContent.stories.tsx +46 -0
- package/src/{components/CommandsDialog/CommandsDialog.tsx → containers/CommandsDialogContent/CommandsDialogContent.tsx} +23 -21
- package/src/containers/CommandsDialogContent/index.ts +7 -0
- package/src/containers/CommandsTrigger/CommandsTrigger.tsx +28 -0
- package/src/containers/CommandsTrigger/index.ts +7 -0
- package/src/{components → containers/NavTreeContainer}/NavTreeContainer.tsx +76 -142
- package/src/containers/NavTreeContainer/index.ts +6 -0
- package/src/{components → containers/NavTreeDocumentTitle}/NavTreeDocumentTitle.tsx +2 -2
- package/src/containers/NavTreeDocumentTitle/index.ts +7 -0
- package/src/containers/index.ts +12 -0
- package/src/experimental/Tree.stories.tsx +54 -57
- package/src/experimental/Tree.tsx +3 -3
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useActions.ts +34 -0
- package/src/hooks/useLoadDescendents.ts +23 -0
- package/src/hooks/useNavTreeModel.ts +118 -0
- package/src/{hooks.ts → hooks/useNavTreeState.ts} +3 -34
- package/src/meta.ts +2 -2
- package/src/operations/expose.ts +42 -0
- package/src/operations/index.ts +7 -0
- package/src/testing/app-graph-builder.ts +34 -30
- package/src/testing/generator.ts +4 -4
- package/src/translations.ts +9 -10
- package/src/types/capabilities.ts +2 -2
- package/src/types/events.ts +4 -3
- package/src/util.ts +19 -5
- package/dist/lib/browser/app-graph-builder-RSMA6I22.mjs +0 -43
- package/dist/lib/browser/app-graph-builder-RSMA6I22.mjs.map +0 -7
- package/dist/lib/browser/chunk-6YPQ625I.mjs +0 -1293
- package/dist/lib/browser/chunk-6YPQ625I.mjs.map +0 -7
- package/dist/lib/browser/chunk-AGQDZBPL.mjs +0 -23
- package/dist/lib/browser/chunk-AGQDZBPL.mjs.map +0 -7
- package/dist/lib/browser/chunk-YKTYPINZ.mjs +0 -19
- package/dist/lib/browser/chunk-YKTYPINZ.mjs.map +0 -7
- package/dist/lib/browser/keyboard-32EH3N4K.mjs +0 -52
- package/dist/lib/browser/keyboard-32EH3N4K.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-IB75DC5O.mjs +0 -52
- package/dist/lib/browser/operation-resolver-IB75DC5O.mjs.map +0 -7
- package/dist/lib/browser/react-surface-F6CVMS3Y.mjs +0 -58
- package/dist/lib/browser/react-surface-F6CVMS3Y.mjs.map +0 -7
- package/dist/lib/browser/state-EVYQOUI3.mjs +0 -120
- package/dist/lib/browser/state-EVYQOUI3.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard/index.d.ts +0 -3
- package/dist/types/src/capabilities/keyboard/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts +0 -5
- package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -3
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts +0 -6
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/components/CommandsDialog/CommandsDialog.d.ts.map +0 -1
- package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +0 -1
- package/dist/types/src/components/CommandsDialog/index.d.ts +0 -3
- package/dist/types/src/components/CommandsDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeContainer.d.ts +0 -16
- package/dist/types/src/components/NavTreeContainer.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeContext.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeDocumentTitle.d.ts.map +0 -1
- package/dist/types/src/hooks.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/keyboard/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -41
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/components/CommandsDialog/CommandsTrigger.tsx +0 -26
- package/src/components/CommandsDialog/index.ts +0 -6
- /package/dist/types/src/{components/CommandsDialog → containers/CommandsTrigger}/CommandsTrigger.d.ts +0 -0
- /package/dist/types/src/{components → containers/NavTreeDocumentTitle}/NavTreeDocumentTitle.d.ts +0 -0
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.bcb3aa67d6",
|
|
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",
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#hooks": "./src/hooks/index.ts",
|
|
20
|
+
"#meta": "./src/meta.ts",
|
|
21
|
+
"#operations": "./src/operations/index.ts",
|
|
22
|
+
"#testing": "./src/testing/index.ts",
|
|
23
|
+
"#types": "./src/types/index.ts"
|
|
24
|
+
},
|
|
15
25
|
"exports": {
|
|
16
26
|
".": {
|
|
17
27
|
"source": "./src/index.ts",
|
|
@@ -32,58 +42,59 @@
|
|
|
32
42
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
|
|
33
43
|
"@radix-ui/react-dismissable-layer": "1.1.5",
|
|
34
44
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
35
|
-
"date-fns": "^3.
|
|
36
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
37
|
-
"@dxos/async": "0.8.4-main.
|
|
38
|
-
"@dxos/app-
|
|
39
|
-
"@dxos/debug": "0.8.4-main.
|
|
40
|
-
"@dxos/echo": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/operation": "0.8.4-main.
|
|
46
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
47
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
48
|
-
"@dxos/plugin-observability": "0.8.4-main.
|
|
49
|
-
"@dxos/protocols": "0.8.4-main.
|
|
50
|
-
"@dxos/react-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/react-ui-
|
|
55
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
56
|
-
"@dxos/react-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
45
|
+
"date-fns": "^3.6.0",
|
|
46
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
47
|
+
"@dxos/async": "0.8.4-main.bcb3aa67d6",
|
|
48
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
49
|
+
"@dxos/debug": "0.8.4-main.bcb3aa67d6",
|
|
50
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
51
|
+
"@dxos/app-graph": "0.8.4-main.bcb3aa67d6",
|
|
52
|
+
"@dxos/invariant": "0.8.4-main.bcb3aa67d6",
|
|
53
|
+
"@dxos/keyboard": "0.8.4-main.bcb3aa67d6",
|
|
54
|
+
"@dxos/lit-ui": "0.8.4-main.bcb3aa67d6",
|
|
55
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
56
|
+
"@dxos/plugin-deck": "0.8.4-main.bcb3aa67d6",
|
|
57
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
58
|
+
"@dxos/plugin-observability": "0.8.4-main.bcb3aa67d6",
|
|
59
|
+
"@dxos/protocols": "0.8.4-main.bcb3aa67d6",
|
|
60
|
+
"@dxos/react-ui-list": "0.8.4-main.bcb3aa67d6",
|
|
61
|
+
"@dxos/log": "0.8.4-main.bcb3aa67d6",
|
|
62
|
+
"@dxos/react-ui-attention": "0.8.4-main.bcb3aa67d6",
|
|
63
|
+
"@dxos/react-ui-menu": "0.8.4-main.bcb3aa67d6",
|
|
64
|
+
"@dxos/react-ui-search": "0.8.4-main.bcb3aa67d6",
|
|
65
|
+
"@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
|
|
66
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
67
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6",
|
|
68
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
|
|
69
|
+
"@dxos/react-ui-tabs": "0.8.4-main.bcb3aa67d6"
|
|
59
70
|
},
|
|
60
71
|
"devDependencies": {
|
|
61
|
-
"@effect-atom/atom-react": "^0.
|
|
62
|
-
"@effect/platform": "0.
|
|
72
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
73
|
+
"@effect/platform": "0.94.4",
|
|
63
74
|
"@types/react": "~19.2.7",
|
|
64
75
|
"@types/react-dom": "~19.2.3",
|
|
65
|
-
"effect": "3.
|
|
76
|
+
"effect": "3.20.0",
|
|
66
77
|
"react": "~19.2.3",
|
|
67
78
|
"react-dom": "~19.2.3",
|
|
68
|
-
"vite": "7.1.
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
79
|
+
"vite": "^7.1.11",
|
|
80
|
+
"@dxos/plugin-attention": "0.8.4-main.bcb3aa67d6",
|
|
81
|
+
"@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
|
|
82
|
+
"@dxos/plugin-testing": "0.8.4-main.bcb3aa67d6",
|
|
83
|
+
"@dxos/plugin-theme": "0.8.4-main.bcb3aa67d6",
|
|
84
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
85
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
86
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6",
|
|
87
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
88
|
+
"@dxos/plugin-space": "0.8.4-main.bcb3aa67d6"
|
|
78
89
|
},
|
|
79
90
|
"peerDependencies": {
|
|
80
|
-
"@effect-atom/atom-react": "^0.
|
|
81
|
-
"@effect/platform": "0.
|
|
82
|
-
"effect": "3.
|
|
91
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
92
|
+
"@effect/platform": "0.94.4",
|
|
93
|
+
"effect": "3.20.0",
|
|
83
94
|
"react": "~19.2.3",
|
|
84
95
|
"react-dom": "~19.2.3",
|
|
85
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
86
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
96
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
97
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
87
98
|
},
|
|
88
99
|
"publishConfig": {
|
|
89
100
|
"access": "public"
|
package/src/NavTreePlugin.tsx
CHANGED
|
@@ -4,25 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { ActivationEvent,
|
|
7
|
+
import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from '@dxos/app-toolkit';
|
|
8
9
|
import { Graph } from '@dxos/plugin-graph';
|
|
9
10
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { meta } from './meta';
|
|
12
|
+
import { NODE_TYPE } from '#containers';
|
|
13
|
+
import { meta } from '#meta';
|
|
14
14
|
import { translations } from './translations';
|
|
15
|
-
import { NavTreeEvents } from '
|
|
15
|
+
import { NavTreeEvents } from '#types';
|
|
16
|
+
|
|
17
|
+
import { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from '#capabilities';
|
|
16
18
|
|
|
17
19
|
export const NavTreePlugin = Plugin.define(meta).pipe(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
activatesOn: Common.ActivationEvent.LayoutReady,
|
|
21
|
-
activatesAfter: [NavTreeEvents.StateReady],
|
|
22
|
-
activate: State,
|
|
23
|
-
}),
|
|
24
|
-
Common.Plugin.addTranslationsModule({ translations }),
|
|
25
|
-
Common.Plugin.addMetadataModule({
|
|
20
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
21
|
+
AppPlugin.addMetadataModule({
|
|
26
22
|
metadata: {
|
|
27
23
|
id: NODE_TYPE,
|
|
28
24
|
metadata: {
|
|
@@ -39,23 +35,32 @@ export const NavTreePlugin = Plugin.define(meta).pipe(
|
|
|
39
35
|
},
|
|
40
36
|
},
|
|
41
37
|
}),
|
|
38
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
39
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
40
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
41
|
+
Plugin.addModule({
|
|
42
|
+
id: 'state',
|
|
43
|
+
activatesOn: AppActivationEvents.LayoutReady,
|
|
44
|
+
activatesAfter: [NavTreeEvents.StateReady],
|
|
45
|
+
activate: State,
|
|
46
|
+
}),
|
|
42
47
|
Plugin.addModule({
|
|
43
48
|
id: 'expose',
|
|
44
49
|
activatesOn: ActivationEvent.allOf(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
ActivationEvents.OperationInvokerReady,
|
|
51
|
+
AppActivationEvents.AppGraphReady,
|
|
52
|
+
AppActivationEvents.LayoutReady,
|
|
48
53
|
NavTreeEvents.StateReady,
|
|
49
54
|
),
|
|
50
55
|
activate: Effect.fnUntraced(function* () {
|
|
51
|
-
const layout = yield*
|
|
52
|
-
const { invokePromise } = yield* Capability.get(
|
|
53
|
-
const { graph } = yield* Capability.get(
|
|
56
|
+
const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
|
|
57
|
+
const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
58
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
54
59
|
if (invokePromise && layout.active.length === 1) {
|
|
55
60
|
// TODO(wittjosiah): This should really be fired once the navtree renders for the first time.
|
|
56
61
|
// That is the point at which the graph is expanded and the path should be available.
|
|
57
62
|
void Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 30_000 })
|
|
58
|
-
.then(() => invokePromise(
|
|
63
|
+
.then(() => invokePromise(LayoutOperation.Expose, { subject: layout.active[0] }))
|
|
59
64
|
.catch(() => {});
|
|
60
65
|
}
|
|
61
66
|
|
|
@@ -64,14 +69,8 @@ export const NavTreePlugin = Plugin.define(meta).pipe(
|
|
|
64
69
|
}),
|
|
65
70
|
Plugin.addModule({
|
|
66
71
|
id: 'keyboard',
|
|
67
|
-
activatesOn: ActivationEvent.allOf(
|
|
68
|
-
Common.ActivationEvent.AppGraphReady,
|
|
69
|
-
Common.ActivationEvent.OperationInvokerReady,
|
|
70
|
-
),
|
|
72
|
+
activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, ActivationEvents.OperationInvokerReady),
|
|
71
73
|
activate: Keyboard,
|
|
72
74
|
}),
|
|
73
|
-
Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
|
|
74
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
75
|
-
Common.Plugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
76
75
|
Plugin.make,
|
|
77
76
|
);
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
8
9
|
import { Operation } from '@dxos/operation';
|
|
9
10
|
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
|
-
import { COMMANDS_DIALOG, meta } from '
|
|
12
|
+
import { COMMANDS_DIALOG, meta } from '#meta';
|
|
12
13
|
|
|
13
14
|
export default Capability.makeModule(
|
|
14
15
|
Effect.fnUntraced(function* () {
|
|
@@ -20,12 +21,12 @@ export default Capability.makeModule(
|
|
|
20
21
|
{
|
|
21
22
|
id: COMMANDS_DIALOG,
|
|
22
23
|
data: () =>
|
|
23
|
-
Operation.invoke(
|
|
24
|
+
Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
24
25
|
subject: COMMANDS_DIALOG,
|
|
25
26
|
blockAlign: 'start',
|
|
26
27
|
}),
|
|
27
28
|
properties: {
|
|
28
|
-
label: ['open
|
|
29
|
+
label: ['open-commands.label', { ns: meta.id }],
|
|
29
30
|
icon: 'ph--magnifying-glass--regular',
|
|
30
31
|
keyBinding: {
|
|
31
32
|
macos: 'meta+k',
|
|
@@ -36,6 +37,6 @@ export default Capability.makeModule(
|
|
|
36
37
|
]),
|
|
37
38
|
});
|
|
38
39
|
|
|
39
|
-
return Capability.contributes(
|
|
40
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
40
41
|
}),
|
|
41
42
|
);
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));
|
|
10
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
'OperationHandler',
|
|
12
|
+
() => import('./operation-handler'),
|
|
13
|
+
);
|
|
14
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
15
|
+
export const State = Capability.lazy('State', () => import('./state'));
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { debounce } from '@dxos/async';
|
|
9
10
|
import { Keyboard } from '@dxos/keyboard';
|
|
10
11
|
import { Graph, Node, runAction } from '@dxos/plugin-graph';
|
|
11
12
|
import { getHostPlatform } from '@dxos/util';
|
|
12
13
|
|
|
13
|
-
import { KEY_BINDING } from '
|
|
14
|
+
import { KEY_BINDING } from '#meta';
|
|
14
15
|
|
|
15
16
|
export default Capability.makeModule(
|
|
16
17
|
Effect.fnUntraced(function* () {
|
|
17
|
-
const { graph } = yield* Capability.get(
|
|
18
|
-
const invoker = yield* Capability.get(
|
|
18
|
+
const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
|
|
19
|
+
const invoker = yield* Capability.get(Capabilities.OperationInvoker);
|
|
19
20
|
const pluginContext = yield* Capability.Service;
|
|
20
21
|
|
|
21
22
|
// TODO(wittjosiah): Factor out.
|
|
@@ -46,7 +47,7 @@ export default Capability.makeModule(
|
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
const eventHandler = debounce(() => {
|
|
49
|
-
Graph.traverse(graph, { visitor });
|
|
50
|
+
Graph.traverse(graph, { relation: ['child', 'action'], visitor });
|
|
50
51
|
}, 500);
|
|
51
52
|
|
|
52
53
|
const unsubscribe = graph.onNodeChanged.on(eventHandler);
|
|
@@ -55,7 +56,7 @@ export default Capability.makeModule(
|
|
|
55
56
|
Keyboard.singleton.initialize();
|
|
56
57
|
Keyboard.singleton.setCurrentContext(Node.RootId);
|
|
57
58
|
|
|
58
|
-
return Capability.contributes(
|
|
59
|
+
return Capability.contributes(Capabilities.Null, null, () =>
|
|
59
60
|
Effect.sync(() => {
|
|
60
61
|
unsubscribe();
|
|
61
62
|
Keyboard.singleton.destroy();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { NavTreeOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, NavTreeOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -5,46 +5,45 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
import { Node } from '@dxos/plugin-graph';
|
|
10
11
|
|
|
11
|
-
import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '
|
|
12
|
-
import { COMMANDS_DIALOG, meta } from '
|
|
12
|
+
import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '#containers';
|
|
13
|
+
import { COMMANDS_DIALOG, meta } from '#meta';
|
|
13
14
|
|
|
14
15
|
export default Capability.makeModule(() =>
|
|
15
16
|
Effect.succeed(
|
|
16
|
-
Capability.contributes(
|
|
17
|
-
|
|
17
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
|
+
Surface.create({
|
|
18
19
|
id: COMMANDS_DIALOG,
|
|
19
20
|
role: 'dialog',
|
|
20
21
|
filter: (data): data is { props: { selected?: string } } => data.component === COMMANDS_DIALOG,
|
|
21
22
|
component: ({ data, ref }) => <CommandsDialogContent {...data.props} ref={ref} />,
|
|
22
23
|
}),
|
|
23
|
-
|
|
24
|
-
id: `${meta.id}
|
|
24
|
+
Surface.create({
|
|
25
|
+
id: `${meta.id}.navigation`,
|
|
25
26
|
role: 'navigation',
|
|
26
|
-
filter: (data): data is { popoverAnchorId?: string;
|
|
27
|
-
typeof data.current === 'string',
|
|
27
|
+
filter: (data): data is { popoverAnchorId?: string; current: string } => typeof data.current === 'string',
|
|
28
28
|
component: ({ data, ref }) => {
|
|
29
29
|
return (
|
|
30
30
|
<NavTreeContainer
|
|
31
31
|
tab={data.current}
|
|
32
32
|
popoverAnchorId={data.popoverAnchorId as string | undefined}
|
|
33
|
-
topbar={data.topbar as boolean}
|
|
34
33
|
ref={ref}
|
|
35
34
|
/>
|
|
36
35
|
);
|
|
37
36
|
},
|
|
38
37
|
}),
|
|
39
|
-
|
|
40
|
-
id: `${meta.id}
|
|
38
|
+
Surface.create({
|
|
39
|
+
id: `${meta.id}.document-title`,
|
|
41
40
|
role: 'document-title',
|
|
42
41
|
component: ({ data }) => (
|
|
43
42
|
<NavTreeDocumentTitle node={Node.isGraphNode(data.subject) ? data.subject : undefined} />
|
|
44
43
|
),
|
|
45
44
|
}),
|
|
46
|
-
|
|
47
|
-
id: `${meta.id}
|
|
45
|
+
Surface.create({
|
|
46
|
+
id: `${meta.id}.search-input`,
|
|
48
47
|
role: 'search-input',
|
|
49
48
|
position: 'fallback',
|
|
50
49
|
component: () => <CommandsTrigger />,
|
|
@@ -5,24 +5,25 @@
|
|
|
5
5
|
import { Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
10
|
+
import { Graph, Node } from '@dxos/plugin-graph';
|
|
9
11
|
import { Path } from '@dxos/react-ui-list';
|
|
10
12
|
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { type NavTreeCapabilities as NC, NavTreeCapabilities } from '
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { type NavTreeCapabilities as NC, NavTreeCapabilities } from '#types';
|
|
13
15
|
|
|
14
|
-
const KEY = `${meta.id}
|
|
16
|
+
const KEY = `${meta.id}.state.v1`;
|
|
15
17
|
|
|
16
18
|
/** Default item state for new entries. */
|
|
17
19
|
const defaultItemState: NC.NavTreeItemState = { open: false, current: false, alternateTree: false };
|
|
18
20
|
|
|
21
|
+
/** L0 (top-level workspace) paths are direct children of root — not part of the expandable tree model. */
|
|
22
|
+
const isTopLevelPath = (path: string[]): boolean => path.length === 2 && path[0] === Node.RootId;
|
|
23
|
+
|
|
19
24
|
/** Default state entries for initial tree structure. */
|
|
20
25
|
// TODO(thure): Initialize these dynamically.
|
|
21
|
-
const defaultStateEntries: [string, NC.NavTreeItemState][] = [
|
|
22
|
-
['root', { open: true, current: false }],
|
|
23
|
-
['root~dxos.org/plugin/space-spaces', { open: true, current: false }],
|
|
24
|
-
['root~dxos.org/plugin/files', { open: true, current: false }],
|
|
25
|
-
];
|
|
26
|
+
const defaultStateEntries: [string, NC.NavTreeItemState][] = [['root', { open: true, current: false }]];
|
|
26
27
|
|
|
27
28
|
const getInitialState = (): Map<string, NC.NavTreeItemState> => {
|
|
28
29
|
const stringified = localStorage.getItem(KEY);
|
|
@@ -40,8 +41,8 @@ const getInitialState = (): Map<string, NC.NavTreeItemState> => {
|
|
|
40
41
|
|
|
41
42
|
export default Capability.makeModule(
|
|
42
43
|
Effect.fnUntraced(function* () {
|
|
43
|
-
const registry = yield* Capability.get(
|
|
44
|
-
const layoutAtom = yield* Capability.get(
|
|
44
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
45
|
+
const layoutAtom = yield* Capability.get(AppCapabilities.Layout);
|
|
45
46
|
|
|
46
47
|
// Backing state for persistence (not reactive).
|
|
47
48
|
const backingState = getInitialState();
|
|
@@ -55,6 +56,9 @@ export default Capability.makeModule(
|
|
|
55
56
|
|
|
56
57
|
const getItemAtom = (path: string[]): Atom.Atom<NC.NavTreeItemState> => {
|
|
57
58
|
const pathString = Path.create(...path);
|
|
59
|
+
if (!backingState.has(pathString)) {
|
|
60
|
+
backingState.set(pathString, { ...defaultItemState });
|
|
61
|
+
}
|
|
58
62
|
return itemAtomFamily(pathString);
|
|
59
63
|
};
|
|
60
64
|
|
|
@@ -68,12 +72,12 @@ export default Capability.makeModule(
|
|
|
68
72
|
const currentValue = registry.get(atom);
|
|
69
73
|
const newValue = { ...currentValue, [key]: next };
|
|
70
74
|
|
|
71
|
-
// Update the atom.
|
|
72
75
|
registry.set(atom, newValue);
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
if (!(key === 'open' && isTopLevelPath(path))) {
|
|
78
|
+
backingState.set(pathString, newValue);
|
|
79
|
+
localStorage.setItem(KEY, JSON.stringify(Array.from(backingState.entries())));
|
|
80
|
+
}
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
// Subscribe to layout changes to update current state.
|
|
@@ -108,6 +112,30 @@ export default Capability.makeModule(
|
|
|
108
112
|
return () => clearTimeout(timeout);
|
|
109
113
|
});
|
|
110
114
|
|
|
115
|
+
// Once graph is ready, expand every node marked open in state so the graph has children loaded for rendering.
|
|
116
|
+
yield* Effect.gen(function* () {
|
|
117
|
+
const { graph } = yield* Capability.waitFor(AppCapabilities.AppGraph);
|
|
118
|
+
|
|
119
|
+
// Always expand the active workspace so its subtree is initialized.
|
|
120
|
+
const layout = registry.get(layoutAtom);
|
|
121
|
+
if (layout.workspace) {
|
|
122
|
+
Graph.expand(graph, layout.workspace, 'child');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Expand persisted open nodes, skipping inactive workspace tabs.
|
|
126
|
+
const openPaths = Array.from(backingState.entries())
|
|
127
|
+
.filter(([, state]) => state.open)
|
|
128
|
+
.map(([pathString]) => Path.parts(pathString))
|
|
129
|
+
.filter((path) => !isTopLevelPath(path));
|
|
130
|
+
for (const path of openPaths) {
|
|
131
|
+
const nodeId = path[path.length - 1];
|
|
132
|
+
if (!nodeId) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
Graph.expand(graph, nodeId, 'child');
|
|
136
|
+
}
|
|
137
|
+
}).pipe(Effect.forkDaemon);
|
|
138
|
+
|
|
111
139
|
return Capability.contributes(
|
|
112
140
|
NavTreeCapabilities.State,
|
|
113
141
|
{
|
|
@@ -8,22 +8,23 @@ import * as Effect from 'effect/Effect';
|
|
|
8
8
|
import React, { type KeyboardEvent, useCallback, useRef } from 'react';
|
|
9
9
|
import { expect, userEvent, within } from 'storybook/test';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { useAtomCapability } from '@dxos/app-framework/react';
|
|
11
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
13
12
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
14
|
-
import {
|
|
13
|
+
import { useAtomCapability } from '@dxos/app-framework/ui';
|
|
14
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
15
|
+
import { Operation, OperationHandlerSet } from '@dxos/operation';
|
|
15
16
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
16
17
|
import { faker } from '@dxos/random';
|
|
17
18
|
import { IconButton, Input, Main, Toolbar } from '@dxos/react-ui';
|
|
18
|
-
import {
|
|
19
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
19
20
|
import { useAttention, useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
20
21
|
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
21
22
|
import { mx } from '@dxos/ui-theme';
|
|
22
23
|
|
|
24
|
+
import { NavTreeContainer } from '#containers';
|
|
23
25
|
import { NavTreePlugin } from '../../NavTreePlugin';
|
|
24
|
-
import { storybookGraphBuilders } from '
|
|
26
|
+
import { storybookGraphBuilders } from '#testing';
|
|
25
27
|
import { translations } from '../../translations';
|
|
26
|
-
import { NavTreeContainer } from '../NavTreeContainer';
|
|
27
28
|
|
|
28
29
|
faker.seed(1234);
|
|
29
30
|
|
|
@@ -39,14 +40,14 @@ const StoryPlankHeading = ({ attendableId }: { attendableId: string }) => {
|
|
|
39
40
|
const { hasAttention } = useAttention(attendableId);
|
|
40
41
|
console.log('hasAttention', hasAttention);
|
|
41
42
|
return (
|
|
42
|
-
<div className='flex p-1 items-center border-
|
|
43
|
+
<div className='flex p-1 items-center border-b border-separator'>
|
|
43
44
|
<IconButton
|
|
44
45
|
density='coarse'
|
|
45
46
|
icon='ph--atom--regular'
|
|
46
47
|
label='Test'
|
|
47
48
|
iconOnly
|
|
48
49
|
variant={hasAttention ? 'primary' : 'ghost'}
|
|
49
|
-
classNames='
|
|
50
|
+
classNames='w-(--dx-rail-action) h-(--dx-rail-action)'
|
|
50
51
|
/>
|
|
51
52
|
<StackItem.ResizeHandle />
|
|
52
53
|
</div>
|
|
@@ -69,22 +70,22 @@ const StoryPlank = ({ attendableId }: { attendableId: string }) => {
|
|
|
69
70
|
<StackItem.Root
|
|
70
71
|
item={{ id: attendableId }}
|
|
71
72
|
{...attentionAttrs}
|
|
72
|
-
classNames='bg-
|
|
73
|
+
classNames='bg-base-surface border-e border-separator'
|
|
73
74
|
size={30}
|
|
74
75
|
onKeyDown={handleKeyDown}
|
|
75
76
|
ref={rootElement}
|
|
76
77
|
>
|
|
77
78
|
<StoryPlankHeading attendableId={attendableId} />
|
|
78
79
|
<StackItem.Content toolbar>
|
|
79
|
-
<Toolbar.Root classNames='border-
|
|
80
|
+
<Toolbar.Root classNames='border-b border-subdued-separator'>
|
|
80
81
|
<Toolbar.Button>Test</Toolbar.Button>
|
|
81
82
|
</Toolbar.Root>
|
|
82
83
|
|
|
83
|
-
<div className={mx(container, 'm-2 bg-
|
|
84
|
+
<div className={mx(container, 'm-2 bg-active-surface')}>
|
|
84
85
|
<Input.Root>
|
|
85
86
|
<Input.Label>Level 1 (group)</Input.Label>
|
|
86
87
|
</Input.Root>
|
|
87
|
-
<div className={mx(container, 'bg-
|
|
88
|
+
<div className={mx(container, 'bg-base-surface')}>
|
|
88
89
|
<Input.Root>
|
|
89
90
|
<Input.Label>Level 2 (base)</Input.Label>
|
|
90
91
|
<Input.TextArea placeholder='Enter text' />
|
|
@@ -115,11 +116,11 @@ const DefaultStory = () => {
|
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
const meta = {
|
|
118
|
-
title: 'plugins/plugin-navtree/NavTree',
|
|
119
|
+
title: 'plugins/plugin-navtree/components/NavTree',
|
|
119
120
|
component: NavTreeContainer,
|
|
120
121
|
render: DefaultStory,
|
|
121
122
|
decorators: [
|
|
122
|
-
|
|
123
|
+
withLayout({ layout: 'fullscreen' }),
|
|
123
124
|
withPluginManager({
|
|
124
125
|
plugins: [
|
|
125
126
|
...corePlugins(),
|
|
@@ -130,20 +131,21 @@ const meta = {
|
|
|
130
131
|
NavTreePlugin(),
|
|
131
132
|
],
|
|
132
133
|
capabilities: () => {
|
|
133
|
-
const storyStateAtom = Atom.make({ tab: 'space-0' }).pipe(Atom.keepAlive);
|
|
134
|
+
const storyStateAtom = Atom.make({ tab: 'root/space-0' }).pipe(Atom.keepAlive);
|
|
134
135
|
return [
|
|
135
136
|
Capability.contributes(StoryState, storyStateAtom),
|
|
136
|
-
Capability.contributes(
|
|
137
|
-
Capability.contributes(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
Capability.contributes(AppCapabilities.AppGraphBuilder, storybookGraphBuilders()),
|
|
138
|
+
Capability.contributes(
|
|
139
|
+
Capabilities.OperationHandler,
|
|
140
|
+
OperationHandlerSet.make(
|
|
141
|
+
Operation.withHandler(LayoutOperation.SwitchWorkspace, ({ subject }) =>
|
|
141
142
|
Effect.gen(function* () {
|
|
142
|
-
const registry: Registry.Registry = yield* Capability.get(
|
|
143
|
+
const registry: Registry.Registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
143
144
|
registry.set(storyStateAtom, { tab: subject });
|
|
144
145
|
}),
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
),
|
|
147
|
+
),
|
|
148
|
+
),
|
|
147
149
|
];
|
|
148
150
|
},
|
|
149
151
|
}),
|
|
@@ -159,7 +161,7 @@ export default meta;
|
|
|
159
161
|
type Story = StoryObj<typeof NavTreeContainer>;
|
|
160
162
|
|
|
161
163
|
export const Default: Story = {
|
|
162
|
-
play: async ({ canvasElement }) => {
|
|
164
|
+
play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {
|
|
163
165
|
const canvas = within(canvasElement);
|
|
164
166
|
|
|
165
167
|
// Find the element with treegrid role and click on its parent
|