@dxos/app-framework 0.8.4-main.b97322e → 0.8.4-main.bc2380dfbc

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 (571) 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-HRFPP52W.mjs +35 -0
  6. package/dist/lib/browser/capability-HRFPP52W.mjs.map +7 -0
  7. package/dist/lib/browser/capability-VQ236TY5.mjs +38 -0
  8. package/dist/lib/browser/capability-VQ236TY5.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-23D4SJUE.mjs +42 -0
  10. package/dist/lib/browser/chunk-23D4SJUE.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-3JWJXGLK.mjs +79 -0
  12. package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-45CHLTBV.mjs +34 -0
  14. package/dist/lib/browser/chunk-45CHLTBV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
  16. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-6GZYCP73.mjs +422 -0
  18. package/dist/lib/browser/chunk-6GZYCP73.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-7VZJR2OA.mjs +581 -0
  20. package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  22. package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  24. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-G6Q2M2M5.mjs +218 -0
  26. package/dist/lib/browser/chunk-G6Q2M2M5.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-J43JDWAV.mjs +1445 -0
  28. package/dist/lib/browser/chunk-J43JDWAV.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  30. package/dist/lib/browser/chunk-WBHCSOBW.mjs +80 -0
  31. package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-XLYULXAO.mjs +469 -0
  33. package/dist/lib/browser/chunk-XLYULXAO.mjs.map +7 -0
  34. package/dist/lib/browser/chunk-ZGJAZSNE.mjs +142 -0
  35. package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
  36. package/dist/lib/browser/cli/index.mjs +76 -0
  37. package/dist/lib/browser/cli/index.mjs.map +7 -0
  38. package/dist/lib/browser/common/activation-events.mjs +24 -0
  39. package/dist/lib/browser/common/capabilities.mjs +46 -0
  40. package/dist/lib/browser/core/activation-event.mjs +20 -0
  41. package/dist/lib/browser/core/capability.mjs +30 -0
  42. package/dist/lib/browser/core/capability.mjs.map +7 -0
  43. package/dist/lib/browser/core/plugin-manager.mjs +19 -0
  44. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  45. package/dist/lib/browser/core/plugin.mjs +39 -0
  46. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  47. package/dist/lib/browser/core/url-loader.mjs +24 -0
  48. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  49. package/dist/lib/browser/index.mjs +108 -156
  50. package/dist/lib/browser/index.mjs.map +4 -4
  51. package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs +44 -0
  52. package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs.map +7 -0
  53. package/dist/lib/browser/meta.json +1 -1
  54. package/dist/lib/browser/testing/index.mjs +236 -51
  55. package/dist/lib/browser/testing/index.mjs.map +4 -4
  56. package/dist/lib/browser/testing/react.mjs +78 -0
  57. package/dist/lib/browser/testing/react.mjs.map +7 -0
  58. package/dist/lib/browser/ui/index.mjs +48 -0
  59. package/dist/lib/browser/ui/index.mjs.map +7 -0
  60. package/dist/lib/node-esm/capability-GS3XJH74.mjs +39 -0
  61. package/dist/lib/node-esm/capability-GS3XJH74.mjs.map +7 -0
  62. package/dist/lib/node-esm/capability-I5P7ACFL.mjs +36 -0
  63. package/dist/lib/node-esm/capability-I5P7ACFL.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
  65. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-4RJL37GN.mjs +423 -0
  67. package/dist/lib/node-esm/chunk-4RJL37GN.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-6XW6LET6.mjs +35 -0
  69. package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-D347W3KO.mjs +143 -0
  71. package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-DW45NFLW.mjs +1446 -0
  73. package/dist/lib/node-esm/chunk-DW45NFLW.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-EI4LYXFY.mjs +470 -0
  75. package/dist/lib/node-esm/chunk-EI4LYXFY.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  77. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-KIFOQXD4.mjs +219 -0
  79. package/dist/lib/node-esm/chunk-KIFOQXD4.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-SBS2YMPT.mjs +43 -0
  81. package/dist/lib/node-esm/chunk-SBS2YMPT.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs +80 -0
  83. package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-V24UWT36.mjs +582 -0
  85. package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
  86. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs +81 -0
  87. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
  88. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  89. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  90. package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
  91. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  92. package/dist/lib/node-esm/cli/index.mjs +77 -0
  93. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  94. package/dist/lib/node-esm/common/activation-events.mjs +25 -0
  95. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  96. package/dist/lib/node-esm/common/capabilities.mjs +47 -0
  97. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  99. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  100. package/dist/lib/node-esm/core/capability.mjs +31 -0
  101. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  102. package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
  103. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  104. package/dist/lib/node-esm/core/plugin.mjs +40 -0
  105. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  106. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  107. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  108. package/dist/lib/node-esm/index.mjs +108 -156
  109. package/dist/lib/node-esm/index.mjs.map +4 -4
  110. package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs +45 -0
  111. package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs.map +7 -0
  112. package/dist/lib/node-esm/meta.json +1 -1
  113. package/dist/lib/node-esm/testing/index.mjs +236 -51
  114. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  115. package/dist/lib/node-esm/testing/react.mjs +79 -0
  116. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  117. package/dist/lib/node-esm/ui/index.mjs +49 -0
  118. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  119. package/dist/plugin/node-esm/index.mjs +893 -0
  120. package/dist/plugin/node-esm/index.mjs.map +7 -0
  121. package/dist/plugin/node-esm/meta.json +1 -0
  122. package/dist/types/src/cli/cli.d.ts +39 -0
  123. package/dist/types/src/cli/cli.d.ts.map +1 -0
  124. package/dist/types/src/cli/index.d.ts +2 -0
  125. package/dist/types/src/cli/index.d.ts.map +1 -0
  126. package/dist/types/src/common/activation-events.d.ts +27 -0
  127. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  128. package/dist/types/src/common/annotations.d.ts +1 -0
  129. package/dist/types/src/common/annotations.d.ts.map +1 -0
  130. package/dist/types/src/common/capabilities.d.ts +110 -123
  131. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  132. package/dist/types/src/common/index.d.ts +4 -8
  133. package/dist/types/src/common/index.d.ts.map +1 -1
  134. package/dist/types/src/common/operations.d.ts +19 -0
  135. package/dist/types/src/common/operations.d.ts.map +1 -0
  136. package/dist/types/src/common/translations.d.ts +8 -8
  137. package/dist/types/src/common/translations.d.ts.map +1 -1
  138. package/dist/types/src/context.d.ts +5 -0
  139. package/dist/types/src/context.d.ts.map +1 -0
  140. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
  141. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  142. package/dist/types/src/core/capability-manager.d.ts +48 -0
  143. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  144. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  145. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  146. package/dist/types/src/core/capability.d.ts +156 -0
  147. package/dist/types/src/core/capability.d.ts.map +1 -0
  148. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  149. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  150. package/dist/types/src/core/index.d.ts +11 -4
  151. package/dist/types/src/core/index.d.ts.map +1 -1
  152. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  153. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  154. package/dist/types/src/core/plugin-manager.d.ts +298 -0
  155. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  156. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  157. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  158. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  159. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  160. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  161. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  162. package/dist/types/src/core/plugin.d.ts +265 -37
  163. package/dist/types/src/core/plugin.d.ts.map +1 -1
  164. package/dist/types/src/core/registry.d.ts +107 -0
  165. package/dist/types/src/core/registry.d.ts.map +1 -0
  166. package/dist/types/src/core/url-loader.d.ts +127 -0
  167. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  168. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  169. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  170. package/dist/types/src/helpers.d.ts.map +1 -1
  171. package/dist/types/src/index.d.ts +3 -4
  172. package/dist/types/src/index.d.ts.map +1 -1
  173. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
  174. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
  175. package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
  176. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
  177. package/dist/types/src/plugin-operation/history/errors.d.ts +32 -0
  178. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
  179. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
  180. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
  181. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
  182. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
  183. package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
  184. package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
  185. package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
  186. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
  187. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
  188. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
  189. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
  190. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
  191. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
  192. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
  193. package/dist/types/src/plugin-operation/index.d.ts +3 -0
  194. package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
  195. package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
  196. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
  197. package/dist/types/src/plugin-operation/meta.d.ts +3 -0
  198. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
  199. package/dist/types/src/plugin-operation/testing.d.ts +59 -0
  200. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
  201. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
  202. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
  203. package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
  204. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
  205. package/dist/types/src/plugin-runtime/index.d.ts +2 -0
  206. package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
  207. package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
  208. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
  209. package/dist/types/src/testing/harness.d.ts +67 -0
  210. package/dist/types/src/testing/harness.d.ts.map +1 -0
  211. package/dist/types/src/testing/index.d.ts +2 -0
  212. package/dist/types/src/testing/index.d.ts.map +1 -1
  213. package/dist/types/src/testing/react.d.ts +27 -0
  214. package/dist/types/src/testing/react.d.ts.map +1 -0
  215. package/dist/types/src/testing/react.test.d.ts +2 -0
  216. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  217. package/dist/types/src/testing/service.d.ts +8 -0
  218. package/dist/types/src/testing/service.d.ts.map +1 -0
  219. package/dist/types/src/testing/withPluginManager.d.ts +11 -10
  220. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  221. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  222. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  223. package/dist/types/src/ui/components/App/App.d.ts +9 -0
  224. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  225. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  226. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  227. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  228. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  229. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
  230. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
  231. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
  232. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
  233. package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
  234. package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
  235. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts +13 -0
  236. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  237. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  238. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  239. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  240. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  241. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  242. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  243. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts +14 -0
  244. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  245. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  246. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  247. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  248. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  249. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  250. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  251. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  252. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  253. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  254. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  255. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  256. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  257. package/dist/types/src/ui/components/index.d.ts +5 -0
  258. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  259. package/dist/types/src/ui/hooks/index.d.ts +6 -0
  260. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  261. package/dist/types/src/ui/hooks/useApp.d.ts +89 -0
  262. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  263. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  264. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  265. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  266. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  267. package/dist/types/src/ui/hooks/useLoading.d.ts +18 -0
  268. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  269. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  270. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  271. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  272. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  273. package/dist/types/src/ui/index.d.ts +3 -0
  274. package/dist/types/src/ui/index.d.ts.map +1 -0
  275. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
  276. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
  277. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  278. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  279. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  280. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  281. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  282. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  283. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  284. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  285. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  286. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  287. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  288. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  289. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  290. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  291. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  292. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  293. package/dist/types/tsconfig.tsbuildinfo +1 -1
  294. package/moon.yml +26 -3
  295. package/package.json +117 -53
  296. package/src/cli/cli.ts +107 -0
  297. package/src/{playground/layout → cli}/index.ts +1 -1
  298. package/src/common/activation-events.ts +44 -0
  299. package/src/{playground/debug/index.ts → common/annotations.ts} +0 -2
  300. package/src/common/capabilities.ts +169 -114
  301. package/src/common/index.ts +4 -8
  302. package/src/common/operations.ts +35 -0
  303. package/src/common/translations.ts +18 -10
  304. package/src/context.ts +9 -0
  305. package/src/core/{events.ts → activation-event.ts} +10 -7
  306. package/src/core/capability-manager.test.ts +151 -0
  307. package/src/core/capability-manager.ts +192 -0
  308. package/src/core/capability.ts +247 -0
  309. package/src/core/edge-registry-plugin-provider.ts +92 -0
  310. package/src/core/index.ts +11 -4
  311. package/src/core/plugin-asset-cache.ts +60 -0
  312. package/src/core/plugin-manager.test.ts +1899 -0
  313. package/src/core/plugin-manager.ts +1685 -0
  314. package/src/core/plugin-manifest.test.ts +75 -0
  315. package/src/core/plugin-manifest.ts +134 -0
  316. package/src/core/plugin.ts +404 -43
  317. package/src/core/registry.ts +163 -0
  318. package/src/core/url-loader.test.ts +221 -0
  319. package/src/core/url-loader.ts +388 -0
  320. package/src/helpers.test.ts +1 -1
  321. package/src/index.ts +3 -4
  322. package/src/plugin-operation/OperationPlugin.ts +24 -0
  323. package/src/plugin-operation/history/capability.ts +36 -0
  324. package/src/plugin-operation/history/errors.ts +7 -0
  325. package/src/plugin-operation/history/history-tracker.test.ts +374 -0
  326. package/src/plugin-operation/history/history-tracker.ts +128 -0
  327. package/src/plugin-operation/history/index.ts +9 -0
  328. package/src/plugin-operation/history/types.ts +17 -0
  329. package/src/plugin-operation/history/undo-mapping.ts +135 -0
  330. package/src/plugin-operation/history/undo-registry.test.ts +72 -0
  331. package/src/plugin-operation/history/undo-registry.ts +54 -0
  332. package/src/plugin-operation/index.ts +6 -0
  333. package/src/plugin-operation/invoker-capability.ts +55 -0
  334. package/src/plugin-operation/meta.ts +12 -0
  335. package/src/plugin-operation/testing.ts +155 -0
  336. package/src/plugin-runtime/RuntimePlugin.ts +19 -0
  337. package/src/plugin-runtime/capability.ts +53 -0
  338. package/src/plugin-runtime/index.ts +5 -0
  339. package/src/plugin-runtime/meta.ts +12 -0
  340. package/src/testing/harness.ts +229 -0
  341. package/src/testing/index.ts +2 -0
  342. package/src/testing/react.test.tsx +48 -0
  343. package/src/testing/react.tsx +113 -0
  344. package/src/testing/service.ts +52 -0
  345. package/src/testing/withPluginManager.stories.tsx +15 -12
  346. package/src/testing/withPluginManager.tsx +78 -54
  347. package/src/ui/components/App/App.stories.tsx +88 -0
  348. package/src/ui/components/App/App.tsx +81 -0
  349. package/src/{playground/logger → ui/components/App}/index.ts +1 -1
  350. package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
  351. package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
  352. package/src/ui/components/Placeholder/index.ts +5 -0
  353. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +185 -0
  354. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  355. package/src/ui/components/PluginManager/index.ts +5 -0
  356. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
  357. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  358. package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
  359. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  360. package/src/ui/components/Surface/context.ts +12 -0
  361. package/src/ui/components/Surface/index.ts +54 -0
  362. package/src/ui/components/Surface/types.test.ts +126 -0
  363. package/src/ui/components/Surface/types.ts +269 -0
  364. package/src/ui/components/index.ts +8 -0
  365. package/src/ui/hooks/index.ts +9 -0
  366. package/src/ui/hooks/useApp.test.tsx +159 -0
  367. package/src/ui/hooks/useApp.tsx +424 -0
  368. package/src/ui/hooks/useCapabilities.ts +67 -0
  369. package/src/ui/hooks/useLoading.tsx +76 -0
  370. package/src/ui/hooks/useSettingsState.ts +26 -0
  371. package/src/ui/hooks/useSurface.ts +13 -0
  372. package/src/ui/index.ts +6 -0
  373. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
  374. package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
  375. package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
  376. package/src/vite-plugin/boot-loader/index.ts +5 -0
  377. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  378. package/src/vite-plugin/composer/index.ts +306 -0
  379. package/src/vite-plugin/import-map/index.ts +527 -0
  380. package/src/vite-plugin/index.ts +10 -0
  381. package/src/vite-plugin/manifest.test.ts +46 -0
  382. package/src/vite-plugin/manifest.ts +57 -0
  383. package/src/vite-plugin/packages.ts +187 -0
  384. package/tsconfig.json +25 -23
  385. package/tsconfig.node.json +2 -4
  386. package/typedoc.json +2 -4
  387. package/vitest.config.ts +8 -6
  388. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  389. package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
  390. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs +0 -137
  391. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
  392. package/dist/lib/browser/chunk-FMN65HSW.mjs +0 -1519
  393. package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
  394. package/dist/lib/browser/chunk-FO2PH7M3.mjs +0 -415
  395. package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
  396. package/dist/lib/browser/chunk-ORWHM7CO.mjs +0 -32
  397. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  398. package/dist/lib/browser/intent-dispatcher-LSYQZSEB.mjs +0 -11
  399. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs +0 -39
  400. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
  401. package/dist/lib/browser/store-KML2R4IE.mjs +0 -30
  402. package/dist/lib/browser/store-KML2R4IE.mjs.map +0 -7
  403. package/dist/lib/browser/worker.mjs +0 -79
  404. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs +0 -138
  405. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
  406. package/dist/lib/node-esm/chunk-73HGSHKE.mjs +0 -416
  407. package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
  408. package/dist/lib/node-esm/chunk-UMZQERLE.mjs +0 -34
  409. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  410. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs +0 -1521
  411. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
  412. package/dist/lib/node-esm/intent-dispatcher-6CYNGPSW.mjs +0 -12
  413. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs +0 -40
  414. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
  415. package/dist/lib/node-esm/store-QEXGXLWZ.mjs +0 -31
  416. package/dist/lib/node-esm/store-QEXGXLWZ.mjs.map +0 -7
  417. package/dist/lib/node-esm/worker.mjs +0 -80
  418. package/dist/types/src/App.d.ts +0 -43
  419. package/dist/types/src/App.d.ts.map +0 -1
  420. package/dist/types/src/common/collaboration.d.ts +0 -19
  421. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  422. package/dist/types/src/common/events.d.ts +0 -52
  423. package/dist/types/src/common/events.d.ts.map +0 -1
  424. package/dist/types/src/common/file.d.ts +0 -14
  425. package/dist/types/src/common/file.d.ts.map +0 -1
  426. package/dist/types/src/common/graph.d.ts +0 -21
  427. package/dist/types/src/common/graph.d.ts.map +0 -1
  428. package/dist/types/src/common/layout.d.ts +0 -281
  429. package/dist/types/src/common/layout.d.ts.map +0 -1
  430. package/dist/types/src/common/surface.d.ts +0 -65
  431. package/dist/types/src/common/surface.d.ts.map +0 -1
  432. package/dist/types/src/core/capabilities.d.ts +0 -114
  433. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  434. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  435. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  436. package/dist/types/src/core/events.d.ts.map +0 -1
  437. package/dist/types/src/core/manager.d.ts +0 -122
  438. package/dist/types/src/core/manager.d.ts.map +0 -1
  439. package/dist/types/src/core/manager.test.d.ts +0 -2
  440. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  441. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  442. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  443. package/dist/types/src/playground/debug/index.d.ts +0 -2
  444. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  445. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  446. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  447. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  448. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  449. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  450. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  451. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  452. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  453. package/dist/types/src/playground/generator/index.d.ts +0 -3
  454. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  455. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  456. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  457. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  458. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  459. package/dist/types/src/playground/layout/index.d.ts +0 -2
  460. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  461. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  462. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  463. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  464. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  465. package/dist/types/src/playground/logger/index.d.ts +0 -2
  466. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  467. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  468. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  469. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  470. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  471. package/dist/types/src/playground/playground.stories.d.ts +0 -10
  472. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  473. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  474. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  475. package/dist/types/src/plugin-intent/actions.d.ts +0 -38
  476. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  477. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  478. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  479. package/dist/types/src/plugin-intent/index.d.ts +0 -5
  480. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  481. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  482. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  483. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  484. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  485. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  486. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  487. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  488. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  489. package/dist/types/src/plugin-settings/actions.d.ts +0 -27
  490. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  491. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  492. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  493. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  494. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  495. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  496. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  497. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  498. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  499. package/dist/types/src/plugin-settings/translations.d.ts +0 -10
  500. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  501. package/dist/types/src/react/ErrorBoundary.d.ts +0 -31
  502. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  503. package/dist/types/src/react/IntentContext.d.ts +0 -8
  504. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  505. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  506. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  507. package/dist/types/src/react/Surface.d.ts +0 -12
  508. package/dist/types/src/react/Surface.d.ts.map +0 -1
  509. package/dist/types/src/react/Surface.stories.d.ts +0 -16
  510. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  511. package/dist/types/src/react/common.d.ts +0 -13
  512. package/dist/types/src/react/common.d.ts.map +0 -1
  513. package/dist/types/src/react/index.d.ts +0 -7
  514. package/dist/types/src/react/index.d.ts.map +0 -1
  515. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  516. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  517. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  518. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  519. package/dist/types/src/worker.d.ts +0 -4
  520. package/dist/types/src/worker.d.ts.map +0 -1
  521. package/src/App.tsx +0 -276
  522. package/src/common/collaboration.ts +0 -21
  523. package/src/common/events.ts +0 -77
  524. package/src/common/file.ts +0 -22
  525. package/src/common/graph.ts +0 -30
  526. package/src/common/layout.ts +0 -278
  527. package/src/common/surface.ts +0 -86
  528. package/src/core/capabilities.test.ts +0 -136
  529. package/src/core/capabilities.ts +0 -254
  530. package/src/core/manager.test.ts +0 -515
  531. package/src/core/manager.ts +0 -519
  532. package/src/playground/debug/Debug.tsx +0 -39
  533. package/src/playground/debug/plugin.ts +0 -17
  534. package/src/playground/generator/Main.tsx +0 -71
  535. package/src/playground/generator/Toolbar.tsx +0 -46
  536. package/src/playground/generator/generator.ts +0 -48
  537. package/src/playground/generator/index.ts +0 -6
  538. package/src/playground/generator/plugin.ts +0 -23
  539. package/src/playground/layout/Layout.tsx +0 -33
  540. package/src/playground/layout/plugin.ts +0 -17
  541. package/src/playground/logger/Toolbar.tsx +0 -29
  542. package/src/playground/logger/plugin.ts +0 -36
  543. package/src/playground/logger/schema.ts +0 -12
  544. package/src/playground/playground.stories.tsx +0 -42
  545. package/src/plugin-intent/IntentPlugin.ts +0 -20
  546. package/src/plugin-intent/actions.ts +0 -33
  547. package/src/plugin-intent/errors.ts +0 -39
  548. package/src/plugin-intent/index.ts +0 -8
  549. package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
  550. package/src/plugin-intent/intent-dispatcher.ts +0 -333
  551. package/src/plugin-intent/intent.ts +0 -154
  552. package/src/plugin-settings/SettingsPlugin.ts +0 -35
  553. package/src/plugin-settings/actions.ts +0 -29
  554. package/src/plugin-settings/app-graph-builder.ts +0 -157
  555. package/src/plugin-settings/index.ts +0 -6
  556. package/src/plugin-settings/intent-resolver.ts +0 -34
  557. package/src/plugin-settings/store.ts +0 -33
  558. package/src/plugin-settings/translations.ts +0 -19
  559. package/src/react/ErrorBoundary.tsx +0 -45
  560. package/src/react/IntentContext.tsx +0 -34
  561. package/src/react/Surface.stories.tsx +0 -96
  562. package/src/react/Surface.tsx +0 -77
  563. package/src/react/common.ts +0 -12
  564. package/src/react/index.ts +0 -10
  565. package/src/react/useCapabilities.ts +0 -30
  566. package/src/react/useIntentResolver.ts +0 -22
  567. package/src/worker.ts +0 -11
  568. /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  569. /package/dist/lib/browser/{worker.mjs.map → common/activation-events.mjs.map} +0 -0
  570. /package/dist/lib/{node-esm/intent-dispatcher-6CYNGPSW.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  571. /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,QA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AU,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACzC,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAC7B,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAC3D,UAAU,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAClD,sBAAsB,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/Surface/types.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './App';
2
+ export * from './Placeholder';
3
+ export * from './PluginManager';
4
+ export * from './Surface';
5
+ //# 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,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './useApp';
2
+ export * from './useCapabilities';
3
+ export * from './useLoading';
4
+ export * from './useSettingsState';
5
+ export * from './useSurface';
6
+ //# 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,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,89 @@
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 PlaceholderProps = {
40
+ stage?: number;
41
+ progress?: StartupProgress;
42
+ };
43
+ export type UseAppOptions = {
44
+ pluginManager?: PluginManager.PluginManager;
45
+ pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];
46
+ onPluginRemove?: PluginManager.ManagerOptions['onRemove'];
47
+ pluginRegistryProvider?: PluginManager.ManagerOptions['pluginRegistryProvider'];
48
+ plugins?: Plugin.Plugin[];
49
+ core?: string[];
50
+ defaults?: string[];
51
+ /**
52
+ * Additional activation events to fire before startup.
53
+ * These are fired alongside SetupReactSurface before the Startup event.
54
+ */
55
+ setupEvents?: ActivationEvent.ActivationEvent[];
56
+ cacheEnabled?: boolean;
57
+ safeMode?: boolean;
58
+ debounce?: number;
59
+ timeout?: number;
60
+ fallback?: FC<FallbackProps>;
61
+ placeholder?: FC<PlaceholderProps>;
62
+ };
63
+ /**
64
+ * Expected usage is for this to be the entrypoint of the application.
65
+ * Initializes plugins and renders the root components.
66
+ *
67
+ * @example
68
+ * const plugins = [LayoutPlugin(), MyPlugin()];
69
+ * const core = [LayoutPluginId];
70
+ * const default = [MyPluginId];
71
+ * const fallback = <div>Initializing Plugins...</div>;
72
+ * const App = useApp({ plugins, core, default, fallback });
73
+ * createRoot(document.getElementById('root')!).render(
74
+ * <StrictMode>
75
+ * <App />
76
+ * </StrictMode>,
77
+ * );
78
+ *
79
+ * @param params.pluginLoader A function which loads new plugins.
80
+ * @param params.plugins All plugins available to the application.
81
+ * @param params.core Core plugins which will always be enabled.
82
+ * @param params.defaults Default plugins are enabled by default but can be disabled by the user.
83
+ * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
84
+ * @param params.safeMode Whether to enable safe mode, which disables optional plugins.
85
+ * @param params.fallback Fallback component to render if an error occurs during startup.
86
+ * @param params.placeholder Placeholder component to render during startup.
87
+ */
88
+ export declare const useApp: ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, pluginRegistryProvider, plugins: pluginsProp, core: coreProp, defaults: defaultsProp, setupEvents: setupEventsProp, placeholder, fallback, cacheEnabled, safeMode, debounce, timeout, }: UseAppOptions) => () => React.JSX.Element;
89
+ //# 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;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BG;AACH,eAAO,MAAM,MAAM,6PAehB,aAAa,4BAkOf,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(ThreadCapabilities.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(ThreadCapabilities.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;AACH,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,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,34 @@
1
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ /**
4
+ * Storybook host that runs the **real** inline driver script (`boot-loader.js`)
5
+ * against the same DOM structure {@link bootLoaderPlugin} injects in production
6
+ * via `transformIndexHtml`. The component injects `<style>` + the loader DOM,
7
+ * evaluates the driver, and exposes `window.__bootLoader` for the stories to
8
+ * call — no React reimplementation of the state machine.
9
+ *
10
+ * On unmount, the host calls `__bootLoader.dismiss()` (which clears the creep
11
+ * timer and removes the `#boot-loader` node) and clears the global so a fresh
12
+ * mount re-runs the driver from scratch.
13
+ */
14
+ type BootLoaderHostProps = {
15
+ initialStatus?: string;
16
+ markSvg?: string;
17
+ };
18
+ declare const BootLoaderHost: ({ initialStatus, markSvg }: BootLoaderHostProps) => React.JSX.Element;
19
+ declare const meta: Meta<typeof BootLoaderHost>;
20
+ export default meta;
21
+ type Story = StoryObj<typeof BootLoaderHost>;
22
+ export declare const Default: Story;
23
+ /**
24
+ * Renders the React `Placeholder` from `@dxos/app-framework/ui` on its own —
25
+ * useful for eyeballing the handoff target the boot loader dismisses to.
26
+ */
27
+ export declare const PlaceholderHandoff: Story;
28
+ /**
29
+ * End-to-end handoff sim: the driver ticks 0 → 100% then the host calls
30
+ * `dismiss()` and the underlying `Placeholder` fades the mark in / out,
31
+ * mirroring the production sequence.
32
+ */
33
+ export declare const Handoff: Story;
34
+ //# sourceMappingURL=BootLoader.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BootLoader.stories.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/BootLoader.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D;;;;;;;;;;GAUG;AACH,KAAK,mBAAmB,GAAG;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF,QAAA,MAAM,cAAc,+BAA6C,mBAAmB,sBAmDnF,CAAC;AA0IF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAYrC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAGhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAWrB,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,51 @@
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 above the progress bar.
13
+ * The mark renders at full opacity with whatever fills the SVG declares, so
14
+ * pass a colour-palette logo for the strongest visual identity. SVGs that use
15
+ * `fill="currentColor"` still inherit the loader's `prefers-color-scheme`
16
+ * text colour. Leave empty/undefined to render only the bar.
17
+ */
18
+ markSvg?: string;
19
+ };
20
+ /**
21
+ * Vite plugin that injects a tiny native-DOM "boot loader" into the host app's
22
+ * `index.html`.
23
+ *
24
+ * The loader paints on the very first frame, before any JS bundle is fetched —
25
+ * so the user sees something immediately on cold load instead of staring at a
26
+ * blank document while the compiled module graph is parsed. The brand mark
27
+ * sits centred inside a thin determinate progress ring; both layers are
28
+ * composited so the ring's fill stays visually smooth even while the JS main
29
+ * thread is busy.
30
+ *
31
+ * The host app drives the loader from `main.tsx`:
32
+ * - `window.__bootLoader.status(text)` updates the status line per phase.
33
+ * - `window.__bootLoader.progress(fraction)` grows the determinate ring (0–1).
34
+ * - `window.__bootLoader.dismiss()` removes the loader once React has mounted.
35
+ *
36
+ * Inject order:
37
+ * - `<style>` → `<head>` (parses before any bundled stylesheet).
38
+ * - `<div id="boot-loader">…</div>` → start of `<body>` (sibling of `#root`).
39
+ * - inline `<script>` defining `window.__bootLoader` → start of `<body>`.
40
+ *
41
+ * Keeping the loader as a sibling of `#root` (rather than a child of it) means
42
+ * `createRoot(document.getElementById('root')).render(...)` does not fight the
43
+ * loader for ownership; the host explicitly calls `dismiss()` after the first
44
+ * React commit, which gives a deterministic handoff.
45
+ *
46
+ * Color tokens are exposed as CSS custom properties (`--boot-loader-bg-light`,
47
+ * `--boot-loader-bg-dark`, etc.) defined in `boot-loader.css`, so consumers can
48
+ * override them at the document level without us re-parameterizing this plugin.
49
+ */
50
+ export declare const bootLoaderPlugin: ({ status, markSvg }?: BootLoaderOptions) => Plugin;
51
+ //# 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":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,gBAAgB,yBAAyB,iBAAiB,KAAQ,MA+D9E,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"}