@dxos/app-framework 0.7.4 → 0.7.5-labs.071a3e2
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/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs +137 -0
- package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs.map +7 -0
- package/dist/lib/browser/chunk-G3HBVVT5.mjs +1403 -0
- package/dist/lib/browser/chunk-G3HBVVT5.mjs.map +7 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs +32 -0
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +7 -0
- package/dist/lib/browser/chunk-TGOF2WQZ.mjs +285 -0
- package/dist/lib/browser/chunk-TGOF2WQZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +135 -543
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-dispatcher-LJKNIGAM.mjs +11 -0
- package/dist/lib/browser/intent-resolver-Z724VAMC.mjs +38 -0
- package/dist/lib/browser/intent-resolver-Z724VAMC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/store-NWCY7LAP.mjs +19 -0
- package/dist/lib/browser/store-NWCY7LAP.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +74 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/worker.mjs +77 -0
- package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs +146 -0
- package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs.map +7 -0
- package/dist/lib/node/chunk-55KIQ6YK.cjs +1437 -0
- package/dist/lib/node/chunk-55KIQ6YK.cjs.map +7 -0
- package/dist/lib/node/chunk-5GABBW2Q.cjs +308 -0
- package/dist/lib/node/chunk-5GABBW2Q.cjs.map +7 -0
- package/dist/lib/node/chunk-QLVQ6PND.cjs +58 -0
- package/dist/lib/node/chunk-QLVQ6PND.cjs.map +7 -0
- package/dist/lib/node/index.cjs +136 -558
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{plugin-settings-OZ6IKAE5.cjs → intent-dispatcher-CGUK3BCJ.cjs} +10 -10
- package/dist/lib/node/intent-dispatcher-CGUK3BCJ.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-7GNKPRWT.cjs +45 -0
- package/dist/lib/node/intent-resolver-7GNKPRWT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/store-WMJSEQPC.cjs +34 -0
- package/dist/lib/node/store-WMJSEQPC.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +98 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node/worker.cjs +99 -0
- package/dist/lib/node/worker.cjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs +138 -0
- package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-47FG42II.mjs +286 -0
- package/dist/lib/node-esm/chunk-47FG42II.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +34 -0
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs +1405 -0
- package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +135 -543
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-dispatcher-RZAWA4XD.mjs +12 -0
- package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs +39 -0
- package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/store-YUWINFBN.mjs +20 -0
- package/dist/lib/node-esm/store-YUWINFBN.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +75 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/worker.mjs +78 -0
- package/dist/types/src/App.d.ts +22 -13
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +296 -0
- package/dist/types/src/common/capabilities.d.ts.map +1 -0
- package/dist/types/src/common/events.d.ts +48 -0
- package/dist/types/src/common/events.d.ts.map +1 -0
- package/dist/types/src/common/file.d.ts +14 -0
- package/dist/types/src/common/file.d.ts.map +1 -0
- package/dist/types/src/common/graph.d.ts +21 -0
- package/dist/types/src/common/graph.d.ts.map +1 -0
- package/dist/types/src/common/index.d.ts +8 -0
- package/dist/types/src/common/index.d.ts.map +1 -0
- package/dist/types/src/common/layout.d.ts +248 -0
- package/dist/types/src/common/layout.d.ts.map +1 -0
- package/dist/types/src/common/surface.d.ts +68 -0
- package/dist/types/src/common/surface.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +11 -0
- package/dist/types/src/common/translations.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.d.ts +94 -0
- package/dist/types/src/core/capabilities.d.ts.map +1 -0
- package/dist/types/src/core/capabilities.test.d.ts +2 -0
- package/dist/types/src/core/capabilities.test.d.ts.map +1 -0
- package/dist/types/src/core/events.d.ts +58 -0
- package/dist/types/src/core/events.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +5 -0
- package/dist/types/src/core/index.d.ts.map +1 -0
- package/dist/types/src/core/manager.d.ts +119 -0
- package/dist/types/src/core/manager.d.ts.map +1 -0
- package/dist/types/src/core/manager.test.d.ts +2 -0
- package/dist/types/src/core/manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +97 -0
- package/dist/types/src/core/plugin.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts +10 -0
- package/dist/types/src/helpers.d.ts.map +1 -0
- package/dist/types/src/helpers.test.d.ts +2 -0
- package/dist/types/src/helpers.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/debug/Debug.d.ts +6 -0
- package/dist/types/src/playground/debug/Debug.d.ts.map +1 -0
- package/dist/types/src/playground/debug/index.d.ts +2 -0
- package/dist/types/src/playground/debug/index.d.ts.map +1 -0
- package/dist/types/src/playground/debug/plugin.d.ts +2 -0
- package/dist/types/src/playground/debug/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Main.d.ts +6 -0
- package/dist/types/src/playground/generator/Main.d.ts.map +1 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/generator/generator.d.ts +7 -0
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -0
- package/dist/types/src/playground/generator/index.d.ts +3 -0
- package/dist/types/src/playground/generator/index.d.ts.map +1 -0
- package/dist/types/src/playground/generator/plugin.d.ts +2 -0
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/layout/Layout.d.ts +8 -0
- package/dist/types/src/playground/layout/Layout.d.ts.map +1 -0
- package/dist/types/src/playground/layout/index.d.ts +2 -0
- package/dist/types/src/playground/layout/index.d.ts.map +1 -0
- package/dist/types/src/playground/layout/plugin.d.ts +2 -0
- package/dist/types/src/playground/layout/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts +6 -0
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -0
- package/dist/types/src/playground/logger/index.d.ts +2 -0
- package/dist/types/src/playground/logger/index.d.ts.map +1 -0
- package/dist/types/src/playground/logger/plugin.d.ts +2 -0
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -0
- package/dist/types/src/playground/logger/schema.d.ts +13 -0
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -0
- package/dist/types/src/playground/playground.stories.d.ts +10 -0
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +2 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/actions.d.ts +23 -0
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/errors.d.ts +16 -0
- package/dist/types/src/plugin-intent/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/index.d.ts +5 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +113 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +2 -0
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/intent.d.ts +68 -0
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -0
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/actions.d.ts +27 -0
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +197 -0
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/index.d.ts +3 -0
- package/dist/types/src/plugin-settings/index.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +4 -0
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/store.d.ts +5 -0
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -0
- package/dist/types/src/plugin-settings/translations.d.ts +11 -0
- package/dist/types/src/plugin-settings/translations.d.ts.map +1 -0
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/src/react/IntentContext.d.ts +8 -0
- package/dist/types/src/react/IntentContext.d.ts.map +1 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/react/Surface.d.ts +12 -0
- package/dist/types/src/react/Surface.d.ts.map +1 -0
- package/dist/types/src/react/Surface.stories.d.ts +16 -0
- package/dist/types/src/react/Surface.stories.d.ts.map +1 -0
- package/dist/types/src/react/common.d.ts +12 -0
- package/dist/types/src/react/common.d.ts.map +1 -0
- package/dist/types/src/react/index.d.ts +7 -0
- package/dist/types/src/react/index.d.ts.map +1 -0
- package/dist/types/src/react/useCapabilities.d.ts +13 -0
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/react/useIntentResolver.d.ts +3 -0
- package/dist/types/src/react/useIntentResolver.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +10 -0
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts +5 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -0
- package/dist/types/src/worker.d.ts +4 -0
- package/dist/types/src/worker.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +39 -17
- package/project.json +4 -3
- package/src/App.tsx +139 -34
- package/src/common/capabilities.ts +97 -0
- package/src/common/events.ts +72 -0
- package/src/common/file.ts +22 -0
- package/src/common/graph.ts +30 -0
- package/src/{plugins/common → common}/index.ts +3 -2
- package/src/common/layout.ts +225 -0
- package/src/common/surface.ts +81 -0
- package/src/common/translations.ts +17 -0
- package/src/core/capabilities.test.ts +116 -0
- package/src/core/capabilities.ts +222 -0
- package/src/core/events.ts +58 -0
- package/src/core/index.ts +8 -0
- package/src/core/manager.test.ts +516 -0
- package/src/core/manager.ts +511 -0
- package/src/core/plugin.ts +131 -0
- package/src/helpers.test.ts +97 -0
- package/src/helpers.ts +45 -0
- package/src/index.ts +6 -3
- package/src/playground/debug/Debug.tsx +39 -0
- package/src/playground/debug/index.ts +5 -0
- package/src/playground/debug/plugin.ts +17 -0
- package/src/playground/generator/Main.tsx +71 -0
- package/src/playground/generator/Toolbar.tsx +46 -0
- package/src/playground/generator/generator.ts +48 -0
- package/src/playground/generator/index.ts +6 -0
- package/src/playground/generator/plugin.ts +23 -0
- package/src/playground/layout/Layout.tsx +33 -0
- package/src/playground/layout/index.ts +5 -0
- package/src/playground/layout/plugin.ts +17 -0
- package/src/playground/logger/Toolbar.tsx +29 -0
- package/src/playground/logger/index.ts +5 -0
- package/src/playground/logger/plugin.ts +36 -0
- package/src/playground/logger/schema.ts +12 -0
- package/src/playground/playground.stories.tsx +34 -0
- package/src/plugin-intent/IntentPlugin.tsx +20 -0
- package/src/plugin-intent/actions.ts +22 -0
- package/src/plugin-intent/errors.ts +39 -0
- package/src/plugin-intent/index.ts +8 -0
- package/src/plugin-intent/intent-dispatcher.test.ts +299 -0
- package/src/plugin-intent/intent-dispatcher.ts +304 -0
- package/src/plugin-intent/intent.ts +146 -0
- package/src/plugin-settings/SettingsPlugin.ts +35 -0
- package/src/plugin-settings/actions.ts +27 -0
- package/src/plugin-settings/app-graph-builder.ts +122 -0
- package/src/plugin-settings/index.ts +6 -0
- package/src/plugin-settings/intent-resolver.ts +28 -0
- package/src/plugin-settings/store.ts +20 -0
- package/src/plugin-settings/translations.ts +17 -0
- package/src/react/IntentContext.tsx +34 -0
- package/src/react/PluginManagerProvider.ts +22 -0
- package/src/react/Surface.stories.tsx +96 -0
- package/src/react/Surface.tsx +75 -0
- package/src/react/common.ts +12 -0
- package/src/react/index.ts +10 -0
- package/src/react/useCapabilities.ts +40 -0
- package/src/react/useIntentResolver.ts +22 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/withPluginManager.stories.tsx +47 -0
- package/src/testing/withPluginManager.tsx +75 -0
- package/src/worker.ts +11 -0
- package/tsconfig.json +54 -2
- package/dist/lib/browser/chunk-3E7RY3CE.mjs +0 -72
- package/dist/lib/browser/chunk-3E7RY3CE.mjs.map +0 -7
- package/dist/lib/browser/chunk-653Y45CL.mjs +0 -41
- package/dist/lib/browser/chunk-653Y45CL.mjs.map +0 -7
- package/dist/lib/browser/chunk-FRXJ25VI.mjs +0 -214
- package/dist/lib/browser/chunk-FRXJ25VI.mjs.map +0 -7
- package/dist/lib/browser/chunk-YXM35XRE.mjs +0 -213
- package/dist/lib/browser/chunk-YXM35XRE.mjs.map +0 -7
- package/dist/lib/browser/plugin-intent-LU4KL2RO.mjs +0 -22
- package/dist/lib/browser/plugin-settings-OM3G2QFY.mjs +0 -11
- package/dist/lib/browser/plugin-surface-LECZMKSQ.mjs +0 -24
- package/dist/lib/node/chunk-JZ2JVKRY.cjs +0 -58
- package/dist/lib/node/chunk-JZ2JVKRY.cjs.map +0 -7
- package/dist/lib/node/chunk-QBM42OQ6.cjs +0 -97
- package/dist/lib/node/chunk-QBM42OQ6.cjs.map +0 -7
- package/dist/lib/node/chunk-QSVP5HOW.cjs +0 -238
- package/dist/lib/node/chunk-QSVP5HOW.cjs.map +0 -7
- package/dist/lib/node/chunk-SOVLKUWI.cjs +0 -236
- package/dist/lib/node/chunk-SOVLKUWI.cjs.map +0 -7
- package/dist/lib/node/plugin-intent-FVFR2LKB.cjs +0 -43
- package/dist/lib/node/plugin-intent-FVFR2LKB.cjs.map +0 -7
- package/dist/lib/node/plugin-settings-OZ6IKAE5.cjs.map +0 -7
- package/dist/lib/node/plugin-surface-YWDRXQTD.cjs +0 -45
- package/dist/lib/node/plugin-surface-YWDRXQTD.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-2R4GVK7O.mjs +0 -215
- package/dist/lib/node-esm/chunk-2R4GVK7O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs +0 -74
- package/dist/lib/node-esm/chunk-EYCTSFEJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFMFQBB4.mjs +0 -214
- package/dist/lib/node-esm/chunk-YFMFQBB4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs +0 -43
- package/dist/lib/node-esm/chunk-YNU7FTGJ.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-intent-V7ER24Y6.mjs +0 -23
- package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs +0 -12
- package/dist/lib/node-esm/plugin-settings-37UVWF2V.mjs.map +0 -7
- package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs +0 -25
- package/dist/lib/node-esm/plugin-surface-TEU42XQN.mjs.map +0 -7
- package/dist/types/src/plugins/common/file.d.ts +0 -22
- package/dist/types/src/plugins/common/file.d.ts.map +0 -1
- package/dist/types/src/plugins/common/graph.d.ts +0 -51
- package/dist/types/src/plugins/common/graph.d.ts.map +0 -1
- package/dist/types/src/plugins/common/index.d.ts +0 -7
- package/dist/types/src/plugins/common/index.d.ts.map +0 -1
- package/dist/types/src/plugins/common/layout.d.ts +0 -202
- package/dist/types/src/plugins/common/layout.d.ts.map +0 -1
- package/dist/types/src/plugins/common/metadata.d.ts +0 -16
- package/dist/types/src/plugins/common/metadata.d.ts.map +0 -1
- package/dist/types/src/plugins/common/navigation.d.ts +0 -196
- package/dist/types/src/plugins/common/navigation.d.ts.map +0 -1
- package/dist/types/src/plugins/common/translations.d.ts +0 -22
- package/dist/types/src/plugins/common/translations.d.ts.map +0 -1
- package/dist/types/src/plugins/helpers.d.ts +0 -41
- package/dist/types/src/plugins/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/index.d.ts +0 -7
- package/dist/types/src/plugins/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts +0 -21
- package/dist/types/src/plugins/plugin-host/HostPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts +0 -14
- package/dist/types/src/plugins/plugin-host/PluginContainer.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts +0 -47
- package/dist/types/src/plugins/plugin-host/PluginContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/index.d.ts +0 -4
- package/dist/types/src/plugins/plugin-host/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.d.ts +0 -98
- package/dist/types/src/plugins/plugin-host/plugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts +0 -35
- package/dist/types/src/plugins/plugin-host/plugin.test.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts +0 -21
- package/dist/types/src/plugins/plugin-intent/IntentContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts +0 -8
- package/dist/types/src/plugins/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/helpers.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/index.d.ts +0 -6
- package/dist/types/src/plugins/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/intent.d.ts +0 -81
- package/dist/types/src/plugins/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-intent/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-intent/provides.d.ts +0 -20
- package/dist/types/src/plugins/plugin-intent/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/index.d.ts +0 -4
- package/dist/types/src/plugins/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-settings/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-settings/provides.d.ts +0 -13
- package/dist/types/src/plugins/plugin-settings/provides.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts +0 -62
- package/dist/types/src/plugins/plugin-surface/Surface.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts +0 -7
- package/dist/types/src/plugins/plugin-surface/SurfacePlugin.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts +0 -39
- package/dist/types/src/plugins/plugin-surface/SurfaceRootContext.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts +0 -21
- package/dist/types/src/plugins/plugin-surface/helpers.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/index.d.ts +0 -8
- package/dist/types/src/plugins/plugin-surface/index.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/meta.d.ts +0 -5
- package/dist/types/src/plugins/plugin-surface/meta.d.ts.map +0 -1
- package/dist/types/src/plugins/plugin-surface/provides.d.ts +0 -16
- package/dist/types/src/plugins/plugin-surface/provides.d.ts.map +0 -1
- package/src/plugins/common/file.ts +0 -36
- package/src/plugins/common/graph.ts +0 -70
- package/src/plugins/common/layout.ts +0 -155
- package/src/plugins/common/metadata.ts +0 -29
- package/src/plugins/common/navigation.ts +0 -185
- package/src/plugins/common/translations.ts +0 -36
- package/src/plugins/helpers.ts +0 -92
- package/src/plugins/index.ts +0 -11
- package/src/plugins/plugin-host/HostPlugin.tsx +0 -96
- package/src/plugins/plugin-host/PluginContainer.tsx +0 -120
- package/src/plugins/plugin-host/PluginContext.tsx +0 -79
- package/src/plugins/plugin-host/index.ts +0 -8
- package/src/plugins/plugin-host/plugin.test.ts +0 -158
- package/src/plugins/plugin-host/plugin.ts +0 -126
- package/src/plugins/plugin-intent/IntentContext.tsx +0 -49
- package/src/plugins/plugin-intent/IntentPlugin.tsx +0 -151
- package/src/plugins/plugin-intent/helpers.ts +0 -11
- package/src/plugins/plugin-intent/index.ts +0 -12
- package/src/plugins/plugin-intent/intent.ts +0 -101
- package/src/plugins/plugin-intent/meta.ts +0 -9
- package/src/plugins/plugin-intent/provides.ts +0 -38
- package/src/plugins/plugin-settings/SettingsPlugin.tsx +0 -22
- package/src/plugins/plugin-settings/index.ts +0 -9
- package/src/plugins/plugin-settings/meta.ts +0 -9
- package/src/plugins/plugin-settings/provides.ts +0 -29
- package/src/plugins/plugin-surface/Surface.tsx +0 -195
- package/src/plugins/plugin-surface/SurfacePlugin.tsx +0 -33
- package/src/plugins/plugin-surface/SurfaceRootContext.tsx +0 -60
- package/src/plugins/plugin-surface/helpers.ts +0 -22
- package/src/plugins/plugin-surface/index.ts +0 -14
- package/src/plugins/plugin-surface/meta.ts +0 -9
- package/src/plugins/plugin-surface/provides.ts +0 -26
- /package/dist/lib/browser/{plugin-intent-LU4KL2RO.mjs.map → intent-dispatcher-LJKNIGAM.mjs.map} +0 -0
- /package/dist/lib/browser/{plugin-settings-OM3G2QFY.mjs.map → worker.mjs.map} +0 -0
- /package/dist/lib/{browser/plugin-surface-LECZMKSQ.mjs.map → node-esm/intent-dispatcher-RZAWA4XD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{plugin-intent-V7ER24Y6.mjs.map → worker.mjs.map} +0 -0
- /package/dist/types/src/{plugins/plugin-surface → react}/ErrorBoundary.d.ts +0 -0
- /package/src/{plugins/plugin-surface → react}/ErrorBoundary.tsx +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var worker_exports = {};
|
|
20
|
+
__export(worker_exports, {
|
|
21
|
+
Capabilities: () => import_chunk_55KIQ6YK.Capabilities,
|
|
22
|
+
Events: () => import_chunk_55KIQ6YK.Events,
|
|
23
|
+
FileInfoSchema: () => import_chunk_55KIQ6YK.FileInfoSchema,
|
|
24
|
+
INTENT_ACTION: () => import_chunk_55KIQ6YK.INTENT_ACTION,
|
|
25
|
+
INTENT_PLUGIN: () => import_chunk_55KIQ6YK.INTENT_PLUGIN,
|
|
26
|
+
IntentAction: () => import_chunk_55KIQ6YK.IntentAction,
|
|
27
|
+
IntentPlugin: () => import_chunk_55KIQ6YK.IntentPlugin,
|
|
28
|
+
LAYOUT_ACTION: () => import_chunk_55KIQ6YK.LAYOUT_ACTION,
|
|
29
|
+
LAYOUT_PLUGIN: () => import_chunk_55KIQ6YK.LAYOUT_PLUGIN,
|
|
30
|
+
Label: () => import_chunk_55KIQ6YK.Label,
|
|
31
|
+
LayoutAction: () => import_chunk_55KIQ6YK.LayoutAction,
|
|
32
|
+
Plugin: () => import_chunk_55KIQ6YK.Plugin,
|
|
33
|
+
PluginManager: () => import_chunk_55KIQ6YK.PluginManager,
|
|
34
|
+
PluginModule: () => import_chunk_55KIQ6YK.PluginModule,
|
|
35
|
+
PluginsContext: () => import_chunk_55KIQ6YK.PluginsContext,
|
|
36
|
+
Resource: () => import_chunk_55KIQ6YK.Resource,
|
|
37
|
+
ResourceKey: () => import_chunk_55KIQ6YK.ResourceKey,
|
|
38
|
+
ResourceLanguage: () => import_chunk_55KIQ6YK.ResourceLanguage,
|
|
39
|
+
allOf: () => import_chunk_55KIQ6YK.allOf,
|
|
40
|
+
chain: () => import_chunk_55KIQ6YK.chain,
|
|
41
|
+
contributes: () => import_chunk_55KIQ6YK.contributes,
|
|
42
|
+
createDispatcher: () => import_chunk_55KIQ6YK.createDispatcher,
|
|
43
|
+
createIntent: () => import_chunk_55KIQ6YK.createIntent,
|
|
44
|
+
createResolver: () => import_chunk_55KIQ6YK.createResolver,
|
|
45
|
+
createSurface: () => import_chunk_55KIQ6YK.createSurface,
|
|
46
|
+
defaultFileTypes: () => import_chunk_55KIQ6YK.defaultFileTypes,
|
|
47
|
+
defineCapability: () => import_chunk_55KIQ6YK.defineCapability,
|
|
48
|
+
defineEvent: () => import_chunk_55KIQ6YK.defineEvent,
|
|
49
|
+
defineModule: () => import_chunk_55KIQ6YK.defineModule,
|
|
50
|
+
definePlugin: () => import_chunk_55KIQ6YK.definePlugin,
|
|
51
|
+
eventKey: () => import_chunk_55KIQ6YK.eventKey,
|
|
52
|
+
getEvents: () => import_chunk_55KIQ6YK.getEvents,
|
|
53
|
+
isAllOf: () => import_chunk_55KIQ6YK.isAllOf,
|
|
54
|
+
isOneOf: () => import_chunk_55KIQ6YK.isOneOf,
|
|
55
|
+
lazy: () => import_chunk_55KIQ6YK.lazy,
|
|
56
|
+
oneOf: () => import_chunk_55KIQ6YK.oneOf
|
|
57
|
+
});
|
|
58
|
+
module.exports = __toCommonJS(worker_exports);
|
|
59
|
+
var import_chunk_55KIQ6YK = require("./chunk-55KIQ6YK.cjs");
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
Capabilities,
|
|
63
|
+
Events,
|
|
64
|
+
FileInfoSchema,
|
|
65
|
+
INTENT_ACTION,
|
|
66
|
+
INTENT_PLUGIN,
|
|
67
|
+
IntentAction,
|
|
68
|
+
IntentPlugin,
|
|
69
|
+
LAYOUT_ACTION,
|
|
70
|
+
LAYOUT_PLUGIN,
|
|
71
|
+
Label,
|
|
72
|
+
LayoutAction,
|
|
73
|
+
Plugin,
|
|
74
|
+
PluginManager,
|
|
75
|
+
PluginModule,
|
|
76
|
+
PluginsContext,
|
|
77
|
+
Resource,
|
|
78
|
+
ResourceKey,
|
|
79
|
+
ResourceLanguage,
|
|
80
|
+
allOf,
|
|
81
|
+
chain,
|
|
82
|
+
contributes,
|
|
83
|
+
createDispatcher,
|
|
84
|
+
createIntent,
|
|
85
|
+
createResolver,
|
|
86
|
+
createSurface,
|
|
87
|
+
defaultFileTypes,
|
|
88
|
+
defineCapability,
|
|
89
|
+
defineEvent,
|
|
90
|
+
defineModule,
|
|
91
|
+
definePlugin,
|
|
92
|
+
eventKey,
|
|
93
|
+
getEvents,
|
|
94
|
+
isAllOf,
|
|
95
|
+
isOneOf,
|
|
96
|
+
lazy,
|
|
97
|
+
oneOf
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=worker.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["worker.cjs"],
|
|
4
|
+
"sourcesContent": ["import {\n Capabilities,\n Events,\n FileInfoSchema,\n INTENT_ACTION,\n INTENT_PLUGIN,\n IntentAction,\n IntentPlugin,\n LAYOUT_ACTION,\n LAYOUT_PLUGIN,\n Label,\n LayoutAction,\n Plugin,\n PluginManager,\n PluginModule,\n PluginsContext,\n Resource,\n ResourceKey,\n ResourceLanguage,\n allOf,\n chain,\n contributes,\n createDispatcher,\n createIntent,\n createResolver,\n createSurface,\n defaultFileTypes,\n defineCapability,\n defineEvent,\n defineModule,\n definePlugin,\n eventKey,\n getEvents,\n isAllOf,\n isOneOf,\n lazy,\n oneOf\n} from \"./chunk-55KIQ6YK.cjs\";\nexport {\n Capabilities,\n Events,\n FileInfoSchema,\n INTENT_ACTION,\n INTENT_PLUGIN,\n IntentAction,\n IntentPlugin,\n LAYOUT_ACTION,\n LAYOUT_PLUGIN,\n Label,\n LayoutAction,\n Plugin,\n PluginManager,\n PluginModule,\n PluginsContext,\n Resource,\n ResourceKey,\n ResourceLanguage,\n allOf,\n chain,\n contributes,\n createDispatcher,\n createIntent,\n createResolver,\n createSurface,\n defaultFileTypes,\n defineCapability,\n defineEvent,\n defineModule,\n definePlugin,\n eventKey,\n getEvents,\n isAllOf,\n isOneOf,\n lazy,\n oneOf\n};\n//# sourceMappingURL=worker.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAqCO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SETTINGS_ID,
|
|
4
|
+
SETTINGS_KEY,
|
|
5
|
+
SETTINGS_PLUGIN,
|
|
6
|
+
SettingsAction
|
|
7
|
+
} from "./chunk-CNJYZNSL.mjs";
|
|
8
|
+
import {
|
|
9
|
+
Capabilities,
|
|
10
|
+
contributes,
|
|
11
|
+
createIntent
|
|
12
|
+
} from "./chunk-ZTB4TA6Q.mjs";
|
|
13
|
+
|
|
14
|
+
// packages/sdk/app-framework/src/plugin-settings/app-graph-builder.ts
|
|
15
|
+
import { createExtension } from "@dxos/app-graph";
|
|
16
|
+
import { nonNullable } from "@dxos/util";
|
|
17
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
18
|
+
createExtension({
|
|
19
|
+
id: `${SETTINGS_PLUGIN}/action`,
|
|
20
|
+
filter: (node) => node.id === "root",
|
|
21
|
+
actions: () => [
|
|
22
|
+
{
|
|
23
|
+
id: SETTINGS_PLUGIN,
|
|
24
|
+
data: async () => {
|
|
25
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
26
|
+
await dispatch(createIntent(SettingsAction.Open));
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
label: [
|
|
30
|
+
"open settings label",
|
|
31
|
+
{
|
|
32
|
+
ns: SETTINGS_PLUGIN
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
icon: "ph--gear--regular",
|
|
36
|
+
keyBinding: {
|
|
37
|
+
macos: "meta+,",
|
|
38
|
+
windows: "alt+,"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
createExtension({
|
|
45
|
+
id: `${SETTINGS_PLUGIN}/core`,
|
|
46
|
+
filter: (node) => node.id === "root",
|
|
47
|
+
connector: () => [
|
|
48
|
+
{
|
|
49
|
+
id: SETTINGS_ID,
|
|
50
|
+
type: SETTINGS_PLUGIN,
|
|
51
|
+
properties: {
|
|
52
|
+
label: [
|
|
53
|
+
"app settings label",
|
|
54
|
+
{
|
|
55
|
+
ns: SETTINGS_PLUGIN
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
icon: "ph--gear--regular",
|
|
59
|
+
disposition: "pin-end",
|
|
60
|
+
position: "fallback",
|
|
61
|
+
testId: "treeView.appSettings"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
66
|
+
createExtension({
|
|
67
|
+
id: `${SETTINGS_PLUGIN}/core-plugins`,
|
|
68
|
+
filter: (node) => node.id === SETTINGS_ID,
|
|
69
|
+
connector: () => {
|
|
70
|
+
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
71
|
+
const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);
|
|
72
|
+
return [
|
|
73
|
+
...manager.plugins.filter((plugin) => manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
74
|
+
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
75
|
+
if (!settings) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return [
|
|
79
|
+
plugin.meta,
|
|
80
|
+
settings
|
|
81
|
+
];
|
|
82
|
+
}).filter(nonNullable).map(([meta, settings]) => ({
|
|
83
|
+
id: `${SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
|
|
84
|
+
type: "category",
|
|
85
|
+
data: settings,
|
|
86
|
+
properties: {
|
|
87
|
+
label: meta.name ?? meta.id,
|
|
88
|
+
icon: meta.icon ?? "ph--circle--regular"
|
|
89
|
+
}
|
|
90
|
+
})),
|
|
91
|
+
{
|
|
92
|
+
id: `${SETTINGS_KEY}:custom-plugins`,
|
|
93
|
+
type: "collection",
|
|
94
|
+
properties: {
|
|
95
|
+
label: [
|
|
96
|
+
"custom plugins label",
|
|
97
|
+
{
|
|
98
|
+
ns: SETTINGS_PLUGIN
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
icon: "ph--squares-four--regular",
|
|
102
|
+
role: "branch"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
createExtension({
|
|
109
|
+
id: `${SETTINGS_PLUGIN}/custom-plugins`,
|
|
110
|
+
filter: (node) => node.id === `${SETTINGS_KEY}:custom-plugins`,
|
|
111
|
+
connector: () => {
|
|
112
|
+
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
113
|
+
const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);
|
|
114
|
+
return manager.plugins.filter((plugin) => !manager.core.includes(plugin.meta.id)).map((plugin) => {
|
|
115
|
+
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
116
|
+
if (!settings) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return [
|
|
120
|
+
plugin.meta,
|
|
121
|
+
settings
|
|
122
|
+
];
|
|
123
|
+
}).filter(nonNullable).map(([meta, settings]) => ({
|
|
124
|
+
id: `${SETTINGS_KEY}:${meta.id.replaceAll("/", ":")}`,
|
|
125
|
+
type: "category",
|
|
126
|
+
data: settings,
|
|
127
|
+
properties: {
|
|
128
|
+
label: meta.name ?? meta.id,
|
|
129
|
+
icon: meta.icon ?? "ph--circle--regular"
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
]);
|
|
135
|
+
export {
|
|
136
|
+
app_graph_builder_default as default
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=app-graph-builder-MKLYH3NE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin-settings/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createExtension, type Node } from '@dxos/app-graph';\nimport { type SettingsStore, type SettingsValue } from '@dxos/local-storage';\nimport { nonNullable } from '@dxos/util';\n\nimport { SETTINGS_ID, SETTINGS_KEY, SETTINGS_PLUGIN, SettingsAction } from './actions';\nimport { Capabilities } from '../common';\nimport { contributes, type PluginMeta, type PluginsContext } from '../core';\nimport { createIntent } from '../plugin-intent';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${SETTINGS_PLUGIN}/action`,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: SETTINGS_PLUGIN,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.Open));\n },\n properties: {\n label: ['open settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ],\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/core`,\n filter: (node): node is Node<null> => node.id === 'root',\n connector: () => [\n {\n id: SETTINGS_ID,\n type: SETTINGS_PLUGIN,\n properties: {\n label: ['app settings label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'fallback',\n testId: 'treeView.appSettings',\n },\n },\n ],\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/core-plugins`,\n filter: (node): node is Node<null> => node.id === SETTINGS_ID,\n connector: () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);\n return [\n ...manager.plugins\n .filter((plugin) => manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(nonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n\n {\n id: `${SETTINGS_KEY}:custom-plugins`,\n type: 'collection',\n properties: {\n label: ['custom plugins label', { ns: SETTINGS_PLUGIN }],\n icon: 'ph--squares-four--regular',\n role: 'branch',\n },\n },\n ];\n },\n }),\n createExtension({\n id: `${SETTINGS_PLUGIN}/custom-plugins`,\n filter: (node): node is Node<null> => node.id === `${SETTINGS_KEY}:custom-plugins`,\n connector: () => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);\n return manager.plugins\n .filter((plugin) => !manager.core.includes(plugin.meta.id))\n .map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {\n const settings = settingsStore?.getStore(plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(nonNullable)\n .map(([meta, settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n }));\n },\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,SAASA,uBAAkC;AAE3C,SAASC,mBAAmB;AAO5B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;IAClDI,SAAS,MAAM;MACb;QACEJ,IAAIC;QACJI,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,aAAaY,gBAAgB;AAC7F,gBAAMF,SAASG,aAAaC,eAAeC,IAAI,CAAA;QACjD;QACAC,YAAY;UACVC,OAAO;YAAC;YAAuB;cAAEC,IAAId;YAAgB;;UACrDe,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA;EACApB,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;IAClDoB,WAAW,MAAM;MACf;QACEpB,IAAIqB;QACJC,MAAMrB;QACNY,YAAY;UACVC,OAAO;YAAC;YAAsB;cAAEC,IAAId;YAAgB;;UACpDe,MAAM;UACNO,aAAa;UACbC,UAAU;UACVC,QAAQ;QACV;MACF;;EAEJ,CAAA;EACA1B,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOqB;IAClDD,WAAW,MAAA;AACT,YAAMM,UAAU/B,QAAQa,kBAAkBX,aAAa8B,aAAa;AACpE,YAAM,CAACC,aAAAA,IAAiBjC,QAAQkC,oBAAoBhC,aAAaiC,aAAa;AAC9E,aAAO;WACFJ,QAAQK,QACR7B,OAAO,CAAC8B,WAAWN,QAAQO,KAAKC,SAASF,OAAOG,KAAKnC,EAAE,CAAA,EACvD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KAAKnC,GAAGyC,WAAW,KAAK,GAAA,CAAA;QAC/CnB,MAAM;QACNjB,MAAMgC;QACNxB,YAAY;UACVC,OAAOqB,KAAKO,QAAQP,KAAKnC;UACzBgB,MAAMmB,KAAKnB,QAAQ;QACrB;MACF,EAAA;IACJ;EACF,CAAA;CACD;",
|
|
6
|
+
"names": ["createExtension", "nonNullable", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "SETTINGS_PLUGIN", "filter", "node", "actions", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "SettingsAction", "Open", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "disposition", "position", "testId", "manager", "PluginManager", "settingsStore", "requestCapabilities", "SettingsStore", "plugins", "plugin", "core", "includes", "meta", "map", "settings", "getStore", "nonNullable", "SETTINGS_KEY", "replaceAll", "name", "role"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Capabilities,
|
|
4
|
+
Events,
|
|
5
|
+
PluginManager
|
|
6
|
+
} from "./chunk-ZTB4TA6Q.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/sdk/app-framework/src/react/PluginManagerProvider.ts
|
|
9
|
+
import { createContext, useContext } from "react";
|
|
10
|
+
import { raise } from "@dxos/debug";
|
|
11
|
+
var PluginManagerContext = createContext(void 0);
|
|
12
|
+
var usePluginManager = () => useContext(PluginManagerContext) ?? raise(new Error("Missing PluginManagerContext"));
|
|
13
|
+
var PluginManagerProvider = PluginManagerContext.Provider;
|
|
14
|
+
|
|
15
|
+
// packages/sdk/app-framework/src/react/useCapabilities.ts
|
|
16
|
+
import { computed } from "@preact/signals-core";
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
var useCapabilities = (interfaceDef, filter) => {
|
|
19
|
+
const manager = usePluginManager();
|
|
20
|
+
const signal = useMemo(() => computed(() => manager.context.requestCapabilities(interfaceDef, filter)), [
|
|
21
|
+
interfaceDef
|
|
22
|
+
]);
|
|
23
|
+
return signal.value;
|
|
24
|
+
};
|
|
25
|
+
var useCapability = (interfaceDef, filter) => {
|
|
26
|
+
const manager = usePluginManager();
|
|
27
|
+
const signal = useMemo(() => computed(() => manager.context.requestCapability(interfaceDef, filter)), [
|
|
28
|
+
interfaceDef
|
|
29
|
+
]);
|
|
30
|
+
return signal.value;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// packages/sdk/app-framework/src/react/common.ts
|
|
34
|
+
var useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);
|
|
35
|
+
var useAppGraph = () => useCapability(Capabilities.AppGraph);
|
|
36
|
+
var useLayout = () => useCapability(Capabilities.Layout);
|
|
37
|
+
|
|
38
|
+
// packages/sdk/app-framework/src/react/ErrorBoundary.tsx
|
|
39
|
+
import React, { Component } from "react";
|
|
40
|
+
var ErrorBoundary = class extends Component {
|
|
41
|
+
constructor(props) {
|
|
42
|
+
super(props);
|
|
43
|
+
this.state = {
|
|
44
|
+
error: void 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static getDerivedStateFromError(error) {
|
|
48
|
+
return {
|
|
49
|
+
error
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
componentDidUpdate(prevProps) {
|
|
53
|
+
if (prevProps.data !== this.props.data) {
|
|
54
|
+
this.resetError();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
if (this.state.error) {
|
|
59
|
+
return /* @__PURE__ */ React.createElement(this.props.fallback, {
|
|
60
|
+
data: this.props.data,
|
|
61
|
+
error: this.state.error,
|
|
62
|
+
reset: this.resetError
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return this.props.children;
|
|
66
|
+
}
|
|
67
|
+
resetError() {
|
|
68
|
+
this.setState({
|
|
69
|
+
error: void 0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// packages/sdk/app-framework/src/react/Surface.tsx
|
|
75
|
+
import React2, { memo, forwardRef, Suspense, useMemo as useMemo2 } from "react";
|
|
76
|
+
import { useDefaultValue } from "@dxos/react-hooks";
|
|
77
|
+
import { byPosition } from "@dxos/util";
|
|
78
|
+
var useSurfaces = () => {
|
|
79
|
+
const surfaces = useCapabilities(Capabilities.ReactSurface);
|
|
80
|
+
return useMemo2(() => surfaces.flat(), [
|
|
81
|
+
surfaces
|
|
82
|
+
]);
|
|
83
|
+
};
|
|
84
|
+
var findCandidates = (surfaces, { role, data }) => {
|
|
85
|
+
return Object.values(surfaces).filter((definition) => Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role).filter(({ filter }) => filter ? filter(data ?? {}) : true).toSorted(byPosition);
|
|
86
|
+
};
|
|
87
|
+
var isSurfaceAvailable = (context, { role, data }) => {
|
|
88
|
+
const surfaces = context.requestCapabilities(Capabilities.ReactSurface);
|
|
89
|
+
const candidates = findCandidates(surfaces.flat(), {
|
|
90
|
+
role,
|
|
91
|
+
data
|
|
92
|
+
});
|
|
93
|
+
return candidates.length > 0;
|
|
94
|
+
};
|
|
95
|
+
var Surface = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ id: _id, role, data: _data, limit, fallback, placeholder, ...rest }, forwardedRef) => {
|
|
96
|
+
const surfaces = useSurfaces();
|
|
97
|
+
const data = useDefaultValue(_data, () => ({}));
|
|
98
|
+
const definitions = findCandidates(surfaces, {
|
|
99
|
+
role,
|
|
100
|
+
data
|
|
101
|
+
});
|
|
102
|
+
const candidates = limit ? definitions.slice(0, limit) : definitions;
|
|
103
|
+
const nodes = candidates.map(({ component: Component2, id }) => /* @__PURE__ */ React2.createElement(Component2, {
|
|
104
|
+
ref: forwardedRef,
|
|
105
|
+
key: id,
|
|
106
|
+
id,
|
|
107
|
+
role,
|
|
108
|
+
data,
|
|
109
|
+
limit,
|
|
110
|
+
...rest
|
|
111
|
+
}));
|
|
112
|
+
const suspense = placeholder ? /* @__PURE__ */ React2.createElement(Suspense, {
|
|
113
|
+
fallback: placeholder
|
|
114
|
+
}, nodes) : nodes;
|
|
115
|
+
return fallback ? /* @__PURE__ */ React2.createElement(ErrorBoundary, {
|
|
116
|
+
data,
|
|
117
|
+
fallback
|
|
118
|
+
}, suspense) : suspense;
|
|
119
|
+
}));
|
|
120
|
+
Surface.displayName = "Surface";
|
|
121
|
+
|
|
122
|
+
// packages/sdk/app-framework/src/react/useIntentResolver.ts
|
|
123
|
+
import { useEffect } from "react";
|
|
124
|
+
var useIntentResolver = (module, resolver) => {
|
|
125
|
+
const manager = usePluginManager();
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
manager.context.contributeCapability({
|
|
128
|
+
module,
|
|
129
|
+
interface: Capabilities.IntentResolver,
|
|
130
|
+
implementation: resolver
|
|
131
|
+
});
|
|
132
|
+
return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);
|
|
133
|
+
}, [
|
|
134
|
+
module,
|
|
135
|
+
resolver
|
|
136
|
+
]);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// packages/sdk/app-framework/src/App.tsx
|
|
140
|
+
import { effect } from "@preact/signals-core";
|
|
141
|
+
import React3 from "react";
|
|
142
|
+
import { invariant } from "@dxos/invariant";
|
|
143
|
+
import { create } from "@dxos/live-object";
|
|
144
|
+
|
|
145
|
+
// packages/sdk/app-framework/src/helpers.ts
|
|
146
|
+
var topologicalSort = (nodes) => {
|
|
147
|
+
const getDependencies = (nodeId, seen = /* @__PURE__ */ new Set(), path = /* @__PURE__ */ new Set()) => {
|
|
148
|
+
if (path.has(nodeId)) {
|
|
149
|
+
throw new Error(`Circular dependency detected involving ${nodeId}`);
|
|
150
|
+
}
|
|
151
|
+
if (seen.has(nodeId)) {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
const node = nodes.find((n) => n.id === nodeId);
|
|
155
|
+
if (!node) {
|
|
156
|
+
throw new Error(`Node ${nodeId} not found but is listed as a dependency`);
|
|
157
|
+
}
|
|
158
|
+
const newPath = /* @__PURE__ */ new Set([
|
|
159
|
+
...path,
|
|
160
|
+
nodeId
|
|
161
|
+
]);
|
|
162
|
+
const newSeen = /* @__PURE__ */ new Set([
|
|
163
|
+
...seen,
|
|
164
|
+
nodeId
|
|
165
|
+
]);
|
|
166
|
+
const dependsOn = node.dependsOn ?? [];
|
|
167
|
+
return [
|
|
168
|
+
...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)),
|
|
169
|
+
nodeId
|
|
170
|
+
];
|
|
171
|
+
};
|
|
172
|
+
const allDependencies = nodes.map((node) => node.id).flatMap((id) => getDependencies(id)).filter((id, index, self) => self.indexOf(id) === index);
|
|
173
|
+
return allDependencies.map((id) => nodes.find((node) => node.id === id)).filter((node) => node !== void 0);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// packages/sdk/app-framework/src/App.tsx
|
|
177
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
178
|
+
var ENABLED_KEY = "dxos.org/app-framework/enabled";
|
|
179
|
+
var createApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), defaults = [], placeholder = null, fallback = DefaultFallback, cacheEnabled = false }) => {
|
|
180
|
+
const pluginLoader = _pluginLoader ?? ((id) => {
|
|
181
|
+
const plugin = plugins.find((plugin2) => plugin2.meta.id === id);
|
|
182
|
+
invariant(plugin, `Plugin not found: ${id}`, {
|
|
183
|
+
F: __dxlog_file,
|
|
184
|
+
L: 68,
|
|
185
|
+
S: void 0,
|
|
186
|
+
A: [
|
|
187
|
+
"plugin",
|
|
188
|
+
"`Plugin not found: ${id}`"
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
return plugin;
|
|
192
|
+
});
|
|
193
|
+
const state = create({
|
|
194
|
+
ready: false,
|
|
195
|
+
error: null
|
|
196
|
+
});
|
|
197
|
+
const cached = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? "[]");
|
|
198
|
+
const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;
|
|
199
|
+
const manager = pluginManager ?? new PluginManager({
|
|
200
|
+
pluginLoader,
|
|
201
|
+
plugins,
|
|
202
|
+
core,
|
|
203
|
+
enabled
|
|
204
|
+
});
|
|
205
|
+
manager.activation.on(({ event, state: _state, error }) => {
|
|
206
|
+
if (event === Events.Startup.id) {
|
|
207
|
+
state.ready = _state === "activated";
|
|
208
|
+
}
|
|
209
|
+
if (error && !state.ready && !state.error) {
|
|
210
|
+
state.error = error;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
effect(() => {
|
|
214
|
+
cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));
|
|
215
|
+
});
|
|
216
|
+
manager.context.contributeCapability({
|
|
217
|
+
interface: Capabilities.PluginManager,
|
|
218
|
+
implementation: manager,
|
|
219
|
+
module: "dxos.org/app-framework/plugin-manager"
|
|
220
|
+
});
|
|
221
|
+
setupDevtools(manager);
|
|
222
|
+
void manager.activate(Events.SetupSurfaces);
|
|
223
|
+
void manager.activate(Events.Startup);
|
|
224
|
+
return () => /* @__PURE__ */ React3.createElement(ErrorBoundary, {
|
|
225
|
+
fallback
|
|
226
|
+
}, /* @__PURE__ */ React3.createElement(PluginManagerProvider, {
|
|
227
|
+
value: manager
|
|
228
|
+
}, /* @__PURE__ */ React3.createElement(App, {
|
|
229
|
+
placeholder,
|
|
230
|
+
state
|
|
231
|
+
})));
|
|
232
|
+
};
|
|
233
|
+
var App = ({ placeholder, state }) => {
|
|
234
|
+
const reactContexts = useCapabilities(Capabilities.ReactContext);
|
|
235
|
+
const reactRoots = useCapabilities(Capabilities.ReactRoot);
|
|
236
|
+
if (state.error) {
|
|
237
|
+
throw state.error;
|
|
238
|
+
}
|
|
239
|
+
if (!state.ready) {
|
|
240
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, placeholder);
|
|
241
|
+
}
|
|
242
|
+
const ComposedContext = composeContexts(reactContexts);
|
|
243
|
+
return /* @__PURE__ */ React3.createElement(ComposedContext, null, reactRoots.map(({ id, root: Component2 }) => /* @__PURE__ */ React3.createElement(Component2, {
|
|
244
|
+
key: id
|
|
245
|
+
})));
|
|
246
|
+
};
|
|
247
|
+
var DefaultFallback = ({ error }) => {
|
|
248
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
249
|
+
style: {
|
|
250
|
+
padding: "1rem"
|
|
251
|
+
}
|
|
252
|
+
}, /* @__PURE__ */ React3.createElement("h1", {
|
|
253
|
+
style: {
|
|
254
|
+
fontSize: "1.2rem",
|
|
255
|
+
fontWeight: 700,
|
|
256
|
+
margin: "0.5rem 0"
|
|
257
|
+
}
|
|
258
|
+
}, error.message), /* @__PURE__ */ React3.createElement("pre", null, error.stack));
|
|
259
|
+
};
|
|
260
|
+
var composeContexts = (contexts) => {
|
|
261
|
+
if (contexts.length === 0) {
|
|
262
|
+
return ({ children }) => /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);
|
|
263
|
+
}
|
|
264
|
+
return topologicalSort(contexts).map(({ context }) => context).reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React3.createElement(Acc, null, /* @__PURE__ */ React3.createElement(Next, null, children)));
|
|
265
|
+
};
|
|
266
|
+
var setupDevtools = (manager) => {
|
|
267
|
+
globalThis.composer ??= {};
|
|
268
|
+
globalThis.composer.manager = manager;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export {
|
|
272
|
+
usePluginManager,
|
|
273
|
+
PluginManagerProvider,
|
|
274
|
+
useCapabilities,
|
|
275
|
+
useCapability,
|
|
276
|
+
useIntentDispatcher,
|
|
277
|
+
useAppGraph,
|
|
278
|
+
useLayout,
|
|
279
|
+
ErrorBoundary,
|
|
280
|
+
useSurfaces,
|
|
281
|
+
isSurfaceAvailable,
|
|
282
|
+
Surface,
|
|
283
|
+
useIntentResolver,
|
|
284
|
+
createApp
|
|
285
|
+
};
|
|
286
|
+
//# sourceMappingURL=chunk-47FG42II.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/react/PluginManagerProvider.ts", "../../../src/react/useCapabilities.ts", "../../../src/react/common.ts", "../../../src/react/ErrorBoundary.tsx", "../../../src/react/Surface.tsx", "../../../src/react/useIntentResolver.ts", "../../../src/App.tsx", "../../../src/helpers.ts"],
|
|
4
|
+
"sourcesContent": ["//\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 | undefined>(undefined);\n\n/**\n * Get the plugin manager.\n */\nexport const usePluginManager = (): PluginManager =>\n useContext(PluginManagerContext) ?? raise(new Error('Missing PluginManagerContext'));\n\n/**\n * Context provider for a plugin manager.\n */\nexport const PluginManagerProvider = PluginManagerContext.Provider;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { computed } from '@preact/signals-core';\nimport { useMemo } from 'react';\n\nimport { usePluginManager } from './PluginManagerProvider';\nimport { type InterfaceDef } from '../core';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(\n () => computed(() => manager.context.requestCapabilities(interfaceDef, filter)),\n [interfaceDef],\n );\n\n return signal.value;\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, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(() => computed(() => manager.context.requestCapability(interfaceDef, filter)), [interfaceDef]);\n return signal.value;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCapability } from './useCapabilities';\nimport { Capabilities } from '../common';\n\nexport const useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);\n\nexport const useAppGraph = () => useCapability(Capabilities.AppGraph);\n\nexport const useLayout = () => useCapability(Capabilities.Layout);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { memo, forwardRef, Suspense, useMemo } from 'react';\n\nimport { useDefaultValue } from '@dxos/react-hooks';\nimport { byPosition } from '@dxos/util';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { useCapabilities } from './useCapabilities';\nimport { Capabilities, type SurfaceDefinition, type SurfaceProps } from '../common';\nimport { type PluginsContext } from '../core';\n\n/**\n * @internal\n */\nexport const useSurfaces = () => {\n const surfaces = useCapabilities(Capabilities.ReactSurface);\n return useMemo(() => surfaces.flat(), [surfaces]);\n};\n\nconst findCandidates = (surfaces: SurfaceDefinition[], { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n return Object.values(surfaces)\n .filter((definition) =>\n Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,\n )\n .filter(({ filter }) => (filter ? filter(data ?? {}) : true))\n .toSorted(byPosition);\n};\n\n/**\n * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.\n */\nexport const isSurfaceAvailable = (context: PluginsContext, { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n const surfaces = context.requestCapabilities(Capabilities.ReactSurface);\n const candidates = findCandidates(surfaces.flat(), { role, data });\n return candidates.length > 0;\n};\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = memo(\n forwardRef<HTMLElement, SurfaceProps>(\n ({ id: _id, role, data: _data, limit, fallback, placeholder, ...rest }, forwardedRef) => {\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 anyways.\n // In the future, it would be nice to be able to bucket the surface contributions by role.\n const surfaces = useSurfaces();\n const data = useDefaultValue(_data, () => ({}));\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 const nodes = candidates.map(({ component: Component, id }) => (\n <Component ref={forwardedRef} key={id} id={id} role={role} data={data} limit={limit} {...rest} />\n ));\n\n const suspense = placeholder ? <Suspense fallback={placeholder}>{nodes}</Suspense> : nodes;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n ),\n);\n\nSurface.displayName = 'Surface';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { Capabilities } from '../common';\nimport { type AnyIntentResolver } from '../plugin-intent';\nimport { usePluginManager } from '../react';\n\nexport const useIntentResolver = (module: string, resolver: AnyIntentResolver) => {\n const manager = usePluginManager();\n useEffect(() => {\n manager.context.contributeCapability({\n module,\n interface: Capabilities.IntentResolver,\n implementation: resolver,\n });\n\n return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);\n }, [module, resolver]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { create } from '@dxos/live-object';\n\nimport { Capabilities, Events } from './common';\nimport { PluginManager, type PluginManagerOptions, type Plugin } from './core';\nimport { topologicalSort } from './helpers';\nimport { ErrorBoundary, PluginManagerProvider, useCapabilities } from './react';\n\nconst ENABLED_KEY = 'dxos.org/app-framework/enabled';\n\nexport type CreateAppOptions = {\n pluginManager?: PluginManager;\n pluginLoader?: PluginManagerOptions['pluginLoader'];\n plugins?: Plugin[];\n core?: string[];\n defaults?: string[];\n placeholder?: ReactNode;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\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 = createApp({ 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 */\nexport const createApp = ({\n pluginManager,\n pluginLoader: _pluginLoader,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n defaults = [],\n placeholder = null,\n fallback = DefaultFallback,\n cacheEnabled = false,\n}: CreateAppOptions) => {\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader =\n _pluginLoader ??\n ((id: string) => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n });\n\n const state = create({ ready: false, error: null });\n const cached: string[] = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]');\n const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;\n const manager = pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled });\n\n manager.activation.on(({ event, state: _state, error }) => {\n if (event === Events.Startup.id) {\n state.ready = _state === 'activated';\n }\n\n if (error && !state.ready && !state.error) {\n state.error = error;\n }\n });\n\n effect(() => {\n cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));\n });\n\n manager.context.contributeCapability({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n setupDevtools(manager);\n\n // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.\n void manager.activate(Events.SetupSurfaces);\n void manager.activate(Events.Startup);\n\n return () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <App placeholder={placeholder} state={state} />\n </PluginManagerProvider>\n </ErrorBoundary>\n );\n};\n\ntype AppProps = Required<Pick<CreateAppOptions, 'placeholder'>> & {\n state: { ready: boolean; error: unknown };\n};\n\nconst App = ({ placeholder, state }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n\n if (state.error) {\n // This trigger the error boundary to provide UI feedback for the startup error.\n throw state.error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead?\n if (!state.ready) {\n return <>{placeholder}</>;\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\n// Default fallback does not use tailwind or theme.\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\nconst setupDevtools = (manager: PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\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"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,eAAeC,kBAAkB;AAE1C,SAASC,aAA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AAEE,IAAIoD,MAAMC,WAAS,MACpC,gBAAAb,OAAA,cAACa,YAAAA;IAAUC,KAAKtD;;AAIxB;AAGA,IAAMI,kBAAkB,CAAC,EAAEQ,MAAK,MAAoB;AAClD,SACE,gBAAA4B,OAAA,cAACe,OAAAA;IAAIC,OAAO;MAAEC,SAAS;IAAO;KAE5B,gBAAAjB,OAAA,cAACkB,MAAAA;IAAGF,OAAO;MAAEG,UAAU;MAAUC,YAAY;MAAKC,QAAQ;IAAW;KAAIjD,MAAMkD,OAAO,GACtF,gBAAAtB,OAAA,cAACuB,OAAAA,MAAKnD,MAAMoD,KAAK,CAAA;AAGvB;AAEA,IAAMb,kBAAkB,CAACc,aAAAA;AACvB,MAAIA,SAAS9C,WAAW,GAAG;AACzB,WAAO,CAAC,EAAE+C,SAAQ,MAA0B,gBAAA1B,OAAA,cAAAA,OAAA,UAAA,MAAG0B,QAAAA;EACjD;AAEA,SAAOC,gBAAgBF,QAAAA,EACpBnE,IAAI,CAAC,EAAEiC,QAAO,MAAOA,OAAAA,EACrBqC,OAAO,CAACC,KAAKC,SAAS,CAAC,EAAEJ,SAAQ,MAChC,gBAAA1B,OAAA,cAAC6B,KAAAA,MACC,gBAAA7B,OAAA,cAAC8B,MAAAA,MAAMJ,QAAAA,CAAAA,CAAAA;AAGf;AAEA,IAAM7B,gBAAgB,CAACjB,YAAAA;AACpBmD,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAASpD,UAAUA;AACzC;",
|
|
6
|
+
"names": ["createContext", "useContext", "raise", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "computed", "useMemo", "useCapabilities", "interfaceDef", "filter", "manager", "usePluginManager", "signal", "useMemo", "computed", "context", "requestCapabilities", "value", "useCapability", "requestCapability", "useIntentDispatcher", "useCapability", "Capabilities", "IntentDispatcher", "useAppGraph", "AppGraph", "useLayout", "Layout", "React", "Component", "ErrorBoundary", "Component", "constructor", "props", "state", "error", "undefined", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "this", "fallback", "reset", "children", "setState", "React", "memo", "forwardRef", "Suspense", "useMemo", "useDefaultValue", "byPosition", "useSurfaces", "surfaces", "useCapabilities", "Capabilities", "ReactSurface", "useMemo", "flat", "findCandidates", "role", "data", "Object", "values", "filter", "definition", "Array", "isArray", "includes", "toSorted", "byPosition", "isSurfaceAvailable", "context", "requestCapabilities", "candidates", "length", "Surface", "memo", "forwardRef", "id", "_id", "_data", "limit", "fallback", "placeholder", "rest", "forwardedRef", "useDefaultValue", "definitions", "slice", "nodes", "map", "component", "Component", "React", "ref", "key", "suspense", "Suspense", "ErrorBoundary", "displayName", "useEffect", "useIntentResolver", "module", "resolver", "manager", "usePluginManager", "useEffect", "context", "contributeCapability", "interface", "Capabilities", "IntentResolver", "implementation", "removeCapability", "effect", "React", "invariant", "create", "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", "ENABLED_KEY", "createApp", "pluginManager", "pluginLoader", "_pluginLoader", "plugins", "core", "map", "meta", "id", "defaults", "placeholder", "fallback", "DefaultFallback", "cacheEnabled", "plugin", "find", "invariant", "state", "create", "ready", "error", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "length", "manager", "PluginManager", "activation", "on", "event", "_state", "Events", "Startup", "effect", "setItem", "stringify", "context", "contributeCapability", "interface", "Capabilities", "implementation", "module", "setupDevtools", "activate", "SetupSurfaces", "React", "ErrorBoundary", "PluginManagerProvider", "value", "App", "reactContexts", "useCapabilities", "ReactContext", "reactRoots", "ReactRoot", "ComposedContext", "composeContexts", "root", "Component", "key", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "contexts", "children", "topologicalSort", "reduce", "Acc", "Next", "globalThis", "composer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/sdk/app-framework/src/plugin-settings/actions.ts
|
|
4
|
+
import { Schema as S } from "@effect/schema";
|
|
5
|
+
var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
6
|
+
var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
|
|
7
|
+
var SETTINGS_ID = "dxos:settings";
|
|
8
|
+
var SETTINGS_KEY = "settings";
|
|
9
|
+
var SettingsAction;
|
|
10
|
+
(function(SettingsAction2) {
|
|
11
|
+
class Open extends S.TaggedClass()(`${SETTINGS_ACTION}/open`, {
|
|
12
|
+
input: S.Struct({
|
|
13
|
+
plugin: S.optional(S.String)
|
|
14
|
+
}),
|
|
15
|
+
output: S.Void
|
|
16
|
+
}) {
|
|
17
|
+
}
|
|
18
|
+
SettingsAction2.Open = Open;
|
|
19
|
+
class OpenPluginRegistry extends S.TaggedClass()(`${SETTINGS_ACTION}/open-plugin-registry`, {
|
|
20
|
+
input: S.Void,
|
|
21
|
+
output: S.Void
|
|
22
|
+
}) {
|
|
23
|
+
}
|
|
24
|
+
SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
|
|
25
|
+
})(SettingsAction || (SettingsAction = {}));
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
SETTINGS_PLUGIN,
|
|
29
|
+
SETTINGS_ACTION,
|
|
30
|
+
SETTINGS_ID,
|
|
31
|
+
SETTINGS_KEY,
|
|
32
|
+
SettingsAction
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=chunk-CNJYZNSL.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin-settings/actions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema as S } from '@effect/schema';\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\nexport const SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;\nexport const SETTINGS_ID = 'dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends S.TaggedClass<Open>()(`${SETTINGS_ACTION}/open`, {\n input: S.Struct({\n plugin: S.optional(S.String),\n }),\n output: S.Void,\n }) {}\n\n export class OpenPluginRegistry extends S.TaggedClass<OpenPluginRegistry>()(\n `${SETTINGS_ACTION}/open-plugin-registry`,\n {\n input: S.Void,\n output: S.Void,\n },\n ) {}\n}\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,UAAUC,SAAS;AAErB,IAAMC,kBAAkB;AACxB,IAAMC,kBAAkB,GAAGD,eAAAA;AAC3B,IAAME,cAAc;AACpB,IAAMC,eAAe;;UAEXC,iBAAAA;EACR,MAAMC,aAAaC,EAAEC,YAAW,EAAS,GAAGN,eAAAA,SAAwB;IACzEO,OAAOF,EAAEG,OAAO;MACdC,QAAQJ,EAAEK,SAASL,EAAEM,MAAM;IAC7B,CAAA;IACAC,QAAQP,EAAEQ;EACZ,CAAA,EAAA;EAAI;kBALST,OAAAA;EAON,MAAMU,2BAA2BT,EAAEC,YAAW,EACnD,GAAGN,eAAAA,yBACH;IACEO,OAAOF,EAAEQ;IACTD,QAAQP,EAAEQ;EACZ,CAAA,EAAA;EACC;kBANUC,qBAAAA;AAOf,GAfiBX,mBAAAA,iBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["Schema", "S", "SETTINGS_PLUGIN", "SETTINGS_ACTION", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "S", "TaggedClass", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
|
|
7
|
+
}
|