@dxos/app-framework 0.8.2-main.f11618f → 0.8.2-staging.42af850
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-OHM2Z6YQ.mjs → app-graph-builder-DYEAGZPS.mjs} +23 -23
- package/dist/lib/browser/app-graph-builder-DYEAGZPS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DVNSCQJ5.mjs → chunk-5GE2ERNU.mjs} +314 -280
- package/dist/lib/browser/chunk-5GE2ERNU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SFPT4Z2C.mjs → chunk-WWEJRWFX.mjs} +10 -10
- package/dist/lib/browser/chunk-WWEJRWFX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X2YC645Z.mjs → chunk-ZMXJV64L.mjs} +122 -62
- package/dist/lib/browser/chunk-ZMXJV64L.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +10 -10
- package/dist/lib/browser/{intent-dispatcher-J7QIFHLO.mjs → intent-dispatcher-ELZN5EM7.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs → intent-resolver-SGWLINTO.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-XMPVLJOQ.mjs → store-YIU6IPZ2.mjs} +7 -6
- package/dist/lib/browser/store-YIU6IPZ2.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +30 -14
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/worker.mjs +3 -3
- package/dist/lib/node/app-graph-builder-GBLISL7L.cjs +146 -0
- package/dist/lib/node/app-graph-builder-GBLISL7L.cjs.map +7 -0
- package/dist/lib/node/{chunk-JUSEAFDU.cjs → chunk-G774ASXO.cjs} +5 -5
- package/dist/lib/node/chunk-G774ASXO.cjs.map +7 -0
- package/dist/lib/node/{chunk-I3CJYEBC.cjs → chunk-HIVITTZD.cjs} +156 -122
- package/dist/lib/node/chunk-HIVITTZD.cjs.map +7 -0
- package/dist/lib/node/{chunk-5UOVF3OR.cjs → chunk-Z2PMVDJ5.cjs} +155 -95
- package/dist/lib/node/chunk-Z2PMVDJ5.cjs.map +7 -0
- package/dist/lib/node/index.cjs +81 -81
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs → intent-dispatcher-LFXZJTAS.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs.map → intent-dispatcher-LFXZJTAS.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs → intent-resolver-EPSFTHL6.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-N7JLYYDI.cjs → store-CVVRXUTH.cjs} +10 -9
- package/dist/lib/node/store-CVVRXUTH.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +34 -17
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node/worker.cjs +39 -39
- package/dist/lib/node/worker.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-OMH534A4.mjs → app-graph-builder-LUBDEIT6.mjs} +23 -23
- package/dist/lib/node-esm/app-graph-builder-LUBDEIT6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QHXUTJHE.mjs → chunk-6IKYKERU.mjs} +122 -62
- package/dist/lib/node-esm/chunk-6IKYKERU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PHOUQACM.mjs → chunk-I6BVZMAH.mjs} +10 -10
- package/dist/lib/node-esm/chunk-I6BVZMAH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GSDBF2CK.mjs → chunk-Z2ZHH4HN.mjs} +314 -280
- package/dist/lib/node-esm/chunk-Z2ZHH4HN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -10
- package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs → intent-dispatcher-A2JCMWRD.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs → intent-resolver-5C4O43GK.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-M2BYJL6K.mjs → store-HRZXZ2D2.mjs} +7 -6
- package/dist/lib/node-esm/store-HRZXZ2D2.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +30 -14
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/worker.mjs +3 -3
- package/dist/types/src/App.d.ts +3 -1
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +40 -222
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +8 -8
- package/dist/types/src/common/collaboration.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +7 -7
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +165 -163
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +7 -7
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +28 -13
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/events.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +6 -3
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +2 -2
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +6 -6
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +14 -14
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +3 -3
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +14 -20
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +10 -10
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +2 -195
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/store.d.ts +2 -2
- package/dist/types/src/plugin-settings/store.d.ts.map +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +1 -1
- package/dist/types/src/react/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/react/IntentContext.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts +2 -2
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/useCapabilities.d.ts +2 -2
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/react/useIntentResolver.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +6 -2
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -21
- package/src/App.tsx +97 -47
- package/src/common/capabilities.ts +18 -7
- package/src/common/collaboration.ts +9 -9
- package/src/common/file.ts +7 -7
- package/src/common/layout.ts +156 -136
- package/src/common/translations.ts +7 -7
- package/src/core/capabilities.test.ts +55 -36
- package/src/core/capabilities.ts +79 -59
- package/src/core/manager.test.ts +19 -19
- package/src/core/manager.ts +24 -16
- package/src/core/plugin.ts +2 -2
- package/src/playground/generator/generator.ts +4 -4
- package/src/playground/logger/schema.ts +5 -5
- package/src/playground/playground.stories.tsx +13 -9
- package/src/plugin-intent/actions.ts +9 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +23 -42
- package/src/plugin-intent/intent-dispatcher.ts +7 -11
- package/src/plugin-intent/intent.ts +22 -20
- package/src/plugin-settings/actions.ts +8 -8
- package/src/plugin-settings/app-graph-builder.ts +129 -94
- package/src/plugin-settings/store.ts +20 -17
- package/src/react/ErrorBoundary.tsx +3 -3
- package/src/react/Surface.stories.tsx +1 -1
- package/src/react/Surface.tsx +3 -3
- package/src/react/useCapabilities.ts +9 -19
- package/src/testing/withPluginManager.stories.tsx +0 -1
- package/src/testing/withPluginManager.tsx +35 -16
- package/tsconfig.json +1 -53
- package/typedoc/assets/navigation.js +1 -1
- package/typedoc/assets/search.js +1 -1
- package/typedoc/classes/CollaborationActions.InsertContent.html +280 -280
- package/typedoc/classes/ErrorBoundary.html +6 -6
- package/typedoc/classes/IntentAction.ShowUndo.html +125 -125
- package/typedoc/classes/IntentAction.Track.html +239 -239
- package/typedoc/classes/LayoutAction.AddToast.html +163 -163
- package/typedoc/classes/LayoutAction.Close.html +352 -352
- package/typedoc/classes/LayoutAction.Expose.html +238 -238
- package/typedoc/classes/LayoutAction.Open.html +904 -748
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +241 -241
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +280 -280
- package/typedoc/classes/LayoutAction.Set.html +436 -358
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +469 -391
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +238 -238
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +358 -358
- package/typedoc/classes/LayoutAction.UpdateDialog.html +865 -475
- package/typedoc/classes/LayoutAction.UpdateLayout.html +281 -281
- package/typedoc/classes/LayoutAction.UpdatePopover.html +826 -826
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +397 -319
- package/typedoc/classes/Plugin.html +3 -3
- package/typedoc/classes/PluginContext.html +38 -0
- package/typedoc/classes/PluginManager.html +17 -16
- package/typedoc/classes/PluginModule.html +9 -9
- package/typedoc/classes/SettingsAction.Open.html +199 -199
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +124 -124
- package/typedoc/functions/Events.createStateEvent.html +2 -2
- package/typedoc/functions/IntentPlugin.html +1 -1
- package/typedoc/functions/SettingsPlugin.html +1 -1
- package/typedoc/functions/allOf.html +2 -2
- package/typedoc/functions/chain.html +2 -2
- package/typedoc/functions/contributes.html +2 -2
- package/typedoc/functions/createDispatcher.html +3 -3
- package/typedoc/functions/createIntent.html +3 -3
- package/typedoc/functions/createResolver.html +2 -2
- package/typedoc/functions/createSurface.html +2 -2
- package/typedoc/functions/defineCapability.html +2 -2
- package/typedoc/functions/defineEvent.html +2 -2
- package/typedoc/functions/defineModule.html +2 -2
- package/typedoc/functions/definePlugin.html +2 -2
- package/typedoc/functions/eventKey.html +2 -2
- package/typedoc/functions/getEvents.html +2 -2
- package/typedoc/functions/isAllOf.html +2 -2
- package/typedoc/functions/isOneOf.html +2 -2
- package/typedoc/functions/isSurfaceAvailable.html +2 -2
- package/typedoc/functions/lazy.html +2 -2
- package/typedoc/functions/oneOf.html +2 -2
- package/typedoc/functions/{createApp.html → useApp.html} +2 -2
- package/typedoc/functions/useAppGraph.html +1 -1
- package/typedoc/functions/useCapabilities.html +3 -3
- package/typedoc/functions/useCapability.html +3 -3
- package/typedoc/functions/useIntentDispatcher.html +1 -1
- package/typedoc/functions/useIntentResolver.html +1 -1
- package/typedoc/functions/useLayout.html +1 -1
- package/typedoc/functions/usePluginManager.html +2 -2
- package/typedoc/hierarchy.html +1 -1
- package/typedoc/index.html +2 -2
- package/typedoc/interfaces/LayoutAction.Toast.html +2 -2
- package/typedoc/modules/Capabilities.html +1 -1
- package/typedoc/modules/CollaborationActions.html +1 -1
- package/typedoc/modules/Events.html +1 -1
- package/typedoc/modules/IntentAction.html +1 -1
- package/typedoc/modules/LayoutAction.html +2 -2
- package/typedoc/modules/SettingsAction.html +1 -1
- package/typedoc/modules.html +1 -1
- package/typedoc/types/ActivationEvent.html +3 -3
- package/typedoc/types/ActivationEvents.html +2 -2
- package/typedoc/types/AnyCapability.html +1 -1
- package/typedoc/types/AnyIntent.html +1 -1
- package/typedoc/types/AnyIntentChain.html +1 -1
- package/typedoc/types/AnyIntentEffectResult.html +1 -1
- package/typedoc/types/AnyIntentResolver.html +1 -1
- package/typedoc/types/AnyIntentResult.html +1 -1
- package/typedoc/types/Capabilities.FileUploader.html +1 -1
- package/typedoc/types/Capabilities.IntentResolver.html +1 -1
- package/typedoc/types/Capabilities.Layout.html +1 -1
- package/typedoc/types/Capabilities.Metadata.html +1 -1
- package/typedoc/types/Capabilities.ReactContext.html +1 -1
- package/typedoc/types/Capabilities.ReactRoot.html +1 -1
- package/typedoc/types/Capabilities.ReactSurface.html +1 -1
- package/typedoc/types/Capabilities.Settings.html +2 -2
- package/typedoc/types/Capability.html +5 -5
- package/typedoc/types/CreateAppOptions.html +3 -2
- package/typedoc/types/FileInfo.html +1 -1
- package/typedoc/types/Intent.html +6 -10
- package/typedoc/types/IntentChain.html +3 -3
- package/typedoc/types/IntentContext.html +2 -2
- package/typedoc/types/IntentData.html +1 -1
- package/typedoc/types/IntentDispatcher.html +2 -2
- package/typedoc/types/IntentDispatcherResult.html +2 -2
- package/typedoc/types/IntentEffectDefinition.html +2 -2
- package/typedoc/types/IntentEffectResult.html +6 -6
- package/typedoc/types/IntentParams.html +2 -2
- package/typedoc/types/IntentResolver.html +2 -2
- package/typedoc/types/IntentResultData.html +1 -1
- package/typedoc/types/IntentSchema.html +1 -1
- package/typedoc/types/IntentUndo.html +2 -2
- package/typedoc/types/InterfaceDef.html +3 -3
- package/typedoc/types/Label.html +1 -1
- package/typedoc/types/NodeSerializer.html +3 -3
- package/typedoc/types/PluginManagerOptions.html +3 -2
- package/typedoc/types/PluginMeta.html +9 -9
- package/typedoc/types/PromiseIntentDispatcher.html +2 -2
- package/typedoc/types/PromiseIntentUndo.html +2 -2
- package/typedoc/types/Resource.html +1 -1
- package/typedoc/types/ResourceKey.html +1 -1
- package/typedoc/types/ResourceLanguage.html +1 -1
- package/typedoc/types/SerializedNode.html +2 -2
- package/typedoc/types/SurfaceComponent.html +2 -2
- package/typedoc/types/SurfaceDefinition.html +2 -2
- package/typedoc/types/SurfaceProps.html +2 -2
- package/typedoc/variables/Capabilities.AnchorSort.html +1 -0
- package/typedoc/variables/Capabilities.AppGraph.html +1 -1
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +1 -1
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +1 -1
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +1 -1
- package/typedoc/variables/Capabilities.FileUploader.html +1 -1
- package/typedoc/variables/Capabilities.IntentDispatcher.html +1 -1
- package/typedoc/variables/Capabilities.IntentResolver.html +1 -1
- package/typedoc/variables/Capabilities.Layout.html +1 -1
- package/typedoc/variables/Capabilities.Metadata.html +1 -1
- package/typedoc/variables/Capabilities.Null.html +1 -1
- package/typedoc/variables/Capabilities.PluginManager.html +1 -1
- package/typedoc/variables/Capabilities.ReactContext.html +1 -1
- package/typedoc/variables/Capabilities.ReactRoot.html +1 -1
- package/typedoc/variables/Capabilities.ReactSurface.html +1 -1
- package/typedoc/variables/Capabilities.RxRegistry.html +1 -0
- package/typedoc/variables/Capabilities.Settings.html +1 -1
- package/typedoc/variables/Capabilities.SettingsStore.html +1 -1
- package/typedoc/variables/Capabilities.Tools.html +1 -1
- package/typedoc/variables/Capabilities.Translations.html +1 -1
- package/typedoc/variables/Events.AppGraphReady.html +2 -2
- package/typedoc/variables/Events.DispatcherReady.html +2 -2
- package/typedoc/variables/Events.LayoutReady.html +1 -1
- package/typedoc/variables/Events.SettingsReady.html +2 -2
- package/typedoc/variables/Events.SetupAppGraph.html +2 -2
- package/typedoc/variables/Events.SetupArtifactDefinition.html +2 -2
- package/typedoc/variables/Events.SetupIntentResolver.html +2 -2
- package/typedoc/variables/Events.SetupMetadata.html +2 -2
- package/typedoc/variables/Events.SetupReactSurface.html +2 -2
- package/typedoc/variables/Events.SetupSettings.html +2 -2
- package/typedoc/variables/Events.SetupTranslations.html +2 -2
- package/typedoc/variables/Events.Startup.html +2 -2
- package/typedoc/variables/FileInfoSchema.html +1 -1
- package/typedoc/variables/INTENT_ACTION.html +1 -1
- package/typedoc/variables/INTENT_PLUGIN.html +1 -1
- package/typedoc/variables/LAYOUT_ACTION.html +1 -1
- package/typedoc/variables/LAYOUT_PLUGIN.html +1 -1
- package/typedoc/variables/Label.html +1 -1
- package/typedoc/variables/LayoutAction.Toast.html +1 -1
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +1 -1
- package/typedoc/variables/PluginManagerProvider.html +2 -2
- package/typedoc/variables/Resource.html +2 -2
- package/typedoc/variables/ResourceKey.html +1 -1
- package/typedoc/variables/ResourceLanguage.html +1 -1
- package/typedoc/variables/SETTINGS_ACTION.html +1 -1
- package/typedoc/variables/SETTINGS_ID.html +1 -1
- package/typedoc/variables/SETTINGS_KEY.html +1 -1
- package/typedoc/variables/SETTINGS_PLUGIN.html +1 -1
- package/typedoc/variables/Surface.html +2 -2
- package/typedoc/variables/defaultFileTypes.html +1 -1
- package/dist/lib/browser/app-graph-builder-OHM2Z6YQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-DVNSCQJ5.mjs.map +0 -7
- package/dist/lib/browser/chunk-SFPT4Z2C.mjs.map +0 -7
- package/dist/lib/browser/chunk-X2YC645Z.mjs.map +0 -7
- package/dist/lib/browser/store-XMPVLJOQ.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-Z45FKS52.cjs +0 -146
- package/dist/lib/node/app-graph-builder-Z45FKS52.cjs.map +0 -7
- package/dist/lib/node/chunk-5UOVF3OR.cjs.map +0 -7
- package/dist/lib/node/chunk-I3CJYEBC.cjs.map +0 -7
- package/dist/lib/node/chunk-JUSEAFDU.cjs.map +0 -7
- package/dist/lib/node/store-N7JLYYDI.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OMH534A4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GSDBF2CK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PHOUQACM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QHXUTJHE.mjs.map +0 -7
- package/dist/lib/node-esm/store-M2BYJL6K.mjs.map +0 -7
- package/typedoc/classes/PluginsContext.html +0 -25
- /package/dist/lib/browser/{intent-dispatcher-J7QIFHLO.mjs.map → intent-dispatcher-ELZN5EM7.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs.map → intent-resolver-SGWLINTO.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs.map → intent-resolver-EPSFTHL6.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs.map → intent-dispatcher-A2JCMWRD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs.map → intent-resolver-5C4O43GK.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntentResolver.d.ts","sourceRoot":"","sources":["../../../../src/react/useIntentResolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useIntentResolver.d.ts","sourceRoot":"","sources":["../../../../src/react/useIntentResolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,UAAU,iBAAiB,SAW5E,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { type Decorator } from '@storybook/react';
|
|
2
2
|
import { type CreateAppOptions } from '../App';
|
|
3
|
-
import { type ActivationEvent, type AnyCapability } from '../core';
|
|
3
|
+
import { type ActivationEvent, type AnyCapability, type PluginContext } from '../core';
|
|
4
|
+
export type Provider<C, R> = (context: C) => R;
|
|
5
|
+
export type ProviderOrValue<C, R> = Provider<C, R> | R;
|
|
6
|
+
export declare const getValue: <C, R>(providerOrValue: ProviderOrValue<C, R>, context: C) => R;
|
|
4
7
|
export type WithPluginManagerOptions = CreateAppOptions & {
|
|
5
|
-
capabilities?: AnyCapability[]
|
|
8
|
+
capabilities?: ProviderOrValue<PluginContext, AnyCapability[]>;
|
|
6
9
|
fireEvents?: (ActivationEvent | string)[];
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* Wraps a story with a plugin manager.
|
|
13
|
+
* NOTE: This builds up and tears down the plugin manager on every render.
|
|
10
14
|
*/
|
|
11
15
|
export declare const withPluginManager: (options?: WithPluginManagerOptions) => Decorator;
|
|
12
16
|
//# sourceMappingURL=withPluginManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,
|
|
1
|
+
{"version":3,"file":"withPluginManager.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAU,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACvD,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,iBAAiB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAG,CAEnF,CAAC;AA+BF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IACxD,YAAY,CAAC,EAAE,eAAe,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAS,wBAA6B,KAAG,SAmC1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withPluginManager.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withPluginManager.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withPluginManager.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAiB7D,QAAA,MAAM,IAAI,EAAE,IAkBX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -37,34 +37,41 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@preact/signals-core": "^1.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/invariant": "0.8.2-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
40
|
+
"@preact/signals-core": "^1.9.0",
|
|
41
|
+
"@dxos/ai": "0.8.2-staging.42af850",
|
|
42
|
+
"@dxos/app-graph": "0.8.2-staging.42af850",
|
|
43
|
+
"@dxos/client-protocol": "0.8.2-staging.42af850",
|
|
44
|
+
"@dxos/artifact": "0.8.2-staging.42af850",
|
|
45
|
+
"@dxos/async": "0.8.2-staging.42af850",
|
|
46
|
+
"@dxos/invariant": "0.8.2-staging.42af850",
|
|
47
|
+
"@dxos/echo-schema": "0.8.2-staging.42af850",
|
|
48
|
+
"@dxos/debug": "0.8.2-staging.42af850",
|
|
49
|
+
"@dxos/keys": "0.8.2-staging.42af850",
|
|
50
|
+
"@dxos/local-storage": "0.8.2-staging.42af850",
|
|
51
|
+
"@dxos/live-object": "0.8.2-staging.42af850",
|
|
52
|
+
"@dxos/log": "0.8.2-staging.42af850",
|
|
53
|
+
"@dxos/react-hooks": "0.8.2-staging.42af850",
|
|
54
|
+
"@dxos/schema": "0.8.2-staging.42af850",
|
|
55
|
+
"@dxos/util": "0.8.2-staging.42af850"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
58
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
59
|
+
"@effect/platform": "0.80.12",
|
|
55
60
|
"@phosphor-icons/react": "^2.1.5",
|
|
56
61
|
"@types/react": "~18.2.0",
|
|
57
|
-
"effect": "3.
|
|
62
|
+
"effect": "3.14.21",
|
|
58
63
|
"react": "~18.2.0",
|
|
59
64
|
"typedoc": "0.28.1",
|
|
60
|
-
"@dxos/echo-signals": "0.8.2-
|
|
61
|
-
"@dxos/random": "0.8.2-
|
|
62
|
-
"@dxos/react-ui": "0.8.2-
|
|
63
|
-
"@dxos/react-ui
|
|
64
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
65
|
+
"@dxos/echo-signals": "0.8.2-staging.42af850",
|
|
66
|
+
"@dxos/random": "0.8.2-staging.42af850",
|
|
67
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-staging.42af850",
|
|
68
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
69
|
+
"@dxos/storybook-utils": "0.8.2-staging.42af850"
|
|
65
70
|
},
|
|
66
71
|
"peerDependencies": {
|
|
67
|
-
"effect": "
|
|
72
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
73
|
+
"@effect/platform": "0.80.12",
|
|
74
|
+
"effect": "^3.13.3",
|
|
68
75
|
"react": "~18.2.0"
|
|
69
76
|
},
|
|
70
77
|
"publishConfig": {
|
package/src/App.tsx
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { RegistryContext } from '@effect-rx/rx-react';
|
|
5
6
|
import { effect } from '@preact/signals-core';
|
|
6
|
-
import React, { useEffect, useState, type FC, type PropsWithChildren } from 'react';
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useState, type FC, type PropsWithChildren } from 'react';
|
|
7
8
|
|
|
8
9
|
import { invariant } from '@dxos/invariant';
|
|
9
10
|
import { live } from '@dxos/live-object';
|
|
11
|
+
import { useDefaultValue } from '@dxos/react-hooks';
|
|
10
12
|
|
|
11
13
|
import { Capabilities, Events } from './common';
|
|
12
14
|
import { PluginManager, type PluginManagerOptions, type Plugin } from './core';
|
|
@@ -24,6 +26,7 @@ export type CreateAppOptions = {
|
|
|
24
26
|
placeholder?: FC<{ stage: number }>;
|
|
25
27
|
fallback?: ErrorBoundary['props']['fallback'];
|
|
26
28
|
cacheEnabled?: boolean;
|
|
29
|
+
safeMode?: boolean;
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
/**
|
|
@@ -49,64 +52,111 @@ export type CreateAppOptions = {
|
|
|
49
52
|
* @param params.placeholder Placeholder component to render during startup.
|
|
50
53
|
* @param params.fallback Fallback component to render if an error occurs during startup.
|
|
51
54
|
* @param params.cacheEnabled Whether to cache enabled plugins in localStorage.
|
|
55
|
+
* @param params.safeMode Whether to enable safe mode, which disables optional plugins.
|
|
52
56
|
*/
|
|
53
|
-
export const
|
|
57
|
+
export const useApp = ({
|
|
54
58
|
pluginManager,
|
|
55
59
|
pluginLoader: _pluginLoader,
|
|
56
|
-
plugins
|
|
57
|
-
core
|
|
58
|
-
defaults
|
|
60
|
+
plugins: _plugins,
|
|
61
|
+
core: _core,
|
|
62
|
+
defaults: _defaults,
|
|
59
63
|
placeholder,
|
|
60
64
|
fallback = DefaultFallback,
|
|
61
65
|
cacheEnabled = false,
|
|
66
|
+
safeMode = false,
|
|
62
67
|
}: CreateAppOptions) => {
|
|
68
|
+
const plugins = useDefaultValue(_plugins, () => []);
|
|
69
|
+
const core = useDefaultValue(_core, () => plugins.map(({ meta }) => meta.id));
|
|
70
|
+
const defaults = useDefaultValue(_defaults, () => []);
|
|
71
|
+
|
|
63
72
|
// TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.
|
|
64
|
-
const pluginLoader =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
const pluginLoader = useMemo(
|
|
74
|
+
() =>
|
|
75
|
+
_pluginLoader ??
|
|
76
|
+
((id: string) => {
|
|
77
|
+
const plugin = plugins.find((plugin) => plugin.meta.id === id);
|
|
78
|
+
invariant(plugin, `Plugin not found: ${id}`);
|
|
79
|
+
return plugin;
|
|
80
|
+
}),
|
|
81
|
+
[_pluginLoader, plugins],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const state = useMemo(() => live({ ready: false, error: null }), []);
|
|
85
|
+
const cached: string[] = useMemo(() => JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]'), []);
|
|
86
|
+
const enabled = useMemo(
|
|
87
|
+
() => (safeMode ? [] : cacheEnabled && cached.length > 0 ? cached : defaults),
|
|
88
|
+
[safeMode, cacheEnabled, cached, defaults],
|
|
89
|
+
);
|
|
90
|
+
const manager = useMemo(
|
|
91
|
+
() => pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled }),
|
|
92
|
+
[pluginManager, pluginLoader, plugins, core, enabled],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
return manager.activation.on(({ event, state: _state, error }) => {
|
|
97
|
+
// Once the app is ready the first time, don't show the fallback again.
|
|
98
|
+
if (!state.ready && event === Events.Startup.id) {
|
|
99
|
+
state.ready = _state === 'activated';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (error && !state.ready && !state.error) {
|
|
103
|
+
state.error = error;
|
|
104
|
+
}
|
|
70
105
|
});
|
|
106
|
+
}, [manager, state]);
|
|
71
107
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
effect(() => {
|
|
110
|
+
cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));
|
|
111
|
+
});
|
|
112
|
+
}, [cacheEnabled, manager]);
|
|
76
113
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
manager.context.contributeCapability({
|
|
116
|
+
interface: Capabilities.PluginManager,
|
|
117
|
+
implementation: manager,
|
|
118
|
+
module: 'dxos.org/app-framework/plugin-manager',
|
|
119
|
+
});
|
|
82
120
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
manager.context.contributeCapability({
|
|
122
|
+
interface: Capabilities.RxRegistry,
|
|
123
|
+
implementation: manager.registry,
|
|
124
|
+
module: 'dxos.org/app-framework/rx-registry',
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return () => {
|
|
128
|
+
manager.context.removeCapability(Capabilities.PluginManager, manager);
|
|
129
|
+
manager.context.removeCapability(Capabilities.RxRegistry, manager.registry);
|
|
130
|
+
};
|
|
131
|
+
}, [manager]);
|
|
132
|
+
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
setupDevtools(manager);
|
|
135
|
+
}, [manager]);
|
|
136
|
+
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
const timeout = setTimeout(async () => {
|
|
139
|
+
await Promise.all([
|
|
140
|
+
// TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.
|
|
141
|
+
manager.activate(Events.SetupReactSurface),
|
|
142
|
+
manager.activate(Events.Startup),
|
|
143
|
+
]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return () => clearTimeout(timeout);
|
|
147
|
+
}, [manager]);
|
|
148
|
+
|
|
149
|
+
return useCallback(
|
|
150
|
+
() => (
|
|
151
|
+
<ErrorBoundary fallback={fallback}>
|
|
152
|
+
<PluginManagerProvider value={manager}>
|
|
153
|
+
<RegistryContext.Provider value={manager.registry}>
|
|
154
|
+
<App placeholder={placeholder} state={state} />
|
|
155
|
+
</RegistryContext.Provider>
|
|
156
|
+
</PluginManagerProvider>
|
|
157
|
+
</ErrorBoundary>
|
|
158
|
+
),
|
|
159
|
+
[fallback, manager, placeholder, state],
|
|
110
160
|
);
|
|
111
161
|
};
|
|
112
162
|
|
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Registry } from '@effect-rx/rx-react';
|
|
6
|
+
import { type Schema } from 'effect';
|
|
6
7
|
import { type FC, type PropsWithChildren } from 'react';
|
|
7
8
|
|
|
8
|
-
import { type
|
|
9
|
-
import { type
|
|
9
|
+
import { type ExecutableTool } from '@dxos/ai';
|
|
10
|
+
import { type GraphBuilder, type BuilderExtensions } from '@dxos/app-graph';
|
|
11
|
+
import { type ArtifactDefinition } from '@dxos/artifact';
|
|
10
12
|
import { type Space } from '@dxos/client-protocol';
|
|
11
13
|
import { type RootSettingsStore } from '@dxos/local-storage';
|
|
14
|
+
import { type AnchoredTo } from '@dxos/schema';
|
|
12
15
|
|
|
13
16
|
import { type FileInfo } from './file';
|
|
14
17
|
import { type NodeSerializer } from './graph';
|
|
15
18
|
import { type SurfaceDefinition } from './surface';
|
|
16
19
|
import { type Resource } from './translations';
|
|
17
|
-
import {
|
|
20
|
+
import { type PluginManager, defineCapability } from '../core';
|
|
18
21
|
import { type AnyIntentResolver, type IntentContext } from '../plugin-intent';
|
|
19
22
|
|
|
20
23
|
export namespace Capabilities {
|
|
@@ -22,6 +25,8 @@ export namespace Capabilities {
|
|
|
22
25
|
|
|
23
26
|
export const Null = defineCapability<null>('dxos.org/app-framework/capability/null');
|
|
24
27
|
|
|
28
|
+
export const RxRegistry = defineCapability<Registry.Registry>('dxos.org/app-framework/capability/rx-registry');
|
|
29
|
+
|
|
25
30
|
export type ReactContext = Readonly<{ id: string; dependsOn?: string[]; context: FC<PropsWithChildren> }>;
|
|
26
31
|
export const ReactContext = defineCapability<ReactContext>('dxos.org/app-framework/capability/react-context');
|
|
27
32
|
|
|
@@ -68,7 +73,7 @@ export namespace Capabilities {
|
|
|
68
73
|
'dxos.org/app-framework/capability/app-graph',
|
|
69
74
|
);
|
|
70
75
|
|
|
71
|
-
export const AppGraphBuilder = defineCapability<
|
|
76
|
+
export const AppGraphBuilder = defineCapability<BuilderExtensions>(
|
|
72
77
|
'dxos.org/app-framework/capability/app-graph-builder',
|
|
73
78
|
);
|
|
74
79
|
|
|
@@ -82,7 +87,7 @@ export namespace Capabilities {
|
|
|
82
87
|
// export type Settings = Parameters<RootSettingsStore['createStore']>[0];
|
|
83
88
|
// export type Settings<T extends SettingsValue = SettingsValue> = SettingsProps<T>;
|
|
84
89
|
export type Settings = {
|
|
85
|
-
schema:
|
|
90
|
+
schema: Schema.Schema.All;
|
|
86
91
|
prefix: string;
|
|
87
92
|
value?: Record<string, any>;
|
|
88
93
|
};
|
|
@@ -91,11 +96,17 @@ export namespace Capabilities {
|
|
|
91
96
|
export type Metadata = Readonly<{ id: string; metadata: Record<string, any> }>;
|
|
92
97
|
export const Metadata = defineCapability<Metadata>('dxos.org/app-framework/capability/metadata');
|
|
93
98
|
|
|
94
|
-
export const Tools = defineCapability<
|
|
99
|
+
export const Tools = defineCapability<ExecutableTool[]>('dxos.org/app-framework/capability/tools');
|
|
95
100
|
export const ArtifactDefinition = defineCapability<ArtifactDefinition>(
|
|
96
101
|
'dxos.org/app-framework/capability/artifact-definition',
|
|
97
102
|
);
|
|
98
103
|
|
|
99
104
|
export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;
|
|
100
105
|
export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');
|
|
106
|
+
|
|
107
|
+
type AnchorSort = {
|
|
108
|
+
key: string;
|
|
109
|
+
sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;
|
|
110
|
+
};
|
|
111
|
+
export const AnchorSort = defineCapability<AnchorSort>('dxos.org/app-framework/capability/anchor-sort');
|
|
101
112
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { Expando, Ref
|
|
7
|
+
import { Expando, Ref } from '@dxos/echo-schema';
|
|
8
8
|
|
|
9
9
|
export namespace CollaborationActions {
|
|
10
|
-
export class InsertContent extends
|
|
11
|
-
input:
|
|
12
|
-
|
|
13
|
-
target: Ref(Expando),
|
|
10
|
+
export class InsertContent extends Schema.TaggedClass<InsertContent>()('assistant/intent-content', {
|
|
11
|
+
input: Schema.Struct({
|
|
12
|
+
target: Expando,
|
|
14
13
|
object: Ref(Expando),
|
|
15
|
-
|
|
14
|
+
at: Schema.optional(Schema.String),
|
|
15
|
+
label: Schema.String.pipe(Schema.optional),
|
|
16
16
|
}).annotations({
|
|
17
|
-
|
|
17
|
+
description: 'Enables plugins to inject content blocks or references into a related entity.',
|
|
18
18
|
}),
|
|
19
|
-
output:
|
|
19
|
+
output: Schema.Void,
|
|
20
20
|
}) {}
|
|
21
21
|
}
|
package/src/common/file.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
7
|
// TODO(burdon): See Accept attribute (uses MIME types).
|
|
8
8
|
// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],
|
|
@@ -12,11 +12,11 @@ export const defaultFileTypes = {
|
|
|
12
12
|
text: ['pdf', 'txt', 'md'],
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export const FileInfoSchema =
|
|
16
|
-
name:
|
|
17
|
-
type:
|
|
18
|
-
url:
|
|
19
|
-
cid:
|
|
15
|
+
export const FileInfoSchema = Schema.Struct({
|
|
16
|
+
name: Schema.String,
|
|
17
|
+
type: Schema.String,
|
|
18
|
+
url: Schema.optional(Schema.String),
|
|
19
|
+
cid: Schema.optional(Schema.String), // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export type FileInfo =
|
|
22
|
+
export type FileInfo = Schema.Schema.Type<typeof FileInfoSchema>;
|