@dxos/plugin-registry 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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-LKQBQDUA.mjs → app-graph-builder-YN3N2KW4.mjs} +20 -20
- package/dist/lib/browser/app-graph-builder-YN3N2KW4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AEBASNOI.mjs → chunk-MWZPWWWF.mjs} +2 -4
- package/dist/lib/browser/chunk-MWZPWWWF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-W67CIJI3.mjs → intent-resolver-RUD6WFGT.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-W67CIJI3.mjs.map → intent-resolver-RUD6WFGT.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-SRFVJQKE.mjs → react-surface-3CDFJHV3.mjs} +29 -29
- package/dist/lib/browser/react-surface-3CDFJHV3.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +1 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/Icon.stories.d.ts +12 -4
- package/dist/types/src/components/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts +30 -5
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.stories.d.ts +34 -8
- package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -29
- package/src/RegistryPlugin.tsx +23 -24
- package/src/capabilities/app-graph-builder.ts +16 -16
- package/src/capabilities/intent-resolver.ts +4 -4
- package/src/capabilities/react-surface.tsx +8 -13
- package/src/components/Icon.stories.tsx +12 -9
- package/src/components/PluginDetail.stories.tsx +9 -9
- package/src/components/PluginDetail.tsx +36 -34
- package/src/components/PluginItem.tsx +2 -2
- package/src/components/PluginList.stories.tsx +27 -26
- package/src/components/RegistryContainer.tsx +1 -1
- package/src/meta.ts +1 -3
- package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs.map +0 -7
- package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SRFVJQKE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-N44OGVQA.mjs +0 -162
- package/dist/lib/node-esm/app-graph-builder-N44OGVQA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-R3GXMWPJ.mjs +0 -18
- package/dist/lib/node-esm/chunk-R3GXMWPJ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -72
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-M2CBVUVQ.mjs +0 -24
- package/dist/lib/node-esm/intent-resolver-M2CBVUVQ.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-5XAG2EYX.mjs +0 -336
- package/dist/lib/node-esm/react-surface-5XAG2EYX.mjs.map +0 -7
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.a4bbb77",
|
|
4
4
|
"description": "Braneframe plugin gallery",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs"
|
|
15
16
|
}
|
|
@@ -24,41 +25,40 @@
|
|
|
24
25
|
],
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@preact-signals/safe-react": "^0.9.0",
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/echo": "0.8.4-main.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
36
|
-
"@dxos/util": "0.8.4-main.
|
|
28
|
+
"@dxos/echo": "0.8.4-main.a4bbb77",
|
|
29
|
+
"@dxos/app-framework": "0.8.4-main.a4bbb77",
|
|
30
|
+
"@dxos/echo-schema": "0.8.4-main.a4bbb77",
|
|
31
|
+
"@dxos/invariant": "0.8.4-main.a4bbb77",
|
|
32
|
+
"@dxos/plugin-graph": "0.8.4-main.a4bbb77",
|
|
33
|
+
"@dxos/live-object": "0.8.4-main.a4bbb77",
|
|
34
|
+
"@dxos/react-ui-form": "0.8.4-main.a4bbb77",
|
|
35
|
+
"@dxos/plugin-observability": "0.8.4-main.a4bbb77",
|
|
36
|
+
"@dxos/react-ui-stack": "0.8.4-main.a4bbb77",
|
|
37
|
+
"@dxos/util": "0.8.4-main.a4bbb77"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@effect-rx/rx-react": "0.
|
|
40
|
-
"@effect/platform": "0.
|
|
41
|
-
"@phosphor-icons/react": "^2.1.
|
|
42
|
-
"@types/react": "~
|
|
43
|
-
"@types/react-dom": "~
|
|
44
|
-
"effect": "3.
|
|
45
|
-
"react": "~
|
|
46
|
-
"react-dom": "~
|
|
47
|
-
"vite": "
|
|
48
|
-
"@dxos/random": "0.8.4-main.
|
|
49
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
50
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
51
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
40
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
41
|
+
"@effect/platform": "0.92.1",
|
|
42
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
43
|
+
"@types/react": "~19.2.0",
|
|
44
|
+
"@types/react-dom": "~19.2.0",
|
|
45
|
+
"effect": "3.18.3",
|
|
46
|
+
"react": "~19.2.0",
|
|
47
|
+
"react-dom": "~19.2.0",
|
|
48
|
+
"vite": "7.1.9",
|
|
49
|
+
"@dxos/random": "0.8.4-main.a4bbb77",
|
|
50
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
51
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77",
|
|
52
|
+
"@dxos/storybook-utils": "0.8.4-main.a4bbb77"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"@effect-rx/rx-react": "^0.34.1",
|
|
55
56
|
"@effect/platform": "^0.80.12",
|
|
56
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
57
57
|
"effect": "^3.13.3",
|
|
58
|
-
"react": "
|
|
59
|
-
"react-dom": "
|
|
60
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
61
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
58
|
+
"react": "^19.0.0",
|
|
59
|
+
"react-dom": "^19.0.0",
|
|
60
|
+
"@dxos/react-ui": "0.8.4-main.a4bbb77",
|
|
61
|
+
"@dxos/react-ui-theme": "0.8.4-main.a4bbb77"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
package/src/RegistryPlugin.tsx
CHANGED
|
@@ -2,32 +2,31 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, defineModule, definePlugin
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
|
|
8
8
|
import { meta } from './meta';
|
|
9
9
|
import { translations } from './translations';
|
|
10
10
|
|
|
11
|
-
export const RegistryPlugin = () =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]);
|
|
11
|
+
export const RegistryPlugin = definePlugin(meta, () => [
|
|
12
|
+
defineModule({
|
|
13
|
+
id: `${meta.id}/module/translations`,
|
|
14
|
+
activatesOn: Events.SetupTranslations,
|
|
15
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
16
|
+
}),
|
|
17
|
+
defineModule({
|
|
18
|
+
id: `${meta.id}/module/react-surface`,
|
|
19
|
+
activatesOn: Events.SetupReactSurface,
|
|
20
|
+
activate: ReactSurface,
|
|
21
|
+
}),
|
|
22
|
+
defineModule({
|
|
23
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
24
|
+
activatesOn: Events.SetupIntentResolver,
|
|
25
|
+
activate: IntentResolver,
|
|
26
|
+
}),
|
|
27
|
+
defineModule({
|
|
28
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
29
|
+
activatesOn: Events.SetupAppGraph,
|
|
30
|
+
activate: AppGraphBuilder,
|
|
31
|
+
}),
|
|
32
|
+
]);
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
6
|
import { Option, pipe } from 'effect';
|
|
7
7
|
|
|
8
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
|
|
9
9
|
import { createExtension } from '@dxos/plugin-graph';
|
|
10
10
|
|
|
11
|
-
import { REGISTRY_ID, REGISTRY_KEY,
|
|
11
|
+
import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export default (context: PluginContext) =>
|
|
14
14
|
contributes(Capabilities.AppGraphBuilder, [
|
|
15
15
|
createExtension({
|
|
16
|
-
id:
|
|
16
|
+
id: meta.id,
|
|
17
17
|
actions: (node) =>
|
|
18
18
|
Rx.make((get) =>
|
|
19
19
|
pipe(
|
|
@@ -21,13 +21,13 @@ export default (context: PluginContext) =>
|
|
|
21
21
|
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
22
22
|
Option.map((node) => [
|
|
23
23
|
{
|
|
24
|
-
id:
|
|
24
|
+
id: meta.id,
|
|
25
25
|
data: async () => {
|
|
26
26
|
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
27
|
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
28
28
|
},
|
|
29
29
|
properties: {
|
|
30
|
-
label: ['open plugin registry label', { ns:
|
|
30
|
+
label: ['open plugin registry label', { ns: meta.id }],
|
|
31
31
|
icon: 'ph--squares-four--regular',
|
|
32
32
|
disposition: 'menu',
|
|
33
33
|
},
|
|
@@ -38,7 +38,7 @@ export default (context: PluginContext) =>
|
|
|
38
38
|
),
|
|
39
39
|
}),
|
|
40
40
|
createExtension({
|
|
41
|
-
id:
|
|
41
|
+
id: meta.id,
|
|
42
42
|
connector: (node) =>
|
|
43
43
|
Rx.make((get) =>
|
|
44
44
|
pipe(
|
|
@@ -47,9 +47,9 @@ export default (context: PluginContext) =>
|
|
|
47
47
|
Option.map((node) => [
|
|
48
48
|
{
|
|
49
49
|
id: REGISTRY_ID,
|
|
50
|
-
type:
|
|
50
|
+
type: meta.id,
|
|
51
51
|
properties: {
|
|
52
|
-
label: ['plugin registry label', { ns:
|
|
52
|
+
label: ['plugin registry label', { ns: meta.id }],
|
|
53
53
|
icon: 'ph--squares-four--regular',
|
|
54
54
|
disposition: 'pin-end',
|
|
55
55
|
testId: 'treeView.pluginRegistry',
|
|
@@ -60,7 +60,7 @@ export default (context: PluginContext) =>
|
|
|
60
60
|
type: 'category',
|
|
61
61
|
data: `${REGISTRY_KEY}+all`,
|
|
62
62
|
properties: {
|
|
63
|
-
label: ['all plugins label', { ns:
|
|
63
|
+
label: ['all plugins label', { ns: meta.id }],
|
|
64
64
|
icon: 'ph--squares-four--regular',
|
|
65
65
|
key: REGISTRY_KEY,
|
|
66
66
|
testId: 'pluginRegistry.all',
|
|
@@ -71,7 +71,7 @@ export default (context: PluginContext) =>
|
|
|
71
71
|
type: 'category',
|
|
72
72
|
data: `${REGISTRY_KEY}+installed`,
|
|
73
73
|
properties: {
|
|
74
|
-
label: ['installed plugins label', { ns:
|
|
74
|
+
label: ['installed plugins label', { ns: meta.id }],
|
|
75
75
|
icon: 'ph--check--regular',
|
|
76
76
|
key: REGISTRY_KEY,
|
|
77
77
|
testId: 'pluginRegistry.installed',
|
|
@@ -82,7 +82,7 @@ export default (context: PluginContext) =>
|
|
|
82
82
|
type: 'category',
|
|
83
83
|
data: `${REGISTRY_KEY}+recommended`,
|
|
84
84
|
properties: {
|
|
85
|
-
label: ['recommended plugins label', { ns:
|
|
85
|
+
label: ['recommended plugins label', { ns: meta.id }],
|
|
86
86
|
icon: 'ph--star--regular',
|
|
87
87
|
key: REGISTRY_KEY,
|
|
88
88
|
testId: 'pluginRegistry.recommended',
|
|
@@ -93,7 +93,7 @@ export default (context: PluginContext) =>
|
|
|
93
93
|
type: 'category',
|
|
94
94
|
data: `${REGISTRY_KEY}+labs`,
|
|
95
95
|
properties: {
|
|
96
|
-
label: ['labs plugins label', { ns:
|
|
96
|
+
label: ['labs plugins label', { ns: meta.id }],
|
|
97
97
|
icon: 'ph--flask--regular',
|
|
98
98
|
key: REGISTRY_KEY,
|
|
99
99
|
testId: 'pluginRegistry.labs',
|
|
@@ -107,7 +107,7 @@ export default (context: PluginContext) =>
|
|
|
107
107
|
),
|
|
108
108
|
}),
|
|
109
109
|
createExtension({
|
|
110
|
-
id: `${
|
|
110
|
+
id: `${meta.id}/actions`,
|
|
111
111
|
actions: (node) =>
|
|
112
112
|
Rx.make((get) =>
|
|
113
113
|
pipe(
|
|
@@ -115,10 +115,10 @@ export default (context: PluginContext) =>
|
|
|
115
115
|
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
116
116
|
Option.map(() => [
|
|
117
117
|
{
|
|
118
|
-
id: `${
|
|
118
|
+
id: `${meta.id}/load-by-url`,
|
|
119
119
|
data: async () => {},
|
|
120
120
|
properties: {
|
|
121
|
-
label: ['load by url label', { ns:
|
|
121
|
+
label: ['load by url label', { ns: meta.id }],
|
|
122
122
|
icon: 'ph--cloud-arrow-down--regular',
|
|
123
123
|
disabled: true,
|
|
124
124
|
},
|
|
@@ -129,7 +129,7 @@ export default (context: PluginContext) =>
|
|
|
129
129
|
),
|
|
130
130
|
}),
|
|
131
131
|
createExtension({
|
|
132
|
-
id: `${
|
|
132
|
+
id: `${meta.id}/plugins`,
|
|
133
133
|
connector: (node) =>
|
|
134
134
|
Rx.make((get) =>
|
|
135
135
|
pipe(
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
contributes,
|
|
7
|
-
SettingsAction,
|
|
8
|
-
createResolver,
|
|
9
|
-
LayoutAction,
|
|
10
6
|
Capabilities,
|
|
7
|
+
LayoutAction,
|
|
8
|
+
SettingsAction,
|
|
9
|
+
contributes,
|
|
11
10
|
createIntent,
|
|
11
|
+
createResolver,
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
13
|
|
|
14
14
|
import { REGISTRY_ID } from '../meta';
|
|
@@ -4,16 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createSurface,
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
7
|
+
import { Capabilities, Plugin, contributes, createSurface, usePluginManager } from '@dxos/app-framework';
|
|
9
8
|
|
|
10
9
|
import { PluginDetail, RegistryContainer } from '../components';
|
|
11
|
-
import { REGISTRY_KEY,
|
|
10
|
+
import { REGISTRY_KEY, meta } from '../meta';
|
|
12
11
|
|
|
13
12
|
export default () =>
|
|
14
13
|
contributes(Capabilities.ReactSurface, [
|
|
15
14
|
createSurface({
|
|
16
|
-
id: `${
|
|
15
|
+
id: `${meta.id}/all`,
|
|
17
16
|
role: 'article',
|
|
18
17
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
19
18
|
component: () => {
|
|
@@ -24,7 +23,7 @@ export default () =>
|
|
|
24
23
|
},
|
|
25
24
|
}),
|
|
26
25
|
createSurface({
|
|
27
|
-
id: `${
|
|
26
|
+
id: `${meta.id}/installed`,
|
|
28
27
|
role: 'article',
|
|
29
28
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
30
29
|
component: () => {
|
|
@@ -41,7 +40,7 @@ export default () =>
|
|
|
41
40
|
},
|
|
42
41
|
}),
|
|
43
42
|
createSurface({
|
|
44
|
-
id: `${
|
|
43
|
+
id: `${meta.id}/recommended`,
|
|
45
44
|
role: 'article',
|
|
46
45
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
47
46
|
component: () => {
|
|
@@ -58,7 +57,7 @@ export default () =>
|
|
|
58
57
|
},
|
|
59
58
|
}),
|
|
60
59
|
createSurface({
|
|
61
|
-
id: `${
|
|
60
|
+
id: `${meta.id}/labs`,
|
|
62
61
|
role: 'article',
|
|
63
62
|
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
|
|
64
63
|
component: () => {
|
|
@@ -69,7 +68,7 @@ export default () =>
|
|
|
69
68
|
},
|
|
70
69
|
}),
|
|
71
70
|
createSurface({
|
|
72
|
-
id: `${
|
|
71
|
+
id: `${meta.id}/plugin-details`,
|
|
73
72
|
role: 'article',
|
|
74
73
|
filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
|
|
75
74
|
component: ({ data: { subject } }) => {
|
|
@@ -80,11 +79,7 @@ export default () =>
|
|
|
80
79
|
[manager, subject.meta.id, enabled],
|
|
81
80
|
);
|
|
82
81
|
|
|
83
|
-
return
|
|
84
|
-
<StackItem.Content role='article'>
|
|
85
|
-
<PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />
|
|
86
|
-
</StackItem.Content>
|
|
87
|
-
);
|
|
82
|
+
return <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />;
|
|
88
83
|
},
|
|
89
84
|
}),
|
|
90
85
|
]);
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { type Meta } from '@storybook/react-vite';
|
|
9
|
-
import React, { forwardRef, type SVGProps, type ReactElement } from 'react';
|
|
5
|
+
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import React, { type ReactElement, type SVGProps, forwardRef } from 'react';
|
|
10
8
|
|
|
9
|
+
import { Icon } from '@dxos/react-ui';
|
|
10
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -89,19 +89,22 @@ const DefaultStory = () => {
|
|
|
89
89
|
return (
|
|
90
90
|
<div className='flex gap-4 p-8 ring'>
|
|
91
91
|
<CustomIcon weight={'regular'} className={mx(getSize(8))} />
|
|
92
|
-
<
|
|
92
|
+
<Icon icon='ph--github-logo--regular' classNames={mx(getSize(8))} />
|
|
93
93
|
</div>
|
|
94
94
|
);
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
export const Default = {};
|
|
97
|
+
export const Default: Story = {};
|
|
98
98
|
|
|
99
|
-
const meta
|
|
99
|
+
const meta = {
|
|
100
100
|
title: 'plugins/plugin-registry/Icon',
|
|
101
101
|
render: DefaultStory,
|
|
102
|
+
decorators: [withTheme],
|
|
102
103
|
parameters: {
|
|
103
104
|
layout: 'centered',
|
|
104
105
|
},
|
|
105
|
-
}
|
|
106
|
+
} satisfies Meta<typeof IconBase>;
|
|
106
107
|
|
|
107
108
|
export default meta;
|
|
109
|
+
|
|
110
|
+
type Story = StoryObj<typeof meta>;
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
9
7
|
import { faker } from '@dxos/random';
|
|
10
|
-
import {
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
|
-
import { PluginDetail, type PluginDetailProps } from './PluginDetail';
|
|
13
10
|
import { translations } from '../translations';
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
import { PluginDetail } from './PluginDetail';
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
16
15
|
title: 'plugins/plugin-registry/PluginDetail',
|
|
17
16
|
component: PluginDetail,
|
|
18
|
-
decorators: [withTheme
|
|
17
|
+
decorators: [withTheme],
|
|
19
18
|
parameters: {
|
|
19
|
+
layout: 'column',
|
|
20
20
|
translations,
|
|
21
21
|
},
|
|
22
|
-
}
|
|
22
|
+
} satisfies Meta<typeof PluginDetail>;
|
|
23
23
|
|
|
24
24
|
export default meta;
|
|
25
25
|
|
|
26
|
-
type Story = StoryObj<
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
27
|
|
|
28
28
|
export const Default: Story = {
|
|
29
29
|
args: {
|
|
@@ -6,9 +6,9 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Plugin } from '@dxos/app-framework';
|
|
8
8
|
import { Icon, Input, Link, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import {
|
|
9
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export type PluginDetailProps = {
|
|
14
14
|
plugin: Plugin;
|
|
@@ -17,47 +17,49 @@ export type PluginDetailProps = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {
|
|
20
|
-
const { t } = useTranslation(
|
|
20
|
+
const { t } = useTranslation(meta.id);
|
|
21
21
|
const { id, name, description, homePage, source, screenshots } = plugin.meta;
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
<div role='none' className='
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
<Input.
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<StackItem.Content classNames='block overflow-y-auto'>
|
|
25
|
+
<div role='none' className='container-max-width p-4'>
|
|
26
|
+
<div role='none' className='flex justify-between items-center'>
|
|
27
|
+
<p>{id}</p>
|
|
28
|
+
<Input.Root>
|
|
29
|
+
<Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />
|
|
30
|
+
</Input.Root>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
{screenshots && screenshots.length > 0 && (
|
|
34
|
+
<div role='none'>
|
|
35
|
+
<h1 className='text-lg mb-2'>Preview</h1>
|
|
36
|
+
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
31
39
|
|
|
32
|
-
{screenshots && screenshots.length > 0 && (
|
|
33
40
|
<div role='none'>
|
|
34
|
-
<
|
|
35
|
-
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
41
|
+
<p>{description}</p>
|
|
36
42
|
</div>
|
|
37
|
-
)}
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
<div role='none'>
|
|
45
|
+
<h1 className='text-lg mb-2'>Resources</h1>
|
|
46
|
+
<div className='flex gap-2'>
|
|
47
|
+
{homePage && (
|
|
48
|
+
<Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
49
|
+
{t('home page label')}
|
|
50
|
+
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
51
|
+
</Link>
|
|
52
|
+
)}
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</Link>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
{source && (
|
|
54
|
-
<Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
55
|
-
{t('source label')}
|
|
56
|
-
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
57
|
-
</Link>
|
|
58
|
-
)}
|
|
54
|
+
{source && (
|
|
55
|
+
<Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
56
|
+
{t('source label')}
|
|
57
|
+
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
58
|
+
</Link>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
59
61
|
</div>
|
|
60
62
|
</div>
|
|
61
|
-
</
|
|
63
|
+
</StackItem.Content>
|
|
62
64
|
);
|
|
63
65
|
};
|
|
@@ -8,7 +8,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
8
8
|
import { Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export type PluginItemProps = {
|
|
14
14
|
plugin: Plugin;
|
|
@@ -28,7 +28,7 @@ export const PluginItem = ({
|
|
|
28
28
|
hasSettings: _hasSettings,
|
|
29
29
|
onSettings,
|
|
30
30
|
}: PluginItemProps) => {
|
|
31
|
-
const { t } = useTranslation(
|
|
31
|
+
const { t } = useTranslation(meta.id);
|
|
32
32
|
const { id, name, description, tags, icon = 'ph--circle--regular' } = plugin.meta;
|
|
33
33
|
const isEnabled = enabled.includes(id);
|
|
34
34
|
const inputId = `${id}-input`;
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { type Plugin, definePlugin } from '@dxos/app-framework';
|
|
11
9
|
import { faker } from '@dxos/random';
|
|
12
10
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
12
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
|
-
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
15
13
|
|
|
16
|
-
import { PluginList } from './PluginList';
|
|
17
14
|
import { translations } from '../translations';
|
|
18
15
|
|
|
16
|
+
import { PluginList } from './PluginList';
|
|
17
|
+
|
|
19
18
|
faker.seed(1);
|
|
20
19
|
|
|
21
20
|
const icons = [
|
|
@@ -30,21 +29,20 @@ const icons = [
|
|
|
30
29
|
const DefaultStory = ({ classNames }: ThemedClassName<{}>) => {
|
|
31
30
|
const [plugins] = useState<Plugin[]>(
|
|
32
31
|
faker.helpers.multiple(
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
),
|
|
32
|
+
definePlugin(
|
|
33
|
+
{
|
|
34
|
+
id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
|
|
35
|
+
name: `${faker.commerce.productName()}`,
|
|
36
|
+
description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
|
|
37
|
+
tags: faker.datatype.boolean({ probability: 0.6 })
|
|
38
|
+
? [faker.helpers.arrayElement(['labs', 'beta', 'alpha', 'stable', 'new', '新発売'])]
|
|
39
|
+
: undefined,
|
|
40
|
+
icon: faker.helpers.arrayElement(icons),
|
|
41
|
+
homePage: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.url() : undefined,
|
|
42
|
+
source: faker.internet.url(),
|
|
43
|
+
},
|
|
44
|
+
() => [],
|
|
45
|
+
),
|
|
48
46
|
{ count: 16 },
|
|
49
47
|
),
|
|
50
48
|
);
|
|
@@ -61,21 +59,24 @@ const DefaultStory = ({ classNames }: ThemedClassName<{}>) => {
|
|
|
61
59
|
);
|
|
62
60
|
};
|
|
63
61
|
|
|
64
|
-
const meta
|
|
62
|
+
const meta = {
|
|
65
63
|
title: 'plugins/plugin-registry/PluginList',
|
|
66
64
|
component: PluginList,
|
|
67
65
|
render: DefaultStory,
|
|
68
|
-
decorators: [withTheme
|
|
66
|
+
decorators: [withTheme],
|
|
69
67
|
parameters: {
|
|
68
|
+
layout: 'column',
|
|
70
69
|
translations,
|
|
71
70
|
},
|
|
72
|
-
}
|
|
71
|
+
} satisfies Meta<typeof PluginList>;
|
|
73
72
|
|
|
74
73
|
export default meta;
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
type Story = StoryObj<typeof meta>;
|
|
76
|
+
|
|
77
|
+
export const Default: Story = {};
|
|
77
78
|
|
|
78
|
-
export const Column = {
|
|
79
|
+
export const Column: Story = {
|
|
79
80
|
args: {
|
|
80
81
|
classNames: 'w-[30rem]',
|
|
81
82
|
},
|