@dxos/plugin-registry 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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/cli/index.mjs +15 -19
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +50 -41
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/cli/index.mjs +15 -18
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +51 -41
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- 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 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/disable.d.ts +2 -2
- package/dist/types/src/cli/commands/enable.d.ts +2 -2
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/cli/storage.d.ts +4 -4
- package/dist/types/src/cli/storage.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +15 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +43 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
- package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +38 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/index.d.ts +2 -0
- package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts +3 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +14 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts +3 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +5 -1
- 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/translations.d.ts +19 -15
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -31
- package/src/RegistryPlugin.tsx +9 -7
- package/src/capabilities/app-graph-builder.ts +148 -0
- package/src/capabilities/index.ts +9 -3
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +94 -0
- package/src/cli/plugin.ts +4 -3
- package/src/cli/storage.ts +14 -21
- package/src/components/{PluginDetail.stories.tsx → PluginDetail/PluginDetail.stories.tsx} +4 -3
- package/src/components/PluginDetail/PluginDetail.tsx +84 -0
- package/src/components/PluginDetail/index.ts +5 -0
- package/src/components/{PluginItem.tsx → PluginList/PluginItem.tsx} +16 -12
- package/src/components/{PluginList.stories.tsx → PluginList/PluginList.stories.tsx} +17 -7
- package/src/components/PluginList/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +84 -0
- package/src/containers/LoadPluginDialog/index.ts +7 -0
- package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
- package/src/containers/PluginArticle/index.ts +7 -0
- package/src/containers/PluginRegistry/PluginRegistry.tsx +94 -0
- package/src/containers/PluginRegistry/index.ts +7 -0
- package/src/containers/index.ts +10 -0
- package/src/meta.ts +12 -5
- package/src/operations/index.ts +7 -0
- package/src/operations/open-plugin-registry.ts +21 -0
- package/src/translations.ts +19 -15
- package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs +0 -166
- package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs.map +0 -7
- package/dist/lib/browser/chunk-VOAOTNGS.mjs +0 -19
- package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs +0 -24
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs +0 -337
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs +0 -167
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +0 -21
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs +0 -25
- package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs +0 -338
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- 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/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.d.ts +0 -9
- package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts +0 -32
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/PluginItem.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.stories.d.ts +0 -34
- package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
- package/dist/types/src/components/RegistryContainer.d.ts +0 -8
- package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -136
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -99
- package/src/components/PluginDetail.tsx +0 -79
- package/src/components/RegistryContainer.tsx +0 -83
- /package/dist/types/src/components/{PluginItem.d.ts → PluginList/PluginItem.d.ts} +0 -0
- /package/dist/types/src/components/{PluginList.d.ts → PluginList/PluginList.d.ts} +0 -0
- /package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-registry",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bcb3aa67d6",
|
|
4
4
|
"description": "Braneframe plugin gallery",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,17 +12,25 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#meta": "./src/meta.ts",
|
|
20
|
+
"#operations": "./src/operations/index.ts",
|
|
21
|
+
"#types": "./src/types.ts"
|
|
22
|
+
},
|
|
15
23
|
"exports": {
|
|
16
24
|
".": {
|
|
25
|
+
"source": "./src/index.ts",
|
|
17
26
|
"browser": "./dist/lib/browser/index.mjs",
|
|
18
27
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
-
"source": "./src/index.ts",
|
|
20
28
|
"types": "./dist/types/src/index.d.ts"
|
|
21
29
|
},
|
|
22
30
|
"./cli": {
|
|
31
|
+
"source": "./src/cli/index.ts",
|
|
23
32
|
"browser": "./dist/lib/browser/cli/index.mjs",
|
|
24
33
|
"node": "./dist/lib/node-esm/cli/index.mjs",
|
|
25
|
-
"source": "./src/cli/index.ts",
|
|
26
34
|
"types": "./dist/types/src/cli/index.d.ts"
|
|
27
35
|
}
|
|
28
36
|
},
|
|
@@ -35,44 +43,46 @@
|
|
|
35
43
|
"src"
|
|
36
44
|
],
|
|
37
45
|
"dependencies": {
|
|
38
|
-
"@effect-atom/atom-react": "^0.
|
|
39
|
-
"@effect/cli": "0.
|
|
40
|
-
"
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/cli-util": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/
|
|
46
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
47
|
+
"@effect/cli": "0.73.2",
|
|
48
|
+
"yaml": "^2.8.2",
|
|
49
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
50
|
+
"@dxos/cli-util": "0.8.4-main.bcb3aa67d6",
|
|
51
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
52
|
+
"@dxos/client-protocol": "0.8.4-main.bcb3aa67d6",
|
|
53
|
+
"@dxos/invariant": "0.8.4-main.bcb3aa67d6",
|
|
54
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
55
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
56
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
57
|
+
"@dxos/plugin-observability": "0.8.4-main.bcb3aa67d6",
|
|
58
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
|
|
59
|
+
"@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
|
|
60
|
+
"@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
|
|
61
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6",
|
|
62
|
+
"@dxos/effect": "0.8.4-main.bcb3aa67d6"
|
|
53
63
|
},
|
|
54
64
|
"devDependencies": {
|
|
55
|
-
"@effect-atom/atom-react": "^0.
|
|
56
|
-
"@effect/platform": "0.
|
|
65
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
66
|
+
"@effect/platform": "0.94.4",
|
|
57
67
|
"@types/react": "~19.2.7",
|
|
58
68
|
"@types/react-dom": "~19.2.3",
|
|
59
|
-
"effect": "3.
|
|
69
|
+
"effect": "3.20.0",
|
|
60
70
|
"react": "~19.2.3",
|
|
61
71
|
"react-dom": "~19.2.3",
|
|
62
|
-
"vite": "7.1.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
66
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
72
|
+
"vite": "^7.1.11",
|
|
73
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
74
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
75
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
76
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
67
77
|
},
|
|
68
78
|
"peerDependencies": {
|
|
69
|
-
"@effect-atom/atom-react": "^0.
|
|
70
|
-
"@effect/platform": "0.
|
|
71
|
-
"effect": "3.
|
|
79
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
80
|
+
"@effect/platform": "0.94.4",
|
|
81
|
+
"effect": "3.20.0",
|
|
72
82
|
"react": "~19.2.3",
|
|
73
83
|
"react-dom": "~19.2.3",
|
|
74
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
75
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
85
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
76
86
|
},
|
|
77
87
|
"publishConfig": {
|
|
78
88
|
"access": "public"
|
package/src/RegistryPlugin.tsx
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { meta } from './meta';
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
import { translations } from './translations';
|
|
10
10
|
|
|
11
|
+
import { AppGraphBuilder, OperationHandler, ReactSurface } from '#capabilities';
|
|
12
|
+
|
|
11
13
|
export const RegistryPlugin = Plugin.define(meta).pipe(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
15
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
16
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
17
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
16
18
|
Plugin.make,
|
|
17
19
|
);
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
11
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
12
|
+
|
|
13
|
+
import { LOAD_PLUGIN_DIALOG } from '../containers';
|
|
14
|
+
import { REGISTRY_ID, REGISTRY_KEY, registryCategoryId, meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
const capabilities = yield* Capability.Service;
|
|
19
|
+
|
|
20
|
+
const extensions = yield* Effect.all([
|
|
21
|
+
GraphBuilder.createExtension({
|
|
22
|
+
id: meta.id,
|
|
23
|
+
match: NodeMatcher.whenRoot,
|
|
24
|
+
actions: () =>
|
|
25
|
+
Effect.succeed([
|
|
26
|
+
{
|
|
27
|
+
id: meta.id,
|
|
28
|
+
data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
|
|
29
|
+
properties: {
|
|
30
|
+
label: ['open-plugin-registry.label', { ns: meta.id }],
|
|
31
|
+
icon: 'ph--squares-four--regular',
|
|
32
|
+
disposition: 'menu',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
]),
|
|
36
|
+
}),
|
|
37
|
+
GraphBuilder.createExtension({
|
|
38
|
+
id: meta.id,
|
|
39
|
+
match: NodeMatcher.whenRoot,
|
|
40
|
+
connector: () =>
|
|
41
|
+
Effect.succeed([
|
|
42
|
+
Node.make({
|
|
43
|
+
id: REGISTRY_ID,
|
|
44
|
+
type: meta.id,
|
|
45
|
+
properties: {
|
|
46
|
+
label: ['plugin-registry.label', { ns: meta.id }],
|
|
47
|
+
icon: 'ph--squares-four--regular',
|
|
48
|
+
disposition: 'pin-end',
|
|
49
|
+
testId: 'treeView.pluginRegistry',
|
|
50
|
+
},
|
|
51
|
+
nodes: [
|
|
52
|
+
Node.make({
|
|
53
|
+
id: registryCategoryId('all'),
|
|
54
|
+
type: 'category',
|
|
55
|
+
data: registryCategoryId('all'),
|
|
56
|
+
properties: {
|
|
57
|
+
label: ['all-plugins.label', { ns: meta.id }],
|
|
58
|
+
icon: 'ph--squares-four--regular',
|
|
59
|
+
key: REGISTRY_KEY,
|
|
60
|
+
testId: 'pluginRegistry.all',
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
Node.make({
|
|
64
|
+
id: registryCategoryId('installed'),
|
|
65
|
+
type: 'category',
|
|
66
|
+
data: registryCategoryId('installed'),
|
|
67
|
+
properties: {
|
|
68
|
+
label: ['installed-plugins.label', { ns: meta.id }],
|
|
69
|
+
icon: 'ph--check--regular',
|
|
70
|
+
key: REGISTRY_KEY,
|
|
71
|
+
testId: 'pluginRegistry.installed',
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
Node.make({
|
|
75
|
+
id: registryCategoryId('recommended'),
|
|
76
|
+
type: 'category',
|
|
77
|
+
data: registryCategoryId('recommended'),
|
|
78
|
+
properties: {
|
|
79
|
+
label: ['recommended-plugins.label', { ns: meta.id }],
|
|
80
|
+
icon: 'ph--star--regular',
|
|
81
|
+
key: REGISTRY_KEY,
|
|
82
|
+
testId: 'pluginRegistry.recommended',
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
Node.make({
|
|
86
|
+
id: registryCategoryId('labs'),
|
|
87
|
+
type: 'category',
|
|
88
|
+
data: registryCategoryId('labs'),
|
|
89
|
+
properties: {
|
|
90
|
+
label: ['labs-plugins.label', { ns: meta.id }],
|
|
91
|
+
icon: 'ph--flask--regular',
|
|
92
|
+
key: REGISTRY_KEY,
|
|
93
|
+
testId: 'pluginRegistry.labs',
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
}),
|
|
98
|
+
]),
|
|
99
|
+
}),
|
|
100
|
+
GraphBuilder.createExtension({
|
|
101
|
+
id: `${meta.id}.actions`,
|
|
102
|
+
match: NodeMatcher.whenAny(NodeMatcher.whenId(`root/${REGISTRY_ID}`), (node) =>
|
|
103
|
+
node.properties.key === REGISTRY_KEY ? Option.some(node) : Option.none(),
|
|
104
|
+
),
|
|
105
|
+
actions: () =>
|
|
106
|
+
Effect.succeed([
|
|
107
|
+
{
|
|
108
|
+
id: `${meta.id}.load-by-url`,
|
|
109
|
+
data: Effect.fnUntraced(function* () {
|
|
110
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
111
|
+
subject: LOAD_PLUGIN_DIALOG,
|
|
112
|
+
state: true,
|
|
113
|
+
});
|
|
114
|
+
}),
|
|
115
|
+
properties: {
|
|
116
|
+
label: ['load-by-url.label', { ns: meta.id }],
|
|
117
|
+
icon: 'ph--cloud-arrow-down--regular',
|
|
118
|
+
disposition: 'list-item-primary',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
]),
|
|
122
|
+
}),
|
|
123
|
+
GraphBuilder.createExtension({
|
|
124
|
+
id: `${meta.id}.plugins`,
|
|
125
|
+
match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
|
|
126
|
+
connector: () => {
|
|
127
|
+
const manager = capabilities.get(Capabilities.PluginManager);
|
|
128
|
+
return Effect.succeed(
|
|
129
|
+
manager.getPlugins().map((plugin) =>
|
|
130
|
+
Node.make({
|
|
131
|
+
id: plugin.meta.id,
|
|
132
|
+
type: 'org.dxos.plugin',
|
|
133
|
+
data: plugin,
|
|
134
|
+
properties: {
|
|
135
|
+
label: plugin.meta.name ?? plugin.meta.id,
|
|
136
|
+
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
137
|
+
disposition: 'hidden',
|
|
138
|
+
},
|
|
139
|
+
}),
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
]);
|
|
145
|
+
|
|
146
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -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 { RegistryOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, RegistryOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, usePluginManager } from '@dxos/app-framework/ui';
|
|
10
|
+
|
|
11
|
+
import { LOAD_PLUGIN_DIALOG, LoadPluginDialog, PluginArticle, PluginRegistry } from '#containers';
|
|
12
|
+
import { registryCategoryId, meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.succeed(
|
|
16
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
17
|
+
Surface.create({
|
|
18
|
+
id: `${meta.id}.all`,
|
|
19
|
+
role: 'article',
|
|
20
|
+
filter: (data): data is any => data.subject === registryCategoryId('all'),
|
|
21
|
+
component: () => {
|
|
22
|
+
const manager = usePluginManager();
|
|
23
|
+
const filtered = useMemo(
|
|
24
|
+
() => manager.getPlugins().filter(({ meta }) => !manager.getCore().includes(meta.id)),
|
|
25
|
+
[],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return <PluginRegistry id={registryCategoryId('all')} plugins={filtered} />;
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
Surface.create({
|
|
32
|
+
id: `${meta.id}.installed`,
|
|
33
|
+
role: 'article',
|
|
34
|
+
filter: (data): data is any => data.subject === registryCategoryId('installed'),
|
|
35
|
+
component: () => {
|
|
36
|
+
const manager = usePluginManager();
|
|
37
|
+
const filtered = useMemo(
|
|
38
|
+
() =>
|
|
39
|
+
manager
|
|
40
|
+
.getPlugins()
|
|
41
|
+
.filter(({ meta }) => !manager.getCore().includes(meta.id))
|
|
42
|
+
.filter(({ meta }) => manager.getEnabled().includes(meta.id)),
|
|
43
|
+
[],
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return <PluginRegistry id={registryCategoryId('installed')} plugins={filtered} />;
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
Surface.create({
|
|
50
|
+
id: `${meta.id}.recommended`,
|
|
51
|
+
role: 'article',
|
|
52
|
+
filter: (data): data is any => data.subject === registryCategoryId('recommended'),
|
|
53
|
+
component: () => {
|
|
54
|
+
const manager = usePluginManager();
|
|
55
|
+
const filtered = useMemo(
|
|
56
|
+
() =>
|
|
57
|
+
manager
|
|
58
|
+
.getPlugins()
|
|
59
|
+
.filter(({ meta }) => !manager.getCore().includes(meta.id))
|
|
60
|
+
.filter(({ meta }) => !meta.tags?.includes('labs')),
|
|
61
|
+
[],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return <PluginRegistry id={registryCategoryId('recommended')} plugins={filtered} />;
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
Surface.create({
|
|
68
|
+
id: `${meta.id}.labs`,
|
|
69
|
+
role: 'article',
|
|
70
|
+
filter: (data): data is any => data.subject === registryCategoryId('labs'),
|
|
71
|
+
component: () => {
|
|
72
|
+
const manager = usePluginManager();
|
|
73
|
+
const filtered = useMemo(() => manager.getPlugins().filter(({ meta }) => meta.tags?.includes('labs')), []);
|
|
74
|
+
|
|
75
|
+
return <PluginRegistry id={registryCategoryId('labs')} plugins={filtered} />;
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
Surface.create({
|
|
79
|
+
id: `${meta.id}.plugin-details`,
|
|
80
|
+
role: 'article',
|
|
81
|
+
filter: (data): data is { subject: Plugin.Plugin } => Plugin.isPlugin(data.subject),
|
|
82
|
+
component: ({ data: { subject } }) => {
|
|
83
|
+
return <PluginArticle subject={subject} />;
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
Surface.create({
|
|
87
|
+
id: LOAD_PLUGIN_DIALOG,
|
|
88
|
+
role: 'dialog',
|
|
89
|
+
filter: (data): data is any => data.component === LOAD_PLUGIN_DIALOG,
|
|
90
|
+
component: () => <LoadPluginDialog />,
|
|
91
|
+
}),
|
|
92
|
+
]),
|
|
93
|
+
),
|
|
94
|
+
);
|
package/src/cli/plugin.ts
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
|
-
import { meta } from '
|
|
8
|
+
import { meta } from '#meta';
|
|
8
9
|
|
|
9
10
|
import { plugin } from './commands';
|
|
10
11
|
|
|
11
12
|
export const RegistryPlugin = Plugin.define(meta).pipe(
|
|
12
|
-
|
|
13
|
+
AppPlugin.addCommandModule({
|
|
13
14
|
commands: [plugin],
|
|
14
15
|
}),
|
|
15
16
|
Plugin.make,
|
package/src/cli/storage.ts
CHANGED
|
@@ -6,37 +6,31 @@ import * as FileSystem from '@effect/platform/FileSystem';
|
|
|
6
6
|
import * as Path from '@effect/platform/Path';
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
import * as Schema from 'effect/Schema';
|
|
9
|
+
import * as Yaml from 'yaml';
|
|
9
10
|
|
|
10
|
-
import { DX_CONFIG
|
|
11
|
+
import { DX_CONFIG } from '@dxos/client-protocol';
|
|
11
12
|
|
|
12
13
|
// TODO(wittjosiah): Factor out to app-framework?
|
|
13
14
|
|
|
14
|
-
const PLUGINS_FILE = 'plugins.json';
|
|
15
|
-
|
|
16
15
|
const PluginsSchema = Schema.Array(Schema.String);
|
|
17
16
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
const getPluginsPath = (profile: string): Effect.Effect<string, never, Path.Path> =>
|
|
22
|
-
Effect.gen(function* () {
|
|
23
|
-
const path = yield* Path.Path;
|
|
24
|
-
return path.join(getProfilePath(DX_CONFIG, profile), PLUGINS_FILE);
|
|
25
|
-
});
|
|
17
|
+
/** CLI-only: path to plugins/<profile>.yml (sibling to profile/). */
|
|
18
|
+
const getPluginsConfigPath = (profile: string) => `${DX_CONFIG}/plugins/${profile}.yml`;
|
|
26
19
|
|
|
27
20
|
/**
|
|
28
|
-
* Load enabled plugins from profile
|
|
21
|
+
* Load enabled plugins from plugins/<profile>.yml (sibling to profile/).
|
|
29
22
|
* Returns the list of enabled plugin IDs, or an empty array if the file doesn't exist.
|
|
30
23
|
*/
|
|
31
24
|
export const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: string }) {
|
|
32
25
|
const fs = yield* FileSystem.FileSystem;
|
|
33
|
-
const pluginsPath =
|
|
26
|
+
const pluginsPath = getPluginsConfigPath(profile);
|
|
34
27
|
|
|
35
28
|
const content = yield* fs
|
|
36
29
|
.readFileString(pluginsPath)
|
|
37
30
|
.pipe(Effect.catchTag('SystemError', () => Effect.succeed('[]')));
|
|
38
31
|
|
|
39
|
-
const
|
|
32
|
+
const raw = Yaml.parse(content);
|
|
33
|
+
const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(
|
|
40
34
|
Effect.catchAll(() => Effect.succeed([] as string[])),
|
|
41
35
|
);
|
|
42
36
|
|
|
@@ -44,14 +38,13 @@ export const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: s
|
|
|
44
38
|
});
|
|
45
39
|
|
|
46
40
|
/**
|
|
47
|
-
* Save enabled plugins to profile
|
|
41
|
+
* Save enabled plugins to plugins/<profile>.yml.
|
|
48
42
|
*/
|
|
49
43
|
export const saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }: { profile: string; enabled: string[] }) {
|
|
50
44
|
const fs = yield* FileSystem.FileSystem;
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
yield* fs.writeFileString(pluginsPath, encoded + '\n');
|
|
45
|
+
const path = yield* Path.Path;
|
|
46
|
+
const pluginsPath = getPluginsConfigPath(profile);
|
|
47
|
+
yield* fs.makeDirectory(path.dirname(pluginsPath), { recursive: true });
|
|
48
|
+
const encoded = Yaml.stringify(enabled);
|
|
49
|
+
yield* fs.writeFileString(pluginsPath, encoded);
|
|
57
50
|
});
|
|
@@ -8,15 +8,16 @@ import { Plugin } from '@dxos/app-framework';
|
|
|
8
8
|
import { faker } from '@dxos/random';
|
|
9
9
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
10
10
|
|
|
11
|
-
import { translations } from '
|
|
11
|
+
import { translations } from '../../translations';
|
|
12
12
|
|
|
13
13
|
import { PluginDetail } from './PluginDetail';
|
|
14
14
|
|
|
15
15
|
const meta = {
|
|
16
|
-
title: 'plugins/plugin-registry/PluginDetail',
|
|
16
|
+
title: 'plugins/plugin-registry/components/PluginDetail',
|
|
17
17
|
component: PluginDetail,
|
|
18
|
-
decorators: [withTheme, withLayout({ layout: 'column' })],
|
|
18
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
19
19
|
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
20
21
|
translations,
|
|
21
22
|
},
|
|
22
23
|
} satisfies Meta<typeof PluginDetail>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { Icon, Input, Link, ScrollArea, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { composable, composableProps, getStyles, mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
export type PluginDetailProps = {
|
|
14
|
+
plugin: Plugin.Plugin;
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
onEnabledChange?: (enabled: boolean) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const PluginDetail = composable<HTMLDivElement, PluginDetailProps>(
|
|
20
|
+
({ plugin, enabled, onEnabledChange, ...props }, forwardedRef) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const {
|
|
23
|
+
id,
|
|
24
|
+
name,
|
|
25
|
+
description,
|
|
26
|
+
homePage,
|
|
27
|
+
source,
|
|
28
|
+
screenshots,
|
|
29
|
+
icon = 'ph--circle--regular',
|
|
30
|
+
iconHue = 'neutral',
|
|
31
|
+
} = plugin.meta;
|
|
32
|
+
const styles = getStyles(iconHue);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<ScrollArea.Root {...composableProps(props)} orientation='vertical' ref={forwardedRef}>
|
|
36
|
+
<ScrollArea.Viewport>
|
|
37
|
+
<div role='none' className='dx-document grid grid-cols-[min-content_1fr] gap-4 p-4'>
|
|
38
|
+
<div role='none'>
|
|
39
|
+
<Icon classNames={mx('p-1 rounded-md', styles.fill, styles.surfaceText)} icon={icon} size={14} />
|
|
40
|
+
</div>
|
|
41
|
+
<div role='none' className='flex flex-col gap-6'>
|
|
42
|
+
<div role='none' className='grid grid-cols-[1fr_min-content] gap-x-3 w-full pt-1'>
|
|
43
|
+
<h2 className='text-xl'>{name}</h2>
|
|
44
|
+
<Input.Root>
|
|
45
|
+
<Input.Switch classNames='self-center' checked={enabled} onCheckedChange={onEnabledChange} />
|
|
46
|
+
</Input.Root>
|
|
47
|
+
<p className='pt-0.5 text-sm text-description'>{id}</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div role='none'>
|
|
50
|
+
<p className='text-description'>{description}</p>
|
|
51
|
+
</div>
|
|
52
|
+
{screenshots && screenshots.length > 0 && (
|
|
53
|
+
<div role='none' className='flex flex-col gap-2'>
|
|
54
|
+
<h2>Preview</h2>
|
|
55
|
+
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
<div role='none' className='flex flex-col gap-2'>
|
|
59
|
+
<h2>Resources</h2>
|
|
60
|
+
<div className='flex gap-2'>
|
|
61
|
+
{homePage && (
|
|
62
|
+
<Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
63
|
+
{t('home-page.label')}
|
|
64
|
+
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mx-1' />
|
|
65
|
+
</Link>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
{source && (
|
|
69
|
+
<Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
70
|
+
{t('source.label')}
|
|
71
|
+
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mx-1' />
|
|
72
|
+
</Link>
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</ScrollArea.Viewport>
|
|
79
|
+
</ScrollArea.Root>
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
PluginDetail.displayName = 'PluginDetail';
|