@dxos/plugin-registry 0.7.5-main.499c70c → 0.7.5-main.5ae2ba8
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-Z6FZXJWI.mjs +164 -0
- package/dist/lib/browser/app-graph-builder-Z6FZXJWI.mjs.map +7 -0
- package/dist/lib/browser/chunk-H6GNIIDK.mjs +16 -0
- package/dist/lib/browser/chunk-H6GNIIDK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +50 -189
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-QW333HWJ.mjs +23 -0
- package/dist/lib/browser/intent-resolver-QW333HWJ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-6JN3QJEF.mjs +324 -0
- package/dist/lib/browser/react-surface-6JN3QJEF.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 +8 -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 +12 -0
- package/dist/types/src/components/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList.d.ts +5 -9
- 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 +6 -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 +11 -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 -1
- package/package.json +18 -23
- package/src/RegistryPlugin.tsx +26 -41
- 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 +128 -0
- package/src/components/PluginList.stories.tsx +30 -21
- package/src/components/PluginList.tsx +13 -90
- package/src/components/RegistryContainer.tsx +81 -0
- package/src/components/index.ts +2 -1
- package/src/index.ts +1 -4
- package/src/meta.ts +5 -1
- package/src/translations.ts +13 -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 -108
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REGISTRY_ID,
|
|
3
|
+
REGISTRY_KEY,
|
|
4
|
+
REGISTRY_PLUGIN
|
|
5
|
+
} from "./chunk-H6GNIIDK.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-Z6FZXJWI.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-H6GNIIDK.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,162 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
REGISTRY_ID,
|
|
3
|
+
REGISTRY_KEY,
|
|
2
4
|
REGISTRY_PLUGIN,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-H6GNIIDK.mjs";
|
|
5
7
|
|
|
6
8
|
// packages/plugins/plugin-registry/src/RegistryPlugin.tsx
|
|
7
|
-
import
|
|
8
|
-
import { createSurface } from "@dxos/app-framework";
|
|
9
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
9
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events } from "@dxos/app-framework";
|
|
10
10
|
|
|
11
|
-
// packages/plugins/plugin-registry/src/
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
const { t } = useTranslation(REGISTRY_PLUGIN);
|
|
17
|
-
return /* @__PURE__ */ React.createElement(List, {
|
|
18
|
-
classNames: "mb-4 select-none"
|
|
19
|
-
}, plugins.map(({ id, name, description, homePage, source, icon = "ph--circle--regular" }) => {
|
|
20
|
-
const isEnabled = enabled.includes(id);
|
|
21
|
-
const isLoaded = loaded.includes(id);
|
|
22
|
-
const reloadRequired = isEnabled !== isLoaded;
|
|
23
|
-
const inputId = `${id}-input`;
|
|
24
|
-
const labelId = `${id}-label`;
|
|
25
|
-
const descriptionId = `${id}-description`;
|
|
26
|
-
const handleChange = useCallback(() => onChange?.(id, !isEnabled), [
|
|
27
|
-
id,
|
|
28
|
-
isEnabled,
|
|
29
|
-
onChange
|
|
30
|
-
]);
|
|
31
|
-
return /* @__PURE__ */ React.createElement(Input.Root, {
|
|
32
|
-
key: id,
|
|
33
|
-
id: inputId
|
|
34
|
-
}, /* @__PURE__ */ React.createElement(ListItem.Root, {
|
|
35
|
-
labelId,
|
|
36
|
-
"data-testid": `pluginList.${id}`,
|
|
37
|
-
"aria-describedby": descriptionId,
|
|
38
|
-
classNames: "flex gap-2 plb-2 pli-2 -mli-2 rounded"
|
|
39
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
40
|
-
icon,
|
|
41
|
-
size: 6,
|
|
42
|
-
classNames: "shrink-0 mbs-1"
|
|
43
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
44
|
-
role: "none",
|
|
45
|
-
className: mx(fineBlockSize, "grow pbs-1 pl-1")
|
|
46
|
-
}, /* @__PURE__ */ React.createElement("label", {
|
|
47
|
-
htmlFor: inputId,
|
|
48
|
-
id: labelId,
|
|
49
|
-
className: "truncate"
|
|
50
|
-
}, name ?? id), (description || reloadRequired || homePage || source) && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
51
|
-
id: descriptionId,
|
|
52
|
-
className: "space-b-1 pbs-1 pbe-1"
|
|
53
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
54
|
-
className: descriptionText
|
|
55
|
-
}, description), homePage && /* @__PURE__ */ React.createElement(Link, {
|
|
56
|
-
href: homePage,
|
|
57
|
-
target: "_blank",
|
|
58
|
-
rel: "noreferrer",
|
|
59
|
-
"aria-describedby": descriptionId,
|
|
60
|
-
classNames: "text-xs text-description"
|
|
61
|
-
}, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
62
|
-
icon: "ph--arrow-square-out--bold",
|
|
63
|
-
size: 3,
|
|
64
|
-
classNames: "inline-block leading-none mli-1"
|
|
65
|
-
})), source && /* @__PURE__ */ React.createElement(Link, {
|
|
66
|
-
href: source,
|
|
67
|
-
target: "_blank",
|
|
68
|
-
rel: "noreferrer",
|
|
69
|
-
"aria-describedby": descriptionId,
|
|
70
|
-
classNames: "text-xs text-description"
|
|
71
|
-
}, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
72
|
-
icon: "ph--arrow-square-out--bold",
|
|
73
|
-
size: 3,
|
|
74
|
-
classNames: "inline-block leading-none mli-1"
|
|
75
|
-
}))), reloadRequired && /* @__PURE__ */ React.createElement(Button, {
|
|
76
|
-
variant: "ghost",
|
|
77
|
-
classNames: "p-0 gap-2",
|
|
78
|
-
onClick: onReload
|
|
79
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
80
|
-
size: 4,
|
|
81
|
-
icon: "ph--arrow-clockwise--regular"
|
|
82
|
-
}), /* @__PURE__ */ React.createElement("p", {
|
|
83
|
-
className: "text-sm font-medium"
|
|
84
|
-
}, t("reload required message"))))), /* @__PURE__ */ React.createElement("div", {
|
|
85
|
-
className: "pbs-1"
|
|
86
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
87
|
-
classNames: "self-center",
|
|
88
|
-
checked: isEnabled,
|
|
89
|
-
onClick: handleChange
|
|
90
|
-
}))));
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// packages/plugins/plugin-registry/src/components/PluginSettings.tsx
|
|
95
|
-
import React2, { useMemo } from "react";
|
|
96
|
-
import { createIntent, useIntentDispatcher, usePlugins } from "@dxos/app-framework";
|
|
97
|
-
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
98
|
-
import { Input as Input2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
99
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
100
|
-
var sortPluginMeta = ({ name: a = "" }, { name: b = "" }) => a.localeCompare(b);
|
|
101
|
-
var PluginSettings = ({ settings }) => {
|
|
102
|
-
const { t } = useTranslation2(REGISTRY_PLUGIN);
|
|
103
|
-
const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();
|
|
104
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
105
|
-
const installed = useMemo(() => plugins.filter(({ meta }) => !core.includes(meta.id)).filter(({ meta }) => enabled.includes(meta.id)).map(({ meta }) => meta).sort(sortPluginMeta), []);
|
|
106
|
-
const pluginIds = plugins.map(({ meta }) => meta.id);
|
|
107
|
-
const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sortPluginMeta), []);
|
|
108
|
-
const recommended = available.filter((meta) => !meta.tags?.includes("experimental"));
|
|
109
|
-
const experimental = available.filter((meta) => meta.tags?.includes("experimental"));
|
|
110
|
-
const handleChange = (id, enabled2) => {
|
|
111
|
-
setPlugin(id, enabled2);
|
|
112
|
-
void dispatch(createIntent(ObservabilityAction.SendEvent, {
|
|
113
|
-
name: "plugins.toggle",
|
|
114
|
-
properties: {
|
|
115
|
-
plugin: id,
|
|
116
|
-
enabled: enabled2
|
|
117
|
-
}
|
|
118
|
-
}));
|
|
119
|
-
};
|
|
120
|
-
const handleReload = () => {
|
|
121
|
-
window.location.reload();
|
|
122
|
-
};
|
|
123
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DeprecatedFormInput, {
|
|
124
|
-
label: t("settings show experimental label")
|
|
125
|
-
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
126
|
-
"data-testid": "pluginSettings.experimental",
|
|
127
|
-
checked: settings.experimental,
|
|
128
|
-
onCheckedChange: (checked) => settings.experimental = !!checked
|
|
129
|
-
})), /* @__PURE__ */ React2.createElement(Section, {
|
|
130
|
-
label: t("settings section installed label")
|
|
131
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
132
|
-
plugins: installed,
|
|
133
|
-
loaded: pluginIds,
|
|
134
|
-
enabled,
|
|
135
|
-
onChange: handleChange,
|
|
136
|
-
onReload: handleReload
|
|
137
|
-
})), /* @__PURE__ */ React2.createElement(Section, {
|
|
138
|
-
label: t("settings section recommended label")
|
|
139
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
140
|
-
plugins: recommended,
|
|
141
|
-
loaded: pluginIds,
|
|
142
|
-
enabled,
|
|
143
|
-
onChange: handleChange,
|
|
144
|
-
onReload: handleReload
|
|
145
|
-
})), settings.experimental && /* @__PURE__ */ React2.createElement(Section, {
|
|
146
|
-
label: t("settings section experimental label")
|
|
147
|
-
}, /* @__PURE__ */ React2.createElement(PluginList, {
|
|
148
|
-
plugins: experimental,
|
|
149
|
-
loaded: pluginIds,
|
|
150
|
-
enabled,
|
|
151
|
-
onChange: handleChange,
|
|
152
|
-
onReload: handleReload
|
|
153
|
-
})));
|
|
154
|
-
};
|
|
155
|
-
var Section = ({ label, children }) => {
|
|
156
|
-
return /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("h2", {
|
|
157
|
-
className: "py-2 text-sm text-subdued"
|
|
158
|
-
}, label), children);
|
|
159
|
-
};
|
|
11
|
+
// packages/plugins/plugin-registry/src/capabilities/index.ts
|
|
12
|
+
import { lazy } from "@dxos/app-framework";
|
|
13
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-Z6FZXJWI.mjs"));
|
|
14
|
+
var IntentResolver = lazy(() => import("./intent-resolver-QW333HWJ.mjs"));
|
|
15
|
+
var ReactSurface = lazy(() => import("./react-surface-6JN3QJEF.mjs"));
|
|
160
16
|
|
|
161
17
|
// packages/plugins/plugin-registry/src/translations.ts
|
|
162
18
|
var translations_default = [
|
|
@@ -166,50 +22,55 @@ var translations_default = [
|
|
|
166
22
|
"plugin name": "Registry",
|
|
167
23
|
"reload required message": "Reload required.",
|
|
168
24
|
"settings show experimental label": "Show experimental plugins",
|
|
169
|
-
"settings section installed label": "
|
|
25
|
+
"settings section installed label": "Enabled",
|
|
170
26
|
"settings section recommended label": "Recommended",
|
|
171
27
|
"settings section experimental label": "Experimental",
|
|
172
|
-
"
|
|
173
|
-
"
|
|
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",
|
|
40
|
+
"settings label": "Settings"
|
|
174
41
|
}
|
|
175
42
|
}
|
|
176
43
|
}
|
|
177
44
|
];
|
|
178
45
|
|
|
179
46
|
// packages/plugins/plugin-registry/src/RegistryPlugin.tsx
|
|
180
|
-
var RegistryPlugin = () =>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
})
|
|
203
|
-
})
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
// packages/plugins/plugin-registry/src/index.ts
|
|
210
|
-
var src_default = RegistryPlugin;
|
|
47
|
+
var RegistryPlugin = () => definePlugin(meta, [
|
|
48
|
+
defineModule({
|
|
49
|
+
id: `${meta.id}/module/translations`,
|
|
50
|
+
activatesOn: Events.SetupTranslations,
|
|
51
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
52
|
+
}),
|
|
53
|
+
defineModule({
|
|
54
|
+
id: `${meta.id}/module/react-surface`,
|
|
55
|
+
activatesOn: Events.SetupReactSurface,
|
|
56
|
+
activate: ReactSurface
|
|
57
|
+
}),
|
|
58
|
+
defineModule({
|
|
59
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
60
|
+
activatesOn: Events.SetupIntentResolver,
|
|
61
|
+
activate: IntentResolver
|
|
62
|
+
}),
|
|
63
|
+
defineModule({
|
|
64
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
65
|
+
activatesOn: Events.SetupAppGraph,
|
|
66
|
+
activate: AppGraphBuilder
|
|
67
|
+
})
|
|
68
|
+
]);
|
|
211
69
|
export {
|
|
70
|
+
REGISTRY_ID,
|
|
71
|
+
REGISTRY_KEY,
|
|
72
|
+
REGISTRY_PLUGIN,
|
|
212
73
|
RegistryPlugin,
|
|
213
|
-
|
|
74
|
+
meta
|
|
214
75
|
};
|
|
215
76
|
//# 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.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\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 'settings label': 'Settings',\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;QAC9B,kBAAkB;MACpB;IACF;EACF;;;;AFrBK,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", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "IntentResolver", "SetupAppGraph", "AppGraphBuilder"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REGISTRY_ID
|
|
3
|
+
} from "./chunk-H6GNIIDK.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-QW333HWJ.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
|
+
}
|