@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,90 @@
1
+ /**
2
+ * Interface definition for a capability.
3
+ */
4
+ import { type Effect } from 'effect';
5
+ import { type MaybePromise } from '@dxos/util';
6
+ import { type ActivationEvent } from './events';
7
+ declare const InterfaceDefTypeId: unique symbol;
8
+ /**
9
+ * The interface definition of a capability.
10
+ */
11
+ export type InterfaceDef<T> = {
12
+ [InterfaceDefTypeId]: T;
13
+ identifier: string;
14
+ };
15
+ /**
16
+ * Helper to define the interface of a capability.
17
+ */
18
+ export declare const defineCapability: <T>(identifier: string) => InterfaceDef<T>;
19
+ /**
20
+ * Functionality contributed to the application by a plugin module.
21
+ */
22
+ export type Capability<T> = {
23
+ /**
24
+ * The interface definition of the capability.
25
+ */
26
+ interface: InterfaceDef<T>;
27
+ /**
28
+ * The implementation of the capability.
29
+ */
30
+ implementation: T;
31
+ /**
32
+ * Called when the capability is deactivated.
33
+ */
34
+ deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
35
+ };
36
+ export type AnyCapability = Capability<any>;
37
+ type PluginsContextOptions = {
38
+ activate: (event: ActivationEvent) => MaybePromise<boolean>;
39
+ reset: (event: ActivationEvent) => MaybePromise<boolean>;
40
+ };
41
+ /**
42
+ * Helper to define the implementation of a capability.
43
+ */
44
+ export declare const contributes: <T>(interfaceDef: Capability<T>["interface"], implementation: Capability<T>["implementation"], deactivate?: Capability<T>["deactivate"]) => Capability<T>;
45
+ type LazyCapability<T, U> = () => Promise<{
46
+ default: (props: T) => MaybePromise<Capability<U>>;
47
+ }>;
48
+ /**
49
+ * Helper to define a lazily loaded implementation of a capability.
50
+ */
51
+ export declare const lazy: <T, U>(c: LazyCapability<T, U>) => (props?: T) => Promise<Capability<U>>;
52
+ /**
53
+ * Context which is passed to plugins, allowing them to interact with each other.
54
+ */
55
+ export declare class PluginsContext {
56
+ private readonly _definedCapabilities;
57
+ /**
58
+ * Activates plugins based on the activation event.
59
+ * @param event The activation event.
60
+ * @returns Whether the activation was successful.
61
+ */
62
+ readonly activate: PluginsContextOptions['activate'];
63
+ /**
64
+ * Re-activates the modules that were activated by the event.
65
+ * @param event The activation event.
66
+ * @returns Whether the reset was successful.
67
+ */
68
+ readonly reset: PluginsContextOptions['reset'];
69
+ constructor({ activate, reset }: PluginsContextOptions);
70
+ /**
71
+ * Requests capabilities from the plugin context.
72
+ * @returns An array of capabilities.
73
+ * @reactive
74
+ */
75
+ requestCapabilities<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U): U[];
76
+ /**
77
+ * Requests a single capability from the plugin context.
78
+ * @returns The capability.
79
+ * @throws If no capability is found.
80
+ * @reactive
81
+ */
82
+ requestCapability<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T, moduleId: string) => capability is U): U;
83
+ /**
84
+ * Waits for a capability to be contributed.
85
+ * @returns The capability.
86
+ */
87
+ waitForCapability<T, U extends T = T>(interfaceDef: InterfaceDef<T>, filter?: (capability: T) => capability is U): Promise<U>;
88
+ }
89
+ export {};
90
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMrC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAA,MAAM,kBAAkB,EAAE,OAAO,MAAyC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,CAAC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AE,CAAC,CAAC,cACrB,CAAC,KAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAG9B,CAAC;AAEP;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAgD;IAErF;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAErD;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;gBAEnC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,qBAAqB;IA4CtD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EACpC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,GAC5D,CAAC,EAAE;IAaN;;;;;OAKG;IACH,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAClC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,IAAI,CAAC,GAC5D,CAAC;IAMJ;;;OAGG;IACG,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EACxC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,UAAU,IAAI,CAAC,GAC1C,OAAO,CAAC,CAAC,CAAC;CAYd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=capabilities.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.test.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * An event which activates a plugin module.
3
+ */
4
+ export type ActivationEvent = {
5
+ id: string;
6
+ specifier?: string;
7
+ };
8
+ /**
9
+ * An activation event that can be a single event, or a combination of events.
10
+ */
11
+ export type ActivationEvents = ActivationEvent | {
12
+ type: 'one-of';
13
+ events: ActivationEvent[];
14
+ } | {
15
+ type: 'all-of';
16
+ events: ActivationEvent[];
17
+ };
18
+ /**
19
+ * Helper to define an activation event.
20
+ */
21
+ export declare const defineEvent: (id: string, specifier?: string) => ActivationEvent;
22
+ /**
23
+ * Helper to create an activation event key.
24
+ */
25
+ export declare const eventKey: (event: ActivationEvent) => string;
26
+ /**
27
+ * Helper to create an activation event that triggers when any of the given events are activated.
28
+ */
29
+ export declare const oneOf: (...events: ActivationEvent[]) => {
30
+ type: "one-of";
31
+ events: ActivationEvent[];
32
+ };
33
+ /**
34
+ * Helper to create an activation event that triggers when all of the given events are activated.
35
+ */
36
+ export declare const allOf: (...events: ActivationEvent[]) => {
37
+ type: "all-of";
38
+ events: ActivationEvent[];
39
+ };
40
+ /**
41
+ * Helper to check if an activation event is a one-of event.
42
+ */
43
+ export declare const isOneOf: (events: ActivationEvents) => events is {
44
+ type: "one-of";
45
+ events: ActivationEvent[];
46
+ };
47
+ /**
48
+ * Helper to check if an activation event is an all-of event.
49
+ */
50
+ export declare const isAllOf: (events: ActivationEvents) => events is {
51
+ type: "all-of";
52
+ events: ActivationEvent[];
53
+ };
54
+ /**
55
+ * Helper to get the events from an activation event.
56
+ */
57
+ export declare const getEvents: (events: ActivationEvents) => ActivationEvent[];
58
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/events.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,WAAW,OAAQ,MAAM,cAAc,MAAM,KAC5B,eAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAW,eAAe,WAAoE,CAAC;AAEpH;;GAEG;AACH,eAAO,MAAM,KAAK,cAAe,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,KAAK,cAAe,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,OAAO,WAAY,gBAAgB,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1D,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,OAAO,WAAY,gBAAgB,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1D,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,SAAS,WAAY,gBAAgB,sBAAkD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './capabilities';
2
+ export * from './events';
3
+ export * from './manager';
4
+ export * from './plugin';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,126 @@
1
+ import { Event } from '@dxos/async';
2
+ import { type ReactiveObject } from '@dxos/live-object';
3
+ import { type MaybePromise } from '@dxos/util';
4
+ import { PluginsContext } from './capabilities';
5
+ import { type ActivationEvent } from './events';
6
+ import { type PluginModule, type Plugin } from './plugin';
7
+ export type PluginManagerOptions = {
8
+ pluginLoader: (id: string) => MaybePromise<Plugin>;
9
+ plugins?: Plugin[];
10
+ core?: string[];
11
+ enabled?: string[];
12
+ };
13
+ export declare class PluginManager {
14
+ readonly activation: Event<{
15
+ event: string;
16
+ state: "activating" | "activated" | "error";
17
+ error?: any;
18
+ }>;
19
+ readonly context: PluginsContext;
20
+ private readonly _state;
21
+ private readonly _pluginLoader;
22
+ private readonly _capabilities;
23
+ constructor({ pluginLoader, plugins, core, enabled, }: PluginManagerOptions);
24
+ /**
25
+ * Plugins that are currently registered.
26
+ *
27
+ * @reactive
28
+ */
29
+ get plugins(): ReactiveObject<readonly Plugin[]>;
30
+ /**
31
+ * Ids of plugins that are core and cannot be removed.
32
+ *
33
+ * @reactive
34
+ */
35
+ get core(): ReactiveObject<readonly string[]>;
36
+ /**
37
+ * Ids of plugins that are currently enabled.
38
+ *
39
+ * @reactive
40
+ */
41
+ get enabled(): ReactiveObject<readonly string[]>;
42
+ /**
43
+ * Modules of plugins which are currently enabled.
44
+ *
45
+ * @reactive
46
+ */
47
+ get modules(): ReactiveObject<readonly PluginModule[]>;
48
+ /**
49
+ * Ids of modules which are currently active.
50
+ *
51
+ * @reactive
52
+ */
53
+ get active(): ReactiveObject<readonly string[]>;
54
+ /**
55
+ * Ids of modules which are pending removal.
56
+ *
57
+ * @reactive
58
+ */
59
+ get pendingRemoval(): ReactiveObject<readonly string[]>;
60
+ /**
61
+ * Ids of events which have been fired.
62
+ *
63
+ * @reactive
64
+ */
65
+ get eventsFired(): ReactiveObject<readonly string[]>;
66
+ /**
67
+ * Ids of modules which are pending reset.
68
+ *
69
+ * @reactive
70
+ */
71
+ get pendingReset(): ReactiveObject<readonly string[]>;
72
+ /**
73
+ * Adds a plugin to the manager via the plugin loader.
74
+ * @param id The id of the plugin.
75
+ */
76
+ add(id: string): Promise<boolean>;
77
+ /**
78
+ * Enables a plugin.
79
+ * @param id The id of the plugin.
80
+ */
81
+ enable(id: string): boolean;
82
+ /**
83
+ * Removes a plugin from the manager.
84
+ * @param id The id of the plugin.
85
+ */
86
+ remove(id: string): boolean;
87
+ /**
88
+ * Disables a plugin.
89
+ * @param id The id of the plugin.
90
+ */
91
+ disable(id: string): boolean;
92
+ /**
93
+ * Activates plugins based on the activation event.
94
+ * @param event The activation event.
95
+ * @returns Whether the activation was successful.
96
+ */
97
+ activate(event: ActivationEvent | string): Promise<boolean>;
98
+ /**
99
+ * Deactivates all of the modules for a plugin.
100
+ * @param id The id of the plugin.
101
+ * @returns Whether the deactivation was successful.
102
+ */
103
+ deactivate(id: string): Promise<boolean>;
104
+ /**
105
+ * Re-activates the modules that were activated by the event.
106
+ * @param event The activation event.
107
+ * @returns Whether the reset was successful.
108
+ */
109
+ reset(event: ActivationEvent | string): Promise<boolean>;
110
+ private _addPlugin;
111
+ private _removePlugin;
112
+ private _addModule;
113
+ private _removeModule;
114
+ private _getPlugin;
115
+ private _getActiveModules;
116
+ private _getInactiveModules;
117
+ private _getActiveModulesByEvent;
118
+ private _getInactiveModulesByEvent;
119
+ private _setPendingResetByModule;
120
+ private _activate;
121
+ private _activateModule;
122
+ private _deactivate;
123
+ private _deactivateModule;
124
+ private _reset;
125
+ }
126
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/core/manager.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAsB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,e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I,cAAc,CAAC,SAAS,MAAM,EAAE,CAAC,CAEnD;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,cAAc,CAAC,SAAS,MAAM,EAAE,CAAC,CAEpD;IAED;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASvC;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAoB3B;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAa3B;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAgC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3D;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxD,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,wBAAwB;IAuBhC,OAAO,CAAC,SAAS;IAkDjB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,iBAAiB;IAmCzB,OAAO,CAAC,MAAM;CAsBf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.test.d.ts","sourceRoot":"","sources":["../../../../src/core/manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,94 @@
1
+ import { type Effect } from 'effect';
2
+ import { type MaybePromise } from '@dxos/util';
3
+ import { type AnyCapability, type PluginsContext } from './capabilities';
4
+ import { type ActivationEvent, type ActivationEvents } from './events';
5
+ interface PluginModuleInterface {
6
+ /**
7
+ * Unique id of the module.
8
+ */
9
+ id: string;
10
+ /**
11
+ * Events for which the module will be activated.
12
+ */
13
+ activatesOn: ActivationEvents;
14
+ /**
15
+ * Events which the plugin depends on being activated.
16
+ * Plugin is marked as needing reset a plugin activated by a dependent event is removed.
17
+ * Events are automatically activated before activation of the plugin.
18
+ */
19
+ activatesBefore?: ActivationEvent[];
20
+ /**
21
+ * Events which this plugin triggers upon activation.
22
+ */
23
+ activatesAfter?: ActivationEvent[];
24
+ /**
25
+ * Called when the module is activated.
26
+ * @param context The plugin context.
27
+ * @returns The capabilities of the module.
28
+ */
29
+ activate: (context: PluginsContext) => MaybePromise<AnyCapability | AnyCapability[]> | Effect.Effect<AnyCapability | AnyCapability[], Error>;
30
+ }
31
+ /**
32
+ * A unit of containment of modular functionality that can be provided to an application.
33
+ * Plugins provide things like components, state, actions, etc. to the application.
34
+ */
35
+ export declare class PluginModule implements PluginModuleInterface {
36
+ readonly id: PluginModuleInterface['id'];
37
+ readonly activatesOn: PluginModuleInterface['activatesOn'];
38
+ readonly activatesBefore?: PluginModuleInterface['activatesBefore'];
39
+ readonly activatesAfter?: PluginModuleInterface['activatesAfter'];
40
+ readonly activate: PluginModuleInterface['activate'];
41
+ constructor(options: PluginModuleInterface);
42
+ }
43
+ /**
44
+ * Helper to define a module.
45
+ */
46
+ export declare const defineModule: (options: PluginModuleInterface) => PluginModule;
47
+ export type PluginMeta = {
48
+ /**
49
+ * Globally unique ID.
50
+ *
51
+ * Expected to be in the form of a valid URL.
52
+ *
53
+ * @example dxos.org/plugin/example
54
+ */
55
+ id: string;
56
+ /**
57
+ * Human-readable name.
58
+ */
59
+ name?: string;
60
+ /**
61
+ * Short description of plugin functionality.
62
+ */
63
+ description?: string;
64
+ /**
65
+ * URL of home page.
66
+ */
67
+ homePage?: string;
68
+ /**
69
+ * URL of source code.
70
+ */
71
+ source?: string;
72
+ /**
73
+ * Tags to help categorize the plugin.
74
+ */
75
+ tags?: string[];
76
+ /**
77
+ * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
78
+ */
79
+ icon?: string;
80
+ };
81
+ /**
82
+ * A collection of modules that are be enabled/disabled as a unit.
83
+ */
84
+ export declare class Plugin {
85
+ readonly meta: PluginMeta;
86
+ readonly modules: PluginModule[];
87
+ constructor(meta: PluginMeta, modules: PluginModule[]);
88
+ }
89
+ /**
90
+ * Helper to define a plugin.
91
+ */
92
+ export declare const definePlugin: (meta: PluginMeta, modules: PluginModule[]) => Plugin;
93
+ export {};
94
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/core/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,qBAAqB;IAC7B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC;IAE9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,EAAE,CACR,OAAO,EAAE,cAAc,KACpB,YAAY,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM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: string;
3
+ dependsOn?: string[];
4
+ };
5
+ /**
6
+ * Topologically sorts a list of nodes based on their dependencies.
7
+ */
8
+ export declare const topologicalSort: <T extends DependencyNode>(nodes: T[]) => T[];
9
+ export {};
10
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,SAAS,CAAC,EAAE,KAAG,CAAC,EA+BvE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=helpers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.test.d.ts","sourceRoot":"","sources":["../../../src/helpers.test.ts"],"names":[],"mappings":""}
@@ -1,3 +1,7 @@
1
- export * from './plugins';
2
1
  export * from './App';
2
+ export * from './common';
3
+ export * from './core';
4
+ export * from './plugin-intent';
5
+ export * from './plugin-settings';
6
+ export * from './react';
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAE1B,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Capabilities } from '../../common';
3
+ export declare const Debug: () => React.JSX.Element;
4
+ declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
5
+ export default _default;
6
+ //# sourceMappingURL=Debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../../../src/playground/debug/Debug.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAC;AAI3D,eAAO,MAAM,KAAK,yBAgBjB,CAAC;;AAEF,wBAQI"}
@@ -0,0 +1,2 @@
1
+ export * from './plugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/playground/debug/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const DebugPlugin: () => import("../../core").Plugin;
2
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/playground/debug/plugin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,mCAOpB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Capabilities } from '../../common';
3
+ export declare const Main: () => React.JSX.Element;
4
+ declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
5
+ export default _default;
6
+ //# sourceMappingURL=Main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Main.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiC5C,eAAO,MAAM,IAAI,yBAsBhB,CAAC;;AAEF,wBAKK"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Capabilities } from '../../common';
3
+ export declare const Toolbar: () => React.JSX.Element;
4
+ declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
5
+ export default _default;
6
+ //# sourceMappingURL=Toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/Toolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,eAAO,MAAM,OAAO,yBAyBnB,CAAC;;AAEF,wBAKK"}
@@ -0,0 +1,5 @@
1
+ export declare const Number: import("../../core").InterfaceDef<number>;
2
+ export declare const CountEvent: import("../../core").ActivationEvent;
3
+ export declare const createPluginId: (id: string) => string;
4
+ export declare const createNumberPlugin: (id: string) => import("../../core").Plugin;
5
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/generator.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,2CAA6D,CAAC;AAEjF,eAAO,MAAM,UAAU,sCAA+C,CAAC;AAEvE,eAAO,MAAM,cAAc,OAAQ,MAAM,WAAoC,CAAC;AAE9E,eAAO,MAAM,kBAAkB,OAAQ,MAAM,gCAU5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './plugin';
2
+ export * from './generator';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const GeneratorPlugin: () => import("../../core").Plugin;
2
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/playground/generator/plugin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,mCAOxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const Layout: () => React.JSX.Element;
3
+ declare const _default: () => import("../../core").Capability<Readonly<{
4
+ id: string;
5
+ root: React.FC<React.PropsWithChildren>;
6
+ }>>;
7
+ export default _default;
8
+ //# sourceMappingURL=Layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/playground/layout/Layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,MAAM,yBAgBlB,CAAC;;;;;AAEF,wBAIK"}
@@ -0,0 +1,2 @@
1
+ export * from './plugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/playground/layout/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const LayoutPlugin: () => import("../../core").Plugin;
2
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/playground/layout/plugin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,mCAOrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Capabilities } from '../../common';
3
+ export declare const Logger: () => React.JSX.Element;
4
+ declare const _default: () => import("../../core").Capability<Capabilities.ReactSurface>;
5
+ export default _default;
6
+ //# sourceMappingURL=Toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/Toolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,YAAY,EAAiB,MAAM,cAAc,CAAC;AAI3D,eAAO,MAAM,MAAM,yBAIlB,CAAC;;AAEF,wBAQI"}
@@ -0,0 +1,2 @@
1
+ export * from './plugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const LoggerPlugin: () => import("../../core").Plugin;
2
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/plugin.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,mCAmBrB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { S } from '@dxos/echo-schema';
2
+ declare const Log_base: S.TaggedClass<Log, "dxos.org/test/logger/log", {
3
+ readonly _tag: S.tag<"dxos.org/test/logger/log">;
4
+ } & {
5
+ input: S.Struct<{
6
+ message: typeof S.String;
7
+ }>;
8
+ output: typeof S.Void;
9
+ }>;
10
+ export declare class Log extends Log_base {
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/playground/logger/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;;;;;;;;;AAEtC,qBAAa,GAAI,SAAQ,QAKvB;CAAG"}
@@ -0,0 +1,10 @@
1
+ import '@dxos-theme';
2
+ import React from 'react';
3
+ export declare const Playground: {};
4
+ declare const _default: {
5
+ title: string;
6
+ render: () => React.JSX.Element;
7
+ decorators: import("@storybook/react/*").Decorator[];
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=playground.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playground.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/playground.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAqB1B,eAAO,MAAM,UAAU,IAAK,CAAC;;;;;;AAE7B,wBAIE"}
@@ -2,7 +2,7 @@ import { type Context, type Provider } from 'react';
2
2
  import { type AnyIntentResolver, type IntentContext } from './intent-dispatcher';
3
3
  declare const IntentContext: Context<IntentContext | undefined>;
4
4
  export declare const useIntentDispatcher: () => Pick<IntentContext, "dispatch" | "dispatchPromise">;
5
- export declare const useIntentResolver: (pluginId: string, resolver: AnyIntentResolver) => void;
5
+ export declare const useIntentResolver: (module: string, resolver: AnyIntentResolver) => void;
6
6
  export declare const IntentProvider: Provider<IntentContext | undefined>;
7
7
  export {};
8
8
  //# sourceMappingURL=IntentContext.d.ts.map