@dxos/app-framework 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
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/dist/lib/browser/{capability-DU35RXMD.mjs → capability-5RRH3WIB.mjs} +11 -10
- package/dist/lib/browser/capability-5RRH3WIB.mjs.map +7 -0
- package/dist/lib/browser/{capability-7LE5X2NH.mjs → capability-LUKGKUQH.mjs} +10 -9
- package/dist/lib/browser/{chunk-4DQMLMGU.mjs → chunk-23D4SJUE.mjs} +11 -13
- package/dist/lib/browser/{chunk-4DQMLMGU.mjs.map → chunk-23D4SJUE.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-ZQO3UZ4R.mjs → chunk-3JWJXGLK.mjs} +6 -4
- package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +7 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs +34 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-66IXTIVK.mjs} +3 -2
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs +581 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs +422 -0
- package/dist/lib/browser/chunk-CZ4BIAHH.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
- package/dist/lib/browser/{chunk-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-JD3Z5NEF.mjs +469 -0
- package/dist/lib/browser/chunk-JD3Z5NEF.mjs.map +7 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs +1174 -0
- package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IGRQWMWW.mjs → chunk-WBHCSOBW.mjs} +18 -18
- package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KWP6PKIU.mjs → chunk-Z55LVAGN.mjs} +87 -19
- package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EIFGKQSA.mjs → chunk-ZGJAZSNE.mjs} +9 -37
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +16 -29
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/common/activation-events.mjs +9 -8
- package/dist/lib/browser/common/capabilities.mjs +9 -8
- package/dist/lib/browser/core/activation-event.mjs +1 -1
- package/dist/lib/browser/core/capability.mjs +3 -1
- package/dist/lib/browser/core/plugin-manager.mjs +8 -4
- package/dist/lib/browser/core/plugin.mjs +14 -4
- package/dist/lib/browser/core/url-loader.mjs +24 -0
- package/dist/lib/browser/index.mjs +45 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{invoker-capability-7QW56NOM.mjs → invoker-capability-K4GHUFXF.mjs} +22 -14
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +184 -45
- 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 +19 -20
- package/dist/lib/node-esm/{capability-OSVYGK4X.mjs → capability-FCGZVIEG.mjs} +10 -9
- package/dist/lib/{browser/capability-7LE5X2NH.mjs.map → node-esm/capability-FCGZVIEG.mjs.map} +1 -1
- package/dist/lib/node-esm/{capability-SR2EIZFP.mjs → capability-JOIQ2MQE.mjs} +11 -10
- package/dist/lib/node-esm/capability-JOIQ2MQE.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-6XW6LET6.mjs +35 -0
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DHSHRYIB.mjs → chunk-D347W3KO.mjs} +9 -37
- package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs +470 -0
- package/dist/lib/node-esm/chunk-DRZKO5UZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DZ2XLAGI.mjs → chunk-HTBJU5FX.mjs} +87 -19
- package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs +423 -0
- package/dist/lib/node-esm/chunk-M3HKPRPO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs +1175 -0
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J2PHTRHC.mjs → chunk-SBS2YMPT.mjs} +11 -13
- package/dist/lib/node-esm/{chunk-J2PHTRHC.mjs.map → chunk-SBS2YMPT.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-64IMLAS2.mjs → chunk-SDJ4B2LU.mjs} +6 -4
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs +582 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OQYHRZYF.mjs → chunk-WFSRZKBP.mjs} +18 -18
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-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 +16 -29
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/common/activation-events.mjs +9 -8
- package/dist/lib/node-esm/common/capabilities.mjs +9 -8
- package/dist/lib/node-esm/core/activation-event.mjs +1 -1
- package/dist/lib/node-esm/core/capability.mjs +3 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
- package/dist/lib/node-esm/core/plugin.mjs +14 -4
- package/dist/lib/node-esm/core/url-loader.mjs +25 -0
- package/dist/lib/node-esm/index.mjs +45 -24
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{invoker-capability-CK4AMF2R.mjs → invoker-capability-XEPW5LMJ.mjs} +22 -14
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +184 -45
- 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 +19 -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/common/activation-events.d.ts +1 -1
- 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 +4 -8
- 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 +14 -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 +177 -4
- 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 +113 -7
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +101 -0
- package/dist/types/src/core/registry.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.d.ts +127 -0
- package/dist/types/src/core/url-loader.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.test.d.ts +2 -0
- package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/errors.d.ts +30 -3
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/types.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/testing.d.ts +27 -77
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -1
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +1 -1
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -1
- package/dist/types/src/testing/harness.d.ts +67 -0
- package/dist/types/src/testing/harness.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +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 +0 -1
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts +47 -8
- 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/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 +58 -62
- package/src/cli/cli.ts +3 -3
- package/src/common/activation-events.ts +6 -6
- package/src/common/annotations.ts +3 -0
- package/src/common/capabilities.ts +18 -23
- package/src/common/operations.ts +7 -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 +21 -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 +855 -29
- package/src/core/plugin-manager.ts +818 -179
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +145 -12
- package/src/core/registry.ts +157 -0
- package/src/core/url-loader.test.ts +221 -0
- package/src/core/url-loader.ts +388 -0
- package/src/plugin-operation/OperationPlugin.ts +2 -3
- package/src/plugin-operation/history/capability.ts +1 -2
- package/src/plugin-operation/history/errors.ts +2 -6
- package/src/plugin-operation/history/history-tracker.test.ts +37 -43
- package/src/plugin-operation/history/history-tracker.ts +1 -2
- package/src/plugin-operation/history/types.ts +1 -1
- package/src/plugin-operation/history/undo-mapping.ts +1 -1
- package/src/plugin-operation/history/undo-registry.test.ts +3 -4
- package/src/plugin-operation/history/undo-registry.ts +1 -1
- package/src/plugin-operation/invoker-capability.ts +19 -4
- package/src/plugin-operation/meta.ts +2 -1
- package/src/plugin-operation/testing.ts +26 -45
- package/src/plugin-runtime/RuntimePlugin.ts +2 -3
- package/src/plugin-runtime/meta.ts +2 -1
- package/src/testing/harness.ts +229 -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 +3 -3
- package/src/testing/withPluginManager.stories.tsx +1 -2
- package/src/testing/withPluginManager.tsx +40 -15
- package/src/ui/components/App/App.stories.tsx +88 -0
- package/src/ui/components/App/App.tsx +81 -0
- package/src/ui/components/App/index.ts +5 -0
- 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/{PluginManagerContext.stories.tsx → PluginManager/PluginManagerContext.stories.tsx} +15 -13
- 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 +0 -1
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +233 -24
- package/src/ui/hooks/useCapabilities.ts +1 -1
- package/src/ui/hooks/useLoading.tsx +14 -6
- 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 +22 -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-DU35RXMD.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.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.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-JAZVHID3.mjs +0 -35
- package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +0 -7
- 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.map +0 -7
- 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/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/{node-esm/capability-OSVYGK4X.mjs.map → browser/capability-LUKGKUQH.mjs.map} +0 -0
- /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/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/ui/components/{surface → Surface}/context.ts +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/core/plugin-manager.ts", "../../../src/core/capability-manager.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, Registry } from '@effect-atom/atom-react';\nimport * as Array from 'effect/Array';\nimport * as Cause from 'effect/Cause';\nimport * as Deferred from 'effect/Deferred';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as Function from 'effect/Function';\nimport * as HashSet from 'effect/HashSet';\nimport * as PubSub from 'effect/PubSub';\nimport * as Ref from 'effect/Ref';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { log } from '@dxos/log';\n\nimport * as ActivationEvent from './activation-event';\nimport * as Capability from './capability';\nimport * as CapabilityManager from './capability-manager';\nimport * as Plugin from './plugin';\n\n/**\n * Identifier denoting a Manager.\n */\nexport const ManagerTypeId: unique symbol = Symbol.for('@dxos/app-framework/Manager');\nexport type ManagerTypeId = typeof ManagerTypeId;\n\nexport type ManagerOptions = {\n pluginLoader: (id: string) => Effect.Effect<Plugin.Plugin, Error>;\n plugins?: Plugin.Plugin[];\n core?: string[];\n enabled?: string[];\n registry?: Registry.Registry;\n};\n\ntype ActivationMessage = { event: string; state: 'activating' | 'activated' | 'error'; error?: Error };\n\n/**\n * Interface for the Plugin Manager.\n */\nexport interface PluginManager {\n readonly [ManagerTypeId]: ManagerTypeId;\n readonly activation: PubSub.PubSub<ActivationMessage>;\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n readonly plugins: Atom.Atom<readonly Plugin.Plugin[]>;\n readonly core: Atom.Atom<readonly string[]>;\n readonly enabled: Atom.Atom<readonly string[]>;\n readonly modules: Atom.Atom<readonly Plugin.PluginModule[]>;\n readonly active: Atom.Atom<readonly string[]>;\n readonly eventsFired: Atom.Atom<readonly string[]>;\n readonly pendingReset: Atom.Atom<readonly string[]>;\n\n getPlugins(): readonly Plugin.Plugin[];\n getCore(): readonly string[];\n getEnabled(): readonly string[];\n getModules(): readonly Plugin.PluginModule[];\n getActive(): readonly string[];\n getEventsFired(): readonly string[];\n getPendingReset(): readonly string[];\n\n add(id: string): Effect.Effect<boolean, Error>;\n enable(id: string): Effect.Effect<boolean, Error>;\n remove(id: string): boolean;\n disable(id: string): Effect.Effect<boolean, Error>;\n // TODO(wittjosiah): Improve error typing.\n activate(\n event: ActivationEvent.ActivationEvent | string,\n params?: { before?: string; after?: string },\n ): Effect.Effect<boolean, Error>;\n deactivate(id: string): Effect.Effect<boolean, Error>;\n reset(event: ActivationEvent.ActivationEvent | string): Effect.Effect<boolean, Error>;\n}\n\n/**\n * Type guard to check if a value is a PluginManager.\n */\nexport const isManager = (value: unknown): value is PluginManager => {\n return typeof value === 'object' && value !== null && ManagerTypeId in value;\n};\n\n/**\n * Internal implementation of PluginManager.\n */\nclass ManagerImpl implements PluginManager {\n readonly [ManagerTypeId]: ManagerTypeId = ManagerTypeId;\n readonly activation = Effect.runSync(PubSub.unbounded<ActivationMessage>());\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n private readonly _pluginsAtom: Atom.Writable<Plugin.Plugin[]>;\n private readonly _coreAtom: Atom.Writable<string[]>;\n private readonly _enabledAtom: Atom.Writable<string[]>;\n private readonly _modulesAtom: Atom.Writable<Plugin.PluginModule[]>;\n private readonly _activeAtom: Atom.Writable<string[]>;\n private readonly _eventsFiredAtom: Atom.Writable<string[]>;\n private readonly _pendingResetAtom: Atom.Writable<string[]>;\n private readonly _pluginLoader: ManagerOptions['pluginLoader'];\n private readonly _capabilities = new Map<string, Capability.Any[]>();\n private readonly _moduleMemoMap = new Map<Plugin.PluginModule['id'], Deferred.Deferred<Capability.Any[], Error>>();\n private readonly _moduleSemaphores = new Map<Plugin.PluginModule['id'], Effect.Semaphore>();\n private readonly _activatingEvents = Effect.runSync(Ref.make<string[]>([]));\n private readonly _activatingModules = Effect.runSync(Ref.make<string[]>([]));\n\n constructor({\n pluginLoader,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n enabled = [],\n registry,\n }: ManagerOptions) {\n this.registry = registry ?? Registry.make();\n this.capabilities = CapabilityManager.make({\n registry: this.registry,\n });\n\n this._pluginLoader = pluginLoader;\n this._pluginsAtom = Atom.make(plugins).pipe(Atom.keepAlive);\n this._coreAtom = Atom.make(core).pipe(Atom.keepAlive);\n this._enabledAtom = Atom.make(enabled).pipe(Atom.keepAlive);\n this._modulesAtom = Atom.make<Plugin.PluginModule[]>([]).pipe(Atom.keepAlive);\n this._activeAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n this._eventsFiredAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n this._pendingResetAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n plugins.forEach((plugin) => this._addPlugin(plugin));\n void Effect.all([...core, ...enabled].map((id) => this.enable(id))).pipe(runAndForwardErrors);\n }\n\n get plugins(): Atom.Atom<readonly Plugin.Plugin[]> {\n return this._pluginsAtom;\n }\n\n get core(): Atom.Atom<readonly string[]> {\n return this._coreAtom;\n }\n\n /**\n * Ids of plugins that are currently enabled.\n */\n get enabled(): Atom.Atom<readonly string[]> {\n return this._enabledAtom;\n }\n\n /**\n * Modules of plugins which are currently enabled.\n */\n get modules(): Atom.Atom<readonly Plugin.PluginModule[]> {\n return this._modulesAtom;\n }\n\n /**\n * Ids of modules which are currently active.\n */\n get active(): Atom.Atom<readonly string[]> {\n return this._activeAtom;\n }\n\n /**\n * Ids of events which have been fired.\n */\n get eventsFired(): Atom.Atom<readonly string[]> {\n return this._eventsFiredAtom;\n }\n\n /**\n * Ids of modules which are pending reset.\n */\n get pendingReset(): Atom.Atom<readonly string[]> {\n return this._pendingResetAtom;\n }\n\n getPlugins(): readonly Plugin.Plugin[] {\n return this._get(this._pluginsAtom);\n }\n\n getCore(): readonly string[] {\n return this._get(this._coreAtom);\n }\n\n getEnabled(): readonly string[] {\n return this._get(this._enabledAtom);\n }\n\n getModules(): readonly Plugin.PluginModule[] {\n return this._get(this._modulesAtom);\n }\n\n getActive(): readonly string[] {\n return this._get(this._activeAtom);\n }\n\n getEventsFired(): readonly string[] {\n return this._get(this._eventsFiredAtom);\n }\n\n getPendingReset(): readonly string[] {\n return this._get(this._pendingResetAtom);\n }\n\n /**\n * Adds a plugin to the manager via the plugin loader.\n * @param id The id of the plugin.\n */\n add(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('add plugin', { id });\n const plugin = yield* this._pluginLoader(id);\n this._addPlugin(plugin);\n return yield* this.enable(id);\n });\n }\n\n /**\n * Enables a plugin.\n * @param id The id of the plugin.\n */\n enable(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('enable plugin', { id });\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n this._update(this._enabledAtom, (enabled) => (enabled.includes(id) ? enabled : [...enabled, id]));\n\n plugin.modules.forEach((module) => {\n this._addModule(module);\n this._setPendingResetByModule(module);\n });\n\n log('pending reset', { events: [...this.getPendingReset()] });\n yield* Effect.all(\n this.getPendingReset().map((event) => this.activate(event)),\n { concurrency: 'unbounded' },\n );\n\n return true;\n });\n }\n\n /**\n * Removes a plugin from the manager.\n * @param id The id of the plugin.\n */\n remove(id: string): boolean {\n log('remove plugin', { id });\n const result = this.disable(id);\n if (!result) {\n return false;\n }\n\n this._removePlugin(id);\n return true;\n }\n\n /**\n * Disables a plugin.\n * @param id The id of the plugin.\n */\n disable(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('disable plugin', { id });\n if (this._get(this._coreAtom).includes(id)) {\n return false;\n }\n\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n const enabledIndex = this._get(this._enabledAtom).findIndex((enabled) => enabled === id);\n if (enabledIndex !== -1) {\n this._update(this._enabledAtom, (enabled) => enabled.filter((item) => item !== id));\n yield* this.deactivate(id);\n\n plugin.modules.forEach((module) => {\n this._removeModule(module.id);\n });\n }\n\n return true;\n });\n }\n\n /**\n * Activates plugins based on the activation event.\n * @param event The activation event.\n * @returns Whether the activation was successful.\n */\n activate(\n event: ActivationEvent.ActivationEvent | string,\n params?: { before?: string; after?: string },\n ): Effect.Effect<boolean, Error> {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n return Effect.gen(this, function* () {\n log('activating', { key, ...params });\n yield* Ref.update(this._activatingEvents, (activating) => Array.append(activating, key));\n const pendingIndex = this._get(this._pendingResetAtom).findIndex((event) => event === key);\n if (pendingIndex !== -1) {\n this._update(this._pendingResetAtom, (pending) => pending.filter((event) => event !== key));\n }\n\n const activatingEvents = yield* this._activatingEvents;\n const activatingModules = yield* this._activatingModules;\n const modules = this._getInactiveModulesByEvent(key).filter((module) => {\n const allOf = ActivationEvent.isAllOf(module.activatesOn);\n if (!allOf) {\n return true;\n }\n\n // Check to see if all of the events in the `allOf` have been fired.\n // An event can be considered \"fired\" if it is in the `eventsFired` list or if it is currently being activated.\n const events = ActivationEvent.getEvents(module.activatesOn).filter(\n (event) => ActivationEvent.eventKey(event) !== key,\n );\n return (\n events.every(\n (event) =>\n this._get(this._eventsFiredAtom).includes(ActivationEvent.eventKey(event)) ||\n activatingEvents.includes(ActivationEvent.eventKey(event)),\n ) && !activatingModules.includes(module.id)\n );\n });\n yield* Ref.update(this._activatingModules, (activating) =>\n Array.appendAll(\n activating,\n modules.map((module) => module.id),\n ),\n );\n if (modules.length === 0) {\n log('no modules to activate', { key });\n if (!this._get(this._eventsFiredAtom).includes(key)) {\n this._update(this._eventsFiredAtom, (events) => [...events, key]);\n }\n return false;\n }\n\n log('activating modules', { key, modules: modules.map((module) => module.id) });\n yield* PubSub.publish(this.activation, { event: key, state: 'activating' });\n\n // Fire activatesBefore events.\n const beforeEvents = Function.pipe(\n modules,\n Array.flatMap((module) => module.activatesBefore ?? []),\n HashSet.fromIterable,\n HashSet.toValues,\n Array.filter((event) => !activatingEvents.includes(ActivationEvent.eventKey(event))),\n );\n yield* Function.pipe(\n beforeEvents,\n Array.map((event) => this.activate(event, { before: key })),\n Effect.allWith({ concurrency: 'unbounded' }),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() =>\n log.warn('activatesBefore is taking a long time', {\n event: key,\n beforeEvents: beforeEvents.map(ActivationEvent.eventKey),\n }),\n ),\n ),\n ),\n ),\n );\n\n // Concurrently triggers loading of lazy capabilities.\n const getCapabilities = yield* Function.pipe(\n modules,\n Array.map((mod) => this._loadModule(mod)),\n Effect.allWith({ concurrency: 'unbounded' }),\n Effect.catchAll((error) => {\n return Effect.gen(this, function* () {\n yield* PubSub.publish(this.activation, { event: key, state: 'error', error });\n return yield* Effect.fail(error);\n });\n }),\n );\n\n // Contribute the capabilities from the activated modules.\n yield* Function.pipe(\n modules,\n Array.zip(getCapabilities),\n Array.map(([module, capabilities]) => this._contributeCapabilities(module, capabilities)),\n // TODO(wittjosiah): This currently can't be run in parallel.\n // Running this with concurrency causes races with `allOf` activation events.\n Effect.all,\n );\n\n // Fire activatesAfter events.\n const afterEvents = Function.pipe(\n modules,\n Array.flatMap((module) => module.activatesAfter ?? []),\n HashSet.fromIterable,\n HashSet.toValues,\n Array.filter((event) => !activatingEvents.includes(ActivationEvent.eventKey(event))),\n );\n yield* Function.pipe(\n afterEvents,\n Array.map((event) => this.activate(event, { after: key })),\n Effect.allWith({ concurrency: 'unbounded' }),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() =>\n log.warn('activatesAfter is taking a long time', {\n event: key,\n afterEvents: afterEvents.map(ActivationEvent.eventKey),\n }),\n ),\n ),\n ),\n ),\n );\n\n yield* Ref.update(this._activatingEvents, (activating) => Array.filter(activating, (event) => event !== key));\n yield* Ref.update(this._activatingModules, (activating) =>\n Array.filter(activating, (module) => !modules.map((module) => module.id).includes(module)),\n );\n\n if (!this._get(this._eventsFiredAtom).includes(key)) {\n this._update(this._eventsFiredAtom, (events) => [...events, key]);\n }\n\n yield* PubSub.publish(this.activation, { event: key, state: 'activated' });\n log('activated', { key });\n\n return true;\n }).pipe(\n together(\n Effect.sleep(Duration.seconds(15)).pipe(\n Effect.andThen(Effect.sync(() => log.warn('event activation is taking a long time', { event: key }))),\n ),\n ),\n );\n }\n\n /**\n * Deactivates all of the modules for a plugin.\n * @param id The id of the plugin.\n * @returns Whether the deactivation was successful.\n */\n deactivate(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n const modules = plugin.modules;\n const results = yield* Effect.all(\n modules.map((module) => this._deactivateModule(module)),\n { concurrency: 'unbounded' },\n );\n return results.every((result) => result);\n });\n }\n\n /**\n * Re-activates the modules that were activated by the event.\n * @param event The activation event.\n * @returns Whether the reset was successful.\n */\n reset(event: ActivationEvent.ActivationEvent | string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n log('reset', { key });\n const modules = this._getActiveModulesByEvent(key);\n const results = yield* Effect.all(\n modules.map((module) => this._deactivateModule(module)),\n { concurrency: 'unbounded' },\n );\n\n if (results.every((result) => result)) {\n return yield* this.activate(key);\n } else {\n return false;\n }\n });\n }\n\n private _get<T>(atom: Atom.Atom<T>): T {\n return this.registry.get(atom);\n }\n\n private _set<T>(atom: Atom.Writable<T>, value: T): void {\n this.registry.set(atom, value);\n }\n\n private _update<T>(atom: Atom.Writable<T>, updater: (current: T) => T): void {\n this._set(atom, updater(this._get(atom)));\n }\n\n private _addPlugin(plugin: Plugin.Plugin): void {\n log('add plugin', { id: plugin.meta.id });\n // TODO(wittjosiah): Find a way to add a warning for duplicate plugins that doesn't cause log spam.\n this._update(this._pluginsAtom, (plugins) => (plugins.includes(plugin) ? plugins : [...plugins, plugin]));\n }\n\n private _removePlugin(id: string): void {\n log('remove plugin', { id });\n this._update(this._pluginsAtom, (plugins) => plugins.filter((plugin) => plugin.meta.id !== id));\n }\n\n private _addModule(module: Plugin.PluginModule): void {\n log('add module', { id: module.id });\n // TODO(wittjosiah): Find a way to add a warning for duplicate modules that doesn't cause log spam.\n this._update(this._modulesAtom, (modules) => (modules.includes(module) ? modules : [...modules, module]));\n }\n\n private _removeModule(id: string): void {\n log('remove module', { id });\n this._update(this._modulesAtom, (modules) => modules.filter((module) => module.id !== id));\n }\n\n private _getPlugin(id: string): Plugin.Plugin | undefined {\n return this._get(this._pluginsAtom).find((plugin) => plugin.meta.id === id);\n }\n\n private _getActiveModules(): Plugin.PluginModule[] {\n const active = this._get(this._activeAtom);\n return this._get(this._modulesAtom).filter((module) => active.includes(module.id));\n }\n\n private _getInactiveModules(): Plugin.PluginModule[] {\n const active = this._get(this._activeAtom);\n return this._get(this._modulesAtom).filter((module) => !active.includes(module.id));\n }\n\n private _getActiveModulesByEvent(key: string): Plugin.PluginModule[] {\n return this._getActiveModules().filter((module) =>\n ActivationEvent.getEvents(module.activatesOn).map(ActivationEvent.eventKey).includes(key),\n );\n }\n\n private _getInactiveModulesByEvent(key: string): Plugin.PluginModule[] {\n return this._getInactiveModules().filter((module) =>\n ActivationEvent.getEvents(module.activatesOn).map(ActivationEvent.eventKey).includes(key),\n );\n }\n\n private _setPendingResetByModule(module: Plugin.PluginModule): void {\n const activationEvents = ActivationEvent.getEvents(module.activatesOn)\n .map(ActivationEvent.eventKey)\n .filter((key) => this._get(this._eventsFiredAtom).includes(key));\n\n const pendingReset = Array.fromIterable(new Set(activationEvents)).filter((event) => {\n const pending = this._get(this._pendingResetAtom);\n return !pending.includes(event);\n });\n if (pendingReset.length > 0) {\n log('pending reset', { events: pendingReset });\n this._update(this._pendingResetAtom, (current) => [...current, ...pendingReset]);\n }\n }\n\n private _getModuleSemaphore(moduleId: Plugin.PluginModule['id']): Effect.Semaphore {\n let semaphore = this._moduleSemaphores.get(moduleId);\n if (!semaphore) {\n semaphore = Effect.runSync(Effect.makeSemaphore(1));\n this._moduleSemaphores.set(moduleId, semaphore);\n }\n return semaphore;\n }\n\n private _loadModule = (module: Plugin.PluginModule): Effect.Effect<Capability.Any[], Error> =>\n Effect.gen(this, function* () {\n const semaphore = this._getModuleSemaphore(module.id);\n\n // Atomically check-and-set under per-module semaphore to prevent race conditions.\n const deferredToAwait = yield* Effect.gen(this, function* () {\n const existing = this._moduleMemoMap.get(module.id);\n if (existing) {\n return existing;\n }\n\n // First caller - create deferred, store it, and start loading in background.\n const deferred = yield* Deferred.make<Capability.Any[], Error>();\n this._moduleMemoMap.set(module.id, deferred);\n\n const loadEffect = Effect.gen(this, function* () {\n log('loading module', { module: module.id });\n const [duration, capabilities] = yield* module\n .activate()\n .pipe(\n Effect.provideService(Capability.Service, this.capabilities),\n Effect.provideService(Plugin.Service, this),\n Effect.timed,\n );\n const normalized = capabilities == null ? [] : Array.isArray(capabilities) ? capabilities : [capabilities];\n log('loaded module', {\n module: module.id,\n elapsed: Duration.toMillis(duration),\n failed: false,\n });\n return normalized as Capability.Any[];\n }).pipe(\n Effect.withSpan('PluginManager._loadModule'),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() => log.warn(`module is taking a long time to activate`, { module: module.id })),\n ),\n ),\n ),\n );\n\n // Fork the load to run in background, completing the deferred when done.\n yield* Effect.forkDaemon(\n loadEffect.pipe(\n Effect.tap((result) => Deferred.succeed(deferred, result)),\n Effect.catchAllCause((cause) => {\n const error = Cause.squash(cause);\n log.error('module failed to activate', {\n module: module.id,\n error: error instanceof Error ? error.message : String(error),\n stack: error instanceof Error ? error.stack : undefined,\n isDefect: !Cause.isFailure(cause),\n });\n return Deferred.fail(deferred, error instanceof Error ? error : new Error(String(error)));\n }),\n ),\n );\n\n return deferred;\n }).pipe(semaphore.withPermits(1));\n\n // Wait for result outside the semaphore so multiple waiters can proceed concurrently.\n return yield* Deferred.await(deferredToAwait);\n });\n\n private _contributeCapabilities(\n module: Plugin.PluginModule,\n capabilities: Capability.Any[],\n ): Effect.Effect<void, Error> {\n return Effect.gen(this, function* () {\n capabilities.forEach((capability) => {\n this.capabilities.contribute({ module: module.id, ...capability });\n });\n this._update(this._activeAtom, (active) => [...active, module.id]);\n this._capabilities.set(module.id, capabilities);\n });\n }\n\n private _deactivateModule(module: Plugin.PluginModule): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const id = module.id;\n log('deactivating', { id });\n this._moduleMemoMap.delete(id);\n\n const capabilities = this._capabilities.get(id);\n if (capabilities) {\n for (const capability of capabilities) {\n this.capabilities.remove(capability.interface, capability.implementation);\n const program = capability.deactivate?.() ?? Effect.succeed(undefined);\n yield* program;\n }\n this._capabilities.delete(id);\n }\n\n const activeIndex = this._get(this._activeAtom).findIndex((event) => event === id);\n if (activeIndex !== -1) {\n this._update(this._activeAtom, (active) => active.filter((event) => event !== id));\n }\n\n log('deactivated', { id });\n return true;\n });\n }\n}\n\n/**\n * Creates a new Plugin Manager instance.\n */\nexport const make = (options: ManagerOptions): PluginManager => new ManagerImpl(options);\n\n/**\n * Runs an effect concurrently with another effect.\n * If the first effect completes, the second effect is interrupted.\n */\n// TODO(dmaretskyi): Effect.race > Effect.asVoid\nconst together =\n <R1>(togetherEffect: Effect.Effect<void, never, R1>) =>\n <A, E, R2>(effect: Effect.Effect<A, E, R2>): Effect.Effect<A, E, R1 | R2> =>\n Effect.gen(function* () {\n const togetherFiber = yield* Effect.fork(togetherEffect);\n const result = yield* effect;\n yield* Fiber.interrupt(togetherFiber);\n return result;\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, type Registry } from '@effect-atom/atom-react';\nimport * as Deferred from 'effect/Deferred';\nimport * as Effect from 'effect/Effect';\n\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport type * as Capability from './capability';\n\ntype CapabilityEntry<T> = {\n moduleId: string;\n implementation: T;\n};\n\n/**\n * Options for creating a capability manager.\n * @internal\n */\nexport type CapabilityManagerOptions = {\n registry: Registry.Registry;\n};\n\n/**\n * Interface for the Capability Manager.\n * Provides methods for contributing, removing, and accessing capabilities.\n */\nexport interface CapabilityManager {\n contribute<T>(args: { module: string; interface: Capability.InterfaceDef<T>; implementation: T }): void;\n\n remove<T>(interfaceDef: Capability.InterfaceDef<T>, implementation: T): void;\n\n /**\n * Get the Atom reference to the available capabilities for a given interface.\n * Primarily useful for deriving other Atom values based on the capabilities or\n * for subscribing to changes in the capabilities.\n * @returns An atom reference to the available capabilities.\n */\n atom<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<T[]>;\n\n /**\n * Get capabilities from the capability manager.\n * @returns An array of capabilities.\n */\n getAll<T>(interfaceDef: Capability.InterfaceDef<T>): T[];\n\n /**\n * Requests a single capability from the capability manager.\n * @returns The capability.\n * @throws If no capability is found.\n */\n get<T>(interfaceDef: Capability.InterfaceDef<T>): T;\n\n /**\n * Waits for a capability to be available.\n * @returns The capability.\n */\n waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error>;\n}\n\n/**\n * Internal implementation of CapabilityManager.\n */\nclass CapabilityManagerImpl implements CapabilityManager {\n private readonly _registry: Registry.Registry;\n\n private readonly _capabilityEntries = Atom.family<string, Atom.Writable<CapabilityEntry<unknown>[]>>(() => {\n return Atom.make<CapabilityEntry<unknown>[]>([]).pipe(Atom.keepAlive);\n });\n\n readonly _capabilities = Atom.family<string, Atom.Atom<unknown[]>>((id: string) => {\n return Atom.make((get) => {\n const current = get(this._capabilityEntries(id));\n return current.map((c) => c.implementation);\n });\n });\n\n readonly _capability = Atom.family<string, Atom.Atom<unknown>>((id: string) => {\n return Atom.make((get) => {\n const current = get(this._capabilities(id));\n invariant(current.length > 0, `No capability found for ${id}`);\n return current[0];\n });\n });\n\n constructor({ registry }: CapabilityManagerOptions) {\n this._registry = registry;\n }\n\n contribute<T>({\n module: moduleId,\n interface: interfaceDef,\n implementation,\n }: {\n module: string;\n interface: Capability.InterfaceDef<T>;\n implementation: T;\n }): void {\n const current = this._registry.get(this._capabilityEntries(interfaceDef.identifier));\n const isDuplicate = current.some((c) => c.moduleId === moduleId && c.implementation === implementation);\n if (isDuplicate) {\n log('capability already contributed, skipping', { id: interfaceDef.identifier, moduleId });\n return;\n }\n\n const entry: CapabilityEntry<T> = { moduleId, implementation };\n this._registry.set(this._capabilityEntries(interfaceDef.identifier), [...current, entry]);\n log('capability contributed', {\n id: interfaceDef.identifier,\n moduleId,\n count: current.length,\n });\n }\n\n remove<T>(interfaceDef: Capability.InterfaceDef<T>, implementation: T): void {\n const current = this._registry.get(this._capabilityEntries(interfaceDef.identifier));\n if (current.length === 0) {\n return;\n }\n\n const next = current.filter((c) => c.implementation !== implementation);\n if (next.length !== current.length) {\n this._registry.set(this._capabilityEntries(interfaceDef.identifier), next);\n log('capability removed', { id: interfaceDef.identifier, count: current.length });\n } else {\n log.warn('capability not removed', { id: interfaceDef.identifier });\n }\n }\n\n atom<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<T[]> {\n // NOTE: This the type-checking for capabilities is done at the time of contribution.\n return this._capabilities(interfaceDef.identifier) as Atom.Atom<T[]>;\n }\n\n getAll<T>(interfaceDef: Capability.InterfaceDef<T>): T[] {\n return this._registry.get(this.atom(interfaceDef));\n }\n\n get<T>(interfaceDef: Capability.InterfaceDef<T>): T {\n const capabilities = this.getAll(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\n }\n\n waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error> {\n return Effect.gen(this, function* () {\n const [capability] = this.getAll(interfaceDef);\n if (capability) {\n return capability;\n }\n\n const deferred = yield* Deferred.make<T, Error>();\n const cancel = this._registry.subscribe(this.atom(interfaceDef), (capabilities) => {\n if (capabilities.length > 0) {\n Effect.runSync(Deferred.succeed(deferred, capabilities[0]));\n }\n });\n const result = yield* Deferred.await(deferred);\n cancel();\n return result;\n });\n }\n}\n\n/**\n * Creates a new Capability Manager instance.\n */\nexport const make = (options: CapabilityManagerOptions): CapabilityManager => new CapabilityManagerImpl(options);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;;;;cAAAA;;AAIA,SAASC,QAAAA,OAAMC,gBAAgB;AAC/B,YAAYC,WAAW;AACvB,YAAYC,WAAW;AACvB,YAAYC,eAAc;AAC1B,YAAYC,cAAc;AAC1B,YAAYC,aAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAC1B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,SAAS;AAErB,SAASC,2BAA2B;AACpC,SAASC,OAAAA,YAAW;;;ACjBpB;;cAAAC;;AAIA,SAASC,YAA2B;AACpC,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;;AAyDpB,IAAMC,wBAAN,MAAMA;EACaC;EAEAC,qBAAqBP,KAAKQ,OAA0D,MAAA;AACnG,WAAOR,KAAKD,KAAiC,CAAA,CAAE,EAAEU,KAAKT,KAAKU,SAAS;EACtE,CAAA;EAESC,gBAAgBX,KAAKQ,OAAqC,CAACI,OAAAA;AAClE,WAAOZ,KAAKD,KAAK,CAACc,QAAAA;AAChB,YAAMC,UAAUD,IAAI,KAAKN,mBAAmBK,EAAAA,CAAAA;AAC5C,aAAOE,QAAQC,I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;QAAE1B;MAAG,GAAA;;;;;;AACzB,WAAKV,eAAeuJ,OAAO7I,EAAAA;AAE3B,YAAMtB,eAAe,KAAKU,cAAc4G,IAAIhG,EAAAA;AAC5C,UAAItB,cAAc;AAChB,mBAAWiK,cAAcjK,cAAc;AACrC,eAAKA,aAAa2D,OAAOsG,WAAWG,WAAWH,WAAWI,cAAc;AACxE,gBAAMC,UAAUL,WAAW9F,aAAU,KAAeiF,gBAAQQ,MAAAA;AAC5D,iBAAOU;QACT;AACA,aAAK5J,cAAcyJ,OAAO7I,EAAAA;MAC5B;AAEA,YAAMiJ,cAAc,KAAKhI,KAAK,KAAKjC,WAAW,EAAE0D,UAAU,CAACR,UAAUA,UAAUlC,EAAAA;AAC/E,UAAIiJ,gBAAgB,IAAI;AACtB,aAAKrH,QAAQ,KAAK5C,aAAa,CAAC6B,WAAWA,OAAO8B,OAAO,CAACT,UAAUA,UAAUlC,EAAAA,CAAAA;MAChF;AAEA0B,MAAAA,KAAI,eAAe;QAAE1B;MAAG,GAAA;;;;;;AACxB,aAAO;IACT,CAAA;EACF;AACF;AAKO,IAAMP,QAAO,CAACyJ,YAA2C,IAAI5K,YAAY4K,OAAAA;AAOhF,IAAMxE,WACJ,CAAKyE,mBACL,CAAWC,WACF3H,YAAI,aAAA;AACT,QAAM4H,gBAAgB,OAAcC,aAAKH,cAAAA;AACzC,QAAM7G,SAAS,OAAO8G;AACtB,SAAaG,gBAAUF,aAAAA;AACvB,SAAO/G;AACT,CAAA;",
|
|
6
|
-
"names": ["make", "Atom", "Registry", "Array", "Cause", "Deferred", "Duration", "Effect", "Fiber", "Function", "HashSet", "PubSub", "Ref", "runAndForwardErrors", "log", "make", "Atom", "Deferred", "Effect", "invariant", "log", "CapabilityManagerImpl", "_registry", "_capabilityEntries", "family", "pipe", "keepAlive", "_capabilities", "id", "get", "current", "map", "c", "implementation", "_capability", "length", "registry", "contribute", "module", "moduleId", "interface", "interfaceDef", "identifier", "isDuplicate", "some", "entry", "set", "count", "remove", "next", "filter", "warn", "atom", "getAll", "capabilities", "waitFor", "gen", "capability", "deferred", "cancel", "subscribe", "runSync", "succeed", "result", "await", "options", "ManagerTypeId", "Symbol", "for", "isManager", "value", "ManagerImpl", "activation", "runSync", "unbounded", "capabilities", "registry", "_pluginsAtom", "_coreAtom", "_enabledAtom", "_modulesAtom", "_activeAtom", "_eventsFiredAtom", "_pendingResetAtom", "_pluginLoader", "_capabilities", "Map", "_moduleMemoMap", "_moduleSemaphores", "_activatingEvents", "make", "_activatingModules", "pluginLoader", "plugins", "core", "map", "meta", "id", "enabled", "Registry", "Atom", "pipe", "keepAlive", "forEach", "plugin", "_addPlugin", "all", "enable", "runAndForwardErrors", "modules", "active", "eventsFired", "pendingReset", "getPlugins", "_get", "getCore", "getEnabled", "getModules", "getActive", "getEventsFired", "getPendingReset", "add", "gen", "log", "_getPlugin", "_update", "includes", "module", "_addModule", "_setPendingResetByModule", "events", "event", "activate", "concurrency", "remove", "result", "disable", "_removePlugin", "enabledIndex", "findIndex", "filter", "item", "deactivate", "_removeModule", "params", "key", "eventKey", "update", "activating", "append", "pendingIndex", "pending", "activatingEvents", "activatingModules", "_getInactiveModulesByEvent", "allOf", "isAllOf", "activatesOn", "getEvents", "every", "appendAll", "length", "publish", "state", "beforeEvents", "flatMap", "activatesBefore", "fromIterable", "toValues", "before", "allWith", "together", "sleep", "seconds", "andThen", "sync", "warn", "getCapabilities", "mod", "_loadModule", "catchAll", "error", "fail", "zip", "_contributeCapabilities", "afterEvents", "activatesAfter", "after", "results", "_deactivateModule", "reset", "_getActiveModulesByEvent", "atom", "get", "_set", "set", "updater", "find", "_getActiveModules", "_getInactiveModules", "activationEvents", "Set", "current", "_getModuleSemaphore", "moduleId", "semaphore", "makeSemaphore", "deferredToAwait", "existing", "deferred", "loadEffect", "duration", "provideService", "Service", "timed", "normalized", "isArray", "elapsed", "toMillis", "failed", "withSpan", "forkDaemon", "tap", "succeed", "catchAllCause", "cause", "squash", "Error", "message", "String", "stack", "undefined", "isDefect", "isFailure", "withPermits", "await", "capability", "contribute", "delete", "interface", "implementation", "program", "activeIndex", "options", "togetherEffect", "effect", "togetherFiber", "fork", "interrupt"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/invoker-capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationInvoker } from '@dxos/operation';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Capability, Plugin } from '../core';\n\n//\n// Capability Module\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the services for synchronous access in callbacks.\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n // Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).\n const managedRuntimes = yield* Capability.getAll(Capabilities.ManagedRuntime);\n const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : undefined;\n\n const invoker = OperationInvoker.make(\n () =>\n Effect.gen(function* () {\n yield* Plugin.activate(ActivationEvents.SetupOperationResolver);\n return (yield* Capability.getAll(Capabilities.OperationResolver)).flat();\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n ),\n managedRuntime,\n );\n\n return Capability.contributes(Capabilities.OperationInvoker, invoker);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AASjC,IAAA,6BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAC5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,QAAMG,kBAAkB,OAAOP,mBAAWQ,OAAOC,qBAAaC,cAAc;AAC5E,QAAMC,iBAAiBJ,gBAAgBK,SAAS,IAAIL,gBAAgB,CAAA,IAAKM;AAEzE,QAAMC,UAAUC,iBAAiBC,KAC/B,MACSC,WAAI,aAAA;AACT,WAAOX,eAAOY,SAASC,0BAAiBC,sBAAsB;AAC9D,YAAQ,OAAOpB,mBAAWQ,OAAOC,qBAAaY,iBAAiB,GAAGC,KAAI;EACxE,CAAA,EAAGC,KACMC,sBAAexB,mBAAWI,SAASD,iBAAAA,GACnCqB,sBAAelB,eAAOF,SAASC,aAAAA,CAAAA,GAE1CM,cAAAA;AAGF,SAAOX,mBAAWyB,YAAYhB,qBAAaM,kBAAkBD,OAAAA;AAC/D,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "OperationInvoker", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "managedRuntimes", "getAll", "Capabilities", "ManagedRuntime", "managedRuntime", "length", "undefined", "invoker", "OperationInvoker", "make", "gen", "activate", "ActivationEvents", "SetupOperationResolver", "OperationResolver", "flat", "pipe", "provideService", "contributes"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/App.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAItD,OAAO,EAAgB,KAAK,aAAa,EAA+B,MAAM,UAAU,CAAC;AAEzF,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG;IACvE,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,sDAAsD,QAAQ,6BA2BjF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.stories.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/App.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,MAAM,OAAO,CAAC;AA0C1B,QAAA,MAAM,IAAI;;;;;;;CAOM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFallback.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/DefaultFallback.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,sBAgB1D,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
-
type State = {
|
|
3
|
-
error: Error | undefined;
|
|
4
|
-
};
|
|
5
|
-
export type ErrorBoundaryProps = PropsWithChildren<{
|
|
6
|
-
data?: any;
|
|
7
|
-
fallback?: FC<{
|
|
8
|
-
data?: any;
|
|
9
|
-
error: Error;
|
|
10
|
-
}>;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* Surface error boundary.
|
|
14
|
-
* For basic usage prefer providing a fallback component to `Surface`.
|
|
15
|
-
*
|
|
16
|
-
* Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
|
|
17
|
-
*/
|
|
18
|
-
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
|
|
19
|
-
static getDerivedStateFromError(error: Error): {
|
|
20
|
-
error: Error;
|
|
21
|
-
};
|
|
22
|
-
state: {
|
|
23
|
-
error: undefined;
|
|
24
|
-
};
|
|
25
|
-
componentDidUpdate(prevProps: ErrorBoundaryProps): void;
|
|
26
|
-
render(): ReactNode;
|
|
27
|
-
private resetError;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1F,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,EAAE,CAAC;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC;IACrE,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE;IAItD,KAAK;;MAAwB;IAE7B,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAMvD,MAAM,IAAI,SAAS;IAS5B,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginManagerContext.stories.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/PluginManagerContext.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAoK5D,QAAA,MAAM,IAAI;;;;;;;CAOM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginManagerProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/PluginManagerProvider.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aAAa,CAAC,aACoC,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,qBAAqB,mEAAgC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type NamedExoticComponent, type RefAttributes } from 'react';
|
|
2
|
-
import { type CapabilityManager } from '../../../core';
|
|
3
|
-
import { type Props } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* A surface is a named region of the screen that can be populated by plugins.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Surface: NamedExoticComponent<Props & RefAttributes<HTMLElement>>;
|
|
8
|
-
/**
|
|
9
|
-
* @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.
|
|
10
|
-
*/
|
|
11
|
-
export declare const isSurfaceAvailable: (capabilityManager: CapabilityManager.CapabilityManager, { role, data }: Pick<Props, "role" | "data">) => boolean;
|
|
12
|
-
//# sourceMappingURL=SurfaceComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/surface/SurfaceComponent.tsx"],"names":[],"mappings":"AAIA,OAAc,EAEZ,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAOnB,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMvD,OAAO,EAAmB,KAAK,KAAK,EAA+B,MAAM,SAAS,CAAC;AAyInF;;GAEG;AAEH,eAAO,MAAM,OAAO,EAAE,oBAAoB,CAAC,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC,CAoC5E,CAAC;AA8CF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,mBAAmB,iBAAiB,CAAC,iBAAiB,EACtD,gBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,YAK7C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceComponent.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/surface/SurfaceComponent.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA+D,MAAM,OAAO,CAAC;AA2HpF,QAAA,MAAM,IAAI;;;;;;;CAO2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/surface/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EAAE,cAAc,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -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":"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AAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;CACvD,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE7G;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EACxD,YAAY,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAC3C,eAAe,CAAC,CAAC,CAAuC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAC3D,YAAY,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAClD,sBAAsB,CAAC,CAAC,CAA+C,CAAC"}
|
|
@@ -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,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
|
-
};
|