@verdaccio/ui-components 5.0.0-next-9.25 → 5.0.0-next-9.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/Dependencies/DependencyBlock.js +1 -0
- package/build/components/Dependencies/DependencyBlock.js.map +1 -1
- package/build/components/Dependencies/DependencyBlock.mjs +1 -0
- package/build/components/Dependencies/DependencyBlock.mjs.map +1 -1
- package/build/components/Help/Help.js +103 -66
- package/build/components/Help/Help.js.map +1 -1
- package/build/components/Help/Help.mjs +103 -66
- package/build/components/Help/Help.mjs.map +1 -1
- package/build/i18n/crowdin/ui.js +3 -1
- package/build/i18n/crowdin/ui.js.map +1 -1
- package/build/i18n/crowdin/ui.json +3 -1
- package/build/i18n/crowdin/ui.mjs +3 -1
- package/build/i18n/crowdin/ui.mjs.map +1 -1
- package/build/i18n/download_translations/cs-CZ/ui.js +3 -1
- package/build/i18n/download_translations/cs-CZ/ui.js.map +1 -1
- package/build/i18n/download_translations/cs-CZ/ui.json +3 -1
- package/build/i18n/download_translations/cs-CZ/ui.mjs +3 -1
- package/build/i18n/download_translations/cs-CZ/ui.mjs.map +1 -1
- package/build/i18n/download_translations/de-DE/ui.js +123 -119
- package/build/i18n/download_translations/de-DE/ui.js.map +1 -1
- package/build/i18n/download_translations/de-DE/ui.json +121 -119
- package/build/i18n/download_translations/de-DE/ui.mjs +123 -120
- package/build/i18n/download_translations/de-DE/ui.mjs.map +1 -1
- package/build/i18n/download_translations/es-ES/ui.js +53 -49
- package/build/i18n/download_translations/es-ES/ui.js.map +1 -1
- package/build/i18n/download_translations/es-ES/ui.json +51 -49
- package/build/i18n/download_translations/es-ES/ui.mjs +53 -50
- package/build/i18n/download_translations/es-ES/ui.mjs.map +1 -1
- package/build/i18n/download_translations/fr-FR/ui.js +56 -54
- package/build/i18n/download_translations/fr-FR/ui.js.map +1 -1
- package/build/i18n/download_translations/fr-FR/ui.json +56 -54
- package/build/i18n/download_translations/fr-FR/ui.mjs +56 -54
- package/build/i18n/download_translations/fr-FR/ui.mjs.map +1 -1
- package/build/i18n/download_translations/ga-IE/ui.js +3 -1
- package/build/i18n/download_translations/ga-IE/ui.js.map +1 -1
- package/build/i18n/download_translations/ga-IE/ui.json +3 -1
- package/build/i18n/download_translations/ga-IE/ui.mjs +3 -1
- package/build/i18n/download_translations/ga-IE/ui.mjs.map +1 -1
- package/build/i18n/download_translations/gl-ES/ui.js +3 -1
- package/build/i18n/download_translations/gl-ES/ui.js.map +1 -1
- package/build/i18n/download_translations/gl-ES/ui.json +3 -1
- package/build/i18n/download_translations/gl-ES/ui.mjs +3 -1
- package/build/i18n/download_translations/gl-ES/ui.mjs.map +1 -1
- package/build/i18n/download_translations/it-IT/ui.js +3 -1
- package/build/i18n/download_translations/it-IT/ui.js.map +1 -1
- package/build/i18n/download_translations/it-IT/ui.json +3 -1
- package/build/i18n/download_translations/it-IT/ui.mjs +3 -1
- package/build/i18n/download_translations/it-IT/ui.mjs.map +1 -1
- package/build/i18n/download_translations/ko-KR/ui.js +3 -1
- package/build/i18n/download_translations/ko-KR/ui.js.map +1 -1
- package/build/i18n/download_translations/ko-KR/ui.json +3 -1
- package/build/i18n/download_translations/ko-KR/ui.mjs +3 -1
- package/build/i18n/download_translations/ko-KR/ui.mjs.map +1 -1
- package/build/i18n/download_translations/pl-PL/ui.js +3 -1
- package/build/i18n/download_translations/pl-PL/ui.js.map +1 -1
- package/build/i18n/download_translations/pl-PL/ui.json +3 -1
- package/build/i18n/download_translations/pl-PL/ui.mjs +3 -1
- package/build/i18n/download_translations/pl-PL/ui.mjs.map +1 -1
- package/build/i18n/download_translations/pt-BR/ui.js +3 -1
- package/build/i18n/download_translations/pt-BR/ui.js.map +1 -1
- package/build/i18n/download_translations/pt-BR/ui.json +3 -1
- package/build/i18n/download_translations/pt-BR/ui.mjs +3 -1
- package/build/i18n/download_translations/pt-BR/ui.mjs.map +1 -1
- package/build/i18n/download_translations/ru-RU/ui.js +3 -1
- package/build/i18n/download_translations/ru-RU/ui.js.map +1 -1
- package/build/i18n/download_translations/ru-RU/ui.json +3 -1
- package/build/i18n/download_translations/ru-RU/ui.mjs +3 -1
- package/build/i18n/download_translations/ru-RU/ui.mjs.map +1 -1
- package/build/i18n/download_translations/sr-CS/ui.js +3 -1
- package/build/i18n/download_translations/sr-CS/ui.js.map +1 -1
- package/build/i18n/download_translations/sr-CS/ui.json +3 -1
- package/build/i18n/download_translations/sr-CS/ui.mjs +3 -1
- package/build/i18n/download_translations/sr-CS/ui.mjs.map +1 -1
- package/build/i18n/download_translations/tr-TR/ui.js +3 -1
- package/build/i18n/download_translations/tr-TR/ui.js.map +1 -1
- package/build/i18n/download_translations/tr-TR/ui.json +3 -1
- package/build/i18n/download_translations/tr-TR/ui.mjs +3 -1
- package/build/i18n/download_translations/tr-TR/ui.mjs.map +1 -1
- package/build/i18n/download_translations/vi-VN/ui.js +3 -1
- package/build/i18n/download_translations/vi-VN/ui.js.map +1 -1
- package/build/i18n/download_translations/vi-VN/ui.json +3 -1
- package/build/i18n/download_translations/vi-VN/ui.mjs +3 -1
- package/build/i18n/download_translations/vi-VN/ui.mjs.map +1 -1
- package/build/i18n/download_translations/yo-NG/ui.js +3 -1
- package/build/i18n/download_translations/yo-NG/ui.js.map +1 -1
- package/build/i18n/download_translations/yo-NG/ui.json +3 -1
- package/build/i18n/download_translations/yo-NG/ui.mjs +3 -1
- package/build/i18n/download_translations/yo-NG/ui.mjs.map +1 -1
- package/build/i18n/download_translations/zh-CN/ui.js +3 -1
- package/build/i18n/download_translations/zh-CN/ui.js.map +1 -1
- package/build/i18n/download_translations/zh-CN/ui.json +3 -1
- package/build/i18n/download_translations/zh-CN/ui.mjs +3 -1
- package/build/i18n/download_translations/zh-CN/ui.mjs.map +1 -1
- package/build/i18n/download_translations/zh-TW/ui.js +3 -1
- package/build/i18n/download_translations/zh-TW/ui.js.map +1 -1
- package/build/i18n/download_translations/zh-TW/ui.json +3 -1
- package/build/i18n/download_translations/zh-TW/ui.mjs +3 -1
- package/build/i18n/download_translations/zh-TW/ui.mjs.map +1 -1
- package/build/i18n/loadTranslationFile.d.ts +2 -2
- package/build/i18n/loadTranslationFile.js +2 -2
- package/build/i18n/loadTranslationFile.js.map +1 -1
- package/build/i18n/loadTranslationFile.mjs +2 -2
- package/build/i18n/loadTranslationFile.mjs.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.js +9 -2
- package/build/sections/Header/HeaderSettingsDialog.js.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.mjs +9 -2
- package/build/sections/Header/HeaderSettingsDialog.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +17 -4
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs +17 -4
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs.map +1 -1
- package/build/utils/markdown.d.ts +1 -1
- package/build/utils/markdown.js +3 -1
- package/build/utils/markdown.js.map +1 -1
- package/build/utils/markdown.mjs +2 -1
- package/build/utils/markdown.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -30,6 +30,7 @@ var DependencyBlock = ({ title, dependencies }) => {
|
|
|
30
30
|
const navigate = (0, react_router.useNavigate)();
|
|
31
31
|
const { t } = (0, react_i18next.useTranslation)();
|
|
32
32
|
const deps = Object.entries(dependencies);
|
|
33
|
+
deps.sort(([nameA], [nameB]) => nameA.localeCompare(nameB));
|
|
33
34
|
function handleClick(name) {
|
|
34
35
|
navigate(`${require_routes.Route.DETAIL}${name}`);
|
|
35
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependencyBlock.js","names":["styled","Typography","Chip","useNavigate","useTranslation","Route","Box"],"sources":["../../../src/components/Dependencies/DependencyBlock.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport type { Theme } from '../../Theme';\nimport type { PackageDependencies } from '../../types/packageMeta';\nimport { Route } from '../../utils';\n\ninterface DependencyBlockProps {\n title: string;\n dependencies: PackageDependencies;\n}\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nexport const Tags = styled('div')<{ theme?: Theme }>((props) => ({\n display: 'flex',\n justifyContent: 'start',\n flexWrap: 'wrap',\n // force title to be on the same line as the title\n // could be better to avoid margin on the first element\n // but it is a bit tricky to do with flexbox\n marginLeft: props.theme.spacing(-0.6),\n}));\n\nexport const Tag = styled(Chip)<{ theme?: Theme }>((props) => ({\n margin: props.theme.spacing(0.6),\n}));\n\nexport const DependencyBlock: React.FC<DependencyBlockProps> = ({ title, dependencies }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n const deps = Object.entries(dependencies);\n\n function handleClick(name: string): void {\n navigate(`${Route.DETAIL}${name}`);\n }\n\n function labelText(title: string, name: string, version: string): string {\n if (title === 'bundleDependencies') {\n return t('dependencies.dependency-block-bundle', { package: name });\n } else {\n return t('dependencies.dependency-block', { package: name, version });\n }\n }\n\n return (\n <Box data-testid={title} sx={{ margin: 2 }}>\n <StyledText sx={{ marginBottom: 1 }} variant=\"subtitle1\">\n {`${title} (${deps.length})`}\n </StyledText>\n <Tags>\n {deps.map(([name, version]: [string, string]) => {\n // Bundle dependencies are stored as array, for example [ 0: \"semver\" ]\n // so the package name arrives here in the version field\n const packageName = title == 'bundleDependencies' ? version : name;\n return (\n <Tag\n className={'dep-tag'}\n clickable={true}\n data-testid={packageName}\n key={packageName}\n label={labelText(title, packageName, version)}\n onClick={() => {\n handleClick(packageName);\n }}\n />\n );\n })}\n </Tags>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,cAAA,GAAaA,gBAAAA,QAAAA,CAAOC,yBAAAA,OAAU,CAAC,EAAqB,WAAW;CAC1E,YAAY,MAAM,MAAM,WAAW;CACnC,eAAe;AACjB,EAAE;AAEF,IAAa,QAAA,GAAOD,gBAAAA,QAAAA,CAAO,KAAK,CAAC,EAAqB,WAAW;CAC/D,SAAS;CACT,gBAAgB;CAChB,UAAU;CAIV,YAAY,MAAM,MAAM,QAAQ,GAAI;AACtC,EAAE;AAEF,IAAa,OAAA,GAAMA,gBAAAA,QAAAA,CAAOE,mBAAAA,OAAI,CAAC,EAAqB,WAAW,EAC7D,QAAQ,MAAM,MAAM,QAAQ,EAAG,EACjC,EAAE;AAEF,IAAa,mBAAmD,EAAE,OAAO,mBAAmB;CAC1F,MAAM,YAAA,GAAWC,aAAAA,YAAAA,CAAY;CAC7B,MAAM,EAAE,OAAA,GAAMC,cAAAA,eAAAA,CAAe;CAC7B,MAAM,OAAO,OAAO,QAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"DependencyBlock.js","names":["styled","Typography","Chip","useNavigate","useTranslation","Route","Box"],"sources":["../../../src/components/Dependencies/DependencyBlock.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport type { Theme } from '../../Theme';\nimport type { PackageDependencies } from '../../types/packageMeta';\nimport { Route } from '../../utils';\n\ninterface DependencyBlockProps {\n title: string;\n dependencies: PackageDependencies;\n}\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nexport const Tags = styled('div')<{ theme?: Theme }>((props) => ({\n display: 'flex',\n justifyContent: 'start',\n flexWrap: 'wrap',\n // force title to be on the same line as the title\n // could be better to avoid margin on the first element\n // but it is a bit tricky to do with flexbox\n marginLeft: props.theme.spacing(-0.6),\n}));\n\nexport const Tag = styled(Chip)<{ theme?: Theme }>((props) => ({\n margin: props.theme.spacing(0.6),\n}));\n\nexport const DependencyBlock: React.FC<DependencyBlockProps> = ({ title, dependencies }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n const deps = Object.entries(dependencies);\n\n // sort dependencies alphabetically by name\n deps.sort(([nameA], [nameB]) => nameA.localeCompare(nameB));\n\n function handleClick(name: string): void {\n navigate(`${Route.DETAIL}${name}`);\n }\n\n function labelText(title: string, name: string, version: string): string {\n if (title === 'bundleDependencies') {\n return t('dependencies.dependency-block-bundle', { package: name });\n } else {\n return t('dependencies.dependency-block', { package: name, version });\n }\n }\n\n return (\n <Box data-testid={title} sx={{ margin: 2 }}>\n <StyledText sx={{ marginBottom: 1 }} variant=\"subtitle1\">\n {`${title} (${deps.length})`}\n </StyledText>\n <Tags>\n {deps.map(([name, version]: [string, string]) => {\n // Bundle dependencies are stored as array, for example [ 0: \"semver\" ]\n // so the package name arrives here in the version field\n const packageName = title == 'bundleDependencies' ? version : name;\n return (\n <Tag\n className={'dep-tag'}\n clickable={true}\n data-testid={packageName}\n key={packageName}\n label={labelText(title, packageName, version)}\n onClick={() => {\n handleClick(packageName);\n }}\n />\n );\n })}\n </Tags>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,cAAA,GAAaA,gBAAAA,QAAAA,CAAOC,yBAAAA,OAAU,CAAC,EAAqB,WAAW;CAC1E,YAAY,MAAM,MAAM,WAAW;CACnC,eAAe;AACjB,EAAE;AAEF,IAAa,QAAA,GAAOD,gBAAAA,QAAAA,CAAO,KAAK,CAAC,EAAqB,WAAW;CAC/D,SAAS;CACT,gBAAgB;CAChB,UAAU;CAIV,YAAY,MAAM,MAAM,QAAQ,GAAI;AACtC,EAAE;AAEF,IAAa,OAAA,GAAMA,gBAAAA,QAAAA,CAAOE,mBAAAA,OAAI,CAAC,EAAqB,WAAW,EAC7D,QAAQ,MAAM,MAAM,QAAQ,EAAG,EACjC,EAAE;AAEF,IAAa,mBAAmD,EAAE,OAAO,mBAAmB;CAC1F,MAAM,YAAA,GAAWC,aAAAA,YAAAA,CAAY;CAC7B,MAAM,EAAE,OAAA,GAAMC,cAAAA,eAAAA,CAAe;CAC7B,MAAM,OAAO,OAAO,QAAQ,YAAY;CAGxC,KAAK,MAAM,CAAC,QAAQ,CAAC,WAAW,MAAM,cAAc,KAAK,CAAC;CAE1D,SAAS,YAAY,MAAoB;EACvC,SAAS,GAAGC,eAAAA,MAAM,SAAS,MAAM;CACnC;CAEA,SAAS,UAAU,OAAe,MAAc,SAAyB;EACvE,IAAI,UAAU,sBACZ,OAAO,EAAE,wCAAwC,EAAE,SAAS,KAAK,CAAC;OAElE,OAAO,EAAE,iCAAiC;GAAE,SAAS;GAAM;EAAQ,CAAC;CAExE;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,kBAAAA,SAAD;EAAK,eAAa;EAAO,IAAI,EAAE,QAAQ,EAAE;EAAzC,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;GAAY,IAAI,EAAE,cAAc,EAAE;GAAG,SAAQ;GAC1C,UAAA,GAAG,MAAM,IAAI,KAAK,OAAO;EAChB,CAAA,GACZ,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAA,UACG,KAAK,KAAK,CAAC,MAAM,aAA+B;GAG/C,MAAM,cAAc,SAAS,uBAAuB,UAAU;GAC9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IACE,WAAW;IACX,WAAW;IACX,eAAa;IAEb,OAAO,UAAU,OAAO,aAAa,OAAO;IAC5C,eAAe;KACb,YAAY,WAAW;IACzB;GACD,GALM,WAKN;EAEL,CAAC,EACG,CAAA,CACH;;AAET"}
|
|
@@ -24,6 +24,7 @@ var DependencyBlock = ({ title, dependencies }) => {
|
|
|
24
24
|
const navigate = useNavigate();
|
|
25
25
|
const { t } = useTranslation();
|
|
26
26
|
const deps = Object.entries(dependencies);
|
|
27
|
+
deps.sort(([nameA], [nameB]) => nameA.localeCompare(nameB));
|
|
27
28
|
function handleClick(name) {
|
|
28
29
|
navigate(`${Route$1.DETAIL}${name}`);
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependencyBlock.mjs","names":["Route"],"sources":["../../../src/components/Dependencies/DependencyBlock.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport type { Theme } from '../../Theme';\nimport type { PackageDependencies } from '../../types/packageMeta';\nimport { Route } from '../../utils';\n\ninterface DependencyBlockProps {\n title: string;\n dependencies: PackageDependencies;\n}\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nexport const Tags = styled('div')<{ theme?: Theme }>((props) => ({\n display: 'flex',\n justifyContent: 'start',\n flexWrap: 'wrap',\n // force title to be on the same line as the title\n // could be better to avoid margin on the first element\n // but it is a bit tricky to do with flexbox\n marginLeft: props.theme.spacing(-0.6),\n}));\n\nexport const Tag = styled(Chip)<{ theme?: Theme }>((props) => ({\n margin: props.theme.spacing(0.6),\n}));\n\nexport const DependencyBlock: React.FC<DependencyBlockProps> = ({ title, dependencies }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n const deps = Object.entries(dependencies);\n\n function handleClick(name: string): void {\n navigate(`${Route.DETAIL}${name}`);\n }\n\n function labelText(title: string, name: string, version: string): string {\n if (title === 'bundleDependencies') {\n return t('dependencies.dependency-block-bundle', { package: name });\n } else {\n return t('dependencies.dependency-block', { package: name, version });\n }\n }\n\n return (\n <Box data-testid={title} sx={{ margin: 2 }}>\n <StyledText sx={{ marginBottom: 1 }} variant=\"subtitle1\">\n {`${title} (${deps.length})`}\n </StyledText>\n <Tags>\n {deps.map(([name, version]: [string, string]) => {\n // Bundle dependencies are stored as array, for example [ 0: \"semver\" ]\n // so the package name arrives here in the version field\n const packageName = title == 'bundleDependencies' ? version : name;\n return (\n <Tag\n className={'dep-tag'}\n clickable={true}\n data-testid={packageName}\n key={packageName}\n label={labelText(title, packageName, version)}\n onClick={() => {\n handleClick(packageName);\n }}\n />\n );\n })}\n </Tags>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;AAiBA,IAAa,aAAa,OAAO,UAAU,CAAC,EAAqB,WAAW;CAC1E,YAAY,MAAM,MAAM,WAAW;CACnC,eAAe;AACjB,EAAE;AAEF,IAAa,OAAO,OAAO,KAAK,CAAC,EAAqB,WAAW;CAC/D,SAAS;CACT,gBAAgB;CAChB,UAAU;CAIV,YAAY,MAAM,MAAM,QAAQ,GAAI;AACtC,EAAE;AAEF,IAAa,MAAM,OAAO,IAAI,CAAC,EAAqB,WAAW,EAC7D,QAAQ,MAAM,MAAM,QAAQ,EAAG,EACjC,EAAE;AAEF,IAAa,mBAAmD,EAAE,OAAO,mBAAmB;CAC1F,MAAM,WAAW,YAAY;CAC7B,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,OAAO,OAAO,QAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"DependencyBlock.mjs","names":["Route"],"sources":["../../../src/components/Dependencies/DependencyBlock.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport type { Theme } from '../../Theme';\nimport type { PackageDependencies } from '../../types/packageMeta';\nimport { Route } from '../../utils';\n\ninterface DependencyBlockProps {\n title: string;\n dependencies: PackageDependencies;\n}\n\nexport const StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nexport const Tags = styled('div')<{ theme?: Theme }>((props) => ({\n display: 'flex',\n justifyContent: 'start',\n flexWrap: 'wrap',\n // force title to be on the same line as the title\n // could be better to avoid margin on the first element\n // but it is a bit tricky to do with flexbox\n marginLeft: props.theme.spacing(-0.6),\n}));\n\nexport const Tag = styled(Chip)<{ theme?: Theme }>((props) => ({\n margin: props.theme.spacing(0.6),\n}));\n\nexport const DependencyBlock: React.FC<DependencyBlockProps> = ({ title, dependencies }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n const deps = Object.entries(dependencies);\n\n // sort dependencies alphabetically by name\n deps.sort(([nameA], [nameB]) => nameA.localeCompare(nameB));\n\n function handleClick(name: string): void {\n navigate(`${Route.DETAIL}${name}`);\n }\n\n function labelText(title: string, name: string, version: string): string {\n if (title === 'bundleDependencies') {\n return t('dependencies.dependency-block-bundle', { package: name });\n } else {\n return t('dependencies.dependency-block', { package: name, version });\n }\n }\n\n return (\n <Box data-testid={title} sx={{ margin: 2 }}>\n <StyledText sx={{ marginBottom: 1 }} variant=\"subtitle1\">\n {`${title} (${deps.length})`}\n </StyledText>\n <Tags>\n {deps.map(([name, version]: [string, string]) => {\n // Bundle dependencies are stored as array, for example [ 0: \"semver\" ]\n // so the package name arrives here in the version field\n const packageName = title == 'bundleDependencies' ? version : name;\n return (\n <Tag\n className={'dep-tag'}\n clickable={true}\n data-testid={packageName}\n key={packageName}\n label={labelText(title, packageName, version)}\n onClick={() => {\n handleClick(packageName);\n }}\n />\n );\n })}\n </Tags>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;AAiBA,IAAa,aAAa,OAAO,UAAU,CAAC,EAAqB,WAAW;CAC1E,YAAY,MAAM,MAAM,WAAW;CACnC,eAAe;AACjB,EAAE;AAEF,IAAa,OAAO,OAAO,KAAK,CAAC,EAAqB,WAAW;CAC/D,SAAS;CACT,gBAAgB;CAChB,UAAU;CAIV,YAAY,MAAM,MAAM,QAAQ,GAAI;AACtC,EAAE;AAEF,IAAa,MAAM,OAAO,IAAI,CAAC,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ccio/yarn-import npm-login";
|
|
45
47
|
/** The one-time command that makes a client use this registry, honouring `web.scope`. */
|
|
46
48
|
function getSetupCommand(tab, scope, registryUrl) {
|
|
47
49
|
switch (tab) {
|
|
@@ -98,8 +100,8 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
98
100
|
const registryUrl = configOptions.base;
|
|
99
101
|
const scope = configOptions.scope || void 0;
|
|
100
102
|
const setupTabs = SETUP_TABS.filter((tab) => tab === NPMRC || configOptions.pkgManagers?.includes(tab));
|
|
101
|
-
const hasBun = configOptions.pkgManagers?.includes("bun");
|
|
102
103
|
const [setupTab, setSetupTab] = (0, react.useState)(setupTabs[0]);
|
|
104
|
+
const isBun = setupTab === "bun";
|
|
103
105
|
const steps = [{
|
|
104
106
|
key: "configure",
|
|
105
107
|
title: t("help.steps.configure.title"),
|
|
@@ -136,34 +138,65 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
136
138
|
key: "login",
|
|
137
139
|
title: t("help.steps.login.title"),
|
|
138
140
|
description: t("help.steps.login.description"),
|
|
139
|
-
body: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
body: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
142
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
143
|
+
dataTestId: "help-login-command",
|
|
144
|
+
text: t("help.first-step-command-line", { registryUrl })
|
|
145
|
+
}),
|
|
146
|
+
isBun && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
|
|
147
|
+
color: "text.secondary",
|
|
148
|
+
sx: { mt: 1 },
|
|
149
|
+
variant: "body2",
|
|
150
|
+
children: t("help.steps.login.bun-note")
|
|
151
|
+
}),
|
|
152
|
+
setupTab === "yarn" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Box.default, {
|
|
153
|
+
"data-testid": "help-login-yarn-plugin",
|
|
154
|
+
sx: { mt: 2 },
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Typography.default, {
|
|
157
|
+
color: "text.secondary",
|
|
158
|
+
variant: "body2",
|
|
159
|
+
children: [
|
|
160
|
+
t("help.steps.login.yarn-note"),
|
|
161
|
+
" ",
|
|
162
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
163
|
+
href: YARN_PLUGIN_NPM_URL,
|
|
164
|
+
rel: "noopener noreferrer",
|
|
165
|
+
target: "_blank",
|
|
166
|
+
children: t("help.steps.login.yarn-plugin-link")
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
171
|
+
dataTestId: "help-login-yarn-plugin-install",
|
|
172
|
+
text: YARN_PLUGIN_INSTALL
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
175
|
+
dataTestId: "help-login-yarn-command",
|
|
176
|
+
text: require_cli_utils.getCLISetRegistry("yarn npm login", registryUrl)
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
] })
|
|
148
181
|
});
|
|
149
182
|
steps.push({
|
|
150
183
|
key: "publish",
|
|
151
184
|
title: t("help.steps.publish.title"),
|
|
152
185
|
description: t("help.steps.publish.description"),
|
|
153
|
-
body:
|
|
154
|
-
dataTestId: "help-publish-command",
|
|
155
|
-
text: t("help.second-step-command-line", { registryUrl })
|
|
156
|
-
}), hasBun && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
186
|
+
body: isBun ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
157
187
|
dataTestId: "help-publish-command-bun",
|
|
158
188
|
text: require_cli_utils.getCLISetRegistry("bun publish", registryUrl)
|
|
159
|
-
})
|
|
189
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
190
|
+
dataTestId: "help-publish-command",
|
|
191
|
+
text: t("help.second-step-command-line", { registryUrl })
|
|
192
|
+
})
|
|
160
193
|
});
|
|
161
194
|
if (withWaitStep) steps.push({
|
|
162
195
|
key: "wait",
|
|
163
196
|
title: t("help.steps.wait.title"),
|
|
164
197
|
description: t("help.steps.wait.description")
|
|
165
198
|
});
|
|
166
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
199
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_styles.StepList, {
|
|
167
200
|
"aria-labelledby": labelledBy,
|
|
168
201
|
"data-testid": "help-guide",
|
|
169
202
|
children: steps.map((step, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HelpStep, {
|
|
@@ -172,21 +205,7 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
172
205
|
title: step.title,
|
|
173
206
|
children: step.body
|
|
174
207
|
}, step.key))
|
|
175
|
-
})
|
|
176
|
-
"data-testid": "help-uplinks-note",
|
|
177
|
-
severity: "info",
|
|
178
|
-
sx: { mt: 3 },
|
|
179
|
-
children: [
|
|
180
|
-
t("help.uplinks-note"),
|
|
181
|
-
" ",
|
|
182
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
183
|
-
href: DOCS_UPLINKS_URL,
|
|
184
|
-
rel: "noopener noreferrer",
|
|
185
|
-
target: "_blank",
|
|
186
|
-
children: t("help.uplinks-link")
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
})] });
|
|
208
|
+
});
|
|
190
209
|
};
|
|
191
210
|
var Help = () => {
|
|
192
211
|
const { configOptions } = require_AppConfigurationProvider.useConfig();
|
|
@@ -211,47 +230,65 @@ var Help = () => {
|
|
|
211
230
|
xs: 2,
|
|
212
231
|
sm: 4
|
|
213
232
|
} },
|
|
214
|
-
children: [
|
|
215
|
-
|
|
216
|
-
display: "flex",
|
|
217
|
-
alignItems: {
|
|
218
|
-
xs: "flex-start",
|
|
219
|
-
sm: "center"
|
|
220
|
-
},
|
|
221
|
-
gap: 2,
|
|
222
|
-
mb: 3
|
|
223
|
-
},
|
|
224
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_icons_material_Inventory2Outlined.default, {
|
|
225
|
-
color: "primary",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Box.default, {
|
|
226
235
|
sx: {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
236
|
+
display: "flex",
|
|
237
|
+
alignItems: {
|
|
238
|
+
xs: "flex-start",
|
|
239
|
+
sm: "center"
|
|
230
240
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
id: "help-card__title",
|
|
241
|
+
gap: 2,
|
|
242
|
+
mb: 3
|
|
243
|
+
},
|
|
244
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_icons_material_Inventory2Outlined.default, {
|
|
245
|
+
color: "primary",
|
|
237
246
|
sx: {
|
|
238
247
|
fontSize: {
|
|
239
|
-
xs:
|
|
240
|
-
sm:
|
|
248
|
+
xs: 32,
|
|
249
|
+
sm: 48
|
|
241
250
|
},
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
flexShrink: 0
|
|
252
|
+
}
|
|
253
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Box.default, {
|
|
254
|
+
sx: { minWidth: 0 },
|
|
255
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Heading.default, {
|
|
256
|
+
id: "help-card__title",
|
|
257
|
+
sx: {
|
|
258
|
+
fontSize: {
|
|
259
|
+
xs: "1.25rem",
|
|
260
|
+
sm: "1.5rem"
|
|
261
|
+
},
|
|
262
|
+
lineHeight: 1.3
|
|
263
|
+
},
|
|
264
|
+
variant: "h5",
|
|
265
|
+
children: t("help.title")
|
|
266
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
|
|
267
|
+
color: "text.secondary",
|
|
268
|
+
children: t("help.welcome", { title: configOptions.title })
|
|
269
|
+
})]
|
|
249
270
|
})]
|
|
250
|
-
})
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HelpGuide, {
|
|
273
|
+
labelledBy: "help-card__title",
|
|
274
|
+
withWaitStep: true
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mui_material_Alert.default, {
|
|
277
|
+
"data-testid": "help-uplinks-note",
|
|
278
|
+
severity: "info",
|
|
279
|
+
sx: { mt: 3 },
|
|
280
|
+
children: [
|
|
281
|
+
t("help.uplinks-note"),
|
|
282
|
+
" ",
|
|
283
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
284
|
+
href: DOCS_UPLINKS_URL,
|
|
285
|
+
rel: "noopener noreferrer",
|
|
286
|
+
target: "_blank",
|
|
287
|
+
children: t("help.uplinks-link")
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
})
|
|
291
|
+
]
|
|
255
292
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_CardActions.default, {
|
|
256
293
|
sx: {
|
|
257
294
|
px: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Help.js","names":["getCLISetConfigRegistry","getCLISBerryYamlRegistry","getBunfigRegistry","getNpmrcRegistry","CommandBox","CopyClipboard","Step","StepNumber","Box","Typography","useConfig","CustomHelpContent","ReactMarkdown","externalLinkComponents","useTranslation","useState","_Fragment","Tabs","Tab","getCLISetRegistry","StepList","Alert","Link","Card","CardContent","Inventory2Outlined","Heading","CardActions","DocsLink"],"sources":["../../../src/components/Help/Help.tsx"],"sourcesContent":["import Inventory2Outlined from '@mui/icons-material/Inventory2Outlined';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport CardActions from '@mui/material/CardActions';\nimport CardContent from '@mui/material/CardContent';\nimport Link from '@mui/material/Link';\nimport Tab from '@mui/material/Tab';\nimport Tabs from '@mui/material/Tabs';\nimport Typography from '@mui/material/Typography';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport ReactMarkdown from 'react-markdown';\n\nimport { CopyClipboard, Heading, useConfig } from '../../';\nimport DocsLink from '../DocsLink';\nimport {\n getBunfigRegistry,\n getCLISBerryYamlRegistry,\n getCLISetConfigRegistry,\n getCLISetRegistry,\n getNpmrcRegistry,\n} from '../../utils/cli-utils';\nimport { externalLinkComponents } from '../../utils/markdown';\nimport {\n CardStyled as Card,\n CommandBox,\n CustomHelpContent,\n Step,\n StepList,\n StepNumber,\n} from './styles';\n\nconst NPMRC = '.npmrc';\nconst SETUP_TABS = ['npm', 'pnpm', 'yarn', 'bun', NPMRC] as const;\ntype SetupTab = (typeof SETUP_TABS)[number];\n\nconst DOCS_UPLINKS_URL = 'https://verdaccio.org/docs/uplinks';\n\n/** The one-time command that makes a client use this registry, honouring `web.scope`. */\nexport function getSetupCommand(tab: SetupTab, scope: string | undefined, registryUrl: string) {\n switch (tab) {\n case 'npm':\n return getCLISetConfigRegistry('npm config set', scope, registryUrl);\n case 'pnpm':\n return getCLISetConfigRegistry('pnpm config set', scope, registryUrl);\n case 'yarn':\n return getCLISBerryYamlRegistry(scope, registryUrl).trim();\n case 'bun':\n return getBunfigRegistry(scope, registryUrl);\n default:\n return getNpmrcRegistry(scope, registryUrl);\n }\n}\n\nconst Command: React.FC<{ dataTestId: string; text: string }> = ({ dataTestId, text }) => (\n <CommandBox>\n <CopyClipboard dataTestId={dataTestId} text={text}>\n <code>{text}</code>\n </CopyClipboard>\n </CommandBox>\n);\n\nconst HelpStep: React.FC<{\n index: number;\n title: string;\n description?: string;\n children?: React.ReactNode;\n}> = ({ index, title, description, children }) => (\n <Step>\n <StepNumber aria-hidden={true}>{index}</StepNumber>\n <Box sx={{ minWidth: 0, flex: 1 }}>\n <Typography component=\"h3\" sx={{ fontWeight: 600 }} variant=\"subtitle1\">\n {title}\n </Typography>\n {description && (\n <Typography color=\"text.secondary\" variant=\"body2\">\n {description}\n </Typography>\n )}\n {children}\n </Box>\n </Step>\n);\n\n/** The markdown that `web.help` sets, with `{{registryUrl}}` filled in. */\nexport const CustomHelp: React.FC<{ markdown: string }> = ({ markdown }) => {\n const { configOptions } = useConfig();\n return (\n <CustomHelpContent data-testid=\"help-custom\">\n <ReactMarkdown components={externalLinkComponents}>\n {markdown.replaceAll('{{registryUrl}}', configOptions.base)}\n </ReactMarkdown>\n </CustomHelpContent>\n );\n};\n\n/** The steps to point a client at the registry, log in and publish; shared by the welcome card and the settings. */\nexport const HelpGuide: React.FC<{ withWaitStep?: boolean; labelledBy?: string }> = ({\n withWaitStep = false,\n labelledBy,\n}) => {\n const { configOptions } = useConfig();\n const { t } = useTranslation();\n const registryUrl = configOptions.base;\n const scope = configOptions.scope || undefined;\n const setupTabs = SETUP_TABS.filter(\n (tab) => tab === NPMRC || configOptions.pkgManagers?.includes(tab)\n );\n const hasBun = configOptions.pkgManagers?.includes('bun');\n const [setupTab, setSetupTab] = useState<SetupTab>(setupTabs[0]);\n const steps: { key: string; title: string; description?: string; body?: React.ReactNode }[] = [\n {\n key: 'configure',\n title: t('help.steps.configure.title'),\n description: t('help.steps.configure.description'),\n body: (\n <>\n <Tabs\n allowScrollButtonsMobile={true}\n aria-label={t('help.steps.configure.title')}\n onChange={(_event, value: SetupTab) => setSetupTab(value)}\n sx={{ minHeight: 36, mt: 1 }}\n scrollButtons=\"auto\"\n value={setupTab}\n variant=\"scrollable\"\n >\n {setupTabs.map((tab) => (\n <Tab\n data-testid={`help-setup-${tab}`}\n key={tab}\n label={tab}\n sx={{ minHeight: 36, minWidth: 0, px: 1.5, py: 0, textTransform: 'none' }}\n value={tab}\n />\n ))}\n </Tabs>\n <Command\n dataTestId=\"help-setup-command\"\n text={getSetupCommand(setupTab, scope, registryUrl)}\n />\n </>\n ),\n },\n ];\n if (configOptions.login) {\n steps.push({\n key: 'login',\n title: t('help.steps.login.title'),\n description: t('help.steps.login.description'),\n body: (\n <>\n <Command\n dataTestId=\"help-login-command\"\n text={t('help.first-step-command-line', { registryUrl })}\n />\n {hasBun && (\n <Typography color=\"text.secondary\" sx={{ mt: 1 }} variant=\"body2\">\n {t('help.steps.login.bun-note')}\n </Typography>\n )}\n </>\n ),\n });\n }\n steps.push({\n key: 'publish',\n title: t('help.steps.publish.title'),\n description: t('help.steps.publish.description'),\n body: (\n <>\n <Command\n dataTestId=\"help-publish-command\"\n text={t('help.second-step-command-line', { registryUrl })}\n />\n {hasBun && (\n <Command\n dataTestId=\"help-publish-command-bun\"\n text={getCLISetRegistry('bun publish', registryUrl)}\n />\n )}\n </>\n ),\n });\n if (withWaitStep) {\n steps.push({\n key: 'wait',\n title: t('help.steps.wait.title'),\n description: t('help.steps.wait.description'),\n });\n }\n\n return (\n <>\n <StepList aria-labelledby={labelledBy} data-testid=\"help-guide\">\n {steps.map((step, index) => (\n <HelpStep\n description={step.description}\n index={index + 1}\n key={step.key}\n title={step.title}\n >\n {step.body}\n </HelpStep>\n ))}\n </StepList>\n {/* @ts-ignore - Alert does accept children despite the type error */}\n <Alert data-testid=\"help-uplinks-note\" severity=\"info\" sx={{ mt: 3 }}>\n {t('help.uplinks-note')}{' '}\n <Link href={DOCS_UPLINKS_URL} rel=\"noopener noreferrer\" target=\"_blank\">\n {t('help.uplinks-link')}\n </Link>\n </Alert>\n </>\n );\n};\n\nconst Help: React.FC = () => {\n const { configOptions } = useConfig();\n const { t } = useTranslation();\n const customHelp = configOptions.help?.trim();\n if (customHelp) {\n return (\n <Card data-testid=\"help-card\" id=\"help-card\">\n <CardContent sx={{ p: { xs: 2, sm: 4 } }}>\n <CustomHelp markdown={customHelp} />\n </CardContent>\n </Card>\n );\n }\n return (\n <Card data-testid=\"help-card\" id=\"help-card\">\n <CardContent sx={{ p: { xs: 2, sm: 4 } }}>\n <Box\n sx={{ display: 'flex', alignItems: { xs: 'flex-start', sm: 'center' }, gap: 2, mb: 3 }}\n >\n <Inventory2Outlined\n color=\"primary\"\n sx={{ fontSize: { xs: 32, sm: 48 }, flexShrink: 0 }}\n />\n <Box sx={{ minWidth: 0 }}>\n <Heading\n id=\"help-card__title\"\n sx={{ fontSize: { xs: '1.25rem', sm: '1.5rem' }, lineHeight: 1.3 }}\n variant=\"h5\"\n >\n {t('help.title')}\n </Heading>\n <Typography color=\"text.secondary\">\n {t('help.welcome', { title: configOptions.title })}\n </Typography>\n </Box>\n </Box>\n <HelpGuide labelledBy=\"help-card__title\" withWaitStep={true} />\n </CardContent>\n <CardActions sx={{ px: { xs: 2, sm: 4 }, pb: 3 }}>\n <DocsLink dataTestId=\"help-docs-link\" />\n </CardActions>\n </Card>\n );\n};\n\nexport default Help;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,QAAQ;AACd,IAAM,aAAa;CAAC;CAAO;CAAQ;CAAQ;CAAO;AAAK;AAGvD,IAAM,mBAAmB;;AAGzB,SAAgB,gBAAgB,KAAe,OAA2B,aAAqB;CAC7F,QAAQ,KAAR;EACE,KAAK,OACH,OAAOA,kBAAAA,wBAAwB,kBAAkB,OAAO,WAAW;EACrE,KAAK,QACH,OAAOA,kBAAAA,wBAAwB,mBAAmB,OAAO,WAAW;EACtE,KAAK,QACH,OAAOC,kBAAAA,yBAAyB,OAAO,WAAW,CAAC,CAAC,KAAK;EAC3D,KAAK,OACH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AI;MAAG;MAAG,YAAY;KAAE;IACnD,CAAA,GACD,iBAAA,GAAA,kBAAA,KAAA,CAACjB,kBAAAA,SAAD;KAAK,IAAI,EAAE,UAAU,EAAE;KAAvB,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACkB,gBAAAA,SAAD;MACE,IAAG;MACH,IAAI;OAAE,UAAU;QAAE,IAAI;QAAW,IAAI;OAAS;OAAG,YAAY;MAAI;MACjE,SAAQ;MAEP,UAAA,EAAE,YAAY;KACR,CAAA,GACT,iBAAA,GAAA,kBAAA,IAAA,CAACjB,yBAAAA,SAAD;MAAY,OAAM;MACf,UAAA,EAAE,gBAAgB,EAAE,OAAO,cAAc,MAAM,CAAC;KACvC,CAAA,CACT;IACF,CAAA,CAAA;GACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;IAAW,YAAW;IAAmB,cAAc;GAAO,CAAA,CACnD;EACb,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAACkB,0BAAAA,SAAD;GAAa,IAAI;IAAE,IAAI;KAAE,IAAI;KAAG,IAAI;IAAE;IAAG,IAAI;GAAE;GAC7C,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,SAAD,EAAU,YAAW,iBAAkB,CAAA;EAC5B,CAAA,CACT;;AAEV"}
|
|
1
|
+
{"version":3,"file":"Help.js","names":["getCLISetConfigRegistry","getCLISBerryYamlRegistry","getBunfigRegistry","getNpmrcRegistry","CommandBox","CopyClipboard","Step","StepNumber","Box","Typography","useConfig","CustomHelpContent","ReactMarkdown","externalLinkComponents","useTranslation","useState","_Fragment","Tabs","Tab","Link","getCLISetRegistry","StepList","Card","CardContent","Inventory2Outlined","Heading","Alert","CardActions","DocsLink"],"sources":["../../../src/components/Help/Help.tsx"],"sourcesContent":["import Inventory2Outlined from '@mui/icons-material/Inventory2Outlined';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport CardActions from '@mui/material/CardActions';\nimport CardContent from '@mui/material/CardContent';\nimport Link from '@mui/material/Link';\nimport Tab from '@mui/material/Tab';\nimport Tabs from '@mui/material/Tabs';\nimport Typography from '@mui/material/Typography';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport ReactMarkdown from 'react-markdown';\n\nimport { CopyClipboard, Heading, useConfig } from '../../';\nimport DocsLink from '../DocsLink';\nimport {\n getBunfigRegistry,\n getCLISBerryYamlRegistry,\n getCLISetConfigRegistry,\n getCLISetRegistry,\n getNpmrcRegistry,\n} from '../../utils/cli-utils';\nimport { externalLinkComponents } from '../../utils/markdown';\nimport {\n CardStyled as Card,\n CommandBox,\n CustomHelpContent,\n Step,\n StepList,\n StepNumber,\n} from './styles';\n\nconst NPMRC = '.npmrc';\nconst SETUP_TABS = ['npm', 'pnpm', 'yarn', 'bun', NPMRC] as const;\ntype SetupTab = (typeof SETUP_TABS)[number];\n\nconst DOCS_UPLINKS_URL = 'https://verdaccio.org/docs/uplinks';\nconst YARN_PLUGIN_NPM_URL = 'https://github.com/verdaccio/yarn-plugin-npm';\nconst YARN_PLUGIN_INSTALL = 'yarn dlx @verdaccio/yarn-import npm-login';\n\n/** The one-time command that makes a client use this registry, honouring `web.scope`. */\nexport function getSetupCommand(tab: SetupTab, scope: string | undefined, registryUrl: string) {\n switch (tab) {\n case 'npm':\n return getCLISetConfigRegistry('npm config set', scope, registryUrl);\n case 'pnpm':\n return getCLISetConfigRegistry('pnpm config set', scope, registryUrl);\n case 'yarn':\n return getCLISBerryYamlRegistry(scope, registryUrl).trim();\n case 'bun':\n return getBunfigRegistry(scope, registryUrl);\n default:\n return getNpmrcRegistry(scope, registryUrl);\n }\n}\n\nconst Command: React.FC<{ dataTestId: string; text: string }> = ({ dataTestId, text }) => (\n <CommandBox>\n <CopyClipboard dataTestId={dataTestId} text={text}>\n <code>{text}</code>\n </CopyClipboard>\n </CommandBox>\n);\n\nconst HelpStep: React.FC<{\n index: number;\n title: string;\n description?: string;\n children?: React.ReactNode;\n}> = ({ index, title, description, children }) => (\n <Step>\n <StepNumber aria-hidden={true}>{index}</StepNumber>\n <Box sx={{ minWidth: 0, flex: 1 }}>\n <Typography component=\"h3\" sx={{ fontWeight: 600 }} variant=\"subtitle1\">\n {title}\n </Typography>\n {description && (\n <Typography color=\"text.secondary\" variant=\"body2\">\n {description}\n </Typography>\n )}\n {children}\n </Box>\n </Step>\n);\n\n/** The markdown that `web.help` sets, with `{{registryUrl}}` filled in. */\nexport const CustomHelp: React.FC<{ markdown: string }> = ({ markdown }) => {\n const { configOptions } = useConfig();\n return (\n <CustomHelpContent data-testid=\"help-custom\">\n <ReactMarkdown components={externalLinkComponents}>\n {markdown.replaceAll('{{registryUrl}}', configOptions.base)}\n </ReactMarkdown>\n </CustomHelpContent>\n );\n};\n\n/** The steps to point a client at the registry, log in and publish; shared by the welcome card and the settings. */\nexport const HelpGuide: React.FC<{ withWaitStep?: boolean; labelledBy?: string }> = ({\n withWaitStep = false,\n labelledBy,\n}) => {\n const { configOptions } = useConfig();\n const { t } = useTranslation();\n const registryUrl = configOptions.base;\n const scope = configOptions.scope || undefined;\n const setupTabs = SETUP_TABS.filter(\n (tab) => tab === NPMRC || configOptions.pkgManagers?.includes(tab)\n );\n const [setupTab, setSetupTab] = useState<SetupTab>(setupTabs[0]);\n const isBun = setupTab === 'bun';\n const steps: { key: string; title: string; description?: string; body?: React.ReactNode }[] = [\n {\n key: 'configure',\n title: t('help.steps.configure.title'),\n description: t('help.steps.configure.description'),\n body: (\n <>\n <Tabs\n allowScrollButtonsMobile={true}\n aria-label={t('help.steps.configure.title')}\n onChange={(_event, value: SetupTab) => setSetupTab(value)}\n sx={{ minHeight: 36, mt: 1 }}\n scrollButtons=\"auto\"\n value={setupTab}\n variant=\"scrollable\"\n >\n {setupTabs.map((tab) => (\n <Tab\n data-testid={`help-setup-${tab}`}\n key={tab}\n label={tab}\n sx={{ minHeight: 36, minWidth: 0, px: 1.5, py: 0, textTransform: 'none' }}\n value={tab}\n />\n ))}\n </Tabs>\n <Command\n dataTestId=\"help-setup-command\"\n text={getSetupCommand(setupTab, scope, registryUrl)}\n />\n </>\n ),\n },\n ];\n if (configOptions.login) {\n steps.push({\n key: 'login',\n title: t('help.steps.login.title'),\n description: t('help.steps.login.description'),\n body: (\n <>\n <Command\n dataTestId=\"help-login-command\"\n text={t('help.first-step-command-line', { registryUrl })}\n />\n {isBun && (\n <Typography color=\"text.secondary\" sx={{ mt: 1 }} variant=\"body2\">\n {t('help.steps.login.bun-note')}\n </Typography>\n )}\n {setupTab === 'yarn' && (\n <Box data-testid=\"help-login-yarn-plugin\" sx={{ mt: 2 }}>\n <Typography color=\"text.secondary\" variant=\"body2\">\n {t('help.steps.login.yarn-note')}{' '}\n <Link href={YARN_PLUGIN_NPM_URL} rel=\"noopener noreferrer\" target=\"_blank\">\n {t('help.steps.login.yarn-plugin-link')}\n </Link>\n </Typography>\n <Command dataTestId=\"help-login-yarn-plugin-install\" text={YARN_PLUGIN_INSTALL} />\n <Command\n dataTestId=\"help-login-yarn-command\"\n text={getCLISetRegistry('yarn npm login', registryUrl)}\n />\n </Box>\n )}\n </>\n ),\n });\n }\n steps.push({\n key: 'publish',\n title: t('help.steps.publish.title'),\n description: t('help.steps.publish.description'),\n body: isBun ? (\n <Command\n dataTestId=\"help-publish-command-bun\"\n text={getCLISetRegistry('bun publish', registryUrl)}\n />\n ) : (\n <Command\n dataTestId=\"help-publish-command\"\n text={t('help.second-step-command-line', { registryUrl })}\n />\n ),\n });\n if (withWaitStep) {\n steps.push({\n key: 'wait',\n title: t('help.steps.wait.title'),\n description: t('help.steps.wait.description'),\n });\n }\n\n return (\n <StepList aria-labelledby={labelledBy} data-testid=\"help-guide\">\n {steps.map((step, index) => (\n <HelpStep\n description={step.description}\n index={index + 1}\n key={step.key}\n title={step.title}\n >\n {step.body}\n </HelpStep>\n ))}\n </StepList>\n );\n};\n\nconst Help: React.FC = () => {\n const { configOptions } = useConfig();\n const { t } = useTranslation();\n const customHelp = configOptions.help?.trim();\n if (customHelp) {\n return (\n <Card data-testid=\"help-card\" id=\"help-card\">\n <CardContent sx={{ p: { xs: 2, sm: 4 } }}>\n <CustomHelp markdown={customHelp} />\n </CardContent>\n </Card>\n );\n }\n return (\n <Card data-testid=\"help-card\" id=\"help-card\">\n <CardContent sx={{ p: { xs: 2, sm: 4 } }}>\n <Box\n sx={{ display: 'flex', alignItems: { xs: 'flex-start', sm: 'center' }, gap: 2, mb: 3 }}\n >\n <Inventory2Outlined\n color=\"primary\"\n sx={{ fontSize: { xs: 32, sm: 48 }, flexShrink: 0 }}\n />\n <Box sx={{ minWidth: 0 }}>\n <Heading\n id=\"help-card__title\"\n sx={{ fontSize: { xs: '1.25rem', sm: '1.5rem' }, lineHeight: 1.3 }}\n variant=\"h5\"\n >\n {t('help.title')}\n </Heading>\n <Typography color=\"text.secondary\">\n {t('help.welcome', { title: configOptions.title })}\n </Typography>\n </Box>\n </Box>\n <HelpGuide labelledBy=\"help-card__title\" withWaitStep={true} />\n {/* @ts-ignore - Alert does accept children despite the type error */}\n <Alert data-testid=\"help-uplinks-note\" severity=\"info\" sx={{ mt: 3 }}>\n {t('help.uplinks-note')}{' '}\n <Link href={DOCS_UPLINKS_URL} rel=\"noopener noreferrer\" target=\"_blank\">\n {t('help.uplinks-link')}\n </Link>\n </Alert>\n </CardContent>\n <CardActions sx={{ px: { xs: 2, sm: 4 }, pb: 3 }}>\n <DocsLink dataTestId=\"help-docs-link\" />\n </CardActions>\n </Card>\n );\n};\n\nexport default Help;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,QAAQ;AACd,IAAM,aAAa;CAAC;CAAO;CAAQ;CAAQ;CAAO;AAAK;AAGvD,IAAM,mBAAmB;AACzB,IAAM,sBAAsB;AAC5B,IAAM,sBAAsB;;AAG5B,SAAgB,gBAAgB,KAAe,OAA2B,aAAqB;CAC7F,QAAQ,KAAR;EACE,KAAK,OACH,OAAOA,kBAAAA,wBAAw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IAAE;IAAG,IAAI;GAAE;GAC7C,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,SAAD,EAAU,YAAW,iBAAkB,CAAA;EAC5B,CAAA,CACT;;AAEV"}
|
|
@@ -30,6 +30,8 @@ var SETUP_TABS = [
|
|
|
30
30
|
NPMRC
|
|
31
31
|
];
|
|
32
32
|
var DOCS_UPLINKS_URL = "https://verdaccio.org/docs/uplinks";
|
|
33
|
+
var YARN_PLUGIN_NPM_URL = "https://github.com/verdaccio/yarn-plugin-npm";
|
|
34
|
+
var YARN_PLUGIN_INSTALL = "yarn dlx @verdaccio/yarn-import npm-login";
|
|
33
35
|
/** The one-time command that makes a client use this registry, honouring `web.scope`. */
|
|
34
36
|
function getSetupCommand(tab, scope, registryUrl) {
|
|
35
37
|
switch (tab) {
|
|
@@ -86,8 +88,8 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
86
88
|
const registryUrl = configOptions.base;
|
|
87
89
|
const scope = configOptions.scope || void 0;
|
|
88
90
|
const setupTabs = SETUP_TABS.filter((tab) => tab === NPMRC || configOptions.pkgManagers?.includes(tab));
|
|
89
|
-
const hasBun = configOptions.pkgManagers?.includes("bun");
|
|
90
91
|
const [setupTab, setSetupTab] = useState(setupTabs[0]);
|
|
92
|
+
const isBun = setupTab === "bun";
|
|
91
93
|
const steps = [{
|
|
92
94
|
key: "configure",
|
|
93
95
|
title: t("help.steps.configure.title"),
|
|
@@ -124,34 +126,65 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
124
126
|
key: "login",
|
|
125
127
|
title: t("help.steps.login.title"),
|
|
126
128
|
description: t("help.steps.login.description"),
|
|
127
|
-
body: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
body: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
130
|
+
/* @__PURE__ */ jsx(Command, {
|
|
131
|
+
dataTestId: "help-login-command",
|
|
132
|
+
text: t("help.first-step-command-line", { registryUrl })
|
|
133
|
+
}),
|
|
134
|
+
isBun && /* @__PURE__ */ jsx(Typography, {
|
|
135
|
+
color: "text.secondary",
|
|
136
|
+
sx: { mt: 1 },
|
|
137
|
+
variant: "body2",
|
|
138
|
+
children: t("help.steps.login.bun-note")
|
|
139
|
+
}),
|
|
140
|
+
setupTab === "yarn" && /* @__PURE__ */ jsxs(Box, {
|
|
141
|
+
"data-testid": "help-login-yarn-plugin",
|
|
142
|
+
sx: { mt: 2 },
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsxs(Typography, {
|
|
145
|
+
color: "text.secondary",
|
|
146
|
+
variant: "body2",
|
|
147
|
+
children: [
|
|
148
|
+
t("help.steps.login.yarn-note"),
|
|
149
|
+
" ",
|
|
150
|
+
/* @__PURE__ */ jsx(Link, {
|
|
151
|
+
href: YARN_PLUGIN_NPM_URL,
|
|
152
|
+
rel: "noopener noreferrer",
|
|
153
|
+
target: "_blank",
|
|
154
|
+
children: t("help.steps.login.yarn-plugin-link")
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ jsx(Command, {
|
|
159
|
+
dataTestId: "help-login-yarn-plugin-install",
|
|
160
|
+
text: YARN_PLUGIN_INSTALL
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsx(Command, {
|
|
163
|
+
dataTestId: "help-login-yarn-command",
|
|
164
|
+
text: getCLISetRegistry("yarn npm login", registryUrl)
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
] })
|
|
136
169
|
});
|
|
137
170
|
steps.push({
|
|
138
171
|
key: "publish",
|
|
139
172
|
title: t("help.steps.publish.title"),
|
|
140
173
|
description: t("help.steps.publish.description"),
|
|
141
|
-
body:
|
|
142
|
-
dataTestId: "help-publish-command",
|
|
143
|
-
text: t("help.second-step-command-line", { registryUrl })
|
|
144
|
-
}), hasBun && /* @__PURE__ */ jsx(Command, {
|
|
174
|
+
body: isBun ? /* @__PURE__ */ jsx(Command, {
|
|
145
175
|
dataTestId: "help-publish-command-bun",
|
|
146
176
|
text: getCLISetRegistry("bun publish", registryUrl)
|
|
147
|
-
})
|
|
177
|
+
}) : /* @__PURE__ */ jsx(Command, {
|
|
178
|
+
dataTestId: "help-publish-command",
|
|
179
|
+
text: t("help.second-step-command-line", { registryUrl })
|
|
180
|
+
})
|
|
148
181
|
});
|
|
149
182
|
if (withWaitStep) steps.push({
|
|
150
183
|
key: "wait",
|
|
151
184
|
title: t("help.steps.wait.title"),
|
|
152
185
|
description: t("help.steps.wait.description")
|
|
153
186
|
});
|
|
154
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ jsx(StepList, {
|
|
155
188
|
"aria-labelledby": labelledBy,
|
|
156
189
|
"data-testid": "help-guide",
|
|
157
190
|
children: steps.map((step, index) => /* @__PURE__ */ jsx(HelpStep, {
|
|
@@ -160,21 +193,7 @@ var HelpGuide = ({ withWaitStep = false, labelledBy }) => {
|
|
|
160
193
|
title: step.title,
|
|
161
194
|
children: step.body
|
|
162
195
|
}, step.key))
|
|
163
|
-
})
|
|
164
|
-
"data-testid": "help-uplinks-note",
|
|
165
|
-
severity: "info",
|
|
166
|
-
sx: { mt: 3 },
|
|
167
|
-
children: [
|
|
168
|
-
t("help.uplinks-note"),
|
|
169
|
-
" ",
|
|
170
|
-
/* @__PURE__ */ jsx(Link, {
|
|
171
|
-
href: DOCS_UPLINKS_URL,
|
|
172
|
-
rel: "noopener noreferrer",
|
|
173
|
-
target: "_blank",
|
|
174
|
-
children: t("help.uplinks-link")
|
|
175
|
-
})
|
|
176
|
-
]
|
|
177
|
-
})] });
|
|
196
|
+
});
|
|
178
197
|
};
|
|
179
198
|
var Help = () => {
|
|
180
199
|
const { configOptions } = useConfig();
|
|
@@ -199,47 +218,65 @@ var Help = () => {
|
|
|
199
218
|
xs: 2,
|
|
200
219
|
sm: 4
|
|
201
220
|
} },
|
|
202
|
-
children: [
|
|
203
|
-
|
|
204
|
-
display: "flex",
|
|
205
|
-
alignItems: {
|
|
206
|
-
xs: "flex-start",
|
|
207
|
-
sm: "center"
|
|
208
|
-
},
|
|
209
|
-
gap: 2,
|
|
210
|
-
mb: 3
|
|
211
|
-
},
|
|
212
|
-
children: [/* @__PURE__ */ jsx(Inventory2Outlined, {
|
|
213
|
-
color: "primary",
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
214
223
|
sx: {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
display: "flex",
|
|
225
|
+
alignItems: {
|
|
226
|
+
xs: "flex-start",
|
|
227
|
+
sm: "center"
|
|
218
228
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
id: "help-card__title",
|
|
229
|
+
gap: 2,
|
|
230
|
+
mb: 3
|
|
231
|
+
},
|
|
232
|
+
children: [/* @__PURE__ */ jsx(Inventory2Outlined, {
|
|
233
|
+
color: "primary",
|
|
225
234
|
sx: {
|
|
226
235
|
fontSize: {
|
|
227
|
-
xs:
|
|
228
|
-
sm:
|
|
236
|
+
xs: 32,
|
|
237
|
+
sm: 48
|
|
229
238
|
},
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
239
|
+
flexShrink: 0
|
|
240
|
+
}
|
|
241
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
242
|
+
sx: { minWidth: 0 },
|
|
243
|
+
children: [/* @__PURE__ */ jsx(Heading, {
|
|
244
|
+
id: "help-card__title",
|
|
245
|
+
sx: {
|
|
246
|
+
fontSize: {
|
|
247
|
+
xs: "1.25rem",
|
|
248
|
+
sm: "1.5rem"
|
|
249
|
+
},
|
|
250
|
+
lineHeight: 1.3
|
|
251
|
+
},
|
|
252
|
+
variant: "h5",
|
|
253
|
+
children: t("help.title")
|
|
254
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
255
|
+
color: "text.secondary",
|
|
256
|
+
children: t("help.welcome", { title: configOptions.title })
|
|
257
|
+
})]
|
|
237
258
|
})]
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ jsx(HelpGuide, {
|
|
261
|
+
labelledBy: "help-card__title",
|
|
262
|
+
withWaitStep: true
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ jsxs(Alert, {
|
|
265
|
+
"data-testid": "help-uplinks-note",
|
|
266
|
+
severity: "info",
|
|
267
|
+
sx: { mt: 3 },
|
|
268
|
+
children: [
|
|
269
|
+
t("help.uplinks-note"),
|
|
270
|
+
" ",
|
|
271
|
+
/* @__PURE__ */ jsx(Link, {
|
|
272
|
+
href: DOCS_UPLINKS_URL,
|
|
273
|
+
rel: "noopener noreferrer",
|
|
274
|
+
target: "_blank",
|
|
275
|
+
children: t("help.uplinks-link")
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
})
|
|
279
|
+
]
|
|
243
280
|
}), /* @__PURE__ */ jsx(CardActions, {
|
|
244
281
|
sx: {
|
|
245
282
|
px: {
|