@dxos/app-framework 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878
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 +1 -3
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/{capability-DU35RXMD.mjs → capability-C4WE22TJ.mjs} +12 -11
- package/dist/lib/browser/capability-C4WE22TJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-2ZIYRDAF.mjs +95 -0
- package/dist/lib/browser/chunk-2ZIYRDAF.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-PKQT6C53.mjs → chunk-66IXTIVK.mjs} +3 -2
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/chunk-67GCXX5I.mjs +581 -0
- package/dist/lib/browser/chunk-67GCXX5I.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
- package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-FJ4765WW.mjs.map} +3 -3
- package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZQO3UZ4R.mjs → chunk-IW44C7UL.mjs} +10 -4
- package/dist/lib/browser/chunk-IW44C7UL.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-EIFGKQSA.mjs → chunk-LPWOVOOB.mjs} +14 -42
- package/dist/lib/browser/chunk-LPWOVOOB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4DQMLMGU.mjs → chunk-LUQOVTWB.mjs} +13 -14
- package/dist/lib/browser/chunk-LUQOVTWB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KWP6PKIU.mjs → chunk-SLX73WRZ.mjs} +92 -19
- package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-SZMB3K2N.mjs +517 -0
- package/dist/lib/browser/chunk-SZMB3K2N.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 +17 -32
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/common/activation-events.mjs +11 -14
- package/dist/lib/browser/common/capabilities.mjs +19 -8
- package/dist/lib/browser/core/activation-event.mjs +1 -1
- package/dist/lib/browser/core/capability.mjs +5 -1
- package/dist/lib/browser/core/plugin-manager.mjs +8 -4
- package/dist/lib/browser/core/plugin.mjs +16 -4
- package/dist/lib/browser/core/url-loader.mjs +24 -0
- package/dist/lib/browser/index.mjs +47 -49
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/process-manager-capability-3Q4TA73T.mjs +89 -0
- package/dist/lib/browser/process-manager-capability-3Q4TA73T.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +199 -52
- 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 +25 -20
- package/dist/lib/node-esm/{capability-SR2EIZFP.mjs → capability-GPN6OS6M.mjs} +12 -11
- package/dist/lib/node-esm/capability-GPN6OS6M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-37Z53PXZ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-37Z53PXZ.mjs.map} +3 -3
- 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-DZ2XLAGI.mjs → chunk-6S45OMUP.mjs} +92 -19
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-64IMLAS2.mjs → chunk-CTKEZHKF.mjs} +10 -4
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DHSHRYIB.mjs → chunk-FEVJEUD7.mjs} +14 -42
- package/dist/lib/node-esm/chunk-FEVJEUD7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GBHZF46K.mjs +518 -0
- package/dist/lib/node-esm/chunk-GBHZF46K.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GUE5V5CG.mjs +582 -0
- package/dist/lib/node-esm/chunk-GUE5V5CG.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-J2PHTRHC.mjs → chunk-MXWDXYV2.mjs} +13 -14
- package/dist/lib/node-esm/chunk-MXWDXYV2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QBUGLR4H.mjs +96 -0
- package/dist/lib/node-esm/chunk-QBUGLR4H.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-7OWSHPYK.mjs → chunk-XOCUANHO.mjs} +3 -2
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +17 -32
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/common/activation-events.mjs +11 -14
- package/dist/lib/node-esm/common/capabilities.mjs +19 -8
- package/dist/lib/node-esm/core/activation-event.mjs +1 -1
- package/dist/lib/node-esm/core/capability.mjs +5 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
- package/dist/lib/node-esm/core/plugin.mjs +16 -4
- package/dist/lib/node-esm/core/url-loader.mjs +25 -0
- package/dist/lib/node-esm/index.mjs +47 -49
- 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-5KCLSNQM.mjs +90 -0
- package/dist/lib/node-esm/process-manager-capability-5KCLSNQM.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +199 -52
- 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 +25 -20
- 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 +1 -3
- package/dist/types/src/cli/cli.d.ts.map +1 -1
- package/dist/types/src/common/activation-events.d.ts +10 -13
- package/dist/types/src/common/activation-events.d.ts.map +1 -1
- 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 +113 -12
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +8 -22
- package/dist/types/src/common/operations.d.ts.map +1 -1
- package/dist/types/src/core/activation-event.d.ts +5 -5
- package/dist/types/src/core/activation-event.d.ts.map +1 -1
- package/dist/types/src/core/capability-manager.d.ts +5 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -1
- package/dist/types/src/core/capability.d.ts +19 -8
- package/dist/types/src/core/capability.d.ts.map +1 -1
- 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 +6 -0
- 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 +238 -7
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- 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 +182 -7
- 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 +1 -2
- 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-operation → plugin-process-manager}/history/history-tracker.d.ts +1 -1
- 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.map +1 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +1 -1
- 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.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.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 +1 -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.map +1 -1
- 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.d.ts → App/App.d.ts} +3 -2
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
- package/dist/types/src/ui/components/{App.stories.d.ts → App/App.stories.d.ts} +6 -1
- 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.map +1 -0
- package/dist/types/src/ui/components/{PluginManagerProvider.d.ts → PluginManager/PluginManagerProvider.d.ts} +1 -1
- 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.map +1 -0
- package/dist/types/src/ui/components/{surface → Surface}/SurfaceInfo.d.ts.map +1 -1
- 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 → Surface}/context.d.ts.map +1 -1
- 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 +3 -3
- package/dist/types/src/ui/components/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/index.d.ts +1 -1
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts +51 -15
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useSurface.d.ts +2 -2
- package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -1
- package/dist/types/src/ui/index.d.ts +0 -1
- package/dist/types/src/ui/index.d.ts.map +1 -1
- 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 +16 -4
- package/package.json +63 -63
- package/src/cli/cli.ts +4 -9
- package/src/common/activation-events.ts +12 -17
- package/src/common/annotations.ts +3 -0
- package/src/common/capabilities.ts +160 -29
- package/src/common/operations.ts +8 -10
- package/src/context.ts +1 -1
- package/src/core/activation-event.ts +5 -2
- package/src/core/capability-manager.test.ts +1 -1
- package/src/core/capability-manager.ts +22 -1
- package/src/core/capability.ts +28 -10
- package/src/core/edge-registry-plugin-provider.ts +92 -0
- package/src/core/index.ts +6 -0
- package/src/core/plugin-asset-cache.ts +60 -0
- package/src/core/plugin-manager.test.ts +1085 -31
- package/src/core/plugin-manager.ts +1180 -189
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +195 -12
- 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/index.ts +1 -2
- package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
- package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +1 -2
- package/src/plugin-process-manager/history/errors.ts +7 -0
- package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +37 -43
- package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +1 -2
- package/src/{plugin-operation → plugin-process-manager}/history/types.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +3 -4
- package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +1 -1
- package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
- package/src/plugin-process-manager/meta.ts +14 -0
- package/src/plugin-process-manager/process-manager-capability.ts +178 -0
- package/src/{plugin-operation → plugin-process-manager}/testing.ts +26 -45
- package/src/testing/harness.ts +247 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/react.test.tsx +48 -0
- package/src/testing/react.tsx +113 -0
- package/src/testing/service.ts +4 -4
- package/src/testing/withPluginManager.stories.tsx +1 -2
- package/src/testing/withPluginManager.tsx +45 -17
- package/src/ui/components/App/App.stories.tsx +86 -0
- package/src/ui/components/App/App.tsx +81 -0
- package/src/{plugin-runtime → ui/components/App}/index.ts +1 -1
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +156 -0
- package/src/ui/components/Placeholder/index.ts +5 -0
- package/src/ui/components/{PluginManagerContext.stories.tsx → PluginManager/PluginManagerContext.stories.tsx} +15 -14
- package/src/ui/components/{PluginManagerProvider.ts → PluginManager/PluginManagerProvider.ts} +1 -1
- package/src/ui/components/PluginManager/index.ts +5 -0
- package/src/ui/components/{surface → Surface}/SurfaceComponent.stories.tsx +25 -23
- package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
- package/src/ui/components/{surface → Surface}/SurfaceInfo.tsx +1 -2
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -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 +3 -3
- package/src/ui/hooks/index.ts +1 -1
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +236 -33
- package/src/ui/hooks/useCapabilities.ts +2 -1
- package/src/ui/hooks/useLoading.tsx +14 -6
- package/src/ui/hooks/useProcessManagerRuntime.ts +78 -0
- package/src/ui/hooks/useSurface.ts +3 -3
- package/src/ui/index.ts +0 -1
- 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 +28 -1
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +1 -1
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/dist/lib/browser/capability-7LE5X2NH.mjs +0 -37
- package/dist/lib/browser/capability-7LE5X2NH.mjs.map +0 -7
- package/dist/lib/browser/capability-DU35RXMD.mjs.map +0 -7
- package/dist/lib/browser/chunk-4DQMLMGU.mjs.map +0 -7
- package/dist/lib/browser/chunk-EIFGKQSA.mjs.map +0 -7
- package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
- package/dist/lib/browser/chunk-IGRQWMWW.mjs +0 -80
- package/dist/lib/browser/chunk-IGRQWMWW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KWP6PKIU.mjs.map +0 -7
- package/dist/lib/browser/chunk-NPUEVX42.mjs +0 -34
- package/dist/lib/browser/chunk-NPUEVX42.mjs.map +0 -7
- package/dist/lib/browser/chunk-PKQT6C53.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGWEEBUV.mjs +0 -807
- package/dist/lib/browser/chunk-WGWEEBUV.mjs.map +0 -7
- package/dist/lib/browser/chunk-YAFEA4GV.mjs +0 -1
- package/dist/lib/browser/chunk-YZQ6NFG4.mjs +0 -781
- package/dist/lib/browser/chunk-YZQ6NFG4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZQO3UZ4R.mjs.map +0 -7
- package/dist/lib/browser/invoker-capability-7QW56NOM.mjs +0 -36
- package/dist/lib/browser/invoker-capability-7QW56NOM.mjs.map +0 -7
- package/dist/lib/node-esm/capability-OSVYGK4X.mjs +0 -38
- package/dist/lib/node-esm/capability-OSVYGK4X.mjs.map +0 -7
- package/dist/lib/node-esm/capability-SR2EIZFP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-64IMLAS2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DHSHRYIB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DZ2XLAGI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J2PHTRHC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JAZVHID3.mjs +0 -35
- package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OQYHRZYF.mjs +0 -81
- package/dist/lib/node-esm/chunk-OQYHRZYF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs +0 -782
- package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XHAKT6UD.mjs +0 -808
- package/dist/lib/node-esm/chunk-XHAKT6UD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +0 -2
- package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs +0 -37
- package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs.map +0 -7
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts +0 -7
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/errors.d.ts +0 -5
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/index.d.ts +0 -3
- package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/testing.d.ts +0 -109
- package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
- package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/index.d.ts +0 -2
- package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
- package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
- package/dist/types/src/ui/components/App.d.ts.map +0 -1
- package/dist/types/src/ui/components/App.stories.d.ts.map +0 -1
- package/dist/types/src/ui/components/DefaultFallback.d.ts +0 -8
- package/dist/types/src/ui/components/DefaultFallback.d.ts.map +0 -1
- package/dist/types/src/ui/components/ErrorBoundary.d.ts +0 -30
- package/dist/types/src/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/ui/components/PluginManagerContext.stories.d.ts.map +0 -1
- package/dist/types/src/ui/components/PluginManagerProvider.d.ts.map +0 -1
- package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts +0 -12
- package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts.map +0 -1
- package/dist/types/src/ui/components/surface/SurfaceComponent.stories.d.ts.map +0 -1
- package/dist/types/src/ui/components/surface/index.d.ts +0 -5
- package/dist/types/src/ui/components/surface/index.d.ts.map +0 -1
- package/dist/types/src/ui/components/surface/types.d.ts +0 -94
- package/dist/types/src/ui/components/surface/types.d.ts.map +0 -1
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts +0 -19
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +0 -1
- package/src/plugin-operation/OperationPlugin.ts +0 -25
- package/src/plugin-operation/history/errors.ts +0 -11
- package/src/plugin-operation/invoker-capability.ts +0 -40
- package/src/plugin-operation/meta.ts +0 -11
- package/src/plugin-runtime/RuntimePlugin.ts +0 -20
- package/src/plugin-runtime/capability.ts +0 -53
- package/src/plugin-runtime/meta.ts +0 -11
- package/src/ui/components/App.stories.tsx +0 -62
- package/src/ui/components/App.tsx +0 -57
- package/src/ui/components/DefaultFallback.tsx +0 -26
- package/src/ui/components/ErrorBoundary.tsx +0 -56
- package/src/ui/components/surface/SurfaceComponent.tsx +0 -262
- package/src/ui/components/surface/index.ts +0 -8
- package/src/ui/components/surface/types.ts +0 -119
- package/src/ui/hooks/useOperationResolver.ts +0 -40
- /package/dist/lib/browser/{chunk-YAFEA4GV.mjs.map → core/url-loader.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-Z4TJPSMP.mjs.map → core/url-loader.mjs.map} +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
- /package/dist/types/src/ui/components/{PluginManagerContext.stories.d.ts → PluginManager/PluginManagerContext.stories.d.ts} +0 -0
- /package/dist/types/src/ui/components/{surface → Surface}/SurfaceComponent.stories.d.ts +0 -0
- /package/dist/types/src/ui/components/{surface → Surface}/SurfaceInfo.d.ts +0 -0
- /package/dist/types/src/ui/components/{surface → Surface}/context.d.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
- /package/src/ui/components/{surface → Surface}/context.ts +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren, ReactNode, RefCallback } from 'react';
|
|
2
|
-
import type { MakeOptional, Position } from '@dxos/util';
|
|
3
|
-
import type { ErrorBoundary } from '..';
|
|
4
|
-
/**
|
|
5
|
-
* Props that are passed to the Surface component.
|
|
6
|
-
*/
|
|
7
|
-
export type Props<T extends Record<string, any> = Record<string, unknown>> = {
|
|
8
|
-
/**
|
|
9
|
-
* If specified, the Surface will be wrapped in an error boundary.
|
|
10
|
-
* The fallback component will be rendered if an error occurs.
|
|
11
|
-
*/
|
|
12
|
-
fallback?: ErrorBoundary['props']['fallback'];
|
|
13
|
-
/**
|
|
14
|
-
* If specified, the Surface will be wrapped in a suspense boundary.
|
|
15
|
-
* The placeholder component will be rendered while the surface component is loading.
|
|
16
|
-
*/
|
|
17
|
-
placeholder?: ReactNode;
|
|
18
|
-
} & MakeOptional<CoreProps<T>, 'id' | 'data'> &
|
|
19
|
-
/**
|
|
20
|
-
* Additional props to pass to the component.
|
|
21
|
-
* These props are not used by Surface itself but may be used by components which resolve the surface.
|
|
22
|
-
* Exclude known prop names to prevent overriding well-defined props.
|
|
23
|
-
*/
|
|
24
|
-
{
|
|
25
|
-
[K in keyof Record<string, any>]: K extends keyof CoreProps<T> | 'fallback' | 'placeholder' ? never : any;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.
|
|
29
|
-
*/
|
|
30
|
-
export type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{
|
|
31
|
-
/**
|
|
32
|
-
* ID for debugging.
|
|
33
|
-
*/
|
|
34
|
-
id: string;
|
|
35
|
-
/**
|
|
36
|
-
* Role defines how the data should be rendered.
|
|
37
|
-
*/
|
|
38
|
-
role: string;
|
|
39
|
-
/**
|
|
40
|
-
* The data to be rendered by the surface.
|
|
41
|
-
* NOTE: This must be a stable value.
|
|
42
|
-
*/
|
|
43
|
-
data: T;
|
|
44
|
-
/**
|
|
45
|
-
* If more than one component is resolved, the limit determines how many are rendered.
|
|
46
|
-
*/
|
|
47
|
-
limit?: number | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
export type ComponentProps<T extends Record<string, any> = Record<string, any>> = CoreProps<T> & {
|
|
50
|
-
ref?: RefCallback<HTMLElement>;
|
|
51
|
-
} & Record<string, any>;
|
|
52
|
-
/**
|
|
53
|
-
* React component used to render a surface once is has matched.
|
|
54
|
-
*/
|
|
55
|
-
export type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (props: ComponentProps<T>) => ReactNode;
|
|
56
|
-
/**
|
|
57
|
-
* Definition of when a React component surface should be rendered.
|
|
58
|
-
*/
|
|
59
|
-
export type ReactDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
60
|
-
kind: 'react';
|
|
61
|
-
id: string;
|
|
62
|
-
role: string | string[];
|
|
63
|
-
position?: Position;
|
|
64
|
-
component: ComponentFunction<T>;
|
|
65
|
-
filter?: (data: Record<string, unknown>) => data is T;
|
|
66
|
-
}>;
|
|
67
|
-
/**
|
|
68
|
-
* Definition of when a Web Component surface should be rendered.
|
|
69
|
-
*/
|
|
70
|
-
export type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{
|
|
71
|
-
kind: 'web-component';
|
|
72
|
-
id: string;
|
|
73
|
-
role: string | string[];
|
|
74
|
-
position?: Position;
|
|
75
|
-
/**
|
|
76
|
-
* The tag name of the Web Component to render.
|
|
77
|
-
* The Web Component will receive the same props as React surfaces via properties/attributes.
|
|
78
|
-
*/
|
|
79
|
-
tagName: string;
|
|
80
|
-
filter?: (data: Record<string, unknown>) => data is T;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Definition of when a surface (React or Web Component) should be rendered.
|
|
84
|
-
*/
|
|
85
|
-
export type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a React surface definition.
|
|
88
|
-
*/
|
|
89
|
-
export declare const create: <T extends Record<string, any> = any>(definition: Omit<ReactDefinition<T>, "kind">) => ReactDefinition<T>;
|
|
90
|
-
/**
|
|
91
|
-
* Creates a Web Component surface definition.
|
|
92
|
-
*/
|
|
93
|
-
export declare const createWeb: <T extends Record<string, any> = any>(definition: Omit<WebComponentDefinition<T>, "kind">) => WebComponentDefinition<T>;
|
|
94
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/surface/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Capabilities } from '../../common';
|
|
2
|
-
/**
|
|
3
|
-
* Hook to dynamically register an operation resolver (handler) within a React component.
|
|
4
|
-
* The resolver is added when the component mounts and removed when it unmounts.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* const scrollHandler = useMemo(() => OperationResolver.make({
|
|
9
|
-
* operation: LayoutOperation.ScrollIntoView,
|
|
10
|
-
* handler: (input) => Effect.sync(() => {
|
|
11
|
-
* // Handle scroll
|
|
12
|
-
* }),
|
|
13
|
-
* }), [deps]);
|
|
14
|
-
*
|
|
15
|
-
* useOperationResolver(meta.id, scrollHandler);
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const useOperationResolver: (module: string, resolver: Capabilities.OperationResolver) => void;
|
|
19
|
-
//# sourceMappingURL=useOperationResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOperationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useOperationResolver.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,EAAE,UAAU,YAAY,CAAC,iBAAiB,SAc5F,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ActivationEvents } from '../common';
|
|
6
|
-
import { Capability, Plugin } from '../core';
|
|
7
|
-
|
|
8
|
-
import { meta } from './meta';
|
|
9
|
-
|
|
10
|
-
const OperationInvoker = Capability.lazy('OperationInvoker', () => import('./invoker-capability'));
|
|
11
|
-
const HistoryCapabilities = Capability.lazy('HistoryCapabilities', () => import('./history/capability'));
|
|
12
|
-
|
|
13
|
-
export const OperationPlugin = Plugin.define(meta).pipe(
|
|
14
|
-
Plugin.addModule({
|
|
15
|
-
activatesOn: ActivationEvents.ManagedRuntimeReady,
|
|
16
|
-
activatesBefore: [ActivationEvents.SetupOperationResolver],
|
|
17
|
-
activatesAfter: [ActivationEvents.OperationInvokerReady],
|
|
18
|
-
activate: OperationInvoker,
|
|
19
|
-
}),
|
|
20
|
-
Plugin.addModule({
|
|
21
|
-
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
22
|
-
activate: HistoryCapabilities,
|
|
23
|
-
}),
|
|
24
|
-
Plugin.make,
|
|
25
|
-
);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { OperationInvoker } from '@dxos/operation';
|
|
8
|
-
|
|
9
|
-
import { ActivationEvents, Capabilities } from '../common';
|
|
10
|
-
import { Capability, Plugin } from '../core';
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
// Capability Module
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
export default Capability.makeModule(
|
|
17
|
-
Effect.fnUntraced(function* () {
|
|
18
|
-
// Get the services for synchronous access in callbacks.
|
|
19
|
-
const capabilityManager = yield* Capability.Service;
|
|
20
|
-
const pluginManager = yield* Plugin.Service;
|
|
21
|
-
|
|
22
|
-
// Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).
|
|
23
|
-
const managedRuntimes = yield* Capability.getAll(Capabilities.ManagedRuntime);
|
|
24
|
-
const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : undefined;
|
|
25
|
-
|
|
26
|
-
const invoker = OperationInvoker.make(
|
|
27
|
-
() =>
|
|
28
|
-
Effect.gen(function* () {
|
|
29
|
-
yield* Plugin.activate(ActivationEvents.SetupOperationResolver);
|
|
30
|
-
return (yield* Capability.getAll(Capabilities.OperationResolver)).flat();
|
|
31
|
-
}).pipe(
|
|
32
|
-
Effect.provideService(Capability.Service, capabilityManager),
|
|
33
|
-
Effect.provideService(Plugin.Service, pluginManager),
|
|
34
|
-
),
|
|
35
|
-
managedRuntime,
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
return Capability.contributes(Capabilities.OperationInvoker, invoker);
|
|
39
|
-
}),
|
|
40
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Plugin } from '../core';
|
|
6
|
-
|
|
7
|
-
export const meta: Plugin.Meta = {
|
|
8
|
-
id: 'dxos.org/plugin/operation',
|
|
9
|
-
name: 'Operation Plugin',
|
|
10
|
-
description: 'Provides operation invocation, undo registry, and history tracking.',
|
|
11
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ActivationEvents } from '../common';
|
|
6
|
-
import { Capability, Plugin } from '../core';
|
|
7
|
-
|
|
8
|
-
import { meta } from './meta';
|
|
9
|
-
|
|
10
|
-
const ManagedRuntimeCapability = Capability.lazy('ManagedRuntime', () => import('./capability'));
|
|
11
|
-
|
|
12
|
-
export const RuntimePlugin = Plugin.define(meta).pipe(
|
|
13
|
-
Plugin.addModule({
|
|
14
|
-
activatesOn: ActivationEvents.Startup,
|
|
15
|
-
activatesBefore: [ActivationEvents.SetupLayer],
|
|
16
|
-
activatesAfter: [ActivationEvents.ManagedRuntimeReady],
|
|
17
|
-
activate: ManagedRuntimeCapability,
|
|
18
|
-
}),
|
|
19
|
-
Plugin.make,
|
|
20
|
-
);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Layer from 'effect/Layer';
|
|
7
|
-
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
8
|
-
|
|
9
|
-
import { ActivationEvents, Capabilities } from '../common';
|
|
10
|
-
import { Capability, Plugin } from '../core';
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
// Capability Module
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
export default Capability.makeModule(
|
|
17
|
-
Effect.fnUntraced(function* () {
|
|
18
|
-
// Get the CapabilityManager to create a layer for it.
|
|
19
|
-
const capabilityManager = yield* Capability.Service;
|
|
20
|
-
|
|
21
|
-
// Get the PluginManager to create a layer for it.
|
|
22
|
-
const pluginManager = yield* Plugin.Service;
|
|
23
|
-
|
|
24
|
-
// Trigger setup event so plugins can contribute their layers.
|
|
25
|
-
yield* Plugin.activate(ActivationEvents.SetupLayer);
|
|
26
|
-
|
|
27
|
-
// Gather all contributed layers.
|
|
28
|
-
const layers = yield* Capability.getAll(Capabilities.Layer);
|
|
29
|
-
|
|
30
|
-
// Create layers that provide Capability.Service and Plugin.Service.
|
|
31
|
-
const capabilityServiceLayer = Layer.succeed(Capability.Service, capabilityManager);
|
|
32
|
-
const pluginServiceLayer = Layer.succeed(Plugin.Service, pluginManager);
|
|
33
|
-
|
|
34
|
-
// Merge all layers including service layers.
|
|
35
|
-
// Layer.mergeAll requires a tuple type, so we use a cast for dynamic arrays.
|
|
36
|
-
const composedLayer =
|
|
37
|
-
layers.length > 0
|
|
38
|
-
? (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(
|
|
39
|
-
capabilityServiceLayer,
|
|
40
|
-
pluginServiceLayer,
|
|
41
|
-
...layers,
|
|
42
|
-
)
|
|
43
|
-
: (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(
|
|
44
|
-
capabilityServiceLayer,
|
|
45
|
-
pluginServiceLayer,
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
// Create the managed runtime from the composed layer.
|
|
49
|
-
const runtime = ManagedRuntime.make(composedLayer) as Capabilities.ManagedRuntime;
|
|
50
|
-
|
|
51
|
-
return Capability.contributes(Capabilities.ManagedRuntime, runtime);
|
|
52
|
-
}),
|
|
53
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Plugin } from '../core';
|
|
6
|
-
|
|
7
|
-
export const meta: Plugin.Meta = {
|
|
8
|
-
id: 'dxos.org/plugin/runtime',
|
|
9
|
-
name: 'Runtime Plugin',
|
|
10
|
-
description: 'Provides a managed Effect runtime by composing contributed layers.',
|
|
11
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
|
-
|
|
11
|
-
import { ActivationEvents, Capabilities } from '../../common';
|
|
12
|
-
import { Capability, Plugin } from '../../core';
|
|
13
|
-
import { useApp } from '../hooks';
|
|
14
|
-
|
|
15
|
-
// Minimal plugin that contributes a ReactRoot.
|
|
16
|
-
const TestPlugin = Plugin.define({
|
|
17
|
-
id: 'dxos.org/plugin/test',
|
|
18
|
-
name: 'Test Plugin',
|
|
19
|
-
}).pipe(
|
|
20
|
-
Plugin.addModule({
|
|
21
|
-
id: 'TestMain',
|
|
22
|
-
activatesOn: ActivationEvents.Startup,
|
|
23
|
-
activate: () =>
|
|
24
|
-
Effect.succeed([
|
|
25
|
-
Capability.contributes(Capabilities.ReactRoot, {
|
|
26
|
-
id: 'dxos.org/plugin/test/root',
|
|
27
|
-
root: () => (
|
|
28
|
-
<div className='fixed inset-0 flex items-center justify-center text-2xl'>App Started Successfully!</div>
|
|
29
|
-
),
|
|
30
|
-
}),
|
|
31
|
-
]),
|
|
32
|
-
}),
|
|
33
|
-
Plugin.make,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const plugins = [TestPlugin()];
|
|
37
|
-
const core = [TestPlugin.meta.id];
|
|
38
|
-
|
|
39
|
-
const DefaultStory = () => {
|
|
40
|
-
const App = useApp({
|
|
41
|
-
plugins,
|
|
42
|
-
core,
|
|
43
|
-
placeholder: () => <div className='fixed inset-0 flex items-center justify-center'>Loading...</div>,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return <App />;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const meta = {
|
|
50
|
-
title: 'sdk/app-framework/App',
|
|
51
|
-
render: DefaultStory,
|
|
52
|
-
decorators: [withTheme()],
|
|
53
|
-
parameters: {
|
|
54
|
-
layout: 'fullscreen',
|
|
55
|
-
},
|
|
56
|
-
} satisfies Meta;
|
|
57
|
-
|
|
58
|
-
export default meta;
|
|
59
|
-
|
|
60
|
-
type Story = StoryObj<typeof meta>;
|
|
61
|
-
|
|
62
|
-
export const Default: Story = {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities } from '../../common';
|
|
8
|
-
import { topologicalSort } from '../../helpers';
|
|
9
|
-
import { LoadingState, type UseAppOptions, useCapabilities, useLoading } from '../hooks';
|
|
10
|
-
|
|
11
|
-
export type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {
|
|
12
|
-
ready: boolean;
|
|
13
|
-
error: unknown;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const App = ({ placeholder: Placeholder, ready, error, debounce }: AppProps) => {
|
|
17
|
-
const reactContexts = useCapabilities(Capabilities.ReactContext);
|
|
18
|
-
const reactRoots = useCapabilities(Capabilities.ReactRoot);
|
|
19
|
-
const stage = useLoading(ready, debounce);
|
|
20
|
-
|
|
21
|
-
if (error) {
|
|
22
|
-
// This triggers the error boundary to provide UI feedback for the startup error.
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// TODO(wittjosiah): Consider using Suspense instead.
|
|
27
|
-
if (stage < LoadingState.Done) {
|
|
28
|
-
if (!Placeholder) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return <Placeholder stage={stage} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const ComposedContext = composeContexts(reactContexts);
|
|
36
|
-
return (
|
|
37
|
-
<ComposedContext>
|
|
38
|
-
{reactRoots.map(({ id, root: Component }) => (
|
|
39
|
-
<Component key={id} />
|
|
40
|
-
))}
|
|
41
|
-
</ComposedContext>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const composeContexts = (contexts: Capabilities.ReactContext[]) => {
|
|
46
|
-
if (contexts.length === 0) {
|
|
47
|
-
return ({ children }: PropsWithChildren) => <>{children}</>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return topologicalSort(contexts)
|
|
51
|
-
.map(({ context }) => context)
|
|
52
|
-
.reduce((Acc, Next) => ({ children }) => (
|
|
53
|
-
<Acc>
|
|
54
|
-
<Next>{children}</Next>
|
|
55
|
-
</Acc>
|
|
56
|
-
));
|
|
57
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* NOTE: Default fallback should not use tailwind or theme.
|
|
9
|
-
*/
|
|
10
|
-
export const DefaultFallback = ({ error }: { error: Error }) => {
|
|
11
|
-
return (
|
|
12
|
-
<div
|
|
13
|
-
style={{
|
|
14
|
-
margin: '1rem',
|
|
15
|
-
padding: '1rem',
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
border: '4px solid teal',
|
|
18
|
-
borderRadius: '1rem',
|
|
19
|
-
}}
|
|
20
|
-
>
|
|
21
|
-
{/* TODO(wittjosiah): Link to docs for replacing default. */}
|
|
22
|
-
<h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>ERROR: {error.message}</h1>
|
|
23
|
-
<pre style={{ overflow: 'auto', fontSize: '1rem', whiteSpace: 'pre-wrap', color: '#888888' }}>{error.stack}</pre>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';
|
|
6
|
-
|
|
7
|
-
type State = {
|
|
8
|
-
error: Error | undefined;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type ErrorBoundaryProps = PropsWithChildren<{
|
|
12
|
-
data?: any;
|
|
13
|
-
fallback?: FC<{ data?: any; error: Error }>;
|
|
14
|
-
}>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Surface error boundary.
|
|
18
|
-
* For basic usage prefer providing a fallback component to `Surface`.
|
|
19
|
-
*
|
|
20
|
-
* Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
|
|
21
|
-
*/
|
|
22
|
-
export class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
|
|
23
|
-
static getDerivedStateFromError(error: Error): { error: Error } {
|
|
24
|
-
return { error };
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override state = { error: undefined };
|
|
28
|
-
|
|
29
|
-
override componentDidUpdate(prevProps: ErrorBoundaryProps): void {
|
|
30
|
-
if (prevProps.data !== this.props.data) {
|
|
31
|
-
this.resetError();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
override render(): ReactNode {
|
|
36
|
-
if (this.state.error) {
|
|
37
|
-
const Fallback = this.props.fallback ?? DefaultFallback;
|
|
38
|
-
return <Fallback data={this.props.data} error={this.state.error} />;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return this.props.children;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private resetError(): void {
|
|
45
|
-
this.setState({ error: undefined });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const DefaultFallback: NonNullable<ErrorBoundaryProps['fallback']> = ({ data, error }) => {
|
|
50
|
-
return (
|
|
51
|
-
<div className='flex flex-col gap-2 overflow-hidden border border-red-500 rounded-sm'>
|
|
52
|
-
<h1 className='p-2'>ERROR: {error.message}</h1>
|
|
53
|
-
<pre className='p-2 overflow-y-auto text-sm text-subdued'>{JSON.stringify(data, null, 2)}</pre>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|