@dxos/app-framework 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/{capability-7RLVE42K.mjs → capability-K5XIVCQU.mjs} +12 -11
- package/dist/lib/browser/capability-K5XIVCQU.mjs.map +7 -0
- package/dist/lib/browser/chunk-5AHASNDW.mjs +95 -0
- package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-66IXTIVK.mjs} +3 -2
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZRWBPIZG.mjs → chunk-BRK6GYNB.mjs} +14 -42
- package/dist/lib/browser/chunk-BRK6GYNB.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-YNFPIQGB.mjs → chunk-IW44C7UL.mjs} +9 -2
- package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5RJNZV7K.mjs → chunk-KFDF7KR3.mjs} +11 -13
- package/dist/lib/browser/{chunk-5RJNZV7K.mjs.map → chunk-KFDF7KR3.mjs.map} +3 -3
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs +422 -0
- package/dist/lib/browser/chunk-KLHQNYJ2.mjs.map +7 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs +581 -0
- package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FNKT2QQ2.mjs → chunk-SLX73WRZ.mjs} +90 -17
- package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs +513 -0
- package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs +1446 -0
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +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-JIWLN7SU.mjs +89 -0
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +199 -56
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/testing/react.mjs +78 -0
- package/dist/lib/browser/testing/react.mjs.map +7 -0
- package/dist/lib/browser/ui/index.mjs +24 -15
- package/dist/lib/node-esm/{capability-EVZK4REM.mjs → capability-RLKFFLTB.mjs} +12 -11
- package/dist/lib/node-esm/capability-RLKFFLTB.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-CJCQS2YL.mjs → chunk-6S45OMUP.mjs} +90 -17
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2A4PRBIX.mjs → chunk-BYHYYJZH.mjs} +14 -42
- package/dist/lib/node-esm/chunk-BYHYYJZH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SB5ODNPX.mjs → chunk-CTKEZHKF.mjs} +9 -2
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs +514 -0
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs +582 -0
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VUIUFIGT.mjs → chunk-OUEMWPIW.mjs} +11 -13
- package/dist/lib/node-esm/{chunk-VUIUFIGT.mjs.map → chunk-OUEMWPIW.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs +96 -0
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs +1447 -0
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-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-PHKLO2BL.mjs +90 -0
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +199 -56
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/testing/react.mjs +79 -0
- package/dist/lib/node-esm/testing/react.mjs.map +7 -0
- package/dist/lib/node-esm/ui/index.mjs +24 -15
- 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 +13 -2
- 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.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/App.d.ts +3 -2
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.stories.d.ts +2 -2
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
- 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 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +16 -4
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/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/index.d.ts +22 -6
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/types.d.ts +110 -9
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
- 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 +1 -0
- 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 +47 -11
- 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 +24 -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/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 +15 -0
- package/package.json +53 -54
- 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 +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 +20 -2
- 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 +1170 -198
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +194 -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 -20
- package/src/ui/components/App/App.stories.tsx +7 -13
- package/src/ui/components/App/App.tsx +29 -5
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
- package/src/{plugin-runtime → ui/components/Placeholder}/index.ts +1 -1
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +8 -7
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +16 -15
- package/src/ui/components/Surface/SurfaceComponent.tsx +111 -55
- package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
- package/src/ui/components/Surface/index.ts +35 -1
- package/src/ui/components/Surface/types.test.ts +126 -0
- package/src/ui/components/Surface/types.ts +164 -12
- package/src/ui/components/index.ts +1 -0
- package/src/ui/hooks/index.ts +1 -1
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +229 -24
- package/src/ui/hooks/useLoading.tsx +14 -6
- package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
- package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
- package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
- package/src/vite-plugin/boot-loader/index.ts +5 -0
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/composer/index.ts +306 -0
- package/src/vite-plugin/import-map/index.ts +527 -0
- package/src/vite-plugin/index.ts +10 -0
- package/src/vite-plugin/manifest.test.ts +46 -0
- package/src/vite-plugin/manifest.ts +57 -0
- package/src/vite-plugin/packages.ts +187 -0
- package/tsconfig.json +25 -1
- package/tsconfig.node.json +1 -1
- 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-2GL5JAGJ.mjs +0 -37
- package/dist/lib/browser/capability-2GL5JAGJ.mjs.map +0 -7
- package/dist/lib/browser/capability-7RLVE42K.mjs.map +0 -7
- package/dist/lib/browser/chunk-4CTRO67U.mjs +0 -703
- package/dist/lib/browser/chunk-4CTRO67U.mjs.map +0 -7
- package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
- package/dist/lib/browser/chunk-FNKT2QQ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-HE27PNNQ.mjs +0 -824
- package/dist/lib/browser/chunk-HE27PNNQ.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-REORGDJT.mjs +0 -80
- package/dist/lib/browser/chunk-REORGDJT.mjs.map +0 -7
- package/dist/lib/browser/chunk-YAFEA4GV.mjs +0 -1
- package/dist/lib/browser/chunk-YNFPIQGB.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZRWBPIZG.mjs.map +0 -7
- package/dist/lib/browser/invoker-capability-BNLVNYHU.mjs +0 -36
- package/dist/lib/browser/invoker-capability-BNLVNYHU.mjs.map +0 -7
- package/dist/lib/node-esm/capability-CHIMU6LX.mjs +0 -38
- package/dist/lib/node-esm/capability-CHIMU6LX.mjs.map +0 -7
- package/dist/lib/node-esm/capability-EVZK4REM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2A4PRBIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7CPNAEGV.mjs +0 -704
- package/dist/lib/node-esm/chunk-7CPNAEGV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CJCQS2YL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DTCHT2X2.mjs +0 -825
- package/dist/lib/node-esm/chunk-DTCHT2X2.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-SB5ODNPX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UFW652GS.mjs +0 -81
- package/dist/lib/node-esm/chunk-UFW652GS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +0 -2
- package/dist/lib/node-esm/invoker-capability-VF6SP44V.mjs +0 -37
- package/dist/lib/node-esm/invoker-capability-VF6SP44V.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.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/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/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/capability.d.ts +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/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
|
@@ -1,703 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PluginManagerContext
|
|
3
|
-
} from "./chunk-FHQTHCX7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
capabilities_exports
|
|
6
|
-
} from "./chunk-REORGDJT.mjs";
|
|
7
|
-
import {
|
|
8
|
-
activation_events_exports
|
|
9
|
-
} from "./chunk-NPUEVX42.mjs";
|
|
10
|
-
import {
|
|
11
|
-
plugin_manager_exports
|
|
12
|
-
} from "./chunk-HE27PNNQ.mjs";
|
|
13
|
-
|
|
14
|
-
// src/ui/components/App/App.tsx
|
|
15
|
-
import React2 from "react";
|
|
16
|
-
|
|
17
|
-
// src/helpers.ts
|
|
18
|
-
var topologicalSort = (nodes) => {
|
|
19
|
-
const getDependencies = (nodeId, seen = /* @__PURE__ */ new Set(), path = /* @__PURE__ */ new Set()) => {
|
|
20
|
-
if (path.has(nodeId)) {
|
|
21
|
-
throw new Error(`Circular dependency detected involving ${nodeId}`);
|
|
22
|
-
}
|
|
23
|
-
if (seen.has(nodeId)) {
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
const node = nodes.find((n) => n.id === nodeId);
|
|
27
|
-
if (!node) {
|
|
28
|
-
throw new Error(`Node ${nodeId} not found but is listed as a dependency`);
|
|
29
|
-
}
|
|
30
|
-
const newPath = /* @__PURE__ */ new Set([
|
|
31
|
-
...path,
|
|
32
|
-
nodeId
|
|
33
|
-
]);
|
|
34
|
-
const newSeen = /* @__PURE__ */ new Set([
|
|
35
|
-
...seen,
|
|
36
|
-
nodeId
|
|
37
|
-
]);
|
|
38
|
-
const dependsOn = node.dependsOn ?? [];
|
|
39
|
-
return [
|
|
40
|
-
...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)),
|
|
41
|
-
nodeId
|
|
42
|
-
];
|
|
43
|
-
};
|
|
44
|
-
const allDependencies = nodes.map((node) => node.id).flatMap((id) => getDependencies(id)).filter((id, index, self) => self.indexOf(id) === index);
|
|
45
|
-
return allDependencies.map((id) => nodes.find((node) => node.id === id)).filter((node) => node !== void 0);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/ui/hooks/useApp.tsx
|
|
49
|
-
import { RegistryContext } from "@effect-atom/atom-react";
|
|
50
|
-
import * as Effect from "effect/Effect";
|
|
51
|
-
import * as Fiber from "effect/Fiber";
|
|
52
|
-
import * as PubSub from "effect/PubSub";
|
|
53
|
-
import * as Queue from "effect/Queue";
|
|
54
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
55
|
-
import { runAndForwardErrors } from "@dxos/effect";
|
|
56
|
-
import { invariant } from "@dxos/invariant";
|
|
57
|
-
import { log } from "@dxos/log";
|
|
58
|
-
import { ErrorBoundary, ErrorFallback } from "@dxos/react-error-boundary";
|
|
59
|
-
import { useAsyncEffect, useDefaultValue } from "@dxos/react-hooks";
|
|
60
|
-
import { ContextProtocolProvider } from "@dxos/web-context-react";
|
|
61
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/ui/hooks/useApp.tsx";
|
|
62
|
-
var ENABLED_KEY = "dxos.org/app-framework/enabled";
|
|
63
|
-
var useApp = ({ pluginManager, pluginLoader: pluginLoaderProp, plugins: pluginsProp, core: coreProp, defaults: defaultsProp, setupEvents: setupEventsProp, placeholder, fallback = ErrorFallback, cacheEnabled = false, safeMode = false, debounce = 0, timeout = 3e4 }) => {
|
|
64
|
-
const plugins = useDefaultValue(pluginsProp, () => []);
|
|
65
|
-
const core = useDefaultValue(coreProp, () => plugins.map(({ meta }) => meta.id));
|
|
66
|
-
const defaults = useDefaultValue(defaultsProp, () => []);
|
|
67
|
-
const setupEvents = useDefaultValue(setupEventsProp, () => []);
|
|
68
|
-
const pluginLoader = useMemo(() => pluginLoaderProp ?? ((id) => Effect.sync(() => {
|
|
69
|
-
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
70
|
-
invariant(plugin, `Plugin not found: ${id}`, {
|
|
71
|
-
F: __dxlog_file,
|
|
72
|
-
L: 96,
|
|
73
|
-
S: void 0,
|
|
74
|
-
A: [
|
|
75
|
-
"plugin",
|
|
76
|
-
"`Plugin not found: ${id}`"
|
|
77
|
-
]
|
|
78
|
-
});
|
|
79
|
-
return plugin;
|
|
80
|
-
})), [
|
|
81
|
-
pluginLoaderProp,
|
|
82
|
-
plugins
|
|
83
|
-
]);
|
|
84
|
-
const readyRef = useRef(false);
|
|
85
|
-
const [ready, setReady] = useState(false);
|
|
86
|
-
const errorRef = useRef(null);
|
|
87
|
-
const [error, setError] = useState(null);
|
|
88
|
-
const cached = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? "[]"), []);
|
|
89
|
-
const enabled = useMemo(() => safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults, [
|
|
90
|
-
safeMode,
|
|
91
|
-
cacheEnabled,
|
|
92
|
-
cached,
|
|
93
|
-
defaults
|
|
94
|
-
]);
|
|
95
|
-
const manager = useMemo(() => pluginManager ?? plugin_manager_exports.make({
|
|
96
|
-
pluginLoader,
|
|
97
|
-
plugins,
|
|
98
|
-
core,
|
|
99
|
-
enabled
|
|
100
|
-
}), [
|
|
101
|
-
pluginManager,
|
|
102
|
-
pluginLoader,
|
|
103
|
-
plugins,
|
|
104
|
-
core,
|
|
105
|
-
enabled
|
|
106
|
-
]);
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (!cacheEnabled) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
return manager.registry.subscribe(manager.enabled, (value) => {
|
|
112
|
-
localStorage.setItem(ENABLED_KEY, JSON.stringify(value));
|
|
113
|
-
});
|
|
114
|
-
}, [
|
|
115
|
-
cacheEnabled,
|
|
116
|
-
manager
|
|
117
|
-
]);
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
setupDevtools(manager);
|
|
120
|
-
}, [
|
|
121
|
-
manager
|
|
122
|
-
]);
|
|
123
|
-
useAsyncEffect(async () => {
|
|
124
|
-
manager.capabilities.contribute({
|
|
125
|
-
interface: capabilities_exports.PluginManager,
|
|
126
|
-
implementation: manager,
|
|
127
|
-
module: "dxos.org/app-framework/plugin-manager"
|
|
128
|
-
});
|
|
129
|
-
manager.capabilities.contribute({
|
|
130
|
-
interface: capabilities_exports.AtomRegistry,
|
|
131
|
-
implementation: manager.registry,
|
|
132
|
-
module: "dxos.org/app-framework/atom-registry"
|
|
133
|
-
});
|
|
134
|
-
const fiber = Effect.gen(function* () {
|
|
135
|
-
const queue = yield* PubSub.subscribe(manager.activation);
|
|
136
|
-
const listener = yield* Effect.forkDaemon(Queue.take(queue).pipe(Effect.tap(({ event, state, error: error$ }) => Effect.sync(() => {
|
|
137
|
-
if (event === activation_events_exports.Startup.id && state === "activated") {
|
|
138
|
-
clearTimeout(timeoutId);
|
|
139
|
-
setReady(true);
|
|
140
|
-
readyRef.current = true;
|
|
141
|
-
}
|
|
142
|
-
if (error$ && !readyRef.current) {
|
|
143
|
-
setError(error$);
|
|
144
|
-
errorRef.current = error$;
|
|
145
|
-
}
|
|
146
|
-
})), Effect.forever));
|
|
147
|
-
yield* Effect.all([
|
|
148
|
-
...setupEvents.map((event) => manager.activate(event)),
|
|
149
|
-
manager.activate(activation_events_exports.SetupReactSurface),
|
|
150
|
-
manager.activate(activation_events_exports.Startup)
|
|
151
|
-
]);
|
|
152
|
-
return yield* Fiber.join(listener);
|
|
153
|
-
}).pipe(Effect.scoped, Effect.runFork);
|
|
154
|
-
const timeoutId = setTimeout(() => {
|
|
155
|
-
if (!readyRef.current && !errorRef.current) {
|
|
156
|
-
log.warn("startup timeout diagnostic", {
|
|
157
|
-
eventsFired: manager.getEventsFired(),
|
|
158
|
-
activeModules: manager.getActive(),
|
|
159
|
-
pendingReset: manager.getPendingReset()
|
|
160
|
-
}, {
|
|
161
|
-
F: __dxlog_file,
|
|
162
|
-
L: 176,
|
|
163
|
-
S: void 0,
|
|
164
|
-
C: (f, a) => f(...a)
|
|
165
|
-
});
|
|
166
|
-
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
167
|
-
setError(new Error(`Startup timed out after ${timeout}ms`));
|
|
168
|
-
}
|
|
169
|
-
}, timeout);
|
|
170
|
-
return () => {
|
|
171
|
-
clearTimeout(timeoutId);
|
|
172
|
-
void runAndForwardErrors(Fiber.interrupt(fiber));
|
|
173
|
-
manager.capabilities.remove(capabilities_exports.PluginManager, manager);
|
|
174
|
-
manager.capabilities.remove(capabilities_exports.AtomRegistry, manager.registry);
|
|
175
|
-
};
|
|
176
|
-
}, [
|
|
177
|
-
manager
|
|
178
|
-
]);
|
|
179
|
-
return useCallback(() => /* @__PURE__ */ React.createElement(ErrorBoundary, {
|
|
180
|
-
name: "app",
|
|
181
|
-
FallbackComponent: fallback
|
|
182
|
-
}, /* @__PURE__ */ React.createElement(PluginManagerProvider, {
|
|
183
|
-
value: manager
|
|
184
|
-
}, /* @__PURE__ */ React.createElement(ContextProtocolProvider, {
|
|
185
|
-
value: manager,
|
|
186
|
-
context: PluginManagerContext
|
|
187
|
-
}, /* @__PURE__ */ React.createElement(RegistryContext.Provider, {
|
|
188
|
-
value: manager.registry
|
|
189
|
-
}, /* @__PURE__ */ React.createElement(App, {
|
|
190
|
-
placeholder,
|
|
191
|
-
ready,
|
|
192
|
-
error,
|
|
193
|
-
debounce
|
|
194
|
-
}))))), [
|
|
195
|
-
fallback,
|
|
196
|
-
manager,
|
|
197
|
-
placeholder,
|
|
198
|
-
ready,
|
|
199
|
-
error
|
|
200
|
-
]);
|
|
201
|
-
};
|
|
202
|
-
var setupDevtools = (manager) => {
|
|
203
|
-
globalThis.composer ??= {};
|
|
204
|
-
globalThis.composer.manager = manager;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/ui/hooks/useCapabilities.ts
|
|
208
|
-
import { useAtomValue } from "@effect-atom/atom-react";
|
|
209
|
-
import { useCallback as useCallback2 } from "react";
|
|
210
|
-
import { invariant as invariant2 } from "@dxos/invariant";
|
|
211
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-framework/src/ui/hooks/useCapabilities.ts";
|
|
212
|
-
var useCapabilities = (interfaceDef) => {
|
|
213
|
-
const manager = usePluginManager();
|
|
214
|
-
return useAtomValue(manager.capabilities.atom(interfaceDef));
|
|
215
|
-
};
|
|
216
|
-
var useCapability = (interfaceDef) => {
|
|
217
|
-
const capabilities = useCapabilities(interfaceDef);
|
|
218
|
-
invariant2(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`, {
|
|
219
|
-
F: __dxlog_file2,
|
|
220
|
-
L: 30,
|
|
221
|
-
S: void 0,
|
|
222
|
-
A: [
|
|
223
|
-
"capabilities.length > 0",
|
|
224
|
-
"`No capability found for ${interfaceDef.identifier}`"
|
|
225
|
-
]
|
|
226
|
-
});
|
|
227
|
-
return capabilities[0];
|
|
228
|
-
};
|
|
229
|
-
var useAtomCapability = (atomCapability) => {
|
|
230
|
-
const atom = useCapability(atomCapability);
|
|
231
|
-
return useAtomValue(atom);
|
|
232
|
-
};
|
|
233
|
-
var useAtomCapabilityState = (atomCapability) => {
|
|
234
|
-
const registry = useCapability(capabilities_exports.AtomRegistry);
|
|
235
|
-
const atom = useCapability(atomCapability);
|
|
236
|
-
const value = useAtomValue(atom);
|
|
237
|
-
const update = useCallback2((fn) => {
|
|
238
|
-
registry.set(atom, fn(registry.get(atom)));
|
|
239
|
-
}, [
|
|
240
|
-
registry,
|
|
241
|
-
atom
|
|
242
|
-
]);
|
|
243
|
-
return [
|
|
244
|
-
value,
|
|
245
|
-
update
|
|
246
|
-
];
|
|
247
|
-
};
|
|
248
|
-
var useOperationInvoker = () => useCapability(capabilities_exports.OperationInvoker);
|
|
249
|
-
|
|
250
|
-
// src/ui/hooks/useLoading.tsx
|
|
251
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
252
|
-
var LoadingState = /* @__PURE__ */ (function(LoadingState2) {
|
|
253
|
-
LoadingState2[LoadingState2["Loading"] = 0] = "Loading";
|
|
254
|
-
LoadingState2[LoadingState2["FadeIn"] = 1] = "FadeIn";
|
|
255
|
-
LoadingState2[LoadingState2["FadeOut"] = 2] = "FadeOut";
|
|
256
|
-
LoadingState2[LoadingState2["Done"] = 3] = "Done";
|
|
257
|
-
return LoadingState2;
|
|
258
|
-
})({});
|
|
259
|
-
var useLoading = (ready, debounce = 0) => {
|
|
260
|
-
const [stage, setStage] = useState2(0);
|
|
261
|
-
useEffect2(() => {
|
|
262
|
-
if (!debounce) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const i = setInterval(() => {
|
|
266
|
-
setStage((stage2) => {
|
|
267
|
-
switch (stage2) {
|
|
268
|
-
case 0: {
|
|
269
|
-
if (!ready) {
|
|
270
|
-
return 1;
|
|
271
|
-
} else {
|
|
272
|
-
clearInterval(i);
|
|
273
|
-
return 3;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
case 1: {
|
|
277
|
-
if (ready) {
|
|
278
|
-
return 2;
|
|
279
|
-
}
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
case 2: {
|
|
283
|
-
clearInterval(i);
|
|
284
|
-
return 3;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return stage2;
|
|
288
|
-
});
|
|
289
|
-
}, debounce);
|
|
290
|
-
return () => clearInterval(i);
|
|
291
|
-
}, [
|
|
292
|
-
debounce
|
|
293
|
-
]);
|
|
294
|
-
if (!debounce) {
|
|
295
|
-
return ready ? 3 : 0;
|
|
296
|
-
}
|
|
297
|
-
return stage;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
// src/ui/hooks/useOperationResolver.ts
|
|
301
|
-
import { useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
302
|
-
var useOperationResolver = (module, resolver) => {
|
|
303
|
-
const manager = usePluginManager();
|
|
304
|
-
const resolverArray = useMemo2(() => [
|
|
305
|
-
resolver
|
|
306
|
-
], [
|
|
307
|
-
resolver
|
|
308
|
-
]);
|
|
309
|
-
useEffect3(() => {
|
|
310
|
-
manager.capabilities.contribute({
|
|
311
|
-
module,
|
|
312
|
-
interface: capabilities_exports.OperationResolver,
|
|
313
|
-
implementation: resolverArray
|
|
314
|
-
});
|
|
315
|
-
return () => manager.capabilities.remove(capabilities_exports.OperationResolver, resolverArray);
|
|
316
|
-
}, [
|
|
317
|
-
module,
|
|
318
|
-
resolverArray
|
|
319
|
-
]);
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
// src/ui/hooks/useSettingsState.ts
|
|
323
|
-
import { RegistryContext as RegistryContext2, useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
|
|
324
|
-
import { useCallback as useCallback3, useContext } from "react";
|
|
325
|
-
var useSettingsState = (atom) => {
|
|
326
|
-
const registry = useContext(RegistryContext2);
|
|
327
|
-
const settings = useAtomValue2(atom);
|
|
328
|
-
const updateSettings = useCallback3((fn) => {
|
|
329
|
-
registry.set(atom, fn(registry.get(atom)));
|
|
330
|
-
}, [
|
|
331
|
-
registry,
|
|
332
|
-
atom
|
|
333
|
-
]);
|
|
334
|
-
return {
|
|
335
|
-
settings,
|
|
336
|
-
updateSettings
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
// src/ui/hooks/useSurface.ts
|
|
341
|
-
import { useContext as useContext2 } from "react";
|
|
342
|
-
import { raise } from "@dxos/debug";
|
|
343
|
-
var useSurface = () => {
|
|
344
|
-
return useContext2(Surface.Context) ?? raise(new Error("Missing SurfaceContext"));
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
// src/ui/components/App/App.tsx
|
|
348
|
-
var App = ({ placeholder: Placeholder, ready, error, debounce }) => {
|
|
349
|
-
const reactContexts = useCapabilities(capabilities_exports.ReactContext);
|
|
350
|
-
const reactRoots = useCapabilities(capabilities_exports.ReactRoot);
|
|
351
|
-
const stage = useLoading(ready, debounce);
|
|
352
|
-
if (error) {
|
|
353
|
-
throw error;
|
|
354
|
-
}
|
|
355
|
-
if (stage < LoadingState.Done) {
|
|
356
|
-
if (!Placeholder) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
return /* @__PURE__ */ React2.createElement(Placeholder, {
|
|
360
|
-
stage
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
const ComposedContext = composeContexts(reactContexts);
|
|
364
|
-
return /* @__PURE__ */ React2.createElement(ComposedContext, null, reactRoots.map(({ id, root: Component }) => /* @__PURE__ */ React2.createElement(Component, {
|
|
365
|
-
key: id
|
|
366
|
-
})));
|
|
367
|
-
};
|
|
368
|
-
var composeContexts = (contexts) => {
|
|
369
|
-
if (contexts.length === 0) {
|
|
370
|
-
return ({ children }) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, children);
|
|
371
|
-
}
|
|
372
|
-
return topologicalSort(contexts).map(({ context }) => context).reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React2.createElement(Acc, null, /* @__PURE__ */ React2.createElement(Next, null, children)));
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
// src/ui/components/PluginManager/PluginManagerProvider.ts
|
|
376
|
-
import { createContext, useContext as useContext3 } from "react";
|
|
377
|
-
import { raise as raise2 } from "@dxos/debug";
|
|
378
|
-
var PluginManagerContext2 = createContext(void 0);
|
|
379
|
-
var usePluginManager = () => useContext3(PluginManagerContext2) ?? raise2(new Error("Missing PluginManagerContext"));
|
|
380
|
-
var PluginManagerProvider = PluginManagerContext2.Provider;
|
|
381
|
-
|
|
382
|
-
// src/ui/components/Surface/context.ts
|
|
383
|
-
import { createContext as createContext2 } from "react";
|
|
384
|
-
var SurfaceContext = createContext2(void 0);
|
|
385
|
-
|
|
386
|
-
// src/ui/components/Surface/SurfaceComponent.tsx
|
|
387
|
-
import React4, { Fragment, Suspense, forwardRef as forwardRef2, memo, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
388
|
-
import { log as log2 } from "@dxos/log";
|
|
389
|
-
import { ErrorBoundary as ErrorBoundary2 } from "@dxos/react-error-boundary";
|
|
390
|
-
import { useDefaultValue as useDefaultValue2 } from "@dxos/react-hooks";
|
|
391
|
-
import { byPosition } from "@dxos/util";
|
|
392
|
-
|
|
393
|
-
// src/ui/components/Surface/SurfaceInfo.tsx
|
|
394
|
-
import React3, { cloneElement, forwardRef, useCallback as useCallback4, useLayoutEffect, useState as useState3 } from "react";
|
|
395
|
-
import { createPortal } from "react-dom";
|
|
396
|
-
import { addEventListener, combine } from "@dxos/async";
|
|
397
|
-
import { useMergeRefs } from "@dxos/react-hooks";
|
|
398
|
-
var SurfaceInfo = /* @__PURE__ */ forwardRef(({ children }, forwardedRef) => {
|
|
399
|
-
const [rect, setRect] = useState3(null);
|
|
400
|
-
const [expand, setExpand] = useState3(false);
|
|
401
|
-
const info = useSurface();
|
|
402
|
-
const [root, setRoot] = useState3(null);
|
|
403
|
-
const measureRef = useCallback4((node) => setRoot(node), []);
|
|
404
|
-
const mergedRef = useMergeRefs([
|
|
405
|
-
measureRef,
|
|
406
|
-
forwardedRef
|
|
407
|
-
]);
|
|
408
|
-
const childWithRef = /* @__PURE__ */ cloneElement(children, {
|
|
409
|
-
ref: mergedRef
|
|
410
|
-
});
|
|
411
|
-
useLayoutEffect(() => {
|
|
412
|
-
if (!root) {
|
|
413
|
-
setRect(null);
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
const measure = () => {
|
|
417
|
-
setRect(root.getBoundingClientRect());
|
|
418
|
-
};
|
|
419
|
-
const observer = new ResizeObserver(measure);
|
|
420
|
-
observer.observe(root);
|
|
421
|
-
measure();
|
|
422
|
-
return combine(addEventListener(window, "scroll", measure, true), addEventListener(window, "resize", measure), () => {
|
|
423
|
-
observer.disconnect();
|
|
424
|
-
});
|
|
425
|
-
}, [
|
|
426
|
-
root
|
|
427
|
-
]);
|
|
428
|
-
const padding = 0;
|
|
429
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, childWithRef, rect && /* @__PURE__ */ createPortal(
|
|
430
|
-
/* @__PURE__ */ React3.createElement("div", {
|
|
431
|
-
role: "none",
|
|
432
|
-
className: "z-[100] fixed flex flex-col-reverse scrollbar-none overflow-auto pointer-events-none",
|
|
433
|
-
style: {
|
|
434
|
-
top: rect.top + padding,
|
|
435
|
-
left: rect.left + padding,
|
|
436
|
-
width: rect.width - padding * 2,
|
|
437
|
-
height: rect.height - padding * 2
|
|
438
|
-
}
|
|
439
|
-
}, expand ? /* @__PURE__ */ React3.createElement("div", {
|
|
440
|
-
className: "absolute inset-0 bg-deck-surface border border-green-500 cursor-pointer pointer-events-auto overflow-auto",
|
|
441
|
-
onPointerDown: (ev) => ev.stopPropagation(),
|
|
442
|
-
onClick: (ev) => {
|
|
443
|
-
ev.stopPropagation();
|
|
444
|
-
setExpand(false);
|
|
445
|
-
}
|
|
446
|
-
}, /* @__PURE__ */ React3.createElement("pre", {
|
|
447
|
-
className: "p-2 text-xs text-description font-mono"
|
|
448
|
-
}, JSON.stringify({
|
|
449
|
-
info
|
|
450
|
-
}, null, 2))) : /* @__PURE__ */ React3.createElement("span", {
|
|
451
|
-
className: "absolute right-1 bottom-0 flex items-center p-1 text-green-500 opacity-80 hover:opacity-100 text-xl cursor-pointer pointer-events-auto",
|
|
452
|
-
title: info.id,
|
|
453
|
-
onPointerDown: (ev) => ev.stopPropagation(),
|
|
454
|
-
onClick: (ev) => {
|
|
455
|
-
ev.stopPropagation();
|
|
456
|
-
setExpand(true);
|
|
457
|
-
}
|
|
458
|
-
}, "\u24D8")),
|
|
459
|
-
// TODO(burdon): Create well-known element to gather all debug portals.
|
|
460
|
-
document.body
|
|
461
|
-
));
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
// src/ui/components/Surface/SurfaceComponent.tsx
|
|
465
|
-
var __dxlog_file3 = "/__w/dxos/dxos/packages/sdk/app-framework/src/ui/components/Surface/SurfaceComponent.tsx";
|
|
466
|
-
var DEFAULT_PLACEHOLDER = /* @__PURE__ */ React4.createElement(Fragment, null);
|
|
467
|
-
var DEBUG = import.meta.env.VITE_DEBUG;
|
|
468
|
-
var WebComponentWrapper = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id, role, data, limit, definition, ...rest }, forwardedRef) => {
|
|
469
|
-
const containerRef = useRef2(null);
|
|
470
|
-
const elementRef = useRef2(null);
|
|
471
|
-
const propsRef = useRef2({
|
|
472
|
-
id,
|
|
473
|
-
role,
|
|
474
|
-
data,
|
|
475
|
-
limit,
|
|
476
|
-
...rest
|
|
477
|
-
});
|
|
478
|
-
propsRef.current = {
|
|
479
|
-
id,
|
|
480
|
-
role,
|
|
481
|
-
data,
|
|
482
|
-
limit,
|
|
483
|
-
...rest
|
|
484
|
-
};
|
|
485
|
-
useEffect4(() => {
|
|
486
|
-
if (!containerRef.current || elementRef.current) {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
const element = document.createElement(definition.tagName);
|
|
490
|
-
elementRef.current = element;
|
|
491
|
-
Object.assign(element, propsRef.current);
|
|
492
|
-
containerRef.current.appendChild(element);
|
|
493
|
-
if (typeof forwardedRef === "function") {
|
|
494
|
-
forwardedRef(element);
|
|
495
|
-
} else if (forwardedRef) {
|
|
496
|
-
forwardedRef.current = element;
|
|
497
|
-
}
|
|
498
|
-
return () => {
|
|
499
|
-
if (elementRef.current && containerRef.current?.contains(elementRef.current)) {
|
|
500
|
-
containerRef.current.removeChild(elementRef.current);
|
|
501
|
-
}
|
|
502
|
-
if (typeof forwardedRef === "function") {
|
|
503
|
-
forwardedRef(null);
|
|
504
|
-
} else if (forwardedRef) {
|
|
505
|
-
forwardedRef.current = null;
|
|
506
|
-
}
|
|
507
|
-
elementRef.current = null;
|
|
508
|
-
};
|
|
509
|
-
}, [
|
|
510
|
-
definition.tagName,
|
|
511
|
-
forwardedRef
|
|
512
|
-
]);
|
|
513
|
-
useEffect4(() => {
|
|
514
|
-
const element = elementRef.current;
|
|
515
|
-
if (!element) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
Object.assign(element, propsRef.current);
|
|
519
|
-
});
|
|
520
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
521
|
-
ref: containerRef
|
|
522
|
-
});
|
|
523
|
-
}));
|
|
524
|
-
WebComponentWrapper.displayName = "WebComponentWrapper";
|
|
525
|
-
var SurfaceContextProvider = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id, role, data, limit, fallback = ErrorFallback2, definition, ...rest }, forwardedRef) => {
|
|
526
|
-
const contextValue = useMemo3(() => ({
|
|
527
|
-
id,
|
|
528
|
-
role,
|
|
529
|
-
data
|
|
530
|
-
}), [
|
|
531
|
-
id,
|
|
532
|
-
role,
|
|
533
|
-
data
|
|
534
|
-
]);
|
|
535
|
-
if (definition.kind === "web-component") {
|
|
536
|
-
return /* @__PURE__ */ React4.createElement(ErrorBoundary2, {
|
|
537
|
-
name: "surface",
|
|
538
|
-
resetKeys: [
|
|
539
|
-
data
|
|
540
|
-
],
|
|
541
|
-
FallbackComponent: fallback
|
|
542
|
-
}, /* @__PURE__ */ React4.createElement(SurfaceContext.Provider, {
|
|
543
|
-
value: contextValue
|
|
544
|
-
}, /* @__PURE__ */ React4.createElement(WebComponentWrapper, {
|
|
545
|
-
id,
|
|
546
|
-
role,
|
|
547
|
-
data,
|
|
548
|
-
limit,
|
|
549
|
-
definition,
|
|
550
|
-
ref: forwardedRef,
|
|
551
|
-
...rest
|
|
552
|
-
})));
|
|
553
|
-
}
|
|
554
|
-
const Component = definition.component;
|
|
555
|
-
const debug = DEBUG || "__DX_DEBUG__" in window;
|
|
556
|
-
if (debug) {
|
|
557
|
-
return /* @__PURE__ */ React4.createElement(ErrorBoundary2, {
|
|
558
|
-
name: "surface",
|
|
559
|
-
resetKeys: [
|
|
560
|
-
data
|
|
561
|
-
],
|
|
562
|
-
FallbackComponent: fallback
|
|
563
|
-
}, /* @__PURE__ */ React4.createElement("div", {
|
|
564
|
-
role: "none",
|
|
565
|
-
className: "contents",
|
|
566
|
-
"data-id": id,
|
|
567
|
-
"data-role": role
|
|
568
|
-
}, /* @__PURE__ */ React4.createElement(SurfaceContext.Provider, {
|
|
569
|
-
value: contextValue
|
|
570
|
-
}, /* @__PURE__ */ React4.createElement(SurfaceInfo, {
|
|
571
|
-
ref: forwardedRef
|
|
572
|
-
}, /* @__PURE__ */ React4.createElement(Component, {
|
|
573
|
-
id,
|
|
574
|
-
role,
|
|
575
|
-
data,
|
|
576
|
-
limit,
|
|
577
|
-
...rest
|
|
578
|
-
})))));
|
|
579
|
-
}
|
|
580
|
-
return /* @__PURE__ */ React4.createElement(ErrorBoundary2, {
|
|
581
|
-
name: "surface",
|
|
582
|
-
resetKeys: [
|
|
583
|
-
data
|
|
584
|
-
],
|
|
585
|
-
FallbackComponent: fallback
|
|
586
|
-
}, /* @__PURE__ */ React4.createElement("div", {
|
|
587
|
-
role: "none",
|
|
588
|
-
className: "contents",
|
|
589
|
-
"data-id": id,
|
|
590
|
-
"data-role": role
|
|
591
|
-
}, /* @__PURE__ */ React4.createElement(SurfaceContext.Provider, {
|
|
592
|
-
value: contextValue
|
|
593
|
-
}, /* @__PURE__ */ React4.createElement(Component, {
|
|
594
|
-
id,
|
|
595
|
-
role,
|
|
596
|
-
data,
|
|
597
|
-
limit,
|
|
598
|
-
...rest,
|
|
599
|
-
ref: forwardedRef
|
|
600
|
-
}))));
|
|
601
|
-
}));
|
|
602
|
-
SurfaceContextProvider.displayName = "SurfaceContextProvider";
|
|
603
|
-
var SurfaceComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ id: _id, role, data: dataProp, limit, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {
|
|
604
|
-
const data = useDefaultValue2(dataProp, () => ({}));
|
|
605
|
-
const surfaces = useSurfaces();
|
|
606
|
-
const definitions = findCandidates(surfaces, {
|
|
607
|
-
role,
|
|
608
|
-
data
|
|
609
|
-
});
|
|
610
|
-
const candidates = limit ? definitions.slice(0, limit) : definitions;
|
|
611
|
-
if (DEBUG && candidates.length === 0) {
|
|
612
|
-
log2.warn("no candidates for surface", {
|
|
613
|
-
role,
|
|
614
|
-
data
|
|
615
|
-
}, {
|
|
616
|
-
F: __dxlog_file3,
|
|
617
|
-
L: 185,
|
|
618
|
-
S: void 0,
|
|
619
|
-
C: (f, a) => f(...a)
|
|
620
|
-
});
|
|
621
|
-
return null;
|
|
622
|
-
}
|
|
623
|
-
return /* @__PURE__ */ React4.createElement(Suspense, {
|
|
624
|
-
fallback: placeholder
|
|
625
|
-
}, candidates.map((definition) => /* @__PURE__ */ React4.createElement(SurfaceContextProvider, {
|
|
626
|
-
key: definition.id,
|
|
627
|
-
id: definition.id,
|
|
628
|
-
role,
|
|
629
|
-
data,
|
|
630
|
-
limit,
|
|
631
|
-
definition,
|
|
632
|
-
ref: forwardedRef,
|
|
633
|
-
...rest
|
|
634
|
-
})));
|
|
635
|
-
}));
|
|
636
|
-
SurfaceComponent.displayName = "Surface";
|
|
637
|
-
var ErrorFallback2 = ({ error }) => {
|
|
638
|
-
const { message } = error instanceof Error ? error : {
|
|
639
|
-
message: String(error)
|
|
640
|
-
};
|
|
641
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
642
|
-
role: "alert",
|
|
643
|
-
"data-testid": "error-boundary-fallback"
|
|
644
|
-
}, /* @__PURE__ */ React4.createElement("h1", {
|
|
645
|
-
className: "flex gap-2 text-sm mt-2 text-info-text"
|
|
646
|
-
}, message));
|
|
647
|
-
};
|
|
648
|
-
var findCandidates = (surfaces, { role, data }) => {
|
|
649
|
-
return Object.values(surfaces).filter((definition) => Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role).filter(({ filter }) => filter ? filter(data ?? {}) : true).toSorted(byPosition);
|
|
650
|
-
};
|
|
651
|
-
var useSurfaces = () => {
|
|
652
|
-
const surfaces = useCapabilities(capabilities_exports.ReactSurface);
|
|
653
|
-
return useMemo3(() => surfaces.flat(), [
|
|
654
|
-
surfaces
|
|
655
|
-
]);
|
|
656
|
-
};
|
|
657
|
-
var isSurfaceAvailable = (capabilityManager, { role, data }) => {
|
|
658
|
-
const surfaces = capabilityManager.getAll(capabilities_exports.ReactSurface);
|
|
659
|
-
const candidates = findCandidates(surfaces.flat(), {
|
|
660
|
-
role,
|
|
661
|
-
data
|
|
662
|
-
});
|
|
663
|
-
return candidates.length > 0;
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
// src/ui/components/Surface/types.ts
|
|
667
|
-
var create = (definition) => ({
|
|
668
|
-
...definition,
|
|
669
|
-
kind: "react"
|
|
670
|
-
});
|
|
671
|
-
var createWeb = (definition) => ({
|
|
672
|
-
...definition,
|
|
673
|
-
kind: "web-component"
|
|
674
|
-
});
|
|
675
|
-
|
|
676
|
-
// src/ui/components/Surface/index.ts
|
|
677
|
-
(function(Surface2) {
|
|
678
|
-
Surface2.create = create;
|
|
679
|
-
Surface2.createWeb = createWeb;
|
|
680
|
-
Surface2.Context = SurfaceContext;
|
|
681
|
-
Surface2.Surface = SurfaceComponent;
|
|
682
|
-
Surface2.isAvailable = isSurfaceAvailable;
|
|
683
|
-
})(Surface || (Surface = {}));
|
|
684
|
-
var Surface;
|
|
685
|
-
|
|
686
|
-
export {
|
|
687
|
-
useApp,
|
|
688
|
-
useCapabilities,
|
|
689
|
-
useCapability,
|
|
690
|
-
useAtomCapability,
|
|
691
|
-
useAtomCapabilityState,
|
|
692
|
-
useOperationInvoker,
|
|
693
|
-
LoadingState,
|
|
694
|
-
useLoading,
|
|
695
|
-
useOperationResolver,
|
|
696
|
-
useSettingsState,
|
|
697
|
-
useSurface,
|
|
698
|
-
App,
|
|
699
|
-
usePluginManager,
|
|
700
|
-
PluginManagerProvider,
|
|
701
|
-
Surface
|
|
702
|
-
};
|
|
703
|
-
//# sourceMappingURL=chunk-4CTRO67U.mjs.map
|