@dxos/app-framework 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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.
- package/.storybook/main.mts +9 -0
- package/.storybook/preview.mts +8 -0
- package/dist/lib/browser/capability-5RRH3WIB.mjs +35 -0
- package/dist/lib/browser/capability-5RRH3WIB.mjs.map +7 -0
- package/dist/lib/browser/capability-LUKGKUQH.mjs +38 -0
- package/dist/lib/browser/capability-LUKGKUQH.mjs.map +7 -0
- package/dist/lib/browser/chunk-23D4SJUE.mjs +42 -0
- package/dist/lib/browser/chunk-23D4SJUE.mjs.map +7 -0
- package/dist/lib/browser/chunk-3JWJXGLK.mjs +79 -0
- package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +7 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs +34 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs +581 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs +422 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JD3Z5NEF.mjs +469 -0
- package/dist/lib/browser/chunk-JD3Z5NEF.mjs.map +7 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs +1174 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +7 -0
- package/dist/lib/browser/chunk-WBHCSOBW.mjs +80 -0
- package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
- package/dist/lib/browser/chunk-Z55LVAGN.mjs +213 -0
- package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs +142 -0
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +76 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +24 -0
- package/dist/lib/browser/common/capabilities.mjs +46 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/capability.mjs +30 -0
- package/dist/lib/browser/core/capability.mjs.map +7 -0
- package/dist/lib/browser/core/plugin-manager.mjs +19 -0
- package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/browser/core/plugin.mjs +37 -0
- package/dist/lib/browser/core/plugin.mjs.map +7 -0
- package/dist/lib/browser/core/url-loader.mjs +24 -0
- package/dist/lib/browser/core/url-loader.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +108 -162
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs +44 -0
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +235 -48
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/testing/react.mjs +78 -0
- package/dist/lib/browser/testing/react.mjs.map +7 -0
- package/dist/lib/browser/ui/index.mjs +48 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-FCGZVIEG.mjs +39 -0
- package/dist/lib/node-esm/capability-FCGZVIEG.mjs.map +7 -0
- package/dist/lib/node-esm/capability-JOIQ2MQE.mjs +36 -0
- package/dist/lib/node-esm/capability-JOIQ2MQE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs +35 -0
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D347W3KO.mjs +143 -0
- package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs +470 -0
- package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HTBJU5FX.mjs +214 -0
- package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs +423 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs +1175 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SBS2YMPT.mjs +43 -0
- package/dist/lib/node-esm/chunk-SBS2YMPT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs +80 -0
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs +582 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs +81 -0
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +77 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +25 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +47 -0
- package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
- package/dist/lib/node-esm/core/activation-event.mjs +21 -0
- package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
- package/dist/lib/node-esm/core/capability.mjs +31 -0
- package/dist/lib/node-esm/core/capability.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin.mjs +38 -0
- package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/core/url-loader.mjs +25 -0
- package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +108 -162
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs +45 -0
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +235 -48
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/testing/react.mjs +79 -0
- package/dist/lib/node-esm/testing/react.mjs.map +7 -0
- package/dist/lib/node-esm/ui/index.mjs +49 -0
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/plugin/node-esm/index.mjs +893 -0
- package/dist/plugin/node-esm/index.mjs.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/types/src/cli/cli.d.ts +39 -0
- package/dist/types/src/cli/cli.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/common/activation-events.d.ts +27 -0
- package/dist/types/src/common/activation-events.d.ts.map +1 -0
- package/dist/types/src/common/annotations.d.ts +1 -0
- package/dist/types/src/common/annotations.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +110 -190
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +4 -8
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +19 -0
- package/dist/types/src/common/operations.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +8 -8
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/context.d.ts +5 -0
- package/dist/types/src/context.d.ts.map +1 -0
- package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
- package/dist/types/src/core/activation-event.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.d.ts +48 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.test.d.ts +2 -0
- package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/capability.d.ts +156 -0
- package/dist/types/src/core/capability.d.ts.map +1 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +11 -4
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
- package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.d.ts +239 -0
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.d.ts +101 -0
- package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +208 -37
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +101 -0
- package/dist/types/src/core/registry.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.d.ts +127 -0
- package/dist/types/src/core/url-loader.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.test.d.ts +2 -0
- package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts +32 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
- package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/index.d.ts +3 -0
- package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/meta.d.ts +3 -0
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/testing.d.ts +59 -0
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/index.d.ts +2 -0
- package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +67 -0
- package/dist/types/src/testing/harness.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/react.d.ts +27 -0
- package/dist/types/src/testing/react.d.ts.map +1 -0
- package/dist/types/src/testing/react.test.d.ts +2 -0
- package/dist/types/src/testing/react.test.d.ts.map +1 -0
- package/dist/types/src/testing/service.d.ts +8 -0
- package/dist/types/src/testing/service.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +8 -9
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts +9 -0
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/index.d.ts +2 -0
- package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
- package/dist/types/src/{playground/playground.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +5 -4
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
- package/dist/types/src/{components/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -2
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
- package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
- package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
- package/dist/types/src/ui/components/index.d.ts +5 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/index.d.ts +6 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.d.ts +89 -0
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/{components → ui/hooks}/useLoading.d.ts +1 -2
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
- package/dist/types/src/ui/index.d.ts +3 -0
- package/dist/types/src/ui/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/index.d.ts +5 -0
- package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
- package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/packages.d.ts +13 -0
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +26 -3
- package/package.json +114 -54
- package/src/cli/cli.ts +107 -0
- package/src/{playground/logger → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +44 -0
- package/src/{components/index.ts → common/annotations.ts} +0 -2
- package/src/common/capabilities.ts +169 -195
- package/src/common/index.ts +4 -8
- package/src/common/operations.ts +35 -0
- package/src/common/translations.ts +18 -10
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +10 -7
- package/src/core/capability-manager.test.ts +151 -0
- package/src/core/capability-manager.ts +192 -0
- package/src/core/capability.ts +247 -0
- package/src/core/edge-registry-plugin-provider.ts +92 -0
- package/src/core/index.ts +11 -4
- package/src/core/plugin-asset-cache.ts +60 -0
- package/src/core/plugin-manager.test.ts +1671 -0
- package/src/core/plugin-manager.ts +1335 -0
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +369 -43
- package/src/core/registry.ts +157 -0
- package/src/core/url-loader.test.ts +221 -0
- package/src/core/url-loader.ts +388 -0
- package/src/index.ts +3 -4
- package/src/plugin-operation/OperationPlugin.ts +24 -0
- package/src/plugin-operation/history/capability.ts +36 -0
- package/src/plugin-operation/history/errors.ts +7 -0
- package/src/plugin-operation/history/history-tracker.test.ts +374 -0
- package/src/plugin-operation/history/history-tracker.ts +128 -0
- package/src/plugin-operation/history/index.ts +9 -0
- package/src/plugin-operation/history/types.ts +17 -0
- package/src/plugin-operation/history/undo-mapping.ts +135 -0
- package/src/plugin-operation/history/undo-registry.test.ts +72 -0
- package/src/plugin-operation/history/undo-registry.ts +54 -0
- package/src/plugin-operation/index.ts +6 -0
- package/src/plugin-operation/invoker-capability.ts +55 -0
- package/src/plugin-operation/meta.ts +12 -0
- package/src/plugin-operation/testing.ts +155 -0
- package/src/plugin-runtime/RuntimePlugin.ts +19 -0
- package/src/plugin-runtime/capability.ts +53 -0
- package/src/plugin-runtime/index.ts +5 -0
- package/src/plugin-runtime/meta.ts +12 -0
- package/src/testing/harness.ts +229 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/react.test.tsx +48 -0
- package/src/testing/react.tsx +113 -0
- package/src/testing/service.ts +52 -0
- package/src/testing/withPluginManager.stories.tsx +9 -10
- package/src/testing/withPluginManager.tsx +74 -50
- package/src/ui/components/App/App.stories.tsx +88 -0
- package/src/ui/components/App/App.tsx +81 -0
- package/src/{playground/layout → ui/components/App}/index.ts +1 -1
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
- package/src/{playground/debug → ui/components/Placeholder}/index.ts +1 -1
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +185 -0
- package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
- package/src/ui/components/PluginManager/index.ts +5 -0
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
- package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
- package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
- package/src/ui/components/Surface/context.ts +12 -0
- package/src/ui/components/Surface/index.ts +54 -0
- package/src/ui/components/Surface/types.test.ts +126 -0
- package/src/ui/components/Surface/types.ts +269 -0
- package/src/ui/components/index.ts +8 -0
- package/src/ui/hooks/index.ts +9 -0
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +424 -0
- package/src/ui/hooks/useCapabilities.ts +67 -0
- package/src/{components → ui/hooks}/useLoading.tsx +16 -10
- package/src/ui/hooks/useSettingsState.ts +26 -0
- package/src/ui/hooks/useSurface.ts +13 -0
- package/src/ui/index.ts +6 -0
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
- package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
- package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
- package/src/vite-plugin/boot-loader/index.ts +5 -0
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/composer/index.ts +306 -0
- package/src/vite-plugin/import-map/index.ts +527 -0
- package/src/vite-plugin/index.ts +10 -0
- package/src/vite-plugin/manifest.test.ts +46 -0
- package/src/vite-plugin/manifest.ts +57 -0
- package/src/vite-plugin/packages.ts +187 -0
- package/tsconfig.json +24 -15
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +8 -6
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
- package/dist/lib/browser/app-graph-builder-AFFC6VB2.mjs +0 -137
- package/dist/lib/browser/app-graph-builder-AFFC6VB2.mjs.map +0 -7
- package/dist/lib/browser/chunk-ORWHM7CO.mjs +0 -32
- package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
- package/dist/lib/browser/chunk-OZY7HV2A.mjs +0 -1643
- package/dist/lib/browser/chunk-OZY7HV2A.mjs.map +0 -7
- package/dist/lib/browser/chunk-T6M7JB7M.mjs +0 -471
- package/dist/lib/browser/chunk-T6M7JB7M.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-QG7UPGQX.mjs +0 -11
- package/dist/lib/browser/intent-resolver-4S4PSTM5.mjs +0 -39
- package/dist/lib/browser/intent-resolver-4S4PSTM5.mjs.map +0 -7
- package/dist/lib/browser/store-6E33KLGK.mjs +0 -30
- package/dist/lib/browser/store-6E33KLGK.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -85
- package/dist/lib/node-esm/app-graph-builder-S4OAULX5.mjs +0 -138
- package/dist/lib/node-esm/app-graph-builder-S4OAULX5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F63ZRXMK.mjs +0 -1645
- package/dist/lib/node-esm/chunk-F63ZRXMK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJFU7QOR.mjs +0 -472
- package/dist/lib/node-esm/chunk-HJFU7QOR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs +0 -34
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-NXBGPJOX.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-2ZKXI5ET.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-2ZKXI5ET.mjs.map +0 -7
- package/dist/lib/node-esm/store-QQUTQHHT.mjs +0 -31
- package/dist/lib/node-esm/store-QQUTQHHT.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -86
- package/dist/types/src/common/collaboration.d.ts +0 -20
- package/dist/types/src/common/collaboration.d.ts.map +0 -1
- package/dist/types/src/common/events.d.ts +0 -52
- package/dist/types/src/common/events.d.ts.map +0 -1
- package/dist/types/src/common/file.d.ts +0 -14
- package/dist/types/src/common/file.d.ts.map +0 -1
- package/dist/types/src/common/graph.d.ts +0 -21
- package/dist/types/src/common/graph.d.ts.map +0 -1
- package/dist/types/src/common/layout.d.ts +0 -281
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts +0 -65
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/components/App.d.ts +0 -10
- package/dist/types/src/components/App.d.ts.map +0 -1
- package/dist/types/src/components/App.stories.d.ts.map +0 -1
- package/dist/types/src/components/DefaultFallback.d.ts +0 -8
- package/dist/types/src/components/DefaultFallback.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/components/useApp.d.ts +0 -44
- package/dist/types/src/components/useApp.d.ts.map +0 -1
- package/dist/types/src/components/useLoading.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -117
- package/dist/types/src/core/capabilities.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.test.d.ts +0 -2
- package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
- package/dist/types/src/core/events.d.ts.map +0 -1
- package/dist/types/src/core/manager.d.ts +0 -126
- package/dist/types/src/core/manager.d.ts.map +0 -1
- package/dist/types/src/core/manager.test.d.ts +0 -2
- package/dist/types/src/core/manager.test.d.ts.map +0 -1
- package/dist/types/src/playground/debug/Debug.d.ts +0 -6
- package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
- package/dist/types/src/playground/debug/index.d.ts +0 -2
- package/dist/types/src/playground/debug/index.d.ts.map +0 -1
- package/dist/types/src/playground/debug/plugin.d.ts +0 -2
- package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Main.d.ts +0 -6
- package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/generator/generator.d.ts +0 -7
- package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
- package/dist/types/src/playground/generator/index.d.ts +0 -3
- package/dist/types/src/playground/generator/index.d.ts.map +0 -1
- package/dist/types/src/playground/generator/plugin.d.ts +0 -2
- package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/layout/Layout.d.ts +0 -8
- package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
- package/dist/types/src/playground/layout/index.d.ts +0 -2
- package/dist/types/src/playground/layout/index.d.ts.map +0 -1
- package/dist/types/src/playground/layout/plugin.d.ts +0 -2
- package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/logger/index.d.ts +0 -2
- package/dist/types/src/playground/logger/index.d.ts.map +0 -1
- package/dist/types/src/playground/logger/plugin.d.ts +0 -2
- package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/schema.d.ts +0 -13
- package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/actions.d.ts +0 -38
- package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/errors.d.ts +0 -16
- package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/index.d.ts +0 -6
- package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent.d.ts +0 -63
- package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/actions.d.ts +0 -27
- package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/index.d.ts +0 -3
- package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/store.d.ts +0 -5
- package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/translations.d.ts +0 -10
- package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
- package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/react/IntentContext.d.ts +0 -8
- package/dist/types/src/react/IntentContext.d.ts.map +0 -1
- package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
- package/dist/types/src/react/Surface.d.ts +0 -12
- package/dist/types/src/react/Surface.d.ts.map +0 -1
- package/dist/types/src/react/Surface.stories.d.ts +0 -18
- package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
- package/dist/types/src/react/common.d.ts +0 -13
- package/dist/types/src/react/common.d.ts.map +0 -1
- package/dist/types/src/react/index.d.ts +0 -7
- package/dist/types/src/react/index.d.ts.map +0 -1
- package/dist/types/src/react/useCapabilities.d.ts +0 -13
- package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
- package/dist/types/src/react/useIntentResolver.d.ts +0 -3
- package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/common/collaboration.ts +0 -18
- package/src/common/events.ts +0 -79
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/layout.ts +0 -278
- package/src/common/surface.ts +0 -86
- package/src/components/App.stories.tsx +0 -35
- package/src/components/App.tsx +0 -59
- package/src/components/DefaultFallback.tsx +0 -26
- package/src/components/useApp.tsx +0 -166
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -259
- package/src/core/manager.test.ts +0 -516
- package/src/core/manager.ts +0 -597
- package/src/playground/debug/Debug.tsx +0 -39
- package/src/playground/debug/plugin.ts +0 -17
- package/src/playground/generator/Main.tsx +0 -71
- package/src/playground/generator/Toolbar.tsx +0 -47
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -23
- package/src/playground/layout/Layout.tsx +0 -33
- package/src/playground/layout/plugin.ts +0 -17
- package/src/playground/logger/Toolbar.tsx +0 -30
- package/src/playground/logger/plugin.ts +0 -37
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -47
- package/src/plugin-intent/IntentPlugin.ts +0 -21
- package/src/plugin-intent/actions.ts +0 -33
- package/src/plugin-intent/errors.ts +0 -39
- package/src/plugin-intent/index.ts +0 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
- package/src/plugin-intent/intent-dispatcher.ts +0 -335
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-settings/SettingsPlugin.ts +0 -36
- package/src/plugin-settings/actions.ts +0 -29
- package/src/plugin-settings/app-graph-builder.ts +0 -158
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -35
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/ErrorBoundary.tsx +0 -54
- package/src/react/IntentContext.tsx +0 -35
- package/src/react/Surface.stories.tsx +0 -104
- package/src/react/Surface.tsx +0 -78
- package/src/react/common.ts +0 -13
- package/src/react/index.ts +0 -10
- package/src/react/useCapabilities.ts +0 -31
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
- /package/dist/lib/{node-esm/worker.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-NXBGPJOX.mjs.map → browser/common/activation-events.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → common/capabilities.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-QG7UPGQX.mjs.map → core/activation-event.mjs.map} +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// Inline driver script — injected into the host's `<body>` by `bootLoaderPlugin`.
|
|
6
|
+
// Runs before the module bundle is fetched, so the host can observe `boot:html-parsed`
|
|
7
|
+
// and update the visible status from `main.tsx` between phases.
|
|
8
|
+
//
|
|
9
|
+
// The loader has two host-driven states (plus an unobserved idle state on
|
|
10
|
+
// script entry that's promoted automatically — there's no API to opt out of
|
|
11
|
+
// motion on cold load, by design):
|
|
12
|
+
// - State 1 (slow tick): auto-entered the moment the inline script runs;
|
|
13
|
+
// asymptotic creep toward `STATE_1_ASYMPTOTE`%.
|
|
14
|
+
// - State 2 (progress): host-driven, value supplied to `progress(fraction)`.
|
|
15
|
+
// The creep stays alive in state 2 too, with a
|
|
16
|
+
// ceiling that climbs `STATE_2_BUMP` percent ahead
|
|
17
|
+
// of the most recent `progress()` call (capped at
|
|
18
|
+
// `ABSOLUTE_CEILING`). Between sparse host updates
|
|
19
|
+
// the ring keeps inching forward toward that
|
|
20
|
+
// ceiling, so a long activation gap doesn't read
|
|
21
|
+
// as a frozen disc.
|
|
22
|
+
//
|
|
23
|
+
// `window.__bootLoader.status(text)` updates the visible status line.
|
|
24
|
+
// `window.__bootLoader.progress(fraction)` enter state 2 with `fraction` ∈ [0, 1].
|
|
25
|
+
// `window.__bootLoader.dismiss()` remove the loader DOM (terminal).
|
|
26
|
+
//
|
|
27
|
+
// Kept ES5-flavoured so the bundler never has to touch it.
|
|
28
|
+
|
|
29
|
+
(function () {
|
|
30
|
+
performance.mark('boot:html-parsed');
|
|
31
|
+
|
|
32
|
+
// Asymptotic creep — `next = raw + (ceiling - raw) * creepRate` per tick,
|
|
33
|
+
// so the var eases toward `ceiling` and never quite reaches it.
|
|
34
|
+
var CREEP_TICK_MS = 100;
|
|
35
|
+
// State 1 creep is a "we're alive" hint before any real progress lands,
|
|
36
|
+
// so it eases gently toward a low asymptote.
|
|
37
|
+
var STATE_1_RATE = 0.04;
|
|
38
|
+
var STATE_1_ASYMPTOTE = 20;
|
|
39
|
+
// State 2 creep bridges the gap between sparse `progress()` calls.
|
|
40
|
+
// Tuning is a trade-off:
|
|
41
|
+
// - Larger `STATE_2_RATE` → fills faster, but reaches the ceiling
|
|
42
|
+
// sooner and then sits idle (looks "paused").
|
|
43
|
+
// - Larger `STATE_2_BUMP` → ring leads further ahead of the host's
|
|
44
|
+
// last reported value, so subsequent host updates feel "behind"
|
|
45
|
+
// until they cross the lead.
|
|
46
|
+
// Current values aim for continuous-but-modest motion through a ~5 s
|
|
47
|
+
// activation silence: 50 % → ~64 % over 5 s, ceiling at host + 15 % so
|
|
48
|
+
// real progress can catch up via `Math.max` without big jumps.
|
|
49
|
+
var STATE_2_RATE = 0.05;
|
|
50
|
+
var STATE_2_BUMP = 15;
|
|
51
|
+
// Ring never auto-creeps past this — keeps the user from interpreting the
|
|
52
|
+
// ring as "almost done" while the host hasn't actually said so.
|
|
53
|
+
var ABSOLUTE_CEILING = 90;
|
|
54
|
+
|
|
55
|
+
// 0 = idle (transient — auto-promoted to 1 immediately below),
|
|
56
|
+
// 1 = slow tick, 2 = host-driven progress.
|
|
57
|
+
var state = 0;
|
|
58
|
+
var creepHandle = null;
|
|
59
|
+
var creepCeiling = STATE_1_ASYMPTOTE;
|
|
60
|
+
var creepRate = STATE_1_RATE;
|
|
61
|
+
var trace = /(?:^|[?&])trace=1(?:&|$)/.test(window.location.search);
|
|
62
|
+
var start = Date.now();
|
|
63
|
+
var last = Date.now();
|
|
64
|
+
var timings = [];
|
|
65
|
+
|
|
66
|
+
function ensureCreep() {
|
|
67
|
+
if (creepHandle != null) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
creepHandle = setInterval(function () {
|
|
72
|
+
var element = document.getElementById('boot-loader-disc');
|
|
73
|
+
if (!element) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
var raw = parseFloat(element.style.getPropertyValue('--boot-loader-bar-progress')) || 0;
|
|
77
|
+
// Already at (or above) the ceiling — nothing to do this tick.
|
|
78
|
+
if (raw >= creepCeiling - 0.1) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
var next = raw + (creepCeiling - raw) * creepRate;
|
|
82
|
+
element.style.setProperty('--boot-loader-bar-progress', String(next));
|
|
83
|
+
if (next > 0 && next < 100) {
|
|
84
|
+
element.setAttribute('data-progress-active', '');
|
|
85
|
+
}
|
|
86
|
+
}, CREEP_TICK_MS);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function stopCreep() {
|
|
90
|
+
if (creepHandle != null) {
|
|
91
|
+
clearInterval(creepHandle);
|
|
92
|
+
creepHandle = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Read the element's *current animated* translateY in pixels — the
|
|
97
|
+
// interpolated value mid-transition, not the property as last written.
|
|
98
|
+
// `getComputedStyle(...).transform` returns a `matrix(...)` /
|
|
99
|
+
// `matrix3d(...)` string with the live, interpolated translation.
|
|
100
|
+
// Used by the status FLIP so successive appends chain off the in-flight
|
|
101
|
+
// position instead of yanking the track back to a fixed invert target.
|
|
102
|
+
function readTranslateY(element) {
|
|
103
|
+
var computed = window.getComputedStyle(element).transform;
|
|
104
|
+
if (!computed || computed === 'none') {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
var match = computed.match(/matrix.*\(([^)]+)\)/);
|
|
108
|
+
if (!match) {
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
var values = match[1].split(',');
|
|
112
|
+
// 2D `matrix(a, b, c, d, tx, ty)` → ty at index 5.
|
|
113
|
+
// 3D `matrix3d(...)` (16 entries) → ty at index 13.
|
|
114
|
+
if (values.length === 6) {
|
|
115
|
+
return parseFloat(values[5]) || 0;
|
|
116
|
+
}
|
|
117
|
+
if (values.length === 16) {
|
|
118
|
+
return parseFloat(values[13]) || 0;
|
|
119
|
+
}
|
|
120
|
+
return 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
window.__bootLoader = {
|
|
124
|
+
/**
|
|
125
|
+
* Update the visible status line. The caller owns formatting — the
|
|
126
|
+
* loader just renders `humanized` and records the structured fields
|
|
127
|
+
* for the trace. Idempotent on the full structured payload: equal
|
|
128
|
+
* back-to-back updates are a no-op, but two updates with the same
|
|
129
|
+
* visible text and different `event` / `module` ids still produce a
|
|
130
|
+
* fresh trace entry so the timeline can distinguish those transitions.
|
|
131
|
+
*
|
|
132
|
+
* Payload: `{ event?, module?, humanized, range? }`.
|
|
133
|
+
* - `humanized`: the exact string to display (e.g. "Loading framework…",
|
|
134
|
+
* "Activating Observability: react-surface").
|
|
135
|
+
* - `event` / `module`: optional raw ids for the trace, when the
|
|
136
|
+
* update originates from an activation transition.
|
|
137
|
+
* - `range`: optional `{ index, total }` for ticking progress within
|
|
138
|
+
* a single phase (e.g. "Loading plugins (12/80)"). When present,
|
|
139
|
+
* the loader replaces the current line in place rather than
|
|
140
|
+
* appending a new one — so 80 plugin loads produce one trace
|
|
141
|
+
* entry with an updating suffix instead of 80 separate lines.
|
|
142
|
+
*/
|
|
143
|
+
status: function (payload) {
|
|
144
|
+
if (!payload || typeof payload !== 'object') {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
var humanized = payload.humanized || '';
|
|
148
|
+
var event = payload.event || null;
|
|
149
|
+
var moduleId = payload.module || null;
|
|
150
|
+
var range =
|
|
151
|
+
payload.range && typeof payload.range.index === 'number' && typeof payload.range.total === 'number'
|
|
152
|
+
? payload.range
|
|
153
|
+
: null;
|
|
154
|
+
// Display text appends the (i/n) suffix when a range is provided so
|
|
155
|
+
// the same `humanized` string can tick through a count without the
|
|
156
|
+
// caller having to format it.
|
|
157
|
+
var displayText = range ? humanized + ' (' + range.index + '/' + range.total + ')' : humanized;
|
|
158
|
+
// Compare against the previous entry's structured fields, not the
|
|
159
|
+
// DOM text alone — two different transitions can humanize to the same
|
|
160
|
+
// visible string (e.g. an event-level "Activating Foo" followed by a
|
|
161
|
+
// module-level "Activating Foo: react-surface" reduced to "Activating
|
|
162
|
+
// Foo" by a custom formatter), and the trace should still carry both.
|
|
163
|
+
var previous = timings.length > 0 ? timings[timings.length - 1] : null;
|
|
164
|
+
if (
|
|
165
|
+
previous &&
|
|
166
|
+
previous.text === displayText &&
|
|
167
|
+
(previous.event || null) === event &&
|
|
168
|
+
(previous.module || null) === moduleId
|
|
169
|
+
) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (range && previous) {
|
|
173
|
+
// Range tick — collapse into the previous trace entry instead of
|
|
174
|
+
// appending. The trace timeline records one transition per phase,
|
|
175
|
+
// not one per `(i/n)` step, keeping the boot trace compact.
|
|
176
|
+
previous.text = displayText;
|
|
177
|
+
} else {
|
|
178
|
+
if (previous) {
|
|
179
|
+
previous.duration = Date.now() - last;
|
|
180
|
+
}
|
|
181
|
+
var entry = { text: displayText };
|
|
182
|
+
if (event) {
|
|
183
|
+
entry.event = event;
|
|
184
|
+
}
|
|
185
|
+
if (moduleId) {
|
|
186
|
+
entry.module = moduleId;
|
|
187
|
+
}
|
|
188
|
+
timings.push(entry);
|
|
189
|
+
last = Date.now();
|
|
190
|
+
}
|
|
191
|
+
var element = document.getElementById('boot-loader-status');
|
|
192
|
+
if (!element) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
// The track holds every appended status line. On the first
|
|
196
|
+
// `status()` call we hoist any pre-existing lines (the initial
|
|
197
|
+
// status injected by `bootLoaderPlugin`) into the track so the
|
|
198
|
+
// CSS `transform` translation applies uniformly.
|
|
199
|
+
var track = document.getElementById('boot-loader-status-track');
|
|
200
|
+
var lastLine = track.lastElementChild;
|
|
201
|
+
if (range && lastLine) {
|
|
202
|
+
// Range tick — replace the current visible line's text in place,
|
|
203
|
+
// no slide. The line keeps its position so the (i/n) counter just
|
|
204
|
+
// updates over the same row.
|
|
205
|
+
lastLine.textContent = displayText;
|
|
206
|
+
} else {
|
|
207
|
+
// Fresh phase (or first line) — append to the bottom-anchored track
|
|
208
|
+
// (see `#boot-loader-status`'s `justify-content: flex-end` in
|
|
209
|
+
// `boot-loader.css`) and run a FLIP-style slide so the new line
|
|
210
|
+
// rises from below the viewport's bottom edge instead of snapping
|
|
211
|
+
// into place. The flex layout handles which lines are visible at
|
|
212
|
+
// rest (newest on the last row, older lines stacked above, anything
|
|
213
|
+
// that overflows is clipped at the top by `overflow: hidden`), so
|
|
214
|
+
// this code only owns the animation.
|
|
215
|
+
var line = document.createElement('div');
|
|
216
|
+
line.className = 'boot-loader-status-line';
|
|
217
|
+
line.textContent = displayText;
|
|
218
|
+
// Read the track's current animated translateY before mutating
|
|
219
|
+
// anything. When a previous slide is still in flight this is
|
|
220
|
+
// somewhere in (0, lineHeight]; when the track is at rest it's 0.
|
|
221
|
+
// Reading via `getComputedStyle` (not `style.transform`) gives the
|
|
222
|
+
// interpolated mid-transition value, which is what the chain math
|
|
223
|
+
// below needs.
|
|
224
|
+
var currentY = readTranslateY(track);
|
|
225
|
+
// Measure the line height from a sibling when one exists — the
|
|
226
|
+
// newly appended line may not have laid out yet at the moment of
|
|
227
|
+
// the bounding-rect read in some engines. Pixels (not `em`) because
|
|
228
|
+
// some engines (and headless Chromium) don't reliably interpolate
|
|
229
|
+
// `transform` between `em`-valued translateY's.
|
|
230
|
+
var probe = track.lastElementChild;
|
|
231
|
+
track.appendChild(line);
|
|
232
|
+
var lineHeight = (probe || line).getBoundingClientRect().height || 0;
|
|
233
|
+
// Invert: snap the track down to `currentY + lineHeight` with no
|
|
234
|
+
// transition. The `+ lineHeight` is the usual FLIP offset (the
|
|
235
|
+
// track just grew by a row, so this keeps every existing line at
|
|
236
|
+
// the pixel position it had before the append). The `+ currentY`
|
|
237
|
+
// is the chain term — if a previous slide was still in flight we
|
|
238
|
+
// pin the track to its in-flight position instead of yanking it
|
|
239
|
+
// back to its pre-animation start, so the previous line keeps
|
|
240
|
+
// rising smoothly through the append rather than jumping down.
|
|
241
|
+
// Then force a reflow and animate to translateY(0); the track
|
|
242
|
+
// covers the full `currentY + lineHeight` distance in one ride
|
|
243
|
+
// and bursts of rapid updates read as a continuous scroll rather
|
|
244
|
+
// than overlapping snaps.
|
|
245
|
+
track.style.transition = 'none';
|
|
246
|
+
track.style.transform = `translateY(${currentY + lineHeight}px)`;
|
|
247
|
+
void track.offsetHeight;
|
|
248
|
+
track.style.transition = '';
|
|
249
|
+
track.style.transform = 'translateY(0)';
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Enter state 2 (host-driven progress) — set the determinate ring to
|
|
255
|
+
* `fraction` ∈ [0, 1]. Invalid / negative / non-finite values clamp to
|
|
256
|
+
* 0 (the empty ring) rather than letting `NaN`/`Infinity` slip into
|
|
257
|
+
* `--boot-loader-bar-progress`, which CSS would treat as invalid and
|
|
258
|
+
* silently reset to the 0% var() default. The state-1 creep timer is
|
|
259
|
+
* left running with a new ceiling so the ring keeps inching forward
|
|
260
|
+
* between host updates.
|
|
261
|
+
*
|
|
262
|
+
* The ring never regresses: if the requested value is below the
|
|
263
|
+
* current var (e.g. the host's first call is `progress(0)` while the
|
|
264
|
+
* creep had already reached ~12%), the existing value is held. The
|
|
265
|
+
* host's progress catches up once it exceeds the held floor, so the
|
|
266
|
+
* ring's motion stays monotonic across the state-1 → state-2 boundary.
|
|
267
|
+
*/
|
|
268
|
+
progress: function (fraction) {
|
|
269
|
+
state = 2;
|
|
270
|
+
// Set the var on the disc so both the masked ring and the orbiting
|
|
271
|
+
// dot (siblings inside `#boot-loader-disc`) inherit the same value.
|
|
272
|
+
var element = document.getElementById('boot-loader-disc');
|
|
273
|
+
if (!element) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// Flip into "host-driven" mode the first time `progress()` lands —
|
|
277
|
+
// CSS keys the brand mark's grayscale→color transition off this
|
|
278
|
+
// attribute, so the mark eases from monochrome to full palette as
|
|
279
|
+
// real progress starts arriving.
|
|
280
|
+
element.setAttribute('data-host-driven', '');
|
|
281
|
+
var clamped = typeof fraction !== 'number' || !isFinite(fraction) || fraction < 0 ? 0 : Math.min(1, fraction);
|
|
282
|
+
var requestedPct = clamped * 100;
|
|
283
|
+
var currentPct = parseFloat(element.style.getPropertyValue('--boot-loader-bar-progress')) || 0;
|
|
284
|
+
var nextPct = Math.max(currentPct, requestedPct);
|
|
285
|
+
element.style.setProperty('--boot-loader-bar-progress', String(nextPct));
|
|
286
|
+
// Switch the ongoing creep to its state-2 cadence — faster ease and
|
|
287
|
+
// a larger lead bump so the ring keeps moving while the host is
|
|
288
|
+
// silent (e.g. composer-app's "Starting Composer…" stretch while the
|
|
289
|
+
// first slow plugin module activates).
|
|
290
|
+
creepRate = STATE_2_RATE;
|
|
291
|
+
var newCeiling = Math.min(nextPct + STATE_2_BUMP, ABSOLUTE_CEILING);
|
|
292
|
+
if (newCeiling > creepCeiling) {
|
|
293
|
+
creepCeiling = newCeiling;
|
|
294
|
+
}
|
|
295
|
+
ensureCreep();
|
|
296
|
+
// Toggle the leading-edge dot only while progress is strictly in (0, 1).
|
|
297
|
+
if (nextPct > 0 && nextPct < 100) {
|
|
298
|
+
element.setAttribute('data-progress-active', '');
|
|
299
|
+
} else {
|
|
300
|
+
element.removeAttribute('data-progress-active');
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
dismiss: function () {
|
|
305
|
+
stopCreep();
|
|
306
|
+
var element = document.getElementById('boot-loader');
|
|
307
|
+
if (element && element.parentNode) {
|
|
308
|
+
element.parentNode.removeChild(element);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (trace) {
|
|
312
|
+
if (timings.length > 0) {
|
|
313
|
+
timings[timings.length - 1].duration = Date.now() - last;
|
|
314
|
+
}
|
|
315
|
+
console.log(JSON.stringify({ total: Date.now() - start, timings }, null, 2));
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
// Auto-promote idle → slow tick the moment this inline script executes,
|
|
321
|
+
// so the disc starts moving on the very first frame the loader paints.
|
|
322
|
+
// The host calls `progress()` later to take over.
|
|
323
|
+
state = 1;
|
|
324
|
+
ensureCreep();
|
|
325
|
+
})();
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Plugin } from 'vite';
|
|
6
|
+
|
|
7
|
+
import css from './boot-loader.css?raw';
|
|
8
|
+
import driverScript from './boot-loader.js?raw';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@link bootLoaderPlugin}.
|
|
12
|
+
*/
|
|
13
|
+
export type BootLoaderOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Initial status text rendered by the loader (replaced via
|
|
16
|
+
* `window.__bootLoader.status(...)` once the host starts firing phase callbacks).
|
|
17
|
+
*/
|
|
18
|
+
status?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Inline SVG markup for an optional brand mark rendered above the progress bar.
|
|
22
|
+
* The mark renders at full opacity with whatever fills the SVG declares, so
|
|
23
|
+
* pass a colour-palette logo for the strongest visual identity. SVGs that use
|
|
24
|
+
* `fill="currentColor"` still inherit the loader's `prefers-color-scheme`
|
|
25
|
+
* text colour. Leave empty/undefined to render only the bar.
|
|
26
|
+
*/
|
|
27
|
+
markSvg?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Vite plugin that injects a tiny native-DOM "boot loader" into the host app's
|
|
32
|
+
* `index.html`.
|
|
33
|
+
*
|
|
34
|
+
* The loader paints on the very first frame, before any JS bundle is fetched —
|
|
35
|
+
* so the user sees something immediately on cold load instead of staring at a
|
|
36
|
+
* blank document while the compiled module graph is parsed. The brand mark
|
|
37
|
+
* sits centred inside a thin determinate progress ring; both layers are
|
|
38
|
+
* composited so the ring's fill stays visually smooth even while the JS main
|
|
39
|
+
* thread is busy.
|
|
40
|
+
*
|
|
41
|
+
* The host app drives the loader from `main.tsx`:
|
|
42
|
+
* - `window.__bootLoader.status(text)` updates the status line per phase.
|
|
43
|
+
* - `window.__bootLoader.progress(fraction)` grows the determinate ring (0–1).
|
|
44
|
+
* - `window.__bootLoader.dismiss()` removes the loader once React has mounted.
|
|
45
|
+
*
|
|
46
|
+
* Inject order:
|
|
47
|
+
* - `<style>` → `<head>` (parses before any bundled stylesheet).
|
|
48
|
+
* - `<div id="boot-loader">…</div>` → start of `<body>` (sibling of `#root`).
|
|
49
|
+
* - inline `<script>` defining `window.__bootLoader` → start of `<body>`.
|
|
50
|
+
*
|
|
51
|
+
* Keeping the loader as a sibling of `#root` (rather than a child of it) means
|
|
52
|
+
* `createRoot(document.getElementById('root')).render(...)` does not fight the
|
|
53
|
+
* loader for ownership; the host explicitly calls `dismiss()` after the first
|
|
54
|
+
* React commit, which gives a deterministic handoff.
|
|
55
|
+
*
|
|
56
|
+
* Color tokens are exposed as CSS custom properties (`--boot-loader-bg-light`,
|
|
57
|
+
* `--boot-loader-bg-dark`, etc.) defined in `boot-loader.css`, so consumers can
|
|
58
|
+
* override them at the document level without us re-parameterizing this plugin.
|
|
59
|
+
*/
|
|
60
|
+
export const bootLoaderPlugin = ({ status, markSvg }: BootLoaderOptions = {}): Plugin => {
|
|
61
|
+
return {
|
|
62
|
+
name: 'app-framework:boot-loader',
|
|
63
|
+
transformIndexHtml() {
|
|
64
|
+
// The mark slot uses `children: <raw-svg>` (vite emits string children as
|
|
65
|
+
// raw HTML, not text-escaped) so the host can pass an SVG file's contents
|
|
66
|
+
// straight through. The mark and ring are siblings inside `#boot-loader-disc`
|
|
67
|
+
// so CSS grid-stacking can centre the mark inside the ring without the ring's
|
|
68
|
+
// radial-gradient mask clipping the SVG.
|
|
69
|
+
const markChildren = markSvg ? [{ tag: 'div', attrs: { id: 'boot-loader-mark' }, children: markSvg }] : [];
|
|
70
|
+
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
tag: 'style',
|
|
74
|
+
injectTo: 'head',
|
|
75
|
+
children: css,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
tag: 'div',
|
|
79
|
+
injectTo: 'body-prepend',
|
|
80
|
+
attrs: {
|
|
81
|
+
id: 'boot-loader',
|
|
82
|
+
role: 'status',
|
|
83
|
+
'aria-live': 'polite',
|
|
84
|
+
'aria-label': 'Initializing',
|
|
85
|
+
},
|
|
86
|
+
children: [
|
|
87
|
+
{
|
|
88
|
+
tag: 'div',
|
|
89
|
+
attrs: { id: 'boot-loader-disc' },
|
|
90
|
+
children: [
|
|
91
|
+
{ tag: 'div', attrs: { id: 'boot-loader-bar' }, children: '' },
|
|
92
|
+
{ tag: 'div', attrs: { id: 'boot-loader-dot' }, children: '' },
|
|
93
|
+
...markChildren,
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
tag: 'div',
|
|
98
|
+
attrs: { id: 'boot-loader-status' },
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
tag: 'div',
|
|
102
|
+
attrs: { id: 'boot-loader-status-fade' },
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
tag: 'div',
|
|
106
|
+
attrs: { id: 'boot-loader-status-track' },
|
|
107
|
+
children: status
|
|
108
|
+
? [{ tag: 'div', attrs: { class: 'boot-loader-status-line' }, children: status }]
|
|
109
|
+
: [],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
tag: 'script',
|
|
117
|
+
injectTo: 'body-prepend',
|
|
118
|
+
children: driverScript,
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
};
|