@dxos/plugin-settings 0.9.0 → 0.9.1-main.c7dcc2e112
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/neutral/chunk-6FYMXQBX.mjs +14 -0
- package/dist/lib/neutral/chunk-6FYMXQBX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-P5B3UTFE.mjs +23 -0
- package/dist/lib/neutral/chunk-P5B3UTFE.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +29 -7
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{open-NRUWKEGC.mjs → open-OXJVRO33.mjs} +6 -6
- package/dist/lib/neutral/open-OXJVRO33.mjs.map +7 -0
- package/dist/lib/neutral/{open-plugin-registry-XGFG2JWB.mjs → open-plugin-registry-HWRSVH4V.mjs} +6 -6
- package/dist/lib/neutral/open-plugin-registry-HWRSVH4V.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/actions.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +7 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +14 -0
- package/package.json +10 -9
- package/src/SettingsPlugin.test.ts +1 -1
- package/src/actions.ts +8 -5
- package/src/capabilities/app-graph-builder.ts +15 -11
- package/src/index.ts +1 -1
- package/src/meta.ts +3 -7
- package/src/operations/open-plugin-registry.ts +4 -4
- package/src/operations/open.ts +4 -4
- package/src/translations.ts +3 -3
- package/src/types/index.ts +12 -2
- package/dist/lib/neutral/chunk-3DJRTSII.mjs +0 -16
- package/dist/lib/neutral/chunk-3DJRTSII.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J2FJOTAW.mjs +0 -28
- package/dist/lib/neutral/chunk-J2FJOTAW.mjs.map +0 -7
- package/dist/lib/neutral/open-NRUWKEGC.mjs.map +0 -7
- package/dist/lib/neutral/open-plugin-registry-XGFG2JWB.mjs.map +0 -7
package/dx.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-settings",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1-main.c7dcc2e112",
|
|
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",
|
|
@@ -45,22 +45,23 @@
|
|
|
45
45
|
"types": "dist/types/src/index.d.ts",
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
|
48
|
+
"dx.config.ts",
|
|
48
49
|
"src"
|
|
49
50
|
],
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@dxos/app-framework": "0.9.
|
|
52
|
-
"@dxos/app-
|
|
53
|
-
"@dxos/app-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
52
|
+
"@dxos/app-framework": "0.9.1-main.c7dcc2e112",
|
|
53
|
+
"@dxos/app-graph": "0.9.1-main.c7dcc2e112",
|
|
54
|
+
"@dxos/app-toolkit": "0.9.1-main.c7dcc2e112",
|
|
55
|
+
"@dxos/keys": "0.9.1-main.c7dcc2e112",
|
|
56
|
+
"@dxos/compute": "0.9.1-main.c7dcc2e112",
|
|
57
|
+
"@dxos/react-ui-form": "0.9.1-main.c7dcc2e112",
|
|
58
|
+
"@dxos/util": "0.9.1-main.c7dcc2e112"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@types/react": "~19.2.7",
|
|
61
62
|
"effect": "3.21.3",
|
|
62
63
|
"react": "~19.2.3",
|
|
63
|
-
"@dxos/plugin-graph": "0.9.
|
|
64
|
+
"@dxos/plugin-graph": "0.9.1-main.c7dcc2e112"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"effect": "3.21.3",
|
|
@@ -13,7 +13,7 @@ import { SettingsPlugin } from '#plugin';
|
|
|
13
13
|
|
|
14
14
|
import { meta } from './meta';
|
|
15
15
|
|
|
16
|
-
const moduleId = (name: string) => `${meta.
|
|
16
|
+
const moduleId = (name: string) => `${meta.profile.key}.module.${name}`;
|
|
17
17
|
|
|
18
18
|
describe('SettingsPlugin', () => {
|
|
19
19
|
test('modules activate on the expected events', async ({ expect }) => {
|
package/src/actions.ts
CHANGED
|
@@ -10,15 +10,18 @@ import { SETTINGS_ID, SETTINGS_KEY } from '#types';
|
|
|
10
10
|
export { SETTINGS_ID, SETTINGS_KEY };
|
|
11
11
|
|
|
12
12
|
export namespace SettingsAction {
|
|
13
|
-
export class Open extends Schema.TaggedClass<Open>()(`${meta.
|
|
13
|
+
export class Open extends Schema.TaggedClass<Open>()(`${meta.profile.key}.open`, {
|
|
14
14
|
input: Schema.Struct({
|
|
15
15
|
plugin: Schema.optional(Schema.String),
|
|
16
16
|
}),
|
|
17
17
|
output: Schema.Void,
|
|
18
18
|
}) {}
|
|
19
19
|
|
|
20
|
-
export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(
|
|
21
|
+
`${meta.profile.key}.openPluginRegistry`,
|
|
22
|
+
{
|
|
23
|
+
input: Schema.Void,
|
|
24
|
+
output: Schema.Void,
|
|
25
|
+
},
|
|
26
|
+
) {}
|
|
24
27
|
}
|
|
@@ -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, Node, NodeMatcher } from '@dxos/app-graph';
|
|
9
|
-
import { AppCapabilities,
|
|
9
|
+
import { AppCapabilities, Paths, SettingsOperation } from '@dxos/app-toolkit';
|
|
10
10
|
import { Operation } from '@dxos/compute';
|
|
11
11
|
import { isNonNullable } from '@dxos/util';
|
|
12
12
|
|
|
@@ -31,7 +31,7 @@ export default Capability.makeModule(
|
|
|
31
31
|
id: 'root',
|
|
32
32
|
data: () => Operation.invoke(SettingsOperation.Open, {}),
|
|
33
33
|
properties: {
|
|
34
|
-
label: ['plugin-settings.label', { ns: meta.
|
|
34
|
+
label: ['plugin-settings.label', { ns: meta.profile.key }],
|
|
35
35
|
icon: 'ph--gear--regular',
|
|
36
36
|
disposition: 'menu',
|
|
37
37
|
keyBinding: {
|
|
@@ -49,9 +49,9 @@ export default Capability.makeModule(
|
|
|
49
49
|
Effect.succeed([
|
|
50
50
|
Node.make({
|
|
51
51
|
id: SETTINGS_ID,
|
|
52
|
-
type: meta.
|
|
52
|
+
type: meta.profile.key,
|
|
53
53
|
properties: {
|
|
54
|
-
label: ['plugin-settings.label', { ns: meta.
|
|
54
|
+
label: ['plugin-settings.label', { ns: meta.profile.key }],
|
|
55
55
|
icon: 'ph--gear--regular',
|
|
56
56
|
disposition: 'pin-end',
|
|
57
57
|
position: 'first',
|
|
@@ -62,7 +62,7 @@ export default Capability.makeModule(
|
|
|
62
62
|
}),
|
|
63
63
|
GraphBuilder.createExtension({
|
|
64
64
|
id: 'plugins',
|
|
65
|
-
match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
|
|
65
|
+
match: NodeMatcher.whenId(Paths.getSpacePath(SETTINGS_ID)),
|
|
66
66
|
connector: (node, get) => {
|
|
67
67
|
const [manager] = get(managerAtom);
|
|
68
68
|
const allSettings = get(settingsAtom);
|
|
@@ -70,7 +70,7 @@ export default Capability.makeModule(
|
|
|
70
70
|
manager
|
|
71
71
|
.getPlugins()
|
|
72
72
|
.map((plugin: Plugin$.Plugin): [Plugin$.Meta, AppCapabilities.Settings] | null => {
|
|
73
|
-
const settings = allSettings.find((s) => s.prefix === plugin.meta.
|
|
73
|
+
const settings = allSettings.find((s) => s.prefix === plugin.meta.profile.key);
|
|
74
74
|
if (!settings) {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
@@ -78,16 +78,20 @@ export default Capability.makeModule(
|
|
|
78
78
|
return [plugin.meta, settings];
|
|
79
79
|
})
|
|
80
80
|
.filter(isNonNullable)
|
|
81
|
-
.sort(([a], [b]) =>
|
|
81
|
+
.sort(([a], [b]) =>
|
|
82
|
+
(a.profile.name ?? a.profile.key).localeCompare(b.profile.name ?? b.profile.key, undefined, {
|
|
83
|
+
sensitivity: 'base',
|
|
84
|
+
}),
|
|
85
|
+
)
|
|
82
86
|
.map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) =>
|
|
83
87
|
Node.make({
|
|
84
|
-
id: `${SETTINGS_KEY}:${meta.
|
|
88
|
+
id: `${SETTINGS_KEY}:${meta.profile.key.replaceAll('/', ':')}`,
|
|
85
89
|
type: 'category',
|
|
86
90
|
data: settings,
|
|
87
91
|
properties: {
|
|
88
|
-
label: meta.name ?? meta.
|
|
89
|
-
icon: meta.icon ?? 'ph--circle--regular',
|
|
90
|
-
iconHue: meta.
|
|
92
|
+
label: meta.profile.name ?? meta.profile.key,
|
|
93
|
+
icon: meta.profile.icon?.key ?? 'ph--circle--regular',
|
|
94
|
+
iconHue: meta.profile.icon?.hue,
|
|
91
95
|
},
|
|
92
96
|
}),
|
|
93
97
|
),
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import { DXN } from '@dxos/keys';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
author: 'DXOS',
|
|
12
|
-
tags: ['system'],
|
|
13
|
-
});
|
|
7
|
+
import config from '../dx.config';
|
|
8
|
+
|
|
9
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { LayoutOperation,
|
|
8
|
+
import { LayoutOperation, Paths, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
10
|
|
|
11
|
-
import { SETTINGS_ID,
|
|
11
|
+
import { SETTINGS_ID, getPluginRegistrySectionPath } from '../types';
|
|
12
12
|
|
|
13
13
|
const handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =
|
|
14
14
|
SettingsOperation.OpenPluginRegistry.pipe(
|
|
15
15
|
Operation.withHandler(() =>
|
|
16
16
|
Effect.gen(function* () {
|
|
17
17
|
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
18
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
|
|
18
|
+
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: Paths.getSpacePath(SETTINGS_ID) });
|
|
19
19
|
// Await (don't fork): SwitchWorkspace selects the workspace's first child, so a forked Open
|
|
20
20
|
// races/drops before its deck update applies. Awaiting guarantees the registry is selected.
|
|
21
21
|
yield* invoke(LayoutOperation.Open, {
|
|
22
|
-
subject: [
|
|
22
|
+
subject: [getPluginRegistrySectionPath()],
|
|
23
23
|
});
|
|
24
24
|
}),
|
|
25
25
|
),
|
package/src/operations/open.ts
CHANGED
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { LayoutOperation,
|
|
8
|
+
import { LayoutOperation, Paths, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
9
|
import { Operation } from '@dxos/compute';
|
|
10
10
|
|
|
11
|
-
import { SETTINGS_ID,
|
|
11
|
+
import { SETTINGS_ID, getPluginSettingsSectionPath } from '../types';
|
|
12
12
|
|
|
13
13
|
const handler: Operation.WithHandler<typeof SettingsOperation.Open> = SettingsOperation.Open.pipe(
|
|
14
14
|
Operation.withHandler((input) =>
|
|
15
15
|
Effect.gen(function* () {
|
|
16
16
|
const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
|
|
17
|
-
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
|
|
17
|
+
yield* invoke(LayoutOperation.SwitchWorkspace, { subject: Paths.getSpacePath(SETTINGS_ID) });
|
|
18
18
|
if (input.plugin) {
|
|
19
19
|
// Await (don't fork): SwitchWorkspace already selects the workspace's first child, so a
|
|
20
20
|
// forked Open for the requested plugin races/drops before its deck update applies, leaving
|
|
21
21
|
// the wrong plugin selected. Awaiting guarantees the requested plugin becomes the selection.
|
|
22
22
|
yield* invoke(LayoutOperation.Open, {
|
|
23
|
-
subject: [
|
|
23
|
+
subject: [getPluginSettingsSectionPath(input.plugin)],
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
}),
|
package/src/translations.ts
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Translations } from '@dxos/app-toolkit';
|
|
6
6
|
|
|
7
7
|
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
|
-
[meta.
|
|
12
|
+
[meta.profile.key]: {
|
|
13
13
|
'plugin-settings.label': 'Plugin Settings',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
] as const satisfies Resource[];
|
|
17
|
+
] as const satisfies Translations.Resource[];
|
package/src/types/index.ts
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Paths } from '@dxos/app-toolkit';
|
|
6
6
|
|
|
7
|
-
export const SETTINGS_ID = pinnedWorkspaceId('dxos:settings');
|
|
7
|
+
export const SETTINGS_ID = Paths.pinnedWorkspaceId('dxos:settings');
|
|
8
8
|
export const SETTINGS_KEY = 'settings';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Canonical qualified path to a specific plugin's section in the settings workspace.
|
|
12
|
+
* Segments are joined using the `settings:plugin-id` convention.
|
|
13
|
+
*/
|
|
14
|
+
export const getPluginSettingsSectionPath = (pluginId: string): string =>
|
|
15
|
+
Paths.getSpacePath(SETTINGS_ID, `${SETTINGS_KEY}:${pluginId.replaceAll('/', ':')}`);
|
|
16
|
+
|
|
17
|
+
/** Canonical qualified path to the plugin registry section in the settings workspace. */
|
|
18
|
+
export const getPluginRegistrySectionPath = (): string => Paths.getSpacePath(SETTINGS_ID, `${SETTINGS_KEY}:plugins`);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
var meta = Plugin.makeMeta({
|
|
5
|
-
key: DXN.make("org.dxos.plugin.settings"),
|
|
6
|
-
name: "Settings",
|
|
7
|
-
author: "DXOS",
|
|
8
|
-
tags: [
|
|
9
|
-
"system"
|
|
10
|
-
]
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
meta
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-3DJRTSII.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.settings'),\n name: 'Settings',\n author: 'DXOS',\n tags: ['system'],\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AAEb,IAAMC,OAAOF,OAAOG,SAAS;EAClCC,KAAKH,IAAII,KAAK,0BAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT,CAAA;",
|
|
6
|
-
"names": ["Plugin", "DXN", "meta", "makeMeta", "key", "make", "name", "author", "tags"]
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// src/actions.ts
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { meta } from "#meta";
|
|
4
|
-
import { SETTINGS_ID, SETTINGS_KEY } from "#types";
|
|
5
|
-
(function(SettingsAction2) {
|
|
6
|
-
class Open extends Schema.TaggedClass()(`${meta.id}.open`, {
|
|
7
|
-
input: Schema.Struct({
|
|
8
|
-
plugin: Schema.optional(Schema.String)
|
|
9
|
-
}),
|
|
10
|
-
output: Schema.Void
|
|
11
|
-
}) {
|
|
12
|
-
}
|
|
13
|
-
SettingsAction2.Open = Open;
|
|
14
|
-
class OpenPluginRegistry extends Schema.TaggedClass()(`${meta.id}.openPluginRegistry`, {
|
|
15
|
-
input: Schema.Void,
|
|
16
|
-
output: Schema.Void
|
|
17
|
-
}) {
|
|
18
|
-
}
|
|
19
|
-
SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
|
|
20
|
-
})(SettingsAction || (SettingsAction = {}));
|
|
21
|
-
var SettingsAction;
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
SETTINGS_ID,
|
|
25
|
-
SETTINGS_KEY,
|
|
26
|
-
SettingsAction
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=chunk-J2FJOTAW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/actions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from '#meta';\nimport { SETTINGS_ID, SETTINGS_KEY } from '#types';\n\nexport { SETTINGS_ID, SETTINGS_KEY };\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}.openPluginRegistry`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAY;AACrB,SAASC,aAAaC,oBAAoB;UAIzBC,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,uBAAuB;IAChHC,OAAcM;IACdD,QAAeC;EACjB,CAAA,EAAA;EAAI;kBAHSC,qBAAAA;AAIf,GAZiBZ,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "meta", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "TaggedClass", "meta", "id", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/open.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, getSpacePath } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../actions';\n\nconst handler: Operation.WithHandler<typeof SettingsOperation.Open> = SettingsOperation.Open.pipe(\n Operation.withHandler((input) =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });\n if (input.plugin) {\n // Await (don't fork): SwitchWorkspace already selects the workspace's first child, so a\n // forked Open for the requested plugin races/drops before its deck update applies, leaving\n // the wrong plugin selected. Awaiting guarantees the requested plugin becomes the selection.\n yield* invoke(LayoutOperation.Open, {\n subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],\n });\n }\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,mBAAmBC,oBAAoB;AACjE,SAASC,iBAAiB;AAI1B,IAAMC,UAAgEC,kBAAkBC,KAAKC,KAC3FC,UAAUC,YAAY,CAACC,UACdC,WAAI,aAAA;AACT,QAAM,EAAEC,OAAM,IAAK,OAAOC,WAAWC,IAAIC,aAAaC,gBAAgB;AACtE,SAAOJ,OAAOK,gBAAgBC,iBAAiB;IAAEC,SAASC,aAAaC,WAAAA;EAAa,CAAA;AACpF,MAAIX,MAAMY,QAAQ;AAIhB,WAAOV,OAAOK,gBAAgBX,MAAM;MAClCa,SAAS;QAAC,GAAGC,aAAaC,WAAAA,CAAAA,IAAgBE,YAAAA,IAAgBb,MAAMY,OAAOE,WAAW,KAAK,GAAA,CAAA;;IACzF,CAAA;EACF;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAepB;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "getSpacePath", "Operation", "handler", "SettingsOperation", "Open", "pipe", "Operation", "withHandler", "input", "gen", "invoke", "Capability", "get", "Capabilities", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "getSpacePath", "SETTINGS_ID", "plugin", "SETTINGS_KEY", "replaceAll"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/open-plugin-registry.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, getSpacePath } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../actions';\n\nconst handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =\n SettingsOperation.OpenPluginRegistry.pipe(\n Operation.withHandler(() =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });\n // Await (don't fork): SwitchWorkspace selects the workspace's first child, so a forked Open\n // races/drops before its deck update applies. Awaiting guarantees the registry is selected.\n yield* invoke(LayoutOperation.Open, {\n subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:plugins`],\n });\n }),\n ),\n );\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,mBAAmBC,oBAAoB;AACjE,SAASC,iBAAiB;AAI1B,IAAMC,UACJC,kBAAkBC,mBAAmBC,KACnCC,UAAUC,YAAY,MACbC,WAAI,aAAA;AACT,QAAM,EAAEC,OAAM,IAAK,OAAOC,WAAWC,IAAIC,aAAaC,gBAAgB;AACtE,SAAOJ,OAAOK,gBAAgBC,iBAAiB;IAAEC,SAASC,aAAaC,WAAAA;EAAa,CAAA;AAGpF,SAAOT,OAAOK,gBAAgBK,MAAM;IAClCH,SAAS;MAAC,GAAGC,aAAaC,WAAAA,CAAAA,IAAgBE,YAAAA;;EAC5C,CAAA;AACF,CAAA,CAAA,CAAA;AAIN,IAAA,+BAAelB;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "getSpacePath", "Operation", "handler", "SettingsOperation", "OpenPluginRegistry", "pipe", "Operation", "withHandler", "gen", "invoke", "Capability", "get", "Capabilities", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "getSpacePath", "SETTINGS_ID", "Open", "SETTINGS_KEY"]
|
|
7
|
-
}
|