@dxos/app-framework 0.8.4-main.84f28bd → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/capability-K5XIVCQU.mjs +35 -0
- package/dist/lib/browser/capability-K5XIVCQU.mjs.map +7 -0
- package/dist/lib/browser/chunk-5AHASNDW.mjs +95 -0
- package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
- package/dist/lib/browser/chunk-5GY3YOEL.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-BRK6GYNB.mjs +142 -0
- package/dist/lib/browser/chunk-BRK6GYNB.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-IW44C7UL.mjs +83 -0
- package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KFDF7KR3.mjs +42 -0
- package/dist/lib/browser/chunk-KFDF7KR3.mjs.map +7 -0
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs +422 -0
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs.map +7 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs +581 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-SLX73WRZ.mjs +218 -0
- package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs +513 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs +1446 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +74 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +20 -0
- package/dist/lib/browser/common/capabilities.mjs +56 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/capability.mjs +32 -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 +39 -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 +85 -156
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs +89 -0
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +249 -56
- 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 +54 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-RLKFFLTB.mjs +36 -0
- package/dist/lib/node-esm/capability-RLKFFLTB.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-42UNAKYO.mjs +423 -0
- package/dist/lib/node-esm/chunk-42UNAKYO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs +219 -0
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BYHYYJZH.mjs +143 -0
- package/dist/lib/node-esm/chunk-BYHYYJZH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs +84 -0
- package/dist/lib/node-esm/chunk-CTKEZHKF.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-JNT72ZCN.mjs +514 -0
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs +582 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OUEMWPIW.mjs +43 -0
- package/dist/lib/node-esm/chunk-OUEMWPIW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs +96 -0
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs +1447 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.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 +75 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +21 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +57 -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 +33 -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 +40 -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 +85 -156
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs +90 -0
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +249 -56
- 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 +55 -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 +37 -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 +24 -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 +214 -120
- 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 +161 -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 +297 -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 +277 -37
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +107 -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 +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts +18 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts +6 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/types.d.ts +13 -0
- package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts +101 -0
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +79 -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 +11 -10
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
- 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/ui/components/PluginManager/PluginManagerContext.stories.d.ts +13 -0
- 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/ui/components/Surface/SurfaceComponent.stories.d.ts +14 -0
- 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 +7 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.d.ts +86 -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/ui/hooks/useLoading.d.ts +18 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +24 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.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 +121 -53
- package/src/cli/cli.ts +102 -0
- package/src/{playground/layout → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +39 -0
- package/src/{playground/debug/index.ts → common/annotations.ts} +0 -2
- package/src/common/capabilities.ts +304 -108
- 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 +254 -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 +1899 -0
- package/src/core/plugin-manager.ts +1687 -0
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +419 -43
- package/src/core/registry.ts +163 -0
- package/src/core/url-loader.test.ts +221 -0
- package/src/core/url-loader.ts +388 -0
- package/src/helpers.test.ts +1 -1
- package/src/index.ts +2 -4
- package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
- package/src/plugin-process-manager/history/capability.ts +36 -0
- package/src/plugin-process-manager/history/errors.ts +7 -0
- package/src/plugin-process-manager/history/history-tracker.test.ts +374 -0
- package/src/plugin-process-manager/history/history-tracker.ts +128 -0
- package/src/plugin-process-manager/history/index.ts +9 -0
- package/src/plugin-process-manager/history/types.ts +17 -0
- package/src/plugin-process-manager/history/undo-mapping.ts +135 -0
- package/src/plugin-process-manager/history/undo-registry.test.ts +72 -0
- package/src/plugin-process-manager/history/undo-registry.ts +54 -0
- package/src/plugin-process-manager/index.ts +6 -0
- package/src/plugin-process-manager/meta.ts +14 -0
- package/src/plugin-process-manager/process-manager-capability.ts +178 -0
- package/src/plugin-process-manager/testing.ts +155 -0
- package/src/testing/harness.ts +247 -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 +15 -12
- package/src/testing/withPluginManager.tsx +82 -55
- package/src/ui/components/App/App.stories.tsx +86 -0
- package/src/ui/components/App/App.tsx +81 -0
- package/src/{playground/logger → 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/ui/components/Placeholder/index.ts +5 -0
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +184 -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 +10 -0
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +418 -0
- package/src/ui/hooks/useCapabilities.ts +67 -0
- package/src/ui/hooks/useLoading.tsx +76 -0
- package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
- 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 +33 -22
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +8 -6
- package/.eslintrc.cjs +0 -9
- package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
- package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
- package/dist/lib/browser/app-graph-builder-BGGXLD6T.mjs +0 -137
- package/dist/lib/browser/app-graph-builder-BGGXLD6T.mjs.map +0 -7
- package/dist/lib/browser/chunk-2636QSIK.mjs +0 -1518
- package/dist/lib/browser/chunk-2636QSIK.mjs.map +0 -7
- package/dist/lib/browser/chunk-DHZB7HG7.mjs +0 -413
- package/dist/lib/browser/chunk-DHZB7HG7.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/intent-dispatcher-TWKB22NI.mjs +0 -11
- package/dist/lib/browser/intent-resolver-O67UANYP.mjs +0 -39
- package/dist/lib/browser/intent-resolver-O67UANYP.mjs.map +0 -7
- package/dist/lib/browser/store-LFKDWHUQ.mjs +0 -30
- package/dist/lib/browser/store-LFKDWHUQ.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -79
- package/dist/lib/node-esm/app-graph-builder-QHIJUYYW.mjs +0 -138
- package/dist/lib/node-esm/app-graph-builder-QHIJUYYW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NJAFK626.mjs +0 -414
- package/dist/lib/node-esm/chunk-NJAFK626.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/chunk-VSKRV3NW.mjs +0 -1520
- package/dist/lib/node-esm/chunk-VSKRV3NW.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-5PRM3KGH.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-K3D4BXQQ.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-K3D4BXQQ.mjs.map +0 -7
- package/dist/lib/node-esm/store-53XDUBMD.mjs +0 -31
- package/dist/lib/node-esm/store-53XDUBMD.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -80
- package/dist/types/src/App.d.ts +0 -43
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/common/collaboration.d.ts +0 -19
- 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/core/capabilities.d.ts +0 -114
- 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 -122
- 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 +0 -10
- 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 -5
- 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 -31
- 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 -16
- 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/App.tsx +0 -276
- package/src/common/collaboration.ts +0 -21
- package/src/common/events.ts +0 -77
- 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/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -254
- package/src/core/manager.test.ts +0 -515
- package/src/core/manager.ts +0 -519
- 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 -46
- 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 -29
- package/src/playground/logger/plugin.ts +0 -36
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -42
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -33
- package/src/plugin-intent/errors.ts +0 -39
- package/src/plugin-intent/index.ts +0 -8
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
- package/src/plugin-intent/intent-dispatcher.ts +0 -333
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-settings/SettingsPlugin.ts +0 -35
- package/src/plugin-settings/actions.ts +0 -29
- package/src/plugin-settings/app-graph-builder.ts +0 -157
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -34
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/ErrorBoundary.tsx +0 -45
- package/src/react/IntentContext.tsx +0 -34
- package/src/react/Surface.stories.tsx +0 -96
- package/src/react/Surface.tsx +0 -77
- package/src/react/common.ts +0 -12
- package/src/react/index.ts +0 -10
- package/src/react/useCapabilities.ts +0 -30
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
- package/typedoc/.nojekyll +0 -1
- package/typedoc/assets/hierarchy.js +0 -1
- package/typedoc/assets/highlight.css +0 -106
- package/typedoc/assets/icons.js +0 -18
- package/typedoc/assets/icons.svg +0 -1
- package/typedoc/assets/main.js +0 -60
- package/typedoc/assets/navigation.js +0 -1
- package/typedoc/assets/search.js +0 -1
- package/typedoc/assets/style.css +0 -1640
- package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
- package/typedoc/classes/ErrorBoundary.html +0 -125
- package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
- package/typedoc/classes/IntentAction.Track.html +0 -266
- package/typedoc/classes/LayoutAction.AddToast.html +0 -265
- package/typedoc/classes/LayoutAction.Close.html +0 -382
- package/typedoc/classes/LayoutAction.Expose.html +0 -265
- package/typedoc/classes/LayoutAction.Open.html +0 -1123
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
- package/typedoc/classes/LayoutAction.Set.html +0 -460
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -499
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
- package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -1123
- package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
- package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -616
- package/typedoc/classes/Plugin.html +0 -6
- package/typedoc/classes/PluginContext.html +0 -38
- package/typedoc/classes/PluginManager.html +0 -43
- package/typedoc/classes/PluginModule.html +0 -18
- package/typedoc/classes/SettingsAction.Open.html +0 -226
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
- package/typedoc/functions/Events.createStateEvent.html +0 -2
- package/typedoc/functions/IntentPlugin.html +0 -1
- package/typedoc/functions/SettingsPlugin.html +0 -1
- package/typedoc/functions/allOf.html +0 -2
- package/typedoc/functions/chain.html +0 -3
- package/typedoc/functions/contributes.html +0 -2
- package/typedoc/functions/createDispatcher.html +0 -3
- package/typedoc/functions/createIntent.html +0 -6
- package/typedoc/functions/createResolver.html +0 -2
- package/typedoc/functions/createSurface.html +0 -2
- package/typedoc/functions/defineCapability.html +0 -2
- package/typedoc/functions/defineEvent.html +0 -2
- package/typedoc/functions/defineModule.html +0 -2
- package/typedoc/functions/definePlugin.html +0 -2
- package/typedoc/functions/eventKey.html +0 -2
- package/typedoc/functions/getEvents.html +0 -2
- package/typedoc/functions/isAllOf.html +0 -2
- package/typedoc/functions/isOneOf.html +0 -2
- package/typedoc/functions/isSurfaceAvailable.html +0 -2
- package/typedoc/functions/lazy.html +0 -2
- package/typedoc/functions/oneOf.html +0 -2
- package/typedoc/functions/useApp.html +0 -6
- package/typedoc/functions/useAppGraph.html +0 -1
- package/typedoc/functions/useCapabilities.html +0 -3
- package/typedoc/functions/useCapability.html +0 -4
- package/typedoc/functions/useIntentDispatcher.html +0 -1
- package/typedoc/functions/useIntentResolver.html +0 -1
- package/typedoc/functions/useLayout.html +0 -1
- package/typedoc/functions/usePluginManager.html +0 -2
- package/typedoc/hierarchy.html +0 -1
- package/typedoc/index.html +0 -12
- package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
- package/typedoc/media/LICENSE +0 -8
- package/typedoc/modules/Capabilities.html +0 -1
- package/typedoc/modules/CollaborationActions.html +0 -1
- package/typedoc/modules/Events.html +0 -1
- package/typedoc/modules/IntentAction.html +0 -1
- package/typedoc/modules/LayoutAction.html +0 -2
- package/typedoc/modules/SettingsAction.html +0 -1
- package/typedoc/modules.html +0 -1
- package/typedoc/types/ActivationEvent.html +0 -8
- package/typedoc/types/ActivationEvents.html +0 -2
- package/typedoc/types/AnyCapability.html +0 -1
- package/typedoc/types/AnyIntent.html +0 -1
- package/typedoc/types/AnyIntentChain.html +0 -1
- package/typedoc/types/AnyIntentEffectResult.html +0 -1
- package/typedoc/types/AnyIntentResolver.html +0 -1
- package/typedoc/types/AnyIntentResult.html +0 -1
- package/typedoc/types/Capabilities.FileUploader.html +0 -1
- package/typedoc/types/Capabilities.IntentResolver.html +0 -1
- package/typedoc/types/Capabilities.Layout.html +0 -1
- package/typedoc/types/Capabilities.Metadata.html +0 -1
- package/typedoc/types/Capabilities.ReactContext.html +0 -1
- package/typedoc/types/Capabilities.ReactRoot.html +0 -1
- package/typedoc/types/Capabilities.ReactSurface.html +0 -1
- package/typedoc/types/Capabilities.Settings.html +0 -4
- package/typedoc/types/Capability.html +0 -9
- package/typedoc/types/CreateAppOptions.html +0 -10
- package/typedoc/types/FileInfo.html +0 -1
- package/typedoc/types/Intent.html +0 -10
- package/typedoc/types/IntentChain.html +0 -6
- package/typedoc/types/IntentContext.html +0 -5
- package/typedoc/types/IntentData.html +0 -1
- package/typedoc/types/IntentDispatcher.html +0 -2
- package/typedoc/types/IntentDispatcherResult.html +0 -2
- package/typedoc/types/IntentEffectDefinition.html +0 -2
- package/typedoc/types/IntentEffectResult.html +0 -15
- package/typedoc/types/IntentParams.html +0 -3
- package/typedoc/types/IntentResolver.html +0 -2
- package/typedoc/types/IntentResultData.html +0 -1
- package/typedoc/types/IntentSchema.html +0 -1
- package/typedoc/types/IntentUndo.html +0 -2
- package/typedoc/types/InterfaceDef.html +0 -4
- package/typedoc/types/Label.html +0 -1
- package/typedoc/types/NodeSerializer.html +0 -8
- package/typedoc/types/PluginManagerOptions.html +0 -6
- package/typedoc/types/PluginMeta.html +0 -21
- package/typedoc/types/PromiseIntentDispatcher.html +0 -2
- package/typedoc/types/PromiseIntentUndo.html +0 -2
- package/typedoc/types/Resource.html +0 -1
- package/typedoc/types/ResourceKey.html +0 -1
- package/typedoc/types/ResourceLanguage.html +0 -1
- package/typedoc/types/SerializedNode.html +0 -4
- package/typedoc/types/SurfaceComponent.html +0 -2
- package/typedoc/types/SurfaceDefinition.html +0 -2
- package/typedoc/types/SurfaceProps.html +0 -4
- package/typedoc/variables/Capabilities.AnchorSort.html +0 -1
- package/typedoc/variables/Capabilities.AppGraph.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
- package/typedoc/variables/Capabilities.FileUploader.html +0 -1
- package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
- package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
- package/typedoc/variables/Capabilities.Layout.html +0 -1
- package/typedoc/variables/Capabilities.Metadata.html +0 -1
- package/typedoc/variables/Capabilities.Null.html +0 -1
- package/typedoc/variables/Capabilities.PluginManager.html +0 -1
- package/typedoc/variables/Capabilities.ReactContext.html +0 -1
- package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
- package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
- package/typedoc/variables/Capabilities.RxRegistry.html +0 -1
- package/typedoc/variables/Capabilities.Settings.html +0 -1
- package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
- package/typedoc/variables/Capabilities.Tools.html +0 -1
- package/typedoc/variables/Capabilities.Translations.html +0 -1
- package/typedoc/variables/Events.AppGraphReady.html +0 -2
- package/typedoc/variables/Events.DispatcherReady.html +0 -2
- package/typedoc/variables/Events.LayoutReady.html +0 -1
- package/typedoc/variables/Events.SettingsReady.html +0 -2
- package/typedoc/variables/Events.SetupAppGraph.html +0 -2
- package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
- package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
- package/typedoc/variables/Events.SetupMetadata.html +0 -2
- package/typedoc/variables/Events.SetupReactSurface.html +0 -2
- package/typedoc/variables/Events.SetupSettings.html +0 -2
- package/typedoc/variables/Events.SetupTranslations.html +0 -2
- package/typedoc/variables/Events.Startup.html +0 -2
- package/typedoc/variables/FileInfoSchema.html +0 -1
- package/typedoc/variables/INTENT_ACTION.html +0 -1
- package/typedoc/variables/INTENT_PLUGIN.html +0 -1
- package/typedoc/variables/LAYOUT_ACTION.html +0 -1
- package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
- package/typedoc/variables/Label.html +0 -1
- package/typedoc/variables/LayoutAction.Toast.html +0 -1
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
- package/typedoc/variables/PluginManagerProvider.html +0 -2
- package/typedoc/variables/Resource.html +0 -2
- package/typedoc/variables/ResourceKey.html +0 -1
- package/typedoc/variables/ResourceLanguage.html +0 -1
- package/typedoc/variables/SETTINGS_ACTION.html +0 -1
- package/typedoc/variables/SETTINGS_ID.html +0 -1
- package/typedoc/variables/SETTINGS_KEY.html +0 -1
- package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
- package/typedoc/variables/Surface.html +0 -2
- package/typedoc/variables/defaultFileTypes.html +0 -1
- /package/dist/lib/browser/{intent-dispatcher-TWKB22NI.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → common/activation-events.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-5PRM3KGH.mjs.map → browser/common/capabilities.mjs.map} +0 -0
- /package/dist/lib/{node-esm/worker.mjs.map → browser/core/activation-event.mjs.map} +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { FC, PropsWithChildren, ReactNode, RefCallback } from 'react';
|
|
2
|
+
import type { MakeOptional, Position } from '@dxos/util';
|
|
3
|
+
/**
|
|
4
|
+
* A typed role token. Carries a role string for runtime dispatch plus a phantom
|
|
5
|
+
* data type so consumers using `type={SomeToken}` and providers using
|
|
6
|
+
* `AppSurface.object(SomeToken, ...)` share a single type-level contract.
|
|
7
|
+
*
|
|
8
|
+
* Mint via {@link makeType}.
|
|
9
|
+
*/
|
|
10
|
+
export type RoleToken<TData> = {
|
|
11
|
+
readonly role: string;
|
|
12
|
+
/** Covariant phantom; never accessed at runtime. */
|
|
13
|
+
readonly _phantom?: TData;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* One entry in a {@link SurfaceFilter} — a role plus the guard that validates
|
|
17
|
+
* the data shape when the Surface dispatcher is matching that role.
|
|
18
|
+
*/
|
|
19
|
+
export type SurfaceBinding = {
|
|
20
|
+
readonly role: string;
|
|
21
|
+
readonly guard: (data: unknown) => boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Typed filter binding for {@link create}. Combines one or more `(role, guard)`
|
|
25
|
+
* pairs so a provider can register against multiple roles while keeping the
|
|
26
|
+
* role and its data shape in a single expression.
|
|
27
|
+
*/
|
|
28
|
+
export type SurfaceFilter<TData> = {
|
|
29
|
+
readonly bindings: ReadonlyArray<SurfaceBinding>;
|
|
30
|
+
/** Covariant phantom; never accessed at runtime. */
|
|
31
|
+
readonly _phantom?: TData;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Narrow data type carried by a role token.
|
|
35
|
+
*/
|
|
36
|
+
export type TokenData<T> = T extends RoleToken<infer D> ? D : never;
|
|
37
|
+
/**
|
|
38
|
+
* Runtime guard for {@link SurfaceFilter}. Distinguishes new-style filter
|
|
39
|
+
* bindings from legacy predicate filters.
|
|
40
|
+
*/
|
|
41
|
+
export declare const isSurfaceFilter: (value: unknown) => value is SurfaceFilter<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Mints a typed role token. Identity is structural; all tokens with the same
|
|
44
|
+
* `role` string are interchangeable at runtime.
|
|
45
|
+
*/
|
|
46
|
+
export declare const makeType: <TData>(role: string) => RoleToken<TData>;
|
|
47
|
+
/**
|
|
48
|
+
* Props that are passed to the Surface component.
|
|
49
|
+
*
|
|
50
|
+
* The role can be provided either as a string via `role` or as a typed
|
|
51
|
+
* {@link RoleToken} via `type`. The typed form narrows `data` to the token's
|
|
52
|
+
* declared shape.
|
|
53
|
+
*/
|
|
54
|
+
export type Props<T extends Record<string, any> = Record<string, unknown>> = {
|
|
55
|
+
/**
|
|
56
|
+
* If specified, the Surface will be wrapped in an error boundary.
|
|
57
|
+
* The fallback component will be rendered if an error occurs.
|
|
58
|
+
*/
|
|
59
|
+
fallback?: FC<{
|
|
60
|
+
error: Error;
|
|
61
|
+
data?: any;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* If specified, the Surface will be wrapped in a suspense boundary.
|
|
65
|
+
* The placeholder component will be rendered while the surface component is loading.
|
|
66
|
+
*/
|
|
67
|
+
placeholder?: ReactNode;
|
|
68
|
+
} & MakeOptional<CoreProps<T>, 'id' | 'data' | 'role'> & {
|
|
69
|
+
/**
|
|
70
|
+
* Explicitly disallow `type` on the untyped Props overload — if the caller
|
|
71
|
+
* provides `type={AppSurface.X}`, TypeScript must route to the typed
|
|
72
|
+
* overload (where `data` is narrowed by the token). Without this, the
|
|
73
|
+
* catch-all index signature below would accept any `type` value and mask
|
|
74
|
+
* the typed overload entirely.
|
|
75
|
+
*/
|
|
76
|
+
type?: undefined;
|
|
77
|
+
} /**
|
|
78
|
+
* Additional props to pass to the component.
|
|
79
|
+
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
80
|
+
* Exclude known prop names to prevent overriding well-defined props.
|
|
81
|
+
*/ & {
|
|
82
|
+
[K in keyof Record<string, any>]: K extends keyof CoreProps<T> | 'fallback' | 'placeholder' | 'type' ? never : any;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Typed Surface consumer props — carries the role/data-shape contract via a
|
|
86
|
+
* {@link RoleToken}. Available as a typed overload of the Surface component so
|
|
87
|
+
* ad-hoc `type` fields on arbitrary spread props don't conflict with the
|
|
88
|
+
* untyped consumer form.
|
|
89
|
+
*/
|
|
90
|
+
export type TypedProps<TToken extends RoleToken<any>> = {
|
|
91
|
+
fallback?: FC<{
|
|
92
|
+
error: Error;
|
|
93
|
+
data?: any;
|
|
94
|
+
}>;
|
|
95
|
+
placeholder?: ReactNode;
|
|
96
|
+
id?: string;
|
|
97
|
+
type: TToken;
|
|
98
|
+
data?: TokenData<TToken>;
|
|
99
|
+
limit?: number | undefined;
|
|
100
|
+
} & {
|
|
101
|
+
[K in keyof Record<string, any>]: K extends 'fallback' | 'placeholder' | 'id' | 'type' | 'data' | 'limit' ? never : any;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.
|
|
105
|
+
*/
|
|
106
|
+
export type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
107
|
+
/**
|
|
108
|
+
* ID for debugging.
|
|
109
|
+
*/
|
|
110
|
+
id: string;
|
|
111
|
+
/**
|
|
112
|
+
* Role defines how the data should be rendered. For new code, prefer the
|
|
113
|
+
* typed overload of the Surface component which takes a {@link RoleToken}
|
|
114
|
+
* via the `type` prop instead — it enforces a role/data contract at compile
|
|
115
|
+
* time.
|
|
116
|
+
*/
|
|
117
|
+
role: string;
|
|
118
|
+
/**
|
|
119
|
+
* The data to be rendered by the surface.
|
|
120
|
+
* NOTE: This must be a stable value.
|
|
121
|
+
*/
|
|
122
|
+
data: T;
|
|
123
|
+
/**
|
|
124
|
+
* If more than one component is resolved, the limit determines how many are rendered.
|
|
125
|
+
*/
|
|
126
|
+
limit?: number | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
export type ComponentProps<T extends Record<string, any> = Record<string, any>> = CoreProps<T> & {
|
|
129
|
+
ref?: RefCallback<HTMLElement>;
|
|
130
|
+
} & Record<string, any>;
|
|
131
|
+
/**
|
|
132
|
+
* React component used to render a surface once is has matched.
|
|
133
|
+
*/
|
|
134
|
+
export type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (props: ComponentProps<T>) => ReactNode;
|
|
135
|
+
/**
|
|
136
|
+
* Definition of when a React component surface should be rendered.
|
|
137
|
+
*
|
|
138
|
+
* The optional `filter` receives the consumer-supplied `role` as its second
|
|
139
|
+
* argument so a single definition can encode role-specific guards (used by the
|
|
140
|
+
* {@link SurfaceFilter}-based `create` overload).
|
|
141
|
+
*/
|
|
142
|
+
export type ReactDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
143
|
+
kind: 'react';
|
|
144
|
+
id: string;
|
|
145
|
+
role: string | string[];
|
|
146
|
+
position?: Position;
|
|
147
|
+
component: ComponentFunction<T>;
|
|
148
|
+
filter?: (data: Record<string, unknown>, role?: string) => data is T;
|
|
149
|
+
}>;
|
|
150
|
+
/**
|
|
151
|
+
* Definition of when a Web Component surface should be rendered.
|
|
152
|
+
*/
|
|
153
|
+
export type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
154
|
+
kind: 'web-component';
|
|
155
|
+
id: string;
|
|
156
|
+
role: string | string[];
|
|
157
|
+
position?: Position;
|
|
158
|
+
/**
|
|
159
|
+
* The tag name of the Web Component to render.
|
|
160
|
+
* The Web Component will receive the same props as React surfaces via properties/attributes.
|
|
161
|
+
*/
|
|
162
|
+
tagName: string;
|
|
163
|
+
filter?: (data: Record<string, unknown>, role?: string) => data is T;
|
|
164
|
+
}>;
|
|
165
|
+
/**
|
|
166
|
+
* Definition of when a surface (React or Web Component) should be rendered.
|
|
167
|
+
*/
|
|
168
|
+
export type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;
|
|
169
|
+
/**
|
|
170
|
+
* Typed React surface definition — role is derived from the filter's bindings.
|
|
171
|
+
*/
|
|
172
|
+
export type TypedReactDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
173
|
+
id: string;
|
|
174
|
+
filter: SurfaceFilter<T>;
|
|
175
|
+
component: ComponentFunction<T>;
|
|
176
|
+
position?: Position;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* Typed Web Component surface definition.
|
|
180
|
+
*/
|
|
181
|
+
export type TypedWebComponentDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
182
|
+
id: string;
|
|
183
|
+
filter: SurfaceFilter<T>;
|
|
184
|
+
tagName: string;
|
|
185
|
+
position?: Position;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Creates a React surface definition.
|
|
189
|
+
*/
|
|
190
|
+
export declare function create<T extends Record<string, any> = any>(definition: TypedReactDefinition<T>): ReactDefinition<T>;
|
|
191
|
+
export declare function create<T extends Record<string, any> = any>(definition: Omit<ReactDefinition<T>, 'kind'>): ReactDefinition<T>;
|
|
192
|
+
/**
|
|
193
|
+
* Creates a Web Component surface definition.
|
|
194
|
+
*/
|
|
195
|
+
export declare function createWeb<T extends Record<string, any> = any>(definition: TypedWebComponentDefinition<T>): WebComponentDefinition<T>;
|
|
196
|
+
export declare function createWeb<T extends Record<string, any> = any>(definition: Omit<WebComponentDefinition<T>, 'kind'>): WebComponentDefinition<T>;
|
|
197
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/Surface/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/Surface/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import { type FallbackProps } from '@dxos/react-error-boundary';
|
|
3
|
+
import { type ActivationEvent, type Plugin, PluginManager } from '../../core';
|
|
4
|
+
export type StartupProgress = {
|
|
5
|
+
/** Number of modules that have been activated. */
|
|
6
|
+
activated: number;
|
|
7
|
+
/** Total number of modules registered. */
|
|
8
|
+
total: number;
|
|
9
|
+
/** Fractional progress (0-1). */
|
|
10
|
+
progress: number;
|
|
11
|
+
/**
|
|
12
|
+
* Raw activation event key (e.g. `org.dxos.app-framework.event.startup`).
|
|
13
|
+
* Set on event-level transitions, *and* on module-level transitions where
|
|
14
|
+
* it carries the parent activation event that first triggered the
|
|
15
|
+
* module's load (plumbed through `_loadCapabilitiesForModules` →
|
|
16
|
+
* `_loadModule`). Consumers can use this either as the primary id (when
|
|
17
|
+
* {@link module} is absent) or as an extra "context" field alongside
|
|
18
|
+
* {@link module}.
|
|
19
|
+
*/
|
|
20
|
+
event?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Raw module id (e.g. `org.dxos.plugin.observability.module.ReactSurface`)
|
|
23
|
+
* when the in-flight activation is module-level. When present,
|
|
24
|
+
* {@link event} may also be set, identifying the parent activation that
|
|
25
|
+
* triggered this module's load.
|
|
26
|
+
*/
|
|
27
|
+
module?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Pre-humanized label for the currently surfaced transition (module
|
|
30
|
+
* label if {@link module} is set, otherwise the event label), supplied
|
|
31
|
+
* for consumers that want a sensible default. Hosts that prefer to
|
|
32
|
+
* render their own label can read the raw {@link event}/{@link module}
|
|
33
|
+
* fields and ignore this — the framework leaves the policy choice
|
|
34
|
+
* (which transitions to surface, how to format them, whether to drop
|
|
35
|
+
* sub-modules entirely) to the host's `Placeholder`.
|
|
36
|
+
*/
|
|
37
|
+
humanizedName?: string;
|
|
38
|
+
};
|
|
39
|
+
export type PlaceholderProps = {
|
|
40
|
+
stage?: number;
|
|
41
|
+
progress?: StartupProgress;
|
|
42
|
+
};
|
|
43
|
+
export type UseAppOptions = {
|
|
44
|
+
pluginManager?: PluginManager.PluginManager;
|
|
45
|
+
pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];
|
|
46
|
+
onPluginRemove?: PluginManager.ManagerOptions['onRemove'];
|
|
47
|
+
pluginRegistryProvider?: PluginManager.ManagerOptions['pluginRegistryProvider'];
|
|
48
|
+
plugins?: Plugin.Plugin[];
|
|
49
|
+
defaults?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* Additional activation events to fire before startup.
|
|
52
|
+
* These are fired alongside SetupReactSurface before the Startup event.
|
|
53
|
+
*/
|
|
54
|
+
setupEvents?: ActivationEvent.ActivationEvent[];
|
|
55
|
+
cacheEnabled?: boolean;
|
|
56
|
+
safeMode?: boolean;
|
|
57
|
+
debounce?: number;
|
|
58
|
+
timeout?: number;
|
|
59
|
+
fallback?: FC<FallbackProps>;
|
|
60
|
+
placeholder?: FC<PlaceholderProps>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Expected usage is for this to be the entrypoint of the application.
|
|
64
|
+
* Initializes plugins and renders the root components.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* const plugins = [LayoutPlugin(), MyPlugin()];
|
|
68
|
+
* const defaults = [MyPluginId];
|
|
69
|
+
* const fallback = () => <div>Initializing Plugins...</div>;
|
|
70
|
+
* const App = useApp({ plugins, defaults, fallback });
|
|
71
|
+
* createRoot(document.getElementById('root')!).render(
|
|
72
|
+
* <StrictMode>
|
|
73
|
+
* <App />
|
|
74
|
+
* </StrictMode>,
|
|
75
|
+
* );
|
|
76
|
+
*
|
|
77
|
+
* @param params.pluginLoader A function which loads new plugins.
|
|
78
|
+
* @param params.plugins All plugins available to the application. Plugins whose `meta.tags` includes `'system'` are treated as core (force-enabled, not user-toggleable).
|
|
79
|
+
* @param params.defaults Default plugins are enabled by default but can be disabled by the user.
|
|
80
|
+
* @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
|
|
81
|
+
* @param params.safeMode Whether to enable safe mode, which disables optional plugins.
|
|
82
|
+
* @param params.fallback Fallback component to render if an error occurs during startup.
|
|
83
|
+
* @param params.placeholder Placeholder component to render during startup.
|
|
84
|
+
*/
|
|
85
|
+
export declare const useApp: ({ pluginManager, pluginLoader: pluginLoaderProp, onPluginRemove, pluginRegistryProvider, plugins: pluginsProp, defaults: defaultsProp, setupEvents: setupEventsProp, placeholder, fallback, cacheEnabled, safeMode, debounce, timeout, }: UseAppOptions) => () => React.JSX.Element;
|
|
86
|
+
//# sourceMappingURL=useApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useApp.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAqD,MAAM,OAAO,CAAC;AAK1F,OAAO,EAAgC,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAM9F,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK9E,MAAM,MAAM,eAAe,GAAG;IAC5B,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC;IAC5C,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5D,cAAc,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1D,sBAAsB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,eAAe,EAAE,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC;IAC7B,WAAW,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM,6OAchB,aAAa,4BAgOf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApp.test.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useApp.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import { Capabilities } from '../../common';
|
|
3
|
+
import { type Capability } from '../../core';
|
|
4
|
+
/**
|
|
5
|
+
* Hook to request capabilities from the plugin context.
|
|
6
|
+
* @returns An array of capabilities.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useCapabilities: <T>(interfaceDef: Capability.InterfaceDef<T>) => T[];
|
|
9
|
+
/**
|
|
10
|
+
* Hook to request a capability from the plugin context.
|
|
11
|
+
* @returns The capability.
|
|
12
|
+
* @throws If no capability is found.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useCapability: <T>(interfaceDef: Capability.InterfaceDef<T>) => T;
|
|
15
|
+
/**
|
|
16
|
+
* Hook to get the current value of an atom capability.
|
|
17
|
+
* Automatically subscribes to changes.
|
|
18
|
+
* @example const settings = useAtomCapability(ThreadCapabilities.Settings);
|
|
19
|
+
*/
|
|
20
|
+
export declare const useAtomCapability: <T>(atomCapability: Capability.InterfaceDef<Atom.Atom<T>>) => T;
|
|
21
|
+
/**
|
|
22
|
+
* Hook to get value and updater for an atom capability.
|
|
23
|
+
* Returns [currentValue, updateFn] similar to useState.
|
|
24
|
+
* @example const [settings, updateSettings] = useAtomCapabilityState(ThreadCapabilities.Settings);
|
|
25
|
+
*/
|
|
26
|
+
export declare const useAtomCapabilityState: <T>(atomCapability: Capability.InterfaceDef<Atom.Writable<T>>) => [T, (fn: (current: T) => T) => void];
|
|
27
|
+
/**
|
|
28
|
+
* Hook to get the operation invoker capability.
|
|
29
|
+
*/
|
|
30
|
+
export declare const useOperationInvoker: () => Capabilities.OperationInvoker;
|
|
31
|
+
//# sourceMappingURL=useCapabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useCapabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAgB,MAAM,yBAAyB,CAAC;AAKlE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,gBAAgB,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,QAG1E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,gBAAgB,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAIxE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,kBAAkB,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAG,CAG5F,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,kBACtB,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KACxD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAWrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAO,YAAY,CAAC,gBAAgE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum LoadingState {
|
|
2
|
+
Loading = 0,
|
|
3
|
+
FadeIn = 1,
|
|
4
|
+
FadeOut = 2,
|
|
5
|
+
Done = 3
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* To avoid "flashing" the placeholder, we wait a period of time before starting the loading animation.
|
|
9
|
+
* If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.
|
|
10
|
+
*
|
|
11
|
+
* States:
|
|
12
|
+
* 0: Loading - Wait for a period of time before starting the loading animation.
|
|
13
|
+
* 1: Fade-in - Display a loading animation.
|
|
14
|
+
* 2: Fade-out - Fade out the loading animation.
|
|
15
|
+
* 3: Done - Remove the placeholder.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useLoading: (ready: boolean, debounce?: number) => LoadingState;
|
|
18
|
+
//# sourceMappingURL=useLoading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoading.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useLoading.tsx"],"names":[],"mappings":"AAMA,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,UAAW,OAAO,oCAoDxC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import { type DependencyList } from 'react';
|
|
4
|
+
import type { SpaceId } from '@dxos/keys';
|
|
5
|
+
import { Capabilities } from '../../common';
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the shared {@link Capabilities.ProcessManagerRuntime} from the plugin context.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useProcessManagerRuntime: () => Capabilities.ProcessManagerRuntime;
|
|
10
|
+
/**
|
|
11
|
+
* Build a callback that runs an effect on the {@link Capabilities.ProcessManagerRuntime}
|
|
12
|
+
* with space-scoped services resolved via {@link ServiceResolver.provide}.
|
|
13
|
+
*
|
|
14
|
+
* The `tags` tuple must list every service the effect requires (beyond the
|
|
15
|
+
* fixed {@link Capabilities.ProcessManagerRuntimeServices}); these services are
|
|
16
|
+
* resolved for the given `spaceId` through the runtime's service resolver.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useSpaceCallback: <const Tags extends readonly Context.Tag<any, any>[], T>(spaceId: SpaceId | undefined, tags: Tags, fn: () => Effect.Effect<T, any, Context.Tag.Identifier<Tags[number]> | Capabilities.ProcessManagerRuntimeServices>, deps?: DependencyList) => (() => Promise<T>);
|
|
19
|
+
/**
|
|
20
|
+
* Suspensefully resolve a single space-scoped service via the
|
|
21
|
+
* {@link Capabilities.ProcessManagerRuntime}'s service resolver.
|
|
22
|
+
*/
|
|
23
|
+
export declare const useSpaceService: <T extends Context.Tag<any, any>>(tag: T, spaceId: SpaceId | undefined) => Context.Tag.Service<T> | undefined;
|
|
24
|
+
//# sourceMappingURL=useProcessManagerRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProcessManagerRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useProcessManagerRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAIvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,YAAY,CAAC,qBACN,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,CAAC,IAAI,SAAS,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,WAC5E,OAAO,GAAG,SAAS,QACtB,IAAI,MACN,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,YAAY,CAAC,6BAA6B,CAAC,SAC3G,cAAc,KACpB,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAUnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,OACxD,CAAC,WACG,OAAO,GAAG,SAAS,KAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAc3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to read and update a settings atom.
|
|
4
|
+
* Returns the current value and an update function.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useSettingsState: <T>(atom: Atom.Writable<T>) => {
|
|
7
|
+
settings: T;
|
|
8
|
+
updateSettings: (fn: (current: T) => T) => void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useSettingsState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSettingsState.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSettingsState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAiC,MAAM,yBAAyB,CAAC;AAGnF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,QAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KACrB;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;CAYhE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSurface.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSurface.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAErC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Storybook host that runs the **real** inline driver script (`boot-loader.js`)
|
|
5
|
+
* against the same DOM structure {@link bootLoaderPlugin} injects in production
|
|
6
|
+
* via `transformIndexHtml`. The component injects `<style>` + the loader DOM,
|
|
7
|
+
* evaluates the driver, and exposes `window.__bootLoader` for the stories to
|
|
8
|
+
* call — no React reimplementation of the state machine.
|
|
9
|
+
*
|
|
10
|
+
* On unmount, the host calls `__bootLoader.dismiss()` (which clears the creep
|
|
11
|
+
* timer and removes the `#boot-loader` node) and clears the global so a fresh
|
|
12
|
+
* mount re-runs the driver from scratch.
|
|
13
|
+
*/
|
|
14
|
+
type BootLoaderHostProps = {
|
|
15
|
+
initialStatus?: string;
|
|
16
|
+
markSvg?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const BootLoaderHost: ({ initialStatus, markSvg }: BootLoaderHostProps) => React.JSX.Element;
|
|
19
|
+
declare const meta: Meta<typeof BootLoaderHost>;
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof BootLoaderHost>;
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Renders the React `Placeholder` from `@dxos/app-framework/ui` on its own —
|
|
25
|
+
* useful for eyeballing the handoff target the boot loader dismisses to.
|
|
26
|
+
*/
|
|
27
|
+
export declare const PlaceholderHandoff: Story;
|
|
28
|
+
/**
|
|
29
|
+
* End-to-end handoff sim: the driver ticks 0 → 100% then the host calls
|
|
30
|
+
* `dismiss()` and the underlying `Placeholder` fades the mark in / out,
|
|
31
|
+
* mirroring the production sequence.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Handoff: Story;
|
|
34
|
+
//# sourceMappingURL=BootLoader.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BootLoader.stories.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/BootLoader.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D;;;;;;;;;;GAUG;AACH,KAAK,mBAAmB,GAAG;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF,QAAA,MAAM,cAAc,+BAA6C,mBAAmB,sBAmDnF,CAAC;AA0IF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAYrC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAGhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link bootLoaderPlugin}.
|
|
4
|
+
*/
|
|
5
|
+
export type BootLoaderOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Initial status text rendered by the loader (replaced via
|
|
8
|
+
* `window.__bootLoader.status(...)` once the host starts firing phase callbacks).
|
|
9
|
+
*/
|
|
10
|
+
status?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Inline SVG markup for an optional brand mark rendered above the progress bar.
|
|
13
|
+
* The mark renders at full opacity with whatever fills the SVG declares, so
|
|
14
|
+
* pass a colour-palette logo for the strongest visual identity. SVGs that use
|
|
15
|
+
* `fill="currentColor"` still inherit the loader's `prefers-color-scheme`
|
|
16
|
+
* text colour. Leave empty/undefined to render only the bar.
|
|
17
|
+
*/
|
|
18
|
+
markSvg?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Vite plugin that injects a tiny native-DOM "boot loader" into the host app's
|
|
22
|
+
* `index.html`.
|
|
23
|
+
*
|
|
24
|
+
* The loader paints on the very first frame, before any JS bundle is fetched —
|
|
25
|
+
* so the user sees something immediately on cold load instead of staring at a
|
|
26
|
+
* blank document while the compiled module graph is parsed. The brand mark
|
|
27
|
+
* sits centred inside a thin determinate progress ring; both layers are
|
|
28
|
+
* composited so the ring's fill stays visually smooth even while the JS main
|
|
29
|
+
* thread is busy.
|
|
30
|
+
*
|
|
31
|
+
* The host app drives the loader from `main.tsx`:
|
|
32
|
+
* - `window.__bootLoader.status(text)` updates the status line per phase.
|
|
33
|
+
* - `window.__bootLoader.progress(fraction)` grows the determinate ring (0–1).
|
|
34
|
+
* - `window.__bootLoader.dismiss()` removes the loader once React has mounted.
|
|
35
|
+
*
|
|
36
|
+
* Inject order:
|
|
37
|
+
* - `<style>` → `<head>` (parses before any bundled stylesheet).
|
|
38
|
+
* - `<div id="boot-loader">…</div>` → start of `<body>` (sibling of `#root`).
|
|
39
|
+
* - inline `<script>` defining `window.__bootLoader` → start of `<body>`.
|
|
40
|
+
*
|
|
41
|
+
* Keeping the loader as a sibling of `#root` (rather than a child of it) means
|
|
42
|
+
* `createRoot(document.getElementById('root')).render(...)` does not fight the
|
|
43
|
+
* loader for ownership; the host explicitly calls `dismiss()` after the first
|
|
44
|
+
* React commit, which gives a deterministic handoff.
|
|
45
|
+
*
|
|
46
|
+
* Color tokens are exposed as CSS custom properties (`--boot-loader-bg-light`,
|
|
47
|
+
* `--boot-loader-bg-dark`, etc.) defined in `boot-loader.css`, so consumers can
|
|
48
|
+
* override them at the document level without us re-parameterizing this plugin.
|
|
49
|
+
*/
|
|
50
|
+
export declare const bootLoaderPlugin: ({ status, markSvg }?: BootLoaderOptions) => Plugin;
|
|
51
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/boot-loader/loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAKnC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,gBAAgB,yBAAyB,iBAAiB,KAAQ,MA+D9E,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Plugin as VitePlugin } from 'vite';
|
|
2
|
+
import { type BuildMeta, ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest } from '../manifest';
|
|
3
|
+
export { ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest };
|
|
4
|
+
export type { BuildMeta };
|
|
5
|
+
export type ComposerPluginOptions = {
|
|
6
|
+
/** Entry point for the plugin bundle. Defaults to `src/plugin.tsx`. */
|
|
7
|
+
entry?: string;
|
|
8
|
+
/** Dev server port. Defaults to {@link PLUGIN_DEV_SERVER_PORT}. */
|
|
9
|
+
port?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Plugin metadata. When provided, a `manifest.json` asset is emitted alongside the bundle
|
|
12
|
+
* listing every emitted file. The host fetches this manifest at install time and persists
|
|
13
|
+
* the declared assets in its offline cache so the plugin works without network. The bundle's
|
|
14
|
+
* entry module is always written as {@link ENTRY_FILENAME} (`index.mjs`).
|
|
15
|
+
*/
|
|
16
|
+
meta?: BuildMeta;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Vite plugin for **external Composer plugin projects**. Configures the build to produce
|
|
20
|
+
* an ESM bundle that externalizes all framework dependencies, which the Composer host app
|
|
21
|
+
* provides at runtime via import map.
|
|
22
|
+
*
|
|
23
|
+
* Handles:
|
|
24
|
+
* 1. Build config — lib mode entry point, ES format output, rollup externals, code-split chunks.
|
|
25
|
+
* 2. Dev externalization — marks shared deps as external during `vite serve` and strips
|
|
26
|
+
* the `/@id/` prefix that Vite's import analysis adds to external bare specifiers.
|
|
27
|
+
* 3. JSX dev runtime shim — bridges `react/jsx-dev-runtime` (used by React refresh in dev)
|
|
28
|
+
* to `react/jsx-runtime` (which is what the externalized React provides).
|
|
29
|
+
* 4. Manifest emit — when `meta` is supplied, writes `manifest.json` next to the bundled
|
|
30
|
+
* module listing every emitted asset (entry, CSS, chunks, etc.) so the host can eagerly
|
|
31
|
+
* cache them for offline use.
|
|
32
|
+
*/
|
|
33
|
+
export declare const composerPlugin: (options?: ComposerPluginOptions) => VitePlugin[];
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/composer/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAGjD,OAAO,EAAE,KAAK,SAAS,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrG,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;AAClE,YAAY,EAAE,SAAS,EAAE,CAAC;AAwD1B,MAAM,MAAM,qBAAqB,GAAG;IAClC,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,aAAc,qBAAqB,KAAG,UAAU,EAiN1E,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Vite plugin for the **host app** (Composer). Generates a browser import map so that
|
|
4
|
+
* shared packages are loaded once and reused by both the host and any remote plugins.
|
|
5
|
+
*
|
|
6
|
+
* In production, emits a dedicated chunk per specifier via virtual wrapper modules,
|
|
7
|
+
* then injects a `<script type="importmap">` tag into the HTML with the chunk URLs.
|
|
8
|
+
*
|
|
9
|
+
* Virtual wrappers are needed because directly emitting chunks for CJS packages loses
|
|
10
|
+
* their named exports due to Rollup's interop. The wrapper re-exports them explicitly.
|
|
11
|
+
*
|
|
12
|
+
* TODO: Restore dev-mode support. The previous dev path mapped each bare specifier to
|
|
13
|
+
* its absolute `/@fs/` file path during `buildStart`, which forced `this.resolve()` for
|
|
14
|
+
* hundreds of subpath entrypoints and raced with Vite's optimize-deps static scan —
|
|
15
|
+
* producing non-deterministic chunk content (~34 chunks drifting per warm-start) and
|
|
16
|
+
* triggering Vite 8.0.10's `runOptimizer` / `commitProcessing` crashes (`fileHash` /
|
|
17
|
+
* `browserHash` undefined on partial-discovery batches). Plugin is currently gated to
|
|
18
|
+
* `apply: 'build'` to avoid both. A working dev-mode implementation would need to
|
|
19
|
+
* resolve specifiers without participating in the optimize-deps phase — candidates:
|
|
20
|
+
* - defer resolution to `transformIndexHtml` (after the optimizer settles)
|
|
21
|
+
* - read resolved paths from `environment.depsOptimizer.metadata` rather than calling
|
|
22
|
+
* `this.resolve()` ourselves
|
|
23
|
+
* - resolve via `require.resolve` directly, bypassing the Vite plugin pipeline entirely
|
|
24
|
+
*/
|
|
25
|
+
export declare const importMapPlugin: (options?: {
|
|
26
|
+
packages?: string[];
|
|
27
|
+
}) => Plugin[];
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/import-map/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAmUnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,eAAe,aAAc;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,KAAG,MAAM,EA4KzE,CAAC"}
|