@dxos/plugin-registry 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660

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 (158) hide show
  1. package/dist/lib/browser/PluginArticle-N2ITBUGD.mjs +29 -0
  2. package/dist/lib/browser/PluginArticle-N2ITBUGD.mjs.map +7 -0
  3. package/dist/lib/browser/PluginRegistry-DKO4UEYH.mjs +78 -0
  4. package/dist/lib/browser/PluginRegistry-DKO4UEYH.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-AHS5BI4Y.mjs +167 -0
  6. package/dist/lib/browser/app-graph-builder-AHS5BI4Y.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2YWVCU2W.mjs +191 -0
  8. package/dist/lib/browser/chunk-2YWVCU2W.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-XPEFEID2.mjs → chunk-KMUDYITM.mjs} +4 -2
  10. package/dist/lib/browser/chunk-KMUDYITM.mjs.map +7 -0
  11. package/dist/lib/browser/cli/index.mjs +222 -0
  12. package/dist/lib/browser/cli/index.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +25 -29
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/operation-resolver-PK4B2BZQ.mjs +25 -0
  17. package/dist/lib/browser/operation-resolver-PK4B2BZQ.mjs.map +7 -0
  18. package/dist/lib/browser/react-surface-ZBP7YXKO.mjs +85 -0
  19. package/dist/lib/browser/react-surface-ZBP7YXKO.mjs.map +7 -0
  20. package/dist/lib/node-esm/PluginArticle-3NEYDKN5.mjs +30 -0
  21. package/dist/lib/node-esm/PluginArticle-3NEYDKN5.mjs.map +7 -0
  22. package/dist/lib/node-esm/PluginRegistry-BYKWC732.mjs +79 -0
  23. package/dist/lib/node-esm/PluginRegistry-BYKWC732.mjs.map +7 -0
  24. package/dist/lib/node-esm/app-graph-builder-DBDL5WWF.mjs +168 -0
  25. package/dist/lib/node-esm/app-graph-builder-DBDL5WWF.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-BOCFM775.mjs +192 -0
  27. package/dist/lib/node-esm/chunk-BOCFM775.mjs.map +7 -0
  28. package/dist/lib/node-esm/chunk-ENSNUFQK.mjs +23 -0
  29. package/dist/lib/node-esm/chunk-ENSNUFQK.mjs.map +7 -0
  30. package/dist/lib/node-esm/cli/index.mjs +223 -0
  31. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +66 -0
  33. package/dist/lib/node-esm/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/meta.json +1 -0
  35. package/dist/lib/node-esm/operation-resolver-CCHN4NBP.mjs +26 -0
  36. package/dist/lib/node-esm/operation-resolver-CCHN4NBP.mjs.map +7 -0
  37. package/dist/lib/node-esm/react-surface-FJHMLGZF.mjs +86 -0
  38. package/dist/lib/node-esm/react-surface-FJHMLGZF.mjs.map +7 -0
  39. package/dist/types/src/RegistryPlugin.d.ts +2 -1
  40. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  42. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  43. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  44. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/index.d.ts +3 -3
  46. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  48. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  50. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  52. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  54. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  55. package/dist/types/src/cli/commands/disable.d.ts +11 -0
  56. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  57. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  58. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  59. package/dist/types/src/cli/commands/index.d.ts +3 -0
  60. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  61. package/dist/types/src/cli/commands/list.d.ts +7 -0
  62. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  63. package/dist/types/src/cli/commands/util.d.ts +11 -0
  64. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  65. package/dist/types/src/cli/index.d.ts +3 -0
  66. package/dist/types/src/cli/index.d.ts.map +1 -0
  67. package/dist/types/src/cli/plugin.d.ts +3 -0
  68. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  69. package/dist/types/src/cli/storage.d.ts +18 -0
  70. package/dist/types/src/cli/storage.d.ts.map +1 -0
  71. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +9 -0
  72. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
  73. package/dist/types/src/components/{PluginDetail.stories.d.ts → PluginDetail/PluginDetail.stories.d.ts} +2 -1
  74. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
  75. package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
  76. package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
  77. package/dist/types/src/components/{PluginItem.d.ts → PluginList/PluginItem.d.ts} +2 -2
  78. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
  79. package/dist/types/src/components/{PluginList.d.ts → PluginList/PluginList.d.ts} +1 -1
  80. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
  81. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
  82. package/dist/types/src/components/PluginList/index.d.ts +2 -0
  83. package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
  84. package/dist/types/src/components/index.d.ts +0 -1
  85. package/dist/types/src/components/index.d.ts.map +1 -1
  86. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
  87. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
  88. package/dist/types/src/containers/PluginArticle/index.d.ts +3 -0
  89. package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
  90. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +8 -0
  91. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
  92. package/dist/types/src/containers/PluginRegistry/index.d.ts +3 -0
  93. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
  94. package/dist/types/src/containers/index.d.ts +4 -0
  95. package/dist/types/src/containers/index.d.ts.map +1 -0
  96. package/dist/types/src/meta.d.ts +4 -2
  97. package/dist/types/src/meta.d.ts.map +1 -1
  98. package/dist/types/tsconfig.tsbuildinfo +1 -1
  99. package/package.json +50 -32
  100. package/src/RegistryPlugin.tsx +10 -24
  101. package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -0
  102. package/src/capabilities/app-graph-builder/index.ts +7 -0
  103. package/src/capabilities/index.ts +3 -5
  104. package/src/capabilities/operation-resolver/index.ts +7 -0
  105. package/src/capabilities/operation-resolver/operation-resolver.ts +24 -0
  106. package/src/capabilities/react-surface/index.ts +7 -0
  107. package/src/capabilities/react-surface/react-surface.tsx +88 -0
  108. package/src/cli/commands/disable.ts +47 -0
  109. package/src/cli/commands/enable.ts +44 -0
  110. package/src/cli/commands/index.ts +14 -0
  111. package/src/cli/commands/list.ts +41 -0
  112. package/src/cli/commands/util.ts +24 -0
  113. package/src/cli/index.ts +6 -0
  114. package/src/cli/plugin.ts +17 -0
  115. package/src/cli/storage.ts +50 -0
  116. package/src/components/PluginDetail/PluginDetail.stories.tsx +44 -0
  117. package/src/components/PluginDetail/PluginDetail.tsx +81 -0
  118. package/src/components/PluginDetail/index.ts +5 -0
  119. package/src/components/{PluginItem.tsx → PluginList/PluginItem.tsx} +18 -14
  120. package/src/components/PluginList/PluginList.stories.tsx +84 -0
  121. package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +2 -2
  122. package/src/components/PluginList/index.ts +5 -0
  123. package/src/components/index.ts +0 -1
  124. package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
  125. package/src/containers/PluginArticle/index.ts +7 -0
  126. package/src/containers/PluginRegistry/PluginRegistry.tsx +86 -0
  127. package/src/containers/PluginRegistry/index.ts +7 -0
  128. package/src/containers/index.ts +8 -0
  129. package/src/meta.ts +6 -6
  130. package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs +0 -162
  131. package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-XPEFEID2.mjs.map +0 -7
  133. package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs +0 -23
  134. package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs.map +0 -7
  135. package/dist/lib/browser/react-surface-IGCXOVE2.mjs +0 -359
  136. package/dist/lib/browser/react-surface-IGCXOVE2.mjs.map +0 -7
  137. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  138. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  139. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  140. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  141. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  142. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  143. package/dist/types/src/components/PluginDetail.d.ts +0 -9
  144. package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
  145. package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
  146. package/dist/types/src/components/PluginItem.d.ts.map +0 -1
  147. package/dist/types/src/components/PluginList.d.ts.map +0 -1
  148. package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
  149. package/dist/types/src/components/RegistryContainer.d.ts +0 -7
  150. package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
  151. package/src/capabilities/app-graph-builder.ts +0 -156
  152. package/src/capabilities/intent-resolver.ts +0 -27
  153. package/src/capabilities/react-surface.tsx +0 -86
  154. package/src/components/PluginDetail.stories.tsx +0 -45
  155. package/src/components/PluginDetail.tsx +0 -82
  156. package/src/components/PluginList.stories.tsx +0 -80
  157. package/src/components/RegistryContainer.tsx +0 -76
  158. /package/dist/types/src/components/{PluginList.stories.d.ts → PluginList/PluginList.stories.d.ts} +0 -0
@@ -1,4 +0,0 @@
1
- import { type PluginContext } from '@dxos/app-framework';
2
- declare const _default: (context: PluginContext) => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<import("@dxos/app-graph").BuilderExtensions>>;
3
- export default _default;
4
- //# sourceMappingURL=app-graph-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAQA,OAAO,EAAgB,KAAK,aAAa,EAA6C,MAAM,qBAAqB,CAAC;yBAKlG,SAAS,aAAa;AAAtC,wBA8IK"}
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.IntentResolver>>;
3
- export default _default;
4
- //# sourceMappingURL=intent-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EAMb,MAAM,qBAAqB,CAAC;;AAI7B,wBAWI"}
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.ReactSurface>>;
3
- export default _default;
4
- //# sourceMappingURL=react-surface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAsC,MAAM,qBAAqB,CAAC;;AAMvF,wBAyEK"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { type Plugin } from '@dxos/app-framework';
3
- export type PluginDetailProps = {
4
- plugin: Plugin;
5
- enabled?: boolean;
6
- onEnable?: () => void;
7
- };
8
- export declare const PluginDetail: ({ plugin, enabled, onEnable }: PluginDetailProps) => React.JSX.Element;
9
- //# sourceMappingURL=PluginDetail.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginDetail.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,+BAA+B,iBAAiB,sBA8D5E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginDetail.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASjE,QAAA,MAAM,IAAI;;;;;;;yBANc,CAAS,IAAG,CAAE,EAAC,CAAC;;;;;;;;;;;;;;;;;;;CAaH,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAkBrB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginItem.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQlD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,oFAOxB,eAAe,sBA+EjB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG;IAC9D,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,uBAA4B,eAAe,sBAQrE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginList.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAoDxC,QAAA,MAAM,IAAI;;;;;;;yBAlDY,CAAO,IAAI,CAAE,EAAC,CAAC;;;;;;;;;;;;;;;;;;;CAyDF,CAAC;AAEpC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type Plugin } from '@dxos/app-framework';
3
- export declare const RegistryContainer: ({ id, plugins: _plugins }: {
4
- id: string;
5
- plugins: Plugin[];
6
- }) => React.JSX.Element;
7
- //# sourceMappingURL=RegistryContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RegistryContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/RegistryContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAA8B,KAAK,MAAM,EAAgC,MAAM,qBAAqB,CAAC;AAS5G,eAAO,MAAM,iBAAiB,GAAI,2BAA2B;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBA4D7F,CAAC"}
@@ -1,156 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Atom } from '@effect-atom/atom-react';
6
- import * as Function from 'effect/Function';
7
- import * as Option from 'effect/Option';
8
-
9
- import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
10
- import { createExtension } from '@dxos/plugin-graph';
11
-
12
- import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
13
-
14
- export default (context: PluginContext) =>
15
- contributes(Capabilities.AppGraphBuilder, [
16
- createExtension({
17
- id: meta.id,
18
- actions: (node) =>
19
- Atom.make((get) =>
20
- Function.pipe(
21
- get(node),
22
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
23
- Option.map((node) => [
24
- {
25
- id: meta.id,
26
- data: async () => {
27
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
28
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
29
- },
30
- properties: {
31
- label: ['open plugin registry label', { ns: meta.id }],
32
- icon: 'ph--squares-four--regular',
33
- disposition: 'menu',
34
- },
35
- },
36
- ]),
37
- Option.getOrElse(() => []),
38
- ),
39
- ),
40
- }),
41
- createExtension({
42
- id: meta.id,
43
- connector: (node) =>
44
- Atom.make((get) =>
45
- Function.pipe(
46
- get(node),
47
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
48
- Option.map((node) => [
49
- {
50
- id: REGISTRY_ID,
51
- type: meta.id,
52
- properties: {
53
- label: ['plugin registry label', { ns: meta.id }],
54
- icon: 'ph--squares-four--regular',
55
- disposition: 'pin-end',
56
- testId: 'treeView.pluginRegistry',
57
- },
58
- nodes: [
59
- {
60
- id: `${REGISTRY_KEY}+all`,
61
- type: 'category',
62
- data: `${REGISTRY_KEY}+all`,
63
- properties: {
64
- label: ['all plugins label', { ns: meta.id }],
65
- icon: 'ph--squares-four--regular',
66
- key: REGISTRY_KEY,
67
- testId: 'pluginRegistry.all',
68
- },
69
- },
70
- {
71
- id: `${REGISTRY_KEY}+installed`,
72
- type: 'category',
73
- data: `${REGISTRY_KEY}+installed`,
74
- properties: {
75
- label: ['installed plugins label', { ns: meta.id }],
76
- icon: 'ph--check--regular',
77
- key: REGISTRY_KEY,
78
- testId: 'pluginRegistry.installed',
79
- },
80
- },
81
- {
82
- id: `${REGISTRY_KEY}+recommended`,
83
- type: 'category',
84
- data: `${REGISTRY_KEY}+recommended`,
85
- properties: {
86
- label: ['recommended plugins label', { ns: meta.id }],
87
- icon: 'ph--star--regular',
88
- key: REGISTRY_KEY,
89
- testId: 'pluginRegistry.recommended',
90
- },
91
- },
92
- {
93
- id: `${REGISTRY_KEY}+labs`,
94
- type: 'category',
95
- data: `${REGISTRY_KEY}+labs`,
96
- properties: {
97
- label: ['labs plugins label', { ns: meta.id }],
98
- icon: 'ph--flask--regular',
99
- key: REGISTRY_KEY,
100
- testId: 'pluginRegistry.labs',
101
- },
102
- },
103
- ],
104
- },
105
- ]),
106
- Option.getOrElse(() => []),
107
- ),
108
- ),
109
- }),
110
- createExtension({
111
- id: `${meta.id}/actions`,
112
- actions: (node) =>
113
- Atom.make((get) =>
114
- Function.pipe(
115
- get(node),
116
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
117
- Option.map(() => [
118
- {
119
- id: `${meta.id}/load-by-url`,
120
- data: async () => {},
121
- properties: {
122
- label: ['load by url label', { ns: meta.id }],
123
- icon: 'ph--cloud-arrow-down--regular',
124
- disabled: true,
125
- },
126
- },
127
- ]),
128
- Option.getOrElse(() => []),
129
- ),
130
- ),
131
- }),
132
- createExtension({
133
- id: `${meta.id}/plugins`,
134
- connector: (node) =>
135
- Atom.make((get) =>
136
- Function.pipe(
137
- get(node),
138
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
139
- Option.map(() => {
140
- const manager = context.getCapability(Capabilities.PluginManager);
141
- return manager.plugins.map((plugin) => ({
142
- id: plugin.meta.id.replaceAll('/', ':'),
143
- type: 'dxos.org/plugin',
144
- data: plugin,
145
- properties: {
146
- label: plugin.meta.name ?? plugin.meta.id,
147
- icon: plugin.meta.icon ?? 'ph--circle--regular',
148
- disposition: 'hidden',
149
- },
150
- }));
151
- }),
152
- Option.getOrElse(() => []),
153
- ),
154
- ),
155
- }),
156
- ]);
@@ -1,27 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import {
6
- Capabilities,
7
- LayoutAction,
8
- SettingsAction,
9
- contributes,
10
- createIntent,
11
- createResolver,
12
- } from '@dxos/app-framework';
13
-
14
- import { REGISTRY_ID } from '../meta';
15
-
16
- export default () =>
17
- contributes(
18
- Capabilities.IntentResolver,
19
- createResolver({
20
- intent: SettingsAction.OpenPluginRegistry,
21
- resolve: () => {
22
- return {
23
- intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],
24
- };
25
- },
26
- }),
27
- );
@@ -1,86 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { useCallback, useMemo } from 'react';
6
-
7
- import { Capabilities, Plugin, contributes, createSurface } from '@dxos/app-framework';
8
- import { usePluginManager } from '@dxos/app-framework/react';
9
-
10
- import { PluginDetail, RegistryContainer } from '../components';
11
- import { REGISTRY_KEY, meta } from '../meta';
12
-
13
- export default () =>
14
- contributes(Capabilities.ReactSurface, [
15
- createSurface({
16
- id: `${meta.id}/all`,
17
- role: 'article',
18
- filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
19
- component: () => {
20
- const manager = usePluginManager();
21
- const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
22
-
23
- return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;
24
- },
25
- }),
26
- createSurface({
27
- id: `${meta.id}/installed`,
28
- role: 'article',
29
- filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
30
- component: () => {
31
- const manager = usePluginManager();
32
- const filtered = useMemo(
33
- () =>
34
- manager.plugins
35
- .filter(({ meta }) => !manager.core.includes(meta.id))
36
- .filter(({ meta }) => manager.enabled.includes(meta.id)),
37
- [],
38
- );
39
-
40
- return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;
41
- },
42
- }),
43
- createSurface({
44
- id: `${meta.id}/recommended`,
45
- role: 'article',
46
- filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
47
- component: () => {
48
- const manager = usePluginManager();
49
- const filtered = useMemo(
50
- () =>
51
- manager.plugins
52
- .filter(({ meta }) => !manager.core.includes(meta.id))
53
- .filter(({ meta }) => !meta.tags?.includes('labs')),
54
- [],
55
- );
56
-
57
- return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;
58
- },
59
- }),
60
- createSurface({
61
- id: `${meta.id}/labs`,
62
- role: 'article',
63
- filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
64
- component: () => {
65
- const manager = usePluginManager();
66
- const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('labs')), []);
67
-
68
- return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;
69
- },
70
- }),
71
- createSurface({
72
- id: `${meta.id}/plugin-details`,
73
- role: 'article',
74
- filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
75
- component: ({ data: { subject } }) => {
76
- const manager = usePluginManager();
77
- const enabled = manager.enabled.includes(subject.meta.id);
78
- const handleEnable = useCallback(
79
- () => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),
80
- [manager, subject.meta.id, enabled],
81
- );
82
-
83
- return <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />;
84
- },
85
- }),
86
- ]);
@@ -1,45 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
-
7
- import { faker } from '@dxos/random';
8
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
9
-
10
- import { translations } from '../translations';
11
-
12
- import { PluginDetail } from './PluginDetail';
13
-
14
- const meta = {
15
- title: 'plugins/plugin-registry/PluginDetail',
16
- component: PluginDetail,
17
- decorators: [withTheme, withLayout({ container: 'column' })],
18
- parameters: {
19
- translations,
20
- },
21
- } satisfies Meta<typeof PluginDetail>;
22
-
23
- export default meta;
24
-
25
- type Story = StoryObj<typeof meta>;
26
-
27
- export const Default: Story = {
28
- args: {
29
- plugin: {
30
- meta: {
31
- id: 'example.com/plugin/test-plugin',
32
- name: 'Test Plugin',
33
- description: faker.lorem.paragraphs(2),
34
- icon: 'ph--bug--regular',
35
- iconHue: 'sky',
36
- homePage: 'https://example.com',
37
- source: 'https://github.com/example/test-plugin',
38
- screenshots: [
39
- 'https://media.gcflearnfree.org/content/55e073de7dd48174331f51b3_01_17_2014/getting_started_interactive2.png',
40
- ],
41
- },
42
- modules: [],
43
- },
44
- },
45
- };
@@ -1,82 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type Plugin } from '@dxos/app-framework';
8
- import { Icon, Input, Link, useTranslation } from '@dxos/react-ui';
9
- import { StackItem } from '@dxos/react-ui-stack';
10
- import { getStyles, mx } from '@dxos/react-ui-theme';
11
-
12
- import { meta } from '../meta';
13
-
14
- export type PluginDetailProps = {
15
- plugin: Plugin;
16
- enabled?: boolean;
17
- onEnable?: () => void;
18
- };
19
-
20
- export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {
21
- const { t } = useTranslation(meta.id);
22
- const {
23
- id,
24
- name,
25
- description,
26
- homePage,
27
- source,
28
- screenshots,
29
- icon = 'ph--circle--regular',
30
- iconHue = 'neutral',
31
- } = plugin.meta;
32
- const styles = getStyles(iconHue);
33
-
34
- return (
35
- <StackItem.Content scrollable>
36
- <div role='none' className='grid grid-cols-[min-content_1fr] gap-4 container-max-width p-4'>
37
- <div role='none'>
38
- <Icon classNames={mx('p-1 rounded', styles.bg, styles.icon)} icon={icon} size={14} />
39
- </div>
40
- <div role='none' className='flex flex-col gap-6'>
41
- <div role='none' className='grid grid-cols-[1fr_min-content] gap-x-3 is-full pbs-1'>
42
- <h2 className='text-xl'>{name}</h2>
43
- <Input.Root>
44
- <Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />
45
- </Input.Root>
46
- <p className='pbs-0.5 text-sm text-description'>{id}</p>
47
- </div>
48
-
49
- <div role='none'>
50
- <p className='text-description'>{description}</p>
51
- </div>
52
-
53
- {screenshots && screenshots.length > 0 && (
54
- <div role='none' className='flex flex-col gap-2'>
55
- <h2>Preview</h2>
56
- <img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
57
- </div>
58
- )}
59
-
60
- <div role='none' className='flex flex-col gap-2'>
61
- <h2>Resources</h2>
62
- <div className='flex gap-2'>
63
- {homePage && (
64
- <Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
65
- {t('home page label')}
66
- <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
67
- </Link>
68
- )}
69
-
70
- {source && (
71
- <Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
72
- {t('source label')}
73
- <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
74
- </Link>
75
- )}
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- </StackItem.Content>
81
- );
82
- };
@@ -1,80 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useState } from 'react';
7
-
8
- import { type Plugin, definePlugin } from '@dxos/app-framework';
9
- import { faker } from '@dxos/random';
10
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
- import { getHashHue } from '@dxos/react-ui-theme';
12
-
13
- import { translations } from '../translations';
14
- import { RegistryTagType } from '../types';
15
-
16
- import { PluginList } from './PluginList';
17
-
18
- faker.seed(1);
19
-
20
- const icons = [
21
- 'ph--bug--regular',
22
- 'ph--compass--regular',
23
- 'ph--kanban--regular',
24
- 'ph--table--regular',
25
- 'ph--gear--regular',
26
- 'ph--github-logo--regular',
27
- ];
28
-
29
- const DefaultStory = () => {
30
- const [plugins] = useState<Plugin[]>(
31
- faker.helpers.multiple(
32
- () =>
33
- definePlugin(
34
- {
35
- id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
36
- name: `${faker.commerce.productName()}`,
37
- description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
38
- tags: faker.helpers.uniqueArray(RegistryTagType.literals as any, Math.floor(Math.random() * 3)),
39
- icon: faker.helpers.arrayElement(icons),
40
- iconHue: getHashHue(faker.string.uuid()),
41
- homePage: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.url() : undefined,
42
- source: faker.internet.url(),
43
- },
44
- () => [],
45
- )(),
46
- { count: 32 },
47
- ),
48
- );
49
- const [enabled, setEnabled] = useState<string[]>([]);
50
-
51
- const handleChange = (id: string, enabled: boolean) => {
52
- setEnabled((plugins) => (enabled ? [...plugins, id] : plugins.filter((plugin) => plugin === id)));
53
- };
54
-
55
- return <PluginList plugins={plugins} enabled={enabled} onChange={handleChange} hasSettings={() => true} />;
56
- };
57
-
58
- const meta = {
59
- title: 'plugins/plugin-registry/PluginList',
60
- component: PluginList,
61
- render: DefaultStory,
62
- parameters: {
63
- translations,
64
- },
65
- } satisfies Meta<typeof PluginList>;
66
-
67
- export default meta;
68
-
69
- type Story = StoryObj<typeof meta>;
70
-
71
- export const Default: Story = {
72
- decorators: [withTheme, withLayout({ container: 'column', scroll: true })],
73
- };
74
-
75
- export const FullScreen: Story = {
76
- decorators: [withTheme, withLayout({ scroll: true })],
77
- parameters: {
78
- layout: 'fullscreen',
79
- },
80
- };
@@ -1,76 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { useCallback, useMemo } from 'react';
6
-
7
- import { Capabilities, LayoutAction, type Plugin, SettingsAction, createIntent } from '@dxos/app-framework';
8
- import { useCapability, useIntentDispatcher, usePluginManager } from '@dxos/app-framework/react';
9
- import { ObservabilityAction } from '@dxos/plugin-observability/types';
10
- import { StackItem } from '@dxos/react-ui-stack';
11
-
12
- import { PluginList } from './PluginList';
13
-
14
- const sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin, { meta: { name: b = '' } }: Plugin) => a.localeCompare(b);
15
-
16
- export const RegistryContainer = ({ id, plugins: _plugins }: { id: string; plugins: Plugin[] }) => {
17
- const manager = usePluginManager();
18
- const { dispatchPromise: dispatch } = useIntentDispatcher();
19
- const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [_plugins]);
20
- const settingsStore = useCapability(Capabilities.SettingsStore);
21
-
22
- // TODO(wittjosiah): Factor out to an intent?
23
- const handleChange = useCallback(
24
- async (id: string, enabled: boolean) => {
25
- if (enabled) {
26
- await manager.enable(id);
27
- } else {
28
- await manager.disable(id);
29
- }
30
-
31
- await dispatch(
32
- createIntent(ObservabilityAction.SendEvent, {
33
- name: 'plugins.toggle',
34
- properties: {
35
- plugin: id,
36
- enabled,
37
- },
38
- }),
39
- );
40
- },
41
- [dispatch, manager],
42
- );
43
-
44
- const handleClick = useCallback(
45
- (pluginId: string) =>
46
- dispatch(
47
- createIntent(LayoutAction.Open, {
48
- part: 'main',
49
- // TODO(wittjosiah): `/` currently is not supported in ids.
50
- subject: [pluginId.replaceAll('/', ':')],
51
- options: { pivotId: id, positioning: 'end' },
52
- }),
53
- ),
54
- [dispatch, id],
55
- );
56
-
57
- const hasSettings = useCallback((pluginId: string) => !!settingsStore.getStore(pluginId), [settingsStore]);
58
-
59
- const handleSettings = useCallback(
60
- (pluginId: string) => dispatch(createIntent(SettingsAction.Open, { plugin: pluginId })),
61
- [dispatch],
62
- );
63
-
64
- return (
65
- <StackItem.Content scrollable>
66
- <PluginList
67
- plugins={plugins}
68
- enabled={manager.enabled}
69
- onClick={handleClick}
70
- onChange={handleChange}
71
- hasSettings={hasSettings}
72
- onSettings={handleSettings}
73
- />
74
- </StackItem.Content>
75
- );
76
- };