@dxos/plugin-registry 0.6.14-main.7bd9c89 → 0.6.14-staging.934c9de
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.
|
@@ -72,16 +72,16 @@ var PluginList = ({ plugins = [], loaded = [], enabled = [], onChange, onReload
|
|
|
72
72
|
import React2, { useMemo } from "react";
|
|
73
73
|
import { useIntentDispatcher, usePlugins } from "@dxos/app-framework";
|
|
74
74
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
75
|
-
import { SettingsValue } from "@dxos/plugin-settings";
|
|
76
75
|
import { Input as Input2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
77
|
-
|
|
76
|
+
import { FormInput } from "@dxos/react-ui-data";
|
|
77
|
+
var sortPluginMeta = ({ name: a = "" }, { name: b = "" }) => a.localeCompare(b);
|
|
78
78
|
var PluginSettings = ({ settings }) => {
|
|
79
79
|
const { t } = useTranslation2(REGISTRY_PLUGIN);
|
|
80
80
|
const { plugins, enabled, core, setPlugin, ...pluginContext } = usePlugins();
|
|
81
81
|
const dispatch = useIntentDispatcher();
|
|
82
|
-
const installed = useMemo(() => plugins.filter(({ meta }) => !core.includes(meta.id)).filter(({ meta }) => enabled.includes(meta.id)).map(({ meta }) => meta).sort(
|
|
82
|
+
const installed = useMemo(() => plugins.filter(({ meta }) => !core.includes(meta.id)).filter(({ meta }) => enabled.includes(meta.id)).map(({ meta }) => meta).sort(sortPluginMeta), []);
|
|
83
83
|
const pluginIds = plugins.map(({ meta }) => meta.id);
|
|
84
|
-
const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(
|
|
84
|
+
const available = useMemo(() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sortPluginMeta), []);
|
|
85
85
|
const recommended = available.filter((meta) => !meta.tags?.includes("experimental"));
|
|
86
86
|
const experimental = available.filter((meta) => meta.tags?.includes("experimental"));
|
|
87
87
|
const handleChange = (id, enabled2) => {
|
|
@@ -100,7 +100,7 @@ var PluginSettings = ({ settings }) => {
|
|
|
100
100
|
const handleReload = () => {
|
|
101
101
|
window.location.reload();
|
|
102
102
|
};
|
|
103
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
103
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(FormInput, {
|
|
104
104
|
label: t("settings show experimental label")
|
|
105
105
|
}, /* @__PURE__ */ React2.createElement(Input2.Switch, {
|
|
106
106
|
"data-testid": "pluginSettings.experimental",
|
|
@@ -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 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 {
|
|
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,SAAAA;MAAMC,SAASlB;MAAST,IAAIU;MAASa,WAAU;OAC7CtB,QAAQD,EAAAA,IAETE,eAAeM,kBAAkBL,aACjC,sBAAA,cAACkB,OAAAA;MAAIrB,IAAIW;MAAeY,WAAU;OAChC,sBAAA,cAACK,KAAAA;MAAEL,WAAWM;OAAkB3B,WAAAA,GAc/BM,kBACC,sBAAA,cAACsB,QAAAA;MAAOC,SAAQ;MAAQjC,YAAW;MAAYkC,SAASvC;OACtD,sBAAA,cAAC0B,MAAAA;MAAKC,MAAM;MAAGhB,MAAK;QACpB,sBAAA,cAACwB,KAAAA;MAAEL,WAAU;OAAuB7B,EAAE,yBAAA,CAAA,CAAA,CAAA,CAAA,GAMhD,sBAAA,cAAC2B,OAAAA;MAAIE,WAAU;OACb,sBAAA,cAACX,MAAMqB,QAAM;MAACnC,YAAW;MAAcoC,SAAS7B;MAAW2B,SAAS,MAAMxC,WAAWQ,IAAI,CAACK,SAAAA;;EAKpG,CAAA,CAAA;AAGN;;;AC5EA,OAAO8B,UAASC,eAAuC;AAEvD,SAA0BC,qBAAqBC,kBAAkB;AACjE,SAASC,2BAA2B;AACpC,SAASC,
|
|
6
|
-
"names": ["React", "LocalStorageStore", "React", "Button", "Icon", "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", "
|
|
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 { Input, useTranslation } from '@dxos/react-ui';\nimport { FormInput } from '@dxos/react-ui-data';\n\nimport { PluginList } from './PluginList';\nimport { type RegistrySettingsProps } from '../RegistryPlugin';\nimport { REGISTRY_PLUGIN } from '../meta';\n\nconst sortPluginMeta = ({ 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(sortPluginMeta),\n [],\n );\n\n const pluginIds = plugins.map(({ meta }) => meta.id);\n const available = useMemo(\n () => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sortPluginMeta),\n [],\n );\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 <FormInput 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 </FormInput>\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,c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AU;MACRV,UAAUA,SAASW;MACnBC;MACAC,SAAS;QACPC,WAAW,CAAC,EAAEC,MAAMC,KAAI,MAAE;AACxB,kBAAQA,MAAAA;YACN,KAAK;AACH,qBAAOD,KAAKE,WAAWd,aAAKe,KAAK,gBAAAC,OAAA,cAACC,gBAAAA;gBAAepB,UAAUA,SAASW;mBAAa;UACrF;AAEA,iBAAO;QACT;MACF;IACF;EACF;AACF;;;AIpCA,IAAA,cAAeU;",
|
|
6
|
+
"names": ["React", "LocalStorageStore", "React", "Button", "Icon", "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", "Input", "useTranslation", "FormInput", "sortPluginMeta", "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", "sort", "pluginIds", "available", "recommended", "tags", "experimental", "handleChange", "action", "ObservabilityAction", "SEND_EVENT", "data", "properties", "plugin", "handleReload", "window", "location", "reload", "React", "FormInput", "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":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":
|
|
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":11847,"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/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","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":14905},"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/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-data","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/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-registry/src/components/PluginSettings.tsx":{"bytesInOutput":2977},"packages/plugins/plugin-registry/src/translations.ts":{"bytesInOutput":479},"packages/plugins/plugin-registry/src/index.ts":{"bytesInOutput":34}},"bytes":7267},"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 +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;AAK/D,eAAO,MAAM,cAAc,iBAAkB;IAAE,QAAQ,EAAE,qBAAqB,CAAA;CAAE,
|
|
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,sBAkF/E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-registry",
|
|
3
|
-
"version": "0.6.14-
|
|
3
|
+
"version": "0.6.14-staging.934c9de",
|
|
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": true,
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
12
|
+
"types": "./dist/types/src/index.d.ts",
|
|
13
|
+
"browser": "./dist/lib/browser/index.mjs"
|
|
13
14
|
},
|
|
14
15
|
"./meta": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
16
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
+
"browser": "./dist/lib/browser/meta.mjs"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -29,11 +30,11 @@
|
|
|
29
30
|
"src"
|
|
30
31
|
],
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@dxos/app-framework": "0.6.14-
|
|
33
|
-
"@dxos/plugin-observability": "0.6.14-
|
|
34
|
-
"@dxos/local-storage": "0.6.14-
|
|
35
|
-
"@dxos/util": "0.6.14-
|
|
36
|
-
"@dxos/
|
|
33
|
+
"@dxos/app-framework": "0.6.14-staging.934c9de",
|
|
34
|
+
"@dxos/plugin-observability": "0.6.14-staging.934c9de",
|
|
35
|
+
"@dxos/local-storage": "0.6.14-staging.934c9de",
|
|
36
|
+
"@dxos/util": "0.6.14-staging.934c9de",
|
|
37
|
+
"@dxos/react-ui-data": "0.6.14-staging.934c9de"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -42,19 +43,19 @@
|
|
|
42
43
|
"react": "~18.2.0",
|
|
43
44
|
"react-dom": "~18.2.0",
|
|
44
45
|
"vite": "5.4.7",
|
|
45
|
-
"@dxos/random": "0.6.14-
|
|
46
|
-
"@dxos/react-ui": "0.6.14-
|
|
47
|
-
"@dxos/react-ui-
|
|
48
|
-
"@dxos/react-ui-
|
|
49
|
-
"@dxos/storybook-utils": "0.6.14-
|
|
46
|
+
"@dxos/random": "0.6.14-staging.934c9de",
|
|
47
|
+
"@dxos/react-ui": "0.6.14-staging.934c9de",
|
|
48
|
+
"@dxos/react-ui-mosaic": "0.6.14-staging.934c9de",
|
|
49
|
+
"@dxos/react-ui-theme": "0.6.14-staging.934c9de",
|
|
50
|
+
"@dxos/storybook-utils": "0.6.14-staging.934c9de"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"@phosphor-icons/react": "^2.1.5",
|
|
53
54
|
"react": "~18.2.0",
|
|
54
55
|
"react-dom": "~18.2.0",
|
|
55
|
-
"@dxos/react-ui": "0.6.14-
|
|
56
|
-
"@dxos/react-ui-
|
|
57
|
-
"@dxos/react-ui-
|
|
56
|
+
"@dxos/react-ui": "0.6.14-staging.934c9de",
|
|
57
|
+
"@dxos/react-ui-theme": "0.6.14-staging.934c9de",
|
|
58
|
+
"@dxos/react-ui-mosaic": "0.6.14-staging.934c9de"
|
|
58
59
|
},
|
|
59
60
|
"publishConfig": {
|
|
60
61
|
"access": "public"
|
|
@@ -6,14 +6,14 @@ import React, { useMemo, type PropsWithChildren } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type PluginMeta, useIntentDispatcher, usePlugins } from '@dxos/app-framework';
|
|
8
8
|
import { ObservabilityAction } from '@dxos/plugin-observability/meta';
|
|
9
|
-
import { SettingsValue } from '@dxos/plugin-settings';
|
|
10
9
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { FormInput } from '@dxos/react-ui-data';
|
|
11
11
|
|
|
12
12
|
import { PluginList } from './PluginList';
|
|
13
13
|
import { type RegistrySettingsProps } from '../RegistryPlugin';
|
|
14
14
|
import { REGISTRY_PLUGIN } from '../meta';
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const sortPluginMeta = ({ name: a = '' }: PluginMeta, { name: b = '' }: PluginMeta) => a.localeCompare(b);
|
|
17
17
|
|
|
18
18
|
export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }) => {
|
|
19
19
|
const { t } = useTranslation(REGISTRY_PLUGIN);
|
|
@@ -27,12 +27,15 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
|
|
|
27
27
|
.filter(({ meta }) => !core.includes(meta.id))
|
|
28
28
|
.filter(({ meta }) => enabled.includes(meta.id))
|
|
29
29
|
.map(({ meta }) => meta)
|
|
30
|
-
.sort(
|
|
30
|
+
.sort(sortPluginMeta),
|
|
31
31
|
[],
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
const pluginIds = plugins.map(({ meta }) => meta.id);
|
|
35
|
-
const available = useMemo(
|
|
35
|
+
const available = useMemo(
|
|
36
|
+
() => pluginContext.available.filter(({ id }) => !enabled.includes(id)).sort(sortPluginMeta),
|
|
37
|
+
[],
|
|
38
|
+
);
|
|
36
39
|
const recommended = available.filter((meta) => !meta.tags?.includes('experimental'));
|
|
37
40
|
const experimental = available.filter((meta) => meta.tags?.includes('experimental'));
|
|
38
41
|
|
|
@@ -53,13 +56,13 @@ export const PluginSettings = ({ settings }: { settings: RegistrySettingsProps }
|
|
|
53
56
|
|
|
54
57
|
return (
|
|
55
58
|
<>
|
|
56
|
-
<
|
|
59
|
+
<FormInput label={t('settings show experimental label')}>
|
|
57
60
|
<Input.Switch
|
|
58
61
|
data-testid='pluginSettings.experimental'
|
|
59
62
|
checked={settings.experimental}
|
|
60
63
|
onCheckedChange={(checked) => (settings.experimental = !!checked)}
|
|
61
64
|
/>
|
|
62
|
-
</
|
|
65
|
+
</FormInput>
|
|
63
66
|
|
|
64
67
|
<Section label={t('settings section installed label')}>
|
|
65
68
|
<PluginList
|