mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
chore(website): enhance plugin search ui (#4294)
* chore(website): enhance plugin search ui * Delete .changeset/popular-nails-behave.md * Update addons.json
This commit is contained in:
parent
10be85cb7e
commit
88a91bdfc7
11 changed files with 59 additions and 47 deletions
|
@ -12,6 +12,10 @@ import path from 'path';
|
||||||
).json();
|
).json();
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
item.description = d.description;
|
item.description = d.description;
|
||||||
|
// remove html tags from description (e.g. <h1...>)
|
||||||
|
item.description = item.description.replace(/<[^>]*>?/gm, '');
|
||||||
|
// remove markdown links from description (e.g. [link](url))
|
||||||
|
item.description = item.description.replace(/\[(.*?)\]\(.*?\)/gm, '$1');
|
||||||
item.url = `https://www.npmjs.org/${item.name}`;
|
item.url = `https://www.npmjs.org/${item.name}`;
|
||||||
item.registry = `https://registry.npmjs.org/${item.name}`;
|
item.registry = `https://registry.npmjs.org/${item.name}`;
|
||||||
item.bundled = typeof item.bundled === 'boolean' ? item.bundled : false;
|
item.bundled = typeof item.bundled === 'boolean' ? item.bundled : false;
|
||||||
|
|
|
@ -70,7 +70,7 @@ module.exports = {
|
||||||
'plugin-filter',
|
'plugin-filter',
|
||||||
{
|
{
|
||||||
type: 'link',
|
type: 'link',
|
||||||
label: 'Search Plugins',
|
label: 'Search for Plugins & Tools',
|
||||||
href: '/dev/plugins-search',
|
href: '/dev/plugins-search',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { useTheme } from '@mui/styles';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import CardLogo from './CardLogo';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import { Addon } from './types';
|
import { Addon } from './types';
|
||||||
|
|
||||||
|
@ -54,6 +55,15 @@ const AddonCard: FC<Addon> = ({
|
||||||
<Icon category={category} />
|
<Icon category={category} />
|
||||||
</Avatar>
|
</Avatar>
|
||||||
}
|
}
|
||||||
|
action={
|
||||||
|
<Avatar
|
||||||
|
alt="Verdaccio"
|
||||||
|
title="Verdaccio Core"
|
||||||
|
sx={{ width: 40, height: 40, bgcolor: 'transparent' }}
|
||||||
|
>
|
||||||
|
<CardLogo origin={origin} />
|
||||||
|
</Avatar>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
|
@ -75,6 +85,7 @@ const AddonCard: FC<Addon> = ({
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Chip
|
<Chip
|
||||||
|
title="Monthly downloads"
|
||||||
label={new Intl.NumberFormat().format(downloads)}
|
label={new Intl.NumberFormat().format(downloads)}
|
||||||
avatar={
|
avatar={
|
||||||
<Avatar sizes="small">
|
<Avatar sizes="small">
|
||||||
|
@ -85,10 +96,11 @@ const AddonCard: FC<Addon> = ({
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Chip label={`v${latest}`} variant="outlined" />
|
<Chip title="Latest version" label={`v${latest}`} variant="outlined" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button
|
<Button
|
||||||
|
title="Show package on npmjs.com"
|
||||||
variant="text"
|
variant="text"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
|
|
13
website/src/components/EcosystemSearch/CardLogo.tsx
Normal file
13
website/src/components/EcosystemSearch/CardLogo.tsx
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
import * as React from 'react';
|
||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import Logo from '../Logo';
|
||||||
|
import styles from './Header.module.scss';
|
||||||
|
|
||||||
|
const CardLogo: FC<{ origin: string }> = ({ origin }): React.ReactElement => {
|
||||||
|
// Show Verdaccio logo for core plugins
|
||||||
|
return origin === 'core' ? <Logo /> : <></>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CardLogo;
|
|
@ -60,7 +60,7 @@ const FilterControl: FC<Props> = ({ categories, origins, onChange }): ReactEleme
|
||||||
fontWeight="lg"
|
fontWeight="lg"
|
||||||
sx={{ marginBottom: theme.spacing(1) }}
|
sx={{ marginBottom: theme.spacing(1) }}
|
||||||
>
|
>
|
||||||
<Translate>Search Plugins / Tools</Translate>
|
<Translate>Search for Plugins and Tools</Translate>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Alert severity="info" sx={{ marginBottom: theme.spacing(1) }}>
|
<Alert severity="info" sx={{ marginBottom: theme.spacing(1) }}>
|
||||||
<Translate>Items qualified as core are maintained actively by the verdaccio team</Translate>
|
<Translate>Items qualified as core are maintained actively by the verdaccio team</Translate>
|
||||||
|
|
|
@ -10,17 +10,17 @@ import { FC } from 'react';
|
||||||
|
|
||||||
const Icon: FC<{ category: string }> = ({ category }): React.ReactElement => {
|
const Icon: FC<{ category: string }> = ({ category }): React.ReactElement => {
|
||||||
if (category === 'middleware') {
|
if (category === 'middleware') {
|
||||||
return <AltRouteIcon />;
|
return <AltRouteIcon titleAccess={'Middleware Plugin'} />;
|
||||||
} else if (category === 'storage') {
|
} else if (category === 'storage') {
|
||||||
return <StorageIcon />;
|
return <StorageIcon titleAccess={'Storage Plugin'} />;
|
||||||
} else if (category === 'tool') {
|
} else if (category === 'tool') {
|
||||||
return <HandymanIcon />;
|
return <HandymanIcon titleAccess={'Tool'} />;
|
||||||
} else if (category === 'filter') {
|
} else if (category === 'filter') {
|
||||||
return <FilterAltIcon />;
|
return <FilterAltIcon titleAccess={'Filter Plugin'} />;
|
||||||
} else if (category === 'authentication') {
|
} else if (category === 'authentication') {
|
||||||
return <SecurityIcon />;
|
return <SecurityIcon titleAccess={'Authentication Plugin'} />;
|
||||||
} else if (category === 'ui') {
|
} else if (category === 'ui') {
|
||||||
return <ColorLensIcon />;
|
return <ColorLensIcon titleAccess={'UI Theme'} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <HubIcon />;
|
return <HubIcon />;
|
||||||
|
|
|
@ -805,17 +805,6 @@
|
||||||
"latest": "1.0.2",
|
"latest": "1.0.2",
|
||||||
"downloads": 4
|
"downloads": 4
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "verdaccio-sqlite",
|
|
||||||
"bundled": false,
|
|
||||||
"origin": "community",
|
|
||||||
"category": "authentication",
|
|
||||||
"description": "Verdaccio SQLite authentication plugin",
|
|
||||||
"url": "https://www.npmjs.org/verdaccio-sqlite",
|
|
||||||
"registry": "https://registry.npmjs.org/verdaccio-sqlite",
|
|
||||||
"latest": "1.0.2",
|
|
||||||
"downloads": 4
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "verdaccio-simplegroup",
|
"name": "verdaccio-simplegroup",
|
||||||
"bundled": false,
|
"bundled": false,
|
||||||
|
@ -1166,26 +1155,6 @@
|
||||||
"registry": "https://registry.npmjs.org/tgz-checker",
|
"registry": "https://registry.npmjs.org/tgz-checker",
|
||||||
"latest": "0.1.9",
|
"latest": "0.1.9",
|
||||||
"downloads": 13
|
"downloads": 13
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "npm-offline-packer",
|
|
||||||
"bundled": false,
|
|
||||||
"origin": "community",
|
|
||||||
"category": "tool",
|
|
||||||
"url": "https://www.npmjs.org/npm-offline-packer",
|
|
||||||
"registry": "https://registry.npmjs.org/npm-offline-packer",
|
|
||||||
"latest": "1.0.1",
|
|
||||||
"downloads": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "npm-offline-packer",
|
|
||||||
"bundled": false,
|
|
||||||
"origin": "community",
|
|
||||||
"category": "tool",
|
|
||||||
"url": "https://www.npmjs.org/npm-offline-packer",
|
|
||||||
"registry": "https://registry.npmjs.org/npm-offline-packer",
|
|
||||||
"latest": "1.0.1",
|
|
||||||
"downloads": 10
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,16 +6,13 @@ import React from 'react';
|
||||||
|
|
||||||
import Command from './Command';
|
import Command from './Command';
|
||||||
import styles from './Header.module.scss';
|
import styles from './Header.module.scss';
|
||||||
|
import Logo from './Logo';
|
||||||
|
|
||||||
const Header = (): React.ReactElement => {
|
const Header = (): React.ReactElement => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles['header--wrap']}>
|
<div className={styles['header--wrap']}>
|
||||||
<img
|
<Logo />
|
||||||
className={styles['header--imageLogo']}
|
|
||||||
src={useBaseUrl('/img/logo/uk/verdaccio-tiny-uk-no-bg.svg')}
|
|
||||||
alt="Verdaccio Logo"
|
|
||||||
/>
|
|
||||||
<div className={styles['header--mt-2']}>
|
<div className={styles['header--mt-2']}>
|
||||||
<h1 className={styles['header--title']}>Verdaccio</h1>
|
<h1 className={styles['header--title']}>Verdaccio</h1>
|
||||||
<p className={styles['header--subtitle']}>
|
<p className={styles['header--subtitle']}>
|
||||||
|
|
17
website/src/components/Logo.tsx
Normal file
17
website/src/components/Logo.tsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
import * as React from 'react';
|
||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import styles from './Header.module.scss';
|
||||||
|
|
||||||
|
const Logo: FC = (): React.ReactElement => {
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
className={styles['header--imageLogo']}
|
||||||
|
src={useBaseUrl('/img/logo/uk/verdaccio-tiny-uk-no-bg.svg')}
|
||||||
|
alt="Verdaccio Logo"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Logo;
|
|
@ -57,7 +57,7 @@
|
||||||
"plugin-filter",
|
"plugin-filter",
|
||||||
{
|
{
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"label": "Search Plugins",
|
"label": "Search for Plugins & Tools",
|
||||||
"href": "/dev/plugins-search"
|
"href": "/dev/plugins-search"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
"plugin-filter",
|
"plugin-filter",
|
||||||
{
|
{
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"label": "Search Plugins",
|
"label": "Search for Plugins & Tools",
|
||||||
"href": "/dev/plugins-search"
|
"href": "/dev/plugins-search"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue