@verdaccio/ui-components 5.0.0-next-9.23 → 5.0.0-next-9.25
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/README.md +20 -0
- package/build/api/use-data.d.ts +2 -2
- package/build/api/use-data.js +2 -2
- package/build/api/use-data.js.map +1 -1
- package/build/api/use-data.mjs +2 -2
- package/build/api/use-data.mjs.map +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.d.ts +1 -0
- package/build/components/CopyClipboard/CopyToClipBoard.js +36 -17
- package/build/components/CopyClipboard/CopyToClipBoard.js.map +1 -1
- package/build/components/CopyClipboard/CopyToClipBoard.mjs +36 -19
- package/build/components/CopyClipboard/CopyToClipBoard.mjs.map +1 -1
- package/build/components/CopyClipboard/utils.d.ts +2 -1
- package/build/components/CopyClipboard/utils.js +6 -4
- package/build/components/CopyClipboard/utils.js.map +1 -1
- package/build/components/CopyClipboard/utils.mjs +6 -4
- package/build/components/CopyClipboard/utils.mjs.map +1 -1
- package/build/components/DocsLink/DocsLink.d.ts +8 -0
- package/build/components/DocsLink/DocsLink.js +40 -0
- package/build/components/DocsLink/DocsLink.js.map +1 -0
- package/build/components/DocsLink/DocsLink.mjs +35 -0
- package/build/components/DocsLink/DocsLink.mjs.map +1 -0
- package/build/components/DocsLink/index.d.ts +1 -0
- package/build/components/DocsLink/index.js +3 -0
- package/build/components/DocsLink/index.mjs +1 -0
- package/build/components/Help/Help.d.ts +13 -0
- package/build/components/Help/Help.js +243 -36
- package/build/components/Help/Help.js.map +1 -1
- package/build/components/Help/Help.mjs +237 -39
- package/build/components/Help/Help.mjs.map +1 -1
- package/build/components/Help/styles.d.ts +29 -0
- package/build/components/Help/styles.js +86 -1
- package/build/components/Help/styles.js.map +1 -1
- package/build/components/Help/styles.mjs +82 -2
- package/build/components/Help/styles.mjs.map +1 -1
- package/build/components/Icons/Managers/Bun.d.ts +2 -0
- package/build/components/Icons/Managers/Bun2.js +18 -0
- package/build/components/Icons/Managers/Bun2.js.map +1 -0
- package/build/components/Icons/Managers/Bun2.mjs +16 -0
- package/build/components/Icons/Managers/Bun2.mjs.map +1 -0
- package/build/components/Icons/Managers/bun.js +6 -0
- package/build/components/Icons/Managers/bun.js.map +1 -0
- package/build/components/Icons/Managers/bun.mjs +6 -0
- package/build/components/Icons/Managers/bun.mjs.map +1 -0
- package/build/components/Icons/Managers/bun.svg +1 -0
- package/build/components/Icons/Managers/index.d.ts +1 -0
- package/build/components/Icons/Managers/index.js +2 -0
- package/build/components/Icons/Managers/index.mjs +2 -1
- package/build/components/Icons/index.js +3 -0
- package/build/components/Icons/index.mjs +3 -1
- package/build/components/Install/Install.d.ts +2 -0
- package/build/components/Install/Install.js +30 -2
- package/build/components/Install/Install.js.map +1 -1
- package/build/components/Install/Install.mjs +30 -3
- package/build/components/Install/Install.mjs.map +1 -1
- package/build/components/Install/InstallListItem.d.ts +2 -1
- package/build/components/Install/InstallListItem.js +17 -0
- package/build/components/Install/InstallListItem.js.map +1 -1
- package/build/components/Install/InstallListItem.mjs +17 -0
- package/build/components/Install/InstallListItem.mjs.map +1 -1
- package/build/components/Loading/PackageListSkeleton.d.ts +3 -0
- package/build/components/Loading/PackageListSkeleton.js +70 -0
- package/build/components/Loading/PackageListSkeleton.js.map +1 -0
- package/build/components/Loading/PackageListSkeleton.mjs +65 -0
- package/build/components/Loading/PackageListSkeleton.mjs.map +1 -0
- package/build/components/Loading/VersionSkeleton.d.ts +3 -0
- package/build/components/Loading/VersionSkeleton.js +119 -0
- package/build/components/Loading/VersionSkeleton.js.map +1 -0
- package/build/components/Loading/VersionSkeleton.mjs +111 -0
- package/build/components/Loading/VersionSkeleton.mjs.map +1 -0
- package/build/components/Loading/index.d.ts +2 -0
- package/build/components/Loading/index.js +4 -0
- package/build/components/Loading/index.mjs +4 -1
- package/build/components/Package/Package.js +5 -1
- package/build/components/Package/Package.js.map +1 -1
- package/build/components/Package/Package.mjs +6 -2
- package/build/components/Package/Package.mjs.map +1 -1
- package/build/components/Package/styles.d.ts +3 -0
- package/build/components/Package/styles.js +8 -0
- package/build/components/Package/styles.js.map +1 -1
- package/build/components/Package/styles.mjs +8 -1
- package/build/components/Package/styles.mjs.map +1 -1
- package/build/components/PackageList/PackageList.js +4 -4
- package/build/components/PackageList/PackageList.js.map +1 -1
- package/build/components/PackageList/PackageList.mjs +5 -5
- package/build/components/PackageList/PackageList.mjs.map +1 -1
- package/build/components/PackageList/PackageListToolbar.d.ts +15 -0
- package/build/components/PackageList/PackageListToolbar.js +127 -0
- package/build/components/PackageList/PackageListToolbar.js.map +1 -0
- package/build/components/PackageList/PackageListToolbar.mjs +119 -0
- package/build/components/PackageList/PackageListToolbar.mjs.map +1 -0
- package/build/components/PackageList/filterPackages.d.ts +16 -0
- package/build/components/PackageList/filterPackages.js +37 -0
- package/build/components/PackageList/filterPackages.js.map +1 -0
- package/build/components/PackageList/filterPackages.mjs +34 -0
- package/build/components/PackageList/filterPackages.mjs.map +1 -0
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +18 -7
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js.map +1 -1
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.mjs +18 -7
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.mjs.map +1 -1
- package/build/components/RegistryInfoDialog/types.d.ts +1 -0
- package/build/components/Search/AutoComplete/AutoComplete.d.ts +3 -0
- package/build/components/Search/AutoComplete/AutoComplete.js +3 -1
- package/build/components/Search/AutoComplete/AutoComplete.js.map +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.mjs +3 -1
- package/build/components/Search/AutoComplete/AutoComplete.mjs.map +1 -1
- package/build/components/Search/Search.js +28 -1
- package/build/components/Search/Search.js.map +1 -1
- package/build/components/Search/Search.mjs +31 -5
- package/build/components/Search/Search.mjs.map +1 -1
- package/build/components/Search/SearchItem.d.ts +12 -1
- package/build/components/Search/SearchItem.js +53 -70
- package/build/components/Search/SearchItem.js.map +1 -1
- package/build/components/Search/SearchItem.mjs +51 -67
- package/build/components/Search/SearchItem.mjs.map +1 -1
- package/build/components/Search/utils.d.ts +10 -0
- package/build/components/Search/utils.js +28 -1
- package/build/components/Search/utils.js.map +1 -1
- package/build/components/Search/utils.mjs +26 -2
- package/build/components/Search/utils.mjs.map +1 -1
- package/build/components/SettingsMenu/SettingsMenu.js +2 -2
- package/build/components/SettingsMenu/SettingsMenu.mjs +1 -1
- package/build/components/Versions/Versions.js +8 -2
- package/build/components/Versions/Versions.js.map +1 -1
- package/build/components/Versions/Versions.mjs +8 -2
- package/build/components/Versions/Versions.mjs.map +1 -1
- package/build/components/VisuallyHidden/index.d.ts +5 -0
- package/build/components/VisuallyHidden/index.js +17 -0
- package/build/components/VisuallyHidden/index.js.map +1 -0
- package/build/components/VisuallyHidden/index.mjs +15 -0
- package/build/components/VisuallyHidden/index.mjs.map +1 -0
- package/build/configuration.js +2 -1
- package/build/configuration.js.map +1 -1
- package/build/configuration.mjs +2 -1
- package/build/configuration.mjs.map +1 -1
- package/build/i18n/ABOUT_TRANSLATIONS.md +19 -0
- package/build/i18n/crowdin/ui.js +378 -0
- package/build/i18n/crowdin/ui.js.map +1 -0
- package/build/i18n/crowdin/ui.json +345 -0
- package/build/i18n/crowdin/ui.mjs +355 -0
- package/build/i18n/crowdin/ui.mjs.map +1 -0
- package/build/i18n/download_translations/cs-CZ/ui.js +376 -0
- package/build/i18n/download_translations/cs-CZ/ui.js.map +1 -0
- package/build/i18n/download_translations/cs-CZ/ui.json +345 -0
- package/build/i18n/download_translations/cs-CZ/ui.mjs +354 -0
- package/build/i18n/download_translations/cs-CZ/ui.mjs.map +1 -0
- package/build/i18n/download_translations/de-DE/ui.js +376 -0
- package/build/i18n/download_translations/de-DE/ui.js.map +1 -0
- package/build/i18n/download_translations/de-DE/ui.json +345 -0
- package/build/i18n/download_translations/de-DE/ui.mjs +354 -0
- package/build/i18n/download_translations/de-DE/ui.mjs.map +1 -0
- package/build/i18n/download_translations/es-ES/ui.js +376 -0
- package/build/i18n/download_translations/es-ES/ui.js.map +1 -0
- package/build/i18n/download_translations/es-ES/ui.json +345 -0
- package/build/i18n/download_translations/es-ES/ui.mjs +354 -0
- package/build/i18n/download_translations/es-ES/ui.mjs.map +1 -0
- package/build/i18n/download_translations/fr-FR/ui.js +376 -0
- package/build/i18n/download_translations/fr-FR/ui.js.map +1 -0
- package/build/i18n/download_translations/fr-FR/ui.json +345 -0
- package/build/i18n/download_translations/fr-FR/ui.mjs +354 -0
- package/build/i18n/download_translations/fr-FR/ui.mjs.map +1 -0
- package/build/i18n/download_translations/ga-IE/ui.js +376 -0
- package/build/i18n/download_translations/ga-IE/ui.js.map +1 -0
- package/build/i18n/download_translations/ga-IE/ui.json +345 -0
- package/build/i18n/download_translations/ga-IE/ui.mjs +354 -0
- package/build/i18n/download_translations/ga-IE/ui.mjs.map +1 -0
- package/build/i18n/download_translations/gl-ES/ui.js +376 -0
- package/build/i18n/download_translations/gl-ES/ui.js.map +1 -0
- package/build/i18n/download_translations/gl-ES/ui.json +345 -0
- package/build/i18n/download_translations/gl-ES/ui.mjs +354 -0
- package/build/i18n/download_translations/gl-ES/ui.mjs.map +1 -0
- package/build/i18n/download_translations/it-IT/ui.js +376 -0
- package/build/i18n/download_translations/it-IT/ui.js.map +1 -0
- package/build/i18n/download_translations/it-IT/ui.json +345 -0
- package/build/i18n/download_translations/it-IT/ui.mjs +354 -0
- package/build/i18n/download_translations/it-IT/ui.mjs.map +1 -0
- package/build/i18n/download_translations/ko-KR/ui.js +376 -0
- package/build/i18n/download_translations/ko-KR/ui.js.map +1 -0
- package/build/i18n/download_translations/ko-KR/ui.json +345 -0
- package/build/i18n/download_translations/ko-KR/ui.mjs +354 -0
- package/build/i18n/download_translations/ko-KR/ui.mjs.map +1 -0
- package/build/i18n/download_translations/pl-PL/ui.js +376 -0
- package/build/i18n/download_translations/pl-PL/ui.js.map +1 -0
- package/build/i18n/download_translations/pl-PL/ui.json +345 -0
- package/build/i18n/download_translations/pl-PL/ui.mjs +354 -0
- package/build/i18n/download_translations/pl-PL/ui.mjs.map +1 -0
- package/build/i18n/download_translations/pt-BR/ui.js +376 -0
- package/build/i18n/download_translations/pt-BR/ui.js.map +1 -0
- package/build/i18n/download_translations/pt-BR/ui.json +345 -0
- package/build/i18n/download_translations/pt-BR/ui.mjs +354 -0
- package/build/i18n/download_translations/pt-BR/ui.mjs.map +1 -0
- package/build/i18n/download_translations/ru-RU/ui.js +376 -0
- package/build/i18n/download_translations/ru-RU/ui.js.map +1 -0
- package/build/i18n/download_translations/ru-RU/ui.json +345 -0
- package/build/i18n/download_translations/ru-RU/ui.mjs +354 -0
- package/build/i18n/download_translations/ru-RU/ui.mjs.map +1 -0
- package/build/i18n/download_translations/sr-CS/ui.js +373 -0
- package/build/i18n/download_translations/sr-CS/ui.js.map +1 -0
- package/build/i18n/download_translations/sr-CS/ui.json +345 -0
- package/build/i18n/download_translations/sr-CS/ui.mjs +352 -0
- package/build/i18n/download_translations/sr-CS/ui.mjs.map +1 -0
- package/build/i18n/download_translations/tr-TR/ui.js +376 -0
- package/build/i18n/download_translations/tr-TR/ui.js.map +1 -0
- package/build/i18n/download_translations/tr-TR/ui.json +345 -0
- package/build/i18n/download_translations/tr-TR/ui.mjs +354 -0
- package/build/i18n/download_translations/tr-TR/ui.mjs.map +1 -0
- package/build/i18n/download_translations/vi-VN/ui.js +373 -0
- package/build/i18n/download_translations/vi-VN/ui.js.map +1 -0
- package/build/i18n/download_translations/vi-VN/ui.json +345 -0
- package/build/i18n/download_translations/vi-VN/ui.mjs +352 -0
- package/build/i18n/download_translations/vi-VN/ui.mjs.map +1 -0
- package/build/i18n/download_translations/yo-NG/ui.js +373 -0
- package/build/i18n/download_translations/yo-NG/ui.js.map +1 -0
- package/build/i18n/download_translations/yo-NG/ui.json +345 -0
- package/build/i18n/download_translations/yo-NG/ui.mjs +352 -0
- package/build/i18n/download_translations/yo-NG/ui.mjs.map +1 -0
- package/build/i18n/download_translations/zh-CN/ui.js +376 -0
- package/build/i18n/download_translations/zh-CN/ui.js.map +1 -0
- package/build/i18n/download_translations/zh-CN/ui.json +345 -0
- package/build/i18n/download_translations/zh-CN/ui.mjs +354 -0
- package/build/i18n/download_translations/zh-CN/ui.mjs.map +1 -0
- package/build/i18n/download_translations/zh-TW/ui.js +376 -0
- package/build/i18n/download_translations/zh-TW/ui.js.map +1 -0
- package/build/i18n/download_translations/zh-TW/ui.json +345 -0
- package/build/i18n/download_translations/zh-TW/ui.mjs +354 -0
- package/build/i18n/download_translations/zh-TW/ui.mjs.map +1 -0
- package/build/i18n/loadTranslationFile.d.ts +6 -0
- package/build/i18n/loadTranslationFile.js +52 -0
- package/build/i18n/loadTranslationFile.js.map +1 -0
- package/build/i18n/loadTranslationFile.mjs +51 -0
- package/build/i18n/loadTranslationFile.mjs.map +1 -0
- package/build/i18n/translationProgress.d.ts +6 -0
- package/build/i18n/translationProgress.js +29 -0
- package/build/i18n/translationProgress.js.map +1 -0
- package/build/i18n/translationProgress.mjs +29 -0
- package/build/i18n/translationProgress.mjs.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +11 -0
- package/build/index.mjs +5 -2
- package/build/mockServiceWorker.js +1 -0
- package/build/pages/Version/Version.js +2 -2
- package/build/pages/Version/Version.js.map +1 -1
- package/build/pages/Version/Version.mjs +2 -2
- package/build/pages/Version/Version.mjs.map +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +3 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js.map +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.mjs +3 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.mjs.map +1 -1
- package/build/providers/ManifestsProvider/ManifestsProvider.d.ts +3 -0
- package/build/providers/ManifestsProvider/ManifestsProvider.js +9 -2
- package/build/providers/ManifestsProvider/ManifestsProvider.js.map +1 -1
- package/build/providers/ManifestsProvider/ManifestsProvider.mjs +10 -4
- package/build/providers/ManifestsProvider/ManifestsProvider.mjs.map +1 -1
- package/build/sections/Detail/ContainerContent.js +8 -0
- package/build/sections/Detail/ContainerContent.js.map +1 -1
- package/build/sections/Detail/ContainerContent.mjs +8 -1
- package/build/sections/Detail/ContainerContent.mjs.map +1 -1
- package/build/sections/Detail/Detail.d.ts +3 -6
- package/build/sections/Detail/Detail.js +13 -14
- package/build/sections/Detail/Detail.js.map +1 -1
- package/build/sections/Detail/Detail.mjs +14 -15
- package/build/sections/Detail/Detail.mjs.map +1 -1
- package/build/sections/Detail/Tabs.d.ts +3 -2
- package/build/sections/Detail/Tabs.js +9 -4
- package/build/sections/Detail/Tabs.js.map +1 -1
- package/build/sections/Detail/Tabs.mjs +9 -4
- package/build/sections/Detail/Tabs.mjs.map +1 -1
- package/build/sections/Footer/Footer.js +24 -3
- package/build/sections/Footer/Footer.js.map +1 -1
- package/build/sections/Footer/Footer.mjs +24 -4
- package/build/sections/Footer/Footer.mjs.map +1 -1
- package/build/sections/Footer/styles.d.ts +6 -0
- package/build/sections/Footer/styles.js +21 -2
- package/build/sections/Footer/styles.js.map +1 -1
- package/build/sections/Footer/styles.mjs +21 -3
- package/build/sections/Footer/styles.mjs.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.js +30 -8
- package/build/sections/Header/HeaderSettingsDialog.js.map +1 -1
- package/build/sections/Header/HeaderSettingsDialog.mjs +30 -8
- package/build/sections/Header/HeaderSettingsDialog.mjs.map +1 -1
- package/build/sections/Header/LanguageSwitch.js +95 -70
- package/build/sections/Header/LanguageSwitch.js.map +1 -1
- package/build/sections/Header/LanguageSwitch.mjs +94 -71
- package/build/sections/Header/LanguageSwitch.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +1 -4
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +83 -13
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs +85 -13
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs.map +1 -1
- package/build/sections/Home/Home.js +58 -2
- package/build/sections/Home/Home.js.map +1 -1
- package/build/sections/Home/Home.mjs +60 -4
- package/build/sections/Home/Home.mjs.map +1 -1
- package/build/utils/cli-utils.d.ts +10 -0
- package/build/utils/cli-utils.js +26 -0
- package/build/utils/cli-utils.js.map +1 -1
- package/build/utils/cli-utils.mjs +23 -1
- package/build/utils/cli-utils.mjs.map +1 -1
- package/build/utils/index.d.ts +1 -1
- package/build/utils/index.js +4 -0
- package/build/utils/index.mjs +2 -2
- package/build/utils/markdown.d.ts +6 -0
- package/build/utils/markdown.js +14 -0
- package/build/utils/markdown.js.map +1 -0
- package/build/utils/markdown.mjs +12 -0
- package/build/utils/markdown.mjs.map +1 -0
- package/package.json +8 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.mjs","names":[],"sources":["../../../../src/i18n/download_translations/zh-TW/ui.json"],"sourcesContent":["{\n \"loading\": \"載入中...\",\n \"copy-to-clipboard\": \"複製到剪貼簿\",\n \"copy-to-clipboard-done\": \"\",\n \"author-anonymous\": \"匿名\",\n \"author-unknown\": \"未知\",\n \"action-bar-action\": {\n \"visit-home-page\": \"瀏覽首頁\",\n \"open-an-issue\": \"提交問題\",\n \"download-tarball\": \"下載 tarball\",\n \"raw\": \"\",\n \"raw-title\": \"\"\n },\n \"dialog\": {\n \"docs-link\": \"\",\n \"opens-in-new-tab\": \"\",\n \"registry-info\": {\n \"title\": \"\"\n },\n \"settings\": {\n \"title\": \"設定檔案\"\n },\n \"license\": \"許可\",\n \"totalContributors\": \"\",\n \"support\": \"\"\n },\n \"header\": {\n \"documentation\": \"文件\",\n \"registry-info\": \"註冊資訊\",\n \"settings\": \"\",\n \"help\": \"幫助\",\n \"registry-no-conf\": \"沒有可用設定\",\n \"greetings\": \"你好 \"\n },\n \"search\": {\n \"packages\": \"找尋套件\",\n \"origin\": {\n \"private\": \"\",\n \"cached\": \"\",\n \"remote\": \"\"\n },\n \"group\": {\n \"private\": \"\",\n \"cached\": \"\",\n \"remote\": \"\"\n }\n },\n \"autoComplete\": {\n \"loading\": \"載入中...\",\n \"no-results-found\": \"無結果\",\n \"clear\": \"清除\",\n \"expand\": \"展開\",\n \"collapse\": \"收縮\",\n \"error\": \"\"\n },\n \"tab\": {\n \"uplinks\": \"上行連結\",\n \"versions\": \"版本\",\n \"dependencies\": \"相依\",\n \"readme\": \"Readme\"\n },\n \"uplinks\": {\n \"title\": \"上行連結\",\n \"no-items\": \"{{name}} 沒有上游連結。\"\n },\n \"versions\": {\n \"current-tags\": \"當前標籤\",\n \"version-history\": \"\",\n \"not-available\": \"無法取得\",\n \"deprecated\": \"\",\n \"search.placeholder\": \"\",\n \"hide-deprecated\": \"\"\n },\n \"packageList\": {\n \"filter\": \"\",\n \"scope\": \"\",\n \"all-scopes\": \"\",\n \"no-scope\": \"\",\n \"sort\": \"\",\n \"sort-default\": \"\",\n \"sort-name\": \"\",\n \"sort-recent\": \"\",\n \"count\": \"\",\n \"no-match\": \"\"\n },\n \"package\": {\n \"published-on\": \"\",\n \"version\": \"\",\n \"visit-home-page\": \"瀏覽首頁\",\n \"homepage\": \"首頁\",\n \"open-an-issue\": \"提交問題\",\n \"bugs\": \"漏洞\",\n \"download\": \"下载 {{what}}\",\n \"the-tar-file\": \"tar 檔案\",\n \"tarball\": \"壓縮檔\"\n },\n \"dependencies\": {\n \"has-no-dependencies\": \"{{package}} 沒有相依套件.\",\n \"dependency-block\": \"\",\n \"dependency-block-bundle\": \"\"\n },\n \"form\": {\n \"username\": \"使用者名稱\",\n \"password\": \"密碼\"\n },\n \"form-placeholder\": {\n \"username\": \"你的使用者名稱\",\n \"password\": \"你的密碼\"\n },\n \"form-validation\": {\n \"required-field\": \"必填欄位\",\n \"required-min-length\": \"\",\n \"unable-to-sign-in\": \"無法登入\",\n \"username-or-password-cant-be-empty\": \"使用者名稱或密碼不可空白\",\n \"invalid-email\": \"\"\n },\n \"help\": {\n \"settings-tab\": \"\",\n \"title\": \"尚未發布任何 Npm 套件.\",\n \"welcome\": \"\",\n \"steps\": {\n \"configure\": {\n \"title\": \"\",\n \"description\": \"\"\n },\n \"login\": {\n \"title\": \"\",\n \"description\": \"\",\n \"bun-note\": \"\"\n },\n \"publish\": {\n \"title\": \"\",\n \"description\": \"\"\n },\n \"wait\": {\n \"title\": \"\",\n \"description\": \"\"\n }\n },\n \"first-step-command-line\": \"\",\n \"second-step-command-line\": \"\",\n \"uplinks-note\": \"\",\n \"uplinks-link\": \"\"\n },\n \"sidebar\": {\n \"detail\": {\n \"latest-version\": \"最新版本 v{{version}}\",\n \"version\": \"\",\n \"published\": \"\"\n },\n \"installation\": {\n \"title\": \"安装\",\n \"latest\": \"最新版本\",\n \"global\": \"\",\n \"yarnModern\": \"\",\n \"npmrc\": \"\"\n },\n \"repository\": {\n \"title\": \"儲存庫\"\n },\n \"author\": {\n \"title\": \"作者\"\n },\n \"distribution\": {\n \"title\": \"\",\n \"license\": \"許可\",\n \"size\": \"大小\",\n \"file-count\": \"\"\n },\n \"keywords\": {\n \"title\": \"\"\n },\n \"maintainers\": {\n \"title\": \"維護人員\"\n },\n \"contributors\": {\n \"title\": \"貢獻人員\"\n },\n \"engines\": {\n \"npm-version\": \"\",\n \"pnpm-version\": \"\",\n \"yarn-version\": \"\",\n \"node-js\": \"\"\n }\n },\n \"footer\": {\n \"powered-by\": \"Powered by\",\n \"made-with-love-on\": \"用 <0>♥</0> 製作\"\n },\n \"button\": {\n \"close\": \"關閉\",\n \"cancel\": \"取消\",\n \"login\": \"登入\",\n \"logout\": \"登出\",\n \"go-to-the-home-page\": \"前往首頁\",\n \"fund-this-package\": \"<0>贊助</0> 這個套件\"\n },\n \"error\": {\n \"401\": {\n \"sorry-no-access\": \"\"\n },\n \"404\": {\n \"sorry-we-could-not-find-it\": \"不好意思, 找不到...\"\n },\n \"unspecific\": \"發生錯誤。\",\n \"app-context-not-correct-used\": \"\",\n \"theme-context-not-correct-used\": \"\",\n \"package-meta-is-required-at-detail-context\": \"\",\n \"download-tarball\": \"\"\n },\n \"lng\": {\n \"english\": \"English\",\n \"czech\": \"\",\n \"japanese\": \"日語\",\n \"portuguese\": \"\",\n \"spanish\": \"西班牙語\",\n \"irish\": \"\",\n \"german\": \"德語\",\n \"italian\": \"\",\n \"french\": \"法語\",\n \"russian\": \"\",\n \"turkish\": \"\",\n \"ukraine\": \"\",\n \"khmer\": \"\",\n \"chinese\": \"\",\n \"chineseTraditional\": \"\",\n \"korean\": \"\",\n \"polish\": \"\",\n \"galician\": \"\"\n },\n \"flag\": {\n \"austria\": \"\",\n \"australia\": \"\",\n \"brazil\": \"\",\n \"canada\": \"\",\n \"spain\": \"\",\n \"nicaragua\": \"\",\n \"india\": \"\",\n \"china\": \"\",\n \"germany\": \"\",\n \"taiwan\": \"\"\n },\n \"packageManagers\": {\n \"title\": \"套件管理器\",\n \"description\": \"此為本套件管理庫的詳細設定檔案。每個套件管理器都可以有不同的設定檔案,展開每一個區塊以獲得更多資訊。若區塊無法展開,請檢視您的設定檔案。\",\n \"yarnclassicDetails\": \"Yarn classic 設定檔與 Yarn 2+ 設定檔有些許不同。需要更多詳細資訊請點擊:[Yarn Classic](https://verdaccio.org/docs/cli-registry#yarn-1x)。\",\n \"yarnBerryDetails\": \"\",\n \"minReleaseAge\": {\n \"title\": \"\",\n \"description\": \"\",\n \"npm\": \"\",\n \"pnpm\": \"\",\n \"yarn\": \"\",\n \"bun\": \"\",\n \"registry\": \"\"\n },\n \"bunDetails\": \"\"\n },\n \"language\": {\n \"title\": \"翻譯\",\n \"contribute\": \"\",\n \"description\": \"這邊是語言設定檔案,結果將顯示在您的應用程式介面上。\",\n \"progress\": \"\"\n },\n \"security\": {\n \"login\": {\n \"createUser\": \"\",\n \"noUserQuestion\": \"\"\n },\n \"success\": {\n \"title\": \"\",\n \"messageSuccess\": \"\",\n \"messageLogin\": \"\",\n \"messageChangePassword\": \"\",\n \"messageAddUser\": \"\",\n \"submit\": \"\"\n },\n \"addUser\": {\n \"title\": \"\",\n \"username\": \"使用者名稱\",\n \"password\": \"密碼\",\n \"email\": \"\",\n \"emailDescription\": \"\",\n \"submit\": \"\",\n \"alreadyUserQuestion\": \"\",\n \"login\": \"\"\n },\n \"changePassword\": {\n \"loginRequired\": \"\",\n \"title\": \"\",\n \"oldPassword\": \"\",\n \"invalidOldPassword\": \"\",\n \"newPassword\": \"\",\n \"confirmPassword\": \"\",\n \"submit\": \"\"\n },\n \"error\": {\n \"username-or-password-cant-be-empty\": \"使用者名稱或密碼不可空白\",\n \"username-min-length\": \"\",\n \"username-must-be-url-safe\": \"\",\n \"username-already-exists\": \"\",\n \"username-not-found\": \"\",\n \"unable-to-add-user\": \"\",\n \"unable-to-change-password\": \"\",\n \"unable-to-login\": \"\",\n \"password-mismatch\": \"\",\n \"invalid-credentials\": \"\",\n \"invalid-next-param\": \"\"\n }\n },\n \"stage\": {\n \"menu\": \"\",\n \"title\": \"\",\n \"description\": \"\",\n \"empty\": \"\",\n \"backToList\": \"\",\n \"column\": {\n \"package\": \"\",\n \"version\": \"\",\n \"tag\": \"\",\n \"stagedBy\": \"\",\n \"date\": \"\",\n \"access\": \"\",\n \"shasum\": \"\",\n \"actions\": \"\"\n },\n \"action\": {\n \"approve\": \"\",\n \"reject\": \"\",\n \"download\": \"下載 tarball\"\n },\n \"confirm\": {\n \"approveTitle\": \"\",\n \"approveBody\": \"\",\n \"rejectTitle\": \"\",\n \"rejectBody\": \"\"\n },\n \"error\": {\n \"list\": \"\",\n \"notFound\": \"\",\n \"action\": \"\"\n }\n },\n \"about\": \"\"\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DEFAULT_TRANSLATION_LANGUAGE = "en-US";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the translated UI strings for a language. Crowdin only exports translated strings,
|
|
4
|
+
* so missing keys (or a language that was not downloaded) fall back to English through i18next.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadTranslationFile(lng: string): Record<string, unknown>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_ui = require("./download_translations/cs-CZ/ui.js");
|
|
2
|
+
const require_ui$1 = require("./download_translations/de-DE/ui.js");
|
|
3
|
+
const require_ui$2 = require("./download_translations/es-ES/ui.js");
|
|
4
|
+
const require_ui$3 = require("./download_translations/fr-FR/ui.js");
|
|
5
|
+
const require_ui$4 = require("./download_translations/ga-IE/ui.js");
|
|
6
|
+
const require_ui$5 = require("./download_translations/gl-ES/ui.js");
|
|
7
|
+
const require_ui$6 = require("./download_translations/it-IT/ui.js");
|
|
8
|
+
const require_ui$7 = require("./download_translations/ko-KR/ui.js");
|
|
9
|
+
const require_ui$8 = require("./download_translations/pl-PL/ui.js");
|
|
10
|
+
const require_ui$9 = require("./download_translations/pt-BR/ui.js");
|
|
11
|
+
const require_ui$10 = require("./download_translations/ru-RU/ui.js");
|
|
12
|
+
const require_ui$11 = require("./download_translations/sr-CS/ui.js");
|
|
13
|
+
const require_ui$12 = require("./download_translations/tr-TR/ui.js");
|
|
14
|
+
const require_ui$13 = require("./download_translations/vi-VN/ui.js");
|
|
15
|
+
const require_ui$14 = require("./download_translations/yo-NG/ui.js");
|
|
16
|
+
const require_ui$15 = require("./download_translations/zh-CN/ui.js");
|
|
17
|
+
const require_ui$16 = require("./download_translations/zh-TW/ui.js");
|
|
18
|
+
const require_ui$17 = require("./crowdin/ui.js");
|
|
19
|
+
//#region src/i18n/loadTranslationFile.ts
|
|
20
|
+
var translationModules = /* #__PURE__ */ Object.assign({
|
|
21
|
+
"./download_translations/cs-CZ/ui.json": require_ui.default,
|
|
22
|
+
"./download_translations/de-DE/ui.json": require_ui$1.default,
|
|
23
|
+
"./download_translations/es-ES/ui.json": require_ui$2.default,
|
|
24
|
+
"./download_translations/fr-FR/ui.json": require_ui$3.default,
|
|
25
|
+
"./download_translations/ga-IE/ui.json": require_ui$4.default,
|
|
26
|
+
"./download_translations/gl-ES/ui.json": require_ui$5.default,
|
|
27
|
+
"./download_translations/it-IT/ui.json": require_ui$6.default,
|
|
28
|
+
"./download_translations/ko-KR/ui.json": require_ui$7.default,
|
|
29
|
+
"./download_translations/pl-PL/ui.json": require_ui$8.default,
|
|
30
|
+
"./download_translations/pt-BR/ui.json": require_ui$9.default,
|
|
31
|
+
"./download_translations/ru-RU/ui.json": require_ui$10.default,
|
|
32
|
+
"./download_translations/sr-CS/ui.json": require_ui$11.default,
|
|
33
|
+
"./download_translations/tr-TR/ui.json": require_ui$12.default,
|
|
34
|
+
"./download_translations/vi-VN/ui.json": require_ui$13.default,
|
|
35
|
+
"./download_translations/yo-NG/ui.json": require_ui$14.default,
|
|
36
|
+
"./download_translations/zh-CN/ui.json": require_ui$15.default,
|
|
37
|
+
"./download_translations/zh-TW/ui.json": require_ui$16.default
|
|
38
|
+
});
|
|
39
|
+
var DEFAULT_TRANSLATION_LANGUAGE = "en-US";
|
|
40
|
+
/**
|
|
41
|
+
* Returns the translated UI strings for a language. Crowdin only exports translated strings,
|
|
42
|
+
* so missing keys (or a language that was not downloaded) fall back to English through i18next.
|
|
43
|
+
*/
|
|
44
|
+
function loadTranslationFile(lng) {
|
|
45
|
+
if (lng === "en-US") return require_ui$17.default;
|
|
46
|
+
return translationModules[`./download_translations/${lng}/ui.json`] ?? {};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.DEFAULT_TRANSLATION_LANGUAGE = DEFAULT_TRANSLATION_LANGUAGE;
|
|
50
|
+
exports.loadTranslationFile = loadTranslationFile;
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=loadTranslationFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadTranslationFile.js","names":["__import_glob__0_0_","__import_glob__0_1_","__import_glob__0_2_","__import_glob__0_3_","__import_glob__0_4_","__import_glob__0_5_","__import_glob__0_6_","__import_glob__0_7_","__import_glob__0_8_","__import_glob__0_9_","__import_glob__0_10_","__import_glob__0_11_","__import_glob__0_12_","__import_glob__0_13_","__import_glob__0_14_","__import_glob__0_15_","__import_glob__0_16_","enTranslations"],"sources":["../../src/i18n/loadTranslationFile.ts"],"sourcesContent":["import enTranslations from './crowdin/ui.json';\n\n// Crowdin downloads land here before the build, so the bundle carries every available language.\nconst translationModules = import.meta.glob<Record<string, unknown>>(\n './download_translations/*/ui.json',\n { eager: true, import: 'default' }\n);\n\nexport const DEFAULT_TRANSLATION_LANGUAGE = 'en-US';\n\n/**\n * Returns the translated UI strings for a language. Crowdin only exports translated strings,\n * so missing keys (or a language that was not downloaded) fall back to English through i18next.\n */\nexport function loadTranslationFile(lng: string): Record<string, unknown> {\n if (lng === DEFAULT_TRANSLATION_LANGUAGE) {\n return enTranslations;\n }\n return translationModules[`./download_translations/${lng}/ui.json`] ?? {};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,IAAM,qBAAqB,uBAAA,OAAA;CAAA,yCAAAA,WAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,aAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;CAAA,yCAAAC,cAAAA;AAG3B,CAAA;AAEA,IAAa,+BAA+B;;;;;AAM5C,SAAgB,oBAAoB,KAAsC;CACxE,IAAI,QAAA,SACF,OAAOC,cAAAA;CAET,OAAO,mBAAmB,2BAA2B,IAAI,cAAc,CAAC;AAC1E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import ui_default from "./download_translations/cs-CZ/ui.mjs";
|
|
2
|
+
import ui_default$1 from "./download_translations/de-DE/ui.mjs";
|
|
3
|
+
import ui_default$2 from "./download_translations/es-ES/ui.mjs";
|
|
4
|
+
import ui_default$3 from "./download_translations/fr-FR/ui.mjs";
|
|
5
|
+
import ui_default$4 from "./download_translations/ga-IE/ui.mjs";
|
|
6
|
+
import ui_default$5 from "./download_translations/gl-ES/ui.mjs";
|
|
7
|
+
import ui_default$6 from "./download_translations/it-IT/ui.mjs";
|
|
8
|
+
import ui_default$7 from "./download_translations/ko-KR/ui.mjs";
|
|
9
|
+
import ui_default$8 from "./download_translations/pl-PL/ui.mjs";
|
|
10
|
+
import ui_default$9 from "./download_translations/pt-BR/ui.mjs";
|
|
11
|
+
import ui_default$10 from "./download_translations/ru-RU/ui.mjs";
|
|
12
|
+
import ui_default$11 from "./download_translations/sr-CS/ui.mjs";
|
|
13
|
+
import ui_default$12 from "./download_translations/tr-TR/ui.mjs";
|
|
14
|
+
import ui_default$13 from "./download_translations/vi-VN/ui.mjs";
|
|
15
|
+
import ui_default$14 from "./download_translations/yo-NG/ui.mjs";
|
|
16
|
+
import ui_default$15 from "./download_translations/zh-CN/ui.mjs";
|
|
17
|
+
import ui_default$16 from "./download_translations/zh-TW/ui.mjs";
|
|
18
|
+
import ui_default$17 from "./crowdin/ui.mjs";
|
|
19
|
+
//#region src/i18n/loadTranslationFile.ts
|
|
20
|
+
var translationModules = /* #__PURE__ */ Object.assign({
|
|
21
|
+
"./download_translations/cs-CZ/ui.json": ui_default,
|
|
22
|
+
"./download_translations/de-DE/ui.json": ui_default$1,
|
|
23
|
+
"./download_translations/es-ES/ui.json": ui_default$2,
|
|
24
|
+
"./download_translations/fr-FR/ui.json": ui_default$3,
|
|
25
|
+
"./download_translations/ga-IE/ui.json": ui_default$4,
|
|
26
|
+
"./download_translations/gl-ES/ui.json": ui_default$5,
|
|
27
|
+
"./download_translations/it-IT/ui.json": ui_default$6,
|
|
28
|
+
"./download_translations/ko-KR/ui.json": ui_default$7,
|
|
29
|
+
"./download_translations/pl-PL/ui.json": ui_default$8,
|
|
30
|
+
"./download_translations/pt-BR/ui.json": ui_default$9,
|
|
31
|
+
"./download_translations/ru-RU/ui.json": ui_default$10,
|
|
32
|
+
"./download_translations/sr-CS/ui.json": ui_default$11,
|
|
33
|
+
"./download_translations/tr-TR/ui.json": ui_default$12,
|
|
34
|
+
"./download_translations/vi-VN/ui.json": ui_default$13,
|
|
35
|
+
"./download_translations/yo-NG/ui.json": ui_default$14,
|
|
36
|
+
"./download_translations/zh-CN/ui.json": ui_default$15,
|
|
37
|
+
"./download_translations/zh-TW/ui.json": ui_default$16
|
|
38
|
+
});
|
|
39
|
+
var DEFAULT_TRANSLATION_LANGUAGE = "en-US";
|
|
40
|
+
/**
|
|
41
|
+
* Returns the translated UI strings for a language. Crowdin only exports translated strings,
|
|
42
|
+
* so missing keys (or a language that was not downloaded) fall back to English through i18next.
|
|
43
|
+
*/
|
|
44
|
+
function loadTranslationFile(lng) {
|
|
45
|
+
if (lng === "en-US") return ui_default$17;
|
|
46
|
+
return translationModules[`./download_translations/${lng}/ui.json`] ?? {};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { DEFAULT_TRANSLATION_LANGUAGE, loadTranslationFile };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=loadTranslationFile.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadTranslationFile.mjs","names":["__import_glob__0_0_","__import_glob__0_1_","__import_glob__0_2_","__import_glob__0_3_","__import_glob__0_4_","__import_glob__0_5_","__import_glob__0_6_","__import_glob__0_7_","__import_glob__0_8_","__import_glob__0_9_","__import_glob__0_10_","__import_glob__0_11_","__import_glob__0_12_","__import_glob__0_13_","__import_glob__0_14_","__import_glob__0_15_","__import_glob__0_16_","enTranslations"],"sources":["../../src/i18n/loadTranslationFile.ts"],"sourcesContent":["import enTranslations from './crowdin/ui.json';\n\n// Crowdin downloads land here before the build, so the bundle carries every available language.\nconst translationModules = import.meta.glob<Record<string, unknown>>(\n './download_translations/*/ui.json',\n { eager: true, import: 'default' }\n);\n\nexport const DEFAULT_TRANSLATION_LANGUAGE = 'en-US';\n\n/**\n * Returns the translated UI strings for a language. Crowdin only exports translated strings,\n * so missing keys (or a language that was not downloaded) fall back to English through i18next.\n */\nexport function loadTranslationFile(lng: string): Record<string, unknown> {\n if (lng === DEFAULT_TRANSLATION_LANGUAGE) {\n return enTranslations;\n }\n return translationModules[`./download_translations/${lng}/ui.json`] ?? {};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,IAAM,qBAAqB,uBAAA,OAAA;CAAA,yCAAAA;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;CAAA,yCAAAC;AAG3B,CAAA;AAEA,IAAa,+BAA+B;;;;;AAM5C,SAAgB,oBAAoB,KAAsC;CACxE,IAAI,QAAA,SACF,OAAOC;CAET,OAAO,mBAAmB,2BAA2B,IAAI,cAAc,CAAC;AAC1E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type TranslationTree = {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
};
|
|
4
|
+
/** Percentage (0-100) of the source strings present in a translation; keys missing from the source are ignored. */
|
|
5
|
+
export declare function getTranslationProgress(source: TranslationTree, translation: TranslationTree | undefined): number;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/i18n/translationProgress.ts
|
|
2
|
+
function countTranslated(source, translation) {
|
|
3
|
+
let total = 0;
|
|
4
|
+
let translated = 0;
|
|
5
|
+
for (const [key, sourceValue] of Object.entries(source)) {
|
|
6
|
+
const value = translation?.[key];
|
|
7
|
+
if (typeof sourceValue === "object" && sourceValue !== null) {
|
|
8
|
+
const nested = countTranslated(sourceValue, typeof value === "object" && value !== null ? value : void 0);
|
|
9
|
+
total += nested.total;
|
|
10
|
+
translated += nested.translated;
|
|
11
|
+
} else {
|
|
12
|
+
total += 1;
|
|
13
|
+
if (typeof value === "string" && value.length > 0) translated += 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
total,
|
|
18
|
+
translated
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Percentage (0-100) of the source strings present in a translation; keys missing from the source are ignored. */
|
|
22
|
+
function getTranslationProgress(source, translation) {
|
|
23
|
+
const { total, translated } = countTranslated(source, translation);
|
|
24
|
+
return total === 0 ? 0 : Math.floor(translated / total * 100);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.getTranslationProgress = getTranslationProgress;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=translationProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translationProgress.js","names":[],"sources":["../../src/i18n/translationProgress.ts"],"sourcesContent":["type TranslationTree = { [key: string]: unknown };\n\nfunction countTranslated(source: TranslationTree, translation: TranslationTree | undefined) {\n let total = 0;\n let translated = 0;\n for (const [key, sourceValue] of Object.entries(source)) {\n const value = translation?.[key];\n if (typeof sourceValue === 'object' && sourceValue !== null) {\n const nested = countTranslated(\n sourceValue as TranslationTree,\n typeof value === 'object' && value !== null ? (value as TranslationTree) : undefined\n );\n total += nested.total;\n translated += nested.translated;\n } else {\n total += 1;\n if (typeof value === 'string' && value.length > 0) {\n translated += 1;\n }\n }\n }\n return { total, translated };\n}\n\n/** Percentage (0-100) of the source strings present in a translation; keys missing from the source are ignored. */\nexport function getTranslationProgress(\n source: TranslationTree,\n translation: TranslationTree | undefined\n): number {\n const { total, translated } = countTranslated(source, translation);\n return total === 0 ? 0 : Math.floor((translated / total) * 100);\n}\n"],"mappings":";AAEA,SAAS,gBAAgB,QAAyB,aAA0C;CAC1F,IAAI,QAAQ;CACZ,IAAI,aAAa;CACjB,KAAK,MAAM,CAAC,KAAK,gBAAgB,OAAO,QAAQ,MAAM,GAAG;EACvD,MAAM,QAAQ,cAAc;EAC5B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM;GAC3D,MAAM,SAAS,gBACb,aACA,OAAO,UAAU,YAAY,UAAU,OAAQ,QAA4B,KAAA,CAC7E;GACA,SAAS,OAAO;GAChB,cAAc,OAAO;EACvB,OAAO;GACL,SAAS;GACT,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,GAC9C,cAAc;EAElB;CACF;CACA,OAAO;EAAE;EAAO;CAAW;AAC7B;;AAGA,SAAgB,uBACd,QACA,aACQ;CACR,MAAM,EAAE,OAAO,eAAe,gBAAgB,QAAQ,WAAW;CACjE,OAAO,UAAU,IAAI,IAAI,KAAK,MAAO,aAAa,QAAS,GAAG;AAChE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/i18n/translationProgress.ts
|
|
2
|
+
function countTranslated(source, translation) {
|
|
3
|
+
let total = 0;
|
|
4
|
+
let translated = 0;
|
|
5
|
+
for (const [key, sourceValue] of Object.entries(source)) {
|
|
6
|
+
const value = translation?.[key];
|
|
7
|
+
if (typeof sourceValue === "object" && sourceValue !== null) {
|
|
8
|
+
const nested = countTranslated(sourceValue, typeof value === "object" && value !== null ? value : void 0);
|
|
9
|
+
total += nested.total;
|
|
10
|
+
translated += nested.translated;
|
|
11
|
+
} else {
|
|
12
|
+
total += 1;
|
|
13
|
+
if (typeof value === "string" && value.length > 0) translated += 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
total,
|
|
18
|
+
translated
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Percentage (0-100) of the source strings present in a translation; keys missing from the source are ignored. */
|
|
22
|
+
function getTranslationProgress(source, translation) {
|
|
23
|
+
const { total, translated } = countTranslated(source, translation);
|
|
24
|
+
return total === 0 ? 0 : Math.floor(translated / total * 100);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getTranslationProgress };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=translationProgress.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translationProgress.mjs","names":[],"sources":["../../src/i18n/translationProgress.ts"],"sourcesContent":["type TranslationTree = { [key: string]: unknown };\n\nfunction countTranslated(source: TranslationTree, translation: TranslationTree | undefined) {\n let total = 0;\n let translated = 0;\n for (const [key, sourceValue] of Object.entries(source)) {\n const value = translation?.[key];\n if (typeof sourceValue === 'object' && sourceValue !== null) {\n const nested = countTranslated(\n sourceValue as TranslationTree,\n typeof value === 'object' && value !== null ? (value as TranslationTree) : undefined\n );\n total += nested.total;\n translated += nested.translated;\n } else {\n total += 1;\n if (typeof value === 'string' && value.length > 0) {\n translated += 1;\n }\n }\n }\n return { total, translated };\n}\n\n/** Percentage (0-100) of the source strings present in a translation; keys missing from the source are ignored. */\nexport function getTranslationProgress(\n source: TranslationTree,\n translation: TranslationTree | undefined\n): number {\n const { total, translated } = countTranslated(source, translation);\n return total === 0 ? 0 : Math.floor((translated / total) * 100);\n}\n"],"mappings":";AAEA,SAAS,gBAAgB,QAAyB,aAA0C;CAC1F,IAAI,QAAQ;CACZ,IAAI,aAAa;CACjB,KAAK,MAAM,CAAC,KAAK,gBAAgB,OAAO,QAAQ,MAAM,GAAG;EACvD,MAAM,QAAQ,cAAc;EAC5B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM;GAC3D,MAAM,SAAS,gBACb,aACA,OAAO,UAAU,YAAY,UAAU,OAAQ,QAA4B,KAAA,CAC7E;GACA,SAAS,OAAO;GAChB,cAAc,OAAO;EACvB,OAAO;GACL,SAAS;GACT,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,GAC9C,cAAc;EAElB;CACF;CACA,OAAO;EAAE;EAAO;CAAW;AAC7B;;AAGA,SAAgB,uBACd,QACA,aACQ;CACR,MAAM,EAAE,OAAO,eAAe,gBAAgB,QAAQ,WAAW;CACjE,OAAO,UAAU,IAAI,IAAI,KAAK,MAAO,aAAa,QAAS,GAAG;AAChE"}
|
package/build/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { default as LoginDialog } from './components/LoginDialog';
|
|
|
30
30
|
export { default as Search } from './components/Search';
|
|
31
31
|
export { default as HeaderInfoDialog } from './components/HeaderInfoDialog';
|
|
32
32
|
export { default as Loading } from './components/Loading';
|
|
33
|
+
export { PackageListSkeleton, VersionSkeleton } from './components/Loading';
|
|
33
34
|
export { default as Package } from './components/Package';
|
|
34
35
|
export { default as Help } from './components/Help';
|
|
35
36
|
export { default as PackageList } from './components/PackageList';
|
|
@@ -51,3 +52,4 @@ export { loadable, Route } from './utils';
|
|
|
51
52
|
export * from './hooks';
|
|
52
53
|
export * from './Theme';
|
|
53
54
|
export { api } from './store';
|
|
55
|
+
export { loadTranslationFile, DEFAULT_TRANSLATION_LANGUAGE } from './i18n/loadTranslationFile';
|
package/build/index.js
CHANGED
|
@@ -83,6 +83,8 @@ require("./components/Search/index.js");
|
|
|
83
83
|
const require_HeaderInfoDialog = require("./components/HeaderInfoDialog/HeaderInfoDialog.js");
|
|
84
84
|
require("./components/HeaderInfoDialog/index.js");
|
|
85
85
|
const require_Loading = require("./components/Loading/Loading.js");
|
|
86
|
+
const require_PackageListSkeleton = require("./components/Loading/PackageListSkeleton.js");
|
|
87
|
+
const require_VersionSkeleton = require("./components/Loading/VersionSkeleton.js");
|
|
86
88
|
require("./components/Loading/index.js");
|
|
87
89
|
const require_Package = require("./components/Package/Package.js");
|
|
88
90
|
require("./components/Package/index.js");
|
|
@@ -97,6 +99,7 @@ const require_Sidebar = require("./sections/SideBar/Sidebar.js");
|
|
|
97
99
|
require("./sections/SideBar/index.js");
|
|
98
100
|
const require_Detail = require("./sections/Detail/Detail.js");
|
|
99
101
|
require("./sections/Detail/index.js");
|
|
102
|
+
const require_loadTranslationFile = require("./i18n/loadTranslationFile.js");
|
|
100
103
|
const require_Header = require("./sections/Header/Header.js");
|
|
101
104
|
require("./sections/Header/index.js");
|
|
102
105
|
const require_Home = require("./sections/Home/Home.js");
|
|
@@ -126,6 +129,7 @@ exports.AuthProvider = require_AuthProvider.AuthProvider;
|
|
|
126
129
|
exports.Author = require_Author.default;
|
|
127
130
|
exports.ChangePassword = require_ChangePassword.default;
|
|
128
131
|
exports.CopyClipboard = require_CopyToClipBoard.default;
|
|
132
|
+
exports.DEFAULT_TRANSLATION_LANGUAGE = require_loadTranslationFile.DEFAULT_TRANSLATION_LANGUAGE;
|
|
129
133
|
exports.Dependencies = require_Dependencies.default;
|
|
130
134
|
exports.Deprecated = require_Deprecated.default;
|
|
131
135
|
exports.Detail = require_Detail.default;
|
|
@@ -158,11 +162,13 @@ exports.Loading = require_Loading.default;
|
|
|
158
162
|
exports.Login = require_Login.default;
|
|
159
163
|
exports.LoginDialog = require_LoginDialog.default;
|
|
160
164
|
exports.Logo = require_Logo.default;
|
|
165
|
+
exports.MIN_RELEASE_AGE_DAYS = require_cli_utils.MIN_RELEASE_AGE_DAYS;
|
|
161
166
|
exports.ManifestsProvider = require_ManifestsProvider.default;
|
|
162
167
|
exports.MenuItem = require_MenuItem.default;
|
|
163
168
|
exports.NotFound = require_NotFound.default;
|
|
164
169
|
exports.Package = require_Package.default;
|
|
165
170
|
exports.PackageList = require_PackageList.default;
|
|
171
|
+
exports.PackageListSkeleton = require_PackageListSkeleton.default;
|
|
166
172
|
exports.PersistenceSettingProvider = require_PersistenceSettingProvider.PersistenceSettingProvider;
|
|
167
173
|
exports.Person = require_Person.default;
|
|
168
174
|
exports.RawViewer = require_RawViewer.default;
|
|
@@ -180,6 +186,7 @@ exports.TranslatorProvider = require_TranslatorProvider.default;
|
|
|
180
186
|
exports.UpLinks = require_UpLinks.default;
|
|
181
187
|
exports.VersionLayout = require_Version.default;
|
|
182
188
|
exports.VersionProvider = require_VersionProvider.default;
|
|
189
|
+
exports.VersionSkeleton = require_VersionSkeleton.default;
|
|
183
190
|
exports.Versions = require_Versions.default;
|
|
184
191
|
exports.api = require_api.default;
|
|
185
192
|
exports.breakPoints = require_tokens.breakPoints;
|
|
@@ -193,12 +200,16 @@ exports.copyToClipBoardUtility = require_utils.copyToClipBoardUtility;
|
|
|
193
200
|
exports.customizedTheme = require_tokens.customizedTheme;
|
|
194
201
|
exports.fontSize = require_tokens.fontSize;
|
|
195
202
|
exports.fontWeight = require_tokens.fontWeight;
|
|
203
|
+
exports.getBunfigRegistry = require_cli_utils.getBunfigRegistry;
|
|
196
204
|
exports.getCLIChangePassword = require_cli_utils.getCLIChangePassword;
|
|
197
205
|
exports.getCLISBerryYamlRegistry = require_cli_utils.getCLISBerryYamlRegistry;
|
|
198
206
|
exports.getCLISetConfigRegistry = require_cli_utils.getCLISetConfigRegistry;
|
|
199
207
|
exports.getCLISetRegistry = require_cli_utils.getCLISetRegistry;
|
|
208
|
+
exports.getMinReleaseAgeConfig = require_cli_utils.getMinReleaseAgeConfig;
|
|
209
|
+
exports.getNpmrcRegistry = require_cli_utils.getNpmrcRegistry;
|
|
200
210
|
exports.getTheme = require_theme.getTheme;
|
|
201
211
|
exports.isTokenExpire = require_token.isTokenExpire;
|
|
212
|
+
exports.loadTranslationFile = require_loadTranslationFile.loadTranslationFile;
|
|
202
213
|
exports.loadable = require_loadable.default;
|
|
203
214
|
exports.tokenExpireInMs = require_token.tokenExpireInMs;
|
|
204
215
|
Object.defineProperty(exports, "url", {
|
package/build/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import CopyToClipBoard from "./components/CopyClipboard/CopyToClipBoard.mjs";
|
|
|
4
4
|
import "./components/CopyClipboard/index.mjs";
|
|
5
5
|
import { url_exports } from "./utils/url.mjs";
|
|
6
6
|
import { utils_exports } from "./utils/utils.mjs";
|
|
7
|
-
import { getCLIChangePassword, getCLISBerryYamlRegistry, getCLISetConfigRegistry, getCLISetRegistry } from "./utils/cli-utils.mjs";
|
|
7
|
+
import { MIN_RELEASE_AGE_DAYS, getBunfigRegistry, getCLIChangePassword, getCLISBerryYamlRegistry, getCLISetConfigRegistry, getCLISetRegistry, getMinReleaseAgeConfig, getNpmrcRegistry } from "./utils/cli-utils.mjs";
|
|
8
8
|
import loadable_default from "./utils/loadable.mjs";
|
|
9
9
|
import { Route } from "./utils/routes.mjs";
|
|
10
10
|
import { isTokenExpire, tokenExpireInMs } from "./utils/token.mjs";
|
|
@@ -79,6 +79,8 @@ import "./components/Search/index.mjs";
|
|
|
79
79
|
import HeaderInfoDialog from "./components/HeaderInfoDialog/HeaderInfoDialog.mjs";
|
|
80
80
|
import "./components/HeaderInfoDialog/index.mjs";
|
|
81
81
|
import Loading from "./components/Loading/Loading.mjs";
|
|
82
|
+
import PackageListSkeleton from "./components/Loading/PackageListSkeleton.mjs";
|
|
83
|
+
import VersionSkeleton from "./components/Loading/VersionSkeleton.mjs";
|
|
82
84
|
import "./components/Loading/index.mjs";
|
|
83
85
|
import Package from "./components/Package/Package.mjs";
|
|
84
86
|
import "./components/Package/index.mjs";
|
|
@@ -93,6 +95,7 @@ import DetailSidebar from "./sections/SideBar/Sidebar.mjs";
|
|
|
93
95
|
import "./sections/SideBar/index.mjs";
|
|
94
96
|
import DetailContainer from "./sections/Detail/Detail.mjs";
|
|
95
97
|
import "./sections/Detail/index.mjs";
|
|
98
|
+
import { DEFAULT_TRANSLATION_LANGUAGE, loadTranslationFile } from "./i18n/loadTranslationFile.mjs";
|
|
96
99
|
import Header from "./sections/Header/Header.mjs";
|
|
97
100
|
import "./sections/Header/index.mjs";
|
|
98
101
|
import Home from "./sections/Home/Home.mjs";
|
|
@@ -113,4 +116,4 @@ import { ThemeProvider, useCustomTheme } from "./Theme/ThemeProvider.mjs";
|
|
|
113
116
|
import StyleBaseline from "./Theme/StyleBaseline.mjs";
|
|
114
117
|
import "./Theme/index.mjs";
|
|
115
118
|
import "./store/index.mjs";
|
|
116
|
-
export { ActionBar, AddUser, AppConfigurationProvider, AppRoute, AuthContext, AuthProvider, Author, ChangePassword, CopyToClipBoard as CopyClipboard, Dependencies, Deprecated, DetailContainer as Detail, Developers, Dist as Distribution, DownloadProvider, Engine as Engines, ErrorBoundary, Footer, Forbidden, FundButton, GenericError, Header, HeaderInfoDialog, Heading, Help, Home, Icons_exports as Icons, Install, Keywords, Label, Link, LinkExternal, Loading, Login, LoginDialog, Logo, ManifestsProvider, MenuItem, NotFound, Package, PackageList, PersistenceSettingProvider, Person, RawViewer, Readme, Route, Search, SearchContext, SearchProvider, DetailSidebar as SideBar, DetailSidebarTitle as SideBarTitle, StyleBaseline, Success, ThemeProvider, TranslatorProvider, UpLinks, VersionLayout, VersionProvider, Versions, api_default as api, breakPoints, colors_exports as colors, copyToClipBoardUtility, customizedTheme, fontSize, fontWeight, getCLIChangePassword, getCLISBerryYamlRegistry, getCLISetConfigRegistry, getCLISetRegistry, getTheme, isTokenExpire, loadable_default as loadable, tokenExpireInMs, url_exports as url, useAuth, useConfig, useCustomTheme, useDownload, useLanguage, useLocalStorage, useManifests, useOnClickOutside, useSearch, useSettings, useVersion, utils_exports as utils };
|
|
119
|
+
export { ActionBar, AddUser, AppConfigurationProvider, AppRoute, AuthContext, AuthProvider, Author, ChangePassword, CopyToClipBoard as CopyClipboard, DEFAULT_TRANSLATION_LANGUAGE, Dependencies, Deprecated, DetailContainer as Detail, Developers, Dist as Distribution, DownloadProvider, Engine as Engines, ErrorBoundary, Footer, Forbidden, FundButton, GenericError, Header, HeaderInfoDialog, Heading, Help, Home, Icons_exports as Icons, Install, Keywords, Label, Link, LinkExternal, Loading, Login, LoginDialog, Logo, MIN_RELEASE_AGE_DAYS, ManifestsProvider, MenuItem, NotFound, Package, PackageList, PackageListSkeleton, PersistenceSettingProvider, Person, RawViewer, Readme, Route, Search, SearchContext, SearchProvider, DetailSidebar as SideBar, DetailSidebarTitle as SideBarTitle, StyleBaseline, Success, ThemeProvider, TranslatorProvider, UpLinks, VersionLayout, VersionProvider, VersionSkeleton, Versions, api_default as api, breakPoints, colors_exports as colors, copyToClipBoardUtility, customizedTheme, fontSize, fontWeight, getBunfigRegistry, getCLIChangePassword, getCLISBerryYamlRegistry, getCLISetConfigRegistry, getCLISetRegistry, getMinReleaseAgeConfig, getNpmrcRegistry, getTheme, isTokenExpire, loadTranslationFile, loadable_default as loadable, tokenExpireInMs, url_exports as url, useAuth, useConfig, useCustomTheme, useDownload, useLanguage, useLocalStorage, useManifests, useOnClickOutside, useSearch, useSettings, useVersion, utils_exports as utils };
|
|
@@ -5,7 +5,7 @@ const require_GenericError = require("../../components/GenericError/GenericError
|
|
|
5
5
|
require("../../components/GenericError/index.js");
|
|
6
6
|
const require_Forbidden = require("../../components/Forbidden/Forbidden.js");
|
|
7
7
|
require("../../components/Forbidden/index.js");
|
|
8
|
-
const
|
|
8
|
+
const require_VersionSkeleton = require("../../components/Loading/VersionSkeleton.js");
|
|
9
9
|
const require_Version = require("../../layouts/Version/Version.js");
|
|
10
10
|
require("../../index.js");
|
|
11
11
|
let react = require("react");
|
|
@@ -14,7 +14,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
14
14
|
//#region src/pages/Version/Version.tsx
|
|
15
15
|
var Version = () => {
|
|
16
16
|
const { hasNotBeenFound, isForbidden, isUnAuthorized, isError, isLoading, packageMeta } = require_VersionProvider.useVersion();
|
|
17
|
-
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
17
|
+
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_VersionSkeleton.default, {});
|
|
18
18
|
if (isUnAuthorized) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Forbidden.Forbidden, {});
|
|
19
19
|
if (isForbidden) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Forbidden.Forbidden, {});
|
|
20
20
|
if (hasNotBeenFound) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NotFound.default, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Version.js","names":["useVersion","
|
|
1
|
+
{"version":3,"file":"Version.js","names":["useVersion","VersionSkeleton","Forbidden","NotFound","GenericError","VersionLayout"],"sources":["../../../src/pages/Version/Version.tsx"],"sourcesContent":["import React from 'react';\n\nimport Forbidden from '../../components/Forbidden';\nimport GenericError from '../../components/GenericError';\nimport { NotFound, VersionLayout, VersionSkeleton, useVersion } from '../../index';\n\nconst Version: React.FC = () => {\n const { hasNotBeenFound, isForbidden, isUnAuthorized, isError, isLoading, packageMeta } =\n useVersion();\n\n if (isLoading) {\n return <VersionSkeleton />;\n }\n\n if (isUnAuthorized) {\n return <Forbidden />;\n }\n\n if (isForbidden) {\n return <Forbidden />;\n }\n\n if (hasNotBeenFound) {\n return <NotFound />;\n }\n\n // 5xx, network failures or a manifest that never arrived: rendering the\n // layout without packageMeta crashes the tab components\n if (isError || !packageMeta) {\n return <GenericError />;\n }\n\n return <VersionLayout />;\n};\n\nexport default Version;\n"],"mappings":";;;;;;;;;;;;;;AAMA,IAAM,gBAA0B;CAC9B,MAAM,EAAE,iBAAiB,aAAa,gBAAgB,SAAS,WAAW,gBACxEA,wBAAAA,WAAW;CAEb,IAAI,WACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAD,CAAkB,CAAA;CAG3B,IAAI,gBACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,WAAD,CAAY,CAAA;CAGrB,IAAI,aACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,kBAAAA,WAAD,CAAY,CAAA;CAGrB,IAAI,iBACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,SAAD,CAAW,CAAA;CAKpB,IAAI,WAAW,CAAC,aACd,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD,CAAe,CAAA;CAGxB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,SAAD,CAAgB,CAAA;AACzB"}
|
|
@@ -4,7 +4,7 @@ import GenericError from "../../components/GenericError/GenericError.mjs";
|
|
|
4
4
|
import "../../components/GenericError/index.mjs";
|
|
5
5
|
import { Forbidden } from "../../components/Forbidden/Forbidden.mjs";
|
|
6
6
|
import "../../components/Forbidden/index.mjs";
|
|
7
|
-
import
|
|
7
|
+
import VersionSkeleton from "../../components/Loading/VersionSkeleton.mjs";
|
|
8
8
|
import VersionLayout from "../../layouts/Version/Version.mjs";
|
|
9
9
|
import "../../index.mjs";
|
|
10
10
|
import "react";
|
|
@@ -12,7 +12,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
12
|
//#region src/pages/Version/Version.tsx
|
|
13
13
|
var Version = () => {
|
|
14
14
|
const { hasNotBeenFound, isForbidden, isUnAuthorized, isError, isLoading, packageMeta } = useVersion();
|
|
15
|
-
if (isLoading) return /* @__PURE__ */ jsx(
|
|
15
|
+
if (isLoading) return /* @__PURE__ */ jsx(VersionSkeleton, {});
|
|
16
16
|
if (isUnAuthorized) return /* @__PURE__ */ jsx(Forbidden, {});
|
|
17
17
|
if (isForbidden) return /* @__PURE__ */ jsx(Forbidden, {});
|
|
18
18
|
if (hasNotBeenFound) return /* @__PURE__ */ jsx(NotFound, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Version.mjs","names":[],"sources":["../../../src/pages/Version/Version.tsx"],"sourcesContent":["import React from 'react';\n\nimport Forbidden from '../../components/Forbidden';\nimport GenericError from '../../components/GenericError';\nimport {
|
|
1
|
+
{"version":3,"file":"Version.mjs","names":[],"sources":["../../../src/pages/Version/Version.tsx"],"sourcesContent":["import React from 'react';\n\nimport Forbidden from '../../components/Forbidden';\nimport GenericError from '../../components/GenericError';\nimport { NotFound, VersionLayout, VersionSkeleton, useVersion } from '../../index';\n\nconst Version: React.FC = () => {\n const { hasNotBeenFound, isForbidden, isUnAuthorized, isError, isLoading, packageMeta } =\n useVersion();\n\n if (isLoading) {\n return <VersionSkeleton />;\n }\n\n if (isUnAuthorized) {\n return <Forbidden />;\n }\n\n if (isForbidden) {\n return <Forbidden />;\n }\n\n if (hasNotBeenFound) {\n return <NotFound />;\n }\n\n // 5xx, network failures or a manifest that never arrived: rendering the\n // layout without packageMeta crashes the tab components\n if (isError || !packageMeta) {\n return <GenericError />;\n }\n\n return <VersionLayout />;\n};\n\nexport default Version;\n"],"mappings":";;;;;;;;;;;;AAMA,IAAM,gBAA0B;CAC9B,MAAM,EAAE,iBAAiB,aAAa,gBAAgB,SAAS,WAAW,gBACxE,WAAW;CAEb,IAAI,WACF,OAAO,oBAAC,iBAAD,CAAkB,CAAA;CAG3B,IAAI,gBACF,OAAO,oBAAC,WAAD,CAAY,CAAA;CAGrB,IAAI,aACF,OAAO,oBAAC,WAAD,CAAY,CAAA;CAGrB,IAAI,iBACF,OAAO,oBAAC,UAAD,CAAW,CAAA;CAKpB,IAAI,WAAW,CAAC,aACd,OAAO,oBAAC,cAAD,CAAe,CAAA;CAGxB,OAAO,oBAAC,eAAD,CAAgB,CAAA;AACzB"}
|
|
@@ -9,7 +9,8 @@ var DEFAULT_OPTIONS = {
|
|
|
9
9
|
pkgManagers: [
|
|
10
10
|
"yarn",
|
|
11
11
|
"pnpm",
|
|
12
|
-
"npm"
|
|
12
|
+
"npm",
|
|
13
|
+
"bun"
|
|
13
14
|
],
|
|
14
15
|
scope: "",
|
|
15
16
|
base: "",
|
|
@@ -23,6 +24,7 @@ var DEFAULT_OPTIONS = {
|
|
|
23
24
|
showSearch: true,
|
|
24
25
|
showRaw: true,
|
|
25
26
|
showDownloadTarball: true,
|
|
27
|
+
showPackageListToolbar: true,
|
|
26
28
|
showUplinks: true,
|
|
27
29
|
hideDeprecatedVersions: false,
|
|
28
30
|
title: "Verdaccio"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfigurationProvider.js","names":["PRIMARY_COLOR","createContext","useMemo","useContext"],"sources":["../../../src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport type { TemplateUIOptions } from '@verdaccio/types';\n\nimport { PRIMARY_COLOR } from '../../Theme/colors';\n\ntype ConfigProviderProps = {\n configOptions: TemplateUIOptions;\n};\n\ninterface AppConfigurationProviderProps {\n children: ReactNode;\n // Allows passing overrides like { flags: { myFlag: true } }\n overrideConfig?: Partial<TemplateUIOptions>;\n}\n\nconst DEFAULT_OPTIONS: TemplateUIOptions = {\n primaryColor: PRIMARY_COLOR,\n pkgManagers: ['yarn', 'pnpm', 'npm'],\n scope: '',\n base: '',\n flags: {},\n login: true,\n url_prefix: '',\n showInfo: true,\n showSettings: true,\n showThemeSwitch: true,\n showFooter: true,\n showSearch: true,\n showRaw: true,\n showDownloadTarball: true,\n showUplinks: true,\n hideDeprecatedVersions: false,\n title: 'Verdaccio',\n};\n\n/**\n * Merges defaults, window globals, and optional local overrides.\n */\nfunction getConfiguration(overrides: Partial<TemplateUIOptions> = {}): TemplateUIOptions {\n const windowOptions = window?.__VERDACCIO_BASENAME_UI_OPTIONS || {};\n\n const uiConfiguration = {\n ...DEFAULT_OPTIONS,\n ...windowOptions,\n ...overrides,\n flags: {\n ...DEFAULT_OPTIONS.flags,\n ...windowOptions.flags,\n ...overrides.flags,\n },\n };\n\n // Logic cleanup: Ensure primaryColor is never empty/null\n if (!uiConfiguration.primaryColor) {\n uiConfiguration.primaryColor = PRIMARY_COLOR;\n }\n\n return uiConfiguration;\n}\n\nconst AppConfigurationContext = createContext<ConfigProviderProps | undefined>(undefined);\n\nconst AppConfigurationProvider: FunctionComponent<AppConfigurationProviderProps> = ({\n children,\n overrideConfig = {},\n}) => {\n // We include overrideConfig in the dependency array so if the prop\n // changes, the configuration updates accordingly.\n const value = useMemo(\n () => ({\n configOptions: getConfiguration(overrideConfig),\n }),\n [overrideConfig]\n );\n\n return (\n <AppConfigurationContext.Provider value={value}>{children}</AppConfigurationContext.Provider>\n );\n};\n\nexport { AppConfigurationProvider };\n\nexport const useConfig = () => {\n const ctx = useContext(AppConfigurationContext);\n if (!ctx) {\n throw new Error('useConfig must be used within AppConfigurationProvider');\n }\n return ctx;\n};\n"],"mappings":";;;;;;AAiBA,IAAM,kBAAqC;CACzC,cAAcA,eAAAA;CACd,aAAa;EAAC;EAAQ;EAAQ;CAAK;
|
|
1
|
+
{"version":3,"file":"AppConfigurationProvider.js","names":["PRIMARY_COLOR","createContext","useMemo","useContext"],"sources":["../../../src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport type { TemplateUIOptions } from '@verdaccio/types';\n\nimport { PRIMARY_COLOR } from '../../Theme/colors';\n\ntype ConfigProviderProps = {\n configOptions: TemplateUIOptions;\n};\n\ninterface AppConfigurationProviderProps {\n children: ReactNode;\n // Allows passing overrides like { flags: { myFlag: true } }\n overrideConfig?: Partial<TemplateUIOptions>;\n}\n\nconst DEFAULT_OPTIONS: TemplateUIOptions = {\n primaryColor: PRIMARY_COLOR,\n pkgManagers: ['yarn', 'pnpm', 'npm', 'bun'],\n scope: '',\n base: '',\n flags: {},\n login: true,\n url_prefix: '',\n showInfo: true,\n showSettings: true,\n showThemeSwitch: true,\n showFooter: true,\n showSearch: true,\n showRaw: true,\n showDownloadTarball: true,\n showPackageListToolbar: true,\n showUplinks: true,\n hideDeprecatedVersions: false,\n title: 'Verdaccio',\n};\n\n/**\n * Merges defaults, window globals, and optional local overrides.\n */\nfunction getConfiguration(overrides: Partial<TemplateUIOptions> = {}): TemplateUIOptions {\n const windowOptions = window?.__VERDACCIO_BASENAME_UI_OPTIONS || {};\n\n const uiConfiguration = {\n ...DEFAULT_OPTIONS,\n ...windowOptions,\n ...overrides,\n flags: {\n ...DEFAULT_OPTIONS.flags,\n ...windowOptions.flags,\n ...overrides.flags,\n },\n };\n\n // Logic cleanup: Ensure primaryColor is never empty/null\n if (!uiConfiguration.primaryColor) {\n uiConfiguration.primaryColor = PRIMARY_COLOR;\n }\n\n return uiConfiguration;\n}\n\nconst AppConfigurationContext = createContext<ConfigProviderProps | undefined>(undefined);\n\nconst AppConfigurationProvider: FunctionComponent<AppConfigurationProviderProps> = ({\n children,\n overrideConfig = {},\n}) => {\n // We include overrideConfig in the dependency array so if the prop\n // changes, the configuration updates accordingly.\n const value = useMemo(\n () => ({\n configOptions: getConfiguration(overrideConfig),\n }),\n [overrideConfig]\n );\n\n return (\n <AppConfigurationContext.Provider value={value}>{children}</AppConfigurationContext.Provider>\n );\n};\n\nexport { AppConfigurationProvider };\n\nexport const useConfig = () => {\n const ctx = useContext(AppConfigurationContext);\n if (!ctx) {\n throw new Error('useConfig must be used within AppConfigurationProvider');\n }\n return ctx;\n};\n"],"mappings":";;;;;;AAiBA,IAAM,kBAAqC;CACzC,cAAcA,eAAAA;CACd,aAAa;EAAC;EAAQ;EAAQ;EAAO;CAAK;CAC1C,OAAO;CACP,MAAM;CACN,OAAO,CAAC;CACR,OAAO;CACP,YAAY;CACZ,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,qBAAqB;CACrB,wBAAwB;CACxB,aAAa;CACb,wBAAwB;CACxB,OAAO;AACT;;;;AAKA,SAAS,iBAAiB,YAAwC,CAAC,GAAsB;CACvF,MAAM,gBAAgB,QAAQ,mCAAmC,CAAC;CAElE,MAAM,kBAAkB;EACtB,GAAG;EACH,GAAG;EACH,GAAG;EACH,OAAO;GACL,GAAG,gBAAgB;GACnB,GAAG,cAAc;GACjB,GAAG,UAAU;EACf;CACF;CAGA,IAAI,CAAC,gBAAgB,cACnB,gBAAgB,eAAeA,eAAAA;CAGjC,OAAO;AACT;AAEA,IAAM,2BAAA,GAA0BC,MAAAA,cAAAA,CAA+C,KAAA,CAAS;AAExF,IAAM,4BAA8E,EAClF,UACA,iBAAiB,CAAC,QACd;CAGJ,MAAM,SAAA,GAAQC,MAAAA,QAAAA,QACL,EACL,eAAe,iBAAiB,cAAc,EAChD,IACA,CAAC,cAAc,CACjB;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAwB,UAAzB;EAAyC;EAAQ;CAA2C,CAAA;AAEhG;AAIA,IAAa,kBAAkB;CAC7B,MAAM,OAAA,GAAMC,MAAAA,WAAAA,CAAW,uBAAuB;CAC9C,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,wDAAwD;CAE1E,OAAO;AACT"}
|
|
@@ -7,7 +7,8 @@ var DEFAULT_OPTIONS = {
|
|
|
7
7
|
pkgManagers: [
|
|
8
8
|
"yarn",
|
|
9
9
|
"pnpm",
|
|
10
|
-
"npm"
|
|
10
|
+
"npm",
|
|
11
|
+
"bun"
|
|
11
12
|
],
|
|
12
13
|
scope: "",
|
|
13
14
|
base: "",
|
|
@@ -21,6 +22,7 @@ var DEFAULT_OPTIONS = {
|
|
|
21
22
|
showSearch: true,
|
|
22
23
|
showRaw: true,
|
|
23
24
|
showDownloadTarball: true,
|
|
25
|
+
showPackageListToolbar: true,
|
|
24
26
|
showUplinks: true,
|
|
25
27
|
hideDeprecatedVersions: false,
|
|
26
28
|
title: "Verdaccio"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfigurationProvider.mjs","names":[],"sources":["../../../src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport type { TemplateUIOptions } from '@verdaccio/types';\n\nimport { PRIMARY_COLOR } from '../../Theme/colors';\n\ntype ConfigProviderProps = {\n configOptions: TemplateUIOptions;\n};\n\ninterface AppConfigurationProviderProps {\n children: ReactNode;\n // Allows passing overrides like { flags: { myFlag: true } }\n overrideConfig?: Partial<TemplateUIOptions>;\n}\n\nconst DEFAULT_OPTIONS: TemplateUIOptions = {\n primaryColor: PRIMARY_COLOR,\n pkgManagers: ['yarn', 'pnpm', 'npm'],\n scope: '',\n base: '',\n flags: {},\n login: true,\n url_prefix: '',\n showInfo: true,\n showSettings: true,\n showThemeSwitch: true,\n showFooter: true,\n showSearch: true,\n showRaw: true,\n showDownloadTarball: true,\n showUplinks: true,\n hideDeprecatedVersions: false,\n title: 'Verdaccio',\n};\n\n/**\n * Merges defaults, window globals, and optional local overrides.\n */\nfunction getConfiguration(overrides: Partial<TemplateUIOptions> = {}): TemplateUIOptions {\n const windowOptions = window?.__VERDACCIO_BASENAME_UI_OPTIONS || {};\n\n const uiConfiguration = {\n ...DEFAULT_OPTIONS,\n ...windowOptions,\n ...overrides,\n flags: {\n ...DEFAULT_OPTIONS.flags,\n ...windowOptions.flags,\n ...overrides.flags,\n },\n };\n\n // Logic cleanup: Ensure primaryColor is never empty/null\n if (!uiConfiguration.primaryColor) {\n uiConfiguration.primaryColor = PRIMARY_COLOR;\n }\n\n return uiConfiguration;\n}\n\nconst AppConfigurationContext = createContext<ConfigProviderProps | undefined>(undefined);\n\nconst AppConfigurationProvider: FunctionComponent<AppConfigurationProviderProps> = ({\n children,\n overrideConfig = {},\n}) => {\n // We include overrideConfig in the dependency array so if the prop\n // changes, the configuration updates accordingly.\n const value = useMemo(\n () => ({\n configOptions: getConfiguration(overrideConfig),\n }),\n [overrideConfig]\n );\n\n return (\n <AppConfigurationContext.Provider value={value}>{children}</AppConfigurationContext.Provider>\n );\n};\n\nexport { AppConfigurationProvider };\n\nexport const useConfig = () => {\n const ctx = useContext(AppConfigurationContext);\n if (!ctx) {\n throw new Error('useConfig must be used within AppConfigurationProvider');\n }\n return ctx;\n};\n"],"mappings":";;;;AAiBA,IAAM,kBAAqC;CACzC,cAAc;CACd,aAAa;EAAC;EAAQ;EAAQ;CAAK;
|
|
1
|
+
{"version":3,"file":"AppConfigurationProvider.mjs","names":[],"sources":["../../../src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx"],"sourcesContent":["import type { FunctionComponent, ReactNode } from 'react';\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport type { TemplateUIOptions } from '@verdaccio/types';\n\nimport { PRIMARY_COLOR } from '../../Theme/colors';\n\ntype ConfigProviderProps = {\n configOptions: TemplateUIOptions;\n};\n\ninterface AppConfigurationProviderProps {\n children: ReactNode;\n // Allows passing overrides like { flags: { myFlag: true } }\n overrideConfig?: Partial<TemplateUIOptions>;\n}\n\nconst DEFAULT_OPTIONS: TemplateUIOptions = {\n primaryColor: PRIMARY_COLOR,\n pkgManagers: ['yarn', 'pnpm', 'npm', 'bun'],\n scope: '',\n base: '',\n flags: {},\n login: true,\n url_prefix: '',\n showInfo: true,\n showSettings: true,\n showThemeSwitch: true,\n showFooter: true,\n showSearch: true,\n showRaw: true,\n showDownloadTarball: true,\n showPackageListToolbar: true,\n showUplinks: true,\n hideDeprecatedVersions: false,\n title: 'Verdaccio',\n};\n\n/**\n * Merges defaults, window globals, and optional local overrides.\n */\nfunction getConfiguration(overrides: Partial<TemplateUIOptions> = {}): TemplateUIOptions {\n const windowOptions = window?.__VERDACCIO_BASENAME_UI_OPTIONS || {};\n\n const uiConfiguration = {\n ...DEFAULT_OPTIONS,\n ...windowOptions,\n ...overrides,\n flags: {\n ...DEFAULT_OPTIONS.flags,\n ...windowOptions.flags,\n ...overrides.flags,\n },\n };\n\n // Logic cleanup: Ensure primaryColor is never empty/null\n if (!uiConfiguration.primaryColor) {\n uiConfiguration.primaryColor = PRIMARY_COLOR;\n }\n\n return uiConfiguration;\n}\n\nconst AppConfigurationContext = createContext<ConfigProviderProps | undefined>(undefined);\n\nconst AppConfigurationProvider: FunctionComponent<AppConfigurationProviderProps> = ({\n children,\n overrideConfig = {},\n}) => {\n // We include overrideConfig in the dependency array so if the prop\n // changes, the configuration updates accordingly.\n const value = useMemo(\n () => ({\n configOptions: getConfiguration(overrideConfig),\n }),\n [overrideConfig]\n );\n\n return (\n <AppConfigurationContext.Provider value={value}>{children}</AppConfigurationContext.Provider>\n );\n};\n\nexport { AppConfigurationProvider };\n\nexport const useConfig = () => {\n const ctx = useContext(AppConfigurationContext);\n if (!ctx) {\n throw new Error('useConfig must be used within AppConfigurationProvider');\n }\n return ctx;\n};\n"],"mappings":";;;;AAiBA,IAAM,kBAAqC;CACzC,cAAc;CACd,aAAa;EAAC;EAAQ;EAAQ;EAAO;CAAK;CAC1C,OAAO;CACP,MAAM;CACN,OAAO,CAAC;CACR,OAAO;CACP,YAAY;CACZ,UAAU;CACV,cAAc;CACd,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,qBAAqB;CACrB,wBAAwB;CACxB,aAAa;CACb,wBAAwB;CACxB,OAAO;AACT;;;;AAKA,SAAS,iBAAiB,YAAwC,CAAC,GAAsB;CACvF,MAAM,gBAAgB,QAAQ,mCAAmC,CAAC;CAElE,MAAM,kBAAkB;EACtB,GAAG;EACH,GAAG;EACH,GAAG;EACH,OAAO;GACL,GAAG,gBAAgB;GACnB,GAAG,cAAc;GACjB,GAAG,UAAU;EACf;CACF;CAGA,IAAI,CAAC,gBAAgB,cACnB,gBAAgB,eAAe;CAGjC,OAAO;AACT;AAEA,IAAM,0BAA0B,cAA+C,KAAA,CAAS;AAExF,IAAM,4BAA8E,EAClF,UACA,iBAAiB,CAAC,QACd;CAGJ,MAAM,QAAQ,eACL,EACL,eAAe,iBAAiB,cAAc,EAChD,IACA,CAAC,cAAc,CACjB;CAEA,OACE,oBAAC,wBAAwB,UAAzB;EAAyC;EAAQ;CAA2C,CAAA;AAEhG;AAIA,IAAa,kBAAkB;CAC7B,MAAM,MAAM,WAAW,uBAAuB;CAC9C,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,wDAAwD;CAE1E,OAAO;AACT"}
|
|
@@ -19,8 +19,11 @@ export interface ManifestWeb extends Omit<Manifest, 'time' | 'author'> {
|
|
|
19
19
|
dist: any;
|
|
20
20
|
}
|
|
21
21
|
export declare const ManifestsContext: React.Context<Partial<ManifestsContextProps>>;
|
|
22
|
+
/** While the registry is empty the home page polls, so a first publish shows up without a reload. */
|
|
23
|
+
export declare const EMPTY_REGISTRY_REFRESH_MS = 10000;
|
|
22
24
|
declare const ManifestsProvider: React.FC<{
|
|
23
25
|
children: ReactElement;
|
|
26
|
+
emptyRefreshMs?: number;
|
|
24
27
|
}>;
|
|
25
28
|
export default ManifestsProvider;
|
|
26
29
|
export declare const useManifests: () => Partial<ManifestsContextProps>;
|
|
@@ -9,9 +9,15 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
9
9
|
//#region src/providers/ManifestsProvider/ManifestsProvider.tsx
|
|
10
10
|
var ManifestsContext = (0, react.createContext)({});
|
|
11
11
|
var configuration = require_configuration.getConfiguration();
|
|
12
|
-
|
|
12
|
+
/** While the registry is empty the home page polls, so a first publish shows up without a reload. */
|
|
13
|
+
var EMPTY_REGISTRY_REFRESH_MS = 1e4;
|
|
14
|
+
var ManifestsProvider = ({ children, emptyRefreshMs = EMPTY_REGISTRY_REFRESH_MS }) => {
|
|
13
15
|
const basePath = require_utils.stripTrailingSlash(configuration.base);
|
|
14
|
-
const
|
|
16
|
+
const [refreshInterval, setRefreshInterval] = (0, react.useState)(0);
|
|
17
|
+
const data = require_use_data.useData(basePath, require_routes.APIRoute.PACKAGES, void 0, void 0, {
|
|
18
|
+
refreshInterval,
|
|
19
|
+
onSuccess: (latest) => setRefreshInterval(Array.isArray(latest) && latest.length === 0 ? emptyRefreshMs : 0)
|
|
20
|
+
});
|
|
15
21
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ManifestsContext.Provider, {
|
|
16
22
|
value: {
|
|
17
23
|
manifests: data.data ?? [],
|
|
@@ -23,6 +29,7 @@ var ManifestsProvider = ({ children }) => {
|
|
|
23
29
|
};
|
|
24
30
|
var useManifests = () => (0, react.useContext)(ManifestsContext);
|
|
25
31
|
//#endregion
|
|
32
|
+
exports.EMPTY_REGISTRY_REFRESH_MS = EMPTY_REGISTRY_REFRESH_MS;
|
|
26
33
|
exports.ManifestsContext = ManifestsContext;
|
|
27
34
|
exports.default = ManifestsProvider;
|
|
28
35
|
exports.useManifests = useManifests;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManifestsProvider.js","names":["createContext","getConfiguration","stripTrailingSlash","useData","APIRoute","useContext"],"sources":["../../../src/providers/ManifestsProvider/ManifestsProvider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React, { createContext, useContext } from 'react';\n\nimport type { Manifest } from '@verdaccio/types';\n\nimport { useData } from '../../api/use-data';\nimport { getConfiguration } from '../../configuration';\nimport { stripTrailingSlash } from '../../store/utils';\nimport { APIRoute } from '../../utils/routes';\n\nexport interface ManifestsContextProps {\n isError: boolean;\n isLoading: boolean;\n manifests: ManifestWeb[];\n}\n\nexport interface Author {\n name?: string;\n email?: string;\n url?: string;\n avatar?: string;\n}\n\nexport interface ManifestWeb extends Omit<Manifest, 'time' | 'author'> {\n time: string;\n author: Author;\n version: string;\n dist: any;\n}\n\nexport const ManifestsContext = createContext<Partial<ManifestsContextProps>>({});\n\nconst configuration = getConfiguration();\n\nconst ManifestsProvider: React.FC<{ children: ReactElement }> = ({
|
|
1
|
+
{"version":3,"file":"ManifestsProvider.js","names":["createContext","getConfiguration","stripTrailingSlash","useState","useData","APIRoute","useContext"],"sources":["../../../src/providers/ManifestsProvider/ManifestsProvider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React, { createContext, useContext, useState } from 'react';\n\nimport type { Manifest } from '@verdaccio/types';\n\nimport { useData } from '../../api/use-data';\nimport { getConfiguration } from '../../configuration';\nimport { stripTrailingSlash } from '../../store/utils';\nimport { APIRoute } from '../../utils/routes';\n\nexport interface ManifestsContextProps {\n isError: boolean;\n isLoading: boolean;\n manifests: ManifestWeb[];\n}\n\nexport interface Author {\n name?: string;\n email?: string;\n url?: string;\n avatar?: string;\n}\n\nexport interface ManifestWeb extends Omit<Manifest, 'time' | 'author'> {\n time: string;\n author: Author;\n version: string;\n dist: any;\n}\n\nexport const ManifestsContext = createContext<Partial<ManifestsContextProps>>({});\n\nconst configuration = getConfiguration();\n\n/** While the registry is empty the home page polls, so a first publish shows up without a reload. */\nexport const EMPTY_REGISTRY_REFRESH_MS = 10_000;\n\nconst ManifestsProvider: React.FC<{ children: ReactElement; emptyRefreshMs?: number }> = ({\n children,\n emptyRefreshMs = EMPTY_REGISTRY_REFRESH_MS,\n}) => {\n const basePath = stripTrailingSlash(configuration.base);\n // a number, not SWR's function form: that one is read once at mount, before any data exists\n const [refreshInterval, setRefreshInterval] = useState(0);\n\n const data = useData<ManifestWeb[]>(basePath, APIRoute.PACKAGES, undefined, undefined, {\n refreshInterval,\n onSuccess: (latest) =>\n setRefreshInterval(Array.isArray(latest) && latest.length === 0 ? emptyRefreshMs : 0),\n });\n\n return (\n <ManifestsContext.Provider\n value={{\n manifests: (data.data as ManifestWeb[]) ?? [],\n isLoading: data.isLoading,\n // any error counts (network failures have no `.code`), but a failed\n // revalidation must not hide an already-cached, renderable list\n isError: typeof data.error !== 'undefined' && typeof data.data === 'undefined',\n }}\n >\n {children}\n </ManifestsContext.Provider>\n );\n};\n\nexport default ManifestsProvider;\n\nexport const useManifests = () => useContext(ManifestsContext);\n"],"mappings":";;;;;;;;;AA8BA,IAAa,oBAAA,GAAmBA,MAAAA,cAAAA,CAA8C,CAAC,CAAC;AAEhF,IAAM,gBAAgBC,sBAAAA,iBAAiB;;AAGvC,IAAa,4BAA4B;AAEzC,IAAM,qBAAoF,EACxF,UACA,iBAAiB,gCACb;CACJ,MAAM,WAAWC,cAAAA,mBAAmB,cAAc,IAAI;CAEtD,MAAM,CAAC,iBAAiB,uBAAA,GAAsBC,MAAAA,SAAAA,CAAS,CAAC;CAExD,MAAM,OAAOC,iBAAAA,QAAuB,UAAUC,eAAAA,SAAS,UAAU,KAAA,GAAW,KAAA,GAAW;EACrF;EACA,YAAY,WACV,mBAAmB,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,IAAI,iBAAiB,CAAC;CACxF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAiB,UAAlB;EACE,OAAO;GACL,WAAY,KAAK,QAA0B,CAAC;GAC5C,WAAW,KAAK;GAGhB,SAAS,OAAO,KAAK,UAAU,eAAe,OAAO,KAAK,SAAS;EACrE;EAEC;CACwB,CAAA;AAE/B;AAIA,IAAa,sBAAA,GAAqBC,MAAAA,WAAAA,CAAW,gBAAgB"}
|
|
@@ -2,14 +2,20 @@ import { APIRoute } from "../../utils/routes.mjs";
|
|
|
2
2
|
import { useData } from "../../api/use-data.mjs";
|
|
3
3
|
import { getConfiguration } from "../../configuration.mjs";
|
|
4
4
|
import { stripTrailingSlash } from "../../store/utils.mjs";
|
|
5
|
-
import { createContext, useContext } from "react";
|
|
5
|
+
import { createContext, useContext, useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/providers/ManifestsProvider/ManifestsProvider.tsx
|
|
8
8
|
var ManifestsContext = createContext({});
|
|
9
9
|
var configuration = getConfiguration();
|
|
10
|
-
|
|
10
|
+
/** While the registry is empty the home page polls, so a first publish shows up without a reload. */
|
|
11
|
+
var EMPTY_REGISTRY_REFRESH_MS = 1e4;
|
|
12
|
+
var ManifestsProvider = ({ children, emptyRefreshMs = EMPTY_REGISTRY_REFRESH_MS }) => {
|
|
11
13
|
const basePath = stripTrailingSlash(configuration.base);
|
|
12
|
-
const
|
|
14
|
+
const [refreshInterval, setRefreshInterval] = useState(0);
|
|
15
|
+
const data = useData(basePath, APIRoute.PACKAGES, void 0, void 0, {
|
|
16
|
+
refreshInterval,
|
|
17
|
+
onSuccess: (latest) => setRefreshInterval(Array.isArray(latest) && latest.length === 0 ? emptyRefreshMs : 0)
|
|
18
|
+
});
|
|
13
19
|
return /* @__PURE__ */ jsx(ManifestsContext.Provider, {
|
|
14
20
|
value: {
|
|
15
21
|
manifests: data.data ?? [],
|
|
@@ -21,6 +27,6 @@ var ManifestsProvider = ({ children }) => {
|
|
|
21
27
|
};
|
|
22
28
|
var useManifests = () => useContext(ManifestsContext);
|
|
23
29
|
//#endregion
|
|
24
|
-
export { ManifestsContext, ManifestsProvider as default, useManifests };
|
|
30
|
+
export { EMPTY_REGISTRY_REFRESH_MS, ManifestsContext, ManifestsProvider as default, useManifests };
|
|
25
31
|
|
|
26
32
|
//# sourceMappingURL=ManifestsProvider.mjs.map
|