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