@dxos/plugin-registry 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae

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 (168) hide show
  1. package/dist/lib/browser/PluginArticle-MLBF7AFA.mjs +29 -0
  2. package/dist/lib/browser/PluginArticle-MLBF7AFA.mjs.map +7 -0
  3. package/dist/lib/browser/PluginRegistry-ENAI4SAY.mjs +77 -0
  4. package/dist/lib/browser/PluginRegistry-ENAI4SAY.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-2HXD7SOS.mjs +167 -0
  6. package/dist/lib/browser/app-graph-builder-2HXD7SOS.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-TSNK3SAR.mjs +191 -0
  8. package/dist/lib/browser/chunk-TSNK3SAR.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-VOAOTNGS.mjs +19 -0
  10. package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +7 -0
  11. package/dist/lib/browser/cli/index.mjs +224 -0
  12. package/dist/lib/browser/cli/index.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +23 -31
  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-7P3NNVSR.mjs +25 -0
  17. package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +7 -0
  18. package/dist/lib/browser/react-surface-DH25DIRH.mjs +85 -0
  19. package/dist/lib/browser/react-surface-DH25DIRH.mjs.map +7 -0
  20. package/dist/lib/node-esm/PluginArticle-TP2G6GGI.mjs +30 -0
  21. package/dist/lib/node-esm/PluginArticle-TP2G6GGI.mjs.map +7 -0
  22. package/dist/lib/node-esm/PluginRegistry-CWIZIQNX.mjs +78 -0
  23. package/dist/lib/node-esm/PluginRegistry-CWIZIQNX.mjs.map +7 -0
  24. package/dist/lib/node-esm/app-graph-builder-2LNPN72O.mjs +168 -0
  25. package/dist/lib/node-esm/app-graph-builder-2LNPN72O.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-4XO63XB6.mjs +192 -0
  27. package/dist/lib/node-esm/chunk-4XO63XB6.mjs.map +7 -0
  28. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +21 -0
  29. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +7 -0
  30. package/dist/lib/node-esm/cli/index.mjs +225 -0
  31. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  32. package/dist/lib/node-esm/index.mjs +64 -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-B24QW6IF.mjs +26 -0
  36. package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +7 -0
  37. package/dist/lib/node-esm/react-surface-3YBEVL65.mjs +86 -0
  38. package/dist/lib/node-esm/react-surface-3YBEVL65.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/PluginDetail.stories.d.ts +33 -0
  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 +34 -0
  82. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/PluginList/index.d.ts +2 -0
  84. package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
  85. package/dist/types/src/components/index.d.ts +0 -1
  86. package/dist/types/src/components/index.d.ts.map +1 -1
  87. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
  88. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
  89. package/dist/types/src/containers/PluginArticle/index.d.ts +3 -0
  90. package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
  91. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +8 -0
  92. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
  93. package/dist/types/src/containers/PluginRegistry/index.d.ts +3 -0
  94. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
  95. package/dist/types/src/containers/index.d.ts +4 -0
  96. package/dist/types/src/containers/index.d.ts.map +1 -0
  97. package/dist/types/src/meta.d.ts +2 -3
  98. package/dist/types/src/meta.d.ts.map +1 -1
  99. package/dist/types/src/types.d.ts +3 -1
  100. package/dist/types/src/types.d.ts.map +1 -1
  101. package/dist/types/tsconfig.tsbuildinfo +1 -1
  102. package/package.json +50 -34
  103. package/src/RegistryPlugin.tsx +10 -25
  104. package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -0
  105. package/src/capabilities/app-graph-builder/index.ts +7 -0
  106. package/src/capabilities/index.ts +3 -5
  107. package/src/capabilities/operation-resolver/index.ts +7 -0
  108. package/src/capabilities/operation-resolver/operation-resolver.ts +24 -0
  109. package/src/capabilities/react-surface/index.ts +7 -0
  110. package/src/capabilities/react-surface/react-surface.tsx +88 -0
  111. package/src/cli/commands/disable.ts +47 -0
  112. package/src/cli/commands/enable.ts +44 -0
  113. package/src/cli/commands/index.ts +14 -0
  114. package/src/cli/commands/list.ts +41 -0
  115. package/src/cli/commands/util.ts +24 -0
  116. package/src/cli/index.ts +6 -0
  117. package/src/cli/plugin.ts +17 -0
  118. package/src/cli/storage.ts +57 -0
  119. package/src/components/PluginDetail/PluginDetail.stories.tsx +44 -0
  120. package/src/components/PluginDetail/PluginDetail.tsx +81 -0
  121. package/src/components/PluginDetail/index.ts +5 -0
  122. package/src/components/PluginList/PluginItem.tsx +124 -0
  123. package/src/components/PluginList/PluginList.stories.tsx +84 -0
  124. package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +3 -5
  125. package/src/components/PluginList/index.ts +5 -0
  126. package/src/components/index.ts +0 -1
  127. package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
  128. package/src/containers/PluginArticle/index.ts +7 -0
  129. package/src/containers/PluginRegistry/PluginRegistry.tsx +86 -0
  130. package/src/containers/PluginRegistry/index.ts +7 -0
  131. package/src/containers/index.ts +8 -0
  132. package/src/meta.ts +8 -5
  133. package/src/types.ts +5 -1
  134. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs +0 -161
  135. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs.map +0 -7
  136. package/dist/lib/browser/chunk-AEBASNOI.mjs +0 -16
  137. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  138. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs +0 -23
  139. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs.map +0 -7
  140. package/dist/lib/browser/react-surface-3GNB7AOY.mjs +0 -333
  141. package/dist/lib/browser/react-surface-3GNB7AOY.mjs.map +0 -7
  142. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  143. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  144. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  145. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  146. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  147. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  148. package/dist/types/src/components/Icon.stories.d.ts +0 -6
  149. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  150. package/dist/types/src/components/PluginDetail.d.ts +0 -9
  151. package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
  152. package/dist/types/src/components/PluginDetail.stories.d.ts +0 -8
  153. package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
  154. package/dist/types/src/components/PluginItem.d.ts.map +0 -1
  155. package/dist/types/src/components/PluginList.d.ts.map +0 -1
  156. package/dist/types/src/components/PluginList.stories.d.ts +0 -11
  157. package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
  158. package/dist/types/src/components/RegistryContainer.d.ts +0 -7
  159. package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
  160. package/src/capabilities/app-graph-builder.ts +0 -155
  161. package/src/capabilities/intent-resolver.ts +0 -27
  162. package/src/capabilities/react-surface.tsx +0 -90
  163. package/src/components/Icon.stories.tsx +0 -108
  164. package/src/components/PluginDetail.stories.tsx +0 -45
  165. package/src/components/PluginDetail.tsx +0 -63
  166. package/src/components/PluginItem.tsx +0 -119
  167. package/src/components/PluginList.stories.tsx +0 -82
  168. package/src/components/RegistryContainer.tsx +0 -84
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '@dxos/app-framework';
2
- declare const _default: () => import("@dxos/app-framework").Capability<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,EAKL,YAAY,EAEb,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<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,EAAwD,MAAM,qBAAqB,CAAC;;AAMzG,wBA6EK"}
@@ -1,6 +0,0 @@
1
- import '@dxos-theme';
2
- import { type Meta } from '@storybook/react-vite';
3
- export declare const Default: {};
4
- declare const meta: Meta;
5
- export default meta;
6
- //# sourceMappingURL=Icon.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AA0FlD,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAMX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -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;AAMlD,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,sBA4C5E,CAAC"}
@@ -1,8 +0,0 @@
1
- import '@dxos-theme';
2
- import { type StoryObj, type Meta } from '@storybook/react-vite';
3
- import { type PluginDetailProps } from './PluginDetail';
4
- declare const meta: Meta<PluginDetailProps>;
5
- export default meta;
6
- type Story = StoryObj<PluginDetailProps>;
7
- export declare const Default: Story;
8
- //# sourceMappingURL=PluginDetail.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginDetail.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginDetail.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGtE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAOjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAiBrB,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;AAMlD,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,gFAOxB,eAAe,sBAyFjB,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,sBAUrE,CAAC"}
@@ -1,11 +0,0 @@
1
- import '@dxos-theme';
2
- import { type Meta } from '@storybook/react-vite';
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Default: {};
6
- export declare const Column: {
7
- args: {
8
- classNames: string;
9
- };
10
- };
11
- //# sourceMappingURL=PluginList.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginList.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAyDlD,QAAA,MAAM,IAAI,EAAE,IAQX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,eAAO,MAAM,MAAM;;;;CAIlB,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,EAIL,KAAK,MAAM,EAKZ,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,iBAAiB,GAAI,2BAA2B;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBA4D7F,CAAC"}
@@ -1,155 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
7
-
8
- import { Capabilities, contributes, createIntent, SettingsAction, type PluginContext } from '@dxos/app-framework';
9
- import { createExtension } from '@dxos/plugin-graph';
10
-
11
- import { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
12
-
13
- export default (context: PluginContext) =>
14
- contributes(Capabilities.AppGraphBuilder, [
15
- createExtension({
16
- id: REGISTRY_PLUGIN,
17
- actions: (node) =>
18
- Rx.make((get) =>
19
- pipe(
20
- get(node),
21
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
22
- Option.map((node) => [
23
- {
24
- id: REGISTRY_PLUGIN,
25
- data: async () => {
26
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
27
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
28
- },
29
- properties: {
30
- label: ['open plugin registry label', { ns: REGISTRY_PLUGIN }],
31
- icon: 'ph--squares-four--regular',
32
- disposition: 'menu',
33
- },
34
- },
35
- ]),
36
- Option.getOrElse(() => []),
37
- ),
38
- ),
39
- }),
40
- createExtension({
41
- id: REGISTRY_PLUGIN,
42
- connector: (node) =>
43
- Rx.make((get) =>
44
- pipe(
45
- get(node),
46
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
47
- Option.map((node) => [
48
- {
49
- id: REGISTRY_ID,
50
- type: REGISTRY_PLUGIN,
51
- properties: {
52
- label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],
53
- icon: 'ph--squares-four--regular',
54
- disposition: 'pin-end',
55
- testId: 'treeView.pluginRegistry',
56
- },
57
- nodes: [
58
- {
59
- id: `${REGISTRY_KEY}+all`,
60
- type: 'category',
61
- data: `${REGISTRY_KEY}+all`,
62
- properties: {
63
- label: ['all plugins label', { ns: REGISTRY_PLUGIN }],
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: ['installed plugins label', { ns: REGISTRY_PLUGIN }],
75
- icon: 'ph--check--regular',
76
- key: REGISTRY_KEY,
77
- testId: 'pluginRegistry.installed',
78
- },
79
- },
80
- {
81
- id: `${REGISTRY_KEY}+recommended`,
82
- type: 'category',
83
- data: `${REGISTRY_KEY}+recommended`,
84
- properties: {
85
- label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],
86
- icon: 'ph--star--regular',
87
- key: REGISTRY_KEY,
88
- testId: 'pluginRegistry.recommended',
89
- },
90
- },
91
- {
92
- id: `${REGISTRY_KEY}+labs`,
93
- type: 'category',
94
- data: `${REGISTRY_KEY}+labs`,
95
- properties: {
96
- label: ['labs plugins label', { ns: REGISTRY_PLUGIN }],
97
- icon: 'ph--flask--regular',
98
- key: REGISTRY_KEY,
99
- testId: 'pluginRegistry.labs',
100
- },
101
- },
102
- ],
103
- },
104
- ]),
105
- Option.getOrElse(() => []),
106
- ),
107
- ),
108
- }),
109
- createExtension({
110
- id: `${REGISTRY_PLUGIN}/actions`,
111
- actions: (node) =>
112
- Rx.make((get) =>
113
- pipe(
114
- get(node),
115
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
116
- Option.map(() => [
117
- {
118
- id: `${REGISTRY_PLUGIN}/load-by-url`,
119
- data: async () => {},
120
- properties: {
121
- label: ['load by url label', { ns: REGISTRY_PLUGIN }],
122
- icon: 'ph--cloud-arrow-down--regular',
123
- disabled: true,
124
- },
125
- },
126
- ]),
127
- Option.getOrElse(() => []),
128
- ),
129
- ),
130
- }),
131
- createExtension({
132
- id: `${REGISTRY_PLUGIN}/plugins`,
133
- connector: (node) =>
134
- Rx.make((get) =>
135
- pipe(
136
- get(node),
137
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
138
- Option.map(() => {
139
- const manager = context.getCapability(Capabilities.PluginManager);
140
- return manager.plugins.map((plugin) => ({
141
- id: plugin.meta.id.replaceAll('/', ':'),
142
- type: 'dxos.org/plugin',
143
- data: plugin,
144
- properties: {
145
- label: plugin.meta.name ?? plugin.meta.id,
146
- icon: plugin.meta.icon ?? 'ph--circle--regular',
147
- disposition: 'hidden',
148
- },
149
- }));
150
- }),
151
- Option.getOrElse(() => []),
152
- ),
153
- ),
154
- }),
155
- ]);
@@ -1,27 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import {
6
- contributes,
7
- SettingsAction,
8
- createResolver,
9
- LayoutAction,
10
- Capabilities,
11
- createIntent,
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,90 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { useCallback, useMemo } from 'react';
6
-
7
- import { Capabilities, contributes, createSurface, Plugin, usePluginManager } from '@dxos/app-framework';
8
- import { StackItem } from '@dxos/react-ui-stack';
9
-
10
- import { PluginDetail, RegistryContainer } from '../components';
11
- import { REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
12
-
13
- export default () =>
14
- contributes(Capabilities.ReactSurface, [
15
- createSurface({
16
- id: `${REGISTRY_PLUGIN}/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: `${REGISTRY_PLUGIN}/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: `${REGISTRY_PLUGIN}/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: `${REGISTRY_PLUGIN}/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: `${REGISTRY_PLUGIN}/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 (
84
- <StackItem.Content>
85
- <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />
86
- </StackItem.Content>
87
- );
88
- },
89
- }),
90
- ]);
@@ -1,108 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { IconBase, type IconWeight, type IconProps } from '@phosphor-icons/react';
8
- import { type Meta } from '@storybook/react-vite';
9
- import React, { forwardRef, type SVGProps, type ReactElement } from 'react';
10
-
11
- import { Icon } from '@dxos/react-ui';
12
- import { getSize, mx } from '@dxos/react-ui-theme';
13
-
14
- /**
15
- * Serializable icon props.
16
- */
17
- type StoryIconProps = {
18
- name: string;
19
- weights: Record<string, SVGProps<SVGPathElement>[]>;
20
- };
21
-
22
- /**
23
- * Create icon from serializable data.
24
- * https://github.com/phosphor-icons/react#custom-icons
25
- * https://github.com/phosphor-icons/core/tree/main/assets
26
- */
27
- const createIcon = ({ name, weights }: StoryIconProps) => {
28
- const CustomIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) => (
29
- <IconBase
30
- ref={ref}
31
- {...props}
32
- weights={
33
- new Map<IconWeight, ReactElement>(
34
- Object.entries(weights).map(
35
- ([key, paths]) =>
36
- [
37
- key,
38
- <>
39
- {paths.map((props, i) => (
40
- <path key={`${key}-${i}`} {...props} />
41
- ))}
42
- </>,
43
- ] as [IconWeight, ReactElement],
44
- ),
45
- )
46
- }
47
- />
48
- ));
49
- CustomIcon.displayName = name;
50
- return CustomIcon;
51
- };
52
-
53
- const DefaultStory = () => {
54
- const CustomIcon = createIcon({
55
- name: 'GithubLogo',
56
- weights: {
57
- // https://github.com/phosphor-icons/core/tree/main/assets
58
- // <path d="M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
59
- // <path d="M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
60
- // <path d="M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
61
- regular: [
62
- {
63
- d: 'M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z',
64
- fill: 'none',
65
- stroke: 'currentColor',
66
- strokeLinecap: 'round',
67
- strokeLinejoin: 'round',
68
- strokeWidth: '16',
69
- },
70
- {
71
- d: 'M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40',
72
- fill: 'none',
73
- stroke: 'currentColor',
74
- strokeLinecap: 'round',
75
- strokeLinejoin: 'round',
76
- strokeWidth: '16',
77
- },
78
- {
79
- d: 'M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144',
80
- fill: 'none',
81
- stroke: 'currentColor',
82
- strokeLinecap: 'round',
83
- strokeLinejoin: 'round',
84
- strokeWidth: '16',
85
- },
86
- ],
87
- },
88
- });
89
-
90
- return (
91
- <div className='flex gap-4 p-8 ring'>
92
- <CustomIcon weight={'regular'} className={mx(getSize(8))} />
93
- <Icon icon='ph--github-logo--regular' classNames={mx(getSize(8))} />
94
- </div>
95
- );
96
- };
97
-
98
- export const Default = {};
99
-
100
- const meta: Meta = {
101
- title: 'plugins/plugin-registry/Icon',
102
- render: DefaultStory,
103
- parameters: {
104
- layout: 'centered',
105
- },
106
- };
107
-
108
- export default meta;
@@ -1,45 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { type StoryObj, type Meta } from '@storybook/react-vite';
8
-
9
- import { faker } from '@dxos/random';
10
- import { withLayout, withTheme } from '@dxos/storybook-utils';
11
-
12
- import { PluginDetail, type PluginDetailProps } from './PluginDetail';
13
- import { translations } from '../translations';
14
-
15
- const meta: Meta<PluginDetailProps> = {
16
- title: 'plugins/plugin-registry/PluginDetail',
17
- component: PluginDetail,
18
- decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
19
- parameters: {
20
- translations,
21
- },
22
- };
23
-
24
- export default meta;
25
-
26
- type Story = StoryObj<PluginDetailProps>;
27
-
28
- export const Default: Story = {
29
- args: {
30
- plugin: {
31
- meta: {
32
- id: 'example.com/plugin/test-plugin',
33
- name: 'Test Plugin',
34
- description: faker.lorem.paragraphs(2),
35
- icon: 'ph--bug--regular',
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,63 +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 { DeprecatedFormContainer } from '@dxos/react-ui-form';
10
-
11
- import { REGISTRY_PLUGIN } from '../meta';
12
-
13
- export type PluginDetailProps = {
14
- plugin: Plugin;
15
- enabled?: boolean;
16
- onEnable?: () => void;
17
- };
18
-
19
- export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {
20
- const { t } = useTranslation(REGISTRY_PLUGIN);
21
- const { id, name, description, homePage, source, screenshots } = plugin.meta;
22
-
23
- return (
24
- <DeprecatedFormContainer classNames='gap-6'>
25
- <div role='none' className='flex justify-between items-center'>
26
- <p>{id}</p>
27
- <Input.Root>
28
- <Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />
29
- </Input.Root>
30
- </div>
31
-
32
- {screenshots && screenshots.length > 0 && (
33
- <div role='none'>
34
- <h1 className='text-lg mb-2'>Preview</h1>
35
- <img src={screenshots[0]} alt={name} className='aspect-video object-fit' />
36
- </div>
37
- )}
38
-
39
- <div role='none'>
40
- <p>{description}</p>
41
- </div>
42
-
43
- <div role='none'>
44
- <h1 className='text-lg mb-2'>Resources</h1>
45
- <div className='flex gap-2'>
46
- {homePage && (
47
- <Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
48
- {t('home page label')}
49
- <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
50
- </Link>
51
- )}
52
-
53
- {source && (
54
- <Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>
55
- {t('source label')}
56
- <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />
57
- </Link>
58
- )}
59
- </div>
60
- </div>
61
- </DeprecatedFormContainer>
62
- );
63
- };