@verdaccio/ui-theme 3.1.0 → 6.0.0-6-next.11
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/.babelrc +33 -0
- package/.eslintrc +115 -0
- package/.stylelintrc +40 -0
- package/CHANGELOG.md +152 -554
- package/LICENSE +1 -1
- package/README.md +22 -95
- package/config/env.js +9 -0
- package/jest/api/packages.json +42 -0
- package/jest/identity.js +29 -0
- package/jest/jest.config.js +39 -0
- package/jest/jestEnvironment.js +1 -0
- package/jest/server-handlers.ts +9 -0
- package/jest/server.ts +6 -0
- package/jest/setup-env.ts +15 -0
- package/jest/setup.ts +31 -0
- package/jest/unit/components/__mocks__/api.ts +47 -0
- package/jest/unit/components/__mocks__/token.ts +31 -0
- package/jest/unit/components/store/login.ts +23 -0
- package/jest/unit/components/store/logo.ts +7 -0
- package/jest/unit/components/store/package.ts +174 -0
- package/jest/unit/components/store/packageMeta.ts +592 -0
- package/jest/unit/empty.ts +1 -0
- package/lib/constants.ts +9 -0
- package/package.json +153 -228
- package/src/App/App.test.tsx +123 -0
- package/src/App/App.tsx +54 -0
- package/src/App/AppError.tsx +38 -0
- package/src/App/AppRoute.tsx +63 -0
- package/src/App/Footer/Footer.test.tsx +20 -0
- package/src/App/Footer/Footer.tsx +111 -0
- package/src/App/Footer/__snapshots__/Footer.test.tsx.snap +456 -0
- package/src/App/Footer/index.ts +1 -0
- package/src/App/Footer/styles.ts +44 -0
- package/src/App/Header/Header.test.tsx +152 -0
- package/src/App/Header/Header.tsx +74 -0
- package/src/App/Header/HeaderGreetings.tsx +22 -0
- package/src/App/Header/HeaderInfoDialog.tsx +19 -0
- package/src/App/Header/HeaderLeft.tsx +31 -0
- package/src/App/Header/HeaderMenu.tsx +65 -0
- package/src/App/Header/HeaderRight.tsx +118 -0
- package/src/App/Header/HeaderToolTip.tsx +19 -0
- package/src/App/Header/HeaderToolTipIcon.tsx +75 -0
- package/src/App/Header/LanguageSwitch.tsx +125 -0
- package/src/App/Header/LoginDialog/LoginDialog.test.tsx +112 -0
- package/src/App/Header/LoginDialog/LoginDialog.tsx +81 -0
- package/src/App/Header/LoginDialog/LoginDialogCloseButton.tsx +32 -0
- package/src/App/Header/LoginDialog/LoginDialogForm.tsx +97 -0
- package/src/App/Header/LoginDialog/LoginDialogFormError.tsx +43 -0
- package/src/App/Header/LoginDialog/LoginDialogHeader.tsx +48 -0
- package/src/App/Header/LoginDialog/__snapshots__/LoginDialog.test.tsx.snap +3 -0
- package/src/App/Header/LoginDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.test.tsx +27 -0
- package/src/App/Header/RegistryInfoContent/RegistryInfoContent.tsx +155 -0
- package/src/App/Header/RegistryInfoContent/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/RegistryInfoDialog.tsx +30 -0
- package/src/App/Header/RegistryInfoDialog/index.ts +1 -0
- package/src/App/Header/RegistryInfoDialog/styles.ts +16 -0
- package/src/App/Header/RegistryInfoDialog/types.ts +7 -0
- package/src/App/Header/Search/Search.test.tsx +168 -0
- package/src/App/Header/Search/Search.tsx +127 -0
- package/src/App/Header/Search/SearchAdornment.tsx +18 -0
- package/src/App/Header/Search/__snapshots__/Search.test.tsx.snap +101 -0
- package/src/App/Header/Search/index.ts +1 -0
- package/src/App/Header/index.ts +1 -0
- package/src/App/Header/styles.ts +89 -0
- package/src/App/index.ts +1 -0
- package/src/App/utils/loadable.tsx +10 -0
- package/src/components/.eslintrc +7 -0
- package/src/components/ActionBar/ActionBar.test.tsx +91 -0
- package/src/components/ActionBar/ActionBar.tsx +45 -0
- package/src/components/ActionBar/ActionBarAction.tsx +75 -0
- package/src/components/ActionBar/__snapshots__/ActionBar.test.tsx.snap +122 -0
- package/src/components/ActionBar/index.ts +1 -0
- package/src/components/AppBar.tsx +10 -0
- package/src/components/Author/Author.test.tsx +75 -0
- package/src/components/Author/Author.tsx +47 -0
- package/src/components/Author/__snapshots__/Author.test.tsx.snap +353 -0
- package/src/components/Author/index.ts +1 -0
- package/src/components/Author/styles.ts +23 -0
- package/src/components/AutoComplete/AutoComplete.tsx +179 -0
- package/src/components/AutoComplete/AutoCompleteV2.tsx +296 -0
- package/src/components/AutoComplete/index.ts +1 -0
- package/src/components/AutoComplete/styles.tsx +58 -0
- package/src/components/AutoComplete/useAutoComplete.tsx +61 -0
- package/src/components/Avatar.tsx +3 -0
- package/src/components/Box.tsx +8 -0
- package/src/components/Button.tsx +10 -0
- package/src/components/Card.tsx +10 -0
- package/src/components/CardActions.tsx +13 -0
- package/src/components/CardContent.tsx +10 -0
- package/src/components/Chip.tsx +10 -0
- package/src/components/CircularProgress.tsx +15 -0
- package/src/components/CopyToClipBoard.tsx +45 -0
- package/src/components/Dialog.tsx +10 -0
- package/src/components/DialogActions.tsx +16 -0
- package/src/components/DialogContent.tsx +16 -0
- package/src/components/DialogTitle.tsx +10 -0
- package/src/components/Divider.tsx +10 -0
- package/src/components/FloatingActionButton.tsx +12 -0
- package/src/components/FormControl.tsx +10 -0
- package/src/components/FormHelperText.tsx +16 -0
- package/src/components/Grid.tsx +10 -0
- package/src/components/Heading.tsx +15 -0
- package/src/components/IconButton.tsx +10 -0
- package/src/components/Icons/.eslintrc +5 -0
- package/src/components/Icons/Earth.tsx +36 -0
- package/src/components/Icons/FileBinary.tsx +20 -0
- package/src/components/Icons/Law.tsx +20 -0
- package/src/components/Icons/License.tsx +18 -0
- package/src/components/Icons/Time.tsx +19 -0
- package/src/components/Icons/Version.tsx +20 -0
- package/src/components/Icons/index.ts +5 -0
- package/src/components/Input.tsx +10 -0
- package/src/components/InputAdornment/InputAdornment.tsx +16 -0
- package/src/components/InputAdornment/index.ts +1 -0
- package/src/components/InputLabel.tsx +10 -0
- package/src/components/Label/Label.test.tsx +15 -0
- package/src/components/Label/Label.tsx +35 -0
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +14 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link.tsx +39 -0
- package/src/components/List.tsx +10 -0
- package/src/components/ListItem.tsx +23 -0
- package/src/components/ListItemText.tsx +16 -0
- package/src/components/Loading/Loading.test.tsx +12 -0
- package/src/components/Loading/Loading.tsx +17 -0
- package/src/components/Loading/Spinner/Spinner.test.tsx +14 -0
- package/src/components/Loading/Spinner/Spinner.tsx +35 -0
- package/src/components/Loading/Spinner/__snapshots__/Spinner.test.tsx.snap +148 -0
- package/src/components/Loading/Spinner/index.tsx +1 -0
- package/src/components/Loading/__snapshots__/Loading.test.tsx.snap +86 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Loading/styles.ts +17 -0
- package/src/components/Logo/Logo.test.tsx +12 -0
- package/src/components/Logo/Logo.tsx +55 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +19 -0
- package/src/components/Logo/img/logo-black-and-white.svg +1 -0
- package/src/components/Logo/img/logo.svg +1 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/Menu.tsx +10 -0
- package/src/components/MenuItem.tsx +25 -0
- package/src/components/NotFound/NotFound.tsx +52 -0
- package/src/components/NotFound/Notfound.test.tsx +37 -0
- package/src/components/NotFound/__snapshots__/Notfound.test.tsx.snap +44 -0
- package/src/components/NotFound/img/package.svg +1 -0
- package/src/components/NotFound/index.ts +1 -0
- package/src/components/NotFound/styles.ts +40 -0
- package/src/components/Paper.tsx +10 -0
- package/src/components/SnackbarContent.tsx +15 -0
- package/src/components/SvgIcon.tsx +38 -0
- package/src/components/Tab.tsx +10 -0
- package/src/components/Tabs.tsx +14 -0
- package/src/components/Text/Text.tsx +17 -0
- package/src/components/Text/TextConfig.ts +7 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/TextField/TextField.test.tsx +16 -0
- package/src/components/TextField/TextField.tsx +23 -0
- package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +19 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/Toolbar.tsx +10 -0
- package/src/components/Tooltip.tsx +25 -0
- package/src/design-tokens/ResetStyles.tsx +44 -0
- package/src/design-tokens/StyleBaseline.tsx +14 -0
- package/src/design-tokens/ThemeContext.ts +13 -0
- package/src/design-tokens/ThemeProvider.tsx +44 -0
- package/src/design-tokens/emotion.ts +5 -0
- package/src/design-tokens/load-dayjs-locale.ts +98 -0
- package/src/design-tokens/theme.ts +159 -0
- package/src/design-tokens/useLocalStorage.ts +40 -0
- package/src/design-tokens/useOnClickOutside.ts +28 -0
- package/src/design-tokens/useTheme.ts +7 -0
- package/src/i18n/ABOUT_TRANSLATIONS.md +13 -0
- package/src/i18n/config.ts +52 -0
- package/src/i18n/crowdin/ui.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/cs-CZ.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/de-DE.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/en-US.json +170 -0
- package/src/i18n/deprecated_translations_dont_use/es-ES.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/fr-FR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ja-JP.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/km-KH.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/pt-BR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/ru-RU.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/tr-TR.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/uk-UA.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-CN.json +168 -0
- package/src/i18n/deprecated_translations_dont_use/zh-TW.json +165 -0
- package/src/i18n/enabledLanguages.ts +35 -0
- package/src/index.tsx +36 -0
- package/src/lib/constants.ts +9 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.test.tsx +93 -0
- package/src/pages/Version/DetailContainer/Dependencies/Dependencies.tsx +100 -0
- package/src/pages/Version/DetailContainer/Dependencies/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Dependencies/styles.ts +26 -0
- package/src/pages/Version/DetailContainer/Dependencies/types.ts +7 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.test.tsx +34 -0
- package/src/pages/Version/DetailContainer/Deprecated/Deprecated.tsx +31 -0
- package/src/pages/Version/DetailContainer/Deprecated/index.ts +1 -0
- package/src/pages/Version/DetailContainer/DetailContainer.test.tsx +13 -0
- package/src/pages/Version/DetailContainer/DetailContainer.tsx +37 -0
- package/src/pages/Version/DetailContainer/DetailContainerContent.tsx +41 -0
- package/src/pages/Version/DetailContainer/DetailContainerContentReadme.tsx +19 -0
- package/src/pages/Version/DetailContainer/DetailContainerTabs.tsx +36 -0
- package/src/pages/Version/DetailContainer/NoItems/NoItems.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/Noitems.test.tsx +16 -0
- package/src/pages/Version/DetailContainer/NoItems/__snapshots__/Noitems.test.tsx.snap +9 -0
- package/src/pages/Version/DetailContainer/NoItems/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.spec.tsx +19 -0
- package/src/pages/Version/DetailContainer/Readme/Readme.tsx +22 -0
- package/src/pages/Version/DetailContainer/Readme/__snapshots__/Readme.spec.tsx.snap +94 -0
- package/src/pages/Version/DetailContainer/Readme/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Readme/types.ts +3 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.test.tsx +58 -0
- package/src/pages/Version/DetailContainer/UpLinks/UpLinks.tsx +45 -0
- package/src/pages/Version/DetailContainer/UpLinks/__snapshots__/UpLinks.test.tsx.snap +247 -0
- package/src/pages/Version/DetailContainer/UpLinks/index.ts +1 -0
- package/src/pages/Version/DetailContainer/UpLinks/styles.ts +24 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.test.tsx +60 -0
- package/src/pages/Version/DetailContainer/Versions/Versions.tsx +41 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsHistoryList.tsx +40 -0
- package/src/pages/Version/DetailContainer/Versions/VersionsTagList.tsx +28 -0
- package/src/pages/Version/DetailContainer/Versions/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailContainer/Versions/__snapshots__/Versions.test.tsx.snap +3 -0
- package/src/pages/Version/DetailContainer/Versions/index.ts +1 -0
- package/src/pages/Version/DetailContainer/Versions/styles.ts +30 -0
- package/src/pages/Version/DetailContainer/__snapshots__/DetailContainer.test.tsx.snap +103 -0
- package/src/pages/Version/DetailContainer/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/DetailSidebar.tsx +55 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.test.tsx +111 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarFundButton.tsx +53 -0
- package/src/pages/Version/DetailSidebar/DetailSidebarTitle.tsx +40 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.test.tsx +117 -0
- package/src/pages/Version/DetailSidebar/Developers/Developers.tsx +90 -0
- package/src/pages/Version/DetailSidebar/Developers/DevelopersTitle.tsx +32 -0
- package/src/pages/Version/DetailSidebar/Developers/__snapshots__/Developers.test.tsx.snap +380 -0
- package/src/pages/Version/DetailSidebar/Developers/get-unique-developer-values.ts +16 -0
- package/src/pages/Version/DetailSidebar/Developers/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Developers/styles.ts +31 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Dist/Dist.tsx +49 -0
- package/src/pages/Version/DetailSidebar/Dist/__snapshots__/Dist.test.tsx.snap +602 -0
- package/src/pages/Version/DetailSidebar/Dist/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Dist/styles.ts +27 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.test.tsx +71 -0
- package/src/pages/Version/DetailSidebar/Engines/Engines.tsx +58 -0
- package/src/pages/Version/DetailSidebar/Engines/img/node.png +0 -0
- package/src/pages/Version/DetailSidebar/Engines/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Engines/styles.ts +14 -0
- package/src/pages/Version/DetailSidebar/Install/Install.test.tsx +64 -0
- package/src/pages/Version/DetailSidebar/Install/Install.tsx +52 -0
- package/src/pages/Version/DetailSidebar/Install/InstallListItem.tsx +97 -0
- package/src/pages/Version/DetailSidebar/Install/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Install/img/npm.svg +15 -0
- package/src/pages/Version/DetailSidebar/Install/img/pnpm.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/img/yarn.svg +1 -0
- package/src/pages/Version/DetailSidebar/Install/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.test.tsx +78 -0
- package/src/pages/Version/DetailSidebar/Repository/Repository.tsx +93 -0
- package/src/pages/Version/DetailSidebar/Repository/__partials__/data.json +5984 -0
- package/src/pages/Version/DetailSidebar/Repository/__snapshots__/Repository.test.tsx.snap +3 -0
- package/src/pages/Version/DetailSidebar/Repository/img/git.png +0 -0
- package/src/pages/Version/DetailSidebar/Repository/index.ts +1 -0
- package/src/pages/Version/DetailSidebar/index.ts +1 -0
- package/src/pages/Version/Version.test.tsx +68 -0
- package/src/pages/Version/Version.tsx +41 -0
- package/src/pages/Version/VersionContextProvider.tsx +43 -0
- package/src/pages/Version/VersionLayout.tsx +20 -0
- package/src/pages/Version/__partials__/data.json +5984 -0
- package/src/pages/Version/context.ts +10 -0
- package/src/pages/Version/get-route-package-name.ts +9 -0
- package/src/pages/Version/index.ts +4 -0
- package/src/pages/Version/version-config.ts +19 -0
- package/src/pages/home/Home.tsx +25 -0
- package/src/pages/home/PackageList/Help/Help.test.tsx +12 -0
- package/src/pages/home/PackageList/Help/Help.tsx +56 -0
- package/src/pages/home/PackageList/Help/__snapshots__/Help.test.tsx.snap +159 -0
- package/src/pages/home/PackageList/Help/index.ts +1 -0
- package/src/pages/home/PackageList/Help/styles.ts +13 -0
- package/src/pages/home/PackageList/Package/Package.test.tsx +56 -0
- package/src/pages/home/PackageList/Package/Package.tsx +253 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.test.tsx +16 -0
- package/src/pages/home/PackageList/Package/Tag/Tag.tsx +11 -0
- package/src/pages/home/PackageList/Package/Tag/__snapshots__/Tag.test.tsx.snap +21 -0
- package/src/pages/home/PackageList/Package/Tag/index.ts +1 -0
- package/src/pages/home/PackageList/Package/Tag/styles.ts +11 -0
- package/src/pages/home/PackageList/Package/index.ts +1 -0
- package/src/pages/home/PackageList/Package/styles.ts +112 -0
- package/src/pages/home/PackageList/PackageList.tsx +81 -0
- package/src/pages/home/PackageList/Packagelist.test.tsx +60 -0
- package/src/pages/home/PackageList/index.ts +1 -0
- package/src/pages/home/index.ts +1 -0
- package/src/providers/API/api.test.ts +136 -0
- package/src/providers/API/api.ts +73 -0
- package/src/providers/API/storage.ts +12 -0
- package/src/providers/config/AppConfigurationProvider.tsx +57 -0
- package/src/providers/config/index.ts +1 -0
- package/src/store/index.ts +1 -0
- package/src/store/models/configuration.ts +42 -0
- package/src/store/models/download.ts +31 -0
- package/src/store/models/index.ts +17 -0
- package/src/store/models/login.ts +90 -0
- package/src/store/models/manifest.ts +91 -0
- package/src/store/models/packages.ts +36 -0
- package/src/store/models/search.ts +81 -0
- package/src/store/store.ts +15 -0
- package/src/template/favicon.ico +0 -0
- package/src/template/index.html +21 -0
- package/src/utils/.eslintrc +5 -0
- package/src/utils/cli-utils.test.ts +66 -0
- package/src/utils/cli-utils.ts +38 -0
- package/src/utils/colors.ts +1 -0
- package/src/utils/constants.ts +5 -0
- package/src/utils/file-size.ts +13 -0
- package/src/utils/i18nForTests.ts +25 -0
- package/src/utils/login.test.ts +71 -0
- package/src/utils/login.ts +44 -0
- package/src/utils/package.test.ts +101 -0
- package/src/utils/package.ts +105 -0
- package/src/utils/sec-utils.ts +15 -0
- package/src/utils/storage.ts +12 -0
- package/src/utils/test-react-testing-library.tsx +38 -0
- package/src/utils/url.test.ts +28 -0
- package/src/utils/url.ts +58 -0
- package/src/utils/windows.ts +3 -0
- package/static/favicon.ico +0 -0
- package/static/index.html +21 -0
- package/static/main.c57129036f278d0c7acf.js +2 -0
- package/static/main.c57129036f278d0c7acf.js.LICENSE.txt +1456 -0
- package/static/manifest.json +5 -17
- package/static/runtime.c57129036f278d0c7acf.js +2 -0
- package/static/{runtime.f6e570dfe38870a45bf5.js.LICENSE.txt → runtime.c57129036f278d0c7acf.js.LICENSE.txt} +2 -2
- package/static/vendors.c57129036f278d0c7acf.js +2 -0
- package/static/vendors.c57129036f278d0c7acf.js.LICENSE.txt +2932 -0
- package/tools/.eslintrc +14 -0
- package/tools/_verdaccio.config.yaml +59 -0
- package/tools/dev.server.js +48 -0
- package/tools/getPackageJson.js +25 -0
- package/tools/verdaccio.js +31 -0
- package/tools/webpack.config.js +82 -0
- package/tools/webpack.dev.config.babel.js +60 -0
- package/tools/webpack.prod.config.babel.js +81 -0
- package/tsconfig.build.json +24 -0
- package/tsconfig.json +27 -0
- package/types/custom.d.ts +9 -0
- package/types/files.d.ts +9 -0
- package/types/index.ts +12 -0
- package/types/jest-dom.d.ts +1 -0
- package/types/packageMeta.ts +82 -0
- package/static/238.f6e570dfe38870a45bf5.js +0 -2
- package/static/238.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/718.f6e570dfe38870a45bf5.js +0 -2
- package/static/718.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/73.f6e570dfe38870a45bf5.js +0 -2
- package/static/73.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dependencies.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dependencies.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Dist.f6e570dfe38870a45bf5.js +0 -2
- package/static/Dist.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Engines.f6e570dfe38870a45bf5.js +0 -2
- package/static/Engines.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Home.f6e570dfe38870a45bf5.js +0 -2
- package/static/Home.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Install.f6e570dfe38870a45bf5.js +0 -2
- package/static/Install.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/NotFound.f6e570dfe38870a45bf5.js +0 -2
- package/static/NotFound.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Provider.f6e570dfe38870a45bf5.js +0 -2
- package/static/Provider.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Repository.f6e570dfe38870a45bf5.js +0 -2
- package/static/Repository.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/UpLinks.f6e570dfe38870a45bf5.js +0 -2
- package/static/UpLinks.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Version.f6e570dfe38870a45bf5.js +0 -2
- package/static/Version.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/Versions.f6e570dfe38870a45bf5.js +0 -2
- package/static/Versions.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/main.f6e570dfe38870a45bf5.js +0 -2
- package/static/main.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -10
- package/static/runtime.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js +0 -2
- package/static/vendors.f6e570dfe38870a45bf5.js.LICENSE.txt +0 -98
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import Avatar from '@material-ui/core/Avatar';
|
|
3
|
+
import Add from '@material-ui/icons/Add';
|
|
4
|
+
import React, { useState, useCallback, useContext, useEffect, useMemo } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
import Box from 'verdaccio-ui/components/Box';
|
|
8
|
+
import FloatingActionButton from 'verdaccio-ui/components/FloatingActionButton';
|
|
9
|
+
import Tooltip from 'verdaccio-ui/components/Tooltip';
|
|
10
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
11
|
+
|
|
12
|
+
import { DetailContext } from '../..';
|
|
13
|
+
|
|
14
|
+
import DevelopersTitle from './DevelopersTitle';
|
|
15
|
+
import getUniqueDeveloperValues from './get-unique-developer-values';
|
|
16
|
+
|
|
17
|
+
export enum DeveloperType {
|
|
18
|
+
CONTRIBUTORS = 'contributors',
|
|
19
|
+
MAINTAINERS = 'maintainers',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>((props) => ({
|
|
23
|
+
backgroundColor: props.theme?.palette.primary.main,
|
|
24
|
+
color: props.theme?.palette.white,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
type: DeveloperType;
|
|
29
|
+
visibleMax?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const StyledBox = styled(Box)({
|
|
33
|
+
'> *': {
|
|
34
|
+
margin: 5,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const VISIBLE_MAX = 6;
|
|
39
|
+
|
|
40
|
+
const Developers: React.FC<Props> = ({ type, visibleMax = VISIBLE_MAX }) => {
|
|
41
|
+
const detailContext = useContext(DetailContext);
|
|
42
|
+
const { t } = useTranslation();
|
|
43
|
+
|
|
44
|
+
if (!detailContext) {
|
|
45
|
+
throw Error(t('app-context-not-correct-used'));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const developers = useMemo(
|
|
49
|
+
() => getUniqueDeveloperValues(detailContext.packageMeta?.latest[type]),
|
|
50
|
+
[detailContext.packageMeta, type]
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const [visibleDevelopersMax, setVisibleDevelopersMax] = useState(visibleMax);
|
|
54
|
+
const [visibleDevelopers, setVisibleDevelopers] = useState(developers);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!developers.length) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
setVisibleDevelopers(developers.slice(0, visibleDevelopersMax));
|
|
61
|
+
}, [developers, visibleDevelopersMax]);
|
|
62
|
+
|
|
63
|
+
const handleSetVisibleDevelopersMax = useCallback(() => {
|
|
64
|
+
setVisibleDevelopersMax(visibleDevelopersMax + VISIBLE_MAX);
|
|
65
|
+
}, [visibleDevelopersMax]);
|
|
66
|
+
|
|
67
|
+
if (!visibleDevelopers || !developers.length) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<DevelopersTitle type={type} />
|
|
74
|
+
<StyledBox display="flex" flexWrap="wrap" margin="10px 0 10px 0">
|
|
75
|
+
{visibleDevelopers.map((visibleDeveloper) => (
|
|
76
|
+
<Tooltip key={visibleDeveloper.email} title={visibleDeveloper.name}>
|
|
77
|
+
<Avatar alt={visibleDeveloper.name} src={visibleDeveloper.avatar} />
|
|
78
|
+
</Tooltip>
|
|
79
|
+
))}
|
|
80
|
+
{visibleDevelopersMax < developers.length && (
|
|
81
|
+
<Fab onClick={handleSetVisibleDevelopersMax} size="small">
|
|
82
|
+
<Add />
|
|
83
|
+
</Fab>
|
|
84
|
+
)}
|
|
85
|
+
</StyledBox>
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default Developers;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
import Text from 'verdaccio-ui/components/Text';
|
|
6
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
7
|
+
|
|
8
|
+
export enum DeveloperType {
|
|
9
|
+
CONTRIBUTORS = 'contributors',
|
|
10
|
+
MAINTAINERS = 'maintainers',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
type: DeveloperType;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const DevelopersTitle: React.FC<Props> = ({ type }) => {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
switch (type) {
|
|
20
|
+
case DeveloperType.CONTRIBUTORS:
|
|
21
|
+
return <StyledText variant={'subtitle1'}>{t('sidebar.contributors.title')}</StyledText>;
|
|
22
|
+
case DeveloperType.MAINTAINERS:
|
|
23
|
+
return <StyledText variant={'subtitle1'}>{t('sidebar.maintainers.title')}</StyledText>;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default DevelopersTitle;
|
|
28
|
+
|
|
29
|
+
const StyledText = styled(Text)<{ theme?: Theme }>(({ theme }) => ({
|
|
30
|
+
fontWeight: theme?.fontWeight.bold,
|
|
31
|
+
marginBottom: '10px',
|
|
32
|
+
}));
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test Developers should render the component for contributors with items 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"asFragment": [Function],
|
|
6
|
+
"baseElement": .emotion-0 {
|
|
7
|
+
font-weight: 700;
|
|
8
|
+
margin-bottom: 10px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.emotion-2>* {
|
|
12
|
+
margin: 5px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
<body>
|
|
16
|
+
<div>
|
|
17
|
+
<span
|
|
18
|
+
class="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
|
|
19
|
+
>
|
|
20
|
+
Contributors
|
|
21
|
+
</span>
|
|
22
|
+
<div
|
|
23
|
+
class="MuiBox-root MuiBox-root-2 emotion-2 emotion-3"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
27
|
+
title="dmethvin"
|
|
28
|
+
>
|
|
29
|
+
<svg
|
|
30
|
+
aria-hidden="true"
|
|
31
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
32
|
+
focusable="false"
|
|
33
|
+
viewBox="0 0 24 24"
|
|
34
|
+
>
|
|
35
|
+
<path
|
|
36
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
37
|
+
/>
|
|
38
|
+
</svg>
|
|
39
|
+
</div>
|
|
40
|
+
<div
|
|
41
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
42
|
+
title="mgol"
|
|
43
|
+
>
|
|
44
|
+
<svg
|
|
45
|
+
aria-hidden="true"
|
|
46
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
47
|
+
focusable="false"
|
|
48
|
+
viewBox="0 0 24 24"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
52
|
+
/>
|
|
53
|
+
</svg>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</body>,
|
|
58
|
+
"container": .emotion-0 {
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
margin-bottom: 10px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.emotion-2>* {
|
|
64
|
+
margin: 5px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
<div>
|
|
68
|
+
<span
|
|
69
|
+
class="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
|
|
70
|
+
>
|
|
71
|
+
Contributors
|
|
72
|
+
</span>
|
|
73
|
+
<div
|
|
74
|
+
class="MuiBox-root MuiBox-root-2 emotion-2 emotion-3"
|
|
75
|
+
>
|
|
76
|
+
<div
|
|
77
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
78
|
+
title="dmethvin"
|
|
79
|
+
>
|
|
80
|
+
<svg
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
83
|
+
focusable="false"
|
|
84
|
+
viewBox="0 0 24 24"
|
|
85
|
+
>
|
|
86
|
+
<path
|
|
87
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
88
|
+
/>
|
|
89
|
+
</svg>
|
|
90
|
+
</div>
|
|
91
|
+
<div
|
|
92
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
93
|
+
title="mgol"
|
|
94
|
+
>
|
|
95
|
+
<svg
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
98
|
+
focusable="false"
|
|
99
|
+
viewBox="0 0 24 24"
|
|
100
|
+
>
|
|
101
|
+
<path
|
|
102
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
103
|
+
/>
|
|
104
|
+
</svg>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>,
|
|
108
|
+
"debug": [Function],
|
|
109
|
+
"findAllByAltText": [Function],
|
|
110
|
+
"findAllByDisplayValue": [Function],
|
|
111
|
+
"findAllByLabelText": [Function],
|
|
112
|
+
"findAllByPlaceholderText": [Function],
|
|
113
|
+
"findAllByRole": [Function],
|
|
114
|
+
"findAllByTestId": [Function],
|
|
115
|
+
"findAllByText": [Function],
|
|
116
|
+
"findAllByTitle": [Function],
|
|
117
|
+
"findByAltText": [Function],
|
|
118
|
+
"findByDisplayValue": [Function],
|
|
119
|
+
"findByLabelText": [Function],
|
|
120
|
+
"findByPlaceholderText": [Function],
|
|
121
|
+
"findByRole": [Function],
|
|
122
|
+
"findByTestId": [Function],
|
|
123
|
+
"findByText": [Function],
|
|
124
|
+
"findByTitle": [Function],
|
|
125
|
+
"getAllByAltText": [Function],
|
|
126
|
+
"getAllByDisplayValue": [Function],
|
|
127
|
+
"getAllByLabelText": [Function],
|
|
128
|
+
"getAllByPlaceholderText": [Function],
|
|
129
|
+
"getAllByRole": [Function],
|
|
130
|
+
"getAllByTestId": [Function],
|
|
131
|
+
"getAllByText": [Function],
|
|
132
|
+
"getAllByTitle": [Function],
|
|
133
|
+
"getByAltText": [Function],
|
|
134
|
+
"getByDisplayValue": [Function],
|
|
135
|
+
"getByLabelText": [Function],
|
|
136
|
+
"getByPlaceholderText": [Function],
|
|
137
|
+
"getByRole": [Function],
|
|
138
|
+
"getByTestId": [Function],
|
|
139
|
+
"getByText": [Function],
|
|
140
|
+
"getByTitle": [Function],
|
|
141
|
+
"queryAllByAltText": [Function],
|
|
142
|
+
"queryAllByDisplayValue": [Function],
|
|
143
|
+
"queryAllByLabelText": [Function],
|
|
144
|
+
"queryAllByPlaceholderText": [Function],
|
|
145
|
+
"queryAllByRole": [Function],
|
|
146
|
+
"queryAllByTestId": [Function],
|
|
147
|
+
"queryAllByText": [Function],
|
|
148
|
+
"queryAllByTitle": [Function],
|
|
149
|
+
"queryByAltText": [Function],
|
|
150
|
+
"queryByDisplayValue": [Function],
|
|
151
|
+
"queryByLabelText": [Function],
|
|
152
|
+
"queryByPlaceholderText": [Function],
|
|
153
|
+
"queryByRole": [Function],
|
|
154
|
+
"queryByTestId": [Function],
|
|
155
|
+
"queryByText": [Function],
|
|
156
|
+
"queryByTitle": [Function],
|
|
157
|
+
"rerender": [Function],
|
|
158
|
+
"unmount": [Function],
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
exports[`test Developers should render the component for maintainers with items 1`] = `
|
|
163
|
+
Object {
|
|
164
|
+
"asFragment": [Function],
|
|
165
|
+
"baseElement": .emotion-0 {
|
|
166
|
+
font-weight: 700;
|
|
167
|
+
margin-bottom: 10px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.emotion-2>* {
|
|
171
|
+
margin: 5px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
<body>
|
|
175
|
+
<div>
|
|
176
|
+
<span
|
|
177
|
+
class="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
|
|
178
|
+
>
|
|
179
|
+
Maintainers
|
|
180
|
+
</span>
|
|
181
|
+
<div
|
|
182
|
+
class="MuiBox-root MuiBox-root-1 emotion-2 emotion-3"
|
|
183
|
+
>
|
|
184
|
+
<div
|
|
185
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
186
|
+
title="dmethvin"
|
|
187
|
+
>
|
|
188
|
+
<svg
|
|
189
|
+
aria-hidden="true"
|
|
190
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
191
|
+
focusable="false"
|
|
192
|
+
viewBox="0 0 24 24"
|
|
193
|
+
>
|
|
194
|
+
<path
|
|
195
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
196
|
+
/>
|
|
197
|
+
</svg>
|
|
198
|
+
</div>
|
|
199
|
+
<div
|
|
200
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
201
|
+
title="mgol"
|
|
202
|
+
>
|
|
203
|
+
<svg
|
|
204
|
+
aria-hidden="true"
|
|
205
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
206
|
+
focusable="false"
|
|
207
|
+
viewBox="0 0 24 24"
|
|
208
|
+
>
|
|
209
|
+
<path
|
|
210
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
211
|
+
/>
|
|
212
|
+
</svg>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</body>,
|
|
217
|
+
"container": .emotion-0 {
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
margin-bottom: 10px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.emotion-2>* {
|
|
223
|
+
margin: 5px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
<div>
|
|
227
|
+
<span
|
|
228
|
+
class="MuiTypography-root emotion-0 emotion-1 MuiTypography-subtitle1"
|
|
229
|
+
>
|
|
230
|
+
Maintainers
|
|
231
|
+
</span>
|
|
232
|
+
<div
|
|
233
|
+
class="MuiBox-root MuiBox-root-1 emotion-2 emotion-3"
|
|
234
|
+
>
|
|
235
|
+
<div
|
|
236
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
237
|
+
title="dmethvin"
|
|
238
|
+
>
|
|
239
|
+
<svg
|
|
240
|
+
aria-hidden="true"
|
|
241
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
242
|
+
focusable="false"
|
|
243
|
+
viewBox="0 0 24 24"
|
|
244
|
+
>
|
|
245
|
+
<path
|
|
246
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
247
|
+
/>
|
|
248
|
+
</svg>
|
|
249
|
+
</div>
|
|
250
|
+
<div
|
|
251
|
+
class="MuiAvatar-root MuiAvatar-circle MuiAvatar-colorDefault"
|
|
252
|
+
title="mgol"
|
|
253
|
+
>
|
|
254
|
+
<svg
|
|
255
|
+
aria-hidden="true"
|
|
256
|
+
class="MuiSvgIcon-root MuiAvatar-fallback"
|
|
257
|
+
focusable="false"
|
|
258
|
+
viewBox="0 0 24 24"
|
|
259
|
+
>
|
|
260
|
+
<path
|
|
261
|
+
d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
262
|
+
/>
|
|
263
|
+
</svg>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>,
|
|
267
|
+
"debug": [Function],
|
|
268
|
+
"findAllByAltText": [Function],
|
|
269
|
+
"findAllByDisplayValue": [Function],
|
|
270
|
+
"findAllByLabelText": [Function],
|
|
271
|
+
"findAllByPlaceholderText": [Function],
|
|
272
|
+
"findAllByRole": [Function],
|
|
273
|
+
"findAllByTestId": [Function],
|
|
274
|
+
"findAllByText": [Function],
|
|
275
|
+
"findAllByTitle": [Function],
|
|
276
|
+
"findByAltText": [Function],
|
|
277
|
+
"findByDisplayValue": [Function],
|
|
278
|
+
"findByLabelText": [Function],
|
|
279
|
+
"findByPlaceholderText": [Function],
|
|
280
|
+
"findByRole": [Function],
|
|
281
|
+
"findByTestId": [Function],
|
|
282
|
+
"findByText": [Function],
|
|
283
|
+
"findByTitle": [Function],
|
|
284
|
+
"getAllByAltText": [Function],
|
|
285
|
+
"getAllByDisplayValue": [Function],
|
|
286
|
+
"getAllByLabelText": [Function],
|
|
287
|
+
"getAllByPlaceholderText": [Function],
|
|
288
|
+
"getAllByRole": [Function],
|
|
289
|
+
"getAllByTestId": [Function],
|
|
290
|
+
"getAllByText": [Function],
|
|
291
|
+
"getAllByTitle": [Function],
|
|
292
|
+
"getByAltText": [Function],
|
|
293
|
+
"getByDisplayValue": [Function],
|
|
294
|
+
"getByLabelText": [Function],
|
|
295
|
+
"getByPlaceholderText": [Function],
|
|
296
|
+
"getByRole": [Function],
|
|
297
|
+
"getByTestId": [Function],
|
|
298
|
+
"getByText": [Function],
|
|
299
|
+
"getByTitle": [Function],
|
|
300
|
+
"queryAllByAltText": [Function],
|
|
301
|
+
"queryAllByDisplayValue": [Function],
|
|
302
|
+
"queryAllByLabelText": [Function],
|
|
303
|
+
"queryAllByPlaceholderText": [Function],
|
|
304
|
+
"queryAllByRole": [Function],
|
|
305
|
+
"queryAllByTestId": [Function],
|
|
306
|
+
"queryAllByText": [Function],
|
|
307
|
+
"queryAllByTitle": [Function],
|
|
308
|
+
"queryByAltText": [Function],
|
|
309
|
+
"queryByDisplayValue": [Function],
|
|
310
|
+
"queryByLabelText": [Function],
|
|
311
|
+
"queryByPlaceholderText": [Function],
|
|
312
|
+
"queryByRole": [Function],
|
|
313
|
+
"queryByTestId": [Function],
|
|
314
|
+
"queryByText": [Function],
|
|
315
|
+
"queryByTitle": [Function],
|
|
316
|
+
"rerender": [Function],
|
|
317
|
+
"unmount": [Function],
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
320
|
+
|
|
321
|
+
exports[`test Developers should render the component with no items 1`] = `
|
|
322
|
+
Object {
|
|
323
|
+
"asFragment": [Function],
|
|
324
|
+
"baseElement": <body>
|
|
325
|
+
<div />
|
|
326
|
+
</body>,
|
|
327
|
+
"container": <div />,
|
|
328
|
+
"debug": [Function],
|
|
329
|
+
"findAllByAltText": [Function],
|
|
330
|
+
"findAllByDisplayValue": [Function],
|
|
331
|
+
"findAllByLabelText": [Function],
|
|
332
|
+
"findAllByPlaceholderText": [Function],
|
|
333
|
+
"findAllByRole": [Function],
|
|
334
|
+
"findAllByTestId": [Function],
|
|
335
|
+
"findAllByText": [Function],
|
|
336
|
+
"findAllByTitle": [Function],
|
|
337
|
+
"findByAltText": [Function],
|
|
338
|
+
"findByDisplayValue": [Function],
|
|
339
|
+
"findByLabelText": [Function],
|
|
340
|
+
"findByPlaceholderText": [Function],
|
|
341
|
+
"findByRole": [Function],
|
|
342
|
+
"findByTestId": [Function],
|
|
343
|
+
"findByText": [Function],
|
|
344
|
+
"findByTitle": [Function],
|
|
345
|
+
"getAllByAltText": [Function],
|
|
346
|
+
"getAllByDisplayValue": [Function],
|
|
347
|
+
"getAllByLabelText": [Function],
|
|
348
|
+
"getAllByPlaceholderText": [Function],
|
|
349
|
+
"getAllByRole": [Function],
|
|
350
|
+
"getAllByTestId": [Function],
|
|
351
|
+
"getAllByText": [Function],
|
|
352
|
+
"getAllByTitle": [Function],
|
|
353
|
+
"getByAltText": [Function],
|
|
354
|
+
"getByDisplayValue": [Function],
|
|
355
|
+
"getByLabelText": [Function],
|
|
356
|
+
"getByPlaceholderText": [Function],
|
|
357
|
+
"getByRole": [Function],
|
|
358
|
+
"getByTestId": [Function],
|
|
359
|
+
"getByText": [Function],
|
|
360
|
+
"getByTitle": [Function],
|
|
361
|
+
"queryAllByAltText": [Function],
|
|
362
|
+
"queryAllByDisplayValue": [Function],
|
|
363
|
+
"queryAllByLabelText": [Function],
|
|
364
|
+
"queryAllByPlaceholderText": [Function],
|
|
365
|
+
"queryAllByRole": [Function],
|
|
366
|
+
"queryAllByTestId": [Function],
|
|
367
|
+
"queryAllByText": [Function],
|
|
368
|
+
"queryAllByTitle": [Function],
|
|
369
|
+
"queryByAltText": [Function],
|
|
370
|
+
"queryByDisplayValue": [Function],
|
|
371
|
+
"queryByLabelText": [Function],
|
|
372
|
+
"queryByPlaceholderText": [Function],
|
|
373
|
+
"queryByRole": [Function],
|
|
374
|
+
"queryByTestId": [Function],
|
|
375
|
+
"queryByText": [Function],
|
|
376
|
+
"queryByTitle": [Function],
|
|
377
|
+
"rerender": [Function],
|
|
378
|
+
"unmount": [Function],
|
|
379
|
+
}
|
|
380
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Developer } from '../../../../../types/packageMeta';
|
|
2
|
+
|
|
3
|
+
function getUniqueDeveloperValues(developers?: Developer[]): Developer[] {
|
|
4
|
+
if (!developers) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
return developers.reduce(
|
|
8
|
+
(accumulator: Developer[], current: Developer) =>
|
|
9
|
+
accumulator.some((developer) => developer.email === current.email)
|
|
10
|
+
? accumulator
|
|
11
|
+
: [...accumulator, current],
|
|
12
|
+
[]
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default getUniqueDeveloperValues;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Developers';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
import FloatingActionButton from 'verdaccio-ui/components/FloatingActionButton';
|
|
4
|
+
import Text from 'verdaccio-ui/components/Text';
|
|
5
|
+
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
|
6
|
+
|
|
7
|
+
export const Details = styled('span')({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const Content = styled('div')({
|
|
14
|
+
margin: '10px 0 10px 0',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexWrap: 'wrap',
|
|
17
|
+
'> *': {
|
|
18
|
+
margin: '5px',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const StyledText = styled(Text)<{ theme?: Theme }>((props) => ({
|
|
23
|
+
fontWeight: props.theme?.fontWeight.bold,
|
|
24
|
+
marginBottom: '10px',
|
|
25
|
+
textTransform: 'capitalize',
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>((props) => ({
|
|
29
|
+
backgroundColor: props.theme?.palette.primary.main,
|
|
30
|
+
color: props.theme?.palette.white,
|
|
31
|
+
}));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, cleanup } from 'verdaccio-ui/utils/test-react-testing-library';
|
|
4
|
+
|
|
5
|
+
import { DetailContext } from '../../context';
|
|
6
|
+
|
|
7
|
+
import Dist from './Dist';
|
|
8
|
+
|
|
9
|
+
const withDistComponent = (
|
|
10
|
+
packageMeta: React.ContextType<typeof DetailContext>['packageMeta']
|
|
11
|
+
): JSX.Element => (
|
|
12
|
+
<DetailContext.Provider value={{ packageMeta }}>
|
|
13
|
+
<Dist />
|
|
14
|
+
</DetailContext.Provider>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
describe('<Dist /> component', () => {
|
|
18
|
+
afterEach(function () {
|
|
19
|
+
cleanup();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('should render the component in default state', () => {
|
|
23
|
+
const wrapper = render(
|
|
24
|
+
withDistComponent({
|
|
25
|
+
latest: {
|
|
26
|
+
name: 'verdaccio1',
|
|
27
|
+
version: '4.0.0',
|
|
28
|
+
dist: {
|
|
29
|
+
fileCount: 7,
|
|
30
|
+
unpackedSize: 10,
|
|
31
|
+
},
|
|
32
|
+
license: '',
|
|
33
|
+
},
|
|
34
|
+
_uplinks: {},
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
expect(wrapper).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('should render the component with license as string', () => {
|
|
41
|
+
const wrapper = render(
|
|
42
|
+
withDistComponent({
|
|
43
|
+
latest: {
|
|
44
|
+
name: 'verdaccio2',
|
|
45
|
+
version: '4.0.0',
|
|
46
|
+
dist: {
|
|
47
|
+
fileCount: 7,
|
|
48
|
+
unpackedSize: 10,
|
|
49
|
+
},
|
|
50
|
+
license: 'MIT',
|
|
51
|
+
},
|
|
52
|
+
_uplinks: {},
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
expect(wrapper).toMatchSnapshot();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('should render the component with license as object', () => {
|
|
59
|
+
const wrapper = render(
|
|
60
|
+
withDistComponent({
|
|
61
|
+
latest: {
|
|
62
|
+
name: 'verdaccio3',
|
|
63
|
+
version: '4.0.0',
|
|
64
|
+
dist: {
|
|
65
|
+
fileCount: 7,
|
|
66
|
+
unpackedSize: 10,
|
|
67
|
+
},
|
|
68
|
+
license: {
|
|
69
|
+
type: 'MIT',
|
|
70
|
+
url: 'https://www.opensource.org/licenses/mit-license.php',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
_uplinks: {},
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
expect(wrapper).toMatchSnapshot();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { FC, useContext } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
|
|
4
|
+
import List from 'verdaccio-ui/components/List';
|
|
5
|
+
import fileSizeSI from 'verdaccio-ui/utils/file-size';
|
|
6
|
+
import { formatLicense } from 'verdaccio-ui/utils/package';
|
|
7
|
+
|
|
8
|
+
import { DetailContext } from '../../context';
|
|
9
|
+
|
|
10
|
+
import { StyledText, DistListItem, DistChips } from './styles';
|
|
11
|
+
|
|
12
|
+
const DistChip: FC<{ name: string }> = ({ name, children }) =>
|
|
13
|
+
children ? (
|
|
14
|
+
<DistChips
|
|
15
|
+
label={
|
|
16
|
+
<>
|
|
17
|
+
<b>{name}</b>
|
|
18
|
+
{': '}
|
|
19
|
+
{children}
|
|
20
|
+
</>
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
) : null;
|
|
24
|
+
|
|
25
|
+
const Dist: FC = () => {
|
|
26
|
+
const { packageMeta } = useContext(DetailContext);
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
|
|
29
|
+
if (!packageMeta) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { dist, license } = packageMeta && packageMeta.latest;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<List
|
|
37
|
+
subheader={<StyledText variant="subtitle1">{t('sidebar.distribution.title')}</StyledText>}>
|
|
38
|
+
<DistListItem button={true}>
|
|
39
|
+
<DistChip name={t('sidebar.distribution.file-count')}>{dist.fileCount}</DistChip>
|
|
40
|
+
<DistChip name={t('sidebar.distribution.size')}>
|
|
41
|
+
{dist.unpackedSize && fileSizeSI(dist.unpackedSize)}
|
|
42
|
+
</DistChip>
|
|
43
|
+
<DistChip name={t('sidebar.distribution.license')}>{formatLicense(license)}</DistChip>
|
|
44
|
+
</DistListItem>
|
|
45
|
+
</List>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default Dist;
|