@dxos/plugin-settings 0.8.4-main.52d7546f51 → 0.8.4-main.7996785055
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-CCZGWQMT.mjs → app-graph-builder-JD5QCT54.mjs} +7 -7
- package/dist/lib/browser/app-graph-builder-JD5QCT54.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ONAYSYBX.mjs → chunk-WV7AYROT.mjs} +6 -5
- package/dist/lib/browser/chunk-WV7AYROT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/open-MZAFK2IZ.mjs +28 -0
- package/dist/lib/browser/open-MZAFK2IZ.mjs.map +7 -0
- package/dist/lib/browser/open-plugin-registry-UGLESZTR.mjs +26 -0
- package/dist/lib/browser/open-plugin-registry-UGLESZTR.mjs.map +7 -0
- package/dist/lib/browser/operation-handler-FCI3F5DK.mjs +16 -0
- package/dist/lib/browser/operation-handler-FCI3F5DK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-LZWJ45UQ.mjs → app-graph-builder-VM5CLJ4H.mjs} +7 -7
- package/dist/lib/node-esm/app-graph-builder-VM5CLJ4H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TSHGTOLF.mjs → chunk-D7CHCV5B.mjs} +6 -5
- package/dist/lib/node-esm/chunk-D7CHCV5B.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/open-QOPG73Y7.mjs +29 -0
- package/dist/lib/node-esm/open-QOPG73Y7.mjs.map +7 -0
- package/dist/lib/node-esm/open-plugin-registry-MD3Z3M2A.mjs +27 -0
- package/dist/lib/node-esm/open-plugin-registry-MD3Z3M2A.mjs.map +7 -0
- package/dist/lib/node-esm/operation-handler-AYVEPQZN.mjs +18 -0
- package/dist/lib/node-esm/operation-handler-AYVEPQZN.mjs.map +7 -0
- package/dist/types/src/actions.d.ts +5 -5
- package/dist/types/src/actions.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/SettingsPlugin.ts +2 -2
- package/src/actions.ts +5 -3
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +5 -5
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler/index.ts +11 -0
- package/src/capabilities/operation-handler/operation-handler.ts +16 -0
- package/src/meta.ts +1 -1
- package/src/operations/index.ts +10 -0
- package/src/operations/open-plugin-registry.ts +28 -0
- package/src/operations/open.ts +29 -0
- package/dist/lib/browser/app-graph-builder-CCZGWQMT.mjs.map +0 -7
- package/dist/lib/browser/chunk-ONAYSYBX.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-IIUEJRBW.mjs +0 -54
- package/dist/lib/browser/operation-resolver-IIUEJRBW.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-LZWJ45UQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TSHGTOLF.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-QRFPVUSP.mjs +0 -55
- package/dist/lib/node-esm/operation-resolver-QRFPVUSP.mjs.map +0 -7
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/src/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-settings",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.7996785055",
|
|
4
4
|
"description": "DXOS Settings plugin for managing application settings.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
+
"source": "./src/index.ts",
|
|
17
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
18
19
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
-
"source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/src/index.d.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"src"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
33
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
34
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
35
|
-
"@dxos/operation": "0.8.4-main.
|
|
36
|
-
"@dxos/util": "0.8.4-main.
|
|
32
|
+
"@dxos/app-framework": "0.8.4-main.7996785055",
|
|
33
|
+
"@dxos/app-toolkit": "0.8.4-main.7996785055",
|
|
34
|
+
"@dxos/app-graph": "0.8.4-main.7996785055",
|
|
35
|
+
"@dxos/operation": "0.8.4-main.7996785055",
|
|
36
|
+
"@dxos/util": "0.8.4-main.7996785055"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/react": "~19.2.7",
|
|
40
|
-
"effect": "3.
|
|
40
|
+
"effect": "3.20.0",
|
|
41
41
|
"react": "~19.2.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"effect": "3.
|
|
44
|
+
"effect": "3.20.0",
|
|
45
45
|
"react": "~19.2.3"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
package/src/SettingsPlugin.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { OperationHandler, SettingsAppGraphBuilder } from './capabilities';
|
|
9
9
|
import { meta } from './meta';
|
|
10
10
|
import { translations } from './translations';
|
|
11
11
|
|
|
12
12
|
export const SettingsPlugin = Plugin.define(meta).pipe(
|
|
13
13
|
AppPlugin.addAppGraphModule({ activate: SettingsAppGraphBuilder }),
|
|
14
|
-
AppPlugin.
|
|
14
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
15
15
|
AppPlugin.addTranslationsModule({ translations }),
|
|
16
16
|
Plugin.make,
|
|
17
17
|
);
|
package/src/actions.ts
CHANGED
|
@@ -4,20 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { pinnedWorkspaceId } from '@dxos/app-toolkit';
|
|
8
|
+
|
|
7
9
|
import { meta } from './meta';
|
|
8
10
|
|
|
9
|
-
export const SETTINGS_ID = '
|
|
11
|
+
export const SETTINGS_ID = pinnedWorkspaceId('dxos:settings');
|
|
10
12
|
export const SETTINGS_KEY = 'settings';
|
|
11
13
|
|
|
12
14
|
export namespace SettingsAction {
|
|
13
|
-
export class Open extends Schema.TaggedClass<Open>()(`${meta.id}
|
|
15
|
+
export class Open extends Schema.TaggedClass<Open>()(`${meta.id}.open`, {
|
|
14
16
|
input: Schema.Struct({
|
|
15
17
|
plugin: Schema.optional(Schema.String),
|
|
16
18
|
}),
|
|
17
19
|
output: Schema.Void,
|
|
18
20
|
}) {}
|
|
19
21
|
|
|
20
|
-
export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}
|
|
22
|
+
export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}.open-plugin-registry`, {
|
|
21
23
|
input: Schema.Void,
|
|
22
24
|
output: Schema.Void,
|
|
23
25
|
}) {}
|
|
@@ -6,7 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';
|
|
8
8
|
import { GraphBuilder, NodeMatcher } from '@dxos/app-graph';
|
|
9
|
-
import { AppCapabilities, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { AppCapabilities, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
10
10
|
import { Operation } from '@dxos/operation';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@ export default Capability.makeModule(
|
|
|
22
22
|
|
|
23
23
|
const extensions = yield* Effect.all([
|
|
24
24
|
GraphBuilder.createExtension({
|
|
25
|
-
id: `${meta.id}
|
|
25
|
+
id: `${meta.id}.action`,
|
|
26
26
|
match: NodeMatcher.whenRoot,
|
|
27
27
|
actions: () =>
|
|
28
28
|
Effect.succeed([
|
|
@@ -42,7 +42,7 @@ export default Capability.makeModule(
|
|
|
42
42
|
]),
|
|
43
43
|
}),
|
|
44
44
|
GraphBuilder.createExtension({
|
|
45
|
-
id: `${meta.id}
|
|
45
|
+
id: `${meta.id}.core`,
|
|
46
46
|
match: NodeMatcher.whenRoot,
|
|
47
47
|
connector: () =>
|
|
48
48
|
Effect.succeed([
|
|
@@ -60,8 +60,8 @@ export default Capability.makeModule(
|
|
|
60
60
|
]),
|
|
61
61
|
}),
|
|
62
62
|
GraphBuilder.createExtension({
|
|
63
|
-
id: `${meta.id}
|
|
64
|
-
match: NodeMatcher.whenId(SETTINGS_ID),
|
|
63
|
+
id: `${meta.id}.plugins`,
|
|
64
|
+
match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
|
|
65
65
|
connector: (node, get) => {
|
|
66
66
|
const [manager] = get(managerAtom);
|
|
67
67
|
const allSettings = get(settingsAtom);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
|
+
'OperationHandler',
|
|
10
|
+
() => import('./operation-handler'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { SettingsOperationHandlerSet } from '../../operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, SettingsOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
package/src/meta.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =
|
|
14
|
+
SettingsOperation.OpenPluginRegistry.pipe(
|
|
15
|
+
Operation.withHandler(() =>
|
|
16
|
+
Effect.gen(function* () {
|
|
17
|
+
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
18
|
+
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
|
|
19
|
+
yield* Effect.fork(
|
|
20
|
+
invoke(LayoutOperation.Open, {
|
|
21
|
+
subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:plugins`],
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
9
|
+
import { Operation } from '@dxos/operation';
|
|
10
|
+
|
|
11
|
+
import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof SettingsOperation.Open> = SettingsOperation.Open.pipe(
|
|
14
|
+
Operation.withHandler((input) =>
|
|
15
|
+
Effect.gen(function* () {
|
|
16
|
+
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
17
|
+
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
|
|
18
|
+
if (input.plugin) {
|
|
19
|
+
yield* Effect.fork(
|
|
20
|
+
invoke(LayoutOperation.Open, {
|
|
21
|
+
subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default handler;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { AppCapabilities, SettingsOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { isNonNullable } from '@dxos/util';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n const managerAtom = capabilities.atom(Capabilities.PluginManager);\n const settingsAtom = capabilities.atom(AppCapabilities.Settings);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}/action`,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: meta.id,\n data: () => Operation.invoke(SettingsOperation.Open, {}),\n properties: {\n label: ['open settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/core`,\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n {\n id: SETTINGS_ID,\n type: meta.id,\n properties: {\n label: ['app settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'hoist',\n testId: 'treeView.appSettings',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/plugins`,\n match: NodeMatcher.whenId(SETTINGS_ID),\n connector: (node, get) => {\n const [manager] = get(managerAtom);\n const allSettings = get(settingsAtom);\n return Effect.succeed(\n manager\n .getPlugins()\n .map((plugin: Plugin$.Plugin): [Plugin$.Meta, AppCapabilities.Settings] | null => {\n const settings = allSettings.find((s) => s.prefix === plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n );\n },\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAA0C;AACjE,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAK9B,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,WAAWI;AACvC,QAAMC,cAAcF,aAAaG,KAAKC,aAAaC,aAAa;AAChE,QAAMC,eAAeN,aAAaG,KAAKI,gBAAgBC,QAAQ;AAE/D,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBC,SAAS,MACAC,eAAQ;QACb;UACEN,IAAIC,KAAKD;UACTO,MAAM,MAAMC,UAAUC,OAAOC,kBAAkBC,MAAM,CAAC,CAAA;UACtDC,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC7Ce,MAAM;YACNC,aAAa;YACbC,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACL,CAAA;IACArB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBgB,WAAW,MACFd,eAAQ;QACb;UACEN,IAAIqB;UACJC,MAAMrB,KAAKD;UACXY,YAAY;YACVC,OAAO;cAAC;cAAsB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC5Ce,MAAM;YACNC,aAAa;YACbO,UAAU;YACVC,QAAQ;UACV;QACF;OACD;IACL,CAAA;IACA1B,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYsB,OAAOJ,WAAAA;MAC1BD,WAAW,CAACM,MAAMC,QAAAA;AAChB,cAAM,CAACC,OAAAA,IAAWD,IAAItC,WAAAA;AACtB,cAAMwC,cAAcF,IAAIlC,YAAAA;AACxB,eAAca,eACZsB,QACGE,WAAU,EACVC,IAAI,CAACC,WAAAA;AACJ,gBAAMC,WAAWJ,YAAYK,KAAK,CAACC,MAAMA,EAAEC,WAAWJ,OAAO/B,KAAKD,EAAE;AACpE,cAAI,CAACiC,UAAU;AACb,mBAAO;UACT;AAEA,iBAAO;YAACD,OAAO/B;YAAMgC;;QACvB,CAAA,EACCI,OAAOC,aAAAA,EACPP,IAAI,CAAC,CAAC9B,OAAMgC,QAAAA,OAAyD;UACpEjC,IAAI,GAAGuC,YAAAA,IAAgBtC,MAAKD,GAAGwC,WAAW,KAAK,GAAA,CAAA;UAC/ClB,MAAM;UACNf,MAAM0B;UACNrB,YAAY;YACVC,OAAOZ,MAAKwC,QAAQxC,MAAKD;YACzBe,MAAMd,MAAKc,QAAQ;UACrB;QACF,EAAA,CAAA;MAEN;IACF,CAAA;GACD;AAED,SAAO/B,WAAW0D,YAAYhD,gBAAgBiD,iBAAiB/C,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "GraphBuilder", "NodeMatcher", "AppCapabilities", "SettingsOperation", "Operation", "isNonNullable", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "managerAtom", "atom", "Capabilities", "PluginManager", "settingsAtom", "AppCapabilities", "Settings", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "SettingsOperation", "Open", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "position", "testId", "whenId", "node", "get", "manager", "allSettings", "getPlugins", "map", "plugin", "settings", "find", "s", "prefix", "filter", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "contributes", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../src/actions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/settings',\n name: 'Settings',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from './meta';\n\nexport const SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${meta.id}/open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}/open-plugin-registry`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,OAAoB;EAC/BC,IAAI;EACJC,MAAM;AACR;;;ACLA,YAAYC,YAAY;AAIjB,IAAMC,cAAc;AACpB,IAAMC,eAAe;UAEXC,iBAAAA;EACR,MAAMC,aAAoBC,mBAAW,EAAS,GAAGC,KAAKC,EAAE,SAAS;IACtEC,OAAcC,cAAO;MACnBC,QAAeC,gBAAgBC,aAAM;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EAAI;kBALSV,OAAAA;EAON,MAAMW,2BAAkCV,mBAAW,EAAuB,GAAGC,KAAKC,EAAE,yBAAyB;IAClHC,OAAcM;IACdD,QAAeC;EACjB,CAAA,EAAA;EAAI;kBAHSC,qBAAAA;AAIf,GAZiBZ,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["meta", "id", "name", "Schema", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "TaggedClass", "meta", "id", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SETTINGS_ID,
|
|
3
|
-
SETTINGS_KEY
|
|
4
|
-
} from "./chunk-ONAYSYBX.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
-
import { LayoutOperation, SettingsOperation } from "@dxos/app-toolkit";
|
|
10
|
-
import { OperationResolver } from "@dxos/operation";
|
|
11
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
13
|
-
//
|
|
14
|
-
// Open Settings
|
|
15
|
-
//
|
|
16
|
-
OperationResolver.make({
|
|
17
|
-
operation: SettingsOperation.Open,
|
|
18
|
-
handler: (input) => Effect.gen(function* () {
|
|
19
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
20
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
21
|
-
subject: SETTINGS_ID
|
|
22
|
-
});
|
|
23
|
-
if (input.plugin) {
|
|
24
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
25
|
-
subject: [
|
|
26
|
-
`${SETTINGS_KEY}:${input.plugin.replaceAll("/", ":")}`
|
|
27
|
-
]
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
}),
|
|
32
|
-
//
|
|
33
|
-
// Open Plugin Registry
|
|
34
|
-
//
|
|
35
|
-
OperationResolver.make({
|
|
36
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
37
|
-
handler: () => Effect.gen(function* () {
|
|
38
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
39
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
40
|
-
subject: SETTINGS_ID
|
|
41
|
-
});
|
|
42
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
43
|
-
subject: [
|
|
44
|
-
`${SETTINGS_KEY}:plugins`
|
|
45
|
-
]
|
|
46
|
-
}));
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
]);
|
|
50
|
-
}));
|
|
51
|
-
export {
|
|
52
|
-
operation_resolver_default as default
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=operation-resolver-IIUEJRBW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n //\n // Open Settings\n //\n OperationResolver.make({\n operation: SettingsOperation.Open,\n handler: (input) =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n if (input.plugin) {\n // Fire and forget the open operation.\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],\n }),\n );\n }\n }),\n }),\n\n //\n // Open Plugin Registry\n //\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: () =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:plugins`],\n }),\n );\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;;;;IAI5DA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAS,CAACC,UACDC,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AACtE,YAAIR,MAAMS,QAAQ;AAEhB,iBAAcC,YACZR,OAAOG,gBAAgBP,MAAM;YAC3BS,SAAS;cAAC,GAAGI,YAAAA,IAAgBX,MAAMS,OAAOG,WAAW,KAAK,GAAA,CAAA;;UAC5D,CAAA,CAAA;QAEJ;MACF,CAAA;IACJ,CAAA;;;;IAKAlB,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBgB;MAC7Bd,SAAS,MACAE,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AACtE,eAAcE,YACZR,OAAOG,gBAAgBP,MAAM;UAC3BS,SAAS;YAAC,GAAGI,YAAAA;;QACf,CAAA,CAAA;MAEJ,CAAA;IACJ,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "SettingsOperation", "Open", "handler", "input", "gen", "invoke", "get", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "SETTINGS_ID", "plugin", "fork", "SETTINGS_KEY", "replaceAll", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { AppCapabilities, SettingsOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { isNonNullable } from '@dxos/util';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n const managerAtom = capabilities.atom(Capabilities.PluginManager);\n const settingsAtom = capabilities.atom(AppCapabilities.Settings);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}/action`,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: meta.id,\n data: () => Operation.invoke(SettingsOperation.Open, {}),\n properties: {\n label: ['open settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/core`,\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n {\n id: SETTINGS_ID,\n type: meta.id,\n properties: {\n label: ['app settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'hoist',\n testId: 'treeView.appSettings',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/plugins`,\n match: NodeMatcher.whenId(SETTINGS_ID),\n connector: (node, get) => {\n const [manager] = get(managerAtom);\n const allSettings = get(settingsAtom);\n return Effect.succeed(\n manager\n .getPlugins()\n .map((plugin: Plugin$.Plugin): [Plugin$.Meta, AppCapabilities.Settings] | null => {\n const settings = allSettings.find((s) => s.prefix === plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n );\n },\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAA0C;AACjE,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAK9B,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,WAAWI;AACvC,QAAMC,cAAcF,aAAaG,KAAKC,aAAaC,aAAa;AAChE,QAAMC,eAAeN,aAAaG,KAAKI,gBAAgBC,QAAQ;AAE/D,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBC,SAAS,MACAC,eAAQ;QACb;UACEN,IAAIC,KAAKD;UACTO,MAAM,MAAMC,UAAUC,OAAOC,kBAAkBC,MAAM,CAAC,CAAA;UACtDC,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC7Ce,MAAM;YACNC,aAAa;YACbC,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACL,CAAA;IACArB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBgB,WAAW,MACFd,eAAQ;QACb;UACEN,IAAIqB;UACJC,MAAMrB,KAAKD;UACXY,YAAY;YACVC,OAAO;cAAC;cAAsB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC5Ce,MAAM;YACNC,aAAa;YACbO,UAAU;YACVC,QAAQ;UACV;QACF;OACD;IACL,CAAA;IACA1B,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYsB,OAAOJ,WAAAA;MAC1BD,WAAW,CAACM,MAAMC,QAAAA;AAChB,cAAM,CAACC,OAAAA,IAAWD,IAAItC,WAAAA;AACtB,cAAMwC,cAAcF,IAAIlC,YAAAA;AACxB,eAAca,eACZsB,QACGE,WAAU,EACVC,IAAI,CAACC,WAAAA;AACJ,gBAAMC,WAAWJ,YAAYK,KAAK,CAACC,MAAMA,EAAEC,WAAWJ,OAAO/B,KAAKD,EAAE;AACpE,cAAI,CAACiC,UAAU;AACb,mBAAO;UACT;AAEA,iBAAO;YAACD,OAAO/B;YAAMgC;;QACvB,CAAA,EACCI,OAAOC,aAAAA,EACPP,IAAI,CAAC,CAAC9B,OAAMgC,QAAAA,OAAyD;UACpEjC,IAAI,GAAGuC,YAAAA,IAAgBtC,MAAKD,GAAGwC,WAAW,KAAK,GAAA,CAAA;UAC/ClB,MAAM;UACNf,MAAM0B;UACNrB,YAAY;YACVC,OAAOZ,MAAKwC,QAAQxC,MAAKD;YACzBe,MAAMd,MAAKc,QAAQ;UACrB;QACF,EAAA,CAAA;MAEN;IACF,CAAA;GACD;AAED,SAAO/B,WAAW0D,YAAYhD,gBAAgBiD,iBAAiB/C,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "GraphBuilder", "NodeMatcher", "AppCapabilities", "SettingsOperation", "Operation", "isNonNullable", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "managerAtom", "atom", "Capabilities", "PluginManager", "settingsAtom", "AppCapabilities", "Settings", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "SettingsOperation", "Open", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "position", "testId", "whenId", "node", "get", "manager", "allSettings", "getPlugins", "map", "plugin", "settings", "find", "s", "prefix", "filter", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "contributes", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../src/actions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/settings',\n name: 'Settings',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from './meta';\n\nexport const SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${meta.id}/open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}/open-plugin-registry`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,OAAoB;EAC/BC,IAAI;EACJC,MAAM;AACR;;;ACLA,YAAYC,YAAY;AAIjB,IAAMC,cAAc;AACpB,IAAMC,eAAe;UAEXC,iBAAAA;EACR,MAAMC,aAAoBC,mBAAW,EAAS,GAAGC,KAAKC,EAAE,SAAS;IACtEC,OAAcC,cAAO;MACnBC,QAAeC,gBAAgBC,aAAM;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EAAI;kBALSV,OAAAA;EAON,MAAMW,2BAAkCV,mBAAW,EAAuB,GAAGC,KAAKC,EAAE,yBAAyB;IAClHC,OAAcM;IACdD,QAAeC;EACjB,CAAA,EAAA;EAAI;kBAHSC,qBAAAA;AAIf,GAZiBZ,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["meta", "id", "name", "Schema", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "TaggedClass", "meta", "id", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SETTINGS_ID,
|
|
4
|
-
SETTINGS_KEY
|
|
5
|
-
} from "./chunk-TSHGTOLF.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
-
import { LayoutOperation, SettingsOperation } from "@dxos/app-toolkit";
|
|
11
|
-
import { OperationResolver } from "@dxos/operation";
|
|
12
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
14
|
-
//
|
|
15
|
-
// Open Settings
|
|
16
|
-
//
|
|
17
|
-
OperationResolver.make({
|
|
18
|
-
operation: SettingsOperation.Open,
|
|
19
|
-
handler: (input) => Effect.gen(function* () {
|
|
20
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
21
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
22
|
-
subject: SETTINGS_ID
|
|
23
|
-
});
|
|
24
|
-
if (input.plugin) {
|
|
25
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
26
|
-
subject: [
|
|
27
|
-
`${SETTINGS_KEY}:${input.plugin.replaceAll("/", ":")}`
|
|
28
|
-
]
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
}),
|
|
33
|
-
//
|
|
34
|
-
// Open Plugin Registry
|
|
35
|
-
//
|
|
36
|
-
OperationResolver.make({
|
|
37
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
38
|
-
handler: () => Effect.gen(function* () {
|
|
39
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
40
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, {
|
|
41
|
-
subject: SETTINGS_ID
|
|
42
|
-
});
|
|
43
|
-
yield* Effect.fork(invoke(LayoutOperation.Open, {
|
|
44
|
-
subject: [
|
|
45
|
-
`${SETTINGS_KEY}:plugins`
|
|
46
|
-
]
|
|
47
|
-
}));
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
]);
|
|
51
|
-
}));
|
|
52
|
-
export {
|
|
53
|
-
operation_resolver_default as default
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=operation-resolver-QRFPVUSP.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n //\n // Open Settings\n //\n OperationResolver.make({\n operation: SettingsOperation.Open,\n handler: (input) =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n if (input.plugin) {\n // Fire and forget the open operation.\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],\n }),\n );\n }\n }),\n }),\n\n //\n // Open Plugin Registry\n //\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: () =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${SETTINGS_KEY}:plugins`],\n }),\n );\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,yBAAyB;AACnD,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;;;;IAI5DA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAS,CAACC,UACDC,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AACtE,YAAIR,MAAMS,QAAQ;AAEhB,iBAAcC,YACZR,OAAOG,gBAAgBP,MAAM;YAC3BS,SAAS;cAAC,GAAGI,YAAAA,IAAgBX,MAAMS,OAAOG,WAAW,KAAK,GAAA,CAAA;;UAC5D,CAAA,CAAA;QAEJ;MACF,CAAA;IACJ,CAAA;;;;IAKAlB,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBgB;MAC7Bd,SAAS,MACAE,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;AACtE,eAAcE,YACZR,OAAOG,gBAAgBP,MAAM;UAC3BS,SAAS;YAAC,GAAGI,YAAAA;;QACf,CAAA,CAAA;MAEJ,CAAA;IACJ,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "SettingsOperation", "Open", "handler", "input", "gen", "invoke", "get", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "SETTINGS_ID", "plugin", "fork", "SETTINGS_KEY", "replaceAll", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const SettingsOperationResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").OperationResolver[]>>, Error>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,yBAAyB,wJAGrC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.OperationResolver[]>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=operation-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/operation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAM/D,wBAyCE"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
|
-
import { OperationResolver } from '@dxos/operation';
|
|
10
|
-
|
|
11
|
-
import { SETTINGS_ID, SETTINGS_KEY } from '../../actions';
|
|
12
|
-
|
|
13
|
-
export default Capability.makeModule(
|
|
14
|
-
Effect.fnUntraced(function* () {
|
|
15
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
16
|
-
//
|
|
17
|
-
// Open Settings
|
|
18
|
-
//
|
|
19
|
-
OperationResolver.make({
|
|
20
|
-
operation: SettingsOperation.Open,
|
|
21
|
-
handler: (input) =>
|
|
22
|
-
Effect.gen(function* () {
|
|
23
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
24
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });
|
|
25
|
-
if (input.plugin) {
|
|
26
|
-
// Fire and forget the open operation.
|
|
27
|
-
yield* Effect.fork(
|
|
28
|
-
invoke(LayoutOperation.Open, {
|
|
29
|
-
subject: [`${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],
|
|
30
|
-
}),
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
}),
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// Open Plugin Registry
|
|
38
|
-
//
|
|
39
|
-
OperationResolver.make({
|
|
40
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
41
|
-
handler: () =>
|
|
42
|
-
Effect.gen(function* () {
|
|
43
|
-
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
44
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: SETTINGS_ID });
|
|
45
|
-
yield* Effect.fork(
|
|
46
|
-
invoke(LayoutOperation.Open, {
|
|
47
|
-
subject: [`${SETTINGS_KEY}:plugins`],
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
52
|
-
]);
|
|
53
|
-
}),
|
|
54
|
-
);
|