@dxos/plugin-registry 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a

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 (40) hide show
  1. package/dist/lib/browser/{app-graph-builder-6JQNRTEQ.mjs → app-graph-builder-5BKKIS5T.mjs} +25 -24
  2. package/dist/lib/browser/app-graph-builder-5BKKIS5T.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-AEBASNOI.mjs → chunk-MWZPWWWF.mjs} +2 -4
  4. package/dist/lib/browser/chunk-MWZPWWWF.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +5 -7
  6. package/dist/lib/browser/index.mjs.map +2 -2
  7. package/dist/lib/browser/{intent-resolver-UGDFPMAG.mjs → intent-resolver-RUD6WFGT.mjs} +4 -4
  8. package/dist/lib/browser/{intent-resolver-UGDFPMAG.mjs.map → intent-resolver-RUD6WFGT.mjs.map} +1 -1
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/{react-surface-YATPY47L.mjs → react-surface-FYRVOQGA.mjs} +18 -18
  11. package/dist/lib/browser/react-surface-FYRVOQGA.mjs.map +7 -0
  12. package/dist/types/src/RegistryPlugin.d.ts +1 -1
  13. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  15. package/dist/types/src/components/Icon.stories.d.ts +1 -1
  16. package/dist/types/src/components/Icon.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/PluginDetail.stories.d.ts +0 -1
  18. package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/PluginList.stories.d.ts +0 -1
  20. package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
  21. package/dist/types/src/meta.d.ts +0 -1
  22. package/dist/types/src/meta.d.ts.map +1 -1
  23. package/dist/types/src/types.d.ts +1 -1
  24. package/dist/types/src/types.d.ts.map +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +27 -28
  27. package/src/RegistryPlugin.tsx +22 -23
  28. package/src/capabilities/app-graph-builder.ts +21 -20
  29. package/src/capabilities/react-surface.tsx +6 -6
  30. package/src/components/Icon.stories.tsx +2 -2
  31. package/src/components/PluginDetail.stories.tsx +2 -4
  32. package/src/components/PluginDetail.tsx +3 -3
  33. package/src/components/PluginItem.tsx +2 -2
  34. package/src/components/PluginList.stories.tsx +16 -19
  35. package/src/components/RegistryContainer.tsx +1 -1
  36. package/src/meta.ts +1 -3
  37. package/src/types.ts +1 -1
  38. package/dist/lib/browser/app-graph-builder-6JQNRTEQ.mjs.map +0 -7
  39. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  40. package/dist/lib/browser/react-surface-YATPY47L.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-registry",
3
- "version": "0.8.4-main.dedc0f3",
3
+ "version": "0.8.4-main.ead640a",
4
4
  "description": "Braneframe plugin gallery",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -25,40 +25,39 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@preact-signals/safe-react": "^0.9.0",
28
- "@dxos/app-framework": "0.8.4-main.dedc0f3",
29
- "@dxos/echo": "0.8.4-main.dedc0f3",
30
- "@dxos/echo-schema": "0.8.4-main.dedc0f3",
31
- "@dxos/live-object": "0.8.4-main.dedc0f3",
32
- "@dxos/plugin-observability": "0.8.4-main.dedc0f3",
33
- "@dxos/plugin-graph": "0.8.4-main.dedc0f3",
34
- "@dxos/invariant": "0.8.4-main.dedc0f3",
35
- "@dxos/react-ui-form": "0.8.4-main.dedc0f3",
36
- "@dxos/react-ui-stack": "0.8.4-main.dedc0f3",
37
- "@dxos/util": "0.8.4-main.dedc0f3"
28
+ "@dxos/app-framework": "0.8.4-main.ead640a",
29
+ "@dxos/echo": "0.8.4-main.ead640a",
30
+ "@dxos/live-object": "0.8.4-main.ead640a",
31
+ "@dxos/plugin-graph": "0.8.4-main.ead640a",
32
+ "@dxos/invariant": "0.8.4-main.ead640a",
33
+ "@dxos/plugin-observability": "0.8.4-main.ead640a",
34
+ "@dxos/react-ui-form": "0.8.4-main.ead640a",
35
+ "@dxos/react-ui-stack": "0.8.4-main.ead640a",
36
+ "@dxos/util": "0.8.4-main.ead640a"
38
37
  },
39
38
  "devDependencies": {
40
- "@effect-rx/rx-react": "0.38.0",
41
- "@effect/platform": "0.90.2",
42
- "@phosphor-icons/react": "^2.1.5",
43
- "@types/react": "~18.2.0",
44
- "@types/react-dom": "~18.2.0",
45
- "effect": "3.17.7",
46
- "react": "~18.2.0",
47
- "react-dom": "~18.2.0",
48
- "vite": "7.1.1",
49
- "@dxos/random": "0.8.4-main.dedc0f3",
50
- "@dxos/react-ui": "0.8.4-main.dedc0f3",
51
- "@dxos/storybook-utils": "0.8.4-main.dedc0f3",
52
- "@dxos/react-ui-theme": "0.8.4-main.dedc0f3"
39
+ "@effect-rx/rx-react": "0.42.4",
40
+ "@effect/platform": "0.92.1",
41
+ "@phosphor-icons/react": "^2.1.10",
42
+ "@types/react": "~19.2.2",
43
+ "@types/react-dom": "~19.2.1",
44
+ "effect": "3.18.3",
45
+ "react": "~19.2.0",
46
+ "react-dom": "~19.2.0",
47
+ "vite": "7.1.9",
48
+ "@dxos/random": "0.8.4-main.ead640a",
49
+ "@dxos/react-ui": "0.8.4-main.ead640a",
50
+ "@dxos/react-ui-theme": "0.8.4-main.ead640a",
51
+ "@dxos/storybook-utils": "0.8.4-main.ead640a"
53
52
  },
54
53
  "peerDependencies": {
55
54
  "@effect-rx/rx-react": "^0.34.1",
56
55
  "@effect/platform": "^0.80.12",
57
56
  "effect": "^3.13.3",
58
- "react": "~18.2.0",
59
- "react-dom": "~18.2.0",
60
- "@dxos/react-ui": "0.8.4-main.dedc0f3",
61
- "@dxos/react-ui-theme": "0.8.4-main.dedc0f3"
57
+ "react": "^19.0.0",
58
+ "react-dom": "^19.0.0",
59
+ "@dxos/react-ui": "0.8.4-main.ead640a",
60
+ "@dxos/react-ui-theme": "0.8.4-main.ead640a"
62
61
  },
63
62
  "publishConfig": {
64
63
  "access": "public"
@@ -8,26 +8,25 @@ import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
8
8
  import { meta } from './meta';
9
9
  import { translations } from './translations';
10
10
 
11
- export const RegistryPlugin = () =>
12
- definePlugin(meta, [
13
- defineModule({
14
- id: `${meta.id}/module/translations`,
15
- activatesOn: Events.SetupTranslations,
16
- activate: () => contributes(Capabilities.Translations, translations),
17
- }),
18
- defineModule({
19
- id: `${meta.id}/module/react-surface`,
20
- activatesOn: Events.SetupReactSurface,
21
- activate: ReactSurface,
22
- }),
23
- defineModule({
24
- id: `${meta.id}/module/intent-resolver`,
25
- activatesOn: Events.SetupIntentResolver,
26
- activate: IntentResolver,
27
- }),
28
- defineModule({
29
- id: `${meta.id}/module/app-graph-builder`,
30
- activatesOn: Events.SetupAppGraph,
31
- activate: AppGraphBuilder,
32
- }),
33
- ]);
11
+ export const RegistryPlugin = definePlugin(meta, () => [
12
+ defineModule({
13
+ id: `${meta.id}/module/translations`,
14
+ activatesOn: Events.SetupTranslations,
15
+ activate: () => contributes(Capabilities.Translations, translations),
16
+ }),
17
+ defineModule({
18
+ id: `${meta.id}/module/react-surface`,
19
+ activatesOn: Events.SetupReactSurface,
20
+ activate: ReactSurface,
21
+ }),
22
+ defineModule({
23
+ id: `${meta.id}/module/intent-resolver`,
24
+ activatesOn: Events.SetupIntentResolver,
25
+ activate: IntentResolver,
26
+ }),
27
+ defineModule({
28
+ id: `${meta.id}/module/app-graph-builder`,
29
+ activatesOn: Events.SetupAppGraph,
30
+ activate: AppGraphBuilder,
31
+ }),
32
+ ]);
@@ -3,31 +3,32 @@
3
3
  //
4
4
 
5
5
  import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
7
8
 
8
9
  import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
9
10
  import { createExtension } from '@dxos/plugin-graph';
10
11
 
11
- import { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
12
+ import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
12
13
 
13
14
  export default (context: PluginContext) =>
14
15
  contributes(Capabilities.AppGraphBuilder, [
15
16
  createExtension({
16
- id: REGISTRY_PLUGIN,
17
+ id: meta.id,
17
18
  actions: (node) =>
18
19
  Rx.make((get) =>
19
- pipe(
20
+ Function.pipe(
20
21
  get(node),
21
22
  Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
22
23
  Option.map((node) => [
23
24
  {
24
- id: REGISTRY_PLUGIN,
25
+ id: meta.id,
25
26
  data: async () => {
26
27
  const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
27
28
  await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
28
29
  },
29
30
  properties: {
30
- label: ['open plugin registry label', { ns: REGISTRY_PLUGIN }],
31
+ label: ['open plugin registry label', { ns: meta.id }],
31
32
  icon: 'ph--squares-four--regular',
32
33
  disposition: 'menu',
33
34
  },
@@ -38,18 +39,18 @@ export default (context: PluginContext) =>
38
39
  ),
39
40
  }),
40
41
  createExtension({
41
- id: REGISTRY_PLUGIN,
42
+ id: meta.id,
42
43
  connector: (node) =>
43
44
  Rx.make((get) =>
44
- pipe(
45
+ Function.pipe(
45
46
  get(node),
46
47
  Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
47
48
  Option.map((node) => [
48
49
  {
49
50
  id: REGISTRY_ID,
50
- type: REGISTRY_PLUGIN,
51
+ type: meta.id,
51
52
  properties: {
52
- label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],
53
+ label: ['plugin registry label', { ns: meta.id }],
53
54
  icon: 'ph--squares-four--regular',
54
55
  disposition: 'pin-end',
55
56
  testId: 'treeView.pluginRegistry',
@@ -60,7 +61,7 @@ export default (context: PluginContext) =>
60
61
  type: 'category',
61
62
  data: `${REGISTRY_KEY}+all`,
62
63
  properties: {
63
- label: ['all plugins label', { ns: REGISTRY_PLUGIN }],
64
+ label: ['all plugins label', { ns: meta.id }],
64
65
  icon: 'ph--squares-four--regular',
65
66
  key: REGISTRY_KEY,
66
67
  testId: 'pluginRegistry.all',
@@ -71,7 +72,7 @@ export default (context: PluginContext) =>
71
72
  type: 'category',
72
73
  data: `${REGISTRY_KEY}+installed`,
73
74
  properties: {
74
- label: ['installed plugins label', { ns: REGISTRY_PLUGIN }],
75
+ label: ['installed plugins label', { ns: meta.id }],
75
76
  icon: 'ph--check--regular',
76
77
  key: REGISTRY_KEY,
77
78
  testId: 'pluginRegistry.installed',
@@ -82,7 +83,7 @@ export default (context: PluginContext) =>
82
83
  type: 'category',
83
84
  data: `${REGISTRY_KEY}+recommended`,
84
85
  properties: {
85
- label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],
86
+ label: ['recommended plugins label', { ns: meta.id }],
86
87
  icon: 'ph--star--regular',
87
88
  key: REGISTRY_KEY,
88
89
  testId: 'pluginRegistry.recommended',
@@ -93,7 +94,7 @@ export default (context: PluginContext) =>
93
94
  type: 'category',
94
95
  data: `${REGISTRY_KEY}+labs`,
95
96
  properties: {
96
- label: ['labs plugins label', { ns: REGISTRY_PLUGIN }],
97
+ label: ['labs plugins label', { ns: meta.id }],
97
98
  icon: 'ph--flask--regular',
98
99
  key: REGISTRY_KEY,
99
100
  testId: 'pluginRegistry.labs',
@@ -107,18 +108,18 @@ export default (context: PluginContext) =>
107
108
  ),
108
109
  }),
109
110
  createExtension({
110
- id: `${REGISTRY_PLUGIN}/actions`,
111
+ id: `${meta.id}/actions`,
111
112
  actions: (node) =>
112
113
  Rx.make((get) =>
113
- pipe(
114
+ Function.pipe(
114
115
  get(node),
115
116
  Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
116
117
  Option.map(() => [
117
118
  {
118
- id: `${REGISTRY_PLUGIN}/load-by-url`,
119
+ id: `${meta.id}/load-by-url`,
119
120
  data: async () => {},
120
121
  properties: {
121
- label: ['load by url label', { ns: REGISTRY_PLUGIN }],
122
+ label: ['load by url label', { ns: meta.id }],
122
123
  icon: 'ph--cloud-arrow-down--regular',
123
124
  disabled: true,
124
125
  },
@@ -129,10 +130,10 @@ export default (context: PluginContext) =>
129
130
  ),
130
131
  }),
131
132
  createExtension({
132
- id: `${REGISTRY_PLUGIN}/plugins`,
133
+ id: `${meta.id}/plugins`,
133
134
  connector: (node) =>
134
135
  Rx.make((get) =>
135
- pipe(
136
+ Function.pipe(
136
137
  get(node),
137
138
  Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
138
139
  Option.map(() => {
@@ -7,12 +7,12 @@ import React, { useCallback, useMemo } from 'react';
7
7
  import { Capabilities, Plugin, contributes, createSurface, usePluginManager } from '@dxos/app-framework';
8
8
 
9
9
  import { PluginDetail, RegistryContainer } from '../components';
10
- import { REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
10
+ import { REGISTRY_KEY, meta } from '../meta';
11
11
 
12
12
  export default () =>
13
13
  contributes(Capabilities.ReactSurface, [
14
14
  createSurface({
15
- id: `${REGISTRY_PLUGIN}/all`,
15
+ id: `${meta.id}/all`,
16
16
  role: 'article',
17
17
  filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,
18
18
  component: () => {
@@ -23,7 +23,7 @@ export default () =>
23
23
  },
24
24
  }),
25
25
  createSurface({
26
- id: `${REGISTRY_PLUGIN}/installed`,
26
+ id: `${meta.id}/installed`,
27
27
  role: 'article',
28
28
  filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,
29
29
  component: () => {
@@ -40,7 +40,7 @@ export default () =>
40
40
  },
41
41
  }),
42
42
  createSurface({
43
- id: `${REGISTRY_PLUGIN}/recommended`,
43
+ id: `${meta.id}/recommended`,
44
44
  role: 'article',
45
45
  filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,
46
46
  component: () => {
@@ -57,7 +57,7 @@ export default () =>
57
57
  },
58
58
  }),
59
59
  createSurface({
60
- id: `${REGISTRY_PLUGIN}/labs`,
60
+ id: `${meta.id}/labs`,
61
61
  role: 'article',
62
62
  filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,
63
63
  component: () => {
@@ -68,7 +68,7 @@ export default () =>
68
68
  },
69
69
  }),
70
70
  createSurface({
71
- id: `${REGISTRY_PLUGIN}/plugin-details`,
71
+ id: `${meta.id}/plugin-details`,
72
72
  role: 'article',
73
73
  filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,
74
74
  component: ({ data: { subject } }) => {
@@ -2,13 +2,12 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
8
6
  import { type Meta, type StoryObj } from '@storybook/react-vite';
9
7
  import React, { type ReactElement, type SVGProps, forwardRef } from 'react';
10
8
 
11
9
  import { Icon } from '@dxos/react-ui';
10
+ import { withTheme } from '@dxos/react-ui/testing';
12
11
  import { getSize, mx } from '@dxos/react-ui-theme';
13
12
 
14
13
  /**
@@ -100,6 +99,7 @@ export const Default: Story = {};
100
99
  const meta = {
101
100
  title: 'plugins/plugin-registry/Icon',
102
101
  render: DefaultStory,
102
+ decorators: [withTheme],
103
103
  parameters: {
104
104
  layout: 'centered',
105
105
  },
@@ -2,12 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
 
9
7
  import { faker } from '@dxos/random';
10
- import { withLayout, withTheme } from '@dxos/storybook-utils';
8
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
9
 
12
10
  import { translations } from '../translations';
13
11
 
@@ -16,7 +14,7 @@ import { PluginDetail } from './PluginDetail';
16
14
  const meta = {
17
15
  title: 'plugins/plugin-registry/PluginDetail',
18
16
  component: PluginDetail,
19
- decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
17
+ decorators: [withTheme, withLayout({ container: 'column' })],
20
18
  parameters: {
21
19
  translations,
22
20
  },
@@ -8,7 +8,7 @@ import { type Plugin } from '@dxos/app-framework';
8
8
  import { Icon, Input, Link, useTranslation } from '@dxos/react-ui';
9
9
  import { StackItem } from '@dxos/react-ui-stack';
10
10
 
11
- import { REGISTRY_PLUGIN } from '../meta';
11
+ import { meta } from '../meta';
12
12
 
13
13
  export type PluginDetailProps = {
14
14
  plugin: Plugin;
@@ -17,11 +17,11 @@ export type PluginDetailProps = {
17
17
  };
18
18
 
19
19
  export const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {
20
- const { t } = useTranslation(REGISTRY_PLUGIN);
20
+ const { t } = useTranslation(meta.id);
21
21
  const { id, name, description, homePage, source, screenshots } = plugin.meta;
22
22
 
23
23
  return (
24
- <StackItem.Content classNames='block overflow-y-auto'>
24
+ <StackItem.Content scrollable>
25
25
  <div role='none' className='container-max-width p-4'>
26
26
  <div role='none' className='flex justify-between items-center'>
27
27
  <p>{id}</p>
@@ -8,7 +8,7 @@ import { type Plugin } from '@dxos/app-framework';
8
8
  import { Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';
9
9
  import { descriptionText, mx } from '@dxos/react-ui-theme';
10
10
 
11
- import { REGISTRY_PLUGIN } from '../meta';
11
+ import { meta } from '../meta';
12
12
 
13
13
  export type PluginItemProps = {
14
14
  plugin: Plugin;
@@ -28,7 +28,7 @@ export const PluginItem = ({
28
28
  hasSettings: _hasSettings,
29
29
  onSettings,
30
30
  }: PluginItemProps) => {
31
- const { t } = useTranslation(REGISTRY_PLUGIN);
31
+ const { t } = useTranslation(meta.id);
32
32
  const { id, name, description, tags, icon = 'ph--circle--regular' } = plugin.meta;
33
33
  const isEnabled = enabled.includes(id);
34
34
  const inputId = `${id}-input`;
@@ -2,16 +2,14 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useState } from 'react';
9
7
 
10
8
  import { type Plugin, definePlugin } from '@dxos/app-framework';
11
9
  import { faker } from '@dxos/random';
12
10
  import { type ThemedClassName } from '@dxos/react-ui';
11
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
13
12
  import { mx } from '@dxos/react-ui-theme';
14
- import { withLayout, withTheme } from '@dxos/storybook-utils';
15
13
 
16
14
  import { translations } from '../translations';
17
15
 
@@ -31,21 +29,20 @@ const icons = [
31
29
  const DefaultStory = ({ classNames }: ThemedClassName<{}>) => {
32
30
  const [plugins] = useState<Plugin[]>(
33
31
  faker.helpers.multiple(
34
- () =>
35
- definePlugin(
36
- {
37
- id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
38
- name: `${faker.commerce.productName()}`,
39
- description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
40
- tags: faker.datatype.boolean({ probability: 0.6 })
41
- ? [faker.helpers.arrayElement(['labs', 'beta', 'alpha', 'stable', 'new', '新発売'])]
42
- : undefined,
43
- icon: faker.helpers.arrayElement(icons),
44
- homePage: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.url() : undefined,
45
- source: faker.internet.url(),
46
- },
47
- [],
48
- ),
32
+ definePlugin(
33
+ {
34
+ id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
35
+ name: `${faker.commerce.productName()}`,
36
+ description: faker.lorem.sentences(Math.ceil(Math.random() * 3)),
37
+ tags: faker.datatype.boolean({ probability: 0.6 })
38
+ ? [faker.helpers.arrayElement(['labs', 'beta', 'alpha', 'stable', 'new', '新発売'])]
39
+ : undefined,
40
+ icon: faker.helpers.arrayElement(icons),
41
+ homePage: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.url() : undefined,
42
+ source: faker.internet.url(),
43
+ },
44
+ () => [],
45
+ ),
49
46
  { count: 16 },
50
47
  ),
51
48
  );
@@ -66,7 +63,7 @@ const meta = {
66
63
  title: 'plugins/plugin-registry/PluginList',
67
64
  component: PluginList,
68
65
  render: DefaultStory,
69
- decorators: [withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
66
+ decorators: [withTheme, withLayout({ container: 'column' })],
70
67
  parameters: {
71
68
  translations,
72
69
  },
@@ -70,7 +70,7 @@ export const RegistryContainer = ({ id, plugins: _plugins }: { id: string; plugi
70
70
  );
71
71
 
72
72
  return (
73
- <StackItem.Content classNames='min-bs-0 overflow-y-auto scrollbar-thin contain-layout'>
73
+ <StackItem.Content scrollable>
74
74
  <PluginList
75
75
  plugins={plugins}
76
76
  enabled={manager.enabled}
package/src/meta.ts CHANGED
@@ -4,8 +4,6 @@
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
6
 
7
- export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
8
-
9
7
  // TODO(wittjosiah): Deck does not currently support `/` in ids.
10
8
  // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
11
9
  // Ideally this should be worked into the data model in a generic way.
@@ -13,6 +11,6 @@ export const REGISTRY_ID = '!dxos:plugin-registry';
13
11
  export const REGISTRY_KEY = 'plugin-registry';
14
12
 
15
13
  export const meta: PluginMeta = {
16
- id: REGISTRY_PLUGIN,
14
+ id: 'dxos.org/plugin/registry',
17
15
  name: 'Plugins',
18
16
  };
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({
@@ -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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C,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAO4B,cAAcpB,OAAOE,KAAKP,KAAAA,IAAQK,OAAOG,KAAI,CAAA,GACnFH,OAAOI,IAAI,MAAA;AACT,YAAMuB,UAAUxC,QAAQqB,cAAcnB,aAAauC,aAAa;AAChE,aAAOD,QAAQE,QAAQzB,IAAI,CAAC0B,YAAY;QACtCtC,IAAIsC,OAAOC,KAAKvC,GAAGwC,WAAW,KAAK,GAAA;QACnCX,MAAM;QACNhB,MAAMyB;QACNjB,YAAY;UACVC,OAAOgB,OAAOC,KAAKE,QAAQH,OAAOC,KAAKvC;UACvCwB,MAAMc,OAAOC,KAAKf,QAAQ;UAC1BC,aAAa;QACf;MACF,EAAA;IACF,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,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,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/PluginDetail.tsx", "../../../src/components/PluginList.tsx", "../../../src/components/PluginItem.tsx", "../../../src/components/RegistryContainer.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Capabilities, Plugin, contributes, createSurface, usePluginManager } from '@dxos/app-framework';\n\nimport { PluginDetail, RegistryContainer } from '../components';\nimport { REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${REGISTRY_PLUGIN}/all`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}+all`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);\n\n return <RegistryContainer id={`${REGISTRY_KEY}+all`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/installed`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}+installed`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(\n () =>\n manager.plugins\n .filter(({ meta }) => !manager.core.includes(meta.id))\n .filter(({ meta }) => manager.enabled.includes(meta.id)),\n [],\n );\n\n return <RegistryContainer id={`${REGISTRY_KEY}+installed`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/recommended`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}+recommended`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(\n () =>\n manager.plugins\n .filter(({ meta }) => !manager.core.includes(meta.id))\n .filter(({ meta }) => !meta.tags?.includes('labs')),\n [],\n );\n\n return <RegistryContainer id={`${REGISTRY_KEY}+recommended`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/labs`,\n role: 'article',\n filter: (data): data is any => data.subject === `${REGISTRY_KEY}+labs`,\n component: () => {\n const manager = usePluginManager();\n const filtered = useMemo(() => manager.plugins.filter(({ meta }) => meta.tags?.includes('labs')), []);\n\n return <RegistryContainer id={`${REGISTRY_KEY}+labs`} plugins={filtered} />;\n },\n }),\n createSurface({\n id: `${REGISTRY_PLUGIN}/plugin-details`,\n role: 'article',\n filter: (data): data is { subject: Plugin } => data.subject instanceof Plugin,\n component: ({ data: { subject } }) => {\n const manager = usePluginManager();\n const enabled = manager.enabled.includes(subject.meta.id);\n const handleEnable = useCallback(\n () => (enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id)),\n [manager, subject.meta.id, enabled],\n );\n\n return <PluginDetail plugin={subject} enabled={enabled} onEnable={handleEnable} />;\n },\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { Icon, Input, Link, useTranslation } from '@dxos/react-ui';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport type PluginDetailProps = {\n plugin: Plugin;\n enabled?: boolean;\n onEnable?: () => void;\n};\n\nexport const PluginDetail = ({ plugin, enabled, onEnable }: PluginDetailProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { id, name, description, homePage, source, screenshots } = plugin.meta;\n\n return (\n <StackItem.Content classNames='block overflow-y-auto'>\n <div role='none' className='container-max-width p-4'>\n <div role='none' className='flex justify-between items-center'>\n <p>{id}</p>\n <Input.Root>\n <Input.Switch classNames='self-center' checked={enabled} onClick={onEnable} />\n </Input.Root>\n </div>\n\n {screenshots && screenshots.length > 0 && (\n <div role='none'>\n <h1 className='text-lg mb-2'>Preview</h1>\n <img src={screenshots[0]} alt={name} className='aspect-video object-fit' />\n </div>\n )}\n\n <div role='none'>\n <p>{description}</p>\n </div>\n\n <div role='none'>\n <h1 className='text-lg mb-2'>Resources</h1>\n <div className='flex gap-2'>\n {homePage && (\n <Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('home page label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n\n {source && (\n <Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('source label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mli-1' />\n </Link>\n )}\n </div>\n </div>\n </div>\n </StackItem.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { List } from '@dxos/react-ui';\n\nimport { PluginItem, type PluginItemProps } from './PluginItem';\n\nexport type PluginListProps = Omit<PluginItemProps, 'plugin'> & {\n plugins?: readonly Plugin[];\n};\n\nexport const PluginList = ({ plugins = [], ...props }: PluginListProps) => {\n return (\n <List classNames='grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] auto-rows-[12rem] gap-3 p-3'>\n {plugins.map((plugin) => (\n <div key={plugin.meta.id} className='flex'>\n <PluginItem plugin={plugin} {...props} />\n </div>\n ))}\n </List>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type MouseEvent, useCallback } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';\nimport { descriptionText, mx } from '@dxos/react-ui-theme';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport type PluginItemProps = {\n plugin: Plugin;\n installed?: readonly string[];\n enabled?: readonly string[];\n onClick?: (id: string) => void;\n onChange?: (id: string, enabled: boolean) => void;\n hasSettings?: (id: string) => boolean;\n onSettings?: (id: string) => void;\n};\n\nexport const PluginItem = ({\n plugin,\n enabled = [],\n onClick,\n onChange,\n hasSettings: _hasSettings,\n onSettings,\n}: PluginItemProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { id, name, description, tags, icon = 'ph--circle--regular' } = plugin.meta;\n const isEnabled = enabled.includes(id);\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n const handleClick = useCallback(() => onClick?.(id), [id, onClick]);\n\n const handleChange = useCallback(\n (event: MouseEvent) => {\n event.stopPropagation();\n onChange?.(id, !isEnabled);\n },\n [id, isEnabled, onChange],\n );\n\n const hasSettings = _hasSettings?.(id) ?? false;\n const handleSettings = useCallback(() => onSettings?.(id), [id, onSettings]);\n\n return (\n <ListItem.Root\n key={id}\n labelId={labelId}\n data-testid={`pluginList.${id}`}\n aria-describedby={descriptionId}\n // TODO(burdon): Use Rail vars.\n classNames='is-full bs-full grid grid-cols-[48px_1fr_48px] grid-rows-[40px_1fr_32px] p-1 border border-separator rounded-md'\n >\n {/* Header. */}\n <div className='flex flex-col grow justify-center items-center'>\n <Icon icon={icon} size={6} onClick={handleClick} classNames='text-subdued cursor-pointer' />\n </div>\n <div className='flex items-center overflow-hidden cursor-pointer' onClick={handleClick}>\n <span className='truncate'>{name ?? id}</span>\n </div>\n <div className='flex justify-center items-center'>\n <Input.Root id={inputId}>\n <Input.Switch classNames='self-center' checked={isEnabled} onClick={handleChange} />\n </Input.Root>\n </div>\n\n {/* Body. */}\n <div />\n {(description || tags) && (\n <div id={descriptionId} className='col-span-2 flex flex-col w-full justify-between gap-2 pb-2'>\n <div className='grow'>\n <p className={mx(descriptionText, 'line-clamp-3 min-w-0 pie-2')}>{description}</p>\n </div>\n {tags && tags.length > 0 && (\n <div>\n {tags.map((tag) => (\n <Tag key={tag} palette={'indigo'} classNames='text-xs capitalize'>\n {tag}\n </Tag>\n ))}\n </div>\n )}\n </div>\n )}\n\n {/* Footer. */}\n <div />\n <div className='flex gap-2 items-center pie-1'>\n <Link\n aria-describedby={descriptionId}\n classNames='text-sm text-description cursor-pointer'\n onClick={handleClick}\n >\n {t('details label')}\n </Link>\n\n <div className='flex-1' />\n </div>\n <div className='flex justify-center items-center'>\n {hasSettings && (\n <IconButton\n aria-describedby={descriptionId}\n classNames='text-sm text-description cursor-pointer'\n icon='ph--gear--regular'\n label={t('settings label')}\n iconOnly\n size={4}\n onClick={handleSettings}\n />\n )}\n </div>\n </ListItem.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport {\n Capabilities,\n LayoutAction,\n type Plugin,\n SettingsAction,\n createIntent,\n useCapability,\n useIntentDispatcher,\n usePluginManager,\n} from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { PluginList } from './PluginList';\n\nconst sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin, { meta: { name: b = '' } }: Plugin) => a.localeCompare(b);\n\nexport const RegistryContainer = ({ id, plugins: _plugins }: { id: string; plugins: Plugin[] }) => {\n const manager = usePluginManager();\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [_plugins]);\n const settingsStore = useCapability(Capabilities.SettingsStore);\n\n // TODO(wittjosiah): Factor out to an intent?\n const handleChange = useCallback(\n async (id: string, enabled: boolean) => {\n if (enabled) {\n await manager.enable(id);\n } else {\n await manager.disable(id);\n }\n\n await dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'plugins.toggle',\n properties: {\n plugin: id,\n enabled,\n },\n }),\n );\n },\n [dispatch, manager],\n );\n\n const handleClick = useCallback(\n (pluginId: string) =>\n dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n // TODO(wittjosiah): `/` currently is not supported in ids.\n subject: [pluginId.replaceAll('/', ':')],\n options: { pivotId: id, positioning: 'end' },\n }),\n ),\n [dispatch, id],\n );\n\n const hasSettings = useCallback((pluginId: string) => !!settingsStore.getStore(pluginId), [settingsStore]);\n\n const handleSettings = useCallback(\n (pluginId: string) => dispatch(createIntent(SettingsAction.Open, { plugin: pluginId })),\n [dispatch],\n );\n\n return (\n <StackItem.Content classNames='min-bs-0 overflow-y-auto scrollbar-thin contain-layout'>\n <PluginList\n plugins={plugins}\n enabled={manager.enabled}\n onClick={handleClick}\n onChange={handleChange}\n hasSettings={hasSettings}\n onSettings={handleSettings}\n />\n </StackItem.Content>\n );\n};\n"],
5
- "mappings": ";;;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,gBAAAA,eAAcC,QAAQC,aAAaC,eAAeC,oBAAAA,yBAAwB;;;;ACFnF,OAAOC,WAAW;AAGlB,SAASC,MAAMC,OAAOC,MAAMC,sBAAsB;AAClD,SAASC,iBAAiB;AAUnB,IAAMC,eAAe,CAAC,EAAEC,QAAQC,SAASC,SAAQ,MAAqB;;;AAC3E,UAAM,EAAEC,EAAC,IAAKC,eAAeC,eAAAA;AAC7B,UAAM,EAAEC,IAAIC,MAAMC,aAAaC,UAAUC,QAAQC,YAAW,IAAKX,OAAOY;AAExE,WACE,sBAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,sBAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,sBAAA,cAACF,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,sBAAA,cAACC,KAAAA,MAAGb,EAAAA,GACJ,sBAAA,cAACc,MAAMC,MAAI,MACT,sBAAA,cAACD,MAAME,QAAM;MAACP,YAAW;MAAcQ,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emo", "Capabilities", "Plugin", "contributes", "createSurface", "usePluginManager", "React", "Icon", "Input", "Link", "useTranslation", "StackItem", "PluginDetail", "plugin", "enabled", "onEnable", "t", "useTranslation", "REGISTRY_PLUGIN", "id", "name", "description", "homePage", "source", "screenshots", "meta", "StackItem", "Content", "classNames", "div", "role", "className", "p", "Input", "Root", "Switch", "checked", "onClick", "length", "h1", "img", "src", "alt", "Link", "href", "target", "rel", "Icon", "icon", "size", "React", "List", "React", "useCallback", "Icon", "IconButton", "Input", "Link", "ListItem", "Tag", "useTranslation", "descriptionText", "mx", "PluginItem", "plugin", "enabled", "onClick", "onChange", "hasSettings", "_hasSettings", "onSettings", "t", "useTranslation", "REGISTRY_PLUGIN", "id", "name", "description", "tags", "icon", "meta", "isEnabled", "includes", "inputId", "labelId", "descriptionId", "handleClick", "useCallback", "handleChange", "event", "stopPropagation", "handleSettings", "React", "ListItem", "Root", "key", "data-testid", "aria-describedby", "classNames", "div", "className", "Icon", "size", "span", "Input", "Switch", "checked", "p", "mx", "descriptionText", "length", "map", "tag", "Tag", "palette", "Link", "IconButton", "label", "iconOnly", "PluginList", "plugins", "props", "React", "List", "classNames", "map", "plugin", "div", "key", "meta", "id", "className", "PluginItem", "React", "useCallback", "useMemo", "Capabilities", "LayoutAction", "SettingsAction", "createIntent", "useCapability", "useIntentDispatcher", "usePluginManager", "ObservabilityAction", "StackItem", "sortByPluginMeta", "meta", "name", "a", "b", "localeCompare", "RegistryContainer", "id", "plugins", "_plugins", "manager", "usePluginManager", "dispatchPromise", "dispatch", "useIntentDispatcher", "useMemo", "sort", "settingsStore", "useCapability", "Capabilities", "SettingsStore", "handleChange", "useCallback", "enabled", "enable", "disable", "createIntent", "ObservabilityAction", "SendEvent", "properties", "plugin", "handleClick", "pluginId", "LayoutAction", "Open", "part", "subject", "replaceAll", "options", "pivotId", "positioning", "hasSettings", "getStore", "handleSettings", "SettingsAction", "React", "StackItem", "Content", "classNames", "PluginList", "onClick", "onChange", "onSettings", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "REGISTRY_PLUGIN", "role", "filter", "data", "subject", "REGISTRY_KEY", "component", "manager", "usePluginManager", "filtered", "useMemo", "plugins", "meta", "core", "includes", "React", "RegistryContainer", "enabled", "tags", "Plugin", "handleEnable", "useCallback", "disable", "enable", "PluginDetail", "plugin", "onEnable"]
7
- }