@dxos/app-framework 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8

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 (556) hide show
  1. package/.storybook/main.mts +9 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/LICENSE +102 -5
  4. package/README.md +1 -1
  5. package/dist/lib/browser/capability-BOPAKKWG.mjs +35 -0
  6. package/dist/lib/browser/capability-BOPAKKWG.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
  8. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
  10. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-CO3XLNUX.mjs +95 -0
  12. package/dist/lib/browser/chunk-CO3XLNUX.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-DC3WRPBV.mjs +227 -0
  14. package/dist/lib/browser/chunk-DC3WRPBV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  16. package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  18. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-HFLKXMT7.mjs +587 -0
  20. package/dist/lib/browser/chunk-HFLKXMT7.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-IW44C7UL.mjs +83 -0
  22. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  24. package/dist/lib/browser/chunk-KZUDO43J.mjs +422 -0
  25. package/dist/lib/browser/chunk-KZUDO43J.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-Q2GLJTVV.mjs +12 -0
  27. package/dist/lib/browser/chunk-Q2GLJTVV.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-SYXIYT6T.mjs +143 -0
  29. package/dist/lib/browser/chunk-SYXIYT6T.mjs.map +7 -0
  30. package/dist/lib/browser/chunk-XHS5KDNX.mjs +1471 -0
  31. package/dist/lib/browser/chunk-XHS5KDNX.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-Y66ELD4U.mjs +476 -0
  33. package/dist/lib/browser/chunk-Y66ELD4U.mjs.map +7 -0
  34. package/dist/lib/browser/cli/index.mjs +74 -0
  35. package/dist/lib/browser/cli/index.mjs.map +7 -0
  36. package/dist/lib/browser/common/activation-events.mjs +20 -0
  37. package/dist/lib/browser/common/capabilities.mjs +56 -0
  38. package/dist/lib/browser/core/activation-event.mjs +20 -0
  39. package/dist/lib/browser/core/capability.mjs +32 -0
  40. package/dist/lib/browser/core/capability.mjs.map +7 -0
  41. package/dist/lib/browser/core/plugin-manager.mjs +19 -0
  42. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  43. package/dist/lib/browser/core/plugin.mjs +41 -0
  44. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  45. package/dist/lib/browser/core/url-loader.mjs +24 -0
  46. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  47. package/dist/lib/browser/index.mjs +85 -157
  48. package/dist/lib/browser/index.mjs.map +4 -4
  49. package/dist/lib/browser/meta.json +1 -1
  50. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs +132 -0
  51. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs.map +7 -0
  52. package/dist/lib/browser/testing/index.mjs +321 -56
  53. package/dist/lib/browser/testing/index.mjs.map +4 -4
  54. package/dist/lib/browser/testing/react.mjs +78 -0
  55. package/dist/lib/browser/testing/react.mjs.map +7 -0
  56. package/dist/lib/browser/ui/index.mjs +52 -0
  57. package/dist/lib/browser/ui/index.mjs.map +7 -0
  58. package/dist/lib/node-esm/capability-KZWRTX7R.mjs +36 -0
  59. package/dist/lib/node-esm/capability-KZWRTX7R.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
  61. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs +588 -0
  63. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs +144 -0
  65. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs +84 -0
  67. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-FPW45EZH.mjs +14 -0
  69. package/dist/lib/node-esm/chunk-FPW45EZH.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs +477 -0
  71. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  73. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  75. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-NULBHQYS.mjs +96 -0
  77. package/dist/lib/node-esm/chunk-NULBHQYS.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-SX5NVETP.mjs +1472 -0
  79. package/dist/lib/node-esm/chunk-SX5NVETP.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  81. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs +423 -0
  83. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs +228 -0
  85. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs.map +7 -0
  86. package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
  87. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  88. package/dist/lib/node-esm/cli/index.mjs +75 -0
  89. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  90. package/dist/lib/node-esm/common/activation-events.mjs +21 -0
  91. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  92. package/dist/lib/node-esm/common/capabilities.mjs +57 -0
  93. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  94. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  95. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  96. package/dist/lib/node-esm/core/capability.mjs +33 -0
  97. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
  99. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  100. package/dist/lib/node-esm/core/plugin.mjs +42 -0
  101. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  102. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  103. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  104. package/dist/lib/node-esm/index.mjs +85 -157
  105. package/dist/lib/node-esm/index.mjs.map +4 -4
  106. package/dist/lib/node-esm/meta.json +1 -1
  107. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs +133 -0
  108. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs.map +7 -0
  109. package/dist/lib/node-esm/testing/index.mjs +321 -56
  110. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  111. package/dist/lib/node-esm/testing/react.mjs +79 -0
  112. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  113. package/dist/lib/node-esm/ui/index.mjs +53 -0
  114. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  115. package/dist/plugin/node-esm/index.mjs +977 -0
  116. package/dist/plugin/node-esm/index.mjs.map +7 -0
  117. package/dist/plugin/node-esm/meta.json +1 -0
  118. package/dist/types/src/cli/cli.d.ts +37 -0
  119. package/dist/types/src/cli/cli.d.ts.map +1 -0
  120. package/dist/types/src/cli/index.d.ts +2 -0
  121. package/dist/types/src/cli/index.d.ts.map +1 -0
  122. package/dist/types/src/common/activation-events.d.ts +24 -0
  123. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  124. package/dist/types/src/common/annotations.d.ts +1 -0
  125. package/dist/types/src/common/annotations.d.ts.map +1 -0
  126. package/dist/types/src/common/capabilities.d.ts +214 -195
  127. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  128. package/dist/types/src/common/index.d.ts +3 -8
  129. package/dist/types/src/common/index.d.ts.map +1 -1
  130. package/dist/types/src/common/translations.d.ts +8 -8
  131. package/dist/types/src/common/translations.d.ts.map +1 -1
  132. package/dist/types/src/context.d.ts +5 -0
  133. package/dist/types/src/context.d.ts.map +1 -0
  134. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
  135. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  136. package/dist/types/src/core/capability-manager.d.ts +52 -0
  137. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  138. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  139. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  140. package/dist/types/src/core/capability.d.ts +161 -0
  141. package/dist/types/src/core/capability.d.ts.map +1 -0
  142. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  143. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  144. package/dist/types/src/core/index.d.ts +11 -4
  145. package/dist/types/src/core/index.d.ts.map +1 -1
  146. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  147. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  148. package/dist/types/src/core/plugin-manager.d.ts +297 -0
  149. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  150. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  151. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  152. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  153. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  154. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  155. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  156. package/dist/types/src/core/plugin.d.ts +308 -41
  157. package/dist/types/src/core/plugin.d.ts.map +1 -1
  158. package/dist/types/src/core/registry.d.ts +107 -0
  159. package/dist/types/src/core/registry.d.ts.map +1 -0
  160. package/dist/types/src/core/url-loader.d.ts +127 -0
  161. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  162. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  163. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  164. package/dist/types/src/helpers.d.ts.map +1 -1
  165. package/dist/types/src/index.d.ts +2 -4
  166. package/dist/types/src/index.d.ts.map +1 -1
  167. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  168. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  169. package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
  170. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  171. package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
  172. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  173. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts +32 -0
  174. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  175. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts +2 -0
  176. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  177. package/dist/types/src/plugin-process-manager/history/index.d.ts +6 -0
  178. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  179. package/dist/types/src/plugin-process-manager/history/types.d.ts +13 -0
  180. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  181. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts +101 -0
  182. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  183. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts +23 -0
  184. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  185. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts +2 -0
  186. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  187. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts +10 -0
  188. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts.map +1 -0
  189. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  190. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  191. package/dist/types/src/plugin-process-manager/meta.d.ts +3 -0
  192. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  193. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  194. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  195. package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
  196. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  197. package/dist/types/src/testing/harness.d.ts +79 -0
  198. package/dist/types/src/testing/harness.d.ts.map +1 -0
  199. package/dist/types/src/testing/index.d.ts +3 -0
  200. package/dist/types/src/testing/index.d.ts.map +1 -1
  201. package/dist/types/src/testing/operationCapture.d.ts +64 -0
  202. package/dist/types/src/testing/operationCapture.d.ts.map +1 -0
  203. package/dist/types/src/testing/react.d.ts +27 -0
  204. package/dist/types/src/testing/react.d.ts.map +1 -0
  205. package/dist/types/src/testing/react.test.d.ts +2 -0
  206. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  207. package/dist/types/src/testing/service.d.ts +8 -0
  208. package/dist/types/src/testing/service.d.ts.map +1 -0
  209. package/dist/types/src/testing/withPluginManager.d.ts +9 -10
  210. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  211. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  212. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  213. package/dist/types/src/ui/components/App/App.d.ts +41 -0
  214. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  215. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  216. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  217. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  218. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  219. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts +13 -0
  220. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  221. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  222. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  223. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  224. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  225. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  226. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  227. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts +14 -0
  228. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  229. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  230. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  231. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  232. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  233. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  234. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  235. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  236. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  237. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  238. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  239. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  240. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  241. package/dist/types/src/ui/components/index.d.ts +4 -0
  242. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  243. package/dist/types/src/ui/hooks/index.d.ts +7 -0
  244. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  245. package/dist/types/src/ui/hooks/useApp.d.ts +80 -0
  246. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  247. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  248. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  249. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  250. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  251. package/dist/types/src/ui/hooks/useLoading.d.ts +18 -0
  252. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  253. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
  254. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  255. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  256. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  257. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  258. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  259. package/dist/types/src/ui/index.d.ts +3 -0
  260. package/dist/types/src/ui/index.d.ts.map +1 -0
  261. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  262. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  263. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +59 -0
  264. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  265. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  266. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  267. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  268. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  269. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  270. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  271. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  272. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  273. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  274. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  275. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  276. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  277. package/dist/types/tsconfig.tsbuildinfo +1 -1
  278. package/moon.yml +26 -3
  279. package/package.json +125 -55
  280. package/src/cli/cli.ts +102 -0
  281. package/src/{playground/layout → cli}/index.ts +1 -1
  282. package/src/common/activation-events.ts +39 -0
  283. package/src/{playground/debug/index.ts → common/annotations.ts} +0 -2
  284. package/src/common/capabilities.ts +287 -184
  285. package/src/common/index.ts +3 -8
  286. package/src/common/translations.ts +18 -10
  287. package/src/context.ts +9 -0
  288. package/src/core/{events.ts → activation-event.ts} +10 -7
  289. package/src/core/capability-manager.test.ts +154 -0
  290. package/src/core/capability-manager.ts +213 -0
  291. package/src/core/capability.ts +254 -0
  292. package/src/core/edge-registry-plugin-provider.ts +92 -0
  293. package/src/core/index.ts +11 -4
  294. package/src/core/plugin-asset-cache.ts +60 -0
  295. package/src/core/plugin-manager.test.ts +1929 -0
  296. package/src/core/plugin-manager.ts +1696 -0
  297. package/src/core/plugin-manifest.test.ts +75 -0
  298. package/src/core/plugin-manifest.ts +134 -0
  299. package/src/core/plugin.ts +458 -46
  300. package/src/core/registry.ts +163 -0
  301. package/src/core/url-loader.test.ts +222 -0
  302. package/src/core/url-loader.ts +388 -0
  303. package/src/index.ts +2 -4
  304. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  305. package/src/plugin-process-manager/history/capability.ts +36 -0
  306. package/src/plugin-process-manager/history/errors.ts +7 -0
  307. package/src/plugin-process-manager/history/history-tracker.test.ts +353 -0
  308. package/src/plugin-process-manager/history/history-tracker.ts +144 -0
  309. package/src/plugin-process-manager/history/index.ts +9 -0
  310. package/src/plugin-process-manager/history/types.ts +17 -0
  311. package/src/plugin-process-manager/history/undo-mapping.ts +135 -0
  312. package/src/plugin-process-manager/history/undo-registry.test.ts +74 -0
  313. package/src/plugin-process-manager/history/undo-registry.ts +54 -0
  314. package/src/plugin-process-manager/idb-key-value-store.ts +64 -0
  315. package/src/plugin-process-manager/index.ts +6 -0
  316. package/src/plugin-process-manager/meta.ts +16 -0
  317. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  318. package/src/plugin-process-manager/testing.ts +156 -0
  319. package/src/testing/harness.ts +247 -0
  320. package/src/testing/index.ts +3 -0
  321. package/src/testing/operationCapture.ts +144 -0
  322. package/src/testing/react.test.tsx +50 -0
  323. package/src/testing/react.tsx +113 -0
  324. package/src/testing/service.ts +52 -0
  325. package/src/testing/withPluginManager.stories.tsx +15 -13
  326. package/src/testing/withPluginManager.tsx +81 -56
  327. package/src/ui/components/App/App.stories.tsx +84 -0
  328. package/src/ui/components/App/App.tsx +144 -0
  329. package/src/{playground/logger → ui/components/App}/index.ts +1 -1
  330. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +179 -0
  331. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  332. package/src/ui/components/PluginManager/index.ts +5 -0
  333. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
  334. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  335. package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
  336. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  337. package/src/ui/components/Surface/context.ts +12 -0
  338. package/src/ui/components/Surface/index.ts +54 -0
  339. package/src/ui/components/Surface/types.test.ts +126 -0
  340. package/src/ui/components/Surface/types.ts +290 -0
  341. package/src/ui/components/index.ts +7 -0
  342. package/src/ui/hooks/index.ts +10 -0
  343. package/src/ui/hooks/useApp.test.tsx +161 -0
  344. package/src/ui/hooks/useApp.tsx +404 -0
  345. package/src/ui/hooks/useCapabilities.ts +68 -0
  346. package/src/ui/hooks/useLoading.tsx +76 -0
  347. package/src/ui/hooks/useProcessManagerRuntime.ts +78 -0
  348. package/src/ui/hooks/useSettingsState.ts +26 -0
  349. package/src/ui/hooks/useSurface.ts +13 -0
  350. package/src/ui/index.ts +6 -0
  351. package/src/vite-plugin/boot-loader/BootLoader.solid-stories.tsx +198 -0
  352. package/src/vite-plugin/boot-loader/index.ts +5 -0
  353. package/src/vite-plugin/boot-loader/loader-app/Loader.tsx +166 -0
  354. package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +311 -0
  355. package/src/vite-plugin/boot-loader/loader-app/bridge.ts +25 -0
  356. package/src/vite-plugin/boot-loader/loader-app/entry.tsx +21 -0
  357. package/src/vite-plugin/boot-loader/loader-app/mount.tsx +70 -0
  358. package/src/vite-plugin/boot-loader/loader-app/store.test.ts +137 -0
  359. package/src/vite-plugin/boot-loader/loader-app/store.ts +149 -0
  360. package/src/vite-plugin/boot-loader/loader-app/tsconfig.json +11 -0
  361. package/src/vite-plugin/boot-loader/loader-app/types.ts +78 -0
  362. package/src/vite-plugin/boot-loader/loader.ts +204 -0
  363. package/src/vite-plugin/composer/index.ts +306 -0
  364. package/src/vite-plugin/import-map/index.ts +527 -0
  365. package/src/vite-plugin/index.ts +10 -0
  366. package/src/vite-plugin/manifest.test.ts +55 -0
  367. package/src/vite-plugin/manifest.ts +63 -0
  368. package/src/vite-plugin/packages.ts +187 -0
  369. package/tsconfig.json +31 -24
  370. package/tsconfig.node.json +2 -4
  371. package/typedoc.json +2 -4
  372. package/vitest.config.ts +8 -6
  373. package/.swc/plugins/v7_linux_x86_64_13.0.0/c614d7475354583212fbd7669acbae95b9832c305bf51bdaabe2e6de05abb6bf +0 -0
  374. package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
  375. package/dist/lib/browser/app-graph-builder-MOVKFH3J.mjs +0 -137
  376. package/dist/lib/browser/app-graph-builder-MOVKFH3J.mjs.map +0 -7
  377. package/dist/lib/browser/chunk-NKCIDYDI.mjs +0 -1598
  378. package/dist/lib/browser/chunk-NKCIDYDI.mjs.map +0 -7
  379. package/dist/lib/browser/chunk-ORWHM7CO.mjs +0 -32
  380. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  381. package/dist/lib/browser/chunk-OSBZFKMO.mjs +0 -428
  382. package/dist/lib/browser/chunk-OSBZFKMO.mjs.map +0 -7
  383. package/dist/lib/browser/intent-dispatcher-FTTJLVGN.mjs +0 -11
  384. package/dist/lib/browser/intent-resolver-ZCGEAG3E.mjs +0 -39
  385. package/dist/lib/browser/intent-resolver-ZCGEAG3E.mjs.map +0 -7
  386. package/dist/lib/browser/store-3QB6Q2BC.mjs +0 -30
  387. package/dist/lib/browser/store-3QB6Q2BC.mjs.map +0 -7
  388. package/dist/lib/browser/worker.mjs +0 -79
  389. package/dist/lib/node-esm/app-graph-builder-ODE4B5GT.mjs +0 -138
  390. package/dist/lib/node-esm/app-graph-builder-ODE4B5GT.mjs.map +0 -7
  391. package/dist/lib/node-esm/chunk-UMZQERLE.mjs +0 -34
  392. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  393. package/dist/lib/node-esm/chunk-WU3QN5B6.mjs +0 -429
  394. package/dist/lib/node-esm/chunk-WU3QN5B6.mjs.map +0 -7
  395. package/dist/lib/node-esm/chunk-YEN7NKTF.mjs +0 -1600
  396. package/dist/lib/node-esm/chunk-YEN7NKTF.mjs.map +0 -7
  397. package/dist/lib/node-esm/intent-dispatcher-YQIQ55LJ.mjs +0 -12
  398. package/dist/lib/node-esm/intent-resolver-KG27L7EQ.mjs +0 -40
  399. package/dist/lib/node-esm/intent-resolver-KG27L7EQ.mjs.map +0 -7
  400. package/dist/lib/node-esm/store-TIJAVO3D.mjs +0 -31
  401. package/dist/lib/node-esm/store-TIJAVO3D.mjs.map +0 -7
  402. package/dist/lib/node-esm/worker.mjs +0 -80
  403. package/dist/types/src/App.d.ts +0 -43
  404. package/dist/types/src/App.d.ts.map +0 -1
  405. package/dist/types/src/common/collaboration.d.ts +0 -19
  406. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  407. package/dist/types/src/common/events.d.ts +0 -52
  408. package/dist/types/src/common/events.d.ts.map +0 -1
  409. package/dist/types/src/common/file.d.ts +0 -14
  410. package/dist/types/src/common/file.d.ts.map +0 -1
  411. package/dist/types/src/common/graph.d.ts +0 -21
  412. package/dist/types/src/common/graph.d.ts.map +0 -1
  413. package/dist/types/src/common/layout.d.ts +0 -281
  414. package/dist/types/src/common/layout.d.ts.map +0 -1
  415. package/dist/types/src/common/surface.d.ts +0 -65
  416. package/dist/types/src/common/surface.d.ts.map +0 -1
  417. package/dist/types/src/core/capabilities.d.ts +0 -114
  418. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  419. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  420. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  421. package/dist/types/src/core/events.d.ts.map +0 -1
  422. package/dist/types/src/core/manager.d.ts +0 -126
  423. package/dist/types/src/core/manager.d.ts.map +0 -1
  424. package/dist/types/src/core/manager.test.d.ts +0 -2
  425. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  426. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  427. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  428. package/dist/types/src/playground/debug/index.d.ts +0 -2
  429. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  430. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  431. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  432. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  433. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  434. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  435. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  436. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  437. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  438. package/dist/types/src/playground/generator/index.d.ts +0 -3
  439. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  440. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  441. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  442. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  443. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  444. package/dist/types/src/playground/layout/index.d.ts +0 -2
  445. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  446. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  447. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  448. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  449. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  450. package/dist/types/src/playground/logger/index.d.ts +0 -2
  451. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  452. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  453. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  454. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  455. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  456. package/dist/types/src/playground/playground.stories.d.ts +0 -10
  457. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  458. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  459. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  460. package/dist/types/src/plugin-intent/actions.d.ts +0 -38
  461. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  462. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  463. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  464. package/dist/types/src/plugin-intent/index.d.ts +0 -5
  465. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  466. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  467. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  468. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  469. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  470. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  471. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  472. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  473. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  474. package/dist/types/src/plugin-settings/actions.d.ts +0 -27
  475. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  476. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  477. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  478. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  479. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  480. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  481. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  482. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  483. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  484. package/dist/types/src/plugin-settings/translations.d.ts +0 -10
  485. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  486. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  487. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  488. package/dist/types/src/react/IntentContext.d.ts +0 -8
  489. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  490. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  491. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  492. package/dist/types/src/react/Surface.d.ts +0 -12
  493. package/dist/types/src/react/Surface.d.ts.map +0 -1
  494. package/dist/types/src/react/Surface.stories.d.ts +0 -16
  495. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  496. package/dist/types/src/react/common.d.ts +0 -13
  497. package/dist/types/src/react/common.d.ts.map +0 -1
  498. package/dist/types/src/react/index.d.ts +0 -7
  499. package/dist/types/src/react/index.d.ts.map +0 -1
  500. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  501. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  502. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  503. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  504. package/dist/types/src/worker.d.ts +0 -4
  505. package/dist/types/src/worker.d.ts.map +0 -1
  506. package/src/App.tsx +0 -284
  507. package/src/common/collaboration.ts +0 -21
  508. package/src/common/events.ts +0 -79
  509. package/src/common/file.ts +0 -22
  510. package/src/common/graph.ts +0 -30
  511. package/src/common/layout.ts +0 -278
  512. package/src/common/surface.ts +0 -86
  513. package/src/core/capabilities.test.ts +0 -136
  514. package/src/core/capabilities.ts +0 -255
  515. package/src/core/manager.test.ts +0 -516
  516. package/src/core/manager.ts +0 -597
  517. package/src/playground/debug/Debug.tsx +0 -39
  518. package/src/playground/debug/plugin.ts +0 -17
  519. package/src/playground/generator/Main.tsx +0 -71
  520. package/src/playground/generator/Toolbar.tsx +0 -47
  521. package/src/playground/generator/generator.ts +0 -48
  522. package/src/playground/generator/index.ts +0 -6
  523. package/src/playground/generator/plugin.ts +0 -23
  524. package/src/playground/layout/Layout.tsx +0 -33
  525. package/src/playground/layout/plugin.ts +0 -17
  526. package/src/playground/logger/Toolbar.tsx +0 -30
  527. package/src/playground/logger/plugin.ts +0 -37
  528. package/src/playground/logger/schema.ts +0 -12
  529. package/src/playground/playground.stories.tsx +0 -43
  530. package/src/plugin-intent/IntentPlugin.ts +0 -21
  531. package/src/plugin-intent/actions.ts +0 -33
  532. package/src/plugin-intent/errors.ts +0 -39
  533. package/src/plugin-intent/index.ts +0 -8
  534. package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
  535. package/src/plugin-intent/intent-dispatcher.ts +0 -334
  536. package/src/plugin-intent/intent.ts +0 -154
  537. package/src/plugin-settings/SettingsPlugin.ts +0 -36
  538. package/src/plugin-settings/actions.ts +0 -29
  539. package/src/plugin-settings/app-graph-builder.ts +0 -158
  540. package/src/plugin-settings/index.ts +0 -6
  541. package/src/plugin-settings/intent-resolver.ts +0 -35
  542. package/src/plugin-settings/store.ts +0 -33
  543. package/src/plugin-settings/translations.ts +0 -19
  544. package/src/react/ErrorBoundary.tsx +0 -54
  545. package/src/react/IntentContext.tsx +0 -35
  546. package/src/react/Surface.stories.tsx +0 -97
  547. package/src/react/Surface.tsx +0 -78
  548. package/src/react/common.ts +0 -13
  549. package/src/react/index.ts +0 -10
  550. package/src/react/useCapabilities.ts +0 -31
  551. package/src/react/useIntentResolver.ts +0 -22
  552. package/src/worker.ts +0 -11
  553. /package/dist/lib/browser/{intent-dispatcher-FTTJLVGN.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  554. /package/dist/lib/browser/{worker.mjs.map → common/activation-events.mjs.map} +0 -0
  555. /package/dist/lib/{node-esm/intent-dispatcher-YQIQ55LJ.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  556. /package/dist/lib/{node-esm/worker.mjs.map → browser/core/activation-event.mjs.map} +0 -0
@@ -0,0 +1,197 @@
1
+ import type { FC, PropsWithChildren, ReactNode, RefCallback } from 'react';
2
+ import type { MakeOptional, Position } from '@dxos/util';
3
+ /**
4
+ * A typed role token. Carries a role string for runtime dispatch plus a phantom
5
+ * data type so consumers using `type={SomeToken}` and providers using
6
+ * `AppSurface.object(SomeToken, ...)` share a single type-level contract.
7
+ *
8
+ * Mint via {@link makeType}.
9
+ */
10
+ export type RoleToken<TData> = {
11
+ readonly role: string;
12
+ /** Covariant phantom; never accessed at runtime. */
13
+ readonly _phantom?: TData;
14
+ };
15
+ /**
16
+ * One entry in a {@link SurfaceFilter} — a role plus the guard that validates
17
+ * the data shape when the Surface dispatcher is matching that role.
18
+ */
19
+ export type SurfaceBinding = {
20
+ readonly role: string;
21
+ readonly guard: (data: unknown) => boolean;
22
+ };
23
+ /**
24
+ * Typed filter binding for {@link create}. Combines one or more `(role, guard)`
25
+ * pairs so a provider can register against multiple roles while keeping the
26
+ * role and its data shape in a single expression.
27
+ */
28
+ export type SurfaceFilter<TData> = {
29
+ readonly bindings: ReadonlyArray<SurfaceBinding>;
30
+ /** Covariant phantom; never accessed at runtime. */
31
+ readonly _phantom?: TData;
32
+ };
33
+ /**
34
+ * Narrow data type carried by a role token.
35
+ */
36
+ export type TokenData<T> = T extends RoleToken<infer D> ? D : never;
37
+ /**
38
+ * Runtime guard for {@link SurfaceFilter}. Distinguishes new-style filter
39
+ * bindings from legacy predicate filters.
40
+ */
41
+ export declare const isSurfaceFilter: (value: unknown) => value is SurfaceFilter<any>;
42
+ /**
43
+ * Mints a typed role token. Identity is structural; all tokens with the same
44
+ * `role` string are interchangeable at runtime.
45
+ */
46
+ export declare const makeType: <TData>(role: string) => RoleToken<TData>;
47
+ /**
48
+ * Props that are passed to the Surface component.
49
+ *
50
+ * The role can be provided either as a string via `role` or as a typed
51
+ * {@link RoleToken} via `type`. The typed form narrows `data` to the token's
52
+ * declared shape.
53
+ */
54
+ export type Props<T extends Record<string, any> = Record<string, unknown>> = {
55
+ /**
56
+ * If specified, the Surface will be wrapped in an error boundary.
57
+ * The fallback component will be rendered if an error occurs.
58
+ */
59
+ fallback?: FC<{
60
+ error: Error;
61
+ data?: any;
62
+ }>;
63
+ /**
64
+ * If specified, the Surface will be wrapped in a suspense boundary.
65
+ * The placeholder component will be rendered while the surface component is loading.
66
+ */
67
+ placeholder?: ReactNode;
68
+ } & MakeOptional<CoreProps<T>, 'id' | 'data' | 'role'> & {
69
+ /**
70
+ * Explicitly disallow `type` on the untyped Props overload — if the caller
71
+ * provides `type={AppSurface.X}`, TypeScript must route to the typed
72
+ * overload (where `data` is narrowed by the token). Without this, the
73
+ * catch-all index signature below would accept any `type` value and mask
74
+ * the typed overload entirely.
75
+ */
76
+ type?: undefined;
77
+ } /**
78
+ * Additional props to pass to the component.
79
+ * These props are not used by Surface itself but may be used by components which resolve the surface.
80
+ * Exclude known prop names to prevent overriding well-defined props.
81
+ */ & {
82
+ [K in keyof Record<string, any>]: K extends keyof CoreProps<T> | 'fallback' | 'placeholder' | 'type' ? never : any;
83
+ };
84
+ /**
85
+ * Typed Surface consumer props — carries the role/data-shape contract via a
86
+ * {@link RoleToken}. Available as a typed overload of the Surface component so
87
+ * ad-hoc `type` fields on arbitrary spread props don't conflict with the
88
+ * untyped consumer form.
89
+ */
90
+ export type TypedProps<TToken extends RoleToken<any>> = {
91
+ fallback?: FC<{
92
+ error: Error;
93
+ data?: any;
94
+ }>;
95
+ placeholder?: ReactNode;
96
+ id?: string;
97
+ type: TToken;
98
+ data?: TokenData<TToken>;
99
+ limit?: number | undefined;
100
+ } & {
101
+ [K in keyof Record<string, any>]: K extends 'fallback' | 'placeholder' | 'id' | 'type' | 'data' | 'limit' ? never : any;
102
+ };
103
+ /**
104
+ * NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.
105
+ */
106
+ export type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
107
+ /**
108
+ * ID for debugging.
109
+ */
110
+ id: string;
111
+ /**
112
+ * Role defines how the data should be rendered. For new code, prefer the
113
+ * typed overload of the Surface component which takes a {@link RoleToken}
114
+ * via the `type` prop instead — it enforces a role/data contract at compile
115
+ * time.
116
+ */
117
+ role: string;
118
+ /**
119
+ * The data to be rendered by the surface.
120
+ * NOTE: This must be a stable value.
121
+ */
122
+ data: T;
123
+ /**
124
+ * If more than one component is resolved, the limit determines how many are rendered.
125
+ */
126
+ limit?: number | undefined;
127
+ }>;
128
+ export type ComponentProps<T extends Record<string, any> = Record<string, any>> = CoreProps<T> & {
129
+ ref?: RefCallback<HTMLElement>;
130
+ } & Record<string, any>;
131
+ /**
132
+ * React component used to render a surface once is has matched.
133
+ */
134
+ export type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (props: ComponentProps<T>) => ReactNode;
135
+ /**
136
+ * Definition of when a React component surface should be rendered.
137
+ *
138
+ * The optional `filter` receives the consumer-supplied `role` as its second
139
+ * argument so a single definition can encode role-specific guards (used by the
140
+ * {@link SurfaceFilter}-based `create` overload).
141
+ */
142
+ export type ReactDefinition<T extends Record<string, any> = any> = Readonly<{
143
+ kind: 'react';
144
+ id: string;
145
+ role: string | string[];
146
+ position?: Position;
147
+ component: ComponentFunction<T>;
148
+ filter?: (data: Record<string, unknown>, role?: string) => data is T;
149
+ }>;
150
+ /**
151
+ * Definition of when a Web Component surface should be rendered.
152
+ */
153
+ export type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{
154
+ kind: 'web-component';
155
+ id: string;
156
+ role: string | string[];
157
+ position?: Position;
158
+ /**
159
+ * The tag name of the Web Component to render.
160
+ * The Web Component will receive the same props as React surfaces via properties/attributes.
161
+ */
162
+ tagName: string;
163
+ filter?: (data: Record<string, unknown>, role?: string) => data is T;
164
+ }>;
165
+ /**
166
+ * Definition of when a surface (React or Web Component) should be rendered.
167
+ */
168
+ export type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;
169
+ /**
170
+ * Typed React surface definition — role is derived from the filter's bindings.
171
+ */
172
+ export type TypedReactDefinition<T extends Record<string, any> = any> = Readonly<{
173
+ id: string;
174
+ filter: SurfaceFilter<T>;
175
+ component: ComponentFunction<T>;
176
+ position?: Position;
177
+ }>;
178
+ /**
179
+ * Typed Web Component surface definition.
180
+ */
181
+ export type TypedWebComponentDefinition<T extends Record<string, any> = any> = Readonly<{
182
+ id: string;
183
+ filter: SurfaceFilter<T>;
184
+ tagName: string;
185
+ position?: Position;
186
+ }>;
187
+ /**
188
+ * Creates a React surface definition.
189
+ */
190
+ export declare function create<T extends Record<string, any> = any>(definition: TypedReactDefinition<T>): ReactDefinition<T>;
191
+ export declare function create<T extends Record<string, any> = any>(definition: Omit<ReactDefinition<T>, 'kind'>): ReactDefinition<T>;
192
+ /**
193
+ * Creates a Web Component surface definition.
194
+ */
195
+ export declare function createWeb<T extends Record<string, any> = any>(definition: TypedWebComponentDefinition<T>): WebComponentDefinition<T>;
196
+ export declare function createWeb<T extends Record<string, any> = any>(definition: Omit<WebComponentDefinition<T>, 'kind'>): WebComponentDefinition<T>;
197
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/Surface/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,KAAK,IAAI;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI;IACjC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACjD,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEpE;;;GAGG;AACH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test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './App';
2
+ export * from './PluginManager';
3
+ export * from './Surface';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './useApp';
2
+ export * from './useCapabilities';
3
+ export * from './useLoading';
4
+ export * from './useProcessManagerRuntime';
5
+ export * from './useSettingsState';
6
+ export * from './useSurface';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,80 @@
1
+ import React, { type FC } from 'react';
2
+ import { type FallbackProps } from '@dxos/react-error-boundary';
3
+ import { type ActivationEvent, type Plugin, PluginManager } from '../../core';
4
+ export type StartupProgress = {
5
+ /** Number of modules that have been activated. */
6
+ activated: number;
7
+ /** Total number of modules registered. */
8
+ total: number;
9
+ /** Fractional progress (0-1). */
10
+ progress: number;
11
+ /**
12
+ * Raw activation event key (e.g. `org.dxos.app-framework.event.startup`).
13
+ * Set on event-level transitions, *and* on module-level transitions where
14
+ * it carries the parent activation event that first triggered the
15
+ * module's load (plumbed through `_loadCapabilitiesForModules` →
16
+ * `_loadModule`). Consumers can use this either as the primary id (when
17
+ * {@link module} is absent) or as an extra "context" field alongside
18
+ * {@link module}.
19
+ */
20
+ event?: string;
21
+ /**
22
+ * Raw module id (e.g. `org.dxos.plugin.observability.module.ReactSurface`)
23
+ * when the in-flight activation is module-level. When present,
24
+ * {@link event} may also be set, identifying the parent activation that
25
+ * triggered this module's load.
26
+ */
27
+ module?: string;
28
+ /**
29
+ * Pre-humanized label for the currently surfaced transition (module
30
+ * label if {@link module} is set, otherwise the event label), supplied
31
+ * for consumers that want a sensible default. Hosts that prefer to
32
+ * render their own label can read the raw {@link event}/{@link module}
33
+ * fields and ignore this — the framework leaves the policy choice
34
+ * (which transitions to surface, how to format them, whether to drop
35
+ * sub-modules entirely) to the host's `Placeholder`.
36
+ */
37
+ humanizedName?: string;
38
+ };
39
+ export type UseAppOptions = {
40
+ pluginManager?: PluginManager.PluginManager;
41
+ pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];
42
+ onPluginRemove?: PluginManager.ManagerOptions['onRemove'];
43
+ pluginRegistryProvider?: PluginManager.ManagerOptions['pluginRegistryProvider'];
44
+ plugins?: Plugin.Plugin[];
45
+ defaults?: string[];
46
+ /**
47
+ * Additional activation events to fire before startup.
48
+ * These are fired alongside SetupReactSurface before the Startup event.
49
+ */
50
+ setupEvents?: ActivationEvent.ActivationEvent[];
51
+ cacheEnabled?: boolean;
52
+ safeMode?: boolean;
53
+ debounce?: number;
54
+ timeout?: number;
55
+ fallback?: FC<FallbackProps>;
56
+ };
57
+ /**
58
+ * Expected usage is for this to be the entrypoint of the application.
59
+ * Initializes plugins and renders the root components.
60
+ *
61
+ * @example
62
+ * const plugins = [LayoutPlugin(), MyPlugin()];
63
+ * const defaults = [MyPluginId];
64
+ * const fallback = () => <div>Initializing Plugins...</div>;
65
+ * const App = useApp({ plugins, defaults, fallback });
66
+ * createRoot(document.getElementById('root')!).render(
67
+ * <StrictMode>
68
+ * <App />
69
+ * </StrictMode>,
70
+ * );
71
+ *
72
+ * @param params.pluginLoader A function which loads new plugins.
73
+ * @param params.plugins All plugins available to the application. Plugins whose `meta.tags` includes `'system'` are treated as core (force-enabled, not user-toggleable).
74
+ * @param params.defaults Default plugins are enabled by default but can be disabled by the user.
75
+ * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
76
+ * @param params.safeMode Whether to enable safe mode, which disables optional plugins.
77
+ * @param params.fallback Fallback component to render if an error occurs during startup.
78
+ */
79
+ export declare const useApp: ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, pluginRegistryProvider, plugins: pluginsProp, defaults: defaultsProp, setupEvents: setupEventsProp, fallback, cacheEnabled, safeMode, debounce, timeout, }: UseAppOptions) => () => React.JSX.Element;
80
+ //# sourceMappingURL=useApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useApp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useApp.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAqD,MAAM,OAAO,CAAC;AAK1F,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAM9F,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK9E,MAAM,MAAM,eAAe,GAAG;IAC5B,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC;IAC5C,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5D,cAAc,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1D,sBAAsB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,eAAe,EAAE,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,MAAM,gOAahB,aAAa,4BA0Nf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useApp.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useApp.test.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useApp.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import { type Atom } from '@effect-atom/atom-react';
2
+ import { Capabilities } from '../../common';
3
+ import { type Capability } from '../../core';
4
+ /**
5
+ * Hook to request capabilities from the plugin context.
6
+ * @returns An array of capabilities.
7
+ */
8
+ export declare const useCapabilities: <T>(interfaceDef: Capability.InterfaceDef<T>) => T[];
9
+ /**
10
+ * Hook to request a capability from the plugin context.
11
+ * @returns The capability.
12
+ * @throws If no capability is found.
13
+ */
14
+ export declare const useCapability: <T>(interfaceDef: Capability.InterfaceDef<T>) => T;
15
+ /**
16
+ * Hook to get the current value of an atom capability.
17
+ * Automatically subscribes to changes.
18
+ * @example const settings = useAtomCapability(CommentCapabilities.Settings);
19
+ */
20
+ export declare const useAtomCapability: <T>(atomCapability: Capability.InterfaceDef<Atom.Atom<T>>) => T;
21
+ /**
22
+ * Hook to get value and updater for an atom capability.
23
+ * Returns [currentValue, updateFn] similar to useState.
24
+ * @example const [settings, updateSettings] = useAtomCapabilityState(CommentCapabilities.Settings);
25
+ */
26
+ export declare const useAtomCapabilityState: <T>(atomCapability: Capability.InterfaceDef<Atom.Writable<T>>) => [T, (fn: (current: T) => T) => void];
27
+ /**
28
+ * Hook to get the operation invoker capability.
29
+ */
30
+ export declare const useOperationInvoker: () => Capabilities.OperationInvoker;
31
+ //# sourceMappingURL=useCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useCapabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAKlE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,gBAAgB,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,QAG1E,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,aAAa,GAAI,CAAC,gBAAgB,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAIxE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,kBAAkB,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAG,CAG5F,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,kBACtB,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KACxD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAWrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAO,YAAY,CAAC,gBAAgE,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare enum LoadingState {
2
+ Loading = 0,
3
+ FadeIn = 1,
4
+ FadeOut = 2,
5
+ Done = 3
6
+ }
7
+ /**
8
+ * To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
9
+ * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
10
+ *
11
+ * States:
12
+ * 0: Loading - Wait for a period of time before starting the loading animation.
13
+ * 1: Fade-in - Display a loading animation.
14
+ * 2: Fade-out - Fade out the loading animation.
15
+ * 3: Done - Remove the placeholder.
16
+ */
17
+ export declare const useLoading: (ready: boolean, debounce?: number) => LoadingState;
18
+ //# sourceMappingURL=useLoading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoading.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useLoading.tsx"],"names":[],"mappings":"AAMA,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,UAAW,OAAO,oCAoDxC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import { type DependencyList } from 'react';
4
+ import type { SpaceId } from '@dxos/keys';
5
+ import { Capabilities } from '../../common';
6
+ /**
7
+ * Resolve the shared {@link Capabilities.ProcessManagerRuntime} from the plugin context.
8
+ */
9
+ export declare const useProcessManagerRuntime: () => Capabilities.ProcessManagerRuntime;
10
+ /**
11
+ * Build a callback that runs an effect on the {@link Capabilities.ProcessManagerRuntime}
12
+ * with space-scoped services resolved via {@link ServiceResolver.provide}.
13
+ *
14
+ * The `tags` tuple must list every service the effect requires (beyond the
15
+ * fixed {@link Capabilities.ProcessManagerRuntimeServices}); these services are
16
+ * resolved for the given `spaceId` through the runtime's service resolver.
17
+ *
18
+ * Nested `Operation.invoke` / `Operation.schedule` calls within the effect
19
+ * inherit `spaceId` as a default {@link Operation.InvokeOptions} so that
20
+ * spawned operation processes have a space context (and therefore can resolve
21
+ * space-scoped services like `Database.Service`) without each call site having
22
+ * to thread the id through manually.
23
+ */
24
+ export declare const useSpaceCallback: <const Tags extends readonly Context.Tag<any, any>[], T>(spaceId: SpaceId | undefined, tags: Tags, fn: () => Effect.Effect<T, any, Context.Tag.Identifier<Tags[number]> | Capabilities.ProcessManagerRuntimeServices>, deps?: DependencyList) => (() => Promise<T>);
25
+ /**
26
+ * Suspensefully resolve a single space-scoped service via the
27
+ * {@link Capabilities.ProcessManagerRuntime}'s service resolver.
28
+ */
29
+ export declare const useSpaceService: <T extends Context.Tag<any, any>>(tag: T, spaceId: SpaceId | undefined) => Context.Tag.Service<T> | undefined;
30
+ //# sourceMappingURL=useProcessManagerRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProcessManagerRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useProcessManagerRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAIvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,YAAY,CAAC,qBACN,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,CAAC,IAAI,SAAS,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,WAC5E,OAAO,GAAG,SAAS,QACtB,IAAI,MACN,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,6BAA6B,CAAC,SAC3G,cAAc,KACpB,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAanB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,OACxD,CAAC,WACG,OAAO,GAAG,SAAS,KAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAc3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type Atom } from '@effect-atom/atom-react';
2
+ /**
3
+ * Hook to read and update a settings atom.
4
+ * Returns the current value and an update function.
5
+ */
6
+ export declare const useSettingsState: <T>(atom: Atom.Writable<T>) => {
7
+ settings: T;
8
+ updateSettings: (fn: (current: T) => T) => void;
9
+ };
10
+ //# sourceMappingURL=useSettingsState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSettingsState.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSettingsState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAiC,MAAM,yBAAyB,CAAC;AAGnF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,QAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KACrB;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;CAYhE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Surface } from '../components';
2
+ export declare const useSurface: () => Surface.Context;
3
+ //# sourceMappingURL=useSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurface.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSurface.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAErC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './loader';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { type Plugin } from 'vite';
2
+ /**
3
+ * Options for {@link bootLoaderPlugin}.
4
+ */
5
+ export type BootLoaderOptions = {
6
+ /**
7
+ * Initial status text rendered by the loader (replaced via
8
+ * `window.__bootLoader.status(...)` once the host starts firing phase callbacks).
9
+ */
10
+ status?: string;
11
+ /**
12
+ * Inline SVG markup for an optional brand mark rendered inside the progress
13
+ * ring. The mark renders at full opacity with whatever fills the SVG declares,
14
+ * so pass a colour-palette logo for the strongest visual identity. SVGs that
15
+ * use `fill="currentColor"` still inherit the loader's `prefers-color-scheme`
16
+ * text colour. Leave empty/undefined to render only the ring.
17
+ */
18
+ markSvg?: string;
19
+ /**
20
+ * HTML entry filenames to inject the loader into. Defaults to `index.html` only
21
+ * so auxiliary pages (`recovery.html`, `reset.html`, etc.) stay unobstructed.
22
+ */
23
+ include?: string[];
24
+ };
25
+ /**
26
+ * Vite plugin that injects a Solid "boot loader" app into the host app's
27
+ * `index.html`.
28
+ *
29
+ * The full-screen backdrop paints on the very first frame from an inline
30
+ * `<style>` (before any JS bundle is fetched), so the user sees the loading
31
+ * surface immediately on cold load instead of a blank document. A compiled,
32
+ * self-contained Solid IIFE — inlined ahead of the app bundle — then renders
33
+ * the determinate progress ring + status log into that backdrop and exposes the
34
+ * host-facing driver on `window.__bootLoader`.
35
+ *
36
+ * The host app drives the loader (the React relay forwards `useApp`'s startup
37
+ * progress):
38
+ * - `window.__bootLoader.status(payload)` updates the status line per phase.
39
+ * - `window.__bootLoader.progress(fraction)` grows the determinate ring (0–1).
40
+ * - `window.__bootLoader.ready()` plays the dismissal outro, then self-removes.
41
+ * - `window.__bootLoader.dismiss()` removes the loader immediately (fast path).
42
+ *
43
+ * Inject order (all at the start of `<body>`, except the stylesheet):
44
+ * - `<style>` → `<head>` (parses before any bundled stylesheet).
45
+ * - `<div id="boot-loader">` → the static backdrop the CSS styles instantly.
46
+ * - inline `<script>` config (`window.__BOOT_LOADER_CONFIG__`) → before the bundle.
47
+ * - inline `<script>` loader bundle → renders the Solid app into the backdrop.
48
+ *
49
+ * Keeping the loader a sibling of `#root` (rather than a child) means
50
+ * `createRoot(document.getElementById('root')).render(...)` does not fight the
51
+ * loader for ownership; the framework explicitly dismisses after the first
52
+ * React commit for a deterministic handoff.
53
+ *
54
+ * Color tokens are exposed as CSS custom properties (`--boot-loader-bg-light`,
55
+ * etc.) in `boot-loader.css`, so consumers can override them at the document
56
+ * level without re-parameterizing this plugin.
57
+ */
58
+ export declare const bootLoaderPlugin: ({ status, markSvg, include }?: BootLoaderOptions) => Plugin;
59
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/loader.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAcnC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2EF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB,kCAAmD,iBAAiB,KAAQ,MA4CxG,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type Plugin as VitePlugin } from 'vite';
2
+ import { type BuildMeta, ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest } from '../manifest';
3
+ export { ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest };
4
+ export type { BuildMeta };
5
+ export type ComposerPluginOptions = {
6
+ /** Entry point for the plugin bundle. Defaults to `src/plugin.tsx`. */
7
+ entry?: string;
8
+ /** Dev server port. Defaults to {@link PLUGIN_DEV_SERVER_PORT}. */
9
+ port?: number;
10
+ /**
11
+ * Plugin metadata. When provided, a `manifest.json` asset is emitted alongside the bundle
12
+ * listing every emitted file. The host fetches this manifest at install time and persists
13
+ * the declared assets in its offline cache so the plugin works without network. The bundle's
14
+ * entry module is always written as {@link ENTRY_FILENAME} (`index.mjs`).
15
+ */
16
+ meta?: BuildMeta;
17
+ };
18
+ /**
19
+ * Vite plugin for **external Composer plugin projects**. Configures the build to produce
20
+ * an ESM bundle that externalizes all framework dependencies, which the Composer host app
21
+ * provides at runtime via import map.
22
+ *
23
+ * Handles:
24
+ * 1. Build config — lib mode entry point, ES format output, rollup externals, code-split chunks.
25
+ * 2. Dev externalization — marks shared deps as external during `vite serve` and strips
26
+ * the `/@id/` prefix that Vite's import analysis adds to external bare specifiers.
27
+ * 3. JSX dev runtime shim — bridges `react/jsx-dev-runtime` (used by React refresh in dev)
28
+ * to `react/jsx-runtime` (which is what the externalized React provides).
29
+ * 4. Manifest emit — when `meta` is supplied, writes `manifest.json` next to the bundled
30
+ * module listing every emitted asset (entry, CSS, chunks, etc.) so the host can eagerly
31
+ * cache them for offline use.
32
+ */
33
+ export declare const composerPlugin: (options?: ComposerPluginOptions) => VitePlugin[];
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/composer/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAGjD,OAAO,EAAE,KAAK,SAAS,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrG,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;AAClE,YAAY,EAAE,SAAS,EAAE,CAAC;AAwD1B,MAAM,MAAM,qBAAqB,GAAG;IAClC,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,aAAc,qBAAqB,KAAG,UAAU,EAiN1E,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { type Plugin } from 'vite';
2
+ /**
3
+ * Vite plugin for the **host app** (Composer). Generates a browser import map so that
4
+ * shared packages are loaded once and reused by both the host and any remote plugins.
5
+ *
6
+ * In production, emits a dedicated chunk per specifier via virtual wrapper modules,
7
+ * then injects a `<script type="importmap">` tag into the HTML with the chunk URLs.
8
+ *
9
+ * Virtual wrappers are needed because directly emitting chunks for CJS packages loses
10
+ * their named exports due to Rollup's interop. The wrapper re-exports them explicitly.
11
+ *
12
+ * TODO: Restore dev-mode support. The previous dev path mapped each bare specifier to
13
+ * its absolute `/@fs/` file path during `buildStart`, which forced `this.resolve()` for
14
+ * hundreds of subpath entrypoints and raced with Vite's optimize-deps static scan —
15
+ * producing non-deterministic chunk content (~34 chunks drifting per warm-start) and
16
+ * triggering Vite 8.0.10's `runOptimizer` / `commitProcessing` crashes (`fileHash` /
17
+ * `browserHash` undefined on partial-discovery batches). Plugin is currently gated to
18
+ * `apply: 'build'` to avoid both. A working dev-mode implementation would need to
19
+ * resolve specifiers without participating in the optimize-deps phase — candidates:
20
+ * - defer resolution to `transformIndexHtml` (after the optimizer settles)
21
+ * - read resolved paths from `environment.depsOptimizer.metadata` rather than calling
22
+ * `this.resolve()` ourselves
23
+ * - resolve via `require.resolve` directly, bypassing the Vite plugin pipeline entirely
24
+ */
25
+ export declare const importMapPlugin: (options?: {
26
+ packages?: string[];
27
+ }) => Plugin[];
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/import-map/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAmUnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,eAAe,aAAc;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,KAAG,MAAM,EA4KzE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './boot-loader';
2
+ export * from './composer';
3
+ export * from './import-map';
4
+ export * from './packages';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC"}