@verdaccio/ui-components 5.0.0-next-9.7 → 5.0.0-next-9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Theme/ResetStyles.d.ts +1 -1
- package/build/Theme/StyleBaseline.d.ts +1 -2
- package/build/Theme/ThemeProvider.d.ts +1 -1
- package/build/Theme/modes.d.ts +13 -1
- package/build/Theme/modes.js +18 -3
- package/build/Theme/modes.js.map +1 -1
- package/build/Theme/modes.mjs +16 -2
- package/build/Theme/modes.mjs.map +1 -1
- package/build/Theme/theme.d.ts +27 -3
- package/build/Theme/theme.js.map +1 -1
- package/build/Theme/theme.mjs.map +1 -1
- package/build/api/use-data-mutation.d.ts +3 -3
- package/build/api/use-data.d.ts +2 -2
- package/build/components/ActionBar/ActionBar.d.ts +1 -1
- package/build/components/ActionBar/ActionBarAction.d.ts +7 -2
- package/build/components/AppRoute/AppRoute.d.ts +1 -1
- package/build/components/Author/Author.d.ts +1 -1
- package/build/components/Author/styles.d.ts +9 -2
- package/build/components/CopyClipboard/CopyToClipBoard.d.ts +1 -1
- package/build/components/CopyClipboard/utils.d.ts +1 -1
- package/build/components/Dependencies/Dependencies.d.ts +1 -1
- package/build/components/Dependencies/DependencyBlock.d.ts +15 -7
- package/build/components/Dependencies/DependencyBlock.mjs +2 -2
- package/build/components/Dependencies/DependencyBlock.mjs.map +1 -1
- package/build/components/Dependencies/index.js +1 -1
- package/build/components/Dependencies/types.d.ts +1 -1
- package/build/components/Deprecated/Deprecated.d.ts +1 -1
- package/build/components/Developers/Developers.d.ts +8 -3
- package/build/components/Developers/Title.d.ts +1 -1
- package/build/components/Developers/Title.mjs +2 -2
- package/build/components/Developers/Title.mjs.map +1 -1
- package/build/components/Developers/get-unique-developer-values.d.ts +1 -1
- package/build/components/Distribution/Dist.d.ts +2 -2
- package/build/components/Distribution/styles.d.ts +12 -3
- package/build/components/Distribution/styles.mjs +2 -2
- package/build/components/Distribution/styles.mjs.map +1 -1
- package/build/components/Engines/Engines.d.ts +2 -2
- package/build/components/Engines/styles.d.ts +9 -2
- package/build/components/Engines/styles.mjs +2 -2
- package/build/components/Engines/styles.mjs.map +1 -1
- package/build/components/ErrorBoundary/ErrorBoundary.d.ts +2 -3
- package/build/components/Forbidden/Forbidden.d.ts +1 -1
- package/build/components/FundButton/FundButton.d.ts +1 -1
- package/build/components/FundButton/FundButton.js +1 -1
- package/build/components/FundButton/FundButton.js.map +1 -1
- package/build/components/FundButton/FundButton.mjs +1 -1
- package/build/components/FundButton/FundButton.mjs.map +1 -1
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.d.ts +1 -1
- package/build/components/Heading/Heading.d.ts +2 -2
- package/build/components/Heading/Heading.mjs +2 -2
- package/build/components/Heading/Heading.mjs.map +1 -1
- package/build/components/Help/Help.d.ts +1 -1
- package/build/components/Help/Help.mjs +3 -3
- package/build/components/Help/Help.mjs.map +1 -1
- package/build/components/Help/styles.d.ts +3 -1
- package/build/components/Icons/DevsIcons/CommonJS.d.ts +1 -1
- package/build/components/Icons/DevsIcons/ES6Module.d.ts +1 -1
- package/build/components/Icons/DevsIcons/Git.d.ts +1 -1
- package/build/components/Icons/DevsIcons/NodeJS.d.ts +1 -1
- package/build/components/Icons/DevsIcons/TypeScript.d.ts +1 -1
- package/build/components/Icons/DevsIcons/commonjs.svg +4 -0
- package/build/components/Icons/DevsIcons/es6module.svg +4 -0
- package/build/components/Icons/DevsIcons/git.svg +4 -0
- package/build/components/Icons/DevsIcons/nodejs.svg +6 -0
- package/build/components/Icons/DevsIcons/typescript.svg +4 -0
- package/build/components/Icons/Earth.d.ts +1 -1
- package/build/components/Icons/FileBinary.d.ts +1 -1
- package/build/components/Icons/Law.d.ts +1 -1
- package/build/components/Icons/License.d.ts +1 -1
- package/build/components/Icons/Managers/Npm.d.ts +1 -1
- package/build/components/Icons/Managers/Pnpm.d.ts +1 -1
- package/build/components/Icons/Managers/Yarn.d.ts +1 -1
- package/build/components/Icons/Managers/npm.svg +15 -0
- package/build/components/Icons/Managers/pnpm.svg +1 -0
- package/build/components/Icons/Managers/yarn.svg +1 -0
- package/build/components/Icons/SvgIcon.d.ts +2 -2
- package/build/components/Icons/Time.d.ts +1 -1
- package/build/components/Icons/Version.d.ts +1 -1
- package/build/components/Install/Install.d.ts +3 -3
- package/build/components/Install/InstallListItem.d.ts +1 -1
- package/build/components/Install/InstallListItem.mjs +2 -2
- package/build/components/Install/InstallListItem.mjs.map +1 -1
- package/build/components/Keywords/KeywordListItems.d.ts +1 -1
- package/build/components/Keywords/Keywords.d.ts +2 -2
- package/build/components/Keywords/Keywords.mjs +2 -2
- package/build/components/Keywords/Keywords.mjs.map +1 -1
- package/build/components/Label/Label.d.ts +2 -2
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.mjs +2 -2
- package/build/components/Link/Link.mjs.map +1 -1
- package/build/components/LinkExternal/LinkExternal.d.ts +1 -1
- package/build/components/Loading/Loading.d.ts +1 -1
- package/build/components/Loading/Spinner/Spinner.d.ts +1 -1
- package/build/components/Loading/styles.d.ts +7 -7
- package/build/components/LoginDialog/LoginDialog.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.js +2 -2
- package/build/components/LoginDialog/LoginDialogCloseButton.js.map +1 -1
- package/build/components/LoginDialog/LoginDialogCloseButton.mjs +2 -2
- package/build/components/LoginDialog/LoginDialogCloseButton.mjs.map +1 -1
- package/build/components/LoginDialog/LoginDialogForm.d.ts +1 -1
- package/build/components/LoginDialog/LoginDialogFormError.d.ts +1 -1
- package/build/components/LoginForm/Login.d.ts +2 -2
- package/build/components/LoginForm/Login.mjs +2 -2
- package/build/components/LoginForm/Login.mjs.map +1 -1
- package/build/components/LoginForm/PasswordField.d.ts +3 -3
- package/build/components/LoginForm/UsernameField.d.ts +3 -3
- package/build/components/LoginForm/styles.d.ts +1 -1
- package/build/components/LoginForm/styles.js +2 -2
- package/build/components/LoginForm/styles.js.map +1 -1
- package/build/components/LoginForm/styles.mjs +2 -2
- package/build/components/LoginForm/styles.mjs.map +1 -1
- package/build/components/LoginForm/useLoginForm.d.ts +17 -17
- package/build/components/Logo/Logo.d.ts +1 -1
- package/build/components/Logo/img/logo-black-and-white.svg +1 -0
- package/build/components/Logo/img/logo.svg +1 -0
- package/build/components/MenuItem/MenuItem.d.ts +2 -2
- package/build/components/NoItems/NoItems.d.ts +1 -1
- package/build/components/NoItems/NoItems.mjs +2 -2
- package/build/components/NoItems/NoItems.mjs.map +1 -1
- package/build/components/NotFound/NotFound.d.ts +1 -1
- package/build/components/NotFound/img/package.svg +1 -0
- package/build/components/Package/Package.d.ts +3 -3
- package/build/components/Package/Package.js.map +1 -1
- package/build/components/Package/Package.mjs.map +1 -1
- package/build/components/Package/styles.d.ts +39 -29
- package/build/components/Package/styles.mjs +2 -2
- package/build/components/Package/styles.mjs.map +1 -1
- package/build/components/PackageList/PackageList.d.ts +2 -2
- package/build/components/Person/Person.d.ts +2 -2
- package/build/components/Person/PersonTooltip.d.ts +2 -2
- package/build/components/Person/PersonTooltip.mjs +2 -2
- package/build/components/Person/PersonTooltip.mjs.map +1 -1
- package/build/components/Person/utils.d.ts +1 -1
- package/build/components/RawViewer/RawViewer.d.ts +1 -1
- package/build/components/Readme/Readme.d.ts +2 -5
- package/build/components/Readme/Readme.js +6 -6
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.mjs +6 -6
- package/build/components/Readme/Readme.mjs.map +1 -1
- package/build/components/Readme/github-markdown.css +1654 -0
- package/build/components/Readme/hljs-github-dark.css +117 -0
- package/build/components/Readme/hljs-github-light.css +117 -0
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.d.ts +2 -2
- package/build/components/RegistryInfoDialog/styles.d.ts +11 -7
- package/build/components/RegistryInfoDialog/types.d.ts +1 -1
- package/build/components/Repository/Repository.d.ts +1 -1
- package/build/components/Repository/Repository.mjs +4 -4
- package/build/components/Repository/Repository.mjs.map +1 -1
- package/build/components/Search/AutoComplete/AutoComplete.d.ts +2 -3
- package/build/components/Search/AutoComplete/styles.d.ts +3 -3
- package/build/components/Search/Search.d.ts +1 -1
- package/build/components/Search/Search.js +15 -30
- package/build/components/Search/Search.js.map +1 -1
- package/build/components/Search/Search.mjs +15 -30
- package/build/components/Search/Search.mjs.map +1 -1
- package/build/components/Search/SearchItem.d.ts +4 -4
- package/build/components/Search/styles.d.ts +10 -6
- package/build/components/Search/utils.d.ts +21 -0
- package/build/components/Search/utils.js +37 -0
- package/build/components/Search/utils.js.map +1 -1
- package/build/components/Search/utils.mjs +37 -1
- package/build/components/Search/utils.mjs.map +1 -1
- package/build/components/SettingsMenu/SettingsMenu.d.ts +1 -1
- package/build/components/SideBarTitle/SideBarTitle.d.ts +1 -1
- package/build/components/UnAuthorized/UnAuthorized.d.ts +1 -1
- package/build/components/UpLinks/UpLinks.d.ts +1 -1
- package/build/components/UpLinks/UplinkLink.d.ts +1 -1
- package/build/components/UpLinks/index.js +1 -1
- package/build/components/UpLinks/styles.d.ts +11 -7
- package/build/components/UpLinks/styles.mjs +5 -5
- package/build/components/UpLinks/styles.mjs.map +1 -1
- package/build/components/Versions/HistoryList.d.ts +2 -2
- package/build/components/Versions/TagList.d.ts +2 -2
- package/build/components/Versions/Versions.d.ts +7 -2
- package/build/components/Versions/Versions.mjs +2 -2
- package/build/components/Versions/Versions.mjs.map +1 -1
- package/build/components/Versions/index.js +1 -1
- package/build/components/Versions/styles.d.ts +6 -6
- package/build/components/Versions/styles.mjs +3 -3
- package/build/components/Versions/styles.mjs.map +1 -1
- package/build/components/Versions/types.d.ts +1 -1
- package/build/configuration.d.ts +1 -1
- package/build/hooks/useOnClickOutside.d.ts +1 -1
- package/build/index.d.ts +0 -3
- package/build/index.js +59 -62
- package/build/index.mjs +2 -6
- package/build/layouts/Security/Dialog.d.ts +1 -1
- package/build/layouts/Version/Version.d.ts +1 -1
- package/build/pages/Front/index.js +1 -1
- package/build/pages/Version/Version.d.ts +1 -1
- package/build/pages/Version/index.js +1 -1
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.d.ts +2 -2
- package/build/providers/AuthProvider/AuthProvider.d.ts +2 -3
- package/build/providers/AuthProvider/types.d.ts +1 -1
- package/build/providers/AuthProvider/utils.d.ts +1 -1
- package/build/providers/DownloadProvider/DownloadProvider.d.ts +1 -2
- package/build/providers/ManifestsProvider/ManifestsProvider.d.ts +2 -3
- package/build/providers/ManifestsProvider/README.md +22 -0
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +1 -2
- package/build/providers/SearchProvider/SearchProvider.d.ts +2 -3
- package/build/providers/TranslatorProvider/TranslatorProvider.d.ts +2 -3
- package/build/providers/VersionProvider/README.md +22 -0
- package/build/providers/VersionProvider/VersionProvider.d.ts +2 -2
- package/build/routes/SecurityRoutes.d.ts +1 -1
- package/build/sections/Detail/ContainerContent.d.ts +1 -1
- package/build/sections/Detail/Detail.d.ts +1 -1
- package/build/sections/Detail/ReadmeSection.d.ts +1 -1
- package/build/sections/Detail/Tabs.d.ts +1 -1
- package/build/sections/Footer/Footer.d.ts +1 -1
- package/build/sections/Footer/styles.d.ts +17 -17
- package/build/sections/Header/Header.d.ts +1 -1
- package/build/sections/Header/HeaderGreetings.d.ts +1 -1
- package/build/sections/Header/HeaderLeft.d.ts +1 -1
- package/build/sections/Header/HeaderMenu.d.ts +1 -2
- package/build/sections/Header/HeaderMenu.js +10 -11
- package/build/sections/Header/HeaderMenu.js.map +1 -1
- package/build/sections/Header/HeaderMenu.mjs +10 -11
- package/build/sections/Header/HeaderMenu.mjs.map +1 -1
- package/build/sections/Header/HeaderRight.d.ts +1 -1
- package/build/sections/Header/HeaderSettingsDialog.d.ts +1 -1
- package/build/sections/Header/HeaderToolTip.d.ts +2 -2
- package/build/sections/Header/HeaderToolTipIcon.d.ts +1 -1
- package/build/sections/Header/LanguageSwitch.d.ts +12 -3
- package/build/sections/Header/LanguageSwitch.mjs +2 -2
- package/build/sections/Header/LanguageSwitch.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.d.ts +7 -8
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs +5 -5
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.mjs.map +1 -1
- package/build/sections/Header/RegistryInfoContent/styles.d.ts +7 -7
- package/build/sections/Header/styles.d.ts +33 -19
- package/build/sections/Home/Home.d.ts +1 -1
- package/build/sections/Security/AddUser.d.ts +1 -1
- package/build/sections/Security/AddUser.js +0 -1
- package/build/sections/Security/AddUser.js.map +1 -1
- package/build/sections/Security/AddUser.mjs +0 -1
- package/build/sections/Security/AddUser.mjs.map +1 -1
- package/build/sections/Security/ChangePassword.d.ts +1 -1
- package/build/sections/Security/ChangePassword.js +0 -1
- package/build/sections/Security/ChangePassword.js.map +1 -1
- package/build/sections/Security/ChangePassword.mjs +0 -1
- package/build/sections/Security/ChangePassword.mjs.map +1 -1
- package/build/sections/Security/Login.d.ts +1 -1
- package/build/sections/Security/Success.d.ts +1 -1
- package/build/sections/Security/styles.d.ts +5 -3
- package/build/sections/Security/styles.js +1 -1
- package/build/sections/Security/styles.js.map +1 -1
- package/build/sections/Security/styles.mjs +1 -1
- package/build/sections/Security/styles.mjs.map +1 -1
- package/build/sections/SideBar/Sidebar.d.ts +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/packageMeta.d.ts +1 -1
- package/build/ui-components.css +1024 -334
- package/build/utils/cli-utils.d.ts +1 -1
- package/build/utils/loadable.d.ts +1 -1
- package/build/utils/utils.d.ts +2 -2
- package/package.json +5 -8
- package/build/pages/Security/index.js +0 -4
- package/build/pages/Security/index.mjs +0 -4
- package/build/test/i18n-config.d.ts +0 -2
- package/build/test/test-react-testing-library.d.ts +0 -23
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[data-theme='dark'] pre code.hljs {
|
|
2
|
+
display: block;
|
|
3
|
+
overflow-x: auto;
|
|
4
|
+
padding: 1em;
|
|
5
|
+
}
|
|
6
|
+
[data-theme='dark'] code.hljs {
|
|
7
|
+
padding: 3px 5px;
|
|
8
|
+
}
|
|
9
|
+
/*!
|
|
10
|
+
Theme: GitHub Dark
|
|
11
|
+
Description: Dark theme as seen on github.com
|
|
12
|
+
Author: github.com
|
|
13
|
+
Maintainer: @Hirse
|
|
14
|
+
Updated: 2021-05-15
|
|
15
|
+
|
|
16
|
+
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
17
|
+
Current colors taken from GitHub's CSS
|
|
18
|
+
*/
|
|
19
|
+
[data-theme='dark'] .hljs {
|
|
20
|
+
color: #c9d1d9;
|
|
21
|
+
background: #0d1117;
|
|
22
|
+
}
|
|
23
|
+
[data-theme='dark'] .hljs-doctag,
|
|
24
|
+
[data-theme='dark'] .hljs-keyword,
|
|
25
|
+
[data-theme='dark'] .hljs-meta .hljs-keyword,
|
|
26
|
+
[data-theme='dark'] .hljs-template-tag,
|
|
27
|
+
[data-theme='dark'] .hljs-template-variable,
|
|
28
|
+
[data-theme='dark'] .hljs-type,
|
|
29
|
+
[data-theme='dark'] .hljs-variable.language_ {
|
|
30
|
+
/* prettylights-syntax-keyword */
|
|
31
|
+
color: #ff7b72;
|
|
32
|
+
}
|
|
33
|
+
[data-theme='dark'] .hljs-title,
|
|
34
|
+
[data-theme='dark'] .hljs-title.class_,
|
|
35
|
+
[data-theme='dark'] .hljs-title.class_.inherited__,
|
|
36
|
+
[data-theme='dark'] .hljs-title.function_ {
|
|
37
|
+
/* prettylights-syntax-entity */
|
|
38
|
+
color: #d2a8ff;
|
|
39
|
+
}
|
|
40
|
+
[data-theme='dark'] .hljs-attr,
|
|
41
|
+
[data-theme='dark'] .hljs-attribute,
|
|
42
|
+
[data-theme='dark'] .hljs-literal,
|
|
43
|
+
[data-theme='dark'] .hljs-meta,
|
|
44
|
+
[data-theme='dark'] .hljs-number,
|
|
45
|
+
[data-theme='dark'] .hljs-operator,
|
|
46
|
+
[data-theme='dark'] .hljs-variable,
|
|
47
|
+
[data-theme='dark'] .hljs-selector-attr,
|
|
48
|
+
[data-theme='dark'] .hljs-selector-class,
|
|
49
|
+
[data-theme='dark'] .hljs-selector-id {
|
|
50
|
+
/* prettylights-syntax-constant */
|
|
51
|
+
color: #79c0ff;
|
|
52
|
+
}
|
|
53
|
+
[data-theme='dark'] .hljs-regexp,
|
|
54
|
+
[data-theme='dark'] .hljs-string,
|
|
55
|
+
[data-theme='dark'] .hljs-meta .hljs-string {
|
|
56
|
+
/* prettylights-syntax-string */
|
|
57
|
+
color: #a5d6ff;
|
|
58
|
+
}
|
|
59
|
+
[data-theme='dark'] .hljs-built_in,
|
|
60
|
+
[data-theme='dark'] .hljs-symbol {
|
|
61
|
+
/* prettylights-syntax-variable */
|
|
62
|
+
color: #ffa657;
|
|
63
|
+
}
|
|
64
|
+
[data-theme='dark'] .hljs-comment,
|
|
65
|
+
[data-theme='dark'] .hljs-code,
|
|
66
|
+
[data-theme='dark'] .hljs-formula {
|
|
67
|
+
/* prettylights-syntax-comment */
|
|
68
|
+
color: #8b949e;
|
|
69
|
+
}
|
|
70
|
+
[data-theme='dark'] .hljs-name,
|
|
71
|
+
[data-theme='dark'] .hljs-quote,
|
|
72
|
+
[data-theme='dark'] .hljs-selector-tag,
|
|
73
|
+
[data-theme='dark'] .hljs-selector-pseudo {
|
|
74
|
+
/* prettylights-syntax-entity-tag */
|
|
75
|
+
color: #7ee787;
|
|
76
|
+
}
|
|
77
|
+
[data-theme='dark'] .hljs-subst {
|
|
78
|
+
/* prettylights-syntax-storage-modifier-import */
|
|
79
|
+
color: #c9d1d9;
|
|
80
|
+
}
|
|
81
|
+
[data-theme='dark'] .hljs-section {
|
|
82
|
+
/* prettylights-syntax-markup-heading */
|
|
83
|
+
color: #1f6feb;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
}
|
|
86
|
+
[data-theme='dark'] .hljs-bullet {
|
|
87
|
+
/* prettylights-syntax-markup-list */
|
|
88
|
+
color: #f2cc60;
|
|
89
|
+
}
|
|
90
|
+
[data-theme='dark'] .hljs-emphasis {
|
|
91
|
+
/* prettylights-syntax-markup-italic */
|
|
92
|
+
color: #c9d1d9;
|
|
93
|
+
font-style: italic;
|
|
94
|
+
}
|
|
95
|
+
[data-theme='dark'] .hljs-strong {
|
|
96
|
+
/* prettylights-syntax-markup-bold */
|
|
97
|
+
color: #c9d1d9;
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
}
|
|
100
|
+
[data-theme='dark'] .hljs-addition {
|
|
101
|
+
/* prettylights-syntax-markup-inserted */
|
|
102
|
+
color: #aff5b4;
|
|
103
|
+
background-color: #033a16;
|
|
104
|
+
}
|
|
105
|
+
[data-theme='dark'] .hljs-deletion {
|
|
106
|
+
/* prettylights-syntax-markup-deleted */
|
|
107
|
+
color: #ffdcd7;
|
|
108
|
+
background-color: #67060c;
|
|
109
|
+
}
|
|
110
|
+
[data-theme='dark'] .hljs-char.escape_,
|
|
111
|
+
[data-theme='dark'] .hljs-link,
|
|
112
|
+
[data-theme='dark'] .hljs-params,
|
|
113
|
+
[data-theme='dark'] .hljs-property,
|
|
114
|
+
[data-theme='dark'] .hljs-punctuation,
|
|
115
|
+
[data-theme='dark'] .hljs-tag {
|
|
116
|
+
/* purposely ignored */
|
|
117
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[data-theme='light'] pre code.hljs {
|
|
2
|
+
display: block;
|
|
3
|
+
overflow-x: auto;
|
|
4
|
+
padding: 1em;
|
|
5
|
+
}
|
|
6
|
+
[data-theme='light'] code.hljs {
|
|
7
|
+
padding: 3px 5px;
|
|
8
|
+
}
|
|
9
|
+
/*!
|
|
10
|
+
Theme: GitHub
|
|
11
|
+
Description: Light theme as seen on github.com
|
|
12
|
+
Author: github.com
|
|
13
|
+
Maintainer: @Hirse
|
|
14
|
+
Updated: 2021-05-15
|
|
15
|
+
|
|
16
|
+
Outdated base version: https://github.com/primer/github-syntax-light
|
|
17
|
+
Current colors taken from GitHub's CSS
|
|
18
|
+
*/
|
|
19
|
+
[data-theme='light'] .hljs {
|
|
20
|
+
color: #24292e;
|
|
21
|
+
background: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
[data-theme='light'] .hljs-doctag,
|
|
24
|
+
[data-theme='light'] .hljs-keyword,
|
|
25
|
+
[data-theme='light'] .hljs-meta .hljs-keyword,
|
|
26
|
+
[data-theme='light'] .hljs-template-tag,
|
|
27
|
+
[data-theme='light'] .hljs-template-variable,
|
|
28
|
+
[data-theme='light'] .hljs-type,
|
|
29
|
+
[data-theme='light'] .hljs-variable.language_ {
|
|
30
|
+
/* prettylights-syntax-keyword */
|
|
31
|
+
color: #d73a49;
|
|
32
|
+
}
|
|
33
|
+
[data-theme='light'] .hljs-title,
|
|
34
|
+
[data-theme='light'] .hljs-title.class_,
|
|
35
|
+
[data-theme='light'] .hljs-title.class_.inherited__,
|
|
36
|
+
[data-theme='light'] .hljs-title.function_ {
|
|
37
|
+
/* prettylights-syntax-entity */
|
|
38
|
+
color: #6f42c1;
|
|
39
|
+
}
|
|
40
|
+
[data-theme='light'] .hljs-attr,
|
|
41
|
+
[data-theme='light'] .hljs-attribute,
|
|
42
|
+
[data-theme='light'] .hljs-literal,
|
|
43
|
+
[data-theme='light'] .hljs-meta,
|
|
44
|
+
[data-theme='light'] .hljs-number,
|
|
45
|
+
[data-theme='light'] .hljs-operator,
|
|
46
|
+
[data-theme='light'] .hljs-variable,
|
|
47
|
+
[data-theme='light'] .hljs-selector-attr,
|
|
48
|
+
[data-theme='light'] .hljs-selector-class,
|
|
49
|
+
[data-theme='light'] .hljs-selector-id {
|
|
50
|
+
/* prettylights-syntax-constant */
|
|
51
|
+
color: #0064d6;
|
|
52
|
+
}
|
|
53
|
+
[data-theme='light'] .hljs-regexp,
|
|
54
|
+
[data-theme='light'] .hljs-string,
|
|
55
|
+
[data-theme='light'] .hljs-meta .hljs-string {
|
|
56
|
+
/* prettylights-syntax-string */
|
|
57
|
+
color: #032f62;
|
|
58
|
+
}
|
|
59
|
+
[data-theme='light'] .hljs-built_in,
|
|
60
|
+
[data-theme='light'] .hljs-symbol {
|
|
61
|
+
/* prettylights-syntax-variable */
|
|
62
|
+
color: #e36209;
|
|
63
|
+
}
|
|
64
|
+
[data-theme='light'] .hljs-comment,
|
|
65
|
+
[data-theme='light'] .hljs-code,
|
|
66
|
+
[data-theme='light'] .hljs-formula {
|
|
67
|
+
/* prettylights-syntax-comment */
|
|
68
|
+
color: #6a737d;
|
|
69
|
+
}
|
|
70
|
+
[data-theme='light'] .hljs-name,
|
|
71
|
+
[data-theme='light'] .hljs-quote,
|
|
72
|
+
[data-theme='light'] .hljs-selector-tag,
|
|
73
|
+
[data-theme='light'] .hljs-selector-pseudo {
|
|
74
|
+
/* prettylights-syntax-entity-tag */
|
|
75
|
+
color: #22863a;
|
|
76
|
+
}
|
|
77
|
+
[data-theme='light'] .hljs-subst {
|
|
78
|
+
/* prettylights-syntax-storage-modifier-import */
|
|
79
|
+
color: #24292e;
|
|
80
|
+
}
|
|
81
|
+
[data-theme='light'] .hljs-section {
|
|
82
|
+
/* prettylights-syntax-markup-heading */
|
|
83
|
+
color: #005cc5;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
}
|
|
86
|
+
[data-theme='light'] .hljs-bullet {
|
|
87
|
+
/* prettylights-syntax-markup-list */
|
|
88
|
+
color: #735c0f;
|
|
89
|
+
}
|
|
90
|
+
[data-theme='light'] .hljs-emphasis {
|
|
91
|
+
/* prettylights-syntax-markup-italic */
|
|
92
|
+
color: #24292e;
|
|
93
|
+
font-style: italic;
|
|
94
|
+
}
|
|
95
|
+
[data-theme='light'] .hljs-strong {
|
|
96
|
+
/* prettylights-syntax-markup-bold */
|
|
97
|
+
color: #24292e;
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
}
|
|
100
|
+
[data-theme='light'] .hljs-addition {
|
|
101
|
+
/* prettylights-syntax-markup-inserted */
|
|
102
|
+
color: #22863a;
|
|
103
|
+
background-color: #f0fff4;
|
|
104
|
+
}
|
|
105
|
+
[data-theme='light'] .hljs-deletion {
|
|
106
|
+
/* prettylights-syntax-markup-deleted */
|
|
107
|
+
color: #b31d28;
|
|
108
|
+
background-color: #ffeef0;
|
|
109
|
+
}
|
|
110
|
+
[data-theme='light'] .hljs-char.escape_,
|
|
111
|
+
[data-theme='light'] .hljs-link,
|
|
112
|
+
[data-theme='light'] .hljs-params,
|
|
113
|
+
[data-theme='light'] .hljs-property,
|
|
114
|
+
[data-theme='light'] .hljs-punctuation,
|
|
115
|
+
[data-theme='light'] .hljs-tag {
|
|
116
|
+
/* purposely ignored */
|
|
117
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const Title: import(
|
|
3
|
-
|
|
4
|
-
theme?: import("@emotion/react").Theme;
|
|
1
|
+
import { Theme } from '../../';
|
|
2
|
+
export declare const Title: import('@emotion/styled').StyledComponent<import('@mui/material/DialogTitle').DialogTitleOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "children" | "p" | "style" | "zIndex" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "className" | "classes" | "sx" | "variant" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
3
|
+
theme?: import('@emotion/react').Theme;
|
|
5
4
|
} & {
|
|
6
5
|
theme?: Theme;
|
|
7
6
|
}, {}, {}>;
|
|
8
|
-
export declare const
|
|
9
|
-
theme?: import(
|
|
7
|
+
export declare const Content: import('@emotion/styled').StyledComponent<import('@mui/material/DialogContent').DialogContentProps & {
|
|
8
|
+
theme?: import('@emotion/react').Theme;
|
|
9
|
+
} & {
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export declare const TextContent: import('@emotion/styled').StyledComponent<{
|
|
13
|
+
theme?: import('@emotion/react').Theme;
|
|
10
14
|
as?: React.ElementType;
|
|
11
15
|
} & {
|
|
12
16
|
theme?: Theme;
|
|
13
|
-
}, import(
|
|
17
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -13,11 +13,11 @@ import { useTranslation } from "react-i18next";
|
|
|
13
13
|
import { common } from "@mui/material/colors";
|
|
14
14
|
import List from "@mui/material/List";
|
|
15
15
|
import Avatar from "@mui/material/Avatar";
|
|
16
|
-
import
|
|
16
|
+
import Typography from "@mui/material/Typography";
|
|
17
17
|
import ListItem from "@mui/material/ListItem";
|
|
18
|
-
import
|
|
18
|
+
import MuiListItemText from "@mui/material/ListItemText";
|
|
19
19
|
//#region src/components/Repository/Repository.tsx
|
|
20
|
-
var StyledText = styled(
|
|
20
|
+
var StyledText = styled(Typography)((props) => ({
|
|
21
21
|
fontWeight: props.theme.fontWeight.bold,
|
|
22
22
|
textTransform: "capitalize"
|
|
23
23
|
}));
|
|
@@ -25,7 +25,7 @@ var RepositoryListItem = styled(ListItem)({
|
|
|
25
25
|
padding: 0,
|
|
26
26
|
":hover": { backgroundColor: "transparent" }
|
|
27
27
|
});
|
|
28
|
-
var RepositoryListItemText = styled(
|
|
28
|
+
var RepositoryListItemText = styled(MuiListItemText)({
|
|
29
29
|
padding: "0 0 0 10px",
|
|
30
30
|
margin: 0
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Repository.mjs","names":[],"sources":["../../../src/components/Repository/Repository.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Avatar from '@mui/material/Avatar';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport Typography from '@mui/material/Typography';\nimport { common } from '@mui/material/colors';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport type { Theme } from '../../Theme';\nimport { url as urlUtils } from '../../utils';\nimport CopyClipboard from '../CopyClipboard';\nimport { Git } from '../Icons';\nimport LinkExternal from '../LinkExternal';\n\nconst StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nconst RepositoryListItem = styled(ListItem)({\n padding: 0,\n ':hover': {\n backgroundColor: 'transparent',\n },\n});\n\nconst RepositoryListItemText = styled(ListItemText)({\n padding: '0 0 0 10px',\n margin: 0,\n});\n\nconst RepositoryAvatar = styled(Avatar)({\n padding: 0,\n marginLeft: 0,\n backgroundColor: 'transparent',\n});\n\nconst Repository: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {\n const { t } = useTranslation();\n const url = packageMeta?.latest?.repository?.url;\n if (!url || !urlUtils.isURL(url)) {\n return null;\n }\n\n const getCorrectRepositoryURL = (): string => {\n if (!url.includes('git+')) {\n return url;\n }\n\n return url.split('git+')[1];\n };\n\n const repositoryURL = getCorrectRepositoryURL();\n\n return (\n <List\n dense={true}\n subheader={<StyledText variant=\"subtitle1\">{t('sidebar.repository.title')}</StyledText>}\n >\n <RepositoryListItem>\n <RepositoryAvatar sx={{ bgcolor: common.white }}>\n <Git />\n </RepositoryAvatar>\n <RepositoryListItemText\n primary={\n <CopyClipboard dataTestId=\"repositoryID\" text={repositoryURL} title={repositoryURL}>\n <LinkExternal to={repositoryURL} variant=\"outline\">\n {repositoryURL}\n </LinkExternal>\n </CopyClipboard>\n }\n />\n </RepositoryListItem>\n </List>\n );\n};\n\nexport default Repository;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"Repository.mjs","names":[],"sources":["../../../src/components/Repository/Repository.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport Avatar from '@mui/material/Avatar';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport Typography from '@mui/material/Typography';\nimport { common } from '@mui/material/colors';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport type { Theme } from '../../Theme';\nimport { url as urlUtils } from '../../utils';\nimport CopyClipboard from '../CopyClipboard';\nimport { Git } from '../Icons';\nimport LinkExternal from '../LinkExternal';\n\nconst StyledText = styled(Typography)<{ theme?: Theme }>((props) => ({\n fontWeight: props.theme.fontWeight.bold,\n textTransform: 'capitalize',\n}));\n\nconst RepositoryListItem = styled(ListItem)({\n padding: 0,\n ':hover': {\n backgroundColor: 'transparent',\n },\n});\n\nconst RepositoryListItemText = styled(ListItemText)({\n padding: '0 0 0 10px',\n margin: 0,\n});\n\nconst RepositoryAvatar = styled(Avatar)({\n padding: 0,\n marginLeft: 0,\n backgroundColor: 'transparent',\n});\n\nconst Repository: React.FC<{ packageMeta: any }> = ({ packageMeta }) => {\n const { t } = useTranslation();\n const url = packageMeta?.latest?.repository?.url;\n if (!url || !urlUtils.isURL(url)) {\n return null;\n }\n\n const getCorrectRepositoryURL = (): string => {\n if (!url.includes('git+')) {\n return url;\n }\n\n return url.split('git+')[1];\n };\n\n const repositoryURL = getCorrectRepositoryURL();\n\n return (\n <List\n dense={true}\n subheader={<StyledText variant=\"subtitle1\">{t('sidebar.repository.title')}</StyledText>}\n >\n <RepositoryListItem>\n <RepositoryAvatar sx={{ bgcolor: common.white }}>\n <Git />\n </RepositoryAvatar>\n <RepositoryListItemText\n primary={\n <CopyClipboard dataTestId=\"repositoryID\" text={repositoryURL} title={repositoryURL}>\n <LinkExternal to={repositoryURL} variant=\"outline\">\n {repositoryURL}\n </LinkExternal>\n </CopyClipboard>\n }\n />\n </RepositoryListItem>\n </List>\n );\n};\n\nexport default Repository;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,OAAO,WAAW,EAAqB,WAAW;CACnE,YAAY,MAAM,MAAM,WAAW;CACnC,eAAe;CAChB,EAAE;AAEH,IAAM,qBAAqB,OAAO,SAAS,CAAC;CAC1C,SAAS;CACT,UAAU,EACR,iBAAiB,eAClB;CACF,CAAC;AAEF,IAAM,yBAAyB,OAAO,gBAAa,CAAC;CAClD,SAAS;CACT,QAAQ;CACT,CAAC;AAEF,IAAM,mBAAmB,OAAO,OAAO,CAAC;CACtC,SAAS;CACT,YAAY;CACZ,iBAAiB;CAClB,CAAC;AAEF,IAAM,cAA8C,EAAE,kBAAkB;CACtE,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,MAAM,aAAa,QAAQ,YAAY;AAC7C,KAAI,CAAC,OAAO,CAAC,MAAe,IAAI,CAC9B,QAAO;CAGT,MAAM,gCAAwC;AAC5C,MAAI,CAAC,IAAI,SAAS,OAAO,CACvB,QAAO;AAGT,SAAO,IAAI,MAAM,OAAO,CAAC;;CAG3B,MAAM,gBAAgB,yBAAyB;AAE/C,QACE,oBAAC,MAAD;EACE,OAAO;EACP,WAAW,oBAAC,YAAD;GAAY,SAAQ;aAAa,EAAE,2BAA2B;GAAc,CAAA;YAEvF,qBAAC,oBAAD,EAAA,UAAA,CACE,oBAAC,kBAAD;GAAkB,IAAI,EAAE,SAAS,OAAO,OAAO;aAC7C,oBAAC,KAAD,EAAO,CAAA;GACU,CAAA,EACnB,oBAAC,wBAAD,EACE,SACE,oBAAC,iBAAD;GAAe,YAAW;GAAe,MAAM;GAAe,OAAO;aACnE,oBAAC,cAAD;IAAc,IAAI;IAAe,SAAQ;cACtC;IACY,CAAA;GACD,CAAA,EAElB,CAAA,CACiB,EAAA,CAAA;EAChB,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type { SearchResultWeb } from '@verdaccio/types';
|
|
1
|
+
import { FC, default as React } from 'react';
|
|
2
|
+
import { SearchResultWeb } from '@verdaccio/types';
|
|
4
3
|
export type OnSelecItem = (event: React.SyntheticEvent, value: SearchResultWeb, reason: string, details?: string) => void;
|
|
5
4
|
interface Props {
|
|
6
5
|
suggestions?: SearchResultWeb[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Wrapper: import(
|
|
2
|
-
theme?: import(
|
|
1
|
+
export declare const Wrapper: import('@emotion/styled').StyledComponent<{
|
|
2
|
+
theme?: import('@emotion/react').Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
|
-
}, import(
|
|
4
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_routes = require("../../utils/routes.js");
|
|
3
3
|
require("../../utils/index.js");
|
|
4
|
-
const require_AppConfigurationProvider = require("../../providers/AppConfigurationProvider/AppConfigurationProvider.js");
|
|
5
4
|
const require_SearchProvider = require("../../providers/SearchProvider/SearchProvider.js");
|
|
6
5
|
const require_AutoComplete = require("./AutoComplete/AutoComplete.js");
|
|
7
6
|
require("./AutoComplete/index.js");
|
|
7
|
+
const require_utils = require("./utils.js");
|
|
8
8
|
const require_SearchItem = require("./SearchItem.js");
|
|
9
9
|
const require_styles = require("./styles.js");
|
|
10
10
|
require("../../index.js");
|
|
@@ -25,8 +25,6 @@ var Search = () => {
|
|
|
25
25
|
const { t } = (0, react_i18next.useTranslation)();
|
|
26
26
|
const navigate = (0, react_router.useNavigate)();
|
|
27
27
|
const { searchResults, isLoading, doSearch } = require_SearchProvider.useSearch();
|
|
28
|
-
const { configOptions: { flags } } = require_AppConfigurationProvider.useConfig();
|
|
29
|
-
const searchRemote = flags?.searchRemote ?? false;
|
|
30
28
|
const abortControllerRef = (0, react.useRef)(null);
|
|
31
29
|
const cancelAllSearchRequests = (0, react.useCallback)(() => {
|
|
32
30
|
if (abortControllerRef.current) {
|
|
@@ -41,10 +39,10 @@ var Search = () => {
|
|
|
41
39
|
const handleClickSearch = (0, react.useCallback)((event, value, reason) => {
|
|
42
40
|
event.stopPropagation();
|
|
43
41
|
if (reason === "selectOption") {
|
|
44
|
-
const
|
|
45
|
-
navigate(`${require_routes.Route.DETAIL}${
|
|
42
|
+
const { name } = require_utils.normalizeSearchOption(value);
|
|
43
|
+
if (name) navigate(`${require_routes.Route.DETAIL}${name}`);
|
|
46
44
|
}
|
|
47
|
-
}, [navigate
|
|
45
|
+
}, [navigate]);
|
|
48
46
|
const doSearchRef = (0, react.useRef)(doSearch);
|
|
49
47
|
doSearchRef.current = doSearch;
|
|
50
48
|
/**
|
|
@@ -76,29 +74,16 @@ var Search = () => {
|
|
|
76
74
|
}, [debouncedFetch, cancelAllSearchRequests]);
|
|
77
75
|
const renderOption = (props, option) => {
|
|
78
76
|
const { key, ...otherProps } = props;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
isRemote,
|
|
90
|
-
name: item?.name,
|
|
91
|
-
version: item?.version
|
|
92
|
-
}, key);
|
|
93
|
-
} else {
|
|
94
|
-
const item = option.package;
|
|
95
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchItem.default, {
|
|
96
|
-
...otherProps,
|
|
97
|
-
description: item?.description,
|
|
98
|
-
name: item?.name,
|
|
99
|
-
version: item?.version
|
|
100
|
-
}, key);
|
|
101
|
-
}
|
|
77
|
+
const { name, version, description, isPrivate, isCached, isRemote } = require_utils.normalizeSearchOption(option);
|
|
78
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchItem.default, {
|
|
79
|
+
...otherProps,
|
|
80
|
+
description,
|
|
81
|
+
isCached,
|
|
82
|
+
isPrivate,
|
|
83
|
+
isRemote,
|
|
84
|
+
name,
|
|
85
|
+
version
|
|
86
|
+
}, key);
|
|
102
87
|
};
|
|
103
88
|
const renderInput = (params) => {
|
|
104
89
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_styles.StyledTextField, {
|
|
@@ -116,7 +101,7 @@ var Search = () => {
|
|
|
116
101
|
});
|
|
117
102
|
};
|
|
118
103
|
const getOptionLabel = (option) => {
|
|
119
|
-
return option
|
|
104
|
+
return require_utils.normalizeSearchOption(option).name;
|
|
120
105
|
};
|
|
121
106
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AutoComplete.default, {
|
|
122
107
|
getOptionLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","names":[],"sources":["../../../src/components/Search/Search.tsx"],"sourcesContent":["import SearchMui from '@mui/icons-material/Search';\nimport { debounce } from 'lodash-es';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport
|
|
1
|
+
{"version":3,"file":"Search.js","names":[],"sources":["../../../src/components/Search/Search.tsx"],"sourcesContent":["import SearchMui from '@mui/icons-material/Search';\nimport { debounce } from 'lodash-es';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport { useSearch } from '../../';\nimport { Route } from '../../utils';\nimport AutoComplete from './AutoComplete';\nimport SearchItem from './SearchItem';\nimport { StyledInputAdornment, StyledTextField } from './styles';\nimport { normalizeSearchOption } from './utils';\n\nconst CONSTANTS = {\n API_DELAY: 300,\n ABORT_ERROR: 'AbortError',\n};\n\nconst Search: React.FC = () => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { searchResults, isLoading, doSearch } = useSearch();\n\n const abortControllerRef = useRef<AbortController | null>(null);\n\n const cancelAllSearchRequests = useCallback(() => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n abortControllerRef.current = null;\n }\n }, []);\n\n const handleOnBlur = useCallback(\n (event: React.SyntheticEvent) => {\n event.stopPropagation();\n cancelAllSearchRequests();\n },\n [cancelAllSearchRequests]\n );\n\n const handleClickSearch = useCallback(\n (event: React.SyntheticEvent, value: any, reason: string): void => {\n event.stopPropagation();\n if (reason === 'selectOption') {\n const { name } = normalizeSearchOption(value);\n if (name) {\n navigate(`${Route.DETAIL}${name}`);\n }\n }\n },\n [navigate]\n );\n\n // Use a ref to always access the latest doSearch without re-creating the debounced function\n const doSearchRef = useRef(doSearch);\n doSearchRef.current = doSearch;\n\n /**\n * Stable fetch function that reads the latest doSearch from a ref,\n * avoiding dependency changes that would break the debounce.\n */\n const handleFetchPackages = useCallback(\n async ({ value }: { value: string }) => {\n if (value?.trim() !== '') {\n // Abort any previous pending request before starting a new one\n cancelAllSearchRequests();\n\n // Create a new controller for the current request\n const controller = new AbortController();\n abortControllerRef.current = controller;\n\n try {\n await doSearchRef.current?.({\n text: value,\n signal: controller.signal,\n });\n } catch (err: any) {\n if (err.name === CONSTANTS.ABORT_ERROR) {\n console.warn('Search request aborted');\n } else {\n console.error('Search error:', err);\n }\n }\n }\n },\n [cancelAllSearchRequests]\n );\n\n // Memoize the debounced function so a single instance is reused across renders,\n // ensuring the debounce timer works correctly instead of creating a new timer per render.\n const debouncedFetch = useMemo(\n () => debounce(handleFetchPackages, CONSTANTS.API_DELAY),\n [handleFetchPackages]\n );\n\n useEffect(() => {\n return () => {\n debouncedFetch.cancel?.();\n cancelAllSearchRequests();\n };\n }, [debouncedFetch, cancelAllSearchRequests]);\n\n const renderOption = (props, option) => {\n const { key, ...otherProps } = props;\n const { name, version, description, isPrivate, isCached, isRemote } =\n normalizeSearchOption(option);\n return (\n <SearchItem\n key={key}\n {...otherProps}\n description={description}\n isCached={isCached}\n isPrivate={isPrivate}\n isRemote={isRemote}\n name={name}\n version={version}\n />\n );\n };\n\n const renderInput = (params) => {\n return (\n <StyledTextField\n {...params}\n InputProps={{\n ...params.InputProps,\n startAdornment: (\n <StyledInputAdornment position=\"start\">\n <SearchMui />\n </StyledInputAdornment>\n ),\n }}\n label=\"\"\n placeholder={t('search.packages')}\n variant=\"standard\"\n />\n );\n };\n\n const getOptionLabel = (option) => {\n return normalizeSearchOption(option).name;\n };\n\n return (\n <AutoComplete\n getOptionLabel={getOptionLabel}\n onCleanSuggestions={handleOnBlur}\n onSelectItem={handleClickSearch}\n onSuggestionsFetch={debouncedFetch}\n placeholder={t('search.packages')}\n renderInput={renderInput}\n renderOption={renderOption}\n suggestions={searchResults}\n suggestionsLoading={isLoading}\n />\n );\n};\n\nexport default Search;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,IAAM,YAAY;CAChB,WAAW;CACX,aAAa;CACd;AAED,IAAM,eAAyB;CAC7B,MAAM,EAAE,OAAA,GAAA,cAAA,iBAAsB;CAC9B,MAAM,YAAA,GAAA,aAAA,cAAwB;CAC9B,MAAM,EAAE,eAAe,WAAW,aAAa,uBAAA,WAAW;CAE1D,MAAM,sBAAA,GAAA,MAAA,QAAoD,KAAK;CAE/D,MAAM,2BAAA,GAAA,MAAA,mBAA4C;AAChD,MAAI,mBAAmB,SAAS;AAC9B,sBAAmB,QAAQ,OAAO;AAClC,sBAAmB,UAAU;;IAE9B,EAAE,CAAC;CAEN,MAAM,gBAAA,GAAA,MAAA,cACH,UAAgC;AAC/B,QAAM,iBAAiB;AACvB,2BAAyB;IAE3B,CAAC,wBAAwB,CAC1B;CAED,MAAM,qBAAA,GAAA,MAAA,cACH,OAA6B,OAAY,WAAyB;AACjE,QAAM,iBAAiB;AACvB,MAAI,WAAW,gBAAgB;GAC7B,MAAM,EAAE,SAAS,cAAA,sBAAsB,MAAM;AAC7C,OAAI,KACF,UAAS,GAAG,eAAA,MAAM,SAAS,OAAO;;IAIxC,CAAC,SAAS,CACX;CAGD,MAAM,eAAA,GAAA,MAAA,QAAqB,SAAS;AACpC,aAAY,UAAU;;;;;CAMtB,MAAM,uBAAA,GAAA,MAAA,aACJ,OAAO,EAAE,YAA+B;AACtC,MAAI,OAAO,MAAM,KAAK,IAAI;AAExB,4BAAyB;GAGzB,MAAM,aAAa,IAAI,iBAAiB;AACxC,sBAAmB,UAAU;AAE7B,OAAI;AACF,UAAM,YAAY,UAAU;KAC1B,MAAM;KACN,QAAQ,WAAW;KACpB,CAAC;YACK,KAAU;AACjB,QAAI,IAAI,SAAS,UAAU,YACzB,SAAQ,KAAK,yBAAyB;QAEtC,SAAQ,MAAM,iBAAiB,IAAI;;;IAK3C,CAAC,wBAAwB,CAC1B;CAID,MAAM,kBAAA,GAAA,MAAA,gBAAA,GAAA,UAAA,UACW,qBAAqB,UAAU,UAAU,EACxD,CAAC,oBAAoB,CACtB;AAED,EAAA,GAAA,MAAA,iBAAgB;AACd,eAAa;AACX,kBAAe,UAAU;AACzB,4BAAyB;;IAE1B,CAAC,gBAAgB,wBAAwB,CAAC;CAE7C,MAAM,gBAAgB,OAAO,WAAW;EACtC,MAAM,EAAE,KAAK,GAAG,eAAe;EAC/B,MAAM,EAAE,MAAM,SAAS,aAAa,WAAW,UAAU,aACvD,cAAA,sBAAsB,OAAO;AAC/B,SACE,iBAAA,GAAA,kBAAA,KAAC,mBAAA,SAAD;GAEE,GAAI;GACS;GACH;GACC;GACD;GACJ;GACG;GACT,EARK,IAQL;;CAIN,MAAM,eAAe,WAAW;AAC9B,SACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,iBAAD;GACE,GAAI;GACJ,YAAY;IACV,GAAG,OAAO;IACV,gBACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,sBAAD;KAAsB,UAAS;eAC7B,iBAAA,GAAA,kBAAA,KAAC,2BAAA,SAAD,EAAa,CAAA;KACQ,CAAA;IAE1B;GACD,OAAM;GACN,aAAa,EAAE,kBAAkB;GACjC,SAAQ;GACR,CAAA;;CAIN,MAAM,kBAAkB,WAAW;AACjC,SAAO,cAAA,sBAAsB,OAAO,CAAC;;AAGvC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EACkB;EAChB,oBAAoB;EACpB,cAAc;EACd,oBAAoB;EACpB,aAAa,EAAE,kBAAkB;EACpB;EACC;EACd,aAAa;EACb,oBAAoB;EACpB,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Route as Route$1 } from "../../utils/routes.mjs";
|
|
2
2
|
import "../../utils/index.mjs";
|
|
3
|
-
import { useConfig } from "../../providers/AppConfigurationProvider/AppConfigurationProvider.mjs";
|
|
4
3
|
import { useSearch } from "../../providers/SearchProvider/SearchProvider.mjs";
|
|
5
4
|
import AutoComplete from "./AutoComplete/AutoComplete.mjs";
|
|
6
5
|
import "./AutoComplete/index.mjs";
|
|
6
|
+
import { normalizeSearchOption } from "./utils.mjs";
|
|
7
7
|
import SearchItem from "./SearchItem.mjs";
|
|
8
8
|
import { StyledInputAdornment, StyledTextField } from "./styles.mjs";
|
|
9
9
|
import "../../index.mjs";
|
|
@@ -22,8 +22,6 @@ var Search = () => {
|
|
|
22
22
|
const { t } = useTranslation();
|
|
23
23
|
const navigate = useNavigate();
|
|
24
24
|
const { searchResults, isLoading, doSearch } = useSearch();
|
|
25
|
-
const { configOptions: { flags } } = useConfig();
|
|
26
|
-
const searchRemote = flags?.searchRemote ?? false;
|
|
27
25
|
const abortControllerRef = useRef(null);
|
|
28
26
|
const cancelAllSearchRequests = useCallback(() => {
|
|
29
27
|
if (abortControllerRef.current) {
|
|
@@ -38,10 +36,10 @@ var Search = () => {
|
|
|
38
36
|
const handleClickSearch = useCallback((event, value, reason) => {
|
|
39
37
|
event.stopPropagation();
|
|
40
38
|
if (reason === "selectOption") {
|
|
41
|
-
const
|
|
42
|
-
navigate(`${Route$1.DETAIL}${
|
|
39
|
+
const { name } = normalizeSearchOption(value);
|
|
40
|
+
if (name) navigate(`${Route$1.DETAIL}${name}`);
|
|
43
41
|
}
|
|
44
|
-
}, [navigate
|
|
42
|
+
}, [navigate]);
|
|
45
43
|
const doSearchRef = useRef(doSearch);
|
|
46
44
|
doSearchRef.current = doSearch;
|
|
47
45
|
/**
|
|
@@ -73,29 +71,16 @@ var Search = () => {
|
|
|
73
71
|
}, [debouncedFetch, cancelAllSearchRequests]);
|
|
74
72
|
const renderOption = (props, option) => {
|
|
75
73
|
const { key, ...otherProps } = props;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
isRemote,
|
|
87
|
-
name: item?.name,
|
|
88
|
-
version: item?.version
|
|
89
|
-
}, key);
|
|
90
|
-
} else {
|
|
91
|
-
const item = option.package;
|
|
92
|
-
return /* @__PURE__ */ jsx(SearchItem, {
|
|
93
|
-
...otherProps,
|
|
94
|
-
description: item?.description,
|
|
95
|
-
name: item?.name,
|
|
96
|
-
version: item?.version
|
|
97
|
-
}, key);
|
|
98
|
-
}
|
|
74
|
+
const { name, version, description, isPrivate, isCached, isRemote } = normalizeSearchOption(option);
|
|
75
|
+
return /* @__PURE__ */ jsx(SearchItem, {
|
|
76
|
+
...otherProps,
|
|
77
|
+
description,
|
|
78
|
+
isCached,
|
|
79
|
+
isPrivate,
|
|
80
|
+
isRemote,
|
|
81
|
+
name,
|
|
82
|
+
version
|
|
83
|
+
}, key);
|
|
99
84
|
};
|
|
100
85
|
const renderInput = (params) => {
|
|
101
86
|
return /* @__PURE__ */ jsx(StyledTextField, {
|
|
@@ -113,7 +98,7 @@ var Search = () => {
|
|
|
113
98
|
});
|
|
114
99
|
};
|
|
115
100
|
const getOptionLabel = (option) => {
|
|
116
|
-
return option
|
|
101
|
+
return normalizeSearchOption(option).name;
|
|
117
102
|
};
|
|
118
103
|
return /* @__PURE__ */ jsx(AutoComplete, {
|
|
119
104
|
getOptionLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.mjs","names":[],"sources":["../../../src/components/Search/Search.tsx"],"sourcesContent":["import SearchMui from '@mui/icons-material/Search';\nimport { debounce } from 'lodash-es';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport
|
|
1
|
+
{"version":3,"file":"Search.mjs","names":[],"sources":["../../../src/components/Search/Search.tsx"],"sourcesContent":["import SearchMui from '@mui/icons-material/Search';\nimport { debounce } from 'lodash-es';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router';\n\nimport { useSearch } from '../../';\nimport { Route } from '../../utils';\nimport AutoComplete from './AutoComplete';\nimport SearchItem from './SearchItem';\nimport { StyledInputAdornment, StyledTextField } from './styles';\nimport { normalizeSearchOption } from './utils';\n\nconst CONSTANTS = {\n API_DELAY: 300,\n ABORT_ERROR: 'AbortError',\n};\n\nconst Search: React.FC = () => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { searchResults, isLoading, doSearch } = useSearch();\n\n const abortControllerRef = useRef<AbortController | null>(null);\n\n const cancelAllSearchRequests = useCallback(() => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n abortControllerRef.current = null;\n }\n }, []);\n\n const handleOnBlur = useCallback(\n (event: React.SyntheticEvent) => {\n event.stopPropagation();\n cancelAllSearchRequests();\n },\n [cancelAllSearchRequests]\n );\n\n const handleClickSearch = useCallback(\n (event: React.SyntheticEvent, value: any, reason: string): void => {\n event.stopPropagation();\n if (reason === 'selectOption') {\n const { name } = normalizeSearchOption(value);\n if (name) {\n navigate(`${Route.DETAIL}${name}`);\n }\n }\n },\n [navigate]\n );\n\n // Use a ref to always access the latest doSearch without re-creating the debounced function\n const doSearchRef = useRef(doSearch);\n doSearchRef.current = doSearch;\n\n /**\n * Stable fetch function that reads the latest doSearch from a ref,\n * avoiding dependency changes that would break the debounce.\n */\n const handleFetchPackages = useCallback(\n async ({ value }: { value: string }) => {\n if (value?.trim() !== '') {\n // Abort any previous pending request before starting a new one\n cancelAllSearchRequests();\n\n // Create a new controller for the current request\n const controller = new AbortController();\n abortControllerRef.current = controller;\n\n try {\n await doSearchRef.current?.({\n text: value,\n signal: controller.signal,\n });\n } catch (err: any) {\n if (err.name === CONSTANTS.ABORT_ERROR) {\n console.warn('Search request aborted');\n } else {\n console.error('Search error:', err);\n }\n }\n }\n },\n [cancelAllSearchRequests]\n );\n\n // Memoize the debounced function so a single instance is reused across renders,\n // ensuring the debounce timer works correctly instead of creating a new timer per render.\n const debouncedFetch = useMemo(\n () => debounce(handleFetchPackages, CONSTANTS.API_DELAY),\n [handleFetchPackages]\n );\n\n useEffect(() => {\n return () => {\n debouncedFetch.cancel?.();\n cancelAllSearchRequests();\n };\n }, [debouncedFetch, cancelAllSearchRequests]);\n\n const renderOption = (props, option) => {\n const { key, ...otherProps } = props;\n const { name, version, description, isPrivate, isCached, isRemote } =\n normalizeSearchOption(option);\n return (\n <SearchItem\n key={key}\n {...otherProps}\n description={description}\n isCached={isCached}\n isPrivate={isPrivate}\n isRemote={isRemote}\n name={name}\n version={version}\n />\n );\n };\n\n const renderInput = (params) => {\n return (\n <StyledTextField\n {...params}\n InputProps={{\n ...params.InputProps,\n startAdornment: (\n <StyledInputAdornment position=\"start\">\n <SearchMui />\n </StyledInputAdornment>\n ),\n }}\n label=\"\"\n placeholder={t('search.packages')}\n variant=\"standard\"\n />\n );\n };\n\n const getOptionLabel = (option) => {\n return normalizeSearchOption(option).name;\n };\n\n return (\n <AutoComplete\n getOptionLabel={getOptionLabel}\n onCleanSuggestions={handleOnBlur}\n onSelectItem={handleClickSearch}\n onSuggestionsFetch={debouncedFetch}\n placeholder={t('search.packages')}\n renderInput={renderInput}\n renderOption={renderOption}\n suggestions={searchResults}\n suggestionsLoading={isLoading}\n />\n );\n};\n\nexport default Search;\n"],"mappings":";;;;;;;;;;;;;;;;AAaA,IAAM,YAAY;CAChB,WAAW;CACX,aAAa;CACd;AAED,IAAM,eAAyB;CAC7B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,WAAW,aAAa;CAC9B,MAAM,EAAE,eAAe,WAAW,aAAa,WAAW;CAE1D,MAAM,qBAAqB,OAA+B,KAAK;CAE/D,MAAM,0BAA0B,kBAAkB;AAChD,MAAI,mBAAmB,SAAS;AAC9B,sBAAmB,QAAQ,OAAO;AAClC,sBAAmB,UAAU;;IAE9B,EAAE,CAAC;CAEN,MAAM,eAAe,aAClB,UAAgC;AAC/B,QAAM,iBAAiB;AACvB,2BAAyB;IAE3B,CAAC,wBAAwB,CAC1B;CAED,MAAM,oBAAoB,aACvB,OAA6B,OAAY,WAAyB;AACjE,QAAM,iBAAiB;AACvB,MAAI,WAAW,gBAAgB;GAC7B,MAAM,EAAE,SAAS,sBAAsB,MAAM;AAC7C,OAAI,KACF,UAAS,GAAG,QAAM,SAAS,OAAO;;IAIxC,CAAC,SAAS,CACX;CAGD,MAAM,cAAc,OAAO,SAAS;AACpC,aAAY,UAAU;;;;;CAMtB,MAAM,sBAAsB,YAC1B,OAAO,EAAE,YAA+B;AACtC,MAAI,OAAO,MAAM,KAAK,IAAI;AAExB,4BAAyB;GAGzB,MAAM,aAAa,IAAI,iBAAiB;AACxC,sBAAmB,UAAU;AAE7B,OAAI;AACF,UAAM,YAAY,UAAU;KAC1B,MAAM;KACN,QAAQ,WAAW;KACpB,CAAC;YACK,KAAU;AACjB,QAAI,IAAI,SAAS,UAAU,YACzB,SAAQ,KAAK,yBAAyB;QAEtC,SAAQ,MAAM,iBAAiB,IAAI;;;IAK3C,CAAC,wBAAwB,CAC1B;CAID,MAAM,iBAAiB,cACf,SAAS,qBAAqB,UAAU,UAAU,EACxD,CAAC,oBAAoB,CACtB;AAED,iBAAgB;AACd,eAAa;AACX,kBAAe,UAAU;AACzB,4BAAyB;;IAE1B,CAAC,gBAAgB,wBAAwB,CAAC;CAE7C,MAAM,gBAAgB,OAAO,WAAW;EACtC,MAAM,EAAE,KAAK,GAAG,eAAe;EAC/B,MAAM,EAAE,MAAM,SAAS,aAAa,WAAW,UAAU,aACvD,sBAAsB,OAAO;AAC/B,SACE,oBAAC,YAAD;GAEE,GAAI;GACS;GACH;GACC;GACD;GACJ;GACG;GACT,EARK,IAQL;;CAIN,MAAM,eAAe,WAAW;AAC9B,SACE,oBAAC,iBAAD;GACE,GAAI;GACJ,YAAY;IACV,GAAG,OAAO;IACV,gBACE,oBAAC,sBAAD;KAAsB,UAAS;eAC7B,oBAAC,WAAD,EAAa,CAAA;KACQ,CAAA;IAE1B;GACD,OAAM;GACN,aAAa,EAAE,kBAAkB;GACjC,SAAQ;GACR,CAAA;;CAIN,MAAM,kBAAkB,WAAW;AACjC,SAAO,sBAAsB,OAAO,CAAC;;AAGvC,QACE,oBAAC,cAAD;EACkB;EAChB,oBAAoB;EACpB,cAAc;EACd,oBAAoB;EACpB,aAAa,EAAE,kBAAkB;EACpB;EACC;EACd,aAAa;EACb,oBAAoB;EACpB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
3
|
type SearchItemProps = {
|
|
4
4
|
name: string;
|
|
5
5
|
version?: string;
|
|
@@ -8,8 +8,8 @@ type SearchItemProps = {
|
|
|
8
8
|
isCached?: boolean;
|
|
9
9
|
isRemote?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const Description: import(
|
|
12
|
-
theme?: import(
|
|
11
|
+
export declare const Description: import('@emotion/styled').StyledComponent<{
|
|
12
|
+
theme?: import('@emotion/react').Theme;
|
|
13
13
|
as?: React.ElementType;
|
|
14
14
|
} & {
|
|
15
15
|
theme?: Theme;
|