@dxos/plugin-registry 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe
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/cli/index.mjs +15 -19
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +50 -41
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/cli/index.mjs +15 -18
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +51 -41
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/disable.d.ts +2 -2
- package/dist/types/src/cli/commands/enable.d.ts +2 -2
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/cli/storage.d.ts +4 -4
- package/dist/types/src/cli/storage.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +11 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +39 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
- package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +38 -0
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
- package/dist/types/src/components/PluginList/index.d.ts +2 -0
- package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts +2 -0
- package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +10 -0
- package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts +2 -0
- package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +5 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +19 -15
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -31
- package/src/RegistryPlugin.tsx +9 -7
- package/src/capabilities/app-graph-builder.ts +149 -0
- package/src/capabilities/index.ts +9 -3
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +95 -0
- package/src/cli/plugin.ts +4 -3
- package/src/cli/storage.ts +14 -21
- package/src/components/{PluginDetail.stories.tsx → PluginDetail/PluginDetail.stories.tsx} +6 -6
- package/src/components/PluginDetail/PluginDetail.tsx +84 -0
- package/src/components/PluginDetail/index.ts +5 -0
- package/src/components/{PluginItem.tsx → PluginList/PluginItem.tsx} +16 -12
- package/src/components/PluginList/PluginList.stories.tsx +87 -0
- package/src/components/PluginList/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +85 -0
- package/src/containers/LoadPluginDialog/index.ts +5 -0
- package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
- package/src/containers/PluginArticle/index.ts +5 -0
- package/src/containers/PluginRegistry/PluginRegistry.tsx +94 -0
- package/src/containers/PluginRegistry/index.ts +5 -0
- package/src/containers/index.ts +10 -0
- package/src/meta.ts +12 -5
- package/src/operations/index.ts +7 -0
- package/src/operations/open-plugin-registry.ts +21 -0
- package/src/translations.ts +19 -15
- package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs +0 -166
- package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs.map +0 -7
- package/dist/lib/browser/chunk-VOAOTNGS.mjs +0 -19
- package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs +0 -24
- package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs +0 -337
- package/dist/lib/browser/react-surface-IIM6T7IA.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs +0 -167
- package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +0 -21
- package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs +0 -25
- package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs +0 -338
- package/dist/lib/node-esm/react-surface-F67P7RC3.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.d.ts +0 -9
- package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
- package/dist/types/src/components/PluginDetail.stories.d.ts +0 -32
- 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 +0 -34
- package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
- package/dist/types/src/components/RegistryContainer.d.ts +0 -8
- package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -136
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -99
- package/src/components/PluginDetail.tsx +0 -79
- package/src/components/PluginList.stories.tsx +0 -77
- package/src/components/RegistryContainer.tsx +0 -83
- /package/dist/types/src/components/{PluginItem.d.ts → PluginList/PluginItem.d.ts} +0 -0
- /package/dist/types/src/components/{PluginList.d.ts → PluginList/PluginList.d.ts} +0 -0
- /package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
REGISTRY_ID,
|
|
4
|
-
REGISTRY_KEY,
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-SALMIZ2W.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import { Capability, Common, SettingsOperation } from "@dxos/app-framework";
|
|
11
|
-
import { Operation } from "@dxos/operation";
|
|
12
|
-
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
13
|
-
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
14
|
-
const capabilities = yield* Capability.Service;
|
|
15
|
-
const extensions = yield* Effect.all([
|
|
16
|
-
GraphBuilder.createExtension({
|
|
17
|
-
id: meta.id,
|
|
18
|
-
match: NodeMatcher.whenRoot,
|
|
19
|
-
actions: () => Effect.succeed([
|
|
20
|
-
{
|
|
21
|
-
id: meta.id,
|
|
22
|
-
data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
|
|
23
|
-
properties: {
|
|
24
|
-
label: [
|
|
25
|
-
"open plugin registry label",
|
|
26
|
-
{
|
|
27
|
-
ns: meta.id
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
icon: "ph--squares-four--regular",
|
|
31
|
-
disposition: "menu"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
])
|
|
35
|
-
}),
|
|
36
|
-
GraphBuilder.createExtension({
|
|
37
|
-
id: meta.id,
|
|
38
|
-
match: NodeMatcher.whenRoot,
|
|
39
|
-
connector: () => Effect.succeed([
|
|
40
|
-
{
|
|
41
|
-
id: REGISTRY_ID,
|
|
42
|
-
type: meta.id,
|
|
43
|
-
properties: {
|
|
44
|
-
label: [
|
|
45
|
-
"plugin registry label",
|
|
46
|
-
{
|
|
47
|
-
ns: meta.id
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
icon: "ph--squares-four--regular",
|
|
51
|
-
disposition: "pin-end",
|
|
52
|
-
testId: "treeView.pluginRegistry"
|
|
53
|
-
},
|
|
54
|
-
nodes: [
|
|
55
|
-
{
|
|
56
|
-
id: `${REGISTRY_KEY}+all`,
|
|
57
|
-
type: "category",
|
|
58
|
-
data: `${REGISTRY_KEY}+all`,
|
|
59
|
-
properties: {
|
|
60
|
-
label: [
|
|
61
|
-
"all plugins label",
|
|
62
|
-
{
|
|
63
|
-
ns: meta.id
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
icon: "ph--squares-four--regular",
|
|
67
|
-
key: REGISTRY_KEY,
|
|
68
|
-
testId: "pluginRegistry.all"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
73
|
-
type: "category",
|
|
74
|
-
data: `${REGISTRY_KEY}+installed`,
|
|
75
|
-
properties: {
|
|
76
|
-
label: [
|
|
77
|
-
"installed plugins label",
|
|
78
|
-
{
|
|
79
|
-
ns: meta.id
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
icon: "ph--check--regular",
|
|
83
|
-
key: REGISTRY_KEY,
|
|
84
|
-
testId: "pluginRegistry.installed"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
89
|
-
type: "category",
|
|
90
|
-
data: `${REGISTRY_KEY}+recommended`,
|
|
91
|
-
properties: {
|
|
92
|
-
label: [
|
|
93
|
-
"recommended plugins label",
|
|
94
|
-
{
|
|
95
|
-
ns: meta.id
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
icon: "ph--star--regular",
|
|
99
|
-
key: REGISTRY_KEY,
|
|
100
|
-
testId: "pluginRegistry.recommended"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
105
|
-
type: "category",
|
|
106
|
-
data: `${REGISTRY_KEY}+labs`,
|
|
107
|
-
properties: {
|
|
108
|
-
label: [
|
|
109
|
-
"labs plugins label",
|
|
110
|
-
{
|
|
111
|
-
ns: meta.id
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
icon: "ph--flask--regular",
|
|
115
|
-
key: REGISTRY_KEY,
|
|
116
|
-
testId: "pluginRegistry.labs"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
])
|
|
122
|
-
}),
|
|
123
|
-
GraphBuilder.createExtension({
|
|
124
|
-
id: `${meta.id}/actions`,
|
|
125
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
126
|
-
actions: () => Effect.succeed([
|
|
127
|
-
{
|
|
128
|
-
id: `${meta.id}/load-by-url`,
|
|
129
|
-
data: Effect.fnUntraced(function* () {
|
|
130
|
-
}),
|
|
131
|
-
properties: {
|
|
132
|
-
label: [
|
|
133
|
-
"load by url label",
|
|
134
|
-
{
|
|
135
|
-
ns: meta.id
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
icon: "ph--cloud-arrow-down--regular",
|
|
139
|
-
disabled: true
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
])
|
|
143
|
-
}),
|
|
144
|
-
GraphBuilder.createExtension({
|
|
145
|
-
id: `${meta.id}/plugins`,
|
|
146
|
-
match: NodeMatcher.whenId(REGISTRY_ID),
|
|
147
|
-
connector: () => {
|
|
148
|
-
const manager = capabilities.get(Common.Capability.PluginManager);
|
|
149
|
-
return Effect.succeed(manager.getPlugins().map((plugin) => ({
|
|
150
|
-
id: plugin.meta.id.replaceAll("/", ":"),
|
|
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
|
-
disposition: "hidden"
|
|
157
|
-
}
|
|
158
|
-
})));
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
]);
|
|
162
|
-
return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
|
|
163
|
-
}));
|
|
164
|
-
export {
|
|
165
|
-
app_graph_builder_default as default
|
|
166
|
-
};
|
|
167
|
-
//# sourceMappingURL=app-graph-builder-56JXLOGZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common, SettingsOperation } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: meta.id,\n data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),\n properties: {\n label: ['open plugin registry label', { ns: meta.id }],\n icon: 'ph--squares-four--regular',\n disposition: 'menu',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n {\n id: REGISTRY_ID,\n type: meta.id,\n properties: {\n label: ['plugin registry label', { ns: meta.id }],\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: meta.id }],\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: meta.id }],\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: meta.id }],\n icon: 'ph--star--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.recommended',\n },\n },\n {\n id: `${REGISTRY_KEY}+labs`,\n type: 'category',\n data: `${REGISTRY_KEY}+labs`,\n properties: {\n label: ['labs plugins label', { ns: meta.id }],\n icon: 'ph--flask--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.labs',\n },\n },\n ],\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/actions`,\n match: NodeMatcher.whenId(REGISTRY_ID),\n actions: () =>\n Effect.succeed([\n {\n id: `${meta.id}/load-by-url`,\n data: Effect.fnUntraced(function* () {}),\n properties: {\n label: ['load by url label', { ns: meta.id }],\n icon: 'ph--cloud-arrow-down--regular',\n disabled: true,\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/plugins`,\n match: NodeMatcher.whenId(REGISTRY_ID),\n connector: () => {\n const manager = capabilities.get(Common.Capability.PluginManager);\n return Effect.succeed(\n manager.getPlugins().map((plugin) => ({\n id: plugin.meta.id.replaceAll('/', ':'),\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 disposition: 'hidden',\n },\n })),\n );\n },\n }),\n ]);\n\n return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,QAAQC,yBAAyB;AACtD,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,mBAAmB;AAI1C,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOH,WAAWI;AAEvC,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAIC,KAAKD;MACTE,OAAOC,YAAYC;MACnBC,SAAS,MACAC,eAAQ;QACb;UACEN,IAAIC,KAAKD;UACTO,MAAM,MAAMC,UAAUC,OAAOC,kBAAkBC,kBAAkB;UACjEC,YAAY;YACVC,OAAO;cAAC;cAA8B;gBAAEC,IAAIb,KAAKD;cAAG;;YACpDe,MAAM;YACNC,aAAa;UACf;QACF;OACD;IACL,CAAA;IACAlB,aAAaC,gBAAgB;MAC3BC,IAAIC,KAAKD;MACTE,OAAOC,YAAYC;MACnBa,WAAW,MACFX,eAAQ;QACb;UACEN,IAAIkB;UACJC,MAAMlB,KAAKD;UACXY,YAAY;YACVC,OAAO;cAAC;cAAyB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC/Ce,MAAM;YACNC,aAAa;YACbI,QAAQ;UACV;UACAC,OAAO;YACL;cACErB,IAAI,GAAGsB,YAAAA;cACPH,MAAM;cACNZ,MAAM,GAAGe,YAAAA;cACTV,YAAY;gBACVC,OAAO;kBAAC;kBAAqB;oBAAEC,IAAIb,KAAKD;kBAAG;;gBAC3Ce,MAAM;gBACNQ,KAAKD;gBACLF,QAAQ;cACV;YACF;YACA;cACEpB,IAAI,GAAGsB,YAAAA;cACPH,MAAM;cACNZ,MAAM,GAAGe,YAAAA;cACTV,YAAY;gBACVC,OAAO;kBAAC;kBAA2B;oBAAEC,IAAIb,KAAKD;kBAAG;;gBACjDe,MAAM;gBACNQ,KAAKD;gBACLF,QAAQ;cACV;YACF;YACA;cACEpB,IAAI,GAAGsB,YAAAA;cACPH,MAAM;cACNZ,MAAM,GAAGe,YAAAA;cACTV,YAAY;gBACVC,OAAO;kBAAC;kBAA6B;oBAAEC,IAAIb,KAAKD;kBAAG;;gBACnDe,MAAM;gBACNQ,KAAKD;gBACLF,QAAQ;cACV;YACF;YACA;cACEpB,IAAI,GAAGsB,YAAAA;cACPH,MAAM;cACNZ,MAAM,GAAGe,YAAAA;cACTV,YAAY;gBACVC,OAAO;kBAAC;kBAAsB;oBAAEC,IAAIb,KAAKD;kBAAG;;gBAC5Ce,MAAM;gBACNQ,KAAKD;gBACLF,QAAQ;cACV;YACF;;QAEJ;OACD;IACL,CAAA;IACAtB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYqB,OAAON,WAAAA;MAC1Bb,SAAS,MACAC,eAAQ;QACb;UACEN,IAAI,GAAGC,KAAKD,EAAE;UACdO,MAAad,kBAAW,aAAA;UAAc,CAAA;UACtCmB,YAAY;YACVC,OAAO;cAAC;cAAqB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC3Ce,MAAM;YACNU,UAAU;UACZ;QACF;OACD;IACL,CAAA;IACA3B,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYqB,OAAON,WAAAA;MAC1BD,WAAW,MAAA;AACT,cAAMS,UAAUhC,aAAaiC,IAAIC,OAAOrC,WAAWsC,aAAa;AAChE,eAAcvB,eACZoB,QAAQI,WAAU,EAAGC,IAAI,CAACC,YAAY;UACpChC,IAAIgC,OAAO/B,KAAKD,GAAGiC,WAAW,KAAK,GAAA;UACnCd,MAAM;UACNZ,MAAMyB;UACNpB,YAAY;YACVC,OAAOmB,OAAO/B,KAAKiC,QAAQF,OAAO/B,KAAKD;YACvCe,MAAMiB,OAAO/B,KAAKc,QAAQ;YAC1BC,aAAa;UACf;QACF,EAAA,CAAA;MAEJ;IACF,CAAA;GACD;AAED,SAAOzB,WAAW4C,YAAYP,OAAOrC,WAAW6C,iBAAiBxC,UAAAA;AACnE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "SettingsOperation", "Operation", "GraphBuilder", "NodeMatcher", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "SettingsOperation", "OpenPluginRegistry", "properties", "label", "ns", "icon", "disposition", "connector", "REGISTRY_ID", "type", "testId", "nodes", "REGISTRY_KEY", "key", "whenId", "disabled", "manager", "get", "Common", "PluginManager", "getPlugins", "map", "plugin", "replaceAll", "name", "contributes", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var REGISTRY_ID = "!dxos:plugin-registry";
|
|
6
|
-
var REGISTRY_KEY = "plugin-registry";
|
|
7
|
-
var meta = {
|
|
8
|
-
id: "dxos.org/plugin/registry",
|
|
9
|
-
name: "Plugins",
|
|
10
|
-
description: trim`
|
|
11
|
-
Plugin management system for discovering, installing, and configuring workspace extensions.
|
|
12
|
-
Browse available plugins and customize your workspace capabilities.
|
|
13
|
-
`
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
REGISTRY_ID,
|
|
18
|
-
REGISTRY_KEY,
|
|
19
|
-
meta
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-SALMIZ2W.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\n// TODO(wittjosiah): Deck does not currently support `/` in ids.\n// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n// Ideally this should be worked into the data model in a generic way.\nexport const REGISTRY_ID = '!dxos:plugin-registry';\nexport const REGISTRY_KEY = 'plugin-registry';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/registry',\n name: 'Plugins',\n description: trim`\n Plugin management system for discovering, installing, and configuring workspace extensions.\n Browse available plugins and customize your workspace capabilities.\n `,\n};\n"],
|
|
5
|
-
"mappings": ";;;AAKA,SAASA,YAAY;AAKd,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;",
|
|
6
|
-
"names": ["trim", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name", "description", "trim"]
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
REGISTRY_ID
|
|
4
|
-
} from "./chunk-SALMIZ2W.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import { Capability, Common, SettingsOperation } from "@dxos/app-framework";
|
|
9
|
-
import { Operation, OperationResolver } from "@dxos/operation";
|
|
10
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
11
|
-
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
12
|
-
OperationResolver.make({
|
|
13
|
-
operation: SettingsOperation.OpenPluginRegistry,
|
|
14
|
-
handler: Effect.fnUntraced(function* () {
|
|
15
|
-
yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {
|
|
16
|
-
subject: REGISTRY_ID
|
|
17
|
-
});
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
]);
|
|
21
|
-
}));
|
|
22
|
-
export {
|
|
23
|
-
operation_resolver_default as default
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=operation-resolver-3ZB5W3T3.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common, SettingsOperation } from '@dxos/app-framework';\nimport { Operation, OperationResolver } from '@dxos/operation';\n\nimport { REGISTRY_ID } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Common.Capability.OperationResolver, [\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: Effect.fnUntraced(function* () {\n yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, { subject: REGISTRY_ID });\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,QAAQC,yBAAyB;AACtD,SAASC,WAAWC,yBAAyB;AAI7C,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,OAAOJ,WAAWK,mBAAmB;IACjEA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAgBR,kBAAW,aAAA;AACzB,eAAOS,UAAUC,OAAOR,OAAOS,gBAAgBC,iBAAiB;UAAEC,SAASC;QAAY,CAAA;MACzF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "SettingsOperation", "Operation", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Common", "OperationResolver", "make", "operation", "SettingsOperation", "OpenPluginRegistry", "handler", "Operation", "invoke", "LayoutOperation", "SwitchWorkspace", "subject", "REGISTRY_ID"]
|
|
7
|
-
}
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
REGISTRY_KEY,
|
|
4
|
-
meta
|
|
5
|
-
} from "./chunk-SALMIZ2W.mjs";
|
|
6
|
-
|
|
7
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
8
|
-
import * as Effect2 from "effect/Effect";
|
|
9
|
-
import React5, { useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
10
|
-
import { Capability, Common as Common2, Plugin } from "@dxos/app-framework";
|
|
11
|
-
import { usePluginManager as usePluginManager2 } from "@dxos/app-framework/react";
|
|
12
|
-
import { runAndForwardErrors as runAndForwardErrors2 } from "@dxos/effect";
|
|
13
|
-
|
|
14
|
-
// src/components/PluginDetail.tsx
|
|
15
|
-
import React from "react";
|
|
16
|
-
import { Icon, Input, Link, useTranslation } from "@dxos/react-ui";
|
|
17
|
-
import { Layout } from "@dxos/react-ui-mosaic";
|
|
18
|
-
import { getStyles, mx } from "@dxos/ui-theme";
|
|
19
|
-
var PluginDetail = ({ plugin, enabled, onEnabledChange }) => {
|
|
20
|
-
const { t } = useTranslation(meta.id);
|
|
21
|
-
const { id, name, description, homePage, source, screenshots, icon = "ph--circle--regular", iconHue = "neutral" } = plugin.meta;
|
|
22
|
-
const styles = getStyles(iconHue);
|
|
23
|
-
return /* @__PURE__ */ React.createElement(Layout.Container, {
|
|
24
|
-
scrollable: true
|
|
25
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
26
|
-
role: "none",
|
|
27
|
-
className: "grid grid-cols-[min-content_1fr] gap-4 container-max-width p-4"
|
|
28
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
29
|
-
role: "none"
|
|
30
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
31
|
-
classNames: mx("p-1 rounded", styles.bg, styles.icon),
|
|
32
|
-
icon,
|
|
33
|
-
size: 14
|
|
34
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
35
|
-
role: "none",
|
|
36
|
-
className: "flex flex-col gap-6"
|
|
37
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
38
|
-
role: "none",
|
|
39
|
-
className: "grid grid-cols-[1fr_min-content] gap-x-3 is-full pbs-1"
|
|
40
|
-
}, /* @__PURE__ */ React.createElement("h2", {
|
|
41
|
-
className: "text-xl"
|
|
42
|
-
}, name), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
43
|
-
classNames: "self-center",
|
|
44
|
-
checked: enabled,
|
|
45
|
-
onCheckedChange: onEnabledChange
|
|
46
|
-
})), /* @__PURE__ */ React.createElement("p", {
|
|
47
|
-
className: "pbs-0.5 text-sm text-description"
|
|
48
|
-
}, id)), /* @__PURE__ */ React.createElement("div", {
|
|
49
|
-
role: "none"
|
|
50
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
51
|
-
className: "text-description"
|
|
52
|
-
}, description)), screenshots && screenshots.length > 0 && /* @__PURE__ */ React.createElement("div", {
|
|
53
|
-
role: "none",
|
|
54
|
-
className: "flex flex-col gap-2"
|
|
55
|
-
}, /* @__PURE__ */ React.createElement("h2", null, "Preview"), /* @__PURE__ */ React.createElement("img", {
|
|
56
|
-
src: screenshots[0],
|
|
57
|
-
alt: name,
|
|
58
|
-
className: "aspect-video object-fit"
|
|
59
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
60
|
-
role: "none",
|
|
61
|
-
className: "flex flex-col gap-2"
|
|
62
|
-
}, /* @__PURE__ */ React.createElement("h2", null, "Resources"), /* @__PURE__ */ React.createElement("div", {
|
|
63
|
-
className: "flex gap-2"
|
|
64
|
-
}, homePage && /* @__PURE__ */ React.createElement(Link, {
|
|
65
|
-
href: homePage,
|
|
66
|
-
target: "_blank",
|
|
67
|
-
rel: "noreferrer",
|
|
68
|
-
classNames: "text-sm text-description"
|
|
69
|
-
}, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
70
|
-
icon: "ph--arrow-square-out--bold",
|
|
71
|
-
size: 3,
|
|
72
|
-
classNames: "inline-block leading-none mli-1"
|
|
73
|
-
})), source && /* @__PURE__ */ React.createElement(Link, {
|
|
74
|
-
href: source,
|
|
75
|
-
target: "_blank",
|
|
76
|
-
rel: "noreferrer",
|
|
77
|
-
classNames: "text-sm text-description"
|
|
78
|
-
}, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
|
|
79
|
-
icon: "ph--arrow-square-out--bold",
|
|
80
|
-
size: 3,
|
|
81
|
-
classNames: "inline-block leading-none mli-1"
|
|
82
|
-
})))))));
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// src/components/PluginList.tsx
|
|
86
|
-
import React3 from "react";
|
|
87
|
-
import { List } from "@dxos/react-ui";
|
|
88
|
-
|
|
89
|
-
// src/components/PluginItem.tsx
|
|
90
|
-
import React2, { useCallback } from "react";
|
|
91
|
-
import { Icon as Icon2, IconButton, Input as Input2, Link as Link2, ListItem, Tag, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
92
|
-
import { descriptionText, mx as mx2 } from "@dxos/ui-theme";
|
|
93
|
-
import { getStyles as getStyles2 } from "@dxos/ui-theme";
|
|
94
|
-
var PluginItem = ({ plugin, enabled = [], onClick, onChange, hasSettings: hasSettingsProp, onSettings }) => {
|
|
95
|
-
const { t } = useTranslation2(meta.id);
|
|
96
|
-
const { id, name, description, tags, icon = "ph--circle--regular", iconHue = "neutral" } = plugin.meta;
|
|
97
|
-
const isEnabled = enabled.includes(id);
|
|
98
|
-
const inputId = `${id}-input`;
|
|
99
|
-
const labelId = `${id}-label`;
|
|
100
|
-
const descriptionId = `${id}-description`;
|
|
101
|
-
const handleClick = useCallback(() => onClick?.(id), [
|
|
102
|
-
id,
|
|
103
|
-
onClick
|
|
104
|
-
]);
|
|
105
|
-
const handleChange = useCallback((event) => {
|
|
106
|
-
event.stopPropagation();
|
|
107
|
-
onChange?.(id, !isEnabled);
|
|
108
|
-
}, [
|
|
109
|
-
id,
|
|
110
|
-
isEnabled,
|
|
111
|
-
onChange
|
|
112
|
-
]);
|
|
113
|
-
const hasSettings = hasSettingsProp?.(id) ?? false;
|
|
114
|
-
const handleSettings = useCallback(() => onSettings?.(id), [
|
|
115
|
-
id,
|
|
116
|
-
onSettings
|
|
117
|
-
]);
|
|
118
|
-
const styles = getStyles2(iconHue);
|
|
119
|
-
const gridCols = "grid grid-cols-[5rem_1fr]";
|
|
120
|
-
const gridRows = "grid grid-rows-[40px_1fr_min-content_40px]";
|
|
121
|
-
return /* @__PURE__ */ React2.createElement(ListItem.Root, {
|
|
122
|
-
key: id,
|
|
123
|
-
labelId,
|
|
124
|
-
"data-testid": `pluginList.${id}`,
|
|
125
|
-
"aria-describedby": descriptionId,
|
|
126
|
-
classNames: mx2(gridCols, "bs-[12rem] is-full gap-3 pie-2 border border-separator rounded-md overflow-hidden")
|
|
127
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
128
|
-
className: mx2(gridRows, "justify-center rounded-l-md", styles.bg)
|
|
129
|
-
}, /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement(Icon2, {
|
|
130
|
-
classNames: mx2("cursor-pointer", styles.icon),
|
|
131
|
-
icon,
|
|
132
|
-
size: 14,
|
|
133
|
-
onClick: handleClick
|
|
134
|
-
})), /* @__PURE__ */ React2.createElement("div", {
|
|
135
|
-
className: mx2(gridRows)
|
|
136
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
137
|
-
className: "flex items-center overflow-hidden cursor-pointer",
|
|
138
|
-
onClick: handleClick
|
|
139
|
-
}, /* @__PURE__ */ React2.createElement("span", {
|
|
140
|
-
className: "text-lg truncate"
|
|
141
|
-
}, name ?? id)), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("p", {
|
|
142
|
-
className: mx2(descriptionText, "line-clamp-4 min-is-0")
|
|
143
|
-
}, description)), /* @__PURE__ */ React2.createElement("div", {
|
|
144
|
-
className: "flex -mis-0.5 overflow-x-auto scrollbar-none"
|
|
145
|
-
}, tags?.map((tag) => /* @__PURE__ */ React2.createElement(Tag, {
|
|
146
|
-
key: tag,
|
|
147
|
-
palette: tagColors[tag],
|
|
148
|
-
classNames: "text-xs uppercase font-thin"
|
|
149
|
-
}, tag))), /* @__PURE__ */ React2.createElement("div", {
|
|
150
|
-
className: "flex gap-2 items-center text-sm"
|
|
151
|
-
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
152
|
-
"aria-describedby": descriptionId,
|
|
153
|
-
classNames: "cursor-pointer",
|
|
154
|
-
icon: "ph--gear--regular",
|
|
155
|
-
label: t("settings label"),
|
|
156
|
-
iconOnly: true,
|
|
157
|
-
size: 4,
|
|
158
|
-
onClick: handleSettings,
|
|
159
|
-
disabled: !hasSettings
|
|
160
|
-
}), /* @__PURE__ */ React2.createElement(Link2, {
|
|
161
|
-
"aria-describedby": descriptionId,
|
|
162
|
-
classNames: "text-description cursor-pointer",
|
|
163
|
-
onClick: handleClick
|
|
164
|
-
}, t("details label")), /* @__PURE__ */ React2.createElement("div", {
|
|
165
|
-
className: "grow"
|
|
166
|
-
}), /* @__PURE__ */ React2.createElement("div", {
|
|
167
|
-
className: "pie-1"
|
|
168
|
-
}, /* @__PURE__ */ React2.createElement(Input2.Root, {
|
|
169
|
-
id: inputId
|
|
170
|
-
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
171
|
-
classNames: "self-center",
|
|
172
|
-
checked: isEnabled,
|
|
173
|
-
onClick: handleChange
|
|
174
|
-
}))))));
|
|
175
|
-
};
|
|
176
|
-
var tagColors = {
|
|
177
|
-
new: "rose",
|
|
178
|
-
beta: "teal",
|
|
179
|
-
labs: "blue",
|
|
180
|
-
popular: "green",
|
|
181
|
-
featured: "pink",
|
|
182
|
-
experimental: "amber"
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// src/components/PluginList.tsx
|
|
186
|
-
var PluginList = ({ plugins = [], ...props }) => {
|
|
187
|
-
return /* @__PURE__ */ React3.createElement(List, {
|
|
188
|
-
classNames: "grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] auto-rows-[max-content] gap-4 p-4"
|
|
189
|
-
}, plugins.map((plugin) => /* @__PURE__ */ React3.createElement(PluginItem, {
|
|
190
|
-
key: plugin.meta.id,
|
|
191
|
-
plugin,
|
|
192
|
-
...props
|
|
193
|
-
})));
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// src/components/RegistryContainer.tsx
|
|
197
|
-
import { useAtomValue } from "@effect-atom/atom-react";
|
|
198
|
-
import * as Effect from "effect/Effect";
|
|
199
|
-
import React4, { useCallback as useCallback2, useMemo } from "react";
|
|
200
|
-
import { Common, SettingsOperation } from "@dxos/app-framework";
|
|
201
|
-
import { useCapabilities, useOperationInvoker, usePluginManager } from "@dxos/app-framework/react";
|
|
202
|
-
import { runAndForwardErrors } from "@dxos/effect";
|
|
203
|
-
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
204
|
-
import { Layout as Layout2 } from "@dxos/react-ui-mosaic";
|
|
205
|
-
var sortByPluginMeta = ({ meta: { name: a = "" } }, { meta: { name: b = "" } }) => a.localeCompare(b);
|
|
206
|
-
var RegistryContainer = ({ id, plugins: pluginsProp }) => {
|
|
207
|
-
const manager = usePluginManager();
|
|
208
|
-
const { invoke, invokePromise } = useOperationInvoker();
|
|
209
|
-
const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [
|
|
210
|
-
pluginsProp
|
|
211
|
-
]);
|
|
212
|
-
const enabled = useAtomValue(manager.enabled);
|
|
213
|
-
const allSettings = useCapabilities(Common.Capability.Settings);
|
|
214
|
-
const handleChange = useCallback2((id2, enabled2) => Effect.gen(function* () {
|
|
215
|
-
if (enabled2) {
|
|
216
|
-
yield* manager.enable(id2);
|
|
217
|
-
} else {
|
|
218
|
-
yield* manager.disable(id2);
|
|
219
|
-
}
|
|
220
|
-
yield* invoke(ObservabilityOperation.SendEvent, {
|
|
221
|
-
name: "plugins.toggle",
|
|
222
|
-
properties: {
|
|
223
|
-
plugin: id2,
|
|
224
|
-
enabled: enabled2
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}).pipe(runAndForwardErrors), [
|
|
228
|
-
invoke,
|
|
229
|
-
manager
|
|
230
|
-
]);
|
|
231
|
-
const handleClick = useCallback2((pluginId) => invokePromise(Common.LayoutOperation.Open, {
|
|
232
|
-
// TODO(wittjosiah): `/` currently is not supported in ids.
|
|
233
|
-
subject: [
|
|
234
|
-
pluginId.replaceAll("/", ":")
|
|
235
|
-
],
|
|
236
|
-
pivotId: id,
|
|
237
|
-
positioning: "end"
|
|
238
|
-
}), [
|
|
239
|
-
invokePromise,
|
|
240
|
-
id
|
|
241
|
-
]);
|
|
242
|
-
const hasSettings = useCallback2((pluginId) => allSettings.some((s) => s.prefix === pluginId), [
|
|
243
|
-
allSettings
|
|
244
|
-
]);
|
|
245
|
-
const handleSettings = useCallback2((pluginId) => invokePromise(SettingsOperation.Open, {
|
|
246
|
-
plugin: pluginId
|
|
247
|
-
}), [
|
|
248
|
-
invokePromise
|
|
249
|
-
]);
|
|
250
|
-
return /* @__PURE__ */ React4.createElement(Layout2.Container, {
|
|
251
|
-
scrollable: true
|
|
252
|
-
}, /* @__PURE__ */ React4.createElement(PluginList, {
|
|
253
|
-
plugins,
|
|
254
|
-
enabled,
|
|
255
|
-
onClick: handleClick,
|
|
256
|
-
onChange: handleChange,
|
|
257
|
-
hasSettings,
|
|
258
|
-
onSettings: handleSettings
|
|
259
|
-
}));
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
263
|
-
var react_surface_default = Capability.makeModule(() => Effect2.succeed(Capability.contributes(Common2.Capability.ReactSurface, [
|
|
264
|
-
Common2.createSurface({
|
|
265
|
-
id: `${meta.id}/all`,
|
|
266
|
-
role: "article",
|
|
267
|
-
filter: (data) => data.subject === `${REGISTRY_KEY}+all`,
|
|
268
|
-
component: () => {
|
|
269
|
-
const manager = usePluginManager2();
|
|
270
|
-
const filtered = useMemo2(() => manager.getPlugins().filter(({ meta: meta2 }) => !manager.getCore().includes(meta2.id)), []);
|
|
271
|
-
return /* @__PURE__ */ React5.createElement(RegistryContainer, {
|
|
272
|
-
id: `${REGISTRY_KEY}+all`,
|
|
273
|
-
plugins: filtered
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}),
|
|
277
|
-
Common2.createSurface({
|
|
278
|
-
id: `${meta.id}/installed`,
|
|
279
|
-
role: "article",
|
|
280
|
-
filter: (data) => data.subject === `${REGISTRY_KEY}+installed`,
|
|
281
|
-
component: () => {
|
|
282
|
-
const manager = usePluginManager2();
|
|
283
|
-
const filtered = useMemo2(() => manager.getPlugins().filter(({ meta: meta2 }) => !manager.getCore().includes(meta2.id)).filter(({ meta: meta2 }) => manager.getEnabled().includes(meta2.id)), []);
|
|
284
|
-
return /* @__PURE__ */ React5.createElement(RegistryContainer, {
|
|
285
|
-
id: `${REGISTRY_KEY}+installed`,
|
|
286
|
-
plugins: filtered
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
}),
|
|
290
|
-
Common2.createSurface({
|
|
291
|
-
id: `${meta.id}/recommended`,
|
|
292
|
-
role: "article",
|
|
293
|
-
filter: (data) => data.subject === `${REGISTRY_KEY}+recommended`,
|
|
294
|
-
component: () => {
|
|
295
|
-
const manager = usePluginManager2();
|
|
296
|
-
const filtered = useMemo2(() => manager.getPlugins().filter(({ meta: meta2 }) => !manager.getCore().includes(meta2.id)).filter(({ meta: meta2 }) => !meta2.tags?.includes("labs")), []);
|
|
297
|
-
return /* @__PURE__ */ React5.createElement(RegistryContainer, {
|
|
298
|
-
id: `${REGISTRY_KEY}+recommended`,
|
|
299
|
-
plugins: filtered
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
Common2.createSurface({
|
|
304
|
-
id: `${meta.id}/labs`,
|
|
305
|
-
role: "article",
|
|
306
|
-
filter: (data) => data.subject === `${REGISTRY_KEY}+labs`,
|
|
307
|
-
component: () => {
|
|
308
|
-
const manager = usePluginManager2();
|
|
309
|
-
const filtered = useMemo2(() => manager.getPlugins().filter(({ meta: meta2 }) => meta2.tags?.includes("labs")), []);
|
|
310
|
-
return /* @__PURE__ */ React5.createElement(RegistryContainer, {
|
|
311
|
-
id: `${REGISTRY_KEY}+labs`,
|
|
312
|
-
plugins: filtered
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}),
|
|
316
|
-
Common2.createSurface({
|
|
317
|
-
id: `${meta.id}/plugin-details`,
|
|
318
|
-
role: "article",
|
|
319
|
-
filter: (data) => Plugin.isPlugin(data.subject),
|
|
320
|
-
component: ({ data: { subject } }) => {
|
|
321
|
-
const manager = usePluginManager2();
|
|
322
|
-
const enabled = manager.getEnabled().includes(subject.meta.id);
|
|
323
|
-
const handleEnableChange = useCallback3((enabled2) => enabled2 ? runAndForwardErrors2(manager.enable(subject.meta.id)) : runAndForwardErrors2(manager.disable(subject.meta.id)), [
|
|
324
|
-
manager,
|
|
325
|
-
subject.meta.id
|
|
326
|
-
]);
|
|
327
|
-
return /* @__PURE__ */ React5.createElement(PluginDetail, {
|
|
328
|
-
plugin: subject,
|
|
329
|
-
enabled,
|
|
330
|
-
onEnabledChange: handleEnableChange
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
})
|
|
334
|
-
])));
|
|
335
|
-
export {
|
|
336
|
-
react_surface_default as default
|
|
337
|
-
};
|
|
338
|
-
//# sourceMappingURL=react-surface-F67P7RC3.mjs.map
|