@dxos/app-framework 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393

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 (272) hide show
  1. package/dist/lib/browser/{capability-DOMNPRJP.mjs → capability-5RRH3WIB.mjs} +11 -11
  2. package/dist/lib/browser/capability-5RRH3WIB.mjs.map +7 -0
  3. package/dist/lib/browser/{capability-KSNT34SN.mjs → capability-LUKGKUQH.mjs} +10 -10
  4. package/dist/lib/browser/{chunk-T3Y4AEKX.mjs → chunk-23D4SJUE.mjs} +3 -3
  5. package/dist/lib/browser/{chunk-T3Y4AEKX.mjs.map → chunk-23D4SJUE.mjs.map} +1 -1
  6. package/dist/lib/browser/{chunk-2CKCJ6PN.mjs → chunk-3JWJXGLK.mjs} +1 -1
  7. package/dist/lib/browser/{chunk-2CKCJ6PN.mjs.map → chunk-3JWJXGLK.mjs.map} +1 -1
  8. package/dist/lib/browser/{chunk-I34GF4NG.mjs → chunk-45CHLTBV.mjs} +2 -2
  9. package/dist/lib/browser/{chunk-QSXYHXCE.mjs → chunk-66IXTIVK.mjs} +1 -1
  10. package/dist/lib/browser/{chunk-QSXYHXCE.mjs.map → chunk-66IXTIVK.mjs.map} +2 -2
  11. package/dist/lib/browser/{chunk-QRTB4Q3U.mjs → chunk-7VZJR2OA.mjs} +4 -17
  12. package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-CZ4BIAHH.mjs +422 -0
  14. package/dist/lib/browser/chunk-CZ4BIAHH.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-TGX63LTL.mjs → chunk-FJ4765WW.mjs} +1 -1
  16. package/dist/lib/browser/{chunk-TGX63LTL.mjs.map → chunk-FJ4765WW.mjs.map} +2 -2
  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-BMIAYUWT.mjs → chunk-JD3Z5NEF.mjs} +147 -75
  20. package/dist/lib/browser/chunk-JD3Z5NEF.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-NBXPP7JR.mjs +1174 -0
  22. package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-JKWMHZP6.mjs → chunk-WBHCSOBW.mjs} +2 -2
  24. package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
  25. package/dist/lib/browser/{chunk-GDWTW4ZW.mjs → chunk-Z55LVAGN.mjs} +76 -11
  26. package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-F7FW2RK2.mjs → chunk-ZGJAZSNE.mjs} +7 -32
  28. package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +14 -28
  30. package/dist/lib/browser/cli/index.mjs.map +3 -3
  31. package/dist/lib/browser/common/activation-events.mjs +7 -7
  32. package/dist/lib/browser/common/capabilities.mjs +7 -7
  33. package/dist/lib/browser/core/activation-event.mjs +1 -1
  34. package/dist/lib/browser/core/capability.mjs +1 -1
  35. package/dist/lib/browser/core/plugin-manager.mjs +8 -4
  36. package/dist/lib/browser/core/plugin.mjs +10 -2
  37. package/dist/lib/browser/core/url-loader.mjs +13 -5
  38. package/dist/lib/browser/index.mjs +34 -17
  39. package/dist/lib/browser/index.mjs.map +3 -3
  40. package/dist/lib/browser/{invoker-capability-VCMPQOIA.mjs → invoker-capability-K4GHUFXF.mjs} +12 -11
  41. package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +7 -0
  42. package/dist/lib/browser/meta.json +1 -1
  43. package/dist/lib/browser/testing/index.mjs +20 -32
  44. package/dist/lib/browser/testing/index.mjs.map +3 -3
  45. package/dist/lib/browser/testing/react.mjs +11 -11
  46. package/dist/lib/browser/ui/index.mjs +14 -12
  47. package/dist/lib/node-esm/{capability-EOQTORML.mjs → capability-FCGZVIEG.mjs} +10 -10
  48. package/dist/lib/node-esm/{capability-KJTQIWDK.mjs → capability-JOIQ2MQE.mjs} +11 -11
  49. package/dist/lib/node-esm/capability-JOIQ2MQE.mjs.map +7 -0
  50. package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs → chunk-37Z53PXZ.mjs} +1 -1
  51. package/dist/lib/node-esm/{chunk-FKE4Z3D6.mjs.map → chunk-37Z53PXZ.mjs.map} +2 -2
  52. package/dist/lib/node-esm/{chunk-WZCSOX5Q.mjs → chunk-6XW6LET6.mjs} +2 -2
  53. package/dist/lib/node-esm/{chunk-URWHJQT2.mjs → chunk-D347W3KO.mjs} +7 -32
  54. package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-WZ6DHQER.mjs → chunk-DRZKO5UZ.mjs} +147 -75
  56. package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-HI3YBICQ.mjs → chunk-HTBJU5FX.mjs} +76 -11
  58. package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-M3HKPRPO.mjs +423 -0
  60. package/dist/lib/node-esm/chunk-M3HKPRPO.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-MUVUQC3G.mjs +1175 -0
  62. package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +7 -0
  63. package/dist/lib/node-esm/{chunk-VKHGNEDB.mjs → chunk-SBS2YMPT.mjs} +3 -3
  64. package/dist/lib/node-esm/{chunk-VKHGNEDB.mjs.map → chunk-SBS2YMPT.mjs.map} +1 -1
  65. package/dist/lib/node-esm/{chunk-42KBWDE4.mjs → chunk-SDJ4B2LU.mjs} +1 -1
  66. package/dist/lib/node-esm/{chunk-42KBWDE4.mjs.map → chunk-SDJ4B2LU.mjs.map} +1 -1
  67. package/dist/lib/node-esm/{chunk-JPWVIQ5I.mjs → chunk-V24UWT36.mjs} +4 -17
  68. package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
  69. package/dist/lib/node-esm/{chunk-G3RTFSNG.mjs → chunk-WFSRZKBP.mjs} +2 -2
  70. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  72. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-ZZ7CKK6W.mjs → chunk-XOCUANHO.mjs} +1 -1
  74. package/dist/lib/node-esm/{chunk-ZZ7CKK6W.mjs.map → chunk-XOCUANHO.mjs.map} +2 -2
  75. package/dist/lib/node-esm/cli/index.mjs +14 -28
  76. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  77. package/dist/lib/node-esm/common/activation-events.mjs +7 -7
  78. package/dist/lib/node-esm/common/capabilities.mjs +7 -7
  79. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  80. package/dist/lib/node-esm/core/capability.mjs +1 -1
  81. package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
  82. package/dist/lib/node-esm/core/plugin.mjs +10 -2
  83. package/dist/lib/node-esm/core/url-loader.mjs +13 -5
  84. package/dist/lib/node-esm/index.mjs +34 -17
  85. package/dist/lib/node-esm/index.mjs.map +3 -3
  86. package/dist/lib/node-esm/{invoker-capability-EGA3XW6J.mjs → invoker-capability-XEPW5LMJ.mjs} +12 -11
  87. package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +7 -0
  88. package/dist/lib/node-esm/meta.json +1 -1
  89. package/dist/lib/node-esm/testing/index.mjs +20 -32
  90. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  91. package/dist/lib/node-esm/testing/react.mjs +11 -11
  92. package/dist/lib/node-esm/ui/index.mjs +14 -12
  93. package/dist/plugin/node-esm/index.mjs +136 -37
  94. package/dist/plugin/node-esm/index.mjs.map +4 -4
  95. package/dist/plugin/node-esm/meta.json +1 -1
  96. package/dist/types/src/common/annotations.d.ts +1 -0
  97. package/dist/types/src/common/annotations.d.ts.map +1 -0
  98. package/dist/types/src/common/capabilities.d.ts +2 -1
  99. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  100. package/dist/types/src/common/operations.d.ts +1 -1
  101. package/dist/types/src/common/operations.d.ts.map +1 -1
  102. package/dist/types/src/core/activation-event.d.ts +4 -4
  103. package/dist/types/src/core/activation-event.d.ts.map +1 -1
  104. package/dist/types/src/core/capability-manager.d.ts.map +1 -1
  105. package/dist/types/src/core/capability.d.ts +2 -2
  106. package/dist/types/src/core/capability.d.ts.map +1 -1
  107. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  108. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  109. package/dist/types/src/core/index.d.ts +5 -0
  110. package/dist/types/src/core/index.d.ts.map +1 -1
  111. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  112. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  113. package/dist/types/src/core/plugin-manager.d.ts +163 -2
  114. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  115. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  116. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  117. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  118. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  119. package/dist/types/src/core/plugin.d.ts +80 -0
  120. package/dist/types/src/core/plugin.d.ts.map +1 -1
  121. package/dist/types/src/core/registry.d.ts +101 -0
  122. package/dist/types/src/core/registry.d.ts.map +1 -0
  123. package/dist/types/src/core/url-loader.d.ts +88 -3
  124. package/dist/types/src/core/url-loader.d.ts.map +1 -1
  125. package/dist/types/src/helpers.d.ts.map +1 -1
  126. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -1
  127. package/dist/types/src/plugin-operation/history/errors.d.ts +6 -6
  128. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -1
  129. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +1 -1
  130. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -1
  131. package/dist/types/src/plugin-operation/history/types.d.ts +1 -1
  132. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -1
  133. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +1 -1
  134. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
  135. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +1 -1
  136. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -1
  137. package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
  138. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -1
  139. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -1
  140. package/dist/types/src/plugin-operation/testing.d.ts +2 -1
  141. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -1
  142. package/dist/types/src/plugin-runtime/capability.d.ts +1 -1
  143. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
  144. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -1
  145. package/dist/types/src/testing/harness.d.ts +1 -1
  146. package/dist/types/src/testing/harness.d.ts.map +1 -1
  147. package/dist/types/src/testing/react.d.ts.map +1 -1
  148. package/dist/types/src/testing/service.d.ts.map +1 -1
  149. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  150. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  151. package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
  152. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
  153. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
  154. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
  155. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
  156. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
  157. package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
  158. package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
  159. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
  160. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
  161. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
  162. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -1
  163. package/dist/types/src/ui/components/Surface/index.d.ts +1 -1
  164. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
  165. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
  166. package/dist/types/src/ui/components/index.d.ts +1 -0
  167. package/dist/types/src/ui/components/index.d.ts.map +1 -1
  168. package/dist/types/src/ui/hooks/useApp.d.ts +30 -3
  169. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
  170. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
  171. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
  172. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
  173. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +20 -36
  174. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -1
  175. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +1 -50
  176. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -1
  177. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  178. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  179. package/dist/types/src/vite-plugin/composer/index.d.ts +12 -12
  180. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -1
  181. package/dist/types/src/vite-plugin/import-map/index.d.ts +13 -1
  182. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
  183. package/dist/types/src/vite-plugin/manifest.d.ts +30 -5
  184. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -1
  185. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
  186. package/dist/types/tsconfig.tsbuildinfo +1 -1
  187. package/package.json +27 -23
  188. package/src/cli/cli.ts +1 -1
  189. package/src/common/annotations.ts +3 -0
  190. package/src/common/capabilities.ts +2 -1
  191. package/src/common/operations.ts +1 -1
  192. package/src/core/capability.ts +1 -1
  193. package/src/core/edge-registry-plugin-provider.ts +92 -0
  194. package/src/core/index.ts +5 -0
  195. package/src/core/plugin-asset-cache.ts +60 -0
  196. package/src/core/plugin-manager.test.ts +533 -4
  197. package/src/core/plugin-manager.ts +470 -28
  198. package/src/core/plugin-manifest.test.ts +75 -0
  199. package/src/core/plugin-manifest.ts +134 -0
  200. package/src/core/plugin.ts +103 -0
  201. package/src/core/registry.ts +157 -0
  202. package/src/core/url-loader.test.ts +115 -6
  203. package/src/core/url-loader.ts +253 -43
  204. package/src/plugin-operation/history/capability.ts +1 -1
  205. package/src/plugin-operation/history/history-tracker.test.ts +2 -1
  206. package/src/plugin-operation/history/history-tracker.ts +1 -1
  207. package/src/plugin-operation/history/types.ts +1 -1
  208. package/src/plugin-operation/history/undo-mapping.ts +1 -1
  209. package/src/plugin-operation/history/undo-registry.ts +1 -1
  210. package/src/plugin-operation/invoker-capability.ts +2 -1
  211. package/src/plugin-operation/meta.ts +1 -0
  212. package/src/plugin-operation/testing.ts +2 -1
  213. package/src/plugin-runtime/meta.ts +1 -0
  214. package/src/testing/harness.ts +2 -2
  215. package/src/testing/service.ts +1 -1
  216. package/src/testing/withPluginManager.stories.tsx +1 -1
  217. package/src/ui/components/App/App.stories.tsx +2 -6
  218. package/src/ui/components/App/App.tsx +12 -1
  219. package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
  220. package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
  221. package/src/ui/components/Placeholder/index.ts +5 -0
  222. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +4 -2
  223. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +1 -1
  224. package/src/ui/components/Surface/SurfaceComponent.tsx +2 -2
  225. package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
  226. package/src/ui/components/index.ts +1 -0
  227. package/src/ui/hooks/useApp.test.tsx +1 -1
  228. package/src/ui/hooks/useApp.tsx +161 -26
  229. package/src/ui/hooks/useLoading.tsx +14 -6
  230. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +208 -100
  231. package/src/vite-plugin/boot-loader/boot-loader.css +248 -45
  232. package/src/vite-plugin/boot-loader/boot-loader.js +309 -39
  233. package/src/vite-plugin/boot-loader/index.ts +1 -95
  234. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  235. package/src/vite-plugin/composer/index.ts +61 -39
  236. package/src/vite-plugin/import-map/index.ts +42 -5
  237. package/src/vite-plugin/index.ts +2 -2
  238. package/src/vite-plugin/manifest.test.ts +27 -4
  239. package/src/vite-plugin/manifest.ts +42 -5
  240. package/src/vite-plugin/packages.ts +8 -2
  241. package/tsconfig.json +16 -1
  242. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  243. package/dist/lib/browser/capability-DOMNPRJP.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-7B6AJK4D.mjs +0 -964
  245. package/dist/lib/browser/chunk-7B6AJK4D.mjs.map +0 -7
  246. package/dist/lib/browser/chunk-BMIAYUWT.mjs.map +0 -7
  247. package/dist/lib/browser/chunk-F7FW2RK2.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-GDWTW4ZW.mjs.map +0 -7
  249. package/dist/lib/browser/chunk-JKWMHZP6.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-QRTB4Q3U.mjs.map +0 -7
  251. package/dist/lib/browser/chunk-RFSO3JRG.mjs +0 -1
  252. package/dist/lib/browser/chunk-RFSO3JRG.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-Y543KCO7.mjs +0 -174
  254. package/dist/lib/browser/chunk-Y543KCO7.mjs.map +0 -7
  255. package/dist/lib/browser/invoker-capability-VCMPQOIA.mjs.map +0 -7
  256. package/dist/lib/node-esm/capability-KJTQIWDK.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-7PJ5OKRB.mjs +0 -965
  258. package/dist/lib/node-esm/chunk-7PJ5OKRB.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-DXVXOGJ7.mjs +0 -175
  260. package/dist/lib/node-esm/chunk-DXVXOGJ7.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs +0 -2
  262. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs.map +0 -7
  263. package/dist/lib/node-esm/chunk-G3RTFSNG.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-HI3YBICQ.mjs.map +0 -7
  265. package/dist/lib/node-esm/chunk-JPWVIQ5I.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-URWHJQT2.mjs.map +0 -7
  267. package/dist/lib/node-esm/chunk-WZ6DHQER.mjs.map +0 -7
  268. package/dist/lib/node-esm/invoker-capability-EGA3XW6J.mjs.map +0 -7
  269. /package/dist/lib/browser/{capability-KSNT34SN.mjs.map → capability-LUKGKUQH.mjs.map} +0 -0
  270. /package/dist/lib/browser/{chunk-I34GF4NG.mjs.map → chunk-45CHLTBV.mjs.map} +0 -0
  271. /package/dist/lib/node-esm/{capability-EOQTORML.mjs.map → capability-FCGZVIEG.mjs.map} +0 -0
  272. /package/dist/lib/node-esm/{chunk-WZCSOX5Q.mjs.map → chunk-6XW6LET6.mjs.map} +0 -0
@@ -3,13 +3,25 @@
3
3
  //
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
6
7
 
8
+ import { BaseError } from '@dxos/errors';
7
9
  import { log } from '@dxos/log';
8
10
 
9
11
  import * as Plugin from './plugin';
12
+ import * as PluginAssetCache from './plugin-asset-cache';
13
+ import * as PluginManifest from './plugin-manifest';
10
14
 
11
15
  const DEFAULT_KEY = 'org.dxos.composer.remote-plugins';
12
16
 
17
+ /**
18
+ * Tagged error for any failure during remote plugin loading. Construction sites
19
+ * set `context.locator` and `context.reason` (one of `'invalid-locator' |
20
+ * 'manifest-error' | 'cache-error' | 'import-failed' | 'meta-missing' |
21
+ * 'meta-mismatch' | 'duplicate-id'`) so handlers can route on the failure mode.
22
+ */
23
+ export class RemotePluginLoadError extends BaseError.extend('RemotePluginLoadError', 'Failed to load remote plugin') {}
24
+
13
25
  /**
14
26
  * Abstraction over key-value storage (defaults to localStorage).
15
27
  */
@@ -24,14 +36,34 @@ export type Storage = {
24
36
  export type Options = {
25
37
  storage?: Storage;
26
38
  key?: string;
39
+ /**
40
+ * Per-platform offline asset cache. Defaults to a no-op cache (no offline support).
41
+ */
42
+ cache?: PluginAssetCache.Cache;
43
+ };
44
+
45
+ /**
46
+ * Options for the preload entry point. Adds an optional progress hook so hosts
47
+ * can drive a boot-loader counter (`Loading plugins (3/12)…`) as remote plugin
48
+ * manifests resolve. Resolution order is *not* deterministic — each entry races
49
+ * its own network fetch — so callers should treat `loaded` as a count, not an
50
+ * index. Failures are still swallowed; `loaded` advances on both success and
51
+ * recoverable failure so the counter always reaches `total`.
52
+ */
53
+ export type PreloadOptions = Options & {
54
+ onPluginLoaded?: (loaded: number, total: number) => void;
27
55
  };
28
56
 
29
57
  /**
30
58
  * Persisted record of a remote plugin that has been loaded previously.
59
+ *
60
+ * `url` is the URL of the plugin manifest (`plugin.json`), not the entry module.
31
61
  */
32
62
  export type RemotePluginEntry = {
33
63
  id: string;
34
64
  url: string;
65
+ /** Installed version string, e.g. `v1.0.0`. Populated after install from a community catalog entry. */
66
+ version?: string;
35
67
  };
36
68
 
37
69
  const defaultStorage = (): Storage => ({
@@ -64,6 +96,15 @@ const persistRemotePlugin = (storage: Storage, key: string, entry: RemotePluginE
64
96
  }
65
97
  };
66
98
 
99
+ const removePersistedRemotePlugin = (storage: Storage, key: string, pluginId: string): void => {
100
+ try {
101
+ const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== pluginId);
102
+ storage.set(key, JSON.stringify(entries));
103
+ } catch (error) {
104
+ log.warn('failed to remove remote plugin entry', { pluginId, error });
105
+ }
106
+ };
107
+
67
108
  const isUrl = (locator: string): boolean => {
68
109
  try {
69
110
  const url = new URL(locator);
@@ -97,6 +138,36 @@ export const getRemoteEntries = (options: Options = {}): readonly RemotePluginEn
97
138
  return getPersistedRemotePlugins(storage, key);
98
139
  };
99
140
 
141
+ /**
142
+ * Updates the persisted installed version for an already-stored remote plugin entry.
143
+ * Does nothing if the plugin has not been persisted yet.
144
+ */
145
+ export const setInstalledVersion = (id: string, version: string, options: Options = {}): void => {
146
+ const storage = options.storage ?? defaultStorage();
147
+ const key = options.key ?? DEFAULT_KEY;
148
+ const entries = getPersistedRemotePlugins(storage, key);
149
+ const index = entries.findIndex((entry) => entry.id === id);
150
+ if (index === -1) {
151
+ return;
152
+ }
153
+ entries[index] = { ...entries[index], version };
154
+ try {
155
+ storage.set(key, JSON.stringify(entries));
156
+ } catch (error) {
157
+ log.warn('failed to update installed version for remote plugin', { id, version, error });
158
+ }
159
+ };
160
+
161
+ /**
162
+ * Returns the installed version string for the given plugin id, or `undefined` if
163
+ * the plugin was installed without version tracking (legacy install) or is not found.
164
+ */
165
+ export const getInstalledVersion = (id: string, options: Options = {}): string | undefined => {
166
+ const storage = options.storage ?? defaultStorage();
167
+ const key = options.key ?? DEFAULT_KEY;
168
+ return getPersistedRemotePlugins(storage, key).find((entry) => entry.id === id)?.version;
169
+ };
170
+
100
171
  const normalizePluginExport = (mod: Record<string, unknown>): Plugin.Plugin => {
101
172
  const exported = mod.default;
102
173
  if (Plugin.isPlugin(exported)) {
@@ -111,68 +182,207 @@ const normalizePluginExport = (mod: Record<string, unknown>): Plugin.Plugin => {
111
182
  throw new Error('Remote module default export is not a Plugin or a zero-arg plugin factory.');
112
183
  };
113
184
 
114
- const loadRemotePlugin = async (url: string): Promise<Plugin.Plugin> => {
115
- log.info('loading remote plugin', { url });
116
- const mod = await import(/* @vite-ignore */ url);
117
- const plugin = normalizePluginExport(mod);
118
- if (!plugin.meta.id || !plugin.meta.name) {
119
- throw new Error(`Remote plugin at ${url} is missing required meta.id or meta.name.`);
120
- }
121
- return plugin;
122
- };
185
+ /**
186
+ * Loads stylesheets declared in the manifest by appending `<link rel="stylesheet">` elements to the host document.
187
+ * Each link is tagged with `data-dxos-plugin-id` so `uninstall` can clean them up.
188
+ */
189
+ const loadStylesheets = (
190
+ manifest: PluginManifest.ResolvedManifest,
191
+ cache: PluginAssetCache.Cache,
192
+ ): Effect.Effect<void, PluginAssetCache.PluginAssetCacheError> =>
193
+ Effect.gen(function* () {
194
+ if (typeof document === 'undefined') {
195
+ return;
196
+ }
197
+ const cssUrls = manifest.assetUrls.filter((url) => url.endsWith('.css'));
198
+ for (const url of cssUrls) {
199
+ const resolved = yield* cache.resolve(manifest.id, url);
200
+ if (document.querySelector(`link[data-dxos-plugin-id="${manifest.id}"][href="${resolved}"]`)) {
201
+ continue;
202
+ }
203
+ const link = document.createElement('link');
204
+ link.rel = 'stylesheet';
205
+ link.href = resolved;
206
+ link.dataset.dxosPluginId = manifest.id;
207
+ document.head.appendChild(link);
208
+ }
209
+ });
210
+
211
+ const loadFromManifest = (
212
+ manifestUrl: string,
213
+ cache: PluginAssetCache.Cache,
214
+ ): Effect.Effect<{ plugin: Plugin.Plugin; manifest: PluginManifest.ResolvedManifest }, RemotePluginLoadError> =>
215
+ Effect.gen(function* () {
216
+ log.info('loading remote plugin', { manifestUrl });
217
+ const manifest = yield* PluginManifest.fetchManifest(manifestUrl).pipe(
218
+ Effect.mapError(
219
+ (cause) => new RemotePluginLoadError({ context: { locator: manifestUrl, reason: 'manifest-error' }, cause }),
220
+ ),
221
+ );
222
+ const wrapCacheError = Effect.mapError(
223
+ (cause: PluginAssetCache.PluginAssetCacheError) =>
224
+ new RemotePluginLoadError({ context: { locator: manifestUrl, reason: 'cache-error' }, cause }),
225
+ );
226
+ // Dev-mode manifests (served by `vite dev` via composerPlugin) skip the offline
227
+ // cache: chunks resolve on demand through the dev server, the asset list isn't
228
+ // enumerable up-front, and CSS arrives via runtime <style> injection rather than
229
+ // static <link> tags.
230
+ if (!manifest.dev) {
231
+ // Cache the manifest URL alongside its declared assets. Without it, `preload` on a
232
+ // subsequent reload would fetch the manifest from the network — and fail when the
233
+ // plugin's host is offline, dropping the plugin from the runtime.
234
+ const cachedUrls =
235
+ manifest.assetUrls.indexOf(manifestUrl) === -1 ? [manifestUrl, ...manifest.assetUrls] : manifest.assetUrls;
236
+ yield* cache.cache(manifest.id, cachedUrls).pipe(wrapCacheError);
237
+ }
238
+ const entryUrl = manifest.dev
239
+ ? manifest.entryUrl
240
+ : yield* cache.resolve(manifest.id, manifest.entryUrl).pipe(wrapCacheError);
241
+ const mod = yield* Effect.tryPromise({
242
+ try: () => import(/* @vite-ignore */ entryUrl),
243
+ catch: (cause) =>
244
+ new RemotePluginLoadError({ context: { locator: manifestUrl, reason: 'import-failed' }, cause }),
245
+ });
246
+ const plugin = normalizePluginExport(mod);
247
+ if (!plugin.meta.id || !plugin.meta.name) {
248
+ return yield* Effect.fail(
249
+ new RemotePluginLoadError({ context: { locator: manifestUrl, reason: 'meta-missing' } }),
250
+ );
251
+ }
252
+ if (plugin.meta.id !== manifest.id) {
253
+ return yield* Effect.fail(
254
+ new RemotePluginLoadError({
255
+ context: {
256
+ locator: manifestUrl,
257
+ reason: 'meta-mismatch',
258
+ metaId: plugin.meta.id,
259
+ manifestId: manifest.id,
260
+ },
261
+ }),
262
+ );
263
+ }
264
+ // Append stylesheets only after the entry imports cleanly and meta validation
265
+ // passes. If we did this earlier and the import or meta checks failed, the
266
+ // `<link>` tags would leak into the host DOM with no plugin to own their
267
+ // teardown — `uninstall` only runs for plugins the manager actually accepted.
268
+ // In dev mode, Vite injects styles at runtime via the module graph, so static
269
+ // <link> tags would duplicate (or 404, since CSS chunks aren't pre-built).
270
+ if (!manifest.dev) {
271
+ yield* loadStylesheets(manifest, cache).pipe(wrapCacheError);
272
+ }
273
+ return { plugin, manifest };
274
+ });
123
275
 
124
276
  /**
125
- * Preloads previously persisted remote plugins from storage.
277
+ * Preloads previously persisted remote plugins from storage. Per-entry failures
278
+ * are logged and swallowed — the returned effect always succeeds with whichever
279
+ * plugins loaded cleanly, so a single bad entry can't block the host's startup.
126
280
  */
127
- export const preload = async (options: Options = {}): Promise<Plugin.Plugin[]> => {
128
- const storage = options.storage ?? defaultStorage();
129
- const key = options.key ?? DEFAULT_KEY;
281
+ export const preload = (options: PreloadOptions = {}): Effect.Effect<Plugin.Plugin[], never> =>
282
+ Effect.gen(function* () {
283
+ const storage = options.storage ?? defaultStorage();
284
+ const key = options.key ?? DEFAULT_KEY;
285
+ const cache = options.cache ?? PluginAssetCache.noop();
286
+ const onPluginLoaded = options.onPluginLoaded;
130
287
 
131
- const entries = getPersistedRemotePlugins(storage, key);
132
- if (entries.length === 0) {
133
- return [];
134
- }
135
- log.info('preloading remote plugins', { count: entries.length });
136
- const results = await Promise.allSettled(entries.map((entry) => loadRemotePlugin(entry.url)));
137
- const plugins: Plugin.Plugin[] = [];
138
- for (let index = 0; index < results.length; index++) {
139
- const result = results[index];
140
- if (result.status === 'fulfilled') {
141
- plugins.push(result.value);
142
- } else {
143
- log.warn('failed to preload remote plugin', { entry: entries[index], error: result.reason });
288
+ const entries = getPersistedRemotePlugins(storage, key);
289
+ if (entries.length === 0) {
290
+ return [];
144
291
  }
145
- }
146
- return plugins;
147
- };
292
+ log.info('preloading remote plugins', { count: entries.length });
293
+ const total = entries.length;
294
+ let loaded = 0;
295
+ const results = yield* Effect.all(
296
+ entries.map((entry) =>
297
+ loadFromManifest(entry.url, cache).pipe(
298
+ Effect.tapError((error) => Effect.sync(() => log.warn('failed to preload remote plugin', { entry, error }))),
299
+ Effect.option,
300
+ // Tick the progress hook on both success and recoverable failure so
301
+ // the counter monotonically reaches `total`. The host-supplied
302
+ // callback is best-effort: any synchronous throw flows through
303
+ // `Effect.try` and gets logged + ignored so a buggy hook can't
304
+ // derail the preload.
305
+ Effect.tap(() =>
306
+ Effect.sync(() => {
307
+ loaded += 1;
308
+ }).pipe(
309
+ Effect.andThen(Effect.try(() => onPluginLoaded?.(loaded, total))),
310
+ Effect.tapError((error) => Effect.sync(() => log.warn('onPluginLoaded threw', { loaded, total, error }))),
311
+ Effect.ignore,
312
+ ),
313
+ ),
314
+ ),
315
+ ),
316
+ { concurrency: 'unbounded' },
317
+ );
318
+ return results.flatMap((result) =>
319
+ Option.match(result, {
320
+ onNone: () => [],
321
+ onSome: ({ plugin }) => [plugin],
322
+ }),
323
+ );
324
+ });
148
325
 
149
326
  /**
150
327
  * Creates a plugin loader that resolves built-in plugins by ID or loads remote plugins from URLs.
328
+ *
329
+ * Remote URLs must point at a plugin manifest (`plugin.json`). The loader fetches the manifest,
330
+ * eagerly persists every declared asset via the configured `PluginAssetCache`, then dynamic-imports
331
+ * the entry module.
151
332
  */
152
333
  export const make = (builtinPlugins: Plugin.Plugin[], options: Options = {}) => {
153
334
  const storage = options.storage ?? defaultStorage();
154
335
  const key = options.key ?? DEFAULT_KEY;
336
+ const cache = options.cache ?? PluginAssetCache.noop();
155
337
 
156
- return (locator: string): Effect.Effect<Plugin.Plugin, Error> =>
338
+ return (locator: string): Effect.Effect<{ plugin: Plugin.Plugin; dev?: boolean }, RemotePluginLoadError> =>
157
339
  Effect.gen(function* () {
158
340
  const builtin = builtinPlugins.find((plugin) => plugin.meta.id === locator);
159
341
  if (builtin) {
160
- return builtin;
342
+ return { plugin: builtin };
161
343
  }
162
344
  if (!isUrl(locator)) {
163
- return yield* Effect.fail(new Error(`Plugin not found and locator is not a URL: ${locator}`));
345
+ return yield* Effect.fail(new RemotePluginLoadError({ context: { locator, reason: 'invalid-locator' } }));
164
346
  }
165
- const plugin = yield* Effect.tryPromise({
166
- try: () => loadRemotePlugin(locator),
167
- catch: (error) => new Error(`Failed to load remote plugin from ${locator}: ${error}`),
168
- });
169
- const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);
170
- if (duplicate) {
171
- return yield* Effect.fail(
172
- new Error(`Remote plugin ${plugin.meta.id} conflicts with built-in plugin of the same id.`),
173
- );
347
+ const { plugin, manifest } = yield* loadFromManifest(locator, cache);
348
+ // Production manifests can't collide with a builtin id — that would make
349
+ // the registered plugin permanently inaccessible. Dev manifests are
350
+ // allowed to collide because the manager shadow primitive handles the
351
+ // overlap (dev plugin takes the id slot for the session, original is
352
+ // restored on uninstall or page reload).
353
+ if (!manifest.dev) {
354
+ const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);
355
+ if (duplicate) {
356
+ return yield* Effect.fail(
357
+ new RemotePluginLoadError({ context: { locator, reason: 'duplicate-id', id: plugin.meta.id } }),
358
+ );
359
+ }
360
+ persistRemotePlugin(storage, key, { id: plugin.meta.id, url: locator });
174
361
  }
175
- persistRemotePlugin(storage, key, { id: plugin.meta.id, url: locator });
176
- return plugin;
362
+ return { plugin, dev: manifest.dev };
177
363
  });
178
364
  };
365
+
366
+ /**
367
+ * Removes a previously installed remote plugin: drops the persisted entry, evicts cached
368
+ * assets, and removes any stylesheet `<link>` tags that {@link loadFromManifest} appended.
369
+ *
370
+ * Cache eviction failures are logged and swallowed — the persisted entry has already been
371
+ * dropped so the user-visible state is consistent regardless of whether the platform
372
+ * cache cooperated.
373
+ */
374
+ export const uninstall = (pluginId: string, options: Options = {}): Effect.Effect<void, never> =>
375
+ Effect.gen(function* () {
376
+ const storage = options.storage ?? defaultStorage();
377
+ const key = options.key ?? DEFAULT_KEY;
378
+ const cache = options.cache ?? PluginAssetCache.noop();
379
+
380
+ removePersistedRemotePlugin(storage, key, pluginId);
381
+ if (typeof document !== 'undefined') {
382
+ document.querySelectorAll(`link[data-dxos-plugin-id="${pluginId}"]`).forEach((node) => node.remove());
383
+ }
384
+ yield* cache.evict(pluginId).pipe(
385
+ Effect.tapError((error) => Effect.sync(() => log.warn('failed to evict plugin assets', { pluginId, error }))),
386
+ Effect.ignore,
387
+ );
388
+ });
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { type OperationInvoker } from '@dxos/operation';
7
+ import { OperationInvoker } from '@dxos/operation';
8
8
 
9
9
  import { Capabilities } from '../../common';
10
10
  import { Capability } from '../../core';
@@ -10,7 +10,8 @@ import * as ManagedRuntime from 'effect/ManagedRuntime';
10
10
  import * as TestClock from 'effect/TestClock';
11
11
  import { describe, expect } from 'vitest';
12
12
 
13
- import { Operation, OperationInvoker } from '@dxos/operation';
13
+ import { Operation } from '@dxos/compute';
14
+ import { OperationInvoker } from '@dxos/operation';
14
15
 
15
16
  const testRuntime = ManagedRuntime.make(Layer.empty) as unknown as ManagedRuntime.ManagedRuntime<any, any>;
16
17
 
@@ -7,7 +7,7 @@ import * as Stream from 'effect/Stream';
7
7
 
8
8
  import { runAndForwardErrors } from '@dxos/effect';
9
9
  import { log } from '@dxos/log';
10
- import { type OperationInvoker } from '@dxos/operation';
10
+ import { OperationInvoker } from '@dxos/operation';
11
11
 
12
12
  import { UndoOperation } from '../../common';
13
13
  import { EmptyHistoryError } from './errors';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import type { Operation } from '@dxos/operation';
5
+ import type { Operation } from '@dxos/compute';
6
6
 
7
7
  /**
8
8
  * History entry stored by HistoryTracker.
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import type { Operation } from '@dxos/operation';
5
+ import type { Operation } from '@dxos/compute';
6
6
 
7
7
  /**
8
8
  * Label type for translatable text (canonical definition in @dxos/app-toolkit).
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import type { Operation } from '@dxos/operation';
5
+ import type { Operation } from '@dxos/compute';
6
6
 
7
7
  import type * as UndoMapping from './undo-mapping';
8
8
 
@@ -4,7 +4,8 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { OperationHandlerSet, OperationInvoker } from '@dxos/operation';
7
+ import { OperationHandlerSet } from '@dxos/compute';
8
+ import { OperationInvoker } from '@dxos/operation';
8
9
 
9
10
  import { ActivationEvents, Capabilities } from '../common';
10
11
  import { Capability, Plugin } from '../core';
@@ -8,4 +8,5 @@ export const meta: Plugin.Meta = {
8
8
  id: 'org.dxos.plugin.operation',
9
9
  name: 'Operation Plugin',
10
10
  description: 'Provides operation invocation, undo registry, and history tracking.',
11
+ tags: ['system'],
11
12
  };
@@ -9,7 +9,8 @@ import * as Ref from 'effect/Ref';
9
9
  import * as Schema from 'effect/Schema';
10
10
  import * as Stream from 'effect/Stream';
11
11
 
12
- import { Operation, type OperationInvoker } from '@dxos/operation';
12
+ import { Operation } from '@dxos/compute';
13
+ import { OperationInvoker } from '@dxos/operation';
13
14
 
14
15
  //
15
16
  // Test Operations
@@ -8,4 +8,5 @@ export const meta: Plugin.Meta = {
8
8
  id: 'org.dxos.plugin.runtime',
9
9
  name: 'Runtime Plugin',
10
10
  description: 'Provides a managed Effect runtime by composing contributed layers.',
11
+ tags: ['system'],
11
12
  };
@@ -8,9 +8,9 @@ import * as Effect from 'effect/Effect';
8
8
  import * as PubSub from 'effect/PubSub';
9
9
  import * as Queue from 'effect/Queue';
10
10
 
11
+ import { type Operation } from '@dxos/compute';
11
12
  import { runAndForwardErrors } from '@dxos/effect';
12
13
  import { invariant } from '@dxos/invariant';
13
- import { type Operation } from '@dxos/operation';
14
14
 
15
15
  import { ActivationEvents, Capabilities } from '../common';
16
16
  import { ActivationEvent, type Capability, type CapabilityManager, type Plugin, PluginManager } from '../core';
@@ -97,7 +97,7 @@ export const createTestApp = async (opts: TestAppOptions): Promise<TestHarness>
97
97
  Effect.sync(() => {
98
98
  const plugin = plugins.find((plugin) => plugin.meta.id === id);
99
99
  invariant(plugin, `Plugin not found: ${id}`);
100
- return plugin;
100
+ return { plugin };
101
101
  });
102
102
 
103
103
  const manager = PluginManager.make({ pluginLoader, plugins, core, enabled });
@@ -24,7 +24,7 @@ export const fromPlugins = (plugins: Plugin.Plugin[]) =>
24
24
  Effect.sync(() => {
25
25
  const plugin = plugins.find((plugin) => plugin.meta.id === id);
26
26
  invariant(plugin, `Plugin not found: ${id}`);
27
- return plugin;
27
+ return { plugin };
28
28
  });
29
29
 
30
30
  const manager = PluginManager.make({
@@ -23,7 +23,7 @@ const DefaultStory = () => {
23
23
  };
24
24
 
25
25
  const meta = {
26
- title: 'sdk/app-framework/withPluginManager',
26
+ title: 'sdk/app-framework/testing/withPluginManager',
27
27
  render: DefaultStory,
28
28
  decorators: [
29
29
  withTheme(),
@@ -55,11 +55,7 @@ const DefaultStory = ({ plugins }: DefaultStoryProps) => {
55
55
  plugins,
56
56
  core,
57
57
  placeholder: () => {
58
- return (
59
- <div role='none' className='text-description'>
60
- Loading...
61
- </div>
62
- );
58
+ return <div className='text-description'>Loading...</div>;
63
59
  },
64
60
  });
65
61
 
@@ -67,7 +63,7 @@ const DefaultStory = ({ plugins }: DefaultStoryProps) => {
67
63
  };
68
64
 
69
65
  const meta = {
70
- title: 'sdk/app-framework/App',
66
+ title: 'sdk/app-framework/components/App',
71
67
  render: DefaultStory,
72
68
  decorators: [withTheme()],
73
69
  parameters: {
@@ -25,10 +25,21 @@ export const App = ({ placeholder: Placeholder, ready, error, debounce, progress
25
25
  // Emit a once-per-app `app-framework:first-interactive` mark the first time
26
26
  // the placeholder is dismissed and the real app shell renders. Closes the
27
27
  // gap between `Startup` activated and the first interactive paint.
28
+ //
29
+ // Also dismisses the native-DOM boot loader from
30
+ // `@dxos/app-framework/vite-plugin` here — the framework owns the
31
+ // handoff-complete signal, so dismissing in `App` covers both hosts that
32
+ // wire in a `Placeholder` (which may have its own dismiss path) and hosts
33
+ // that don't (the loader would otherwise sit forever as a `z-index: 10`
34
+ // overlay covering the rendered shell).
28
35
  useEffect(() => {
29
- if (placeholderDismissed && performance.getEntriesByName(FIRST_INTERACTIVE_MARK).length === 0) {
36
+ if (!placeholderDismissed) {
37
+ return;
38
+ }
39
+ if (performance.getEntriesByName(FIRST_INTERACTIVE_MARK).length === 0) {
30
40
  performance.mark(FIRST_INTERACTIVE_MARK);
31
41
  }
42
+ (window as { __bootLoader?: { dismiss?: () => void } }).__bootLoader?.dismiss?.();
32
43
  }, [placeholderDismissed]);
33
44
 
34
45
  if (error) {
@@ -0,0 +1,77 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React, { useEffect, useState } from 'react';
7
+ import { expect, within } from 'storybook/test';
8
+
9
+ import { Composer } from '@dxos/brand';
10
+ import { Input, Panel, Toolbar } from '@dxos/react-ui';
11
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
12
+
13
+ import { Placeholder } from './Placeholder';
14
+
15
+ /**
16
+ * The story renders the brand-agnostic `Placeholder` from `@dxos/app-framework/ui`
17
+ * with the Composer brand icon as its `logo`, so the storybook mirrors what
18
+ * composer-app actually mounts in production. The render function form lets
19
+ * the SVG accept the placeholder's animation `className` directly.
20
+ */
21
+ const meta = {
22
+ title: 'sdk/app-framework/components/Placeholder',
23
+ component: Placeholder,
24
+ render: () => {
25
+ const [stage, setStage] = useState(0);
26
+ const [auto, setAuto] = useState(false);
27
+ useEffect(() => {
28
+ if (!auto) {
29
+ return;
30
+ }
31
+
32
+ const interval = setInterval(() => {
33
+ setStage((prev) => {
34
+ return prev >= 2 ? 0 : prev + 1;
35
+ });
36
+ }, 3_000);
37
+
38
+ return () => clearInterval(interval);
39
+ }, [auto]);
40
+
41
+ return (
42
+ <Panel.Root>
43
+ <Panel.Toolbar asChild>
44
+ <Toolbar.Root classNames='gap-2'>
45
+ <Input.Root>
46
+ <Input.Checkbox checked={auto} onCheckedChange={(checked) => setAuto(checked === true)} />
47
+ <Input.Label>Auto</Input.Label>
48
+ </Input.Root>
49
+ <Toolbar.Button onClick={() => setStage((prev) => (prev < 2 ? prev + 1 : 0))}>Next</Toolbar.Button>
50
+ <Toolbar.Text>{stage}</Toolbar.Text>
51
+ </Toolbar.Root>
52
+ </Panel.Toolbar>
53
+ <Panel.Content>
54
+ <Placeholder stage={stage} logo={(logoProps) => <Composer {...logoProps} />} />
55
+ </Panel.Content>
56
+ </Panel.Root>
57
+ );
58
+ },
59
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
60
+ tags: ['test'],
61
+ } satisfies Meta<typeof Placeholder>;
62
+
63
+ export default meta;
64
+
65
+ type Story = StoryObj<typeof meta>;
66
+
67
+ export const Default: Story = {
68
+ args: {
69
+ stage: 0,
70
+ },
71
+ play: async ({ canvasElement }) => {
72
+ const canvas = within(canvasElement);
73
+ // Smoke test: the toolbar's `Next` button is rendered alongside the
74
+ // placeholder, so the story mounted without throwing.
75
+ await expect(canvas.getByRole('button', { name: 'Next' })).toBeInTheDocument();
76
+ },
77
+ };