@dxos/plugin-registry 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
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/neutral/RegistryPlugin.mjs +27 -0
- package/dist/lib/neutral/RegistryPlugin.mjs.map +7 -0
- package/dist/lib/{browser/cli/index.mjs → neutral/RegistryPlugin.node.mjs} +28 -99
- package/dist/lib/neutral/RegistryPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XK2JMH3H.mjs +33 -0
- package/dist/lib/neutral/chunk-XK2JMH3H.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YV7A523U.mjs +29 -0
- package/dist/lib/neutral/chunk-YV7A523U.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +21 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/open-plugin-registry-II735N76.mjs +15 -0
- package/dist/lib/neutral/open-plugin-registry-II735N76.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +18 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +61 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +1 -0
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → RegistryPlugin.node.d.ts} +2 -1
- package/dist/types/src/RegistryPlugin.node.d.ts.map +1 -0
- package/dist/types/src/RegistryPlugin.test.d.ts +2 -0
- package/dist/types/src/RegistryPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/dev-plugin-loader.d.ts +11 -0
- package/dist/types/src/capabilities/dev-plugin-loader.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +15 -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/capabilities/settings.d.ts +14 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/disable.d.ts +2 -2
- package/dist/types/src/commands/disable.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/enable.d.ts +2 -2
- package/dist/types/src/commands/enable.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/list.d.ts +7 -0
- package/dist/types/src/commands/list.d.ts.map +1 -0
- package/dist/types/src/commands/util.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +46 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +68 -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/PluginFailureBadge/PluginFailureBadge.d.ts +20 -0
- package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts.map +1 -0
- package/dist/types/src/components/PluginFailureBadge/index.d.ts +2 -0
- package/dist/types/src/components/PluginFailureBadge/index.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts +40 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts +23 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +67 -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/RegistrySettings/RegistrySettings.d.ts +18 -0
- package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts.map +1 -0
- package/dist/types/src/components/RegistrySettings/index.d.ts +2 -0
- package/dist/types/src/components/RegistrySettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts +20 -0
- package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BaseRegistryArticle/index.d.ts +2 -0
- package/dist/types/src/containers/BaseRegistryArticle/index.d.ts.map +1 -0
- 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 +2 -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 +2 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PublicRegistryArticle/PublicRegistryArticle.d.ts +8 -0
- package/dist/types/src/containers/PublicRegistryArticle/PublicRegistryArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PublicRegistryArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PublicRegistryArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts +14 -0
- package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RegistryArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.d.ts +13 -0
- package/dist/types/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/RegistrySettingsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/RegistrySettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +8 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
- package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
- package/dist/types/src/hooks/use-registry-plugins.d.ts +15 -0
- package/dist/types/src/hooks/use-registry-plugins.d.ts.map +1 -0
- package/dist/types/src/hooks/use-update-available.d.ts +18 -0
- package/dist/types/src/hooks/use-update-available.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- 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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{cli/storage.d.ts → storage.d.ts} +4 -4
- package/dist/types/src/storage.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +48 -16
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +30 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -35
- package/src/{cli/plugin.ts → RegistryPlugin.node.ts} +3 -1
- package/src/RegistryPlugin.test.ts +24 -0
- package/src/RegistryPlugin.tsx +13 -5
- package/src/capabilities/app-graph-builder.ts +200 -0
- package/src/capabilities/dev-plugin-loader.ts +39 -0
- package/src/capabilities/index.ts +11 -3
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +136 -0
- package/src/capabilities/settings.ts +34 -0
- package/src/components/{PluginDetail.stories.tsx → PluginDetail/PluginDetail.stories.tsx} +5 -5
- package/src/components/PluginDetail/PluginDetail.tsx +196 -0
- package/src/components/PluginDetail/index.ts +5 -0
- package/src/components/PluginFailureBadge/PluginFailureBadge.tsx +68 -0
- package/src/components/PluginFailureBadge/index.ts +5 -0
- package/src/components/PluginList/PluginItem.tsx +226 -0
- package/src/components/{PluginList.stories.tsx → PluginList/PluginList.stories.tsx} +18 -15
- package/src/components/PluginList/PluginList.tsx +52 -0
- package/src/components/PluginList/index.ts +5 -0
- package/src/components/RegistrySettings/RegistrySettings.tsx +120 -0
- package/src/components/RegistrySettings/index.ts +5 -0
- package/src/components/index.ts +2 -1
- package/src/containers/BaseRegistryArticle/BaseRegistryArticle.tsx +163 -0
- package/src/containers/BaseRegistryArticle/index.ts +5 -0
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +87 -0
- package/src/containers/LoadPluginDialog/index.ts +5 -0
- package/src/containers/PluginArticle/PluginArticle.tsx +336 -0
- package/src/containers/PluginArticle/index.ts +5 -0
- package/src/containers/PublicRegistryArticle/PublicRegistryArticle.tsx +192 -0
- package/src/containers/PublicRegistryArticle/index.ts +5 -0
- package/src/containers/RegistryArticle/RegistryArticle.tsx +53 -0
- package/src/containers/RegistryArticle/index.ts +5 -0
- package/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.tsx +59 -0
- package/src/containers/RegistrySettingsContainer/index.ts +5 -0
- package/src/containers/index.ts +12 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/use-auto-tags.ts +51 -0
- package/src/hooks/use-registry-plugins.ts +29 -0
- package/src/hooks/use-update-available.ts +31 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +14 -5
- package/src/operations/index.ts +7 -0
- package/src/operations/open-plugin-registry.ts +21 -0
- package/src/plugin.ts +11 -0
- package/src/{cli/storage.ts → storage.ts} +14 -21
- package/src/translations.ts +52 -15
- package/src/types.ts +33 -1
- package/dist/lib/browser/app-graph-builder-YOD5EGAY.mjs +0 -167
- package/dist/lib/browser/app-graph-builder-YOD5EGAY.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/cli/index.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -63
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs +0 -25
- package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs +0 -337
- package/dist/lib/browser/react-surface-IEGOKKMX.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.mjs +0 -168
- package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.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/cli/index.mjs +0 -225
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -64
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs +0 -26
- package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SEJBWRMR.mjs +0 -338
- package/dist/lib/node-esm/react-surface-SEJBWRMR.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/cli/commands/disable.d.ts.map +0 -1
- package/dist/types/src/cli/commands/enable.d.ts.map +0 -1
- package/dist/types/src/cli/commands/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/list.d.ts +0 -7
- package/dist/types/src/cli/commands/list.d.ts.map +0 -1
- package/dist/types/src/cli/commands/util.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -3
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/cli/storage.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 -33
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/PluginItem.d.ts +0 -13
- package/dist/types/src/components/PluginItem.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.d.ts +0 -8
- 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 -137
- 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 -24
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -99
- package/src/cli/index.ts +0 -6
- package/src/components/PluginDetail.tsx +0 -81
- package/src/components/PluginItem.tsx +0 -120
- package/src/components/PluginList.tsx +0 -24
- package/src/components/RegistryContainer.tsx +0 -86
- /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/util.d.ts +0 -0
- /package/src/{cli/commands → commands}/disable.ts +0 -0
- /package/src/{cli/commands → commands}/enable.ts +0 -0
- /package/src/{cli/commands → commands}/index.ts +0 -0
- /package/src/{cli/commands → commands}/list.ts +0 -0
- /package/src/{cli/commands → commands}/util.ts +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
3
|
-
export type PluginDetailProps = {
|
|
4
|
-
plugin: Plugin.Plugin;
|
|
5
|
-
enabled?: boolean;
|
|
6
|
-
onEnabledChange?: (enabled: boolean) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const PluginDetail: ({ plugin, enabled, onEnabledChange }: PluginDetailProps) => React.JSX.Element;
|
|
9
|
-
//# sourceMappingURL=PluginDetail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,sCAAsC,iBAAiB,sBA6DnF,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ plugin, enabled, onEnabledChange }: import("./PluginDetail").PluginDetailProps) => import("react").JSX.Element;
|
|
5
|
-
decorators: import("@storybook/react").Decorator[];
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
translations: [{
|
|
9
|
-
readonly 'en-US': {
|
|
10
|
-
readonly [meta.id]: {
|
|
11
|
-
readonly 'plugin name': "Registry";
|
|
12
|
-
readonly 'details label': "Details";
|
|
13
|
-
readonly 'home page label': "Website";
|
|
14
|
-
readonly 'source label': "Source";
|
|
15
|
-
readonly 'plugin registry label': "Plugin Registry";
|
|
16
|
-
readonly 'all plugins label': "All";
|
|
17
|
-
readonly 'installed plugins label': "Enabled";
|
|
18
|
-
readonly 'recommended plugins label': "Recommended";
|
|
19
|
-
readonly 'labs plugins label': "Labs";
|
|
20
|
-
readonly 'community plugins label': "Community";
|
|
21
|
-
readonly 'load by url label': "Load by URL (soon)";
|
|
22
|
-
readonly 'coming soon label': "Coming soon!";
|
|
23
|
-
readonly 'open plugin registry label': "Open plugin registry";
|
|
24
|
-
readonly 'settings label': "Settings";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof meta>;
|
|
32
|
-
export declare const Default: Story;
|
|
33
|
-
//# sourceMappingURL=PluginDetail.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginDetail.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUjE,QAAA,MAAM,IAAI;;;;;;;;yBAPO,CAAO,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CAeK,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
3
|
-
export type PluginItemProps = {
|
|
4
|
-
plugin: Plugin.Plugin;
|
|
5
|
-
installed?: readonly string[];
|
|
6
|
-
enabled?: readonly string[];
|
|
7
|
-
onClick?: (id: string) => void;
|
|
8
|
-
onChange?: (id: string, enabled: boolean) => void;
|
|
9
|
-
hasSettings?: (id: string) => boolean;
|
|
10
|
-
onSettings?: (id: string) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare const PluginItem: ({ plugin, enabled, onClick, onChange, hasSettings: hasSettingsProp, onSettings, }: PluginItemProps) => React.JSX.Element;
|
|
13
|
-
//# sourceMappingURL=PluginItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginItem.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQlD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,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,GAAI,mFAOxB,eAAe,sBA+EjB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
3
|
-
import { type PluginItemProps } from './PluginItem';
|
|
4
|
-
export type PluginListProps = Omit<PluginItemProps, 'plugin'> & {
|
|
5
|
-
plugins?: readonly Plugin.Plugin[];
|
|
6
|
-
};
|
|
7
|
-
export declare const PluginList: ({ plugins, ...props }: PluginListProps) => React.JSX.Element;
|
|
8
|
-
//# sourceMappingURL=PluginList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,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,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,uBAA4B,eAAe,sBAQrE,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: ({ plugins, ...props }: import("./PluginList").PluginListProps) => React.JSX.Element;
|
|
6
|
-
render: () => React.JSX.Element;
|
|
7
|
-
parameters: {
|
|
8
|
-
translations: [{
|
|
9
|
-
readonly 'en-US': {
|
|
10
|
-
readonly [meta.id]: {
|
|
11
|
-
readonly 'plugin name': "Registry";
|
|
12
|
-
readonly 'details label': "Details";
|
|
13
|
-
readonly 'home page label': "Website";
|
|
14
|
-
readonly 'source label': "Source";
|
|
15
|
-
readonly 'plugin registry label': "Plugin Registry";
|
|
16
|
-
readonly 'all plugins label': "All";
|
|
17
|
-
readonly 'installed plugins label': "Enabled";
|
|
18
|
-
readonly 'recommended plugins label': "Recommended";
|
|
19
|
-
readonly 'labs plugins label': "Labs";
|
|
20
|
-
readonly 'community plugins label': "Community";
|
|
21
|
-
readonly 'load by url label': "Load by URL (soon)";
|
|
22
|
-
readonly 'coming soon label': "Coming soon!";
|
|
23
|
-
readonly 'open plugin registry label': "Open plugin registry";
|
|
24
|
-
readonly 'settings label': "Settings";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof meta>;
|
|
32
|
-
export declare const Default: Story;
|
|
33
|
-
export declare const FullScreen: Story;
|
|
34
|
-
//# sourceMappingURL=PluginList.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginList.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAwDxC,QAAA,MAAM,IAAI;;;;;;;yBAtDY,CAAO,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CA6DF,CAAC;AAEpC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
3
|
-
export type RegistryContainerProps = {
|
|
4
|
-
id: string;
|
|
5
|
-
plugins: Plugin.Plugin[];
|
|
6
|
-
};
|
|
7
|
-
export declare const RegistryContainer: ({ id, plugins: pluginsProp }: RegistryContainerProps) => React.JSX.Element;
|
|
8
|
-
//# sourceMappingURL=RegistryContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/RegistryContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAYlD,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,8BAA8B,sBAAsB,sBA4DrF,CAAC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
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 { AppCapabilities, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
|
-
import { Operation } from '@dxos/operation';
|
|
10
|
-
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
-
|
|
12
|
-
import { REGISTRY_ID, REGISTRY_KEY, meta } from '../../meta';
|
|
13
|
-
|
|
14
|
-
export default Capability.makeModule(
|
|
15
|
-
Effect.fnUntraced(function* () {
|
|
16
|
-
const capabilities = yield* Capability.Service;
|
|
17
|
-
|
|
18
|
-
const extensions = yield* Effect.all([
|
|
19
|
-
GraphBuilder.createExtension({
|
|
20
|
-
id: meta.id,
|
|
21
|
-
match: NodeMatcher.whenRoot,
|
|
22
|
-
actions: () =>
|
|
23
|
-
Effect.succeed([
|
|
24
|
-
{
|
|
25
|
-
id: meta.id,
|
|
26
|
-
data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
|
|
27
|
-
properties: {
|
|
28
|
-
label: ['open plugin registry label', { ns: meta.id }],
|
|
29
|
-
icon: 'ph--squares-four--regular',
|
|
30
|
-
disposition: 'menu',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
]),
|
|
34
|
-
}),
|
|
35
|
-
GraphBuilder.createExtension({
|
|
36
|
-
id: meta.id,
|
|
37
|
-
match: NodeMatcher.whenRoot,
|
|
38
|
-
connector: () =>
|
|
39
|
-
Effect.succeed([
|
|
40
|
-
{
|
|
41
|
-
id: REGISTRY_ID,
|
|
42
|
-
type: meta.id,
|
|
43
|
-
properties: {
|
|
44
|
-
label: ['plugin registry label', { ns: meta.id }],
|
|
45
|
-
icon: 'ph--squares-four--regular',
|
|
46
|
-
disposition: 'pin-end',
|
|
47
|
-
testId: 'treeView.pluginRegistry',
|
|
48
|
-
},
|
|
49
|
-
nodes: [
|
|
50
|
-
{
|
|
51
|
-
id: `${REGISTRY_KEY}+all`,
|
|
52
|
-
type: 'category',
|
|
53
|
-
data: `${REGISTRY_KEY}+all`,
|
|
54
|
-
properties: {
|
|
55
|
-
label: ['all plugins label', { ns: meta.id }],
|
|
56
|
-
icon: 'ph--squares-four--regular',
|
|
57
|
-
key: REGISTRY_KEY,
|
|
58
|
-
testId: 'pluginRegistry.all',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
63
|
-
type: 'category',
|
|
64
|
-
data: `${REGISTRY_KEY}+installed`,
|
|
65
|
-
properties: {
|
|
66
|
-
label: ['installed plugins label', { ns: meta.id }],
|
|
67
|
-
icon: 'ph--check--regular',
|
|
68
|
-
key: REGISTRY_KEY,
|
|
69
|
-
testId: 'pluginRegistry.installed',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
74
|
-
type: 'category',
|
|
75
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
76
|
-
properties: {
|
|
77
|
-
label: ['recommended plugins label', { ns: meta.id }],
|
|
78
|
-
icon: 'ph--star--regular',
|
|
79
|
-
key: REGISTRY_KEY,
|
|
80
|
-
testId: 'pluginRegistry.recommended',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
85
|
-
type: 'category',
|
|
86
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
87
|
-
properties: {
|
|
88
|
-
label: ['labs plugins label', { ns: meta.id }],
|
|
89
|
-
icon: 'ph--flask--regular',
|
|
90
|
-
key: REGISTRY_KEY,
|
|
91
|
-
testId: 'pluginRegistry.labs',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
]),
|
|
97
|
-
}),
|
|
98
|
-
GraphBuilder.createExtension({
|
|
99
|
-
id: `${meta.id}/actions`,
|
|
100
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
101
|
-
actions: () =>
|
|
102
|
-
Effect.succeed([
|
|
103
|
-
{
|
|
104
|
-
id: `${meta.id}/load-by-url`,
|
|
105
|
-
data: Effect.fnUntraced(function* () {}),
|
|
106
|
-
properties: {
|
|
107
|
-
label: ['load by url label', { ns: meta.id }],
|
|
108
|
-
icon: 'ph--cloud-arrow-down--regular',
|
|
109
|
-
disabled: true,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
]),
|
|
113
|
-
}),
|
|
114
|
-
GraphBuilder.createExtension({
|
|
115
|
-
id: `${meta.id}/plugins`,
|
|
116
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
117
|
-
connector: () => {
|
|
118
|
-
const manager = capabilities.get(Capabilities.PluginManager);
|
|
119
|
-
return Effect.succeed(
|
|
120
|
-
manager.getPlugins().map((plugin) => ({
|
|
121
|
-
id: plugin.meta.id.replaceAll('/', ':'),
|
|
122
|
-
type: 'dxos.org/plugin',
|
|
123
|
-
data: plugin,
|
|
124
|
-
properties: {
|
|
125
|
-
label: plugin.meta.name ?? plugin.meta.id,
|
|
126
|
-
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
127
|
-
disposition: 'hidden',
|
|
128
|
-
},
|
|
129
|
-
})),
|
|
130
|
-
);
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
133
|
-
]);
|
|
134
|
-
|
|
135
|
-
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
136
|
-
}),
|
|
137
|
-
);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
|
|
9
|
-
import { Operation, OperationResolver } from '@dxos/operation';
|
|
10
|
-
|
|
11
|
-
import { REGISTRY_ID } from '../../meta';
|
|
12
|
-
|
|
13
|
-
export default Capability.makeModule(
|
|
14
|
-
Effect.fnUntraced(function* () {
|
|
15
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
16
|
-
OperationResolver.make({
|
|
17
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
18
|
-
handler: Effect.fnUntraced(function* () {
|
|
19
|
-
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: REGISTRY_ID });
|
|
20
|
-
}),
|
|
21
|
-
}),
|
|
22
|
-
]);
|
|
23
|
-
}),
|
|
24
|
-
);
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import React, { useCallback, useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
|
|
9
|
-
import { Surface, usePluginManager } from '@dxos/app-framework/ui';
|
|
10
|
-
import { runAndForwardErrors } from '@dxos/effect';
|
|
11
|
-
|
|
12
|
-
import { PluginDetail, RegistryContainer } from '../../components';
|
|
13
|
-
import { REGISTRY_KEY, meta } from '../../meta';
|
|
14
|
-
|
|
15
|
-
export default Capability.makeModule(() =>
|
|
16
|
-
Effect.succeed(
|
|
17
|
-
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
|
-
Surface.create({
|
|
19
|
-
id: `${meta.id}/all`,
|
|
20
|
-
role: 'article',
|
|
21
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
22
|
-
component: () => {
|
|
23
|
-
const manager = usePluginManager();
|
|
24
|
-
const filtered = useMemo(
|
|
25
|
-
() => manager.getPlugins().filter(({ meta }) => !manager.getCore().includes(meta.id)),
|
|
26
|
-
[],
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
32
|
-
Surface.create({
|
|
33
|
-
id: `${meta.id}/installed`,
|
|
34
|
-
role: 'article',
|
|
35
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
36
|
-
component: () => {
|
|
37
|
-
const manager = usePluginManager();
|
|
38
|
-
const filtered = useMemo(
|
|
39
|
-
() =>
|
|
40
|
-
manager
|
|
41
|
-
.getPlugins()
|
|
42
|
-
.filter(({ meta }) => !manager.getCore().includes(meta.id))
|
|
43
|
-
.filter(({ meta }) => manager.getEnabled().includes(meta.id)),
|
|
44
|
-
[],
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
Surface.create({
|
|
51
|
-
id: `${meta.id}/recommended`,
|
|
52
|
-
role: 'article',
|
|
53
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
54
|
-
component: () => {
|
|
55
|
-
const manager = usePluginManager();
|
|
56
|
-
const filtered = useMemo(
|
|
57
|
-
() =>
|
|
58
|
-
manager
|
|
59
|
-
.getPlugins()
|
|
60
|
-
.filter(({ meta }) => !manager.getCore().includes(meta.id))
|
|
61
|
-
.filter(({ meta }) => !meta.tags?.includes('labs')),
|
|
62
|
-
[],
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
Surface.create({
|
|
69
|
-
id: `${meta.id}/labs`,
|
|
70
|
-
role: 'article',
|
|
71
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
|
|
72
|
-
component: () => {
|
|
73
|
-
const manager = usePluginManager();
|
|
74
|
-
const filtered = useMemo(() => manager.getPlugins().filter(({ meta }) => meta.tags?.includes('labs')), []);
|
|
75
|
-
|
|
76
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
|
-
Surface.create({
|
|
80
|
-
id: `${meta.id}/plugin-details`,
|
|
81
|
-
role: 'article',
|
|
82
|
-
filter: (data): data is { subject: Plugin.Plugin } => Plugin.isPlugin(data.subject),
|
|
83
|
-
component: ({ data: { subject } }) => {
|
|
84
|
-
const manager = usePluginManager();
|
|
85
|
-
const enabled = manager.getEnabled().includes(subject.meta.id);
|
|
86
|
-
const handleEnableChange = useCallback(
|
|
87
|
-
(enabled: boolean) =>
|
|
88
|
-
enabled
|
|
89
|
-
? runAndForwardErrors(manager.enable(subject.meta.id))
|
|
90
|
-
: runAndForwardErrors(manager.disable(subject.meta.id)),
|
|
91
|
-
[manager, subject.meta.id],
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
return <PluginDetail plugin={subject} enabled={enabled} onEnabledChange={handleEnableChange} />;
|
|
95
|
-
},
|
|
96
|
-
}),
|
|
97
|
-
]),
|
|
98
|
-
),
|
|
99
|
-
);
|
package/src/cli/index.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { ScrollArea } from '@dxos/react-ui';
|
|
10
|
-
import { getStyles, mx } from '@dxos/ui-theme';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
export type PluginDetailProps = {
|
|
15
|
-
plugin: Plugin.Plugin;
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
onEnabledChange?: (enabled: boolean) => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const PluginDetail = ({ plugin, enabled, onEnabledChange }: PluginDetailProps) => {
|
|
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 orientation='vertical'>
|
|
36
|
-
<ScrollArea.Viewport>
|
|
37
|
-
<div role='none' className='grid grid-cols-[min-content_1fr] gap-4 container-max-width p-4'>
|
|
38
|
-
<div role='none'>
|
|
39
|
-
<Icon classNames={mx('p-1 rounded', styles.bg, styles.icon)} 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 is-full pbs-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='pbs-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 mli-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 mli-1' />
|
|
72
|
-
</Link>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</ScrollArea.Viewport>
|
|
79
|
-
</ScrollArea.Root>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { type MouseEvent, useCallback } from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
8
|
-
import { type ChromaticPalette, Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionText, mx } from '@dxos/ui-theme';
|
|
10
|
-
import { getStyles } from '@dxos/ui-theme';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
import { type RegistryTagType } from '../types';
|
|
14
|
-
|
|
15
|
-
export type PluginItemProps = {
|
|
16
|
-
plugin: Plugin.Plugin;
|
|
17
|
-
installed?: readonly string[];
|
|
18
|
-
enabled?: readonly string[];
|
|
19
|
-
onClick?: (id: string) => void;
|
|
20
|
-
onChange?: (id: string, enabled: boolean) => void;
|
|
21
|
-
hasSettings?: (id: string) => boolean;
|
|
22
|
-
onSettings?: (id: string) => void;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const PluginItem = ({
|
|
26
|
-
plugin,
|
|
27
|
-
enabled = [],
|
|
28
|
-
onClick,
|
|
29
|
-
onChange,
|
|
30
|
-
hasSettings: hasSettingsProp,
|
|
31
|
-
onSettings,
|
|
32
|
-
}: PluginItemProps) => {
|
|
33
|
-
const { t } = useTranslation(meta.id);
|
|
34
|
-
const { id, name, description, tags, icon = 'ph--circle--regular', iconHue = 'neutral' } = plugin.meta;
|
|
35
|
-
const isEnabled = enabled.includes(id);
|
|
36
|
-
const inputId = `${id}-input`;
|
|
37
|
-
const labelId = `${id}-label`;
|
|
38
|
-
const descriptionId = `${id}-description`;
|
|
39
|
-
const handleClick = useCallback(() => onClick?.(id), [id, onClick]);
|
|
40
|
-
|
|
41
|
-
const handleChange = useCallback(
|
|
42
|
-
(event: MouseEvent) => {
|
|
43
|
-
event.stopPropagation();
|
|
44
|
-
onChange?.(id, !isEnabled);
|
|
45
|
-
},
|
|
46
|
-
[id, isEnabled, onChange],
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const hasSettings = hasSettingsProp?.(id) ?? false;
|
|
50
|
-
const handleSettings = useCallback(() => onSettings?.(id), [id, onSettings]);
|
|
51
|
-
const styles = getStyles(iconHue);
|
|
52
|
-
const gridCols = 'grid grid-cols-[5rem_1fr]';
|
|
53
|
-
const gridRows = 'grid grid-rows-[40px_1fr_min-content_40px]';
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<ListItem.Root
|
|
57
|
-
key={id}
|
|
58
|
-
labelId={labelId}
|
|
59
|
-
data-testid={`pluginList.${id}`}
|
|
60
|
-
aria-describedby={descriptionId}
|
|
61
|
-
classNames={mx(gridCols, 'bs-[12rem] is-full gap-3 pie-2 border border-separator rounded-md overflow-hidden')}
|
|
62
|
-
>
|
|
63
|
-
<div className={mx(gridRows, 'justify-center rounded-l-md', styles.bg)}>
|
|
64
|
-
<div />
|
|
65
|
-
<Icon classNames={mx('cursor-pointer', styles.icon)} icon={icon} size={14} onClick={handleClick} />
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div className={mx(gridRows)}>
|
|
69
|
-
<div className='flex items-center overflow-hidden cursor-pointer' onClick={handleClick}>
|
|
70
|
-
<span className='text-lg truncate'>{name ?? id}</span>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div>
|
|
74
|
-
<p className={mx(descriptionText, 'line-clamp-4 min-is-0')}>{description}</p>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div className='flex -mis-0.5 overflow-x-auto scrollbar-none'>
|
|
78
|
-
{tags?.map((tag) => (
|
|
79
|
-
<Tag key={tag} palette={tagColors[tag as RegistryTagType]} classNames='text-xs uppercase font-thin'>
|
|
80
|
-
{tag}
|
|
81
|
-
</Tag>
|
|
82
|
-
))}
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div className='flex gap-2 items-center text-sm'>
|
|
86
|
-
<IconButton
|
|
87
|
-
aria-describedby={descriptionId}
|
|
88
|
-
classNames='cursor-pointer'
|
|
89
|
-
icon='ph--gear--regular'
|
|
90
|
-
label={t('settings label')}
|
|
91
|
-
iconOnly
|
|
92
|
-
size={4}
|
|
93
|
-
onClick={handleSettings}
|
|
94
|
-
disabled={!hasSettings}
|
|
95
|
-
/>
|
|
96
|
-
|
|
97
|
-
<Link aria-describedby={descriptionId} classNames='text-description cursor-pointer' onClick={handleClick}>
|
|
98
|
-
{t('details label')}
|
|
99
|
-
</Link>
|
|
100
|
-
|
|
101
|
-
<div className='grow' />
|
|
102
|
-
<div className='pie-1'>
|
|
103
|
-
<Input.Root id={inputId}>
|
|
104
|
-
<Input.Switch classNames='self-center' checked={isEnabled} onClick={handleChange} />
|
|
105
|
-
</Input.Root>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</ListItem.Root>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const tagColors: Record<RegistryTagType, ChromaticPalette> = {
|
|
114
|
-
new: 'rose',
|
|
115
|
-
beta: 'teal',
|
|
116
|
-
labs: 'blue',
|
|
117
|
-
popular: 'green',
|
|
118
|
-
featured: 'pink',
|
|
119
|
-
experimental: 'amber',
|
|
120
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
8
|
-
import { List } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { PluginItem, type PluginItemProps } from './PluginItem';
|
|
11
|
-
|
|
12
|
-
export type PluginListProps = Omit<PluginItemProps, 'plugin'> & {
|
|
13
|
-
plugins?: readonly Plugin.Plugin[];
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const PluginList = ({ plugins = [], ...props }: PluginListProps) => {
|
|
17
|
-
return (
|
|
18
|
-
<List classNames='grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] auto-rows-[max-content] gap-4 p-4'>
|
|
19
|
-
{plugins.map((plugin) => (
|
|
20
|
-
<PluginItem key={plugin.meta.id} plugin={plugin} {...props} />
|
|
21
|
-
))}
|
|
22
|
-
</List>
|
|
23
|
-
);
|
|
24
|
-
};
|