@dxos/plugin-registry 0.6.13 → 0.6.14-main.2b6a0f3

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.
@@ -9,4 +9,4 @@ export {
9
9
  REGISTRY_PLUGIN,
10
10
  meta_default
11
11
  };
12
- //# sourceMappingURL=chunk-2FC6QNHB.mjs.map
12
+ //# sourceMappingURL=chunk-NEMFDAOB.mjs.map
@@ -0,0 +1,7 @@
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\nexport default {\n id: REGISTRY_PLUGIN,\n name: 'Plugins',\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";AAMO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;",
6
+ "names": ["REGISTRY_PLUGIN", "id", "name"]
7
+ }
@@ -1,31 +1,21 @@
1
1
  import {
2
2
  REGISTRY_PLUGIN,
3
3
  meta_default
4
- } from "./chunk-2FC6QNHB.mjs";
4
+ } from "./chunk-NEMFDAOB.mjs";
5
5
 
6
6
  // packages/plugins/plugin-registry/src/RegistryPlugin.tsx
7
7
  import React3 from "react";
8
8
  import { LocalStorageStore } from "@dxos/local-storage";
9
9
 
10
10
  // packages/plugins/plugin-registry/src/components/PluginList.tsx
11
- import { ArrowClockwise, Circle } from "@phosphor-icons/react";
12
11
  import React from "react";
13
- import {
14
- Button,
15
- DensityProvider,
16
- Input,
17
- List,
18
- ListItem,
19
- useTranslation
20
- } from "@dxos/react-ui";
21
- import { descriptionText, fineBlockSize, getSize, ghostHover, mx } from "@dxos/react-ui-theme";
12
+ import { Button, Icon, Input, List, ListItem, useTranslation } from "@dxos/react-ui";
13
+ import { descriptionText, fineBlockSize, ghostHover, mx } from "@dxos/react-ui-theme";
22
14
  var PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload }) => {
23
15
  const { t } = useTranslation(REGISTRY_PLUGIN);
24
- return /* @__PURE__ */ React.createElement(DensityProvider, {
25
- density: "fine"
26
- }, /* @__PURE__ */ React.createElement(List, {
16
+ return /* @__PURE__ */ React.createElement(List, {
27
17
  classNames: "mb-4 select-none"
28
- }, plugins.map(({ id, name, description, homePage, iconComponent: Icon = Circle }) => {
18
+ }, plugins.map(({ id, name, description, homePage, icon = "ph--circle--regular" }) => {
29
19
  const isEnabled = enabled.includes(id);
30
20
  const isLoaded = loaded.includes(id);
31
21
  const reloadRequired = isEnabled !== isLoaded;
@@ -44,8 +34,9 @@ var PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload
44
34
  ghostHover
45
35
  ]
46
36
  }, /* @__PURE__ */ React.createElement(Icon, {
47
- weight: "duotone",
48
- className: mx("shrink-0 mbs-1", getSize(6))
37
+ icon,
38
+ size: 6,
39
+ classNames: "shrink-0 mbs-1"
49
40
  }), /* @__PURE__ */ React.createElement("div", {
50
41
  role: "none",
51
42
  className: mx(fineBlockSize, "grow pbs-1 pl-1")
@@ -62,16 +53,19 @@ var PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload
62
53
  variant: "ghost",
63
54
  classNames: "p-0 gap-2",
64
55
  onClick: onReload
65
- }, /* @__PURE__ */ React.createElement(ArrowClockwise, null), /* @__PURE__ */ React.createElement("p", {
56
+ }, /* @__PURE__ */ React.createElement(Icon, {
57
+ size: 4,
58
+ icon: "ph--arrow-clockwise--regular"
59
+ }), /* @__PURE__ */ React.createElement("p", {
66
60
  className: "text-sm font-medium"
67
61
  }, t("reload required message"))))), /* @__PURE__ */ React.createElement("div", {
68
62
  className: "pbs-1"
69
63
  }, /* @__PURE__ */ React.createElement(Input.Switch, {
70
64
  classNames: "self-center",
71
- checked: !!isEnabled,
65
+ checked: isEnabled,
72
66
  onClick: () => onChange?.(id, !isEnabled)
73
67
  }))));
74
- })));
68
+ }));
75
69
  };
76
70
 
77
71
  // packages/plugins/plugin-registry/src/components/PluginSettings.tsx
@@ -80,12 +74,13 @@ import { useIntentDispatcher, usePlugins } from "@dxos/app-framework";
80
74
  import { ObservabilityAction } from "@dxos/plugin-observability/meta";
81
75
  import { SettingsValue } from "@dxos/plugin-settings";
82
76
  import { Input as Input2, useTranslation as useTranslation2 } from "@dxos/react-ui";
77
+ var sort = ({ name: a = "" }, { name: b = "" }) => a.localeCompare(b);
83
78
  var PluginSettings = ({ settings }) => {
84
79
  const { t } = useTranslation2(REGISTRY_PLUGIN);
85
- const { enabled, core, plugins, setPlugin, ...pluginContext } = usePlugins();
80
+ const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();
86
81
  const dispatch = useIntentDispatcher();
87
- const sort = (a, b) => a.name?.localeCompare(b.name ?? "") ?? 0;
88
82
  const installed = useMemo(() => plugins.filter(({ meta }) => !core.includes(meta.id)).filter(({ meta }) => enabled.includes(meta.id)).map(({ meta }) => meta).sort(sort), []);
83
+ const pluginIds = plugins.map(({ meta }) => meta.id);
89
84
  const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sort), []);
90
85
  const recommended = available.filter((meta) => !meta.tags?.includes("experimental"));
91
86
  const experimental = available.filter((meta) => meta.tags?.includes("experimental"));
@@ -115,7 +110,7 @@ var PluginSettings = ({ settings }) => {
115
110
  label: t("settings section installed label")
116
111
  }, /* @__PURE__ */ React2.createElement(PluginList, {
117
112
  plugins: installed,
118
- loaded: plugins.map(({ meta }) => meta.id),
113
+ loaded: pluginIds,
119
114
  enabled,
120
115
  onChange: handleChange,
121
116
  onReload: handleReload
@@ -123,7 +118,7 @@ var PluginSettings = ({ settings }) => {
123
118
  label: t("settings section recommended label")
124
119
  }, /* @__PURE__ */ React2.createElement(PluginList, {
125
120
  plugins: recommended,
126
- loaded: plugins.map(({ meta }) => meta.id),
121
+ loaded: pluginIds,
127
122
  enabled,
128
123
  onChange: handleChange,
129
124
  onReload: handleReload
@@ -131,7 +126,7 @@ var PluginSettings = ({ settings }) => {
131
126
  label: t("settings section experimental label")
132
127
  }, /* @__PURE__ */ React2.createElement(PluginList, {
133
128
  plugins: experimental,
134
- loaded: plugins.map(({ meta }) => meta.id),
129
+ loaded: pluginIds,
135
130
  enabled,
136
131
  onChange: handleChange,
137
132
  onReload: handleReload
@@ -139,7 +134,7 @@ var PluginSettings = ({ settings }) => {
139
134
  };
140
135
  var Section = ({ label, children }) => {
141
136
  return /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("h2", {
142
- className: "py-2 text-sm text-neutral-500"
137
+ className: "py-2 text-sm text-subdued"
143
138
  }, label), children);
144
139
  };
145
140
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/RegistryPlugin.tsx", "../../../src/components/PluginList.tsx", "../../../src/components/PluginSettings.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport type { PluginDefinition, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\n\nimport { PluginSettings } from './components';\nimport meta, { REGISTRY_PLUGIN } from './meta';\nimport translations from './translations';\n\nexport type RegistrySettingsProps = {\n experimental?: boolean;\n};\n\nexport type RegistryPluginProvides = SurfaceProvides & TranslationsProvides & SettingsProvides<RegistrySettingsProps>;\n\nexport const RegistryPlugin = (): PluginDefinition<RegistryPluginProvides> => {\n const settings = new LocalStorageStore<RegistrySettingsProps>(REGISTRY_PLUGIN);\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'experimental', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n provides: {\n settings: settings.values,\n translations,\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <PluginSettings settings={settings.values} /> : null;\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ArrowClockwise, Circle } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport type { Plugin } from '@dxos/app-framework';\nimport {\n Button,\n // type ChromaticPalette,\n // type NeutralPalette,\n DensityProvider,\n Input,\n List,\n ListItem,\n useTranslation,\n // Link,\n} from '@dxos/react-ui';\nimport { descriptionText, fineBlockSize, getSize, ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\n// TODO(burdon): Reconcile with theme.\n// const palette: { [tag: string]: ChromaticPalette | NeutralPalette } = {\n// default: 'neutral',\n// new: 'green',\n// beta: 'cyan',\n// alpha: 'purple',\n// experimental: 'indigo',\n// 新発売: 'red',\n// };\n\nexport type PluginListProps = {\n plugins?: Plugin['meta'][];\n loaded?: string[];\n enabled?: string[];\n onChange?: (id: string, enabled: boolean) => void;\n onReload?: () => void;\n};\n\nexport const PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload }: PluginListProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n\n return (\n <DensityProvider density='fine'>\n <List classNames='mb-4 select-none'>\n {plugins.map(({ id, name, description, homePage, iconComponent: Icon = Circle }) => {\n const isEnabled = enabled.includes(id);\n const isLoaded = loaded.includes(id);\n const reloadRequired = isEnabled !== isLoaded;\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n\n return (\n <Input.Root key={id} id={inputId}>\n <ListItem.Root\n labelId={labelId}\n data-testid={`pluginList.${id}`}\n aria-describedby={descriptionId}\n classNames={['flex gap-2 cursor-pointer plb-2 pli-2 -mli-2 rounded', ghostHover]}\n >\n <Icon weight='duotone' className={mx('shrink-0 mbs-1', getSize(6))} />\n <div role='none' className={mx(fineBlockSize, 'grow pbs-1 pl-1')}>\n <label htmlFor={inputId} id={labelId} className='truncate'>\n {name ?? id}\n </label>\n {(description || reloadRequired || homePage) && (\n <div id={descriptionId} className='space-b-1 pbs-1 pbe-1'>\n <p className={descriptionText}>{description}</p>\n {/* TODO(wittjosiah): Include once plugin docs are available. */}\n {/* {homePage && (\n <Link\n href={homePage}\n target='_blank'\n rel='noreferrer'\n aria-describedby={descriptionId}\n classNames='text-xs'\n >\n {t('home page label')}\n <ArrowSquareOut weight='bold' className={mx(getSize(3), 'inline-block leading-none mli-1')} />\n </Link>\n )} */}\n {reloadRequired && (\n <Button variant='ghost' classNames='p-0 gap-2' onClick={onReload}>\n <ArrowClockwise />\n <p className='text-sm font-medium'>{t('reload required message')}</p>\n </Button>\n )}\n </div>\n )}\n </div>\n <div className='pbs-1'>\n <Input.Switch\n classNames='self-center'\n checked={!!isEnabled}\n onClick={() => onChange?.(id, !isEnabled)}\n />\n </div>\n </ListItem.Root>\n </Input.Root>\n );\n })}\n </List>\n </DensityProvider>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo, type PropsWithChildren } from 'react';\n\nimport { type Plugin, useIntentDispatcher, usePlugins } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/meta';\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { PluginList } from './PluginList';\nimport { type RegistrySettingsProps } from '../RegistryPlugin';\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { enabled, core, plugins, setPlugin, ...pluginContext } = usePlugins();\n const dispatch = useIntentDispatcher();\n\n const sort = (a: Plugin['meta'], b: Plugin['meta']) => a.name?.localeCompare(b.name ?? '') ?? 0;\n\n // Memoize to prevent plugins from disappearing when toggling enabled.\n const installed = useMemo(\n () =>\n plugins\n .filter(({ meta }) => !core.includes(meta.id))\n .filter(({ meta }) => enabled.includes(meta.id))\n .map(({ meta }) => meta)\n .sort(sort),\n [],\n );\n\n const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sort), []);\n const recommended = available.filter((meta) => !meta.tags?.includes('experimental'));\n const experimental = available.filter((meta) => meta.tags?.includes('experimental'));\n\n const handleChange = (id: string, enabled: boolean) => {\n setPlugin(id, enabled);\n void dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'plugins.toggle',\n properties: { plugin: id, enabled },\n },\n });\n };\n\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n <>\n <SettingsValue label={t('settings show experimental label')}>\n <Input.Switch\n data-testid='pluginSettings.experimental'\n checked={settings.experimental}\n onCheckedChange={(checked) => (settings.experimental = !!checked)}\n />\n </SettingsValue>\n\n <Section label={t('settings section installed label')}>\n <PluginList\n plugins={installed}\n loaded={plugins.map(({ meta }) => meta.id)}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n\n <Section label={t('settings section recommended label')}>\n <PluginList\n plugins={recommended}\n loaded={plugins.map(({ meta }) => meta.id)}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n\n {settings.experimental && (\n <Section label={t('settings section experimental label')}>\n <PluginList\n plugins={experimental}\n loaded={plugins.map(({ meta }) => meta.id)}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n )}\n </>\n );\n};\n\nconst Section = ({ label, children }: PropsWithChildren<{ label: string }>) => {\n return (\n <div>\n <h2 className='py-2 text-sm text-neutral-500'>{label}</h2>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { REGISTRY_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [REGISTRY_PLUGIN]: {\n 'plugin name': 'Registry',\n 'reload required message': 'Reload required.',\n 'settings show experimental label': 'Show experimental plugins',\n 'settings section installed label': 'Installed',\n 'settings section recommended label': 'Recommended',\n 'settings section experimental label': 'Experimental',\n 'home page label': 'Home page',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryPl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- "names": ["React", "LocalStorageStore", "ArrowClockwise", "Circle", "React", "Button", "DensityProvider", "Input", "List", "ListItem", "useTranslation", "descriptionText", "fineBlockSize", "getSize", "ghostHover", "mx", "PluginList", "plugins", "loaded", "enabled", "onChange", "onReload", "t", "useTranslation", "REGISTRY_PLUGIN", "DensityProvider", "density", "List", "classNames", "map", "id", "name", "description", "homePage", "iconComponent", "Icon", "Circle", "isEnabled", "includes", "isLoaded", "reloadRequired", "inputId", "labelId", "descriptionId", "Input", "Root", "key", "ListItem", "data-testid", "aria-describedby", "ghostHover", "weight", "className", "mx", "getSize", "div", "role", "fineBlockSize", "label", "htmlFor", "p", "descriptionText", "Button", "variant", "onClick", "ArrowClockwise", "Switch", "checked", "React", "useMemo", "useIntentDispatcher", "usePlugins", "ObservabilityAction", "SettingsValue", "Input", "useTranslation", "PluginSettings", "settings", "t", "useTranslation", "REGISTRY_PLUGIN", "enabled", "core", "plugins", "setPlugin", "pluginContext", "usePlugins", "dispatch", "useIntentDispatcher", "sort", "a", "b", "name", "localeCompare", "installed", "useMemo", "filter", "meta", "includes", "id", "map", "available", "recommended", "tags", "experimental", "handleChange", "action", "ObservabilityAction", "SEND_EVENT", "data", "properties", "plugin", "handleReload", "window", "location", "reload", "React", "SettingsValue", "label", "Input", "Switch", "data-testid", "checked", "onCheckedChange", "Section", "PluginList", "loaded", "onChange", "onReload", "children", "div", "h2", "className", "REGISTRY_PLUGIN", "RegistryPlugin", "settings", "LocalStorageStore", "REGISTRY_PLUGIN", "meta", "ready", "prop", "key", "type", "bool", "allowUndefined", "provides", "values", "translations", "surface", "component", "data", "role", "plugin", "id", "React", "PluginSettings", "RegistryPlugin"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport type { PluginDefinition, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\n\nimport { PluginSettings } from './components';\nimport meta, { REGISTRY_PLUGIN } from './meta';\nimport translations from './translations';\n\nexport type RegistrySettingsProps = {\n experimental?: boolean;\n};\n\nexport type RegistryPluginProvides = SurfaceProvides & TranslationsProvides & SettingsProvides<RegistrySettingsProps>;\n\nexport const RegistryPlugin = (): PluginDefinition<RegistryPluginProvides> => {\n const settings = new LocalStorageStore<RegistrySettingsProps>(REGISTRY_PLUGIN);\n\n return {\n meta,\n ready: async () => {\n settings.prop({ key: 'experimental', type: LocalStorageStore.bool({ allowUndefined: true }) });\n },\n provides: {\n settings: settings.values,\n translations,\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <PluginSettings settings={settings.values} /> : null;\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { Button, Icon, Input, List, ListItem, useTranslation } from '@dxos/react-ui';\nimport { descriptionText, fineBlockSize, ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { REGISTRY_PLUGIN } from '../meta';\n\nexport type PluginListProps = {\n plugins?: PluginMeta[];\n loaded?: string[];\n enabled?: string[];\n onChange?: (id: string, enabled: boolean) => void;\n onReload?: () => void;\n};\n\nexport const PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload }: PluginListProps) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n\n return (\n <List classNames='mb-4 select-none'>\n {plugins.map(({ id, name, description, homePage, icon = 'ph--circle--regular' }) => {\n const isEnabled = enabled.includes(id);\n const isLoaded = loaded.includes(id);\n const reloadRequired = isEnabled !== isLoaded;\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n\n return (\n <Input.Root key={id} id={inputId}>\n <ListItem.Root\n labelId={labelId}\n data-testid={`pluginList.${id}`}\n aria-describedby={descriptionId}\n classNames={['flex gap-2 cursor-pointer plb-2 pli-2 -mli-2 rounded', ghostHover]}\n >\n <Icon icon={icon} size={6} classNames='shrink-0 mbs-1' />\n <div role='none' className={mx(fineBlockSize, 'grow pbs-1 pl-1')}>\n <label htmlFor={inputId} id={labelId} className='truncate'>\n {name ?? id}\n </label>\n {(description || reloadRequired || homePage) && (\n <div id={descriptionId} className='space-b-1 pbs-1 pbe-1'>\n <p className={descriptionText}>{description}</p>\n {/* TODO(wittjosiah): Include once plugin docs are available. */}\n {/* {homePage && (\n <Link\n href={homePage}\n target='_blank'\n rel='noreferrer'\n aria-describedby={descriptionId}\n classNames='text-xs'\n >\n {t('home page label')}\n <ArrowSquareOut weight='bold' className={mx(getSize(3), 'inline-block leading-none mli-1')} />\n </Link>\n )} */}\n {reloadRequired && (\n <Button variant='ghost' classNames='p-0 gap-2' onClick={onReload}>\n <Icon size={4} icon='ph--arrow-clockwise--regular' />\n <p className='text-sm font-medium'>{t('reload required message')}</p>\n </Button>\n )}\n </div>\n )}\n </div>\n <div className='pbs-1'>\n <Input.Switch classNames='self-center' checked={isEnabled} onClick={() => onChange?.(id, !isEnabled)} />\n </div>\n </ListItem.Root>\n </Input.Root>\n );\n })}\n </List>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo, type PropsWithChildren } from 'react';\n\nimport { type PluginMeta, useIntentDispatcher, usePlugins } from '@dxos/app-framework';\nimport { ObservabilityAction } from '@dxos/plugin-observability/meta';\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { PluginList } from './PluginList';\nimport { type RegistrySettingsProps } from '../RegistryPlugin';\nimport { REGISTRY_PLUGIN } from '../meta';\n\nconst sort = ({ name: a = '' }: PluginMeta, { name: b = '' }: PluginMeta) => a.localeCompare(b);\n\nexport const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }) => {\n const { t } = useTranslation(REGISTRY_PLUGIN);\n const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();\n const dispatch = useIntentDispatcher();\n\n // Memoize to prevent plugins from disappearing when toggling enabled.\n const installed = useMemo(\n () =>\n plugins\n .filter(({ meta }) => !core.includes(meta.id))\n .filter(({ meta }) => enabled.includes(meta.id))\n .map(({ meta }) => meta)\n .sort(sort),\n [],\n );\n\n const pluginIds = plugins.map(({ meta }) => meta.id);\n const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sort), []);\n const recommended = available.filter((meta) => !meta.tags?.includes('experimental'));\n const experimental = available.filter((meta) => meta.tags?.includes('experimental'));\n\n const handleChange = (id: string, enabled: boolean) => {\n setPlugin(id, enabled);\n void dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'plugins.toggle',\n properties: { plugin: id, enabled },\n },\n });\n };\n\n const handleReload = () => {\n window.location.reload();\n };\n\n return (\n <>\n <SettingsValue label={t('settings show experimental label')}>\n <Input.Switch\n data-testid='pluginSettings.experimental'\n checked={settings.experimental}\n onCheckedChange={(checked) => (settings.experimental = !!checked)}\n />\n </SettingsValue>\n\n <Section label={t('settings section installed label')}>\n <PluginList\n plugins={installed}\n loaded={pluginIds}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n\n <Section label={t('settings section recommended label')}>\n <PluginList\n plugins={recommended}\n loaded={pluginIds}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n\n {settings.experimental && (\n <Section label={t('settings section experimental label')}>\n <PluginList\n plugins={experimental}\n loaded={pluginIds}\n enabled={enabled}\n onChange={handleChange}\n onReload={handleReload}\n />\n </Section>\n )}\n </>\n );\n};\n\nconst Section = ({ label, children }: PropsWithChildren<{ label: string }>) => {\n return (\n <div>\n <h2 className='py-2 text-sm text-subdued'>{label}</h2>\n {children}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { REGISTRY_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [REGISTRY_PLUGIN]: {\n 'plugin name': 'Registry',\n 'reload required message': 'Reload required.',\n 'settings show experimental label': 'Show experimental plugins',\n 'settings section installed label': 'Installed',\n 'settings section recommended label': 'Recommended',\n 'settings section experimental label': 'Experimental',\n 'home page label': 'Home page',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { RegistryPlugin } from './RegistryPlugin';\n\nexport default RegistryPlugin;\n\nexport * from './RegistryPlugin';\n"],
5
+ "mappings": ";;;;;;AAIA,OAAOA,YAAW;AAGlB,SAASC,yBAAyB;;;ACHlC,OAAOC,WAAW;AAGlB,SAASC,QAAQC,MAAMC,OAAOC,MAAMC,UAAUC,sBAAsB;AACpE,SAASC,iBAAiBC,eAAeC,YAAYC,UAAU;AAYxD,IAAMC,aAAa,CAAC,EAAEC,UAAU,CAAA,GAAIC,SAAS,CAAA,GAAIC,UAAU,CAAA,GAAIC,UAAUC,SAAQ,MAAmB;AACzG,QAAM,EAAEC,EAAC,IAAKC,eAAeC,eAAAA;AAE7B,SACE,sBAAA,cAACC,MAAAA;IAAKC,YAAW;KACdT,QAAQU,IAAI,CAAC,EAAEC,IAAIC,MAAMC,aAAaC,UAAUC,OAAO,sBAAqB,MAAE;AAC7E,UAAMC,YAAYd,QAAQe,SAASN,EAAAA;AACnC,UAAMO,WAAWjB,OAAOgB,SAASN,EAAAA;AACjC,UAAMQ,iBAAiBH,cAAcE;AACrC,UAAME,UAAU,GAAGT,EAAAA;AACnB,UAAMU,UAAU,GAAGV,EAAAA;AACnB,UAAMW,gBAAgB,GAAGX,EAAAA;AAEzB,WACE,sBAAA,cAACY,MAAMC,MAAI;MAACC,KAAKd;MAAIA,IAAIS;OACvB,sBAAA,cAACM,SAASF,MAAI;MACZH;MACAM,eAAa,cAAchB,EAAAA;MAC3BiB,oBAAkBN;MAClBb,YAAY;QAAC;QAAwDoB;;OAErE,sBAAA,cAACC,MAAAA;MAAKf;MAAYgB,MAAM;MAAGtB,YAAW;QACtC,sBAAA,cAACuB,OAAAA;MAAIC,MAAK;MAAOC,WAAWC,GAAGC,eAAe,iBAAA;OAC5C,sBAAA,cAACC,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"Input", "List", "ListItem", "useTranslation", "descriptionText", "fineBlockSize", "ghostHover", "mx", "PluginList", "plugins", "loaded", "enabled", "onChange", "onReload", "t", "useTranslation", "REGISTRY_PLUGIN", "List", "classNames", "map", "id", "name", "description", "homePage", "icon", "isEnabled", "includes", "isLoaded", "reloadRequired", "inputId", "labelId", "descriptionId", "Input", "Root", "key", "ListItem", "data-testid", "aria-describedby", "ghostHover", "Icon", "size", "div", "role", "className", "mx", "fineBlockSize", "label", "htmlFor", "p", "descriptionText", "Button", "variant", "onClick", "Switch", "checked", "React", "useMemo", "useIntentDispatcher", "usePlugins", "ObservabilityAction", "SettingsValue", "Input", "useTranslation", "sort", "name", "a", "b", "localeCompare", "PluginSettings", "settings", "t", "useTranslation", "REGISTRY_PLUGIN", "plugins", "enabled", "core", "setPlugin", "pluginContext", "usePlugins", "dispatch", "useIntentDispatcher", "installed", "useMemo", "filter", "meta", "includes", "id", "map", "pluginIds", "available", "recommended", "tags", "experimental", "handleChange", "action", "ObservabilityAction", "SEND_EVENT", "data", "properties", "plugin", "handleReload", "window", "location", "reload", "React", "SettingsValue", "label", "Input", "Switch", "data-testid", "checked", "onCheckedChange", "Section", "PluginList", "loaded", "onChange", "onReload", "children", "div", "h2", "className", "REGISTRY_PLUGIN", "RegistryPlugin", "settings", "LocalStorageStore", "REGISTRY_PLUGIN", "meta", "ready", "prop", "key", "type", "bool", "allowUndefined", "provides", "values", "translations", "surface", "component", "data", "role", "plugin", "id", "React", "PluginSettings", "RegistryPlugin"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-registry/src/meta.ts":{"bytes":851,"imports":[],"format":"esm"},"packages/plugins/plugin-registry/src/components/PluginList.tsx":{"bytes":11469,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/components/PluginSettings.tsx":{"bytes":11868,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/components/PluginList.tsx","kind":"import-statement","original":"./PluginList"},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/components/index.ts":{"bytes":627,"imports":[{"path":"packages/plugins/plugin-registry/src/components/PluginList.tsx","kind":"import-statement","original":"./PluginList"},{"path":"packages/plugins/plugin-registry/src/components/PluginSettings.tsx","kind":"import-statement","original":"./PluginSettings"}],"format":"esm"},"packages/plugins/plugin-registry/src/translations.ts":{"bytes":2036,"imports":[{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/RegistryPlugin.tsx":{"bytes":4337,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-registry/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-registry/src/index.ts":{"bytes":804,"imports":[{"path":"packages/plugins/plugin-registry/src/RegistryPlugin.tsx","kind":"import-statement","original":"./RegistryPlugin"},{"path":"packages/plugins/plugin-registry/src/RegistryPlugin.tsx","kind":"import-statement","original":"./RegistryPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-registry/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15802},"packages/plugins/plugin-registry/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-registry/dist/lib/browser/chunk-2FC6QNHB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["RegistryPlugin","default"],"entryPoint":"packages/plugins/plugin-registry/src/index.ts","inputs":{"packages/plugins/plugin-registry/src/RegistryPlugin.tsx":{"bytesInOutput":830},"packages/plugins/plugin-registry/src/components/PluginList.tsx":{"bytesInOutput":2559},"packages/plugins/plugin-registry/src/components/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-registry/src/components/PluginSettings.tsx":{"bytesInOutput":2976},"packages/plugins/plugin-registry/src/translations.ts":{"bytesInOutput":479},"packages/plugins/plugin-registry/src/index.ts":{"bytesInOutput":34}},"bytes":7407},"packages/plugins/plugin-registry/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-registry/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-registry/dist/lib/browser/chunk-2FC6QNHB.mjs","kind":"import-statement"}],"exports":["REGISTRY_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-registry/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-registry/dist/lib/browser/chunk-2FC6QNHB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":377},"packages/plugins/plugin-registry/dist/lib/browser/chunk-2FC6QNHB.mjs":{"imports":[],"exports":["REGISTRY_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-registry/src/meta.ts":{"bytesInOutput":115}},"bytes":254}}}
1
+ {"inputs":{"packages/plugins/plugin-registry/src/meta.ts":{"bytes":959,"imports":[],"format":"esm"},"packages/plugins/plugin-registry/src/components/PluginList.tsx":{"bytes":10190,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/components/PluginSettings.tsx":{"bytes":11763,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/components/PluginList.tsx","kind":"import-statement","original":"./PluginList"},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/components/index.ts":{"bytes":627,"imports":[{"path":"packages/plugins/plugin-registry/src/components/PluginList.tsx","kind":"import-statement","original":"./PluginList"},{"path":"packages/plugins/plugin-registry/src/components/PluginSettings.tsx","kind":"import-statement","original":"./PluginSettings"}],"format":"esm"},"packages/plugins/plugin-registry/src/translations.ts":{"bytes":2036,"imports":[{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-registry/src/RegistryPlugin.tsx":{"bytes":4337,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-registry/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-registry/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-registry/src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/plugins/plugin-registry/src/index.ts":{"bytes":804,"imports":[{"path":"packages/plugins/plugin-registry/src/RegistryPlugin.tsx","kind":"import-statement","original":"./RegistryPlugin"},{"path":"packages/plugins/plugin-registry/src/RegistryPlugin.tsx","kind":"import-statement","original":"./RegistryPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-registry/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14858},"packages/plugins/plugin-registry/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/plugin-registry/dist/lib/browser/chunk-NEMFDAOB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["RegistryPlugin","default"],"entryPoint":"packages/plugins/plugin-registry/src/index.ts","inputs":{"packages/plugins/plugin-registry/src/RegistryPlugin.tsx":{"bytesInOutput":830},"packages/plugins/plugin-registry/src/components/PluginList.tsx":{"bytesInOutput":2418},"packages/plugins/plugin-registry/src/components/PluginSettings.tsx":{"bytesInOutput":2957},"packages/plugins/plugin-registry/src/translations.ts":{"bytesInOutput":479},"packages/plugins/plugin-registry/src/index.ts":{"bytesInOutput":34}},"bytes":7247},"packages/plugins/plugin-registry/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-registry/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-registry/dist/lib/browser/chunk-NEMFDAOB.mjs","kind":"import-statement"}],"exports":["REGISTRY_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-registry/src/meta.ts","inputs":{},"bytes":165},"packages/plugins/plugin-registry/dist/lib/browser/chunk-NEMFDAOB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":456},"packages/plugins/plugin-registry/dist/lib/browser/chunk-NEMFDAOB.mjs":{"imports":[],"exports":["REGISTRY_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-registry/src/meta.ts":{"bytesInOutput":115}},"bytes":254}}}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REGISTRY_PLUGIN,
3
3
  meta_default
4
- } from "./chunk-2FC6QNHB.mjs";
4
+ } from "./chunk-NEMFDAOB.mjs";
5
5
  export {
6
6
  REGISTRY_PLUGIN,
7
7
  meta_default as default
@@ -1,12 +1,6 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
3
- declare const _default: {
4
- title: string;
5
- render: () => React.JSX.Element;
6
- parameters: {
7
- layout: string;
8
- };
9
- };
10
- export default _default;
2
+ import { type Meta } from '@storybook/react';
11
3
  export declare const Default: {};
4
+ declare const meta: Meta;
5
+ export default meta;
12
6
  //# sourceMappingURL=Icon.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAuD,MAAM,OAAO,CAAC;;;;;;;;AAwF5E,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
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,kBAAkB,CAAC;AAyF7C,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAMX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { Plugin } from '@dxos/app-framework';
2
+ import { type PluginMeta } from '@dxos/app-framework';
3
3
  export type PluginListProps = {
4
- plugins?: Plugin['meta'][];
4
+ plugins?: PluginMeta[];
5
5
  loaded?: string[];
6
6
  enabled?: string[];
7
7
  onChange?: (id: string, enabled: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"PluginList.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA0BlD,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,qDAAqE,eAAe,sBAkE1G,CAAC"}
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,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMtD,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,qDAAqE,eAAe,sBA4D1G,CAAC"}
@@ -1,14 +1,6 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
3
- declare const _default: {
4
- title: string;
5
- component: ({ plugins, loaded, enabled, onChange, onReload }: import("./PluginList").PluginListProps) => React.JSX.Element;
6
- render: () => React.JSX.Element;
7
- decorators: import("@storybook/react/*").Decorator[];
8
- parameters: {
9
- layout: string;
10
- };
11
- };
12
- export default _default;
2
+ import { type Meta } from '@storybook/react';
13
3
  export declare const Default: {};
4
+ declare const meta: Meta;
5
+ export default meta;
14
6
  //# sourceMappingURL=PluginList.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginList.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;;;;;;AAwCxC,wBAQE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
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,kBAAkB,CAAC;AAgD7C,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAQX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PluginSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG/D,eAAO,MAAM,cAAc,iBAAkB;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,sBAgF/E,CAAC"}
1
+ {"version":3,"file":"PluginSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/PluginSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAK/D,eAAO,MAAM,cAAc,iBAAkB;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,sBA+E/E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,6BAA6B,CAAC;;;;;AAE1D,wBAGE"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,6BAA6B,CAAC;;;;;AAE1D,wBAGuB"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@dxos/plugin-registry",
3
- "version": "0.6.13",
3
+ "version": "0.6.14-main.2b6a0f3",
4
4
  "description": "Braneframe plugin gallery",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
+ "sideEffects": false,
9
10
  "exports": {
10
11
  ".": {
11
12
  "browser": "./dist/lib/browser/index.mjs",
@@ -29,11 +30,11 @@
29
30
  "src"
30
31
  ],
31
32
  "dependencies": {
32
- "@dxos/app-framework": "0.6.13",
33
- "@dxos/local-storage": "0.6.13",
34
- "@dxos/plugin-observability": "0.6.13",
35
- "@dxos/plugin-settings": "0.6.13",
36
- "@dxos/util": "0.6.13"
33
+ "@dxos/app-framework": "0.6.14-main.2b6a0f3",
34
+ "@dxos/local-storage": "0.6.14-main.2b6a0f3",
35
+ "@dxos/plugin-observability": "0.6.14-main.2b6a0f3",
36
+ "@dxos/plugin-settings": "0.6.14-main.2b6a0f3",
37
+ "@dxos/util": "0.6.14-main.2b6a0f3"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@phosphor-icons/react": "^2.1.5",
@@ -41,20 +42,20 @@
41
42
  "@types/react-dom": "~18.2.0",
42
43
  "react": "~18.2.0",
43
44
  "react-dom": "~18.2.0",
44
- "vite": "^5.3.4",
45
- "@dxos/react-ui": "0.6.13",
46
- "@dxos/random": "0.6.13",
47
- "@dxos/react-ui-theme": "0.6.13",
48
- "@dxos/react-ui-mosaic": "0.6.13",
49
- "@dxos/storybook-utils": "0.6.13"
45
+ "vite": "5.4.7",
46
+ "@dxos/react-ui": "0.6.14-main.2b6a0f3",
47
+ "@dxos/random": "0.6.14-main.2b6a0f3",
48
+ "@dxos/react-ui-mosaic": "0.6.14-main.2b6a0f3",
49
+ "@dxos/react-ui-theme": "0.6.14-main.2b6a0f3",
50
+ "@dxos/storybook-utils": "0.6.14-main.2b6a0f3"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "@phosphor-icons/react": "^2.1.5",
53
- "react": "^18.0.0",
54
- "react-dom": "^18.0.0",
55
- "@dxos/react-ui": "0.6.13",
56
- "@dxos/react-ui-mosaic": "0.6.13",
57
- "@dxos/react-ui-theme": "0.6.13"
54
+ "react": "~18.2.0",
55
+ "react-dom": "~18.2.0",
56
+ "@dxos/react-ui": "0.6.14-main.2b6a0f3",
57
+ "@dxos/react-ui-mosaic": "0.6.14-main.2b6a0f3",
58
+ "@dxos/react-ui-theme": "0.6.14-main.2b6a0f3"
58
59
  },
59
60
  "publishConfig": {
60
61
  "access": "public"
@@ -5,6 +5,7 @@
5
5
  import '@dxos-theme';
6
6
 
7
7
  import { IconBase, type IconWeight, GithubLogo, type IconProps } from '@phosphor-icons/react';
8
+ import { type Meta } from '@storybook/react';
8
9
  import React, { forwardRef, type SVGProps, type ReactElement } from 'react';
9
10
 
10
11
  import { getSize, mx } from '@dxos/react-ui-theme';
@@ -48,7 +49,7 @@ const createIcon = ({ name, weights }: StoryIconProps) => {
48
49
  return CustomIcon;
49
50
  };
50
51
 
51
- const Story = () => {
52
+ const DefaultStory = () => {
52
53
  const CustomIcon = createIcon({
53
54
  name: 'GithubLogo',
54
55
  weights: {
@@ -93,12 +94,14 @@ const Story = () => {
93
94
  );
94
95
  };
95
96
 
96
- export default {
97
- title: 'plugin-registry/Icon',
98
- render: Story,
97
+ export const Default = {};
98
+
99
+ const meta: Meta = {
100
+ title: 'plugins/plugin-registry/Icon',
101
+ render: DefaultStory,
99
102
  parameters: {
100
103
  layout: 'centered',
101
104
  },
102
105
  };
103
106
 
104
- export const Default = {};
107
+ export default meta;
@@ -4,10 +4,10 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { Bug, Compass, GithubLogo, Kanban, Gear, Table } from '@phosphor-icons/react';
7
+ import { type Meta } from '@storybook/react';
8
8
  import React, { useState } from 'react';
9
9
 
10
- import type { Plugin } from '@dxos/app-framework';
10
+ import { type PluginMeta } from '@dxos/app-framework';
11
11
  import { faker } from '@dxos/random';
12
12
  import { withTheme } from '@dxos/storybook-utils';
13
13
 
@@ -15,10 +15,17 @@ import { PluginList } from './PluginList';
15
15
 
16
16
  faker.seed(1);
17
17
 
18
- const icons = [Bug, Compass, Kanban, Table, Gear, GithubLogo];
18
+ const icons = [
19
+ 'ph--bug--regular',
20
+ 'ph--compass--regular',
21
+ 'ph--kanban--regular',
22
+ 'ph--table--regular',
23
+ 'ph--gear--regular',
24
+ 'ph--github-logo--regular',
25
+ ];
19
26
 
20
- const Story = () => {
21
- const [plugins] = useState<Plugin['meta'][]>(
27
+ const DefaultStory = () => {
28
+ const [plugins] = useState<PluginMeta[]>(
22
29
  faker.helpers.multiple(
23
30
  () => ({
24
31
  id: `dxos.org/plugin/plugin-${faker.string.uuid()}`,
@@ -27,7 +34,7 @@ const Story = () => {
27
34
  tags: faker.datatype.boolean({ probability: 0.6 })
28
35
  ? [faker.helpers.arrayElement(['experimental', 'beta', 'alpha', 'stable', 'new', '新発売'])]
29
36
  : undefined,
30
- iconComponent: faker.helpers.arrayElement(icons),
37
+ icon: faker.helpers.arrayElement(icons),
31
38
  }),
32
39
  { count: 16 },
33
40
  ),
@@ -45,14 +52,16 @@ const Story = () => {
45
52
  );
46
53
  };
47
54
 
48
- export default {
49
- title: 'plugin-registry/PluginList',
55
+ export const Default = {};
56
+
57
+ const meta: Meta = {
58
+ title: 'plugins/plugin-registry/PluginList',
50
59
  component: PluginList,
51
- render: Story,
60
+ render: DefaultStory,
52
61
  decorators: [withTheme],
53
62
  parameters: {
54
63
  layout: 'centered',
55
64
  },
56
65
  };
57
66
 
58
- export const Default = {};
67
+ export default meta;
@@ -2,37 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { ArrowClockwise, Circle } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
8
- import type { Plugin } from '@dxos/app-framework';
9
- import {
10
- Button,
11
- // type ChromaticPalette,
12
- // type NeutralPalette,
13
- DensityProvider,
14
- Input,
15
- List,
16
- ListItem,
17
- useTranslation,
18
- // Link,
19
- } from '@dxos/react-ui';
20
- import { descriptionText, fineBlockSize, getSize, ghostHover, mx } from '@dxos/react-ui-theme';
7
+ import { type PluginMeta } from '@dxos/app-framework';
8
+ import { Button, Icon, Input, List, ListItem, useTranslation } from '@dxos/react-ui';
9
+ import { descriptionText, fineBlockSize, ghostHover, mx } from '@dxos/react-ui-theme';
21
10
 
22
11
  import { REGISTRY_PLUGIN } from '../meta';
23
12
 
24
- // TODO(burdon): Reconcile with theme.
25
- // const palette: { [tag: string]: ChromaticPalette | NeutralPalette } = {
26
- // default: 'neutral',
27
- // new: 'green',
28
- // beta: 'cyan',
29
- // alpha: 'purple',
30
- // experimental: 'indigo',
31
- // 新発売: 'red',
32
- // };
33
-
34
13
  export type PluginListProps = {
35
- plugins?: Plugin['meta'][];
14
+ plugins?: PluginMeta[];
36
15
  loaded?: string[];
37
16
  enabled?: string[];
38
17
  onChange?: (id: string, enabled: boolean) => void;
@@ -43,34 +22,33 @@ export const PluginList = ({ plugins = [], loaded = [], enabled = [], onChange,
43
22
  const { t } = useTranslation(REGISTRY_PLUGIN);
44
23
 
45
24
  return (
46
- <DensityProvider density='fine'>
47
- <List classNames='mb-4 select-none'>
48
- {plugins.map(({ id, name, description, homePage, iconComponent: Icon = Circle }) => {
49
- const isEnabled = enabled.includes(id);
50
- const isLoaded = loaded.includes(id);
51
- const reloadRequired = isEnabled !== isLoaded;
52
- const inputId = `${id}-input`;
53
- const labelId = `${id}-label`;
54
- const descriptionId = `${id}-description`;
25
+ <List classNames='mb-4 select-none'>
26
+ {plugins.map(({ id, name, description, homePage, icon = 'ph--circle--regular' }) => {
27
+ const isEnabled = enabled.includes(id);
28
+ const isLoaded = loaded.includes(id);
29
+ const reloadRequired = isEnabled !== isLoaded;
30
+ const inputId = `${id}-input`;
31
+ const labelId = `${id}-label`;
32
+ const descriptionId = `${id}-description`;
55
33
 
56
- return (
57
- <Input.Root key={id} id={inputId}>
58
- <ListItem.Root
59
- labelId={labelId}
60
- data-testid={`pluginList.${id}`}
61
- aria-describedby={descriptionId}
62
- classNames={['flex gap-2 cursor-pointer plb-2 pli-2 -mli-2 rounded', ghostHover]}
63
- >
64
- <Icon weight='duotone' className={mx('shrink-0 mbs-1', getSize(6))} />
65
- <div role='none' className={mx(fineBlockSize, 'grow pbs-1 pl-1')}>
66
- <label htmlFor={inputId} id={labelId} className='truncate'>
67
- {name ?? id}
68
- </label>
69
- {(description || reloadRequired || homePage) && (
70
- <div id={descriptionId} className='space-b-1 pbs-1 pbe-1'>
71
- <p className={descriptionText}>{description}</p>
72
- {/* TODO(wittjosiah): Include once plugin docs are available. */}
73
- {/* {homePage && (
34
+ return (
35
+ <Input.Root key={id} id={inputId}>
36
+ <ListItem.Root
37
+ labelId={labelId}
38
+ data-testid={`pluginList.${id}`}
39
+ aria-describedby={descriptionId}
40
+ classNames={['flex gap-2 cursor-pointer plb-2 pli-2 -mli-2 rounded', ghostHover]}
41
+ >
42
+ <Icon icon={icon} size={6} classNames='shrink-0 mbs-1' />
43
+ <div role='none' className={mx(fineBlockSize, 'grow pbs-1 pl-1')}>
44
+ <label htmlFor={inputId} id={labelId} className='truncate'>
45
+ {name ?? id}
46
+ </label>
47
+ {(description || reloadRequired || homePage) && (
48
+ <div id={descriptionId} className='space-b-1 pbs-1 pbe-1'>
49
+ <p className={descriptionText}>{description}</p>
50
+ {/* TODO(wittjosiah): Include once plugin docs are available. */}
51
+ {/* {homePage && (
74
52
  <Link
75
53
  href={homePage}
76
54
  target='_blank'
@@ -82,27 +60,22 @@ export const PluginList = ({ plugins = [], loaded = [], enabled = [], onChange,
82
60
  <ArrowSquareOut weight='bold' className={mx(getSize(3), 'inline-block leading-none mli-1')} />
83
61
  </Link>
84
62
  )} */}
85
- {reloadRequired && (
86
- <Button variant='ghost' classNames='p-0 gap-2' onClick={onReload}>
87
- <ArrowClockwise />
88
- <p className='text-sm font-medium'>{t('reload required message')}</p>
89
- </Button>
90
- )}
91
- </div>
92
- )}
93
- </div>
94
- <div className='pbs-1'>
95
- <Input.Switch
96
- classNames='self-center'
97
- checked={!!isEnabled}
98
- onClick={() => onChange?.(id, !isEnabled)}
99
- />
100
- </div>
101
- </ListItem.Root>
102
- </Input.Root>
103
- );
104
- })}
105
- </List>
106
- </DensityProvider>
63
+ {reloadRequired && (
64
+ <Button variant='ghost' classNames='p-0 gap-2' onClick={onReload}>
65
+ <Icon size={4} icon='ph--arrow-clockwise--regular' />
66
+ <p className='text-sm font-medium'>{t('reload required message')}</p>
67
+ </Button>
68
+ )}
69
+ </div>
70
+ )}
71
+ </div>
72
+ <div className='pbs-1'>
73
+ <Input.Switch classNames='self-center' checked={isEnabled} onClick={() => onChange?.(id, !isEnabled)} />
74
+ </div>
75
+ </ListItem.Root>
76
+ </Input.Root>
77
+ );
78
+ })}
79
+ </List>
107
80
  );
108
81
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { useMemo, type PropsWithChildren } from 'react';
6
6
 
7
- import { type Plugin, useIntentDispatcher, usePlugins } from '@dxos/app-framework';
7
+ import { type PluginMeta, useIntentDispatcher, usePlugins } from '@dxos/app-framework';
8
8
  import { ObservabilityAction } from '@dxos/plugin-observability/meta';
9
9
  import { SettingsValue } from '@dxos/plugin-settings';
10
10
  import { Input, useTranslation } from '@dxos/react-ui';
@@ -13,13 +13,13 @@ import { PluginList } from './PluginList';
13
13
  import { type RegistrySettingsProps } from '../RegistryPlugin';
14
14
  import { REGISTRY_PLUGIN } from '../meta';
15
15
 
16
+ const sort = ({ name: a = '' }: PluginMeta, { name: b = '' }: PluginMeta) => a.localeCompare(b);
17
+
16
18
  export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }) => {
17
19
  const { t } = useTranslation(REGISTRY_PLUGIN);
18
- const { enabled, core, plugins, setPlugin, ...pluginContext } = usePlugins();
20
+ const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();
19
21
  const dispatch = useIntentDispatcher();
20
22
 
21
- const sort = (a: Plugin['meta'], b: Plugin['meta']) => a.name?.localeCompare(b.name ?? '') ?? 0;
22
-
23
23
  // Memoize to prevent plugins from disappearing when toggling enabled.
24
24
  const installed = useMemo(
25
25
  () =>
@@ -31,6 +31,7 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
31
31
  [],
32
32
  );
33
33
 
34
+ const pluginIds = plugins.map(({ meta }) => meta.id);
34
35
  const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sort), []);
35
36
  const recommended = available.filter((meta) => !meta.tags?.includes('experimental'));
36
37
  const experimental = available.filter((meta) => meta.tags?.includes('experimental'));
@@ -63,7 +64,7 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
63
64
  <Section label={t('settings section installed label')}>
64
65
  <PluginList
65
66
  plugins={installed}
66
- loaded={plugins.map(({ meta }) => meta.id)}
67
+ loaded={pluginIds}
67
68
  enabled={enabled}
68
69
  onChange={handleChange}
69
70
  onReload={handleReload}
@@ -73,7 +74,7 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
73
74
  <Section label={t('settings section recommended label')}>
74
75
  <PluginList
75
76
  plugins={recommended}
76
- loaded={plugins.map(({ meta }) => meta.id)}
77
+ loaded={pluginIds}
77
78
  enabled={enabled}
78
79
  onChange={handleChange}
79
80
  onReload={handleReload}
@@ -84,7 +85,7 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
84
85
  <Section label={t('settings section experimental label')}>
85
86
  <PluginList
86
87
  plugins={experimental}
87
- loaded={plugins.map(({ meta }) => meta.id)}
88
+ loaded={pluginIds}
88
89
  enabled={enabled}
89
90
  onChange={handleChange}
90
91
  onReload={handleReload}
@@ -98,7 +99,7 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
98
99
  const Section = ({ label, children }: PropsWithChildren<{ label: string }>) => {
99
100
  return (
100
101
  <div>
101
- <h2 className='py-2 text-sm text-neutral-500'>{label}</h2>
102
+ <h2 className='py-2 text-sm text-subdued'>{label}</h2>
102
103
  {children}
103
104
  </div>
104
105
  );
package/src/meta.ts CHANGED
@@ -2,9 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { type PluginMeta } from '@dxos/app-framework';
6
+
5
7
  export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
6
8
 
7
9
  export default {
8
10
  id: REGISTRY_PLUGIN,
9
11
  name: 'Plugins',
10
- };
12
+ } satisfies PluginMeta;
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';\n\nexport default {\n id: REGISTRY_PLUGIN,\n name: 'Plugins',\n};\n"],
5
- "mappings": ";AAIO,IAAMA,kBAAkB;AAE/B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;",
6
- "names": ["REGISTRY_PLUGIN", "id", "name"]
7
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sanity.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanity.test.d.ts","sourceRoot":"","sources":["../../../src/sanity.test.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
-
5
- import { expect } from 'chai';
6
-
7
- import { describe, test } from '@dxos/test';
8
-
9
- describe('Sanity', () => {
10
- test('Sanity', async () => {
11
- expect(true).to.be.true;
12
- });
13
- });