@verdaccio/ui-components 3.0.0-next-7.7 → 3.0.0-next-7.8
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/.eslintrc +1 -1
- package/CHANGELOG.md +6 -0
- package/build/Theme/theme.js +3 -3
- package/build/components/ActionBar/ActionBar.js +3 -1
- package/build/components/ActionBar/ActionBarAction.js +7 -6
- package/build/components/Author/Author.js +13 -42
- package/build/components/CopyClipboard/utils.js +3 -12
- package/build/components/Dependencies/Dependencies.js +12 -13
- package/build/components/Dependencies/DependencyBlock.js +5 -4
- package/build/components/Developers/DeveloperType.js +12 -0
- package/build/components/Developers/Developers.js +20 -22
- package/build/components/Developers/Title.js +5 -9
- package/build/components/Developers/index.js +4 -4
- package/build/components/Distribution/Dist.js +1 -1
- package/build/components/Distribution/styles.js +10 -23
- package/build/components/Engines/Engines.js +7 -1
- package/build/components/Engines/styles.js +6 -6
- package/build/components/FundButton/FundButton.js +7 -8
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +2 -1
- package/build/components/Icons/DevsIcons/CommonJS.js +1 -12
- package/build/components/Icons/DevsIcons/ES6Module.js +2 -13
- package/build/components/Icons/DevsIcons/Git.js +1 -12
- package/build/components/Icons/DevsIcons/NodeJS.js +1 -12
- package/build/components/Icons/DevsIcons/TypeScript.js +1 -12
- package/build/components/Icons/FileBinary.js +11 -5
- package/build/components/Icons/Law.js +12 -6
- package/build/components/Icons/Managers/Npm.js +1 -12
- package/build/components/Icons/Managers/Pnpm.js +1 -12
- package/build/components/Icons/Managers/Yarn.js +1 -12
- package/build/components/Install/Install.js +23 -18
- package/build/components/Install/InstallListItem.js +19 -18
- package/build/components/Keywords/KeywordListItems.js +34 -0
- package/build/components/Keywords/Keywords.js +39 -0
- package/build/{sections/Header/RegistryInfoDialog → components/Keywords}/index.js +2 -2
- package/build/components/Link/Link.js +4 -16
- package/build/components/Link/index.js +1 -1
- package/build/components/LinkExternal/LinkExternal.js +32 -0
- package/build/components/LinkExternal/index.js +14 -0
- package/build/components/Loading/styles.js +3 -2
- package/build/components/LoginDialog/LoginDialog.js +12 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.js +3 -2
- package/build/components/LoginDialog/LoginDialogForm.js +2 -14
- package/build/components/LoginDialog/LoginDialogFormError.js +3 -2
- package/build/components/Logo/Logo.js +13 -6
- package/build/components/Package/Package.js +43 -34
- package/build/components/Package/styles.js +46 -58
- package/build/components/Person/Person.js +48 -0
- package/build/components/Person/PersonTooltip.js +22 -0
- package/build/components/{Package/Tag → Person}/index.js +2 -2
- package/build/components/Person/utils.js +17 -0
- package/build/components/RawViewer/RawViewer.js +11 -5
- package/build/components/Readme/Readme.js +15 -6
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +19 -0
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/utils.js +2 -5
- package/build/components/RegistryInfoDialog/styles.js +9 -10
- package/build/components/Repository/Repository.js +19 -31
- package/build/components/Search/AutoComplete/styles.js +4 -41
- package/build/components/Search/Search.js +4 -2
- package/build/components/Search/SearchItem.js +51 -38
- package/build/components/Search/utils.js +23 -0
- package/build/components/SettingsMenu/SettingsMenu.js +35 -9
- package/build/components/SideBarTitle/SideBarTitle.js +16 -6
- package/build/components/UpLinks/UpLinks.js +35 -6
- package/build/components/UpLinks/UplinkLink.js +22 -0
- package/build/components/UpLinks/styles.js +5 -4
- package/build/components/Versions/HistoryList.js +8 -5
- package/build/components/Versions/TagList.js +8 -4
- package/build/components/Versions/Versions.js +30 -7
- package/build/index.js +27 -3
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +1 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +1 -0
- package/build/sections/Detail/Detail.js +6 -2
- package/build/sections/Detail/Tabs.js +4 -3
- package/build/sections/Footer/Footer.js +17 -8
- package/build/sections/Footer/styles.js +13 -10
- package/build/sections/Header/HeaderLeft.js +14 -17
- package/build/sections/Header/HeaderMenu.js +1 -1
- package/build/sections/Header/HeaderRight.js +12 -3
- package/build/sections/Header/HeaderSettingsDialog.js +2 -2
- package/build/sections/Header/styles.js +43 -82
- package/build/sections/SideBar/Sidebar.js +10 -15
- package/build/src/Theme/ThemeProvider.test.d.ts +1 -0
- package/build/src/components/Author/Author.d.ts +0 -5
- package/build/src/components/CopyClipboard/CopyToClipBoard.test.d.ts +1 -0
- package/build/src/components/Dependencies/Dependencies.d.ts +0 -1
- package/build/src/components/Developers/DeveloperType.d.ts +4 -0
- package/build/src/components/Developers/Developers.d.ts +1 -4
- package/build/src/components/Developers/Title.d.ts +1 -4
- package/build/src/components/Developers/index.d.ts +2 -1
- package/build/src/components/Distribution/styles.d.ts +0 -1
- package/build/src/components/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
- package/build/src/components/HeaderInfoDialog/HeaderInfoDialog.test.d.ts +1 -0
- package/build/src/components/Heading/Heading.test.d.ts +1 -0
- package/build/src/components/Icons/Icons.test.d.ts +1 -0
- package/build/src/components/Install/InstallListItem.d.ts +1 -1
- package/build/src/components/Keywords/KeywordListItems.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.d.ts +6 -0
- package/build/src/components/Keywords/Keywords.stories.d.ts +5 -0
- package/build/src/components/Keywords/Keywords.test.d.ts +1 -0
- package/build/src/components/Keywords/index.d.ts +1 -0
- package/build/src/components/Link/Link.d.ts +0 -3
- package/build/src/components/Link/Link.test.d.ts +1 -0
- package/build/src/components/Link/index.d.ts +1 -1
- package/build/src/components/LinkExternal/LinkExternal.d.ts +3 -0
- package/build/src/components/LinkExternal/LinkExternal.test.d.ts +1 -0
- package/build/src/components/LinkExternal/index.d.ts +1 -0
- package/build/src/components/Logo/Logo.d.ts +1 -0
- package/build/src/components/Logo/Logo.stories.d.ts +5 -0
- package/build/src/components/Package/Package.d.ts +1 -1
- package/build/src/components/Package/styles.d.ts +0 -8
- package/build/src/components/Person/Person.d.ts +9 -0
- package/build/src/components/Person/Person.test.d.ts +1 -0
- package/build/src/components/Person/PersonTooltip.d.ts +6 -0
- package/build/src/components/Person/index.d.ts +1 -0
- package/build/src/components/Person/utils.d.ts +3 -0
- package/build/src/components/Readme/Readme.d.ts +0 -1
- package/build/src/components/Search/AutoComplete/styles.d.ts +0 -8
- package/build/src/components/Search/utils.d.ts +1 -0
- package/build/src/components/SettingsMenu/SettingsMenu.d.ts +2 -2
- package/build/src/components/SettingsMenu/SettingsMenu.test.d.ts +1 -0
- package/build/src/components/UpLinks/UplinkLink.d.ts +6 -0
- package/build/src/components/Versions/Versions.d.ts +1 -0
- package/build/src/index.d.ts +4 -1
- package/build/src/sections/Detail/Tabs.d.ts +1 -0
- package/build/src/sections/Header/styles.d.ts +0 -7
- package/build/src/store/models/routes.d.ts +8 -0
- package/build/src/store/models/utils.d.ts +1 -0
- package/build/src/types/packageMeta.d.ts +7 -5
- package/build/src/utils/routes.d.ts +1 -0
- package/build/src/utils/utils.d.ts +1 -0
- package/build/store/models/configuration.js +2 -1
- package/build/store/models/login.js +4 -2
- package/build/store/models/manifest.js +5 -3
- package/build/store/models/packages.js +4 -2
- package/build/store/models/routes.js +18 -0
- package/build/store/models/search.js +4 -2
- package/build/store/models/utils.js +10 -0
- package/build/utils/routes.js +1 -0
- package/build/utils/utils.js +20 -1
- package/package.json +2 -2
- package/src/AppTest/AppRoute.test.tsx +65 -0
- package/src/Theme/ThemeProvider.test.tsx +27 -0
- package/src/Theme/theme.ts +3 -3
- package/src/components/ActionBar/ActionBar.test.tsx +36 -15
- package/src/components/ActionBar/ActionBar.tsx +1 -1
- package/src/components/ActionBar/ActionBarAction.tsx +8 -5
- package/src/components/Author/Author.test.tsx +7 -1
- package/src/components/Author/Author.tsx +3 -41
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +23 -0
- package/src/components/CopyClipboard/utils.ts +2 -13
- package/src/components/Dependencies/Dependencies.tsx +9 -9
- package/src/components/Dependencies/DependencyBlock.tsx +2 -1
- package/src/components/Developers/DeveloperType.tsx +4 -0
- package/src/components/Developers/Developers.test.tsx +37 -10
- package/src/components/Developers/Developers.tsx +13 -13
- package/src/components/Developers/Title.tsx +1 -5
- package/src/components/Developers/index.ts +2 -1
- package/src/components/Distribution/Dist.test.tsx +1 -1
- package/src/components/Distribution/Dist.tsx +2 -4
- package/src/components/Distribution/styles.ts +0 -6
- package/src/components/Engines/Engines.tsx +6 -2
- package/src/components/Engines/styles.ts +1 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +39 -0
- package/src/components/FundButton/FundButton.tsx +5 -5
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +51 -0
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.tsx +2 -2
- package/src/components/Heading/Heading.test.tsx +20 -0
- package/src/components/Icons/DevsIcons/CommonJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/ES6Module.tsx +2 -8
- package/src/components/Icons/DevsIcons/Git.tsx +1 -7
- package/src/components/Icons/DevsIcons/NodeJS.tsx +1 -7
- package/src/components/Icons/DevsIcons/TypeScript.tsx +1 -7
- package/src/components/Icons/FileBinary.tsx +2 -1
- package/src/components/Icons/Icons.stories.tsx +21 -5
- package/src/components/Icons/Icons.test.tsx +70 -0
- package/src/components/Icons/Law.tsx +2 -1
- package/src/components/Icons/Managers/Npm.tsx +1 -7
- package/src/components/Icons/Managers/Pnpm.tsx +1 -7
- package/src/components/Icons/Managers/Yarn.tsx +1 -7
- package/src/components/Install/Install.test.tsx +54 -13
- package/src/components/Install/Install.tsx +12 -11
- package/src/components/Install/InstallListItem.tsx +12 -11
- package/src/components/Keywords/KeywordListItems.tsx +22 -0
- package/src/components/Keywords/Keywords.stories.tsx +19 -0
- package/src/components/Keywords/Keywords.test.tsx +57 -0
- package/src/components/Keywords/Keywords.tsx +35 -0
- package/src/components/Keywords/index.ts +1 -0
- package/src/components/Link/Link.test.tsx +25 -0
- package/src/components/Link/Link.tsx +4 -18
- package/src/components/Link/index.ts +1 -1
- package/src/components/LinkExternal/LinkExternal.test.tsx +18 -0
- package/src/components/LinkExternal/LinkExternal.tsx +22 -0
- package/src/components/LinkExternal/index.ts +1 -0
- package/src/components/Loading/Loading.test.tsx +8 -5
- package/src/components/Loading/styles.ts +1 -0
- package/src/components/LoginDialog/LoginDialog.test.tsx +1 -1
- package/src/components/LoginDialog/LoginDialog.tsx +10 -1
- package/src/components/LoginDialog/LoginDialogCloseButton.tsx +1 -0
- package/src/components/LoginDialog/LoginDialogForm.tsx +0 -2
- package/src/components/LoginDialog/LoginDialogFormError.tsx +1 -1
- package/src/components/Logo/Logo.stories.tsx +16 -0
- package/src/components/Logo/Logo.test.tsx +8 -1
- package/src/components/Logo/Logo.tsx +19 -3
- package/src/components/Package/Package.test.tsx +47 -14
- package/src/components/Package/Package.tsx +41 -44
- package/src/components/Package/styles.ts +7 -17
- package/src/components/PackageList/Packagelist.test.tsx +1 -0
- package/src/components/Person/Person.test.tsx +50 -0
- package/src/components/Person/Person.tsx +45 -0
- package/src/components/Person/PersonTooltip.tsx +26 -0
- package/src/components/Person/index.ts +1 -0
- package/src/components/Person/utils.ts +20 -0
- package/src/components/RawViewer/RawViewer.tsx +8 -4
- package/src/components/Readme/Readme.spec.tsx +17 -0
- package/src/components/Readme/Readme.tsx +10 -5
- package/src/components/Readme/utils.ts +2 -5
- package/src/components/RegistryInfoDialog/styles.ts +5 -4
- package/src/components/Repository/Repository.tsx +9 -14
- package/src/components/Search/AutoComplete/styles.ts +7 -0
- package/src/components/Search/Search.test.tsx +36 -9
- package/src/components/Search/Search.tsx +4 -2
- package/src/components/Search/SearchItem.tsx +19 -8
- package/src/components/Search/utils.ts +17 -0
- package/src/components/SettingsMenu/SettingsMenu.test.tsx +41 -0
- package/src/components/SettingsMenu/SettingsMenu.tsx +48 -10
- package/src/components/SideBarTitle/SideBarTitle.tsx +19 -3
- package/src/components/UpLinks/UpLinks.test.tsx +7 -0
- package/src/components/UpLinks/UpLinks.tsx +38 -15
- package/src/components/UpLinks/UplinkLink.tsx +20 -0
- package/src/components/UpLinks/styles.ts +1 -0
- package/src/components/Versions/HistoryList.tsx +9 -4
- package/src/components/Versions/TagList.tsx +4 -3
- package/src/components/Versions/Versions.test.tsx +2 -0
- package/src/components/Versions/Versions.tsx +57 -32
- package/src/index.ts +4 -1
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +1 -0
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +2 -0
- package/src/providers/VersionProvider/VersionProvider.test.tsx +3 -3
- package/src/sections/Detail/Detail.test.tsx +8 -1
- package/src/sections/Detail/Detail.tsx +11 -4
- package/src/sections/Detail/Tabs.tsx +5 -2
- package/src/sections/Footer/Footer.tsx +15 -4
- package/src/sections/Footer/styles.ts +4 -0
- package/src/sections/Header/Header.test.tsx +12 -10
- package/src/sections/Header/HeaderLeft.tsx +19 -11
- package/src/sections/Header/HeaderMenu.tsx +1 -1
- package/src/sections/Header/HeaderRight.tsx +14 -3
- package/src/sections/Header/HeaderSettingsDialog.tsx +1 -1
- package/src/sections/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +1 -1
- package/src/sections/Header/styles.ts +4 -16
- package/src/sections/Home/Home.test.tsx +12 -4
- package/src/sections/SideBar/Sidebar.test.tsx +20 -13
- package/src/sections/SideBar/Sidebar.tsx +5 -9
- package/src/store/api.test.ts +16 -0
- package/src/store/models/configuration.ts +2 -1
- package/src/store/models/login.ts +10 -12
- package/src/store/models/manifest.ts +6 -5
- package/src/store/models/packages.ts +4 -5
- package/src/store/models/routes.ts +10 -0
- package/src/store/models/search.ts +4 -2
- package/src/store/models/utils.ts +3 -0
- package/src/types/packageMeta.ts +7 -5
- package/src/utils/routes.ts +1 -0
- package/src/utils/utils.test.ts +34 -0
- package/src/utils/utils.ts +20 -5
- package/tsconfig.json +1 -1
- package/build/components/Developers/styles.js +0 -65
- package/build/components/Distribution/utils.js +0 -25
- package/build/components/Distribution/utilts.spec.js +0 -18
- package/build/components/Package/Tag/Tag.js +0 -14
- package/build/components/Package/Tag/styles.js +0 -24
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +0 -36
- package/build/sections/Header/RegistryInfoDialog/styles.js +0 -46
- package/build/sections/Header/RegistryInfoDialog/types.js +0 -6
- package/build/src/components/Developers/styles.d.ts +0 -11
- package/build/src/components/Distribution/utils.d.ts +0 -7
- package/build/src/components/Package/Tag/Tag.d.ts +0 -6
- package/build/src/components/Package/Tag/index.d.ts +0 -1
- package/build/src/components/Package/Tag/styles.d.ts +0 -5
- package/build/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.d.ts +0 -4
- package/build/src/sections/Header/RegistryInfoDialog/index.d.ts +0 -1
- package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +0 -13
- package/build/src/sections/Header/RegistryInfoDialog/types.d.ts +0 -7
- package/src/components/Developers/styles.ts +0 -31
- package/src/components/Distribution/utils.ts +0 -32
- package/src/components/Distribution/utilts.spec.ts +0 -17
- package/src/components/Package/Tag/Tag.test.tsx +0 -15
- package/src/components/Package/Tag/Tag.tsx +0 -11
- package/src/components/Package/Tag/index.ts +0 -1
- package/src/components/Package/Tag/styles.ts +0 -11
- package/src/components/Search/AutoComplete/styles.tsx +0 -42
- package/src/sections/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +0 -31
- package/src/sections/Header/RegistryInfoDialog/index.ts +0 -1
- package/src/sections/Header/RegistryInfoDialog/styles.ts +0 -21
- package/src/sections/Header/RegistryInfoDialog/types.ts +0 -8
- /package/build/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
- /package/build/src/{components/Package/Tag/Tag.test.d.ts → AppTest/AppRoute.test.d.ts} +0 -0
- /package/src/components/Icons/DevsIcons/{es6modules.svg → es6module.svg} +0 -0
|
@@ -3,7 +3,7 @@ import { MemoryRouter } from 'react-router';
|
|
|
3
3
|
|
|
4
4
|
import { VersionProvider } from '../../providers';
|
|
5
5
|
import { store } from '../../store';
|
|
6
|
-
import { renderWithStore, screen, waitFor } from '../../test/test-react-testing-library';
|
|
6
|
+
import { act, renderWithStore, screen, waitFor } from '../../test/test-react-testing-library';
|
|
7
7
|
import Sidebar from './Sidebar';
|
|
8
8
|
|
|
9
9
|
jest.mock('marked');
|
|
@@ -31,37 +31,44 @@ describe('Sidebar', () => {
|
|
|
31
31
|
jest.clearAllMocks();
|
|
32
32
|
});
|
|
33
33
|
test('should render titles', async () => {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
act(() => {
|
|
35
|
+
renderWithStore(<ComponentSideBar />, store);
|
|
36
|
+
});
|
|
37
|
+
await waitFor(() => expect(screen.getAllByText('jquery')).toHaveLength(2));
|
|
36
38
|
|
|
37
|
-
expect(screen.getByText(`jquery`)).toBeInTheDocument();
|
|
38
39
|
expect(screen.getByText(`sidebar.detail.latest-version`, { exact: false })).toBeInTheDocument();
|
|
39
40
|
expect(
|
|
40
|
-
screen.getByText(
|
|
41
|
+
screen.getByText(/sidebar.detail.published .*years? ago/i, { exact: false })
|
|
41
42
|
).toBeInTheDocument();
|
|
42
43
|
expect(screen.getByText(`sidebar.installation.title`, { exact: false })).toBeInTheDocument();
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
test('should render commonJS', async () => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
act(() => {
|
|
48
|
+
renderWithStore(<ComponentSideBar />, store);
|
|
49
|
+
});
|
|
50
|
+
// package name + keyword
|
|
51
|
+
await waitFor(() => expect(screen.getAllByText('jquery')).toHaveLength(2));
|
|
49
52
|
expect(screen.getByAltText('commonjs')).toBeInTheDocument();
|
|
50
53
|
});
|
|
51
54
|
|
|
52
55
|
test('should render typescript', async () => {
|
|
53
56
|
mockPkgName.mockReturnValue('glob');
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
act(() => {
|
|
58
|
+
renderWithStore(<ComponentSideBar />, store);
|
|
59
|
+
});
|
|
60
|
+
// just package name
|
|
56
61
|
await waitFor(() => expect(screen.getByText('glob')).toBeInTheDocument());
|
|
57
62
|
expect(screen.getByAltText('typescript')).toBeInTheDocument();
|
|
58
63
|
});
|
|
59
64
|
|
|
60
65
|
test('should render es modules', async () => {
|
|
61
66
|
mockPkgName.mockReturnValue('got');
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
act(() => {
|
|
68
|
+
renderWithStore(<ComponentSideBar />, store);
|
|
69
|
+
});
|
|
70
|
+
// package name + keyword
|
|
71
|
+
await waitFor(() => expect(screen.getAllByText('got')).toHaveLength(2));
|
|
65
72
|
expect(screen.getByAltText('es6 modules')).toBeInTheDocument();
|
|
66
73
|
});
|
|
67
74
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
1
|
import Paper from '@mui/material/Paper';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
|
|
5
|
-
import { Theme } from '../../Theme';
|
|
6
4
|
import ActionBar from '../../components/ActionBar';
|
|
7
5
|
import Author from '../../components/Author';
|
|
8
6
|
import Developers, { DeveloperType } from '../../components/Developers';
|
|
@@ -10,6 +8,7 @@ import Dist from '../../components/Distribution';
|
|
|
10
8
|
import Engines from '../../components/Engines';
|
|
11
9
|
import FundButton from '../../components/FundButton';
|
|
12
10
|
import Install from '../../components/Install';
|
|
11
|
+
import Keywords from '../../components/Keywords';
|
|
13
12
|
import Repository from '../../components/Repository';
|
|
14
13
|
import SideBarTitle from '../../components/SideBarTitle';
|
|
15
14
|
import { useConfig } from '../../providers';
|
|
@@ -35,7 +34,7 @@ const DetailSidebar: React.FC = () => {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
return (
|
|
38
|
-
<
|
|
37
|
+
<Paper data-testid="sidebar" sx={{ position: 'sticky', top: 0, p: 2, ml: 2 }}>
|
|
39
38
|
<SideBarTitle
|
|
40
39
|
description={packageMeta.latest?.description}
|
|
41
40
|
hasTypes={typeof packageMeta.latest?.types === 'string'}
|
|
@@ -50,20 +49,17 @@ const DetailSidebar: React.FC = () => {
|
|
|
50
49
|
showDownloadTarball={configOptions.showDownloadTarball}
|
|
51
50
|
showRaw={configOptions.showRaw}
|
|
52
51
|
/>
|
|
53
|
-
<Install configOptions={configOptions} packageMeta={packageMeta} packageName={packageName} />
|
|
54
52
|
<FundButton packageMeta={packageMeta} />
|
|
53
|
+
<Install configOptions={configOptions} packageMeta={packageMeta} packageName={packageName} />
|
|
55
54
|
<Repository packageMeta={packageMeta} />
|
|
56
55
|
<Engines packageMeta={packageMeta} />
|
|
57
56
|
<Dist packageMeta={packageMeta} />
|
|
57
|
+
<Keywords packageMeta={packageMeta} />
|
|
58
58
|
<Author packageMeta={packageMeta} />
|
|
59
59
|
<Developers packageMeta={packageMeta} type={DeveloperType.MAINTAINERS} />
|
|
60
60
|
<Developers packageMeta={packageMeta} type={DeveloperType.CONTRIBUTORS} />
|
|
61
|
-
</
|
|
61
|
+
</Paper>
|
|
62
62
|
);
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export default DetailSidebar;
|
|
66
|
-
|
|
67
|
-
const StyledPaper = styled(Paper)<{ theme?: Theme }>(({ theme }) => ({
|
|
68
|
-
padding: theme?.spacing(3, 2),
|
|
69
|
-
}));
|
package/src/store/api.test.ts
CHANGED
|
@@ -31,6 +31,22 @@ describe('api', () => {
|
|
|
31
31
|
|
|
32
32
|
expect(handled).toEqual([true, blob]);
|
|
33
33
|
});
|
|
34
|
+
|
|
35
|
+
test('should test pdf scenario', async () => {
|
|
36
|
+
const blob = new Blob(['foo']);
|
|
37
|
+
const blobPromise = Promise.resolve<Blob>(blob);
|
|
38
|
+
const response: Response = {
|
|
39
|
+
url: 'http://localhost:8080/test.pdf',
|
|
40
|
+
blob: () => blobPromise,
|
|
41
|
+
ok: true,
|
|
42
|
+
headers: new Headers({
|
|
43
|
+
'Content-Type': 'application/pdf',
|
|
44
|
+
}),
|
|
45
|
+
} as Response;
|
|
46
|
+
const handled = await handleResponseType(response);
|
|
47
|
+
|
|
48
|
+
expect(handled).toEqual([true, blob]);
|
|
49
|
+
});
|
|
34
50
|
});
|
|
35
51
|
|
|
36
52
|
describe('api client', () => {
|
|
@@ -7,6 +7,7 @@ import { Manifest, TemplateUIOptions } from '@verdaccio/types';
|
|
|
7
7
|
import type { RootModel } from '.';
|
|
8
8
|
import { colors } from '../../Theme';
|
|
9
9
|
import API from '../api';
|
|
10
|
+
import { APIRoute } from './routes';
|
|
10
11
|
|
|
11
12
|
const defaultValues: TemplateUIOptions = {
|
|
12
13
|
primaryColor: colors.PRIMARY_COLOR,
|
|
@@ -39,7 +40,7 @@ export const configuration = createModel<RootModel>()({
|
|
|
39
40
|
},
|
|
40
41
|
effects: (dispatch) => ({
|
|
41
42
|
async getPackages() {
|
|
42
|
-
const payload: Manifest[] = await API.request(
|
|
43
|
+
const payload: Manifest[] = await API.request(APIRoute.CONFIG, 'GET');
|
|
43
44
|
dispatch.packages.savePackages(payload);
|
|
44
45
|
},
|
|
45
46
|
}),
|
|
@@ -5,6 +5,8 @@ import type { RootModel } from '.';
|
|
|
5
5
|
import { isTokenExpire } from '../../utils';
|
|
6
6
|
import API from '../api';
|
|
7
7
|
import storage from '../storage';
|
|
8
|
+
import { APIRoute } from './routes';
|
|
9
|
+
import { stripTrailingSlash } from './utils';
|
|
8
10
|
|
|
9
11
|
export const HEADERS = {
|
|
10
12
|
JSON: 'application/json',
|
|
@@ -80,19 +82,15 @@ export const login = createModel<RootModel>()({
|
|
|
80
82
|
},
|
|
81
83
|
effects: (dispatch) => ({
|
|
82
84
|
async getUser({ username, password }, state) {
|
|
83
|
-
const basePath = state.configuration.config.base;
|
|
85
|
+
const basePath = stripTrailingSlash(state.configuration.config.base);
|
|
84
86
|
try {
|
|
85
|
-
const payload: LoginResponse = await API.request(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'Content-Type': HEADERS.JSON,
|
|
93
|
-
},
|
|
94
|
-
}
|
|
95
|
-
);
|
|
87
|
+
const payload: LoginResponse = await API.request(`${basePath}${APIRoute.LOGIN}`, 'POST', {
|
|
88
|
+
body: JSON.stringify({ username, password }),
|
|
89
|
+
headers: {
|
|
90
|
+
Accept: HEADERS.JSON,
|
|
91
|
+
'Content-Type': HEADERS.JSON,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
96
94
|
dispatch.login.logInUser(payload);
|
|
97
95
|
dispatch.packages.getPackages(undefined);
|
|
98
96
|
} catch (error: any) {
|
|
@@ -5,6 +5,8 @@ import { Manifest } from '@verdaccio/types';
|
|
|
5
5
|
import type { RootModel } from '.';
|
|
6
6
|
import { PackageMetaInterface } from '../../types/packageMeta';
|
|
7
7
|
import API from '../api';
|
|
8
|
+
import { APIRoute } from './routes';
|
|
9
|
+
import { stripTrailingSlash } from './utils';
|
|
8
10
|
|
|
9
11
|
function isPackageVersionValid(
|
|
10
12
|
packageMeta: Partial<PackageMetaInterface>,
|
|
@@ -83,10 +85,10 @@ export const manifest = createModel<RootModel>()({
|
|
|
83
85
|
},
|
|
84
86
|
effects: (dispatch) => ({
|
|
85
87
|
async getManifest({ packageName, packageVersion }, state) {
|
|
86
|
-
const basePath = state.configuration.config.base;
|
|
88
|
+
const basePath = stripTrailingSlash(state.configuration.config.base);
|
|
87
89
|
try {
|
|
88
90
|
const manifest: Manifest = await API.request(
|
|
89
|
-
`${basePath}
|
|
91
|
+
`${basePath}${APIRoute.SIDEBAR}${packageName}${
|
|
90
92
|
packageVersion ? `?v=${packageVersion}` : ''
|
|
91
93
|
}`
|
|
92
94
|
);
|
|
@@ -98,10 +100,9 @@ export const manifest = createModel<RootModel>()({
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
const readme: string = await API.request<string>(
|
|
101
|
-
`${basePath}
|
|
103
|
+
`${basePath}${APIRoute.README}${packageName}${
|
|
102
104
|
packageVersion ? `?v=${packageVersion}` : ''
|
|
103
|
-
}
|
|
104
|
-
'GET'
|
|
105
|
+
}`
|
|
105
106
|
);
|
|
106
107
|
dispatch.manifest.saveManifest({ packageName, packageVersion, manifest, readme });
|
|
107
108
|
} catch (error: any) {
|
|
@@ -4,6 +4,8 @@ import { Manifest } from '@verdaccio/types';
|
|
|
4
4
|
|
|
5
5
|
import type { RootModel } from '.';
|
|
6
6
|
import API from '../api';
|
|
7
|
+
import { APIRoute } from './routes';
|
|
8
|
+
import { stripTrailingSlash } from './utils';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
*
|
|
@@ -23,12 +25,9 @@ export const packages = createModel<RootModel>()({
|
|
|
23
25
|
},
|
|
24
26
|
effects: (dispatch) => ({
|
|
25
27
|
async getPackages(_payload, state) {
|
|
26
|
-
const basePath = state.configuration.config.base;
|
|
28
|
+
const basePath = stripTrailingSlash(state.configuration.config.base);
|
|
27
29
|
try {
|
|
28
|
-
const payload: Manifest[] = await API.request(
|
|
29
|
-
`${basePath}-/verdaccio/data/packages`,
|
|
30
|
-
'GET'
|
|
31
|
-
);
|
|
30
|
+
const payload: Manifest[] = await API.request(`${basePath}${APIRoute.PACKAGES}`);
|
|
32
31
|
dispatch.packages.savePackages(payload);
|
|
33
32
|
} catch (error: any) {
|
|
34
33
|
// eslint-disable-next-line no-console
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Example API request:
|
|
2
|
+
// http://localhost:8000/-/verdaccio/data/package/readme/jquery
|
|
3
|
+
export enum APIRoute {
|
|
4
|
+
LOGIN = '/-/verdaccio/sec/login',
|
|
5
|
+
CONFIG = '/-/verdaccio/packages',
|
|
6
|
+
PACKAGES = '/-/verdaccio/data/packages',
|
|
7
|
+
SEARCH = '/-/verdaccio/data/search/', // :value
|
|
8
|
+
SIDEBAR = '/-/verdaccio/data/sidebar/', // :packageName?v=version
|
|
9
|
+
README = '/-/verdaccio/data/package/readme/', // :packageName?v=version
|
|
10
|
+
}
|
|
@@ -5,6 +5,8 @@ import { SearchResultWeb } from '@verdaccio/types';
|
|
|
5
5
|
|
|
6
6
|
import type { RootModel } from '.';
|
|
7
7
|
import API from '../api';
|
|
8
|
+
import { APIRoute } from './routes';
|
|
9
|
+
import { stripTrailingSlash } from './utils';
|
|
8
10
|
|
|
9
11
|
const CONSTANTS = {
|
|
10
12
|
API_DELAY: 300,
|
|
@@ -55,7 +57,7 @@ export const search = createModel<RootModel>()({
|
|
|
55
57
|
},
|
|
56
58
|
effects: (dispatch) => ({
|
|
57
59
|
async getSuggestions({ value }, state) {
|
|
58
|
-
const basePath = state.configuration.config.base;
|
|
60
|
+
const basePath = stripTrailingSlash(state.configuration.config.base);
|
|
59
61
|
try {
|
|
60
62
|
const controller = new window.AbortController();
|
|
61
63
|
dispatch.search.addControllerToQueue({ controller });
|
|
@@ -63,7 +65,7 @@ export const search = createModel<RootModel>()({
|
|
|
63
65
|
// https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#Browser_compatibility
|
|
64
66
|
// FUTURE: signal is not well supported for IE and Samsung Browser
|
|
65
67
|
const suggestions: SearchResultWeb[] = await API.request(
|
|
66
|
-
`${basePath}
|
|
68
|
+
`${basePath}${APIRoute.SEARCH}${encodeURIComponent(value)}`,
|
|
67
69
|
'GET',
|
|
68
70
|
{
|
|
69
71
|
signal,
|
package/src/types/packageMeta.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type ModuleType = 'commonjs' | 'module';
|
|
2
2
|
|
|
3
3
|
export type Latest = {
|
|
4
|
-
author?: Author;
|
|
4
|
+
author?: string | Author;
|
|
5
5
|
deprecated?: string;
|
|
6
6
|
name: string;
|
|
7
7
|
dist?: {
|
|
@@ -15,7 +15,7 @@ export type Latest = {
|
|
|
15
15
|
pnpm?: string;
|
|
16
16
|
yarn?: string;
|
|
17
17
|
};
|
|
18
|
-
license?:
|
|
18
|
+
license?: string | LicenseInterface;
|
|
19
19
|
version: string;
|
|
20
20
|
homepage?: string;
|
|
21
21
|
bugs?: {
|
|
@@ -32,6 +32,7 @@ export type Latest = {
|
|
|
32
32
|
funding?: Funding;
|
|
33
33
|
maintainers?: Developer[];
|
|
34
34
|
contributors?: Developer[];
|
|
35
|
+
keywords?: string | string[];
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export interface PackageMetaInterface {
|
|
@@ -44,8 +45,9 @@ export interface PackageMetaInterface {
|
|
|
44
45
|
|
|
45
46
|
export interface Developer {
|
|
46
47
|
name: string;
|
|
47
|
-
email
|
|
48
|
-
|
|
48
|
+
email?: string;
|
|
49
|
+
url?: string;
|
|
50
|
+
avatar?: string;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
interface Funding {
|
|
@@ -75,7 +77,7 @@ export interface Version {
|
|
|
75
77
|
version: string;
|
|
76
78
|
author?: string | Author;
|
|
77
79
|
description?: string;
|
|
78
|
-
license?: string;
|
|
80
|
+
license?: string | LicenseInterface;
|
|
79
81
|
main?: string;
|
|
80
82
|
keywords?: string[];
|
|
81
83
|
deprecated?: string;
|
package/src/utils/routes.ts
CHANGED
package/src/utils/utils.test.ts
CHANGED
|
@@ -2,12 +2,14 @@ import MockDate from 'mockdate';
|
|
|
2
2
|
|
|
3
3
|
import { packageMeta } from './__partials__/packageMeta';
|
|
4
4
|
import {
|
|
5
|
+
fileSizeSI,
|
|
5
6
|
formatDate,
|
|
6
7
|
formatDateDistance,
|
|
7
8
|
formatLicense,
|
|
8
9
|
formatRepository,
|
|
9
10
|
getLastUpdatedPackageTime,
|
|
10
11
|
getRecentReleases,
|
|
12
|
+
getUplink,
|
|
11
13
|
} from './utils';
|
|
12
14
|
|
|
13
15
|
// jest.useFakeTimers().setSystemTime(new Date('2020-01-01'));
|
|
@@ -111,3 +113,35 @@ describe('getRecentReleases', (): void => {
|
|
|
111
113
|
expect(getRecentReleases()).toEqual([]);
|
|
112
114
|
});
|
|
113
115
|
});
|
|
116
|
+
|
|
117
|
+
describe('getUplink', (): void => {
|
|
118
|
+
test('getUplink for npmjs', () => {
|
|
119
|
+
expect(getUplink('npmjs', 'semver')).toEqual('https://www.npmjs.com/package/semver');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('getUplink for server1', () => {
|
|
123
|
+
expect(getUplink('server1', 'semver')).toEqual(null);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
describe('fileSizeSI', (): void => {
|
|
128
|
+
test('fileSizeSI as number 1234567', () => {
|
|
129
|
+
expect(fileSizeSI(1234567)).toEqual('1.2 MB');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('fileSizeSI as number 9876', () => {
|
|
133
|
+
expect(fileSizeSI(9876)).toEqual('9.9 kB');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('fileSizeSI as number 1000', () => {
|
|
137
|
+
expect(fileSizeSI(1000)).toEqual('1.0 kB');
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('fileSizeSI as number 123', () => {
|
|
141
|
+
expect(fileSizeSI(123)).toEqual('123 Bytes');
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test('fileSizeSI as number 0', () => {
|
|
145
|
+
expect(fileSizeSI(0)).toEqual('0 Bytes');
|
|
146
|
+
});
|
|
147
|
+
});
|
package/src/utils/utils.ts
CHANGED
|
@@ -105,6 +105,15 @@ export function getAuthorName(authorName?: string): string {
|
|
|
105
105
|
return authorName;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
export function getUplink(upLinkName: string, packageName: string): string | null {
|
|
109
|
+
// TODO: make this a config like "uplinks: npmjs: web: https://www.npmjs.com/package/"
|
|
110
|
+
switch (upLinkName) {
|
|
111
|
+
case 'npmjs':
|
|
112
|
+
return `https://www.npmjs.com/package/${packageName}`;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
|
|
108
117
|
export function fileSizeSI(
|
|
109
118
|
a: number,
|
|
110
119
|
b?: typeof Math,
|
|
@@ -112,9 +121,15 @@ export function fileSizeSI(
|
|
|
112
121
|
d?: number,
|
|
113
122
|
e?: number
|
|
114
123
|
): string {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
124
|
+
b = Math;
|
|
125
|
+
c = b.log;
|
|
126
|
+
d = 1e3;
|
|
127
|
+
e = (c(a) / c(d)) | 0;
|
|
128
|
+
let size = a / b.pow(d, e);
|
|
129
|
+
// no decimals for Bytes
|
|
130
|
+
if (e === 0) {
|
|
131
|
+
return Math.floor(size) + ' Bytes';
|
|
132
|
+
} else {
|
|
133
|
+
return size.toFixed(1) + ' ' + 'kMGTPEZY'[--e] + 'B';
|
|
134
|
+
}
|
|
120
135
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.StyledText = exports.Fab = exports.Details = exports.Content = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
|
-
var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
|
|
9
|
-
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
12
|
-
const Details = exports.Details = /*#__PURE__*/(0, _base.default)('span', process.env.NODE_ENV === "production" ? {
|
|
13
|
-
target: "e1u5w7z83"
|
|
14
|
-
} : {
|
|
15
|
-
target: "e1u5w7z83",
|
|
16
|
-
label: "Details"
|
|
17
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
18
|
-
name: "zigog8",
|
|
19
|
-
styles: "display:flex;flex-direction:column;align-items:center"
|
|
20
|
-
} : {
|
|
21
|
-
name: "zigog8",
|
|
22
|
-
styles: "display:flex;flex-direction:column;align-items:center",
|
|
23
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0RldmVsb3BlcnMvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU11QiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9EZXZlbG9wZXJzL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBGYWJNVUkgZnJvbSAnQG11aS9tYXRlcmlhbC9GYWInO1xuaW1wb3J0IFR5cG9ncmFwaHkgZnJvbSAnQG11aS9tYXRlcmlhbC9UeXBvZ3JhcGh5JztcblxuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICcuLi8uLi9UaGVtZSc7XG5cbmV4cG9ydCBjb25zdCBEZXRhaWxzID0gc3R5bGVkKCdzcGFuJykoe1xuICBkaXNwbGF5OiAnZmxleCcsXG4gIGZsZXhEaXJlY3Rpb246ICdjb2x1bW4nLFxuICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcbn0pO1xuXG5leHBvcnQgY29uc3QgQ29udGVudCA9IHN0eWxlZCgnZGl2Jykoe1xuICBtYXJnaW46ICcxMHB4IDAgMTBweCAwJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICBmbGV4V3JhcDogJ3dyYXAnLFxuICAnPiAqJzoge1xuICAgIG1hcmdpbjogJzVweCcsXG4gIH0sXG59KTtcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFRleHQgPSBzdHlsZWQoVHlwb2dyYXBoeSk8eyB0aGVtZT86IFRoZW1lIH0+KChwcm9wcykgPT4gKHtcbiAgZm9udFdlaWdodDogcHJvcHMudGhlbWU/LmZvbnRXZWlnaHQuYm9sZCxcbiAgbWFyZ2luQm90dG9tOiAnMTBweCcsXG4gIHRleHRUcmFuc2Zvcm06ICdjYXBpdGFsaXplJyxcbn0pKTtcblxuZXhwb3J0IGNvbnN0IEZhYiA9IHN0eWxlZChGYWJNVUkpPHsgdGhlbWU/OiBUaGVtZSB9PigocHJvcHMpID0+ICh7XG4gIGJhY2tncm91bmRDb2xvcjogcHJvcHMudGhlbWU/LnBhbGV0dGUucHJpbWFyeS5tYWluLFxuICBjb2xvcjogcHJvcHMudGhlbWU/LnBhbGV0dGUud2hpdGUsXG59KSk7XG4iXX0= */",
|
|
24
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
25
|
-
});
|
|
26
|
-
const Content = exports.Content = /*#__PURE__*/(0, _base.default)('div', process.env.NODE_ENV === "production" ? {
|
|
27
|
-
target: "e1u5w7z82"
|
|
28
|
-
} : {
|
|
29
|
-
target: "e1u5w7z82",
|
|
30
|
-
label: "Content"
|
|
31
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
32
|
-
name: "mkcn9c",
|
|
33
|
-
styles: "margin:10px 0 10px 0;display:flex;flex-wrap:wrap;> *{margin:5px;}"
|
|
34
|
-
} : {
|
|
35
|
-
name: "mkcn9c",
|
|
36
|
-
styles: "margin:10px 0 10px 0;display:flex;flex-wrap:wrap;> *{margin:5px;}",
|
|
37
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0RldmVsb3BlcnMvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVl1QiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9EZXZlbG9wZXJzL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBGYWJNVUkgZnJvbSAnQG11aS9tYXRlcmlhbC9GYWInO1xuaW1wb3J0IFR5cG9ncmFwaHkgZnJvbSAnQG11aS9tYXRlcmlhbC9UeXBvZ3JhcGh5JztcblxuaW1wb3J0IHsgVGhlbWUgfSBmcm9tICcuLi8uLi9UaGVtZSc7XG5cbmV4cG9ydCBjb25zdCBEZXRhaWxzID0gc3R5bGVkKCdzcGFuJykoe1xuICBkaXNwbGF5OiAnZmxleCcsXG4gIGZsZXhEaXJlY3Rpb246ICdjb2x1bW4nLFxuICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcbn0pO1xuXG5leHBvcnQgY29uc3QgQ29udGVudCA9IHN0eWxlZCgnZGl2Jykoe1xuICBtYXJnaW46ICcxMHB4IDAgMTBweCAwJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICBmbGV4V3JhcDogJ3dyYXAnLFxuICAnPiAqJzoge1xuICAgIG1hcmdpbjogJzVweCcsXG4gIH0sXG59KTtcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFRleHQgPSBzdHlsZWQoVHlwb2dyYXBoeSk8eyB0aGVtZT86IFRoZW1lIH0+KChwcm9wcykgPT4gKHtcbiAgZm9udFdlaWdodDogcHJvcHMudGhlbWU/LmZvbnRXZWlnaHQuYm9sZCxcbiAgbWFyZ2luQm90dG9tOiAnMTBweCcsXG4gIHRleHRUcmFuc2Zvcm06ICdjYXBpdGFsaXplJyxcbn0pKTtcblxuZXhwb3J0IGNvbnN0IEZhYiA9IHN0eWxlZChGYWJNVUkpPHsgdGhlbWU/OiBUaGVtZSB9PigocHJvcHMpID0+ICh7XG4gIGJhY2tncm91bmRDb2xvcjogcHJvcHMudGhlbWU/LnBhbGV0dGUucHJpbWFyeS5tYWluLFxuICBjb2xvcjogcHJvcHMudGhlbWU/LnBhbGV0dGUud2hpdGUsXG59KSk7XG4iXX0= */",
|
|
38
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
-
});
|
|
40
|
-
const StyledText = exports.StyledText = /*#__PURE__*/(0, _base.default)(_Typography.default, process.env.NODE_ENV === "production" ? {
|
|
41
|
-
target: "e1u5w7z81"
|
|
42
|
-
} : {
|
|
43
|
-
target: "e1u5w7z81",
|
|
44
|
-
label: "StyledText"
|
|
45
|
-
})(props => {
|
|
46
|
-
var _props$theme;
|
|
47
|
-
return {
|
|
48
|
-
fontWeight: (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.fontWeight.bold,
|
|
49
|
-
marginBottom: '10px',
|
|
50
|
-
textTransform: 'capitalize'
|
|
51
|
-
};
|
|
52
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0RldmVsb3BlcnMvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCMEIiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvRGV2ZWxvcGVycy9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgRmFiTVVJIGZyb20gJ0BtdWkvbWF0ZXJpYWwvRmFiJztcbmltcG9ydCBUeXBvZ3JhcGh5IGZyb20gJ0BtdWkvbWF0ZXJpYWwvVHlwb2dyYXBoeSc7XG5cbmltcG9ydCB7IFRoZW1lIH0gZnJvbSAnLi4vLi4vVGhlbWUnO1xuXG5leHBvcnQgY29uc3QgRGV0YWlscyA9IHN0eWxlZCgnc3BhbicpKHtcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcbiAgYWxpZ25JdGVtczogJ2NlbnRlcicsXG59KTtcblxuZXhwb3J0IGNvbnN0IENvbnRlbnQgPSBzdHlsZWQoJ2RpdicpKHtcbiAgbWFyZ2luOiAnMTBweCAwIDEwcHggMCcsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgZmxleFdyYXA6ICd3cmFwJyxcbiAgJz4gKic6IHtcbiAgICBtYXJnaW46ICc1cHgnLFxuICB9LFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRUZXh0ID0gc3R5bGVkKFR5cG9ncmFwaHkpPHsgdGhlbWU/OiBUaGVtZSB9PigocHJvcHMpID0+ICh7XG4gIGZvbnRXZWlnaHQ6IHByb3BzLnRoZW1lPy5mb250V2VpZ2h0LmJvbGQsXG4gIG1hcmdpbkJvdHRvbTogJzEwcHgnLFxuICB0ZXh0VHJhbnNmb3JtOiAnY2FwaXRhbGl6ZScsXG59KSk7XG5cbmV4cG9ydCBjb25zdCBGYWIgPSBzdHlsZWQoRmFiTVVJKTx7IHRoZW1lPzogVGhlbWUgfT4oKHByb3BzKSA9PiAoe1xuICBiYWNrZ3JvdW5kQ29sb3I6IHByb3BzLnRoZW1lPy5wYWxldHRlLnByaW1hcnkubWFpbixcbiAgY29sb3I6IHByb3BzLnRoZW1lPy5wYWxldHRlLndoaXRlLFxufSkpO1xuIl19 */");
|
|
53
|
-
const Fab = exports.Fab = /*#__PURE__*/(0, _base.default)(_Fab.default, process.env.NODE_ENV === "production" ? {
|
|
54
|
-
target: "e1u5w7z80"
|
|
55
|
-
} : {
|
|
56
|
-
target: "e1u5w7z80",
|
|
57
|
-
label: "Fab"
|
|
58
|
-
})(props => {
|
|
59
|
-
var _props$theme2, _props$theme3;
|
|
60
|
-
return {
|
|
61
|
-
backgroundColor: (_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.palette.primary.main,
|
|
62
|
-
color: (_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.palette.white
|
|
63
|
-
};
|
|
64
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0RldmVsb3BlcnMvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCbUIiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvRGV2ZWxvcGVycy9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgRmFiTVVJIGZyb20gJ0BtdWkvbWF0ZXJpYWwvRmFiJztcbmltcG9ydCBUeXBvZ3JhcGh5IGZyb20gJ0BtdWkvbWF0ZXJpYWwvVHlwb2dyYXBoeSc7XG5cbmltcG9ydCB7IFRoZW1lIH0gZnJvbSAnLi4vLi4vVGhlbWUnO1xuXG5leHBvcnQgY29uc3QgRGV0YWlscyA9IHN0eWxlZCgnc3BhbicpKHtcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcbiAgYWxpZ25JdGVtczogJ2NlbnRlcicsXG59KTtcblxuZXhwb3J0IGNvbnN0IENvbnRlbnQgPSBzdHlsZWQoJ2RpdicpKHtcbiAgbWFyZ2luOiAnMTBweCAwIDEwcHggMCcsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgZmxleFdyYXA6ICd3cmFwJyxcbiAgJz4gKic6IHtcbiAgICBtYXJnaW46ICc1cHgnLFxuICB9LFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRUZXh0ID0gc3R5bGVkKFR5cG9ncmFwaHkpPHsgdGhlbWU/OiBUaGVtZSB9PigocHJvcHMpID0+ICh7XG4gIGZvbnRXZWlnaHQ6IHByb3BzLnRoZW1lPy5mb250V2VpZ2h0LmJvbGQsXG4gIG1hcmdpbkJvdHRvbTogJzEwcHgnLFxuICB0ZXh0VHJhbnNmb3JtOiAnY2FwaXRhbGl6ZScsXG59KSk7XG5cbmV4cG9ydCBjb25zdCBGYWIgPSBzdHlsZWQoRmFiTVVJKTx7IHRoZW1lPzogVGhlbWUgfT4oKHByb3BzKSA9PiAoe1xuICBiYWNrZ3JvdW5kQ29sb3I6IHByb3BzLnRoZW1lPy5wYWxldHRlLnByaW1hcnkubWFpbixcbiAgY29sb3I6IHByb3BzLnRoZW1lPy5wYWxldHRlLndoaXRlLFxufSkpO1xuIl19 */");
|
|
65
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.fileSizeSI = fileSizeSI;
|
|
7
|
-
exports.formatLicense = formatLicense;
|
|
8
|
-
/**
|
|
9
|
-
* Formats license field for webui.
|
|
10
|
-
* @see https://docs.npmjs.com/files/package.json#license
|
|
11
|
-
*/
|
|
12
|
-
// License should use type License defined above, but conflicts with the unit test that provide array or empty object
|
|
13
|
-
function formatLicense(license) {
|
|
14
|
-
if (typeof license === 'string') {
|
|
15
|
-
return license;
|
|
16
|
-
}
|
|
17
|
-
if (license !== null && license !== void 0 && license.type) {
|
|
18
|
-
return license.type;
|
|
19
|
-
}
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
function fileSizeSI(a, b, c, d, e) {
|
|
23
|
-
return (b = Math, c = b.log, d = 1e3, e = c(a) / c(d) | 0, a / b.pow(d, e)).toFixed(2) + ' ' + (e ? 'kMGTPEZY'[--e] + 'B' : 'Bytes');
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _utils = require("./utils");
|
|
4
|
-
test('formatLicense as string', () => {
|
|
5
|
-
expect((0, _utils.formatLicense)('MIT')).toEqual('MIT');
|
|
6
|
-
});
|
|
7
|
-
test('formatLicense as format object', () => {
|
|
8
|
-
expect((0, _utils.formatLicense)({
|
|
9
|
-
type: 'MIT'
|
|
10
|
-
})).toEqual('MIT');
|
|
11
|
-
});
|
|
12
|
-
test('fileSizeSI as number 1000', () => {
|
|
13
|
-
expect((0, _utils.fileSizeSI)(1000)).toEqual('1.00 kB');
|
|
14
|
-
});
|
|
15
|
-
test('fileSizeSI as number 0', () => {
|
|
16
|
-
expect((0, _utils.fileSizeSI)(0)).toEqual('0.00 Bytes');
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=utilts.spec.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _styles = require("./styles");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
const Tag = ({
|
|
11
|
-
children
|
|
12
|
-
}) => /*#__PURE__*/_react.default.createElement(_styles.Wrapper, null, children);
|
|
13
|
-
var _default = exports.default = Tag;
|
|
14
|
-
//# sourceMappingURL=Tag.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Wrapper = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
|
-
const Wrapper = exports.Wrapper = /*#__PURE__*/(0, _base.default)('span', process.env.NODE_ENV === "production" ? {
|
|
11
|
-
target: "e1bcw0zd0"
|
|
12
|
-
} : {
|
|
13
|
-
target: "e1bcw0zd0",
|
|
14
|
-
label: "Wrapper"
|
|
15
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
16
|
-
name: "bk6wq0",
|
|
17
|
-
styles: "vertical-align:middle;line-height:22px;border-radius:2px;color:#485a3e;background-color:#f3f4f2;padding:0.22rem 0.4rem;margin:8px 8px 0 0"
|
|
18
|
-
} : {
|
|
19
|
-
name: "bk6wq0",
|
|
20
|
-
styles: "vertical-align:middle;line-height:22px;border-radius:2px;color:#485a3e;background-color:#f3f4f2;padding:0.22rem 0.4rem;margin:8px 8px 0 0",
|
|
21
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1BhY2thZ2UvVGFnL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvUGFja2FnZS9UYWcvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5leHBvcnQgY29uc3QgV3JhcHBlciA9IHN0eWxlZCgnc3BhbicpKHtcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIGxpbmVIZWlnaHQ6ICcyMnB4JyxcbiAgYm9yZGVyUmFkaXVzOiAnMnB4JyxcbiAgY29sb3I6ICcjNDg1YTNlJyxcbiAgYmFja2dyb3VuZENvbG9yOiAnI2YzZjRmMicsXG4gIHBhZGRpbmc6ICcwLjIycmVtIDAuNHJlbScsXG4gIG1hcmdpbjogJzhweCA4cHggMCAwJyxcbn0pO1xuIl19 */",
|
|
22
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
8
|
-
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
9
|
-
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _reactI18next = require("react-i18next");
|
|
12
|
-
var _styles = require("./styles");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const RegistryInfoDialog = ({
|
|
15
|
-
open = false,
|
|
16
|
-
children,
|
|
17
|
-
onClose,
|
|
18
|
-
title = ''
|
|
19
|
-
}) => {
|
|
20
|
-
const {
|
|
21
|
-
t
|
|
22
|
-
} = (0, _reactI18next.useTranslation)();
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
24
|
-
"data-testid": 'registryInfo--dialog',
|
|
25
|
-
id: "registryInfo--dialog-container",
|
|
26
|
-
maxWidth: "sm",
|
|
27
|
-
onClose: onClose,
|
|
28
|
-
open: open
|
|
29
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.Title, null, title), /*#__PURE__*/_react.default.createElement(_styles.Content, null, children), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
30
|
-
color: "inherit",
|
|
31
|
-
id: "registryInfo--dialog-close",
|
|
32
|
-
onClick: onClose
|
|
33
|
-
}, t('button.close'))));
|
|
34
|
-
};
|
|
35
|
-
var _default = exports.default = RegistryInfoDialog;
|
|
36
|
-
//# sourceMappingURL=RegistryInfoDialog.js.map
|