@dxos/app-framework 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b

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 (316) hide show
  1. package/dist/lib/browser/chunk-GNLU3GAU.mjs +1595 -0
  2. package/dist/lib/browser/chunk-GNLU3GAU.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +112 -618
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +67 -0
  7. package/dist/lib/browser/testing/index.mjs.map +7 -0
  8. package/dist/lib/node/chunk-FBA4BB3J.cjs +1639 -0
  9. package/dist/lib/node/chunk-FBA4BB3J.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +123 -651
  11. package/dist/lib/node/index.cjs.map +4 -4
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/testing/index.cjs +91 -0
  14. package/dist/lib/node/testing/index.cjs.map +7 -0
  15. package/dist/lib/node-esm/chunk-KPMTPXQI.mjs +1597 -0
  16. package/dist/lib/node-esm/chunk-KPMTPXQI.mjs.map +7 -0
  17. package/dist/lib/node-esm/index.mjs +112 -618
  18. package/dist/lib/node-esm/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/lib/node-esm/testing/index.mjs +68 -0
  21. package/dist/lib/node-esm/testing/index.mjs.map +7 -0
  22. package/dist/types/src/App.d.ts +22 -13
  23. package/dist/types/src/App.d.ts.map +1 -1
  24. package/dist/types/src/common/capabilities.d.ts +340 -0
  25. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  26. package/dist/types/src/common/events.d.ts +41 -0
  27. package/dist/types/src/common/events.d.ts.map +1 -0
  28. package/dist/types/src/common/file.d.ts +14 -0
  29. package/dist/types/src/common/file.d.ts.map +1 -0
  30. package/dist/types/src/common/graph.d.ts +21 -0
  31. package/dist/types/src/common/graph.d.ts.map +1 -0
  32. package/dist/types/src/{plugins/common → common}/index.d.ts +3 -1
  33. package/dist/types/src/common/index.d.ts.map +1 -0
  34. package/dist/types/src/{plugins/common → common}/layout.d.ts +0 -11
  35. package/dist/types/src/common/layout.d.ts.map +1 -0
  36. package/dist/types/src/{plugins/common → common}/navigation.d.ts +0 -2
  37. package/dist/types/src/common/navigation.d.ts.map +1 -0
  38. package/dist/types/src/{plugins/plugin-surface/SurfaceContext.d.ts → common/surface.d.ts} +12 -29
  39. package/dist/types/src/common/surface.d.ts.map +1 -0
  40. package/dist/types/src/{plugins/common → common}/translations.d.ts +0 -11
  41. package/dist/types/src/common/translations.d.ts.map +1 -0
  42. package/dist/types/src/core/capabilities.d.ts +90 -0
  43. package/dist/types/src/core/capabilities.d.ts.map +1 -0
  44. package/dist/types/src/core/capabilities.test.d.ts +2 -0
  45. package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
  46. package/dist/types/src/core/events.d.ts +58 -0
  47. package/dist/types/src/core/events.d.ts.map +1 -0
  48. package/dist/types/src/core/index.d.ts +5 -0
  49. package/dist/types/src/core/index.d.ts.map +1 -0
  50. package/dist/types/src/core/manager.d.ts +126 -0
  51. package/dist/types/src/core/manager.d.ts.map +1 -0
  52. package/dist/types/src/core/manager.test.d.ts +2 -0
  53. package/dist/types/src/core/manager.test.d.ts.map +1 -0
  54. package/dist/types/src/core/plugin.d.ts +94 -0
  55. package/dist/types/src/core/plugin.d.ts.map +1 -0
  56. package/dist/types/src/helpers.d.ts +10 -0
  57. package/dist/types/src/helpers.d.ts.map +1 -0
  58. package/dist/types/src/helpers.test.d.ts +2 -0
  59. package/dist/types/src/helpers.test.d.ts.map +1 -0
  60. package/dist/types/src/index.d.ts +5 -1
  61. package/dist/types/src/index.d.ts.map +1 -1
  62. package/dist/types/src/playground/debug/Debug.d.ts +6 -0
  63. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
  64. package/dist/types/src/playground/debug/index.d.ts +2 -0
  65. package/dist/types/src/playground/debug/index.d.ts.map +1 -0
  66. package/dist/types/src/playground/debug/plugin.d.ts +2 -0
  67. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
  68. package/dist/types/src/playground/generator/Main.d.ts +6 -0
  69. package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
  70. package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
  71. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
  72. package/dist/types/src/playground/generator/generator.d.ts +5 -0
  73. package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
  74. package/dist/types/src/playground/generator/index.d.ts +3 -0
  75. package/dist/types/src/playground/generator/index.d.ts.map +1 -0
  76. package/dist/types/src/playground/generator/plugin.d.ts +2 -0
  77. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
  78. package/dist/types/src/playground/layout/Layout.d.ts +8 -0
  79. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
  80. package/dist/types/src/playground/layout/index.d.ts +2 -0
  81. package/dist/types/src/playground/layout/index.d.ts.map +1 -0
  82. package/dist/types/src/playground/layout/plugin.d.ts +2 -0
  83. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
  84. package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
  85. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
  86. package/dist/types/src/playground/logger/index.d.ts +2 -0
  87. package/dist/types/src/playground/logger/index.d.ts.map +1 -0
  88. package/dist/types/src/playground/logger/plugin.d.ts +2 -0
  89. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
  90. package/dist/types/src/playground/logger/schema.d.ts +13 -0
  91. package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
  92. package/dist/types/src/playground/playground.stories.d.ts +10 -0
  93. package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
  94. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/IntentContext.d.ts +1 -1
  95. package/dist/types/src/plugin-intent/IntentContext.d.ts.map +1 -0
  96. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
  97. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
  98. package/dist/types/src/plugin-intent/actions.d.ts +23 -0
  99. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
  100. package/dist/types/src/plugin-intent/errors.d.ts +16 -0
  101. package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
  102. package/dist/types/src/plugin-intent/index.d.ts +6 -0
  103. package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
  104. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.d.ts +18 -19
  105. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
  106. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
  107. package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent.d.ts +5 -25
  108. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
  109. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
  110. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
  111. package/dist/types/src/{plugins/plugin-settings/provides.d.ts → plugin-settings/actions.d.ts} +1 -10
  112. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
  113. package/dist/types/src/plugin-settings/index.d.ts +3 -0
  114. package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
  115. package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
  116. package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
  117. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
  118. package/dist/types/src/react/Surface.d.ts +12 -0
  119. package/dist/types/src/react/Surface.d.ts.map +1 -0
  120. package/dist/types/src/react/index.d.ts +5 -0
  121. package/dist/types/src/react/index.d.ts.map +1 -0
  122. package/dist/types/src/react/useCapabilities.d.ts +13 -0
  123. package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
  124. package/dist/types/src/testing/index.d.ts +2 -0
  125. package/dist/types/src/testing/index.d.ts.map +1 -0
  126. package/dist/types/src/testing/withPluginManager.d.ts +10 -0
  127. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
  128. package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
  129. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
  130. package/dist/types/tsconfig.tsbuildinfo +1 -1
  131. package/package.json +28 -15
  132. package/project.json +2 -1
  133. package/src/App.tsx +138 -34
  134. package/src/common/capabilities.ts +82 -0
  135. package/src/common/events.ts +63 -0
  136. package/src/common/file.ts +22 -0
  137. package/src/common/graph.ts +30 -0
  138. package/src/{plugins/common → common}/index.ts +3 -1
  139. package/src/{plugins/common → common}/layout.ts +0 -16
  140. package/src/{plugins/common → common}/navigation.ts +0 -15
  141. package/src/{plugins/plugin-surface/SurfaceContext.ts → common/surface.ts} +6 -37
  142. package/src/common/translations.ts +18 -0
  143. package/src/core/capabilities.test.ts +116 -0
  144. package/src/core/capabilities.ts +213 -0
  145. package/src/core/events.ts +58 -0
  146. package/src/core/index.ts +8 -0
  147. package/src/core/manager.test.ts +567 -0
  148. package/src/core/manager.ts +497 -0
  149. package/src/core/plugin.ts +128 -0
  150. package/src/helpers.test.ts +97 -0
  151. package/src/helpers.ts +45 -0
  152. package/src/index.ts +6 -3
  153. package/src/playground/debug/Debug.tsx +39 -0
  154. package/src/playground/debug/index.ts +5 -0
  155. package/src/playground/debug/plugin.ts +17 -0
  156. package/src/playground/generator/Main.tsx +71 -0
  157. package/src/playground/generator/Toolbar.tsx +46 -0
  158. package/src/playground/generator/generator.ts +23 -0
  159. package/src/playground/generator/index.ts +6 -0
  160. package/src/playground/generator/plugin.ts +18 -0
  161. package/src/playground/layout/Layout.tsx +33 -0
  162. package/src/playground/layout/index.ts +5 -0
  163. package/src/playground/layout/plugin.ts +17 -0
  164. package/src/playground/logger/Toolbar.tsx +28 -0
  165. package/src/playground/logger/index.ts +5 -0
  166. package/src/playground/logger/plugin.ts +33 -0
  167. package/src/playground/logger/schema.ts +12 -0
  168. package/src/playground/playground.stories.tsx +34 -0
  169. package/src/{plugins/plugin-intent → plugin-intent}/IntentContext.tsx +12 -4
  170. package/src/plugin-intent/IntentPlugin.tsx +60 -0
  171. package/src/plugin-intent/actions.ts +22 -0
  172. package/src/plugin-intent/errors.ts +39 -0
  173. package/src/{plugins/plugin-intent → plugin-intent}/index.ts +2 -6
  174. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.ts +36 -35
  175. package/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.ts +49 -65
  176. package/src/{plugins/plugin-intent → plugin-intent}/intent.ts +5 -21
  177. package/src/plugin-settings/SettingsPlugin.ts +29 -0
  178. package/src/plugin-settings/actions.ts +17 -0
  179. package/src/plugin-settings/index.ts +6 -0
  180. package/src/react/PluginManagerProvider.ts +22 -0
  181. package/src/react/Surface.tsx +72 -0
  182. package/src/react/index.ts +8 -0
  183. package/src/react/useCapabilities.ts +39 -0
  184. package/src/testing/index.ts +5 -0
  185. package/src/testing/withPluginManager.stories.tsx +47 -0
  186. package/src/testing/withPluginManager.tsx +67 -0
  187. package/tsconfig.json +13 -1
  188. package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
  189. package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
  190. package/dist/lib/browser/chunk-QG25ZU2N.mjs +0 -320
  191. package/dist/lib/browser/chunk-QG25ZU2N.mjs.map +0 -7
  192. package/dist/lib/browser/chunk-SPDTXTOV.mjs +0 -163
  193. package/dist/lib/browser/chunk-SPDTXTOV.mjs.map +0 -7
  194. package/dist/lib/browser/chunk-WBOXEHBE.mjs +0 -51
  195. package/dist/lib/browser/chunk-WBOXEHBE.mjs.map +0 -7
  196. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs +0 -32
  197. package/dist/lib/browser/plugin-intent-T7Y3MJ5C.mjs.map +0 -7
  198. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs +0 -15
  199. package/dist/lib/browser/plugin-settings-5U2L2NRU.mjs.map +0 -7
  200. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs +0 -24
  201. package/dist/lib/browser/plugin-surface-OKPF3EQI.mjs.map +0 -7
  202. package/dist/lib/node/chunk-BW3RNEVI.cjs +0 -185
  203. package/dist/lib/node/chunk-BW3RNEVI.cjs.map +0 -7
  204. package/dist/lib/node/chunk-FCMHRU3M.cjs +0 -70
  205. package/dist/lib/node/chunk-FCMHRU3M.cjs.map +0 -7
  206. package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
  207. package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
  208. package/dist/lib/node/chunk-VWHAALIN.cjs +0 -344
  209. package/dist/lib/node/chunk-VWHAALIN.cjs.map +0 -7
  210. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs +0 -53
  211. package/dist/lib/node/plugin-intent-F3TQZIUR.cjs.map +0 -7
  212. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs +0 -36
  213. package/dist/lib/node/plugin-settings-W6UHMH5M.cjs.map +0 -7
  214. package/dist/lib/node/plugin-surface-CCSIONYW.cjs +0 -45
  215. package/dist/lib/node/plugin-surface-CCSIONYW.cjs.map +0 -7
  216. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs +0 -53
  217. package/dist/lib/node-esm/chunk-3T5UIJY3.mjs.map +0 -7
  218. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs +0 -164
  219. package/dist/lib/node-esm/chunk-4GX7V5ZE.mjs.map +0 -7
  220. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs +0 -321
  221. package/dist/lib/node-esm/chunk-CFOUYXQ6.mjs.map +0 -7
  222. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
  223. package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
  224. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs +0 -33
  225. package/dist/lib/node-esm/plugin-intent-W2HQC6LC.mjs.map +0 -7
  226. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs +0 -16
  227. package/dist/lib/node-esm/plugin-settings-H5RHNFVC.mjs.map +0 -7
  228. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs +0 -25
  229. package/dist/lib/node-esm/plugin-surface-V3YET3UL.mjs.map +0 -7
  230. package/dist/types/src/plugins/common/file.d.ts +0 -22
  231. package/dist/types/src/plugins/common/file.d.ts.map +0 -1
  232. package/dist/types/src/plugins/common/graph.d.ts +0 -51
  233. package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
  234. package/dist/types/src/plugins/common/index.d.ts.map +0 -1
  235. package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
  236. package/dist/types/src/plugins/common/metadata.d.ts +0 -16
  237. package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
  238. package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
  239. package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
  240. package/dist/types/src/plugins/helpers.d.ts +0 -41
  241. package/dist/types/src/plugins/helpers.d.ts.map +0 -1
  242. package/dist/types/src/plugins/index.d.ts +0 -7
  243. package/dist/types/src/plugins/index.d.ts.map +0 -1
  244. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -16
  245. package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
  246. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
  247. package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
  248. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
  249. package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
  250. package/dist/types/src/plugins/plugin-host/index.d.ts +0 -6
  251. package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
  252. package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -104
  253. package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
  254. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
  255. package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
  256. package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
  257. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
  258. package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
  259. package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -7
  260. package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
  261. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  262. package/dist/types/src/plugins/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  263. package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
  264. package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -6
  265. package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
  266. package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -16
  267. package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
  268. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
  269. package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  270. package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
  271. package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
  272. package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
  273. package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
  274. package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
  275. package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
  276. package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -7
  277. package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
  278. package/dist/types/src/plugins/plugin-surface/SurfaceContext.d.ts.map +0 -1
  279. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
  280. package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
  281. package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
  282. package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
  283. package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
  284. package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
  285. package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
  286. package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
  287. package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -17
  288. package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
  289. package/src/plugins/common/file.ts +0 -36
  290. package/src/plugins/common/graph.ts +0 -70
  291. package/src/plugins/common/metadata.ts +0 -29
  292. package/src/plugins/common/translations.ts +0 -36
  293. package/src/plugins/helpers.ts +0 -92
  294. package/src/plugins/index.ts +0 -11
  295. package/src/plugins/plugin-host/HostPlugin.tsx +0 -88
  296. package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
  297. package/src/plugins/plugin-host/PluginContext.tsx +0 -79
  298. package/src/plugins/plugin-host/index.ts +0 -12
  299. package/src/plugins/plugin-host/plugin.test.ts +0 -158
  300. package/src/plugins/plugin-host/plugin.ts +0 -133
  301. package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -75
  302. package/src/plugins/plugin-intent/meta.ts +0 -11
  303. package/src/plugins/plugin-intent/provides.ts +0 -26
  304. package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
  305. package/src/plugins/plugin-settings/index.ts +0 -9
  306. package/src/plugins/plugin-settings/meta.ts +0 -9
  307. package/src/plugins/plugin-settings/provides.ts +0 -34
  308. package/src/plugins/plugin-surface/Surface.tsx +0 -62
  309. package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -45
  310. package/src/plugins/plugin-surface/helpers.ts +0 -22
  311. package/src/plugins/plugin-surface/index.ts +0 -14
  312. package/src/plugins/plugin-surface/meta.ts +0 -9
  313. package/src/plugins/plugin-surface/provides.ts +0 -27
  314. /package/dist/types/src/{plugins/plugin-intent → plugin-intent}/intent-dispatcher.test.d.ts +0 -0
  315. /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
  316. /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAA6B,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAC;AAK1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIjF,QAAA,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,CAAuD,CAAC;AAE9G,eAAO,MAAM,mBAAmB,QAAO,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,iBAAiB,CAGxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,YAAY,iBAAiB,SAW5E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,CAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const IntentPlugin: () => import("../core").Plugin;
2
+ //# sourceMappingURL=IntentPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/IntentPlugin.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY,gCAyCrB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { S } from '@dxos/echo-schema';
2
+ export declare const INTENT_PLUGIN = "dxos.org/plugin/intent";
3
+ export declare const INTENT_ACTION = "dxos.org/plugin/intent/action";
4
+ export declare namespace IntentAction {
5
+ const ShowUndo_base: S.TaggedClass<ShowUndo, "dxos.org/plugin/intent/action/show-undo", {
6
+ readonly _tag: S.tag<"dxos.org/plugin/intent/action/show-undo">;
7
+ } & {
8
+ input: S.Struct<{
9
+ message: S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
10
+ ns: typeof S.String;
11
+ count: S.optional<typeof S.Number>;
12
+ }>>]>>]>;
13
+ }>;
14
+ output: typeof S.Void;
15
+ }>;
16
+ /**
17
+ * Fired after an intent is dispatched if the intent is undoable.
18
+ */
19
+ export class ShowUndo extends ShowUndo_base {
20
+ }
21
+ export {};
22
+ }
23
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAA4B,CAAC;AAEvD,yBAAiB,YAAY,CAAC;;;;;;;;;;;;IAC5B;;OAEG;IACH,MAAM,OAAO,QAAS,SAAQ,aAK5B;KAAG;;CACN"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * NOTE: Messages should be sentences (Start with a capital letter and end with a period).
3
+ * Errors can optionally include a JSON context object.
4
+ */
5
+ export declare class BaseError extends Error {
6
+ readonly code: string;
7
+ readonly context?: Record<string, any> | undefined;
8
+ constructor(code: string, message?: string, context?: Record<string, any> | undefined);
9
+ }
10
+ export declare class NoResolversError extends BaseError {
11
+ constructor(action: string);
12
+ }
13
+ export declare class CycleDetectedError extends BaseError {
14
+ constructor(context?: Record<string, any>);
15
+ }
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/errors.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAEhC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAErB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gBAF7B,IAAI,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EACP,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAA;CAQzC;AAED,qBAAa,gBAAiB,SAAQ,SAAS;gBACjC,MAAM,EAAE,MAAM;CAG3B;AAED,qBAAa,kBAAmB,SAAQ,SAAS;gBACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAO1C"}
@@ -0,0 +1,6 @@
1
+ export * from './actions';
2
+ export * from './intent';
3
+ export * from './intent-dispatcher';
4
+ export * from './IntentContext';
5
+ export * from './IntentPlugin';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Effect } from 'effect';
2
- import { type MaybePromise } from '@dxos/util';
3
- import { type AnyIntentChain, type IntentChain, type IntentData, type IntentParams, type IntentResultData, type IntentSchema, type Label } from './intent';
2
+ import { type Simplify } from 'effect/Types';
3
+ import { type MaybePromise, type Disposition } from '@dxos/util';
4
+ import { type AnyIntentChain, type Intent, type IntentChain, type IntentData, type IntentParams, type IntentResultData, type IntentSchema, type Label } from './intent';
4
5
  /**
5
6
  * The return value of an intent effect.
6
7
  */
@@ -28,6 +29,8 @@ export type IntentEffectResult<Fields extends IntentParams> = {
28
29
  * An error that occurred while performing the action.
29
30
  *
30
31
  * If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
32
+ *
33
+ * Return caught error instead of throwing to trigger other intent to be triggered prior to returning the error.
31
34
  */
32
35
  error?: Error;
33
36
  /**
@@ -40,14 +43,6 @@ export type AnyIntentEffectResult = IntentEffectResult<any>;
40
43
  * The result of an intent dispatcher.
41
44
  */
42
45
  export type IntentDispatcherResult<Fields extends IntentParams> = Pick<IntentEffectResult<Fields>, 'data' | 'error'>;
43
- /**
44
- * Determines the priority of the effect when multiple intent resolvers are matched.
45
- *
46
- * - `static` - The effect is selected in the order it was resolved.
47
- * - `hoist` - The effect is selected before `static` effects.
48
- * - `fallback` - The effect is selected after `static` effects.
49
- */
50
- export type IntentDisposition = 'static' | 'hoist' | 'fallback';
51
46
  /**
52
47
  * The implementation of an intent effect.
53
48
  */
@@ -55,12 +50,12 @@ export type IntentEffectDefinition<Fields extends IntentParams> = (data: IntentD
55
50
  /**
56
51
  * Intent resolver to match intents to their effects.
57
52
  */
58
- export type IntentResolver<Tag extends string, Fields extends IntentParams> = {
53
+ export type IntentResolver<Tag extends string, Fields extends IntentParams> = Readonly<{
59
54
  action: Tag;
60
- disposition?: IntentDisposition;
55
+ disposition?: Disposition;
61
56
  filter?: (data: IntentData<Fields>) => boolean;
62
57
  effect: IntentEffectDefinition<Fields>;
63
- };
58
+ }>;
64
59
  export type AnyIntentResolver = IntentResolver<any, any>;
65
60
  /**
66
61
  * Creates an intent resolver to match intents to their effects.
@@ -73,25 +68,28 @@ export declare const createResolver: <Tag extends string, Fields extends IntentP
73
68
  /**
74
69
  * Invokes intents and returns the result.
75
70
  */
76
- export type PromiseIntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>) => Promise<IntentDispatcherResult<Fields>>;
71
+ export type PromiseIntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>) => Promise<Simplify<IntentDispatcherResult<Fields>>>;
77
72
  /**
78
73
  * Creates an effect for intents.
79
74
  */
80
- export type IntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>, depth?: number) => Effect.Effect<IntentDispatcherResult<Fields>, Error>;
75
+ export type IntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>, depth?: number) => Effect.Effect<Simplify<Required<IntentDispatcherResult<Fields>>['data']>, Error>;
76
+ type IntentResult<Tag extends string, Fields extends IntentParams> = IntentEffectResult<Fields> & {
77
+ _intent: Intent<Tag, Fields>;
78
+ };
79
+ export type AnyIntentResult = IntentResult<any, any>;
81
80
  /**
82
81
  * Invokes the most recent undoable intent with undo flags.
83
82
  */
84
- export type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any> | undefined>;
83
+ export type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any>>;
85
84
  /**
86
85
  * Creates an effect which undoes the last intent.
87
86
  */
88
- export type IntentUndo = () => Effect.Effect<IntentDispatcherResult<any> | undefined, Error>;
87
+ export type IntentUndo = () => Effect.Effect<any, Error>;
89
88
  export type IntentContext = {
90
89
  dispatch: IntentDispatcher;
91
90
  dispatchPromise: PromiseIntentDispatcher;
92
91
  undo: IntentUndo;
93
92
  undoPromise: PromiseIntentUndo;
94
- registerResolver: (id: string, resolver: AnyIntentResolver) => () => void;
95
93
  };
96
94
  /**
97
95
  * Sets of an intent dispatcher.
@@ -100,8 +98,9 @@ export type IntentContext = {
100
98
  * @param params.historyLimit The maximum number of intent results to keep in history.
101
99
  * @param params.executionLimit The maximum recursion depth of intent chains.
102
100
  */
103
- export declare const createDispatcher: (resolvers: Record<string, AnyIntentResolver[]>, { executionLimit, historyLimit }?: {
101
+ export declare const createDispatcher: (getResolvers: (module?: string) => AnyIntentResolver[], { executionLimit, historyLimit }?: {
104
102
  executionLimit?: number | undefined;
105
103
  historyLimit?: number | undefined;
106
104
  }) => IntentContext;
105
+ export {};
107
106
  //# sourceMappingURL=intent-dispatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAqB,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,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AK,YAAY,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG;IAChG,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAQzD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,eAAe,EAAE,uBAAuB,CAAC;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,iBACb,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,iBAAiB,EAAE;;;MAErD,aAqGF,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-dispatcher.test.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.test.ts"],"names":[],"mappings":""}
@@ -25,11 +25,11 @@ export type Intent<Tag extends string, Fields extends IntentParams> = {
25
25
  */
26
26
  data: IntentData<Fields>;
27
27
  /**
28
- * Plugin ID.
29
- * If specified, the intent will be sent explicitly to the plugin.
28
+ * Module ID.
29
+ * If specified, the intent will be sent explicitly to the plugin module.
30
30
  * Otherwise, the intent will be sent to all plugins, in order and the first to resolve a non-null value will be used.
31
31
  */
32
- plugin?: string;
32
+ module?: string;
33
33
  /**
34
34
  * Whether or not the intent is being undone.
35
35
  */
@@ -53,36 +53,16 @@ export type AnyIntentChain = IntentChain<any, any, any, any>;
53
53
  * @param params.plugin Optional plugin ID to send the intent to.
54
54
  * @param params.undo Optional flag to indicate that the intent is being undone. Generally not set manually.
55
55
  */
56
- export declare const createIntent: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, data?: IntentData<Fields>, params?: Pick<AnyIntent, "plugin" | "undo">) => IntentChain<Tag, Tag, Fields, Fields>;
56
+ export declare const createIntent: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, data?: IntentData<Fields>, params?: Pick<AnyIntent, "module" | "undo">) => IntentChain<Tag, Tag, Fields, Fields>;
57
57
  /**
58
58
  * Chain two intents together.
59
59
  *
60
60
  * NOTE: Chaining of intents depends on the data inputs and outputs being structs.
61
61
  */
62
- export declare const chain: <FirstTag extends string, NextTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams, NextFields extends IntentParams>(schema: IntentSchema<NextTag, NextFields>, data?: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>>, params?: Pick<AnyIntent, "plugin" | "undo">) => (intent: IntentChain<FirstTag, any, FirstFields, LastFields>) => IntentChain<FirstTag, NextTag, FirstFields, NextFields>;
62
+ export declare const chain: <FirstTag extends string, NextTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams, NextFields extends IntentParams>(schema: IntentSchema<NextTag, NextFields>, data?: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>>, params?: Pick<AnyIntent, "module" | "undo">) => (intent: IntentChain<FirstTag, any, FirstFields, LastFields>) => IntentChain<FirstTag, NextTag, FirstFields, NextFields>;
63
63
  export declare const Label: S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
64
64
  ns: typeof S.String;
65
65
  count: S.optional<typeof S.Number>;
66
66
  }>>]>>]>;
67
67
  export type Label = S.Schema.Type<typeof Label>;
68
- export declare const INTENT_ACTION = "dxos.org/plugin/intent/action";
69
- export declare namespace IntentAction {
70
- const ShowUndo_base: S.TaggedClass<ShowUndo, "dxos.org/plugin/intent/action/show-undo", {
71
- readonly _tag: S.tag<"dxos.org/plugin/intent/action/show-undo">;
72
- } & {
73
- input: S.Struct<{
74
- message: S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
75
- ns: typeof S.String;
76
- count: S.optional<typeof S.Number>;
77
- }>>]>>]>;
78
- }>;
79
- output: typeof S.Void;
80
- }>;
81
- /**
82
- * Fired after an intent is dispatched if the intent is undoable.
83
- */
84
- export class ShowUndo extends ShowUndo_base {
85
- }
86
- export {};
87
- }
88
68
  //# sourceMappingURL=intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,YAAY,IAChD,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAEnH,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,YAAY,IACtD,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;CAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAA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B,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,KACzC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAgBtC,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAEd,QAAQ,SAAS,MAAM,EACvB,OAAO,SAAS,MAAM,EACtB,WAAW,SAAS,YAAY,EAChC,UAAU,SAAS,YAAY,EAC/B,UAAU,SAAS,YAAY,UAEvB,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,SACnC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC,WAC9D,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,cAGlC,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,KAC1D,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAexD,CAAC;AAQJ,eAAO,MAAM,KAAK;;;QAGjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SettingsPlugin: () => import("../core").Plugin;
2
+ //# sourceMappingURL=SettingsPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/SettingsPlugin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,gCAkBvB,CAAC"}
@@ -1,13 +1,4 @@
1
1
  import { S } from '@dxos/echo-schema';
2
- import { type SettingsStoreFactory, type SettingsValue } from '@dxos/local-storage';
3
- import { type Plugin } from '../plugin-host';
4
- export type SettingsProvides<T extends SettingsValue> = {
5
- settings: T;
6
- };
7
- export type SettingsPluginProvides = {
8
- settingsStore: SettingsStoreFactory;
9
- };
10
- export declare const parseSettingsPlugin: (plugin: Plugin) => Plugin<SettingsPluginProvides> | undefined;
11
2
  export declare const SETTINGS_PLUGIN = "dxos.org/plugin/settings";
12
3
  export declare const SETTINGS_ACTION = "dxos.org/plugin/settings/action";
13
4
  export declare namespace SettingsAction {
@@ -23,4 +14,4 @@ export declare namespace SettingsAction {
23
14
  }
24
15
  export {};
25
16
  }
26
- //# sourceMappingURL=provides.d.ts.map
17
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/actions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,eAAe,oCAA8B,CAAC;AAE3D,yBAAiB,cAAc,CAAC;;;;;;;;;IAC9B,MAAM,OAAO,IAAK,SAAQ,SAKxB;KAAG;;CACN"}
@@ -0,0 +1,3 @@
1
+ export * from './actions';
2
+ export * from './SettingsPlugin';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1E,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAC9G,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAInC,kBAAkB,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IAM1C,MAAM;IAQf,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,10 @@
1
+ import { type PluginManager } from '../core';
2
+ /**
3
+ * Get the plugin manager.
4
+ */
5
+ export declare const usePluginManager: () => PluginManager;
6
+ /**
7
+ * Context provider for a plugin manager.
8
+ */
9
+ export declare const PluginManagerProvider: import("react").Provider<PluginManager | undefined>;
10
+ //# sourceMappingURL=PluginManagerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginManagerProvider.d.ts","sourceRoot":"","sources":["../../../../src/react/PluginManagerProvider.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aACkD,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,qBAAqB,qDAAgC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { type SurfaceProps } from '../common';
3
+ import { type PluginsContext } from '../core';
4
+ /**
5
+ * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.
6
+ */
7
+ export declare const isSurfaceAvailable: (context: PluginsContext, { role, data }: Pick<SurfaceProps, "role" | "data">) => boolean;
8
+ /**
9
+ * A surface is a named region of the screen that can be populated by plugins.
10
+ */
11
+ export declare const Surface: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SurfaceProps, "ref"> & React.RefAttributes<HTMLElement>>>;
12
+ //# sourceMappingURL=Surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAOnE,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAgB9C;;GAEG;AACH,eAAO,MAAM,kBAAkB,YAAa,cAAc,kBAAkB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,YAI9G,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,0HA+BnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './ErrorBoundary';
2
+ export * from './PluginManagerProvider';
3
+ export * from './Surface';
4
+ export * from './useCapabilities';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type InterfaceDef } from '../core';
2
+ /**
3
+ * Hook to request capabilities from the plugin context.
4
+ * @returns An array of capabilities.
5
+ */
6
+ export declare const useCapabilities: <T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U) => U[];
7
+ /**
8
+ * Hook to request a capability from the plugin context.
9
+ * @returns The capability.
10
+ * @throws If no capability is found.
11
+ */
12
+ export declare const useCapability: <T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U) => U;
13
+ //# sourceMappingURL=useCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../src/react/useCapabilities.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,CAAC,SAAS,CAAC,oBAC9B,YAAY,CAAC,CAAC,CAAC,WACpB,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,QAQ9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,SAAS,CAAC,oBAC5B,YAAY,CAAC,CAAC,CAAC,WACpB,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,MAK9D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './withPluginManager';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type Decorator } from '@storybook/react';
2
+ import { type CreateAppOptions } from '../App';
3
+ import { type AnyCapability } from '../core';
4
+ /**
5
+ * Wraps a story with a plugin manager.
6
+ */
7
+ export declare const withPluginManager: ({ capabilities, plugins, core, ...options }?: CreateAppOptions & {
8
+ capabilities?: AnyCapability[];
9
+ }) => Decorator;
10
+ //# sourceMappingURL=withPluginManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,KAAK,aAAa,EAA0D,MAAM,SAAS,CAAC;AAErG;;GAEG;AACH,eAAO,MAAM,iBAAiB,iDAK3B,gBAAgB,GAAG;IAAE,YAAY,CAAC,EAAE,aAAa,EAAE,CAAA;CAAE,KAAQ,SAqC/D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type Meta } from '@dxos/storybook-utils';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const Default: {};
5
+ //# sourceMappingURL=withPluginManager.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withPluginManager.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAiB7D,QAAA,MAAM,IAAI,EAAE,IAkBX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":"5.7.2"}
1
+ {"version":"5.7.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/app-framework",
3
- "version": "0.7.5-main.9cb18ac",
3
+ "version": "0.7.5-main.9d2a38b",
4
4
  "description": "A framework for building applications from composible plugins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,11 +12,20 @@
12
12
  "types": "./dist/types/src/index.d.ts",
13
13
  "browser": "./dist/lib/browser/index.mjs",
14
14
  "node": "./dist/lib/node-esm/index.mjs"
15
+ },
16
+ "./testing": {
17
+ "types": "./dist/types/src/testing/index.d.ts",
18
+ "browser": "./dist/lib/browser/testing/index.mjs",
19
+ "node": "./dist/lib/node-esm/testing/index.mjs"
15
20
  }
16
21
  },
17
22
  "types": "dist/types/src/index.d.ts",
18
23
  "typesVersions": {
19
- "*": {}
24
+ "*": {
25
+ "./testing": [
26
+ "dist/types/src/testing/index.d.ts"
27
+ ]
28
+ }
20
29
  },
21
30
  "dependencies": {
22
31
  "@effect/schema": "^0.75.5",
@@ -24,22 +33,26 @@
24
33
  "@preact/signals-core": "^1.6.0",
25
34
  "effect": "^3.12.1",
26
35
  "zod": "^3.22.4",
27
- "@dxos/app-graph": "0.7.5-main.9cb18ac",
28
- "@dxos/async": "0.7.5-main.9cb18ac",
29
- "@dxos/client-protocol": "0.7.5-main.9cb18ac",
30
- "@dxos/context": "0.7.5-main.9cb18ac",
31
- "@dxos/debug": "0.7.5-main.9cb18ac",
32
- "@dxos/invariant": "0.7.5-main.9cb18ac",
33
- "@dxos/echo-schema": "0.7.5-main.9cb18ac",
34
- "@dxos/live-object": "0.7.5-main.9cb18ac",
35
- "@dxos/local-storage": "0.7.5-main.9cb18ac",
36
- "@dxos/react-hooks": "0.7.5-main.9cb18ac",
37
- "@dxos/log": "0.7.5-main.9cb18ac",
38
- "@dxos/util": "0.7.5-main.9cb18ac"
36
+ "@dxos/async": "0.7.5-main.9d2a38b",
37
+ "@dxos/app-graph": "0.7.5-main.9d2a38b",
38
+ "@dxos/client-protocol": "0.7.5-main.9d2a38b",
39
+ "@dxos/context": "0.7.5-main.9d2a38b",
40
+ "@dxos/debug": "0.7.5-main.9d2a38b",
41
+ "@dxos/echo-schema": "0.7.5-main.9d2a38b",
42
+ "@dxos/live-object": "0.7.5-main.9d2a38b",
43
+ "@dxos/invariant": "0.7.5-main.9d2a38b",
44
+ "@dxos/local-storage": "0.7.5-main.9d2a38b",
45
+ "@dxos/react-hooks": "0.7.5-main.9d2a38b",
46
+ "@dxos/storybook-utils": "0.7.5-main.9d2a38b",
47
+ "@dxos/util": "0.7.5-main.9d2a38b",
48
+ "@dxos/log": "0.7.5-main.9d2a38b"
39
49
  },
40
50
  "devDependencies": {
41
51
  "@types/react": "~18.2.0",
42
- "react": "~18.2.0"
52
+ "react": "~18.2.0",
53
+ "@dxos/echo-signals": "0.7.5-main.9d2a38b",
54
+ "@dxos/react-ui": "0.7.5-main.9d2a38b",
55
+ "@dxos/react-ui-syntax-highlighter": "0.7.5-main.9d2a38b"
43
56
  },
44
57
  "peerDependencies": {
45
58
  "@phosphor-icons/react": "^2.1.5",
package/project.json CHANGED
@@ -11,7 +11,8 @@
11
11
  "compile": {
12
12
  "options": {
13
13
  "entryPoints": [
14
- "{projectRoot}/src/index.ts"
14
+ "{projectRoot}/src/index.ts",
15
+ "{projectRoot}/src/testing/index.ts"
15
16
  ]
16
17
  }
17
18
  },