@dxos/plugin-registry 0.8.3-staging.0fa589b → 0.8.4-main.1068cf700f
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-YOD5EGAY.mjs +167 -0
- package/dist/lib/browser/app-graph-builder-YOD5EGAY.mjs.map +7 -0
- package/dist/lib/browser/chunk-VOAOTNGS.mjs +19 -0
- package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +224 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +28 -36
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs +25 -0
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs +337 -0
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.mjs +168 -0
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +21 -0
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +225 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +64 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs +26 -0
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-SEJBWRMR.mjs +338 -0
- package/dist/lib/node-esm/react-surface-SEJBWRMR.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +2 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- 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/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/disable.d.ts +11 -0
- package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
- package/dist/types/src/cli/commands/enable.d.ts +11 -0
- package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +3 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/list.d.ts +7 -0
- package/dist/types/src/cli/commands/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/util.d.ts +11 -0
- package/dist/types/src/cli/commands/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +3 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/cli/storage.d.ts +18 -0
- package/dist/types/src/cli/storage.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail.d.ts +3 -3
- 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/PluginItem.d.ts +2 -2
- package/dist/types/src/components/PluginItem.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.d.ts +1 -1
- package/dist/types/src/components/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.stories.d.ts +31 -8
- package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/components/RegistryContainer.d.ts +4 -3
- package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +19 -19
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -35
- package/src/RegistryPlugin.tsx +11 -26
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +24 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +99 -0
- package/src/cli/commands/disable.ts +47 -0
- package/src/cli/commands/enable.ts +44 -0
- package/src/cli/commands/index.ts +14 -0
- package/src/cli/commands/list.ts +41 -0
- package/src/cli/commands/util.ts +24 -0
- package/src/cli/index.ts +6 -0
- package/src/cli/plugin.ts +17 -0
- package/src/cli/storage.ts +57 -0
- package/src/components/PluginDetail.stories.tsx +23 -24
- package/src/components/PluginDetail.tsx +61 -43
- package/src/components/PluginItem.tsx +55 -54
- package/src/components/PluginList.stories.tsx +37 -35
- package/src/components/PluginList.tsx +3 -5
- package/src/components/RegistryContainer.tsx +53 -51
- package/src/meta.ts +8 -5
- package/src/translations.ts +6 -4
- package/src/types.ts +5 -1
- package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs +0 -161
- package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ISC56E5F.mjs +0 -16
- package/dist/lib/browser/chunk-ISC56E5F.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs +0 -23
- package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W5RNDLXV.mjs +0 -335
- package/dist/lib/browser/react-surface-W5RNDLXV.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/Icon.stories.d.ts +0 -6
- package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -155
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/capabilities/react-surface.tsx +0 -90
- package/src/components/Icon.stories.tsx +0 -107
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, Plugin, usePluginManager } from '@dxos/app-framework';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { PluginDetail, RegistryContainer } from '../components';
|
|
11
|
-
import { REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
|
|
12
|
-
|
|
13
|
-
export default () =>
|
|
14
|
-
contributes(Capabilities.ReactSurface, [
|
|
15
|
-
createSurface({
|
|
16
|
-
id: `${REGISTRY_PLUGIN}/all`,
|
|
17
|
-
role: 'article',
|
|
18
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
19
|
-
component: () => {
|
|
20
|
-
const manager = usePluginManager();
|
|
21
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
|
|
22
|
-
|
|
23
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
createSurface({
|
|
27
|
-
id: `${REGISTRY_PLUGIN}/installed`,
|
|
28
|
-
role: 'article',
|
|
29
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
30
|
-
component: () => {
|
|
31
|
-
const manager = usePluginManager();
|
|
32
|
-
const filtered = useMemo(
|
|
33
|
-
() =>
|
|
34
|
-
manager.plugins
|
|
35
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
36
|
-
.filter(({ meta }) => manager.enabled.includes(meta.id)),
|
|
37
|
-
[],
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
createSurface({
|
|
44
|
-
id: `${REGISTRY_PLUGIN}/recommended`,
|
|
45
|
-
role: 'article',
|
|
46
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
47
|
-
component: () => {
|
|
48
|
-
const manager = usePluginManager();
|
|
49
|
-
const filtered = useMemo(
|
|
50
|
-
() =>
|
|
51
|
-
manager.plugins
|
|
52
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
53
|
-
.filter(({ meta }) => !meta.tags?.includes('labs')),
|
|
54
|
-
[],
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
createSurface({
|
|
61
|
-
id: `${REGISTRY_PLUGIN}/labs`,
|
|
62
|
-
role: 'article',
|
|
63
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
|
|
64
|
-
component: () => {
|
|
65
|
-
const manager = usePluginManager();
|
|
66
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('labs')), []);
|
|
67
|
-
|
|
68
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;
|
|
69
|
-
},
|
|
70
|
-
}),
|
|
71
|
-
createSurface({
|
|
72
|
-
id: `${REGISTRY_PLUGIN}/plugin-details`,
|
|
73
|
-
role: 'article',
|
|
74
|
-
filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
|
|
75
|
-
component: ({ data: { subject } }) => {
|
|
76
|
-
const manager = usePluginManager();
|
|
77
|
-
const enabled = manager.enabled.includes(subject.meta.id);
|
|
78
|
-
const handleEnable = useCallback(
|
|
79
|
-
() => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),
|
|
80
|
-
[manager, subject.meta.id, enabled],
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<StackItem.Content role='article'>
|
|
85
|
-
<PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />
|
|
86
|
-
</StackItem.Content>
|
|
87
|
-
);
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
]);
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { IconBase, type IconWeight, GithubLogo, type IconProps } from '@phosphor-icons/react';
|
|
8
|
-
import { type Meta } from '@storybook/react';
|
|
9
|
-
import React, { forwardRef, type SVGProps, type ReactElement } from 'react';
|
|
10
|
-
|
|
11
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Serializable icon props.
|
|
15
|
-
*/
|
|
16
|
-
type StoryIconProps = {
|
|
17
|
-
name: string;
|
|
18
|
-
weights: Record<string, SVGProps<SVGPathElement>[]>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create icon from serializable data.
|
|
23
|
-
* https://github.com/phosphor-icons/react#custom-icons
|
|
24
|
-
* https://github.com/phosphor-icons/core/tree/main/assets
|
|
25
|
-
*/
|
|
26
|
-
const createIcon = ({ name, weights }: StoryIconProps) => {
|
|
27
|
-
const CustomIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) => (
|
|
28
|
-
<IconBase
|
|
29
|
-
ref={ref}
|
|
30
|
-
{...props}
|
|
31
|
-
weights={
|
|
32
|
-
new Map<IconWeight, ReactElement>(
|
|
33
|
-
Object.entries(weights).map(
|
|
34
|
-
([key, paths]) =>
|
|
35
|
-
[
|
|
36
|
-
key,
|
|
37
|
-
<>
|
|
38
|
-
{paths.map((props, i) => (
|
|
39
|
-
<path key={`${key}-${i}`} {...props} />
|
|
40
|
-
))}
|
|
41
|
-
</>,
|
|
42
|
-
] as [IconWeight, ReactElement],
|
|
43
|
-
),
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
/>
|
|
47
|
-
));
|
|
48
|
-
CustomIcon.displayName = name;
|
|
49
|
-
return CustomIcon;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const DefaultStory = () => {
|
|
53
|
-
const CustomIcon = createIcon({
|
|
54
|
-
name: 'GithubLogo',
|
|
55
|
-
weights: {
|
|
56
|
-
// https://github.com/phosphor-icons/core/tree/main/assets
|
|
57
|
-
// <path d="M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
58
|
-
// <path d="M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
59
|
-
// <path d="M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
60
|
-
regular: [
|
|
61
|
-
{
|
|
62
|
-
d: 'M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z',
|
|
63
|
-
fill: 'none',
|
|
64
|
-
stroke: 'currentColor',
|
|
65
|
-
strokeLinecap: 'round',
|
|
66
|
-
strokeLinejoin: 'round',
|
|
67
|
-
strokeWidth: '16',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
d: 'M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40',
|
|
71
|
-
fill: 'none',
|
|
72
|
-
stroke: 'currentColor',
|
|
73
|
-
strokeLinecap: 'round',
|
|
74
|
-
strokeLinejoin: 'round',
|
|
75
|
-
strokeWidth: '16',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
d: 'M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144',
|
|
79
|
-
fill: 'none',
|
|
80
|
-
stroke: 'currentColor',
|
|
81
|
-
strokeLinecap: 'round',
|
|
82
|
-
strokeLinejoin: 'round',
|
|
83
|
-
strokeWidth: '16',
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<div className='flex gap-4 p-8 ring'>
|
|
91
|
-
<CustomIcon weight={'regular'} className={mx(getSize(8))} />
|
|
92
|
-
<GithubLogo weight={'regular'} className={mx(getSize(8))} />
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const Default = {};
|
|
98
|
-
|
|
99
|
-
const meta: Meta = {
|
|
100
|
-
title: 'plugins/plugin-registry/Icon',
|
|
101
|
-
render: DefaultStory,
|
|
102
|
-
parameters: {
|
|
103
|
-
layout: 'centered',
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export default meta;
|