@dxos/plugin-settings 0.6.14-main.7bd9c89 → 0.8.4-main.1c7ec43d41
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/SettingsPlugin-H7MYSTLT.mjs +9 -0
- package/dist/lib/browser/chunk-YMWZWP5N.mjs +20 -0
- package/dist/lib/browser/chunk-YMWZWP5N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +34 -247
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/plugin.mjs +7 -0
- package/dist/lib/browser/translations.mjs +15 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +9 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node-esm/SettingsPlugin-LSWDBQHF.mjs +10 -0
- package/dist/lib/node-esm/SettingsPlugin-LSWDBQHF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H4MBYZ3E.mjs +22 -0
- package/dist/lib/node-esm/chunk-H4MBYZ3E.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +34 -246
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/plugin.mjs +8 -0
- package/dist/lib/node-esm/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +17 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +11 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/SettingsPlugin.d.ts +3 -6
- package/dist/types/src/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/SettingsPlugin.test.d.ts +2 -0
- package/dist/types/src/SettingsPlugin.test.d.ts.map +1 -0
- package/dist/types/src/actions.d.ts +25 -0
- package/dist/types/src/actions.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -5
- package/dist/types/src/meta.d.ts.map +1 -1
- 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/src/plugin.d.ts +2 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +46 -36
- package/src/SettingsPlugin.test.ts +33 -0
- package/src/SettingsPlugin.ts +19 -0
- package/src/actions.ts +24 -0
- package/src/capabilities/app-graph-builder.ts +99 -0
- package/src/capabilities/index.ts +12 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/index.ts +7 -7
- package/src/meta.ts +7 -7
- package/src/operations/index.ts +10 -0
- package/src/operations/open-plugin-registry.ts +28 -0
- package/src/operations/open.ts +29 -0
- package/src/plugin.ts +7 -0
- package/src/translations.ts +8 -9
- package/src/types/index.ts +8 -0
- package/README.md +0 -15
- package/dist/lib/browser/chunk-PD3C4TDW.mjs +0 -11
- package/dist/lib/browser/chunk-PD3C4TDW.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/node/chunk-AHM6OLF2.cjs +0 -34
- package/dist/lib/node/chunk-AHM6OLF2.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -30
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs +0 -13
- package/dist/lib/node-esm/chunk-PPOEIFFE.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/types/src/components/SettingsDialog.d.ts +0 -6
- package/dist/types/src/components/SettingsDialog.d.ts.map +0 -1
- package/dist/types/src/components/SettingsValue.d.ts +0 -9
- package/dist/types/src/components/SettingsValue.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -3
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/src/SettingsPlugin.tsx +0 -122
- package/src/components/SettingsDialog.tsx +0 -126
- package/src/components/SettingsValue.tsx +0 -49
- package/src/components/index.ts +0 -6
- /package/dist/lib/browser/{meta.mjs.map → SettingsPlugin-H7MYSTLT.mjs.map} +0 -0
- /package/dist/lib/{node-esm/meta.mjs.map → browser/plugin.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,62 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-settings",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DXOS
|
|
3
|
+
"version": "0.8.4-main.1c7ec43d41",
|
|
4
|
+
"description": "DXOS Settings plugin for managing application settings.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
13
|
+
"sideEffects": true,
|
|
14
|
+
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#plugin": "./src/SettingsPlugin.ts",
|
|
17
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
+
"#meta": "./src/meta.ts",
|
|
19
|
+
"#operations": "./src/operations/index.ts",
|
|
20
|
+
"#translations": "./src/translations.ts",
|
|
21
|
+
"#types": "./src/types/index.ts"
|
|
22
|
+
},
|
|
9
23
|
"exports": {
|
|
10
24
|
".": {
|
|
25
|
+
"source": "./src/index.ts",
|
|
11
26
|
"browser": "./dist/lib/browser/index.mjs",
|
|
12
|
-
"node":
|
|
13
|
-
"require": "./dist/lib/node/index.cjs",
|
|
14
|
-
"default": "./dist/lib/node-esm/index.mjs"
|
|
15
|
-
},
|
|
27
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
16
28
|
"types": "./dist/types/src/index.d.ts"
|
|
17
29
|
},
|
|
18
|
-
"./
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
"./plugin": {
|
|
31
|
+
"source": "./src/plugin.ts",
|
|
32
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
33
|
+
"browser": "./dist/lib/browser/plugin.mjs",
|
|
34
|
+
"node": "./dist/lib/node-esm/plugin.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./translations": {
|
|
37
|
+
"source": "./src/translations.ts",
|
|
38
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
39
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
40
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./types": {
|
|
43
|
+
"source": "./src/types/index.ts",
|
|
44
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
45
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
46
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
25
47
|
}
|
|
26
48
|
},
|
|
27
49
|
"types": "dist/types/src/index.d.ts",
|
|
28
|
-
"typesVersions": {
|
|
29
|
-
"*": {
|
|
30
|
-
"meta": [
|
|
31
|
-
"dist/types/src/meta.d.ts"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
50
|
"files": [
|
|
36
51
|
"dist",
|
|
37
52
|
"src"
|
|
38
53
|
],
|
|
39
54
|
"dependencies": {
|
|
40
|
-
"@dxos/app-framework": "0.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/util": "0.
|
|
55
|
+
"@dxos/app-framework": "0.8.4-main.1c7ec43d41",
|
|
56
|
+
"@dxos/app-toolkit": "0.8.4-main.1c7ec43d41",
|
|
57
|
+
"@dxos/compute": "0.8.4-main.1c7ec43d41",
|
|
58
|
+
"@dxos/app-graph": "0.8.4-main.1c7ec43d41",
|
|
59
|
+
"@dxos/util": "0.8.4-main.1c7ec43d41"
|
|
45
60
|
},
|
|
46
61
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"react": "~
|
|
50
|
-
"
|
|
51
|
-
"@dxos/react-ui": "0.6.14-main.7bd9c89",
|
|
52
|
-
"@dxos/react-ui-theme": "0.6.14-main.7bd9c89",
|
|
53
|
-
"@dxos/storybook-utils": "0.6.14-main.7bd9c89"
|
|
62
|
+
"@types/react": "~19.2.7",
|
|
63
|
+
"effect": "3.20.0",
|
|
64
|
+
"react": "~19.2.3",
|
|
65
|
+
"@dxos/plugin-graph": "0.8.4-main.1c7ec43d41"
|
|
54
66
|
},
|
|
55
67
|
"peerDependencies": {
|
|
56
|
-
"
|
|
57
|
-
"react": "~
|
|
58
|
-
"@dxos/react-ui": "0.6.14-main.7bd9c89",
|
|
59
|
-
"@dxos/react-ui-theme": "0.6.14-main.7bd9c89"
|
|
68
|
+
"effect": "3.20.0",
|
|
69
|
+
"react": "~19.2.3"
|
|
60
70
|
},
|
|
61
71
|
"publishConfig": {
|
|
62
72
|
"access": "public"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
|
|
8
|
+
import { createTestApp } from '@dxos/app-framework/testing';
|
|
9
|
+
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
10
|
+
|
|
11
|
+
import { SettingsPlugin } from '#plugin';
|
|
12
|
+
|
|
13
|
+
import { meta } from './meta';
|
|
14
|
+
|
|
15
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
16
|
+
|
|
17
|
+
describe('SettingsPlugin', () => {
|
|
18
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
19
|
+
// Use createTestApp directly to avoid a circular dep with plugin-testing.
|
|
20
|
+
// GraphPlugin fires SetupAppGraph (via firesBeforeActivation) during Startup,
|
|
21
|
+
// activating SettingsAppGraphBuilder. OperationPlugin fires SetupOperationHandler
|
|
22
|
+
// during Startup, activating OperationHandler.
|
|
23
|
+
await using harness = await createTestApp({
|
|
24
|
+
plugins: [GraphPlugin(), OperationPlugin(), RuntimePlugin(), SettingsPlugin()],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// SettingsAppGraphBuilder activates on SetupAppGraph (fired by GraphPlugin during Startup).
|
|
28
|
+
// OperationHandler activates on SetupOperationHandler (fired by OperationPlugin during Startup).
|
|
29
|
+
expect(harness.manager.getActive()).toEqual(
|
|
30
|
+
expect.arrayContaining([moduleId('SettingsAppGraphBuilder'), moduleId('OperationHandler')]),
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { OperationHandler, SettingsAppGraphBuilder } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
12
|
+
export const SettingsPlugin = Plugin.define(meta).pipe(
|
|
13
|
+
AppPlugin.addAppGraphModule({ activate: SettingsAppGraphBuilder }),
|
|
14
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
15
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
16
|
+
Plugin.make,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default SettingsPlugin;
|
package/src/actions.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { SETTINGS_ID, SETTINGS_KEY } from '#types';
|
|
9
|
+
|
|
10
|
+
export { SETTINGS_ID, SETTINGS_KEY };
|
|
11
|
+
|
|
12
|
+
export namespace SettingsAction {
|
|
13
|
+
export class Open extends Schema.TaggedClass<Open>()(`${meta.id}.open`, {
|
|
14
|
+
input: Schema.Struct({
|
|
15
|
+
plugin: Schema.optional(Schema.String),
|
|
16
|
+
}),
|
|
17
|
+
output: Schema.Void,
|
|
18
|
+
}) {}
|
|
19
|
+
|
|
20
|
+
export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}.open-plugin-registry`, {
|
|
21
|
+
input: Schema.Void,
|
|
22
|
+
output: Schema.Void,
|
|
23
|
+
}) {}
|
|
24
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';
|
|
8
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/app-graph';
|
|
9
|
+
import { AppCapabilities, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { isNonNullable } from '@dxos/util';
|
|
12
|
+
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
|
|
15
|
+
import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
|
|
16
|
+
|
|
17
|
+
export default Capability.makeModule(
|
|
18
|
+
Effect.fnUntraced(function* () {
|
|
19
|
+
// Get context for lazy capability access in callbacks.
|
|
20
|
+
const capabilities = yield* Capability.Service;
|
|
21
|
+
const managerAtom = capabilities.atom(Capabilities.PluginManager);
|
|
22
|
+
const settingsAtom = capabilities.atom(AppCapabilities.Settings);
|
|
23
|
+
|
|
24
|
+
const extensions = yield* Effect.all([
|
|
25
|
+
GraphBuilder.createExtension({
|
|
26
|
+
id: 'action',
|
|
27
|
+
match: NodeMatcher.whenRoot,
|
|
28
|
+
actions: () =>
|
|
29
|
+
Effect.succeed([
|
|
30
|
+
{
|
|
31
|
+
id: 'root',
|
|
32
|
+
data: () => Operation.invoke(SettingsOperation.Open, {}),
|
|
33
|
+
properties: {
|
|
34
|
+
label: ['plugin-settings.label', { ns: meta.id }],
|
|
35
|
+
icon: 'ph--gear--regular',
|
|
36
|
+
disposition: 'menu',
|
|
37
|
+
keyBinding: {
|
|
38
|
+
macos: 'meta+,',
|
|
39
|
+
windows: 'alt+,',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
]),
|
|
44
|
+
}),
|
|
45
|
+
GraphBuilder.createExtension({
|
|
46
|
+
id: 'core',
|
|
47
|
+
match: NodeMatcher.whenRoot,
|
|
48
|
+
connector: () =>
|
|
49
|
+
Effect.succeed([
|
|
50
|
+
Node.make({
|
|
51
|
+
id: SETTINGS_ID,
|
|
52
|
+
type: meta.id,
|
|
53
|
+
properties: {
|
|
54
|
+
label: ['plugin-settings.label', { ns: meta.id }],
|
|
55
|
+
icon: 'ph--gear--regular',
|
|
56
|
+
disposition: 'pin-end',
|
|
57
|
+
position: 'hoist',
|
|
58
|
+
testId: 'treeView.appSettings',
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
]),
|
|
62
|
+
}),
|
|
63
|
+
GraphBuilder.createExtension({
|
|
64
|
+
id: 'plugins',
|
|
65
|
+
match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
|
|
66
|
+
connector: (node, get) => {
|
|
67
|
+
const [manager] = get(managerAtom);
|
|
68
|
+
const allSettings = get(settingsAtom);
|
|
69
|
+
return Effect.succeed(
|
|
70
|
+
manager
|
|
71
|
+
.getPlugins()
|
|
72
|
+
.map((plugin: Plugin$.Plugin): [Plugin$.Meta, AppCapabilities.Settings] | null => {
|
|
73
|
+
const settings = allSettings.find((s) => s.prefix === plugin.meta.id);
|
|
74
|
+
if (!settings) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return [plugin.meta, settings];
|
|
79
|
+
})
|
|
80
|
+
.filter(isNonNullable)
|
|
81
|
+
.map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) =>
|
|
82
|
+
Node.make({
|
|
83
|
+
id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
|
|
84
|
+
type: 'category',
|
|
85
|
+
data: settings,
|
|
86
|
+
properties: {
|
|
87
|
+
label: meta.name ?? meta.id,
|
|
88
|
+
icon: meta.icon ?? 'ph--circle--regular',
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
]);
|
|
96
|
+
|
|
97
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
98
|
+
}),
|
|
99
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
export const SettingsAppGraphBuilder = Capability.lazy('SettingsAppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
@@ -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/compute';
|
|
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/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { meta } from './meta';
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const SettingsPlugin = Plugin.lazy(meta, () => import('./SettingsPlugin'));
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export * from './
|
|
11
|
+
export * from './meta';
|
|
12
|
+
|
|
13
|
+
export * from './actions';
|
package/src/meta.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
export const meta: Plugin.Meta = {
|
|
8
|
+
id: 'org.dxos.plugin.settings',
|
|
9
|
+
name: 'Settings',
|
|
10
|
+
tags: ['system'],
|
|
11
|
+
};
|
|
@@ -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/compute';
|
|
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/compute';
|
|
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;
|
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Resource } from '@dxos/app-toolkit';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
|
|
9
|
+
export const translations = [
|
|
8
10
|
{
|
|
9
11
|
'en-US': {
|
|
10
|
-
[
|
|
11
|
-
'
|
|
12
|
-
'settings dialog title': 'Settings',
|
|
13
|
-
'back label': 'Back',
|
|
14
|
-
'click to return to tablist description': 'Click the title to return to the settings menu',
|
|
12
|
+
[meta.id]: {
|
|
13
|
+
'plugin-settings.label': 'Plugin Settings',
|
|
15
14
|
},
|
|
16
15
|
},
|
|
17
16
|
},
|
|
18
|
-
];
|
|
17
|
+
] as const satisfies Resource[];
|
package/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# @dxos/plugin-settings
|
|
2
|
-
|
|
3
|
-
DXOS app plugin for aggregating and rendering plugin settings.
|
|
4
|
-
|
|
5
|
-
## DXOS Resources
|
|
6
|
-
|
|
7
|
-
- [Website](https://dxos.org)
|
|
8
|
-
- [Developer Documentation](https://docs.dxos.org)
|
|
9
|
-
- Talk to us on [Discord](https://dxos.org/discord)
|
|
10
|
-
|
|
11
|
-
## Contributions
|
|
12
|
-
|
|
13
|
-
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
|
-
|
|
15
|
-
License: [MIT](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\n\nexport default {\n id: SETTINGS_PLUGIN,\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;AACN;",
|
|
6
|
-
"names": ["SETTINGS_PLUGIN", "id"]
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_AHM6OLF2_exports = {};
|
|
20
|
-
__export(chunk_AHM6OLF2_exports, {
|
|
21
|
-
SETTINGS_PLUGIN: () => SETTINGS_PLUGIN,
|
|
22
|
-
meta_default: () => meta_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(chunk_AHM6OLF2_exports);
|
|
25
|
-
var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
|
|
26
|
-
var meta_default = {
|
|
27
|
-
id: SETTINGS_PLUGIN
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
SETTINGS_PLUGIN,
|
|
32
|
-
meta_default
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=chunk-AHM6OLF2.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\n\nexport default {\n id: SETTINGS_PLUGIN,\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;AACN;",
|
|
6
|
-
"names": ["SETTINGS_PLUGIN", "id"]
|
|
7
|
-
}
|