@dxos/plugin-registry 0.7.5-labs.e27f9b9 → 0.7.5-labs.f400bbc
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-PPWF5KP5.mjs → app-graph-builder-Z6FZXJWI.mjs} +10 -10
- package/dist/lib/browser/{app-graph-builder-PPWF5KP5.mjs.map → app-graph-builder-Z6FZXJWI.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-RGSIE33X.mjs → chunk-H6GNIIDK.mjs} +2 -2
- package/dist/lib/browser/{chunk-RGSIE33X.mjs.map → chunk-H6GNIIDK.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +9 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-2JQUQJI5.mjs → intent-resolver-QW333HWJ.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-HTHYQQF7.mjs → react-surface-6JN3QJEF.mjs} +69 -40
- package/dist/lib/browser/react-surface-6JN3QJEF.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +110 -110
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +110 -110
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail.d.ts +1 -2
- package/dist/types/src/components/PluginDetail.d.ts.map +1 -1
- package/dist/types/src/components/PluginItem.d.ts +3 -2
- package/dist/types/src/components/PluginItem.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.d.ts +1 -2
- package/dist/types/src/components/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/RegistryContainer.d.ts +1 -2
- package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +17 -16
- package/src/RegistryPlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +8 -8
- package/src/capabilities/react-surface.tsx +8 -8
- package/src/components/PluginDetail.tsx +1 -1
- package/src/components/PluginItem.tsx +44 -16
- package/src/components/PluginList.stories.tsx +1 -1
- package/src/components/RegistryContainer.tsx +57 -27
- package/src/meta.ts +1 -1
- package/src/translations.ts +2 -0
- package/dist/lib/browser/react-surface-HTHYQQF7.mjs.map +0 -7
- /package/dist/lib/browser/{intent-resolver-2JQUQJI5.mjs.map → intent-resolver-QW333HWJ.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;qBAG0lG,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,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AAiB;;2BAAkE,iBAAiB;qFAHr1V,CAAC;AACzE,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type Plugin } from '@dxos/app-framework';
|
|
3
2
|
export type PluginDetailProps = {
|
|
4
3
|
plugin: Plugin;
|
|
5
4
|
enabled?: boolean;
|
|
6
5
|
onEnable?: () => void;
|
|
7
6
|
};
|
|
8
|
-
export declare const PluginDetail: ({ plugin, enabled, onEnable }: PluginDetailProps) =>
|
|
7
|
+
export declare const PluginDetail: ({ plugin, enabled, onEnable }: PluginDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
//# sourceMappingURL=PluginDetail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,kCAAmC,iBAAiB,4CA4C5E,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type Plugin } from '@dxos/app-framework';
|
|
3
2
|
export type PluginItemProps = {
|
|
4
3
|
plugin: Plugin;
|
|
@@ -6,6 +5,8 @@ export type PluginItemProps = {
|
|
|
6
5
|
enabled?: readonly string[];
|
|
7
6
|
onClick?: (id: string) => void;
|
|
8
7
|
onChange?: (id: string, enabled: boolean) => void;
|
|
8
|
+
hasSettings?: (id: string) => boolean;
|
|
9
|
+
onSettings?: (id: string) => void;
|
|
9
10
|
};
|
|
10
|
-
export declare const PluginItem: ({ plugin, enabled, onClick, onChange }: PluginItemProps) =>
|
|
11
|
+
export declare const PluginItem: ({ plugin, enabled, onClick, onChange, hasSettings: _hasSettings, onSettings, }: PluginItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
//# sourceMappingURL=PluginItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginItem.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PluginItem.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,UAAU,mFAOpB,eAAe,4CAkGjB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type Plugin } from '@dxos/app-framework';
|
|
3
2
|
import { type PluginItemProps } from './PluginItem';
|
|
4
3
|
export type PluginListProps = Omit<PluginItemProps, 'plugin'> & {
|
|
5
4
|
plugins?: readonly Plugin[];
|
|
6
5
|
};
|
|
7
|
-
export declare const PluginList: ({ plugins, ...props }: PluginListProps) =>
|
|
6
|
+
export declare const PluginList: ({ plugins, ...props }: PluginListProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
//# sourceMappingURL=PluginList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG;IAC9D,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,UAAU,0BAAgC,eAAe,4CAUrE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type Plugin } from '@dxos/app-framework';
|
|
3
2
|
export declare const RegistryContainer: ({ id, plugins: _plugins }: {
|
|
4
3
|
id: string;
|
|
5
4
|
plugins: Plugin[];
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=RegistryContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/RegistryContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RegistryContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/RegistryContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,MAAM,EAKZ,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,iBAAiB,8BAA+B;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,4CAyD7F,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const REGISTRY_PLUGIN = "dxos.org/plugin/registry";
|
|
2
|
-
export declare const REGISTRY_ID = "dxos:plugin-registry";
|
|
2
|
+
export declare const REGISTRY_ID = "!dxos:plugin-registry";
|
|
3
3
|
export declare const REGISTRY_KEY = "plugin-registry";
|
|
4
4
|
export declare const meta: {
|
|
5
5
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAG1D,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAG1D,eAAO,MAAM,WAAW,0BAA0B,CAAC;AACnD,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAE9C,eAAO,MAAM,IAAI;;;CAGK,CAAC"}
|
|
@@ -7,6 +7,7 @@ declare const _default: {
|
|
|
7
7
|
'settings section installed label': string;
|
|
8
8
|
'settings section recommended label': string;
|
|
9
9
|
'settings section experimental label': string;
|
|
10
|
+
'details label': string;
|
|
10
11
|
'home page label': string;
|
|
11
12
|
'source label': string;
|
|
12
13
|
'plugin registry label': string;
|
|
@@ -18,6 +19,7 @@ declare const _default: {
|
|
|
18
19
|
'load by url label': string;
|
|
19
20
|
'coming soon label': string;
|
|
20
21
|
'open plugin registry label': string;
|
|
22
|
+
'settings label': string;
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA0BE"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-registry",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.f400bbc",
|
|
4
4
|
"description": "Braneframe plugin gallery",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -22,15 +23,15 @@
|
|
|
22
23
|
"src"
|
|
23
24
|
],
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@dxos/app-framework": "0.7.5-labs.
|
|
26
|
-
"@dxos/echo-schema": "0.7.5-labs.
|
|
27
|
-
"@dxos/invariant": "0.7.5-labs.
|
|
28
|
-
"@dxos/live-object": "0.7.5-labs.
|
|
29
|
-
"@dxos/plugin-
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
26
|
+
"@dxos/app-framework": "0.7.5-labs.f400bbc",
|
|
27
|
+
"@dxos/echo-schema": "0.7.5-labs.f400bbc",
|
|
28
|
+
"@dxos/invariant": "0.7.5-labs.f400bbc",
|
|
29
|
+
"@dxos/live-object": "0.7.5-labs.f400bbc",
|
|
30
|
+
"@dxos/plugin-observability": "0.7.5-labs.f400bbc",
|
|
31
|
+
"@dxos/react-ui-form": "0.7.5-labs.f400bbc",
|
|
32
|
+
"@dxos/plugin-graph": "0.7.5-labs.f400bbc",
|
|
33
|
+
"@dxos/react-ui-stack": "0.7.5-labs.f400bbc",
|
|
34
|
+
"@dxos/util": "0.7.5-labs.f400bbc"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -39,17 +40,17 @@
|
|
|
39
40
|
"react": "~18.2.0",
|
|
40
41
|
"react-dom": "~18.2.0",
|
|
41
42
|
"vite": "5.4.7",
|
|
42
|
-
"@dxos/random": "0.7.5-labs.
|
|
43
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
44
|
-
"@dxos/react-ui
|
|
45
|
-
"@dxos/storybook-utils": "0.7.5-labs.
|
|
43
|
+
"@dxos/random": "0.7.5-labs.f400bbc",
|
|
44
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc",
|
|
45
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc",
|
|
46
|
+
"@dxos/storybook-utils": "0.7.5-labs.f400bbc"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"@phosphor-icons/react": "^2.1.5",
|
|
49
50
|
"react": "~18.2.0",
|
|
50
51
|
"react-dom": "~18.2.0",
|
|
51
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
52
|
-
"@dxos/react-ui
|
|
52
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc",
|
|
53
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc"
|
|
53
54
|
},
|
|
54
55
|
"publishConfig": {
|
|
55
56
|
"access": "public"
|
package/src/RegistryPlugin.tsx
CHANGED
|
@@ -17,12 +17,12 @@ export const RegistryPlugin = () =>
|
|
|
17
17
|
}),
|
|
18
18
|
defineModule({
|
|
19
19
|
id: `${meta.id}/module/react-surface`,
|
|
20
|
-
activatesOn: Events.
|
|
20
|
+
activatesOn: Events.SetupReactSurface,
|
|
21
21
|
activate: ReactSurface,
|
|
22
22
|
}),
|
|
23
23
|
defineModule({
|
|
24
24
|
id: `${meta.id}/module/intent-resolver`,
|
|
25
|
-
activatesOn: Events.
|
|
25
|
+
activatesOn: Events.SetupIntentResolver,
|
|
26
26
|
activate: IntentResolver,
|
|
27
27
|
}),
|
|
28
28
|
defineModule({
|
|
@@ -41,9 +41,9 @@ export default (context: PluginsContext) =>
|
|
|
41
41
|
},
|
|
42
42
|
nodes: [
|
|
43
43
|
{
|
|
44
|
-
id: `${REGISTRY_KEY}
|
|
44
|
+
id: `${REGISTRY_KEY}+all`,
|
|
45
45
|
type: 'category',
|
|
46
|
-
data: `${REGISTRY_KEY}
|
|
46
|
+
data: `${REGISTRY_KEY}+all`,
|
|
47
47
|
properties: {
|
|
48
48
|
label: ['all plugins label', { ns: REGISTRY_PLUGIN }],
|
|
49
49
|
icon: 'ph--squares-four--regular',
|
|
@@ -52,9 +52,9 @@ export default (context: PluginsContext) =>
|
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
id: `${REGISTRY_KEY}
|
|
55
|
+
id: `${REGISTRY_KEY}+installed`,
|
|
56
56
|
type: 'category',
|
|
57
|
-
data: `${REGISTRY_KEY}
|
|
57
|
+
data: `${REGISTRY_KEY}+installed`,
|
|
58
58
|
properties: {
|
|
59
59
|
label: ['installed plugins label', { ns: REGISTRY_PLUGIN }],
|
|
60
60
|
icon: 'ph--check--regular',
|
|
@@ -63,9 +63,9 @@ export default (context: PluginsContext) =>
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
id: `${REGISTRY_KEY}
|
|
66
|
+
id: `${REGISTRY_KEY}+recommended`,
|
|
67
67
|
type: 'category',
|
|
68
|
-
data: `${REGISTRY_KEY}
|
|
68
|
+
data: `${REGISTRY_KEY}+recommended`,
|
|
69
69
|
properties: {
|
|
70
70
|
label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],
|
|
71
71
|
icon: 'ph--star--regular',
|
|
@@ -74,9 +74,9 @@ export default (context: PluginsContext) =>
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
id: `${REGISTRY_KEY}
|
|
77
|
+
id: `${REGISTRY_KEY}+experimental`,
|
|
78
78
|
type: 'category',
|
|
79
|
-
data: `${REGISTRY_KEY}
|
|
79
|
+
data: `${REGISTRY_KEY}+experimental`,
|
|
80
80
|
properties: {
|
|
81
81
|
label: ['experimental plugins label', { ns: REGISTRY_PLUGIN }],
|
|
82
82
|
icon: 'ph--flask--regular',
|
|
@@ -15,18 +15,18 @@ export default () =>
|
|
|
15
15
|
createSurface({
|
|
16
16
|
id: `${REGISTRY_PLUGIN}/all`,
|
|
17
17
|
role: 'article',
|
|
18
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}
|
|
18
|
+
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
19
19
|
component: () => {
|
|
20
20
|
const manager = usePluginManager();
|
|
21
21
|
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
|
|
22
22
|
|
|
23
|
-
return <RegistryContainer id={`${REGISTRY_KEY}
|
|
23
|
+
return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
|
|
24
24
|
},
|
|
25
25
|
}),
|
|
26
26
|
createSurface({
|
|
27
27
|
id: `${REGISTRY_PLUGIN}/installed`,
|
|
28
28
|
role: 'article',
|
|
29
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}
|
|
29
|
+
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
30
30
|
component: () => {
|
|
31
31
|
const manager = usePluginManager();
|
|
32
32
|
const filtered = useMemo(
|
|
@@ -37,13 +37,13 @@ export default () =>
|
|
|
37
37
|
[],
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
return <RegistryContainer id={`${REGISTRY_KEY}
|
|
40
|
+
return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
|
|
41
41
|
},
|
|
42
42
|
}),
|
|
43
43
|
createSurface({
|
|
44
44
|
id: `${REGISTRY_PLUGIN}/recommended`,
|
|
45
45
|
role: 'article',
|
|
46
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}
|
|
46
|
+
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
47
47
|
component: () => {
|
|
48
48
|
const manager = usePluginManager();
|
|
49
49
|
const filtered = useMemo(
|
|
@@ -54,18 +54,18 @@ export default () =>
|
|
|
54
54
|
[],
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
return <RegistryContainer id={`${REGISTRY_KEY}
|
|
57
|
+
return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
|
|
58
58
|
},
|
|
59
59
|
}),
|
|
60
60
|
createSurface({
|
|
61
61
|
id: `${REGISTRY_PLUGIN}/experimental`,
|
|
62
62
|
role: 'article',
|
|
63
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}
|
|
63
|
+
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+experimental`,
|
|
64
64
|
component: () => {
|
|
65
65
|
const manager = usePluginManager();
|
|
66
66
|
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('experimental')), []);
|
|
67
67
|
|
|
68
|
-
return <RegistryContainer id={`${REGISTRY_KEY}
|
|
68
|
+
return <RegistryContainer id={`${REGISTRY_KEY}+experimental`} plugins={filtered} />;
|
|
69
69
|
},
|
|
70
70
|
}),
|
|
71
71
|
createSurface({
|
|
@@ -29,7 +29,7 @@ export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) =
|
|
|
29
29
|
</Input.Root>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
{screenshots && (
|
|
32
|
+
{screenshots && screenshots.length > 0 && (
|
|
33
33
|
<div role='none'>
|
|
34
34
|
<h1 className='text-lg mb-2'>Preview</h1>
|
|
35
35
|
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
@@ -16,9 +16,18 @@ export type PluginItemProps = {
|
|
|
16
16
|
enabled?: readonly string[];
|
|
17
17
|
onClick?: (id: string) => void;
|
|
18
18
|
onChange?: (id: string, enabled: boolean) => void;
|
|
19
|
+
hasSettings?: (id: string) => boolean;
|
|
20
|
+
onSettings?: (id: string) => void;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
export const PluginItem = ({
|
|
23
|
+
export const PluginItem = ({
|
|
24
|
+
plugin,
|
|
25
|
+
enabled = [],
|
|
26
|
+
onClick,
|
|
27
|
+
onChange,
|
|
28
|
+
hasSettings: _hasSettings,
|
|
29
|
+
onSettings,
|
|
30
|
+
}: PluginItemProps) => {
|
|
22
31
|
const { t } = useTranslation(REGISTRY_PLUGIN);
|
|
23
32
|
const { id, name, description, homePage, source, icon = 'ph--circle--regular' } = plugin.meta;
|
|
24
33
|
const isEnabled = enabled.includes(id);
|
|
@@ -26,6 +35,7 @@ export const PluginItem = ({ plugin, enabled = [], onClick, onChange }: PluginIt
|
|
|
26
35
|
const labelId = `${id}-label`;
|
|
27
36
|
const descriptionId = `${id}-description`;
|
|
28
37
|
const handleClick = useCallback(() => onClick?.(id), [id, onClick]);
|
|
38
|
+
|
|
29
39
|
const handleChange = useCallback(
|
|
30
40
|
(event: React.MouseEvent) => {
|
|
31
41
|
event.stopPropagation();
|
|
@@ -34,6 +44,9 @@ export const PluginItem = ({ plugin, enabled = [], onClick, onChange }: PluginIt
|
|
|
34
44
|
[id, isEnabled, onChange],
|
|
35
45
|
);
|
|
36
46
|
|
|
47
|
+
const hasSettings = useCallback(() => _hasSettings?.(id) ?? false, [id, _hasSettings]);
|
|
48
|
+
const handleSettings = useCallback(() => onSettings?.(id), [id, onSettings]);
|
|
49
|
+
|
|
37
50
|
return (
|
|
38
51
|
<ListItem.Root
|
|
39
52
|
key={id}
|
|
@@ -41,30 +54,35 @@ export const PluginItem = ({ plugin, enabled = [], onClick, onChange }: PluginIt
|
|
|
41
54
|
data-testid={`pluginList.${id}`}
|
|
42
55
|
aria-describedby={descriptionId}
|
|
43
56
|
classNames='w-full h-full grid grid-cols-[48px_1fr_48px] grid-rows-[40px_1fr] p-1 rounded-md border border-separator'
|
|
44
|
-
onClick={handleClick}
|
|
45
57
|
>
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
55
|
-
<div className='flex grow justify-center items-center'>
|
|
58
|
+
<div className='flex grow justify-center items-center'>
|
|
59
|
+
<Icon icon={icon} size={6} onClick={handleClick} classNames='text-subdued cursor-pointer' />
|
|
60
|
+
</div>
|
|
61
|
+
<div className='flex grow items-center truncate cursor-pointer' onClick={handleClick}>
|
|
62
|
+
{name ?? id}
|
|
63
|
+
</div>
|
|
64
|
+
<div className='flex grow justify-center items-center'>
|
|
65
|
+
<Input.Root id={inputId}>
|
|
56
66
|
<Input.Switch classNames='self-center' checked={isEnabled} onClick={handleChange} />
|
|
57
|
-
</
|
|
58
|
-
</
|
|
67
|
+
</Input.Root>
|
|
68
|
+
</div>
|
|
59
69
|
|
|
60
70
|
<div />
|
|
61
71
|
{(description || homePage || source) && (
|
|
62
|
-
<div id={descriptionId} className='col-span-2 flex flex-col w-full gap-2 pb-3
|
|
72
|
+
<div id={descriptionId} className='col-span-2 flex flex-col w-full gap-2 pb-3'>
|
|
63
73
|
<div className='grow'>
|
|
64
|
-
<p className={mx(descriptionText, 'line-clamp-3 min-w-0')}>{description}</p>
|
|
74
|
+
<p className={mx(descriptionText, 'line-clamp-3 min-w-0 pie-4')}>{description}</p>
|
|
65
75
|
</div>
|
|
66
76
|
|
|
67
77
|
<div className='flex gap-2 items-center'>
|
|
78
|
+
<Link
|
|
79
|
+
aria-describedby={descriptionId}
|
|
80
|
+
classNames='text-sm text-description cursor-pointer'
|
|
81
|
+
onClick={handleClick}
|
|
82
|
+
>
|
|
83
|
+
{t('details label')}
|
|
84
|
+
</Link>
|
|
85
|
+
|
|
68
86
|
{homePage && (
|
|
69
87
|
<Link
|
|
70
88
|
href={homePage}
|
|
@@ -92,6 +110,16 @@ export const PluginItem = ({ plugin, enabled = [], onClick, onChange }: PluginIt
|
|
|
92
110
|
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
93
111
|
</Link>
|
|
94
112
|
)}
|
|
113
|
+
|
|
114
|
+
{hasSettings?.() && (
|
|
115
|
+
<Link
|
|
116
|
+
aria-describedby={descriptionId}
|
|
117
|
+
classNames='text-sm text-description cursor-pointer'
|
|
118
|
+
onClick={handleSettings}
|
|
119
|
+
>
|
|
120
|
+
{t('settings label')}
|
|
121
|
+
</Link>
|
|
122
|
+
)}
|
|
95
123
|
</div>
|
|
96
124
|
</div>
|
|
97
125
|
)}
|
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Capabilities,
|
|
9
|
+
createIntent,
|
|
10
|
+
LayoutAction,
|
|
11
|
+
type Plugin,
|
|
12
|
+
SettingsAction,
|
|
13
|
+
useCapability,
|
|
14
|
+
useIntentDispatcher,
|
|
15
|
+
usePluginManager,
|
|
16
|
+
} from '@dxos/app-framework';
|
|
8
17
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
9
18
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
19
|
|
|
@@ -16,36 +25,57 @@ export const RegistryContainer = ({ id, plugins: _plugins }: { id: string; plugi
|
|
|
16
25
|
const manager = usePluginManager();
|
|
17
26
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
27
|
const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [_plugins]);
|
|
28
|
+
const settingsStore = useCapability(Capabilities.SettingsStore);
|
|
19
29
|
|
|
20
30
|
// TODO(wittjosiah): Factor out to an intent?
|
|
21
|
-
const handleChange =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
const handleChange = useCallback(
|
|
32
|
+
async (id: string, enabled: boolean) => {
|
|
33
|
+
if (enabled) {
|
|
34
|
+
await manager.enable(id);
|
|
35
|
+
} else {
|
|
36
|
+
await manager.disable(id);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
await dispatch(
|
|
40
|
+
createIntent(ObservabilityAction.SendEvent, {
|
|
41
|
+
name: 'plugins.toggle',
|
|
42
|
+
properties: { plugin: id, enabled },
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
[dispatch, manager],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const handleClick = useCallback(
|
|
50
|
+
(pluginId: string) =>
|
|
51
|
+
dispatch(
|
|
52
|
+
createIntent(LayoutAction.Open, {
|
|
53
|
+
part: 'main',
|
|
54
|
+
// TODO(wittjosiah): `/` currently is not supported in ids.
|
|
55
|
+
subject: [pluginId.replaceAll('/', ':')],
|
|
56
|
+
options: { pivotId: id, positioning: 'end' },
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
[dispatch, id],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const hasSettings = useCallback((pluginId: string) => !!settingsStore.getStore(pluginId), [settingsStore]);
|
|
63
|
+
|
|
64
|
+
const handleSettings = useCallback(
|
|
65
|
+
(pluginId: string) => dispatch(createIntent(SettingsAction.Open, { plugin: pluginId })),
|
|
66
|
+
[dispatch],
|
|
67
|
+
);
|
|
45
68
|
|
|
46
69
|
return (
|
|
47
70
|
<StackItem.Content toolbar={false} role='article' classNames='overflow-x-hidden overflow-y-auto'>
|
|
48
|
-
<PluginList
|
|
71
|
+
<PluginList
|
|
72
|
+
plugins={plugins}
|
|
73
|
+
enabled={manager.enabled}
|
|
74
|
+
onClick={handleClick}
|
|
75
|
+
onChange={handleChange}
|
|
76
|
+
hasSettings={hasSettings}
|
|
77
|
+
onSettings={handleSettings}
|
|
78
|
+
/>
|
|
49
79
|
</StackItem.Content>
|
|
50
80
|
);
|
|
51
81
|
};
|
package/src/meta.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
7
7
|
export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
|
|
8
8
|
|
|
9
9
|
// TODO(wittjosiah): Deck does not currently support `/` in ids.
|
|
10
|
-
export const REGISTRY_ID = 'dxos:plugin-registry';
|
|
10
|
+
export const REGISTRY_ID = '!dxos:plugin-registry';
|
|
11
11
|
export const REGISTRY_KEY = 'plugin-registry';
|
|
12
12
|
|
|
13
13
|
export const meta = {
|
package/src/translations.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default [
|
|
|
14
14
|
'settings section installed label': 'Enabled',
|
|
15
15
|
'settings section recommended label': 'Recommended',
|
|
16
16
|
'settings section experimental label': 'Experimental',
|
|
17
|
+
'details label': 'Details',
|
|
17
18
|
'home page label': 'Website',
|
|
18
19
|
'source label': 'Source',
|
|
19
20
|
'plugin registry label': 'Plugin Registry',
|
|
@@ -25,6 +26,7 @@ export default [
|
|
|
25
26
|
'load by url label': 'Load by URL (soon)',
|
|
26
27
|
'coming soon label': 'Coming soon!',
|
|
27
28
|
'open plugin registry label': 'Open plugin registry',
|
|
29
|
+
'settings label': 'Settings',
|
|
28
30
|
},
|
|
29
31
|
},
|
|
30
32
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/PluginDetail.tsx", "../../../src/components/PluginList.tsx", "../../../src/components/PluginItem.tsx", "../../../src/components/RegistryContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Capabilities, contributes, createSurface, Plugin, usePluginManager } from '@dxos/app-framework';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { PluginDetail, RegistryContainer } from '../components';\nimport { REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${REGISTRY_PLUGIN}/all`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}:all`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);\n\n return <RegistryContainer id={`${REGISTRY_KEY}:all`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/installed`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}:installed`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(\n () =>\n manager.plugins\n .filter(({ meta }) => !manager.core.includes(meta.id))\n .filter(({ meta }) => manager.enabled.includes(meta.id)),\n [],\n );\n\n return <RegistryContainer id={`${REGISTRY_KEY}:installed`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/recommended`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}:recommended`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(\n () =>\n manager.plugins\n .filter(({ meta }) => !manager.core.includes(meta.id))\n .filter(({ meta }) => !meta.tags?.includes('experimental')),\n [],\n );\n\n return <RegistryContainer id={`${REGISTRY_KEY}:recommended`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/experimental`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}:experimental`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('experimental')), []);\n\n return <RegistryContainer id={`${REGISTRY_KEY}:experimental`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/plugin-details`,\n role: 'article',\n filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,\n component: ({ data: { subject } }) => {\n const manager = usePluginManager();\n const enabled = manager.enabled.includes(subject.meta.id);\n const handleEnable = useCallback(\n () => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),\n [manager, subject.meta.id, enabled],\n );\n\n return (\n <StackItem.Content role='article' toolbar={false}>\n <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />\n </StackItem.Content>\n );\n },\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { Icon, Input, Link, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormContainer } from '@dxos/react-ui-form';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport type PluginDetailProps = {\n plugin: Plugin;\n enabled?: boolean;\n onEnable?: () => void;\n};\n\nexport const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { id, name, description, homePage, source, screenshots } = plugin.meta;\n\n return (\n <DeprecatedFormContainer classNames='gap-6'>\n <div role='none' className='flex justify-between items-center'>\n <p>{id}</p>\n <Input.Root>\n <Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />\n </Input.Root>\n </div>\n\n {screenshots && (\n <div role='none'>\n <h1 className='text-lg mb-2'>Preview</h1>\n <img src={screenshots[0]} alt={name} className='aspect-video object-fit' />\n </div>\n )}\n\n <div role='none'>\n <p>{description}</p>\n </div>\n\n <div role='none'>\n <h1 className='text-lg mb-2'>Resources</h1>\n <div className='flex gap-2'>\n {homePage && (\n <Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('home page label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n\n {source && (\n <Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('source label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n </div>\n </div>\n </DeprecatedFormContainer>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { List } from '@dxos/react-ui';\n\nimport { PluginItem, type PluginItemProps } from './PluginItem';\n\nexport type PluginListProps = Omit<PluginItemProps, 'plugin'> & {\n plugins?: readonly Plugin[];\n};\n\nexport const PluginList = ({ plugins = [], ...props }: PluginListProps) => {\n return (\n <List classNames='grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] auto-rows-[10rem] gap-3 p-3 overflow-y-auto scrollbar-thin'>\n {plugins.map((plugin) => (\n <div key={plugin.meta.id} className='flex'>\n <PluginItem plugin={plugin} {...props} />\n </div>\n ))}\n </List>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { Icon, Input, Link, ListItem, useTranslation } from '@dxos/react-ui';\nimport { descriptionText, mx } from '@dxos/react-ui-theme';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport type PluginItemProps = {\n plugin: Plugin;\n installed?: readonly string[];\n enabled?: readonly string[];\n onClick?: (id: string) => void;\n onChange?: (id: string, enabled: boolean) => void;\n};\n\nexport const PluginItem = ({ plugin, enabled = [], onClick, onChange }: PluginItemProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { id, name, description, homePage, source, icon = 'ph--circle--regular' } = plugin.meta;\n const isEnabled = enabled.includes(id);\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n const handleClick = useCallback(() => onClick?.(id), [id, onClick]);\n const handleChange = useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation();\n onChange?.(id, !isEnabled);\n },\n [id, isEnabled, onChange],\n );\n\n return (\n <ListItem.Root\n key={id}\n labelId={labelId}\n data-testid={`pluginList.${id}`}\n aria-describedby={descriptionId}\n classNames='w-full h-full grid grid-cols-[48px_1fr_48px] grid-rows-[40px_1fr] p-1 rounded-md border border-separator'\n onClick={handleClick}\n >\n <Input.Root id={inputId}>\n <div className='flex grow justify-center items-center'>\n <Icon icon={icon} size={8} />\n </div>\n <div className='flex grow items-center'>\n <Input.Label id={labelId} classNames='truncate w-full' style={{ fontSize: 'unset' }}>\n {name ?? id}\n </Input.Label>\n </div>\n <div className='flex grow justify-center items-center'>\n <Input.Switch classNames='self-center' checked={isEnabled} onClick={handleChange} />\n </div>\n </Input.Root>\n\n <div />\n {(description || homePage || source) && (\n <div id={descriptionId} className='col-span-2 flex flex-col w-full gap-2 pb-3 overflow-y-scroll'>\n <div className='grow'>\n <p className={mx(descriptionText, 'line-clamp-3 min-w-0')}>{description}</p>\n </div>\n\n <div className='flex gap-2 items-center'>\n {homePage && (\n <Link\n href={homePage}\n target='_blank'\n rel='noreferrer'\n aria-describedby={descriptionId}\n classNames='text-sm text-description'\n onClick={(ev) => ev.stopPropagation()}\n >\n {t('home page label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n\n {source && (\n <Link\n href={source}\n target='_blank'\n rel='noreferrer'\n aria-describedby={descriptionId}\n classNames='text-sm text-description'\n onClick={(ev) => ev.stopPropagation()}\n >\n {t('source label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n </div>\n </div>\n )}\n </ListItem.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { createIntent, LayoutAction, type Plugin, useIntentDispatcher, usePluginManager } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { PluginList } from './PluginList';\n\nconst sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin, { meta: { name: b = '' } }: Plugin) => a.localeCompare(b);\n\nexport const RegistryContainer = ({ id, plugins: _plugins }: { id: string; plugins: Plugin[] }) => {\n const manager = usePluginManager();\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [_plugins]);\n\n // TODO(wittjosiah): Factor out to an intent?\n const handleChange = async (id: string, enabled: boolean) => {\n if (enabled) {\n await manager.enable(id);\n } else {\n await manager.disable(id);\n }\n\n await dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'plugins.toggle',\n properties: { plugin: id, enabled },\n }),\n );\n };\n\n const handleClick = (pluginId: string) =>\n dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n // TODO(wittjosiah): `/` currently is not supported in ids.\n subject: [pluginId.replaceAll('/', ':')],\n options: { pivotId: id, positioning: 'end' },\n }),\n );\n\n return (\n <StackItem.Content toolbar={false} role='article' classNames='overflow-x-hidden overflow-y-auto'>\n <PluginList plugins={plugins} enabled={manager.enabled} onClick={handleClick} onChange={handleChange} />\n </StackItem.Content>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,cAAcC,aAAaC,eAAeC,QAAQC,oBAAAA,yBAAwB;AACnF,SAASC,aAAAA,kBAAiB;;;ACH1B,OAAOC,WAAW;AAGlB,SAASC,MAAMC,OAAOC,MAAMC,sBAAsB;AAClD,SAASC,+BAA+B;AAUjC,IAAMC,eAAe,CAAC,EAAEC,QAAQC,SAAS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,IAAI,GAAGM,YAAAA;QAA4BM,SAASF;;IACxE;EACF,CAAA;EACAX,cAAc;IACZC,IAAI,GAAGC,eAAAA;IACPC,MAAM;IACNC,QAAQ,CAACC,SAAsBA,KAAKC,YAAY,GAAGC,YAAAA;IACnDC,WAAW,MAAA;AACT,YAAMC,UAAUC,kBAAAA;AAChB,YAAMC,WAAWC,SAAQ,MAAMH,QAAQI,QAAQT,OAAO,CAAC,EAAEU,KAAI,MAAOA,KAAKM,MAAMJ,SAAS,cAAA,CAAA,GAAkB,CAAA,CAAE;AAE5G,aAAO,gBAAAC,OAAA,cAACC,mBAAAA;QAAkBjB,IAAI,GAAGM,YAAAA;QAA6BM,SAASF;;IACzE;EACF,CAAA;EACAX,cAAc;IACZC,IAAI,GAAGC,eAAAA;IACPC,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,mBAAmBe;IACvEb,WAAW,CAAC,EAAEH,MAAM,EAAEC,QAAO,EAAE,MAAE;AAC/B,YAAMG,UAAUC,kBAAAA;AAChB,YAAMS,UAAUV,QAAQU,QAAQH,SAASV,QAAQQ,KAAKb,EAAE;AACxD,YAAMqB,eAAeC,aACnB,MAAOJ,UAAUV,QAAQe,QAAQlB,QAAQQ,KAAKb,EAAE,IAAIQ,QAAQgB,OAAOnB,QAAQQ,KAAKb,EAAE,GAClF;QAACQ;QAASH,QAAQQ,KAAKb;QAAIkB;OAAQ;AAGrC,aACE,gBAAAF,OAAA,cAACS,WAAUC,SAAO;QAACxB,MAAK;QAAUyB,SAAS;SACzC,gBAAAX,OAAA,cAACY,cAAAA;QAAaC,QAAQxB;QAASa;QAAkBY,UAAUT;;IAGjE;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "Capabilities", "contributes", "createSurface", "Plugin", "usePluginManager", "StackItem", "React", "Icon", "Input", "Link", "useTranslation", "DeprecatedFormContainer", "PluginDetail", "plugin", "enabled", "onEnable", "t", "useTranslation", "REGISTRY_PLUGIN", "id", "name", "description", "homePage", "source", "screenshots", "meta", "DeprecatedFormContainer", "classNames", "div", "role", "className", "p", "Input", "Root", "Switch", "checked", "onClick", "h1", "img", "src", "alt", "Link", "href", "target", "rel", "Icon", "icon", "size", "React", "List", "React", "useCallback", "Icon", "Input", "Link", "ListItem", "useTranslation", "descriptionText", "mx", "PluginItem", "plugin", "enabled", "onClick", "onChange", "t", "useTranslation", "REGISTRY_PLUGIN", "id", "name", "description", "homePage", "source", "icon", "meta", "isEnabled", "includes", "inputId", "labelId", "descriptionId", "handleClick", "useCallback", "handleChange", "event", "stopPropagation", "React", "ListItem", "Root", "key", "data-testid", "aria-describedby", "classNames", "Input", "div", "className", "Icon", "size", "Label", "style", "fontSize", "Switch", "checked", "p", "mx", "descriptionText", "Link", "href", "target", "rel", "ev", "PluginList", "plugins", "props", "React", "List", "classNames", "map", "plugin", "div", "key", "meta", "id", "className", "PluginItem", "React", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "usePluginManager", "ObservabilityAction", "StackItem", "sortByPluginMeta", "meta", "name", "a", "b", "localeCompare", "RegistryContainer", "id", "plugins", "_plugins", "manager", "usePluginManager", "dispatchPromise", "dispatch", "useIntentDispatcher", "useMemo", "sort", "handleChange", "enabled", "enable", "disable", "createIntent", "ObservabilityAction", "SendEvent", "properties", "plugin", "handleClick", "pluginId", "LayoutAction", "Open", "part", "subject", "replaceAll", "options", "pivotId", "positioning", "React", "StackItem", "Content", "toolbar", "role", "classNames", "PluginList", "onClick", "onChange", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "REGISTRY_PLUGIN", "role", "filter", "data", "subject", "REGISTRY_KEY", "component", "manager", "usePluginManager", "filtered", "useMemo", "plugins", "meta", "core", "includes", "React", "RegistryContainer", "enabled", "tags", "Plugin", "handleEnable", "useCallback", "disable", "enable", "StackItem", "Content", "toolbar", "PluginDetail", "plugin", "onEnable"]
|
|
7
|
-
}
|
/package/dist/lib/browser/{intent-resolver-2JQUQJI5.mjs.map → intent-resolver-QW333HWJ.mjs.map}
RENAMED
|
File without changes
|