@dxos/app-framework 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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-4NSF2SOO.mjs} +16 -11
- package/dist/lib/browser/capability-4NSF2SOO.mjs.map +7 -0
- package/dist/lib/browser/capability-EB3UKSKA.mjs +35 -0
- package/dist/lib/browser/capability-EB3UKSKA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMZN33N4.mjs → chunk-27FZETIA.mjs} +324 -181
- package/dist/lib/browser/chunk-27FZETIA.mjs.map +7 -0
- package/dist/lib/browser/chunk-CV7I2AAB.mjs +80 -0
- package/dist/lib/browser/chunk-CV7I2AAB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6Y7PZV72.mjs → chunk-FL2XTEJH.mjs} +3 -4
- package/dist/lib/browser/chunk-FL2XTEJH.mjs.map +7 -0
- package/dist/lib/browser/chunk-H7OMDDGW.mjs +42 -0
- package/dist/lib/browser/chunk-H7OMDDGW.mjs.map +7 -0
- package/dist/lib/browser/chunk-HDQXX5DC.mjs +157 -0
- package/dist/lib/browser/chunk-HDQXX5DC.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-KNBRTZVK.mjs +892 -0
- package/dist/lib/browser/chunk-KNBRTZVK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7IQHKD4U.mjs → chunk-NO7R7QHA.mjs} +4 -7
- package/dist/lib/browser/chunk-NO7R7QHA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TCLLRCS3.mjs → chunk-P2E7VMRF.mjs} +10 -7
- package/dist/lib/browser/chunk-P2E7VMRF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-QSXYHXCE.mjs} +3 -2
- package/dist/lib/browser/chunk-QSXYHXCE.mjs.map +7 -0
- package/dist/lib/browser/chunk-RFSO3JRG.mjs +1 -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/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 +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 +6 -4
- package/dist/lib/browser/core/url-loader.mjs +12 -0
- package/dist/lib/browser/index.mjs +40 -131
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-P7KPBTP3.mjs +43 -0
- package/dist/lib/browser/invoker-capability-P7KPBTP3.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +56 -34
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/{react → ui}/index.mjs +19 -21
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/{capability-CFLQ2QQU.mjs → capability-CB3MNEI3.mjs} +16 -11
- package/dist/lib/node-esm/capability-CB3MNEI3.mjs.map +7 -0
- package/dist/lib/node-esm/capability-CMROGK7R.mjs +36 -0
- package/dist/lib/node-esm/capability-CMROGK7R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-STMXUEPO.mjs → chunk-37NG7SIN.mjs} +3 -4
- package/dist/lib/node-esm/chunk-37NG7SIN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7JPKC7OM.mjs +893 -0
- package/dist/lib/node-esm/chunk-7JPKC7OM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7PPVTBYR.mjs +81 -0
- package/dist/lib/node-esm/chunk-7PPVTBYR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BQ56U4QX.mjs +43 -0
- package/dist/lib/node-esm/chunk-BQ56U4QX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GT6OKM5I.mjs → chunk-CG6UBBZZ.mjs} +10 -7
- package/dist/lib/node-esm/chunk-CG6UBBZZ.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-663A54LQ.mjs → chunk-EXYTXQ47.mjs} +4 -7
- package/dist/lib/node-esm/chunk-EXYTXQ47.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-OXXXRCQX.mjs +158 -0
- package/dist/lib/node-esm/chunk-OXXXRCQX.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-XYQTBFPA.mjs → chunk-YH44RHP6.mjs} +324 -181
- package/dist/lib/node-esm/chunk-YH44RHP6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-ZZ7CKK6W.mjs} +3 -2
- 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 +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 +6 -4
- 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 +40 -131
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-3C5H46ZY.mjs +44 -0
- package/dist/lib/node-esm/invoker-capability-3C5H46ZY.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +56 -34
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{react → ui}/index.mjs +19 -21
- 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.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 +110 -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 +8 -369
- 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/activation-event.d.ts.map +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/index.d.ts +1 -0
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +9 -2
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +6 -1
- 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 +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/errors.d.ts +30 -3
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +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-operation/invoker-capability.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/testing.d.ts +26 -77
- package/dist/types/src/plugin-operation/testing.d.ts.map +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 +3 -2
- 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/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/{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 +6 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/{react → ui/hooks}/useApp.d.ts +26 -9
- 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/{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/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/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 +20 -6
- package/package.json +91 -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 +172 -0
- package/src/common/index.ts +4 -9
- package/src/common/operations.ts +6 -382
- package/src/common/translations.ts +0 -12
- package/src/context.ts +1 -1
- package/src/core/activation-event.ts +5 -2
- package/src/core/capability-manager.ts +1 -1
- package/src/core/capability.ts +11 -10
- package/src/core/index.ts +1 -0
- package/src/core/plugin-manager.test.ts +313 -44
- package/src/core/plugin-manager.ts +344 -157
- package/src/core/plugin.ts +10 -2
- package/src/core/url-loader.test.ts +79 -0
- package/src/core/url-loader.ts +148 -0
- 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/errors.ts +2 -6
- package/src/plugin-operation/history/history-tracker.test.ts +36 -42
- package/src/plugin-operation/history/undo-mapping.ts +6 -3
- package/src/plugin-operation/history/undo-registry.test.ts +3 -3
- package/src/plugin-operation/invoker-capability.ts +21 -7
- package/src/plugin-operation/meta.ts +1 -1
- package/src/plugin-operation/testing.ts +25 -45
- 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 +46 -19
- package/src/ui/components/App/App.stories.tsx +92 -0
- package/src/{react → ui/components/App}/App.tsx +9 -11
- 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} +28 -24
- package/src/{react/Surface.tsx → ui/components/Surface/SurfaceComponent.tsx} +48 -58
- package/src/{react → ui/components/Surface}/SurfaceInfo.tsx +2 -2
- 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/{common/surface.ts → ui/components/Surface/types.ts} +22 -25
- 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/{react → ui/hooks}/useApp.tsx +110 -30
- package/src/{react → ui/hooks}/useCapabilities.ts +9 -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/src/vite-plugin/composer-plugin.ts +128 -0
- package/src/vite-plugin/import-map-plugin.ts +315 -0
- package/src/vite-plugin/index.ts +6 -0
- package/src/vite-plugin/packages.ts +29 -0
- package/tsconfig.json +4 -28
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +1 -1
- 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-6Y7PZV72.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-PKQT6C53.mjs.map +0 -7
- package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYNO72GQ.mjs +0 -746
- 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 +0 -32
- 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 +0 -747
- package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7OWSHPYK.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-STMXUEPO.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 +0 -33
- 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 +0 -19
- 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/src/react/useOperationResolver.ts +0 -40
- /package/dist/lib/{node-esm/react/index.mjs.map → browser/chunk-RFSO3JRG.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/index.mjs.map → core/url-loader.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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/react/common.ts", "../../../src/react/useCapabilities.ts", "../../../src/react/PluginManagerProvider.ts", "../../../src/react/ErrorBoundary.tsx", "../../../src/react/Surface.tsx", "../../../src/react/SurfaceInfo.tsx", "../../../src/react/useApp.tsx", "../../../src/react/App.tsx", "../../../src/helpers.ts", "../../../src/react/useLoading.tsx", "../../../src/react/DefaultFallback.tsx", "../../../src/react/useOperationResolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useContext } from 'react';\n\nimport * as Common from '../common';\n\nimport { useAtomCapability, useCapability } from './useCapabilities';\n\nexport const useOperationInvoker = (): Common.Capability.OperationInvoker =>\n useCapability(Common.Capability.OperationInvoker);\n\nexport const useAppGraph = (): Common.Capability.AppGraph => useCapability(Common.Capability.AppGraph);\n\nexport const useLayout = (): Common.Capability.Layout => useAtomCapability(Common.Capability.Layout);\n\n/**\n * Hook to read and update a settings atom.\n * Returns the current value and an update function.\n */\nexport const useSettingsState = <T>(\n atom: Atom.Writable<T>,\n): { settings: T; updateSettings: (fn: (current: T) => T) => void } => {\n const registry = useContext(RegistryContext);\n const settings = useAtomValue(atom);\n\n const updateSettings = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n\n return { settings, updateSettings };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback } from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport * as Common from '../common';\nimport { type Capability } from '../core';\n\nimport { usePluginManager } from './PluginManagerProvider';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const manager = usePluginManager();\n return useAtomValue(manager.capabilities.atom(interfaceDef));\n};\n\n/**\n * Hook to request a capability from the plugin context.\n * @returns The capability.\n * @throws If no capability is found.\n */\nexport const useCapability = <T>(interfaceDef: Capability.InterfaceDef<T>) => {\n const capabilities = useCapabilities(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\n};\n\n/**\n * Hook to get the current value of an atom capability.\n * Automatically subscribes to changes.\n * @example const settings = useAtomCapability(ThreadCapabilities.Settings);\n */\nexport const useAtomCapability = <T>(atomCapability: Capability.InterfaceDef<Atom.Atom<T>>): T => {\n const atom = useCapability(atomCapability);\n return useAtomValue(atom);\n};\n\n/**\n * Hook to get value and updater for an atom capability.\n * Returns [currentValue, updateFn] similar to useState.\n * @example const [settings, updateSettings] = useAtomCapabilityState(ThreadCapabilities.Settings);\n */\nexport const useAtomCapabilityState = <T>(\n atomCapability: Capability.InterfaceDef<Atom.Writable<T>>,\n): [T, (fn: (current: T) => T) => void] => {\n const registry = useCapability(Common.Capability.AtomRegistry);\n const atom = useCapability(atomCapability);\n const value = useAtomValue(atom);\n const update = useCallback(\n (fn: (current: T) => T) => {\n registry.set(atom, fn(registry.get(atom)));\n },\n [registry, atom],\n );\n return [value, update];\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { type PluginManager } from '../core';\n\nconst PluginManagerContext = createContext<PluginManager.PluginManager | undefined>(undefined);\n\n/**\n * Get the plugin manager.\n */\nexport const usePluginManager = (): PluginManager.PluginManager =>\n useContext(PluginManagerContext) ?? raise(new Error('Missing PluginManagerContext'));\n\n/**\n * Context provider for a plugin manager.\n */\nexport const PluginManagerProvider = PluginManagerContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren, type ReactNode } from 'react';\n\ntype State = {\n error: Error | undefined;\n};\n\nexport type ErrorBoundaryProps = PropsWithChildren<{\n data?: any;\n fallback?: FC<{ data?: any; error: Error }>;\n}>;\n\n/**\n * Surface error boundary.\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * Ref: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n static getDerivedStateFromError(error: Error): { error: Error } {\n return { error };\n }\n\n override state = { error: undefined };\n\n override componentDidUpdate(prevProps: ErrorBoundaryProps): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render(): ReactNode {\n if (this.state.error) {\n const Fallback = this.props.fallback ?? DefaultFallback;\n return <Fallback data={this.props.data} error={this.state.error} />;\n }\n\n return this.props.children;\n }\n\n private resetError(): void {\n this.setState({ error: undefined });\n }\n}\n\nconst DefaultFallback: NonNullable<ErrorBoundaryProps['fallback']> = ({ data, error }) => {\n return (\n <div className='flex flex-col gap-2 overflow-hidden border border-red-500 rounded-sm'>\n <h1 className='p-2'>ERROR: {error.message}</h1>\n <pre className='p-2 overflow-y-auto text-sm text-subdued'>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n type Context,\n Fragment,\n type NamedExoticComponent,\n type RefAttributes,\n Suspense,\n createContext,\n forwardRef,\n memo,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { log } from '@dxos/log';\nimport { useDefaultValue } from '@dxos/react-hooks';\nimport { byPosition } from '@dxos/util';\n\nimport * as Common from '../common';\nimport { type CapabilityManager } from '../core';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { SurfaceInfo } from './SurfaceInfo';\nimport { useCapabilities } from './useCapabilities';\n\nconst DEFAULT_PLACEHOLDER = <Fragment />;\n\nconst DEBUG = import.meta.env.VITE_DEBUG;\n\nexport type SurfaceContext = Pick<Common.SurfaceProps, 'id' | 'role' | 'data'>;\n\n// TODO(burdon): Use @radix-ui/react-context\nconst SurfaceContext: Context<SurfaceContext | undefined> = createContext<SurfaceContext | undefined>(undefined);\n\n/**\n * Wrapper component for rendering Web Component surfaces.\n * Handles creation, prop setting, and cleanup of Web Components.\n */\nconst WebComponentWrapper = memo(\n forwardRef<HTMLElement, Common.SurfaceProps & { definition: Common.WebComponentSurfaceDefinition }>(\n ({ id, role, data, limit, definition, ...rest }, forwardedRef) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const elementRef = useRef<HTMLElement | null>(null);\n const propsRef = useRef({ id, role, data, limit, ...rest });\n\n // Update props ref on every render\n propsRef.current = { id, role, data, limit, ...rest };\n\n // Create element only once\n useEffect(() => {\n if (!containerRef.current || elementRef.current) return;\n\n // Create the Web Component\n const element = document.createElement(definition.tagName);\n elementRef.current = element;\n\n // Set initial properties on the Web Component\n Object.assign(element, propsRef.current);\n\n // Append to container\n containerRef.current.appendChild(element);\n\n // Setup ref forwarding if provided\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n\n // Cleanup on unmount to prevent memory leaks\n return () => {\n if (elementRef.current && containerRef.current?.contains(elementRef.current)) {\n containerRef.current.removeChild(elementRef.current);\n }\n if (typeof forwardedRef === 'function') {\n forwardedRef(null);\n } else if (forwardedRef) {\n forwardedRef.current = null;\n }\n elementRef.current = null;\n };\n }, [definition.tagName, forwardedRef]);\n\n // Update props on existing element without recreating it\n // This runs on every render to ensure all props (including those in `rest`) are kept up to date\n useEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n\n // Update properties on the existing Web Component\n Object.assign(element, propsRef.current);\n });\n\n return <div ref={containerRef} />;\n },\n ),\n);\n\nWebComponentWrapper.displayName = 'WebComponentWrapper';\n\n/**\n * Wrapper component that provides context for a surface.\n */\nconst SurfaceContextProvider = memo(\n forwardRef<HTMLElement, Common.SurfaceProps & { definition: Common.SurfaceDefinition }>(\n ({ id, role, data, limit, fallback = DefaultFallback, definition, ...rest }, forwardedRef) => {\n const contextValue = useMemo(() => ({ id, role, data }), [id, role, data]);\n\n // Handle Web Component surfaces\n if (definition.kind === 'web-component') {\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <SurfaceContext.Provider value={contextValue}>\n <WebComponentWrapper\n id={id}\n role={role}\n data={data}\n limit={limit}\n definition={definition}\n ref={forwardedRef}\n {...rest}\n />\n </SurfaceContext.Provider>\n </ErrorBoundary>\n );\n }\n\n // Handle React component surfaces\n const Component = definition.component;\n\n // TODO(burdon): Remove from production build?\n const debug = DEBUG || '__DX_DEBUG__' in window;\n if (debug) {\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <div role='none' className='contents' data-id={id} data-role={role}>\n <SurfaceContext.Provider value={contextValue}>\n <SurfaceInfo ref={forwardedRef}>\n <Component id={id} role={role} data={data} limit={limit} {...rest} />\n </SurfaceInfo>\n </SurfaceContext.Provider>\n </div>\n </ErrorBoundary>\n );\n }\n\n return (\n <ErrorBoundary data={data} fallback={fallback}>\n <div role='none' className='contents' data-id={id} data-role={role}>\n <SurfaceContext.Provider value={contextValue}>\n <Component id={id} role={role} data={data} limit={limit} {...rest} ref={forwardedRef} />\n </SurfaceContext.Provider>\n </div>\n </ErrorBoundary>\n );\n },\n ),\n);\n\nSurfaceContextProvider.displayName = 'SurfaceContextProvider';\n\nexport const useSurface = (): SurfaceContext => {\n const context = useContext(SurfaceContext) ?? raise(new Error('Missing SurfaceContext'));\n return context;\n};\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface: NamedExoticComponent<Common.SurfaceProps & RefAttributes<HTMLElement>> = memo(\n forwardRef(({ id: _id, role, data: dataProp, limit, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {\n const data = useDefaultValue(dataProp, () => ({}));\n\n // TODO(wittjosiah): This will make all surfaces depend on a single signal.\n // This isn't ideal because it means that any change to the data will cause all surfaces to re-render.\n // This effectively means that plugin modules which contribute surfaces need to all be activated at startup.\n // This should be fine for now because it's how it worked prior to capabilities api anyway.\n // In the future, it would be nice to be able to bucket the surface contributions by role.\n const surfaces = useSurfaces();\n\n // NOTE: Memoizing the candidates makes the surface not re-render based on reactivity within data.\n const definitions = findCandidates(surfaces, { role, data });\n const candidates = limit ? definitions.slice(0, limit) : definitions;\n if (DEBUG && candidates.length === 0) {\n log.warn('no candidates for surface', { role, data });\n return null;\n }\n\n return (\n <Suspense fallback={placeholder}>\n {candidates.map((definition) => (\n <SurfaceContextProvider\n key={definition.id}\n id={definition.id}\n role={role}\n data={data}\n limit={limit}\n definition={definition}\n ref={forwardedRef}\n {...rest}\n />\n ))}\n </Suspense>\n );\n }),\n);\n\nSurface.displayName = 'Surface';\n\nconst findCandidates = (\n surfaces: Common.SurfaceDefinition[],\n { role, data }: Pick<Common.SurfaceProps, 'role' | 'data'>,\n) => {\n return Object.values(surfaces)\n .filter((definition) =>\n Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,\n )\n .filter(({ filter }) => (filter ? filter(data ?? {}) : true))\n .toSorted(byPosition);\n};\n\n// TODO(burdon): Make user facing, with telemetry.\n// TODO(burdon): Change based on dev/prod mode; infer subject type, id.\nconst DefaultFallback = ({ data, error, dev }: { data: any; error: Error; dev?: boolean }) => {\n if (dev) {\n return (\n <div className='flex flex-col gap-4 p-4 is-full overflow-y-auto'>\n <h1 className='flex gap-2 text-sm mbs-2'>{error.message}</h1>\n <pre className='overflow-auto text-xs text-description'>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n }\n\n return (\n <div className='flex flex-col gap-4 p-4 is-full overflow-y-auto border border-roseFill'>\n <h1 className='flex gap-2 text-sm mbs-2 text-rose-500'>{error.message}</h1>\n <pre className='overflow-auto text-xs text-description'>{error.stack}</pre>\n <pre className='overflow-auto text-xs text-description'>{JSON.stringify(data, null, 2)}</pre>\n </div>\n );\n};\n\n/**\n * @internal\n */\nexport const useSurfaces = () => {\n const surfaces = useCapabilities(Common.Capability.ReactSurface);\n return useMemo(() => surfaces.flat(), [surfaces]);\n};\n\n/**\n * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.\n */\nexport const isSurfaceAvailable = (\n capabilityManager: CapabilityManager.CapabilityManager,\n { role, data }: Pick<Common.SurfaceProps, 'role' | 'data'>,\n) => {\n const surfaces = capabilityManager.getAll(Common.Capability.ReactSurface);\n const candidates = findCandidates(surfaces.flat(), { role, data });\n return candidates.length > 0;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n type ReactElement,\n type Ref,\n cloneElement,\n forwardRef,\n useCallback,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { addEventListener, combine } from '@dxos/async';\nimport { useMergeRefs } from '@dxos/react-hooks';\n\nimport { useSurface } from './Surface';\n\nexport type SurfaceInfoProps = {\n children: ReactElement<{ ref?: Ref<HTMLElement> }>;\n};\n\n/**\n * Debug wrapper for surfaces.\n */\nexport const SurfaceInfo = forwardRef<HTMLElement, SurfaceInfoProps>(({ children }, forwardedRef) => {\n const [rect, setRect] = useState<DOMRect | null>(null);\n const [expand, setExpand] = useState(false);\n const info = useSurface();\n\n const [root, setRoot] = useState<HTMLElement | null>(null);\n const measureRef = useCallback((node: HTMLElement | null) => setRoot(node), []);\n const mergedRef = useMergeRefs([measureRef, forwardedRef]);\n const childWithRef = cloneElement(children, { ref: mergedRef });\n\n useLayoutEffect(() => {\n if (!root) {\n setRect(null);\n return;\n }\n\n const measure = () => {\n setRect(root.getBoundingClientRect());\n };\n\n const observer = new ResizeObserver(measure);\n observer.observe(root);\n measure();\n\n return combine(\n addEventListener(window, 'scroll', measure, true),\n addEventListener(window, 'resize', measure),\n () => {\n observer.disconnect();\n },\n );\n }, [root]);\n\n const padding = 0;\n return (\n <>\n {childWithRef}\n {rect &&\n createPortal(\n <div\n role='none'\n className='z-[100] fixed flex flex-col-reverse scrollbar-none overflow-auto pointer-events-none'\n style={{\n top: rect.top + padding,\n left: rect.left + padding,\n width: rect.width - padding * 2,\n height: rect.height - padding * 2,\n }}\n >\n {expand ? (\n <div\n className='absolute inset-0 bg-deckSurface border border-green-500 cursor-pointer pointer-events-auto overflow-auto'\n onPointerDown={(ev) => ev.stopPropagation()}\n onClick={(ev) => {\n ev.stopPropagation();\n setExpand(false);\n }}\n >\n <pre className='p-2 text-xs text-description font-mono'>{JSON.stringify({ info }, null, 2)}</pre>\n </div>\n ) : (\n <span\n className='absolute right-1 bottom-0 flex items-center p-1 text-green-500 opacity-80 hover:opacity-100 text-xl cursor-pointer pointer-events-auto'\n title={info.id}\n onPointerDown={(ev) => ev.stopPropagation()}\n onClick={(ev) => {\n ev.stopPropagation();\n setExpand(true);\n }}\n >\n ⓘ\n </span>\n )}\n </div>,\n // TODO(burdon): Create well-known element to gather all debug portals.\n document.body,\n )}\n </>\n );\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as PubSub from 'effect/PubSub';\nimport * as Queue from 'effect/Queue';\nimport React, { type FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { useAsyncEffect, useDefaultValue } from '@dxos/react-hooks';\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport * as Common from '../common';\nimport { PluginManagerContext } from '../context';\nimport { type Plugin, PluginManager } from '../core';\n\nimport { App } from './App';\nimport { DefaultFallback } from './DefaultFallback';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { PluginManagerProvider } from './PluginManagerProvider';\n\nconst ENABLED_KEY = 'dxos.org/app-framework/enabled';\n\nexport type UseAppOptions = {\n pluginManager?: PluginManager.PluginManager;\n pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];\n plugins?: Plugin.Plugin[];\n core?: string[];\n defaults?: string[];\n placeholder?: FC<{ stage: number }>;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\n safeMode?: boolean;\n debounce?: number;\n timeout?: number;\n};\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const plugins = [LayoutPlugin(), MyPlugin()];\n * const core = [LayoutPluginId];\n * const default = [MyPluginId];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = useApp({ plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.pluginLoader A function which loads new plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.defaults Default plugins are enabled by default but can be disabled by the user.\n * @param params.placeholder Placeholder component to render during startup.\n * @param params.fallback Fallback component to render if an error occurs during startup.\n * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.\n * @param params.safeMode Whether to enable safe mode, which disables optional plugins.\n */\nexport const useApp = ({\n pluginManager,\n pluginLoader: pluginLoaderProp,\n plugins: pluginsProp,\n core: coreProp,\n defaults: defaultsProp,\n placeholder,\n fallback = DefaultFallback,\n cacheEnabled = false,\n safeMode = false,\n debounce = 0,\n timeout = 30_000,\n}: UseAppOptions) => {\n const plugins = useDefaultValue(pluginsProp, () => []);\n const core = useDefaultValue(coreProp, () => plugins.map(({ meta }) => meta.id));\n const defaults = useDefaultValue(defaultsProp, () => []);\n\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader = useMemo(\n () =>\n pluginLoaderProp ??\n ((id: string) =>\n Effect.sync(() => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n })),\n [pluginLoaderProp, plugins],\n );\n\n const readyRef = useRef(false);\n const [ready, setReady] = useState(false);\n const errorRef = useRef<unknown>(null);\n const [error, setError] = useState<unknown>(null);\n // TODO(wittjosiah): Migrate to Atom.kvs for isomorphic storage.\n const cached: string[] = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]'), []);\n const enabled = useMemo(\n () => (safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults),\n [safeMode, cacheEnabled, cached, defaults],\n );\n const manager = useMemo(\n () => pluginManager ?? PluginManager.make({ pluginLoader, plugins, core, enabled }),\n [pluginManager, pluginLoader, plugins, core, enabled],\n );\n\n useEffect(() => {\n if (!cacheEnabled) {\n return;\n }\n return manager.registry.subscribe(manager.enabled, (value) => {\n localStorage.setItem(ENABLED_KEY, JSON.stringify(value));\n });\n }, [cacheEnabled, manager]);\n\n useEffect(() => {\n setupDevtools(manager);\n }, [manager]);\n\n useAsyncEffect(async () => {\n manager.capabilities.contribute({\n interface: Common.Capability.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n manager.capabilities.contribute({\n interface: Common.Capability.AtomRegistry,\n implementation: manager.registry,\n module: 'dxos.org/app-framework/atom-registry',\n });\n\n const fiber = Effect.gen(function* () {\n const queue = yield* PubSub.subscribe(manager.activation);\n const listener = yield* Effect.forkDaemon(\n Queue.take(queue).pipe(\n Effect.tap(({ event, state, error: error$ }) =>\n Effect.sync(() => {\n if (event === Common.ActivationEvent.Startup.id && state === 'activated') {\n clearTimeout(timeoutId);\n setReady(true);\n readyRef.current = true;\n }\n if (error$ && !readyRef.current) {\n setError(error$);\n errorRef.current = error$;\n }\n }),\n ),\n Effect.forever,\n ),\n );\n\n yield* Effect.all([\n manager.activate(Common.ActivationEvent.SetupSettings),\n manager.activate(Common.ActivationEvent.SetupReactSurface),\n manager.activate(Common.ActivationEvent.Startup),\n ]);\n\n return yield* Fiber.join(listener);\n }).pipe(Effect.scoped, Effect.runFork);\n\n // Set up a timeout for startup.\n const timeoutId = setTimeout(() => {\n if (!readyRef.current && !errorRef.current) {\n log.warn('startup timeout diagnostic', {\n eventsFired: manager.getEventsFired(),\n activeModules: manager.getActive(),\n pendingReset: manager.getPendingReset(),\n });\n void runAndForwardErrors(Fiber.interrupt(fiber));\n setError(new Error(`Startup timed out after ${timeout}ms`));\n }\n }, timeout);\n\n return () => {\n clearTimeout(timeoutId);\n void runAndForwardErrors(Fiber.interrupt(fiber));\n manager.capabilities.remove(Common.Capability.PluginManager, manager);\n manager.capabilities.remove(Common.Capability.AtomRegistry, manager.registry);\n };\n }, [manager]);\n\n return useCallback(\n () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <ContextProtocolProvider value={manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={manager.registry}>\n <App placeholder={placeholder} ready={ready} error={error} debounce={debounce} />\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n </ErrorBoundary>\n ),\n [fallback, manager, placeholder, ready, error],\n );\n};\n\nconst setupDevtools = (manager: PluginManager.PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport * as Common from '../common';\nimport { topologicalSort } from '../helpers';\n\nimport { type UseAppOptions } from './useApp';\nimport { useCapabilities } from './useCapabilities';\nimport { LoadingState, useLoading } from './useLoading';\n\nexport type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {\n ready: boolean;\n error: unknown;\n};\n\nexport const App = ({ placeholder: Placeholder, ready, error, debounce }: AppProps) => {\n const reactContexts = useCapabilities(Common.Capability.ReactContext);\n const reactRoots = useCapabilities(Common.Capability.ReactRoot);\n const stage = useLoading(ready, debounce);\n\n if (error) {\n // This triggers the error boundary to provide UI feedback for the startup error.\n throw error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead.\n if (stage < LoadingState.Done) {\n if (!Placeholder) {\n return null;\n }\n\n return <Placeholder stage={stage} />;\n }\n\n const ComposedContext = composeContexts(reactContexts);\n return (\n <ComposedContext>\n {reactRoots.map(({ id, root: Component }) => (\n <Component key={id} />\n ))}\n </ComposedContext>\n );\n};\n\nconst composeContexts = (contexts: Common.Capability.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\ntype DependencyNode = {\n id: string;\n dependsOn?: string[];\n};\n\n/**\n * Topologically sorts a list of nodes based on their dependencies.\n */\n// TODO(wittjosiah): Factor out?\nexport const topologicalSort = <T extends DependencyNode>(nodes: T[]): T[] => {\n const getDependencies = (nodeId: string, seen = new Set<string>(), path = new Set<string>()): string[] => {\n if (path.has(nodeId)) {\n throw new Error(`Circular dependency detected involving ${nodeId}`);\n }\n if (seen.has(nodeId)) {\n return [];\n }\n\n const node = nodes.find((n) => n.id === nodeId);\n if (!node) {\n throw new Error(`Node ${nodeId} not found but is listed as a dependency`);\n }\n\n const newPath = new Set([...path, nodeId]);\n const newSeen = new Set([...seen, nodeId]);\n\n const dependsOn = node.dependsOn ?? [];\n return [...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)), nodeId];\n };\n\n // Get all unique dependencies.\n const allDependencies = nodes\n .map((node) => node.id)\n .flatMap((id) => getDependencies(id))\n .filter((id, index, self) => self.indexOf(id) === index);\n\n // Map back to original nodes\n return allDependencies\n .map((id) => nodes.find((node) => node.id === id))\n .filter((node): node is T => node !== undefined);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nexport enum LoadingState {\n Loading = 0,\n FadeIn = 1,\n FadeOut = 2,\n Done = 3,\n}\n\n/**\n * To avoid \"flashing\" the placeholder, we wait a period of time before starting the loading animation.\n * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.\n *\n * States:\n * 0: Loading - Wait for a period of time before starting the loading animation.\n * 1: Fade-in - Display a loading animation.\n * 2: Fade-out - Fade out the loading animation.\n * 3: Done - Remove the placeholder.\n */\nexport const useLoading = (ready: boolean, debounce = 0) => {\n const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);\n useEffect(() => {\n if (!debounce) {\n return;\n }\n\n const i = setInterval(() => {\n setStage((stage) => {\n switch (stage) {\n case LoadingState.Loading: {\n if (!ready) {\n return LoadingState.FadeIn;\n } else {\n clearInterval(i);\n return LoadingState.Done;\n }\n }\n\n case LoadingState.FadeIn: {\n if (ready) {\n return LoadingState.FadeOut;\n }\n break;\n }\n\n case LoadingState.FadeOut: {\n clearInterval(i);\n return LoadingState.Done;\n }\n }\n\n return stage;\n });\n }, debounce);\n\n return () => clearInterval(i);\n }, [debounce]);\n\n if (!debounce) {\n return ready ? LoadingState.Done : LoadingState.Loading;\n }\n\n return stage;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\n/**\n * NOTE: Default fallback should not use tailwind or theme.\n */\nexport const DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div\n style={{\n margin: '1rem',\n padding: '1rem',\n overflow: 'hidden',\n border: '4px solid teal',\n borderRadius: '1rem',\n }}\n >\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ margin: '0.5rem 0', fontSize: '1.2rem' }}>ERROR: {error.message}</h1>\n <pre style={{ overflow: 'auto', fontSize: '1rem', whiteSpace: 'pre-wrap', color: '#888888' }}>{error.stack}</pre>\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo } from 'react';\n\nimport * as Common from '../common';\nimport { usePluginManager } from '../react';\n\n/**\n * Hook to dynamically register an operation resolver (handler) within a React component.\n * The resolver is added when the component mounts and removed when it unmounts.\n *\n * @example\n * ```tsx\n * const scrollHandler = useMemo(() => OperationResolver.make({\n * operation: LayoutOperation.ScrollIntoView,\n * handler: (input) => Effect.sync(() => {\n * // Handle scroll\n * }),\n * }), [deps]);\n *\n * useOperationResolver(meta.id, scrollHandler);\n * ```\n */\nexport const useOperationResolver = (module: string, resolver: Common.Capability.OperationResolver) => {\n const manager = usePluginManager();\n // Wrap single resolver in array as the capability expects an array.\n const resolverArray = useMemo(() => [resolver], [resolver]);\n\n useEffect(() => {\n manager.capabilities.contribute({\n module,\n interface: Common.Capability.OperationResolver,\n implementation: resolverArray,\n });\n\n return () => manager.capabilities.remove(Common.Capability.OperationResolver, resolverArray);\n }, [module, resolverArray]);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,SAAoBA,iBAAiBC,gBAAAA,qBAAoB;AACzD,SAASC,eAAAA,cAAaC,cAAAA,mBAAkB;;;ACDxC,SAAoBC,oBAAoB;AACxC,SAASC,mBAAmB;AAE5B,SAASC,iBAAiB;;;ACH1B,SAASC,eAAeC,kBAAkB;AAE1C,SAASC,aAAa;AAItB,IAAMC,wBAAuBC,cAAuDC,MAAAA;AAK7E,IAAMC,mBAAmB,MAC9BC,WAAWJ,qBAAAA,KAAyBK,MAAM,IAAIC,MAAM,8BAAA,CAAA;AAK/C,IAAMC,wBAAwBP,sBAAqBQ;;;;ADHnD,IAAMC,kBAAkB,CAAIC,iBAAAA;AACjC,QAAMC,UAAUC,iBAAAA;AAChB,SAAOC,aAAaF,QAAQG,aAAaC,KAAKL,YAAAA,CAAAA;AAChD;AAOO,IAAMM,gBAAgB,CAAIN,iBAAAA;AAC/B,QAAMI,eAAeL,gBAAgBC,YAAAA;AACrCO,YAAUH,aAAaI,SAAS,GAAG,2BAA2BR,aAAaS,UAAU,IAAE;;;;;;;;;AACvF,SAAOL,aAAa,CAAA;AACtB;AAOO,IAAMM,oBAAoB,CAAIC,mBAAAA;AACnC,QAAMN,OAAOC,cAAcK,cAAAA;AAC3B,SAAOR,aAAaE,IAAAA;AACtB;AAOO,IAAMO,yBAAyB,CACpCD,mBAAAA;AAEA,QAAME,WAAWP,cAAqBQ,WAAWC,YAAY;AAC7D,QAAMV,OAAOC,cAAcK,cAAAA;AAC3B,QAAMK,QAAQb,aAAaE,IAAAA;AAC3B,QAAMY,SAASC,YACb,CAACC,OAAAA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AAcjB,QAAQI,QAAQ;IAC9E;EACF,GAAG;IAACJ;GAAQ;AAEZ,SAAOwD,aACL,MACE,gBAAAC,OAAA,cAACC,eAAAA;IAAcxF;KACb,gBAAAuF,OAAA,cAACE,uBAAAA;IAAsBrD,OAAON;KAC5B,gBAAAyD,OAAA,cAACG,yBAAAA;IAAwBtD,OAAON;IAAS6D,SAASC;KAChD,gBAAAL,OAAA,cAACM,iBAAgBC,UAAQ;IAAC1D,OAAON,QAAQI;KACvC,gBAAAqD,OAAA,cAACQ,KAAAA;IAAIhG;IAA0BkB;IAAcI;IAAcjB;UAMrE;IAACJ;IAAU8B;IAAS/B;IAAakB;IAAOI;GAAM;AAElD;AAEA,IAAMkB,gBAAgB,CAACT,YAAAA;AACpBkE,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAASnE,UAAUA;AACzC;;;AK5MA,SAASoE,aAAAA,YAAWC,WAAAA,gBAAe;AAqB5B,IAAMC,uBAAuB,CAACC,QAAgBC,aAAAA;AACnD,QAAMC,UAAUC,iBAAAA;AAEhB,QAAMC,gBAAgBC,SAAQ,MAAM;IAACJ;KAAW;IAACA;GAAS;AAE1DK,EAAAA,WAAU,MAAA;AACRJ,YAAQK,aAAaC,WAAW;MAC9BR;MACAS,WAAkBC,WAAWC;MAC7BC,gBAAgBR;IAClB,CAAA;AAEA,WAAO,MAAMF,QAAQK,aAAaM,OAAcH,WAAWC,mBAAmBP,aAAAA;EAChF,GAAG;IAACJ;IAAQI;GAAc;AAC5B;",
|
|
6
|
-
"names": ["RegistryContext", "useAtomValue", "useCallback", "useContext", "useAtomValue", "useCallback", "invariant", "createContext", "useContext", "raise", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "useCapabilities", "interfaceDef", "manager", "usePluginManager", "useAtomValue", "capabilities", "atom", "useCapability", "invariant", "length", "identifier", "useAtomCapability", "atomCapability", "useAtomCapabilityState", "registry", "Capability", "AtomRegistry", "value", "update", "useCallback", "fn", "set", "get", "useOperationInvoker", "useCapability", "Capability", "OperationInvoker", "useAppGraph", "AppGraph", "useLayout", "useAtomCapability", "Layout", "useSettingsState", "atom", "registry", "useContext", "RegistryContext", "settings", "useAtomValue", "updateSettings", "useCallback", "fn", "set", "get", "React", "Component", "ErrorBoundary", "Component", "getDerivedStateFromError", "error", "state", "undefined", "componentDidUpdate", "prevProps", "data", "props", "resetError", "render", "Fallback", "fallback", "DefaultFallback", "children", "setState", "div", "className", "h1", "message", "pre", "JSON", "stringify", "React", "Fragment", "Suspense", "createContext", "forwardRef", "memo", "useContext", "useEffect", "useMemo", "useRef", "raise", "log", "useDefaultValue", "byPosition", "React", "cloneElement", "forwardRef", "useCallback", "useLayoutEffect", "useState", "createPortal", "addEventListener", "combine", "useMergeRefs", "SurfaceInfo", "forwardRef", "children", "forwardedRef", "rect", "setRect", "useState", "expand", "setExpand", "info", "useSurface", "root", "setRoot", "measureRef", "useCallback", "node", "mergedRef", "useMergeRefs", "childWithRef", "cloneElement", "ref", "useLayoutEffect", "measure", "getBoundingClientRect", "observer", "ResizeObserver", "observe", "combine", "addEventListener", "window", "disconnect", "padding", "React", "createPortal", "div", "role", "className", "style", "top", "left", "width", "height", "onPointerDown", "ev", "stopPropagation", "onClick", "pre", "JSON", "stringify", "span", "title", "id", "document", "body", "DEFAULT_PLACEHOLDER", "React", "Fragment", "DEBUG", "env", "VITE_DEBUG", "SurfaceContext", "createContext", "undefined", "WebComponentWrapper", "memo", "forwardRef", "id", "role", "data", "limit", "definition", "rest", "forwardedRef", "containerRef", "useRef", "elementRef", "propsRef", "current", "useEffect", "element", "document", "createElement", "tagName", "Object", "assign", "appendChild", "contains", "removeChild", "div", "ref", "displayName", "SurfaceContextProvider", "fallback", "DefaultFallback", "contextValue", "useMemo", "kind", "ErrorBoundary", "Provider", "value", "Component", "component", "debug", "window", "className", "data-id", "data-role", "SurfaceInfo", "useSurface", "context", "useContext", "raise", "Error", "Surface", "_id", "dataProp", "placeholder", "useDefaultValue", "surfaces", "useSurfaces", "definitions", "findCandidates", "candidates", "slice", "length", "log", "warn", "Suspense", "map", "key", "values", "filter", "Array", "isArray", "includes", "toSorted", "byPosition", "error", "dev", "h1", "message", "pre", "JSON", "stringify", "stack", "useCapabilities", "Capability", "ReactSurface", "flat", "isSurfaceAvailable", "capabilityManager", "getAll", "RegistryContext", "Effect", "Fiber", "PubSub", "Queue", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "runAndForwardErrors", "invariant", "log", "useAsyncEffect", "useDefaultValue", "ContextProtocolProvider", "React", "topologicalSort", "nodes", "getDependencies", "nodeId", "seen", "Set", "path", "has", "Error", "node", "find", "n", "id", "newPath", "newSeen", "dependsOn", "flatMap", "depId", "allDependencies", "map", "filter", "index", "self", "indexOf", "undefined", "useEffect", "useState", "LoadingState", "useLoading", "ready", "debounce", "stage", "setStage", "useState", "useEffect", "i", "setInterval", "clearInterval", "App", "placeholder", "Placeholder", "ready", "error", "debounce", "reactContexts", "useCapabilities", "Capability", "ReactContext", "reactRoots", "ReactRoot", "stage", "useLoading", "LoadingState", "Done", "React", "ComposedContext", "composeContexts", "map", "id", "root", "Component", "key", "contexts", "length", "children", "topologicalSort", "context", "reduce", "Acc", "Next", "React", "DefaultFallback", "error", "React", "div", "style", "margin", "padding", "overflow", "border", "borderRadius", "h1", "fontSize", "message", "pre", "whiteSpace", "color", "stack", "ENABLED_KEY", "useApp", "pluginManager", "pluginLoader", "pluginLoaderProp", "plugins", "pluginsProp", "core", "coreProp", "defaults", "defaultsProp", "placeholder", "fallback", "DefaultFallback", "cacheEnabled", "safeMode", "debounce", "timeout", "useDefaultValue", "map", "meta", "id", "useMemo", "sync", "plugin", "find", "invariant", "readyRef", "useRef", "ready", "setReady", "useState", "errorRef", "error", "setError", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "length", "manager", "PluginManager", "make", "useEffect", "registry", "subscribe", "value", "setItem", "stringify", "setupDevtools", "useAsyncEffect", "capabilities", "contribute", "interface", "Capability", "implementation", "module", "AtomRegistry", "fiber", "gen", "queue", "activation", "listener", "forkDaemon", "take", "pipe", "tap", "event", "state", "error$", "ActivationEvent", "Startup", "clearTimeout", "timeoutId", "current", "forever", "all", "activate", "SetupSettings", "SetupReactSurface", "join", "scoped", "runFork", "setTimeout", "log", "warn", "eventsFired", "getEventsFired", "activeModules", "getActive", "pendingReset", "getPendingReset", "runAndForwardErrors", "interrupt", "Error", "remove", "useCallback", "React", "ErrorBoundary", "PluginManagerProvider", "ContextProtocolProvider", "context", "PluginManagerContext", "RegistryContext", "Provider", "App", "globalThis", "composer", "useEffect", "useMemo", "useOperationResolver", "module", "resolver", "manager", "usePluginManager", "resolverArray", "useMemo", "useEffect", "capabilities", "contribute", "interface", "Capability", "OperationResolver", "implementation", "remove"]
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActivationEvent,
|
|
3
|
-
Capability,
|
|
4
|
-
CollaborationOperation,
|
|
5
|
-
FileInfoSchema,
|
|
6
|
-
Label,
|
|
7
|
-
LayoutOperation,
|
|
8
|
-
Plugin,
|
|
9
|
-
Resource,
|
|
10
|
-
ResourceKey,
|
|
11
|
-
ResourceLanguage,
|
|
12
|
-
UndoOperation,
|
|
13
|
-
createSurface,
|
|
14
|
-
createWebSurface,
|
|
15
|
-
defaultFileTypes
|
|
16
|
-
} from "../chunk-BLQJSGL3.mjs";
|
|
17
|
-
import "../chunk-FMZN33N4.mjs";
|
|
18
|
-
import "../chunk-PKQT6C53.mjs";
|
|
19
|
-
import "../chunk-TCLLRCS3.mjs";
|
|
20
|
-
import "../chunk-6Y7PZV72.mjs";
|
|
21
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
22
|
-
export {
|
|
23
|
-
ActivationEvent,
|
|
24
|
-
Capability,
|
|
25
|
-
CollaborationOperation,
|
|
26
|
-
FileInfoSchema,
|
|
27
|
-
Label,
|
|
28
|
-
LayoutOperation,
|
|
29
|
-
Plugin,
|
|
30
|
-
Resource,
|
|
31
|
-
ResourceKey,
|
|
32
|
-
ResourceLanguage,
|
|
33
|
-
UndoOperation,
|
|
34
|
-
createSurface,
|
|
35
|
-
createWebSurface,
|
|
36
|
-
defaultFileTypes
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActivationEvent,
|
|
3
|
-
Capability
|
|
4
|
-
} from "./chunk-BLQJSGL3.mjs";
|
|
5
|
-
import "./chunk-FMZN33N4.mjs";
|
|
6
|
-
import "./chunk-PKQT6C53.mjs";
|
|
7
|
-
import {
|
|
8
|
-
plugin_exports
|
|
9
|
-
} from "./chunk-TCLLRCS3.mjs";
|
|
10
|
-
import {
|
|
11
|
-
capability_exports
|
|
12
|
-
} from "./chunk-6Y7PZV72.mjs";
|
|
13
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
14
|
-
|
|
15
|
-
// src/plugin-operation/invoker-capability.ts
|
|
16
|
-
import * as Effect from "effect/Effect";
|
|
17
|
-
import { OperationInvoker } from "@dxos/operation";
|
|
18
|
-
var invoker_capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
|
|
19
|
-
const capabilityManager = yield* capability_exports.Service;
|
|
20
|
-
const pluginManager = yield* plugin_exports.Service;
|
|
21
|
-
const managedRuntimes = yield* capability_exports.getAll(Capability.ManagedRuntime);
|
|
22
|
-
const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : void 0;
|
|
23
|
-
const invoker = OperationInvoker.make(() => Effect.gen(function* () {
|
|
24
|
-
yield* plugin_exports.activate(ActivationEvent.SetupOperationResolver);
|
|
25
|
-
return (yield* capability_exports.getAll(Capability.OperationResolver)).flat();
|
|
26
|
-
}).pipe(Effect.provideService(capability_exports.Service, capabilityManager), Effect.provideService(plugin_exports.Service, pluginManager)), managedRuntime);
|
|
27
|
-
return capability_exports.contributes(Capability.OperationInvoker, invoker);
|
|
28
|
-
}));
|
|
29
|
-
export {
|
|
30
|
-
invoker_capability_default as default
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=invoker-capability-SZRSTHEH.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/invoker-capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationInvoker } from '@dxos/operation';\n\nimport * as Common from '../common';\nimport { Capability, Plugin } from '../core';\n\n//\n// Capability Module\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the services for synchronous access in callbacks.\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n // Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).\n const managedRuntimes = yield* Capability.getAll(Common.Capability.ManagedRuntime);\n const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : undefined;\n\n const invoker = OperationInvoker.make(\n () =>\n Effect.gen(function* () {\n yield* Plugin.activate(Common.ActivationEvent.SetupOperationResolver);\n return (yield* Capability.getAll(Common.Capability.OperationResolver)).flat();\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n ),\n managedRuntime,\n );\n\n return Capability.contributes(Common.Capability.OperationInvoker, invoker);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AASjC,IAAA,6BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAC5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,QAAMG,kBAAkB,OAAOP,mBAAWQ,OAAcR,WAAWS,cAAc;AACjF,QAAMC,iBAAiBH,gBAAgBI,SAAS,IAAIJ,gBAAgB,CAAA,IAAKK;AAEzE,QAAMC,UAAUC,iBAAiBC,KAC/B,MACSC,WAAI,aAAA;AACT,WAAOV,eAAOW,SAAgBC,gBAAgBC,sBAAsB;AACpE,YAAQ,OAAOnB,mBAAWQ,OAAcR,WAAWoB,iBAAiB,GAAGC,KAAI;EAC7E,CAAA,EAAGC,KACMC,sBAAevB,mBAAWI,SAASD,iBAAAA,GACnCoB,sBAAejB,eAAOF,SAASC,aAAAA,CAAAA,GAE1CK,cAAAA;AAGF,SAAOV,mBAAWwB,YAAmBxB,WAAWc,kBAAkBD,OAAAA;AACpE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "OperationInvoker", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "managedRuntimes", "getAll", "ManagedRuntime", "managedRuntime", "length", "undefined", "invoker", "OperationInvoker", "make", "gen", "activate", "ActivationEvent", "SetupOperationResolver", "OperationResolver", "flat", "pipe", "provideService", "contributes"]
|
|
7
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SETTINGS_ID,
|
|
3
|
-
SETTINGS_KEY,
|
|
4
|
-
SettingsOperation
|
|
5
|
-
} from "./chunk-H4WPA7U7.mjs";
|
|
6
|
-
import {
|
|
7
|
-
Capability,
|
|
8
|
-
LayoutOperation
|
|
9
|
-
} from "./chunk-BLQJSGL3.mjs";
|
|
10
|
-
import "./chunk-FMZN33N4.mjs";
|
|
11
|
-
import "./chunk-PKQT6C53.mjs";
|
|
12
|
-
import "./chunk-TCLLRCS3.mjs";
|
|
13
|
-
import {
|
|
14
|
-
capability_exports
|
|
15
|
-
} from "./chunk-6Y7PZV72.mjs";
|
|
16
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
17
|
-
|
|
18
|
-
// src/plugin-settings/operation-resolver.ts
|
|
19
|
-
import * as Effect from "effect/Effect";
|
|
20
|
-
import { OperationResolver } from "@dxos/operation";
|
|
21
|
-
var operation_resolver_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
|
|
22
|
-
return capability_exports.contributes(Capability.OperationResolver, [
|
|
23
|
-
//
|
|
24
|
-
// Open Settings
|
|
25
|
-
//
|
|
26
|
-
OperationResolver.make({
|
|
27
|
-
operation: SettingsOperation.Open,
|
|
28
|
-
handler: (input) => Effect.gen(function* () {
|
|
29
|
-
const { invoke } = yield* capability_exports.get(Capability.OperationInvoker);
|
|
30
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
31
|
-
subject: SETTINGS_ID
|
|
32
|
-
});
|
|
33
|
-
if (input.plugin) {
|
|
34
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
35
|
-
subject: [
|
|
36
|
-
`${SETTINGS_KEY}:${input.plugin.replaceAll("/", ":")}`
|
|
37
|
-
]
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
}),
|
|
42
|
-
//
|
|
43
|
-
// Open Plugin Registry
|
|
44
|
-
//
|
|
45
|
-
OperationResolver.make({
|
|
46
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
47
|
-
handler: () => Effect.gen(function* () {
|
|
48
|
-
const { invoke } = yield* capability_exports.get(Capability.OperationInvoker);
|
|
49
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
50
|
-
subject: SETTINGS_ID
|
|
51
|
-
});
|
|
52
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
53
|
-
subject: [
|
|
54
|
-
`${SETTINGS_KEY}:plugins`
|
|
55
|
-
]
|
|
56
|
-
}));
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
]);
|
|
60
|
-
}));
|
|
61
|
-
export {
|
|
62
|
-
operation_resolver_default as default
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=operation-resolver-6MP2MYOY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-settings/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationResolver } from '@dxos/operation';\n\nimport * as Common from '../common';\nimport { Capability } from '../core';\n\nimport { SETTINGS_ID, SETTINGS_KEY, SettingsOperation } from './actions';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Common.Capability.OperationResolver, [\n //\n // Open Settings\n //\n OperationResolver.make({\n operation: SettingsOperation.Open,\n handler: (input) =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Common.Capability.OperationInvoker);\n yield* invoke(Common.LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n if (input.plugin) {\n // Fire and forget the open operation.\n yield* Effect.fork(\n invoke(Common.LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],\n }),\n );\n }\n }),\n }),\n\n //\n // Open Plugin Registry\n //\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: () =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Common.Capability.OperationInvoker);\n yield* invoke(Common.LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n yield* Effect.fork(\n invoke(Common.LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:plugins`],\n }),\n );\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,yBAAyB;AAOlC,IAAA,6BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,mBAAWG,YAAmBH,WAAWI,mBAAmB;;;;IAIjEA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAS,CAACC,UACDC,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOZ,mBAAWa,IAAWb,WAAWc,gBAAgB;AAC3E,eAAOF,OAAcG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AAC7E,YAAIR,MAAMS,QAAQ;AAEhB,iBAAcC,YACZR,OAAcG,gBAAgBP,MAAM;YAClCS,SAAS;cAAC,GAAGI,YAAAA,IAAgBX,MAAMS,OAAOG,WAAW,KAAK,GAAA,CAAA;;UAC5D,CAAA,CAAA;QAEJ;MACF,CAAA;IACJ,CAAA;;;;IAKAlB,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBgB;MAC7Bd,SAAS,MACAE,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOZ,mBAAWa,IAAWb,WAAWc,gBAAgB;AAC3E,eAAOF,OAAcG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AAC7E,eAAcE,YACZR,OAAcG,gBAAgBP,MAAM;UAClCS,SAAS;YAAC,GAAGI,YAAAA;;QACf,CAAA,CAAA;MAEJ,CAAA;IACJ,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "OperationResolver", "make", "operation", "SettingsOperation", "Open", "handler", "input", "gen", "invoke", "get", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "SETTINGS_ID", "plugin", "fork", "SETTINGS_KEY", "replaceAll", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SETTINGS_ID,
|
|
4
|
-
SETTINGS_KEY,
|
|
5
|
-
SettingsOperation,
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-XR6NMKEP.mjs";
|
|
8
|
-
import {
|
|
9
|
-
Capability
|
|
10
|
-
} from "./chunk-GQEBIGKD.mjs";
|
|
11
|
-
import "./chunk-XYQTBFPA.mjs";
|
|
12
|
-
import "./chunk-7OWSHPYK.mjs";
|
|
13
|
-
import "./chunk-GT6OKM5I.mjs";
|
|
14
|
-
import {
|
|
15
|
-
capability_exports
|
|
16
|
-
} from "./chunk-STMXUEPO.mjs";
|
|
17
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
18
|
-
|
|
19
|
-
// src/plugin-settings/app-graph-builder.ts
|
|
20
|
-
import * as Effect from "effect/Effect";
|
|
21
|
-
import { GraphBuilder, NodeMatcher } from "@dxos/app-graph";
|
|
22
|
-
import { Operation } from "@dxos/operation";
|
|
23
|
-
import { isNonNullable } from "@dxos/util";
|
|
24
|
-
var app_graph_builder_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
|
|
25
|
-
const capabilities = yield* capability_exports.Service;
|
|
26
|
-
const managerAtom = capabilities.atom(Capability.PluginManager);
|
|
27
|
-
const settingsAtom = capabilities.atom(Capability.Settings);
|
|
28
|
-
const extensions = yield* Effect.all([
|
|
29
|
-
GraphBuilder.createExtension({
|
|
30
|
-
id: `${meta.id}/action`,
|
|
31
|
-
match: NodeMatcher.whenRoot,
|
|
32
|
-
actions: () => Effect.succeed([
|
|
33
|
-
{
|
|
34
|
-
id: meta.id,
|
|
35
|
-
data: () => Operation.invoke(SettingsOperation.Open, {}),
|
|
36
|
-
properties: {
|
|
37
|
-
label: [
|
|
38
|
-
"open settings label",
|
|
39
|
-
{
|
|
40
|
-
ns: meta.id
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
icon: "ph--gear--regular",
|
|
44
|
-
disposition: "menu",
|
|
45
|
-
keyBinding: {
|
|
46
|
-
macos: "meta+,",
|
|
47
|
-
windows: "alt+,"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
])
|
|
52
|
-
}),
|
|
53
|
-
GraphBuilder.createExtension({
|
|
54
|
-
id: `${meta.id}/core`,
|
|
55
|
-
match: NodeMatcher.whenRoot,
|
|
56
|
-
connector: () => Effect.succeed([
|
|
57
|
-
{
|
|
58
|
-
id: SETTINGS_ID,
|
|
59
|
-
type: meta.id,
|
|
60
|
-
properties: {
|
|
61
|
-
label: [
|
|
62
|
-
"app settings label",
|
|
63
|
-
{
|
|
64
|
-
ns: meta.id
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
icon: "ph--gear--regular",
|
|
68
|
-
disposition: "pin-end",
|
|
69
|
-
position: "hoist",
|
|
70
|
-
testId: "treeView.appSettings"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
])
|
|
74
|
-
}),
|
|
75
|
-
GraphBuilder.createExtension({
|
|
76
|
-
id: `${meta.id}/core-plugins`,
|
|
77
|
-
match: NodeMatcher.whenId(SETTINGS_ID),
|
|
78
|
-
connector: (node, get) => {
|
|
79
|
-
const [manager] = get(managerAtom);
|
|
80
|
-
const allSettings = get(settingsAtom);
|
|
81
|
-
return Effect.succeed([
|
|
82
|
-
...manager.getPlugins().filter((plugin) => manager.getCore().includes(plugin.meta.id)).map((plugin) => {
|
|
83
|
-
const settings = allSettings.find((s) => s.prefix === plugin.meta.id);
|
|
84
|
-
if (!settings) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
return [
|
|
88
|
-
plugin.meta,
|
|
89
|
-
settings
|
|
90
|
-
];
|
|
91
|
-
}).filter(isNonNullable).map(([meta2, settings]) => ({
|
|
92
|
-
id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
|
|
93
|
-
type: "category",
|
|
94
|
-
data: settings,
|
|
95
|
-
properties: {
|
|
96
|
-
label: meta2.name ?? meta2.id,
|
|
97
|
-
icon: meta2.icon ?? "ph--circle--regular"
|
|
98
|
-
}
|
|
99
|
-
})),
|
|
100
|
-
{
|
|
101
|
-
id: `${SETTINGS_KEY}:custom-plugins`,
|
|
102
|
-
type: "category",
|
|
103
|
-
properties: {
|
|
104
|
-
label: [
|
|
105
|
-
"custom plugins label",
|
|
106
|
-
{
|
|
107
|
-
ns: meta.id
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
icon: "ph--squares-four--regular",
|
|
111
|
-
role: "branch",
|
|
112
|
-
disposition: "collection"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
]);
|
|
116
|
-
}
|
|
117
|
-
}),
|
|
118
|
-
GraphBuilder.createExtension({
|
|
119
|
-
id: `${meta.id}/custom-plugins`,
|
|
120
|
-
match: NodeMatcher.whenId(`${SETTINGS_KEY}:custom-plugins`),
|
|
121
|
-
connector: (node, get) => {
|
|
122
|
-
const [manager] = get(managerAtom);
|
|
123
|
-
const allSettings = get(settingsAtom);
|
|
124
|
-
return Effect.succeed(manager.getPlugins().filter((plugin) => !manager.getCore().includes(plugin.meta.id)).map((plugin) => {
|
|
125
|
-
const settings = allSettings.find((s) => s.prefix === plugin.meta.id);
|
|
126
|
-
if (!settings) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return [
|
|
130
|
-
plugin.meta,
|
|
131
|
-
settings
|
|
132
|
-
];
|
|
133
|
-
}).filter(isNonNullable).map(([meta2, settings]) => ({
|
|
134
|
-
id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
|
|
135
|
-
type: "category",
|
|
136
|
-
data: settings,
|
|
137
|
-
properties: {
|
|
138
|
-
label: meta2.name ?? meta2.id,
|
|
139
|
-
icon: meta2.icon ?? "ph--circle--regular"
|
|
140
|
-
}
|
|
141
|
-
})));
|
|
142
|
-
}
|
|
143
|
-
})
|
|
144
|
-
]);
|
|
145
|
-
return capability_exports.contributes(Capability.AppGraphBuilder, extensions);
|
|
146
|
-
}));
|
|
147
|
-
export {
|
|
148
|
-
app_graph_builder_default as default
|
|
149
|
-
};
|
|
150
|
-
//# sourceMappingURL=app-graph-builder-LROHGJEM.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 * as Effect from 'effect/Effect';\n\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { Operation } from '@dxos/operation';\nimport { isNonNullable } from '@dxos/util';\n\nimport * as Common from '../common';\nimport { Capability, type Plugin } from '../core';\n\nimport { SETTINGS_ID, SETTINGS_KEY, SettingsOperation } from './actions';\nimport { meta } from './meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n const managerAtom = capabilities.atom(Common.Capability.PluginManager);\n const settingsAtom = capabilities.atom(Common.Capability.Settings);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}/action`,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: meta.id,\n data: () => Operation.invoke(SettingsOperation.Open, {}),\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 }),\n GraphBuilder.createExtension({\n id: `${meta.id}/core`,\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\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 }),\n GraphBuilder.createExtension({\n id: `${meta.id}/core-plugins`,\n match: NodeMatcher.whenId(SETTINGS_ID),\n connector: (node, get) => {\n const [manager] = get(managerAtom);\n const allSettings = get(settingsAtom);\n return Effect.succeed([\n ...manager\n .getPlugins()\n .filter((plugin: Plugin.Plugin) => manager.getCore().includes(plugin.meta.id))\n .map((plugin: Plugin.Plugin): [Plugin.Meta, Common.Capability.Settings] | null => {\n const settings = allSettings.find((s) => s.prefix === plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]: [Plugin.Meta, Common.Capability.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 }),\n GraphBuilder.createExtension({\n id: `${meta.id}/custom-plugins`,\n match: NodeMatcher.whenId(`${SETTINGS_KEY}:custom-plugins`),\n connector: (node, get) => {\n const [manager] = get(managerAtom);\n const allSettings = get(settingsAtom);\n return Effect.succeed(\n manager\n .getPlugins()\n .filter((plugin: Plugin.Plugin) => !manager.getCore().includes(plugin.meta.id))\n .map((plugin: Plugin.Plugin): [Plugin.Meta, Common.Capability.Settings] | null => {\n const settings = allSettings.find((s) => s.prefix === plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]: [Plugin.Meta, Common.Capability.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 }),\n ]);\n\n return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAQ9B,IAAA,4BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,mBAAWI;AACvC,QAAMC,cAAcF,aAAaG,KAAYN,WAAWO,aAAa;AACrE,QAAMC,eAAeL,aAAaG,KAAYN,WAAWS,QAAQ;AAEjE,QAAMC,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;YACzBe,MAAMd,MAAKc,QAAQ;UACrB;QACF,EAAA,CAAA;MAEN;IACF,CAAA;GACD;AAED,SAAO7B,mBAAW2D,YAAmB3D,WAAW4D,iBAAiBlD,UAAAA;AACnE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "GraphBuilder", "NodeMatcher", "Operation", "isNonNullable", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "managerAtom", "atom", "PluginManager", "settingsAtom", "Settings", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "SettingsOperation", "Open", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "position", "testId", "whenId", "node", "get", "manager", "allSettings", "getPlugins", "filter", "plugin", "getCore", "includes", "map", "settings", "find", "s", "prefix", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "role", "contributes", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-runtime/capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport * as Common from '../common';\nimport { Capability, Plugin } from '../core';\n\n//\n// Capability Module\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the CapabilityManager to create a layer for it.\n const capabilityManager = yield* Capability.Service;\n\n // Get the PluginManager to create a layer for it.\n const pluginManager = yield* Plugin.Service;\n\n // Trigger setup event so plugins can contribute their layers.\n yield* Plugin.activate(Common.ActivationEvent.SetupLayer);\n\n // Gather all contributed layers.\n const layers = yield* Capability.getAll(Common.Capability.Layer);\n\n // Create layers that provide Capability.Service and Plugin.Service.\n const capabilityServiceLayer = Layer.succeed(Capability.Service, capabilityManager);\n const pluginServiceLayer = Layer.succeed(Plugin.Service, pluginManager);\n\n // Merge all layers including service layers.\n // Layer.mergeAll requires a tuple type, so we use a cast for dynamic arrays.\n const composedLayer =\n layers.length > 0\n ? (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(\n capabilityServiceLayer,\n pluginServiceLayer,\n ...layers,\n )\n : (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(\n capabilityServiceLayer,\n pluginServiceLayer,\n );\n\n // Create the managed runtime from the composed layer.\n const runtime = ManagedRuntime.make(composedLayer) as Common.Capability.ManagedRuntime;\n\n return Capability.contributes(Common.Capability.ManagedRuntime, runtime);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,oBAAoB;AAShC,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAG5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,SAAOE,eAAOC,SAAgBC,gBAAgBC,UAAU;AAGxD,QAAMC,SAAS,OAAOV,mBAAWW,OAAcX,WAAWY,KAAK;AAG/D,QAAMC,yBAA+BC,cAAQd,mBAAWI,SAASD,iBAAAA;AACjE,QAAMY,qBAA2BD,cAAQR,eAAOF,SAASC,aAAAA;AAIzD,QAAMW,gBACJN,OAAOO,SAAS,IACLC,eACLL,wBACAE,oBAAAA,GACGL,MAAAA,IAEEQ,eACLL,wBACAE,kBAAAA;AAIR,QAAMI,UAAyBC,oBAAKJ,aAAAA;AAEpC,SAAOhB,mBAAWqB,YAAmBrB,WAAWsB,gBAAgBH,OAAAA;AAClE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Layer", "ManagedRuntime", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "activate", "ActivationEvent", "SetupLayer", "layers", "getAll", "Layer", "capabilityServiceLayer", "succeed", "pluginServiceLayer", "composedLayer", "length", "mergeAll", "runtime", "make", "contributes", "ManagedRuntime"]
|
|
7
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
make,
|
|
4
|
-
make2
|
|
5
|
-
} from "./chunk-663A54LQ.mjs";
|
|
6
|
-
import {
|
|
7
|
-
Capability
|
|
8
|
-
} from "./chunk-GQEBIGKD.mjs";
|
|
9
|
-
import "./chunk-XYQTBFPA.mjs";
|
|
10
|
-
import "./chunk-7OWSHPYK.mjs";
|
|
11
|
-
import "./chunk-GT6OKM5I.mjs";
|
|
12
|
-
import {
|
|
13
|
-
capability_exports
|
|
14
|
-
} from "./chunk-STMXUEPO.mjs";
|
|
15
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
16
|
-
|
|
17
|
-
// src/plugin-operation/history/capability.ts
|
|
18
|
-
import * as Effect from "effect/Effect";
|
|
19
|
-
var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
|
|
20
|
-
const capabilities = yield* capability_exports.Service;
|
|
21
|
-
const undoRegistry = make(() => capabilities.getAll(Capability.UndoMapping).flat());
|
|
22
|
-
const invoker = yield* capability_exports.get(Capability.OperationInvoker);
|
|
23
|
-
const historyTracker = make2(invoker, undoRegistry);
|
|
24
|
-
return [
|
|
25
|
-
capability_exports.contributes(Capability.UndoRegistry, undoRegistry),
|
|
26
|
-
capability_exports.contributes(Capability.HistoryTracker, historyTracker)
|
|
27
|
-
];
|
|
28
|
-
}));
|
|
29
|
-
export {
|
|
30
|
-
capability_default as default
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=capability-RCUNM2M7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/history/capability.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { type OperationInvoker } from '@dxos/operation';\n\nimport * as Common from '../../common';\nimport { Capability } from '../../core';\n\nimport * as HistoryTracker from './history-tracker';\nimport * as UndoRegistry from './undo-registry';\n\n//\n// Capability Module - contributes both UndoRegistry and HistoryTracker.\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the context for synchronous access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // Create UndoRegistry.\n const undoRegistry = UndoRegistry.make(() => capabilities.getAll(Common.Capability.UndoMapping).flat());\n\n // Create HistoryTracker (depends on UndoRegistry and OperationInvoker).\n const invoker = yield* Capability.get(Common.Capability.OperationInvoker);\n // Cast to internal type - the factory always returns OperationInvokerInternal.\n const historyTracker = HistoryTracker.make(invoker as OperationInvoker.OperationInvokerInternal, undoRegistry);\n\n return [\n Capability.contributes(Common.Capability.UndoRegistry, undoRegistry),\n Capability.contributes(Common.Capability.HistoryTracker, historyTracker),\n ];\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAcxB,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,mBAAWI;AAGvC,QAAMC,eAA4BC,KAAK,MAAMH,aAAaI,OAAcP,WAAWQ,WAAW,EAAEC,KAAI,CAAA;AAGpG,QAAMC,UAAU,OAAOV,mBAAWW,IAAWX,WAAWY,gBAAgB;AAExE,QAAMC,iBAAgCP,MAAKI,SAAsDL,YAAAA;AAEjG,SAAO;IACLL,mBAAWc,YAAmBd,WAAWe,cAAcV,YAAAA;IACvDL,mBAAWc,YAAmBd,WAAWgB,gBAAgBH,cAAAA;;AAE7D,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "undoRegistry", "make", "getAll", "UndoMapping", "flat", "invoker", "get", "OperationInvoker", "historyTracker", "contributes", "UndoRegistry", "HistoryTracker"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin-operation/history/errors.ts", "../../../src/plugin-operation/history/undo-mapping.ts", "../../../src/plugin-operation/history/undo-registry.ts", "../../../src/plugin-operation/history/history-tracker.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationError } from '@dxos/operation';\n\nexport class EmptyHistoryError extends OperationError {\n constructor() {\n super('EMPTY_HISTORY', 'Cannot undo: history is empty.');\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Operation } from '@dxos/operation';\n\nimport type { Label } from '../../common/translations';\n\n/**\n * Extract the input type from an OperationDefinition.\n */\nexport type InputOf<T> = T extends Operation.Definition<infer I, any> ? I : never;\n\n/**\n * Extract the output type from an OperationDefinition.\n */\nexport type OutputOf<T> = T extends Operation.Definition<any, infer O> ? O : never;\n\n/**\n * Message provider for undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\nexport type MessageProvider<Op extends Operation.Definition<any, any>> =\n | Label\n | ((input: InputOf<Op>, output: OutputOf<Op>) => Label);\n\n/**\n * Undo mapping that links a forward operation to its inverse.\n * Type parameters ensure deriveContext has correctly typed arguments.\n *\n * @template Op - The forward operation definition type.\n * @template Inv - The inverse operation definition type.\n */\nexport interface UndoMapping<\n Op extends Operation.Definition<any, any> = Operation.Definition<any, any>,\n Inv extends Operation.Definition<any, any> = Operation.Definition<any, any>,\n> {\n /** The forward operation. */\n readonly operation: Op;\n\n /** The inverse operation to invoke for undo. */\n readonly inverse: Inv;\n\n /**\n * Derives the input for the inverse operation from the forward operation's input and output.\n * @param input - The input that was passed to the forward operation.\n * @param output - The output that was returned by the forward operation.\n * @returns The input to pass to the inverse operation, or undefined to indicate the operation is not undoable.\n */\n readonly deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;\n\n /**\n * Optional message to show in the undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\n readonly message?: MessageProvider<Op>;\n}\n\n/**\n * Props for creating an UndoMapping.\n */\nexport interface UndoMappingProps<\n Op extends Operation.Definition<any, any>,\n Inv extends Operation.Definition<any, any>,\n> {\n /** The forward operation. */\n operation: Op;\n\n /** The inverse operation to invoke for undo. */\n inverse: Inv;\n\n /**\n * Derives the input for the inverse operation from the forward operation's input and output.\n * Return undefined to indicate the operation is not undoable.\n */\n deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;\n\n /**\n * Optional message to show in the undo toast.\n * Can be a static Label or a function that derives the message from input/output.\n */\n message?: MessageProvider<Op>;\n}\n\n/**\n * Creates a type-safe undo mapping.\n *\n * @example\n * ```ts\n * // Static message\n * const mapping = UndoMapping.make({\n * operation: DeleteThread,\n * inverse: RestoreThread,\n * deriveContext: (input, output) => ({\n * thread: output.thread,\n * anchor: output.anchor,\n * }),\n * message: ['thread deleted label', { ns: 'plugin-thread' }],\n * });\n *\n * // Dynamic message based on input/output\n * const mapping = UndoMapping.make({\n * operation: RemoveObjects,\n * inverse: RestoreObjects,\n * deriveContext: (_input, output) => output,\n * message: (input, _output) =>\n * input.objects.length === 1\n * ? ['object deleted label', { ns: getTypename(input.objects[0]) }]\n * : ['objects deleted label', { ns: 'plugin-space' }],\n * });\n * ```\n */\nexport const make = <Op extends Operation.Definition<any, any>, Inv extends Operation.Definition<any, any>>(\n props: UndoMappingProps<Op, Inv>,\n): UndoMapping<Op, Inv> => props;\n\n/**\n * Resolves a message provider to a Label.\n */\nexport const resolveMessage = <Op extends Operation.Definition<any, any>>(\n message: MessageProvider<Op> | undefined,\n input: InputOf<Op>,\n output: OutputOf<Op>,\n): Label | undefined => {\n if (message === undefined) {\n return undefined;\n }\n if (typeof message === 'function') {\n return message(input, output);\n }\n return message;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Operation } from '@dxos/operation';\n\nimport type * as UndoMapping from './undo-mapping';\n\n//\n// Public Interface\n//\n\n/**\n * Lookup result from UndoRegistry.\n */\nexport type UndoMappingResult = {\n inverse: Operation.Definition<any, any>;\n /** Returns undefined to indicate the operation is not undoable. */\n deriveContext: (input: any, output: any) => any | undefined;\n /** Message provider - may be a static Label or a function. */\n message?: UndoMapping.MessageProvider<Operation.Definition<any, any>>;\n};\n\n/**\n * UndoRegistry interface - looks up inverse operations.\n */\nexport interface UndoRegistry {\n lookup: (operation: Operation.Definition<any, any>) => UndoMappingResult | undefined;\n}\n\n//\n// Factory\n//\n\n/**\n * Creates an UndoRegistry that looks up inverse operations.\n */\nexport const make = (getMappings: () => UndoMapping.UndoMapping[]): UndoRegistry => {\n const lookup = (operation: Operation.Definition<any, any>): UndoMappingResult | undefined => {\n const mappings = getMappings();\n const mapping = mappings.find((m) => m.operation.meta.key === operation.meta.key);\n if (!mapping) {\n return undefined;\n }\n\n return {\n inverse: mapping.inverse,\n deriveContext: mapping.deriveContext,\n message: mapping.message,\n };\n };\n\n return { lookup };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Stream from 'effect/Stream';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { log } from '@dxos/log';\nimport { type OperationInvoker } from '@dxos/operation';\n\nimport { UndoOperation } from '../../common';\n\nimport { EmptyHistoryError } from './errors';\nimport type { HistoryEntry } from './types';\nimport { resolveMessage } from './undo-mapping';\nimport type { UndoRegistry } from './undo-registry';\n\nconst HISTORY_LIMIT = 100;\n\n//\n// Public Interface\n//\n\n/**\n * HistoryTracker interface - tracks operation history and provides undo.\n */\nexport interface HistoryTracker {\n undo: () => Effect.Effect<void, Error>;\n undoPromise: () => Promise<{ error?: Error }>;\n canUndo: () => boolean;\n}\n\n//\n// Factory\n//\n\n/**\n * Creates a HistoryTracker that subscribes to invocation events and provides undo.\n */\nexport const make = (\n invoker: OperationInvoker.OperationInvokerInternal,\n undoRegistry: UndoRegistry,\n): HistoryTracker => {\n const history: HistoryEntry[] = [];\n\n // Subscribe to invocation stream.\n const handleInvocation = (event: OperationInvoker.InvocationEvent) => {\n const mapping = undoRegistry.lookup(event.operation);\n if (!mapping) {\n // Operation is not undoable, skip.\n return;\n }\n\n const inverseInput = mapping.deriveContext(event.input, event.output);\n if (inverseInput === undefined) {\n // Operation is conditionally not undoable (deriveContext returned undefined).\n log('operation not undoable', { key: event.operation.meta.key });\n return;\n }\n\n const entry: HistoryEntry = {\n operation: event.operation,\n input: event.input,\n output: event.output,\n inverse: mapping.inverse,\n inverseInput,\n timestamp: event.timestamp,\n };\n\n history.push(entry);\n log('history entry added', { key: event.operation.meta.key, historyLength: history.length });\n\n // Trim history if it exceeds limit.\n if (history.length > HISTORY_LIMIT) {\n history.splice(0, history.length - HISTORY_LIMIT);\n }\n\n // Show undo toast (resolve message if it's a function).\n const resolvedMessage = resolveMessage(mapping.message, event.input, event.output);\n Effect.runFork(\n invoker.invoke(UndoOperation.ShowUndo, {\n message: resolvedMessage,\n }),\n );\n };\n\n // Fork a fiber to consume the invocation stream.\n Effect.runFork(\n Stream.fromPubSub(invoker.invocations).pipe(\n Stream.runForEach((event) => Effect.sync(() => handleInvocation(event))),\n ),\n );\n\n const undo = (): Effect.Effect<void, Error> => {\n return Effect.gen(function* () {\n const entry = history.pop();\n if (!entry) {\n return yield* Effect.fail(new EmptyHistoryError());\n }\n\n log('undoing operation', { key: entry.operation.meta.key, inverseKey: entry.inverse.meta.key });\n\n // Use _invokeCore to skip event emission (avoid undo-of-undo loops).\n yield* invoker._invokeCore(entry.inverse, entry.inverseInput);\n\n log('undo completed', { key: entry.operation.meta.key });\n });\n };\n\n const undoPromise = async (): Promise<{ error?: Error }> => {\n return runAndForwardErrors(undo())\n .then(() => ({}))\n .catch((error) => {\n log.catch(error);\n return { error };\n });\n };\n\n const canUndo = (): boolean => {\n return history.length > 0;\n };\n\n return {\n undo,\n undoPromise,\n canUnd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,UAAAA;AACNlC,UAAIiC,MAAMC,OAAAA,QAAAA;;;;;;AACV,aAAO;QAAEA;MAAM;IACjB,CAAA;EACJ;AAEA,QAAMC,UAAU,MAAA;AACd,WAAO9C,QAAQmB,SAAS;EAC1B;AAEA,SAAO;IACLe;IACAO;IACAK;EACF;AACF;",
|
|
6
|
-
"names": ["OperationError", "EmptyHistoryError", "OperationError", "make", "props", "resolveMessage", "message", "input", "output", "undefined", "make", "make", "getMappings", "lookup", "operation", "mappings", "mapping", "find", "m", "meta", "key", "undefined", "inverse", "deriveContext", "message", "make", "Effect", "Stream", "runAndForwardErrors", "log", "HISTORY_LIMIT", "make", "invoker", "undoRegistry", "history", "handleInvocation", "event", "mapping", "lookup", "operation", "inverseInput", "deriveContext", "input", "output", "undefined", "log", "key", "meta", "entry", "inverse", "timestamp", "push", "historyLength", "length", "splice", "resolvedMessage", "resolveMessage", "message", "Effect", "runFork", "invoke", "UndoOperation", "ShowUndo", "fromPubSub", "invocations", "pipe", "runForEach", "sync", "undo", "gen", "pop", "fail", "EmptyHistoryError", "inverseKey", "_invokeCore", "undoPromise", "runAndForwardErrors", "then", "catch", "error", "canUndo"]
|
|
7
|
-
}
|