@dxos/plugin-registry 0.7.4 → 0.7.5-labs.071a3e2
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 +164 -0
- package/dist/lib/browser/app-graph-builder-PPWF5KP5.mjs.map +7 -0
- package/dist/lib/browser/chunk-RGSIE33X.mjs +16 -0
- package/dist/lib/browser/chunk-RGSIE33X.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +49 -192
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-2JQUQJI5.mjs +23 -0
- package/dist/lib/browser/intent-resolver-2JQUQJI5.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-NRETIUCH.mjs +295 -0
- package/dist/lib/browser/react-surface-NRETIUCH.mjs.map +7 -0
- package/dist/types/src/RegistryPlugin.d.ts +1 -6
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +180 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail.d.ts +9 -0
- package/dist/types/src/components/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail.stories.d.ts +8 -0
- package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginItem.d.ts +11 -0
- package/dist/types/src/components/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList.d.ts +5 -8
- package/dist/types/src/components/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/PluginList.stories.d.ts +6 -1
- package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/components/RegistryContainer.d.ts +7 -0
- package/dist/types/src/components/RegistryContainer.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/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +10 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +6 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +17 -23
- package/src/RegistryPlugin.tsx +26 -36
- package/src/capabilities/app-graph-builder.ts +126 -0
- package/src/capabilities/index.ts +9 -0
- package/src/capabilities/intent-resolver.ts +27 -0
- package/src/capabilities/react-surface.tsx +90 -0
- package/src/components/PluginDetail.stories.tsx +45 -0
- package/src/components/PluginDetail.tsx +63 -0
- package/src/components/PluginItem.tsx +105 -0
- package/src/components/PluginList.stories.tsx +30 -21
- package/src/components/PluginList.tsx +13 -90
- package/src/components/RegistryContainer.tsx +51 -0
- package/src/components/index.ts +2 -1
- package/src/index.ts +1 -4
- package/src/meta.ts +5 -1
- package/src/translations.ts +12 -2
- package/src/types.ts +13 -0
- package/dist/lib/browser/chunk-NEMFDAOB.mjs +0 -12
- package/dist/lib/browser/chunk-NEMFDAOB.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/components/PluginSettings.d.ts +0 -6
- package/dist/types/src/components/PluginSettings.d.ts.map +0 -1
- package/src/components/PluginSettings.tsx +0 -109
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REGISTRY_ID,
|
|
3
|
+
REGISTRY_KEY,
|
|
4
|
+
REGISTRY_PLUGIN
|
|
5
|
+
} from "./chunk-RGSIE33X.mjs";
|
|
6
|
+
|
|
7
|
+
// packages/plugins/plugin-registry/src/capabilities/app-graph-builder.ts
|
|
8
|
+
import { Capabilities, contributes, createIntent, SettingsAction } from "@dxos/app-framework";
|
|
9
|
+
import { createExtension } from "@dxos/plugin-graph";
|
|
10
|
+
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
|
|
11
|
+
createExtension({
|
|
12
|
+
id: REGISTRY_PLUGIN,
|
|
13
|
+
filter: (node) => node.id === "root",
|
|
14
|
+
actions: () => [
|
|
15
|
+
{
|
|
16
|
+
id: REGISTRY_PLUGIN,
|
|
17
|
+
data: async () => {
|
|
18
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
19
|
+
await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
|
|
20
|
+
},
|
|
21
|
+
properties: {
|
|
22
|
+
label: [
|
|
23
|
+
"open plugin registry label",
|
|
24
|
+
{
|
|
25
|
+
ns: REGISTRY_PLUGIN
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
icon: "ph--squares-four--regular"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
createExtension({
|
|
34
|
+
id: REGISTRY_PLUGIN,
|
|
35
|
+
filter: (node) => node.id === "root",
|
|
36
|
+
connector: () => [
|
|
37
|
+
{
|
|
38
|
+
id: REGISTRY_ID,
|
|
39
|
+
type: REGISTRY_PLUGIN,
|
|
40
|
+
properties: {
|
|
41
|
+
label: [
|
|
42
|
+
"plugin registry label",
|
|
43
|
+
{
|
|
44
|
+
ns: REGISTRY_PLUGIN
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
icon: "ph--squares-four--regular",
|
|
48
|
+
disposition: "pin-end",
|
|
49
|
+
testId: "treeView.pluginRegistry"
|
|
50
|
+
},
|
|
51
|
+
nodes: [
|
|
52
|
+
{
|
|
53
|
+
id: `${REGISTRY_KEY}:all`,
|
|
54
|
+
type: "category",
|
|
55
|
+
data: `${REGISTRY_KEY}:all`,
|
|
56
|
+
properties: {
|
|
57
|
+
label: [
|
|
58
|
+
"all plugins label",
|
|
59
|
+
{
|
|
60
|
+
ns: REGISTRY_PLUGIN
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
icon: "ph--squares-four--regular",
|
|
64
|
+
key: REGISTRY_KEY,
|
|
65
|
+
testId: "pluginRegistry.all"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: `${REGISTRY_KEY}:installed`,
|
|
70
|
+
type: "category",
|
|
71
|
+
data: `${REGISTRY_KEY}:installed`,
|
|
72
|
+
properties: {
|
|
73
|
+
label: [
|
|
74
|
+
"installed plugins label",
|
|
75
|
+
{
|
|
76
|
+
ns: REGISTRY_PLUGIN
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
icon: "ph--check--regular",
|
|
80
|
+
key: REGISTRY_KEY,
|
|
81
|
+
testId: "pluginRegistry.installed"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: `${REGISTRY_KEY}:recommended`,
|
|
86
|
+
type: "category",
|
|
87
|
+
data: `${REGISTRY_KEY}:recommended`,
|
|
88
|
+
properties: {
|
|
89
|
+
label: [
|
|
90
|
+
"recommended plugins label",
|
|
91
|
+
{
|
|
92
|
+
ns: REGISTRY_PLUGIN
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
icon: "ph--star--regular",
|
|
96
|
+
key: REGISTRY_KEY,
|
|
97
|
+
testId: "pluginRegistry.recommended"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: `${REGISTRY_KEY}:experimental`,
|
|
102
|
+
type: "category",
|
|
103
|
+
data: `${REGISTRY_KEY}:experimental`,
|
|
104
|
+
properties: {
|
|
105
|
+
label: [
|
|
106
|
+
"experimental plugins label",
|
|
107
|
+
{
|
|
108
|
+
ns: REGISTRY_PLUGIN
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
icon: "ph--flask--regular",
|
|
112
|
+
key: REGISTRY_KEY,
|
|
113
|
+
testId: "pluginRegistry.experimental"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
createExtension({
|
|
121
|
+
id: `${REGISTRY_PLUGIN}/actions`,
|
|
122
|
+
filter: (node) => node.id === REGISTRY_ID,
|
|
123
|
+
actions: () => [
|
|
124
|
+
{
|
|
125
|
+
id: `${REGISTRY_PLUGIN}/load-by-url`,
|
|
126
|
+
data: async () => {
|
|
127
|
+
},
|
|
128
|
+
properties: {
|
|
129
|
+
label: [
|
|
130
|
+
"load by url label",
|
|
131
|
+
{
|
|
132
|
+
ns: REGISTRY_PLUGIN
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
icon: "ph--cloud-arrow-down--regular",
|
|
136
|
+
disabled: true
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
createExtension({
|
|
142
|
+
id: `${REGISTRY_PLUGIN}/plugins`,
|
|
143
|
+
resolver: ({ id }) => {
|
|
144
|
+
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
145
|
+
const plugin = manager.plugins.find((plugin2) => plugin2.meta.id === id.replaceAll(":", "/"));
|
|
146
|
+
if (!plugin) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
id,
|
|
151
|
+
type: "dxos.org/plugin",
|
|
152
|
+
data: plugin,
|
|
153
|
+
properties: {
|
|
154
|
+
label: plugin.meta.name ?? plugin.meta.id,
|
|
155
|
+
icon: plugin.meta.icon ?? "ph--circle--regular"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
]);
|
|
161
|
+
export {
|
|
162
|
+
app_graph_builder_default as default
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=app-graph-builder-PPWF5KP5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, SettingsAction, type PluginsContext } from '@dxos/app-framework';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: REGISTRY_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n actions: () => [\n {\n id: REGISTRY_PLUGIN,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.OpenPluginRegistry));\n },\n properties: {\n label: ['open plugin registry label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n },\n },\n ],\n }),\n createExtension({\n id: REGISTRY_PLUGIN,\n filter: (node): node is Node<null> => node.id === 'root',\n connector: () => [\n {\n id: REGISTRY_ID,\n type: REGISTRY_PLUGIN,\n properties: {\n label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n disposition: 'pin-end',\n testId: 'treeView.pluginRegistry',\n },\n nodes: [\n {\n id: `${REGISTRY_KEY}:all`,\n type: 'category',\n data: `${REGISTRY_KEY}:all`,\n properties: {\n label: ['all plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.all',\n },\n },\n {\n id: `${REGISTRY_KEY}:installed`,\n type: 'category',\n data: `${REGISTRY_KEY}:installed`,\n properties: {\n label: ['installed plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--check--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.installed',\n },\n },\n {\n id: `${REGISTRY_KEY}:recommended`,\n type: 'category',\n data: `${REGISTRY_KEY}:recommended`,\n properties: {\n label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--star--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.recommended',\n },\n },\n {\n id: `${REGISTRY_KEY}:experimental`,\n type: 'category',\n data: `${REGISTRY_KEY}:experimental`,\n properties: {\n label: ['experimental plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--flask--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.experimental',\n },\n },\n ],\n },\n ],\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/actions`,\n filter: (node): node is Node<null> => node.id === REGISTRY_ID,\n actions: () => [\n {\n id: `${REGISTRY_PLUGIN}/load-by-url`,\n data: async () => {},\n properties: {\n label: ['load by url label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--cloud-arrow-down--regular',\n disabled: true,\n },\n },\n ],\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/plugins`,\n resolver: ({ id }) => {\n const manager = context.requestCapability(Capabilities.PluginManager);\n const plugin = manager.plugins.find((plugin) => plugin.meta.id === id.replaceAll(':', '/'));\n if (!plugin) {\n return;\n }\n\n return {\n id,\n type: 'dxos.org/plugin',\n data: plugin,\n properties: {\n label: plugin.meta.name ?? plugin.meta.id,\n icon: plugin.meta.icon ?? 'ph--circle--regular',\n },\n };\n },\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,sBAA2C;AAC7F,SAASC,uBAAkC;AAI3C,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAIC;IACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;IAClDI,SAAS,MAAM;MACb;QACEJ,IAAIC;QACJI,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,QAAQa,kBAAkBX,aAAaY,gBAAgB;AAC7F,gBAAMF,SAASG,aAAaC,eAAeC,kBAAkB,CAAA;QAC/D;QACAC,YAAY;UACVC,OAAO;YAAC;YAA8B;cAAEC,IAAId;YAAgB;;UAC5De,MAAM;QACR;MACF;;EAEJ,CAAA;EACAjB,gBAAgB;IACdC,IAAIC;IACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAO;IAClDiB,WAAW,MAAM;MACf;QACEjB,IAAIkB;QACJC,MAAMlB;QACNY,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAId;YAAgB;;UACvDe,MAAM;UACNI,aAAa;UACbC,QAAQ;QACV;QACAC,OAAO;UACL;YACEtB,IAAI,GAAGuB,YAAAA;YACPJ,MAAM;YACNd,MAAM,GAAGkB,YAAAA;YACTV,YAAY;cACVC,OAAO;gBAAC;gBAAqB;kBAAEC,IAAId;gBAAgB;;cACnDe,MAAM;cACNQ,KAAKD;cACLF,QAAQ;YACV;UACF;UACA;YACErB,IAAI,GAAGuB,YAAAA;YACPJ,MAAM;YACNd,MAAM,GAAGkB,YAAAA;YACTV,YAAY;cACVC,OAAO;gBAAC;gBAA2B;kBAAEC,IAAId;gBAAgB;;cACzDe,MAAM;cACNQ,KAAKD;cACLF,QAAQ;YACV;UACF;UACA;YACErB,IAAI,GAAGuB,YAAAA;YACPJ,MAAM;YACNd,MAAM,GAAGkB,YAAAA;YACTV,YAAY;cACVC,OAAO;gBAAC;gBAA6B;kBAAEC,IAAId;gBAAgB;;cAC3De,MAAM;cACNQ,KAAKD;cACLF,QAAQ;YACV;UACF;UACA;YACErB,IAAI,GAAGuB,YAAAA;YACPJ,MAAM;YACNd,MAAM,GAAGkB,YAAAA;YACTV,YAAY;cACVC,OAAO;gBAAC;gBAA8B;kBAAEC,IAAId;gBAAgB;;cAC5De,MAAM;cACNQ,KAAKD;cACLF,QAAQ;YACV;UACF;;MAEJ;;EAEJ,CAAA;EACAtB,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOkB;IAClDd,SAAS,MAAM;MACb;QACEJ,IAAI,GAAGC,eAAAA;QACPI,MAAM,YAAA;QAAa;QACnBQ,YAAY;UACVC,OAAO;YAAC;YAAqB;cAAEC,IAAId;YAAgB;;UACnDe,MAAM;UACNS,UAAU;QACZ;MACF;;EAEJ,CAAA;EACA1B,gBAAgB;IACdC,IAAI,GAAGC,eAAAA;IACPyB,UAAU,CAAC,EAAE1B,GAAE,MAAE;AACf,YAAM2B,UAAUhC,QAAQa,kBAAkBX,aAAa+B,aAAa;AACpE,YAAMC,SAASF,QAAQG,QAAQC,KAAK,CAACF,YAAWA,QAAOG,KAAKhC,OAAOA,GAAGiC,WAAW,KAAK,GAAA,CAAA;AACtF,UAAI,CAACJ,QAAQ;AACX;MACF;AAEA,aAAO;QACL7B;QACAmB,MAAM;QACNd,MAAMwB;QACNhB,YAAY;UACVC,OAAOe,OAAOG,KAAKE,QAAQL,OAAOG,KAAKhC;UACvCgB,MAAMa,OAAOG,KAAKhB,QAAQ;QAC5B;MACF;IACF;EACF,CAAA;CACD;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "createIntent", "SettingsAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "REGISTRY_PLUGIN", "filter", "node", "actions", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "createIntent", "SettingsAction", "OpenPluginRegistry", "properties", "label", "ns", "icon", "connector", "REGISTRY_ID", "type", "disposition", "testId", "nodes", "REGISTRY_KEY", "key", "disabled", "resolver", "manager", "PluginManager", "plugin", "plugins", "find", "meta", "replaceAll", "name"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// packages/plugins/plugin-registry/src/meta.ts
|
|
2
|
+
var REGISTRY_PLUGIN = "dxos.org/plugin/registry";
|
|
3
|
+
var REGISTRY_ID = "dxos:plugin-registry";
|
|
4
|
+
var REGISTRY_KEY = "plugin-registry";
|
|
5
|
+
var meta = {
|
|
6
|
+
id: REGISTRY_PLUGIN,
|
|
7
|
+
name: "Plugins"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
REGISTRY_PLUGIN,
|
|
12
|
+
REGISTRY_ID,
|
|
13
|
+
REGISTRY_KEY,
|
|
14
|
+
meta
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-RGSIE33X.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';\n\n// TODO(wittjosiah): Deck does not currently support `/` in ids.\nexport const REGISTRY_ID = 'dxos:plugin-registry';\nexport const REGISTRY_KEY = 'plugin-registry';\n\nexport const meta = {\n id: REGISTRY_PLUGIN,\n name: 'Plugins',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,kBAAkB;AAGxB,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAO;EAClBC,IAAIJ;EACJK,MAAM;AACR;",
|
|
6
|
+
"names": ["REGISTRY_PLUGIN", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name"]
|
|
7
|
+
}
|
|
@@ -1,164 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
REGISTRY_ID,
|
|
3
|
+
REGISTRY_KEY,
|
|
2
4
|
REGISTRY_PLUGIN,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-RGSIE33X.mjs";
|
|
5
7
|
|
|
6
8
|
// packages/plugins/plugin-registry/src/RegistryPlugin.tsx
|
|
7
|
-
import
|
|
8
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
9
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
9
10
|
|
|
10
|
-
// packages/plugins/plugin-registry/src/
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
const { t } = useTranslation(REGISTRY_PLUGIN);
|
|
16
|
-
return /* @__PURE__ */ React.createElement(List, {
|
|
17
|
-
classNames: "mb-4 select-none"
|
|
18
|
-
}, plugins.map(({ id, name, description, homePage, source, icon = "ph--circle--regular" }) => {
|
|
19
|
-
const isEnabled = enabled.includes(id);
|
|
20
|
-
const isLoaded = loaded.includes(id);
|
|
21
|
-
const reloadRequired = isEnabled !== isLoaded;
|
|
22
|
-
const inputId = `${id}-input`;
|
|
23
|
-
const labelId = `${id}-label`;
|
|
24
|
-
const descriptionId = `${id}-description`;
|
|
25
|
-
const handleChange = useCallback(() => onChange?.(id, !isEnabled), [
|
|
26
|
-
id,
|
|
27
|
-
isEnabled,
|
|
28
|
-
onChange
|
|
29
|
-
]);
|
|
30
|
-
return /* @__PURE__ */ React.createElement(Input.Root, {
|
|
31
|
-
key: id,
|
|
32
|
-
id: inputId
|
|
33
|
-
}, /* @__PURE__ */ React.createElement(ListItem.Root, {
|
|
34
|
-
labelId,
|
|
35
|
-
"data-testid": `pluginList.${id}`,
|
|
36
|
-
"aria-describedby": descriptionId,
|
|
37
|
-
classNames: "flex gap-2 plb-2 pli-2 -mli-2 rounded"
|
|
38
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
39
|
-
icon,
|
|
40
|
-
size: 6,
|
|
41
|
-
classNames: "shrink-0 mbs-1"
|
|
42
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
43
|
-
role: "none",
|
|
44
|
-
className: mx(fineBlockSize, "grow pbs-1 pl-1")
|
|
45
|
-
}, /* @__PURE__ */ React.createElement("label", {
|
|
46
|
-
htmlFor: inputId,
|
|
47
|
-
id: labelId,
|
|
48
|
-
className: "truncate"
|
|
49
|
-
}, name ?? id), (description || reloadRequired || homePage || source) && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
50
|
-
id: descriptionId,
|
|
51
|
-
className: "space-b-1 pbs-1 pbe-1"
|
|
52
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
53
|
-
className: descriptionText
|
|
54
|
-
}, description), homePage && /* @__PURE__ */ React.createElement(Link, {
|
|
55
|
-
href: homePage,
|
|
56
|
-
target: "_blank",
|
|
57
|
-
rel: "noreferrer",
|
|
58
|
-
"aria-describedby": descriptionId,
|
|
59
|
-
classNames: "text-xs text-description"
|
|
60
|
-
}, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
61
|
-
icon: "ph--arrow-square-out--bold",
|
|
62
|
-
size: 3,
|
|
63
|
-
classNames: "inline-block leading-none mli-1"
|
|
64
|
-
})), source && /* @__PURE__ */ React.createElement(Link, {
|
|
65
|
-
href: source,
|
|
66
|
-
target: "_blank",
|
|
67
|
-
rel: "noreferrer",
|
|
68
|
-
"aria-describedby": descriptionId,
|
|
69
|
-
classNames: "text-xs text-description"
|
|
70
|
-
}, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
71
|
-
icon: "ph--arrow-square-out--bold",
|
|
72
|
-
size: 3,
|
|
73
|
-
classNames: "inline-block leading-none mli-1"
|
|
74
|
-
}))), reloadRequired && /* @__PURE__ */ React.createElement(Button, {
|
|
75
|
-
variant: "ghost",
|
|
76
|
-
classNames: "p-0 gap-2",
|
|
77
|
-
onClick: onReload
|
|
78
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
79
|
-
size: 4,
|
|
80
|
-
icon: "ph--arrow-clockwise--regular"
|
|
81
|
-
}), /* @__PURE__ */ React.createElement("p", {
|
|
82
|
-
className: "text-sm font-medium"
|
|
83
|
-
}, t("reload required message"))))), /* @__PURE__ */ React.createElement("div", {
|
|
84
|
-
className: "pbs-1"
|
|
85
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
86
|
-
classNames: "self-center",
|
|
87
|
-
checked: isEnabled,
|
|
88
|
-
onClick: handleChange
|
|
89
|
-
}))));
|
|
90
|
-
}));
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// packages/plugins/plugin-registry/src/components/PluginSettings.tsx
|
|
94
|
-
import React2, { useMemo } from "react";
|
|
95
|
-
import { useIntentDispatcher, usePlugins } from "@dxos/app-framework";
|
|
96
|
-
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
97
|
-
import { Input as Input2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
98
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
99
|
-
var sortPluginMeta = ({ name: a = "" }, { name: b = "" }) => a.localeCompare(b);
|
|
100
|
-
var PluginSettings = ({ settings }) => {
|
|
101
|
-
const { t } = useTranslation2(REGISTRY_PLUGIN);
|
|
102
|
-
const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();
|
|
103
|
-
const dispatch = useIntentDispatcher();
|
|
104
|
-
const installed = useMemo(() => plugins.filter(({ meta }) => !core.includes(meta.id)).filter(({ meta }) => enabled.includes(meta.id)).map(({ meta }) => meta).sort(sortPluginMeta), []);
|
|
105
|
-
const pluginIds = plugins.map(({ meta }) => meta.id);
|
|
106
|
-
const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sortPluginMeta), []);
|
|
107
|
-
const recommended = available.filter((meta) => !meta.tags?.includes("experimental"));
|
|
108
|
-
const experimental = available.filter((meta) => meta.tags?.includes("experimental"));
|
|
109
|
-
const handleChange = (id, enabled2) => {
|
|
110
|
-
setPlugin(id, enabled2);
|
|
111
|
-
void dispatch({
|
|
112
|
-
action: ObservabilityAction.SEND_EVENT,
|
|
113
|
-
data: {
|
|
114
|
-
name: "plugins.toggle",
|
|
115
|
-
properties: {
|
|
116
|
-
plugin: id,
|
|
117
|
-
enabled: enabled2
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
const handleReload = () => {
|
|
123
|
-
window.location.reload();
|
|
124
|
-
};
|
|
125
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
126
|
-
label: t("settings show experimental label")
|
|
127
|
-
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
128
|
-
"data-testid": "pluginSettings.experimental",
|
|
129
|
-
checked: settings.experimental,
|
|
130
|
-
onCheckedChange: (checked) => settings.experimental = !!checked
|
|
131
|
-
})), /* @__PURE__ */ React2.createElement(Section, {
|
|
132
|
-
label: t("settings section installed label")
|
|
133
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
134
|
-
plugins: installed,
|
|
135
|
-
loaded: pluginIds,
|
|
136
|
-
enabled,
|
|
137
|
-
onChange: handleChange,
|
|
138
|
-
onReload: handleReload
|
|
139
|
-
})), /* @__PURE__ */ React2.createElement(Section, {
|
|
140
|
-
label: t("settings section recommended label")
|
|
141
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
142
|
-
plugins: recommended,
|
|
143
|
-
loaded: pluginIds,
|
|
144
|
-
enabled,
|
|
145
|
-
onChange: handleChange,
|
|
146
|
-
onReload: handleReload
|
|
147
|
-
})), settings.experimental && /* @__PURE__ */ React2.createElement(Section, {
|
|
148
|
-
label: t("settings section experimental label")
|
|
149
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
150
|
-
plugins: experimental,
|
|
151
|
-
loaded: pluginIds,
|
|
152
|
-
enabled,
|
|
153
|
-
onChange: handleChange,
|
|
154
|
-
onReload: handleReload
|
|
155
|
-
})));
|
|
156
|
-
};
|
|
157
|
-
var Section = ({ label, children }) => {
|
|
158
|
-
return /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("h2", {
|
|
159
|
-
className: "py-2 text-sm text-subdued"
|
|
160
|
-
}, label), children);
|
|
161
|
-
};
|
|
11
|
+
// packages/plugins/plugin-registry/src/capabilities/index.ts
|
|
12
|
+
import { lazy } from "@dxos/app-framework";
|
|
13
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-PPWF5KP5.mjs"));
|
|
14
|
+
var IntentResolver = lazy(() => import("./intent-resolver-2JQUQJI5.mjs"));
|
|
15
|
+
var ReactSurface = lazy(() => import("./react-surface-NRETIUCH.mjs"));
|
|
162
16
|
|
|
163
17
|
// packages/plugins/plugin-registry/src/translations.ts
|
|
164
18
|
var translations_default = [
|
|
@@ -168,51 +22,54 @@ var translations_default = [
|
|
|
168
22
|
"plugin name": "Registry",
|
|
169
23
|
"reload required message": "Reload required.",
|
|
170
24
|
"settings show experimental label": "Show experimental plugins",
|
|
171
|
-
"settings section installed label": "
|
|
25
|
+
"settings section installed label": "Enabled",
|
|
172
26
|
"settings section recommended label": "Recommended",
|
|
173
27
|
"settings section experimental label": "Experimental",
|
|
174
|
-
"
|
|
175
|
-
"
|
|
28
|
+
"details label": "Details",
|
|
29
|
+
"home page label": "Website",
|
|
30
|
+
"source label": "Source",
|
|
31
|
+
"plugin registry label": "Plugin Registry",
|
|
32
|
+
"all plugins label": "All",
|
|
33
|
+
"installed plugins label": "Enabled",
|
|
34
|
+
"recommended plugins label": "Recommended",
|
|
35
|
+
"experimental plugins label": "Experimental",
|
|
36
|
+
"community plugins label": "Community",
|
|
37
|
+
"load by url label": "Load by URL (soon)",
|
|
38
|
+
"coming soon label": "Coming soon!",
|
|
39
|
+
"open plugin registry label": "Open plugin registry"
|
|
176
40
|
}
|
|
177
41
|
}
|
|
178
42
|
}
|
|
179
43
|
];
|
|
180
44
|
|
|
181
45
|
// packages/plugins/plugin-registry/src/RegistryPlugin.tsx
|
|
182
|
-
var RegistryPlugin = () =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
// packages/plugins/plugin-registry/src/index.ts
|
|
213
|
-
var src_default = RegistryPlugin;
|
|
46
|
+
var RegistryPlugin = () => definePlugin(meta, [
|
|
47
|
+
defineModule({
|
|
48
|
+
id: `${meta.id}/module/translations`,
|
|
49
|
+
activatesOn: Events.SetupTranslations,
|
|
50
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
51
|
+
}),
|
|
52
|
+
defineModule({
|
|
53
|
+
id: `${meta.id}/module/react-surface`,
|
|
54
|
+
activatesOn: Events.SetupSurfaces,
|
|
55
|
+
activate: ReactSurface
|
|
56
|
+
}),
|
|
57
|
+
defineModule({
|
|
58
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
59
|
+
activatesOn: Events.SetupIntents,
|
|
60
|
+
activate: IntentResolver
|
|
61
|
+
}),
|
|
62
|
+
defineModule({
|
|
63
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
64
|
+
activatesOn: Events.SetupAppGraph,
|
|
65
|
+
activate: AppGraphBuilder
|
|
66
|
+
})
|
|
67
|
+
]);
|
|
214
68
|
export {
|
|
69
|
+
REGISTRY_ID,
|
|
70
|
+
REGISTRY_KEY,
|
|
71
|
+
REGISTRY_PLUGIN,
|
|
215
72
|
RegistryPlugin,
|
|
216
|
-
|
|
73
|
+
meta
|
|
217
74
|
};
|
|
218
75
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/RegistryPlugin.tsx", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/RegistryPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\n\nimport { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\n\nexport const RegistryPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupSurfaces,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntents,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { REGISTRY_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [REGISTRY_PLUGIN]: {\n 'plugin name': 'Registry',\n 'reload required message': 'Reload required.',\n 'settings show experimental label': 'Show experimental plugins',\n 'settings section installed label': 'Enabled',\n 'settings section recommended label': 'Recommended',\n 'settings section experimental label': 'Experimental',\n 'details label': 'Details',\n 'home page label': 'Website',\n 'source label': 'Source',\n 'plugin registry label': 'Plugin Registry',\n 'all plugins label': 'All',\n 'installed plugins label': 'Enabled',\n 'recommended plugins label': 'Recommended',\n 'experimental plugins label': 'Experimental',\n 'community plugins label': 'Community',\n 'load by url label': 'Load by URL (soon)',\n 'coming soon label': 'Coming soon!',\n 'open plugin registry label': 'Open plugin registry',\n },\n },\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,cAAc;;;ACA9E,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACF9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACG,eAAAA,GAAkB;QACjB,eAAe;QACf,2BAA2B;QAC3B,oCAAoC;QACpC,oCAAoC;QACpC,sCAAsC;QACtC,uCAAuC;QACvC,iBAAiB;QACjB,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,qBAAqB;QACrB,2BAA2B;QAC3B,6BAA6B;QAC7B,8BAA8B;QAC9B,2BAA2B;QAC3B,qBAAqB;QACrB,qBAAqB;QACrB,8BAA8B;MAChC;IACF;EACF;;;;AFpBK,IAAMC,iBAAiB,MAC5BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAUM;EACZ,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOS;IACpBP,UAAUQ;EACZ,CAAA;EACAb,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOW;IACpBT,UAAUU;EACZ,CAAA;CACD;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "lazy", "AppGraphBuilder", "lazy", "IntentResolver", "ReactSurface", "REGISTRY_PLUGIN", "RegistryPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupSurfaces", "ReactSurface", "SetupIntents", "IntentResolver", "SetupAppGraph", "AppGraphBuilder"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REGISTRY_ID
|
|
3
|
+
} from "./chunk-RGSIE33X.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-registry/src/capabilities/intent-resolver.ts
|
|
6
|
+
import { contributes, SettingsAction, createResolver, LayoutAction, Capabilities, createIntent } from "@dxos/app-framework";
|
|
7
|
+
var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
|
|
8
|
+
intent: SettingsAction.OpenPluginRegistry,
|
|
9
|
+
resolve: () => {
|
|
10
|
+
return {
|
|
11
|
+
intents: [
|
|
12
|
+
createIntent(LayoutAction.SwitchWorkspace, {
|
|
13
|
+
part: "workspace",
|
|
14
|
+
subject: REGISTRY_ID
|
|
15
|
+
})
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
export {
|
|
21
|
+
intent_resolver_default as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=intent-resolver-2JQUQJI5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n contributes,\n SettingsAction,\n createResolver,\n LayoutAction,\n Capabilities,\n createIntent,\n} from '@dxos/app-framework';\n\nimport { REGISTRY_ID } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: SettingsAction.OpenPluginRegistry,\n resolve: () => {\n return {\n intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],\n };\n },\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SACEA,aACAC,gBACAC,gBACAC,cACAC,cACAC,oBACK;AAIP,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,MAAA;AACP,WAAO;MACLC,SAAS;QAACC,aAAaC,aAAaC,iBAAiB;UAAEC,MAAM;UAAaC,SAASC;QAAY,CAAA;;IACjG;EACF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["contributes", "SettingsAction", "createResolver", "LayoutAction", "Capabilities", "createIntent", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "SettingsAction", "OpenPluginRegistry", "resolve", "intents", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "REGISTRY_ID"]
|
|
7
|
+
}
|