@dxos/plugin-navtree 0.8.4-main.b97322e → 0.8.4-main.bc674ce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/lib/browser/app-graph-builder-RSMA6I22.mjs +43 -0
  2. package/dist/lib/browser/app-graph-builder-RSMA6I22.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-6YPQ625I.mjs +1293 -0
  4. package/dist/lib/browser/chunk-6YPQ625I.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-AGQDZBPL.mjs +23 -0
  6. package/dist/lib/browser/chunk-AGQDZBPL.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-YKTYPINZ.mjs +19 -0
  8. package/dist/lib/browser/chunk-YKTYPINZ.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +84 -96
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-32EH3N4K.mjs} +20 -19
  12. package/dist/lib/browser/keyboard-32EH3N4K.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/operation-resolver-IB75DC5O.mjs +52 -0
  15. package/dist/lib/browser/operation-resolver-IB75DC5O.mjs.map +7 -0
  16. package/dist/lib/browser/react-surface-F6CVMS3Y.mjs +58 -0
  17. package/dist/lib/browser/react-surface-F6CVMS3Y.mjs.map +7 -0
  18. package/dist/lib/browser/state-EVYQOUI3.mjs +120 -0
  19. package/dist/lib/browser/state-EVYQOUI3.mjs.map +7 -0
  20. package/dist/types/src/NavTreePlugin.d.ts +2 -1
  21. package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  23. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  25. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +5 -105
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/keyboard/index.d.ts +3 -0
  29. package/dist/types/src/capabilities/keyboard/index.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/keyboard/keyboard.d.ts +5 -0
  31. package/dist/types/src/capabilities/keyboard/keyboard.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  33. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  35. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  37. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  39. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/state/index.d.ts +3 -0
  41. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/state/state.d.ts +6 -0
  43. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  44. package/dist/types/src/components/CommandsDialog/CommandsDialog.d.ts +3 -2
  45. package/dist/types/src/components/CommandsDialog/CommandsDialog.d.ts.map +1 -1
  46. package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
  47. package/dist/types/src/components/NavTree/NavTree.d.ts +32 -3
  48. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  49. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +29 -4
  50. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/NavTreeContainer.d.ts +8 -1
  52. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  53. package/dist/types/src/components/NavTreeDocumentTitle.d.ts +1 -1
  54. package/dist/types/src/components/NavTreeDocumentTitle.d.ts.map +1 -1
  55. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +6 -6
  56. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
  57. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +33 -4
  58. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +2 -2
  60. package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
  61. package/dist/types/src/components/Sidebar/L0Menu.d.ts +6 -4
  62. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  63. package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
  64. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  65. package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
  66. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
  67. package/dist/types/src/components/Sidebar/index.d.ts +1 -0
  68. package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
  69. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
  70. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -5
  71. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  72. package/dist/types/src/components/index.d.ts.map +1 -1
  73. package/dist/types/src/components/types.d.ts +8 -8
  74. package/dist/types/src/components/types.d.ts.map +1 -1
  75. package/dist/types/src/experimental/Tree.d.ts +1 -2
  76. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  77. package/dist/types/src/experimental/Tree.stories.d.ts +7 -4
  78. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  79. package/dist/types/src/hooks.d.ts +32 -1
  80. package/dist/types/src/hooks.d.ts.map +1 -1
  81. package/dist/types/src/index.d.ts +1 -2
  82. package/dist/types/src/index.d.ts.map +1 -1
  83. package/dist/types/src/meta.d.ts +3 -4
  84. package/dist/types/src/meta.d.ts.map +1 -1
  85. package/dist/types/src/testing/app-graph-builder.d.ts +2 -3
  86. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  87. package/dist/types/src/testing/generator.d.ts +5 -6
  88. package/dist/types/src/testing/generator.d.ts.map +1 -1
  89. package/dist/types/src/testing/update-state.d.ts +2 -2
  90. package/dist/types/src/testing/update-state.d.ts.map +1 -1
  91. package/dist/types/src/translations.d.ts +1 -0
  92. package/dist/types/src/translations.d.ts.map +1 -1
  93. package/dist/types/src/types/capabilities.d.ts +16 -0
  94. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  95. package/dist/types/src/types/events.d.ts +5 -0
  96. package/dist/types/src/types/events.d.ts.map +1 -0
  97. package/dist/types/src/types/index.d.ts +4 -0
  98. package/dist/types/src/types/index.d.ts.map +1 -0
  99. package/dist/types/src/{types.d.ts → types/schema.d.ts} +10 -9
  100. package/dist/types/src/types/schema.d.ts.map +1 -0
  101. package/dist/types/src/util.d.ts +8 -9
  102. package/dist/types/src/util.d.ts.map +1 -1
  103. package/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +55 -53
  105. package/src/NavTreePlugin.tsx +65 -83
  106. package/src/capabilities/app-graph-builder/app-graph-builder.ts +41 -0
  107. package/src/capabilities/app-graph-builder/index.ts +7 -0
  108. package/src/capabilities/index.ts +5 -9
  109. package/src/capabilities/keyboard/index.ts +7 -0
  110. package/src/capabilities/keyboard/keyboard.ts +65 -0
  111. package/src/capabilities/operation-resolver/index.ts +7 -0
  112. package/src/capabilities/operation-resolver/operation-resolver.ts +41 -0
  113. package/src/capabilities/react-surface/index.ts +7 -0
  114. package/src/capabilities/react-surface/react-surface.tsx +54 -0
  115. package/src/capabilities/state/index.ts +7 -0
  116. package/src/capabilities/state/state.ts +121 -0
  117. package/src/components/CommandsDialog/CommandsDialog.tsx +109 -98
  118. package/src/components/CommandsDialog/CommandsTrigger.tsx +6 -15
  119. package/src/components/NavTree/NavTree.stories.tsx +98 -93
  120. package/src/components/NavTree/NavTree.tsx +12 -18
  121. package/src/components/NavTreeContainer.tsx +280 -256
  122. package/src/components/NavTreeDocumentTitle.tsx +5 -4
  123. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +20 -12
  124. package/src/components/NavTreeItem/NavTreeItemAction.tsx +25 -18
  125. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +38 -32
  126. package/src/components/Sidebar/L0Menu.tsx +114 -139
  127. package/src/components/Sidebar/L1Panel.tsx +76 -99
  128. package/src/components/Sidebar/L1Tabs.tsx +33 -0
  129. package/src/components/Sidebar/index.ts +1 -0
  130. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
  131. package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
  132. package/src/components/index.ts +1 -0
  133. package/src/components/types.ts +9 -8
  134. package/src/experimental/Tree.stories.tsx +28 -30
  135. package/src/experimental/Tree.tsx +7 -24
  136. package/src/hooks.ts +54 -2
  137. package/src/index.ts +1 -2
  138. package/src/meta.ts +11 -8
  139. package/src/testing/app-graph-builder.ts +159 -234
  140. package/src/testing/generator.ts +20 -18
  141. package/src/testing/update-state.ts +6 -6
  142. package/src/translations.ts +1 -0
  143. package/src/types/capabilities.ts +21 -0
  144. package/src/types/events.ts +11 -0
  145. package/src/types/index.ts +7 -0
  146. package/src/{types.ts → types/schema.ts} +9 -8
  147. package/src/util.ts +14 -35
  148. package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs +0 -45
  149. package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
  151. package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
  152. package/dist/lib/browser/chunk-SICQTLXC.mjs +0 -1442
  153. package/dist/lib/browser/chunk-SICQTLXC.mjs.map +0 -7
  154. package/dist/lib/browser/chunk-WCARAZ7J.mjs +0 -15
  155. package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
  156. package/dist/lib/browser/intent-resolver-3XYN2CBU.mjs +0 -47
  157. package/dist/lib/browser/intent-resolver-3XYN2CBU.mjs.map +0 -7
  158. package/dist/lib/browser/keyboard-QRS6WOQH.mjs.map +0 -7
  159. package/dist/lib/browser/react-surface-WURHCBQQ.mjs +0 -51
  160. package/dist/lib/browser/react-surface-WURHCBQQ.mjs.map +0 -7
  161. package/dist/lib/browser/state-54DY3DOY.mjs +0 -117
  162. package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
  163. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  164. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  165. package/dist/types/src/capabilities/capabilities.d.ts +0 -21
  166. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  167. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  168. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  169. package/dist/types/src/capabilities/keyboard.d.ts +0 -4
  170. package/dist/types/src/capabilities/keyboard.d.ts.map +0 -1
  171. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  172. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  173. package/dist/types/src/capabilities/state.d.ts +0 -20
  174. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  175. package/dist/types/src/events.d.ts +0 -4
  176. package/dist/types/src/events.d.ts.map +0 -1
  177. package/dist/types/src/types.d.ts.map +0 -1
  178. package/src/capabilities/app-graph-builder.ts +0 -52
  179. package/src/capabilities/capabilities.ts +0 -20
  180. package/src/capabilities/intent-resolver.ts +0 -37
  181. package/src/capabilities/keyboard.ts +0 -59
  182. package/src/capabilities/react-surface.tsx +0 -45
  183. package/src/capabilities/state.ts +0 -104
  184. package/src/events.ts +0 -11
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "@dxos/plugin-navtree",
3
- "version": "0.8.4-main.b97322e",
3
+ "version": "0.8.4-main.bc674ce",
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",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
14
  "type": "module",
11
15
  "exports": {
12
16
  ".": {
17
+ "source": "./src/index.ts",
13
18
  "types": "./dist/types/src/index.d.ts",
14
19
  "browser": "./dist/lib/browser/index.mjs"
15
20
  }
@@ -23,65 +28,62 @@
23
28
  "src"
24
29
  ],
25
30
  "dependencies": {
26
- "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
27
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
28
- "@preact-signals/safe-react": "^0.9.0",
29
- "@preact/signals-core": "^1.9.0",
31
+ "@atlaskit/pragmatic-drag-and-drop": "1.7.7",
32
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
30
33
  "@radix-ui/react-dismissable-layer": "1.1.5",
31
34
  "@radix-ui/react-use-controllable-state": "1.1.0",
32
35
  "date-fns": "^3.3.1",
33
- "effect": "3.17.0",
34
- "@dxos/app-framework": "0.8.4-main.b97322e",
35
- "@dxos/app-graph": "0.8.4-main.b97322e",
36
- "@dxos/debug": "0.8.4-main.b97322e",
37
- "@dxos/async": "0.8.4-main.b97322e",
38
- "@dxos/echo": "0.8.4-main.b97322e",
39
- "@dxos/invariant": "0.8.4-main.b97322e",
40
- "@dxos/echo-schema": "0.8.4-main.b97322e",
41
- "@dxos/live-object": "0.8.4-main.b97322e",
42
- "@dxos/local-storage": "0.8.4-main.b97322e",
43
- "@dxos/log": "0.8.4-main.b97322e",
44
- "@dxos/keyboard": "0.8.4-main.b97322e",
45
- "@dxos/plugin-graph": "0.8.4-main.b97322e",
46
- "@dxos/plugin-observability": "0.8.4-main.b97322e",
47
- "@dxos/protocols": "0.8.4-main.b97322e",
48
- "@dxos/plugin-deck": "0.8.4-main.b97322e",
49
- "@dxos/react-client": "0.8.4-main.b97322e",
50
- "@dxos/react-ui-attention": "0.8.4-main.b97322e",
51
- "@dxos/react-ui-menu": "0.8.4-main.b97322e",
52
- "@dxos/react-ui-stack": "0.8.4-main.b97322e",
53
- "@dxos/react-ui-searchlist": "0.8.4-main.b97322e",
54
- "@dxos/react-ui-list": "0.8.4-main.b97322e",
55
- "@dxos/util": "0.8.4-main.b97322e",
56
- "@dxos/react-ui-tabs": "0.8.4-main.b97322e"
36
+ "@dxos/app-framework": "0.8.4-main.bc674ce",
37
+ "@dxos/async": "0.8.4-main.bc674ce",
38
+ "@dxos/app-graph": "0.8.4-main.bc674ce",
39
+ "@dxos/debug": "0.8.4-main.bc674ce",
40
+ "@dxos/echo": "0.8.4-main.bc674ce",
41
+ "@dxos/invariant": "0.8.4-main.bc674ce",
42
+ "@dxos/keyboard": "0.8.4-main.bc674ce",
43
+ "@dxos/lit-ui": "0.8.4-main.bc674ce",
44
+ "@dxos/log": "0.8.4-main.bc674ce",
45
+ "@dxos/operation": "0.8.4-main.bc674ce",
46
+ "@dxos/plugin-deck": "0.8.4-main.bc674ce",
47
+ "@dxos/plugin-graph": "0.8.4-main.bc674ce",
48
+ "@dxos/plugin-observability": "0.8.4-main.bc674ce",
49
+ "@dxos/protocols": "0.8.4-main.bc674ce",
50
+ "@dxos/react-client": "0.8.4-main.bc674ce",
51
+ "@dxos/react-ui-attention": "0.8.4-main.bc674ce",
52
+ "@dxos/react-ui-menu": "0.8.4-main.bc674ce",
53
+ "@dxos/react-ui-list": "0.8.4-main.bc674ce",
54
+ "@dxos/react-ui-mosaic": "0.8.4-main.bc674ce",
55
+ "@dxos/react-ui-stack": "0.8.4-main.bc674ce",
56
+ "@dxos/react-ui-tabs": "0.8.4-main.bc674ce",
57
+ "@dxos/react-ui-searchlist": "0.8.4-main.bc674ce",
58
+ "@dxos/util": "0.8.4-main.bc674ce"
57
59
  },
58
60
  "devDependencies": {
59
- "@effect-rx/rx-react": "0.38.0",
60
- "@effect/platform": "0.89.0",
61
- "@types/react": "~18.2.0",
62
- "@types/react-dom": "~18.2.0",
63
- "react": "~18.2.0",
64
- "react-dom": "~18.2.0",
65
- "vite": "5.4.7",
66
- "@dxos/echo-signals": "0.8.4-main.b97322e",
67
- "@dxos/plugin-attention": "0.8.4-main.b97322e",
68
- "@dxos/plugin-client": "0.8.4-main.b97322e",
69
- "@dxos/plugin-space": "0.8.4-main.b97322e",
70
- "@dxos/plugin-storybook-layout": "0.8.4-main.b97322e",
71
- "@dxos/plugin-theme": "0.8.4-main.b97322e",
72
- "@dxos/random": "0.8.4-main.b97322e",
73
- "@dxos/react-ui": "0.8.4-main.b97322e",
74
- "@dxos/storybook-utils": "0.8.4-main.b97322e",
75
- "@dxos/react-ui-theme": "0.8.4-main.b97322e"
61
+ "@effect-atom/atom-react": "^0.4.6",
62
+ "@effect/platform": "0.93.6",
63
+ "@types/react": "~19.2.7",
64
+ "@types/react-dom": "~19.2.3",
65
+ "effect": "3.19.11",
66
+ "react": "~19.2.3",
67
+ "react-dom": "~19.2.3",
68
+ "vite": "7.1.9",
69
+ "@dxos/plugin-client": "0.8.4-main.bc674ce",
70
+ "@dxos/plugin-attention": "0.8.4-main.bc674ce",
71
+ "@dxos/plugin-space": "0.8.4-main.bc674ce",
72
+ "@dxos/random": "0.8.4-main.bc674ce",
73
+ "@dxos/plugin-theme": "0.8.4-main.bc674ce",
74
+ "@dxos/react-ui": "0.8.4-main.bc674ce",
75
+ "@dxos/storybook-utils": "0.8.4-main.bc674ce",
76
+ "@dxos/plugin-testing": "0.8.4-main.bc674ce",
77
+ "@dxos/ui-theme": "0.8.4-main.bc674ce"
76
78
  },
77
79
  "peerDependencies": {
78
- "@effect-rx/rx-react": "^0.34.1",
79
- "@effect/platform": "^0.80.12",
80
- "effect": "^3.13.3",
81
- "react": "~18.2.0",
82
- "react-dom": "~18.2.0",
83
- "@dxos/react-ui": "0.8.4-main.b97322e",
84
- "@dxos/react-ui-theme": "0.8.4-main.b97322e"
80
+ "@effect-atom/atom-react": "^0.4.6",
81
+ "@effect/platform": "0.93.6",
82
+ "effect": "3.19.11",
83
+ "react": "~19.2.3",
84
+ "react-dom": "~19.2.3",
85
+ "@dxos/react-ui": "0.8.4-main.bc674ce",
86
+ "@dxos/ui-theme": "0.8.4-main.bc674ce"
85
87
  },
86
88
  "publishConfig": {
87
89
  "access": "public"
@@ -2,94 +2,76 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import {
6
- definePlugin,
7
- defineModule,
8
- Events,
9
- contributes,
10
- Capabilities,
11
- allOf,
12
- createIntent,
13
- LayoutAction,
14
- } from '@dxos/app-framework';
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { ActivationEvent, Capability, Common, Plugin } from '@dxos/app-framework';
8
+ import { Graph } from '@dxos/plugin-graph';
15
9
  import { type TreeData } from '@dxos/react-ui-list';
16
10
 
17
- import { AppGraphBuilder, IntentResolver, Keyboard, ReactSurface, State } from './capabilities';
11
+ import { AppGraphBuilder, Keyboard, OperationResolver, ReactSurface, State } from './capabilities';
18
12
  import { NODE_TYPE } from './components';
19
- import { NavTreeEvents } from './events';
20
13
  import { meta } from './meta';
21
14
  import { translations } from './translations';
15
+ import { NavTreeEvents } from './types';
22
16
 
23
- export const NavTreePlugin = () =>
24
- definePlugin(meta, [
25
- defineModule({
26
- id: `${meta.id}/module/state`,
27
- activatesOn: Events.LayoutReady,
28
- activatesAfter: [NavTreeEvents.StateReady],
29
- activate: State,
30
- }),
31
- defineModule({
32
- id: `${meta.id}/module/translations`,
33
- activatesOn: Events.SetupTranslations,
34
- activate: () => contributes(Capabilities.Translations, translations),
35
- }),
36
- defineModule({
37
- id: `${meta.id}/module/metadata`,
38
- activatesOn: Events.SetupMetadata,
39
- activate: () =>
40
- contributes(Capabilities.Metadata, {
41
- id: NODE_TYPE,
42
- metadata: {
43
- parse: ({ item }: TreeData, type: string) => {
44
- switch (type) {
45
- case 'node':
46
- return item;
47
- case 'object':
48
- return item.data;
49
- case 'view-object':
50
- return { id: `${item.id}-view`, object: item.data };
51
- }
52
- },
53
- },
54
- }),
55
- }),
56
- defineModule({
57
- id: `${meta.id}/module/expose`,
58
- activatesOn: allOf(Events.DispatcherReady, Events.AppGraphReady, Events.LayoutReady, NavTreeEvents.StateReady),
59
- activate: async (context) => {
60
- const layout = context.getCapability(Capabilities.Layout);
61
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
62
- const { graph } = context.getCapability(Capabilities.AppGraph);
63
- if (dispatch && layout.active.length === 1) {
64
- // TODO(wittjosiah): This should really be fired once the navtree renders for the first time.
65
- // That is the point at which the graph is expanded and the path should be available.
66
- void graph
67
- .waitForPath({ target: layout.active[0] }, { timeout: 30_000 })
68
- .then(() => dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: layout.active[0] })))
69
- .catch(() => {});
70
- }
71
-
72
- return [];
17
+ export const NavTreePlugin = Plugin.define(meta).pipe(
18
+ Plugin.addModule({
19
+ id: 'state',
20
+ activatesOn: Common.ActivationEvent.LayoutReady,
21
+ activatesAfter: [NavTreeEvents.StateReady],
22
+ activate: State,
23
+ }),
24
+ Common.Plugin.addTranslationsModule({ translations }),
25
+ Common.Plugin.addMetadataModule({
26
+ metadata: {
27
+ id: NODE_TYPE,
28
+ metadata: {
29
+ parse: ({ item }: TreeData, type: string) => {
30
+ switch (type) {
31
+ case 'node':
32
+ return item;
33
+ case 'object':
34
+ return item.data;
35
+ case 'view-object':
36
+ return { id: `${item.id}-view`, object: item.data };
37
+ }
38
+ },
73
39
  },
40
+ },
41
+ }),
42
+ Plugin.addModule({
43
+ id: 'expose',
44
+ activatesOn: ActivationEvent.allOf(
45
+ Common.ActivationEvent.OperationInvokerReady,
46
+ Common.ActivationEvent.AppGraphReady,
47
+ Common.ActivationEvent.LayoutReady,
48
+ NavTreeEvents.StateReady,
49
+ ),
50
+ activate: Effect.fnUntraced(function* () {
51
+ const layout = yield* Common.Capability.getAtomValue(Common.Capability.Layout);
52
+ const { invokePromise } = yield* Capability.get(Common.Capability.OperationInvoker);
53
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
54
+ if (invokePromise && layout.active.length === 1) {
55
+ // TODO(wittjosiah): This should really be fired once the navtree renders for the first time.
56
+ // That is the point at which the graph is expanded and the path should be available.
57
+ void Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 30_000 })
58
+ .then(() => invokePromise(Common.LayoutOperation.Expose, { subject: layout.active[0] }))
59
+ .catch(() => {});
60
+ }
61
+
62
+ return [];
74
63
  }),
75
- defineModule({
76
- id: `${meta.id}/module/keyboard`,
77
- activatesOn: Events.AppGraphReady,
78
- activate: Keyboard,
79
- }),
80
- defineModule({
81
- id: `${meta.id}/module/react-surface`,
82
- activatesOn: Events.SetupReactSurface,
83
- activate: ReactSurface,
84
- }),
85
- defineModule({
86
- id: `${meta.id}/module/intent-resolver`,
87
- activatesOn: Events.SetupIntentResolver,
88
- activate: IntentResolver,
89
- }),
90
- defineModule({
91
- id: `${meta.id}/module/app-graph-builder`,
92
- activatesOn: Events.SetupAppGraph,
93
- activate: AppGraphBuilder,
94
- }),
95
- ]);
64
+ }),
65
+ Plugin.addModule({
66
+ id: 'keyboard',
67
+ activatesOn: ActivationEvent.allOf(
68
+ Common.ActivationEvent.AppGraphReady,
69
+ Common.ActivationEvent.OperationInvokerReady,
70
+ ),
71
+ activate: Keyboard,
72
+ }),
73
+ Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
74
+ Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
75
+ Common.Plugin.addAppGraphModule({ activate: AppGraphBuilder }),
76
+ Plugin.make,
77
+ );
@@ -0,0 +1,41 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability, Common } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/operation';
9
+ import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
10
+
11
+ import { COMMANDS_DIALOG, meta } from '../../meta';
12
+
13
+ export default Capability.makeModule(
14
+ Effect.fnUntraced(function* () {
15
+ const extensions = yield* GraphBuilder.createExtension({
16
+ id: meta.id,
17
+ match: NodeMatcher.whenRoot,
18
+ actions: () =>
19
+ Effect.succeed([
20
+ {
21
+ id: COMMANDS_DIALOG,
22
+ data: () =>
23
+ Operation.invoke(Common.LayoutOperation.UpdateDialog, {
24
+ subject: COMMANDS_DIALOG,
25
+ blockAlign: 'start',
26
+ }),
27
+ properties: {
28
+ label: ['open commands label', { ns: meta.id }],
29
+ icon: 'ph--magnifying-glass--regular',
30
+ keyBinding: {
31
+ macos: 'meta+k',
32
+ windows: 'ctrl+k',
33
+ },
34
+ },
35
+ },
36
+ ]),
37
+ });
38
+
39
+ return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
40
+ }),
41
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
@@ -2,12 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
- export const IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const Keyboard = lazy(() => import('./keyboard'));
10
- export const ReactSurface = lazy(() => import('./react-surface'));
11
- export const State = lazy(() => import('./state'));
12
-
13
- export * from './capabilities';
5
+ export * from './app-graph-builder';
6
+ export * from './keyboard';
7
+ export * from './operation-resolver';
8
+ export * from './react-surface';
9
+ export * from './state';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));
@@ -0,0 +1,65 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability, Common } from '@dxos/app-framework';
8
+ import { debounce } from '@dxos/async';
9
+ import { Keyboard } from '@dxos/keyboard';
10
+ import { Graph, Node, runAction } from '@dxos/plugin-graph';
11
+ import { getHostPlatform } from '@dxos/util';
12
+
13
+ import { KEY_BINDING } from '../../meta';
14
+
15
+ export default Capability.makeModule(
16
+ Effect.fnUntraced(function* () {
17
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
18
+ const invoker = yield* Capability.get(Common.Capability.OperationInvoker);
19
+ const pluginContext = yield* Capability.Service;
20
+
21
+ // TODO(wittjosiah): Factor out.
22
+ // TODO(wittjosiah): Handle removal of actions.
23
+ const visitor = (node: Node.Node, path: string[]) => {
24
+ let shortcut: string | undefined;
25
+ if (typeof node.properties.keyBinding === 'object') {
26
+ const availablePlatforms = Object.keys(node.properties.keyBinding);
27
+ const platform = getHostPlatform();
28
+ shortcut = availablePlatforms.includes(platform)
29
+ ? node.properties.keyBinding[platform]
30
+ : platform === 'ios'
31
+ ? node.properties.keyBinding.macos // Fallback to macos if ios-specific bindings not provided.
32
+ : platform === 'linux' || platform === 'unknown'
33
+ ? node.properties.keyBinding.windows // Fallback to windows if platform-specific bindings not provided.
34
+ : undefined;
35
+ } else {
36
+ shortcut = node.properties.keyBinding;
37
+ }
38
+
39
+ if (shortcut && Node.isAction(node)) {
40
+ Keyboard.singleton.getContext(path.slice(0, -1).join('/')).bind({
41
+ shortcut,
42
+ handler: () => void runAction(invoker, pluginContext, node, { parent: node, caller: KEY_BINDING }),
43
+ data: node.properties.label,
44
+ });
45
+ }
46
+ };
47
+
48
+ const eventHandler = debounce(() => {
49
+ Graph.traverse(graph, { visitor });
50
+ }, 500);
51
+
52
+ const unsubscribe = graph.onNodeChanged.on(eventHandler);
53
+
54
+ // TODO(burdon): Create context and plugin.
55
+ Keyboard.singleton.initialize();
56
+ Keyboard.singleton.setCurrentContext(Node.RootId);
57
+
58
+ return Capability.contributes(Common.Capability.Null, null, () =>
59
+ Effect.sync(() => {
60
+ unsubscribe();
61
+ Keyboard.singleton.destroy();
62
+ }),
63
+ );
64
+ }),
65
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const OperationResolver = Capability.lazy('OperationResolver', () => import('./operation-resolver'));
@@ -0,0 +1,41 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability, Common } from '@dxos/app-framework';
8
+ import { log } from '@dxos/log';
9
+ import { OperationResolver } from '@dxos/operation';
10
+ import { Graph } from '@dxos/plugin-graph';
11
+
12
+ import { NavTreeCapabilities } from '../../types';
13
+
14
+ export default Capability.makeModule(
15
+ Effect.fnUntraced(function* () {
16
+ return Capability.contributes(Common.Capability.OperationResolver, [
17
+ OperationResolver.make({
18
+ operation: Common.LayoutOperation.Expose,
19
+ handler: Effect.fnUntraced(function* ({ subject }) {
20
+ const { graph } = yield* Capability.get(Common.Capability.AppGraph);
21
+ const { getItem, setItem } = yield* Capability.get(NavTreeCapabilities.State);
22
+ yield* Effect.tryPromise(() => Graph.waitForPath(graph, { target: subject }, { timeout: 1_000 })).pipe(
23
+ Effect.andThen((path) => {
24
+ [...Array(path.length)].forEach((_, index) => {
25
+ const subpath = path.slice(0, index);
26
+ const value = getItem(subpath);
27
+ if (!value.open) {
28
+ setItem(subpath, 'open', true);
29
+ }
30
+ });
31
+ }),
32
+ Effect.catchAll(() => {
33
+ log('Path to node not found', { subject });
34
+ return Effect.void;
35
+ }),
36
+ );
37
+ }),
38
+ }),
39
+ ]);
40
+ }),
41
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,54 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capability, Common } from '@dxos/app-framework';
9
+ import { Node } from '@dxos/plugin-graph';
10
+
11
+ import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '../../components';
12
+ import { COMMANDS_DIALOG, meta } from '../../meta';
13
+
14
+ export default Capability.makeModule(() =>
15
+ Effect.succeed(
16
+ Capability.contributes(Common.Capability.ReactSurface, [
17
+ Common.createSurface({
18
+ id: COMMANDS_DIALOG,
19
+ role: 'dialog',
20
+ filter: (data): data is { props: { selected?: string } } => data.component === COMMANDS_DIALOG,
21
+ component: ({ data, ref }) => <CommandsDialogContent {...data.props} ref={ref} />,
22
+ }),
23
+ Common.createSurface({
24
+ id: `${meta.id}/navigation`,
25
+ role: 'navigation',
26
+ filter: (data): data is { popoverAnchorId?: string; topbar: boolean; current: string } =>
27
+ typeof data.current === 'string',
28
+ component: ({ data, ref }) => {
29
+ return (
30
+ <NavTreeContainer
31
+ tab={data.current}
32
+ popoverAnchorId={data.popoverAnchorId as string | undefined}
33
+ topbar={data.topbar as boolean}
34
+ ref={ref}
35
+ />
36
+ );
37
+ },
38
+ }),
39
+ Common.createSurface({
40
+ id: `${meta.id}/document-title`,
41
+ role: 'document-title',
42
+ component: ({ data }) => (
43
+ <NavTreeDocumentTitle node={Node.isGraphNode(data.subject) ? data.subject : undefined} />
44
+ ),
45
+ }),
46
+ Common.createSurface({
47
+ id: `${meta.id}/search-input`,
48
+ role: 'search-input',
49
+ position: 'fallback',
50
+ component: () => <CommandsTrigger />,
51
+ }),
52
+ ]),
53
+ ),
54
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const State = Capability.lazy('State', () => import('./state'));