@dxos/app-framework 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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-6E7NCZ77.mjs} +23 -23
- package/dist/lib/browser/app-graph-builder-6E7NCZ77.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DVNSCQJ5.mjs → chunk-2KSDY3EZ.mjs} +297 -270
- package/dist/lib/browser/chunk-2KSDY3EZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X2YC645Z.mjs → chunk-K3HOLGVH.mjs} +38 -26
- package/dist/lib/browser/chunk-K3HOLGVH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SFPT4Z2C.mjs → chunk-KPRHX73H.mjs} +9 -9
- package/dist/lib/browser/chunk-KPRHX73H.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/{intent-dispatcher-J7QIFHLO.mjs → intent-dispatcher-VGUJBPPN.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs → intent-resolver-QLFZY5R5.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-XMPVLJOQ.mjs → store-QGVXOY4T.mjs} +7 -6
- package/dist/lib/browser/store-QGVXOY4T.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +7 -3
- 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-4IWMG67O.cjs +146 -0
- package/dist/lib/node/app-graph-builder-4IWMG67O.cjs.map +7 -0
- package/dist/lib/node/{chunk-I3CJYEBC.cjs → chunk-2EBZ2ICH.cjs} +137 -110
- package/dist/lib/node/chunk-2EBZ2ICH.cjs.map +7 -0
- package/dist/lib/node/{chunk-5UOVF3OR.cjs → chunk-7J66KH2T.cjs} +78 -66
- package/dist/lib/node/chunk-7J66KH2T.cjs.map +7 -0
- package/dist/lib/node/{chunk-JUSEAFDU.cjs → chunk-JQMNABMK.cjs} +4 -4
- package/dist/lib/node/chunk-JQMNABMK.cjs.map +7 -0
- package/dist/lib/node/index.cjs +80 -80
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs → intent-dispatcher-TASJBG5M.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-FQPJNKIZ.cjs.map → intent-dispatcher-TASJBG5M.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs → intent-resolver-5CG5NIJY.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-N7JLYYDI.cjs → store-IF3UR2KA.cjs} +10 -9
- package/dist/lib/node/store-IF3UR2KA.cjs.map +7 -0
- package/dist/lib/node/testing/index.cjs +14 -9
- 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-LYCG5CO3.mjs} +23 -23
- package/dist/lib/node-esm/app-graph-builder-LYCG5CO3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GSDBF2CK.mjs → chunk-BOEJMAVK.mjs} +297 -270
- package/dist/lib/node-esm/chunk-BOEJMAVK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QHXUTJHE.mjs → chunk-ISNBS46Y.mjs} +38 -26
- package/dist/lib/node-esm/chunk-ISNBS46Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PHOUQACM.mjs → chunk-JUJF5L4G.mjs} +9 -9
- package/dist/lib/node-esm/chunk-JUJF5L4G.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs → intent-dispatcher-ZUSNX2OY.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs → intent-resolver-NGDHUKDD.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-M2BYJL6K.mjs → store-NCRSE25X.mjs} +7 -6
- package/dist/lib/node-esm/store-NCRSE25X.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +7 -3
- 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 +6 -196
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +14 -7
- 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 +163 -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/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/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 +5 -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 +25 -20
- package/src/App.tsx +14 -2
- package/src/common/capabilities.ts +7 -4
- package/src/common/collaboration.ts +11 -8
- package/src/common/file.ts +7 -7
- package/src/common/layout.ts +148 -136
- package/src/common/translations.ts +7 -7
- package/src/core/capabilities.test.ts +55 -36
- package/src/core/capabilities.ts +77 -57
- package/src/core/manager.test.ts +19 -19
- package/src/core/manager.ts +14 -6
- 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 +1 -1
- 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/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 +11 -3
- package/tsconfig.json +3 -0
- package/typedoc/assets/navigation.js +1 -1
- package/typedoc/assets/search.js +1 -1
- package/typedoc/classes/CollaborationActions.InsertContent.html +280 -241
- 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 +553 -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/createApp.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/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.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-VGUJBPPN.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-QV5MDMDV.mjs.map → intent-resolver-QLFZY5R5.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-PBAOGJS6.cjs.map → intent-resolver-5CG5NIJY.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-QDUGA7NT.mjs.map → intent-dispatcher-ZUSNX2OY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-P7TC5RBD.mjs.map → intent-resolver-NGDHUKDD.mjs.map} +0 -0
|
@@ -2,17 +2,17 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
|
|
3
3
|
// packages/sdk/app-framework/src/plugin-intent/intent-dispatcher.ts
|
|
4
4
|
import { Effect as Effect3, Option, pipe as pipe2, Ref as Ref2 } from "effect";
|
|
5
|
-
import { live as
|
|
5
|
+
import { live as live2 } from "@dxos/live-object";
|
|
6
6
|
import { log as log3 } from "@dxos/log";
|
|
7
7
|
import { byPosition } from "@dxos/util";
|
|
8
8
|
|
|
9
9
|
// packages/sdk/app-framework/src/plugin-intent/actions.ts
|
|
10
|
-
import { Schema as
|
|
10
|
+
import { Schema as Schema2 } from "effect";
|
|
11
11
|
|
|
12
12
|
// packages/sdk/app-framework/src/plugin-intent/intent.ts
|
|
13
|
-
import { Schema
|
|
13
|
+
import { Schema } from "effect";
|
|
14
14
|
var createIntent = (schema, data = {}, params = {}) => {
|
|
15
|
-
const _ =
|
|
15
|
+
const _ = Schema.validateSync(schema.fields.input)(data);
|
|
16
16
|
const intent = {
|
|
17
17
|
...params,
|
|
18
18
|
_schema: schema,
|
|
@@ -47,9 +47,9 @@ var chain = (schema, data = {}, params = {}) => (intent) => {
|
|
|
47
47
|
]
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
var Label =
|
|
51
|
-
ns:
|
|
52
|
-
count:
|
|
50
|
+
var Label = Schema.Union(Schema.String, Schema.mutable(Schema.Tuple(Schema.String, Schema.mutable(Schema.Struct({
|
|
51
|
+
ns: Schema.String,
|
|
52
|
+
count: Schema.optional(Schema.Number)
|
|
53
53
|
})))));
|
|
54
54
|
|
|
55
55
|
// packages/sdk/app-framework/src/plugin-intent/actions.ts
|
|
@@ -57,20 +57,20 @@ var INTENT_PLUGIN = "dxos.org/plugin/intent";
|
|
|
57
57
|
var INTENT_ACTION = `${INTENT_PLUGIN}/action`;
|
|
58
58
|
var IntentAction;
|
|
59
59
|
(function(IntentAction2) {
|
|
60
|
-
class Track extends
|
|
61
|
-
input:
|
|
62
|
-
intents:
|
|
63
|
-
error:
|
|
60
|
+
class Track extends Schema2.TaggedClass()(`${INTENT_ACTION}/track`, {
|
|
61
|
+
input: Schema2.Struct({
|
|
62
|
+
intents: Schema2.Array(Schema2.String),
|
|
63
|
+
error: Schema2.optional(Schema2.String)
|
|
64
64
|
}),
|
|
65
|
-
output:
|
|
65
|
+
output: Schema2.Void
|
|
66
66
|
}) {
|
|
67
67
|
}
|
|
68
68
|
IntentAction2.Track = Track;
|
|
69
|
-
class ShowUndo extends
|
|
70
|
-
input:
|
|
69
|
+
class ShowUndo extends Schema2.TaggedClass()(`${INTENT_ACTION}/show-undo`, {
|
|
70
|
+
input: Schema2.Struct({
|
|
71
71
|
message: Label
|
|
72
72
|
}),
|
|
73
|
-
output:
|
|
73
|
+
output: Schema2.Void
|
|
74
74
|
}) {
|
|
75
75
|
}
|
|
76
76
|
IntentAction2.ShowUndo = ShowUndo;
|
|
@@ -102,11 +102,10 @@ var CycleDetectedError = class extends BaseError {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
// packages/sdk/app-framework/src/core/capabilities.ts
|
|
105
|
-
import {
|
|
105
|
+
import { Rx } from "@effect-rx/rx-react";
|
|
106
106
|
import { Effect } from "effect";
|
|
107
107
|
import { Trigger } from "@dxos/async";
|
|
108
108
|
import { invariant } from "@dxos/invariant";
|
|
109
|
-
import { live } from "@dxos/live-object";
|
|
110
109
|
import { log } from "@dxos/log";
|
|
111
110
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/capabilities.ts";
|
|
112
111
|
var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
|
|
@@ -132,9 +131,33 @@ var lazy = (c) => async (props) => {
|
|
|
132
131
|
const { default: getCapability } = await c();
|
|
133
132
|
return async () => getCapability(props);
|
|
134
133
|
};
|
|
135
|
-
var
|
|
136
|
-
constructor({ activate, reset }) {
|
|
137
|
-
this.
|
|
134
|
+
var PluginContext = class {
|
|
135
|
+
constructor({ registry, activate, reset }) {
|
|
136
|
+
this._capabilityImpls = Rx.family(() => {
|
|
137
|
+
return Rx.make([]).pipe(Rx.keepAlive);
|
|
138
|
+
});
|
|
139
|
+
this._capabilities = Rx.family((id) => {
|
|
140
|
+
return Rx.make((get) => {
|
|
141
|
+
const current = get(this._capabilityImpls(id));
|
|
142
|
+
return current.map((c) => c.implementation);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
this._capability = Rx.family((id) => {
|
|
146
|
+
return Rx.make((get) => {
|
|
147
|
+
const current = get(this._capabilities(id));
|
|
148
|
+
invariant(current.length > 0, `No capability found for ${id}`, {
|
|
149
|
+
F: __dxlog_file,
|
|
150
|
+
L: 117,
|
|
151
|
+
S: this,
|
|
152
|
+
A: [
|
|
153
|
+
"current.length > 0",
|
|
154
|
+
"`No capability found for ${id}`"
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
return current[0];
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
this._registry = registry;
|
|
138
161
|
this.activate = activate;
|
|
139
162
|
this.reset = reset;
|
|
140
163
|
}
|
|
@@ -142,22 +165,22 @@ var PluginsContext = class {
|
|
|
142
165
|
* @internal
|
|
143
166
|
*/
|
|
144
167
|
contributeCapability({ module: moduleId, interface: interfaceDef, implementation }) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
current = untracked(() => object.value);
|
|
151
|
-
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
168
|
+
const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
|
|
169
|
+
const capability = new CapabilityImpl(moduleId, implementation);
|
|
170
|
+
if (current.includes(capability)) {
|
|
171
|
+
return;
|
|
152
172
|
}
|
|
153
|
-
|
|
173
|
+
this._registry.set(this._capabilityImpls(interfaceDef.identifier), [
|
|
174
|
+
...current,
|
|
175
|
+
capability
|
|
176
|
+
]);
|
|
154
177
|
log("capability contributed", {
|
|
155
178
|
id: interfaceDef.identifier,
|
|
156
179
|
moduleId,
|
|
157
|
-
count:
|
|
180
|
+
count: current.length
|
|
158
181
|
}, {
|
|
159
182
|
F: __dxlog_file,
|
|
160
|
-
L:
|
|
183
|
+
L: 161,
|
|
161
184
|
S: this,
|
|
162
185
|
C: (f, a) => f(...a)
|
|
163
186
|
});
|
|
@@ -166,19 +189,19 @@ var PluginsContext = class {
|
|
|
166
189
|
* @internal
|
|
167
190
|
*/
|
|
168
191
|
removeCapability(interfaceDef, implementation) {
|
|
169
|
-
const current = this.
|
|
170
|
-
if (
|
|
192
|
+
const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));
|
|
193
|
+
if (current.length === 0) {
|
|
171
194
|
return;
|
|
172
195
|
}
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
|
|
196
|
+
const next = current.filter((c) => c.implementation !== implementation);
|
|
197
|
+
if (next.length !== current.length) {
|
|
198
|
+
this._registry.set(this._capabilityImpls(interfaceDef.identifier), next);
|
|
176
199
|
log("capability removed", {
|
|
177
200
|
id: interfaceDef.identifier,
|
|
178
|
-
count:
|
|
201
|
+
count: current.length
|
|
179
202
|
}, {
|
|
180
203
|
F: __dxlog_file,
|
|
181
|
-
L:
|
|
204
|
+
L: 180,
|
|
182
205
|
S: this,
|
|
183
206
|
C: (f, a) => f(...a)
|
|
184
207
|
});
|
|
@@ -187,63 +210,64 @@ var PluginsContext = class {
|
|
|
187
210
|
id: interfaceDef.identifier
|
|
188
211
|
}, {
|
|
189
212
|
F: __dxlog_file,
|
|
190
|
-
L:
|
|
213
|
+
L: 182,
|
|
191
214
|
S: this,
|
|
192
215
|
C: (f, a) => f(...a)
|
|
193
216
|
});
|
|
194
217
|
}
|
|
195
218
|
}
|
|
196
219
|
/**
|
|
197
|
-
*
|
|
220
|
+
* Get the Rx reference to the available capabilities for a given interface.
|
|
221
|
+
* Primarily useful for deriving other Rx values based on the capabilities or
|
|
222
|
+
* for subscribing to changes in the capabilities.
|
|
223
|
+
* @returns An Rx reference to the available capabilities.
|
|
224
|
+
*/
|
|
225
|
+
capabilities(interfaceDef) {
|
|
226
|
+
return this._capabilities(interfaceDef.identifier);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get the Rx reference to the available capabilities for a given interface.
|
|
230
|
+
* Primarily useful for deriving other Rx values based on the capability or
|
|
231
|
+
* for subscribing to changes in the capability.
|
|
232
|
+
* @returns An Rx reference to the available capability.
|
|
233
|
+
* @throws If no capability is found.
|
|
234
|
+
*/
|
|
235
|
+
capability(interfaceDef) {
|
|
236
|
+
return this._capability(interfaceDef.identifier);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Get capabilities from the plugin context.
|
|
198
240
|
* @returns An array of capabilities.
|
|
199
|
-
* @reactive
|
|
200
241
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (!current) {
|
|
204
|
-
const object = live({
|
|
205
|
-
value: []
|
|
206
|
-
});
|
|
207
|
-
current = untracked(() => object.value);
|
|
208
|
-
this._definedCapabilities.set(interfaceDef.identifier, current);
|
|
209
|
-
}
|
|
210
|
-
const capabilities = filter ? current.filter((c) => filter(c.implementation, c.moduleId)) : current;
|
|
211
|
-
return capabilities.map((c) => c.implementation);
|
|
242
|
+
getCapabilities(interfaceDef) {
|
|
243
|
+
return this._registry.get(this.capabilities(interfaceDef));
|
|
212
244
|
}
|
|
213
245
|
/**
|
|
214
246
|
* Requests a single capability from the plugin context.
|
|
215
247
|
* @returns The capability.
|
|
216
248
|
* @throws If no capability is found.
|
|
217
|
-
* @reactive
|
|
218
249
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
invariant(capability, `No capability found for ${interfaceDef.identifier}`, {
|
|
222
|
-
F: __dxlog_file,
|
|
223
|
-
L: 203,
|
|
224
|
-
S: this,
|
|
225
|
-
A: [
|
|
226
|
-
"capability",
|
|
227
|
-
"`No capability found for ${interfaceDef.identifier}`"
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
return capability;
|
|
250
|
+
getCapability(interfaceDef) {
|
|
251
|
+
return this._registry.get(this.capability(interfaceDef));
|
|
231
252
|
}
|
|
232
253
|
/**
|
|
233
|
-
* Waits for a capability to be
|
|
254
|
+
* Waits for a capability to be available.
|
|
234
255
|
* @returns The capability.
|
|
235
256
|
*/
|
|
236
|
-
async waitForCapability(interfaceDef
|
|
257
|
+
async waitForCapability(interfaceDef) {
|
|
258
|
+
const [capability] = this.getCapabilities(interfaceDef);
|
|
259
|
+
if (capability) {
|
|
260
|
+
return capability;
|
|
261
|
+
}
|
|
237
262
|
const trigger = new Trigger();
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
if (capabilities[0]) {
|
|
263
|
+
const cancel = this._registry.subscribe(this.capabilities(interfaceDef), (capabilities) => {
|
|
264
|
+
if (capabilities.length > 0) {
|
|
241
265
|
trigger.wake(capabilities[0]);
|
|
242
266
|
}
|
|
243
267
|
});
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
return
|
|
268
|
+
const result = await trigger.wait();
|
|
269
|
+
cancel();
|
|
270
|
+
return result;
|
|
247
271
|
}
|
|
248
272
|
async activatePromise(event) {
|
|
249
273
|
return this.activate(event).pipe(Effect.runPromise);
|
|
@@ -276,25 +300,28 @@ var getEvents = (events) => "type" in events ? events.events : [
|
|
|
276
300
|
];
|
|
277
301
|
|
|
278
302
|
// packages/sdk/app-framework/src/core/manager.ts
|
|
279
|
-
import {
|
|
303
|
+
import { Registry } from "@effect-rx/rx-react";
|
|
304
|
+
import { untracked } from "@preact/signals-core";
|
|
280
305
|
import { Array as A, Effect as Effect2, Either, Match, pipe } from "effect";
|
|
281
306
|
import { Event } from "@dxos/async";
|
|
282
|
-
import { live
|
|
307
|
+
import { live } from "@dxos/live-object";
|
|
283
308
|
import { log as log2 } from "@dxos/log";
|
|
284
309
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/manager.ts";
|
|
285
310
|
var isPromise = (value) => {
|
|
286
311
|
return value !== null && typeof value === "object" && "then" in value;
|
|
287
312
|
};
|
|
288
313
|
var PluginManager = class {
|
|
289
|
-
constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), enabled = [] }) {
|
|
314
|
+
constructor({ pluginLoader, plugins = [], core = plugins.map(({ meta }) => meta.id), enabled = [], registry }) {
|
|
290
315
|
this.activation = new Event();
|
|
291
|
-
this.
|
|
316
|
+
this._capabilities = /* @__PURE__ */ new Map();
|
|
317
|
+
this.registry = registry ?? Registry.make();
|
|
318
|
+
this.context = new PluginContext({
|
|
319
|
+
registry: this.registry,
|
|
292
320
|
activate: (event) => this._activate(event),
|
|
293
321
|
reset: (id) => this._reset(id)
|
|
294
322
|
});
|
|
295
|
-
this._capabilities = /* @__PURE__ */ new Map();
|
|
296
323
|
this._pluginLoader = pluginLoader;
|
|
297
|
-
this._state =
|
|
324
|
+
this._state = live({
|
|
298
325
|
plugins,
|
|
299
326
|
core,
|
|
300
327
|
enabled,
|
|
@@ -368,12 +395,12 @@ var PluginManager = class {
|
|
|
368
395
|
* @param id The id of the plugin.
|
|
369
396
|
*/
|
|
370
397
|
async add(id) {
|
|
371
|
-
return
|
|
398
|
+
return untracked(async () => {
|
|
372
399
|
log2("add plugin", {
|
|
373
400
|
id
|
|
374
401
|
}, {
|
|
375
402
|
F: __dxlog_file2,
|
|
376
|
-
L:
|
|
403
|
+
L: 154,
|
|
377
404
|
S: this,
|
|
378
405
|
C: (f, a) => f(...a)
|
|
379
406
|
});
|
|
@@ -387,12 +414,12 @@ var PluginManager = class {
|
|
|
387
414
|
* @param id The id of the plugin.
|
|
388
415
|
*/
|
|
389
416
|
enable(id) {
|
|
390
|
-
return
|
|
417
|
+
return untracked(async () => {
|
|
391
418
|
log2("enable plugin", {
|
|
392
419
|
id
|
|
393
420
|
}, {
|
|
394
421
|
F: __dxlog_file2,
|
|
395
|
-
L:
|
|
422
|
+
L: 167,
|
|
396
423
|
S: this,
|
|
397
424
|
C: (f, a) => f(...a)
|
|
398
425
|
});
|
|
@@ -413,7 +440,7 @@ var PluginManager = class {
|
|
|
413
440
|
]
|
|
414
441
|
}, {
|
|
415
442
|
F: __dxlog_file2,
|
|
416
|
-
L:
|
|
443
|
+
L: 182,
|
|
417
444
|
S: this,
|
|
418
445
|
C: (f, a) => f(...a)
|
|
419
446
|
});
|
|
@@ -428,12 +455,12 @@ var PluginManager = class {
|
|
|
428
455
|
* @param id The id of the plugin.
|
|
429
456
|
*/
|
|
430
457
|
remove(id) {
|
|
431
|
-
return
|
|
458
|
+
return untracked(() => {
|
|
432
459
|
log2("remove plugin", {
|
|
433
460
|
id
|
|
434
461
|
}, {
|
|
435
462
|
F: __dxlog_file2,
|
|
436
|
-
L:
|
|
463
|
+
L: 200,
|
|
437
464
|
S: this,
|
|
438
465
|
C: (f, a) => f(...a)
|
|
439
466
|
});
|
|
@@ -450,12 +477,12 @@ var PluginManager = class {
|
|
|
450
477
|
* @param id The id of the plugin.
|
|
451
478
|
*/
|
|
452
479
|
disable(id) {
|
|
453
|
-
return
|
|
480
|
+
return untracked(async () => {
|
|
454
481
|
log2("disable plugin", {
|
|
455
482
|
id
|
|
456
483
|
}, {
|
|
457
484
|
F: __dxlog_file2,
|
|
458
|
-
L:
|
|
485
|
+
L: 217,
|
|
459
486
|
S: this,
|
|
460
487
|
C: (f, a) => f(...a)
|
|
461
488
|
});
|
|
@@ -483,7 +510,7 @@ var PluginManager = class {
|
|
|
483
510
|
* @returns Whether the activation was successful.
|
|
484
511
|
*/
|
|
485
512
|
activate(event) {
|
|
486
|
-
return
|
|
513
|
+
return untracked(() => Effect2.runPromise(this._activate(event)));
|
|
487
514
|
}
|
|
488
515
|
/**
|
|
489
516
|
* Deactivates all of the modules for a plugin.
|
|
@@ -491,7 +518,7 @@ var PluginManager = class {
|
|
|
491
518
|
* @returns Whether the deactivation was successful.
|
|
492
519
|
*/
|
|
493
520
|
deactivate(id) {
|
|
494
|
-
return
|
|
521
|
+
return untracked(() => Effect2.runPromise(this._deactivate(id)));
|
|
495
522
|
}
|
|
496
523
|
/**
|
|
497
524
|
* Re-activates the modules that were activated by the event.
|
|
@@ -499,15 +526,15 @@ var PluginManager = class {
|
|
|
499
526
|
* @returns Whether the reset was successful.
|
|
500
527
|
*/
|
|
501
528
|
reset(event) {
|
|
502
|
-
return
|
|
529
|
+
return untracked(() => Effect2.runPromise(this._reset(event)));
|
|
503
530
|
}
|
|
504
531
|
_addPlugin(plugin) {
|
|
505
|
-
|
|
532
|
+
untracked(() => {
|
|
506
533
|
log2("add plugin", {
|
|
507
534
|
id: plugin.meta.id
|
|
508
535
|
}, {
|
|
509
536
|
F: __dxlog_file2,
|
|
510
|
-
L:
|
|
537
|
+
L: 270,
|
|
511
538
|
S: this,
|
|
512
539
|
C: (f, a) => f(...a)
|
|
513
540
|
});
|
|
@@ -517,12 +544,12 @@ var PluginManager = class {
|
|
|
517
544
|
});
|
|
518
545
|
}
|
|
519
546
|
_removePlugin(id) {
|
|
520
|
-
|
|
547
|
+
untracked(() => {
|
|
521
548
|
log2("remove plugin", {
|
|
522
549
|
id
|
|
523
550
|
}, {
|
|
524
551
|
F: __dxlog_file2,
|
|
525
|
-
L:
|
|
552
|
+
L: 279,
|
|
526
553
|
S: this,
|
|
527
554
|
C: (f, a) => f(...a)
|
|
528
555
|
});
|
|
@@ -533,12 +560,12 @@ var PluginManager = class {
|
|
|
533
560
|
});
|
|
534
561
|
}
|
|
535
562
|
_addModule(module) {
|
|
536
|
-
|
|
563
|
+
untracked(() => {
|
|
537
564
|
log2("add module", {
|
|
538
565
|
id: module.id
|
|
539
566
|
}, {
|
|
540
567
|
F: __dxlog_file2,
|
|
541
|
-
L:
|
|
568
|
+
L: 289,
|
|
542
569
|
S: this,
|
|
543
570
|
C: (f, a) => f(...a)
|
|
544
571
|
});
|
|
@@ -548,12 +575,12 @@ var PluginManager = class {
|
|
|
548
575
|
});
|
|
549
576
|
}
|
|
550
577
|
_removeModule(id) {
|
|
551
|
-
|
|
578
|
+
untracked(() => {
|
|
552
579
|
log2("remove module", {
|
|
553
580
|
id
|
|
554
581
|
}, {
|
|
555
582
|
F: __dxlog_file2,
|
|
556
|
-
L:
|
|
583
|
+
L: 298,
|
|
557
584
|
S: this,
|
|
558
585
|
C: (f, a) => f(...a)
|
|
559
586
|
});
|
|
@@ -579,7 +606,7 @@ var PluginManager = class {
|
|
|
579
606
|
return this._getInactiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));
|
|
580
607
|
}
|
|
581
608
|
_setPendingResetByModule(module) {
|
|
582
|
-
return
|
|
609
|
+
return untracked(() => {
|
|
583
610
|
const activationEvents = getEvents(module.activatesOn).map(eventKey).filter((key) => this._state.eventsFired.includes(key));
|
|
584
611
|
const pendingReset = Array.from(new Set(activationEvents)).filter((event) => !this._state.pendingReset.includes(event));
|
|
585
612
|
if (pendingReset.length > 0) {
|
|
@@ -587,7 +614,7 @@ var PluginManager = class {
|
|
|
587
614
|
events: pendingReset
|
|
588
615
|
}, {
|
|
589
616
|
F: __dxlog_file2,
|
|
590
|
-
L:
|
|
617
|
+
L: 336,
|
|
591
618
|
S: this,
|
|
592
619
|
C: (f, a) => f(...a)
|
|
593
620
|
});
|
|
@@ -606,7 +633,7 @@ var PluginManager = class {
|
|
|
606
633
|
key
|
|
607
634
|
}, {
|
|
608
635
|
F: __dxlog_file2,
|
|
609
|
-
L:
|
|
636
|
+
L: 349,
|
|
610
637
|
S: this,
|
|
611
638
|
C: (f, a) => f(...a)
|
|
612
639
|
});
|
|
@@ -627,7 +654,7 @@ var PluginManager = class {
|
|
|
627
654
|
key
|
|
628
655
|
}, {
|
|
629
656
|
F: __dxlog_file2,
|
|
630
|
-
L:
|
|
657
|
+
L: 365,
|
|
631
658
|
S: this,
|
|
632
659
|
C: (f, a) => f(...a)
|
|
633
660
|
});
|
|
@@ -641,7 +668,7 @@ var PluginManager = class {
|
|
|
641
668
|
modules: modules.map((module) => module.id)
|
|
642
669
|
}, {
|
|
643
670
|
F: __dxlog_file2,
|
|
644
|
-
L:
|
|
671
|
+
L: 372,
|
|
645
672
|
S: this,
|
|
646
673
|
C: (f, a) => f(...a)
|
|
647
674
|
});
|
|
@@ -683,7 +710,7 @@ var PluginManager = class {
|
|
|
683
710
|
key
|
|
684
711
|
}, {
|
|
685
712
|
F: __dxlog_file2,
|
|
686
|
-
L:
|
|
713
|
+
L: 406,
|
|
687
714
|
S: this,
|
|
688
715
|
C: (f, a) => f(...a)
|
|
689
716
|
});
|
|
@@ -699,7 +726,7 @@ var PluginManager = class {
|
|
|
699
726
|
module: module.id
|
|
700
727
|
}, {
|
|
701
728
|
F: __dxlog_file2,
|
|
702
|
-
L:
|
|
729
|
+
L: 421,
|
|
703
730
|
S: this,
|
|
704
731
|
C: (f, a) => f(...a)
|
|
705
732
|
});
|
|
@@ -728,7 +755,7 @@ var PluginManager = class {
|
|
|
728
755
|
module: module.id
|
|
729
756
|
}, {
|
|
730
757
|
F: __dxlog_file2,
|
|
731
|
-
L:
|
|
758
|
+
L: 444,
|
|
732
759
|
S: this,
|
|
733
760
|
C: (f, a) => f(...a)
|
|
734
761
|
});
|
|
@@ -757,7 +784,7 @@ var PluginManager = class {
|
|
|
757
784
|
id
|
|
758
785
|
}, {
|
|
759
786
|
F: __dxlog_file2,
|
|
760
|
-
L:
|
|
787
|
+
L: 471,
|
|
761
788
|
S: this,
|
|
762
789
|
C: (f, a) => f(...a)
|
|
763
790
|
});
|
|
@@ -766,7 +793,7 @@ var PluginManager = class {
|
|
|
766
793
|
for (const capability of capabilities) {
|
|
767
794
|
this.context.removeCapability(capability.interface, capability.implementation);
|
|
768
795
|
const program = capability.deactivate?.();
|
|
769
|
-
yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (
|
|
796
|
+
yield* Match.value(program).pipe(Match.when(Effect2.isEffect, (effect) => effect), Match.when(isPromise, (promise) => Effect2.tryPromise({
|
|
770
797
|
try: () => promise,
|
|
771
798
|
catch: (error) => error
|
|
772
799
|
})), Match.orElse((program2) => Effect2.succeed(program2)));
|
|
@@ -781,7 +808,7 @@ var PluginManager = class {
|
|
|
781
808
|
id
|
|
782
809
|
}, {
|
|
783
810
|
F: __dxlog_file2,
|
|
784
|
-
L:
|
|
811
|
+
L: 497,
|
|
785
812
|
S: this,
|
|
786
813
|
C: (f, a) => f(...a)
|
|
787
814
|
});
|
|
@@ -795,7 +822,7 @@ var PluginManager = class {
|
|
|
795
822
|
key
|
|
796
823
|
}, {
|
|
797
824
|
F: __dxlog_file2,
|
|
798
|
-
L:
|
|
825
|
+
L: 505,
|
|
799
826
|
S: this,
|
|
800
827
|
C: (f, a) => f(...a)
|
|
801
828
|
});
|
|
@@ -838,6 +865,7 @@ var Capabilities;
|
|
|
838
865
|
(function(Capabilities2) {
|
|
839
866
|
Capabilities2.PluginManager = defineCapability("dxos.org/app-framework/capability/plugin-manager");
|
|
840
867
|
Capabilities2.Null = defineCapability("dxos.org/app-framework/capability/null");
|
|
868
|
+
Capabilities2.RxRegistry = defineCapability("dxos.org/app-framework/capability/rx-registry");
|
|
841
869
|
Capabilities2.ReactContext = defineCapability("dxos.org/app-framework/capability/react-context");
|
|
842
870
|
Capabilities2.ReactRoot = defineCapability("dxos.org/app-framework/capability/react-root");
|
|
843
871
|
Capabilities2.ReactSurface = defineCapability("dxos.org/app-framework/common/react-surface");
|
|
@@ -857,20 +885,21 @@ var Capabilities;
|
|
|
857
885
|
})(Capabilities || (Capabilities = {}));
|
|
858
886
|
|
|
859
887
|
// packages/sdk/app-framework/src/common/collaboration.ts
|
|
860
|
-
import {
|
|
861
|
-
import { Expando, Ref
|
|
888
|
+
import { Schema as Schema3, SchemaAST } from "effect";
|
|
889
|
+
import { Expando, Ref } from "@dxos/echo-schema";
|
|
890
|
+
import { SpaceId } from "@dxos/keys";
|
|
862
891
|
var CollaborationActions;
|
|
863
892
|
(function(CollaborationActions2) {
|
|
864
|
-
class InsertContent extends
|
|
865
|
-
input:
|
|
866
|
-
spaceId:
|
|
893
|
+
class InsertContent extends Schema3.TaggedClass()("assistant/intent-content", {
|
|
894
|
+
input: Schema3.Struct({
|
|
895
|
+
spaceId: SpaceId,
|
|
867
896
|
target: Ref(Expando),
|
|
868
897
|
object: Ref(Expando),
|
|
869
|
-
label:
|
|
898
|
+
label: Schema3.String.pipe(Schema3.optional)
|
|
870
899
|
}).annotations({
|
|
871
|
-
[
|
|
900
|
+
[SchemaAST.DescriptionAnnotationId]: "Enables plugins to inject content blocks or references into a related entity."
|
|
872
901
|
}),
|
|
873
|
-
output:
|
|
902
|
+
output: Schema3.Void
|
|
874
903
|
}) {
|
|
875
904
|
}
|
|
876
905
|
CollaborationActions2.InsertContent = InsertContent;
|
|
@@ -895,7 +924,7 @@ var Events;
|
|
|
895
924
|
})(Events || (Events = {}));
|
|
896
925
|
|
|
897
926
|
// packages/sdk/app-framework/src/common/file.ts
|
|
898
|
-
import { Schema as
|
|
927
|
+
import { Schema as Schema4 } from "effect";
|
|
899
928
|
var defaultFileTypes = {
|
|
900
929
|
images: [
|
|
901
930
|
"png",
|
|
@@ -915,15 +944,15 @@ var defaultFileTypes = {
|
|
|
915
944
|
"md"
|
|
916
945
|
]
|
|
917
946
|
};
|
|
918
|
-
var FileInfoSchema =
|
|
919
|
-
name:
|
|
920
|
-
type:
|
|
921
|
-
url:
|
|
922
|
-
cid:
|
|
947
|
+
var FileInfoSchema = Schema4.Struct({
|
|
948
|
+
name: Schema4.String,
|
|
949
|
+
type: Schema4.String,
|
|
950
|
+
url: Schema4.optional(Schema4.String),
|
|
951
|
+
cid: Schema4.optional(Schema4.String)
|
|
923
952
|
});
|
|
924
953
|
|
|
925
954
|
// packages/sdk/app-framework/src/common/layout.ts
|
|
926
|
-
import { Schema as
|
|
955
|
+
import { Schema as Schema5 } from "effect";
|
|
927
956
|
|
|
928
957
|
// packages/sdk/app-framework/src/plugin-intent/IntentPlugin.tsx
|
|
929
958
|
var IntentPlugin = () => definePlugin({
|
|
@@ -939,7 +968,7 @@ var IntentPlugin = () => definePlugin({
|
|
|
939
968
|
activatesAfter: [
|
|
940
969
|
Events.DispatcherReady
|
|
941
970
|
],
|
|
942
|
-
activate: lazy(() => import("./intent-dispatcher-
|
|
971
|
+
activate: lazy(() => import("./intent-dispatcher-ZUSNX2OY.mjs"))
|
|
943
972
|
})
|
|
944
973
|
]);
|
|
945
974
|
|
|
@@ -949,323 +978,323 @@ var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
|
949
978
|
var LayoutAction;
|
|
950
979
|
(function(LayoutAction2) {
|
|
951
980
|
LayoutAction2.UPDATE_LAYOUT = `${LAYOUT_ACTION}/update-layout`;
|
|
952
|
-
class UpdateLayout extends
|
|
953
|
-
input:
|
|
954
|
-
part:
|
|
981
|
+
class UpdateLayout extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
982
|
+
input: Schema5.Struct({
|
|
983
|
+
part: Schema5.String.annotations({
|
|
955
984
|
description: "The part of the layout to mutate."
|
|
956
985
|
}),
|
|
957
|
-
subject:
|
|
986
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
958
987
|
description: "The subject of the layout update."
|
|
959
988
|
})),
|
|
960
|
-
options:
|
|
961
|
-
key:
|
|
962
|
-
value:
|
|
989
|
+
options: Schema5.optional(Schema5.Record({
|
|
990
|
+
key: Schema5.String,
|
|
991
|
+
value: Schema5.Any
|
|
963
992
|
}).annotations({
|
|
964
993
|
description: "Additional options for the layout action."
|
|
965
994
|
}))
|
|
966
995
|
}),
|
|
967
|
-
output:
|
|
996
|
+
output: Schema5.Void
|
|
968
997
|
}) {
|
|
969
998
|
}
|
|
970
999
|
LayoutAction2.UpdateLayout = UpdateLayout;
|
|
971
|
-
class SetLayoutMode extends
|
|
972
|
-
input:
|
|
973
|
-
part:
|
|
1000
|
+
class SetLayoutMode extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1001
|
+
input: Schema5.Struct({
|
|
1002
|
+
part: Schema5.Literal("mode").annotations({
|
|
974
1003
|
description: "Setting the layout mode."
|
|
975
1004
|
}),
|
|
976
|
-
subject:
|
|
1005
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
977
1006
|
description: "Item which is the subject of the new layout mode."
|
|
978
1007
|
})),
|
|
979
|
-
options:
|
|
980
|
-
mode:
|
|
1008
|
+
options: Schema5.Union(Schema5.Struct({
|
|
1009
|
+
mode: Schema5.String.annotations({
|
|
981
1010
|
description: "The new layout mode."
|
|
982
1011
|
})
|
|
983
|
-
}),
|
|
984
|
-
revert:
|
|
1012
|
+
}), Schema5.Struct({
|
|
1013
|
+
revert: Schema5.Boolean.annotations({
|
|
985
1014
|
description: "Revert to the previous layout mode."
|
|
986
1015
|
})
|
|
987
1016
|
}))
|
|
988
1017
|
}),
|
|
989
|
-
output:
|
|
1018
|
+
output: Schema5.Void
|
|
990
1019
|
}) {
|
|
991
1020
|
}
|
|
992
1021
|
LayoutAction2.SetLayoutMode = SetLayoutMode;
|
|
993
|
-
class UpdateSidebar extends
|
|
994
|
-
input:
|
|
995
|
-
part:
|
|
1022
|
+
class UpdateSidebar extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1023
|
+
input: Schema5.Struct({
|
|
1024
|
+
part: Schema5.Literal("sidebar").annotations({
|
|
996
1025
|
description: "Updating the sidebar."
|
|
997
1026
|
}),
|
|
998
|
-
subject:
|
|
1027
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
999
1028
|
description: "URI of the component to display in the sidebar."
|
|
1000
1029
|
})),
|
|
1001
|
-
options:
|
|
1002
|
-
state:
|
|
1030
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1031
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
1003
1032
|
description: "Whether the sidebar is closed, collapsed, or expanded."
|
|
1004
1033
|
})
|
|
1005
1034
|
}))
|
|
1006
1035
|
}),
|
|
1007
|
-
output:
|
|
1036
|
+
output: Schema5.Void
|
|
1008
1037
|
}) {
|
|
1009
1038
|
}
|
|
1010
1039
|
LayoutAction2.UpdateSidebar = UpdateSidebar;
|
|
1011
|
-
class UpdateComplementary extends
|
|
1012
|
-
input:
|
|
1013
|
-
part:
|
|
1040
|
+
class UpdateComplementary extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1041
|
+
input: Schema5.Struct({
|
|
1042
|
+
part: Schema5.Literal("complementary").annotations({
|
|
1014
1043
|
description: "Updating the complementary sidebar."
|
|
1015
1044
|
}),
|
|
1016
|
-
subject:
|
|
1045
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1017
1046
|
description: "URI of the component to display in the complementary area."
|
|
1018
1047
|
})),
|
|
1019
|
-
options:
|
|
1020
|
-
state:
|
|
1048
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1049
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
1021
1050
|
description: "Whether the complementary sidebar is closed, collapsed, or expanded."
|
|
1022
1051
|
})
|
|
1023
1052
|
}))
|
|
1024
1053
|
}),
|
|
1025
|
-
output:
|
|
1054
|
+
output: Schema5.Void
|
|
1026
1055
|
}) {
|
|
1027
1056
|
}
|
|
1028
1057
|
LayoutAction2.UpdateComplementary = UpdateComplementary;
|
|
1029
|
-
class UpdateDialog extends
|
|
1030
|
-
input:
|
|
1031
|
-
part:
|
|
1058
|
+
class UpdateDialog extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1059
|
+
input: Schema5.Struct({
|
|
1060
|
+
part: Schema5.Literal("dialog").annotations({
|
|
1032
1061
|
description: "Updating the dialog."
|
|
1033
1062
|
}),
|
|
1034
|
-
subject:
|
|
1063
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1035
1064
|
description: "URI of the component to display in the dialog."
|
|
1036
1065
|
})),
|
|
1037
|
-
options:
|
|
1038
|
-
state:
|
|
1066
|
+
options: Schema5.Struct({
|
|
1067
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1039
1068
|
description: "Whether the dialog is open or closed."
|
|
1040
1069
|
})),
|
|
1041
|
-
blockAlign:
|
|
1070
|
+
blockAlign: Schema5.optional(Schema5.Literal("start", "center", "end").annotations({
|
|
1042
1071
|
description: "The alignment of the dialog."
|
|
1043
1072
|
})),
|
|
1044
|
-
type:
|
|
1073
|
+
type: Schema5.optional(Schema5.Literal("default", "alert").annotations({
|
|
1045
1074
|
description: "The type of dialog."
|
|
1046
1075
|
})),
|
|
1047
|
-
props:
|
|
1048
|
-
key:
|
|
1049
|
-
value:
|
|
1076
|
+
props: Schema5.optional(Schema5.Record({
|
|
1077
|
+
key: Schema5.String,
|
|
1078
|
+
value: Schema5.Any
|
|
1050
1079
|
}).annotations({
|
|
1051
1080
|
description: "Additional props for the dialog."
|
|
1052
1081
|
}))
|
|
1053
1082
|
})
|
|
1054
1083
|
}),
|
|
1055
|
-
output:
|
|
1084
|
+
output: Schema5.Void
|
|
1056
1085
|
}) {
|
|
1057
1086
|
}
|
|
1058
1087
|
LayoutAction2.UpdateDialog = UpdateDialog;
|
|
1059
|
-
class UpdatePopover extends
|
|
1060
|
-
input:
|
|
1061
|
-
part:
|
|
1088
|
+
class UpdatePopover extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1089
|
+
input: Schema5.Struct({
|
|
1090
|
+
part: Schema5.Literal("popover").annotations({
|
|
1062
1091
|
description: "Updating the popover."
|
|
1063
1092
|
}),
|
|
1064
|
-
subject:
|
|
1093
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
1065
1094
|
description: "URI of the component to display in the popover or data to pass to the popover."
|
|
1066
1095
|
})),
|
|
1067
|
-
options:
|
|
1068
|
-
side:
|
|
1096
|
+
options: Schema5.Struct({
|
|
1097
|
+
side: Schema5.optional(Schema5.Literal("top", "right", "bottom", "left").annotations({
|
|
1069
1098
|
description: "The side of the anchor."
|
|
1070
1099
|
})),
|
|
1071
|
-
state:
|
|
1100
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1072
1101
|
description: "Whether the popover is open or closed."
|
|
1073
1102
|
})),
|
|
1074
|
-
props:
|
|
1075
|
-
key:
|
|
1076
|
-
value:
|
|
1103
|
+
props: Schema5.optional(Schema5.Record({
|
|
1104
|
+
key: Schema5.String,
|
|
1105
|
+
value: Schema5.Any
|
|
1077
1106
|
}).annotations({
|
|
1078
1107
|
description: "Additional props for the popover."
|
|
1079
1108
|
}))
|
|
1080
|
-
}).pipe(
|
|
1081
|
-
variant:
|
|
1082
|
-
anchor:
|
|
1109
|
+
}).pipe(Schema5.extend(Schema5.Union(Schema5.Struct({
|
|
1110
|
+
variant: Schema5.Literal("virtual"),
|
|
1111
|
+
anchor: Schema5.Any.annotations({
|
|
1083
1112
|
description: "The DOM element to anchor the popover to."
|
|
1084
1113
|
})
|
|
1085
|
-
}),
|
|
1086
|
-
variant:
|
|
1087
|
-
anchorId:
|
|
1114
|
+
}), Schema5.Struct({
|
|
1115
|
+
variant: Schema5.optional(Schema5.Literal("react")),
|
|
1116
|
+
anchorId: Schema5.String.annotations({
|
|
1088
1117
|
description: "An id that can be used to determine whether to render the anchor subcomponent."
|
|
1089
1118
|
})
|
|
1090
1119
|
}))))
|
|
1091
1120
|
}),
|
|
1092
|
-
output:
|
|
1121
|
+
output: Schema5.Void
|
|
1093
1122
|
}) {
|
|
1094
1123
|
}
|
|
1095
1124
|
LayoutAction2.UpdatePopover = UpdatePopover;
|
|
1096
|
-
LayoutAction2.Toast =
|
|
1097
|
-
id:
|
|
1125
|
+
LayoutAction2.Toast = Schema5.Struct({
|
|
1126
|
+
id: Schema5.String.annotations({
|
|
1098
1127
|
description: "The id of the toast."
|
|
1099
1128
|
}),
|
|
1100
|
-
title:
|
|
1129
|
+
title: Schema5.optional(Label.annotations({
|
|
1101
1130
|
description: "The title of the toast."
|
|
1102
1131
|
})),
|
|
1103
|
-
description:
|
|
1132
|
+
description: Schema5.optional(Label.annotations({
|
|
1104
1133
|
description: "The description of the toast."
|
|
1105
1134
|
})),
|
|
1106
|
-
icon:
|
|
1135
|
+
icon: Schema5.optional(Schema5.String.annotations({
|
|
1107
1136
|
description: "The icon of the toast."
|
|
1108
1137
|
})),
|
|
1109
|
-
duration:
|
|
1138
|
+
duration: Schema5.optional(Schema5.Number.annotations({
|
|
1110
1139
|
description: "The duration of the toast."
|
|
1111
1140
|
})),
|
|
1112
|
-
closeLabel:
|
|
1141
|
+
closeLabel: Schema5.optional(Label.annotations({
|
|
1113
1142
|
description: "The label of the close button."
|
|
1114
1143
|
})),
|
|
1115
|
-
actionLabel:
|
|
1144
|
+
actionLabel: Schema5.optional(Label.annotations({
|
|
1116
1145
|
description: "The label of the action button."
|
|
1117
1146
|
})),
|
|
1118
|
-
actionAlt:
|
|
1147
|
+
actionAlt: Schema5.optional(Label.annotations({
|
|
1119
1148
|
description: "The alt text of the action button."
|
|
1120
1149
|
})),
|
|
1121
|
-
onAction:
|
|
1150
|
+
onAction: Schema5.optional(Schema5.Any.annotations({
|
|
1122
1151
|
description: "The action to perform when the action button is clicked."
|
|
1123
1152
|
}))
|
|
1124
1153
|
});
|
|
1125
|
-
class AddToast extends
|
|
1126
|
-
input:
|
|
1127
|
-
part:
|
|
1154
|
+
class AddToast extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1155
|
+
input: Schema5.Struct({
|
|
1156
|
+
part: Schema5.Literal("toast").annotations({
|
|
1128
1157
|
description: "Adding a toast."
|
|
1129
1158
|
}),
|
|
1130
1159
|
subject: LayoutAction2.Toast.annotations({
|
|
1131
1160
|
description: "The toast to add."
|
|
1132
1161
|
})
|
|
1133
1162
|
}),
|
|
1134
|
-
output:
|
|
1163
|
+
output: Schema5.Void
|
|
1135
1164
|
}) {
|
|
1136
1165
|
}
|
|
1137
1166
|
LayoutAction2.AddToast = AddToast;
|
|
1138
|
-
class SwitchWorkspace extends
|
|
1139
|
-
input:
|
|
1140
|
-
part:
|
|
1167
|
+
class SwitchWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1168
|
+
input: Schema5.Struct({
|
|
1169
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1141
1170
|
description: "Switching the workspace."
|
|
1142
1171
|
}),
|
|
1143
|
-
subject:
|
|
1172
|
+
subject: Schema5.String.annotations({
|
|
1144
1173
|
description: "The id of the workspace to switch to."
|
|
1145
1174
|
})
|
|
1146
1175
|
}),
|
|
1147
|
-
output:
|
|
1176
|
+
output: Schema5.Void
|
|
1148
1177
|
}) {
|
|
1149
1178
|
}
|
|
1150
1179
|
LayoutAction2.SwitchWorkspace = SwitchWorkspace;
|
|
1151
|
-
class RevertWorkspace extends
|
|
1152
|
-
input:
|
|
1153
|
-
part:
|
|
1180
|
+
class RevertWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1181
|
+
input: Schema5.Struct({
|
|
1182
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1154
1183
|
description: "Switching the workspace."
|
|
1155
1184
|
}),
|
|
1156
|
-
options:
|
|
1157
|
-
revert:
|
|
1185
|
+
options: Schema5.Struct({
|
|
1186
|
+
revert: Schema5.Literal(true).annotations({
|
|
1158
1187
|
description: "Revert to the previous workspace."
|
|
1159
1188
|
})
|
|
1160
1189
|
})
|
|
1161
1190
|
}),
|
|
1162
|
-
output:
|
|
1191
|
+
output: Schema5.Void
|
|
1163
1192
|
}) {
|
|
1164
1193
|
}
|
|
1165
1194
|
LayoutAction2.RevertWorkspace = RevertWorkspace;
|
|
1166
|
-
class Open extends
|
|
1167
|
-
input:
|
|
1168
|
-
part:
|
|
1195
|
+
class Open extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1196
|
+
input: Schema5.Struct({
|
|
1197
|
+
part: Schema5.Literal("main").annotations({
|
|
1169
1198
|
description: "Opening an item in the main content area."
|
|
1170
1199
|
}),
|
|
1171
|
-
subject:
|
|
1200
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1172
1201
|
description: "Ids of the items to open."
|
|
1173
1202
|
})),
|
|
1174
|
-
options:
|
|
1175
|
-
state:
|
|
1203
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1204
|
+
state: Schema5.optional(Schema5.Literal(true).annotations({
|
|
1176
1205
|
description: "The items are being added."
|
|
1177
1206
|
})),
|
|
1178
|
-
variant:
|
|
1207
|
+
variant: Schema5.optional(Schema5.String.annotations({
|
|
1179
1208
|
description: "The variant of the item to open."
|
|
1180
1209
|
})),
|
|
1181
|
-
key:
|
|
1210
|
+
key: Schema5.optional(Schema5.String.annotations({
|
|
1182
1211
|
description: "If provided, will replace item with a matching key (id prefix)."
|
|
1183
1212
|
})),
|
|
1184
|
-
workspace:
|
|
1213
|
+
workspace: Schema5.optional(Schema5.String.annotations({
|
|
1185
1214
|
description: "The workspace to open the items in."
|
|
1186
1215
|
})),
|
|
1187
|
-
scrollIntoView:
|
|
1216
|
+
scrollIntoView: Schema5.optional(Schema5.Boolean.annotations({
|
|
1188
1217
|
description: "Scroll the items into view."
|
|
1189
1218
|
})),
|
|
1190
|
-
pivotId:
|
|
1219
|
+
pivotId: Schema5.optional(Schema5.String.annotations({
|
|
1191
1220
|
description: "The id of the item to place new items next to."
|
|
1192
1221
|
})),
|
|
1193
|
-
positioning:
|
|
1222
|
+
positioning: Schema5.optional(Schema5.Union(Schema5.Literal("start").annotations({
|
|
1194
1223
|
description: "The items are being added before the pivot item."
|
|
1195
|
-
}),
|
|
1224
|
+
}), Schema5.Literal("end").annotations({
|
|
1196
1225
|
description: "The items are being added after the pivot item."
|
|
1197
1226
|
})))
|
|
1198
1227
|
}))
|
|
1199
1228
|
}),
|
|
1200
|
-
output:
|
|
1229
|
+
output: Schema5.Void
|
|
1201
1230
|
}) {
|
|
1202
1231
|
}
|
|
1203
1232
|
LayoutAction2.Open = Open;
|
|
1204
|
-
class Set2 extends
|
|
1205
|
-
input:
|
|
1206
|
-
part:
|
|
1233
|
+
class Set2 extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1234
|
+
input: Schema5.Struct({
|
|
1235
|
+
part: Schema5.Literal("main").annotations({
|
|
1207
1236
|
description: "Setting items in the main content area."
|
|
1208
1237
|
}),
|
|
1209
|
-
subject:
|
|
1238
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1210
1239
|
description: "Ids of the items to set."
|
|
1211
1240
|
})),
|
|
1212
|
-
options:
|
|
1213
|
-
override:
|
|
1241
|
+
options: Schema5.Struct({
|
|
1242
|
+
override: Schema5.Literal(true).annotations({
|
|
1214
1243
|
description: "Override the current items in the main content area."
|
|
1215
1244
|
})
|
|
1216
1245
|
})
|
|
1217
1246
|
}),
|
|
1218
|
-
output:
|
|
1247
|
+
output: Schema5.Void
|
|
1219
1248
|
}) {
|
|
1220
1249
|
}
|
|
1221
1250
|
LayoutAction2.Set = Set2;
|
|
1222
|
-
class Close extends
|
|
1223
|
-
input:
|
|
1224
|
-
part:
|
|
1251
|
+
class Close extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1252
|
+
input: Schema5.Struct({
|
|
1253
|
+
part: Schema5.Literal("main").annotations({
|
|
1225
1254
|
description: "Closing items in the main content area."
|
|
1226
1255
|
}),
|
|
1227
|
-
subject:
|
|
1256
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1228
1257
|
description: "Ids of the items to close."
|
|
1229
1258
|
})),
|
|
1230
|
-
options:
|
|
1231
|
-
state:
|
|
1259
|
+
options: Schema5.Struct({
|
|
1260
|
+
state: Schema5.Literal(false).annotations({
|
|
1232
1261
|
description: "The items are being removed."
|
|
1233
1262
|
})
|
|
1234
1263
|
})
|
|
1235
1264
|
}),
|
|
1236
|
-
output:
|
|
1265
|
+
output: Schema5.Void
|
|
1237
1266
|
}) {
|
|
1238
1267
|
}
|
|
1239
1268
|
LayoutAction2.Close = Close;
|
|
1240
|
-
class ScrollIntoView extends
|
|
1241
|
-
input:
|
|
1242
|
-
part:
|
|
1269
|
+
class ScrollIntoView extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1270
|
+
input: Schema5.Struct({
|
|
1271
|
+
part: Schema5.Literal("current").annotations({
|
|
1243
1272
|
description: "Setting the current item"
|
|
1244
1273
|
}),
|
|
1245
|
-
subject:
|
|
1274
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1246
1275
|
description: "The id of the item to set as current."
|
|
1247
1276
|
})),
|
|
1248
|
-
options:
|
|
1249
|
-
key:
|
|
1250
|
-
value:
|
|
1277
|
+
options: Schema5.optional(Schema5.Record({
|
|
1278
|
+
key: Schema5.String,
|
|
1279
|
+
value: Schema5.Any
|
|
1251
1280
|
}).annotations({
|
|
1252
1281
|
description: "Additional options for the scroll into view."
|
|
1253
1282
|
}))
|
|
1254
1283
|
}),
|
|
1255
|
-
output:
|
|
1284
|
+
output: Schema5.Void
|
|
1256
1285
|
}) {
|
|
1257
1286
|
}
|
|
1258
1287
|
LayoutAction2.ScrollIntoView = ScrollIntoView;
|
|
1259
|
-
class Expose extends
|
|
1260
|
-
input:
|
|
1261
|
-
part:
|
|
1288
|
+
class Expose extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1289
|
+
input: Schema5.Struct({
|
|
1290
|
+
part: Schema5.Literal("navigation").annotations({
|
|
1262
1291
|
description: "Exposing an item in the navigation area."
|
|
1263
1292
|
}),
|
|
1264
|
-
subject:
|
|
1293
|
+
subject: Schema5.String.annotations({
|
|
1265
1294
|
description: "The id of the item to expose."
|
|
1266
1295
|
})
|
|
1267
1296
|
}),
|
|
1268
|
-
output:
|
|
1297
|
+
output: Schema5.Void
|
|
1269
1298
|
}) {
|
|
1270
1299
|
}
|
|
1271
1300
|
LayoutAction2.Expose = Expose;
|
|
@@ -1275,17 +1304,17 @@ var LayoutAction;
|
|
|
1275
1304
|
var createSurface = (definition) => definition;
|
|
1276
1305
|
|
|
1277
1306
|
// packages/sdk/app-framework/src/common/translations.ts
|
|
1278
|
-
import { Schema as
|
|
1279
|
-
var ResourceKey =
|
|
1280
|
-
key:
|
|
1281
|
-
value:
|
|
1307
|
+
import { Schema as Schema6 } from "effect";
|
|
1308
|
+
var ResourceKey = Schema6.Union(Schema6.String, Schema6.Record({
|
|
1309
|
+
key: Schema6.String,
|
|
1310
|
+
value: Schema6.Any
|
|
1282
1311
|
}));
|
|
1283
|
-
var ResourceLanguage =
|
|
1284
|
-
key:
|
|
1312
|
+
var ResourceLanguage = Schema6.Record({
|
|
1313
|
+
key: Schema6.String,
|
|
1285
1314
|
value: ResourceKey
|
|
1286
1315
|
});
|
|
1287
|
-
var Resource =
|
|
1288
|
-
key:
|
|
1316
|
+
var Resource = Schema6.Record({
|
|
1317
|
+
key: Schema6.String,
|
|
1289
1318
|
value: ResourceLanguage
|
|
1290
1319
|
});
|
|
1291
1320
|
|
|
@@ -1298,12 +1327,12 @@ var isUndoable = (historyEntry) => historyEntry.length > 0 && historyEntry.every
|
|
|
1298
1327
|
var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {}) => {
|
|
1299
1328
|
const historyRef = Effect3.runSync(Ref2.make([]));
|
|
1300
1329
|
const handleIntent = (intent) => Effect3.gen(function* () {
|
|
1301
|
-
const candidates = getResolvers(
|
|
1330
|
+
const candidates = getResolvers().filter((resolver) => resolver.intent._tag === intent.id).filter((resolver) => !resolver.filter || resolver.filter(intent.data)).toSorted(byPosition);
|
|
1302
1331
|
if (candidates.length === 0) {
|
|
1303
1332
|
yield* Effect3.fail(new NoResolversError(intent.id));
|
|
1304
1333
|
}
|
|
1305
|
-
const
|
|
1306
|
-
const result = Effect3.isEffect(
|
|
1334
|
+
const effect = candidates[0].resolve(intent.data, intent.undo ?? false);
|
|
1335
|
+
const result = Effect3.isEffect(effect) ? yield* effect : yield* Effect3.promise(async () => effect);
|
|
1307
1336
|
return {
|
|
1308
1337
|
_intent: intent,
|
|
1309
1338
|
...result
|
|
@@ -1417,16 +1446,14 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1417
1446
|
var defaultEffect = () => Effect3.fail(new Error("Intent runtime not ready"));
|
|
1418
1447
|
var defaultPromise = () => Effect3.runPromise(defaultEffect());
|
|
1419
1448
|
var intent_dispatcher_default = (context) => {
|
|
1420
|
-
const state =
|
|
1449
|
+
const state = live2({
|
|
1421
1450
|
dispatch: defaultEffect,
|
|
1422
1451
|
dispatchPromise: defaultPromise,
|
|
1423
1452
|
undo: defaultEffect,
|
|
1424
1453
|
undoPromise: defaultPromise
|
|
1425
1454
|
});
|
|
1426
|
-
const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher((
|
|
1427
|
-
|
|
1428
|
-
}).flat());
|
|
1429
|
-
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
1455
|
+
const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher(() => context.getCapabilities(Capabilities.IntentResolver).flat());
|
|
1456
|
+
const manager = context.getCapability(Capabilities.PluginManager);
|
|
1430
1457
|
state.dispatch = (intentChain, depth) => {
|
|
1431
1458
|
return Effect3.gen(function* () {
|
|
1432
1459
|
yield* manager._activate(Events.SetupIntentResolver);
|
|
@@ -1446,7 +1473,7 @@ export {
|
|
|
1446
1473
|
defineCapability,
|
|
1447
1474
|
contributes,
|
|
1448
1475
|
lazy,
|
|
1449
|
-
|
|
1476
|
+
PluginContext,
|
|
1450
1477
|
defineEvent,
|
|
1451
1478
|
eventKey,
|
|
1452
1479
|
oneOf,
|
|
@@ -1482,4 +1509,4 @@ export {
|
|
|
1482
1509
|
ResourceLanguage,
|
|
1483
1510
|
Resource
|
|
1484
1511
|
};
|
|
1485
|
-
//# sourceMappingURL=chunk-
|
|
1512
|
+
//# sourceMappingURL=chunk-BOEJMAVK.mjs.map
|