@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,138 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SETTINGS_ID,
|
|
3
|
-
SETTINGS_KEY,
|
|
4
|
-
SettingsAction,
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-SCPE4ZO2.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Capabilities,
|
|
9
|
-
contributes,
|
|
10
|
-
createIntent
|
|
11
|
-
} from "./chunk-WPW5VVAX.mjs";
|
|
12
|
-
|
|
13
|
-
// src/plugin-settings/app-graph-builder.ts
|
|
14
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
15
|
-
import * as Function from "effect/Function";
|
|
16
|
-
import * as Option from "effect/Option";
|
|
17
|
-
import { ROOT_ID, createExtension } from "@dxos/app-graph";
|
|
18
|
-
import { isNonNullable } from "@dxos/util";
|
|
19
|
-
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
|
|
20
|
-
createExtension({
|
|
21
|
-
id: `${meta.id}/action`,
|
|
22
|
-
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
23
|
-
{
|
|
24
|
-
id: meta.id,
|
|
25
|
-
data: async () => {
|
|
26
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
|
-
await dispatch(createIntent(SettingsAction.Open));
|
|
28
|
-
},
|
|
29
|
-
properties: {
|
|
30
|
-
label: [
|
|
31
|
-
"open settings label",
|
|
32
|
-
{
|
|
33
|
-
ns: meta.id
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
icon: "ph--gear--regular",
|
|
37
|
-
disposition: "menu",
|
|
38
|
-
keyBinding: {
|
|
39
|
-
macos: "meta+,",
|
|
40
|
-
windows: "alt+,"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
]), Option.getOrElse(() => [])))
|
|
45
|
-
}),
|
|
46
|
-
createExtension({
|
|
47
|
-
id: `${meta.id}/core`,
|
|
48
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
49
|
-
{
|
|
50
|
-
id: SETTINGS_ID,
|
|
51
|
-
type: meta.id,
|
|
52
|
-
properties: {
|
|
53
|
-
label: [
|
|
54
|
-
"app settings label",
|
|
55
|
-
{
|
|
56
|
-
ns: meta.id
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
icon: "ph--gear--regular",
|
|
60
|
-
disposition: "pin-end",
|
|
61
|
-
position: "hoist",
|
|
62
|
-
testId: "treeView.appSettings"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
]), Option.getOrElse(() => [])))
|
|
66
|
-
}),
|
|
67
|
-
createExtension({
|
|
68
|
-
id: `${meta.id}/core-plugins`,
|
|
69
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id !== SETTINGS_ID ? Option.none() : Option.some(node2)), Option.map(() => {
|
|
70
|
-
const manager = get(context.capability(Capabilities.PluginManager));
|
|
71
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
72
|
-
return [
|
|
73
|
-
...manager.plugins.filter((plugin) => manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
74
|
-
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
75
|
-
if (!settings) {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
return [
|
|
79
|
-
plugin.meta,
|
|
80
|
-
settings
|
|
81
|
-
];
|
|
82
|
-
}).filter(isNonNullable).map(([meta2, settings]) => ({
|
|
83
|
-
id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
|
|
84
|
-
type: "category",
|
|
85
|
-
data: settings,
|
|
86
|
-
properties: {
|
|
87
|
-
label: meta2.name ?? meta2.id,
|
|
88
|
-
icon: meta2.icon ?? "ph--circle--regular"
|
|
89
|
-
}
|
|
90
|
-
})),
|
|
91
|
-
{
|
|
92
|
-
id: `${SETTINGS_KEY}:custom-plugins`,
|
|
93
|
-
type: "category",
|
|
94
|
-
properties: {
|
|
95
|
-
label: [
|
|
96
|
-
"custom plugins label",
|
|
97
|
-
{
|
|
98
|
-
ns: meta.id
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
icon: "ph--squares-four--regular",
|
|
102
|
-
role: "branch",
|
|
103
|
-
disposition: "collection"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
];
|
|
107
|
-
}), Option.getOrElse(() => [])))
|
|
108
|
-
}),
|
|
109
|
-
createExtension({
|
|
110
|
-
id: `${meta.id}/custom-plugins`,
|
|
111
|
-
connector: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id !== `${SETTINGS_KEY}:custom-plugins` ? Option.none() : Option.some(node2)), Option.map(() => {
|
|
112
|
-
const manager = get(context.capability(Capabilities.PluginManager));
|
|
113
|
-
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
114
|
-
return manager.plugins.filter((plugin) => !manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
115
|
-
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
116
|
-
if (!settings) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
return [
|
|
120
|
-
plugin.meta,
|
|
121
|
-
settings
|
|
122
|
-
];
|
|
123
|
-
}).filter(isNonNullable).map(([meta2, settings]) => ({
|
|
124
|
-
id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
|
|
125
|
-
type: "category",
|
|
126
|
-
data: settings,
|
|
127
|
-
properties: {
|
|
128
|
-
label: meta2.name ?? meta2.id,
|
|
129
|
-
icon: meta2.icon ?? "ph--circle--regular"
|
|
130
|
-
}
|
|
131
|
-
}));
|
|
132
|
-
}), Option.getOrElse(() => [])))
|
|
133
|
-
})
|
|
134
|
-
]));
|
|
135
|
-
export {
|
|
136
|
-
app_graph_builder_default as default
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=app-graph-builder-OIEZZC45.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-settings/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { ROOT_ID, createExtension } from '@dxos/app-graph';\nimport { type SettingsStore, type SettingsValue } from '@dxos/local-storage';\nimport { isNonNullable } from '@dxos/util';\n\nimport { Capabilities } from '../common';\nimport { type PluginContext, type PluginMeta, contributes } from '../core';\nimport { createIntent } from '../plugin-intent';\n\nimport { SETTINGS_ID, SETTINGS_KEY, SettingsAction } from './actions';\nimport { meta } from './meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/action`,\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: meta.id,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.Open));\n },\n properties: {\n label: ['open settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/core`,\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: SETTINGS_ID,\n type: meta.id,\n properties: {\n label: ['app settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'hoist',\n testId: 'treeView.appSettings',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/core-plugins`,\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id !== SETTINGS_ID ? Option.none() : Option.some(node))),\n Option.map(() => {\n const manager = get(context.capability(Capabilities.PluginManager));\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n return [\n ...manager.plugins\n .filter((plugin) => manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n\n {\n id: `${SETTINGS_KEY}:custom-plugins`,\n type: 'category',\n properties: {\n label: ['custom plugins label', { ns: meta.id }],\n icon: 'ph--squares-four--regular',\n role: 'branch',\n disposition: 'collection',\n },\n },\n ];\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/custom-plugins`,\n connector: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) =>\n node.id !== `${SETTINGS_KEY}:custom-plugins` ? Option.none() : Option.some(node),\n ),\n Option.map(() => {\n const manager = get(context.capability(Capabilities.PluginManager));\n const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));\n return manager.plugins\n .filter((plugin) => !manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n }));\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Atom", "Function", "Option", "ROOT_ID", "createExtension", "isNonNullable", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Atom", "make", "get", "pipe", "flatMap", "ROOT_ID", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "SettingsAction", "Open", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "getOrElse", "connector", "SETTINGS_ID", "type", "position", "testId", "manager", "capability", "PluginManager", "settingsStore", "capabilities", "SettingsStore", "plugins", "filter", "plugin", "core", "includes", "settings", "getStore", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "role"]
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// src/plugin-settings/meta.ts
|
|
2
|
-
var meta = {
|
|
3
|
-
id: "dxos.org/plugin/settings",
|
|
4
|
-
name: "Settings"
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/plugin-settings/actions.ts
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
9
|
-
var SETTINGS_ID = "!dxos:settings";
|
|
10
|
-
var SETTINGS_KEY = "settings";
|
|
11
|
-
(function(SettingsAction2) {
|
|
12
|
-
class Open extends Schema.TaggedClass()(`${meta.id}/open`, {
|
|
13
|
-
input: Schema.Struct({
|
|
14
|
-
plugin: Schema.optional(Schema.String)
|
|
15
|
-
}),
|
|
16
|
-
output: Schema.Void
|
|
17
|
-
}) {
|
|
18
|
-
}
|
|
19
|
-
SettingsAction2.Open = Open;
|
|
20
|
-
class OpenPluginRegistry extends Schema.TaggedClass()(`${meta.id}/open-plugin-registry`, {
|
|
21
|
-
input: Schema.Void,
|
|
22
|
-
output: Schema.Void
|
|
23
|
-
}) {
|
|
24
|
-
}
|
|
25
|
-
SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
|
|
26
|
-
})(SettingsAction || (SettingsAction = {}));
|
|
27
|
-
var SettingsAction;
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
meta,
|
|
31
|
-
SETTINGS_ID,
|
|
32
|
-
SETTINGS_KEY,
|
|
33
|
-
SettingsAction
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=chunk-SCPE4ZO2.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-settings/meta.ts", "../../../src/plugin-settings/actions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/settings',\n name: 'Settings',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from './meta';\n\n// TODO(burdon): Document.\nexport const SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${meta.id}/open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}/open-plugin-registry`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,OAAmB;EAC9BC,IAAI;EACJC,MAAM;AACR;;;ACLA,YAAYC,YAAY;AAKjB,IAAMC,cAAc;AACpB,IAAMC,eAAe;UAEXC,iBAAAA;EACR,MAAMC,aAAoBC,mBAAW,EAAS,GAAGC,KAAKC,EAAE,SAAS;IACtEC,OAAcC,cAAO;MACnBC,QAAeC,gBAAgBC,aAAM;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EAAI;kBALSV,OAAAA;EAON,MAAMW,2BAAkCV,mBAAW,EAAuB,GAAGC,KAAKC,EAAE,yBAAyB;IAClHC,OAAcM;IACdD,QAAeC;EACjB,CAAA,EAAA;EAAI;kBAHSC,qBAAAA;AAIf,GAZiBZ,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["meta", "id", "name", "Schema", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "TaggedClass", "meta", "id", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Capabilities,
|
|
3
|
-
Events,
|
|
4
|
-
PluginManager
|
|
5
|
-
} from "./chunk-WPW5VVAX.mjs";
|
|
6
|
-
|
|
7
|
-
// src/react/useCapabilities.ts
|
|
8
|
-
import { useAtomValue } from "@effect-atom/atom-react";
|
|
9
|
-
import { invariant } from "@dxos/invariant";
|
|
10
|
-
|
|
11
|
-
// src/react/PluginManagerProvider.ts
|
|
12
|
-
import { createContext, useContext } from "react";
|
|
13
|
-
import { raise } from "@dxos/debug";
|
|
14
|
-
var PluginManagerContext = createContext(void 0);
|
|
15
|
-
var usePluginManager = () => useContext(PluginManagerContext) ?? raise(new Error("Missing PluginManagerContext"));
|
|
16
|
-
var PluginManagerProvider = PluginManagerContext.Provider;
|
|
17
|
-
|
|
18
|
-
// src/react/useCapabilities.ts
|
|
19
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/react/useCapabilities.ts";
|
|
20
|
-
var useCapabilities = (interfaceDef) => {
|
|
21
|
-
const manager = usePluginManager();
|
|
22
|
-
return useAtomValue(manager.context.capabilities(interfaceDef));
|
|
23
|
-
};
|
|
24
|
-
var useCapability = (interfaceDef) => {
|
|
25
|
-
const capabilities = useCapabilities(interfaceDef);
|
|
26
|
-
invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`, {
|
|
27
|
-
F: __dxlog_file,
|
|
28
|
-
L: 29,
|
|
29
|
-
S: void 0,
|
|
30
|
-
A: [
|
|
31
|
-
"capabilities.length > 0",
|
|
32
|
-
"`No capability found for ${interfaceDef.identifier}`"
|
|
33
|
-
]
|
|
34
|
-
});
|
|
35
|
-
return capabilities[0];
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// src/react/common.ts
|
|
39
|
-
var useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);
|
|
40
|
-
var useAppGraph = () => useCapability(Capabilities.AppGraph);
|
|
41
|
-
var useLayout = () => useCapability(Capabilities.Layout);
|
|
42
|
-
|
|
43
|
-
// src/react/types.ts
|
|
44
|
-
import * as Schema from "effect/Schema";
|
|
45
|
-
var SurfaceCardRole = Schema.Literal("card", "card--popover", "card--intrinsic", "card--extrinsic", "card--transclusion");
|
|
46
|
-
|
|
47
|
-
// src/react/ErrorBoundary.tsx
|
|
48
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
49
|
-
import React, { Component } from "react";
|
|
50
|
-
var ErrorBoundary = class extends Component {
|
|
51
|
-
static getDerivedStateFromError(error) {
|
|
52
|
-
return {
|
|
53
|
-
error
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
state = {
|
|
57
|
-
error: void 0
|
|
58
|
-
};
|
|
59
|
-
componentDidUpdate(prevProps) {
|
|
60
|
-
if (prevProps.data !== this.props.data) {
|
|
61
|
-
this.resetError();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
render() {
|
|
65
|
-
if (this.state.error) {
|
|
66
|
-
const Fallback = this.props.fallback ?? DefaultFallback;
|
|
67
|
-
return /* @__PURE__ */ React.createElement(Fallback, {
|
|
68
|
-
data: this.props.data,
|
|
69
|
-
error: this.state.error
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return this.props.children;
|
|
73
|
-
}
|
|
74
|
-
resetError() {
|
|
75
|
-
this.setState({
|
|
76
|
-
error: void 0
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
var DefaultFallback = ({ data, error }) => {
|
|
81
|
-
var _effect = _useSignals();
|
|
82
|
-
try {
|
|
83
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
84
|
-
className: "flex flex-col gap-2 overflow-hidden border border-red-500 rounded-sm"
|
|
85
|
-
}, /* @__PURE__ */ React.createElement("h1", {
|
|
86
|
-
className: "p-2"
|
|
87
|
-
}, "ERROR: ", error.message), /* @__PURE__ */ React.createElement("pre", {
|
|
88
|
-
className: "p-2 overflow-y-auto text-sm text-subdued"
|
|
89
|
-
}, JSON.stringify(data, null, 2)));
|
|
90
|
-
} finally {
|
|
91
|
-
_effect.f();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// src/react/Surface.tsx
|
|
96
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
97
|
-
import React2, { Fragment, Suspense, forwardRef, memo, useMemo } from "react";
|
|
98
|
-
import { useDefaultValue } from "@dxos/react-hooks";
|
|
99
|
-
import { byPosition } from "@dxos/util";
|
|
100
|
-
var DEFAULT_PLACEHOLDER = /* @__PURE__ */ React2.createElement(Fragment, null);
|
|
101
|
-
var Surface = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ id: _id, role, data: dataParam, limit, fallback = DefaultFallback2, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {
|
|
102
|
-
var _effect = _useSignals2();
|
|
103
|
-
try {
|
|
104
|
-
const surfaces = useSurfaces();
|
|
105
|
-
const data = useDefaultValue(dataParam, () => ({}));
|
|
106
|
-
const definitions = findCandidates(surfaces, {
|
|
107
|
-
role,
|
|
108
|
-
data
|
|
109
|
-
});
|
|
110
|
-
const candidates = limit ? definitions.slice(0, limit) : definitions;
|
|
111
|
-
const nodes = candidates.map(({ id, component: Component2 }) => /* @__PURE__ */ React2.createElement(Component2, {
|
|
112
|
-
ref: forwardedRef,
|
|
113
|
-
key: id,
|
|
114
|
-
id,
|
|
115
|
-
role,
|
|
116
|
-
data,
|
|
117
|
-
limit,
|
|
118
|
-
...rest
|
|
119
|
-
}));
|
|
120
|
-
const suspense = /* @__PURE__ */ React2.createElement(Suspense, {
|
|
121
|
-
fallback: placeholder
|
|
122
|
-
}, nodes);
|
|
123
|
-
return /* @__PURE__ */ React2.createElement(ErrorBoundary, {
|
|
124
|
-
data,
|
|
125
|
-
fallback
|
|
126
|
-
}, suspense);
|
|
127
|
-
} finally {
|
|
128
|
-
_effect.f();
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
var DefaultFallback2 = ({ data, error, dev }) => {
|
|
132
|
-
var _effect = _useSignals2();
|
|
133
|
-
try {
|
|
134
|
-
if (dev) {
|
|
135
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
136
|
-
className: "flex flex-col gap-4 p-4 is-full overflow-y-auto"
|
|
137
|
-
}, /* @__PURE__ */ React2.createElement("h1", {
|
|
138
|
-
className: "flex gap-2 text-sm mbs-2"
|
|
139
|
-
}, error.message), /* @__PURE__ */ React2.createElement("pre", {
|
|
140
|
-
className: "overflow-auto text-xs text-description"
|
|
141
|
-
}, JSON.stringify(data, null, 2)));
|
|
142
|
-
}
|
|
143
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
144
|
-
className: "flex flex-col gap-4 p-4 is-full overflow-y-auto border border-roseFill"
|
|
145
|
-
}, /* @__PURE__ */ React2.createElement("h1", {
|
|
146
|
-
className: "flex gap-2 text-sm mbs-2 text-rose-500"
|
|
147
|
-
}, error.message), /* @__PURE__ */ React2.createElement("pre", {
|
|
148
|
-
className: "overflow-auto text-xs text-description"
|
|
149
|
-
}, error.stack), /* @__PURE__ */ React2.createElement("pre", {
|
|
150
|
-
className: "overflow-auto text-xs text-description"
|
|
151
|
-
}, JSON.stringify(data, null, 2)));
|
|
152
|
-
} finally {
|
|
153
|
-
_effect.f();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var useSurfaces = () => {
|
|
157
|
-
const surfaces = useCapabilities(Capabilities.ReactSurface);
|
|
158
|
-
return useMemo(() => surfaces.flat(), [
|
|
159
|
-
surfaces
|
|
160
|
-
]);
|
|
161
|
-
};
|
|
162
|
-
var isSurfaceAvailable = (context, { role, data }) => {
|
|
163
|
-
const surfaces = context.getCapabilities(Capabilities.ReactSurface);
|
|
164
|
-
const candidates = findCandidates(surfaces.flat(), {
|
|
165
|
-
role,
|
|
166
|
-
data
|
|
167
|
-
});
|
|
168
|
-
return candidates.length > 0;
|
|
169
|
-
};
|
|
170
|
-
var findCandidates = (surfaces, { role, data }) => {
|
|
171
|
-
return Object.values(surfaces).filter((definition) => Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role).filter(({ filter }) => filter ? filter(data ?? {}) : true).toSorted(byPosition);
|
|
172
|
-
};
|
|
173
|
-
Surface.displayName = "Surface";
|
|
174
|
-
|
|
175
|
-
// src/react/useApp.tsx
|
|
176
|
-
import { RegistryContext } from "@effect-atom/atom-react";
|
|
177
|
-
import { effect } from "@preact/signals-core";
|
|
178
|
-
import React5, { useCallback, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
179
|
-
import { invariant as invariant2 } from "@dxos/invariant";
|
|
180
|
-
import { live } from "@dxos/live-object";
|
|
181
|
-
import { useAsyncEffect, useDefaultValue as useDefaultValue2 } from "@dxos/react-hooks";
|
|
182
|
-
|
|
183
|
-
// src/react/App.tsx
|
|
184
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
185
|
-
import React3 from "react";
|
|
186
|
-
|
|
187
|
-
// src/helpers.ts
|
|
188
|
-
var topologicalSort = (nodes) => {
|
|
189
|
-
const getDependencies = (nodeId, seen = /* @__PURE__ */ new Set(), path = /* @__PURE__ */ new Set()) => {
|
|
190
|
-
if (path.has(nodeId)) {
|
|
191
|
-
throw new Error(`Circular dependency detected involving ${nodeId}`);
|
|
192
|
-
}
|
|
193
|
-
if (seen.has(nodeId)) {
|
|
194
|
-
return [];
|
|
195
|
-
}
|
|
196
|
-
const node = nodes.find((n) => n.id === nodeId);
|
|
197
|
-
if (!node) {
|
|
198
|
-
throw new Error(`Node ${nodeId} not found but is listed as a dependency`);
|
|
199
|
-
}
|
|
200
|
-
const newPath = /* @__PURE__ */ new Set([
|
|
201
|
-
...path,
|
|
202
|
-
nodeId
|
|
203
|
-
]);
|
|
204
|
-
const newSeen = /* @__PURE__ */ new Set([
|
|
205
|
-
...seen,
|
|
206
|
-
nodeId
|
|
207
|
-
]);
|
|
208
|
-
const dependsOn = node.dependsOn ?? [];
|
|
209
|
-
return [
|
|
210
|
-
...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)),
|
|
211
|
-
nodeId
|
|
212
|
-
];
|
|
213
|
-
};
|
|
214
|
-
const allDependencies = nodes.map((node) => node.id).flatMap((id) => getDependencies(id)).filter((id, index, self) => self.indexOf(id) === index);
|
|
215
|
-
return allDependencies.map((id) => nodes.find((node) => node.id === id)).filter((node) => node !== void 0);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
// src/react/useLoading.tsx
|
|
219
|
-
import { useEffect, useState } from "react";
|
|
220
|
-
var LoadingState = /* @__PURE__ */ (function(LoadingState2) {
|
|
221
|
-
LoadingState2[LoadingState2["Loading"] = 0] = "Loading";
|
|
222
|
-
LoadingState2[LoadingState2["FadeIn"] = 1] = "FadeIn";
|
|
223
|
-
LoadingState2[LoadingState2["FadeOut"] = 2] = "FadeOut";
|
|
224
|
-
LoadingState2[LoadingState2["Done"] = 3] = "Done";
|
|
225
|
-
return LoadingState2;
|
|
226
|
-
})({});
|
|
227
|
-
var useLoading = (state, debounce = 0) => {
|
|
228
|
-
const [stage, setStage] = useState(0);
|
|
229
|
-
useEffect(() => {
|
|
230
|
-
if (!debounce) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
const i = setInterval(() => {
|
|
234
|
-
setStage((stage2) => {
|
|
235
|
-
switch (stage2) {
|
|
236
|
-
case 0: {
|
|
237
|
-
if (!state.ready) {
|
|
238
|
-
return 1;
|
|
239
|
-
} else {
|
|
240
|
-
clearInterval(i);
|
|
241
|
-
return 3;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
case 1: {
|
|
245
|
-
if (state.ready) {
|
|
246
|
-
return 2;
|
|
247
|
-
}
|
|
248
|
-
break;
|
|
249
|
-
}
|
|
250
|
-
case 2: {
|
|
251
|
-
clearInterval(i);
|
|
252
|
-
return 3;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return stage2;
|
|
256
|
-
});
|
|
257
|
-
}, debounce);
|
|
258
|
-
return () => clearInterval(i);
|
|
259
|
-
}, [
|
|
260
|
-
debounce
|
|
261
|
-
]);
|
|
262
|
-
if (!debounce) {
|
|
263
|
-
return state.ready ? 3 : 0;
|
|
264
|
-
}
|
|
265
|
-
return stage;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// src/react/App.tsx
|
|
269
|
-
var App = ({ placeholder: Placeholder, state, debounce }) => {
|
|
270
|
-
var _effect = _useSignals3();
|
|
271
|
-
try {
|
|
272
|
-
const reactContexts = useCapabilities(Capabilities.ReactContext);
|
|
273
|
-
const reactRoots = useCapabilities(Capabilities.ReactRoot);
|
|
274
|
-
const stage = useLoading(state, debounce);
|
|
275
|
-
if (state.error) {
|
|
276
|
-
throw state.error;
|
|
277
|
-
}
|
|
278
|
-
if (stage < LoadingState.Done) {
|
|
279
|
-
if (!Placeholder) {
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
return /* @__PURE__ */ React3.createElement(Placeholder, {
|
|
283
|
-
stage
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
const ComposedContext = composeContexts(reactContexts);
|
|
287
|
-
return /* @__PURE__ */ React3.createElement(ComposedContext, null, reactRoots.map(({ id, root: Component2 }) => /* @__PURE__ */ React3.createElement(Component2, {
|
|
288
|
-
key: id
|
|
289
|
-
})));
|
|
290
|
-
} finally {
|
|
291
|
-
_effect.f();
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
var composeContexts = (contexts) => {
|
|
295
|
-
if (contexts.length === 0) {
|
|
296
|
-
return ({ children }) => /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);
|
|
297
|
-
}
|
|
298
|
-
return topologicalSort(contexts).map(({ context }) => context).reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React3.createElement(Acc, null, /* @__PURE__ */ React3.createElement(Next, null, children)));
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
// src/react/DefaultFallback.tsx
|
|
302
|
-
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
303
|
-
import React4 from "react";
|
|
304
|
-
var DefaultFallback3 = ({ error }) => {
|
|
305
|
-
var _effect = _useSignals4();
|
|
306
|
-
try {
|
|
307
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
308
|
-
style: {
|
|
309
|
-
margin: "1rem",
|
|
310
|
-
padding: "1rem",
|
|
311
|
-
overflow: "hidden",
|
|
312
|
-
border: "4px solid teal",
|
|
313
|
-
borderRadius: "1rem"
|
|
314
|
-
}
|
|
315
|
-
}, /* @__PURE__ */ React4.createElement("h1", {
|
|
316
|
-
style: {
|
|
317
|
-
margin: "0.5rem 0",
|
|
318
|
-
fontSize: "1.2rem"
|
|
319
|
-
}
|
|
320
|
-
}, "ERROR: ", error.message), /* @__PURE__ */ React4.createElement("pre", {
|
|
321
|
-
style: {
|
|
322
|
-
overflow: "auto",
|
|
323
|
-
fontSize: "1rem",
|
|
324
|
-
whiteSpace: "pre-wrap",
|
|
325
|
-
color: "#888888"
|
|
326
|
-
}
|
|
327
|
-
}, error.stack));
|
|
328
|
-
} finally {
|
|
329
|
-
_effect.f();
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
// src/react/useApp.tsx
|
|
334
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-framework/src/react/useApp.tsx";
|
|
335
|
-
var ENABLED_KEY = "dxos.org/app-framework/enabled";
|
|
336
|
-
var useApp = ({ pluginManager, pluginLoader: pluginLoaderParam, plugins: pluginsParam, core: coreParam, defaults: defaultsParam, placeholder, fallback = DefaultFallback3, cacheEnabled = false, safeMode = false, debounce = 0 }) => {
|
|
337
|
-
const plugins = useDefaultValue2(pluginsParam, () => []);
|
|
338
|
-
const core = useDefaultValue2(coreParam, () => plugins.map(({ meta }) => meta.id));
|
|
339
|
-
const defaults = useDefaultValue2(defaultsParam, () => []);
|
|
340
|
-
const pluginLoader = useMemo2(() => pluginLoaderParam ?? ((id) => {
|
|
341
|
-
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
342
|
-
invariant2(plugin, `Plugin not found: ${id}`, {
|
|
343
|
-
F: __dxlog_file2,
|
|
344
|
-
L: 83,
|
|
345
|
-
S: void 0,
|
|
346
|
-
A: [
|
|
347
|
-
"plugin",
|
|
348
|
-
"`Plugin not found: ${id}`"
|
|
349
|
-
]
|
|
350
|
-
});
|
|
351
|
-
return plugin;
|
|
352
|
-
}), [
|
|
353
|
-
pluginLoaderParam,
|
|
354
|
-
plugins
|
|
355
|
-
]);
|
|
356
|
-
const state = useMemo2(() => live({
|
|
357
|
-
ready: false,
|
|
358
|
-
error: null
|
|
359
|
-
}), []);
|
|
360
|
-
const cached = useMemo2(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? "[]"), []);
|
|
361
|
-
const enabled = useMemo2(() => safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults, [
|
|
362
|
-
safeMode,
|
|
363
|
-
cacheEnabled,
|
|
364
|
-
cached,
|
|
365
|
-
defaults
|
|
366
|
-
]);
|
|
367
|
-
const manager = useMemo2(() => pluginManager ?? new PluginManager({
|
|
368
|
-
pluginLoader,
|
|
369
|
-
plugins,
|
|
370
|
-
core,
|
|
371
|
-
enabled
|
|
372
|
-
}), [
|
|
373
|
-
pluginManager,
|
|
374
|
-
pluginLoader,
|
|
375
|
-
plugins,
|
|
376
|
-
core,
|
|
377
|
-
enabled
|
|
378
|
-
]);
|
|
379
|
-
useEffect2(() => {
|
|
380
|
-
return manager.activation.on(({ event, state: _state, error }) => {
|
|
381
|
-
if (!state.ready && event === Events.Startup.id) {
|
|
382
|
-
state.ready = _state === "activated";
|
|
383
|
-
}
|
|
384
|
-
if (error && !state.ready && !state.error) {
|
|
385
|
-
state.error = error;
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
}, [
|
|
389
|
-
manager,
|
|
390
|
-
state
|
|
391
|
-
]);
|
|
392
|
-
useEffect2(() => {
|
|
393
|
-
effect(() => {
|
|
394
|
-
cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));
|
|
395
|
-
});
|
|
396
|
-
}, [
|
|
397
|
-
cacheEnabled,
|
|
398
|
-
manager
|
|
399
|
-
]);
|
|
400
|
-
useEffect2(() => {
|
|
401
|
-
setupDevtools(manager);
|
|
402
|
-
}, [
|
|
403
|
-
manager
|
|
404
|
-
]);
|
|
405
|
-
useAsyncEffect(async () => {
|
|
406
|
-
manager.context.contributeCapability({
|
|
407
|
-
interface: Capabilities.PluginManager,
|
|
408
|
-
implementation: manager,
|
|
409
|
-
module: "dxos.org/app-framework/plugin-manager"
|
|
410
|
-
});
|
|
411
|
-
manager.context.contributeCapability({
|
|
412
|
-
interface: Capabilities.AtomRegistry,
|
|
413
|
-
implementation: manager.registry,
|
|
414
|
-
module: "dxos.org/app-framework/atom-registry"
|
|
415
|
-
});
|
|
416
|
-
await Promise.all([
|
|
417
|
-
// TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
|
|
418
|
-
manager.activate(Events.SetupReactSurface),
|
|
419
|
-
manager.activate(Events.Startup)
|
|
420
|
-
]);
|
|
421
|
-
return () => {
|
|
422
|
-
manager.context.removeCapability(Capabilities.PluginManager, manager);
|
|
423
|
-
manager.context.removeCapability(Capabilities.AtomRegistry, manager.registry);
|
|
424
|
-
};
|
|
425
|
-
}, [
|
|
426
|
-
manager
|
|
427
|
-
]);
|
|
428
|
-
return useCallback(() => /* @__PURE__ */ React5.createElement(ErrorBoundary, {
|
|
429
|
-
fallback
|
|
430
|
-
}, /* @__PURE__ */ React5.createElement(PluginManagerProvider, {
|
|
431
|
-
value: manager
|
|
432
|
-
}, /* @__PURE__ */ React5.createElement(RegistryContext.Provider, {
|
|
433
|
-
value: manager.registry
|
|
434
|
-
}, /* @__PURE__ */ React5.createElement(App, {
|
|
435
|
-
placeholder,
|
|
436
|
-
state,
|
|
437
|
-
debounce
|
|
438
|
-
})))), [
|
|
439
|
-
fallback,
|
|
440
|
-
manager,
|
|
441
|
-
placeholder,
|
|
442
|
-
state
|
|
443
|
-
]);
|
|
444
|
-
};
|
|
445
|
-
var setupDevtools = (manager) => {
|
|
446
|
-
globalThis.composer ??= {};
|
|
447
|
-
globalThis.composer.manager = manager;
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
// src/react/useIntentResolver.ts
|
|
451
|
-
import { useEffect as useEffect3 } from "react";
|
|
452
|
-
var useIntentResolver = (module, resolver) => {
|
|
453
|
-
const manager = usePluginManager();
|
|
454
|
-
useEffect3(() => {
|
|
455
|
-
manager.context.contributeCapability({
|
|
456
|
-
module,
|
|
457
|
-
interface: Capabilities.IntentResolver,
|
|
458
|
-
implementation: resolver
|
|
459
|
-
});
|
|
460
|
-
return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);
|
|
461
|
-
}, [
|
|
462
|
-
module,
|
|
463
|
-
resolver
|
|
464
|
-
]);
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
export {
|
|
468
|
-
usePluginManager,
|
|
469
|
-
PluginManagerProvider,
|
|
470
|
-
useCapabilities,
|
|
471
|
-
useCapability,
|
|
472
|
-
useIntentDispatcher,
|
|
473
|
-
useAppGraph,
|
|
474
|
-
useLayout,
|
|
475
|
-
SurfaceCardRole,
|
|
476
|
-
ErrorBoundary,
|
|
477
|
-
Surface,
|
|
478
|
-
useSurfaces,
|
|
479
|
-
isSurfaceAvailable,
|
|
480
|
-
useApp,
|
|
481
|
-
useIntentResolver
|
|
482
|
-
};
|
|
483
|
-
//# sourceMappingURL=chunk-VFUKEZIN.mjs.map
|