@dxos/app-framework 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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 +2 -4
- package/.storybook/preview.mts +2 -2
- package/dist/lib/browser/capability-BBBBAPDI.mjs +38 -0
- package/dist/lib/browser/capability-BBBBAPDI.mjs.map +7 -0
- package/dist/lib/browser/capability-OP63CD5N.mjs +35 -0
- package/dist/lib/browser/capability-OP63CD5N.mjs.map +7 -0
- package/dist/lib/browser/chunk-2CKCJ6PN.mjs +79 -0
- package/dist/lib/browser/chunk-2CKCJ6PN.mjs.map +7 -0
- package/dist/lib/browser/chunk-F7FW2RK2.mjs +167 -0
- package/dist/lib/browser/chunk-F7FW2RK2.mjs.map +7 -0
- package/dist/lib/browser/chunk-FU4GAFUQ.mjs +148 -0
- package/dist/lib/browser/chunk-FU4GAFUQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-GX4TUNM6.mjs +963 -0
- package/dist/lib/browser/chunk-GX4TUNM6.mjs.map +7 -0
- package/dist/lib/browser/chunk-I34GF4NG.mjs +34 -0
- package/dist/lib/browser/chunk-I34GF4NG.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-JKWMHZP6.mjs +80 -0
- package/dist/lib/browser/chunk-JKWMHZP6.mjs.map +7 -0
- package/dist/lib/browser/chunk-LVJW5EFU.mjs +157 -0
- package/dist/lib/browser/chunk-LVJW5EFU.mjs.map +7 -0
- package/dist/lib/browser/chunk-QSXYHXCE.mjs +48 -0
- package/dist/lib/browser/chunk-QSXYHXCE.mjs.map +7 -0
- package/dist/lib/browser/chunk-RFSO3JRG.mjs +1 -0
- package/dist/lib/browser/chunk-T3Y4AEKX.mjs +42 -0
- package/dist/lib/browser/chunk-T3Y4AEKX.mjs.map +7 -0
- package/dist/lib/browser/chunk-TGX63LTL.mjs +8 -0
- package/dist/lib/browser/chunk-TGX63LTL.mjs.map +7 -0
- package/dist/lib/browser/chunk-WPE6AL7I.mjs +905 -0
- package/dist/lib/browser/chunk-WPE6AL7I.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +90 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +24 -0
- package/dist/lib/browser/common/capabilities.mjs +46 -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 +30 -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 +29 -0
- package/dist/lib/browser/core/plugin.mjs.map +7 -0
- package/dist/lib/browser/core/url-loader.mjs +12 -0
- package/dist/lib/browser/core/url-loader.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +92 -121
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-H5PPENOC.mjs +43 -0
- package/dist/lib/browser/invoker-capability-H5PPENOC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +108 -40
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/ui/index.mjs +44 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-AWBEMRYR.mjs +39 -0
- package/dist/lib/node-esm/capability-AWBEMRYR.mjs.map +7 -0
- package/dist/lib/node-esm/capability-WFEG6CIZ.mjs +36 -0
- package/dist/lib/node-esm/capability-WFEG6CIZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-42KBWDE4.mjs +80 -0
- package/dist/lib/node-esm/chunk-42KBWDE4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs +158 -0
- package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BCEOLX47.mjs +964 -0
- package/dist/lib/node-esm/chunk-BCEOLX47.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EL3R25OQ.mjs +2 -0
- package/dist/lib/node-esm/chunk-EL3R25OQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FKE4Z3D6.mjs +10 -0
- package/dist/lib/node-esm/chunk-FKE4Z3D6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-G3RTFSNG.mjs +81 -0
- package/dist/lib/node-esm/chunk-G3RTFSNG.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-LQKOTNJW.mjs +906 -0
- package/dist/lib/node-esm/chunk-LQKOTNJW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ULUEXB7Q.mjs +149 -0
- package/dist/lib/node-esm/chunk-ULUEXB7Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-URWHJQT2.mjs +168 -0
- package/dist/lib/node-esm/chunk-URWHJQT2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VKHGNEDB.mjs +43 -0
- package/dist/lib/node-esm/chunk-VKHGNEDB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs +35 -0
- package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZZ7CKK6W.mjs +49 -0
- package/dist/lib/node-esm/chunk-ZZ7CKK6W.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +91 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +25 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +47 -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 +31 -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 +30 -0
- package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/core/url-loader.mjs +13 -0
- package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +92 -121
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs +44 -0
- package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +108 -40
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/ui/index.mjs +45 -0
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/plugin/node-esm/index.mjs +384 -0
- package/dist/plugin/node-esm/index.mjs.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/types/src/cli/cli.d.ts +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 +109 -194
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +4 -8
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +19 -0
- package/dist/types/src/common/operations.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +7 -7
- 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} +7 -7
- package/dist/types/src/core/activation-event.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.d.ts +48 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.test.d.ts +2 -0
- package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/capability.d.ts +156 -0
- package/dist/types/src/core/capability.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +6 -4
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +73 -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 +98 -35
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/url-loader.d.ts +25 -0
- package/dist/types/src/core/url-loader.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.test.d.ts +2 -0
- package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -2
- 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 +32 -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 +58 -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 +4 -4
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts +9 -0
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/index.d.ts +2 -0
- package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
- package/dist/types/src/{react/Surface.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +2 -3
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +12 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
- package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
- package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/index.d.ts +26 -0
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/types.d.ts +96 -0
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
- package/dist/types/src/ui/components/index.d.ts +4 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/index.d.ts +6 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useApp.d.ts +30 -12
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +1 -2
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
- package/dist/types/src/ui/index.d.ts +3 -0
- package/dist/types/src/ui/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/composer-plugin.d.ts +18 -0
- package/dist/types/src/vite-plugin/composer-plugin.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/import-map-plugin.d.ts +16 -0
- package/dist/types/src/vite-plugin/import-map-plugin.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/index.d.ts +3 -0
- package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/packages.d.ts +7 -0
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +24 -6
- package/package.json +130 -50
- package/src/cli/cli.ts +107 -0
- package/src/{playground/debug → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +44 -0
- package/src/common/capabilities.ts +168 -210
- package/src/common/index.ts +4 -8
- package/src/common/operations.ts +35 -0
- package/src/common/translations.ts +17 -9
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +10 -7
- package/src/core/capability-manager.test.ts +151 -0
- package/src/core/capability-manager.ts +192 -0
- package/src/core/capability.ts +247 -0
- package/src/core/index.ts +6 -4
- package/src/core/plugin-manager.test.ts +1113 -0
- package/src/core/plugin-manager.ts +883 -0
- package/src/core/plugin.ts +230 -40
- package/src/core/url-loader.test.ts +79 -0
- package/src/core/url-loader.ts +148 -0
- package/src/index.ts +3 -2
- package/src/plugin-operation/OperationPlugin.ts +24 -0
- package/src/plugin-operation/history/capability.ts +36 -0
- package/src/plugin-operation/history/errors.ts +7 -0
- package/src/plugin-operation/history/history-tracker.test.ts +373 -0
- package/src/plugin-operation/history/history-tracker.ts +128 -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 +72 -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 +54 -0
- package/src/plugin-operation/meta.ts +11 -0
- package/src/plugin-operation/testing.ts +154 -0
- package/src/plugin-runtime/RuntimePlugin.ts +19 -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 +7 -8
- package/src/testing/withPluginManager.tsx +63 -38
- package/src/ui/components/App/App.stories.tsx +92 -0
- package/src/{react → ui/components/App}/App.tsx +11 -12
- package/src/{playground/layout → ui/components/App}/index.ts +1 -1
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +183 -0
- package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
- package/src/ui/components/PluginManager/index.ts +5 -0
- package/src/{react/Surface.stories.tsx → ui/components/Surface/SurfaceComponent.stories.tsx} +55 -36
- package/src/ui/components/Surface/SurfaceComponent.tsx +266 -0
- package/src/ui/components/Surface/SurfaceInfo.tsx +107 -0
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
- package/src/ui/components/Surface/context.ts +12 -0
- package/src/ui/components/Surface/index.ts +35 -0
- package/src/ui/components/Surface/types.ts +117 -0
- package/src/ui/components/index.ts +7 -0
- package/src/ui/hooks/index.ts +9 -0
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +289 -0
- package/src/ui/hooks/useCapabilities.ts +67 -0
- package/src/{react → ui/hooks}/useLoading.tsx +4 -6
- package/src/ui/hooks/useSettingsState.ts +26 -0
- package/src/ui/hooks/useSurface.ts +13 -0
- package/src/ui/index.ts +6 -0
- package/src/vite-plugin/composer-plugin.ts +128 -0
- package/src/vite-plugin/import-map-plugin.ts +314 -0
- package/src/vite-plugin/index.ts +6 -0
- package/src/vite-plugin/packages.ts +29 -0
- package/tsconfig.json +12 -27
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +1 -1
- package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
- package/dist/lib/browser/chunk-VFUKEZIN.mjs +0 -483
- package/dist/lib/browser/chunk-VFUKEZIN.mjs.map +0 -7
- package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
- package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
- package/dist/lib/browser/react/index.mjs +0 -34
- package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
- package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IJOHO66N.mjs +0 -484
- package/dist/lib/node-esm/chunk-IJOHO66N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
- package/dist/lib/node-esm/react/index.mjs +0 -35
- package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
- package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
- package/dist/types/src/common/collaboration.d.ts +0 -20
- 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 -279
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts +0 -68
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -117
- 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 -126
- 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 -11
- 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 -36
- 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 -6
- 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-intent/meta.d.ts +0 -3
- package/dist/types/src/plugin-intent/meta.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 -25
- 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/meta.d.ts +0 -3
- package/dist/types/src/plugin-settings/meta.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/App.d.ts +0 -10
- package/dist/types/src/react/App.d.ts.map +0 -1
- package/dist/types/src/react/App.stories.d.ts.map +0 -1
- package/dist/types/src/react/DefaultFallback.d.ts +0 -8
- package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
- 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.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 -9
- package/dist/types/src/react/index.d.ts.map +0 -1
- package/dist/types/src/react/types.d.ts +0 -14
- package/dist/types/src/react/types.d.ts.map +0 -1
- package/dist/types/src/react/useApp.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/react/useLoading.d.ts.map +0 -1
- package/src/common/collaboration.ts +0 -18
- package/src/common/events.ts +0 -79
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/layout.ts +0 -277
- package/src/common/surface.ts +0 -88
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -263
- package/src/core/manager.test.ts +0 -516
- package/src/core/manager.ts +0 -604
- package/src/playground/debug/Debug.tsx +0 -39
- package/src/playground/debug/plugin.ts +0 -16
- package/src/playground/generator/Main.tsx +0 -70
- package/src/playground/generator/Toolbar.tsx +0 -47
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -22
- package/src/playground/layout/Layout.tsx +0 -33
- package/src/playground/layout/plugin.ts +0 -18
- package/src/playground/logger/Toolbar.tsx +0 -30
- package/src/playground/logger/plugin.ts +0 -41
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -46
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -31
- package/src/plugin-intent/errors.ts +0 -40
- package/src/plugin-intent/index.ts +0 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
- package/src/plugin-intent/intent-dispatcher.ts +0 -342
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-intent/meta.ts +0 -10
- package/src/plugin-settings/SettingsPlugin.ts +0 -34
- package/src/plugin-settings/actions.ts +0 -25
- package/src/plugin-settings/app-graph-builder.ts +0 -160
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -35
- package/src/plugin-settings/meta.ts +0 -10
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/App.stories.tsx +0 -33
- package/src/react/DefaultFallback.tsx +0 -26
- package/src/react/ErrorBoundary.tsx +0 -56
- package/src/react/IntentContext.tsx +0 -35
- package/src/react/Surface.tsx +0 -109
- package/src/react/common.ts +0 -13
- package/src/react/index.ts +0 -14
- package/src/react/types.ts +0 -37
- package/src/react/useApp.tsx +0 -165
- package/src/react/useCapabilities.ts +0 -31
- package/src/react/useIntentResolver.ts +0 -22
- /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{react/index.mjs.map → chunk-RFSO3JRG.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/activation-events.mjs.map} +0 -0
- /package/dist/lib/{node-esm/react/index.mjs.map → browser/common/capabilities.mjs.map} +0 -0
|
@@ -1,26 +1,79 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useApp
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LQKOTNJW.mjs";
|
|
5
|
+
import "../chunk-FKE4Z3D6.mjs";
|
|
6
|
+
import "../chunk-VKHGNEDB.mjs";
|
|
5
7
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
capabilities_exports
|
|
9
|
+
} from "../chunk-G3RTFSNG.mjs";
|
|
10
|
+
import {
|
|
11
|
+
activation_events_exports
|
|
12
|
+
} from "../chunk-WZCSOX5Q.mjs";
|
|
13
|
+
import "../chunk-EL3R25OQ.mjs";
|
|
14
|
+
import "../chunk-4A3ZCMI3.mjs";
|
|
15
|
+
import {
|
|
16
|
+
plugin_manager_exports
|
|
17
|
+
} from "../chunk-BCEOLX47.mjs";
|
|
18
|
+
import "../chunk-ZZ7CKK6W.mjs";
|
|
19
|
+
import {
|
|
20
|
+
plugin_exports
|
|
21
|
+
} from "../chunk-ULUEXB7Q.mjs";
|
|
22
|
+
import {
|
|
23
|
+
capability_exports
|
|
24
|
+
} from "../chunk-42KBWDE4.mjs";
|
|
25
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
26
|
+
|
|
27
|
+
// src/testing/service.ts
|
|
28
|
+
import * as Effect from "effect/Effect";
|
|
29
|
+
import * as Layer from "effect/Layer";
|
|
30
|
+
import { invariant } from "@dxos/invariant";
|
|
31
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/testing/service.ts";
|
|
32
|
+
var fromPlugins = (plugins) => Layer.effect(plugin_exports.Service, Effect.gen(function* () {
|
|
33
|
+
const pluginLoader = (id) => Effect.sync(() => {
|
|
34
|
+
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
35
|
+
invariant(plugin, `Plugin not found: ${id}`, {
|
|
36
|
+
F: __dxlog_file,
|
|
37
|
+
L: 26,
|
|
38
|
+
S: this,
|
|
39
|
+
A: [
|
|
40
|
+
"plugin",
|
|
41
|
+
"`Plugin not found: ${id}`"
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
return plugin;
|
|
45
|
+
});
|
|
46
|
+
const manager = plugin_manager_exports.make({
|
|
47
|
+
pluginLoader,
|
|
48
|
+
plugins,
|
|
49
|
+
core: plugins.map((plugin) => plugin.meta.id)
|
|
50
|
+
});
|
|
51
|
+
manager.capabilities.contribute({
|
|
52
|
+
interface: capabilities_exports.PluginManager,
|
|
53
|
+
implementation: manager,
|
|
54
|
+
module: "org.dxos.app-framework.plugin-manager"
|
|
55
|
+
});
|
|
56
|
+
manager.capabilities.contribute({
|
|
57
|
+
interface: capabilities_exports.AtomRegistry,
|
|
58
|
+
implementation: manager.registry,
|
|
59
|
+
module: "org.dxos.app-framework.atom-registry"
|
|
60
|
+
});
|
|
61
|
+
yield* manager.activate(activation_events_exports.Startup);
|
|
62
|
+
return manager;
|
|
63
|
+
}));
|
|
13
64
|
|
|
14
65
|
// src/testing/withPluginManager.tsx
|
|
15
|
-
import
|
|
66
|
+
import * as Effect2 from "effect/Effect";
|
|
67
|
+
import React, { useEffect, useState } from "react";
|
|
16
68
|
import { raise } from "@dxos/debug";
|
|
69
|
+
import { runAndForwardErrors } from "@dxos/effect";
|
|
17
70
|
import { useAsyncEffect } from "@dxos/react-hooks";
|
|
18
71
|
import { getProviderValue } from "@dxos/util";
|
|
19
72
|
var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ meta }) => meta.id), ...options } = {}) => {
|
|
20
|
-
const pluginManager =
|
|
73
|
+
const pluginManager = plugin_manager_exports.make({
|
|
21
74
|
pluginLoader: () => raise(new Error("Not implemented")),
|
|
22
75
|
plugins: [
|
|
23
|
-
StoryPlugin
|
|
76
|
+
StoryPlugin,
|
|
24
77
|
...plugins
|
|
25
78
|
],
|
|
26
79
|
core: [
|
|
@@ -30,8 +83,8 @@ var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ me
|
|
|
30
83
|
...options
|
|
31
84
|
});
|
|
32
85
|
if (capabilities) {
|
|
33
|
-
getProviderValue(capabilities, pluginManager.
|
|
34
|
-
pluginManager.
|
|
86
|
+
getProviderValue(capabilities, pluginManager.capabilities).forEach((capability) => {
|
|
87
|
+
pluginManager.capabilities.contribute({
|
|
35
88
|
interface: capability.interface,
|
|
36
89
|
implementation: capability.implementation,
|
|
37
90
|
module: "story"
|
|
@@ -42,49 +95,64 @@ var setupPluginManager = ({ capabilities, plugins = [], core = plugins.map(({ me
|
|
|
42
95
|
};
|
|
43
96
|
var withPluginManager = (init = {}) => {
|
|
44
97
|
return (Story, context) => {
|
|
98
|
+
const storyId = context.id;
|
|
45
99
|
const options = typeof init === "function" ? init(context) : init;
|
|
46
|
-
const
|
|
47
|
-
init
|
|
48
|
-
]);
|
|
100
|
+
const [managerState, setManagerState] = useState();
|
|
49
101
|
useEffect(() => {
|
|
50
|
-
const
|
|
51
|
-
|
|
102
|
+
const pluginManager = setupPluginManager(options);
|
|
103
|
+
const capability = capability_exports.contributes(capabilities_exports.ReactRoot, {
|
|
104
|
+
id: storyId,
|
|
52
105
|
root: () => /* @__PURE__ */ React.createElement(Story, null)
|
|
53
106
|
});
|
|
54
|
-
pluginManager.
|
|
107
|
+
pluginManager.capabilities.contribute({
|
|
55
108
|
...capability,
|
|
56
|
-
module: "dxos.
|
|
109
|
+
module: "org.dxos.app-framework.with-plugin-manager"
|
|
110
|
+
});
|
|
111
|
+
setManagerState({
|
|
112
|
+
pluginManager,
|
|
113
|
+
setupEvents: options.setupEvents,
|
|
114
|
+
fireEvents: options.fireEvents,
|
|
115
|
+
storyId
|
|
57
116
|
});
|
|
58
117
|
return () => {
|
|
59
|
-
pluginManager.
|
|
118
|
+
pluginManager.capabilities.remove(capability.interface, capability.implementation);
|
|
119
|
+
void runAndForwardErrors(pluginManager.shutdown());
|
|
60
120
|
};
|
|
61
121
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]);
|
|
65
|
-
useAsyncEffect(async () => {
|
|
66
|
-
await Promise.all(options.fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
|
|
67
|
-
}, [
|
|
68
|
-
pluginManager
|
|
122
|
+
storyId,
|
|
123
|
+
init
|
|
69
124
|
]);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return /* @__PURE__ */ React.createElement(
|
|
125
|
+
if (!managerState || managerState.storyId !== storyId) {
|
|
126
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ React.createElement(WithPluginManagerApp, managerState);
|
|
74
129
|
};
|
|
75
130
|
};
|
|
131
|
+
var WithPluginManagerApp = ({ fireEvents, pluginManager, setupEvents, storyId }) => {
|
|
132
|
+
useAsyncEffect(async () => {
|
|
133
|
+
await Promise.all(fireEvents?.map((event) => pluginManager.activate(event)) ?? []);
|
|
134
|
+
}, [
|
|
135
|
+
fireEvents,
|
|
136
|
+
pluginManager,
|
|
137
|
+
storyId
|
|
138
|
+
]);
|
|
139
|
+
const App = useApp({
|
|
140
|
+
pluginManager,
|
|
141
|
+
setupEvents
|
|
142
|
+
});
|
|
143
|
+
return /* @__PURE__ */ React.createElement(App, null);
|
|
144
|
+
};
|
|
76
145
|
var storyMeta = {
|
|
77
|
-
id: "dxos.
|
|
146
|
+
id: "org.dxos.app-framework.story",
|
|
78
147
|
name: "Story"
|
|
79
148
|
};
|
|
80
|
-
var StoryPlugin =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
]);
|
|
149
|
+
var StoryPlugin = plugin_exports.define(storyMeta).pipe(plugin_exports.addModule({
|
|
150
|
+
id: "Story",
|
|
151
|
+
activatesOn: activation_events_exports.Startup,
|
|
152
|
+
activate: () => Effect2.succeed([])
|
|
153
|
+
}), plugin_exports.make)();
|
|
87
154
|
export {
|
|
155
|
+
fromPlugins,
|
|
88
156
|
setupPluginManager,
|
|
89
157
|
withPluginManager
|
|
90
158
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/testing/withPluginManager.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport React, { useEffect,
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["React", "useEffect", "
|
|
3
|
+
"sources": ["../../../../src/testing/service.ts", "../../../../src/testing/withPluginManager.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\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 { Plugin, PluginManager } from '../core';\n\n/**\n * Creates a Plugin.Service layer from a list of plugins.\n * This is primarily used for testing.\n */\nexport const fromPlugins = (plugins: Plugin.Plugin[]) =>\n Layer.effect(\n Plugin.Service,\n Effect.gen(function* () {\n // TODO(wittjosiah): Try to dedupe logic between here, createCliApp and useApp.\n\n const pluginLoader = (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\n const manager = PluginManager.make({\n pluginLoader,\n plugins,\n core: plugins.map((plugin) => plugin.meta.id),\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'org.dxos.app-framework.plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Capabilities.AtomRegistry,\n implementation: manager.registry,\n module: 'org.dxos.app-framework.atom-registry',\n });\n\n yield* manager.activate(ActivationEvents.Startup);\n\n return manager;\n }),\n );\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport * as Effect from 'effect/Effect';\nimport React, { useEffect, useState } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { type MaybeProvider, getProviderValue } from '@dxos/util';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { type ActivationEvent, Capability, type CapabilityManager, Plugin, PluginManager } from '../core';\nimport { type UseAppOptions, useApp } from '../ui';\n\n/**\n * @internal\n */\nexport const setupPluginManager = ({\n capabilities,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n ...options\n}: UseAppOptions & Pick<WithPluginManagerOptions, 'capabilities'> = {}) => {\n const pluginManager = PluginManager.make({\n pluginLoader: () => raise(new Error('Not implemented')),\n plugins: [StoryPlugin, ...plugins],\n core: [StoryPlugin.meta.id, ...core],\n ...options,\n });\n\n if (capabilities) {\n getProviderValue(capabilities, pluginManager.capabilities).forEach((capability) => {\n pluginManager.capabilities.contribute({\n interface: capability.interface,\n implementation: capability.implementation,\n module: 'story',\n });\n });\n }\n\n return pluginManager;\n};\n\ntype ManagedPluginManagerState = {\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n pluginManager: PluginManager.PluginManager;\n setupEvents?: ActivationEvent.ActivationEvent[];\n storyId: string;\n};\n\nexport type WithPluginManagerOptions = UseAppOptions & {\n /** @deprecated */\n capabilities?: MaybeProvider<Capability.Any[], CapabilityManager.CapabilityManager>;\n /** @deprecated */\n fireEvents?: (ActivationEvent.ActivationEvent | string)[];\n};\n\nexport type WithPluginManagerInitializer<Args = void> =\n | WithPluginManagerOptions\n | ((context: StoryContext<Args>) => WithPluginManagerOptions);\n\n/**\n * Wraps a story with a plugin manager.\n * NOTE: This builds up and tears down the plugin manager on every render.\n */\nexport const withPluginManager = <Args,>(init: WithPluginManagerInitializer<Args> = {}): Decorator => {\n return (Story, context) => {\n const storyId = context.id;\n const options = typeof init === 'function' ? init(context as any) : init;\n const [managerState, setManagerState] = useState<ManagedPluginManagerState>();\n\n // Storybook replaces the full context object often, so key manager ownership by story id.\n useEffect(() => {\n const pluginManager = setupPluginManager(options);\n\n const capability = Capability.contributes(Capabilities.ReactRoot, {\n id: storyId,\n root: () => <Story />,\n });\n\n pluginManager.capabilities.contribute({\n ...capability,\n module: 'org.dxos.app-framework.with-plugin-manager',\n });\n\n setManagerState({\n pluginManager,\n setupEvents: options.setupEvents,\n fireEvents: options.fireEvents,\n storyId,\n });\n\n return () => {\n pluginManager.capabilities.remove(capability.interface, capability.implementation);\n void runAndForwardErrors(pluginManager.shutdown());\n };\n }, [storyId, init]);\n\n // Avoid mounting useApp with a stale manager from the previous story.\n if (!managerState || managerState.storyId !== storyId) {\n return <></>;\n }\n\n return <WithPluginManagerApp {...managerState} />;\n };\n};\n\nconst WithPluginManagerApp = ({ fireEvents, pluginManager, setupEvents, storyId }: ManagedPluginManagerState) => {\n // Fire deprecated events only after the effect-owned manager for this story exists.\n useAsyncEffect(async () => {\n await Promise.all(fireEvents?.map((event) => pluginManager.activate(event)) ?? []);\n }, [fireEvents, pluginManager, storyId]);\n\n const App = useApp({ pluginManager, setupEvents });\n\n return <App />;\n};\n\nconst storyMeta = {\n id: 'org.dxos.app-framework.story',\n name: 'Story',\n};\n\n// No-op plugin to ensure there exists at least one plugin for the startup event.\n// This is necessary because `createApp` expects the startup event to complete before the app is ready.\nconst StoryPlugin = Plugin.define(storyMeta).pipe(\n Plugin.addModule({\n id: 'Story',\n activatesOn: ActivationEvents.Startup,\n activate: () => Effect.succeed([]),\n }),\n Plugin.make,\n)();\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Effect", "Layer", "invariant", "fromPlugins", "plugins", "effect", "Plugin", "Service", "gen", "pluginLoader", "id", "sync", "plugin", "find", "meta", "invariant", "manager", "PluginManager", "make", "core", "map", "capabilities", "contribute", "interface", "Capabilities", "implementation", "module", "AtomRegistry", "registry", "activate", "ActivationEvents", "Startup", "Effect", "React", "useEffect", "useState", "raise", "runAndForwardErrors", "useAsyncEffect", "getProviderValue", "setupPluginManager", "capabilities", "plugins", "core", "map", "meta", "id", "options", "pluginManager", "PluginManager", "make", "pluginLoader", "raise", "Error", "StoryPlugin", "getProviderValue", "forEach", "capability", "contribute", "interface", "implementation", "module", "withPluginManager", "init", "Story", "context", "storyId", "managerState", "setManagerState", "useState", "useEffect", "Capability", "contributes", "Capabilities", "ReactRoot", "root", "setupEvents", "fireEvents", "remove", "runAndForwardErrors", "shutdown", "WithPluginManagerApp", "useAsyncEffect", "Promise", "all", "event", "activate", "App", "useApp", "storyMeta", "name", "Plugin", "define", "pipe", "addModule", "activatesOn", "ActivationEvents", "Startup", "succeed"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
App,
|
|
4
|
+
LoadingState,
|
|
5
|
+
PluginManagerProvider,
|
|
6
|
+
Surface,
|
|
7
|
+
useApp,
|
|
8
|
+
useAtomCapability,
|
|
9
|
+
useAtomCapabilityState,
|
|
10
|
+
useCapabilities,
|
|
11
|
+
useCapability,
|
|
12
|
+
useLoading,
|
|
13
|
+
useOperationInvoker,
|
|
14
|
+
usePluginManager,
|
|
15
|
+
useSettingsState,
|
|
16
|
+
useSurface
|
|
17
|
+
} from "../chunk-LQKOTNJW.mjs";
|
|
18
|
+
import "../chunk-FKE4Z3D6.mjs";
|
|
19
|
+
import "../chunk-VKHGNEDB.mjs";
|
|
20
|
+
import "../chunk-G3RTFSNG.mjs";
|
|
21
|
+
import "../chunk-WZCSOX5Q.mjs";
|
|
22
|
+
import "../chunk-EL3R25OQ.mjs";
|
|
23
|
+
import "../chunk-4A3ZCMI3.mjs";
|
|
24
|
+
import "../chunk-BCEOLX47.mjs";
|
|
25
|
+
import "../chunk-ZZ7CKK6W.mjs";
|
|
26
|
+
import "../chunk-ULUEXB7Q.mjs";
|
|
27
|
+
import "../chunk-42KBWDE4.mjs";
|
|
28
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
29
|
+
export {
|
|
30
|
+
App,
|
|
31
|
+
LoadingState,
|
|
32
|
+
PluginManagerProvider,
|
|
33
|
+
Surface,
|
|
34
|
+
useApp,
|
|
35
|
+
useAtomCapability,
|
|
36
|
+
useAtomCapabilityState,
|
|
37
|
+
useCapabilities,
|
|
38
|
+
useCapability,
|
|
39
|
+
useLoading,
|
|
40
|
+
useOperationInvoker,
|
|
41
|
+
usePluginManager,
|
|
42
|
+
useSettingsState,
|
|
43
|
+
useSurface
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.mjs.map
|