@dxos/app-framework 0.8.3 → 0.8.4-main.1068cf700f
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 +11 -0
- package/.storybook/preview.mts +8 -0
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/README.md +0 -8
- package/dist/lib/browser/capability-7LE5X2NH.mjs +37 -0
- package/dist/lib/browser/capability-7LE5X2NH.mjs.map +7 -0
- package/dist/lib/browser/capability-DU35RXMD.mjs +34 -0
- package/dist/lib/browser/capability-DU35RXMD.mjs.map +7 -0
- package/dist/lib/browser/chunk-4DQMLMGU.mjs +44 -0
- package/dist/lib/browser/chunk-4DQMLMGU.mjs.map +7 -0
- package/dist/lib/browser/chunk-EIFGKQSA.mjs +170 -0
- package/dist/lib/browser/chunk-EIFGKQSA.mjs.map +7 -0
- package/dist/lib/browser/chunk-FHQTHCX7.mjs +8 -0
- package/dist/lib/browser/chunk-FHQTHCX7.mjs.map +7 -0
- package/dist/lib/browser/chunk-IGRQWMWW.mjs +80 -0
- package/dist/lib/browser/chunk-IGRQWMWW.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KWP6PKIU.mjs +145 -0
- package/dist/lib/browser/chunk-KWP6PKIU.mjs.map +7 -0
- package/dist/lib/browser/chunk-NPUEVX42.mjs +34 -0
- package/dist/lib/browser/chunk-NPUEVX42.mjs.map +7 -0
- package/dist/lib/browser/chunk-PKQT6C53.mjs +47 -0
- package/dist/lib/browser/chunk-PKQT6C53.mjs.map +7 -0
- package/dist/lib/browser/chunk-WGWEEBUV.mjs +807 -0
- package/dist/lib/browser/chunk-WGWEEBUV.mjs.map +7 -0
- package/dist/lib/browser/chunk-YAFEA4GV.mjs +1 -0
- package/dist/lib/browser/chunk-YZQ6NFG4.mjs +781 -0
- package/dist/lib/browser/chunk-YZQ6NFG4.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZQO3UZ4R.mjs +77 -0
- package/dist/lib/browser/chunk-ZQO3UZ4R.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +89 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +23 -0
- package/dist/lib/browser/common/capabilities.mjs +45 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/activation-event.mjs.map +7 -0
- package/dist/lib/browser/core/capability.mjs +28 -0
- package/dist/lib/browser/core/capability.mjs.map +7 -0
- package/dist/lib/browser/core/plugin-manager.mjs +15 -0
- package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/browser/core/plugin.mjs +27 -0
- package/dist/lib/browser/core/plugin.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +87 -156
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-7QW56NOM.mjs +36 -0
- package/dist/lib/browser/invoker-capability-7QW56NOM.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +84 -38
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/ui/index.mjs +49 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-OSVYGK4X.mjs +38 -0
- package/dist/lib/node-esm/capability-OSVYGK4X.mjs.map +7 -0
- package/dist/lib/node-esm/capability-SR2EIZFP.mjs +35 -0
- package/dist/lib/node-esm/capability-SR2EIZFP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-64IMLAS2.mjs +78 -0
- package/dist/lib/node-esm/chunk-64IMLAS2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs +48 -0
- package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DHSHRYIB.mjs +171 -0
- package/dist/lib/node-esm/chunk-DHSHRYIB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DZ2XLAGI.mjs +146 -0
- package/dist/lib/node-esm/chunk-DZ2XLAGI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-J2PHTRHC.mjs +45 -0
- package/dist/lib/node-esm/chunk-J2PHTRHC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JAZVHID3.mjs +35 -0
- package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OQYHRZYF.mjs +81 -0
- package/dist/lib/node-esm/chunk-OQYHRZYF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UEWJDI2L.mjs +10 -0
- package/dist/lib/node-esm/chunk-UEWJDI2L.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs +782 -0
- package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XHAKT6UD.mjs +808 -0
- package/dist/lib/node-esm/chunk-XHAKT6UD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +2 -0
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +90 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +24 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +46 -0
- package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
- package/dist/lib/node-esm/core/activation-event.mjs +21 -0
- package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
- package/dist/lib/node-esm/core/capability.mjs +29 -0
- package/dist/lib/node-esm/core/capability.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs +16 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin.mjs +28 -0
- package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +87 -156
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs +37 -0
- package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +84 -38
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/ui/index.mjs +50 -0
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/types/src/cli/cli.d.ts +39 -0
- package/dist/types/src/cli/cli.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/common/activation-events.d.ts +27 -0
- package/dist/types/src/common/activation-events.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +114 -121
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +4 -8
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +33 -0
- package/dist/types/src/common/operations.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +8 -8
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/context.d.ts +5 -0
- package/dist/types/src/context.d.ts.map +1 -0
- package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +6 -6
- package/dist/types/src/core/activation-event.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.d.ts +43 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.test.d.ts +2 -0
- package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/capability.d.ts +150 -0
- package/dist/types/src/core/capability.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -4
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +66 -0
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +97 -32
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts +5 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
- package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/index.d.ts +3 -0
- package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/meta.d.ts +3 -0
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/testing.d.ts +109 -0
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/index.d.ts +2 -0
- package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/service.d.ts +8 -0
- package/dist/types/src/testing/service.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +11 -10
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App.d.ts +8 -0
- package/dist/types/src/ui/components/App.d.ts.map +1 -0
- package/dist/types/src/ui/components/App.stories.d.ts +14 -0
- package/dist/types/src/ui/components/App.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/DefaultFallback.d.ts +8 -0
- package/dist/types/src/ui/components/DefaultFallback.d.ts.map +1 -0
- package/dist/types/src/ui/components/ErrorBoundary.d.ts +30 -0
- package/dist/types/src/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManagerContext.stories.d.ts +13 -0
- package/dist/types/src/ui/components/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/ui/components/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/ui/components/index.d.ts +5 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts +12 -0
- package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/SurfaceComponent.stories.d.ts +14 -0
- package/dist/types/src/ui/components/surface/SurfaceComponent.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/SurfaceInfo.d.ts +11 -0
- package/dist/types/src/ui/components/surface/SurfaceInfo.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/context.d.ts +5 -0
- package/dist/types/src/ui/components/surface/context.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/index.d.ts +5 -0
- package/dist/types/src/ui/components/surface/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/surface/types.d.ts +94 -0
- package/dist/types/src/ui/components/surface/types.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/index.d.ts +7 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{App.d.ts → ui/hooks/useApp.d.ts} +16 -9
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts +18 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts +19 -0
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
- package/dist/types/src/ui/index.d.ts +4 -0
- package/dist/types/src/ui/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +25 -0
- package/package.json +113 -45
- package/src/cli/cli.ts +107 -0
- package/src/{playground/layout → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +44 -0
- package/src/common/capabilities.ts +174 -108
- package/src/common/index.ts +4 -8
- package/src/common/operations.ts +38 -0
- package/src/common/translations.ts +18 -10
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +5 -5
- package/src/core/capability-manager.test.ts +151 -0
- package/src/core/capability-manager.ts +171 -0
- package/src/core/capability.ts +236 -0
- package/src/core/index.ts +5 -4
- package/src/core/plugin-manager.test.ts +845 -0
- package/src/core/plugin-manager.ts +696 -0
- package/src/core/plugin.ts +229 -36
- package/src/helpers.test.ts +1 -1
- package/src/index.ts +3 -4
- package/src/plugin-operation/OperationPlugin.ts +25 -0
- package/src/plugin-operation/history/capability.ts +37 -0
- package/src/plugin-operation/history/errors.ts +11 -0
- package/src/plugin-operation/history/history-tracker.test.ts +380 -0
- package/src/plugin-operation/history/history-tracker.ts +129 -0
- package/src/plugin-operation/history/index.ts +9 -0
- package/src/plugin-operation/history/types.ts +17 -0
- package/src/plugin-operation/history/undo-mapping.ts +135 -0
- package/src/plugin-operation/history/undo-registry.test.ts +73 -0
- package/src/plugin-operation/history/undo-registry.ts +54 -0
- package/src/plugin-operation/index.ts +6 -0
- package/src/plugin-operation/invoker-capability.ts +40 -0
- package/src/plugin-operation/meta.ts +11 -0
- package/src/plugin-operation/testing.ts +174 -0
- package/src/plugin-runtime/RuntimePlugin.ts +20 -0
- package/src/plugin-runtime/capability.ts +53 -0
- package/src/{playground/logger → plugin-runtime}/index.ts +1 -1
- package/src/plugin-runtime/meta.ts +11 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/service.ts +52 -0
- package/src/testing/withPluginManager.stories.tsx +15 -11
- package/src/testing/withPluginManager.tsx +43 -44
- package/src/ui/components/App.stories.tsx +62 -0
- package/src/ui/components/App.tsx +57 -0
- package/src/ui/components/DefaultFallback.tsx +26 -0
- package/src/ui/components/ErrorBoundary.tsx +56 -0
- package/src/ui/components/PluginManagerContext.stories.tsx +183 -0
- package/src/{react → ui/components}/PluginManagerProvider.ts +3 -3
- package/src/ui/components/index.ts +8 -0
- package/src/ui/components/surface/SurfaceComponent.stories.tsx +142 -0
- package/src/ui/components/surface/SurfaceComponent.tsx +262 -0
- package/src/ui/components/surface/SurfaceInfo.tsx +107 -0
- package/src/ui/components/surface/context.ts +12 -0
- package/src/ui/components/surface/index.ts +8 -0
- package/src/ui/components/surface/types.ts +119 -0
- package/src/ui/hooks/index.ts +10 -0
- package/src/ui/hooks/useApp.tsx +215 -0
- package/src/ui/hooks/useCapabilities.ts +67 -0
- package/src/ui/hooks/useLoading.tsx +68 -0
- package/src/ui/hooks/useOperationResolver.ts +40 -0
- package/src/ui/hooks/useSettingsState.ts +26 -0
- package/src/ui/hooks/useSurface.ts +13 -0
- package/src/ui/index.ts +7 -0
- package/tsconfig.json +13 -29
- package/vitest.config.ts +8 -3
- package/.eslintrc.cjs +0 -9
- package/README.yml +0 -5
- package/dist/lib/browser/app-graph-builder-BI4VVKSW.mjs +0 -137
- package/dist/lib/browser/app-graph-builder-BI4VVKSW.mjs.map +0 -7
- package/dist/lib/browser/chunk-DIBVO47Z.mjs +0 -406
- package/dist/lib/browser/chunk-DIBVO47Z.mjs.map +0 -7
- package/dist/lib/browser/chunk-EHM4UI3V.mjs +0 -1518
- package/dist/lib/browser/chunk-EHM4UI3V.mjs.map +0 -7
- package/dist/lib/browser/chunk-WWEJRWFX.mjs +0 -32
- package/dist/lib/browser/chunk-WWEJRWFX.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-XVBOMF2Y.mjs +0 -11
- package/dist/lib/browser/intent-resolver-3QMBXLIY.mjs +0 -39
- package/dist/lib/browser/intent-resolver-3QMBXLIY.mjs.map +0 -7
- package/dist/lib/browser/store-5H7XPJGA.mjs +0 -30
- package/dist/lib/browser/store-5H7XPJGA.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -79
- package/dist/lib/node/app-graph-builder-H7QVE4MJ.cjs +0 -146
- package/dist/lib/node/app-graph-builder-H7QVE4MJ.cjs.map +0 -7
- package/dist/lib/node/chunk-G774ASXO.cjs +0 -58
- package/dist/lib/node/chunk-G774ASXO.cjs.map +0 -7
- package/dist/lib/node/chunk-VSOSVDQ3.cjs +0 -1551
- package/dist/lib/node/chunk-VSOSVDQ3.cjs.map +0 -7
- package/dist/lib/node/chunk-YGAY3H34.cjs +0 -429
- package/dist/lib/node/chunk-YGAY3H34.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -193
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-dispatcher-C3SVKJ62.cjs +0 -32
- package/dist/lib/node/intent-dispatcher-C3SVKJ62.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-IOJDYO34.cjs +0 -46
- package/dist/lib/node/intent-resolver-IOJDYO34.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/store-ESF5VR57.cjs +0 -45
- package/dist/lib/node/store-ESF5VR57.cjs.map +0 -7
- package/dist/lib/node/testing/index.cjs +0 -119
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node/worker.cjs +0 -101
- package/dist/lib/node/worker.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NROP6RPQ.mjs +0 -138
- package/dist/lib/node-esm/app-graph-builder-NROP6RPQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2J6FVECI.mjs +0 -1520
- package/dist/lib/node-esm/chunk-2J6FVECI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FHNZZWP4.mjs +0 -407
- package/dist/lib/node-esm/chunk-FHNZZWP4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I6BVZMAH.mjs +0 -34
- package/dist/lib/node-esm/chunk-I6BVZMAH.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-7JPGLCQ5.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-VY4X5UHN.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-VY4X5UHN.mjs.map +0 -7
- package/dist/lib/node-esm/store-UKD2R2KA.mjs +0 -31
- package/dist/lib/node-esm/store-UKD2R2KA.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -80
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/common/collaboration.d.ts +0 -19
- package/dist/types/src/common/collaboration.d.ts.map +0 -1
- package/dist/types/src/common/events.d.ts +0 -52
- package/dist/types/src/common/events.d.ts.map +0 -1
- package/dist/types/src/common/file.d.ts +0 -14
- package/dist/types/src/common/file.d.ts.map +0 -1
- package/dist/types/src/common/graph.d.ts +0 -21
- package/dist/types/src/common/graph.d.ts.map +0 -1
- package/dist/types/src/common/layout.d.ts +0 -281
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts +0 -65
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -114
- package/dist/types/src/core/capabilities.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.test.d.ts +0 -2
- package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
- package/dist/types/src/core/events.d.ts.map +0 -1
- package/dist/types/src/core/manager.d.ts +0 -122
- package/dist/types/src/core/manager.d.ts.map +0 -1
- package/dist/types/src/core/manager.test.d.ts +0 -2
- package/dist/types/src/core/manager.test.d.ts.map +0 -1
- package/dist/types/src/playground/debug/Debug.d.ts +0 -6
- package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
- package/dist/types/src/playground/debug/index.d.ts +0 -2
- package/dist/types/src/playground/debug/index.d.ts.map +0 -1
- package/dist/types/src/playground/debug/plugin.d.ts +0 -2
- package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Main.d.ts +0 -6
- package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/generator/generator.d.ts +0 -7
- package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
- package/dist/types/src/playground/generator/index.d.ts +0 -3
- package/dist/types/src/playground/generator/index.d.ts.map +0 -1
- package/dist/types/src/playground/generator/plugin.d.ts +0 -2
- package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/layout/Layout.d.ts +0 -8
- package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
- package/dist/types/src/playground/layout/index.d.ts +0 -2
- package/dist/types/src/playground/layout/index.d.ts.map +0 -1
- package/dist/types/src/playground/layout/plugin.d.ts +0 -2
- package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/logger/index.d.ts +0 -2
- package/dist/types/src/playground/logger/index.d.ts.map +0 -1
- package/dist/types/src/playground/logger/plugin.d.ts +0 -2
- package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/schema.d.ts +0 -13
- package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
- package/dist/types/src/playground/playground.stories.d.ts +0 -10
- package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/actions.d.ts +0 -38
- package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/errors.d.ts +0 -16
- package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/index.d.ts +0 -5
- package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent.d.ts +0 -63
- package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/actions.d.ts +0 -27
- package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/index.d.ts +0 -3
- package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/store.d.ts +0 -5
- package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/translations.d.ts +0 -11
- package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +0 -31
- package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/react/IntentContext.d.ts +0 -8
- package/dist/types/src/react/IntentContext.d.ts.map +0 -1
- package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
- package/dist/types/src/react/Surface.d.ts +0 -12
- package/dist/types/src/react/Surface.d.ts.map +0 -1
- package/dist/types/src/react/Surface.stories.d.ts +0 -16
- package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
- package/dist/types/src/react/common.d.ts +0 -13
- package/dist/types/src/react/common.d.ts.map +0 -1
- package/dist/types/src/react/index.d.ts +0 -7
- package/dist/types/src/react/index.d.ts.map +0 -1
- package/dist/types/src/react/useCapabilities.d.ts +0 -13
- package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
- package/dist/types/src/react/useIntentResolver.d.ts +0 -3
- package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/project.json +0 -29
- package/src/App.tsx +0 -276
- package/src/common/collaboration.ts +0 -21
- package/src/common/events.ts +0 -77
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/layout.ts +0 -278
- package/src/common/surface.ts +0 -86
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -254
- package/src/core/manager.test.ts +0 -516
- package/src/core/manager.ts +0 -519
- package/src/playground/debug/Debug.tsx +0 -39
- package/src/playground/debug/index.ts +0 -5
- package/src/playground/debug/plugin.ts +0 -17
- package/src/playground/generator/Main.tsx +0 -71
- package/src/playground/generator/Toolbar.tsx +0 -46
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -23
- package/src/playground/layout/Layout.tsx +0 -33
- package/src/playground/layout/plugin.ts +0 -17
- package/src/playground/logger/Toolbar.tsx +0 -29
- package/src/playground/logger/plugin.ts +0 -36
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -42
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -33
- package/src/plugin-intent/errors.ts +0 -39
- package/src/plugin-intent/index.ts +0 -8
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
- package/src/plugin-intent/intent-dispatcher.ts +0 -333
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-settings/SettingsPlugin.ts +0 -35
- package/src/plugin-settings/actions.ts +0 -29
- package/src/plugin-settings/app-graph-builder.ts +0 -157
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -34
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -17
- package/src/react/ErrorBoundary.tsx +0 -45
- package/src/react/IntentContext.tsx +0 -34
- package/src/react/Surface.stories.tsx +0 -96
- package/src/react/Surface.tsx +0 -77
- package/src/react/common.ts +0 -12
- package/src/react/index.ts +0 -10
- package/src/react/useCapabilities.ts +0 -30
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
- package/typedoc/.nojekyll +0 -1
- package/typedoc/assets/hierarchy.js +0 -1
- package/typedoc/assets/highlight.css +0 -106
- package/typedoc/assets/icons.js +0 -18
- package/typedoc/assets/icons.svg +0 -1
- package/typedoc/assets/main.js +0 -60
- package/typedoc/assets/navigation.js +0 -1
- package/typedoc/assets/search.js +0 -1
- package/typedoc/assets/style.css +0 -1640
- package/typedoc/classes/CollaborationActions.InsertContent.html +0 -421
- package/typedoc/classes/ErrorBoundary.html +0 -125
- package/typedoc/classes/IntentAction.ShowUndo.html +0 -227
- package/typedoc/classes/IntentAction.Track.html +0 -266
- package/typedoc/classes/LayoutAction.AddToast.html +0 -265
- package/typedoc/classes/LayoutAction.Close.html +0 -382
- package/typedoc/classes/LayoutAction.Expose.html +0 -265
- package/typedoc/classes/LayoutAction.Open.html +0 -1123
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +0 -343
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +0 -460
- package/typedoc/classes/LayoutAction.Set.html +0 -460
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +0 -499
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +0 -265
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +0 -616
- package/typedoc/classes/LayoutAction.UpdateDialog.html +0 -1123
- package/typedoc/classes/LayoutAction.UpdateLayout.html +0 -461
- package/typedoc/classes/LayoutAction.UpdatePopover.html +0 -1435
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +0 -616
- package/typedoc/classes/Plugin.html +0 -6
- package/typedoc/classes/PluginContext.html +0 -38
- package/typedoc/classes/PluginManager.html +0 -43
- package/typedoc/classes/PluginModule.html +0 -18
- package/typedoc/classes/SettingsAction.Open.html +0 -226
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +0 -265
- package/typedoc/functions/Events.createStateEvent.html +0 -2
- package/typedoc/functions/IntentPlugin.html +0 -1
- package/typedoc/functions/SettingsPlugin.html +0 -1
- package/typedoc/functions/allOf.html +0 -2
- package/typedoc/functions/chain.html +0 -3
- package/typedoc/functions/contributes.html +0 -2
- package/typedoc/functions/createDispatcher.html +0 -3
- package/typedoc/functions/createIntent.html +0 -6
- package/typedoc/functions/createResolver.html +0 -2
- package/typedoc/functions/createSurface.html +0 -2
- package/typedoc/functions/defineCapability.html +0 -2
- package/typedoc/functions/defineEvent.html +0 -2
- package/typedoc/functions/defineModule.html +0 -2
- package/typedoc/functions/definePlugin.html +0 -2
- package/typedoc/functions/eventKey.html +0 -2
- package/typedoc/functions/getEvents.html +0 -2
- package/typedoc/functions/isAllOf.html +0 -2
- package/typedoc/functions/isOneOf.html +0 -2
- package/typedoc/functions/isSurfaceAvailable.html +0 -2
- package/typedoc/functions/lazy.html +0 -2
- package/typedoc/functions/oneOf.html +0 -2
- package/typedoc/functions/useApp.html +0 -6
- package/typedoc/functions/useAppGraph.html +0 -1
- package/typedoc/functions/useCapabilities.html +0 -3
- package/typedoc/functions/useCapability.html +0 -4
- package/typedoc/functions/useIntentDispatcher.html +0 -1
- package/typedoc/functions/useIntentResolver.html +0 -1
- package/typedoc/functions/useLayout.html +0 -1
- package/typedoc/functions/usePluginManager.html +0 -2
- package/typedoc/hierarchy.html +0 -1
- package/typedoc/index.html +0 -16
- package/typedoc/interfaces/LayoutAction.Toast.html +0 -10
- package/typedoc/media/LICENSE +0 -8
- package/typedoc/modules/Capabilities.html +0 -1
- package/typedoc/modules/CollaborationActions.html +0 -1
- package/typedoc/modules/Events.html +0 -1
- package/typedoc/modules/IntentAction.html +0 -1
- package/typedoc/modules/LayoutAction.html +0 -2
- package/typedoc/modules/SettingsAction.html +0 -1
- package/typedoc/modules.html +0 -1
- package/typedoc/types/ActivationEvent.html +0 -8
- package/typedoc/types/ActivationEvents.html +0 -2
- package/typedoc/types/AnyCapability.html +0 -1
- package/typedoc/types/AnyIntent.html +0 -1
- package/typedoc/types/AnyIntentChain.html +0 -1
- package/typedoc/types/AnyIntentEffectResult.html +0 -1
- package/typedoc/types/AnyIntentResolver.html +0 -1
- package/typedoc/types/AnyIntentResult.html +0 -1
- package/typedoc/types/Capabilities.FileUploader.html +0 -1
- package/typedoc/types/Capabilities.IntentResolver.html +0 -1
- package/typedoc/types/Capabilities.Layout.html +0 -1
- package/typedoc/types/Capabilities.Metadata.html +0 -1
- package/typedoc/types/Capabilities.ReactContext.html +0 -1
- package/typedoc/types/Capabilities.ReactRoot.html +0 -1
- package/typedoc/types/Capabilities.ReactSurface.html +0 -1
- package/typedoc/types/Capabilities.Settings.html +0 -4
- package/typedoc/types/Capability.html +0 -9
- package/typedoc/types/CreateAppOptions.html +0 -10
- package/typedoc/types/FileInfo.html +0 -1
- package/typedoc/types/Intent.html +0 -10
- package/typedoc/types/IntentChain.html +0 -6
- package/typedoc/types/IntentContext.html +0 -5
- package/typedoc/types/IntentData.html +0 -1
- package/typedoc/types/IntentDispatcher.html +0 -2
- package/typedoc/types/IntentDispatcherResult.html +0 -2
- package/typedoc/types/IntentEffectDefinition.html +0 -2
- package/typedoc/types/IntentEffectResult.html +0 -15
- package/typedoc/types/IntentParams.html +0 -3
- package/typedoc/types/IntentResolver.html +0 -2
- package/typedoc/types/IntentResultData.html +0 -1
- package/typedoc/types/IntentSchema.html +0 -1
- package/typedoc/types/IntentUndo.html +0 -2
- package/typedoc/types/InterfaceDef.html +0 -4
- package/typedoc/types/Label.html +0 -1
- package/typedoc/types/NodeSerializer.html +0 -8
- package/typedoc/types/PluginManagerOptions.html +0 -6
- package/typedoc/types/PluginMeta.html +0 -21
- package/typedoc/types/PromiseIntentDispatcher.html +0 -2
- package/typedoc/types/PromiseIntentUndo.html +0 -2
- package/typedoc/types/Resource.html +0 -1
- package/typedoc/types/ResourceKey.html +0 -1
- package/typedoc/types/ResourceLanguage.html +0 -1
- package/typedoc/types/SerializedNode.html +0 -4
- package/typedoc/types/SurfaceComponent.html +0 -2
- package/typedoc/types/SurfaceDefinition.html +0 -2
- package/typedoc/types/SurfaceProps.html +0 -4
- package/typedoc/variables/Capabilities.AnchorSort.html +0 -1
- package/typedoc/variables/Capabilities.AppGraph.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +0 -1
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +0 -1
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +0 -1
- package/typedoc/variables/Capabilities.FileUploader.html +0 -1
- package/typedoc/variables/Capabilities.IntentDispatcher.html +0 -1
- package/typedoc/variables/Capabilities.IntentResolver.html +0 -1
- package/typedoc/variables/Capabilities.Layout.html +0 -1
- package/typedoc/variables/Capabilities.Metadata.html +0 -1
- package/typedoc/variables/Capabilities.Null.html +0 -1
- package/typedoc/variables/Capabilities.PluginManager.html +0 -1
- package/typedoc/variables/Capabilities.ReactContext.html +0 -1
- package/typedoc/variables/Capabilities.ReactRoot.html +0 -1
- package/typedoc/variables/Capabilities.ReactSurface.html +0 -1
- package/typedoc/variables/Capabilities.RxRegistry.html +0 -1
- package/typedoc/variables/Capabilities.Settings.html +0 -1
- package/typedoc/variables/Capabilities.SettingsStore.html +0 -1
- package/typedoc/variables/Capabilities.Tools.html +0 -1
- package/typedoc/variables/Capabilities.Translations.html +0 -1
- package/typedoc/variables/Events.AppGraphReady.html +0 -2
- package/typedoc/variables/Events.DispatcherReady.html +0 -2
- package/typedoc/variables/Events.LayoutReady.html +0 -1
- package/typedoc/variables/Events.SettingsReady.html +0 -2
- package/typedoc/variables/Events.SetupAppGraph.html +0 -2
- package/typedoc/variables/Events.SetupArtifactDefinition.html +0 -2
- package/typedoc/variables/Events.SetupIntentResolver.html +0 -2
- package/typedoc/variables/Events.SetupMetadata.html +0 -2
- package/typedoc/variables/Events.SetupReactSurface.html +0 -2
- package/typedoc/variables/Events.SetupSettings.html +0 -2
- package/typedoc/variables/Events.SetupTranslations.html +0 -2
- package/typedoc/variables/Events.Startup.html +0 -2
- package/typedoc/variables/FileInfoSchema.html +0 -1
- package/typedoc/variables/INTENT_ACTION.html +0 -1
- package/typedoc/variables/INTENT_PLUGIN.html +0 -1
- package/typedoc/variables/LAYOUT_ACTION.html +0 -1
- package/typedoc/variables/LAYOUT_PLUGIN.html +0 -1
- package/typedoc/variables/Label.html +0 -1
- package/typedoc/variables/LayoutAction.Toast.html +0 -1
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +0 -1
- package/typedoc/variables/PluginManagerProvider.html +0 -2
- package/typedoc/variables/Resource.html +0 -2
- package/typedoc/variables/ResourceKey.html +0 -1
- package/typedoc/variables/ResourceLanguage.html +0 -1
- package/typedoc/variables/SETTINGS_ACTION.html +0 -1
- package/typedoc/variables/SETTINGS_ID.html +0 -1
- package/typedoc/variables/SETTINGS_KEY.html +0 -1
- package/typedoc/variables/SETTINGS_PLUGIN.html +0 -1
- package/typedoc/variables/Surface.html +0 -2
- package/typedoc/variables/defaultFileTypes.html +0 -1
- /package/dist/lib/browser/{intent-dispatcher-XVBOMF2Y.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → chunk-YAFEA4GV.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-7JPGLCQ5.mjs.map → browser/common/activation-events.mjs.map} +0 -0
- /package/dist/lib/{node-esm/worker.mjs.map → browser/common/capabilities.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ui/components/App.tsx", "../../../src/helpers.ts", "../../../src/ui/hooks/useApp.tsx", "../../../src/ui/components/DefaultFallback.tsx", "../../../src/ui/components/ErrorBoundary.tsx", "../../../src/ui/components/PluginManagerProvider.ts", "../../../src/ui/hooks/useCapabilities.ts", "../../../src/ui/hooks/useLoading.tsx", "../../../src/ui/hooks/useOperationResolver.ts", "../../../src/ui/hooks/useSettingsState.ts", "../../../src/ui/hooks/useSurface.ts", "../../../src/ui/components/surface/context.ts", "../../../src/ui/components/surface/index.ts", "../../../src/ui/components/surface/types.ts", "../../../src/ui/components/surface/SurfaceComponent.tsx", "../../../src/ui/components/surface/SurfaceInfo.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Capabilities } from '../../common';\nimport { topologicalSort } from '../../helpers';\nimport { LoadingState, type UseAppOptions, useCapabilities, useLoading } from '../hooks';\n\nexport type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {\n ready: boolean;\n error: unknown;\n};\n\nexport const App = ({ placeholder: Placeholder, ready, error, debounce }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n const stage = useLoading(ready, debounce);\n\n if (error) {\n // This triggers the error boundary to provide UI feedback for the startup error.\n throw error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead.\n if (stage < LoadingState.Done) {\n if (!Placeholder) {\n return null;\n }\n\n return <Placeholder stage={stage} />;\n }\n\n const ComposedContext = composeContexts(reactContexts);\n return (\n <ComposedContext>\n {reactRoots.map(({ id, root: Component }) => (\n <Component key={id} />\n ))}\n </ComposedContext>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\ntype DependencyNode = {\n id: string;\n dependsOn?: string[];\n};\n\n/**\n * Topologically sorts a list of nodes based on their dependencies.\n */\n// TODO(wittjosiah): Factor out?\nexport const topologicalSort = <T extends DependencyNode>(nodes: T[]): T[] => {\n const getDependencies = (nodeId: string, seen = new Set<string>(), path = new Set<string>()): string[] => {\n if (path.has(nodeId)) {\n throw new Error(`Circular dependency detected involving ${nodeId}`);\n }\n if (seen.has(nodeId)) {\n return [];\n }\n\n const node = nodes.find((n) => n.id === nodeId);\n if (!node) {\n throw new Error(`Node ${nodeId} not found but is listed as a dependency`);\n }\n\n const newPath = new Set([...path, nodeId]);\n const newSeen = new Set([...seen, nodeId]);\n\n const dependsOn = node.dependsOn ?? [];\n return [...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)), nodeId];\n };\n\n // Get all unique dependencies.\n const allDependencies = nodes\n .map((node) => node.id)\n .flatMap((id) => getDependencies(id))\n .filter((id, index, self) => self.indexOf(id) === index);\n\n // Map back to original nodes\n return allDependencies\n .map((id) => nodes.find((node) => node.id === id))\n .filter((node): node is T => node !== undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as PubSub from 'effect/PubSub';\nimport * as Queue from 'effect/Queue';\nimport React, { type FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { useAsyncEffect, useDefaultValue } from '@dxos/react-hooks';\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport { ActivationEvents, Capabilities } from '../../common';\nimport { PluginManagerContext } from '../../context';\nimport { type ActivationEvent, type Plugin, PluginManager } from '../../core';\nimport { App } from '../components/App';\nimport { DefaultFallback } from '../components/DefaultFallback';\nimport { ErrorBoundary } from '../components/ErrorBoundary';\nimport { PluginManagerProvider } from '../components/PluginManagerProvider';\n\nconst ENABLED_KEY = 'dxos.org/app-framework/enabled';\n\nexport type UseAppOptions = {\n pluginManager?: PluginManager.PluginManager;\n pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];\n plugins?: Plugin.Plugin[];\n core?: string[];\n defaults?: string[];\n /**\n * Additional activation events to fire before startup.\n * These are fired alongside SetupReactSurface before the Startup event.\n */\n setupEvents?: ActivationEvent.ActivationEvent[];\n placeholder?: FC<{ stage: number }>;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\n safeMode?: boolean;\n debounce?: number;\n timeout?: number;\n};\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const plugins = [LayoutPlugin(), MyPlugin()];\n * const core = [LayoutPluginId];\n * const default = [MyPluginId];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = useApp({ plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.pluginLoader A function which loads new plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.defaults Default plugins are enabled by default but can be disabled by the user.\n * @param params.placeholder Placeholder component to render during startup.\n * @param params.fallback Fallback component to render if an error occurs during startup.\n * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.\n * @param params.safeMode Whether to enable safe mode, which disables optional plugins.\n */\nexport const useApp = ({\n pluginManager,\n pluginLoader: pluginLoaderProp,\n plugins: pluginsProp,\n core: coreProp,\n defaults: defaultsProp,\n setupEvents: setupEventsProp,\n placeholder,\n fallback = DefaultFallback,\n cacheEnabled = false,\n safeMode = false,\n debounce = 0,\n timeout = 30_000,\n}: UseAppOptions) => {\n const plugins = useDefaultValue(pluginsProp, () => []);\n const core = useDefaultValue(coreProp, () => plugins.map(({ meta }) => meta.id));\n const defaults = useDefaultValue(defaultsProp, () => []);\n const setupEvents = useDefaultValue(setupEventsProp, () => []);\n\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader = useMemo(\n () =>\n pluginLoaderProp ??\n ((id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n })),\n [pluginLoaderProp, plugins],\n );\n\n const readyRef = useRef(false);\n const [ready, setReady] = useState(false);\n const errorRef = useRef<unknown>(null);\n const [error, setError] = useState<unknown>(null);\n // TODO(wittjosiah): Migrate to Atom.kvs for isomorphic storage.\n const cached: string[] = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]'), []);\n const enabled = useMemo(\n () => (safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults),\n [safeMode, cacheEnabled, cached, defaults],\n );\n const manager = useMemo(\n () => pluginManager ?? PluginManager.make({ pluginLoader, plugins, core, enabled }),\n [pluginManager, pluginLoader, plugins, core, enabled],\n );\n\n useEffect(() => {\n if (!cacheEnabled) {\n return;\n }\n return manager.registry.subscribe(manager.enabled, (value) => {\n localStorage.setItem(ENABLED_KEY, JSON.stringify(value));\n });\n }, [cacheEnabled, manager]);\n\n useEffect(() => {\n setupDevtools(manager);\n }, [manager]);\n\n useAsyncEffect(async () => {\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'dxos.org/app-framework/atom-registry',\n });\n\n const fiber = Effect.gen(function* () {\n const queue = yield* PubSub.subscribe(manager.activation);\n const listener = yield* Effect.forkDaemon(\n Queue.take(queue).pipe(\n Effect.tap(({ event, state, error: error$ }) =>\n Effect.sync(() => {\n if (event === ActivationEvents.Startup.id && state === 'activated') {\n clearTimeout(timeoutId);\n setReady(true);\n readyRef.current = true;\n }\n if (error$ && !readyRef.current) {\n setError(error$);\n errorRef.current = error$;\n }\n }),\n ),\n Effect.forever,\n ),\n );\n\n yield* Effect.all([\n ...setupEvents.map((event) => manager.activate(event)),\n manager.activate(ActivationEvents.SetupReactSurface),\n manager.activate(ActivationEvents.Startup),\n ]);\n\n return yield* Fiber.join(listener);\n }).pipe(Effect.scoped, Effect.runFork);\n\n // Set up a timeout for startup.\n const timeoutId = setTimeout(() => {\n if (!readyRef.current && !errorRef.current) {\n log.warn('startup timeout diagnostic', {\n eventsFired: manager.getEventsFired(),\n activeModules: manager.getActive(),\n pendingReset: manager.getPendingReset(),\n });\n void runAndForwardErrors(Fiber.interrupt(fiber));\n setError(new Error(`Startup timed out after ${timeout}ms`));\n }\n }, timeout);\n\n return () => {\n clearTimeout(timeoutId);\n void runAndForwardErrors(Fiber.interrupt(fiber));\n manager.capabilities.remove(Capabilities.PluginManager, manager);\n manager.capabilities.remove(Capabilities.AtomRegistry, manager.registry);\n };\n }, [manager]);\n\n return useCallback(\n () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <ContextProtocolProvider value={manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={manager.registry}>\n <App placeholder={placeholder} ready={ready} error={error} debounce={debounce} />\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n </ErrorBoundary>\n ),\n [fallback, manager, placeholder, ready, error],\n );\n};\n\nconst setupDevtools = (manager: PluginManager.PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\n/**\n * NOTE: Default fallback should not use tailwind or theme.\n */\nexport const DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div\n style={{\n margin: '1rem',\n padding: '1rem',\n overflow: 'hidden',\n border: '4px solid teal',\n borderRadius: '1rem',\n }}\n >\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>ERROR: {error.message}</h1>\n <pre style={{ overflow: 'auto', fontSize: '1rem', whiteSpace: 'pre-wrap', color: '#888888' }}>{error.stack}</pre>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';\n\ntype State = {\n error: Error | undefined;\n};\n\nexport type ErrorBoundaryProps = PropsWithChildren<{\n data?: any;\n fallback?: FC<{ data?: any; error: Error }>;\n}>;\n\n/**\n * Surface error boundary.\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n override state = { error: undefined };\n\n override componentDidUpdate(prevProps: ErrorBoundaryProps): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render(): ReactNode {\n if (this.state.error) {\n const Fallback = this.props.fallback ?? DefaultFallback;\n return <Fallback data={this.props.data} error={this.state.error} />;\n }\n\n return this.props.children;\n }\n\n private resetError(): void {\n this.setState({ error: undefined });\n }\n}\n\nconst DefaultFallback: NonNullable<ErrorBoundaryProps['fallback']> = ({ data, error }) => {\n return (\n <div className='flex flex-col gap-2 overflow-hidden border border-red-500 rounded-sm'>\n <h1 className='p-2'>ERROR: {error.message}</h1>\n <pre className='p-2 overflow-y-auto text-sm text-subdued'>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { type PluginManager } from '../../core';\n\nconst PluginManagerContext = createContext<PluginManager.PluginManager | undefined>(undefined);\n\n/**\n * Get the plugin manager.\n */\nexport const usePluginManager = (): PluginManager.PluginManager =>\n useContext(PluginManagerContext) ?? raise(new Error('Missing PluginManagerContext'));\n\n/**\n * Context provider for a plugin manager.\n */\nexport const PluginManagerProvider = PluginManagerContext.Provider;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback } from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { Capabilities } from '../../common';\nimport { type Capability } from '../../core';\nimport { usePluginManager } from '../components/PluginManagerProvider';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const manager = usePluginManager();\n return useAtomValue(manager.capabilities.atom(interfaceDef));\n};\n\n/**\n * Hook to request a capability from the plugin context.\n * @returns The capability.\n * @throws If no capability is found.\n */\nexport const useCapability = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const capabilities = useCapabilities(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\n};\n\n/**\n * Hook to get the current value of an atom capability.\n * Automatically subscribes to changes.\n * @example const settings = useAtomCapability(ThreadCapabilities.Settings);\n */\nexport const useAtomCapability = <T>(atomCapability: Capability.InterfaceDef<Atom.Atom<T>>): T => {\n const atom = useCapability(atomCapability);\n return useAtomValue(atom);\n};\n\n/**\n * Hook to get value and updater for an atom capability.\n * Returns [currentValue, updateFn] similar to useState.\n * @example const [settings, updateSettings] = useAtomCapabilityState(ThreadCapabilities.Settings);\n */\nexport const useAtomCapabilityState = <T>(\n atomCapability: Capability.InterfaceDef<Atom.Writable<T>>,\n): [T, (fn: (current: T) => T) => void] => {\n const registry = useCapability(Capabilities.AtomRegistry);\n const atom = useCapability(atomCapability);\n const value = useAtomValue(atom);\n const update = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n return [value, update];\n};\n\n/**\n * Hook to get the operation invoker capability.\n */\nexport const useOperationInvoker = (): Capabilities.OperationInvoker => useCapability(Capabilities.OperationInvoker);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nexport enum LoadingState {\n Loading = 0,\n FadeIn = 1,\n FadeOut = 2,\n Done = 3,\n}\n\n/**\n * To avoid \"flashing\" the placeholder, we wait a period of time before starting the loading animation.\n * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.\n *\n * States:\n * 0: Loading - Wait for a period of time before starting the loading animation.\n * 1: Fade-in - Display a loading animation.\n * 2: Fade-out - Fade out the loading animation.\n * 3: Done - Remove the placeholder.\n */\nexport const useLoading = (ready: boolean, debounce = 0) => {\n const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);\n useEffect(() => {\n if (!debounce) {\n return;\n }\n\n const i = setInterval(() => {\n setStage((stage) => {\n switch (stage) {\n case LoadingState.Loading: {\n if (!ready) {\n return LoadingState.FadeIn;\n } else {\n clearInterval(i);\n return LoadingState.Done;\n }\n }\n\n case LoadingState.FadeIn: {\n if (ready) {\n return LoadingState.FadeOut;\n }\n break;\n }\n\n case LoadingState.FadeOut: {\n clearInterval(i);\n return LoadingState.Done;\n }\n }\n\n return stage;\n });\n }, debounce);\n\n return () => clearInterval(i);\n }, [debounce]);\n\n if (!debounce) {\n return ready ? LoadingState.Done : LoadingState.Loading;\n }\n\n return stage;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo } from 'react';\n\nimport { Capabilities } from '../../common';\nimport { usePluginManager } from '../components/PluginManagerProvider';\n\n/**\n * Hook to dynamically register an operation resolver (handler) within a React component.\n * The resolver is added when the component mounts and removed when it unmounts.\n *\n * @example\n * ```tsx\n * const scrollHandler = useMemo(() => OperationResolver.make({\n * operation: LayoutOperation.ScrollIntoView,\n * handler: (input) => Effect.sync(() => {\n * // Handle scroll\n * }),\n * }), [deps]);\n *\n * useOperationResolver(meta.id, scrollHandler);\n * ```\n */\nexport const useOperationResolver = (module: string, resolver: Capabilities.OperationResolver) => {\n const manager = usePluginManager();\n // Wrap single resolver in array as the capability expects an array.\n const resolverArray = useMemo(() => [resolver], [resolver]);\n\n useEffect(() => {\n manager.capabilities.contribute({\n module,\n interface: Capabilities.OperationResolver,\n implementation: resolverArray,\n });\n\n return () => manager.capabilities.remove(Capabilities.OperationResolver, resolverArray);\n }, [module, resolverArray]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useContext } from 'react';\n\n/**\n * Hook to read and update a settings atom.\n * Returns the current value and an update function.\n */\nexport const useSettingsState = <T>(\n atom: Atom.Writable<T>,\n): { settings: T; updateSettings: (fn: (current: T) => T) => void } => {\n const registry = useContext(RegistryContext);\n const settings = useAtomValue(atom);\n\n const updateSettings = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n\n return { settings, updateSettings };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { SurfaceContext } from '../components/surface/context';\n\nexport const useSurface = (): SurfaceContext => {\n return useContext(SurfaceContext) ?? raise(new Error('Missing SurfaceContext'));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { type Props } from './types';\n\nexport type SurfaceContext = Pick<Props, 'id' | 'role' | 'data'>;\n\n// TODO(burdon): Use @radix-ui/react-context\nexport const SurfaceContext: Context<SurfaceContext | undefined> = createContext<SurfaceContext | undefined>(undefined);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * from './types';\nexport { Surface } from './SurfaceComponent';\nexport { isSurfaceAvailable as isAvailable } from './SurfaceComponent';\nexport type { SurfaceContext as Root } from './context';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { PropsWithChildren, ReactNode, RefCallback } from 'react';\n\nimport type { MakeOptional, Position } from '@dxos/util';\n\nimport type { ErrorBoundary } from '..';\n\n/**\n * Props that are passed to the Surface component.\n */\nexport type Props<T extends Record<string, any> = Record<string, unknown>> = {\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n} & MakeOptional<CoreProps<T>, 'id' | 'data'> &\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n * Exclude known prop names to prevent overriding well-defined props.\n */\n {\n [K in keyof Record<string, any>]: K extends keyof CoreProps<T> | 'fallback' | 'placeholder' ? never : any;\n };\n\n/**\n * NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.\n */\nexport type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{\n /**\n * ID for debugging.\n */\n id: string;\n\n /**\n * Role defines how the data should be rendered.\n */\n role: string;\n\n /**\n * The data to be rendered by the surface.\n * NOTE: This must be a stable value.\n */\n data: T;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n}>;\n\n// TODO(burdon): Remove ref since relying on this would be error prone.\nexport type ComponentProps<T extends Record<string, any> = Record<string, any>> = CoreProps<T> & {\n ref?: RefCallback<HTMLElement>;\n} & Record<string, any>;\n\n/**\n * React component used to render a surface once is has matched.\n */\nexport type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (\n props: ComponentProps<T>,\n) => ReactNode;\n\n/**\n * Definition of when a React component surface should be rendered.\n */\nexport type ReactDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'react';\n id: string;\n role: string | string[];\n position?: Position;\n component: ComponentFunction<T>;\n filter?: (data: Record<string, unknown>) => data is T;\n}>;\n\n/**\n * Definition of when a Web Component surface should be rendered.\n */\nexport type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'web-component';\n id: string;\n role: string | string[];\n position?: Position;\n /**\n * The tag name of the Web Component to render.\n * The Web Component will receive the same props as React surfaces via properties/attributes.\n */\n tagName: string;\n filter?: (data: Record<string, unknown>) => data is T;\n}>;\n\n/**\n * Definition of when a surface (React or Web Component) should be rendered.\n */\nexport type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;\n\n/**\n * Creates a React surface definition.\n */\nexport const create = <T extends Record<string, any> = any>(\n definition: Omit<ReactDefinition<T>, 'kind'>,\n): ReactDefinition<T> => ({ ...definition, kind: 'react' });\n\n/**\n * Creates a Web Component surface definition.\n */\nexport const createWeb = <T extends Record<string, any> = any>(\n definition: Omit<WebComponentDefinition<T>, 'kind'>,\n): WebComponentDefinition<T> => ({ ...definition, kind: 'web-component' });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n Fragment,\n type NamedExoticComponent,\n type RefAttributes,\n Suspense,\n forwardRef,\n memo,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { log } from '@dxos/log';\nimport { useDefaultValue } from '@dxos/react-hooks';\nimport { ScrollArea } from '@dxos/react-ui';\nimport { byPosition } from '@dxos/util';\n\nimport { Capabilities } from '../../../common';\nimport { type CapabilityManager } from '../../../core';\nimport { useCapabilities } from '../../hooks';\nimport { ErrorBoundary } from '../ErrorBoundary';\n\nimport { SurfaceContext } from './context';\nimport { SurfaceInfo } from './SurfaceInfo';\nimport { type Definition, type Props, type WebComponentDefinition } from './types';\n\nconst DEFAULT_PLACEHOLDER = <Fragment />;\n\nconst DEBUG = import.meta.env.VITE_DEBUG;\n\n/**\n * Wrapper component for rendering Web Component surfaces.\n * Handles creation, prop setting, and cleanup of Web Components.\n */\nconst WebComponentWrapper = memo(\n forwardRef<HTMLElement, Props & { definition: WebComponentDefinition }>(\n ({ id, role, data, limit, definition, ...rest }, forwardedRef) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const elementRef = useRef<HTMLElement | null>(null);\n const propsRef = useRef({ id, role, data, limit, ...rest });\n\n // Update props ref on every render\n propsRef.current = { id, role, data, limit, ...rest };\n\n // Create element only once\n useEffect(() => {\n if (!containerRef.current || elementRef.current) {\n return;\n }\n\n // Create the Web Component\n const element = document.createElement(definition.tagName);\n elementRef.current = element;\n\n // Set initial properties on the Web Component\n Object.assign(element, propsRef.current);\n\n // Append to container\n containerRef.current.appendChild(element);\n\n // Setup ref forwarding if provided\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n\n // Cleanup on unmount to prevent memory leaks\n return () => {\n if (elementRef.current && containerRef.current?.contains(elementRef.current)) {\n containerRef.current.removeChild(elementRef.current);\n }\n if (typeof forwardedRef === 'function') {\n forwardedRef(null);\n } else if (forwardedRef) {\n forwardedRef.current = null;\n }\n elementRef.current = null;\n };\n }, [definition.tagName, forwardedRef]);\n\n // Update props on existing element without recreating it\n // This runs on every render to ensure all props (including those in `rest`) are kept up to date\n useEffect(() => {\n const element = elementRef.current;\n if (!element) {\n return;\n }\n\n // Update properties on the existing Web Component\n Object.assign(element, propsRef.current);\n });\n\n return <div ref={containerRef} />;\n },\n ),\n);\n\nWebComponentWrapper.displayName = 'WebComponentWrapper';\n\n/**\n * Wrapper component that provides context for a surface.\n */\nconst SurfaceContextProvider = memo(\n forwardRef<HTMLElement, Props & { definition: Definition }>(\n ({ id, role, data, limit, fallback = DefaultFallback, definition, ...rest }, forwardedRef) => {\n const contextValue = useMemo(() => ({ id, role, data }), [id, role, data]);\n\n // Handle Web Component surfaces\n if (definition.kind === 'web-component') {\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <SurfaceContext.Provider value={contextValue}>\n <WebComponentWrapper\n id={id}\n role={role}\n data={data}\n limit={limit}\n definition={definition}\n ref={forwardedRef}\n {...rest}\n />\n </SurfaceContext.Provider>\n </ErrorBoundary>\n );\n }\n\n // Handle React component surfaces\n const Component = definition.component;\n\n // TODO(burdon): Remove from production build?\n const debug = DEBUG || '__DX_DEBUG__' in window;\n if (debug) {\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <div role='none' className='contents' data-id={id} data-role={role}>\n <SurfaceContext.Provider value={contextValue}>\n <SurfaceInfo ref={forwardedRef}>\n <Component id={id} role={role} data={data} limit={limit} {...rest} />\n </SurfaceInfo>\n </SurfaceContext.Provider>\n </div>\n </ErrorBoundary>\n );\n }\n\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <div role='none' className='contents' data-id={id} data-role={role}>\n <SurfaceContext.Provider value={contextValue}>\n <Component id={id} role={role} data={data} limit={limit} {...rest} ref={forwardedRef} />\n </SurfaceContext.Provider>\n </div>\n </ErrorBoundary>\n );\n },\n ),\n);\n\nSurfaceContextProvider.displayName = 'SurfaceContextProvider';\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\n// TODO(burdon): Remove ref since relying on this would be error prone.\nexport const Surface: NamedExoticComponent<Props & RefAttributes<HTMLElement>> = memo(\n forwardRef(({ id: _id, role, data: dataProp, limit, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {\n const data = useDefaultValue(dataProp, () => ({}));\n\n // TODO(wittjosiah): This will make all surfaces depend on a single signal.\n // This isn't ideal because it means that any change to the data will cause all surfaces to re-render.\n // This effectively means that plugin modules which contribute surfaces need to all be activated at startup.\n // This should be fine for now because it's how it worked prior to capabilities api anyway.\n // In the future, it would be nice to be able to bucket the surface contributions by role.\n const surfaces = useSurfaces();\n\n // NOTE: Memoizing the candidates makes the surface not re-render based on reactivity within data.\n const definitions = findCandidates(surfaces, { role, data });\n const candidates = limit ? definitions.slice(0, limit) : definitions;\n if (DEBUG && candidates.length === 0) {\n log.warn('no candidates for surface', { role, data });\n return null;\n }\n\n return (\n <Suspense fallback={placeholder}>\n {candidates.map((definition) => (\n <SurfaceContextProvider\n key={definition.id}\n id={definition.id}\n role={role}\n data={data}\n limit={limit}\n definition={definition}\n ref={forwardedRef}\n {...rest}\n />\n ))}\n </Suspense>\n );\n }),\n);\n\nSurface.displayName = 'Surface';\n\nconst findCandidates = (surfaces: Definition[], { role, data }: Pick<Props, 'role' | 'data'>) => {\n return Object.values(surfaces)\n .filter((definition) =>\n Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,\n )\n .filter(({ filter }) => (filter ? filter(data ?? {}) : true))\n .toSorted(byPosition);\n};\n\n// TODO(burdon): Make user facing, with telemetry.\n// TODO(burdon): Change based on dev/prod mode; infer subject type, id.\nconst DefaultFallback = ({ data, error, dev }: { data: any; error: Error; dev?: boolean }) => {\n if (dev) {\n return (\n <ScrollArea.Root orientation='vertical'>\n <ScrollArea.Viewport classNames='p-4 gap-4'>\n <h1 className='flex gap-2 text-sm mbs-2'>{error.message}</h1>\n <pre className='overflow-auto text-xs text-description'>{JSON.stringify(data, null, 2)}</pre>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n }\n\n return (\n <ScrollArea.Root orientation='vertical'>\n <ScrollArea.Viewport classNames='p-4 gap-4 border border-roseFill'>\n <h1 className='flex gap-2 text-sm mbs-2 text-errorText'>{error.message}</h1>\n <pre className='overflow-x-auto text-xs text-description'>{error.stack}</pre>\n <pre className='overflow-x-auto text-xs text-description'>{JSON.stringify(data, null, 2)}</pre>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n};\n\n/**\n * @internal\n */\nexport const useSurfaces = () => {\n const surfaces = useCapabilities(Capabilities.ReactSurface);\n return useMemo(() => surfaces.flat(), [surfaces]);\n};\n\n/**\n * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.\n */\nexport const isSurfaceAvailable = (\n capabilityManager: CapabilityManager.CapabilityManager,\n { role, data }: Pick<Props, 'role' | 'data'>,\n) => {\n const surfaces = capabilityManager.getAll(Capabilities.ReactSurface);\n const candidates = findCandidates(surfaces.flat(), { role, data });\n return candidates.length > 0;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n type ReactElement,\n type Ref,\n cloneElement,\n forwardRef,\n useCallback,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { addEventListener, combine } from '@dxos/async';\nimport { useMergeRefs } from '@dxos/react-hooks';\n\nimport { useSurface } from '../../hooks';\n\nexport type SurfaceInfoProps = {\n children: ReactElement<{ ref?: Ref<HTMLElement> }>;\n};\n\n/**\n * Debug wrapper for surfaces.\n */\nexport const SurfaceInfo = forwardRef<HTMLElement, SurfaceInfoProps>(({ children }, forwardedRef) => {\n const [rect, setRect] = useState<DOMRect | null>(null);\n const [expand, setExpand] = useState(false);\n const info = useSurface();\n\n const [root, setRoot] = useState<HTMLElement | null>(null);\n const measureRef = useCallback((node: HTMLElement | null) => setRoot(node), []);\n const mergedRef = useMergeRefs([measureRef, forwardedRef]);\n const childWithRef = cloneElement(children, { ref: mergedRef });\n\n useLayoutEffect(() => {\n if (!root) {\n setRect(null);\n return;\n }\n\n const measure = () => {\n setRect(root.getBoundingClientRect());\n };\n\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n measure();\n\n return combine(\n addEventListener(window, 'scroll', measure, true),\n addEventListener(window, 'resize', measure),\n () => {\n observer.disconnect();\n },\n );\n }, [root]);\n\n const padding = 0;\n return (\n <>\n {childWithRef}\n {rect &&\n createPortal(\n <div\n role='none'\n className='z-[100] fixed flex flex-col-reverse scrollbar-none overflow-auto pointer-events-none'\n style={{\n top: rect.top + padding,\n left: rect.left + padding,\n width: rect.width - padding * 2,\n height: rect.height - padding * 2,\n }}\n >\n {expand ? (\n <div\n className='absolute inset-0 bg-deckSurface border border-green-500 cursor-pointer pointer-events-auto overflow-auto'\n onPointerDown={(ev) => ev.stopPropagation()}\n onClick={(ev) => {\n ev.stopPropagation();\n setExpand(false);\n }}\n >\n <pre className='p-2 text-xs text-description font-mono'>{JSON.stringify({ info }, null, 2)}</pre>\n </div>\n ) : (\n <span\n 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'\n title={info.id}\n onPointerDown={(ev) => ev.stopPropagation()}\n onClick={(ev) => {\n ev.stopPropagation();\n setExpand(true);\n }}\n >\n ⓘ\n </span>\n )}\n </div>,\n // TODO(burdon): Create well-known element to gather all debug portals.\n document.body,\n )}\n </>\n );\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAIA,OAAOA,YAAuC;;;ACSvC,IAAMC,kBAAkB,CAA2BC,UAAAA;AACxD,QAAMC,kBAAkB,CAACC,QAAgBC,OAAO,oBAAIC,IAAAA,GAAeC,OAAO,oBAAID,IAAAA,MAAa;AACzF,QAAIC,KAAKC,IAAIJ,MAAAA,GAAS;AACpB,YAAM,IAAIK,MAAM,0CAA0CL,MAAAA,EAAQ;IACpE;AACA,QAAIC,KAAKG,IAAIJ,MAAAA,GAAS;AACpB,aAAO,CAAA;IACT;AAEA,UAAMM,OAAOR,MAAMS,KAAK,CAACC,MAAMA,EAAEC,OAAOT,MAAAA;AACxC,QAAI,CAACM,MAAM;AACT,YAAM,IAAID,MAAM,QAAQL,MAAAA,0CAAgD;IAC1E;AAEA,UAAMU,UAAU,oBAAIR,IAAI;SAAIC;MAAMH;KAAO;AACzC,UAAMW,UAAU,oBAAIT,IAAI;SAAID;MAAMD;KAAO;AAEzC,UAAMY,YAAYN,KAAKM,aAAa,CAAA;AACpC,WAAO;SAAIA,UAAUC,QAAQ,CAACC,UAAUf,gBAAgBe,OAAOH,SAASD,OAAAA,CAAAA;MAAWV;;EACrF;AAGA,QAAMe,kBAAkBjB,MACrBkB,IAAI,CAACV,SAASA,KAAKG,EAAE,EACrBI,QAAQ,CAACJ,OAAOV,gBAAgBU,EAAAA,CAAAA,EAChCQ,OAAO,CAACR,IAAIS,OAAOC,SAASA,KAAKC,QAAQX,EAAAA,MAAQS,KAAAA;AAGpD,SAAOH,gBACJC,IAAI,CAACP,OAAOX,MAAMS,KAAK,CAACD,SAASA,KAAKG,OAAOA,EAAAA,CAAAA,EAC7CQ,OAAO,CAACX,SAAoBA,SAASe,MAAAA;AAC1C;;;ACxCA,SAASC,uBAAuB;AAChC,YAAYC,YAAY;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path", "has", "Error", "node", "find", "n", "id", "newPath", "newSeen", "dependsOn", "flatMap", "depId", "allDependencies", "map", "filter", "index", "self", "indexOf", "undefined", "RegistryContext", "Effect", "Fiber", "PubSub", "Queue", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "runAndForwardErrors", "invariant", "log", "useAsyncEffect", "useDefaultValue", "ContextProtocolProvider", "React", "DefaultFallback", "error", "div", "style", "margin", "padding", "overflow", "border", "borderRadius", "h1", "fontSize", "message", "pre", "whiteSpace", "color", "stack", "React", "Component", "ErrorBoundary", "Component", "getDerivedStateFromError", "error", "state", "undefined", "componentDidUpdate", "prevProps", "data", "props", "resetError", "render", "Fallback", "fallback", "DefaultFallback", "React", "children", "setState", "div", "className", "h1", "message", "pre", "JSON", "stringify", "createContext", "useContext", "raise", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "ENABLED_KEY", "useApp", "pluginManager", "pluginLoader", "pluginLoaderProp", "plugins", "pluginsProp", "core", "coreProp", "defaults", "defaultsProp", "setupEvents", "setupEventsProp", "placeholder", "fallback", "DefaultFallback", "cacheEnabled", "safeMode", "debounce", "timeout", "useDefaultValue", "map", "meta", "id", "useMemo", "sync", "plugin", "find", "invariant", "readyRef", "useRef", "ready", "setReady", "useState", "errorRef", "error", "setError", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "length", "manager", "PluginManager", "make", "useEffect", "registry", "subscribe", "value", "setItem", "stringify", "setupDevtools", "useAsyncEffect", "capabilities", "contribute", "interface", "Capabilities", "implementation", "module", "AtomRegistry", "fiber", "gen", "queue", "activation", "listener", "forkDaemon", "take", "pipe", "tap", "event", "state", "error$", "ActivationEvents", "Startup", "clearTimeout", "timeoutId", "current", "forever", "all", "activate", "SetupReactSurface", "join", "scoped", "runFork", "setTimeout", "log", "warn", "eventsFired", "getEventsFired", "activeModules", "getActive", "pendingReset", "getPendingReset", "runAndForwardErrors", "interrupt", "Error", "remove", "useCallback", "React", "ErrorBoundary", "PluginManagerProvider", "ContextProtocolProvider", "context", "PluginManagerContext", "RegistryContext", "Provider", "App", "globalThis", "composer", "useAtomValue", "useCallback", "invariant", "useCapabilities", "interfaceDef", "manager", "usePluginManager", "useAtomValue", "capabilities", "atom", "useCapability", "invariant", "length", "identifier", "useAtomCapability", "atomCapability", "useAtomCapabilityState", "registry", "Capabilities", "AtomRegistry", "value", "update", "useCallback", "fn", "set", "get", "useOperationInvoker", "OperationInvoker", "useEffect", "useState", "LoadingState", "useLoading", "ready", "debounce", "stage", "setStage", "useState", "useEffect", "i", "setInterval", "clearInterval", "useEffect", "useMemo", "useOperationResolver", "module", "resolver", "manager", "usePluginManager", "resolverArray", "useMemo", "useEffect", "capabilities", "contribute", "interface", "Capabilities", "OperationResolver", "implementation", "remove", "RegistryContext", "useAtomValue", "useCallback", "useContext", "useSettingsState", "atom", "registry", "useContext", "RegistryContext", "settings", "useAtomValue", "updateSettings", "useCallback", "fn", "set", "get", "useContext", "raise", "createContext", "SurfaceContext", "createContext", "undefined", "useSurface", "useContext", "SurfaceContext", "raise", "Error", "App", "placeholder", "Placeholder", "ready", "error", "debounce", "reactContexts", "useCapabilities", "Capabilities", "ReactContext", "reactRoots", "ReactRoot", "stage", "useLoading", "LoadingState", "Done", "React", "ComposedContext", "composeContexts", "map", "id", "root", "Component", "key", "contexts", "length", "children", "topologicalSort", "context", "reduce", "Acc", "Next", "create", "definition", "kind", "createWeb", "React", "Fragment", "Suspense", "forwardRef", "memo", "useEffect", "useMemo", "useRef", "log", "useDefaultValue", "ScrollArea", "byPosition", "React", "cloneElement", "forwardRef", "useCallback", "useLayoutEffect", "useState", "createPortal", "addEventListener", "combine", "useMergeRefs", "SurfaceInfo", "forwardRef", "children", "forwardedRef", "rect", "setRect", "useState", "expand", "setExpand", "info", "useSurface", "root", "setRoot", "measureRef", "useCallback", "node", "mergedRef", "useMergeRefs", "childWithRef", "cloneElement", "ref", "useLayoutEffect", "measure", "getBoundingClientRect", "observer", "ResizeObserver", "observe", "combine", "addEventListener", "window", "disconnect", "padding", "React", "createPortal", "div", "role", "className", "style", "top", "left", "width", "height", "onPointerDown", "ev", "stopPropagation", "onClick", "pre", "JSON", "stringify", "span", "title", "id", "document", "body", "DEFAULT_PLACEHOLDER", "React", "Fragment", "DEBUG", "env", "VITE_DEBUG", "WebComponentWrapper", "memo", "forwardRef", "id", "role", "data", "limit", "definition", "rest", "forwardedRef", "containerRef", "useRef", "elementRef", "propsRef", "current", "useEffect", "element", "document", "createElement", "tagName", "Object", "assign", "appendChild", "contains", "removeChild", "div", "ref", "displayName", "SurfaceContextProvider", "fallback", "DefaultFallback", "contextValue", "useMemo", "kind", "ErrorBoundary", "SurfaceContext", "Provider", "value", "Component", "component", "debug", "window", "className", "data-id", "data-role", "SurfaceInfo", "Surface", "_id", "dataProp", "placeholder", "useDefaultValue", "surfaces", "useSurfaces", "definitions", "findCandidates", "candidates", "slice", "length", "log", "warn", "Suspense", "map", "key", "values", "filter", "Array", "isArray", "includes", "toSorted", "byPosition", "error", "dev", "ScrollArea", "Root", "orientation", "Viewport", "classNames", "h1", "message", "pre", "JSON", "stringify", "stack", "useCapabilities", "Capabilities", "ReactSurface", "flat", "isSurfaceAvailable", "capabilityManager", "getAll"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/core/capability.ts
|
|
6
|
+
var capability_exports = {};
|
|
7
|
+
__export(capability_exports, {
|
|
8
|
+
ModuleTag: () => ModuleTag,
|
|
9
|
+
Service: () => Service,
|
|
10
|
+
atom: () => atom,
|
|
11
|
+
contributes: () => contributes,
|
|
12
|
+
get: () => get,
|
|
13
|
+
getAll: () => getAll,
|
|
14
|
+
getModuleTag: () => getModuleTag,
|
|
15
|
+
lazy: () => lazy,
|
|
16
|
+
make: () => make,
|
|
17
|
+
makeModule: () => makeModule,
|
|
18
|
+
waitFor: () => waitFor
|
|
19
|
+
});
|
|
20
|
+
import * as Context from "effect/Context";
|
|
21
|
+
import * as Effect from "effect/Effect";
|
|
22
|
+
var Service = class extends Context.Tag("@dxos/app-framework/CapabilityManager")() {
|
|
23
|
+
};
|
|
24
|
+
var get = (interfaceDef) => Effect.flatMap(Service, (manager) => Effect.try({
|
|
25
|
+
try: () => manager.get(interfaceDef),
|
|
26
|
+
catch: (error) => error instanceof Error ? error : new Error(String(error))
|
|
27
|
+
}));
|
|
28
|
+
var getAll = (interfaceDef) => Effect.map(Service, (manager) => manager.getAll(interfaceDef));
|
|
29
|
+
var waitFor = (interfaceDef) => Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));
|
|
30
|
+
var atom = (interfaceDef) => Effect.map(Service, (manager) => manager.atom(interfaceDef));
|
|
31
|
+
var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
|
|
32
|
+
var ModuleTag = Symbol.for("@dxos/app-framework/ModuleTag");
|
|
33
|
+
var make = (identifier) => {
|
|
34
|
+
return {
|
|
35
|
+
identifier
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
var contributes = (interfaceDef, implementation, deactivate) => {
|
|
39
|
+
return {
|
|
40
|
+
interface: interfaceDef,
|
|
41
|
+
implementation,
|
|
42
|
+
deactivate
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var lazy = (name, c) => {
|
|
46
|
+
const lazyFn = (props) => Effect.gen(function* () {
|
|
47
|
+
const { default: getCapability } = yield* Effect.tryPromise(() => c());
|
|
48
|
+
const result = yield* getCapability(props);
|
|
49
|
+
const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [
|
|
50
|
+
result
|
|
51
|
+
];
|
|
52
|
+
return normalized;
|
|
53
|
+
});
|
|
54
|
+
return Object.assign(lazyFn, {
|
|
55
|
+
[ModuleTag]: name
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var getModuleTag = (capability) => {
|
|
59
|
+
return capability && typeof capability === "function" && ModuleTag in capability ? String(capability[ModuleTag]) : void 0;
|
|
60
|
+
};
|
|
61
|
+
var makeModule = (fn) => fn;
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
Service,
|
|
65
|
+
get,
|
|
66
|
+
getAll,
|
|
67
|
+
waitFor,
|
|
68
|
+
atom,
|
|
69
|
+
ModuleTag,
|
|
70
|
+
make,
|
|
71
|
+
contributes,
|
|
72
|
+
lazy,
|
|
73
|
+
getModuleTag,
|
|
74
|
+
makeModule,
|
|
75
|
+
capability_exports
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=chunk-ZQO3UZ4R.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/core/capability.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\n\nimport type * as CapabilityManager from './capability-manager';\nimport type * as Plugin from './plugin';\n\n//\n// Capability Service Layer\n//\n\n/**\n * Effect Context.Tag for accessing CapabilityManager via the Effect layer system.\n * This allows capability modules to access the capability manager without having it passed as an argument.\n */\nexport class Service extends Context.Tag('@dxos/app-framework/CapabilityManager')<\n Service,\n CapabilityManager.CapabilityManager\n>() {}\n\n/**\n * Get a single capability from the capability manager.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation.\n * @throws If no capability is found.\n */\n// TODO(wittjosiah): Add custom tagged errors (Data.TaggedError) for app-framework to enable\n// type-safe error handling with Effect. Consider CapabilityNotFoundError, ModuleActivationError, etc.\nexport const get = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) =>\n Effect.try({\n try: () => manager.get(interfaceDef),\n catch: (error) => (error instanceof Error ? error : new Error(String(error))),\n }),\n );\n\n/**\n * Get all capabilities from the capability manager for a given interface.\n * @param interfaceDef The interface definition of the capability.\n * @returns An array of capability implementations.\n */\nexport const getAll = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T[], never, Service> =>\n Effect.map(Service, (manager) => manager.getAll(interfaceDef));\n\n/**\n * Wait for a capability to be available.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation once available.\n */\nexport const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));\n\n/**\n * Get the Atom reference to capabilities for reactive access.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing the array of capability implementations.\n */\nexport const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>\n Effect.map(Service, (manager) => manager.atom(interfaceDef));\n\nconst InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');\n\n/**\n * Symbol used to tag lazy capability functions with their module ID.\n */\nexport const ModuleTag: unique symbol = Symbol.for('@dxos/app-framework/ModuleTag');\n\n/**\n * The interface definition of a capability.\n */\nexport type InterfaceDef<T> = {\n [InterfaceDefTypeId]: T;\n identifier: string;\n};\n\nexport namespace InterfaceDef {\n export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;\n}\n\n/**\n * Helper to define the interface of a capability.\n */\nexport const make = <T>(identifier: string) => {\n return { identifier } as InterfaceDef<T>;\n};\n\n/**\n * A unique string identifier with a Typescript type associated with it.\n * When a capability is contributed to the application an implementation of the interface is provided.\n */\nexport type Capability<T> = {\n /**\n * The interface definition of the capability.\n */\n readonly interface: InterfaceDef<T>;\n\n /**\n * The implementation of the capability.\n */\n readonly implementation: T;\n\n /**\n * Called when the capability is deactivated.\n */\n readonly deactivate?: () => Effect.Effect<void, Error>;\n};\n\nexport type Any = Capability<any>;\n\n/**\n * Union type representing all valid return types for a capability module.\n * Supports single capabilities, arrays, and tuples of different capability types.\n */\nexport type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]] | readonly [Any, ...Any[]];\n\n/**\n * Helper to define the implementation of a capability.\n */\nexport const contributes = <I extends InterfaceDef<any>>(\n interfaceDef: I,\n implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],\n deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],\n): Capability<I> => {\n return {\n interface: interfaceDef,\n implementation,\n deactivate,\n } satisfies Capability<I>;\n};\n\ntype LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\ntype LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\n\ntype NormalizeReturn<R> = R extends readonly (infer A)[]\n ? A[]\n : R extends (infer A)[]\n ? A[]\n : R extends Any\n ? [R]\n : Any[];\n\nexport type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (\n props?: Props,\n) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;\n\n/**\n * Helper to define a lazily loaded implementation of a capability.\n * Supports single capabilities, arrays, and tuples of different capability types.\n * @param name The export name (e.g., 'AppGraphBuilder') - used to auto-compute module IDs.\n * @param loader The lazy loader function.\n * @returns A lazy capability function with ModuleTag symbol attached.\n */\nexport const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(\n name: string,\n c: LoadCapability<T, R> | LoadCapabilities<T, R>,\n): LazyCapability<T, R> => {\n const lazyFn: LazyCapability<T, R> = (props?: T) =>\n Effect.gen(function* () {\n const { default: getCapability } = yield* Effect.tryPromise(() => c());\n const result = yield* getCapability(props);\n const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];\n return normalized as NormalizeReturn<R>;\n });\n\n return Object.assign(lazyFn, { [ModuleTag]: name });\n};\n\n/**\n * Gets the module tag (export name) from a lazy capability function.\n * @param capability The lazy capability function.\n * @returns The module tag if present, undefined otherwise.\n */\n// TODO(wittjosiah): Stricter type for capability.\nexport const getModuleTag = (capability: unknown): string | undefined => {\n return capability && typeof capability === 'function' && ModuleTag in capability\n ? String(capability[ModuleTag])\n : undefined;\n};\n\n/**\n * Helper to define a capability module with explicit typing.\n * Wraps the default export function to provide better type inference and make the pattern explicit.\n *\n * This helper provides explicit typing for the module activation function,\n * making it clear that the function should:\n * - Access CapabilityManager via the Effect layer system (Capability.get, Capability.getAll, etc.)\n * - Return a capability, array of capabilities, or tuple of different capability types (sync or async)\n *\n * Supports returning multiple capabilities of different types as a tuple, which will be normalized\n * to an array at runtime for compatibility with the plugin system.\n *\n * @example\n * ```ts\n * // Module without options - single capability\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * const client = yield* Capability.get(ClientCapabilities.Client);\n * return contributes(Capabilities.SettingsStore, store);\n * })\n * );\n *\n * // Module with multiple capabilities\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * return [\n * contributes(Capabilities.SettingsStore, store),\n * contributes(Capabilities.Translations, translations),\n * ];\n * })\n * );\n *\n * // Module with additional options (context accessed via layer)\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* ({ observability }: { observability?: boolean }) {\n * const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n * return contributes(Capabilities.IntentResolver, ...);\n * })\n * );\n * ```\n */\nexport const makeModule = <\n TProps = void,\n TReturn extends ModuleReturn = ModuleReturn,\n E extends Error = Error,\n R extends Service | Plugin.Service | never = Service,\n>(\n fn: (props?: TProps) => Effect.Effect<TReturn, E, R>,\n): ((props?: TProps) => Effect.Effect<TReturn, E, R>) => fn;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;;;;;;;;;;AAKA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AAajB,IAAMC,UAAN,cAA8BC,YAAI,uCAAA,EAAA,EAAA;AAGpC;AAUE,IAAMC,MAAM,CAAIC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WAAWxB,SAAAA,CAAU,IAC5ByB;AACN;AA2CO,IAAMC,aAAa,CAMxBC,OACuDA;",
|
|
6
|
+
"names": ["Context", "Effect", "Service", "Tag", "get", "interfaceDef", "flatMap", "manager", "try", "catch", "error", "Error", "String", "getAll", "map", "waitFor", "atom", "InterfaceDefTypeId", "Symbol", "for", "ModuleTag", "make", "identifier", "contributes", "implementation", "deactivate", "interface", "lazy", "name", "c", "lazyFn", "props", "gen", "default", "getCapability", "tryPromise", "result", "normalized", "Array", "isArray", "from", "Object", "assign", "getModuleTag", "capability", "undefined", "makeModule", "fn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "../chunk-4DQMLMGU.mjs";
|
|
2
|
+
import {
|
|
3
|
+
capabilities_exports
|
|
4
|
+
} from "../chunk-IGRQWMWW.mjs";
|
|
5
|
+
import {
|
|
6
|
+
activation_events_exports
|
|
7
|
+
} from "../chunk-NPUEVX42.mjs";
|
|
8
|
+
import "../chunk-YAFEA4GV.mjs";
|
|
9
|
+
import {
|
|
10
|
+
plugin_manager_exports
|
|
11
|
+
} from "../chunk-WGWEEBUV.mjs";
|
|
12
|
+
import "../chunk-PKQT6C53.mjs";
|
|
13
|
+
import {
|
|
14
|
+
plugin_exports
|
|
15
|
+
} from "../chunk-KWP6PKIU.mjs";
|
|
16
|
+
import {
|
|
17
|
+
capability_exports
|
|
18
|
+
} from "../chunk-ZQO3UZ4R.mjs";
|
|
19
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
20
|
+
|
|
21
|
+
// src/cli/cli.ts
|
|
22
|
+
import * as Command from "@effect/cli/Command";
|
|
23
|
+
import * as Effect from "effect/Effect";
|
|
24
|
+
import * as Layer from "effect/Layer";
|
|
25
|
+
import { invariant } from "@dxos/invariant";
|
|
26
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/cli/cli.ts";
|
|
27
|
+
var defaultPluginLoader = (plugins) => (id) => Effect.sync(() => {
|
|
28
|
+
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
29
|
+
invariant(plugin, `Plugin not found: ${id}`, {
|
|
30
|
+
F: __dxlog_file,
|
|
31
|
+
L: 19,
|
|
32
|
+
S: void 0,
|
|
33
|
+
A: [
|
|
34
|
+
"plugin",
|
|
35
|
+
"`Plugin not found: ${id}`"
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
return plugin;
|
|
39
|
+
});
|
|
40
|
+
var createCliApp = Effect.fn(function* ({ rootCommand, subCommands: subCommandsProp, pluginManager: pluginManagerProp, pluginLoader: pluginLoaderProp, plugins: pluginsProp = [], core: coreProp, enabled: enabledProp = [], safeMode = false }) {
|
|
41
|
+
const plugins = pluginsProp;
|
|
42
|
+
const core = coreProp ?? plugins.map(({ meta }) => meta.id);
|
|
43
|
+
const pluginLoader = pluginLoaderProp ?? defaultPluginLoader(plugins);
|
|
44
|
+
const enabled = safeMode ? [] : enabledProp;
|
|
45
|
+
const manager = pluginManagerProp ?? plugin_manager_exports.make({
|
|
46
|
+
pluginLoader,
|
|
47
|
+
plugins,
|
|
48
|
+
core,
|
|
49
|
+
enabled
|
|
50
|
+
});
|
|
51
|
+
manager.capabilities.contribute({
|
|
52
|
+
interface: capabilities_exports.PluginManager,
|
|
53
|
+
implementation: manager,
|
|
54
|
+
module: "dxos.org/app-framework/plugin-manager"
|
|
55
|
+
});
|
|
56
|
+
manager.capabilities.contribute({
|
|
57
|
+
interface: capabilities_exports.AtomRegistry,
|
|
58
|
+
implementation: manager.registry,
|
|
59
|
+
module: "dxos.org/app-framework/atom-registry"
|
|
60
|
+
});
|
|
61
|
+
yield* manager.activate(activation_events_exports.Startup);
|
|
62
|
+
const layers = manager.capabilities.getAll(capabilities_exports.Layer);
|
|
63
|
+
const capabilityServiceLayer = Layer.succeed(capability_exports.Service, manager.capabilities);
|
|
64
|
+
const pluginServiceLayer = Layer.succeed(plugin_exports.Service, manager);
|
|
65
|
+
const layer = Layer.mergeAll(capabilityServiceLayer, pluginServiceLayer, ...layers);
|
|
66
|
+
const pluginCommands = manager.capabilities.getAll(capabilities_exports.Command);
|
|
67
|
+
const subCommands = subCommandsProp ? [
|
|
68
|
+
...subCommandsProp,
|
|
69
|
+
...pluginCommands
|
|
70
|
+
] : pluginCommands;
|
|
71
|
+
invariant(subCommands.length > 0, "No subcommands provided", {
|
|
72
|
+
F: __dxlog_file,
|
|
73
|
+
L: 103,
|
|
74
|
+
S: this,
|
|
75
|
+
A: [
|
|
76
|
+
"subCommands.length > 0",
|
|
77
|
+
"'No subcommands provided'"
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
const command = rootCommand.pipe(Command.withSubcommands(subCommands));
|
|
81
|
+
return {
|
|
82
|
+
command,
|
|
83
|
+
layer
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
export {
|
|
87
|
+
createCliApp
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cli/cli.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Capability, Plugin, PluginManager } from '../core';\n\nconst defaultPluginLoader =\n (plugins: Plugin.Plugin[]): PluginManager.ManagerOptions['pluginLoader'] =>\n (id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n });\n\ntype SubCommands = [Command.Command<any, any, any, any>, ...Array<Command.Command<any, any, any, any>>];\n\nexport type CreateCliAppOptions = {\n rootCommand: Command.Command<any, any, any, any>;\n subCommands?: SubCommands;\n pluginManager?: PluginManager.PluginManager;\n pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];\n plugins?: Plugin.Plugin[];\n core?: string[];\n enabled?: string[];\n safeMode?: boolean;\n};\n\n/**\n * Creates a CLI application with plugin support.\n * Similar to useApp but for CLI environments.\n *\n * @example\n * const plugins = [ClientPluginCLI()];\n * const manager = await createCliApp({ plugins });\n * const commands = manager.capabilities.getAll(Capabilities.Command);\n *\n * @param options.pluginManager Optional existing PluginManager instance.\n * @param options.pluginLoader Function to load plugins by ID.\n * @param options.plugins All plugins available to the application.\n * @param options.core Core plugins which will always be enabled.\n * @param options.enabled Enabled plugins.\n * @param options.safeMode Whether to enable safe mode, which disables optional plugins.\n */\nexport const createCliApp = Effect.fn(function* ({\n rootCommand,\n subCommands: subCommandsProp,\n pluginManager: pluginManagerProp,\n pluginLoader: pluginLoaderProp,\n plugins: pluginsProp = [],\n core: coreProp,\n enabled: enabledProp = [],\n safeMode = false,\n}: CreateCliAppOptions) {\n const plugins = pluginsProp;\n const core = coreProp ?? plugins.map(({ meta }) => meta.id);\n const pluginLoader = pluginLoaderProp ?? defaultPluginLoader(plugins);\n const enabled = safeMode ? [] : enabledProp;\n const manager =\n pluginManagerProp ??\n PluginManager.make({\n pluginLoader,\n plugins,\n core,\n enabled,\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'dxos.org/app-framework/atom-registry',\n });\n\n // Activate startup event to load CLI commands and Effect layers.\n yield* manager.activate(ActivationEvents.Startup);\n\n // Gather all layers and merge them into a single layer.\n const layers = manager.capabilities.getAll(Capabilities.Layer);\n const capabilityServiceLayer = Layer.succeed(Capability.Service, manager.capabilities);\n const pluginServiceLayer = Layer.succeed(Plugin.Service, manager);\n const layer = (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(\n capabilityServiceLayer,\n pluginServiceLayer,\n ...layers,\n );\n\n // Gather all commands and provide them to the root command.\n const pluginCommands = manager.capabilities.getAll(Capabilities.Command);\n const subCommands = subCommandsProp ? [...subCommandsProp, ...pluginCommands] : pluginCommands;\n invariant(subCommands.length > 0, 'No subcommands provided');\n const command = rootCommand.pipe(Command.withSubcommands(subCommands as SubCommands));\n\n return { command, layer };\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AAEvB,SAASC,iBAAiB;;AAK1B,IAAMC,sBACJ,CAACC,YACD,CAACC,OACQC,YAAK,MAAA;AACV,QAAMC,SAASH,QAAQI,KAAK,CAACD,YAAWA,QAAOE,KAAKJ,OAAOA,EAAAA;AAC3DK,YAAUH,QAAQ,qBAAqBF,EAAAA,IAAI;;;;;;;;;AAC3C,SAAOE;AACT,CAAA;AA+BG,IAAMI,eAAsBC,UAAG,WAAW,EAC/CC,aACAC,aAAaC,iBACbC,eAAeC,mBACfC,cAAcC,kBACdf,SAASgB,cAAc,CAAA,GACvBC,MAAMC,UACNC,SAASC,cAAc,CAAA,GACvBC,WAAW,MAAK,GACI;AACpB,QAAMrB,UAAUgB;AAChB,QAAMC,OAAOC,YAAYlB,QAAQsB,IAAI,CAAC,EAAEjB,KAAI,MAAOA,KAAKJ,EAAE;AAC1D,QAAMa,eAAeC,oBAAoBhB,oBAAoBC,OAAAA;AAC7D,QAAMmB,UAAUE,WAAW,CAAA,IAAKD;AAChC,QAAMG,UACJV,qBACAW,uBAAcC,KAAK;IACjBX;IACAd;IACAiB;IACAE;EACF,CAAA;AAEFI,UAAQG,aAAaC,WAAW;IAC9BC,WAAWC,qBAAaL;IACxBM,gBAAgBP;IAChBQ,QAAQ;EACV,CAAA;AAEAR,UAAQG,aAAaC,WAAW;IAC9BC,WAAWC,qBAAaG;IACxBF,gBAAgBP,QAAQU;IACxBF,QAAQ;EACV,CAAA;AAGA,SAAOR,QAAQW,SAASC,0BAAiBC,OAAO;AAGhD,QAAMC,SAASd,QAAQG,aAAaY,OAAOT,qBAAaU,KAAK;AAC7D,QAAMC,yBAA+BC,cAAQC,mBAAWC,SAASpB,QAAQG,YAAY;AACrF,QAAMkB,qBAA2BH,cAAQI,eAAOF,SAASpB,OAAAA;AACzD,QAAMuB,QAAeC,eACnBP,wBACAI,oBAAAA,GACGP,MAAAA;AAIL,QAAMW,iBAAiBzB,QAAQG,aAAaY,OAAOT,qBAAaoB,OAAO;AACvE,QAAMvC,cAAcC,kBAAkB;OAAIA;OAAoBqC;MAAkBA;AAChF1C,YAAUI,YAAYwC,SAAS,GAAG,2BAAA;;;;;;;;;AAClC,QAAMC,UAAU1C,YAAY2C,KAAaC,wBAAgB3C,WAAAA,CAAAA;AAEzD,SAAO;IAAEyC;IAASL;EAAM;AAC1B,CAAA;",
|
|
6
|
+
"names": ["Command", "Effect", "Layer", "invariant", "defaultPluginLoader", "plugins", "id", "sync", "plugin", "find", "meta", "invariant", "createCliApp", "fn", "rootCommand", "subCommands", "subCommandsProp", "pluginManager", "pluginManagerProp", "pluginLoader", "pluginLoaderProp", "pluginsProp", "core", "coreProp", "enabled", "enabledProp", "safeMode", "map", "manager", "PluginManager", "make", "capabilities", "contribute", "interface", "Capabilities", "implementation", "module", "AtomRegistry", "registry", "activate", "ActivationEvents", "Startup", "layers", "getAll", "Layer", "capabilityServiceLayer", "succeed", "Capability", "Service", "pluginServiceLayer", "Plugin", "layer", "mergeAll", "pluginCommands", "Command", "length", "command", "pipe", "withSubcommands"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ManagedRuntimeReady,
|
|
3
|
+
OperationInvokerReady,
|
|
4
|
+
SetupLayer,
|
|
5
|
+
SetupOperationResolver,
|
|
6
|
+
SetupReactSurface,
|
|
7
|
+
Startup
|
|
8
|
+
} from "../chunk-NPUEVX42.mjs";
|
|
9
|
+
import "../chunk-YAFEA4GV.mjs";
|
|
10
|
+
import "../chunk-WGWEEBUV.mjs";
|
|
11
|
+
import "../chunk-PKQT6C53.mjs";
|
|
12
|
+
import "../chunk-KWP6PKIU.mjs";
|
|
13
|
+
import "../chunk-ZQO3UZ4R.mjs";
|
|
14
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
15
|
+
export {
|
|
16
|
+
ManagedRuntimeReady,
|
|
17
|
+
OperationInvokerReady,
|
|
18
|
+
SetupLayer,
|
|
19
|
+
SetupOperationResolver,
|
|
20
|
+
SetupReactSurface,
|
|
21
|
+
Startup
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=activation-events.mjs.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AtomRegistry,
|
|
3
|
+
Command,
|
|
4
|
+
HistoryTracker,
|
|
5
|
+
Layer,
|
|
6
|
+
ManagedRuntime,
|
|
7
|
+
Null,
|
|
8
|
+
OperationInvoker,
|
|
9
|
+
OperationResolver,
|
|
10
|
+
PluginManager,
|
|
11
|
+
ReactContext,
|
|
12
|
+
ReactRoot,
|
|
13
|
+
ReactSurface,
|
|
14
|
+
UndoMapping,
|
|
15
|
+
UndoRegistry,
|
|
16
|
+
getAtomValue,
|
|
17
|
+
subscribeAtom,
|
|
18
|
+
updateAtomValue
|
|
19
|
+
} from "../chunk-IGRQWMWW.mjs";
|
|
20
|
+
import "../chunk-YAFEA4GV.mjs";
|
|
21
|
+
import "../chunk-WGWEEBUV.mjs";
|
|
22
|
+
import "../chunk-PKQT6C53.mjs";
|
|
23
|
+
import "../chunk-KWP6PKIU.mjs";
|
|
24
|
+
import "../chunk-ZQO3UZ4R.mjs";
|
|
25
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
26
|
+
export {
|
|
27
|
+
AtomRegistry,
|
|
28
|
+
Command,
|
|
29
|
+
HistoryTracker,
|
|
30
|
+
Layer,
|
|
31
|
+
ManagedRuntime,
|
|
32
|
+
Null,
|
|
33
|
+
OperationInvoker,
|
|
34
|
+
OperationResolver,
|
|
35
|
+
PluginManager,
|
|
36
|
+
ReactContext,
|
|
37
|
+
ReactRoot,
|
|
38
|
+
ReactSurface,
|
|
39
|
+
UndoMapping,
|
|
40
|
+
UndoRegistry,
|
|
41
|
+
getAtomValue,
|
|
42
|
+
subscribeAtom,
|
|
43
|
+
updateAtomValue
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=capabilities.mjs.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
allOf,
|
|
3
|
+
eventKey,
|
|
4
|
+
getEvents,
|
|
5
|
+
isAllOf,
|
|
6
|
+
isOneOf,
|
|
7
|
+
make,
|
|
8
|
+
oneOf
|
|
9
|
+
} from "../chunk-PKQT6C53.mjs";
|
|
10
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
11
|
+
export {
|
|
12
|
+
allOf,
|
|
13
|
+
eventKey,
|
|
14
|
+
getEvents,
|
|
15
|
+
isAllOf,
|
|
16
|
+
isOneOf,
|
|
17
|
+
make,
|
|
18
|
+
oneOf
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=activation-event.mjs.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModuleTag,
|
|
3
|
+
Service,
|
|
4
|
+
atom,
|
|
5
|
+
contributes,
|
|
6
|
+
get,
|
|
7
|
+
getAll,
|
|
8
|
+
getModuleTag,
|
|
9
|
+
lazy,
|
|
10
|
+
make,
|
|
11
|
+
makeModule,
|
|
12
|
+
waitFor
|
|
13
|
+
} from "../chunk-ZQO3UZ4R.mjs";
|
|
14
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
15
|
+
export {
|
|
16
|
+
ModuleTag,
|
|
17
|
+
Service,
|
|
18
|
+
atom,
|
|
19
|
+
contributes,
|
|
20
|
+
get,
|
|
21
|
+
getAll,
|
|
22
|
+
getModuleTag,
|
|
23
|
+
lazy,
|
|
24
|
+
make,
|
|
25
|
+
makeModule,
|
|
26
|
+
waitFor
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=capability.mjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ManagerTypeId,
|
|
3
|
+
isManager,
|
|
4
|
+
make
|
|
5
|
+
} from "../chunk-WGWEEBUV.mjs";
|
|
6
|
+
import "../chunk-PKQT6C53.mjs";
|
|
7
|
+
import "../chunk-KWP6PKIU.mjs";
|
|
8
|
+
import "../chunk-ZQO3UZ4R.mjs";
|
|
9
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
10
|
+
export {
|
|
11
|
+
ManagerTypeId,
|
|
12
|
+
isManager,
|
|
13
|
+
make
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=plugin-manager.mjs.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PluginModuleTypeId,
|
|
3
|
+
PluginTypeId,
|
|
4
|
+
Service,
|
|
5
|
+
activate,
|
|
6
|
+
addModule,
|
|
7
|
+
define,
|
|
8
|
+
isPlugin,
|
|
9
|
+
isPluginModule,
|
|
10
|
+
make,
|
|
11
|
+
reset
|
|
12
|
+
} from "../chunk-KWP6PKIU.mjs";
|
|
13
|
+
import "../chunk-ZQO3UZ4R.mjs";
|
|
14
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
15
|
+
export {
|
|
16
|
+
PluginModuleTypeId,
|
|
17
|
+
PluginTypeId,
|
|
18
|
+
Service,
|
|
19
|
+
activate,
|
|
20
|
+
addModule,
|
|
21
|
+
define,
|
|
22
|
+
isPlugin,
|
|
23
|
+
isPluginModule,
|
|
24
|
+
make,
|
|
25
|
+
reset
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=plugin.mjs.map
|