@dxos/app-framework 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.mts +1 -3
- package/dist/lib/browser/{capability-7PCNSWBT.mjs → capability-6YMUBS54.mjs} +15 -11
- package/dist/lib/browser/capability-6YMUBS54.mjs.map +7 -0
- package/dist/lib/browser/capability-LF3OXSCV.mjs +34 -0
- package/dist/lib/browser/capability-LF3OXSCV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-272IPLHQ.mjs} +1 -1
- package/dist/lib/browser/{chunk-PKQT6C53.mjs.map → chunk-272IPLHQ.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-FMZN33N4.mjs → chunk-2UI6ACB5.mjs} +48 -31
- package/dist/lib/browser/chunk-2UI6ACB5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TCLLRCS3.mjs → chunk-7M4467QR.mjs} +6 -6
- package/dist/lib/browser/chunk-7M4467QR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7IQHKD4U.mjs → chunk-JGWCBVKJ.mjs} +2 -2
- package/dist/lib/browser/chunk-JGWCBVKJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-M5IC326L.mjs +34 -0
- package/dist/lib/browser/chunk-M5IC326L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XYNO72GQ.mjs → chunk-NQPYE365.mjs} +435 -478
- package/dist/lib/browser/chunk-NQPYE365.mjs.map +7 -0
- package/dist/lib/browser/chunk-TGX63LTL.mjs +8 -0
- package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-TGX63LTL.mjs.map} +1 -1
- package/dist/lib/browser/chunk-TIEBZMTF.mjs +44 -0
- package/dist/lib/browser/chunk-TIEBZMTF.mjs.map +7 -0
- package/dist/lib/browser/chunk-WEBSGU5L.mjs +80 -0
- package/dist/lib/browser/chunk-WEBSGU5L.mjs.map +7 -0
- package/dist/lib/browser/chunk-YAFEA4GV.mjs +1 -0
- package/dist/lib/browser/{chunk-6Y7PZV72.mjs → chunk-YNFPIQGB.mjs} +2 -3
- package/dist/lib/browser/{chunk-6Y7PZV72.mjs.map → chunk-YNFPIQGB.mjs.map} +3 -3
- package/dist/lib/browser/cli/index.mjs +89 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +23 -0
- package/dist/lib/browser/common/capabilities.mjs +45 -0
- package/dist/lib/browser/core/activation-event.mjs +1 -1
- package/dist/lib/browser/core/capability.mjs +1 -1
- package/dist/lib/browser/core/plugin-manager.mjs +4 -4
- package/dist/lib/browser/core/plugin.mjs +2 -2
- package/dist/lib/browser/index.mjs +37 -132
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{invoker-capability-SZRSTHEH.mjs → invoker-capability-4AUGUMM5.mjs} +16 -12
- package/dist/lib/browser/invoker-capability-4AUGUMM5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +28 -20
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/{react → ui}/index.mjs +18 -19
- package/dist/lib/node-esm/{capability-CFLQ2QQU.mjs → capability-R5O2OYX4.mjs} +15 -11
- package/dist/lib/node-esm/capability-R5O2OYX4.mjs.map +7 -0
- package/dist/lib/node-esm/capability-SA6LPYGL.mjs +35 -0
- package/dist/lib/node-esm/capability-SA6LPYGL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-663A54LQ.mjs → chunk-3D66SZHP.mjs} +2 -2
- package/dist/lib/node-esm/chunk-3D66SZHP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-6REV5DE7.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs.map → chunk-6REV5DE7.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-6WXBT3EC.mjs → chunk-FHWPWQRJ.mjs} +435 -478
- package/dist/lib/node-esm/chunk-FHWPWQRJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-FKE4Z3D6.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-FKE4Z3D6.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-GT6OKM5I.mjs → chunk-JHFY3HTS.mjs} +6 -6
- package/dist/lib/node-esm/chunk-JHFY3HTS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XYQTBFPA.mjs → chunk-JIVXIJ2T.mjs} +48 -31
- package/dist/lib/node-esm/chunk-JIVXIJ2T.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NHXBSAQR.mjs +35 -0
- package/dist/lib/node-esm/chunk-NHXBSAQR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-STMXUEPO.mjs → chunk-SB5ODNPX.mjs} +2 -3
- package/dist/lib/node-esm/{chunk-STMXUEPO.mjs.map → chunk-SB5ODNPX.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-SCDGIGGU.mjs +45 -0
- package/dist/lib/node-esm/chunk-SCDGIGGU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SQICGJBW.mjs +81 -0
- package/dist/lib/node-esm/chunk-SQICGJBW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +2 -0
- package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +90 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +24 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +46 -0
- package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
- package/dist/lib/node-esm/core/activation-event.mjs +1 -1
- package/dist/lib/node-esm/core/capability.mjs +1 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +4 -4
- package/dist/lib/node-esm/core/plugin.mjs +2 -2
- package/dist/lib/node-esm/index.mjs +37 -132
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{invoker-capability-PNMA5JOS.mjs → invoker-capability-3YDIVDWV.mjs} +16 -12
- package/dist/lib/node-esm/invoker-capability-3YDIVDWV.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +28 -20
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{react → ui}/index.mjs +18 -19
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/types/src/{cli.d.ts → cli/cli.d.ts} +2 -2
- 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 +115 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -0
- package/dist/types/src/common/index.d.ts +4 -9
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +1 -348
- package/dist/types/src/common/operations.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +0 -9
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/activation-event.d.ts +1 -1
- package/dist/types/src/core/capability.d.ts +7 -7
- package/dist/types/src/core/capability.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +1 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts +1 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +11 -3
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +2 -2
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/{react → ui/components/App}/App.d.ts +1 -1
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
- package/dist/types/src/{react/Surface.stories.d.ts → ui/components/App/App.stories.d.ts} +7 -2
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/index.d.ts +2 -0
- package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerProvider.d.ts +1 -1
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +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.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 +20 -0
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
- package/dist/types/src/{common/surface.d.ts → ui/components/Surface/types.d.ts} +20 -18
- 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 +7 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useApp.d.ts +14 -9
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useCapabilities.d.ts +6 -1
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useOperationResolver.d.ts +2 -2
- package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +1 -0
- package/dist/types/src/{react/common.d.ts → ui/hooks/useSettingsState.d.ts} +1 -5
- 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/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +6 -6
- package/package.json +72 -64
- package/src/{cli.ts → cli/cli.ts} +10 -10
- package/src/{playground/debug → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +44 -0
- package/src/common/capabilities.ts +178 -0
- package/src/common/index.ts +4 -9
- package/src/common/operations.ts +2 -376
- package/src/common/translations.ts +0 -12
- package/src/context.ts +1 -1
- package/src/core/activation-event.ts +1 -1
- package/src/core/capability.ts +9 -9
- package/src/core/plugin-manager.test.ts +44 -44
- package/src/core/plugin-manager.ts +19 -0
- package/src/core/plugin.ts +3 -2
- package/src/index.ts +1 -3
- package/src/plugin-operation/OperationPlugin.ts +5 -5
- package/src/plugin-operation/history/capability.ts +5 -5
- package/src/plugin-operation/history/undo-mapping.ts +6 -3
- package/src/plugin-operation/invoker-capability.ts +5 -5
- package/src/plugin-operation/meta.ts +1 -1
- package/src/plugin-runtime/RuntimePlugin.ts +4 -4
- package/src/plugin-runtime/capability.ts +5 -5
- package/src/plugin-runtime/meta.ts +1 -1
- package/src/testing/service.ts +6 -6
- package/src/testing/withPluginManager.stories.tsx +6 -6
- package/src/testing/withPluginManager.tsx +11 -8
- package/src/ui/components/App/App.stories.tsx +92 -0
- package/src/{react → ui/components/App}/App.tsx +6 -9
- package/src/{playground/layout → ui/components/App}/index.ts +1 -1
- package/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.tsx +13 -14
- package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +1 -1
- package/src/ui/components/PluginManager/index.ts +5 -0
- package/src/{react/Surface.stories.tsx → ui/components/Surface/SurfaceComponent.stories.tsx} +18 -16
- package/src/{react/Surface.tsx → ui/components/Surface/SurfaceComponent.tsx} +36 -56
- package/src/{react → ui/components/Surface}/SurfaceInfo.tsx +2 -2
- package/src/ui/components/Surface/context.ts +12 -0
- package/src/ui/components/Surface/index.ts +20 -0
- package/src/{common/surface.ts → ui/components/Surface/types.ts} +22 -25
- package/src/ui/components/index.ts +7 -0
- package/src/ui/hooks/index.ts +10 -0
- package/src/{react → ui/hooks}/useApp.tsx +29 -25
- package/src/{react → ui/hooks}/useCapabilities.ts +9 -5
- package/src/{react → ui/hooks}/useOperationResolver.ts +5 -5
- package/src/{react/common.ts → ui/hooks/useSettingsState.ts} +0 -11
- package/src/ui/hooks/useSurface.ts +13 -0
- package/src/ui/index.ts +6 -0
- package/tsconfig.json +2 -29
- package/tsconfig.node.json +1 -3
- package/typedoc.json +2 -4
- package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs +0 -149
- package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs.map +0 -7
- package/dist/lib/browser/capability-7PCNSWBT.mjs.map +0 -7
- package/dist/lib/browser/capability-KP3PFEXD.mjs +0 -31
- package/dist/lib/browser/capability-KP3PFEXD.mjs.map +0 -7
- package/dist/lib/browser/chunk-7IQHKD4U.mjs.map +0 -7
- package/dist/lib/browser/chunk-BLQJSGL3.mjs +0 -732
- package/dist/lib/browser/chunk-BLQJSGL3.mjs.map +0 -7
- package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
- package/dist/lib/browser/chunk-FMZN33N4.mjs.map +0 -7
- package/dist/lib/browser/chunk-H4WPA7U7.mjs +0 -77
- package/dist/lib/browser/chunk-H4WPA7U7.mjs.map +0 -7
- package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYNO72GQ.mjs.map +0 -7
- package/dist/lib/browser/common/index.mjs +0 -38
- package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs +0 -64
- package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs +0 -150
- package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs.map +0 -7
- package/dist/lib/node-esm/capability-CFLQ2QQU.mjs.map +0 -7
- package/dist/lib/node-esm/capability-RCUNM2M7.mjs +0 -32
- package/dist/lib/node-esm/capability-RCUNM2M7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-663A54LQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GQEBIGKD.mjs +0 -733
- package/dist/lib/node-esm/chunk-GQEBIGKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GT6OKM5I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XR6NMKEP.mjs +0 -78
- package/dist/lib/node-esm/chunk-XR6NMKEP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XYQTBFPA.mjs.map +0 -7
- package/dist/lib/node-esm/common/index.mjs +0 -39
- package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs +0 -65
- package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs.map +0 -7
- package/dist/types/src/cli.d.ts.map +0 -1
- package/dist/types/src/common/activation-event.d.ts +0 -66
- package/dist/types/src/common/activation-event.d.ts.map +0 -1
- package/dist/types/src/common/capability.d.ts +0 -265
- package/dist/types/src/common/capability.d.ts.map +0 -1
- package/dist/types/src/common/collaboration.d.ts +0 -26
- package/dist/types/src/common/collaboration.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/plugin.d.ts +0 -201
- package/dist/types/src/common/plugin.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/playground/debug/Debug.d.ts +0 -8
- 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 -3
- package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Main.d.ts +0 -8
- package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +0 -8
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/generator/generator.d.ts +0 -19
- 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 -3
- package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/layout/Layout.d.ts +0 -10
- 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 -3
- package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +0 -8
- 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 -3
- package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/schema.d.ts +0 -27
- 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-settings/SettingsPlugin.d.ts +0 -3
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/actions.d.ts +0 -61
- package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -6
- 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/meta.d.ts +0 -3
- package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/operation-resolver.d.ts +0 -6
- package/dist/types/src/plugin-settings/operation-resolver.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.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/PluginManagerContext.stories.d.ts.map +0 -1
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
- package/dist/types/src/react/Surface.d.ts +0 -14
- 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/SurfaceInfo.d.ts.map +0 -1
- 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 -12
- 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.map +0 -1
- package/dist/types/src/react/useLoading.d.ts.map +0 -1
- package/dist/types/src/react/useOperationResolver.d.ts.map +0 -1
- package/src/common/activation-event.ts +0 -99
- package/src/common/capability.ts +0 -343
- package/src/common/collaboration.ts +0 -31
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/plugin.ts +0 -364
- package/src/playground/debug/Debug.tsx +0 -49
- package/src/playground/debug/plugin.ts +0 -16
- package/src/playground/generator/Main.tsx +0 -80
- package/src/playground/generator/Toolbar.tsx +0 -57
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -21
- package/src/playground/layout/Layout.tsx +0 -37
- package/src/playground/layout/plugin.ts +0 -18
- package/src/playground/logger/Toolbar.tsx +0 -33
- package/src/playground/logger/index.ts +0 -5
- package/src/playground/logger/plugin.ts +0 -42
- package/src/playground/logger/schema.ts +0 -22
- package/src/playground/playground.stories.tsx +0 -54
- package/src/plugin-settings/SettingsPlugin.ts +0 -19
- package/src/plugin-settings/actions.ts +0 -64
- package/src/plugin-settings/app-graph-builder.ts +0 -140
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/meta.ts +0 -10
- package/src/plugin-settings/operation-resolver.ts +0 -55
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/App.stories.tsx +0 -63
- package/src/react/DefaultFallback.tsx +0 -26
- package/src/react/ErrorBoundary.tsx +0 -56
- package/src/react/index.ts +0 -14
- package/src/react/types.ts +0 -27
- /package/dist/lib/{node-esm/react/index.mjs.map → browser/chunk-YAFEA4GV.mjs.map} +0 -0
- /package/dist/lib/{node-esm/common/index.mjs.map → browser/common/activation-events.mjs.map} +0 -0
- /package/dist/lib/browser/{react/index.mjs.map → common/capabilities.mjs.map} +0 -0
- /package/dist/lib/browser/{common → ui}/index.mjs.map +0 -0
- /package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.d.ts +0 -0
- /package/dist/types/src/{react → ui/components/Surface}/SurfaceInfo.d.ts +0 -0
- /package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +0 -0
- /package/src/{react → ui/hooks}/useLoading.tsx +0 -0
|
@@ -15,7 +15,7 @@ import * as TestClock from 'effect/TestClock';
|
|
|
15
15
|
import { invariant } from '@dxos/invariant';
|
|
16
16
|
import { type LogConfig, type LogEntry, LogLevel, log } from '@dxos/log';
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import { ActivationEvents } from '../common';
|
|
19
19
|
|
|
20
20
|
import * as ActivationEvent from './activation-event';
|
|
21
21
|
import * as Capability from './capability';
|
|
@@ -23,14 +23,14 @@ import type * as CapabilityManager from './capability-manager';
|
|
|
23
23
|
import * as Plugin from './plugin';
|
|
24
24
|
import * as PluginManager from './plugin-manager';
|
|
25
25
|
|
|
26
|
-
const String = Capability.make<{ string: string }>('dxos.
|
|
27
|
-
const Number = Capability.make<{ number: number }>('dxos.
|
|
28
|
-
const Total = Capability.make<{ total: number }>('dxos.
|
|
26
|
+
const String = Capability.make<{ string: string }>('org.dxos.test.string');
|
|
27
|
+
const Number = Capability.make<{ number: number }>('org.dxos.test.number');
|
|
28
|
+
const Total = Capability.make<{ total: number }>('org.dxos.test.total');
|
|
29
29
|
|
|
30
|
-
const CountEvent = ActivationEvent.make('dxos.
|
|
31
|
-
const FailEvent = ActivationEvent.make('dxos.
|
|
30
|
+
const CountEvent = ActivationEvent.make('org.dxos.test.count');
|
|
31
|
+
const FailEvent = ActivationEvent.make('org.dxos.test.fail');
|
|
32
32
|
|
|
33
|
-
const testMeta = { id: 'dxos.
|
|
33
|
+
const testMeta = { id: 'org.dxos.plugin.test', name: 'Test' };
|
|
34
34
|
|
|
35
35
|
// TODO(wittjosiah): Factor out?
|
|
36
36
|
const atomCounter = (registry: Registry.Registry, atom: Atom.Atom<any>) => {
|
|
@@ -89,12 +89,12 @@ describe('PluginManager', () => {
|
|
|
89
89
|
const TestPluginFactory = Plugin.define<TestPluginOptions>(testMeta).pipe(
|
|
90
90
|
Plugin.addModule((options: TestPluginOptions) => ({
|
|
91
91
|
id: 'Hello',
|
|
92
|
-
activatesOn:
|
|
92
|
+
activatesOn: ActivationEvents.Startup,
|
|
93
93
|
activate: () => Effect.succeed(Capability.contributes(String, { string: `hello-${options.count}` })),
|
|
94
94
|
})),
|
|
95
95
|
Plugin.addModule({
|
|
96
96
|
id: 'World',
|
|
97
|
-
activatesOn:
|
|
97
|
+
activatesOn: ActivationEvents.Startup,
|
|
98
98
|
activate: () => Effect.succeed(Capability.contributes(String, { string: 'world' })),
|
|
99
99
|
}),
|
|
100
100
|
Plugin.make,
|
|
@@ -105,7 +105,7 @@ describe('PluginManager', () => {
|
|
|
105
105
|
|
|
106
106
|
const manager = PluginManager.make({ plugins: [plugin], core: [], pluginLoader });
|
|
107
107
|
yield* manager.enable(testMeta.id);
|
|
108
|
-
yield* manager.activate(
|
|
108
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
109
109
|
const strings = manager.capabilities.getAll(String);
|
|
110
110
|
assert.strictEqual(strings.length, 2);
|
|
111
111
|
assert.strictEqual(strings[0].string, 'hello-5');
|
|
@@ -118,7 +118,7 @@ describe('PluginManager', () => {
|
|
|
118
118
|
const Test = Plugin.define(testMeta).pipe(
|
|
119
119
|
Plugin.addModule({
|
|
120
120
|
id: 'Hello',
|
|
121
|
-
activatesOn:
|
|
121
|
+
activatesOn: ActivationEvents.Startup,
|
|
122
122
|
activate: () => Effect.succeed(Capability.contributes(String, { string: 'hello' })),
|
|
123
123
|
}),
|
|
124
124
|
Plugin.make,
|
|
@@ -140,7 +140,7 @@ describe('PluginManager', () => {
|
|
|
140
140
|
const Test = Plugin.define(testMeta).pipe(
|
|
141
141
|
Plugin.addModule({
|
|
142
142
|
id: 'Hello',
|
|
143
|
-
activatesOn:
|
|
143
|
+
activatesOn: ActivationEvents.Startup,
|
|
144
144
|
activate: () => Effect.succeed(Capability.contributes(String, { string: 'hello' })),
|
|
145
145
|
}),
|
|
146
146
|
Plugin.make,
|
|
@@ -154,9 +154,9 @@ describe('PluginManager', () => {
|
|
|
154
154
|
assert.deepStrictEqual(manager.getModules(), [testPlugin.modules[0]]);
|
|
155
155
|
assert.deepStrictEqual(manager.getActive(), []);
|
|
156
156
|
assert.deepStrictEqual(manager.getEventsFired(), []);
|
|
157
|
-
yield* manager.activate(
|
|
157
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
158
158
|
assert.deepStrictEqual(manager.getActive(), [testPlugin.modules[0].id]);
|
|
159
|
-
assert.deepStrictEqual(manager.getEventsFired(), [
|
|
159
|
+
assert.deepStrictEqual(manager.getEventsFired(), [ActivationEvents.Startup.id]);
|
|
160
160
|
}),
|
|
161
161
|
);
|
|
162
162
|
|
|
@@ -165,7 +165,7 @@ describe('PluginManager', () => {
|
|
|
165
165
|
const Test = Plugin.define(testMeta).pipe(
|
|
166
166
|
Plugin.addModule({
|
|
167
167
|
id: 'NoCapabilities',
|
|
168
|
-
activatesOn:
|
|
168
|
+
activatesOn: ActivationEvents.Startup,
|
|
169
169
|
activate: Effect.fnUntraced(function* () {}),
|
|
170
170
|
}),
|
|
171
171
|
Plugin.make,
|
|
@@ -175,7 +175,7 @@ describe('PluginManager', () => {
|
|
|
175
175
|
const manager = PluginManager.make({ plugins: [testPlugin], pluginLoader });
|
|
176
176
|
yield* manager.enable(Test.meta.id);
|
|
177
177
|
|
|
178
|
-
const result = yield* manager.activate(
|
|
178
|
+
const result = yield* manager.activate(ActivationEvents.Startup);
|
|
179
179
|
assert.isTrue(result);
|
|
180
180
|
assert.deepStrictEqual(manager.getActive(), [testPlugin.modules[0].id]);
|
|
181
181
|
assert.strictEqual(manager.capabilities.getAll(String).length, 0);
|
|
@@ -204,7 +204,7 @@ describe('PluginManager', () => {
|
|
|
204
204
|
|
|
205
205
|
it.effect('should catch and log defects (synchronous throws) in module activation', () =>
|
|
206
206
|
Effect.gen(function* () {
|
|
207
|
-
const DefectEvent = ActivationEvent.make('dxos.
|
|
207
|
+
const DefectEvent = ActivationEvent.make('org.dxos.test.defect');
|
|
208
208
|
const capturedErrors: LogEntry[] = [];
|
|
209
209
|
const removeProcessor = log.addProcessor((_config: LogConfig, entry: LogEntry) => {
|
|
210
210
|
if (entry.level === LogLevel.ERROR) {
|
|
@@ -238,7 +238,7 @@ describe('PluginManager', () => {
|
|
|
238
238
|
const defectLog = capturedErrors.find(
|
|
239
239
|
(entry) =>
|
|
240
240
|
entry.message?.includes('module failed to activate') &&
|
|
241
|
-
entry.context?.module === 'dxos.
|
|
241
|
+
entry.context?.module === 'org.dxos.plugin.test.module.DefectInEffectSync',
|
|
242
242
|
);
|
|
243
243
|
assert.isNotNull(defectLog, 'Expected error log for defect');
|
|
244
244
|
assert.strictEqual(defectLog?.context?.isDefect, true, 'Expected isDefect to be true for synchronous throw');
|
|
@@ -249,7 +249,7 @@ describe('PluginManager', () => {
|
|
|
249
249
|
|
|
250
250
|
it.effect('should catch and log defects when activate throws before returning Effect', () =>
|
|
251
251
|
Effect.gen(function* () {
|
|
252
|
-
const DefectEvent = ActivationEvent.make('dxos.
|
|
252
|
+
const DefectEvent = ActivationEvent.make('org.dxos.test.defect-immediate');
|
|
253
253
|
const capturedErrors: LogEntry[] = [];
|
|
254
254
|
const removeProcessor = log.addProcessor((_config: LogConfig, entry: LogEntry) => {
|
|
255
255
|
if (entry.level === LogLevel.ERROR) {
|
|
@@ -284,7 +284,7 @@ describe('PluginManager', () => {
|
|
|
284
284
|
const defectLog = capturedErrors.find(
|
|
285
285
|
(entry) =>
|
|
286
286
|
entry.message?.includes('module failed to activate') &&
|
|
287
|
-
entry.context?.module === 'dxos.
|
|
287
|
+
entry.context?.module === 'org.dxos.plugin.test.module.DefectImmediate',
|
|
288
288
|
);
|
|
289
289
|
assert.isNotNull(defectLog, 'Expected error log for immediate defect');
|
|
290
290
|
assert.strictEqual(
|
|
@@ -303,7 +303,7 @@ describe('PluginManager', () => {
|
|
|
303
303
|
Plugin.define(testMeta).pipe(
|
|
304
304
|
Plugin.addModule({
|
|
305
305
|
id: 'Hello',
|
|
306
|
-
activatesOn:
|
|
306
|
+
activatesOn: ActivationEvents.Startup,
|
|
307
307
|
activate: () => Effect.succeed(Capability.contributes(String, { string: 'hello' })),
|
|
308
308
|
}),
|
|
309
309
|
Plugin.addModule({
|
|
@@ -339,7 +339,7 @@ describe('PluginManager', () => {
|
|
|
339
339
|
);
|
|
340
340
|
|
|
341
341
|
yield* manager.add(testMeta.id);
|
|
342
|
-
yield* manager.activate(
|
|
342
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
343
343
|
yield* activating.await;
|
|
344
344
|
yield* activated.await;
|
|
345
345
|
|
|
@@ -374,7 +374,7 @@ describe('PluginManager', () => {
|
|
|
374
374
|
const Test = Plugin.define(testMeta).pipe(
|
|
375
375
|
Plugin.addModule({
|
|
376
376
|
id: 'Hello',
|
|
377
|
-
activatesOn:
|
|
377
|
+
activatesOn: ActivationEvents.Startup,
|
|
378
378
|
activate: () => {
|
|
379
379
|
count++;
|
|
380
380
|
return Effect.succeed(Capability.contributes(String, { string: 'hello' }));
|
|
@@ -389,19 +389,19 @@ describe('PluginManager', () => {
|
|
|
389
389
|
|
|
390
390
|
{
|
|
391
391
|
yield* manager.add(testMeta.id);
|
|
392
|
-
const result = yield* manager.activate(
|
|
392
|
+
const result = yield* manager.activate(ActivationEvents.Startup);
|
|
393
393
|
assert.isTrue(result);
|
|
394
394
|
assert.deepStrictEqual(manager.getActive(), [testPlugin.modules[0].id]);
|
|
395
395
|
assert.strictEqual(count, 1);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
{
|
|
399
|
-
const result = yield* manager.activate(
|
|
399
|
+
const result = yield* manager.activate(ActivationEvents.Startup);
|
|
400
400
|
assert.isFalse(result);
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
{
|
|
404
|
-
const result = yield* manager.reset(
|
|
404
|
+
const result = yield* manager.reset(ActivationEvents.Startup);
|
|
405
405
|
assert.isTrue(result);
|
|
406
406
|
assert.strictEqual(count, 2);
|
|
407
407
|
}
|
|
@@ -419,7 +419,7 @@ describe('PluginManager', () => {
|
|
|
419
419
|
|
|
420
420
|
it.effect('should be able to fire custom activation events', () =>
|
|
421
421
|
Effect.gen(function* () {
|
|
422
|
-
const Plugin1 = Plugin.define({ id: 'dxos.
|
|
422
|
+
const Plugin1 = Plugin.define({ id: 'org.dxos.test.plugin-1', name: 'Plugin 1' }).pipe(
|
|
423
423
|
Plugin.addModule({
|
|
424
424
|
activatesOn: CountEvent,
|
|
425
425
|
id: 'Plugin1',
|
|
@@ -427,7 +427,7 @@ describe('PluginManager', () => {
|
|
|
427
427
|
}),
|
|
428
428
|
Plugin.make,
|
|
429
429
|
);
|
|
430
|
-
const Plugin2 = Plugin.define({ id: 'dxos.
|
|
430
|
+
const Plugin2 = Plugin.define({ id: 'org.dxos.test.plugin-2', name: 'Plugin 2' }).pipe(
|
|
431
431
|
Plugin.addModule({
|
|
432
432
|
activatesOn: CountEvent,
|
|
433
433
|
id: 'Plugin2',
|
|
@@ -435,7 +435,7 @@ describe('PluginManager', () => {
|
|
|
435
435
|
}),
|
|
436
436
|
Plugin.make,
|
|
437
437
|
);
|
|
438
|
-
const Plugin3 = Plugin.define({ id: 'dxos.
|
|
438
|
+
const Plugin3 = Plugin.define({ id: 'org.dxos.test.plugin-3', name: 'Plugin 3' }).pipe(
|
|
439
439
|
Plugin.addModule({
|
|
440
440
|
activatesOn: CountEvent,
|
|
441
441
|
id: 'Plugin3',
|
|
@@ -477,7 +477,7 @@ describe('PluginManager', () => {
|
|
|
477
477
|
Effect.gen(function* () {
|
|
478
478
|
const Test = Plugin.define(testMeta).pipe(
|
|
479
479
|
Plugin.addModule({
|
|
480
|
-
activatesOn: ActivationEvent.allOf(
|
|
480
|
+
activatesOn: ActivationEvent.allOf(ActivationEvents.Startup, CountEvent),
|
|
481
481
|
id: 'Hello',
|
|
482
482
|
activate: () => {
|
|
483
483
|
return Effect.succeed(Capability.contributes(String, { string: 'hello' }));
|
|
@@ -493,7 +493,7 @@ describe('PluginManager', () => {
|
|
|
493
493
|
assert.strictEqual(manager.capabilities.getAll(String).length, 0);
|
|
494
494
|
|
|
495
495
|
yield* manager.add(testMeta.id);
|
|
496
|
-
yield* manager.activate(
|
|
496
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
497
497
|
assert.deepStrictEqual(manager.getActive(), []);
|
|
498
498
|
assert.strictEqual(manager.capabilities.getAll(String).length, 0);
|
|
499
499
|
|
|
@@ -509,7 +509,7 @@ describe('PluginManager', () => {
|
|
|
509
509
|
const Test = Plugin.define(testMeta).pipe(
|
|
510
510
|
Plugin.addModule({
|
|
511
511
|
id: 'Hello',
|
|
512
|
-
activatesOn: ActivationEvent.oneOf(
|
|
512
|
+
activatesOn: ActivationEvent.oneOf(ActivationEvents.Startup, CountEvent),
|
|
513
513
|
activate: () => {
|
|
514
514
|
count++;
|
|
515
515
|
return Effect.succeed(Capability.contributes(String, { string: 'hello' }));
|
|
@@ -531,7 +531,7 @@ describe('PluginManager', () => {
|
|
|
531
531
|
assert.strictEqual(manager.capabilities.getAll(String).length, 1);
|
|
532
532
|
assert.strictEqual(count, 1);
|
|
533
533
|
|
|
534
|
-
yield* manager.activate(
|
|
534
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
535
535
|
assert.deepStrictEqual(manager.getActive(), [testPlugin.modules[0].id]);
|
|
536
536
|
assert.strictEqual(manager.capabilities.getAll(String).length, 1);
|
|
537
537
|
assert.strictEqual(count, 1);
|
|
@@ -546,10 +546,10 @@ describe('PluginManager', () => {
|
|
|
546
546
|
state.total = numbers.reduce((acc: number, n: { number: number }) => acc + n.number, 0);
|
|
547
547
|
};
|
|
548
548
|
|
|
549
|
-
const Count = Plugin.define({ id: 'dxos.
|
|
549
|
+
const Count = Plugin.define({ id: 'org.dxos.test.count', name: 'Count' }).pipe(
|
|
550
550
|
Plugin.addModule({
|
|
551
551
|
id: 'Count',
|
|
552
|
-
activatesOn:
|
|
552
|
+
activatesOn: ActivationEvents.Startup,
|
|
553
553
|
activatesBefore: [CountEvent],
|
|
554
554
|
activate: Effect.fnUntraced(function* () {
|
|
555
555
|
const capabilityManager = yield* Capability.Service;
|
|
@@ -586,7 +586,7 @@ describe('PluginManager', () => {
|
|
|
586
586
|
{
|
|
587
587
|
yield* manager.add(Test.meta.id);
|
|
588
588
|
yield* manager.add(Count.meta.id);
|
|
589
|
-
yield* manager.activate(
|
|
589
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
590
590
|
assert.deepStrictEqual(manager.getActive(), [
|
|
591
591
|
...testPlugin.modules.map((m) => m.id),
|
|
592
592
|
countPlugin.modules[0].id,
|
|
@@ -626,7 +626,7 @@ describe('PluginManager', () => {
|
|
|
626
626
|
|
|
627
627
|
it.effect('should be reactive', () =>
|
|
628
628
|
Effect.gen(function* () {
|
|
629
|
-
const Plugin1 = Plugin.define({ id: 'dxos.
|
|
629
|
+
const Plugin1 = Plugin.define({ id: 'org.dxos.test.plugin-1', name: 'Plugin 1' }).pipe(
|
|
630
630
|
Plugin.addModule({
|
|
631
631
|
activatesOn: CountEvent,
|
|
632
632
|
id: 'Plugin1',
|
|
@@ -634,7 +634,7 @@ describe('PluginManager', () => {
|
|
|
634
634
|
}),
|
|
635
635
|
Plugin.make,
|
|
636
636
|
);
|
|
637
|
-
const Plugin2 = Plugin.define({ id: 'dxos.
|
|
637
|
+
const Plugin2 = Plugin.define({ id: 'org.dxos.test.plugin-2', name: 'Plugin 2' }).pipe(
|
|
638
638
|
Plugin.addModule({
|
|
639
639
|
activatesOn: CountEvent,
|
|
640
640
|
id: 'Plugin2',
|
|
@@ -642,7 +642,7 @@ describe('PluginManager', () => {
|
|
|
642
642
|
}),
|
|
643
643
|
Plugin.make,
|
|
644
644
|
);
|
|
645
|
-
const Plugin3 = Plugin.define({ id: 'dxos.
|
|
645
|
+
const Plugin3 = Plugin.define({ id: 'org.dxos.test.plugin-3', name: 'Plugin 3' }).pipe(
|
|
646
646
|
Plugin.addModule({
|
|
647
647
|
activatesOn: CountEvent,
|
|
648
648
|
id: 'Plugin3',
|
|
@@ -752,8 +752,8 @@ describe('PluginManager', () => {
|
|
|
752
752
|
}
|
|
753
753
|
});
|
|
754
754
|
|
|
755
|
-
const SlowEvent = ActivationEvent.make('dxos.
|
|
756
|
-
const SlowPlugin = Plugin.define({ id: 'dxos.
|
|
755
|
+
const SlowEvent = ActivationEvent.make('org.dxos.test.slow');
|
|
756
|
+
const SlowPlugin = Plugin.define({ id: 'org.dxos.test.slow-plugin', name: 'Slow Plugin' }).pipe(
|
|
757
757
|
Plugin.addModule({
|
|
758
758
|
id: 'SlowModule',
|
|
759
759
|
activatesOn: SlowEvent,
|
|
@@ -795,11 +795,11 @@ describe('PluginManager', () => {
|
|
|
795
795
|
it.effect('should prevent concurrent loads of the same module via semaphore', () =>
|
|
796
796
|
Effect.gen(function* () {
|
|
797
797
|
// Two different events that both can trigger the same module.
|
|
798
|
-
const EventA = ActivationEvent.make('dxos.
|
|
799
|
-
const EventB = ActivationEvent.make('dxos.
|
|
798
|
+
const EventA = ActivationEvent.make('org.dxos.test.event-a');
|
|
799
|
+
const EventB = ActivationEvent.make('org.dxos.test.event-b');
|
|
800
800
|
|
|
801
801
|
let activateCallCount = 0;
|
|
802
|
-
const ConcurrentPlugin = Plugin.define({ id: 'dxos.
|
|
802
|
+
const ConcurrentPlugin = Plugin.define({ id: 'org.dxos.test.concurrent-plugin', name: 'Concurrent Plugin' }).pipe(
|
|
803
803
|
Plugin.addModule({
|
|
804
804
|
id: 'ConcurrentModule',
|
|
805
805
|
// Module activates on either event - this allows two different events to race.
|
|
@@ -15,6 +15,7 @@ import * as PubSub from 'effect/PubSub';
|
|
|
15
15
|
import * as Ref from 'effect/Ref';
|
|
16
16
|
|
|
17
17
|
import { runAndForwardErrors } from '@dxos/effect';
|
|
18
|
+
import { Performance } from '@dxos/effect';
|
|
18
19
|
import { log } from '@dxos/log';
|
|
19
20
|
|
|
20
21
|
import * as ActivationEvent from './activation-event';
|
|
@@ -438,6 +439,15 @@ class ManagerImpl implements PluginManager {
|
|
|
438
439
|
Effect.andThen(Effect.sync(() => log.warn('event activation is taking a long time', { event: key }))),
|
|
439
440
|
),
|
|
440
441
|
),
|
|
442
|
+
Performance.addTrackEntry({
|
|
443
|
+
name: typeof event === 'string' ? event : ActivationEvent.eventKey(event),
|
|
444
|
+
devtools: {
|
|
445
|
+
dataType: 'track-entry',
|
|
446
|
+
track: 'Event Activation',
|
|
447
|
+
trackGroup: 'Composer',
|
|
448
|
+
color: 'primary',
|
|
449
|
+
},
|
|
450
|
+
}),
|
|
441
451
|
);
|
|
442
452
|
}
|
|
443
453
|
|
|
@@ -609,6 +619,15 @@ class ManagerImpl implements PluginManager {
|
|
|
609
619
|
),
|
|
610
620
|
),
|
|
611
621
|
),
|
|
622
|
+
Performance.addTrackEntry({
|
|
623
|
+
name: module.id,
|
|
624
|
+
devtools: {
|
|
625
|
+
dataType: 'track-entry',
|
|
626
|
+
track: 'Module Activation',
|
|
627
|
+
trackGroup: 'Composer',
|
|
628
|
+
color: 'primary',
|
|
629
|
+
},
|
|
630
|
+
}),
|
|
612
631
|
);
|
|
613
632
|
|
|
614
633
|
// Fork the load to run in background, completing the deferred when done.
|
package/src/core/plugin.ts
CHANGED
|
@@ -49,7 +49,7 @@ export const reset = (event: ActivationEvent.ActivationEvent): Effect.Effect<boo
|
|
|
49
49
|
* Computes a module ID from plugin ID and export name.
|
|
50
50
|
*/
|
|
51
51
|
const computeModuleId = (pluginId: string, moduleName: string): string => {
|
|
52
|
-
return `${pluginId}
|
|
52
|
+
return `${pluginId}.module.${moduleName}`;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -128,7 +128,7 @@ export type Meta = {
|
|
|
128
128
|
*
|
|
129
129
|
* Expected to be in the form of a valid URL.
|
|
130
130
|
*
|
|
131
|
-
* @example dxos.
|
|
131
|
+
* @example org.dxos.plugin.example
|
|
132
132
|
*/
|
|
133
133
|
id: string;
|
|
134
134
|
|
|
@@ -190,6 +190,7 @@ export const isPlugin = (value: unknown): value is Plugin => {
|
|
|
190
190
|
* A collection of modules that are be enabled/disabled as a unit.
|
|
191
191
|
* Plugins provide things such as components, state, actions, etc. to the application.
|
|
192
192
|
*/
|
|
193
|
+
// TODO(burdon): Convert to ECHO schema.
|
|
193
194
|
export interface Plugin {
|
|
194
195
|
readonly [PluginTypeId]: PluginTypeId;
|
|
195
196
|
readonly meta: Readonly<Meta>;
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * as Common from './common';
|
|
5
|
+
export * from './common';
|
|
7
6
|
export * from './context';
|
|
8
7
|
export * from './core';
|
|
9
8
|
export * from './plugin-operation';
|
|
10
9
|
export * from './plugin-runtime';
|
|
11
|
-
export * from './plugin-settings';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { ActivationEvents } from '../common';
|
|
6
6
|
import { Capability, Plugin } from '../core';
|
|
7
7
|
|
|
8
8
|
import { meta } from './meta';
|
|
@@ -12,13 +12,13 @@ const HistoryCapabilities = Capability.lazy('HistoryCapabilities', () => import(
|
|
|
12
12
|
|
|
13
13
|
export const OperationPlugin = Plugin.define(meta).pipe(
|
|
14
14
|
Plugin.addModule({
|
|
15
|
-
activatesOn:
|
|
16
|
-
activatesBefore: [
|
|
17
|
-
activatesAfter: [
|
|
15
|
+
activatesOn: ActivationEvents.ManagedRuntimeReady,
|
|
16
|
+
activatesBefore: [ActivationEvents.SetupOperationResolver],
|
|
17
|
+
activatesAfter: [ActivationEvents.OperationInvokerReady],
|
|
18
18
|
activate: OperationInvoker,
|
|
19
19
|
}),
|
|
20
20
|
Plugin.addModule({
|
|
21
|
-
activatesOn:
|
|
21
|
+
activatesOn: ActivationEvents.OperationInvokerReady,
|
|
22
22
|
activate: HistoryCapabilities,
|
|
23
23
|
}),
|
|
24
24
|
Plugin.make,
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { type OperationInvoker } from '@dxos/operation';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { Capabilities } from '../../common';
|
|
10
10
|
import { Capability } from '../../core';
|
|
11
11
|
|
|
12
12
|
import * as HistoryTracker from './history-tracker';
|
|
@@ -22,16 +22,16 @@ export default Capability.makeModule(
|
|
|
22
22
|
const capabilities = yield* Capability.Service;
|
|
23
23
|
|
|
24
24
|
// Create UndoRegistry.
|
|
25
|
-
const undoRegistry = UndoRegistry.make(() => capabilities.getAll(
|
|
25
|
+
const undoRegistry = UndoRegistry.make(() => capabilities.getAll(Capabilities.UndoMapping).flat());
|
|
26
26
|
|
|
27
27
|
// Create HistoryTracker (depends on UndoRegistry and OperationInvoker).
|
|
28
|
-
const invoker = yield* Capability.get(
|
|
28
|
+
const invoker = yield* Capability.get(Capabilities.OperationInvoker);
|
|
29
29
|
// Cast to internal type - the factory always returns OperationInvokerInternal.
|
|
30
30
|
const historyTracker = HistoryTracker.make(invoker as OperationInvoker.OperationInvokerInternal, undoRegistry);
|
|
31
31
|
|
|
32
32
|
return [
|
|
33
|
-
Capability.contributes(
|
|
34
|
-
Capability.contributes(
|
|
33
|
+
Capability.contributes(Capabilities.UndoRegistry, undoRegistry),
|
|
34
|
+
Capability.contributes(Capabilities.HistoryTracker, historyTracker),
|
|
35
35
|
];
|
|
36
36
|
}),
|
|
37
37
|
);
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import type { Operation } from '@dxos/operation';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Label type for translatable text (canonical definition in @dxos/app-toolkit).
|
|
9
|
+
*/
|
|
10
|
+
type Label = string | [string, { ns: string; count?: number; defaultValue?: string }];
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* Extract the input type from an OperationDefinition.
|
|
@@ -95,7 +98,7 @@ export interface UndoMappingProps<
|
|
|
95
98
|
* thread: output.thread,
|
|
96
99
|
* anchor: output.anchor,
|
|
97
100
|
* }),
|
|
98
|
-
* message: ['thread deleted label', { ns: 'plugin-thread' }],
|
|
101
|
+
* message: ['thread deleted label', { ns: '@dxos/plugin-thread' }],
|
|
99
102
|
* });
|
|
100
103
|
*
|
|
101
104
|
* // Dynamic message based on input/output
|
|
@@ -106,7 +109,7 @@ export interface UndoMappingProps<
|
|
|
106
109
|
* message: (input, _output) =>
|
|
107
110
|
* input.objects.length === 1
|
|
108
111
|
* ? ['object deleted label', { ns: getTypename(input.objects[0]) }]
|
|
109
|
-
* : ['objects deleted label', { ns: 'plugin-space' }],
|
|
112
|
+
* : ['objects deleted label', { ns: '@dxos/plugin-space' }],
|
|
110
113
|
* });
|
|
111
114
|
* ```
|
|
112
115
|
*/
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { OperationInvoker } from '@dxos/operation';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { ActivationEvents, Capabilities } from '../common';
|
|
10
10
|
import { Capability, Plugin } from '../core';
|
|
11
11
|
|
|
12
12
|
//
|
|
@@ -20,14 +20,14 @@ export default Capability.makeModule(
|
|
|
20
20
|
const pluginManager = yield* Plugin.Service;
|
|
21
21
|
|
|
22
22
|
// Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).
|
|
23
|
-
const managedRuntimes = yield* Capability.getAll(
|
|
23
|
+
const managedRuntimes = yield* Capability.getAll(Capabilities.ManagedRuntime);
|
|
24
24
|
const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : undefined;
|
|
25
25
|
|
|
26
26
|
const invoker = OperationInvoker.make(
|
|
27
27
|
() =>
|
|
28
28
|
Effect.gen(function* () {
|
|
29
|
-
yield* Plugin.activate(
|
|
30
|
-
return (yield* Capability.getAll(
|
|
29
|
+
yield* Plugin.activate(ActivationEvents.SetupOperationResolver);
|
|
30
|
+
return (yield* Capability.getAll(Capabilities.OperationResolver)).flat();
|
|
31
31
|
}).pipe(
|
|
32
32
|
Effect.provideService(Capability.Service, capabilityManager),
|
|
33
33
|
Effect.provideService(Plugin.Service, pluginManager),
|
|
@@ -35,6 +35,6 @@ export default Capability.makeModule(
|
|
|
35
35
|
managedRuntime,
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
return Capability.contributes(
|
|
38
|
+
return Capability.contributes(Capabilities.OperationInvoker, invoker);
|
|
39
39
|
}),
|
|
40
40
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Plugin } from '../core';
|
|
6
6
|
|
|
7
7
|
export const meta: Plugin.Meta = {
|
|
8
|
-
id: 'dxos.
|
|
8
|
+
id: 'org.dxos.plugin.operation',
|
|
9
9
|
name: 'Operation Plugin',
|
|
10
10
|
description: 'Provides operation invocation, undo registry, and history tracking.',
|
|
11
11
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { ActivationEvents } from '../common';
|
|
6
6
|
import { Capability, Plugin } from '../core';
|
|
7
7
|
|
|
8
8
|
import { meta } from './meta';
|
|
@@ -11,9 +11,9 @@ const ManagedRuntimeCapability = Capability.lazy('ManagedRuntime', () => import(
|
|
|
11
11
|
|
|
12
12
|
export const RuntimePlugin = Plugin.define(meta).pipe(
|
|
13
13
|
Plugin.addModule({
|
|
14
|
-
activatesOn:
|
|
15
|
-
activatesBefore: [
|
|
16
|
-
activatesAfter: [
|
|
14
|
+
activatesOn: ActivationEvents.Startup,
|
|
15
|
+
activatesBefore: [ActivationEvents.SetupLayer],
|
|
16
|
+
activatesAfter: [ActivationEvents.ManagedRuntimeReady],
|
|
17
17
|
activate: ManagedRuntimeCapability,
|
|
18
18
|
}),
|
|
19
19
|
Plugin.make,
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import * as Layer from 'effect/Layer';
|
|
7
7
|
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { ActivationEvents, Capabilities } from '../common';
|
|
10
10
|
import { Capability, Plugin } from '../core';
|
|
11
11
|
|
|
12
12
|
//
|
|
@@ -22,10 +22,10 @@ export default Capability.makeModule(
|
|
|
22
22
|
const pluginManager = yield* Plugin.Service;
|
|
23
23
|
|
|
24
24
|
// Trigger setup event so plugins can contribute their layers.
|
|
25
|
-
yield* Plugin.activate(
|
|
25
|
+
yield* Plugin.activate(ActivationEvents.SetupLayer);
|
|
26
26
|
|
|
27
27
|
// Gather all contributed layers.
|
|
28
|
-
const layers = yield* Capability.getAll(
|
|
28
|
+
const layers = yield* Capability.getAll(Capabilities.Layer);
|
|
29
29
|
|
|
30
30
|
// Create layers that provide Capability.Service and Plugin.Service.
|
|
31
31
|
const capabilityServiceLayer = Layer.succeed(Capability.Service, capabilityManager);
|
|
@@ -46,8 +46,8 @@ export default Capability.makeModule(
|
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
// Create the managed runtime from the composed layer.
|
|
49
|
-
const runtime = ManagedRuntime.make(composedLayer) as
|
|
49
|
+
const runtime = ManagedRuntime.make(composedLayer) as Capabilities.ManagedRuntime;
|
|
50
50
|
|
|
51
|
-
return Capability.contributes(
|
|
51
|
+
return Capability.contributes(Capabilities.ManagedRuntime, runtime);
|
|
52
52
|
}),
|
|
53
53
|
);
|
package/src/testing/service.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Layer from 'effect/Layer';
|
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import { ActivationEvents, Capabilities } from '../common';
|
|
11
11
|
import { Plugin, PluginManager } from '../core';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -34,18 +34,18 @@ export const fromPlugins = (plugins: Plugin.Plugin[]) =>
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
manager.capabilities.contribute({
|
|
37
|
-
interface:
|
|
37
|
+
interface: Capabilities.PluginManager,
|
|
38
38
|
implementation: manager,
|
|
39
|
-
module: 'dxos.
|
|
39
|
+
module: 'org.dxos.app-framework.plugin-manager',
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
manager.capabilities.contribute({
|
|
43
|
-
interface:
|
|
43
|
+
interface: Capabilities.AtomRegistry,
|
|
44
44
|
implementation: manager.registry,
|
|
45
|
-
module: 'dxos.
|
|
45
|
+
module: 'org.dxos.app-framework.atom-registry',
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
yield* manager.activate(
|
|
48
|
+
yield* manager.activate(ActivationEvents.Startup);
|
|
49
49
|
|
|
50
50
|
return manager;
|
|
51
51
|
}),
|