@dxos/app-framework 0.8.1 → 0.8.2-main.2f9c567
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-576BHZC7.mjs → app-graph-builder-FB4NWT25.mjs} +3 -3
- package/dist/lib/browser/{chunk-PPIBZ5N4.mjs → chunk-A7XUUTJN.mjs} +4 -4
- package/dist/lib/browser/chunk-A7XUUTJN.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/{chunk-6AVTZPMT.mjs → chunk-M6UBP7YP.mjs} +204 -173
- package/dist/lib/browser/chunk-M6UBP7YP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -6
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs → intent-dispatcher-SICNXT2G.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-O763LCLG.mjs → intent-resolver-2K6LNSUE.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{store-URSN7DZI.mjs → store-P4XZF26P.mjs} +2 -2
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/worker.mjs +3 -1
- package/dist/lib/node/{app-graph-builder-JZCSKYPY.cjs → app-graph-builder-5QJ6YDE7.cjs} +28 -28
- 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/{chunk-YIFTVCOR.cjs → chunk-LPUJODXZ.cjs} +180 -150
- package/dist/lib/node/chunk-LPUJODXZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-YNTKVTVX.cjs → chunk-MTROSTO7.cjs} +20 -20
- package/dist/lib/node/{chunk-YNTKVTVX.cjs.map → chunk-MTROSTO7.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +80 -78
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs → intent-dispatcher-XXFKXEHF.cjs} +8 -8
- package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs.map → intent-dispatcher-XXFKXEHF.cjs.map} +2 -2
- package/dist/lib/node/{intent-resolver-3F4POWAM.cjs → intent-resolver-ZP6S7QKG.cjs} +12 -12
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{store-OFDHTDCB.cjs → store-MALHSPHZ.cjs} +7 -7
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node/worker.cjs +39 -37
- package/dist/lib/node/worker.cjs.map +2 -2
- package/dist/lib/node-esm/{app-graph-builder-VYKLSMSZ.mjs → app-graph-builder-2KB5VMTB.mjs} +3 -3
- 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/{chunk-R6A7Z4LU.mjs → chunk-MX6ITPIG.mjs} +4 -4
- package/dist/lib/{browser/chunk-PPIBZ5N4.mjs.map → node-esm/chunk-MX6ITPIG.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-AHKIPS2L.mjs → chunk-OZD32CQN.mjs} +204 -173
- package/dist/lib/node-esm/chunk-OZD32CQN.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -6
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs → intent-dispatcher-FF5HNHPQ.mjs} +2 -2
- package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs → intent-resolver-QWIKXIGI.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{store-EYSUVNCS.mjs → store-3NM6AWB4.mjs} +2 -2
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/worker.mjs +3 -1
- package/dist/types/src/common/capabilities.d.ts +2 -2
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/collaboration.d.ts +19 -0
- package/dist/types/src/common/collaboration.d.ts.map +1 -0
- 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 +1 -0
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +164 -158
- package/dist/types/src/common/layout.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 +5 -2
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/events.d.ts +4 -1
- package/dist/types/src/core/events.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +8 -8
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +2 -1
- package/dist/types/src/core/plugin.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 +27 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +12 -12
- 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/package.json +23 -19
- package/project.json +2 -1
- package/src/App.tsx +2 -2
- package/src/common/capabilities.ts +2 -2
- package/src/common/collaboration.ts +22 -0
- package/src/common/file.ts +7 -7
- package/src/common/index.ts +1 -0
- package/src/common/layout.ts +159 -128
- package/src/common/translations.ts +7 -7
- package/src/core/capabilities.ts +9 -5
- package/src/core/events.ts +4 -1
- package/src/core/manager.test.ts +3 -3
- package/src/core/manager.ts +10 -10
- package/src/core/plugin.ts +2 -1
- package/src/playground/generator/generator.ts +4 -4
- package/src/playground/logger/schema.ts +5 -5
- package/src/plugin-intent/actions.ts +9 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +23 -23
- package/src/plugin-intent/intent-dispatcher.ts +18 -2
- package/src/plugin-intent/intent.ts +20 -11
- package/src/plugin-settings/actions.ts +8 -8
- package/typedoc/.nojekyll +1 -0
- package/typedoc/assets/hierarchy.js +1 -0
- package/typedoc/assets/highlight.css +106 -0
- package/typedoc/assets/icons.js +18 -0
- package/typedoc/assets/icons.svg +1 -0
- package/typedoc/assets/main.js +60 -0
- package/typedoc/assets/navigation.js +1 -0
- package/typedoc/assets/search.js +1 -0
- package/typedoc/assets/style.css +1640 -0
- package/typedoc/classes/CollaborationActions.InsertContent.html +460 -0
- package/typedoc/classes/ErrorBoundary.html +125 -0
- package/typedoc/classes/IntentAction.ShowUndo.html +227 -0
- package/typedoc/classes/IntentAction.Track.html +266 -0
- package/typedoc/classes/LayoutAction.AddToast.html +265 -0
- package/typedoc/classes/LayoutAction.Close.html +382 -0
- package/typedoc/classes/LayoutAction.Expose.html +265 -0
- package/typedoc/classes/LayoutAction.Open.html +1123 -0
- package/typedoc/classes/LayoutAction.RevertWorkspace.html +343 -0
- package/typedoc/classes/LayoutAction.ScrollIntoView.html +460 -0
- package/typedoc/classes/LayoutAction.Set.html +460 -0
- package/typedoc/classes/LayoutAction.SetLayoutMode.html +499 -0
- package/typedoc/classes/LayoutAction.SwitchWorkspace.html +265 -0
- package/typedoc/classes/LayoutAction.UpdateComplementary.html +616 -0
- package/typedoc/classes/LayoutAction.UpdateDialog.html +811 -0
- package/typedoc/classes/LayoutAction.UpdateLayout.html +461 -0
- package/typedoc/classes/LayoutAction.UpdatePopover.html +1435 -0
- package/typedoc/classes/LayoutAction.UpdateSidebar.html +616 -0
- package/typedoc/classes/Plugin.html +6 -0
- package/typedoc/classes/PluginManager.html +42 -0
- package/typedoc/classes/PluginModule.html +18 -0
- package/typedoc/classes/PluginsContext.html +25 -0
- package/typedoc/classes/SettingsAction.Open.html +226 -0
- package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +265 -0
- package/typedoc/functions/Events.createStateEvent.html +2 -0
- package/typedoc/functions/IntentPlugin.html +1 -0
- package/typedoc/functions/SettingsPlugin.html +1 -0
- package/typedoc/functions/allOf.html +2 -0
- package/typedoc/functions/chain.html +3 -0
- package/typedoc/functions/contributes.html +2 -0
- package/typedoc/functions/createApp.html +6 -0
- package/typedoc/functions/createDispatcher.html +3 -0
- package/typedoc/functions/createIntent.html +6 -0
- package/typedoc/functions/createResolver.html +2 -0
- package/typedoc/functions/createSurface.html +2 -0
- package/typedoc/functions/defineCapability.html +2 -0
- package/typedoc/functions/defineEvent.html +2 -0
- package/typedoc/functions/defineModule.html +2 -0
- package/typedoc/functions/definePlugin.html +2 -0
- package/typedoc/functions/eventKey.html +2 -0
- package/typedoc/functions/getEvents.html +2 -0
- package/typedoc/functions/isAllOf.html +2 -0
- package/typedoc/functions/isOneOf.html +2 -0
- package/typedoc/functions/isSurfaceAvailable.html +2 -0
- package/typedoc/functions/lazy.html +2 -0
- package/typedoc/functions/oneOf.html +2 -0
- package/typedoc/functions/useAppGraph.html +1 -0
- package/typedoc/functions/useCapabilities.html +3 -0
- package/typedoc/functions/useCapability.html +4 -0
- package/typedoc/functions/useIntentDispatcher.html +1 -0
- package/typedoc/functions/useIntentResolver.html +1 -0
- package/typedoc/functions/useLayout.html +1 -0
- package/typedoc/functions/usePluginManager.html +2 -0
- package/typedoc/hierarchy.html +1 -0
- package/typedoc/index.html +16 -0
- package/typedoc/interfaces/LayoutAction.Toast.html +10 -0
- package/typedoc/media/LICENSE +8 -0
- package/typedoc/modules/Capabilities.html +1 -0
- package/typedoc/modules/CollaborationActions.html +1 -0
- package/typedoc/modules/Events.html +1 -0
- package/typedoc/modules/IntentAction.html +1 -0
- package/typedoc/modules/LayoutAction.html +2 -0
- package/typedoc/modules/SettingsAction.html +1 -0
- package/typedoc/modules.html +1 -0
- package/typedoc/types/ActivationEvent.html +8 -0
- package/typedoc/types/ActivationEvents.html +2 -0
- package/typedoc/types/AnyCapability.html +1 -0
- package/typedoc/types/AnyIntent.html +1 -0
- package/typedoc/types/AnyIntentChain.html +1 -0
- package/typedoc/types/AnyIntentEffectResult.html +1 -0
- package/typedoc/types/AnyIntentResolver.html +1 -0
- package/typedoc/types/AnyIntentResult.html +1 -0
- package/typedoc/types/Capabilities.FileUploader.html +1 -0
- package/typedoc/types/Capabilities.IntentResolver.html +1 -0
- package/typedoc/types/Capabilities.Layout.html +1 -0
- package/typedoc/types/Capabilities.Metadata.html +1 -0
- package/typedoc/types/Capabilities.ReactContext.html +1 -0
- package/typedoc/types/Capabilities.ReactRoot.html +1 -0
- package/typedoc/types/Capabilities.ReactSurface.html +1 -0
- package/typedoc/types/Capabilities.Settings.html +4 -0
- package/typedoc/types/Capability.html +9 -0
- package/typedoc/types/CreateAppOptions.html +9 -0
- package/typedoc/types/FileInfo.html +1 -0
- package/typedoc/types/Intent.html +14 -0
- package/typedoc/types/IntentChain.html +6 -0
- package/typedoc/types/IntentContext.html +5 -0
- package/typedoc/types/IntentData.html +1 -0
- package/typedoc/types/IntentDispatcher.html +2 -0
- package/typedoc/types/IntentDispatcherResult.html +2 -0
- package/typedoc/types/IntentEffectDefinition.html +2 -0
- package/typedoc/types/IntentEffectResult.html +15 -0
- package/typedoc/types/IntentParams.html +3 -0
- package/typedoc/types/IntentResolver.html +2 -0
- package/typedoc/types/IntentResultData.html +1 -0
- package/typedoc/types/IntentSchema.html +1 -0
- package/typedoc/types/IntentUndo.html +2 -0
- package/typedoc/types/InterfaceDef.html +4 -0
- package/typedoc/types/Label.html +1 -0
- package/typedoc/types/NodeSerializer.html +8 -0
- package/typedoc/types/PluginManagerOptions.html +5 -0
- package/typedoc/types/PluginMeta.html +21 -0
- package/typedoc/types/PromiseIntentDispatcher.html +2 -0
- package/typedoc/types/PromiseIntentUndo.html +2 -0
- package/typedoc/types/Resource.html +1 -0
- package/typedoc/types/ResourceKey.html +1 -0
- package/typedoc/types/ResourceLanguage.html +1 -0
- package/typedoc/types/SerializedNode.html +4 -0
- package/typedoc/types/SurfaceComponent.html +2 -0
- package/typedoc/types/SurfaceDefinition.html +2 -0
- package/typedoc/types/SurfaceProps.html +4 -0
- package/typedoc/variables/Capabilities.AppGraph.html +1 -0
- package/typedoc/variables/Capabilities.AppGraphBuilder.html +1 -0
- package/typedoc/variables/Capabilities.AppGraphSerializer.html +1 -0
- package/typedoc/variables/Capabilities.ArtifactDefinition.html +1 -0
- package/typedoc/variables/Capabilities.FileUploader.html +1 -0
- package/typedoc/variables/Capabilities.IntentDispatcher.html +1 -0
- package/typedoc/variables/Capabilities.IntentResolver.html +1 -0
- package/typedoc/variables/Capabilities.Layout.html +1 -0
- package/typedoc/variables/Capabilities.Metadata.html +1 -0
- package/typedoc/variables/Capabilities.Null.html +1 -0
- package/typedoc/variables/Capabilities.PluginManager.html +1 -0
- package/typedoc/variables/Capabilities.ReactContext.html +1 -0
- package/typedoc/variables/Capabilities.ReactRoot.html +1 -0
- package/typedoc/variables/Capabilities.ReactSurface.html +1 -0
- package/typedoc/variables/Capabilities.Settings.html +1 -0
- package/typedoc/variables/Capabilities.SettingsStore.html +1 -0
- package/typedoc/variables/Capabilities.Tools.html +1 -0
- package/typedoc/variables/Capabilities.Translations.html +1 -0
- package/typedoc/variables/Events.AppGraphReady.html +2 -0
- package/typedoc/variables/Events.DispatcherReady.html +2 -0
- package/typedoc/variables/Events.LayoutReady.html +1 -0
- package/typedoc/variables/Events.SettingsReady.html +2 -0
- package/typedoc/variables/Events.SetupAppGraph.html +2 -0
- package/typedoc/variables/Events.SetupArtifactDefinition.html +2 -0
- package/typedoc/variables/Events.SetupIntentResolver.html +2 -0
- package/typedoc/variables/Events.SetupMetadata.html +2 -0
- package/typedoc/variables/Events.SetupReactSurface.html +2 -0
- package/typedoc/variables/Events.SetupSettings.html +2 -0
- package/typedoc/variables/Events.SetupTranslations.html +2 -0
- package/typedoc/variables/Events.Startup.html +2 -0
- package/typedoc/variables/FileInfoSchema.html +1 -0
- package/typedoc/variables/INTENT_ACTION.html +1 -0
- package/typedoc/variables/INTENT_PLUGIN.html +1 -0
- package/typedoc/variables/LAYOUT_ACTION.html +1 -0
- package/typedoc/variables/LAYOUT_PLUGIN.html +1 -0
- package/typedoc/variables/Label.html +1 -0
- package/typedoc/variables/LayoutAction.Toast.html +1 -0
- package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +1 -0
- package/typedoc/variables/PluginManagerProvider.html +2 -0
- package/typedoc/variables/Resource.html +2 -0
- package/typedoc/variables/ResourceKey.html +1 -0
- package/typedoc/variables/ResourceLanguage.html +1 -0
- package/typedoc/variables/SETTINGS_ACTION.html +1 -0
- package/typedoc/variables/SETTINGS_ID.html +1 -0
- package/typedoc/variables/SETTINGS_KEY.html +1 -0
- package/typedoc/variables/SETTINGS_PLUGIN.html +1 -0
- package/typedoc/variables/Surface.html +2 -0
- package/typedoc/variables/defaultFileTypes.html +1 -0
- package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SFPT4Z2C.mjs.map +0 -7
- package/dist/lib/node/chunk-JUSEAFDU.cjs.map +0 -7
- package/dist/lib/node/chunk-YIFTVCOR.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PHOUQACM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-576BHZC7.mjs.map → app-graph-builder-FB4NWT25.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs.map → intent-dispatcher-SICNXT2G.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-O763LCLG.mjs.map → intent-resolver-2K6LNSUE.mjs.map} +0 -0
- /package/dist/lib/browser/{store-URSN7DZI.mjs.map → store-P4XZF26P.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-builder-JZCSKYPY.cjs.map → app-graph-builder-5QJ6YDE7.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-3F4POWAM.cjs.map → intent-resolver-ZP6S7QKG.cjs.map} +0 -0
- /package/dist/lib/node/{store-OFDHTDCB.cjs.map → store-MALHSPHZ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-VYKLSMSZ.mjs.map → app-graph-builder-2KB5VMTB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs.map → intent-dispatcher-FF5HNHPQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs.map → intent-resolver-QWIKXIGI.mjs.map} +0 -0
- /package/dist/lib/node-esm/{store-EYSUVNCS.mjs.map → store-3NM6AWB4.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 } from "effect";
|
|
3
|
-
import {
|
|
2
|
+
import { Effect as Effect3, Option, pipe as pipe2, Ref as Ref2 } from "effect";
|
|
3
|
+
import { live as live3 } 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;
|
|
@@ -104,7 +104,7 @@ 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 {
|
|
107
|
+
import { live } from "@dxos/live-object";
|
|
108
108
|
import { log } from "@dxos/log";
|
|
109
109
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/capabilities.ts";
|
|
110
110
|
var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
|
|
@@ -142,7 +142,7 @@ var PluginsContext = class {
|
|
|
142
142
|
contributeCapability({ module: moduleId, interface: interfaceDef, implementation }) {
|
|
143
143
|
let current = this._definedCapabilities.get(interfaceDef.identifier);
|
|
144
144
|
if (!current) {
|
|
145
|
-
const object =
|
|
145
|
+
const object = live({
|
|
146
146
|
value: []
|
|
147
147
|
});
|
|
148
148
|
current = untracked(() => object.value);
|
|
@@ -155,7 +155,7 @@ var PluginsContext = class {
|
|
|
155
155
|
count: untracked(() => current.length)
|
|
156
156
|
}, {
|
|
157
157
|
F: __dxlog_file,
|
|
158
|
-
L:
|
|
158
|
+
L: 146,
|
|
159
159
|
S: this,
|
|
160
160
|
C: (f, a) => f(...a)
|
|
161
161
|
});
|
|
@@ -176,7 +176,7 @@ var PluginsContext = class {
|
|
|
176
176
|
count: untracked(() => current.length)
|
|
177
177
|
}, {
|
|
178
178
|
F: __dxlog_file,
|
|
179
|
-
L:
|
|
179
|
+
L: 165,
|
|
180
180
|
S: this,
|
|
181
181
|
C: (f, a) => f(...a)
|
|
182
182
|
});
|
|
@@ -185,7 +185,7 @@ var PluginsContext = class {
|
|
|
185
185
|
id: interfaceDef.identifier
|
|
186
186
|
}, {
|
|
187
187
|
F: __dxlog_file,
|
|
188
|
-
L:
|
|
188
|
+
L: 167,
|
|
189
189
|
S: this,
|
|
190
190
|
C: (f, a) => f(...a)
|
|
191
191
|
});
|
|
@@ -199,7 +199,7 @@ var PluginsContext = class {
|
|
|
199
199
|
requestCapabilities(interfaceDef, filter) {
|
|
200
200
|
let current = this._definedCapabilities.get(interfaceDef.identifier);
|
|
201
201
|
if (!current) {
|
|
202
|
-
const object =
|
|
202
|
+
const object = live({
|
|
203
203
|
value: []
|
|
204
204
|
});
|
|
205
205
|
current = untracked(() => object.value);
|
|
@@ -218,7 +218,7 @@ var PluginsContext = class {
|
|
|
218
218
|
const capability = this.requestCapabilities(interfaceDef, filter)[0];
|
|
219
219
|
invariant(capability, `No capability found for ${interfaceDef.identifier}`, {
|
|
220
220
|
F: __dxlog_file,
|
|
221
|
-
L:
|
|
221
|
+
L: 203,
|
|
222
222
|
S: this,
|
|
223
223
|
A: [
|
|
224
224
|
"capability",
|
|
@@ -277,7 +277,7 @@ var getEvents = (events) => "type" in events ? events.events : [
|
|
|
277
277
|
import { untracked as untracked2 } from "@preact/signals-core";
|
|
278
278
|
import { Array as A, Effect as Effect2, Either, Match, pipe } from "effect";
|
|
279
279
|
import { Event } from "@dxos/async";
|
|
280
|
-
import {
|
|
280
|
+
import { live as live2 } from "@dxos/live-object";
|
|
281
281
|
import { log as log2 } from "@dxos/log";
|
|
282
282
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/core/manager.ts";
|
|
283
283
|
var isPromise = (value) => {
|
|
@@ -292,7 +292,7 @@ var PluginManager = class {
|
|
|
292
292
|
});
|
|
293
293
|
this._capabilities = /* @__PURE__ */ new Map();
|
|
294
294
|
this._pluginLoader = pluginLoader;
|
|
295
|
-
this._state =
|
|
295
|
+
this._state = live2({
|
|
296
296
|
plugins,
|
|
297
297
|
core,
|
|
298
298
|
enabled,
|
|
@@ -854,6 +854,26 @@ var Capabilities;
|
|
|
854
854
|
Capabilities2.FileUploader = defineCapability("dxos.org/app-framework/capability/file-uploader");
|
|
855
855
|
})(Capabilities || (Capabilities = {}));
|
|
856
856
|
|
|
857
|
+
// packages/sdk/app-framework/src/common/collaboration.ts
|
|
858
|
+
import { SchemaAST, Schema as Schema3 } from "effect";
|
|
859
|
+
import { Expando, Ref, SpaceIdSchema } from "@dxos/echo-schema";
|
|
860
|
+
var CollaborationActions;
|
|
861
|
+
(function(CollaborationActions2) {
|
|
862
|
+
class InsertContent extends Schema3.TaggedClass()("assistant/intent-content", {
|
|
863
|
+
input: Schema3.Struct({
|
|
864
|
+
spaceId: SpaceIdSchema,
|
|
865
|
+
target: Ref(Expando),
|
|
866
|
+
object: Ref(Expando),
|
|
867
|
+
label: Schema3.String.pipe(Schema3.optional)
|
|
868
|
+
}).annotations({
|
|
869
|
+
[SchemaAST.DescriptionAnnotationId]: "Enables plugins to inject content blocks or references into a related entity."
|
|
870
|
+
}),
|
|
871
|
+
output: Schema3.Void
|
|
872
|
+
}) {
|
|
873
|
+
}
|
|
874
|
+
CollaborationActions2.InsertContent = InsertContent;
|
|
875
|
+
})(CollaborationActions || (CollaborationActions = {}));
|
|
876
|
+
|
|
857
877
|
// packages/sdk/app-framework/src/common/events.ts
|
|
858
878
|
var Events;
|
|
859
879
|
(function(Events2) {
|
|
@@ -873,7 +893,7 @@ var Events;
|
|
|
873
893
|
})(Events || (Events = {}));
|
|
874
894
|
|
|
875
895
|
// packages/sdk/app-framework/src/common/file.ts
|
|
876
|
-
import { Schema as
|
|
896
|
+
import { Schema as Schema4 } from "effect";
|
|
877
897
|
var defaultFileTypes = {
|
|
878
898
|
images: [
|
|
879
899
|
"png",
|
|
@@ -893,15 +913,15 @@ var defaultFileTypes = {
|
|
|
893
913
|
"md"
|
|
894
914
|
]
|
|
895
915
|
};
|
|
896
|
-
var FileInfoSchema =
|
|
897
|
-
name:
|
|
898
|
-
type:
|
|
899
|
-
url:
|
|
900
|
-
cid:
|
|
916
|
+
var FileInfoSchema = Schema4.Struct({
|
|
917
|
+
name: Schema4.String,
|
|
918
|
+
type: Schema4.String,
|
|
919
|
+
url: Schema4.optional(Schema4.String),
|
|
920
|
+
cid: Schema4.optional(Schema4.String)
|
|
901
921
|
});
|
|
902
922
|
|
|
903
923
|
// packages/sdk/app-framework/src/common/layout.ts
|
|
904
|
-
import { Schema as
|
|
924
|
+
import { Schema as Schema5 } from "effect";
|
|
905
925
|
|
|
906
926
|
// packages/sdk/app-framework/src/plugin-intent/IntentPlugin.tsx
|
|
907
927
|
var IntentPlugin = () => definePlugin({
|
|
@@ -917,7 +937,7 @@ var IntentPlugin = () => definePlugin({
|
|
|
917
937
|
activatesAfter: [
|
|
918
938
|
Events.DispatcherReady
|
|
919
939
|
],
|
|
920
|
-
activate: lazy(() => import("./intent-dispatcher-
|
|
940
|
+
activate: lazy(() => import("./intent-dispatcher-SICNXT2G.mjs"))
|
|
921
941
|
})
|
|
922
942
|
]);
|
|
923
943
|
|
|
@@ -927,313 +947,323 @@ var LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;
|
|
|
927
947
|
var LayoutAction;
|
|
928
948
|
(function(LayoutAction2) {
|
|
929
949
|
LayoutAction2.UPDATE_LAYOUT = `${LAYOUT_ACTION}/update-layout`;
|
|
930
|
-
class UpdateLayout extends
|
|
931
|
-
input:
|
|
932
|
-
part:
|
|
950
|
+
class UpdateLayout extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
951
|
+
input: Schema5.Struct({
|
|
952
|
+
part: Schema5.String.annotations({
|
|
933
953
|
description: "The part of the layout to mutate."
|
|
934
954
|
}),
|
|
935
|
-
subject:
|
|
955
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
936
956
|
description: "The subject of the layout update."
|
|
937
957
|
})),
|
|
938
|
-
options:
|
|
939
|
-
key:
|
|
940
|
-
value:
|
|
958
|
+
options: Schema5.optional(Schema5.Record({
|
|
959
|
+
key: Schema5.String,
|
|
960
|
+
value: Schema5.Any
|
|
941
961
|
}).annotations({
|
|
942
962
|
description: "Additional options for the layout action."
|
|
943
963
|
}))
|
|
944
964
|
}),
|
|
945
|
-
output:
|
|
965
|
+
output: Schema5.Void
|
|
946
966
|
}) {
|
|
947
967
|
}
|
|
948
968
|
LayoutAction2.UpdateLayout = UpdateLayout;
|
|
949
|
-
class SetLayoutMode extends
|
|
950
|
-
input:
|
|
951
|
-
part:
|
|
969
|
+
class SetLayoutMode extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
970
|
+
input: Schema5.Struct({
|
|
971
|
+
part: Schema5.Literal("mode").annotations({
|
|
952
972
|
description: "Setting the layout mode."
|
|
953
973
|
}),
|
|
954
|
-
subject:
|
|
974
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
955
975
|
description: "Item which is the subject of the new layout mode."
|
|
956
976
|
})),
|
|
957
|
-
options:
|
|
958
|
-
mode:
|
|
977
|
+
options: Schema5.Union(Schema5.Struct({
|
|
978
|
+
mode: Schema5.String.annotations({
|
|
959
979
|
description: "The new layout mode."
|
|
960
980
|
})
|
|
961
|
-
}),
|
|
962
|
-
revert:
|
|
981
|
+
}), Schema5.Struct({
|
|
982
|
+
revert: Schema5.Boolean.annotations({
|
|
963
983
|
description: "Revert to the previous layout mode."
|
|
964
984
|
})
|
|
965
985
|
}))
|
|
966
986
|
}),
|
|
967
|
-
output:
|
|
987
|
+
output: Schema5.Void
|
|
968
988
|
}) {
|
|
969
989
|
}
|
|
970
990
|
LayoutAction2.SetLayoutMode = SetLayoutMode;
|
|
971
|
-
class UpdateSidebar extends
|
|
972
|
-
input:
|
|
973
|
-
part:
|
|
991
|
+
class UpdateSidebar extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
992
|
+
input: Schema5.Struct({
|
|
993
|
+
part: Schema5.Literal("sidebar").annotations({
|
|
974
994
|
description: "Updating the sidebar."
|
|
975
995
|
}),
|
|
976
|
-
subject:
|
|
996
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
977
997
|
description: "URI of the component to display in the sidebar."
|
|
978
998
|
})),
|
|
979
|
-
options:
|
|
980
|
-
state:
|
|
999
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1000
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
981
1001
|
description: "Whether the sidebar is closed, collapsed, or expanded."
|
|
982
1002
|
})
|
|
983
1003
|
}))
|
|
984
1004
|
}),
|
|
985
|
-
output:
|
|
1005
|
+
output: Schema5.Void
|
|
986
1006
|
}) {
|
|
987
1007
|
}
|
|
988
1008
|
LayoutAction2.UpdateSidebar = UpdateSidebar;
|
|
989
|
-
class UpdateComplementary extends
|
|
990
|
-
input:
|
|
991
|
-
part:
|
|
1009
|
+
class UpdateComplementary extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1010
|
+
input: Schema5.Struct({
|
|
1011
|
+
part: Schema5.Literal("complementary").annotations({
|
|
992
1012
|
description: "Updating the complementary sidebar."
|
|
993
1013
|
}),
|
|
994
|
-
subject:
|
|
1014
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
995
1015
|
description: "URI of the component to display in the complementary area."
|
|
996
1016
|
})),
|
|
997
|
-
options:
|
|
998
|
-
state:
|
|
1017
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1018
|
+
state: Schema5.Literal("closed", "collapsed", "expanded").annotations({
|
|
999
1019
|
description: "Whether the complementary sidebar is closed, collapsed, or expanded."
|
|
1000
1020
|
})
|
|
1001
1021
|
}))
|
|
1002
1022
|
}),
|
|
1003
|
-
output:
|
|
1023
|
+
output: Schema5.Void
|
|
1004
1024
|
}) {
|
|
1005
1025
|
}
|
|
1006
1026
|
LayoutAction2.UpdateComplementary = UpdateComplementary;
|
|
1007
|
-
class UpdateDialog extends
|
|
1008
|
-
input:
|
|
1009
|
-
part:
|
|
1027
|
+
class UpdateDialog extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1028
|
+
input: Schema5.Struct({
|
|
1029
|
+
part: Schema5.Literal("dialog").annotations({
|
|
1010
1030
|
description: "Updating the dialog."
|
|
1011
1031
|
}),
|
|
1012
|
-
subject:
|
|
1032
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1013
1033
|
description: "URI of the component to display in the dialog."
|
|
1014
1034
|
})),
|
|
1015
|
-
options:
|
|
1016
|
-
state:
|
|
1035
|
+
options: Schema5.Struct({
|
|
1036
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1017
1037
|
description: "Whether the dialog is open or closed."
|
|
1018
1038
|
})),
|
|
1019
|
-
blockAlign:
|
|
1039
|
+
blockAlign: Schema5.optional(Schema5.Literal("start", "center", "end").annotations({
|
|
1020
1040
|
description: "The alignment of the dialog."
|
|
1021
1041
|
})),
|
|
1022
|
-
type:
|
|
1042
|
+
type: Schema5.optional(Schema5.Literal("default", "alert").annotations({
|
|
1023
1043
|
description: "The type of dialog."
|
|
1024
1044
|
})),
|
|
1025
|
-
props:
|
|
1026
|
-
key:
|
|
1027
|
-
value:
|
|
1045
|
+
props: Schema5.optional(Schema5.Record({
|
|
1046
|
+
key: Schema5.String,
|
|
1047
|
+
value: Schema5.Any
|
|
1028
1048
|
}).annotations({
|
|
1029
1049
|
description: "Additional props for the dialog."
|
|
1030
1050
|
}))
|
|
1031
1051
|
})
|
|
1032
1052
|
}),
|
|
1033
|
-
output:
|
|
1053
|
+
output: Schema5.Void
|
|
1034
1054
|
}) {
|
|
1035
1055
|
}
|
|
1036
1056
|
LayoutAction2.UpdateDialog = UpdateDialog;
|
|
1037
|
-
class UpdatePopover extends
|
|
1038
|
-
input:
|
|
1039
|
-
part:
|
|
1057
|
+
class UpdatePopover extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1058
|
+
input: Schema5.Struct({
|
|
1059
|
+
part: Schema5.Literal("popover").annotations({
|
|
1040
1060
|
description: "Updating the popover."
|
|
1041
1061
|
}),
|
|
1042
|
-
subject:
|
|
1043
|
-
description: "URI of the component to display in the popover."
|
|
1062
|
+
subject: Schema5.optional(Schema5.Any.annotations({
|
|
1063
|
+
description: "URI of the component to display in the popover or data to pass to the popover."
|
|
1044
1064
|
})),
|
|
1045
|
-
options:
|
|
1046
|
-
|
|
1047
|
-
description: "The id of the element to anchor the popover to."
|
|
1048
|
-
}),
|
|
1049
|
-
side: S4.optional(S4.Literal("top", "right", "bottom", "left").annotations({
|
|
1065
|
+
options: Schema5.Struct({
|
|
1066
|
+
side: Schema5.optional(Schema5.Literal("top", "right", "bottom", "left").annotations({
|
|
1050
1067
|
description: "The side of the anchor."
|
|
1051
1068
|
})),
|
|
1052
|
-
state:
|
|
1069
|
+
state: Schema5.optional(Schema5.Boolean.annotations({
|
|
1053
1070
|
description: "Whether the popover is open or closed."
|
|
1054
1071
|
})),
|
|
1055
|
-
props:
|
|
1056
|
-
key:
|
|
1057
|
-
value:
|
|
1072
|
+
props: Schema5.optional(Schema5.Record({
|
|
1073
|
+
key: Schema5.String,
|
|
1074
|
+
value: Schema5.Any
|
|
1058
1075
|
}).annotations({
|
|
1059
1076
|
description: "Additional props for the popover."
|
|
1060
1077
|
}))
|
|
1061
|
-
})
|
|
1078
|
+
}).pipe(Schema5.extend(Schema5.Union(Schema5.Struct({
|
|
1079
|
+
variant: Schema5.Literal("virtual"),
|
|
1080
|
+
anchor: Schema5.Any.annotations({
|
|
1081
|
+
description: "The DOM element to anchor the popover to."
|
|
1082
|
+
})
|
|
1083
|
+
}), Schema5.Struct({
|
|
1084
|
+
variant: Schema5.optional(Schema5.Literal("react")),
|
|
1085
|
+
anchorId: Schema5.String.annotations({
|
|
1086
|
+
description: "An id that can be used to determine whether to render the anchor subcomponent."
|
|
1087
|
+
})
|
|
1088
|
+
}))))
|
|
1062
1089
|
}),
|
|
1063
|
-
output:
|
|
1090
|
+
output: Schema5.Void
|
|
1064
1091
|
}) {
|
|
1065
1092
|
}
|
|
1066
1093
|
LayoutAction2.UpdatePopover = UpdatePopover;
|
|
1067
|
-
LayoutAction2.Toast =
|
|
1068
|
-
id:
|
|
1094
|
+
LayoutAction2.Toast = Schema5.Struct({
|
|
1095
|
+
id: Schema5.String.annotations({
|
|
1069
1096
|
description: "The id of the toast."
|
|
1070
1097
|
}),
|
|
1071
|
-
title:
|
|
1098
|
+
title: Schema5.optional(Label.annotations({
|
|
1072
1099
|
description: "The title of the toast."
|
|
1073
1100
|
})),
|
|
1074
|
-
description:
|
|
1101
|
+
description: Schema5.optional(Label.annotations({
|
|
1075
1102
|
description: "The description of the toast."
|
|
1076
1103
|
})),
|
|
1077
|
-
icon:
|
|
1104
|
+
icon: Schema5.optional(Schema5.String.annotations({
|
|
1078
1105
|
description: "The icon of the toast."
|
|
1079
1106
|
})),
|
|
1080
|
-
duration:
|
|
1107
|
+
duration: Schema5.optional(Schema5.Number.annotations({
|
|
1081
1108
|
description: "The duration of the toast."
|
|
1082
1109
|
})),
|
|
1083
|
-
closeLabel:
|
|
1110
|
+
closeLabel: Schema5.optional(Label.annotations({
|
|
1084
1111
|
description: "The label of the close button."
|
|
1085
1112
|
})),
|
|
1086
|
-
actionLabel:
|
|
1113
|
+
actionLabel: Schema5.optional(Label.annotations({
|
|
1087
1114
|
description: "The label of the action button."
|
|
1088
1115
|
})),
|
|
1089
|
-
actionAlt:
|
|
1116
|
+
actionAlt: Schema5.optional(Label.annotations({
|
|
1090
1117
|
description: "The alt text of the action button."
|
|
1091
1118
|
})),
|
|
1092
|
-
onAction:
|
|
1119
|
+
onAction: Schema5.optional(Schema5.Any.annotations({
|
|
1093
1120
|
description: "The action to perform when the action button is clicked."
|
|
1094
1121
|
}))
|
|
1095
1122
|
});
|
|
1096
|
-
class AddToast extends
|
|
1097
|
-
input:
|
|
1098
|
-
part:
|
|
1123
|
+
class AddToast extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1124
|
+
input: Schema5.Struct({
|
|
1125
|
+
part: Schema5.Literal("toast").annotations({
|
|
1099
1126
|
description: "Adding a toast."
|
|
1100
1127
|
}),
|
|
1101
1128
|
subject: LayoutAction2.Toast.annotations({
|
|
1102
1129
|
description: "The toast to add."
|
|
1103
1130
|
})
|
|
1104
1131
|
}),
|
|
1105
|
-
output:
|
|
1132
|
+
output: Schema5.Void
|
|
1106
1133
|
}) {
|
|
1107
1134
|
}
|
|
1108
1135
|
LayoutAction2.AddToast = AddToast;
|
|
1109
|
-
class SwitchWorkspace extends
|
|
1110
|
-
input:
|
|
1111
|
-
part:
|
|
1136
|
+
class SwitchWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1137
|
+
input: Schema5.Struct({
|
|
1138
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1112
1139
|
description: "Switching the workspace."
|
|
1113
1140
|
}),
|
|
1114
|
-
subject:
|
|
1141
|
+
subject: Schema5.String.annotations({
|
|
1115
1142
|
description: "The id of the workspace to switch to."
|
|
1116
1143
|
})
|
|
1117
1144
|
}),
|
|
1118
|
-
output:
|
|
1145
|
+
output: Schema5.Void
|
|
1119
1146
|
}) {
|
|
1120
1147
|
}
|
|
1121
1148
|
LayoutAction2.SwitchWorkspace = SwitchWorkspace;
|
|
1122
|
-
class RevertWorkspace extends
|
|
1123
|
-
input:
|
|
1124
|
-
part:
|
|
1149
|
+
class RevertWorkspace extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1150
|
+
input: Schema5.Struct({
|
|
1151
|
+
part: Schema5.Literal("workspace").annotations({
|
|
1125
1152
|
description: "Switching the workspace."
|
|
1126
1153
|
}),
|
|
1127
|
-
options:
|
|
1128
|
-
revert:
|
|
1154
|
+
options: Schema5.Struct({
|
|
1155
|
+
revert: Schema5.Literal(true).annotations({
|
|
1129
1156
|
description: "Revert to the previous workspace."
|
|
1130
1157
|
})
|
|
1131
1158
|
})
|
|
1132
1159
|
}),
|
|
1133
|
-
output:
|
|
1160
|
+
output: Schema5.Void
|
|
1134
1161
|
}) {
|
|
1135
1162
|
}
|
|
1136
1163
|
LayoutAction2.RevertWorkspace = RevertWorkspace;
|
|
1137
|
-
class Open extends
|
|
1138
|
-
input:
|
|
1139
|
-
part:
|
|
1164
|
+
class Open extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1165
|
+
input: Schema5.Struct({
|
|
1166
|
+
part: Schema5.Literal("main").annotations({
|
|
1140
1167
|
description: "Opening an item in the main content area."
|
|
1141
1168
|
}),
|
|
1142
|
-
subject:
|
|
1169
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1143
1170
|
description: "Ids of the items to open."
|
|
1144
1171
|
})),
|
|
1145
|
-
options:
|
|
1146
|
-
state:
|
|
1172
|
+
options: Schema5.optional(Schema5.Struct({
|
|
1173
|
+
state: Schema5.optional(Schema5.Literal(true).annotations({
|
|
1147
1174
|
description: "The items are being added."
|
|
1148
1175
|
})),
|
|
1149
|
-
variant:
|
|
1176
|
+
variant: Schema5.optional(Schema5.String.annotations({
|
|
1150
1177
|
description: "The variant of the item to open."
|
|
1151
1178
|
})),
|
|
1152
|
-
key:
|
|
1179
|
+
key: Schema5.optional(Schema5.String.annotations({
|
|
1153
1180
|
description: "If provided, will replace item with a matching key (id prefix)."
|
|
1154
1181
|
})),
|
|
1155
|
-
|
|
1182
|
+
workspace: Schema5.optional(Schema5.String.annotations({
|
|
1183
|
+
description: "The workspace to open the items in."
|
|
1184
|
+
})),
|
|
1185
|
+
scrollIntoView: Schema5.optional(Schema5.Boolean.annotations({
|
|
1156
1186
|
description: "Scroll the items into view."
|
|
1157
1187
|
})),
|
|
1158
|
-
pivotId:
|
|
1188
|
+
pivotId: Schema5.optional(Schema5.String.annotations({
|
|
1159
1189
|
description: "The id of the item to place new items next to."
|
|
1160
1190
|
})),
|
|
1161
|
-
positioning:
|
|
1191
|
+
positioning: Schema5.optional(Schema5.Union(Schema5.Literal("start").annotations({
|
|
1162
1192
|
description: "The items are being added before the pivot item."
|
|
1163
|
-
}),
|
|
1193
|
+
}), Schema5.Literal("end").annotations({
|
|
1164
1194
|
description: "The items are being added after the pivot item."
|
|
1165
1195
|
})))
|
|
1166
1196
|
}))
|
|
1167
1197
|
}),
|
|
1168
|
-
output:
|
|
1198
|
+
output: Schema5.Void
|
|
1169
1199
|
}) {
|
|
1170
1200
|
}
|
|
1171
1201
|
LayoutAction2.Open = Open;
|
|
1172
|
-
class Set2 extends
|
|
1173
|
-
input:
|
|
1174
|
-
part:
|
|
1202
|
+
class Set2 extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1203
|
+
input: Schema5.Struct({
|
|
1204
|
+
part: Schema5.Literal("main").annotations({
|
|
1175
1205
|
description: "Setting items in the main content area."
|
|
1176
1206
|
}),
|
|
1177
|
-
subject:
|
|
1207
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1178
1208
|
description: "Ids of the items to set."
|
|
1179
1209
|
})),
|
|
1180
|
-
options:
|
|
1181
|
-
override:
|
|
1210
|
+
options: Schema5.Struct({
|
|
1211
|
+
override: Schema5.Literal(true).annotations({
|
|
1182
1212
|
description: "Override the current items in the main content area."
|
|
1183
1213
|
})
|
|
1184
1214
|
})
|
|
1185
1215
|
}),
|
|
1186
|
-
output:
|
|
1216
|
+
output: Schema5.Void
|
|
1187
1217
|
}) {
|
|
1188
1218
|
}
|
|
1189
1219
|
LayoutAction2.Set = Set2;
|
|
1190
|
-
class Close extends
|
|
1191
|
-
input:
|
|
1192
|
-
part:
|
|
1220
|
+
class Close extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1221
|
+
input: Schema5.Struct({
|
|
1222
|
+
part: Schema5.Literal("main").annotations({
|
|
1193
1223
|
description: "Closing items in the main content area."
|
|
1194
1224
|
}),
|
|
1195
|
-
subject:
|
|
1225
|
+
subject: Schema5.Array(Schema5.String.annotations({
|
|
1196
1226
|
description: "Ids of the items to close."
|
|
1197
1227
|
})),
|
|
1198
|
-
options:
|
|
1199
|
-
state:
|
|
1228
|
+
options: Schema5.Struct({
|
|
1229
|
+
state: Schema5.Literal(false).annotations({
|
|
1200
1230
|
description: "The items are being removed."
|
|
1201
1231
|
})
|
|
1202
1232
|
})
|
|
1203
1233
|
}),
|
|
1204
|
-
output:
|
|
1234
|
+
output: Schema5.Void
|
|
1205
1235
|
}) {
|
|
1206
1236
|
}
|
|
1207
1237
|
LayoutAction2.Close = Close;
|
|
1208
|
-
class ScrollIntoView extends
|
|
1209
|
-
input:
|
|
1210
|
-
part:
|
|
1238
|
+
class ScrollIntoView extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1239
|
+
input: Schema5.Struct({
|
|
1240
|
+
part: Schema5.Literal("current").annotations({
|
|
1211
1241
|
description: "Setting the current item"
|
|
1212
1242
|
}),
|
|
1213
|
-
subject:
|
|
1243
|
+
subject: Schema5.optional(Schema5.String.annotations({
|
|
1214
1244
|
description: "The id of the item to set as current."
|
|
1215
1245
|
})),
|
|
1216
|
-
options:
|
|
1217
|
-
key:
|
|
1218
|
-
value:
|
|
1246
|
+
options: Schema5.optional(Schema5.Record({
|
|
1247
|
+
key: Schema5.String,
|
|
1248
|
+
value: Schema5.Any
|
|
1219
1249
|
}).annotations({
|
|
1220
1250
|
description: "Additional options for the scroll into view."
|
|
1221
1251
|
}))
|
|
1222
1252
|
}),
|
|
1223
|
-
output:
|
|
1253
|
+
output: Schema5.Void
|
|
1224
1254
|
}) {
|
|
1225
1255
|
}
|
|
1226
1256
|
LayoutAction2.ScrollIntoView = ScrollIntoView;
|
|
1227
|
-
class Expose extends
|
|
1228
|
-
input:
|
|
1229
|
-
part:
|
|
1257
|
+
class Expose extends Schema5.TaggedClass()(LayoutAction2.UPDATE_LAYOUT, {
|
|
1258
|
+
input: Schema5.Struct({
|
|
1259
|
+
part: Schema5.Literal("navigation").annotations({
|
|
1230
1260
|
description: "Exposing an item in the navigation area."
|
|
1231
1261
|
}),
|
|
1232
|
-
subject:
|
|
1262
|
+
subject: Schema5.String.annotations({
|
|
1233
1263
|
description: "The id of the item to expose."
|
|
1234
1264
|
})
|
|
1235
1265
|
}),
|
|
1236
|
-
output:
|
|
1266
|
+
output: Schema5.Void
|
|
1237
1267
|
}) {
|
|
1238
1268
|
}
|
|
1239
1269
|
LayoutAction2.Expose = Expose;
|
|
@@ -1243,17 +1273,17 @@ var LayoutAction;
|
|
|
1243
1273
|
var createSurface = (definition) => definition;
|
|
1244
1274
|
|
|
1245
1275
|
// packages/sdk/app-framework/src/common/translations.ts
|
|
1246
|
-
import { Schema as
|
|
1247
|
-
var ResourceKey =
|
|
1248
|
-
key:
|
|
1249
|
-
value:
|
|
1276
|
+
import { Schema as Schema6 } from "effect";
|
|
1277
|
+
var ResourceKey = Schema6.Union(Schema6.String, Schema6.Record({
|
|
1278
|
+
key: Schema6.String,
|
|
1279
|
+
value: Schema6.Any
|
|
1250
1280
|
}));
|
|
1251
|
-
var ResourceLanguage =
|
|
1252
|
-
key:
|
|
1281
|
+
var ResourceLanguage = Schema6.Record({
|
|
1282
|
+
key: Schema6.String,
|
|
1253
1283
|
value: ResourceKey
|
|
1254
1284
|
});
|
|
1255
|
-
var Resource =
|
|
1256
|
-
key:
|
|
1285
|
+
var Resource = Schema6.Record({
|
|
1286
|
+
key: Schema6.String,
|
|
1257
1287
|
value: ResourceLanguage
|
|
1258
1288
|
});
|
|
1259
1289
|
|
|
@@ -1264,7 +1294,7 @@ var HISTORY_LIMIT = 100;
|
|
|
1264
1294
|
var createResolver = (resolver) => resolver;
|
|
1265
1295
|
var isUndoable = (historyEntry) => historyEntry.length > 0 && historyEntry.every(({ undoable }) => !!undoable);
|
|
1266
1296
|
var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {}) => {
|
|
1267
|
-
const historyRef = Effect3.runSync(
|
|
1297
|
+
const historyRef = Effect3.runSync(Ref2.make([]));
|
|
1268
1298
|
const handleIntent = (intent) => Effect3.gen(function* () {
|
|
1269
1299
|
const candidates = getResolvers(intent.module).filter((resolver) => resolver.intent._tag === intent.id).filter((resolver) => !resolver.filter || resolver.filter(intent.data)).toSorted(byPosition);
|
|
1270
1300
|
if (candidates.length === 0) {
|
|
@@ -1282,7 +1312,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1282
1312
|
if (depth > executionLimit) {
|
|
1283
1313
|
yield* Effect3.fail(new CycleDetectedError());
|
|
1284
1314
|
}
|
|
1285
|
-
const resultsRef = yield*
|
|
1315
|
+
const resultsRef = yield* Ref2.make([]);
|
|
1286
1316
|
for (const intent of intentChain.all) {
|
|
1287
1317
|
const { data: prev } = (yield* resultsRef.get)[0] ?? {};
|
|
1288
1318
|
const result2 = yield* handleIntent({
|
|
@@ -1292,7 +1322,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1292
1322
|
...prev
|
|
1293
1323
|
}
|
|
1294
1324
|
});
|
|
1295
|
-
yield*
|
|
1325
|
+
yield* Ref2.update(resultsRef, (results2) => [
|
|
1296
1326
|
result2,
|
|
1297
1327
|
...results2
|
|
1298
1328
|
]);
|
|
@@ -1307,7 +1337,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1307
1337
|
}
|
|
1308
1338
|
const results = yield* resultsRef.get;
|
|
1309
1339
|
const result = results[0];
|
|
1310
|
-
yield*
|
|
1340
|
+
yield* Ref2.update(historyRef, (history) => {
|
|
1311
1341
|
const next = [
|
|
1312
1342
|
...history,
|
|
1313
1343
|
results
|
|
@@ -1331,7 +1361,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1331
1361
|
})).catch((error) => {
|
|
1332
1362
|
log3.catch(error, void 0, {
|
|
1333
1363
|
F: __dxlog_file3,
|
|
1334
|
-
L:
|
|
1364
|
+
L: 270,
|
|
1335
1365
|
S: void 0,
|
|
1336
1366
|
C: (f, a) => f(...a)
|
|
1337
1367
|
});
|
|
@@ -1363,7 +1393,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1363
1393
|
last: all.at(-1),
|
|
1364
1394
|
all
|
|
1365
1395
|
};
|
|
1366
|
-
yield*
|
|
1396
|
+
yield* Ref2.update(historyRef, (h) => h.filter((_, index) => index !== last));
|
|
1367
1397
|
return yield* dispatch(intent);
|
|
1368
1398
|
}
|
|
1369
1399
|
});
|
|
@@ -1385,7 +1415,7 @@ var createDispatcher = (getResolvers, { executionLimit = EXECUTION_LIMIT, histor
|
|
|
1385
1415
|
var defaultEffect = () => Effect3.fail(new Error("Intent runtime not ready"));
|
|
1386
1416
|
var defaultPromise = () => Effect3.runPromise(defaultEffect());
|
|
1387
1417
|
var intent_dispatcher_default = (context) => {
|
|
1388
|
-
const state =
|
|
1418
|
+
const state = live3({
|
|
1389
1419
|
dispatch: defaultEffect,
|
|
1390
1420
|
dispatchPromise: defaultPromise,
|
|
1391
1421
|
undo: defaultEffect,
|
|
@@ -1428,6 +1458,7 @@ export {
|
|
|
1428
1458
|
Plugin,
|
|
1429
1459
|
definePlugin,
|
|
1430
1460
|
Capabilities,
|
|
1461
|
+
CollaborationActions,
|
|
1431
1462
|
Events,
|
|
1432
1463
|
defaultFileTypes,
|
|
1433
1464
|
FileInfoSchema,
|
|
@@ -1449,4 +1480,4 @@ export {
|
|
|
1449
1480
|
ResourceLanguage,
|
|
1450
1481
|
Resource
|
|
1451
1482
|
};
|
|
1452
|
-
//# sourceMappingURL=chunk-
|
|
1483
|
+
//# sourceMappingURL=chunk-M6UBP7YP.mjs.map
|