@dxos/plugin-registry 0.8.4-main.1da679c → 0.8.4-main.21d9917

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.
Files changed (120) hide show
  1. package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs +166 -0
  2. package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-VOAOTNGS.mjs +19 -0
  4. package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +7 -0
  5. package/dist/lib/browser/cli/index.mjs +223 -0
  6. package/dist/lib/browser/cli/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +22 -31
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs +24 -0
  11. package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs.map +7 -0
  12. package/dist/lib/browser/react-surface-IIM6T7IA.mjs +337 -0
  13. package/dist/lib/browser/react-surface-IIM6T7IA.mjs.map +7 -0
  14. package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs +167 -0
  15. package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs.map +7 -0
  16. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +21 -0
  17. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +7 -0
  18. package/dist/lib/node-esm/cli/index.mjs +224 -0
  19. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  20. package/dist/lib/node-esm/index.mjs +63 -0
  21. package/dist/lib/node-esm/index.mjs.map +7 -0
  22. package/dist/lib/node-esm/meta.json +1 -0
  23. package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs +25 -0
  24. package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs.map +7 -0
  25. package/dist/lib/node-esm/react-surface-F67P7RC3.mjs +338 -0
  26. package/dist/lib/node-esm/react-surface-F67P7RC3.mjs.map +7 -0
  27. package/dist/types/src/RegistryPlugin.d.ts +2 -1
  28. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  30. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  32. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  33. package/dist/types/src/capabilities/index.d.ts +3 -3
  34. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  35. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  36. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  37. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  38. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  39. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  40. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  42. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  43. package/dist/types/src/cli/commands/disable.d.ts +11 -0
  44. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  45. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  46. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  47. package/dist/types/src/cli/commands/index.d.ts +3 -0
  48. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  49. package/dist/types/src/cli/commands/list.d.ts +7 -0
  50. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  51. package/dist/types/src/cli/commands/util.d.ts +11 -0
  52. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  53. package/dist/types/src/cli/index.d.ts +3 -0
  54. package/dist/types/src/cli/index.d.ts.map +1 -0
  55. package/dist/types/src/cli/plugin.d.ts +3 -0
  56. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  57. package/dist/types/src/cli/storage.d.ts +18 -0
  58. package/dist/types/src/cli/storage.d.ts.map +1 -0
  59. package/dist/types/src/components/PluginDetail.d.ts +3 -3
  60. package/dist/types/src/components/PluginDetail.d.ts.map +1 -1
  61. package/dist/types/src/components/PluginDetail.stories.d.ts +1 -2
  62. package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/PluginItem.d.ts +2 -2
  64. package/dist/types/src/components/PluginItem.d.ts.map +1 -1
  65. package/dist/types/src/components/PluginList.d.ts +1 -1
  66. package/dist/types/src/components/PluginList.d.ts.map +1 -1
  67. package/dist/types/src/components/PluginList.stories.d.ts +2 -5
  68. package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
  69. package/dist/types/src/components/RegistryContainer.d.ts +4 -3
  70. package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
  71. package/dist/types/src/meta.d.ts +2 -3
  72. package/dist/types/src/meta.d.ts.map +1 -1
  73. package/dist/types/src/types.d.ts +3 -1
  74. package/dist/types/src/types.d.ts.map +1 -1
  75. package/dist/types/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +48 -34
  77. package/src/RegistryPlugin.tsx +9 -25
  78. package/src/capabilities/app-graph-builder/app-graph-builder.ts +136 -0
  79. package/src/capabilities/app-graph-builder/index.ts +7 -0
  80. package/src/capabilities/index.ts +3 -5
  81. package/src/capabilities/operation-resolver/index.ts +7 -0
  82. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  83. package/src/capabilities/react-surface/index.ts +7 -0
  84. package/src/capabilities/react-surface/react-surface.tsx +99 -0
  85. package/src/cli/commands/disable.ts +47 -0
  86. package/src/cli/commands/enable.ts +44 -0
  87. package/src/cli/commands/index.ts +14 -0
  88. package/src/cli/commands/list.ts +41 -0
  89. package/src/cli/commands/util.ts +24 -0
  90. package/src/cli/index.ts +6 -0
  91. package/src/cli/plugin.ts +16 -0
  92. package/src/cli/storage.ts +57 -0
  93. package/src/components/PluginDetail.stories.tsx +15 -18
  94. package/src/components/PluginDetail.tsx +54 -40
  95. package/src/components/PluginItem.tsx +55 -54
  96. package/src/components/PluginList.stories.tsx +25 -33
  97. package/src/components/PluginList.tsx +3 -5
  98. package/src/components/RegistryContainer.tsx +43 -44
  99. package/src/meta.ts +8 -5
  100. package/src/types.ts +5 -1
  101. package/dist/lib/browser/app-graph-builder-GIZIPBS7.mjs +0 -161
  102. package/dist/lib/browser/app-graph-builder-GIZIPBS7.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-AEBASNOI.mjs +0 -16
  104. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  105. package/dist/lib/browser/intent-resolver-APB5WWH4.mjs +0 -23
  106. package/dist/lib/browser/intent-resolver-APB5WWH4.mjs.map +0 -7
  107. package/dist/lib/browser/react-surface-C7T4DU6Q.mjs +0 -335
  108. package/dist/lib/browser/react-surface-C7T4DU6Q.mjs.map +0 -7
  109. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  110. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  111. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  112. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  113. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  114. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  115. package/dist/types/src/components/Icon.stories.d.ts +0 -14
  116. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  117. package/src/capabilities/app-graph-builder.ts +0 -155
  118. package/src/capabilities/intent-resolver.ts +0 -27
  119. package/src/capabilities/react-surface.tsx +0 -85
  120. package/src/components/Icon.stories.tsx +0 -110
package/src/types.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  export const RegistrySettingsSchema = Schema.mutable(
8
8
  Schema.Struct({
@@ -11,3 +11,7 @@ export const RegistrySettingsSchema = Schema.mutable(
11
11
  );
12
12
 
13
13
  export type RegistrySettings = Schema.Schema.Type<typeof RegistrySettingsSchema>;
14
+
15
+ export const RegistryTagType = Schema.Literal('new', 'beta', 'labs', 'popular', 'featured', 'experimental');
16
+
17
+ export type RegistryTagType = Schema.Schema.Type<typeof RegistryTagType>;
@@ -1,161 +0,0 @@
1
- import {
2
- REGISTRY_ID,
3
- REGISTRY_KEY,
4
- REGISTRY_PLUGIN
5
- } from "./chunk-AEBASNOI.mjs";
6
-
7
- // src/capabilities/app-graph-builder.ts
8
- import { Rx } from "@effect-rx/rx-react";
9
- import { Option, pipe } from "effect";
10
- import { Capabilities, SettingsAction, contributes, createIntent } from "@dxos/app-framework";
11
- import { createExtension } from "@dxos/plugin-graph";
12
- var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
13
- createExtension({
14
- id: REGISTRY_PLUGIN,
15
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
16
- {
17
- id: REGISTRY_PLUGIN,
18
- data: async () => {
19
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
20
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
21
- },
22
- properties: {
23
- label: [
24
- "open plugin registry label",
25
- {
26
- ns: REGISTRY_PLUGIN
27
- }
28
- ],
29
- icon: "ph--squares-four--regular",
30
- disposition: "menu"
31
- }
32
- }
33
- ]), Option.getOrElse(() => [])))
34
- }),
35
- createExtension({
36
- id: REGISTRY_PLUGIN,
37
- connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
38
- {
39
- id: REGISTRY_ID,
40
- type: REGISTRY_PLUGIN,
41
- properties: {
42
- label: [
43
- "plugin registry label",
44
- {
45
- ns: REGISTRY_PLUGIN
46
- }
47
- ],
48
- icon: "ph--squares-four--regular",
49
- disposition: "pin-end",
50
- testId: "treeView.pluginRegistry"
51
- },
52
- nodes: [
53
- {
54
- id: `${REGISTRY_KEY}+all`,
55
- type: "category",
56
- data: `${REGISTRY_KEY}+all`,
57
- properties: {
58
- label: [
59
- "all plugins label",
60
- {
61
- ns: REGISTRY_PLUGIN
62
- }
63
- ],
64
- icon: "ph--squares-four--regular",
65
- key: REGISTRY_KEY,
66
- testId: "pluginRegistry.all"
67
- }
68
- },
69
- {
70
- id: `${REGISTRY_KEY}+installed`,
71
- type: "category",
72
- data: `${REGISTRY_KEY}+installed`,
73
- properties: {
74
- label: [
75
- "installed plugins label",
76
- {
77
- ns: REGISTRY_PLUGIN
78
- }
79
- ],
80
- icon: "ph--check--regular",
81
- key: REGISTRY_KEY,
82
- testId: "pluginRegistry.installed"
83
- }
84
- },
85
- {
86
- id: `${REGISTRY_KEY}+recommended`,
87
- type: "category",
88
- data: `${REGISTRY_KEY}+recommended`,
89
- properties: {
90
- label: [
91
- "recommended plugins label",
92
- {
93
- ns: REGISTRY_PLUGIN
94
- }
95
- ],
96
- icon: "ph--star--regular",
97
- key: REGISTRY_KEY,
98
- testId: "pluginRegistry.recommended"
99
- }
100
- },
101
- {
102
- id: `${REGISTRY_KEY}+labs`,
103
- type: "category",
104
- data: `${REGISTRY_KEY}+labs`,
105
- properties: {
106
- label: [
107
- "labs plugins label",
108
- {
109
- ns: REGISTRY_PLUGIN
110
- }
111
- ],
112
- icon: "ph--flask--regular",
113
- key: REGISTRY_KEY,
114
- testId: "pluginRegistry.labs"
115
- }
116
- }
117
- ]
118
- }
119
- ]), Option.getOrElse(() => [])))
120
- }),
121
- createExtension({
122
- id: `${REGISTRY_PLUGIN}/actions`,
123
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => [
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
- ]), Option.getOrElse(() => [])))
140
- }),
141
- createExtension({
142
- id: `${REGISTRY_PLUGIN}/plugins`,
143
- connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => {
144
- const manager = context.getCapability(Capabilities.PluginManager);
145
- return manager.plugins.map((plugin) => ({
146
- id: plugin.meta.id.replaceAll("/", ":"),
147
- type: "dxos.org/plugin",
148
- data: plugin,
149
- properties: {
150
- label: plugin.meta.name ?? plugin.meta.id,
151
- icon: plugin.meta.icon ?? "ph--circle--regular",
152
- disposition: "hidden"
153
- }
154
- }));
155
- }), Option.getOrElse(() => [])))
156
- })
157
- ]));
158
- export {
159
- app_graph_builder_default as default
160
- };
161
- //# sourceMappingURL=app-graph-builder-GIZIPBS7.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: REGISTRY_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: REGISTRY_PLUGIN,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(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 disposition: 'menu',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: REGISTRY_PLUGIN,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\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}+labs`,\n type: 'category',\n data: `${REGISTRY_KEY}+labs`,\n properties: {\n label: ['labs plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--flask--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.labs',\n },\n },\n ],\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/actions`,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/plugins`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const manager = context.getCapability(Capabilities.PluginManager);\n return manager.plugins.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 Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAkCC,gBAAgBC,aAAaC,oBAAoB;AAC5F,SAASC,uBAAuB;AAIhC,IAAA,6BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAIC;IACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAO,SAASQ,OAAOE,KAAKP,KAAAA,IAAQK,OAAOG,KAAI,CAAA,GAC9EH,OAAOI,IAAI,CAACT,UAAS;MACnB;QACEH,IAAIC;QACJY,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKpB,QAAQqB,cAAcnB,aAAaoB,gBAAgB;AACzF,gBAAMF,SAASG,aAAaC,e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,CAAA,GACAjB,OAAOkB,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "SettingsAction", "contributes", "createIntent", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "REGISTRY_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "SettingsAction", "OpenPluginRegistry", "properties", "label", "ns", "icon", "disposition", "getOrElse", "connector", "REGISTRY_ID", "type", "testId", "nodes", "REGISTRY_KEY", "key", "disabled", "manager", "PluginManager", "plugins", "plugin", "meta", "replaceAll", "name"]
7
- }
@@ -1,16 +0,0 @@
1
- // 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-AEBASNOI.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 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.\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: PluginMeta = {\n id: REGISTRY_PLUGIN,\n name: 'Plugins',\n};\n"],
5
- "mappings": ";AAMO,IAAMA,kBAAkB;AAKxB,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIJ;EACJK,MAAM;AACR;",
6
- "names": ["REGISTRY_PLUGIN", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name"]
7
- }
@@ -1,23 +0,0 @@
1
- import {
2
- REGISTRY_ID
3
- } from "./chunk-AEBASNOI.mjs";
4
-
5
- // src/capabilities/intent-resolver.ts
6
- import { Capabilities, LayoutAction, SettingsAction, contributes, createIntent, createResolver } 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-APB5WWH4.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n LayoutAction,\n SettingsAction,\n contributes,\n createIntent,\n createResolver,\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,cACAC,cACAC,gBACAC,aACAC,cACAC,sBACK;AAIP,IAAA,2BAAe,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": ["Capabilities", "LayoutAction", "SettingsAction", "contributes", "createIntent", "createResolver", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "SettingsAction", "OpenPluginRegistry", "resolve", "intents", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "REGISTRY_ID"]
7
- }
@@ -1,335 +0,0 @@
1
- import {
2
- REGISTRY_KEY,
3
- REGISTRY_PLUGIN
4
- } from "./chunk-AEBASNOI.mjs";
5
-
6
- // src/capabilities/react-surface.tsx
7
- import React5, { useCallback as useCallback3, useMemo as useMemo2 } from "react";
8
- import { Capabilities as Capabilities2, Plugin, contributes, createSurface, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
9
-
10
- // src/components/PluginDetail.tsx
11
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
12
- import React from "react";
13
- import { Icon, Input, Link, useTranslation } from "@dxos/react-ui";
14
- import { StackItem } from "@dxos/react-ui-stack";
15
- var PluginDetail = ({ plugin, enabled, onEnable }) => {
16
- var _effect = _useSignals();
17
- try {
18
- const { t } = useTranslation(REGISTRY_PLUGIN);
19
- const { id, name, description, homePage, source, screenshots } = plugin.meta;
20
- return /* @__PURE__ */ React.createElement(StackItem.Content, {
21
- classNames: "block overflow-y-auto"
22
- }, /* @__PURE__ */ React.createElement("div", {
23
- role: "none",
24
- className: "container-max-width p-4"
25
- }, /* @__PURE__ */ React.createElement("div", {
26
- role: "none",
27
- className: "flex justify-between items-center"
28
- }, /* @__PURE__ */ React.createElement("p", null, id), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
29
- classNames: "self-center",
30
- checked: enabled,
31
- onClick: onEnable
32
- }))), screenshots && screenshots.length > 0 && /* @__PURE__ */ React.createElement("div", {
33
- role: "none"
34
- }, /* @__PURE__ */ React.createElement("h1", {
35
- className: "text-lg mb-2"
36
- }, "Preview"), /* @__PURE__ */ React.createElement("img", {
37
- src: screenshots[0],
38
- alt: name,
39
- className: "aspect-video object-fit"
40
- })), /* @__PURE__ */ React.createElement("div", {
41
- role: "none"
42
- }, /* @__PURE__ */ React.createElement("p", null, description)), /* @__PURE__ */ React.createElement("div", {
43
- role: "none"
44
- }, /* @__PURE__ */ React.createElement("h1", {
45
- className: "text-lg mb-2"
46
- }, "Resources"), /* @__PURE__ */ React.createElement("div", {
47
- className: "flex gap-2"
48
- }, homePage && /* @__PURE__ */ React.createElement(Link, {
49
- href: homePage,
50
- target: "_blank",
51
- rel: "noreferrer",
52
- classNames: "text-sm text-description"
53
- }, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
54
- icon: "ph--arrow-square-out--bold",
55
- size: 3,
56
- classNames: "inline-block leading-none mli-1"
57
- })), source && /* @__PURE__ */ React.createElement(Link, {
58
- href: source,
59
- target: "_blank",
60
- rel: "noreferrer",
61
- classNames: "text-sm text-description"
62
- }, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
63
- icon: "ph--arrow-square-out--bold",
64
- size: 3,
65
- classNames: "inline-block leading-none mli-1"
66
- }))))));
67
- } finally {
68
- _effect.f();
69
- }
70
- };
71
-
72
- // src/components/PluginList.tsx
73
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
74
- import React3 from "react";
75
- import { List } from "@dxos/react-ui";
76
-
77
- // src/components/PluginItem.tsx
78
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
79
- import React2, { useCallback } from "react";
80
- import { Icon as Icon2, IconButton, Input as Input2, Link as Link2, ListItem, Tag, useTranslation as useTranslation2 } from "@dxos/react-ui";
81
- import { descriptionText, mx } from "@dxos/react-ui-theme";
82
- var PluginItem = ({ plugin, enabled = [], onClick, onChange, hasSettings: _hasSettings, onSettings }) => {
83
- var _effect = _useSignals2();
84
- try {
85
- const { t } = useTranslation2(REGISTRY_PLUGIN);
86
- const { id, name, description, tags, icon = "ph--circle--regular" } = plugin.meta;
87
- const isEnabled = enabled.includes(id);
88
- const inputId = `${id}-input`;
89
- const labelId = `${id}-label`;
90
- const descriptionId = `${id}-description`;
91
- const handleClick = useCallback(() => onClick?.(id), [
92
- id,
93
- onClick
94
- ]);
95
- const handleChange = useCallback((event) => {
96
- event.stopPropagation();
97
- onChange?.(id, !isEnabled);
98
- }, [
99
- id,
100
- isEnabled,
101
- onChange
102
- ]);
103
- const hasSettings = _hasSettings?.(id) ?? false;
104
- const handleSettings = useCallback(() => onSettings?.(id), [
105
- id,
106
- onSettings
107
- ]);
108
- return /* @__PURE__ */ React2.createElement(ListItem.Root, {
109
- key: id,
110
- labelId,
111
- "data-testid": `pluginList.${id}`,
112
- "aria-describedby": descriptionId,
113
- // TODO(burdon): Use Rail vars.
114
- classNames: "is-full bs-full grid grid-cols-[48px_1fr_48px] grid-rows-[40px_1fr_32px] p-1 border border-separator rounded-md"
115
- }, /* @__PURE__ */ React2.createElement("div", {
116
- className: "flex flex-col grow justify-center items-center"
117
- }, /* @__PURE__ */ React2.createElement(Icon2, {
118
- icon,
119
- size: 6,
120
- onClick: handleClick,
121
- classNames: "text-subdued cursor-pointer"
122
- })), /* @__PURE__ */ React2.createElement("div", {
123
- className: "flex items-center overflow-hidden cursor-pointer",
124
- onClick: handleClick
125
- }, /* @__PURE__ */ React2.createElement("span", {
126
- className: "truncate"
127
- }, name ?? id)), /* @__PURE__ */ React2.createElement("div", {
128
- className: "flex justify-center items-center"
129
- }, /* @__PURE__ */ React2.createElement(Input2.Root, {
130
- id: inputId
131
- }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
132
- classNames: "self-center",
133
- checked: isEnabled,
134
- onClick: handleChange
135
- }))), /* @__PURE__ */ React2.createElement("div", null), (description || tags) && /* @__PURE__ */ React2.createElement("div", {
136
- id: descriptionId,
137
- className: "col-span-2 flex flex-col w-full justify-between gap-2 pb-2"
138
- }, /* @__PURE__ */ React2.createElement("div", {
139
- className: "grow"
140
- }, /* @__PURE__ */ React2.createElement("p", {
141
- className: mx(descriptionText, "line-clamp-3 min-w-0 pie-2")
142
- }, description)), tags && tags.length > 0 && /* @__PURE__ */ React2.createElement("div", null, tags.map((tag) => /* @__PURE__ */ React2.createElement(Tag, {
143
- key: tag,
144
- palette: "indigo",
145
- classNames: "text-xs capitalize"
146
- }, tag)))), /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
147
- className: "flex gap-2 items-center pie-1"
148
- }, /* @__PURE__ */ React2.createElement(Link2, {
149
- "aria-describedby": descriptionId,
150
- classNames: "text-sm text-description cursor-pointer",
151
- onClick: handleClick
152
- }, t("details label")), /* @__PURE__ */ React2.createElement("div", {
153
- className: "flex-1"
154
- })), /* @__PURE__ */ React2.createElement("div", {
155
- className: "flex justify-center items-center"
156
- }, hasSettings && /* @__PURE__ */ React2.createElement(IconButton, {
157
- "aria-describedby": descriptionId,
158
- classNames: "text-sm text-description cursor-pointer",
159
- icon: "ph--gear--regular",
160
- label: t("settings label"),
161
- iconOnly: true,
162
- size: 4,
163
- onClick: handleSettings
164
- })));
165
- } finally {
166
- _effect.f();
167
- }
168
- };
169
-
170
- // src/components/PluginList.tsx
171
- var PluginList = ({ plugins = [], ...props }) => {
172
- var _effect = _useSignals3();
173
- try {
174
- return /* @__PURE__ */ React3.createElement(List, {
175
- classNames: "grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] auto-rows-[12rem] gap-3 p-3"
176
- }, plugins.map((plugin) => /* @__PURE__ */ React3.createElement("div", {
177
- key: plugin.meta.id,
178
- className: "flex"
179
- }, /* @__PURE__ */ React3.createElement(PluginItem, {
180
- plugin,
181
- ...props
182
- }))));
183
- } finally {
184
- _effect.f();
185
- }
186
- };
187
-
188
- // src/components/RegistryContainer.tsx
189
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
190
- import React4, { useCallback as useCallback2, useMemo } from "react";
191
- import { Capabilities, LayoutAction, SettingsAction, createIntent, useCapability, useIntentDispatcher, usePluginManager } from "@dxos/app-framework";
192
- import { ObservabilityAction } from "@dxos/plugin-observability/types";
193
- import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
194
- var sortByPluginMeta = ({ meta: { name: a = "" } }, { meta: { name: b = "" } }) => a.localeCompare(b);
195
- var RegistryContainer = ({ id, plugins: _plugins }) => {
196
- var _effect = _useSignals4();
197
- try {
198
- const manager = usePluginManager();
199
- const { dispatchPromise: dispatch } = useIntentDispatcher();
200
- const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [
201
- _plugins
202
- ]);
203
- const settingsStore = useCapability(Capabilities.SettingsStore);
204
- const handleChange = useCallback2(async (id2, enabled) => {
205
- if (enabled) {
206
- await manager.enable(id2);
207
- } else {
208
- await manager.disable(id2);
209
- }
210
- await dispatch(createIntent(ObservabilityAction.SendEvent, {
211
- name: "plugins.toggle",
212
- properties: {
213
- plugin: id2,
214
- enabled
215
- }
216
- }));
217
- }, [
218
- dispatch,
219
- manager
220
- ]);
221
- const handleClick = useCallback2((pluginId) => dispatch(createIntent(LayoutAction.Open, {
222
- part: "main",
223
- // TODO(wittjosiah): `/` currently is not supported in ids.
224
- subject: [
225
- pluginId.replaceAll("/", ":")
226
- ],
227
- options: {
228
- pivotId: id,
229
- positioning: "end"
230
- }
231
- })), [
232
- dispatch,
233
- id
234
- ]);
235
- const hasSettings = useCallback2((pluginId) => !!settingsStore.getStore(pluginId), [
236
- settingsStore
237
- ]);
238
- const handleSettings = useCallback2((pluginId) => dispatch(createIntent(SettingsAction.Open, {
239
- plugin: pluginId
240
- })), [
241
- dispatch
242
- ]);
243
- return /* @__PURE__ */ React4.createElement(StackItem2.Content, {
244
- classNames: "min-bs-0 overflow-y-auto scrollbar-thin contain-layout"
245
- }, /* @__PURE__ */ React4.createElement(PluginList, {
246
- plugins,
247
- enabled: manager.enabled,
248
- onClick: handleClick,
249
- onChange: handleChange,
250
- hasSettings,
251
- onSettings: handleSettings
252
- }));
253
- } finally {
254
- _effect.f();
255
- }
256
- };
257
-
258
- // src/capabilities/react-surface.tsx
259
- var react_surface_default = (() => contributes(Capabilities2.ReactSurface, [
260
- createSurface({
261
- id: `${REGISTRY_PLUGIN}/all`,
262
- role: "article",
263
- filter: (data) => data.subject === `${REGISTRY_KEY}+all`,
264
- component: () => {
265
- const manager = usePluginManager2();
266
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
267
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
268
- id: `${REGISTRY_KEY}+all`,
269
- plugins: filtered
270
- });
271
- }
272
- }),
273
- createSurface({
274
- id: `${REGISTRY_PLUGIN}/installed`,
275
- role: "article",
276
- filter: (data) => data.subject === `${REGISTRY_KEY}+installed`,
277
- component: () => {
278
- const manager = usePluginManager2();
279
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)).filter(({ meta }) => manager.enabled.includes(meta.id)), []);
280
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
281
- id: `${REGISTRY_KEY}+installed`,
282
- plugins: filtered
283
- });
284
- }
285
- }),
286
- createSurface({
287
- id: `${REGISTRY_PLUGIN}/recommended`,
288
- role: "article",
289
- filter: (data) => data.subject === `${REGISTRY_KEY}+recommended`,
290
- component: () => {
291
- const manager = usePluginManager2();
292
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)).filter(({ meta }) => !meta.tags?.includes("labs")), []);
293
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
294
- id: `${REGISTRY_KEY}+recommended`,
295
- plugins: filtered
296
- });
297
- }
298
- }),
299
- createSurface({
300
- id: `${REGISTRY_PLUGIN}/labs`,
301
- role: "article",
302
- filter: (data) => data.subject === `${REGISTRY_KEY}+labs`,
303
- component: () => {
304
- const manager = usePluginManager2();
305
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => meta.tags?.includes("labs")), []);
306
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
307
- id: `${REGISTRY_KEY}+labs`,
308
- plugins: filtered
309
- });
310
- }
311
- }),
312
- createSurface({
313
- id: `${REGISTRY_PLUGIN}/plugin-details`,
314
- role: "article",
315
- filter: (data) => data.subject instanceof Plugin,
316
- component: ({ data: { subject } }) => {
317
- const manager = usePluginManager2();
318
- const enabled = manager.enabled.includes(subject.meta.id);
319
- const handleEnable = useCallback3(() => enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id), [
320
- manager,
321
- subject.meta.id,
322
- enabled
323
- ]);
324
- return /* @__PURE__ */ React5.createElement(PluginDetail, {
325
- plugin: subject,
326
- enabled,
327
- onEnable: handleEnable
328
- });
329
- }
330
- })
331
- ]));
332
- export {
333
- react_surface_default as default
334
- };
335
- //# sourceMappingURL=react-surface-C7T4DU6Q.mjs.map