@dxos/plugin-registry 0.8.3 → 0.8.4-main.1068cf700f

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 (123) hide show
  1. package/dist/lib/browser/app-graph-builder-YOD5EGAY.mjs +167 -0
  2. package/dist/lib/browser/app-graph-builder-YOD5EGAY.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 +224 -0
  6. package/dist/lib/browser/cli/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +28 -36
  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-7P3NNVSR.mjs +25 -0
  11. package/dist/lib/browser/operation-resolver-7P3NNVSR.mjs.map +7 -0
  12. package/dist/lib/browser/react-surface-IEGOKKMX.mjs +337 -0
  13. package/dist/lib/browser/react-surface-IEGOKKMX.mjs.map +7 -0
  14. package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.mjs +168 -0
  15. package/dist/lib/node-esm/app-graph-builder-WTIS5KI5.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 +225 -0
  19. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  20. package/dist/lib/node-esm/index.mjs +64 -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-B24QW6IF.mjs +26 -0
  24. package/dist/lib/node-esm/operation-resolver-B24QW6IF.mjs.map +7 -0
  25. package/dist/lib/node-esm/react-surface-SEJBWRMR.mjs +338 -0
  26. package/dist/lib/node-esm/react-surface-SEJBWRMR.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 +30 -5
  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 +31 -8
  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/translations.d.ts +19 -19
  74. package/dist/types/src/translations.d.ts.map +1 -1
  75. package/dist/types/src/types.d.ts +3 -1
  76. package/dist/types/src/types.d.ts.map +1 -1
  77. package/dist/types/tsconfig.tsbuildinfo +1 -1
  78. package/package.json +50 -35
  79. package/src/RegistryPlugin.tsx +11 -26
  80. package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -0
  81. package/src/capabilities/app-graph-builder/index.ts +7 -0
  82. package/src/capabilities/index.ts +3 -5
  83. package/src/capabilities/operation-resolver/index.ts +7 -0
  84. package/src/capabilities/operation-resolver/operation-resolver.ts +24 -0
  85. package/src/capabilities/react-surface/index.ts +7 -0
  86. package/src/capabilities/react-surface/react-surface.tsx +99 -0
  87. package/src/cli/commands/disable.ts +47 -0
  88. package/src/cli/commands/enable.ts +44 -0
  89. package/src/cli/commands/index.ts +14 -0
  90. package/src/cli/commands/list.ts +41 -0
  91. package/src/cli/commands/util.ts +24 -0
  92. package/src/cli/index.ts +6 -0
  93. package/src/cli/plugin.ts +17 -0
  94. package/src/cli/storage.ts +57 -0
  95. package/src/components/PluginDetail.stories.tsx +23 -24
  96. package/src/components/PluginDetail.tsx +61 -43
  97. package/src/components/PluginItem.tsx +55 -54
  98. package/src/components/PluginList.stories.tsx +37 -35
  99. package/src/components/PluginList.tsx +3 -5
  100. package/src/components/RegistryContainer.tsx +53 -51
  101. package/src/meta.ts +8 -5
  102. package/src/translations.ts +6 -4
  103. package/src/types.ts +5 -1
  104. package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs +0 -161
  105. package/dist/lib/browser/app-graph-builder-J5YHAGNI.mjs.map +0 -7
  106. package/dist/lib/browser/chunk-ISC56E5F.mjs +0 -16
  107. package/dist/lib/browser/chunk-ISC56E5F.mjs.map +0 -7
  108. package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs +0 -23
  109. package/dist/lib/browser/intent-resolver-AQJNBUT3.mjs.map +0 -7
  110. package/dist/lib/browser/react-surface-W5RNDLXV.mjs +0 -335
  111. package/dist/lib/browser/react-surface-W5RNDLXV.mjs.map +0 -7
  112. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  113. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  114. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  115. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  116. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  117. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  118. package/dist/types/src/components/Icon.stories.d.ts +0 -6
  119. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  120. package/src/capabilities/app-graph-builder.ts +0 -155
  121. package/src/capabilities/intent-resolver.ts +0 -27
  122. package/src/capabilities/react-surface.tsx +0 -90
  123. package/src/components/Icon.stories.tsx +0 -107
@@ -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 role='article'>
85
- <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />
86
- </StackItem.Content>
87
- );
88
- },
89
- }),
90
- ]);
@@ -1,107 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { IconBase, type IconWeight, GithubLogo, type IconProps } from '@phosphor-icons/react';
8
- import { type Meta } from '@storybook/react';
9
- import React, { forwardRef, type SVGProps, type ReactElement } from 'react';
10
-
11
- import { getSize, mx } from '@dxos/react-ui-theme';
12
-
13
- /**
14
- * Serializable icon props.
15
- */
16
- type StoryIconProps = {
17
- name: string;
18
- weights: Record<string, SVGProps<SVGPathElement>[]>;
19
- };
20
-
21
- /**
22
- * Create icon from serializable data.
23
- * https://github.com/phosphor-icons/react#custom-icons
24
- * https://github.com/phosphor-icons/core/tree/main/assets
25
- */
26
- const createIcon = ({ name, weights }: StoryIconProps) => {
27
- const CustomIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) => (
28
- <IconBase
29
- ref={ref}
30
- {...props}
31
- weights={
32
- new Map<IconWeight, ReactElement>(
33
- Object.entries(weights).map(
34
- ([key, paths]) =>
35
- [
36
- key,
37
- <>
38
- {paths.map((props, i) => (
39
- <path key={`${key}-${i}`} {...props} />
40
- ))}
41
- </>,
42
- ] as [IconWeight, ReactElement],
43
- ),
44
- )
45
- }
46
- />
47
- ));
48
- CustomIcon.displayName = name;
49
- return CustomIcon;
50
- };
51
-
52
- const DefaultStory = () => {
53
- const CustomIcon = createIcon({
54
- name: 'GithubLogo',
55
- weights: {
56
- // https://github.com/phosphor-icons/core/tree/main/assets
57
- // <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"/>
58
- // <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"/>
59
- // <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"/>
60
- regular: [
61
- {
62
- 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',
63
- fill: 'none',
64
- stroke: 'currentColor',
65
- strokeLinecap: 'round',
66
- strokeLinejoin: 'round',
67
- strokeWidth: '16',
68
- },
69
- {
70
- d: 'M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40',
71
- fill: 'none',
72
- stroke: 'currentColor',
73
- strokeLinecap: 'round',
74
- strokeLinejoin: 'round',
75
- strokeWidth: '16',
76
- },
77
- {
78
- d: 'M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144',
79
- fill: 'none',
80
- stroke: 'currentColor',
81
- strokeLinecap: 'round',
82
- strokeLinejoin: 'round',
83
- strokeWidth: '16',
84
- },
85
- ],
86
- },
87
- });
88
-
89
- return (
90
- <div className='flex gap-4 p-8 ring'>
91
- <CustomIcon weight={'regular'} className={mx(getSize(8))} />
92
- <GithubLogo weight={'regular'} className={mx(getSize(8))} />
93
- </div>
94
- );
95
- };
96
-
97
- export const Default = {};
98
-
99
- const meta: Meta = {
100
- title: 'plugins/plugin-registry/Icon',
101
- render: DefaultStory,
102
- parameters: {
103
- layout: 'centered',
104
- },
105
- };
106
-
107
- export default meta;