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