@dxos/app-framework 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77

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 (366) hide show
  1. package/.storybook/main.mts +11 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  4. package/.swc/plugins/{v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 → linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7} +0 -0
  5. package/dist/lib/browser/{app-graph-builder-BGGXLD6T.mjs → app-graph-builder-XH4OYQLC.mjs} +25 -25
  6. package/dist/lib/browser/app-graph-builder-XH4OYQLC.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-2636QSIK.mjs → chunk-6V54SRFL.mjs} +390 -270
  8. package/dist/lib/browser/chunk-6V54SRFL.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-RGKMLI6U.mjs} +10 -7
  10. package/dist/lib/browser/chunk-RGKMLI6U.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-DHZB7HG7.mjs → chunk-ZZVFNUHZ.mjs} +189 -135
  12. package/dist/lib/browser/chunk-ZZVFNUHZ.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +20 -28
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-dispatcher-TWKB22NI.mjs → intent-dispatcher-VFMJVO2M.mjs} +2 -2
  16. package/dist/lib/browser/{intent-resolver-O67UANYP.mjs → intent-resolver-ICAPD4JL.mjs} +5 -5
  17. package/dist/lib/browser/intent-resolver-ICAPD4JL.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/{store-LFKDWHUQ.mjs → store-7ZGMHOGB.mjs} +4 -4
  20. package/dist/lib/browser/{store-LFKDWHUQ.mjs.map → store-7ZGMHOGB.mjs.map} +2 -2
  21. package/dist/lib/browser/testing/index.mjs +14 -19
  22. package/dist/lib/browser/testing/index.mjs.map +3 -3
  23. package/dist/lib/browser/worker.mjs +7 -9
  24. package/dist/lib/node-esm/{app-graph-builder-QHIJUYYW.mjs → app-graph-builder-C7H22SOL.mjs} +25 -25
  25. package/dist/lib/node-esm/app-graph-builder-C7H22SOL.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-NJAFK626.mjs → chunk-AXSZKZFD.mjs} +189 -135
  27. package/dist/lib/node-esm/chunk-AXSZKZFD.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-LKPMRTRR.mjs} +10 -7
  29. package/dist/lib/node-esm/chunk-LKPMRTRR.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-VSKRV3NW.mjs → chunk-SOVTUUAY.mjs} +390 -270
  31. package/dist/lib/node-esm/chunk-SOVTUUAY.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +20 -28
  33. package/dist/lib/node-esm/index.mjs.map +3 -3
  34. package/dist/lib/node-esm/{intent-dispatcher-5PRM3KGH.mjs → intent-dispatcher-SAPOKSLZ.mjs} +2 -2
  35. package/dist/lib/node-esm/{intent-resolver-K3D4BXQQ.mjs → intent-resolver-CRNJ6BMD.mjs} +5 -5
  36. package/dist/lib/node-esm/intent-resolver-CRNJ6BMD.mjs.map +7 -0
  37. package/dist/lib/node-esm/meta.json +1 -1
  38. package/dist/lib/node-esm/{store-53XDUBMD.mjs → store-H4F4RMYD.mjs} +4 -4
  39. package/dist/lib/node-esm/{store-53XDUBMD.mjs.map → store-H4F4RMYD.mjs.map} +2 -2
  40. package/dist/lib/node-esm/testing/index.mjs +14 -19
  41. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  42. package/dist/lib/node-esm/worker.mjs +7 -9
  43. package/dist/types/src/common/capabilities.d.ts +85 -9
  44. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  45. package/dist/types/src/common/collaboration.d.ts +9 -8
  46. package/dist/types/src/common/collaboration.d.ts.map +1 -1
  47. package/dist/types/src/common/events.d.ts.map +1 -1
  48. package/dist/types/src/common/layout.d.ts +0 -2
  49. package/dist/types/src/common/layout.d.ts.map +1 -1
  50. package/dist/types/src/common/surface.d.ts +7 -13
  51. package/dist/types/src/common/surface.d.ts.map +1 -1
  52. package/dist/types/src/components/App.d.ts +10 -0
  53. package/dist/types/src/components/App.d.ts.map +1 -0
  54. package/dist/types/src/components/App.stories.d.ts +14 -0
  55. package/dist/types/src/components/App.stories.d.ts.map +1 -0
  56. package/dist/types/src/components/DefaultFallback.d.ts +8 -0
  57. package/dist/types/src/components/DefaultFallback.d.ts.map +1 -0
  58. package/dist/types/src/components/index.d.ts +2 -0
  59. package/dist/types/src/components/index.d.ts.map +1 -0
  60. package/dist/types/src/{App.d.ts → components/useApp.d.ts} +7 -6
  61. package/dist/types/src/components/useApp.d.ts.map +1 -0
  62. package/dist/types/src/components/useLoading.d.ts +19 -0
  63. package/dist/types/src/components/useLoading.d.ts.map +1 -0
  64. package/dist/types/src/core/capabilities.d.ts +4 -1
  65. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  66. package/dist/types/src/core/manager.d.ts +6 -2
  67. package/dist/types/src/core/manager.d.ts.map +1 -1
  68. package/dist/types/src/core/plugin.d.ts +4 -1
  69. package/dist/types/src/core/plugin.d.ts.map +1 -1
  70. package/dist/types/src/index.d.ts +1 -1
  71. package/dist/types/src/index.d.ts.map +1 -1
  72. package/dist/types/src/playground/debug/Debug.d.ts +1 -1
  73. package/dist/types/src/playground/debug/plugin.d.ts +1 -1
  74. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
  75. package/dist/types/src/playground/generator/Main.d.ts +1 -1
  76. package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
  77. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  78. package/dist/types/src/playground/generator/generator.d.ts +1 -1
  79. package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
  80. package/dist/types/src/playground/generator/plugin.d.ts +1 -1
  81. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
  82. package/dist/types/src/playground/layout/Layout.d.ts +2 -2
  83. package/dist/types/src/playground/layout/plugin.d.ts +1 -1
  84. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
  85. package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
  86. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  87. package/dist/types/src/playground/logger/plugin.d.ts +1 -1
  88. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
  89. package/dist/types/src/playground/playground.stories.d.ts +5 -4
  90. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  91. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
  92. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
  93. package/dist/types/src/plugin-intent/actions.d.ts +4 -6
  94. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  95. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
  96. package/dist/types/src/plugin-intent/index.d.ts +1 -0
  97. package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
  98. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +3 -3
  99. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  100. package/dist/types/src/plugin-intent/meta.d.ts +3 -0
  101. package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
  102. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
  103. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
  104. package/dist/types/src/plugin-settings/actions.d.ts +4 -6
  105. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  106. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
  107. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
  108. package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
  109. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
  110. package/dist/types/src/plugin-settings/meta.d.ts +3 -0
  111. package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
  112. package/dist/types/src/plugin-settings/store.d.ts +1 -1
  113. package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
  114. package/dist/types/src/plugin-settings/translations.d.ts +2 -1
  115. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
  116. package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
  117. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
  118. package/dist/types/src/react/IntentContext.d.ts.map +1 -1
  119. package/dist/types/src/react/Surface.d.ts +2 -2
  120. package/dist/types/src/react/Surface.d.ts.map +1 -1
  121. package/dist/types/src/react/Surface.stories.d.ts +6 -5
  122. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  123. package/dist/types/src/react/common.d.ts.map +1 -1
  124. package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
  125. package/dist/types/src/testing/withPluginManager.d.ts +6 -6
  126. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  127. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  128. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  129. package/dist/types/tsconfig.tsbuildinfo +1 -1
  130. package/moon.yml +4 -0
  131. package/package.json +34 -29
  132. package/src/common/capabilities.ts +113 -12
  133. package/src/common/collaboration.ts +5 -8
  134. package/src/common/events.ts +3 -1
  135. package/src/common/layout.ts +2 -3
  136. package/src/common/surface.ts +15 -18
  137. package/src/components/App.stories.tsx +33 -0
  138. package/src/components/App.tsx +59 -0
  139. package/src/components/DefaultFallback.tsx +26 -0
  140. package/src/components/index.ts +5 -0
  141. package/src/{App.tsx → components/useApp.tsx} +24 -136
  142. package/src/components/useLoading.tsx +70 -0
  143. package/src/core/capabilities.test.ts +1 -1
  144. package/src/core/capabilities.ts +11 -6
  145. package/src/core/manager.test.ts +21 -20
  146. package/src/core/manager.ts +132 -54
  147. package/src/core/plugin.ts +8 -2
  148. package/src/helpers.test.ts +1 -1
  149. package/src/index.ts +1 -1
  150. package/src/playground/debug/Debug.tsx +1 -1
  151. package/src/playground/debug/plugin.ts +7 -8
  152. package/src/playground/generator/Toolbar.tsx +2 -1
  153. package/src/playground/generator/generator.ts +3 -3
  154. package/src/playground/generator/plugin.ts +12 -13
  155. package/src/playground/layout/plugin.ts +10 -9
  156. package/src/playground/logger/Toolbar.tsx +2 -1
  157. package/src/playground/logger/plugin.ts +30 -25
  158. package/src/playground/playground.stories.tsx +20 -16
  159. package/src/plugin-intent/IntentPlugin.ts +13 -13
  160. package/src/plugin-intent/actions.ts +3 -5
  161. package/src/plugin-intent/errors.ts +1 -0
  162. package/src/plugin-intent/index.ts +1 -0
  163. package/src/plugin-intent/intent-dispatcher.test.ts +1 -1
  164. package/src/plugin-intent/intent-dispatcher.ts +9 -8
  165. package/src/plugin-intent/meta.ts +10 -0
  166. package/src/plugin-settings/SettingsPlugin.ts +27 -28
  167. package/src/plugin-settings/actions.ts +8 -12
  168. package/src/plugin-settings/app-graph-builder.ts +14 -12
  169. package/src/plugin-settings/intent-resolver.ts +3 -2
  170. package/src/plugin-settings/meta.ts +10 -0
  171. package/src/plugin-settings/store.ts +1 -1
  172. package/src/plugin-settings/translations.ts +3 -3
  173. package/src/react/ErrorBoundary.tsx +24 -15
  174. package/src/react/IntentContext.tsx +3 -2
  175. package/src/react/Surface.stories.tsx +23 -18
  176. package/src/react/Surface.tsx +14 -5
  177. package/src/react/common.ts +2 -1
  178. package/src/react/useCapabilities.ts +2 -1
  179. package/src/testing/withPluginManager.stories.tsx +9 -5
  180. package/src/testing/withPluginManager.tsx +25 -29
  181. package/tsconfig.json +5 -9
  182. package/vitest.config.ts +8 -6
  183. package/.eslintrc.cjs +0 -9
  184. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  185. package/dist/lib/browser/app-graph-builder-BGGXLD6T.mjs.map +0 -7
  186. package/dist/lib/browser/chunk-2636QSIK.mjs.map +0 -7
  187. package/dist/lib/browser/chunk-DHZB7HG7.mjs.map +0 -7
  188. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  189. package/dist/lib/browser/intent-resolver-O67UANYP.mjs.map +0 -7
  190. package/dist/lib/node-esm/app-graph-builder-QHIJUYYW.mjs.map +0 -7
  191. package/dist/lib/node-esm/chunk-NJAFK626.mjs.map +0 -7
  192. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  193. package/dist/lib/node-esm/chunk-VSKRV3NW.mjs.map +0 -7
  194. package/dist/lib/node-esm/intent-resolver-K3D4BXQQ.mjs.map +0 -7
  195. package/dist/types/src/App.d.ts.map +0 -1
  196. package/typedoc/.nojekyll +0 -1
  197. package/typedoc/assets/hierarchy.js +0 -1
  198. package/typedoc/assets/highlight.css +0 -106
  199. package/typedoc/assets/icons.js +0 -18
  200. package/typedoc/assets/icons.svg +0 -1
  201. package/typedoc/assets/main.js +0 -60
  202. package/typedoc/assets/navigation.js +0 -1
  203. package/typedoc/assets/search.js +0 -1
  204. package/typedoc/assets/style.css +0 -1640
  205. package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
  206. package/typedoc/classes/ErrorBoundary.html +0 -125
  207. package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
  208. package/typedoc/classes/IntentAction.Track.html +0 -266
  209. package/typedoc/classes/LayoutAction.AddToast.html +0 -265
  210. package/typedoc/classes/LayoutAction.Close.html +0 -382
  211. package/typedoc/classes/LayoutAction.Expose.html +0 -265
  212. package/typedoc/classes/LayoutAction.Open.html +0 -1123
  213. package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
  214. package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
  215. package/typedoc/classes/LayoutAction.Set.html +0 -460
  216. package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -499
  217. package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
  218. package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
  219. package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -1123
  220. package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
  221. package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
  222. package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -616
  223. package/typedoc/classes/Plugin.html +0 -6
  224. package/typedoc/classes/PluginContext.html +0 -38
  225. package/typedoc/classes/PluginManager.html +0 -43
  226. package/typedoc/classes/PluginModule.html +0 -18
  227. package/typedoc/classes/SettingsAction.Open.html +0 -226
  228. package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
  229. package/typedoc/functions/Events.createStateEvent.html +0 -2
  230. package/typedoc/functions/IntentPlugin.html +0 -1
  231. package/typedoc/functions/SettingsPlugin.html +0 -1
  232. package/typedoc/functions/allOf.html +0 -2
  233. package/typedoc/functions/chain.html +0 -3
  234. package/typedoc/functions/contributes.html +0 -2
  235. package/typedoc/functions/createDispatcher.html +0 -3
  236. package/typedoc/functions/createIntent.html +0 -6
  237. package/typedoc/functions/createResolver.html +0 -2
  238. package/typedoc/functions/createSurface.html +0 -2
  239. package/typedoc/functions/defineCapability.html +0 -2
  240. package/typedoc/functions/defineEvent.html +0 -2
  241. package/typedoc/functions/defineModule.html +0 -2
  242. package/typedoc/functions/definePlugin.html +0 -2
  243. package/typedoc/functions/eventKey.html +0 -2
  244. package/typedoc/functions/getEvents.html +0 -2
  245. package/typedoc/functions/isAllOf.html +0 -2
  246. package/typedoc/functions/isOneOf.html +0 -2
  247. package/typedoc/functions/isSurfaceAvailable.html +0 -2
  248. package/typedoc/functions/lazy.html +0 -2
  249. package/typedoc/functions/oneOf.html +0 -2
  250. package/typedoc/functions/useApp.html +0 -6
  251. package/typedoc/functions/useAppGraph.html +0 -1
  252. package/typedoc/functions/useCapabilities.html +0 -3
  253. package/typedoc/functions/useCapability.html +0 -4
  254. package/typedoc/functions/useIntentDispatcher.html +0 -1
  255. package/typedoc/functions/useIntentResolver.html +0 -1
  256. package/typedoc/functions/useLayout.html +0 -1
  257. package/typedoc/functions/usePluginManager.html +0 -2
  258. package/typedoc/hierarchy.html +0 -1
  259. package/typedoc/index.html +0 -12
  260. package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
  261. package/typedoc/media/LICENSE +0 -8
  262. package/typedoc/modules/Capabilities.html +0 -1
  263. package/typedoc/modules/CollaborationActions.html +0 -1
  264. package/typedoc/modules/Events.html +0 -1
  265. package/typedoc/modules/IntentAction.html +0 -1
  266. package/typedoc/modules/LayoutAction.html +0 -2
  267. package/typedoc/modules/SettingsAction.html +0 -1
  268. package/typedoc/modules.html +0 -1
  269. package/typedoc/types/ActivationEvent.html +0 -8
  270. package/typedoc/types/ActivationEvents.html +0 -2
  271. package/typedoc/types/AnyCapability.html +0 -1
  272. package/typedoc/types/AnyIntent.html +0 -1
  273. package/typedoc/types/AnyIntentChain.html +0 -1
  274. package/typedoc/types/AnyIntentEffectResult.html +0 -1
  275. package/typedoc/types/AnyIntentResolver.html +0 -1
  276. package/typedoc/types/AnyIntentResult.html +0 -1
  277. package/typedoc/types/Capabilities.FileUploader.html +0 -1
  278. package/typedoc/types/Capabilities.IntentResolver.html +0 -1
  279. package/typedoc/types/Capabilities.Layout.html +0 -1
  280. package/typedoc/types/Capabilities.Metadata.html +0 -1
  281. package/typedoc/types/Capabilities.ReactContext.html +0 -1
  282. package/typedoc/types/Capabilities.ReactRoot.html +0 -1
  283. package/typedoc/types/Capabilities.ReactSurface.html +0 -1
  284. package/typedoc/types/Capabilities.Settings.html +0 -4
  285. package/typedoc/types/Capability.html +0 -9
  286. package/typedoc/types/CreateAppOptions.html +0 -10
  287. package/typedoc/types/FileInfo.html +0 -1
  288. package/typedoc/types/Intent.html +0 -10
  289. package/typedoc/types/IntentChain.html +0 -6
  290. package/typedoc/types/IntentContext.html +0 -5
  291. package/typedoc/types/IntentData.html +0 -1
  292. package/typedoc/types/IntentDispatcher.html +0 -2
  293. package/typedoc/types/IntentDispatcherResult.html +0 -2
  294. package/typedoc/types/IntentEffectDefinition.html +0 -2
  295. package/typedoc/types/IntentEffectResult.html +0 -15
  296. package/typedoc/types/IntentParams.html +0 -3
  297. package/typedoc/types/IntentResolver.html +0 -2
  298. package/typedoc/types/IntentResultData.html +0 -1
  299. package/typedoc/types/IntentSchema.html +0 -1
  300. package/typedoc/types/IntentUndo.html +0 -2
  301. package/typedoc/types/InterfaceDef.html +0 -4
  302. package/typedoc/types/Label.html +0 -1
  303. package/typedoc/types/NodeSerializer.html +0 -8
  304. package/typedoc/types/PluginManagerOptions.html +0 -6
  305. package/typedoc/types/PluginMeta.html +0 -21
  306. package/typedoc/types/PromiseIntentDispatcher.html +0 -2
  307. package/typedoc/types/PromiseIntentUndo.html +0 -2
  308. package/typedoc/types/Resource.html +0 -1
  309. package/typedoc/types/ResourceKey.html +0 -1
  310. package/typedoc/types/ResourceLanguage.html +0 -1
  311. package/typedoc/types/SerializedNode.html +0 -4
  312. package/typedoc/types/SurfaceComponent.html +0 -2
  313. package/typedoc/types/SurfaceDefinition.html +0 -2
  314. package/typedoc/types/SurfaceProps.html +0 -4
  315. package/typedoc/variables/Capabilities.AnchorSort.html +0 -1
  316. package/typedoc/variables/Capabilities.AppGraph.html +0 -1
  317. package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
  318. package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
  319. package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
  320. package/typedoc/variables/Capabilities.FileUploader.html +0 -1
  321. package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
  322. package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
  323. package/typedoc/variables/Capabilities.Layout.html +0 -1
  324. package/typedoc/variables/Capabilities.Metadata.html +0 -1
  325. package/typedoc/variables/Capabilities.Null.html +0 -1
  326. package/typedoc/variables/Capabilities.PluginManager.html +0 -1
  327. package/typedoc/variables/Capabilities.ReactContext.html +0 -1
  328. package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
  329. package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
  330. package/typedoc/variables/Capabilities.RxRegistry.html +0 -1
  331. package/typedoc/variables/Capabilities.Settings.html +0 -1
  332. package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
  333. package/typedoc/variables/Capabilities.Tools.html +0 -1
  334. package/typedoc/variables/Capabilities.Translations.html +0 -1
  335. package/typedoc/variables/Events.AppGraphReady.html +0 -2
  336. package/typedoc/variables/Events.DispatcherReady.html +0 -2
  337. package/typedoc/variables/Events.LayoutReady.html +0 -1
  338. package/typedoc/variables/Events.SettingsReady.html +0 -2
  339. package/typedoc/variables/Events.SetupAppGraph.html +0 -2
  340. package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
  341. package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
  342. package/typedoc/variables/Events.SetupMetadata.html +0 -2
  343. package/typedoc/variables/Events.SetupReactSurface.html +0 -2
  344. package/typedoc/variables/Events.SetupSettings.html +0 -2
  345. package/typedoc/variables/Events.SetupTranslations.html +0 -2
  346. package/typedoc/variables/Events.Startup.html +0 -2
  347. package/typedoc/variables/FileInfoSchema.html +0 -1
  348. package/typedoc/variables/INTENT_ACTION.html +0 -1
  349. package/typedoc/variables/INTENT_PLUGIN.html +0 -1
  350. package/typedoc/variables/LAYOUT_ACTION.html +0 -1
  351. package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
  352. package/typedoc/variables/Label.html +0 -1
  353. package/typedoc/variables/LayoutAction.Toast.html +0 -1
  354. package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
  355. package/typedoc/variables/PluginManagerProvider.html +0 -2
  356. package/typedoc/variables/Resource.html +0 -2
  357. package/typedoc/variables/ResourceKey.html +0 -1
  358. package/typedoc/variables/ResourceLanguage.html +0 -1
  359. package/typedoc/variables/SETTINGS_ACTION.html +0 -1
  360. package/typedoc/variables/SETTINGS_ID.html +0 -1
  361. package/typedoc/variables/SETTINGS_KEY.html +0 -1
  362. package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
  363. package/typedoc/variables/Surface.html +0 -2
  364. package/typedoc/variables/defaultFileTypes.html +0 -1
  365. /package/dist/lib/browser/{intent-dispatcher-TWKB22NI.mjs.map → intent-dispatcher-VFMJVO2M.mjs.map} +0 -0
  366. /package/dist/lib/node-esm/{intent-dispatcher-5PRM3KGH.mjs.map → intent-dispatcher-SAPOKSLZ.mjs.map} +0 -0
@@ -5,15 +5,13 @@
5
5
  import { Schema } from 'effect';
6
6
 
7
7
  import { Label } from './intent';
8
-
9
- export const INTENT_PLUGIN = 'dxos.org/plugin/intent';
10
- export const INTENT_ACTION = `${INTENT_PLUGIN}/action`;
8
+ import { meta } from './meta';
11
9
 
12
10
  export namespace IntentAction {
13
11
  /**
14
12
  * Log an intent.
15
13
  */
16
- export class Track extends Schema.TaggedClass<Track>()(`${INTENT_ACTION}/track`, {
14
+ export class Track extends Schema.TaggedClass<Track>()(`${meta.id}/action/track`, {
17
15
  input: Schema.Struct({
18
16
  intents: Schema.Array(Schema.String),
19
17
  error: Schema.optional(Schema.String),
@@ -24,7 +22,7 @@ export namespace IntentAction {
24
22
  /**
25
23
  * Fired after an intent is dispatched if the intent is undoable.
26
24
  */
27
- export class ShowUndo extends Schema.TaggedClass<ShowUndo>()(`${INTENT_ACTION}/show-undo`, {
25
+ export class ShowUndo extends Schema.TaggedClass<ShowUndo>()(`${meta.id}/action/show-undo`, {
28
26
  input: Schema.Struct({
29
27
  message: Label,
30
28
  }),
@@ -28,6 +28,7 @@ export class NoResolversError extends BaseError {
28
28
  }
29
29
  }
30
30
 
31
+ // TODO(burdon): Detect loops.
31
32
  export class CycleDetectedError extends BaseError {
32
33
  constructor(context?: Record<string, any>) {
33
34
  super(
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  export * from './actions';
6
+ export * from './errors';
6
7
  export * from './intent';
7
8
  export * from './intent-dispatcher';
8
9
  export * from './IntentPlugin';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema, Effect, Fiber, pipe } from 'effect';
5
+ import { Effect, Fiber, Schema, pipe } from 'effect';
6
6
  import { describe, expect, test } from 'vitest';
7
7
 
8
8
  import { chain, createIntent } from './intent';
@@ -2,17 +2,19 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Effect, Option, pipe, Ref } from 'effect';
5
+ import { Effect, Option, Ref, pipe } from 'effect';
6
6
  import { type Simplify } from 'effect/Types';
7
7
 
8
8
  import { live } from '@dxos/live-object';
9
9
  import { log } from '@dxos/log';
10
- import { byPosition, type MaybePromise, type Position, type GuardedType } from '@dxos/util';
10
+ import { type GuardedType, type MaybePromise, type Position, byPosition } from '@dxos/util';
11
+
12
+ import { Capabilities, Events } from '../common';
13
+ import { type PluginContext, contributes } from '../core';
11
14
 
12
15
  import { IntentAction } from './actions';
13
16
  import { CycleDetectedError, NoResolversError } from './errors';
14
17
  import {
15
- createIntent,
16
18
  type AnyIntent,
17
19
  type AnyIntentChain,
18
20
  type Intent,
@@ -22,9 +24,8 @@ import {
22
24
  type IntentResultData,
23
25
  type IntentSchema,
24
26
  type Label,
27
+ createIntent,
25
28
  } from './intent';
26
- import { Events, Capabilities } from '../common';
27
- import { contributes, type PluginContext } from '../core';
28
29
 
29
30
  const EXECUTION_LIMIT = 100;
30
31
  const HISTORY_LIMIT = 100;
@@ -196,7 +197,7 @@ export const createDispatcher = (
196
197
  .filter((resolver) => !resolver.filter || resolver.filter(intent.data))
197
198
  .toSorted(byPosition);
198
199
  if (candidates.length === 0) {
199
- yield* Effect.fail(new NoResolversError(intent.id));
200
+ return yield* Effect.fail(new NoResolversError(intent.id));
200
201
  }
201
202
 
202
203
  const effect = candidates[0].resolve(intent.data, intent.undo ?? false);
@@ -207,7 +208,7 @@ export const createDispatcher = (
207
208
  const dispatch: IntentDispatcher = (intentChain, depth = 0) => {
208
209
  return Effect.gen(function* () {
209
210
  if (depth > executionLimit) {
210
- yield* Effect.fail(new CycleDetectedError());
211
+ return yield* Effect.fail(new CycleDetectedError());
211
212
  }
212
213
 
213
214
  const resultsRef = yield* Ref.make<AnyIntentResult[]>([]);
@@ -230,7 +231,7 @@ export const createDispatcher = (
230
231
  // error: result.error.message,
231
232
  // }),
232
233
  // );
233
- yield* Effect.fail(result.error);
234
+ return yield* Effect.fail(result.error);
234
235
  }
235
236
  }
236
237
 
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type PluginMeta } from '@dxos/app-framework';
6
+
7
+ export const meta: PluginMeta = {
8
+ id: 'dxos.org/plugin/intent',
9
+ name: 'Intent',
10
+ };
@@ -2,34 +2,33 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { SETTINGS_PLUGIN } from './actions';
6
- import { translations } from './translations';
7
5
  import { Capabilities, Events } from '../common';
8
6
  import { contributes, defineModule, definePlugin, lazy } from '../core';
9
7
 
10
- // TODO(wittjosiah): Add options to exclude some modules.
11
- export const SettingsPlugin = () =>
12
- definePlugin({ id: SETTINGS_PLUGIN, name: 'Settings' }, [
13
- defineModule({
14
- id: `${SETTINGS_PLUGIN}/module/store`,
15
- activatesOn: Events.Startup,
16
- activatesBefore: [Events.SetupSettings],
17
- activatesAfter: [Events.SettingsReady],
18
- activate: lazy(() => import('./store')),
19
- }),
20
- defineModule({
21
- id: `${SETTINGS_PLUGIN}/module/translations`,
22
- activatesOn: Events.SetupTranslations,
23
- activate: () => contributes(Capabilities.Translations, translations),
24
- }),
25
- defineModule({
26
- id: `${SETTINGS_PLUGIN}/module/intent-resolver`,
27
- activatesOn: Events.SetupIntentResolver,
28
- activate: lazy(() => import('./intent-resolver')),
29
- }),
30
- defineModule({
31
- id: `${SETTINGS_PLUGIN}/module/app-graph-builder`,
32
- activatesOn: Events.SetupAppGraph,
33
- activate: lazy(() => import('./app-graph-builder')),
34
- }),
35
- ]);
8
+ import { meta } from './meta';
9
+ import { translations } from './translations';
10
+
11
+ export const SettingsPlugin = definePlugin(meta, () => [
12
+ defineModule({
13
+ id: `${meta.id}/module/store`,
14
+ activatesOn: Events.Startup,
15
+ activatesBefore: [Events.SetupSettings],
16
+ activatesAfter: [Events.SettingsReady],
17
+ activate: lazy(() => import('./store')),
18
+ }),
19
+ defineModule({
20
+ id: `${meta.id}/module/translations`,
21
+ activatesOn: Events.SetupTranslations,
22
+ activate: () => contributes(Capabilities.Translations, translations),
23
+ }),
24
+ defineModule({
25
+ id: `${meta.id}/module/intent-resolver`,
26
+ activatesOn: Events.SetupIntentResolver,
27
+ activate: lazy(() => import('./intent-resolver')),
28
+ }),
29
+ defineModule({
30
+ id: `${meta.id}/module/app-graph-builder`,
31
+ activatesOn: Events.SetupAppGraph,
32
+ activate: lazy(() => import('./app-graph-builder')),
33
+ }),
34
+ ]);
@@ -4,26 +4,22 @@
4
4
 
5
5
  import { Schema } from 'effect';
6
6
 
7
- export const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';
8
- export const SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
9
- // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
10
- // Ideally this should be worked into the data model in a generic way.
7
+ import { meta } from './meta';
8
+
9
+ // TODO(burdon): Document.
11
10
  export const SETTINGS_ID = '!dxos:settings';
12
11
  export const SETTINGS_KEY = 'settings';
13
12
 
14
13
  export namespace SettingsAction {
15
- export class Open extends Schema.TaggedClass<Open>()(`${SETTINGS_ACTION}/open`, {
14
+ export class Open extends Schema.TaggedClass<Open>()(`${meta.id}/open`, {
16
15
  input: Schema.Struct({
17
16
  plugin: Schema.optional(Schema.String),
18
17
  }),
19
18
  output: Schema.Void,
20
19
  }) {}
21
20
 
22
- export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(
23
- `${SETTINGS_ACTION}/open-plugin-registry`,
24
- {
25
- input: Schema.Void,
26
- output: Schema.Void,
27
- },
28
- ) {}
21
+ export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}/open-plugin-registry`, {
22
+ input: Schema.Void,
23
+ output: Schema.Void,
24
+ }) {}
29
25
  }
@@ -5,19 +5,21 @@
5
5
  import { Rx } from '@effect-rx/rx-react';
6
6
  import { Option, pipe } from 'effect';
7
7
 
8
- import { createExtension, ROOT_ID } from '@dxos/app-graph';
8
+ import { ROOT_ID, createExtension } from '@dxos/app-graph';
9
9
  import { type SettingsStore, type SettingsValue } from '@dxos/local-storage';
10
10
  import { isNonNullable } from '@dxos/util';
11
11
 
12
- import { SETTINGS_ID, SETTINGS_KEY, SETTINGS_PLUGIN, SettingsAction } from './actions';
13
12
  import { Capabilities } from '../common';
14
- import { contributes, type PluginMeta, type PluginContext } from '../core';
13
+ import { type PluginContext, type PluginMeta, contributes } from '../core';
15
14
  import { createIntent } from '../plugin-intent';
16
15
 
16
+ import { SETTINGS_ID, SETTINGS_KEY, SettingsAction } from './actions';
17
+ import { meta } from './meta';
18
+
17
19
  export default (context: PluginContext) =>
18
20
  contributes(Capabilities.AppGraphBuilder, [
19
21
  createExtension({
20
- id: `${SETTINGS_PLUGIN}/action`,
22
+ id: `${meta.id}/action`,
21
23
  actions: (node) =>
22
24
  Rx.make((get) =>
23
25
  pipe(
@@ -25,13 +27,13 @@ export default (context: PluginContext) =>
25
27
  Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
26
28
  Option.map(() => [
27
29
  {
28
- id: SETTINGS_PLUGIN,
30
+ id: meta.id,
29
31
  data: async () => {
30
32
  const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
31
33
  await dispatch(createIntent(SettingsAction.Open));
32
34
  },
33
35
  properties: {
34
- label: ['open settings label', { ns: SETTINGS_PLUGIN }],
36
+ label: ['open settings label', { ns: meta.id }],
35
37
  icon: 'ph--gear--regular',
36
38
  disposition: 'menu',
37
39
  keyBinding: {
@@ -46,7 +48,7 @@ export default (context: PluginContext) =>
46
48
  ),
47
49
  }),
48
50
  createExtension({
49
- id: `${SETTINGS_PLUGIN}/core`,
51
+ id: `${meta.id}/core`,
50
52
  connector: (node) =>
51
53
  Rx.make((get) =>
52
54
  pipe(
@@ -55,9 +57,9 @@ export default (context: PluginContext) =>
55
57
  Option.map(() => [
56
58
  {
57
59
  id: SETTINGS_ID,
58
- type: SETTINGS_PLUGIN,
60
+ type: meta.id,
59
61
  properties: {
60
- label: ['app settings label', { ns: SETTINGS_PLUGIN }],
62
+ label: ['app settings label', { ns: meta.id }],
61
63
  icon: 'ph--gear--regular',
62
64
  disposition: 'pin-end',
63
65
  position: 'hoist',
@@ -70,7 +72,7 @@ export default (context: PluginContext) =>
70
72
  ),
71
73
  }),
72
74
  createExtension({
73
- id: `${SETTINGS_PLUGIN}/core-plugins`,
75
+ id: `${meta.id}/core-plugins`,
74
76
  connector: (node) =>
75
77
  Rx.make((get) =>
76
78
  pipe(
@@ -105,7 +107,7 @@ export default (context: PluginContext) =>
105
107
  id: `${SETTINGS_KEY}:custom-plugins`,
106
108
  type: 'category',
107
109
  properties: {
108
- label: ['custom plugins label', { ns: SETTINGS_PLUGIN }],
110
+ label: ['custom plugins label', { ns: meta.id }],
109
111
  icon: 'ph--squares-four--regular',
110
112
  role: 'branch',
111
113
  disposition: 'collection',
@@ -118,7 +120,7 @@ export default (context: PluginContext) =>
118
120
  ),
119
121
  }),
120
122
  createExtension({
121
- id: `${SETTINGS_PLUGIN}/custom-plugins`,
123
+ id: `${meta.id}/custom-plugins`,
122
124
  connector: (node) =>
123
125
  Rx.make((get) =>
124
126
  pipe(
@@ -4,10 +4,11 @@
4
4
 
5
5
  import { pipe } from 'effect';
6
6
 
7
- import { SETTINGS_ID, SETTINGS_KEY, SettingsAction } from './actions';
8
7
  import { Capabilities, LayoutAction } from '../common';
9
8
  import { contributes } from '../core';
10
- import { createResolver, createIntent, chain } from '../plugin-intent';
9
+ import { chain, createIntent, createResolver } from '../plugin-intent';
10
+
11
+ import { SETTINGS_ID, SETTINGS_KEY, SettingsAction } from './actions';
11
12
 
12
13
  export default () =>
13
14
  contributes(
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type PluginMeta } from '@dxos/app-framework';
6
+
7
+ export const meta: PluginMeta = {
8
+ id: 'dxos.org/plugin/settings',
9
+ name: 'Settings',
10
+ };
@@ -5,7 +5,7 @@
5
5
  import { RootSettingsStore } from '@dxos/local-storage';
6
6
 
7
7
  import { Capabilities } from '../common';
8
- import { contributes, type PluginContext } from '../core';
8
+ import { type PluginContext, contributes } from '../core';
9
9
 
10
10
  export default (context: PluginContext) => {
11
11
  // TODO(wittjosiah): Replace with rx?
@@ -1,15 +1,15 @@
1
1
  //
2
- // Copyright 2023 DXOS.org
2
+ // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { SETTINGS_PLUGIN } from './actions';
7
+ import { meta } from './meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
- [SETTINGS_PLUGIN]: {
12
+ [meta.id]: {
13
13
  'open settings label': 'Open settings',
14
14
  'app settings label': 'Settings',
15
15
  'custom plugins label': 'Plugins',
@@ -2,38 +2,40 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { Component, type FC, type PropsWithChildren } from 'react';
5
+ import React, { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';
6
6
 
7
- type Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;
8
- type State = { error: Error | undefined };
7
+ type State = {
8
+ error: Error | undefined;
9
+ };
10
+
11
+ export type ErrorBoundaryProps = PropsWithChildren<{
12
+ data?: any;
13
+ fallback?: FC<{ data?: any; error: Error }>;
14
+ }>;
9
15
 
10
16
  /**
11
17
  * Surface error boundary.
12
- *
13
18
  * For basic usage prefer providing a fallback component to `Surface`.
14
19
  *
15
- * For more information on error boundaries, see:
16
- * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
20
+ * Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
17
21
  */
18
- export class ErrorBoundary extends Component<Props, State> {
19
- constructor(props: Props) {
20
- super(props);
21
- this.state = { error: undefined };
22
- }
23
-
22
+ export class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
24
23
  static getDerivedStateFromError(error: Error): { error: Error } {
25
24
  return { error };
26
25
  }
27
26
 
28
- override componentDidUpdate(prevProps: Props): void {
27
+ override state = { error: undefined };
28
+
29
+ override componentDidUpdate(prevProps: ErrorBoundaryProps): void {
29
30
  if (prevProps.data !== this.props.data) {
30
31
  this.resetError();
31
32
  }
32
33
  }
33
34
 
34
- override render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined {
35
+ override render(): ReactNode {
35
36
  if (this.state.error) {
36
- return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;
37
+ const Fallback = this.props.fallback ?? DefaultFallback;
38
+ return <Fallback data={this.props.data} error={this.state.error} />;
37
39
  }
38
40
 
39
41
  return this.props.children;
@@ -43,3 +45,10 @@ export class ErrorBoundary extends Component<Props, State> {
43
45
  this.setState({ error: undefined });
44
46
  }
45
47
  }
48
+
49
+ const DefaultFallback: NonNullable<ErrorBoundaryProps['fallback']> = ({ data, error }) => (
50
+ <div className='flex flex-col gap-2 overflow-hidden border border-red-500 rounded-sm'>
51
+ <pre className='whitespace-pre-wrap font-sm text-xs p-2'>ERROR: {error.message}</pre>
52
+ <pre className='whitespace-pre-wrap font-sm text-xs p-2 text-subdued'>{JSON.stringify(data, null, 2)}</pre>
53
+ </div>
54
+ );
@@ -2,15 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Context, createContext, useContext, type Provider, useEffect } from 'react';
5
+ import { type Context, type Provider, createContext, useContext, useEffect } from 'react';
6
6
 
7
7
  import { raise } from '@dxos/debug';
8
8
  import { pick } from '@dxos/util';
9
9
 
10
- import { usePluginManager } from './PluginManagerProvider';
11
10
  import { Capabilities } from '../common';
12
11
  import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
13
12
 
13
+ import { usePluginManager } from './PluginManagerProvider';
14
+
14
15
  const IntentContext: Context<IntentContext | undefined> = createContext<IntentContext | undefined>(undefined);
15
16
 
16
17
  export const useIntentDispatcher = (): Pick<IntentContext, 'dispatch' | 'dispatchPromise'> => {
@@ -2,20 +2,20 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
7
6
  import React, { useCallback, useState } from 'react';
8
7
 
9
8
  import { faker } from '@dxos/random';
10
9
  import { Button, List, ListItem } from '@dxos/react-ui';
11
- import { withLayout, withTheme } from '@dxos/storybook-utils';
10
+ import { withTheme } from '@dxos/react-ui/testing';
12
11
 
13
- import { PluginManagerProvider, usePluginManager } from './PluginManagerProvider';
14
- import { Surface, useSurfaces } from './Surface';
15
12
  import { Capabilities, createSurface } from '../common';
16
13
  import { type PluginManager } from '../core';
17
14
  import { setupPluginManager } from '../testing';
18
15
 
16
+ import { PluginManagerProvider, usePluginManager } from './PluginManagerProvider';
17
+ import { Surface, useSurfaces } from './Surface';
18
+
19
19
  const randomColor = (): string => {
20
20
  const hue = faker.number.int({ min: 0, max: 360 });
21
21
  const saturation = faker.number.int({ min: 50, max: 90 });
@@ -23,7 +23,7 @@ const randomColor = (): string => {
23
23
  return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
24
24
  };
25
25
 
26
- const Story = () => {
26
+ const Component = () => {
27
27
  const manager = usePluginManager();
28
28
  const surfaces = useSurfaces();
29
29
  const [picked, setPicked] = useState('test');
@@ -77,20 +77,25 @@ const Story = () => {
77
77
  );
78
78
  };
79
79
 
80
- export default {
80
+ const DefaultStory = (props: { manager: PluginManager }) => {
81
+ return (
82
+ <PluginManagerProvider value={props.manager}>
83
+ <Component />
84
+ </PluginManagerProvider>
85
+ );
86
+ };
87
+
88
+ const meta = {
81
89
  title: 'sdk/app-framework/Surface',
82
- render: ({ manager }: { manager: PluginManager }) => {
83
- return (
84
- <PluginManagerProvider value={manager}>
85
- <Story />
86
- </PluginManagerProvider>
87
- );
88
- },
89
- // NOTE: Intentionally not using withPluginManager to try to reduce surface area of the story.
90
- decorators: [withTheme, withLayout()],
90
+ render: DefaultStory,
91
+ decorators: [withTheme],
91
92
  args: {
92
93
  manager: setupPluginManager(),
93
94
  },
94
- };
95
+ } satisfies Meta<typeof DefaultStory>;
96
+
97
+ export default meta;
98
+
99
+ type Story = StoryObj<typeof meta>;
95
100
 
96
- export const Default = {};
101
+ export const Default: Story = {};
@@ -2,16 +2,25 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import React, { memo, forwardRef, Suspense, useMemo, Fragment } from 'react';
5
+ import React, {
6
+ Fragment,
7
+ type NamedExoticComponent,
8
+ type RefAttributes,
9
+ Suspense,
10
+ forwardRef,
11
+ memo,
12
+ useMemo,
13
+ } from 'react';
6
14
 
7
15
  import { useDefaultValue } from '@dxos/react-hooks';
8
16
  import { byPosition } from '@dxos/util';
9
17
 
10
- import { ErrorBoundary } from './ErrorBoundary';
11
- import { useCapabilities } from './useCapabilities';
12
18
  import { Capabilities, type SurfaceDefinition, type SurfaceProps } from '../common';
13
19
  import { type PluginContext } from '../core';
14
20
 
21
+ import { ErrorBoundary } from './ErrorBoundary';
22
+ import { useCapabilities } from './useCapabilities';
23
+
15
24
  const DEFAULT_PLACEHOLDER = <Fragment />;
16
25
 
17
26
  /**
@@ -43,8 +52,8 @@ export const isSurfaceAvailable = (context: PluginContext, { role, data }: Pick<
43
52
  /**
44
53
  * A surface is a named region of the screen that can be populated by plugins.
45
54
  */
46
- export const Surface = memo(
47
- forwardRef<HTMLElement, SurfaceProps>(
55
+ export const Surface: NamedExoticComponent<SurfaceProps & RefAttributes<HTMLElement>> = memo(
56
+ forwardRef(
48
57
  ({ id: _id, role, data: _data, limit, fallback, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {
49
58
  // TODO(wittjosiah): This will make all surfaces depend on a single signal.
50
59
  // This isn't ideal because it means that any change to the data will cause all surfaces to re-render.
@@ -2,9 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useCapability } from './useCapabilities';
6
5
  import { Capabilities } from '../common';
7
6
 
7
+ import { useCapability } from './useCapabilities';
8
+
8
9
  export const useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);
9
10
 
10
11
  export const useAppGraph = () => useCapability(Capabilities.AppGraph);
@@ -6,9 +6,10 @@ import { useRxValue } from '@effect-rx/rx-react';
6
6
 
7
7
  import { invariant } from '@dxos/invariant';
8
8
 
9
- import { usePluginManager } from './PluginManagerProvider';
10
9
  import { type InterfaceDef } from '../core';
11
10
 
11
+ import { usePluginManager } from './PluginManagerProvider';
12
+
12
13
  /**
13
14
  * Hook to request capabilities from the plugin context.
14
15
  * @returns An array of capabilities.
@@ -2,15 +2,17 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
5
6
  import React from 'react';
6
7
 
7
- import { withTheme, type Meta } from '@dxos/storybook-utils';
8
+ import { withTheme } from '@dxos/react-ui/testing';
8
9
 
9
- import { withPluginManager } from './withPluginManager';
10
10
  import { Capabilities, createSurface } from '../common';
11
11
  import { contributes } from '../core';
12
12
  import { Surface } from '../react';
13
13
 
14
+ import { withPluginManager } from './withPluginManager';
15
+
14
16
  const DefaultStory = () => {
15
17
  console.log('Render');
16
18
  return (
@@ -21,7 +23,7 @@ const DefaultStory = () => {
21
23
  );
22
24
  };
23
25
 
24
- const meta: Meta = {
26
+ const meta = {
25
27
  title: 'sdk/app-framework/withPluginManager',
26
28
  render: DefaultStory,
27
29
  decorators: [
@@ -39,8 +41,10 @@ const meta: Meta = {
39
41
  ],
40
42
  }),
41
43
  ],
42
- };
44
+ } satisfies Meta<typeof DefaultStory>;
43
45
 
44
46
  export default meta;
45
47
 
46
- export const Default = {};
48
+ type Story = StoryObj<typeof meta>;
49
+
50
+ export const Default: Story = {};