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

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 (378) 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-PSA3RESL.mjs} +31 -30
  6. package/dist/lib/browser/app-graph-builder-PSA3RESL.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-2636QSIK.mjs → chunk-2VZ4RF4A.mjs} +347 -257
  8. package/dist/lib/browser/chunk-2VZ4RF4A.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-DHZB7HG7.mjs → chunk-CPVYIS24.mjs} +172 -134
  10. package/dist/lib/browser/chunk-CPVYIS24.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-ORWHM7CO.mjs → chunk-SCPE4ZO2.mjs} +11 -8
  12. package/dist/lib/browser/chunk-SCPE4ZO2.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-BND6IF4U.mjs} +2 -2
  16. package/dist/lib/browser/{intent-resolver-O67UANYP.mjs → intent-resolver-27FJAJDE.mjs} +7 -7
  17. package/dist/lib/browser/intent-resolver-27FJAJDE.mjs.map +7 -0
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/{store-LFKDWHUQ.mjs → store-F545UOIR.mjs} +4 -4
  20. package/dist/lib/browser/{store-LFKDWHUQ.mjs.map → store-F545UOIR.mjs.map} +2 -2
  21. package/dist/lib/browser/testing/index.mjs +17 -21
  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-VJGZ6KH7.mjs} +31 -30
  25. package/dist/lib/node-esm/app-graph-builder-VJGZ6KH7.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-VSKRV3NW.mjs → chunk-3RRWO5TD.mjs} +347 -257
  27. package/dist/lib/node-esm/chunk-3RRWO5TD.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-NJAFK626.mjs → chunk-MN37WUJ2.mjs} +172 -134
  29. package/dist/lib/node-esm/chunk-MN37WUJ2.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-UMZQERLE.mjs → chunk-ZX63QUGE.mjs} +11 -8
  31. package/dist/lib/node-esm/chunk-ZX63QUGE.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-254AZ6EE.mjs} +2 -2
  35. package/dist/lib/node-esm/{intent-resolver-K3D4BXQQ.mjs → intent-resolver-NPMOPNFL.mjs} +7 -7
  36. package/dist/lib/node-esm/intent-resolver-NPMOPNFL.mjs.map +7 -0
  37. package/dist/lib/node-esm/meta.json +1 -1
  38. package/dist/lib/node-esm/{store-53XDUBMD.mjs → store-CINC4R4L.mjs} +4 -4
  39. package/dist/lib/node-esm/{store-53XDUBMD.mjs.map → store-CINC4R4L.mjs.map} +2 -2
  40. package/dist/lib/node-esm/testing/index.mjs +17 -21
  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 +89 -10
  44. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  45. package/dist/types/src/common/collaboration.d.ts +10 -9
  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/file.d.ts +1 -1
  49. package/dist/types/src/common/file.d.ts.map +1 -1
  50. package/dist/types/src/common/layout.d.ts +1 -3
  51. package/dist/types/src/common/layout.d.ts.map +1 -1
  52. package/dist/types/src/common/surface.d.ts +7 -13
  53. package/dist/types/src/common/surface.d.ts.map +1 -1
  54. package/dist/types/src/common/translations.d.ts +1 -1
  55. package/dist/types/src/common/translations.d.ts.map +1 -1
  56. package/dist/types/src/components/App.d.ts +10 -0
  57. package/dist/types/src/components/App.d.ts.map +1 -0
  58. package/dist/types/src/components/App.stories.d.ts +14 -0
  59. package/dist/types/src/components/App.stories.d.ts.map +1 -0
  60. package/dist/types/src/components/DefaultFallback.d.ts +8 -0
  61. package/dist/types/src/components/DefaultFallback.d.ts.map +1 -0
  62. package/dist/types/src/components/index.d.ts +2 -0
  63. package/dist/types/src/components/index.d.ts.map +1 -0
  64. package/dist/types/src/{App.d.ts → components/useApp.d.ts} +7 -6
  65. package/dist/types/src/components/useApp.d.ts.map +1 -0
  66. package/dist/types/src/components/useLoading.d.ts +19 -0
  67. package/dist/types/src/components/useLoading.d.ts.map +1 -0
  68. package/dist/types/src/core/capabilities.d.ts +7 -4
  69. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  70. package/dist/types/src/core/manager.d.ts +6 -2
  71. package/dist/types/src/core/manager.d.ts.map +1 -1
  72. package/dist/types/src/core/plugin.d.ts +8 -1
  73. package/dist/types/src/core/plugin.d.ts.map +1 -1
  74. package/dist/types/src/index.d.ts +1 -1
  75. package/dist/types/src/index.d.ts.map +1 -1
  76. package/dist/types/src/playground/debug/Debug.d.ts +1 -1
  77. package/dist/types/src/playground/debug/plugin.d.ts +1 -1
  78. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
  79. package/dist/types/src/playground/generator/Main.d.ts +1 -1
  80. package/dist/types/src/playground/generator/Toolbar.d.ts +1 -1
  81. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  82. package/dist/types/src/playground/generator/generator.d.ts +1 -1
  83. package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
  84. package/dist/types/src/playground/generator/plugin.d.ts +1 -1
  85. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
  86. package/dist/types/src/playground/layout/Layout.d.ts +2 -2
  87. package/dist/types/src/playground/layout/plugin.d.ts +1 -1
  88. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
  89. package/dist/types/src/playground/logger/Toolbar.d.ts +1 -1
  90. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  91. package/dist/types/src/playground/logger/plugin.d.ts +1 -1
  92. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
  93. package/dist/types/src/playground/logger/schema.d.ts +1 -1
  94. package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
  95. package/dist/types/src/playground/playground.stories.d.ts +5 -4
  96. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  97. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +1 -1
  98. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
  99. package/dist/types/src/plugin-intent/actions.d.ts +5 -7
  100. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  101. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -1
  102. package/dist/types/src/plugin-intent/index.d.ts +1 -0
  103. package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
  104. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +7 -7
  105. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  106. package/dist/types/src/plugin-intent/intent.d.ts +1 -1
  107. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
  108. package/dist/types/src/plugin-intent/meta.d.ts +3 -0
  109. package/dist/types/src/plugin-intent/meta.d.ts.map +1 -0
  110. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +1 -1
  111. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
  112. package/dist/types/src/plugin-settings/actions.d.ts +5 -7
  113. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  114. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +1 -1
  115. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
  116. package/dist/types/src/plugin-settings/intent-resolver.d.ts +1 -1
  117. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -1
  118. package/dist/types/src/plugin-settings/meta.d.ts +3 -0
  119. package/dist/types/src/plugin-settings/meta.d.ts.map +1 -0
  120. package/dist/types/src/plugin-settings/store.d.ts +1 -1
  121. package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
  122. package/dist/types/src/plugin-settings/translations.d.ts +2 -1
  123. package/dist/types/src/plugin-settings/translations.d.ts.map +1 -1
  124. package/dist/types/src/react/ErrorBoundary.d.ts +13 -14
  125. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
  126. package/dist/types/src/react/IntentContext.d.ts.map +1 -1
  127. package/dist/types/src/react/Surface.d.ts +2 -2
  128. package/dist/types/src/react/Surface.d.ts.map +1 -1
  129. package/dist/types/src/react/Surface.stories.d.ts +6 -5
  130. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  131. package/dist/types/src/react/common.d.ts.map +1 -1
  132. package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
  133. package/dist/types/src/testing/withPluginManager.d.ts +9 -8
  134. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  135. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  136. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  137. package/dist/types/tsconfig.tsbuildinfo +1 -1
  138. package/moon.yml +4 -0
  139. package/package.json +34 -29
  140. package/src/common/capabilities.ts +117 -13
  141. package/src/common/collaboration.ts +6 -9
  142. package/src/common/events.ts +3 -1
  143. package/src/common/file.ts +1 -1
  144. package/src/common/layout.ts +3 -4
  145. package/src/common/surface.ts +15 -18
  146. package/src/common/translations.ts +1 -1
  147. package/src/components/App.stories.tsx +33 -0
  148. package/src/components/App.tsx +59 -0
  149. package/src/components/DefaultFallback.tsx +26 -0
  150. package/src/components/index.ts +5 -0
  151. package/src/{App.tsx → components/useApp.tsx} +24 -136
  152. package/src/components/useLoading.tsx +70 -0
  153. package/src/core/capabilities.test.ts +2 -2
  154. package/src/core/capabilities.ts +18 -9
  155. package/src/core/manager.test.ts +22 -21
  156. package/src/core/manager.ts +139 -54
  157. package/src/core/plugin.ts +13 -2
  158. package/src/helpers.test.ts +1 -1
  159. package/src/index.ts +1 -1
  160. package/src/playground/debug/Debug.tsx +1 -1
  161. package/src/playground/debug/plugin.ts +7 -8
  162. package/src/playground/generator/Toolbar.tsx +2 -1
  163. package/src/playground/generator/generator.ts +4 -4
  164. package/src/playground/generator/plugin.ts +12 -13
  165. package/src/playground/layout/plugin.ts +10 -9
  166. package/src/playground/logger/Toolbar.tsx +2 -1
  167. package/src/playground/logger/plugin.ts +30 -25
  168. package/src/playground/logger/schema.ts +1 -1
  169. package/src/playground/playground.stories.tsx +20 -16
  170. package/src/plugin-intent/IntentPlugin.ts +13 -13
  171. package/src/plugin-intent/actions.ts +4 -6
  172. package/src/plugin-intent/errors.ts +2 -1
  173. package/src/plugin-intent/index.ts +1 -0
  174. package/src/plugin-intent/intent-dispatcher.test.ts +10 -3
  175. package/src/plugin-intent/intent-dispatcher.ts +16 -12
  176. package/src/plugin-intent/intent.ts +1 -1
  177. package/src/plugin-intent/meta.ts +10 -0
  178. package/src/plugin-settings/SettingsPlugin.ts +27 -28
  179. package/src/plugin-settings/actions.ts +9 -13
  180. package/src/plugin-settings/app-graph-builder.ts +20 -17
  181. package/src/plugin-settings/intent-resolver.ts +5 -4
  182. package/src/plugin-settings/meta.ts +10 -0
  183. package/src/plugin-settings/store.ts +1 -1
  184. package/src/plugin-settings/translations.ts +3 -3
  185. package/src/react/ErrorBoundary.tsx +26 -15
  186. package/src/react/IntentContext.tsx +3 -2
  187. package/src/react/Surface.stories.tsx +23 -18
  188. package/src/react/Surface.tsx +14 -5
  189. package/src/react/common.ts +2 -1
  190. package/src/react/useCapabilities.ts +2 -1
  191. package/src/testing/withPluginManager.stories.tsx +9 -5
  192. package/src/testing/withPluginManager.tsx +33 -32
  193. package/tsconfig.json +6 -10
  194. package/vitest.config.ts +8 -6
  195. package/.eslintrc.cjs +0 -9
  196. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  197. package/dist/lib/browser/app-graph-builder-BGGXLD6T.mjs.map +0 -7
  198. package/dist/lib/browser/chunk-2636QSIK.mjs.map +0 -7
  199. package/dist/lib/browser/chunk-DHZB7HG7.mjs.map +0 -7
  200. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  201. package/dist/lib/browser/intent-resolver-O67UANYP.mjs.map +0 -7
  202. package/dist/lib/node-esm/app-graph-builder-QHIJUYYW.mjs.map +0 -7
  203. package/dist/lib/node-esm/chunk-NJAFK626.mjs.map +0 -7
  204. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  205. package/dist/lib/node-esm/chunk-VSKRV3NW.mjs.map +0 -7
  206. package/dist/lib/node-esm/intent-resolver-K3D4BXQQ.mjs.map +0 -7
  207. package/dist/types/src/App.d.ts.map +0 -1
  208. package/typedoc/.nojekyll +0 -1
  209. package/typedoc/assets/hierarchy.js +0 -1
  210. package/typedoc/assets/highlight.css +0 -106
  211. package/typedoc/assets/icons.js +0 -18
  212. package/typedoc/assets/icons.svg +0 -1
  213. package/typedoc/assets/main.js +0 -60
  214. package/typedoc/assets/navigation.js +0 -1
  215. package/typedoc/assets/search.js +0 -1
  216. package/typedoc/assets/style.css +0 -1640
  217. package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
  218. package/typedoc/classes/ErrorBoundary.html +0 -125
  219. package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
  220. package/typedoc/classes/IntentAction.Track.html +0 -266
  221. package/typedoc/classes/LayoutAction.AddToast.html +0 -265
  222. package/typedoc/classes/LayoutAction.Close.html +0 -382
  223. package/typedoc/classes/LayoutAction.Expose.html +0 -265
  224. package/typedoc/classes/LayoutAction.Open.html +0 -1123
  225. package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
  226. package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
  227. package/typedoc/classes/LayoutAction.Set.html +0 -460
  228. package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -499
  229. package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
  230. package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
  231. package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -1123
  232. package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
  233. package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
  234. package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -616
  235. package/typedoc/classes/Plugin.html +0 -6
  236. package/typedoc/classes/PluginContext.html +0 -38
  237. package/typedoc/classes/PluginManager.html +0 -43
  238. package/typedoc/classes/PluginModule.html +0 -18
  239. package/typedoc/classes/SettingsAction.Open.html +0 -226
  240. package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
  241. package/typedoc/functions/Events.createStateEvent.html +0 -2
  242. package/typedoc/functions/IntentPlugin.html +0 -1
  243. package/typedoc/functions/SettingsPlugin.html +0 -1
  244. package/typedoc/functions/allOf.html +0 -2
  245. package/typedoc/functions/chain.html +0 -3
  246. package/typedoc/functions/contributes.html +0 -2
  247. package/typedoc/functions/createDispatcher.html +0 -3
  248. package/typedoc/functions/createIntent.html +0 -6
  249. package/typedoc/functions/createResolver.html +0 -2
  250. package/typedoc/functions/createSurface.html +0 -2
  251. package/typedoc/functions/defineCapability.html +0 -2
  252. package/typedoc/functions/defineEvent.html +0 -2
  253. package/typedoc/functions/defineModule.html +0 -2
  254. package/typedoc/functions/definePlugin.html +0 -2
  255. package/typedoc/functions/eventKey.html +0 -2
  256. package/typedoc/functions/getEvents.html +0 -2
  257. package/typedoc/functions/isAllOf.html +0 -2
  258. package/typedoc/functions/isOneOf.html +0 -2
  259. package/typedoc/functions/isSurfaceAvailable.html +0 -2
  260. package/typedoc/functions/lazy.html +0 -2
  261. package/typedoc/functions/oneOf.html +0 -2
  262. package/typedoc/functions/useApp.html +0 -6
  263. package/typedoc/functions/useAppGraph.html +0 -1
  264. package/typedoc/functions/useCapabilities.html +0 -3
  265. package/typedoc/functions/useCapability.html +0 -4
  266. package/typedoc/functions/useIntentDispatcher.html +0 -1
  267. package/typedoc/functions/useIntentResolver.html +0 -1
  268. package/typedoc/functions/useLayout.html +0 -1
  269. package/typedoc/functions/usePluginManager.html +0 -2
  270. package/typedoc/hierarchy.html +0 -1
  271. package/typedoc/index.html +0 -12
  272. package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
  273. package/typedoc/media/LICENSE +0 -8
  274. package/typedoc/modules/Capabilities.html +0 -1
  275. package/typedoc/modules/CollaborationActions.html +0 -1
  276. package/typedoc/modules/Events.html +0 -1
  277. package/typedoc/modules/IntentAction.html +0 -1
  278. package/typedoc/modules/LayoutAction.html +0 -2
  279. package/typedoc/modules/SettingsAction.html +0 -1
  280. package/typedoc/modules.html +0 -1
  281. package/typedoc/types/ActivationEvent.html +0 -8
  282. package/typedoc/types/ActivationEvents.html +0 -2
  283. package/typedoc/types/AnyCapability.html +0 -1
  284. package/typedoc/types/AnyIntent.html +0 -1
  285. package/typedoc/types/AnyIntentChain.html +0 -1
  286. package/typedoc/types/AnyIntentEffectResult.html +0 -1
  287. package/typedoc/types/AnyIntentResolver.html +0 -1
  288. package/typedoc/types/AnyIntentResult.html +0 -1
  289. package/typedoc/types/Capabilities.FileUploader.html +0 -1
  290. package/typedoc/types/Capabilities.IntentResolver.html +0 -1
  291. package/typedoc/types/Capabilities.Layout.html +0 -1
  292. package/typedoc/types/Capabilities.Metadata.html +0 -1
  293. package/typedoc/types/Capabilities.ReactContext.html +0 -1
  294. package/typedoc/types/Capabilities.ReactRoot.html +0 -1
  295. package/typedoc/types/Capabilities.ReactSurface.html +0 -1
  296. package/typedoc/types/Capabilities.Settings.html +0 -4
  297. package/typedoc/types/Capability.html +0 -9
  298. package/typedoc/types/CreateAppOptions.html +0 -10
  299. package/typedoc/types/FileInfo.html +0 -1
  300. package/typedoc/types/Intent.html +0 -10
  301. package/typedoc/types/IntentChain.html +0 -6
  302. package/typedoc/types/IntentContext.html +0 -5
  303. package/typedoc/types/IntentData.html +0 -1
  304. package/typedoc/types/IntentDispatcher.html +0 -2
  305. package/typedoc/types/IntentDispatcherResult.html +0 -2
  306. package/typedoc/types/IntentEffectDefinition.html +0 -2
  307. package/typedoc/types/IntentEffectResult.html +0 -15
  308. package/typedoc/types/IntentParams.html +0 -3
  309. package/typedoc/types/IntentResolver.html +0 -2
  310. package/typedoc/types/IntentResultData.html +0 -1
  311. package/typedoc/types/IntentSchema.html +0 -1
  312. package/typedoc/types/IntentUndo.html +0 -2
  313. package/typedoc/types/InterfaceDef.html +0 -4
  314. package/typedoc/types/Label.html +0 -1
  315. package/typedoc/types/NodeSerializer.html +0 -8
  316. package/typedoc/types/PluginManagerOptions.html +0 -6
  317. package/typedoc/types/PluginMeta.html +0 -21
  318. package/typedoc/types/PromiseIntentDispatcher.html +0 -2
  319. package/typedoc/types/PromiseIntentUndo.html +0 -2
  320. package/typedoc/types/Resource.html +0 -1
  321. package/typedoc/types/ResourceKey.html +0 -1
  322. package/typedoc/types/ResourceLanguage.html +0 -1
  323. package/typedoc/types/SerializedNode.html +0 -4
  324. package/typedoc/types/SurfaceComponent.html +0 -2
  325. package/typedoc/types/SurfaceDefinition.html +0 -2
  326. package/typedoc/types/SurfaceProps.html +0 -4
  327. package/typedoc/variables/Capabilities.AnchorSort.html +0 -1
  328. package/typedoc/variables/Capabilities.AppGraph.html +0 -1
  329. package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
  330. package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
  331. package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
  332. package/typedoc/variables/Capabilities.FileUploader.html +0 -1
  333. package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
  334. package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
  335. package/typedoc/variables/Capabilities.Layout.html +0 -1
  336. package/typedoc/variables/Capabilities.Metadata.html +0 -1
  337. package/typedoc/variables/Capabilities.Null.html +0 -1
  338. package/typedoc/variables/Capabilities.PluginManager.html +0 -1
  339. package/typedoc/variables/Capabilities.ReactContext.html +0 -1
  340. package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
  341. package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
  342. package/typedoc/variables/Capabilities.RxRegistry.html +0 -1
  343. package/typedoc/variables/Capabilities.Settings.html +0 -1
  344. package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
  345. package/typedoc/variables/Capabilities.Tools.html +0 -1
  346. package/typedoc/variables/Capabilities.Translations.html +0 -1
  347. package/typedoc/variables/Events.AppGraphReady.html +0 -2
  348. package/typedoc/variables/Events.DispatcherReady.html +0 -2
  349. package/typedoc/variables/Events.LayoutReady.html +0 -1
  350. package/typedoc/variables/Events.SettingsReady.html +0 -2
  351. package/typedoc/variables/Events.SetupAppGraph.html +0 -2
  352. package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
  353. package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
  354. package/typedoc/variables/Events.SetupMetadata.html +0 -2
  355. package/typedoc/variables/Events.SetupReactSurface.html +0 -2
  356. package/typedoc/variables/Events.SetupSettings.html +0 -2
  357. package/typedoc/variables/Events.SetupTranslations.html +0 -2
  358. package/typedoc/variables/Events.Startup.html +0 -2
  359. package/typedoc/variables/FileInfoSchema.html +0 -1
  360. package/typedoc/variables/INTENT_ACTION.html +0 -1
  361. package/typedoc/variables/INTENT_PLUGIN.html +0 -1
  362. package/typedoc/variables/LAYOUT_ACTION.html +0 -1
  363. package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
  364. package/typedoc/variables/Label.html +0 -1
  365. package/typedoc/variables/LayoutAction.Toast.html +0 -1
  366. package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
  367. package/typedoc/variables/PluginManagerProvider.html +0 -2
  368. package/typedoc/variables/Resource.html +0 -2
  369. package/typedoc/variables/ResourceKey.html +0 -1
  370. package/typedoc/variables/ResourceLanguage.html +0 -1
  371. package/typedoc/variables/SETTINGS_ACTION.html +0 -1
  372. package/typedoc/variables/SETTINGS_ID.html +0 -1
  373. package/typedoc/variables/SETTINGS_KEY.html +0 -1
  374. package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
  375. package/typedoc/variables/Surface.html +0 -2
  376. package/typedoc/variables/defaultFileTypes.html +0 -1
  377. /package/dist/lib/browser/{intent-dispatcher-TWKB22NI.mjs.map → intent-dispatcher-BND6IF4U.mjs.map} +0 -0
  378. /package/dist/lib/node-esm/{intent-dispatcher-5PRM3KGH.mjs.map → intent-dispatcher-254AZ6EE.mjs.map} +0 -0
@@ -4,20 +4,22 @@
4
4
 
5
5
  import { RegistryContext } from '@effect-rx/rx-react';
6
6
  import { effect } from '@preact/signals-core';
7
- import React, { useCallback, useEffect, useMemo, useState, type FC, type PropsWithChildren } from 'react';
7
+ import React, { type FC, useCallback, useEffect, useMemo } from 'react';
8
8
 
9
9
  import { invariant } from '@dxos/invariant';
10
10
  import { live } from '@dxos/live-object';
11
- import { useDefaultValue } from '@dxos/react-hooks';
11
+ import { useAsyncEffect, useDefaultValue } from '@dxos/react-hooks';
12
12
 
13
- import { Capabilities, Events } from './common';
14
- import { PluginManager, type PluginManagerOptions, type Plugin } from './core';
15
- import { topologicalSort } from './helpers';
16
- import { ErrorBoundary, PluginManagerProvider, useCapabilities } from './react';
13
+ import { Capabilities, Events } from '../common';
14
+ import { type Plugin, PluginManager, type PluginManagerOptions } from '../core';
15
+ import { ErrorBoundary, PluginManagerProvider } from '../react';
16
+
17
+ import { App } from './App';
18
+ import { DefaultFallback } from './DefaultFallback';
17
19
 
18
20
  const ENABLED_KEY = 'dxos.org/app-framework/enabled';
19
21
 
20
- export type CreateAppOptions = {
22
+ export type UseAppOptions = {
21
23
  pluginManager?: PluginManager;
22
24
  pluginLoader?: PluginManagerOptions['pluginLoader'];
23
25
  plugins?: Plugin[];
@@ -27,6 +29,7 @@ export type CreateAppOptions = {
27
29
  fallback?: ErrorBoundary['props']['fallback'];
28
30
  cacheEnabled?: boolean;
29
31
  safeMode?: boolean;
32
+ debounce?: number;
30
33
  };
31
34
 
32
35
  /**
@@ -38,7 +41,7 @@ export type CreateAppOptions = {
38
41
  * const core = [LayoutPluginId];
39
42
  * const default = [MyPluginId];
40
43
  * const fallback = <div>Initializing Plugins...</div>;
41
- * const App = createApp({ plugins, core, default, fallback });
44
+ * const App = useApp({ plugins, core, default, fallback });
42
45
  * createRoot(document.getElementById('root')!).render(
43
46
  * <StrictMode>
44
47
  * <App />
@@ -64,7 +67,8 @@ export const useApp = ({
64
67
  fallback = DefaultFallback,
65
68
  cacheEnabled = false,
66
69
  safeMode = false,
67
- }: CreateAppOptions) => {
70
+ debounce = 0,
71
+ }: UseAppOptions) => {
68
72
  const plugins = useDefaultValue(_plugins, () => []);
69
73
  const core = useDefaultValue(_core, () => plugins.map(({ meta }) => meta.id));
70
74
  const defaults = useDefaultValue(_defaults, () => []);
@@ -112,6 +116,10 @@ export const useApp = ({
112
116
  }, [cacheEnabled, manager]);
113
117
 
114
118
  useEffect(() => {
119
+ setupDevtools(manager);
120
+ }, [manager]);
121
+
122
+ useAsyncEffect(async () => {
115
123
  manager.context.contributeCapability({
116
124
  interface: Capabilities.PluginManager,
117
125
  implementation: manager,
@@ -124,34 +132,24 @@ export const useApp = ({
124
132
  module: 'dxos.org/app-framework/rx-registry',
125
133
  });
126
134
 
135
+ await Promise.all([
136
+ // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
137
+ manager.activate(Events.SetupReactSurface),
138
+ manager.activate(Events.Startup),
139
+ ]);
140
+
127
141
  return () => {
128
142
  manager.context.removeCapability(Capabilities.PluginManager, manager);
129
143
  manager.context.removeCapability(Capabilities.RxRegistry, manager.registry);
130
144
  };
131
145
  }, [manager]);
132
146
 
133
- useEffect(() => {
134
- setupDevtools(manager);
135
- }, [manager]);
136
-
137
- useEffect(() => {
138
- const timeout = setTimeout(async () => {
139
- await Promise.all([
140
- // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
141
- manager.activate(Events.SetupReactSurface),
142
- manager.activate(Events.Startup),
143
- ]);
144
- });
145
-
146
- return () => clearTimeout(timeout);
147
- }, [manager]);
148
-
149
147
  return useCallback(
150
148
  () => (
151
149
  <ErrorBoundary fallback={fallback}>
152
150
  <PluginManagerProvider value={manager}>
153
151
  <RegistryContext.Provider value={manager.registry}>
154
- <App placeholder={placeholder} state={state} />
152
+ <App placeholder={placeholder} state={state} debounce={debounce} />
155
153
  </RegistryContext.Provider>
156
154
  </PluginManagerProvider>
157
155
  </ErrorBoundary>
@@ -160,116 +158,6 @@ export const useApp = ({
160
158
  );
161
159
  };
162
160
 
163
- const DELAY_PLACEHOLDER = 2_000;
164
-
165
- enum LoadingState {
166
- Loading = 0,
167
- FadeIn = 1,
168
- FadeOut = 2,
169
- Done = 3,
170
- }
171
-
172
- /**
173
- * To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
174
- * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
175
- *
176
- * States:
177
- * 0: Loading - Wait for a period of time before starting the loading animation.
178
- * 1: Fade-in - Display a loading animation.
179
- * 2: Fade-out - Fade out the loading animation.
180
- * 3: Done - Remove the placeholder.
181
- */
182
- const useLoading = (state: AppProps['state']) => {
183
- const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);
184
- useEffect(() => {
185
- const i = setInterval(() => {
186
- setStage((tick) => {
187
- switch (tick) {
188
- case LoadingState.Loading:
189
- if (!state.ready) {
190
- return LoadingState.FadeIn;
191
- } else {
192
- clearInterval(i);
193
- return LoadingState.Done;
194
- }
195
- case LoadingState.FadeIn:
196
- if (state.ready) {
197
- return LoadingState.FadeOut;
198
- }
199
- break;
200
- case LoadingState.FadeOut:
201
- clearInterval(i);
202
- return LoadingState.Done;
203
- }
204
-
205
- return tick;
206
- });
207
- }, DELAY_PLACEHOLDER);
208
-
209
- return () => clearInterval(i);
210
- }, []);
211
-
212
- return stage;
213
- };
214
-
215
- type AppProps = Pick<CreateAppOptions, 'placeholder'> & {
216
- state: { ready: boolean; error: unknown };
217
- };
218
-
219
- const App = ({ placeholder: Placeholder, state }: AppProps) => {
220
- const reactContexts = useCapabilities(Capabilities.ReactContext);
221
- const reactRoots = useCapabilities(Capabilities.ReactRoot);
222
- const stage = useLoading(state);
223
-
224
- if (state.error) {
225
- // This triggers the error boundary to provide UI feedback for the startup error.
226
- throw state.error;
227
- }
228
-
229
- // TODO(wittjosiah): Consider using Suspense instead?
230
- if (stage < LoadingState.Done) {
231
- if (!Placeholder) {
232
- return null;
233
- }
234
-
235
- return <Placeholder stage={stage} />;
236
- }
237
-
238
- const ComposedContext = composeContexts(reactContexts);
239
- return (
240
- <ComposedContext>
241
- {reactRoots.map(({ id, root: Component }) => (
242
- <Component key={id} />
243
- ))}
244
- </ComposedContext>
245
- );
246
- };
247
-
248
- // Default fallback does not use tailwind or theme.
249
- const DefaultFallback = ({ error }: { error: Error }) => {
250
- return (
251
- <div style={{ margin: '0.5rem', padding: '1rem', overflow: 'hidden', border: '1px solid red' }}>
252
- {/* TODO(wittjosiah): Link to docs for replacing default. */}
253
- <h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>[ERROR]: {error.message}</h1>
254
- <pre style={{ overflow: 'auto', fontSize: '1rem' }}>{error.stack}</pre>
255
- </div>
256
- );
257
- };
258
-
259
- const composeContexts = (contexts: Capabilities.ReactContext[]) => {
260
- if (contexts.length === 0) {
261
- return ({ children }: PropsWithChildren) => <>{children}</>;
262
- }
263
-
264
- return topologicalSort(contexts)
265
- .map(({ context }) => context)
266
- .reduce((Acc, Next) => ({ children }) => (
267
- <Acc>
268
- <Next>{children}</Next>
269
- </Acc>
270
- ));
271
- };
272
-
273
161
  const setupDevtools = (manager: PluginManager) => {
274
162
  (globalThis as any).composer ??= {};
275
163
  (globalThis as any).composer.manager = manager;
@@ -0,0 +1,70 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useEffect, useState } from 'react';
6
+
7
+ import { type AppProps } from './App';
8
+
9
+ export enum LoadingState {
10
+ Loading = 0,
11
+ FadeIn = 1,
12
+ FadeOut = 2,
13
+ Done = 3,
14
+ }
15
+
16
+ /**
17
+ * To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
18
+ * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
19
+ *
20
+ * States:
21
+ * 0: Loading - Wait for a period of time before starting the loading animation.
22
+ * 1: Fade-in - Display a loading animation.
23
+ * 2: Fade-out - Fade out the loading animation.
24
+ * 3: Done - Remove the placeholder.
25
+ */
26
+ export const useLoading = (state: AppProps['state'], debounce = 0) => {
27
+ const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);
28
+ useEffect(() => {
29
+ if (!debounce) {
30
+ return;
31
+ }
32
+
33
+ const i = setInterval(() => {
34
+ setStage((stage) => {
35
+ switch (stage) {
36
+ case LoadingState.Loading: {
37
+ if (!state.ready) {
38
+ return LoadingState.FadeIn;
39
+ } else {
40
+ clearInterval(i);
41
+ return LoadingState.Done;
42
+ }
43
+ }
44
+
45
+ case LoadingState.FadeIn: {
46
+ if (state.ready) {
47
+ return LoadingState.FadeOut;
48
+ }
49
+ break;
50
+ }
51
+
52
+ case LoadingState.FadeOut: {
53
+ clearInterval(i);
54
+ return LoadingState.Done;
55
+ }
56
+ }
57
+
58
+ return stage;
59
+ });
60
+ }, debounce);
61
+
62
+ return () => clearInterval(i);
63
+ }, [debounce]);
64
+
65
+ if (!debounce) {
66
+ return state.ready ? LoadingState.Done : LoadingState.Loading;
67
+ }
68
+
69
+ return stage;
70
+ };
@@ -3,10 +3,10 @@
3
3
  //
4
4
 
5
5
  import { Registry } from '@effect-rx/rx-react';
6
- import { Effect } from 'effect';
6
+ import * as Effect from 'effect/Effect';
7
7
  import { describe, expect, it, onTestFinished } from 'vitest';
8
8
 
9
- import { defineCapability, PluginContext } from './capabilities';
9
+ import { PluginContext, defineCapability } from './capabilities';
10
10
 
11
11
  const defaultOptions = {
12
12
  activate: () => Effect.succeed(false),
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { type Registry, Rx } from '@effect-rx/rx-react';
6
- import { Effect } from 'effect';
6
+ import * as Effect from 'effect/Effect';
7
7
 
8
8
  import { Trigger } from '@dxos/async';
9
9
  import { invariant } from '@dxos/invariant';
@@ -22,6 +22,10 @@ export type InterfaceDef<T> = {
22
22
  identifier: string;
23
23
  };
24
24
 
25
+ export namespace InterfaceDef {
26
+ export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
27
+ }
28
+
25
29
  /**
26
30
  * Helper to define the interface of a capability.
27
31
  */
@@ -37,12 +41,12 @@ export type Capability<T> = {
37
41
  /**
38
42
  * The interface definition of the capability.
39
43
  */
40
- interface: InterfaceDef<T>;
44
+ readonly interface: InterfaceDef<T>;
41
45
 
42
46
  /**
43
47
  * The implementation of the capability.
44
48
  */
45
- implementation: T;
49
+ readonly implementation: T;
46
50
 
47
51
  /**
48
52
  * Called when the capability is deactivated.
@@ -69,16 +73,21 @@ class CapabilityImpl<T> {
69
73
  /**
70
74
  * Helper to define the implementation of a capability.
71
75
  */
72
- export const contributes = <T>(
73
- interfaceDef: Capability<T>['interface'],
74
- implementation: Capability<T>['implementation'],
75
- deactivate?: Capability<T>['deactivate'],
76
- ): Capability<T> => {
77
- return { interface: interfaceDef, implementation, deactivate } satisfies Capability<T>;
76
+ export const contributes = <I extends InterfaceDef<any>, T = InterfaceDef.Implementation<I>>(
77
+ interfaceDef: I,
78
+ implementation: T,
79
+ deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],
80
+ ): Capability<I> => {
81
+ return {
82
+ interface: interfaceDef,
83
+ implementation: implementation as any, // NOTE: Added to allow providing readonly implementation.
84
+ deactivate,
85
+ } satisfies Capability<I>;
78
86
  };
79
87
 
80
88
  type LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;
81
89
  type LoadCapabilities<T> = () => Promise<{ default: (props: T) => MaybePromise<AnyCapability[]> }>;
90
+
82
91
  // TODO(wittjosiah): Not having the array be `any` causes type errors when using the lazy capability.
83
92
  type LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;
84
93
 
@@ -7,16 +7,17 @@ import { afterEach, describe, expect, it } from 'vitest';
7
7
 
8
8
  import { Trigger } from '@dxos/async';
9
9
  import { raise } from '@dxos/debug';
10
- import { updateCounter } from '@dxos/echo-schema/testing';
10
+ import { updateCounter } from '@dxos/echo/testing';
11
11
  import { registerSignalsRuntime } from '@dxos/echo-signals';
12
12
  import { invariant } from '@dxos/invariant';
13
13
  import { live } from '@dxos/live-object';
14
14
 
15
- import { contributes, defineCapability, type PluginContext } from './capabilities';
15
+ import { Events } from '../common';
16
+
17
+ import { type PluginContext, contributes, defineCapability } from './capabilities';
16
18
  import { allOf, defineEvent, oneOf } from './events';
17
19
  import { PluginManager } from './manager';
18
- import { definePlugin, defineModule, type Plugin } from './plugin';
19
- import { Events } from '../common';
20
+ import { Plugin, defineModule } from './plugin';
20
21
 
21
22
  registerSignalsRuntime();
22
23
 
@@ -42,7 +43,7 @@ describe('PluginManager', () => {
42
43
  });
43
44
 
44
45
  it('should be able to add and remove plugins', async () => {
45
- const Test = definePlugin(testMeta, []);
46
+ const Test = new Plugin(testMeta, []);
46
47
  plugins = [Test];
47
48
 
48
49
  const manager = new PluginManager({ pluginLoader });
@@ -58,7 +59,7 @@ describe('PluginManager', () => {
58
59
  activatesOn: Events.Startup,
59
60
  activate: () => contributes(String, { string: 'hello' }),
60
61
  });
61
- const Test = definePlugin(testMeta, [Hello]);
62
+ const Test = new Plugin(testMeta, [Hello]);
62
63
 
63
64
  const manager = new PluginManager({ plugins: [Test], core: [], pluginLoader });
64
65
  await manager.enable(testMeta.id);
@@ -75,7 +76,7 @@ describe('PluginManager', () => {
75
76
  activatesOn: Events.Startup,
76
77
  activate: () => contributes(String, { string: 'hello' }),
77
78
  });
78
- const Test = definePlugin(testMeta, [Hello]);
79
+ const Test = new Plugin(testMeta, [Hello]);
79
80
 
80
81
  const manager = new PluginManager({ plugins: [Test], enabled: [Test.meta.id], pluginLoader });
81
82
  expect(manager.plugins).toEqual([Test]);
@@ -94,7 +95,7 @@ describe('PluginManager', () => {
94
95
  activatesOn: FailEvent,
95
96
  activate: async () => raise(new Error('test')),
96
97
  });
97
- plugins = [definePlugin(testMeta, [Fail])];
98
+ plugins = [new Plugin(testMeta, [Fail])];
98
99
 
99
100
  const manager = new PluginManager({ pluginLoader });
100
101
  await manager.add(testMeta.id);
@@ -113,7 +114,7 @@ describe('PluginManager', () => {
113
114
  // TODO(wittjosiah): Test and catch more failure modes.
114
115
  activate: async () => async () => raise(new Error('test')),
115
116
  });
116
- plugins = [definePlugin(testMeta, [Hello, Fail])];
117
+ plugins = [new Plugin(testMeta, [Hello, Fail])];
117
118
 
118
119
  const manager = new PluginManager({ pluginLoader });
119
120
  const activating = new Trigger<boolean>();
@@ -148,7 +149,7 @@ describe('PluginManager', () => {
148
149
  return contributes(String, { string: 'hello' });
149
150
  },
150
151
  });
151
- plugins = [definePlugin(testMeta, [Hello])];
152
+ plugins = [new Plugin(testMeta, [Hello])];
152
153
 
153
154
  const manager = new PluginManager({ pluginLoader });
154
155
 
@@ -179,21 +180,21 @@ describe('PluginManager', () => {
179
180
  });
180
181
 
181
182
  it('should be able to fire custom activation events', async () => {
182
- const Plugin1 = definePlugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
183
+ const Plugin1 = new Plugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
183
184
  defineModule({
184
185
  id: 'dxos.org/test/plugin-1',
185
186
  activatesOn: CountEvent,
186
187
  activate: () => [contributes(Number, { number: 1 })],
187
188
  }),
188
189
  ]);
189
- const Plugin2 = definePlugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
190
+ const Plugin2 = new Plugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
190
191
  defineModule({
191
192
  id: 'dxos.org/test/plugin-2',
192
193
  activatesOn: CountEvent,
193
194
  activate: () => [contributes(Number, { number: 2 })],
194
195
  }),
195
196
  ]);
196
- const Plugin3 = definePlugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
197
+ const Plugin3 = new Plugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
197
198
  defineModule({
198
199
  id: 'dxos.org/test/plugin-3',
199
200
  activatesOn: CountEvent,
@@ -230,7 +231,7 @@ describe('PluginManager', () => {
230
231
  return contributes(String, { string: 'hello' });
231
232
  },
232
233
  });
233
- plugins = [definePlugin(testMeta, [Hello])];
234
+ plugins = [new Plugin(testMeta, [Hello])];
234
235
 
235
236
  const manager = new PluginManager({ pluginLoader });
236
237
  expect(manager.active).toEqual([]);
@@ -256,7 +257,7 @@ describe('PluginManager', () => {
256
257
  return contributes(String, { string: 'hello' });
257
258
  },
258
259
  });
259
- plugins = [definePlugin(testMeta, [Hello])];
260
+ plugins = [new Plugin(testMeta, [Hello])];
260
261
 
261
262
  const manager = new PluginManager({ pluginLoader });
262
263
  expect(manager.active).toEqual([]);
@@ -282,7 +283,7 @@ describe('PluginManager', () => {
282
283
  state.total = numbers.reduce((acc, n) => acc + n.number, 0);
283
284
  };
284
285
 
285
- const Count = definePlugin({ id: 'dxos.org/test/count', name: 'Count' }, [
286
+ const Count = new Plugin({ id: 'dxos.org/test/count', name: 'Count' }, [
286
287
  defineModule({
287
288
  id: 'dxos.org/test/count',
288
289
  activatesOn: Events.Startup,
@@ -294,7 +295,7 @@ describe('PluginManager', () => {
294
295
  }),
295
296
  ]);
296
297
 
297
- const Test = definePlugin(testMeta, [
298
+ const Test = new Plugin(testMeta, [
298
299
  defineModule({
299
300
  id: 'dxos.org/test/plugin-1',
300
301
  activatesOn: CountEvent,
@@ -352,7 +353,7 @@ describe('PluginManager', () => {
352
353
  const id = 'dxos.org/test/counter';
353
354
  const stateEvent = Events.createStateEvent(id);
354
355
 
355
- const Test = definePlugin(testMeta, [
356
+ const Test = new Plugin(testMeta, [
356
357
  defineModule({
357
358
  id,
358
359
  activatesOn: Events.Startup,
@@ -389,21 +390,21 @@ describe('PluginManager', () => {
389
390
  });
390
391
 
391
392
  it('should be reactive', async () => {
392
- const Plugin1 = definePlugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
393
+ const Plugin1 = new Plugin({ id: 'dxos.org/test/plugin-1', name: 'Plugin 1' }, [
393
394
  defineModule({
394
395
  id: 'dxos.org/test/plugin-1',
395
396
  activatesOn: CountEvent,
396
397
  activate: () => [contributes(Number, { number: 1 })],
397
398
  }),
398
399
  ]);
399
- const Plugin2 = definePlugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
400
+ const Plugin2 = new Plugin({ id: 'dxos.org/test/plugin-2', name: 'Plugin 2' }, [
400
401
  defineModule({
401
402
  id: 'dxos.org/test/plugin-2',
402
403
  activatesOn: CountEvent,
403
404
  activate: () => [contributes(Number, { number: 2 })],
404
405
  }),
405
406
  ]);
406
- const Plugin3 = definePlugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
407
+ const Plugin3 = new Plugin({ id: 'dxos.org/test/plugin-3', name: 'Plugin 3' }, [
407
408
  defineModule({
408
409
  id: 'dxos.org/test/plugin-3',
409
410
  activatesOn: CountEvent,