@verdaccio/ui-components 5.0.0-next-9.7 → 5.0.0-next-9.9
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.
- package/build/Theme/ResetStyles.d.ts +1 -1
- package/build/Theme/StyleBaseline.d.ts +1 -2
- package/build/Theme/ThemeProvider.d.ts +1 -1
- package/build/Theme/modes.d.ts +13 -1
- package/build/Theme/modes.js +18 -3
- package/build/Theme/modes.js.map +1 -1
- package/build/Theme/modes.mjs +16 -2
- package/build/Theme/modes.mjs.map +1 -1
- package/build/Theme/theme.d.ts +27 -3
- package/build/Theme/theme.js.map +1 -1
- package/build/Theme/theme.mjs.map +1 -1
- package/build/api/use-data-mutation.d.ts +3 -3
- package/build/api/use-data.d.ts +2 -2
- package/build/components/ActionBar/ActionBar.d.ts +1 -1
- package/build/components/ActionBar/ActionBarAction.d.ts +7 -2
- package/build/components/AppRoute/AppRoute.d.ts +1 -1
- package/build/components/Author/Author.d.ts +1 -1
- package/build/components/Author/styles.d.ts +9 -2
- package/build/components/CopyClipboard/CopyToClipBoard.d.ts +1 -1
- package/build/components/CopyClipboard/utils.d.ts +1 -1
- package/build/components/Dependencies/Dependencies.d.ts +1 -1
- package/build/components/Dependencies/DependencyBlock.d.ts +15 -7
- package/build/components/Dependencies/DependencyBlock.mjs +2 -2
- package/build/components/Dependencies/DependencyBlock.mjs.map +1 -1
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Dependencies/types.d.ts +1 -1
- package/build/components/Deprecated/Deprecated.d.ts +1 -1
- package/build/components/Developers/Developers.d.ts +8 -3
- package/build/components/Developers/Title.d.ts +1 -1
- package/build/components/Developers/Title.mjs +2 -2
- package/build/components/Developers/Title.mjs.map +1 -1
- package/build/components/Developers/get-unique-developer-values.d.ts +1 -1
- package/build/components/Distribution/Dist.d.ts +2 -2
- package/build/components/Distribution/styles.d.ts +12 -3
- package/build/components/Distribution/styles.mjs +2 -2
- package/build/components/Distribution/styles.mjs.map +1 -1
- package/build/components/Engines/Engines.d.ts +2 -2
- package/build/components/Engines/styles.d.ts +9 -2
- package/build/components/Engines/styles.mjs +2 -2
- package/build/components/Engines/styles.mjs.map +1 -1
- package/build/components/ErrorBoundary/ErrorBoundary.d.ts +2 -3
- package/build/components/Forbidden/Forbidden.d.ts +1 -1
- package/build/components/FundButton/FundButton.d.ts +1 -1
- package/build/components/FundButton/FundButton.js +1 -1
- package/build/components/FundButton/FundButton.js.map +1 -1
- package/build/components/FundButton/FundButton.mjs +1 -1
- package/build/components/FundButton/FundButton.mjs.map +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.d.ts +1 -1
- package/build/components/Heading/Heading.d.ts +2 -2
- package/build/components/Heading/Heading.mjs +2 -2
- package/build/components/Heading/Heading.mjs.map +1 -1
- package/build/components/Help/Help.d.ts +1 -1
- package/build/components/Help/Help.mjs +3 -3
- package/build/components/Help/Help.mjs.map +1 -1
- package/build/components/Help/styles.d.ts +3 -1
- package/build/components/Icons/DevsIcons/CommonJS.d.ts +1 -1
- package/build/components/Icons/DevsIcons/ES6Module.d.ts +1 -1
- package/build/components/Icons/DevsIcons/Git.d.ts +1 -1
- package/build/components/Icons/DevsIcons/NodeJS.d.ts +1 -1
- package/build/components/Icons/DevsIcons/TypeScript.d.ts +1 -1
- package/build/components/Icons/DevsIcons/commonjs.svg +4 -0
- package/build/components/Icons/DevsIcons/es6module.svg +4 -0
- package/build/components/Icons/DevsIcons/git.svg +4 -0
- package/build/components/Icons/DevsIcons/nodejs.svg +6 -0
- package/build/components/Icons/DevsIcons/typescript.svg +4 -0
- package/build/components/Icons/Earth.d.ts +1 -1
- package/build/components/Icons/FileBinary.d.ts +1 -1
- package/build/components/Icons/Law.d.ts +1 -1
- package/build/components/Icons/License.d.ts +1 -1
- package/build/components/Icons/Managers/Npm.d.ts +1 -1
- package/build/components/Icons/Managers/Pnpm.d.ts +1 -1
- package/build/components/Icons/Managers/Yarn.d.ts +1 -1
- package/build/components/Icons/Managers/npm.svg +15 -0
- package/build/components/Icons/Managers/pnpm.svg +1 -0
- package/build/components/Icons/Managers/yarn.svg +1 -0
- package/build/components/Icons/SvgIcon.d.ts +2 -2
- package/build/components/Icons/Time.d.ts +1 -1
- package/build/components/Icons/Version.d.ts +1 -1
- package/build/components/Install/Install.d.ts +3 -3
- package/build/components/Install/InstallListItem.d.ts +1 -1
- package/build/components/Install/InstallListItem.mjs +2 -2
- package/build/components/Install/InstallListItem.mjs.map +1 -1
- package/build/components/Keywords/KeywordListItems.d.ts +1 -1
- package/build/components/Keywords/Keywords.d.ts +2 -2
- package/build/components/Keywords/Keywords.mjs +2 -2
- package/build/components/Keywords/Keywords.mjs.map +1 -1
- package/build/components/Label/Label.d.ts +2 -2
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.mjs +2 -2
- package/build/components/Link/Link.mjs.map +1 -1
- package/build/components/LinkExternal/LinkExternal.d.ts +1 -1
- package/build/components/Loading/Loading.d.ts +1 -1
- package/build/components/Loading/Spinner/Spinner.d.ts +1 -1
- package/build/components/Loading/styles.d.ts +7 -7
- package/build/components/LoginDialog/LoginDialog.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.js +2 -2
- package/build/components/LoginDialog/LoginDialogCloseButton.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.mjs +2 -2
- package/build/components/LoginDialog/LoginDialogCloseButton.mjs.map +1 -1
- package/build/components/LoginDialog/LoginDialogForm.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogFormError.d.ts +1 -1
- package/build/components/LoginForm/Login.d.ts +2 -2
- package/build/components/LoginForm/Login.mjs +2 -2
- package/build/components/LoginForm/Login.mjs.map +1 -1
- package/build/components/LoginForm/PasswordField.d.ts +3 -3
- package/build/components/LoginForm/UsernameField.d.ts +3 -3
- package/build/components/LoginForm/styles.d.ts +1 -1
- package/build/components/LoginForm/styles.js +2 -2
- package/build/components/LoginForm/styles.js.map +1 -1
- package/build/components/LoginForm/styles.mjs +2 -2
- package/build/components/LoginForm/styles.mjs.map +1 -1
- package/build/components/LoginForm/useLoginForm.d.ts +17 -17
- package/build/components/Logo/Logo.d.ts +1 -1
- package/build/components/Logo/img/logo-black-and-white.svg +1 -0
- package/build/components/Logo/img/logo.svg +1 -0
- package/build/components/MenuItem/MenuItem.d.ts +2 -2
- package/build/components/NoItems/NoItems.d.ts +1 -1
- package/build/components/NoItems/NoItems.mjs +2 -2
- package/build/components/NoItems/NoItems.mjs.map +1 -1
- package/build/components/NotFound/NotFound.d.ts +1 -1
- package/build/components/NotFound/img/package.svg +1 -0
- package/build/components/Package/Package.d.ts +3 -3
- package/build/components/Package/Package.js.map +1 -1
- package/build/components/Package/Package.mjs.map +1 -1
- package/build/components/Package/styles.d.ts +39 -29
- package/build/components/Package/styles.mjs +2 -2
- package/build/components/Package/styles.mjs.map +1 -1
- package/build/components/PackageList/PackageList.d.ts +2 -2
- package/build/components/Person/Person.d.ts +2 -2
- package/build/components/Person/PersonTooltip.d.ts +2 -2
- package/build/components/Person/PersonTooltip.mjs +2 -2
- package/build/components/Person/PersonTooltip.mjs.map +1 -1
- package/build/components/Person/utils.d.ts +1 -1
- package/build/components/RawViewer/RawViewer.d.ts +1 -1
- package/build/components/Readme/Readme.d.ts +2 -5
- package/build/components/Readme/Readme.js +6 -6
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.mjs +6 -6
- package/build/components/Readme/Readme.mjs.map +1 -1
- package/build/components/Readme/github-markdown.css +1654 -0
- package/build/components/Readme/hljs-github-dark.css +117 -0
- package/build/components/Readme/hljs-github-light.css +117 -0
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.d.ts +2 -2
- package/build/components/RegistryInfoDialog/styles.d.ts +11 -7
- package/build/components/RegistryInfoDialog/types.d.ts +1 -1
- package/build/components/Repository/Repository.d.ts +1 -1
- package/build/components/Repository/Repository.mjs +4 -4
- package/build/components/Repository/Repository.mjs.map +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.d.ts +2 -3
- package/build/components/Search/AutoComplete/styles.d.ts +3 -3
- package/build/components/Search/Search.d.ts +1 -1
- package/build/components/Search/Search.js +15 -30
- package/build/components/Search/Search.js.map +1 -1
- package/build/components/Search/Search.mjs +15 -30
- package/build/components/Search/Search.mjs.map +1 -1
- package/build/components/Search/SearchItem.d.ts +4 -4
- package/build/components/Search/styles.d.ts +10 -6
- package/build/components/Search/utils.d.ts +21 -0
- package/build/components/Search/utils.js +37 -0
- package/build/components/Search/utils.js.map +1 -1
- package/build/components/Search/utils.mjs +37 -1
- package/build/components/Search/utils.mjs.map +1 -1
- package/build/components/SettingsMenu/SettingsMenu.d.ts +1 -1
- package/build/components/SideBarTitle/SideBarTitle.d.ts +1 -1
- package/build/components/UnAuthorized/UnAuthorized.d.ts +1 -1
- package/build/components/UpLinks/UpLinks.d.ts +1 -1
- package/build/components/UpLinks/UplinkLink.d.ts +1 -1
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.d.ts +11 -7
- package/build/components/UpLinks/styles.mjs +5 -5
- package/build/components/UpLinks/styles.mjs.map +1 -1
- package/build/components/Versions/HistoryList.d.ts +2 -2
- package/build/components/Versions/TagList.d.ts +2 -2
- package/build/components/Versions/Versions.d.ts +7 -2
- package/build/components/Versions/Versions.mjs +2 -2
- package/build/components/Versions/Versions.mjs.map +1 -1
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.d.ts +6 -6
- package/build/components/Versions/styles.mjs +3 -3
- package/build/components/Versions/styles.mjs.map +1 -1
- package/build/components/Versions/types.d.ts +1 -1
- package/build/configuration.d.ts +1 -1
- package/build/hooks/useOnClickOutside.d.ts +1 -1
- package/build/index.d.ts +0 -3
- package/build/index.js +59 -62
- package/build/index.mjs +2 -6
- package/build/layouts/Security/Dialog.d.ts +1 -1
- package/build/layouts/Version/Version.d.ts +1 -1
- package/build/pages/Front/index.js +1 -1
- package/build/pages/Version/Version.d.ts +1 -1
- package/build/pages/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.d.ts +2 -2
- package/build/providers/AuthProvider/AuthProvider.d.ts +2 -3
- package/build/providers/AuthProvider/types.d.ts +1 -1
- package/build/providers/AuthProvider/utils.d.ts +1 -1
- package/build/providers/DownloadProvider/DownloadProvider.d.ts +1 -2
- package/build/providers/ManifestsProvider/ManifestsProvider.d.ts +2 -3
- package/build/providers/ManifestsProvider/README.md +22 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +1 -2
- package/build/providers/SearchProvider/SearchProvider.d.ts +2 -3
- package/build/providers/TranslatorProvider/TranslatorProvider.d.ts +2 -3
- package/build/providers/VersionProvider/README.md +22 -0
- package/build/providers/VersionProvider/VersionProvider.d.ts +2 -2
- package/build/routes/SecurityRoutes.d.ts +1 -1
- package/build/sections/Detail/ContainerContent.d.ts +1 -1
- package/build/sections/Detail/Detail.d.ts +1 -1
- package/build/sections/Detail/ReadmeSection.d.ts +1 -1
- package/build/sections/Detail/Tabs.d.ts +1 -1
- package/build/sections/Footer/Footer.d.ts +1 -1
- package/build/sections/Footer/styles.d.ts +17 -17
- package/build/sections/Header/Header.d.ts +1 -1
- package/build/sections/Header/HeaderGreetings.d.ts +1 -1
- package/build/sections/Header/HeaderLeft.d.ts +1 -1
- package/build/sections/Header/HeaderMenu.d.ts +1 -2
- package/build/sections/Header/HeaderMenu.js +10 -11
- package/build/sections/Header/HeaderMenu.js.map +1 -1
- package/build/sections/Header/HeaderMenu.mjs +10 -11
- package/build/sections/Header/HeaderMenu.mjs.map +1 -1
- package/build/sections/Header/HeaderRight.d.ts +1 -1
- package/build/sections/Header/HeaderSettingsDialog.d.ts +1 -1
- package/build/sections/Header/HeaderToolTip.d.ts +2 -2
- package/build/sections/Header/HeaderToolTipIcon.d.ts +1 -1
- package/build/sections/Header/LanguageSwitch.d.ts +12 -3
- package/build/sections/Header/LanguageSwitch.mjs +2 -2
- package/build/sections/Header/LanguageSwitch.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +7 -8
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs +5 -5
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.d.ts +7 -7
- package/build/sections/Header/styles.d.ts +33 -19
- package/build/sections/Home/Home.d.ts +1 -1
- package/build/sections/Security/AddUser.d.ts +1 -1
- package/build/sections/Security/AddUser.js +0 -1
- package/build/sections/Security/AddUser.js.map +1 -1
- package/build/sections/Security/AddUser.mjs +0 -1
- package/build/sections/Security/AddUser.mjs.map +1 -1
- package/build/sections/Security/ChangePassword.d.ts +1 -1
- package/build/sections/Security/ChangePassword.js +0 -1
- package/build/sections/Security/ChangePassword.js.map +1 -1
- package/build/sections/Security/ChangePassword.mjs +0 -1
- package/build/sections/Security/ChangePassword.mjs.map +1 -1
- package/build/sections/Security/Login.d.ts +1 -1
- package/build/sections/Security/Success.d.ts +1 -1
- package/build/sections/Security/styles.d.ts +5 -3
- package/build/sections/Security/styles.js +1 -1
- package/build/sections/Security/styles.js.map +1 -1
- package/build/sections/Security/styles.mjs +1 -1
- package/build/sections/Security/styles.mjs.map +1 -1
- package/build/sections/SideBar/Sidebar.d.ts +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/packageMeta.d.ts +1 -1
- package/build/ui-components.css +1024 -334
- package/build/utils/cli-utils.d.ts +1 -1
- package/build/utils/loadable.d.ts +1 -1
- package/build/utils/utils.d.ts +2 -2
- package/package.json +5 -8
- package/build/pages/Security/index.js +0 -4
- package/build/pages/Security/index.mjs +0 -4
- package/build/test/i18n-config.d.ts +0 -2
- package/build/test/test-react-testing-library.d.ts +0 -23
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Theme } from '../../';
|
|
2
2
|
export interface InputFieldProps {
|
|
3
3
|
color: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const StyledTextField: import(
|
|
6
|
-
variant?: import(
|
|
7
|
-
} & Omit<import(
|
|
8
|
-
theme?: import(
|
|
5
|
+
export declare const StyledTextField: import('@emotion/styled').StyledComponent<{
|
|
6
|
+
variant?: import('@mui/material').TextFieldVariants | undefined;
|
|
7
|
+
} & Omit<import('@mui/material').OutlinedTextFieldProps | import('@mui/material').FilledTextFieldProps | import('@mui/material').StandardTextFieldProps, "variant"> & {
|
|
8
|
+
theme?: import('@emotion/react').Theme;
|
|
9
|
+
} & {
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export declare const StyledInputAdornment: import('@emotion/styled').StyledComponent<import('@mui/material').InputAdornmentOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "position" | "className" | "classes" | "sx" | "variant" | "disableTypography" | "disablePointerEvents"> & {
|
|
13
|
+
theme?: import('@emotion/react').Theme;
|
|
9
14
|
} & {
|
|
10
15
|
theme?: Theme;
|
|
11
16
|
}, {}, {}>;
|
|
12
|
-
export declare const StyledInputAdornment: import("@emotion/styled").StyledComponent<any, {}, {}>;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
+
export type NormalizedSearchOption = {
|
|
2
|
+
name: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
isPrivate: boolean;
|
|
6
|
+
isCached: boolean;
|
|
7
|
+
isRemote: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Normalize a raw search result into a unified shape the UI can render,
|
|
11
|
+
* regardless of which backend response format was returned:
|
|
12
|
+
*
|
|
13
|
+
* 1) npm-style "search objects" response where each entry is wrapped in
|
|
14
|
+
* `{ package: { name, version, description, ... }, verdaccioPrivate, verdaccioPkgCached }`.
|
|
15
|
+
* 2) Flat packument-style response where each entry exposes `name`, `version`,
|
|
16
|
+
* `description`, `dist`, etc. directly at the top level.
|
|
17
|
+
*
|
|
18
|
+
* The second shape carries no uplink metadata, so private/remote/cached flags
|
|
19
|
+
* default to `false` and the UI simply omits the corresponding badges.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeSearchOption(option: any): NormalizedSearchOption;
|
|
1
22
|
export declare function cleanDescription(description: string): string;
|
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
//#region src/components/Search/utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a raw search result into a unified shape the UI can render,
|
|
4
|
+
* regardless of which backend response format was returned:
|
|
5
|
+
*
|
|
6
|
+
* 1) npm-style "search objects" response where each entry is wrapped in
|
|
7
|
+
* `{ package: { name, version, description, ... }, verdaccioPrivate, verdaccioPkgCached }`.
|
|
8
|
+
* 2) Flat packument-style response where each entry exposes `name`, `version`,
|
|
9
|
+
* `description`, `dist`, etc. directly at the top level.
|
|
10
|
+
*
|
|
11
|
+
* The second shape carries no uplink metadata, so private/remote/cached flags
|
|
12
|
+
* default to `false` and the UI simply omits the corresponding badges.
|
|
13
|
+
*/
|
|
14
|
+
function normalizeSearchOption(option) {
|
|
15
|
+
if (option && typeof option === "object" && option.package) {
|
|
16
|
+
const pkg = option.package ?? {};
|
|
17
|
+
const isPrivate = Boolean(option.verdaccioPrivate);
|
|
18
|
+
const isCached = Boolean(option.verdaccioPkgCached);
|
|
19
|
+
return {
|
|
20
|
+
name: pkg.name,
|
|
21
|
+
version: pkg.version,
|
|
22
|
+
description: pkg.description,
|
|
23
|
+
isPrivate,
|
|
24
|
+
isCached,
|
|
25
|
+
isRemote: !isCached && !isPrivate
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const flat = option ?? {};
|
|
29
|
+
return {
|
|
30
|
+
name: flat.name,
|
|
31
|
+
version: flat.version,
|
|
32
|
+
description: flat.description,
|
|
33
|
+
isPrivate: false,
|
|
34
|
+
isCached: false,
|
|
35
|
+
isRemote: false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
2
38
|
function removeHtmlTags(input) {
|
|
3
39
|
let previous;
|
|
4
40
|
do {
|
|
@@ -15,5 +51,6 @@ function cleanDescription(description) {
|
|
|
15
51
|
}
|
|
16
52
|
//#endregion
|
|
17
53
|
exports.cleanDescription = cleanDescription;
|
|
54
|
+
exports.normalizeSearchOption = normalizeSearchOption;
|
|
18
55
|
|
|
19
56
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/Search/utils.ts"],"sourcesContent":["function removeHtmlTags(input: string): string {\n let previous;\n do {\n previous = input;\n input = input.replace(/<[^>]*>?/gm, '');\n } while (input !== previous);\n return input;\n}\n\nexport function cleanDescription(description: string): string {\n let output = description;\n // remove html tags from description (e.g. <h1...>)\n output = removeHtmlTags(output);\n // remove markdown links from description (e.g. [link](url))\n output = output.replace(/\\(.*?\\)/gm, '').replace(/(\\[!?|\\])/gm, '');\n return output;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/Search/utils.ts"],"sourcesContent":["export type NormalizedSearchOption = {\n name: string;\n version?: string;\n description?: string;\n isPrivate: boolean;\n isCached: boolean;\n isRemote: boolean;\n};\n\n/**\n * Normalize a raw search result into a unified shape the UI can render,\n * regardless of which backend response format was returned:\n *\n * 1) npm-style \"search objects\" response where each entry is wrapped in\n * `{ package: { name, version, description, ... }, verdaccioPrivate, verdaccioPkgCached }`.\n * 2) Flat packument-style response where each entry exposes `name`, `version`,\n * `description`, `dist`, etc. directly at the top level.\n *\n * The second shape carries no uplink metadata, so private/remote/cached flags\n * default to `false` and the UI simply omits the corresponding badges.\n */\nexport function normalizeSearchOption(option: any): NormalizedSearchOption {\n if (option && typeof option === 'object' && option.package) {\n const pkg = option.package ?? {};\n const isPrivate = Boolean(option.verdaccioPrivate);\n const isCached = Boolean(option.verdaccioPkgCached);\n return {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n isPrivate,\n isCached,\n isRemote: !isCached && !isPrivate,\n };\n }\n\n const flat = option ?? {};\n return {\n name: flat.name,\n version: flat.version,\n description: flat.description,\n isPrivate: false,\n isCached: false,\n isRemote: false,\n };\n}\n\nfunction removeHtmlTags(input: string): string {\n let previous;\n do {\n previous = input;\n input = input.replace(/<[^>]*>?/gm, '');\n } while (input !== previous);\n return input;\n}\n\nexport function cleanDescription(description: string): string {\n let output = description;\n // remove html tags from description (e.g. <h1...>)\n output = removeHtmlTags(output);\n // remove markdown links from description (e.g. [link](url))\n output = output.replace(/\\(.*?\\)/gm, '').replace(/(\\[!?|\\])/gm, '');\n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAgB,sBAAsB,QAAqC;AACzE,KAAI,UAAU,OAAO,WAAW,YAAY,OAAO,SAAS;EAC1D,MAAM,MAAM,OAAO,WAAW,EAAE;EAChC,MAAM,YAAY,QAAQ,OAAO,iBAAiB;EAClD,MAAM,WAAW,QAAQ,OAAO,mBAAmB;AACnD,SAAO;GACL,MAAM,IAAI;GACV,SAAS,IAAI;GACb,aAAa,IAAI;GACjB;GACA;GACA,UAAU,CAAC,YAAY,CAAC;GACzB;;CAGH,MAAM,OAAO,UAAU,EAAE;AACzB,QAAO;EACL,MAAM,KAAK;EACX,SAAS,KAAK;EACd,aAAa,KAAK;EAClB,WAAW;EACX,UAAU;EACV,UAAU;EACX;;AAGH,SAAS,eAAe,OAAuB;CAC7C,IAAI;AACJ,IAAG;AACD,aAAW;AACX,UAAQ,MAAM,QAAQ,cAAc,GAAG;UAChC,UAAU;AACnB,QAAO;;AAGT,SAAgB,iBAAiB,aAA6B;CAC5D,IAAI,SAAS;AAEb,UAAS,eAAe,OAAO;AAE/B,UAAS,OAAO,QAAQ,aAAa,GAAG,CAAC,QAAQ,eAAe,GAAG;AACnE,QAAO"}
|
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
//#region src/components/Search/utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a raw search result into a unified shape the UI can render,
|
|
4
|
+
* regardless of which backend response format was returned:
|
|
5
|
+
*
|
|
6
|
+
* 1) npm-style "search objects" response where each entry is wrapped in
|
|
7
|
+
* `{ package: { name, version, description, ... }, verdaccioPrivate, verdaccioPkgCached }`.
|
|
8
|
+
* 2) Flat packument-style response where each entry exposes `name`, `version`,
|
|
9
|
+
* `description`, `dist`, etc. directly at the top level.
|
|
10
|
+
*
|
|
11
|
+
* The second shape carries no uplink metadata, so private/remote/cached flags
|
|
12
|
+
* default to `false` and the UI simply omits the corresponding badges.
|
|
13
|
+
*/
|
|
14
|
+
function normalizeSearchOption(option) {
|
|
15
|
+
if (option && typeof option === "object" && option.package) {
|
|
16
|
+
const pkg = option.package ?? {};
|
|
17
|
+
const isPrivate = Boolean(option.verdaccioPrivate);
|
|
18
|
+
const isCached = Boolean(option.verdaccioPkgCached);
|
|
19
|
+
return {
|
|
20
|
+
name: pkg.name,
|
|
21
|
+
version: pkg.version,
|
|
22
|
+
description: pkg.description,
|
|
23
|
+
isPrivate,
|
|
24
|
+
isCached,
|
|
25
|
+
isRemote: !isCached && !isPrivate
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const flat = option ?? {};
|
|
29
|
+
return {
|
|
30
|
+
name: flat.name,
|
|
31
|
+
version: flat.version,
|
|
32
|
+
description: flat.description,
|
|
33
|
+
isPrivate: false,
|
|
34
|
+
isCached: false,
|
|
35
|
+
isRemote: false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
2
38
|
function removeHtmlTags(input) {
|
|
3
39
|
let previous;
|
|
4
40
|
do {
|
|
@@ -14,6 +50,6 @@ function cleanDescription(description) {
|
|
|
14
50
|
return output;
|
|
15
51
|
}
|
|
16
52
|
//#endregion
|
|
17
|
-
export { cleanDescription };
|
|
53
|
+
export { cleanDescription, normalizeSearchOption };
|
|
18
54
|
|
|
19
55
|
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/components/Search/utils.ts"],"sourcesContent":["function removeHtmlTags(input: string): string {\n let previous;\n do {\n previous = input;\n input = input.replace(/<[^>]*>?/gm, '');\n } while (input !== previous);\n return input;\n}\n\nexport function cleanDescription(description: string): string {\n let output = description;\n // remove html tags from description (e.g. <h1...>)\n output = removeHtmlTags(output);\n // remove markdown links from description (e.g. [link](url))\n output = output.replace(/\\(.*?\\)/gm, '').replace(/(\\[!?|\\])/gm, '');\n return output;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/components/Search/utils.ts"],"sourcesContent":["export type NormalizedSearchOption = {\n name: string;\n version?: string;\n description?: string;\n isPrivate: boolean;\n isCached: boolean;\n isRemote: boolean;\n};\n\n/**\n * Normalize a raw search result into a unified shape the UI can render,\n * regardless of which backend response format was returned:\n *\n * 1) npm-style \"search objects\" response where each entry is wrapped in\n * `{ package: { name, version, description, ... }, verdaccioPrivate, verdaccioPkgCached }`.\n * 2) Flat packument-style response where each entry exposes `name`, `version`,\n * `description`, `dist`, etc. directly at the top level.\n *\n * The second shape carries no uplink metadata, so private/remote/cached flags\n * default to `false` and the UI simply omits the corresponding badges.\n */\nexport function normalizeSearchOption(option: any): NormalizedSearchOption {\n if (option && typeof option === 'object' && option.package) {\n const pkg = option.package ?? {};\n const isPrivate = Boolean(option.verdaccioPrivate);\n const isCached = Boolean(option.verdaccioPkgCached);\n return {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n isPrivate,\n isCached,\n isRemote: !isCached && !isPrivate,\n };\n }\n\n const flat = option ?? {};\n return {\n name: flat.name,\n version: flat.version,\n description: flat.description,\n isPrivate: false,\n isCached: false,\n isRemote: false,\n };\n}\n\nfunction removeHtmlTags(input: string): string {\n let previous;\n do {\n previous = input;\n input = input.replace(/<[^>]*>?/gm, '');\n } while (input !== previous);\n return input;\n}\n\nexport function cleanDescription(description: string): string {\n let output = description;\n // remove html tags from description (e.g. <h1...>)\n output = removeHtmlTags(output);\n // remove markdown links from description (e.g. [link](url))\n output = output.replace(/\\(.*?\\)/gm, '').replace(/(\\[!?|\\])/gm, '');\n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAgB,sBAAsB,QAAqC;AACzE,KAAI,UAAU,OAAO,WAAW,YAAY,OAAO,SAAS;EAC1D,MAAM,MAAM,OAAO,WAAW,EAAE;EAChC,MAAM,YAAY,QAAQ,OAAO,iBAAiB;EAClD,MAAM,WAAW,QAAQ,OAAO,mBAAmB;AACnD,SAAO;GACL,MAAM,IAAI;GACV,SAAS,IAAI;GACb,aAAa,IAAI;GACjB;GACA;GACA,UAAU,CAAC,YAAY,CAAC;GACzB;;CAGH,MAAM,OAAO,UAAU,EAAE;AACzB,QAAO;EACL,MAAM,KAAK;EACX,SAAS,KAAK;EACd,aAAa,KAAK;EAClB,WAAW;EACX,UAAU;EACV,UAAU;EACX;;AAGH,SAAS,eAAe,OAAuB;CAC7C,IAAI;AACJ,IAAG;AACD,aAAW;AACX,UAAQ,MAAM,QAAQ,cAAc,GAAG;UAChC,UAAU;AACnB,QAAO;;AAGT,SAAgB,iBAAiB,aAA6B;CAC5D,IAAI,SAAS;AAEb,UAAS,eAAe,OAAO;AAE/B,UAAS,OAAO,QAAQ,aAAa,GAAG,CAAC,QAAQ,eAAe,GAAG;AACnE,QAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const require_UpLinks = require("./UpLinks.js");
|
|
2
|
-
exports.default = require_UpLinks;
|
|
2
|
+
exports.default = require_UpLinks.default;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const StyledText: import(
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Theme } from '../../Theme';
|
|
2
|
+
export declare const StyledText: import('@emotion/styled').StyledComponent<import('@mui/material/Typography').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "children" | "p" | "style" | "zIndex" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "variant" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
3
|
+
theme?: import('@emotion/react').Theme;
|
|
4
|
+
} & {
|
|
5
|
+
theme?: Theme;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const Spacer: import('@emotion/styled').StyledComponent<{
|
|
8
|
+
theme?: import('@emotion/react').Theme;
|
|
5
9
|
as?: React.ElementType;
|
|
6
10
|
} & {
|
|
7
11
|
theme?: Theme;
|
|
8
|
-
}, import(
|
|
9
|
-
export declare const ListItemText: import(
|
|
10
|
-
theme?: import(
|
|
12
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const ListItemText: import('@emotion/styled').StyledComponent<import('@mui/material/ListItemText').ListItemTextProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>> & {
|
|
14
|
+
theme?: import('@emotion/react').Theme;
|
|
11
15
|
} & {
|
|
12
16
|
theme?: Theme;
|
|
13
17
|
}, {}, {}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { common } from "@mui/material/colors";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import Typography from "@mui/material/Typography";
|
|
4
|
+
import MuiListItemText from "@mui/material/ListItemText";
|
|
5
5
|
//#region src/components/UpLinks/styles.ts
|
|
6
|
-
var StyledText = styled(
|
|
6
|
+
var StyledText = styled(Typography)((props) => ({ fontWeight: props.theme.fontWeight.bold }));
|
|
7
7
|
var Spacer = styled("div")(({ theme }) => ({
|
|
8
8
|
flex: "1 1 auto",
|
|
9
9
|
borderBottom: `1px dotted ${theme.palette.mode == "light" ? "rgba(0, 0, 0, 0.2)" : "rgba(255, 255, 255, 0.2)"} `,
|
|
@@ -11,12 +11,12 @@ var Spacer = styled("div")(({ theme }) => ({
|
|
|
11
11
|
height: "0.5em",
|
|
12
12
|
margin: "0 16px"
|
|
13
13
|
}));
|
|
14
|
-
var ListItemText
|
|
14
|
+
var ListItemText = styled(MuiListItemText)(({ theme }) => ({
|
|
15
15
|
flex: "none",
|
|
16
16
|
color: theme.palette.mode == "light" ? theme.palette.black : common.white,
|
|
17
17
|
opacity: .6
|
|
18
18
|
}));
|
|
19
19
|
//#endregion
|
|
20
|
-
export { ListItemText
|
|
20
|
+
export { ListItemText, Spacer, StyledText };
|
|
21
21
|
|
|
22
22
|
//# sourceMappingURL=styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.mjs","names":[],"sources":["../../../src/components/UpLinks/styles.ts"],"sourcesContent":["import styled from '@emotion/styled';\nimport { default as MuiListItemText } from '@mui/material/ListItemText';\nimport Typography from '@mui/material/Typography';\nimport { common } from '@mui/material/colors';\n\nimport type { Theme } from '../../Theme';\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n}));\n\nexport const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({\n flex: '1 1 auto',\n borderBottom: `1px dotted ${\n theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'\n } `,\n whiteSpace: 'nowrap',\n height: '0.5em',\n margin: '0 16px',\n}));\n\nexport const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({\n flex: 'none',\n color: theme.palette.mode == 'light' ? theme.palette.black : common.white,\n opacity: 0.6,\n}));\n"],"mappings":";;;;;AAOA,IAAa,aAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"styles.mjs","names":[],"sources":["../../../src/components/UpLinks/styles.ts"],"sourcesContent":["import styled from '@emotion/styled';\nimport { default as MuiListItemText } from '@mui/material/ListItemText';\nimport Typography from '@mui/material/Typography';\nimport { common } from '@mui/material/colors';\n\nimport type { Theme } from '../../Theme';\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n}));\n\nexport const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({\n flex: '1 1 auto',\n borderBottom: `1px dotted ${\n theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'\n } `,\n whiteSpace: 'nowrap',\n height: '0.5em',\n margin: '0 16px',\n}));\n\nexport const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({\n flex: 'none',\n color: theme.palette.mode == 'light' ? theme.palette.black : common.white,\n opacity: 0.6,\n}));\n"],"mappings":";;;;;AAOA,IAAa,aAAa,OAAO,WAAW,EAAqB,WAAW,EAC1E,YAAY,MAAM,MAAM,WAAW,MACpC,EAAE;AAEH,IAAa,SAAS,OAAO,MAAM,EAAqB,EAAE,aAAa;CACrE,MAAM;CACN,cAAc,cACZ,MAAM,QAAQ,QAAQ,UAAU,uBAAuB,2BACxD;CACD,YAAY;CACZ,QAAQ;CACR,QAAQ;CACT,EAAE;AAEH,IAAa,eAAe,OAAO,gBAAgB,EAAqB,EAAE,aAAa;CACrF,MAAM;CACN,OAAO,MAAM,QAAQ,QAAQ,UAAU,MAAM,QAAQ,QAAQ,OAAO;CACpE,SAAS;CACV,EAAE"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Theme } from '../../Theme';
|
|
2
3
|
export type Props = {
|
|
3
4
|
packageMeta: any;
|
|
4
5
|
packageName: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const StyledText: import(
|
|
7
|
+
export declare const StyledText: import('@emotion/styled').StyledComponent<import('@mui/material/Typography').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "children" | "p" | "style" | "zIndex" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "variant" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
8
|
+
theme?: import('@emotion/react').Theme;
|
|
9
|
+
} & {
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
}, {}, {}>;
|
|
7
12
|
declare const Versions: React.FC<Props>;
|
|
8
13
|
export default Versions;
|
|
@@ -8,14 +8,14 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import Box from "@mui/material/Box";
|
|
9
9
|
import { debounce } from "lodash-es";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import
|
|
11
|
+
import Typography from "@mui/material/Typography";
|
|
12
12
|
import Card from "@mui/material/Card";
|
|
13
13
|
import CardContent from "@mui/material/CardContent";
|
|
14
14
|
import Alert from "@mui/material/Alert";
|
|
15
15
|
import TextField from "@mui/material/TextField";
|
|
16
16
|
import semver from "semver";
|
|
17
17
|
//#region src/components/Versions/Versions.tsx
|
|
18
|
-
var StyledText = styled(
|
|
18
|
+
var StyledText = styled(Typography)((props) => ({
|
|
19
19
|
fontWeight: props.theme && props.theme.fontWeight.bold,
|
|
20
20
|
textTransform: "capitalize"
|
|
21
21
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Versions.mjs","names":[],"sources":["../../../src/components/Versions/Versions.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport TextField from '@mui/material/TextField';\nimport Typography from '@mui/material/Typography';\nimport { debounce } from 'lodash-es';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport semver from 'semver';\n\nimport type { Theme } from '../../Theme';\nimport { useConfig } from '../../providers';\nimport VersionsHistoryList from './HistoryList';\nimport VersionsTagList from './TagList';\n\nexport type Props = { packageMeta: any; packageName: string };\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme && props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nconst Versions: React.FC<Props> = ({ packageMeta, packageName }) => {\n const { t } = useTranslation();\n const { configOptions } = useConfig();\n const { versions = {}, time = {}, ['dist-tags']: distTags = {} } = packageMeta;\n\n const [packageVersions, setPackageVersions] = useState(versions);\n if (!packageMeta || Object.keys(packageMeta).length === 0) {\n return null;\n }\n const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;\n const hasDistTags = distTags && Object.keys(distTags).length > 0 && packageName;\n const hasVersionHistory =\n packageVersions && Object.keys(packageVersions).length > 0 && packageName;\n\n const filterVersions = (textSearch) => {\n const filteredVersions = Object.keys(versions).reduce((acc, version) => {\n if (textSearch !== '') {\n if (typeof versions[version] !== 'undefined') {\n if (semver.satisfies(version, textSearch, { includePrerelease: true, loose: true })) {\n acc[version] = versions[version];\n }\n }\n } else {\n acc[version] = versions[version];\n }\n return acc;\n }, {});\n\n setPackageVersions(filteredVersions);\n };\n\n return (\n <Card sx={{ mb: 2 }}>\n <CardContent>\n <Box data-testid=\"versions\" sx={{ m: 2 }}>\n {hasDistTags ? (\n <>\n <StyledText variant=\"subtitle1\">\n {t('versions.current-tags')}\n <span>{` (${Object.keys(distTags).length})`}</span>\n </StyledText>\n <VersionsTagList packageName={packageName} tags={distTags} time={time} />\n </>\n ) : null}\n <>\n <StyledText variant=\"subtitle1\">\n {t('versions.version-history')}\n <span>{` (${Object.keys(packageVersions).length})`}</span>\n </StyledText>\n <TextField\n helperText={t('versions.search.placeholder')}\n onChange={debounce((e) => {\n filterVersions(e.target.value);\n }, 200)}\n size=\"small\"\n variant=\"standard\"\n sx={{ width: '50%' }}\n />\n </>\n {hasVersionHistory ? (\n <>\n {hideDeprecatedVersions === true && (\n // @ts-ignore - Alert does accept children despite the type error\n <Alert severity=\"info\" sx={{ marginTop: 1, marginBottom: 1 }}>\n {t('versions.hide-deprecated')}\n </Alert>\n )}\n <VersionsHistoryList\n packageName={packageName}\n time={time}\n versions={packageVersions}\n />\n </>\n ) : null}\n </Box>\n </CardContent>\n </Card>\n );\n};\n\nexport default Versions;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAa,aAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"Versions.mjs","names":[],"sources":["../../../src/components/Versions/Versions.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport TextField from '@mui/material/TextField';\nimport Typography from '@mui/material/Typography';\nimport { debounce } from 'lodash-es';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport semver from 'semver';\n\nimport type { Theme } from '../../Theme';\nimport { useConfig } from '../../providers';\nimport VersionsHistoryList from './HistoryList';\nimport VersionsTagList from './TagList';\n\nexport type Props = { packageMeta: any; packageName: string };\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme && props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nconst Versions: React.FC<Props> = ({ packageMeta, packageName }) => {\n const { t } = useTranslation();\n const { configOptions } = useConfig();\n const { versions = {}, time = {}, ['dist-tags']: distTags = {} } = packageMeta;\n\n const [packageVersions, setPackageVersions] = useState(versions);\n if (!packageMeta || Object.keys(packageMeta).length === 0) {\n return null;\n }\n const hideDeprecatedVersions = configOptions.hideDeprecatedVersions;\n const hasDistTags = distTags && Object.keys(distTags).length > 0 && packageName;\n const hasVersionHistory =\n packageVersions && Object.keys(packageVersions).length > 0 && packageName;\n\n const filterVersions = (textSearch) => {\n const filteredVersions = Object.keys(versions).reduce((acc, version) => {\n if (textSearch !== '') {\n if (typeof versions[version] !== 'undefined') {\n if (semver.satisfies(version, textSearch, { includePrerelease: true, loose: true })) {\n acc[version] = versions[version];\n }\n }\n } else {\n acc[version] = versions[version];\n }\n return acc;\n }, {});\n\n setPackageVersions(filteredVersions);\n };\n\n return (\n <Card sx={{ mb: 2 }}>\n <CardContent>\n <Box data-testid=\"versions\" sx={{ m: 2 }}>\n {hasDistTags ? (\n <>\n <StyledText variant=\"subtitle1\">\n {t('versions.current-tags')}\n <span>{` (${Object.keys(distTags).length})`}</span>\n </StyledText>\n <VersionsTagList packageName={packageName} tags={distTags} time={time} />\n </>\n ) : null}\n <>\n <StyledText variant=\"subtitle1\">\n {t('versions.version-history')}\n <span>{` (${Object.keys(packageVersions).length})`}</span>\n </StyledText>\n <TextField\n helperText={t('versions.search.placeholder')}\n onChange={debounce((e) => {\n filterVersions(e.target.value);\n }, 200)}\n size=\"small\"\n variant=\"standard\"\n sx={{ width: '50%' }}\n />\n </>\n {hasVersionHistory ? (\n <>\n {hideDeprecatedVersions === true && (\n // @ts-ignore - Alert does accept children despite the type error\n <Alert severity=\"info\" sx={{ marginTop: 1, marginBottom: 1 }}>\n {t('versions.hide-deprecated')}\n </Alert>\n )}\n <VersionsHistoryList\n packageName={packageName}\n time={time}\n versions={packageVersions}\n />\n </>\n ) : null}\n </Box>\n </CardContent>\n </Card>\n );\n};\n\nexport default Versions;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAa,aAAa,OAAO,WAAW,EAAqB,WAAW;CAC1E,YAAY,MAAM,SAAS,MAAM,MAAM,WAAW;CAClD,eAAe;CAChB,EAAE;AAEH,IAAM,YAA6B,EAAE,aAAa,kBAAkB;CAClE,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EAAE,kBAAkB,WAAW;CACrC,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,GAAG,cAAc,WAAW,EAAE,KAAK;CAEnE,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,SAAS;AAChE,KAAI,CAAC,eAAe,OAAO,KAAK,YAAY,CAAC,WAAW,EACtD,QAAO;CAET,MAAM,yBAAyB,cAAc;CAC7C,MAAM,cAAc,YAAY,OAAO,KAAK,SAAS,CAAC,SAAS,KAAK;CACpE,MAAM,oBACJ,mBAAmB,OAAO,KAAK,gBAAgB,CAAC,SAAS,KAAK;CAEhE,MAAM,kBAAkB,eAAe;AAcrC,qBAbyB,OAAO,KAAK,SAAS,CAAC,QAAQ,KAAK,YAAY;AACtE,OAAI,eAAe;QACb,OAAO,SAAS,aAAa;SAC3B,OAAO,UAAU,SAAS,YAAY;MAAE,mBAAmB;MAAM,OAAO;MAAM,CAAC,CACjF,KAAI,WAAW,SAAS;;SAI5B,KAAI,WAAW,SAAS;AAE1B,UAAO;KACN,EAAE,CAAC,CAE8B;;AAGtC,QACE,oBAAC,MAAD;EAAM,IAAI,EAAE,IAAI,GAAG;YACjB,oBAAC,aAAD,EAAA,UACE,qBAAC,KAAD;GAAK,eAAY;GAAW,IAAI,EAAE,GAAG,GAAG;aAAxC;IACG,cACC,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,YAAD;KAAY,SAAQ;eAApB,CACG,EAAE,wBAAwB,EAC3B,oBAAC,QAAD,EAAA,UAAO,KAAK,OAAO,KAAK,SAAS,CAAC,OAAO,IAAU,CAAA,CACxC;QACb,oBAAC,iBAAD;KAA8B;KAAa,MAAM;KAAgB;KAAQ,CAAA,CACxE,EAAA,CAAA,GACD;IACJ,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,YAAD;KAAY,SAAQ;eAApB,CACG,EAAE,2BAA2B,EAC9B,oBAAC,QAAD,EAAA,UAAO,KAAK,OAAO,KAAK,gBAAgB,CAAC,OAAO,IAAU,CAAA,CAC/C;QACb,oBAAC,WAAD;KACE,YAAY,EAAE,8BAA8B;KAC5C,UAAU,UAAU,MAAM;AACxB,qBAAe,EAAE,OAAO,MAAM;QAC7B,IAAI;KACP,MAAK;KACL,SAAQ;KACR,IAAI,EAAE,OAAO,OAAO;KACpB,CAAA,CACD,EAAA,CAAA;IACF,oBACC,qBAAA,YAAA,EAAA,UAAA,CACG,2BAA2B,QAE1B,oBAAC,OAAD;KAAO,UAAS;KAAO,IAAI;MAAE,WAAW;MAAG,cAAc;MAAG;eACzD,EAAE,2BAA2B;KACxB,CAAA,EAEV,oBAAC,qBAAD;KACe;KACP;KACN,UAAU;KACV,CAAA,CACD,EAAA,CAAA,GACD;IACA;MACM,CAAA;EACT,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const require_Versions = require("./Versions.js");
|
|
2
|
-
exports.default = require_Versions;
|
|
2
|
+
exports.default = require_Versions.default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const Spacer: import(
|
|
3
|
-
theme?: import(
|
|
1
|
+
import { Theme } from '../../Theme';
|
|
2
|
+
export declare const Spacer: import('@emotion/styled').StyledComponent<{
|
|
3
|
+
theme?: import('@emotion/react').Theme;
|
|
4
4
|
as?: React.ElementType;
|
|
5
5
|
} & {
|
|
6
6
|
theme?: Theme;
|
|
7
|
-
}, import(
|
|
8
|
-
export declare const ListItemText: import(
|
|
9
|
-
theme?: import(
|
|
7
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const ListItemText: import('@emotion/styled').StyledComponent<import('@mui/material/ListItemText').ListItemTextProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>, import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>> & {
|
|
9
|
+
theme?: import('@emotion/react').Theme;
|
|
10
10
|
} & {
|
|
11
11
|
theme?: Theme;
|
|
12
12
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { common } from "@mui/material/colors";
|
|
3
|
-
import
|
|
3
|
+
import MuiListItemText from "@mui/material/ListItemText";
|
|
4
4
|
//#region src/components/Versions/styles.ts
|
|
5
5
|
var Spacer = styled("div")(({ theme }) => ({
|
|
6
6
|
flex: "1 1 auto",
|
|
@@ -9,12 +9,12 @@ var Spacer = styled("div")(({ theme }) => ({
|
|
|
9
9
|
height: "0.5em",
|
|
10
10
|
margin: "0 16px"
|
|
11
11
|
}));
|
|
12
|
-
var ListItemText
|
|
12
|
+
var ListItemText = styled(MuiListItemText)(({ theme }) => ({
|
|
13
13
|
flex: "none",
|
|
14
14
|
opacity: .6,
|
|
15
15
|
color: theme.palette.mode == "light" ? theme.palette.black : common.white
|
|
16
16
|
}));
|
|
17
17
|
//#endregion
|
|
18
|
-
export { ListItemText
|
|
18
|
+
export { ListItemText, Spacer };
|
|
19
19
|
|
|
20
20
|
//# sourceMappingURL=styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.mjs","names":[],"sources":["../../../src/components/Versions/styles.ts"],"sourcesContent":["import styled from '@emotion/styled';\nimport { default as MuiListItemText } from '@mui/material/ListItemText';\nimport { common } from '@mui/material/colors';\n\nimport type { Theme } from '../../Theme';\n\nexport const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({\n flex: '1 1 auto',\n borderBottom: `1px dotted ${\n theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'\n } `,\n whiteSpace: 'nowrap',\n height: '0.5em',\n margin: '0 16px',\n}));\n\nexport const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({\n flex: 'none',\n opacity: 0.6,\n color: theme.palette.mode == 'light' ? theme.palette.black : common.white,\n}));\n"],"mappings":";;;;AAMA,IAAa,SAAS,OAAO,MAAM,EAAqB,EAAE,aAAa;CACrE,MAAM;CACN,cAAc,cACZ,MAAM,QAAQ,QAAQ,UAAU,uBAAuB,2BACxD;CACD,YAAY;CACZ,QAAQ;CACR,QAAQ;CACT,EAAE;AAEH,IAAa,
|
|
1
|
+
{"version":3,"file":"styles.mjs","names":[],"sources":["../../../src/components/Versions/styles.ts"],"sourcesContent":["import styled from '@emotion/styled';\nimport { default as MuiListItemText } from '@mui/material/ListItemText';\nimport { common } from '@mui/material/colors';\n\nimport type { Theme } from '../../Theme';\n\nexport const Spacer = styled('div')<{ theme?: Theme }>(({ theme }) => ({\n flex: '1 1 auto',\n borderBottom: `1px dotted ${\n theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'\n } `,\n whiteSpace: 'nowrap',\n height: '0.5em',\n margin: '0 16px',\n}));\n\nexport const ListItemText = styled(MuiListItemText)<{ theme?: Theme }>(({ theme }) => ({\n flex: 'none',\n opacity: 0.6,\n color: theme.palette.mode == 'light' ? theme.palette.black : common.white,\n}));\n"],"mappings":";;;;AAMA,IAAa,SAAS,OAAO,MAAM,EAAqB,EAAE,aAAa;CACrE,MAAM;CACN,cAAc,cACZ,MAAM,QAAQ,QAAQ,UAAU,uBAAuB,2BACxD;CACD,YAAY;CACZ,QAAQ;CACR,QAAQ;CACT,EAAE;AAEH,IAAa,eAAe,OAAO,gBAAgB,EAAqB,EAAE,aAAa;CACrF,MAAM;CACN,SAAS;CACT,OAAO,MAAM,QAAQ,QAAQ,UAAU,MAAM,QAAQ,QAAQ,OAAO;CACrE,EAAE"}
|
package/build/configuration.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TemplateUIOptions } from '@verdaccio/types';
|
|
2
2
|
export declare function getConfiguration(): TemplateUIOptions;
|
package/build/index.d.ts
CHANGED
|
@@ -43,9 +43,6 @@ export { default as Login } from './sections/Security/Login';
|
|
|
43
43
|
export { default as Success } from './sections/Security/Success';
|
|
44
44
|
export { default as AddUser } from './sections/Security/AddUser';
|
|
45
45
|
export { default as ChangePassword } from './sections/Security/ChangePassword';
|
|
46
|
-
export { default as FrontPage } from './pages/Front';
|
|
47
|
-
export { default as VersionPage } from './pages/Version';
|
|
48
|
-
export * from './pages/Security';
|
|
49
46
|
export { VersionLayout } from './layouts/Version';
|
|
50
47
|
export * from './providers';
|
|
51
48
|
export * from './utils';
|