@dxos/plugin-registry 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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/PluginArticle-MLBF7AFA.mjs +29 -0
- package/dist/lib/browser/PluginArticle-MLBF7AFA.mjs.map +7 -0
- package/dist/lib/browser/PluginRegistry-ENAI4SAY.mjs +77 -0
- package/dist/lib/browser/PluginRegistry-ENAI4SAY.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-2HXD7SOS.mjs +167 -0
- package/dist/lib/browser/app-graph-builder-2HXD7SOS.mjs.map +7 -0
- package/dist/lib/browser/chunk-TSNK3SAR.mjs +191 -0
- package/dist/lib/browser/chunk-TSNK3SAR.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 +23 -29
- 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-DH25DIRH.mjs +85 -0
- package/dist/lib/browser/react-surface-DH25DIRH.mjs.map +7 -0
- package/dist/lib/node-esm/PluginArticle-TP2G6GGI.mjs +30 -0
- package/dist/lib/node-esm/PluginArticle-TP2G6GGI.mjs.map +7 -0
- package/dist/lib/node-esm/PluginRegistry-CWIZIQNX.mjs +78 -0
- package/dist/lib/node-esm/PluginRegistry-CWIZIQNX.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-2LNPN72O.mjs +168 -0
- package/dist/lib/node-esm/app-graph-builder-2LNPN72O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4XO63XB6.mjs +192 -0
- package/dist/lib/node-esm/chunk-4XO63XB6.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-3YBEVL65.mjs +86 -0
- package/dist/lib/node-esm/react-surface-3YBEVL65.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/PluginDetail.d.ts +9 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/{PluginDetail.stories.d.ts → PluginDetail/PluginDetail.stories.d.ts} +1 -1
- 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/{PluginItem.d.ts → PluginList/PluginItem.d.ts} +2 -2
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/{PluginList.d.ts → PluginList/PluginList.d.ts} +1 -1
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
- package/dist/types/src/components/{PluginList.stories.d.ts → PluginList/PluginList.stories.d.ts} +2 -5
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/index.d.ts +2 -0
- package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts +3 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +8 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts +3 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -33
- package/src/RegistryPlugin.tsx +10 -24
- 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 +88 -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/PluginDetail.stories.tsx +44 -0
- package/src/components/PluginDetail/PluginDetail.tsx +81 -0
- package/src/components/PluginDetail/index.ts +5 -0
- package/src/components/PluginList/PluginItem.tsx +124 -0
- package/src/components/{PluginList.stories.tsx → PluginList/PluginList.stories.tsx} +27 -26
- package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +3 -5
- package/src/components/PluginList/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
- package/src/containers/PluginArticle/index.ts +7 -0
- package/src/containers/PluginRegistry/PluginRegistry.tsx +86 -0
- package/src/containers/PluginRegistry/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/meta.ts +7 -2
- package/src/types.ts +4 -0
- package/dist/lib/browser/app-graph-builder-5BKKIS5T.mjs +0 -162
- package/dist/lib/browser/app-graph-builder-5BKKIS5T.mjs.map +0 -7
- package/dist/lib/browser/chunk-MWZPWWWF.mjs +0 -14
- package/dist/lib/browser/chunk-MWZPWWWF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs +0 -23
- package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FYRVOQGA.mjs +0 -335
- package/dist/lib/browser/react-surface-FYRVOQGA.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 -14
- package/dist/types/src/components/Icon.stories.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.map +0 -1
- package/dist/types/src/components/PluginItem.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.d.ts.map +0 -1
- package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
- package/dist/types/src/components/RegistryContainer.d.ts +0 -7
- package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -156
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/capabilities/react-surface.tsx +0 -85
- package/src/components/Icon.stories.tsx +0 -110
- package/src/components/PluginDetail.stories.tsx +0 -45
- package/src/components/PluginDetail.tsx +0 -65
- package/src/components/PluginItem.tsx +0 -119
- package/src/components/RegistryContainer.tsx +0 -84
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EAMb,MAAM,qBAAqB,CAAC;;AAI7B,wBAWI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAwD,MAAM,qBAAqB,CAAC;;AAKzG,wBAyEK"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const Default: Story;
|
|
4
|
-
declare const meta: {
|
|
5
|
-
title: string;
|
|
6
|
-
render: () => React.JSX.Element;
|
|
7
|
-
decorators: import("@storybook/react").Decorator[];
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof meta>;
|
|
14
|
-
//# sourceMappingURL=Icon.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAuD,MAAM,OAAO,CAAC;AA0F5E,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,QAAA,MAAM,IAAI;;;;;;;CAOuB,CAAC;AAElC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Plugin } from '@dxos/app-framework';
|
|
3
|
-
export type PluginDetailProps = {
|
|
4
|
-
plugin: Plugin;
|
|
5
|
-
enabled?: boolean;
|
|
6
|
-
onEnable?: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const PluginDetail: ({ plugin, enabled, onEnable }: 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;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,GAAI,+BAA+B,iBAAiB,sBA8C5E,CAAC"}
|
|
@@ -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;AASjE,QAAA,MAAM,IAAI;;;;;;;;yBANc,CAAQ,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CAcH,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAC"}
|
|
@@ -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;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,GAAI,gFAOxB,eAAe,sBAyFjB,CAAC"}
|
|
@@ -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,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,uBAA4B,eAAe,sBAUrE,CAAC"}
|
|
@@ -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;AAIxC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAoDtD,QAAA,MAAM,IAAI;;;6BAjC4B,eAAe,CAAC,EAAE,CAAC;;;;;;yBArBnC,CAAO,IAAI,CAAE,EAAC,CAAC;;;;;;;;;;;;;;;;;;;CA+DF,CAAC;AAEpC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,MAAM,EAAE,KAIpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/RegistryContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGL,KAAK,MAAM,EAMZ,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,iBAAiB,GAAI,2BAA2B;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBA4D7F,CAAC"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { createExtension } from '@dxos/plugin-graph';
|
|
11
|
-
|
|
12
|
-
import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginContext) =>
|
|
15
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
16
|
-
createExtension({
|
|
17
|
-
id: meta.id,
|
|
18
|
-
actions: (node) =>
|
|
19
|
-
Rx.make((get) =>
|
|
20
|
-
Function.pipe(
|
|
21
|
-
get(node),
|
|
22
|
-
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
23
|
-
Option.map((node) => [
|
|
24
|
-
{
|
|
25
|
-
id: meta.id,
|
|
26
|
-
data: async () => {
|
|
27
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
28
|
-
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
29
|
-
},
|
|
30
|
-
properties: {
|
|
31
|
-
label: ['open plugin registry label', { ns: meta.id }],
|
|
32
|
-
icon: 'ph--squares-four--regular',
|
|
33
|
-
disposition: 'menu',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
]),
|
|
37
|
-
Option.getOrElse(() => []),
|
|
38
|
-
),
|
|
39
|
-
),
|
|
40
|
-
}),
|
|
41
|
-
createExtension({
|
|
42
|
-
id: meta.id,
|
|
43
|
-
connector: (node) =>
|
|
44
|
-
Rx.make((get) =>
|
|
45
|
-
Function.pipe(
|
|
46
|
-
get(node),
|
|
47
|
-
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
48
|
-
Option.map((node) => [
|
|
49
|
-
{
|
|
50
|
-
id: REGISTRY_ID,
|
|
51
|
-
type: meta.id,
|
|
52
|
-
properties: {
|
|
53
|
-
label: ['plugin registry label', { ns: meta.id }],
|
|
54
|
-
icon: 'ph--squares-four--regular',
|
|
55
|
-
disposition: 'pin-end',
|
|
56
|
-
testId: 'treeView.pluginRegistry',
|
|
57
|
-
},
|
|
58
|
-
nodes: [
|
|
59
|
-
{
|
|
60
|
-
id: `${REGISTRY_KEY}+all`,
|
|
61
|
-
type: 'category',
|
|
62
|
-
data: `${REGISTRY_KEY}+all`,
|
|
63
|
-
properties: {
|
|
64
|
-
label: ['all plugins label', { ns: meta.id }],
|
|
65
|
-
icon: 'ph--squares-four--regular',
|
|
66
|
-
key: REGISTRY_KEY,
|
|
67
|
-
testId: 'pluginRegistry.all',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
72
|
-
type: 'category',
|
|
73
|
-
data: `${REGISTRY_KEY}+installed`,
|
|
74
|
-
properties: {
|
|
75
|
-
label: ['installed plugins label', { ns: meta.id }],
|
|
76
|
-
icon: 'ph--check--regular',
|
|
77
|
-
key: REGISTRY_KEY,
|
|
78
|
-
testId: 'pluginRegistry.installed',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
83
|
-
type: 'category',
|
|
84
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
85
|
-
properties: {
|
|
86
|
-
label: ['recommended plugins label', { ns: meta.id }],
|
|
87
|
-
icon: 'ph--star--regular',
|
|
88
|
-
key: REGISTRY_KEY,
|
|
89
|
-
testId: 'pluginRegistry.recommended',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
94
|
-
type: 'category',
|
|
95
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
96
|
-
properties: {
|
|
97
|
-
label: ['labs plugins label', { ns: meta.id }],
|
|
98
|
-
icon: 'ph--flask--regular',
|
|
99
|
-
key: REGISTRY_KEY,
|
|
100
|
-
testId: 'pluginRegistry.labs',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
]),
|
|
106
|
-
Option.getOrElse(() => []),
|
|
107
|
-
),
|
|
108
|
-
),
|
|
109
|
-
}),
|
|
110
|
-
createExtension({
|
|
111
|
-
id: `${meta.id}/actions`,
|
|
112
|
-
actions: (node) =>
|
|
113
|
-
Rx.make((get) =>
|
|
114
|
-
Function.pipe(
|
|
115
|
-
get(node),
|
|
116
|
-
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
117
|
-
Option.map(() => [
|
|
118
|
-
{
|
|
119
|
-
id: `${meta.id}/load-by-url`,
|
|
120
|
-
data: async () => {},
|
|
121
|
-
properties: {
|
|
122
|
-
label: ['load by url label', { ns: meta.id }],
|
|
123
|
-
icon: 'ph--cloud-arrow-down--regular',
|
|
124
|
-
disabled: true,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
]),
|
|
128
|
-
Option.getOrElse(() => []),
|
|
129
|
-
),
|
|
130
|
-
),
|
|
131
|
-
}),
|
|
132
|
-
createExtension({
|
|
133
|
-
id: `${meta.id}/plugins`,
|
|
134
|
-
connector: (node) =>
|
|
135
|
-
Rx.make((get) =>
|
|
136
|
-
Function.pipe(
|
|
137
|
-
get(node),
|
|
138
|
-
Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
|
|
139
|
-
Option.map(() => {
|
|
140
|
-
const manager = context.getCapability(Capabilities.PluginManager);
|
|
141
|
-
return manager.plugins.map((plugin) => ({
|
|
142
|
-
id: plugin.meta.id.replaceAll('/', ':'),
|
|
143
|
-
type: 'dxos.org/plugin',
|
|
144
|
-
data: plugin,
|
|
145
|
-
properties: {
|
|
146
|
-
label: plugin.meta.name ?? plugin.meta.id,
|
|
147
|
-
icon: plugin.meta.icon ?? 'ph--circle--regular',
|
|
148
|
-
disposition: 'hidden',
|
|
149
|
-
},
|
|
150
|
-
}));
|
|
151
|
-
}),
|
|
152
|
-
Option.getOrElse(() => []),
|
|
153
|
-
),
|
|
154
|
-
),
|
|
155
|
-
}),
|
|
156
|
-
]);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Capabilities,
|
|
7
|
-
LayoutAction,
|
|
8
|
-
SettingsAction,
|
|
9
|
-
contributes,
|
|
10
|
-
createIntent,
|
|
11
|
-
createResolver,
|
|
12
|
-
} from '@dxos/app-framework';
|
|
13
|
-
|
|
14
|
-
import { REGISTRY_ID } from '../meta';
|
|
15
|
-
|
|
16
|
-
export default () =>
|
|
17
|
-
contributes(
|
|
18
|
-
Capabilities.IntentResolver,
|
|
19
|
-
createResolver({
|
|
20
|
-
intent: SettingsAction.OpenPluginRegistry,
|
|
21
|
-
resolve: () => {
|
|
22
|
-
return {
|
|
23
|
-
intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, Plugin, contributes, createSurface, usePluginManager } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { PluginDetail, RegistryContainer } from '../components';
|
|
10
|
-
import { REGISTRY_KEY, meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
export default () =>
|
|
13
|
-
contributes(Capabilities.ReactSurface, [
|
|
14
|
-
createSurface({
|
|
15
|
-
id: `${meta.id}/all`,
|
|
16
|
-
role: 'article',
|
|
17
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
|
|
18
|
-
component: () => {
|
|
19
|
-
const manager = usePluginManager();
|
|
20
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
|
|
21
|
-
|
|
22
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
createSurface({
|
|
26
|
-
id: `${meta.id}/installed`,
|
|
27
|
-
role: 'article',
|
|
28
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
|
|
29
|
-
component: () => {
|
|
30
|
-
const manager = usePluginManager();
|
|
31
|
-
const filtered = useMemo(
|
|
32
|
-
() =>
|
|
33
|
-
manager.plugins
|
|
34
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
35
|
-
.filter(({ meta }) => manager.enabled.includes(meta.id)),
|
|
36
|
-
[],
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
createSurface({
|
|
43
|
-
id: `${meta.id}/recommended`,
|
|
44
|
-
role: 'article',
|
|
45
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
46
|
-
component: () => {
|
|
47
|
-
const manager = usePluginManager();
|
|
48
|
-
const filtered = useMemo(
|
|
49
|
-
() =>
|
|
50
|
-
manager.plugins
|
|
51
|
-
.filter(({ meta }) => !manager.core.includes(meta.id))
|
|
52
|
-
.filter(({ meta }) => !meta.tags?.includes('labs')),
|
|
53
|
-
[],
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
createSurface({
|
|
60
|
-
id: `${meta.id}/labs`,
|
|
61
|
-
role: 'article',
|
|
62
|
-
filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
|
|
63
|
-
component: () => {
|
|
64
|
-
const manager = usePluginManager();
|
|
65
|
-
const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('labs')), []);
|
|
66
|
-
|
|
67
|
-
return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
70
|
-
createSurface({
|
|
71
|
-
id: `${meta.id}/plugin-details`,
|
|
72
|
-
role: 'article',
|
|
73
|
-
filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
|
|
74
|
-
component: ({ data: { subject } }) => {
|
|
75
|
-
const manager = usePluginManager();
|
|
76
|
-
const enabled = manager.enabled.includes(subject.meta.id);
|
|
77
|
-
const handleEnable = useCallback(
|
|
78
|
-
() => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),
|
|
79
|
-
[manager, subject.meta.id, enabled],
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
return <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />;
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
]);
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
-
import React, { type ReactElement, type SVGProps, forwardRef } from 'react';
|
|
8
|
-
|
|
9
|
-
import { Icon } from '@dxos/react-ui';
|
|
10
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
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
|
-
<Icon icon='ph--github-logo--regular' classNames={mx(getSize(8))} />
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const Default: Story = {};
|
|
98
|
-
|
|
99
|
-
const meta = {
|
|
100
|
-
title: 'plugins/plugin-registry/Icon',
|
|
101
|
-
render: DefaultStory,
|
|
102
|
-
decorators: [withTheme],
|
|
103
|
-
parameters: {
|
|
104
|
-
layout: 'centered',
|
|
105
|
-
},
|
|
106
|
-
} satisfies Meta<typeof IconBase>;
|
|
107
|
-
|
|
108
|
-
export default meta;
|
|
109
|
-
|
|
110
|
-
type Story = StoryObj<typeof meta>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
|
|
7
|
-
import { faker } from '@dxos/random';
|
|
8
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
9
|
-
|
|
10
|
-
import { translations } from '../translations';
|
|
11
|
-
|
|
12
|
-
import { PluginDetail } from './PluginDetail';
|
|
13
|
-
|
|
14
|
-
const meta = {
|
|
15
|
-
title: 'plugins/plugin-registry/PluginDetail',
|
|
16
|
-
component: PluginDetail,
|
|
17
|
-
decorators: [withTheme],
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: 'column',
|
|
20
|
-
translations,
|
|
21
|
-
},
|
|
22
|
-
} satisfies Meta<typeof PluginDetail>;
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
|
|
26
|
-
type Story = StoryObj<typeof meta>;
|
|
27
|
-
|
|
28
|
-
export const Default: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
plugin: {
|
|
31
|
-
meta: {
|
|
32
|
-
id: 'example.com/plugin/test-plugin',
|
|
33
|
-
name: 'Test Plugin',
|
|
34
|
-
description: faker.lorem.paragraphs(2),
|
|
35
|
-
icon: 'ph--bug--regular',
|
|
36
|
-
homePage: 'https://example.com',
|
|
37
|
-
source: 'https://github.com/example/test-plugin',
|
|
38
|
-
screenshots: [
|
|
39
|
-
'https://media.gcflearnfree.org/content/55e073de7dd48174331f51b3_01_17_2014/getting_started_interactive2.png',
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
modules: [],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1,65 +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 { StackItem } from '@dxos/react-ui-stack';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
|
|
13
|
-
export type PluginDetailProps = {
|
|
14
|
-
plugin: Plugin;
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
onEnable?: () => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {
|
|
20
|
-
const { t } = useTranslation(meta.id);
|
|
21
|
-
const { id, name, description, homePage, source, screenshots } = plugin.meta;
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<StackItem.Content scrollable>
|
|
25
|
-
<div role='none' className='container-max-width p-4'>
|
|
26
|
-
<div role='none' className='flex justify-between items-center'>
|
|
27
|
-
<p>{id}</p>
|
|
28
|
-
<Input.Root>
|
|
29
|
-
<Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />
|
|
30
|
-
</Input.Root>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
{screenshots && screenshots.length > 0 && (
|
|
34
|
-
<div role='none'>
|
|
35
|
-
<h1 className='text-lg mb-2'>Preview</h1>
|
|
36
|
-
<img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
|
|
37
|
-
</div>
|
|
38
|
-
)}
|
|
39
|
-
|
|
40
|
-
<div role='none'>
|
|
41
|
-
<p>{description}</p>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div role='none'>
|
|
45
|
-
<h1 className='text-lg mb-2'>Resources</h1>
|
|
46
|
-
<div className='flex gap-2'>
|
|
47
|
-
{homePage && (
|
|
48
|
-
<Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
49
|
-
{t('home page label')}
|
|
50
|
-
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
51
|
-
</Link>
|
|
52
|
-
)}
|
|
53
|
-
|
|
54
|
-
{source && (
|
|
55
|
-
<Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
|
|
56
|
-
{t('source label')}
|
|
57
|
-
<Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
|
|
58
|
-
</Link>
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</StackItem.Content>
|
|
64
|
-
);
|
|
65
|
-
};
|