@dxos/plugin-navtree 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51

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 (170) hide show
  1. package/dist/lib/browser/app-graph-builder-XGA4GPGL.mjs +44 -0
  2. package/dist/lib/browser/app-graph-builder-XGA4GPGL.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-63YLDLLE.mjs +1373 -0
  4. package/dist/lib/browser/chunk-63YLDLLE.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-X2HDG62A.mjs +23 -0
  6. package/dist/lib/browser/chunk-X2HDG62A.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 +83 -91
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/{keyboard-AHSAWKXA.mjs → keyboard-46XQHY2O.mjs} +21 -19
  12. package/dist/lib/browser/keyboard-46XQHY2O.mjs.map +7 -0
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/operation-resolver-NNNDII45.mjs +53 -0
  15. package/dist/lib/browser/operation-resolver-NNNDII45.mjs.map +7 -0
  16. package/dist/lib/browser/react-surface-APSEG23H.mjs +59 -0
  17. package/dist/lib/browser/react-surface-APSEG23H.mjs.map +7 -0
  18. package/dist/lib/browser/state-M5YUCIQU.mjs +121 -0
  19. package/dist/lib/browser/state-M5YUCIQU.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 -108
  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 +30 -1
  48. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  49. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +4 -1
  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 +2 -1
  58. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/Sidebar/L0Menu.d.ts +4 -4
  60. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  61. package/dist/types/src/components/Sidebar/L1Panel.d.ts +2 -2
  62. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  63. package/dist/types/src/components/Sidebar/L1Tabs.d.ts +2 -2
  64. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
  65. package/dist/types/src/components/index.d.ts.map +1 -1
  66. package/dist/types/src/components/types.d.ts +7 -7
  67. package/dist/types/src/components/types.d.ts.map +1 -1
  68. package/dist/types/src/experimental/Tree.stories.d.ts +15 -4
  69. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  70. package/dist/types/src/hooks.d.ts +32 -1
  71. package/dist/types/src/hooks.d.ts.map +1 -1
  72. package/dist/types/src/index.d.ts +1 -2
  73. package/dist/types/src/index.d.ts.map +1 -1
  74. package/dist/types/src/meta.d.ts +2 -2
  75. package/dist/types/src/meta.d.ts.map +1 -1
  76. package/dist/types/src/testing/app-graph-builder.d.ts +2 -3
  77. package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
  78. package/dist/types/src/testing/generator.d.ts +5 -6
  79. package/dist/types/src/testing/generator.d.ts.map +1 -1
  80. package/dist/types/src/testing/update-state.d.ts +2 -2
  81. package/dist/types/src/testing/update-state.d.ts.map +1 -1
  82. package/dist/types/src/types/capabilities.d.ts +16 -0
  83. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  84. package/dist/types/src/types/events.d.ts +5 -0
  85. package/dist/types/src/types/events.d.ts.map +1 -0
  86. package/dist/types/src/types/index.d.ts +4 -0
  87. package/dist/types/src/types/index.d.ts.map +1 -0
  88. package/dist/types/src/{types.d.ts → types/schema.d.ts} +7 -7
  89. package/dist/types/src/types/schema.d.ts.map +1 -0
  90. package/dist/types/src/util.d.ts +7 -7
  91. package/dist/types/src/util.d.ts.map +1 -1
  92. package/dist/types/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +54 -52
  94. package/src/NavTreePlugin.tsx +53 -72
  95. package/src/capabilities/app-graph-builder/app-graph-builder.ts +42 -0
  96. package/src/capabilities/app-graph-builder/index.ts +7 -0
  97. package/src/capabilities/index.ts +5 -9
  98. package/src/capabilities/keyboard/index.ts +7 -0
  99. package/src/capabilities/keyboard/keyboard.ts +66 -0
  100. package/src/capabilities/operation-resolver/index.ts +7 -0
  101. package/src/capabilities/operation-resolver/operation-resolver.ts +42 -0
  102. package/src/capabilities/react-surface/index.ts +7 -0
  103. package/src/capabilities/react-surface/react-surface.tsx +55 -0
  104. package/src/capabilities/state/index.ts +7 -0
  105. package/src/capabilities/state/state.ts +122 -0
  106. package/src/components/CommandsDialog/CommandsDialog.tsx +107 -97
  107. package/src/components/CommandsDialog/CommandsTrigger.tsx +4 -13
  108. package/src/components/NavTree/NavTree.stories.tsx +36 -44
  109. package/src/components/NavTree/NavTree.tsx +5 -15
  110. package/src/components/NavTreeContainer.tsx +255 -263
  111. package/src/components/NavTreeDocumentTitle.tsx +3 -2
  112. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +17 -7
  113. package/src/components/NavTreeItem/NavTreeItemAction.tsx +18 -12
  114. package/src/components/NavTreeItem/NavTreeItemColumns.tsx +5 -5
  115. package/src/components/Sidebar/L0Menu.tsx +69 -98
  116. package/src/components/Sidebar/L1Panel.tsx +151 -72
  117. package/src/components/Sidebar/L1Tabs.tsx +6 -31
  118. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +1 -1
  119. package/src/components/index.ts +1 -0
  120. package/src/components/types.ts +7 -7
  121. package/src/experimental/Tree.stories.tsx +45 -54
  122. package/src/experimental/Tree.tsx +3 -3
  123. package/src/hooks.ts +54 -2
  124. package/src/index.ts +1 -2
  125. package/src/meta.ts +7 -2
  126. package/src/testing/app-graph-builder.ts +159 -235
  127. package/src/testing/generator.ts +19 -17
  128. package/src/testing/update-state.ts +6 -6
  129. package/src/types/capabilities.ts +21 -0
  130. package/src/types/events.ts +12 -0
  131. package/src/types/index.ts +7 -0
  132. package/src/{types.ts → types/schema.ts} +6 -6
  133. package/src/util.ts +13 -16
  134. package/dist/lib/browser/app-graph-builder-YAPMENYT.mjs +0 -46
  135. package/dist/lib/browser/app-graph-builder-YAPMENYT.mjs.map +0 -7
  136. package/dist/lib/browser/chunk-IMFXKPSB.mjs +0 -1482
  137. package/dist/lib/browser/chunk-IMFXKPSB.mjs.map +0 -7
  138. package/dist/lib/browser/chunk-LPAREX6J.mjs +0 -15
  139. package/dist/lib/browser/chunk-LPAREX6J.mjs.map +0 -7
  140. package/dist/lib/browser/chunk-ZENLR72O.mjs +0 -14
  141. package/dist/lib/browser/chunk-ZENLR72O.mjs.map +0 -7
  142. package/dist/lib/browser/intent-resolver-TCQXGF6U.mjs +0 -47
  143. package/dist/lib/browser/intent-resolver-TCQXGF6U.mjs.map +0 -7
  144. package/dist/lib/browser/keyboard-AHSAWKXA.mjs.map +0 -7
  145. package/dist/lib/browser/react-surface-AH2TP73M.mjs +0 -51
  146. package/dist/lib/browser/react-surface-AH2TP73M.mjs.map +0 -7
  147. package/dist/lib/browser/state-2Q623V7U.mjs +0 -117
  148. package/dist/lib/browser/state-2Q623V7U.mjs.map +0 -7
  149. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  150. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  151. package/dist/types/src/capabilities/capabilities.d.ts +0 -21
  152. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  153. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  154. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  155. package/dist/types/src/capabilities/keyboard.d.ts +0 -4
  156. package/dist/types/src/capabilities/keyboard.d.ts.map +0 -1
  157. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  158. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  159. package/dist/types/src/capabilities/state.d.ts +0 -20
  160. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  161. package/dist/types/src/events.d.ts +0 -4
  162. package/dist/types/src/events.d.ts.map +0 -1
  163. package/dist/types/src/types.d.ts.map +0 -1
  164. package/src/capabilities/app-graph-builder.ts +0 -53
  165. package/src/capabilities/capabilities.ts +0 -20
  166. package/src/capabilities/intent-resolver.ts +0 -37
  167. package/src/capabilities/keyboard.ts +0 -59
  168. package/src/capabilities/react-surface.tsx +0 -45
  169. package/src/capabilities/state.ts +0 -105
  170. package/src/events.ts +0 -11
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/plugin-navtree",
3
- "version": "0.8.4-main.406dc2a",
3
+ "version": "0.8.4-main.52d7546f51",
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,
@@ -24,65 +28,63 @@
24
28
  "src"
25
29
  ],
26
30
  "dependencies": {
27
- "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
28
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
29
- "@preact-signals/safe-react": "^0.9.0",
30
- "@preact/signals-core": "^1.12.1",
31
+ "@atlaskit/pragmatic-drag-and-drop": "1.7.7",
32
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
31
33
  "@radix-ui/react-dismissable-layer": "1.1.5",
32
34
  "@radix-ui/react-use-controllable-state": "1.1.0",
33
35
  "date-fns": "^3.3.1",
34
- "@dxos/app-framework": "0.8.4-main.406dc2a",
35
- "@dxos/app-graph": "0.8.4-main.406dc2a",
36
- "@dxos/async": "0.8.4-main.406dc2a",
37
- "@dxos/debug": "0.8.4-main.406dc2a",
38
- "@dxos/invariant": "0.8.4-main.406dc2a",
39
- "@dxos/echo": "0.8.4-main.406dc2a",
40
- "@dxos/keyboard": "0.8.4-main.406dc2a",
41
- "@dxos/lit-ui": "0.8.4-main.406dc2a",
42
- "@dxos/live-object": "0.8.4-main.406dc2a",
43
- "@dxos/local-storage": "0.8.4-main.406dc2a",
44
- "@dxos/log": "0.8.4-main.406dc2a",
45
- "@dxos/plugin-deck": "0.8.4-main.406dc2a",
46
- "@dxos/plugin-graph": "0.8.4-main.406dc2a",
47
- "@dxos/plugin-observability": "0.8.4-main.406dc2a",
48
- "@dxos/protocols": "0.8.4-main.406dc2a",
49
- "@dxos/react-ui-attention": "0.8.4-main.406dc2a",
50
- "@dxos/react-client": "0.8.4-main.406dc2a",
51
- "@dxos/react-ui-list": "0.8.4-main.406dc2a",
52
- "@dxos/react-ui-menu": "0.8.4-main.406dc2a",
53
- "@dxos/react-ui-searchlist": "0.8.4-main.406dc2a",
54
- "@dxos/react-ui-tabs": "0.8.4-main.406dc2a",
55
- "@dxos/react-ui-stack": "0.8.4-main.406dc2a",
56
- "@dxos/util": "0.8.4-main.406dc2a"
36
+ "@dxos/app-framework": "0.8.4-main.52d7546f51",
37
+ "@dxos/app-graph": "0.8.4-main.52d7546f51",
38
+ "@dxos/app-toolkit": "0.8.4-main.52d7546f51",
39
+ "@dxos/async": "0.8.4-main.52d7546f51",
40
+ "@dxos/echo": "0.8.4-main.52d7546f51",
41
+ "@dxos/invariant": "0.8.4-main.52d7546f51",
42
+ "@dxos/keyboard": "0.8.4-main.52d7546f51",
43
+ "@dxos/debug": "0.8.4-main.52d7546f51",
44
+ "@dxos/lit-ui": "0.8.4-main.52d7546f51",
45
+ "@dxos/log": "0.8.4-main.52d7546f51",
46
+ "@dxos/plugin-deck": "0.8.4-main.52d7546f51",
47
+ "@dxos/operation": "0.8.4-main.52d7546f51",
48
+ "@dxos/plugin-graph": "0.8.4-main.52d7546f51",
49
+ "@dxos/protocols": "0.8.4-main.52d7546f51",
50
+ "@dxos/plugin-observability": "0.8.4-main.52d7546f51",
51
+ "@dxos/react-client": "0.8.4-main.52d7546f51",
52
+ "@dxos/react-ui-attention": "0.8.4-main.52d7546f51",
53
+ "@dxos/react-ui-list": "0.8.4-main.52d7546f51",
54
+ "@dxos/react-ui-menu": "0.8.4-main.52d7546f51",
55
+ "@dxos/react-ui-mosaic": "0.8.4-main.52d7546f51",
56
+ "@dxos/react-ui-searchlist": "0.8.4-main.52d7546f51",
57
+ "@dxos/react-ui-stack": "0.8.4-main.52d7546f51",
58
+ "@dxos/react-ui-tabs": "0.8.4-main.52d7546f51",
59
+ "@dxos/util": "0.8.4-main.52d7546f51"
57
60
  },
58
61
  "devDependencies": {
59
- "@effect-rx/rx-react": "0.42.4",
60
- "@effect/platform": "0.92.1",
61
- "@types/react": "~19.2.2",
62
- "@types/react-dom": "~19.2.1",
63
- "effect": "3.18.3",
64
- "react": "~19.2.0",
65
- "react-dom": "~19.2.0",
62
+ "@effect-atom/atom-react": "^0.5.0",
63
+ "@effect/platform": "0.94.4",
64
+ "@types/react": "~19.2.7",
65
+ "@types/react-dom": "~19.2.3",
66
+ "effect": "3.19.16",
67
+ "react": "~19.2.3",
68
+ "react-dom": "~19.2.3",
66
69
  "vite": "7.1.9",
67
- "@dxos/echo-signals": "0.8.4-main.406dc2a",
68
- "@dxos/plugin-attention": "0.8.4-main.406dc2a",
69
- "@dxos/plugin-client": "0.8.4-main.406dc2a",
70
- "@dxos/plugin-space": "0.8.4-main.406dc2a",
71
- "@dxos/plugin-storybook-layout": "0.8.4-main.406dc2a",
72
- "@dxos/random": "0.8.4-main.406dc2a",
73
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a",
74
- "@dxos/storybook-utils": "0.8.4-main.406dc2a",
75
- "@dxos/plugin-theme": "0.8.4-main.406dc2a",
76
- "@dxos/react-ui": "0.8.4-main.406dc2a"
70
+ "@dxos/plugin-client": "0.8.4-main.52d7546f51",
71
+ "@dxos/plugin-space": "0.8.4-main.52d7546f51",
72
+ "@dxos/plugin-testing": "0.8.4-main.52d7546f51",
73
+ "@dxos/plugin-theme": "0.8.4-main.52d7546f51",
74
+ "@dxos/random": "0.8.4-main.52d7546f51",
75
+ "@dxos/react-ui": "0.8.4-main.52d7546f51",
76
+ "@dxos/storybook-utils": "0.8.4-main.52d7546f51",
77
+ "@dxos/ui-theme": "0.8.4-main.52d7546f51",
78
+ "@dxos/plugin-attention": "0.8.4-main.52d7546f51"
77
79
  },
78
80
  "peerDependencies": {
79
- "@effect-rx/rx-react": "^0.34.1",
80
- "@effect/platform": "^0.80.12",
81
- "effect": "^3.13.3",
82
- "react": "^19.0.0",
83
- "react-dom": "^19.0.0",
84
- "@dxos/react-ui": "0.8.4-main.406dc2a",
85
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a"
81
+ "@effect-atom/atom-react": "^0.5.0",
82
+ "@effect/platform": "0.94.4",
83
+ "effect": "3.19.16",
84
+ "react": "~19.2.3",
85
+ "react-dom": "~19.2.3",
86
+ "@dxos/ui-theme": "0.8.4-main.52d7546f51",
87
+ "@dxos/react-ui": "0.8.4-main.52d7546f51"
86
88
  },
87
89
  "publishConfig": {
88
90
  "access": "public"
@@ -2,93 +2,74 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import {
6
- Capabilities,
7
- Events,
8
- LayoutAction,
9
- allOf,
10
- contributes,
11
- createIntent,
12
- defineModule,
13
- definePlugin,
14
- } from '@dxos/app-framework';
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
8
+ import { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Graph } from '@dxos/plugin-graph';
15
10
  import { type TreeData } from '@dxos/react-ui-list';
16
11
 
17
- import { AppGraphBuilder, IntentResolver, Keyboard, ReactSurface, State } from './capabilities';
12
+ import { AppGraphBuilder, Keyboard, OperationResolver, ReactSurface, State } from './capabilities';
18
13
  import { NODE_TYPE } from './components';
19
- import { NavTreeEvents } from './events';
20
14
  import { meta } from './meta';
21
15
  import { translations } from './translations';
16
+ import { NavTreeEvents } from './types';
22
17
 
23
- export const NavTreePlugin = definePlugin(meta, () => [
24
- defineModule({
25
- id: `${meta.id}/module/state`,
26
- activatesOn: Events.LayoutReady,
18
+ export const NavTreePlugin = Plugin.define(meta).pipe(
19
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
20
+ AppPlugin.addMetadataModule({
21
+ metadata: {
22
+ id: NODE_TYPE,
23
+ metadata: {
24
+ parse: ({ item }: TreeData, type: string) => {
25
+ switch (type) {
26
+ case 'node':
27
+ return item;
28
+ case 'object':
29
+ return item.data;
30
+ case 'view-object':
31
+ return { id: `${item.id}-view`, object: item.data };
32
+ }
33
+ },
34
+ },
35
+ },
36
+ }),
37
+ AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
38
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
39
+ AppPlugin.addTranslationsModule({ translations }),
40
+ Plugin.addModule({
41
+ id: 'state',
42
+ activatesOn: AppActivationEvents.LayoutReady,
27
43
  activatesAfter: [NavTreeEvents.StateReady],
28
44
  activate: State,
29
45
  }),
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
- }
51
- },
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) {
46
+ Plugin.addModule({
47
+ id: 'expose',
48
+ activatesOn: ActivationEvent.allOf(
49
+ ActivationEvents.OperationInvokerReady,
50
+ AppActivationEvents.AppGraphReady,
51
+ AppActivationEvents.LayoutReady,
52
+ NavTreeEvents.StateReady,
53
+ ),
54
+ activate: Effect.fnUntraced(function* () {
55
+ const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
56
+ const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
57
+ const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
58
+ if (invokePromise && layout.active.length === 1) {
63
59
  // TODO(wittjosiah): This should really be fired once the navtree renders for the first time.
64
60
  // 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] })))
61
+ void Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 30_000 })
62
+ .then(() => invokePromise(LayoutOperation.Expose, { subject: layout.active[0] }))
68
63
  .catch(() => {});
69
64
  }
70
65
 
71
66
  return [];
72
- },
67
+ }),
73
68
  }),
74
- defineModule({
75
- id: `${meta.id}/module/keyboard`,
76
- activatesOn: Events.AppGraphReady,
69
+ Plugin.addModule({
70
+ id: 'keyboard',
71
+ activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, ActivationEvents.OperationInvokerReady),
77
72
  activate: Keyboard,
78
73
  }),
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
- ]);
74
+ Plugin.make,
75
+ );
@@ -0,0 +1,42 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
10
+ import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
11
+
12
+ import { COMMANDS_DIALOG, meta } from '../../meta';
13
+
14
+ export default Capability.makeModule(
15
+ Effect.fnUntraced(function* () {
16
+ const extensions = yield* GraphBuilder.createExtension({
17
+ id: meta.id,
18
+ match: NodeMatcher.whenRoot,
19
+ actions: () =>
20
+ Effect.succeed([
21
+ {
22
+ id: COMMANDS_DIALOG,
23
+ data: () =>
24
+ Operation.invoke(LayoutOperation.UpdateDialog, {
25
+ subject: COMMANDS_DIALOG,
26
+ blockAlign: 'start',
27
+ }),
28
+ properties: {
29
+ label: ['open commands label', { ns: meta.id }],
30
+ icon: 'ph--magnifying-glass--regular',
31
+ keyBinding: {
32
+ macos: 'meta+k',
33
+ windows: 'ctrl+k',
34
+ },
35
+ },
36
+ },
37
+ ]),
38
+ });
39
+
40
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
41
+ }),
42
+ );
@@ -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,66 @@
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 { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { debounce } from '@dxos/async';
10
+ import { Keyboard } from '@dxos/keyboard';
11
+ import { Graph, Node, runAction } from '@dxos/plugin-graph';
12
+ import { getHostPlatform } from '@dxos/util';
13
+
14
+ import { KEY_BINDING } from '../../meta';
15
+
16
+ export default Capability.makeModule(
17
+ Effect.fnUntraced(function* () {
18
+ const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
19
+ const invoker = yield* Capability.get(Capabilities.OperationInvoker);
20
+ const pluginContext = yield* Capability.Service;
21
+
22
+ // TODO(wittjosiah): Factor out.
23
+ // TODO(wittjosiah): Handle removal of actions.
24
+ const visitor = (node: Node.Node, path: string[]) => {
25
+ let shortcut: string | undefined;
26
+ if (typeof node.properties.keyBinding === 'object') {
27
+ const availablePlatforms = Object.keys(node.properties.keyBinding);
28
+ const platform = getHostPlatform();
29
+ shortcut = availablePlatforms.includes(platform)
30
+ ? node.properties.keyBinding[platform]
31
+ : platform === 'ios'
32
+ ? node.properties.keyBinding.macos // Fallback to macos if ios-specific bindings not provided.
33
+ : platform === 'linux' || platform === 'unknown'
34
+ ? node.properties.keyBinding.windows // Fallback to windows if platform-specific bindings not provided.
35
+ : undefined;
36
+ } else {
37
+ shortcut = node.properties.keyBinding;
38
+ }
39
+
40
+ if (shortcut && Node.isAction(node)) {
41
+ Keyboard.singleton.getContext(path.slice(0, -1).join('/')).bind({
42
+ shortcut,
43
+ handler: () => void runAction(invoker, pluginContext, node, { parent: node, caller: KEY_BINDING }),
44
+ data: node.properties.label,
45
+ });
46
+ }
47
+ };
48
+
49
+ const eventHandler = debounce(() => {
50
+ Graph.traverse(graph, { visitor });
51
+ }, 500);
52
+
53
+ const unsubscribe = graph.onNodeChanged.on(eventHandler);
54
+
55
+ // TODO(burdon): Create context and plugin.
56
+ Keyboard.singleton.initialize();
57
+ Keyboard.singleton.setCurrentContext(Node.RootId);
58
+
59
+ return Capability.contributes(Capabilities.Null, null, () =>
60
+ Effect.sync(() => {
61
+ unsubscribe();
62
+ Keyboard.singleton.destroy();
63
+ }),
64
+ );
65
+ }),
66
+ );
@@ -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,42 @@
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 { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
9
+ import { log } from '@dxos/log';
10
+ import { OperationResolver } from '@dxos/operation';
11
+ import { Graph } from '@dxos/plugin-graph';
12
+
13
+ import { NavTreeCapabilities } from '../../types';
14
+
15
+ export default Capability.makeModule(
16
+ Effect.fnUntraced(function* () {
17
+ return Capability.contributes(Capabilities.OperationResolver, [
18
+ OperationResolver.make({
19
+ operation: LayoutOperation.Expose,
20
+ handler: Effect.fnUntraced(function* ({ subject }) {
21
+ const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
22
+ const { getItem, setItem } = yield* Capability.get(NavTreeCapabilities.State);
23
+ yield* Effect.tryPromise(() => Graph.waitForPath(graph, { target: subject }, { timeout: 1_000 })).pipe(
24
+ Effect.andThen((path) => {
25
+ [...Array(path.length)].forEach((_, index) => {
26
+ const subpath = path.slice(0, index);
27
+ const value = getItem(subpath);
28
+ if (!value.open) {
29
+ setItem(subpath, 'open', true);
30
+ }
31
+ });
32
+ }),
33
+ Effect.catchAll(() => {
34
+ log('Path to node not found', { subject });
35
+ return Effect.void;
36
+ }),
37
+ );
38
+ }),
39
+ }),
40
+ ]);
41
+ }),
42
+ );
@@ -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,55 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
10
+ import { Node } from '@dxos/plugin-graph';
11
+
12
+ import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '../../components';
13
+ import { COMMANDS_DIALOG, meta } from '../../meta';
14
+
15
+ export default Capability.makeModule(() =>
16
+ Effect.succeed(
17
+ Capability.contributes(Capabilities.ReactSurface, [
18
+ Surface.create({
19
+ id: COMMANDS_DIALOG,
20
+ role: 'dialog',
21
+ filter: (data): data is { props: { selected?: string } } => data.component === COMMANDS_DIALOG,
22
+ component: ({ data, ref }) => <CommandsDialogContent {...data.props} ref={ref} />,
23
+ }),
24
+ Surface.create({
25
+ id: `${meta.id}/navigation`,
26
+ role: 'navigation',
27
+ filter: (data): data is { popoverAnchorId?: string; topbar: boolean; current: string } =>
28
+ typeof data.current === 'string',
29
+ component: ({ data, ref }) => {
30
+ return (
31
+ <NavTreeContainer
32
+ tab={data.current}
33
+ popoverAnchorId={data.popoverAnchorId as string | undefined}
34
+ topbar={data.topbar as boolean}
35
+ ref={ref}
36
+ />
37
+ );
38
+ },
39
+ }),
40
+ Surface.create({
41
+ id: `${meta.id}/document-title`,
42
+ role: 'document-title',
43
+ component: ({ data }) => (
44
+ <NavTreeDocumentTitle node={Node.isGraphNode(data.subject) ? data.subject : undefined} />
45
+ ),
46
+ }),
47
+ Surface.create({
48
+ id: `${meta.id}/search-input`,
49
+ role: 'search-input',
50
+ position: 'fallback',
51
+ component: () => <CommandsTrigger />,
52
+ }),
53
+ ]),
54
+ ),
55
+ );
@@ -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'));