@verdaccio/ui-components 2.0.0-6-next.9 → 2.0.0-6-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +1 -9
- package/CHANGELOG.md +6 -0
- package/build/Theme/ResetStyles.js +34 -37
- package/build/Theme/StyleBaseline.js +4 -6
- package/build/Theme/ThemeProvider.js +24 -34
- package/build/Theme/colors.js +1 -1
- package/build/Theme/index.js +9 -10
- package/build/Theme/theme.js +26 -28
- package/build/__mocks__/react-markdown.js +6 -5
- package/build/__mocks__/remark-plugin.js +1 -1
- package/build/components/ActionBar/ActionBar.js +23 -36
- package/build/components/ActionBar/ActionBarAction.js +45 -56
- package/build/components/ActionBar/index.js +3 -3
- package/build/components/Author/Author.js +26 -21
- package/build/components/Author/index.js +3 -3
- package/build/components/Author/styles.js +5 -5
- package/build/components/CopyClipboard/CopyToClipBoard.js +21 -23
- package/build/components/CopyClipboard/index.js +4 -4
- package/build/components/CopyClipboard/utils.js +14 -16
- package/build/components/Dependencies/Dependencies.js +68 -66
- package/build/components/Dependencies/index.js +3 -3
- package/build/components/Dependencies/styles.js +9 -11
- package/build/components/Deprecated/Deprecated.js +10 -8
- package/build/components/Deprecated/index.js +3 -3
- package/build/components/Developers/Developers.js +27 -42
- package/build/components/Developers/Title.js +19 -18
- package/build/components/Developers/get-unique-developer-values.js +3 -13
- package/build/components/Developers/index.js +5 -6
- package/build/components/Developers/styles.js +7 -7
- package/build/components/Distribution/Dist.js +24 -22
- package/build/components/Distribution/index.js +3 -3
- package/build/components/Distribution/styles.js +7 -7
- package/build/components/Distribution/utilts.spec.js +4 -4
- package/build/components/Engines/Engines.js +37 -36
- package/build/components/Engines/index.js +3 -3
- package/build/components/Engines/styles.js +4 -4
- package/build/components/ErrorBoundary/ErrorBoundary.js +29 -50
- package/build/components/ErrorBoundary/index.js +3 -3
- package/build/components/FundButton/FundButton.js +28 -29
- package/build/components/FundButton/index.js +3 -3
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +33 -45
- package/build/components/HeaderInfoDialog/index.js +3 -3
- package/build/components/Heading/Heading.js +10 -14
- package/build/components/Heading/index.js +3 -3
- package/build/components/Help/Help.js +22 -21
- package/build/components/Help/index.js +3 -3
- package/build/components/Help/styles.js +2 -2
- package/build/components/Icons/DevsIcons/CommonJS.js +9 -10
- package/build/components/Icons/DevsIcons/ES6Module.js +9 -10
- package/build/components/Icons/DevsIcons/Git.js +9 -10
- package/build/components/Icons/DevsIcons/NodeJS.js +9 -10
- package/build/components/Icons/DevsIcons/TypeScript.js +9 -10
- package/build/components/Icons/DevsIcons/index.js +5 -5
- package/build/components/Icons/Earth.js +11 -11
- package/build/components/Icons/FileBinary.js +4 -4
- package/build/components/Icons/Law.js +4 -4
- package/build/components/Icons/License.js +5 -5
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +9 -10
- package/build/components/Icons/Managers/Pnpm.js +9 -10
- package/build/components/Icons/Managers/Yarn.js +9 -10
- package/build/components/Icons/Managers/index.js +3 -3
- package/build/components/Icons/SvgIcon.js +14 -22
- package/build/components/Icons/Time.js +6 -6
- package/build/components/Icons/Version.js +4 -4
- package/build/components/Icons/index.js +8 -8
- package/build/components/Install/Install.js +40 -26
- package/build/components/Install/InstallListItem.js +46 -37
- package/build/components/Install/index.js +3 -3
- package/build/components/Label/Label.js +13 -19
- package/build/components/Label/index.js +3 -3
- package/build/components/Link/Link.js +16 -15
- package/build/components/Link/index.js +3 -3
- package/build/components/Loading/Loading.js +10 -12
- package/build/components/Loading/Spinner/Spinner.js +27 -37
- package/build/components/Loading/Spinner/index.js +3 -3
- package/build/components/Loading/index.js +3 -3
- package/build/components/Loading/styles.js +11 -12
- package/build/components/LoginDialog/LoginDialog.js +44 -79
- package/build/components/LoginDialog/LoginDialogCloseButton.js +20 -19
- package/build/components/LoginDialog/LoginDialogForm.js +40 -39
- package/build/components/LoginDialog/LoginDialogFormError.js +26 -28
- package/build/components/LoginDialog/LoginDialogHeader.js +29 -29
- package/build/components/LoginDialog/index.js +3 -3
- package/build/components/Logo/Logo.js +35 -36
- package/build/components/Logo/index.js +3 -3
- package/build/components/MenuItem/MenuItem.js +8 -9
- package/build/components/MenuItem/index.js +3 -3
- package/build/components/NoItems/NoItems.js +10 -21
- package/build/components/NoItems/index.js +3 -3
- package/build/components/NotFound/NotFound.js +24 -25
- package/build/components/NotFound/index.js +3 -3
- package/build/components/Package/Package.js +108 -146
- package/build/components/Package/Tag/Tag.js +6 -7
- package/build/components/Package/Tag/index.js +3 -3
- package/build/components/Package/Tag/styles.js +2 -2
- package/build/components/Package/index.js +5 -6
- package/build/components/Package/styles.js +65 -70
- package/build/components/PackageList/PackageList.js +56 -52
- package/build/components/PackageList/index.js +3 -3
- package/build/components/RawViewer/RawViewer.js +23 -22
- package/build/components/RawViewer/index.js +3 -3
- package/build/components/Readme/Readme.js +21 -21
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +6 -6
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/index.js +3 -3
- package/build/components/Readme/utils.js +7 -8
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +14 -14
- package/build/components/RegistryInfoDialog/index.js +3 -3
- package/build/components/RegistryInfoDialog/styles.js +17 -19
- package/build/components/Repository/Repository.js +37 -36
- package/build/components/Repository/index.js +3 -3
- package/build/components/Search/AutoComplete/AutoComplete.js +26 -35
- package/build/components/Search/AutoComplete/index.js +3 -3
- package/build/components/Search/AutoComplete/styles.js +15 -16
- package/build/components/Search/Search.js +54 -54
- package/build/components/Search/SearchItem.js +56 -64
- package/build/components/Search/index.js +3 -3
- package/build/components/Search/styles.js +16 -17
- package/build/components/SettingsMenu/SettingsMenu.js +68 -0
- package/build/components/SettingsMenu/index.js +14 -0
- package/build/components/SideBarTittle/SideBarTittle.js +33 -31
- package/build/components/SideBarTittle/index.js +3 -3
- package/build/components/SideBarTittle/utils.js +4 -4
- package/build/components/TextField/TextField.js +16 -24
- package/build/components/TextField/index.js +3 -3
- package/build/components/UpLinks/UpLinks.js +18 -16
- package/build/components/UpLinks/index.js +3 -3
- package/build/components/UpLinks/styles.js +20 -22
- package/build/components/Versions/HistoryList.js +25 -25
- package/build/components/Versions/TagList.js +19 -22
- package/build/components/Versions/Versions.js +21 -20
- package/build/components/Versions/index.js +3 -3
- package/build/components/Versions/styles.js +19 -21
- package/build/hooks/index.js +5 -5
- package/build/hooks/useLocalStorage.js +18 -27
- package/build/hooks/useOnClickOutside.js +5 -5
- package/build/index.js +104 -97
- package/build/layouts/Version/Version.js +8 -8
- package/build/layouts/Version/index.js +3 -3
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +18 -31
- package/build/providers/AppConfigurationProvider/index.js +5 -6
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +38 -0
- package/build/providers/PersistenceSettingProvider/index.js +21 -0
- package/build/providers/TranslatorProvider/TranslatorProvider.js +26 -49
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +21 -19
- package/build/providers/TranslatorProvider/index.js +6 -7
- package/build/providers/VersionProvider/VersionProvider.js +32 -34
- package/build/providers/VersionProvider/index.js +5 -6
- package/build/providers/index.js +3 -3
- package/build/sections/Detail/ContainerContent.js +21 -32
- package/build/sections/Detail/Detail.js +18 -27
- package/build/sections/Detail/ReadmeSection.js +7 -6
- package/build/sections/Detail/Tabs.js +16 -14
- package/build/sections/Detail/index.js +3 -3
- package/build/sections/Footer/Footer.js +54 -56
- package/build/sections/Footer/index.js +3 -3
- package/build/sections/Footer/styles.js +41 -47
- package/build/sections/Header/Header.js +36 -70
- package/build/sections/Header/HeaderGreetings.js +10 -8
- package/build/sections/Header/HeaderLeft.js +11 -12
- package/build/sections/Header/HeaderMenu.js +18 -17
- package/build/sections/Header/HeaderRight.js +41 -51
- package/build/sections/Header/HeaderSettingsDialog.js +48 -58
- package/build/sections/Header/HeaderToolTip.js +10 -11
- package/build/sections/Header/HeaderToolTipIcon.js +19 -19
- package/build/sections/Header/LanguageSwitch.js +51 -56
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +72 -71
- package/build/sections/Header/RegistryInfoContent/index.js +3 -3
- package/build/sections/Header/RegistryInfoContent/styles.js +13 -16
- package/build/sections/Header/RegistryInfoDialog/RegistryInfoDialog.js +14 -14
- package/build/sections/Header/RegistryInfoDialog/index.js +3 -3
- package/build/sections/Header/RegistryInfoDialog/styles.js +17 -19
- package/build/sections/Header/index.js +3 -3
- package/build/sections/Header/styles.js +35 -38
- package/build/sections/Home/Home.js +11 -14
- package/build/sections/Home/index.js +3 -3
- package/build/sections/SideBar/Sidebar.js +38 -54
- package/build/sections/SideBar/index.js +3 -3
- package/build/sections/index.js +5 -5
- package/build/src/components/ActionBar/ActionBar.stories.d.ts +11 -6
- package/build/src/components/Dependencies/Dependencies.stories.d.ts +8 -6
- package/build/src/components/FundButton/FundButton.stories.d.ts +7 -5
- package/build/src/components/Install/Install.stories.d.ts +9 -5
- package/build/src/components/NoItems/NoItems.d.ts +0 -1
- package/build/src/components/Repository/Repository.stories.d.ts +8 -6
- package/build/src/components/SettingsMenu/SettingsMenu.d.ts +6 -0
- package/build/src/components/SettingsMenu/index.d.ts +1 -0
- package/build/src/components/SideBarTittle/SideBarTittle.stories.d.ts +9 -0
- package/build/src/components/Versions/types.d.ts +0 -2
- package/build/src/index.d.ts +1 -0
- package/build/src/layouts/Version/Version.stories.d.ts +7 -6
- package/build/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.d.ts +6 -0
- package/build/src/providers/PersistenceSettingProvider/index.d.ts +1 -0
- package/build/src/providers/VersionProvider/VersionProvider.d.ts +0 -2
- package/build/store/api.js +35 -52
- package/build/store/index.js +9 -9
- package/build/store/models/configuration.js +12 -32
- package/build/store/models/download.js +22 -44
- package/build/store/models/index.js +1 -1
- package/build/store/models/login.js +55 -77
- package/build/store/models/manifest.js +52 -76
- package/build/store/models/packages.js +22 -49
- package/build/store/models/search.js +59 -85
- package/build/store/storage.js +5 -5
- package/build/store/store.js +3 -3
- package/build/test/i18n-config.js +5 -5
- package/build/test/test-react-testing-library.js +19 -24
- package/build/utils/__partials__/packageMeta.js +1 -1
- package/build/utils/cli-utils.js +27 -20
- package/build/utils/index.js +10 -11
- package/build/utils/loadable.js +9 -12
- package/build/utils/routes.js +1 -1
- package/build/utils/url.js +9 -9
- package/build/utils/utils.js +18 -22
- package/package.json +5 -5
- package/src/components/ActionBar/ActionBar.stories.tsx +60 -46
- package/src/components/Author/Author.stories.tsx +1 -1
- package/src/components/CopyClipboard/CopyToClipBoard.stories.tsx +1 -1
- package/src/components/CopyClipboard/CopyToClipBoard.tsx +2 -2
- package/src/components/Dependencies/Dependencies.stories.tsx +151 -51
- package/src/components/Dependencies/Dependencies.tsx +61 -51
- package/src/components/Deprecated/Deprecated.stories.tsx +1 -1
- package/src/components/Developers/Developers.stories.tsx +1 -1
- package/src/components/Distribution/Dist.stories.tsx +1 -1
- package/src/components/Engines/Engines.stories.tsx +1 -1
- package/src/components/FundButton/FundButton.stories.tsx +48 -17
- package/src/components/Help/Help.stories.tsx +1 -1
- package/src/components/Icons/Icons.stories.tsx +1 -1
- package/src/components/Install/Install.stories.tsx +79 -26
- package/src/components/Install/Install.tsx +28 -14
- package/src/components/Install/InstallListItem.tsx +24 -8
- package/src/components/Loading/Loading.stories.tsx +1 -1
- package/src/components/LoginDialog/LoginDialog.stories.tsx +1 -1
- package/src/components/NoItems/NoItems.stories.tsx +1 -1
- package/src/components/NoItems/NoItems.tsx +5 -6
- package/src/components/Repository/Repository.stories.tsx +39 -12
- package/src/components/Repository/Repository.tsx +2 -4
- package/src/components/Search/Search.stories.tsx +1 -1
- package/src/components/SettingsMenu/SettingsMenu.tsx +67 -0
- package/src/components/SettingsMenu/index.ts +1 -0
- package/src/components/SideBarTittle/SideBarTittle.stories.tsx +68 -0
- package/src/components/UpLinks/Uplinks.stories.tsx +1 -1
- package/src/components/Versions/types.ts +0 -2
- package/src/index.ts +2 -0
- package/src/layouts/Version/Version.stories.tsx +35 -20
- package/src/providers/AppConfigurationProvider/AppConfigurationProvider.tsx +0 -1
- package/src/providers/PersistenceSettingProvider/PersistenceSettingProvider.tsx +57 -0
- package/src/providers/PersistenceSettingProvider/index.ts +1 -0
- package/src/providers/VersionProvider/VersionProvider.tsx +0 -2
- package/src/sections/Detail/Detail.stories.tsx +1 -1
- package/src/sections/Header/Header.stories.tsx +1 -1
- package/src/sections/Home/Home.stories.tsx +1 -1
- package/src/sections/SideBar/Sidebar.stories.tsx +1 -1
- package/src/sections/SideBar/Sidebar.test.tsx +0 -1
- package/src/test/test-react-testing-library.tsx +17 -12
- package/src/utils/url.test.ts +4 -0
- package/src/utils/url.ts +1 -1
|
@@ -1,44 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete"));
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _reactI18next = require("react-i18next");
|
|
11
10
|
var _styles = require("./styles");
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
t = _useTranslation.t;
|
|
33
|
-
var _useState = (0, _react.useState)(''),
|
|
34
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
inputValue = _useState2[0],
|
|
36
|
-
setInputValue = _useState2[1];
|
|
37
|
-
var handleOnInputChange = function handleOnInputChange(event, value, reason) {
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
/* eslint-disable verdaccio/jsx-spread */
|
|
15
|
+
|
|
16
|
+
const AutoComplete = ({
|
|
17
|
+
suggestions,
|
|
18
|
+
onSuggestionsFetch,
|
|
19
|
+
onCleanSuggestions,
|
|
20
|
+
renderInput,
|
|
21
|
+
renderOption,
|
|
22
|
+
getOptionLabel,
|
|
23
|
+
onSelectItem,
|
|
24
|
+
suggestionsLoading = false
|
|
25
|
+
}) => {
|
|
26
|
+
const {
|
|
27
|
+
t
|
|
28
|
+
} = (0, _reactI18next.useTranslation)();
|
|
29
|
+
const [inputValue, setInputValue] = (0, _react.useState)('');
|
|
30
|
+
const handleOnInputChange = (event, value, reason) => {
|
|
38
31
|
if (reason === 'input') {
|
|
39
32
|
event.preventDefault();
|
|
40
33
|
onSuggestionsFetch({
|
|
41
|
-
value
|
|
34
|
+
value
|
|
42
35
|
});
|
|
43
36
|
setInputValue(value);
|
|
44
37
|
} else if (reason === 'clear') {
|
|
@@ -46,13 +39,13 @@ var AutoComplete = function AutoComplete(_ref) {
|
|
|
46
39
|
setInputValue('');
|
|
47
40
|
}
|
|
48
41
|
};
|
|
49
|
-
|
|
42
|
+
const handleOnClose = event => {
|
|
50
43
|
onCleanSuggestions(event);
|
|
51
44
|
setInputValue('');
|
|
52
45
|
};
|
|
53
46
|
|
|
54
47
|
// @ts-ignore
|
|
55
|
-
return /*#__PURE__*/_react
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Wrapper, null, /*#__PURE__*/_react.default.createElement(_Autocomplete.default
|
|
56
49
|
/* @ts-ignore */, {
|
|
57
50
|
clearOnBlur: true,
|
|
58
51
|
disablePortal: true,
|
|
@@ -69,11 +62,9 @@ var AutoComplete = function AutoComplete(_ref) {
|
|
|
69
62
|
options: suggestions,
|
|
70
63
|
renderInput: renderInput,
|
|
71
64
|
renderOption: renderOption,
|
|
72
|
-
renderTags:
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
65
|
+
renderTags: () => null
|
|
75
66
|
}));
|
|
76
67
|
};
|
|
77
68
|
var _default = AutoComplete;
|
|
78
|
-
exports
|
|
69
|
+
exports.default = _default;
|
|
79
70
|
//# sourceMappingURL=AutoComplete.js.map
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
9
|
-
return _AutoComplete
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AutoComplete.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _AutoComplete = _interopRequireDefault(require("./AutoComplete"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Wrapper = exports.StyledTextField = void 0;
|
|
8
7
|
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
8
|
var _ = require("../../../");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
10
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15
|
-
|
|
11
|
+
const Wrapper = /*#__PURE__*/(0, _base.default)('div', process.env.NODE_ENV === "production" ? {
|
|
16
12
|
target: "e1603dot1"
|
|
17
13
|
} : {
|
|
18
14
|
target: "e1603dot1",
|
|
@@ -27,15 +23,15 @@ var Wrapper = /*#__PURE__*/(0, _base["default"])('div', process.env.NODE_ENV ===
|
|
|
27
23
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
24
|
});
|
|
29
25
|
exports.Wrapper = Wrapper;
|
|
30
|
-
|
|
26
|
+
const StyledTextField = /*#__PURE__*/(0, _base.default)(_.TextField, process.env.NODE_ENV === "production" ? {
|
|
31
27
|
target: "e1603dot0"
|
|
32
28
|
} : {
|
|
33
29
|
target: "e1603dot0",
|
|
34
30
|
label: "StyledTextField"
|
|
35
|
-
})(
|
|
31
|
+
})(props => {
|
|
36
32
|
var _props$theme, _props$theme2, _props$theme3, _props$theme4;
|
|
37
33
|
return {
|
|
38
|
-
'& .MuiInputBase-root':
|
|
34
|
+
'& .MuiInputBase-root': {
|
|
39
35
|
':before': {
|
|
40
36
|
content: "''",
|
|
41
37
|
border: 'none'
|
|
@@ -49,15 +45,18 @@ var StyledTextField = /*#__PURE__*/(0, _base["default"])(_.TextField, process.en
|
|
|
49
45
|
':hover:after': {
|
|
50
46
|
content: 'none',
|
|
51
47
|
transform: 'scaleX(1)'
|
|
48
|
+
},
|
|
49
|
+
[`@media screen and (min-width: ${(_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.breakPoints.medium}px)`]: {
|
|
50
|
+
':hover:after': {
|
|
51
|
+
content: "''"
|
|
52
|
+
}
|
|
52
53
|
}
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
},
|
|
55
|
+
'& .MuiInputBase-input': {
|
|
56
|
+
[`@media screen and (min-width: ${(_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.breakPoints.medium}px)`]: {
|
|
57
|
+
color: (_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.palette.white
|
|
56
58
|
}
|
|
57
|
-
}
|
|
58
|
-
'& .MuiInputBase-input': _defineProperty({}, "@media screen and (min-width: ".concat((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.breakPoints.medium, "px)"), {
|
|
59
|
-
color: (_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.palette.white
|
|
60
|
-
})
|
|
59
|
+
}
|
|
61
60
|
};
|
|
62
61
|
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1NlYXJjaC9BdXRvQ29tcGxldGUvc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjK0IiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvU2VhcmNoL0F1dG9Db21wbGV0ZS9zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBUZXh0RmllbGQsIFRoZW1lIH0gZnJvbSAnLi4vLi4vLi4vJztcblxuZXhwb3J0IGludGVyZmFjZSBJbnB1dEZpZWxkUHJvcHMge1xuICBjb2xvcjogc3RyaW5nO1xufVxuXG5leHBvcnQgY29uc3QgV3JhcHBlciA9IHN0eWxlZCgnZGl2Jykoe1xuICB3aWR0aDogJzEwMCUnLFxuICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgekluZGV4OiAxLFxufSk7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRUZXh0RmllbGQgPSBzdHlsZWQoVGV4dEZpZWxkKTx7IHRoZW1lPzogVGhlbWUgfT4oKHByb3BzKSA9PiAoe1xuICAnJiAuTXVpSW5wdXRCYXNlLXJvb3QnOiB7XG4gICAgJzpiZWZvcmUnOiB7XG4gICAgICBjb250ZW50OiBcIicnXCIsXG4gICAgICBib3JkZXI6ICdub25lJyxcbiAgICB9LFxuICAgICc6YWZ0ZXInOiB7XG4gICAgICBib3JkZXJDb2xvcjogcHJvcHMudGhlbWU/LnBhbGV0dGUud2hpdGUsXG4gICAgfSxcbiAgICAnOmhvdmVyOmJlZm9yZSc6IHtcbiAgICAgIGNvbnRlbnQ6ICdub25lJyxcbiAgICB9LFxuICAgICc6aG92ZXI6YWZ0ZXInOiB7XG4gICAgICBjb250ZW50OiAnbm9uZScsXG4gICAgICB0cmFuc2Zvcm06ICdzY2FsZVgoMSknLFxuICAgIH0sXG4gICAgW2BAbWVkaWEgc2NyZWVuIGFuZCAobWluLXdpZHRoOiAke3Byb3BzLnRoZW1lPy5icmVha1BvaW50cy5tZWRpdW19cHgpYF06IHtcbiAgICAgICc6aG92ZXI6YWZ0ZXInOiB7XG4gICAgICAgIGNvbnRlbnQ6IFwiJydcIixcbiAgICAgIH0sXG4gICAgfSxcbiAgfSxcbiAgJyYgLk11aUlucHV0QmFzZS1pbnB1dCc6IHtcbiAgICBbYEBtZWRpYSBzY3JlZW4gYW5kIChtaW4td2lkdGg6ICR7cHJvcHMudGhlbWU/LmJyZWFrUG9pbnRzLm1lZGl1bX1weClgXToge1xuICAgICAgY29sb3I6IHByb3BzLnRoZW1lPy5wYWxldHRlLndoaXRlLFxuICAgIH0sXG4gIH0sXG59KSk7XG4iXX0= */");
|
|
63
62
|
exports.StyledTextField = StyledTextField;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _Search = _interopRequireDefault(require("@mui/icons-material/Search"));
|
|
8
8
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -14,40 +14,38 @@ var _ = require("../../");
|
|
|
14
14
|
var _AutoComplete = _interopRequireDefault(require("./AutoComplete"));
|
|
15
15
|
var _SearchItem = _interopRequireDefault(require("./SearchItem"));
|
|
16
16
|
var _styles = require("./styles");
|
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable verdaccio/jsx-spread */
|
|
27
|
-
var CONSTANTS = {
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable verdaccio/jsx-spread */
|
|
21
|
+
const CONSTANTS = {
|
|
28
22
|
API_DELAY: 300,
|
|
29
23
|
ABORT_ERROR: 'AbortError'
|
|
30
24
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
const Search = ({
|
|
26
|
+
history
|
|
27
|
+
}) => {
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = (0, _reactI18next.useTranslation)();
|
|
31
|
+
const {
|
|
32
|
+
configOptions: {
|
|
33
|
+
flags
|
|
34
|
+
}
|
|
35
|
+
} = (0, _.useConfig)();
|
|
36
|
+
const searchRemote = (flags === null || flags === void 0 ? void 0 : flags.searchRemote) || false;
|
|
37
|
+
const {
|
|
38
|
+
suggestions
|
|
39
|
+
} = (0, _reactRedux.useSelector)(state => state.search);
|
|
40
|
+
const isLoading = (0, _reactRedux.useSelector)(state => {
|
|
43
41
|
var _state$loading;
|
|
44
42
|
return state === null || state === void 0 ? void 0 : (_state$loading = state.loading) === null || _state$loading === void 0 ? void 0 : _state$loading.models.search;
|
|
45
43
|
});
|
|
46
|
-
|
|
44
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
47
45
|
/**
|
|
48
46
|
* Cancel all the requests which are in pending state.
|
|
49
47
|
*/
|
|
50
|
-
|
|
48
|
+
const cancelAllSearchRequests = (0, _react.useCallback)(() => {
|
|
51
49
|
dispatch.search.clearRequestQueue();
|
|
52
50
|
dispatch.search.saveSearch({
|
|
53
51
|
suggestions: []
|
|
@@ -58,7 +56,7 @@ var Search = function Search(_ref) {
|
|
|
58
56
|
* As user focuses out from input, we cancel all the request from requestList
|
|
59
57
|
* and set the API state parameters to default boolean values.
|
|
60
58
|
*/
|
|
61
|
-
|
|
59
|
+
const handleOnBlur = (0, _react.useCallback)(event => {
|
|
62
60
|
// stops event bubbling
|
|
63
61
|
event.stopPropagation();
|
|
64
62
|
cancelAllSearchRequests();
|
|
@@ -67,7 +65,7 @@ var Search = function Search(_ref) {
|
|
|
67
65
|
/**
|
|
68
66
|
* When an user select any package by clicking or pressing return key.
|
|
69
67
|
*/
|
|
70
|
-
|
|
68
|
+
const handleClickSearch = (0, _react.useCallback)((event, value, reason) => {
|
|
71
69
|
// stops event bubbling
|
|
72
70
|
event.stopPropagation();
|
|
73
71
|
switch (reason) {
|
|
@@ -75,9 +73,9 @@ var Search = function Search(_ref) {
|
|
|
75
73
|
if (searchRemote) {
|
|
76
74
|
// TODO: check this part
|
|
77
75
|
// @ts-ignore
|
|
78
|
-
history.push(
|
|
76
|
+
history.push(`/-/web/detail/${value.package.name}`);
|
|
79
77
|
} else {
|
|
80
|
-
history.push(
|
|
78
|
+
history.push(`/-/web/detail/${value.name}`);
|
|
81
79
|
}
|
|
82
80
|
break;
|
|
83
81
|
}
|
|
@@ -87,46 +85,48 @@ var Search = function Search(_ref) {
|
|
|
87
85
|
* Fetch packages from API.
|
|
88
86
|
* For AbortController see: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
|
89
87
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
const handleFetchPackages = (0, _react.useCallback)(({
|
|
89
|
+
value
|
|
90
|
+
}) => {
|
|
92
91
|
if ((value === null || value === void 0 ? void 0 : value.trim()) !== '') {
|
|
93
92
|
dispatch.search.clearRequestQueue();
|
|
94
93
|
dispatch.search.getSuggestions({
|
|
95
|
-
value
|
|
94
|
+
value
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
97
|
}, [dispatch]);
|
|
99
|
-
|
|
100
|
-
return /*#__PURE__*/_react
|
|
101
|
-
InputProps:
|
|
102
|
-
|
|
98
|
+
const renderInput = params => {
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledTextField, _extends({}, params, {
|
|
100
|
+
InputProps: {
|
|
101
|
+
...params.InputProps,
|
|
102
|
+
startAdornment: /*#__PURE__*/_react.default.createElement(_styles.StyledInputAdornment, {
|
|
103
103
|
position: "start"
|
|
104
|
-
}, /*#__PURE__*/_react
|
|
105
|
-
}
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, null))
|
|
105
|
+
},
|
|
106
106
|
label: "",
|
|
107
107
|
placeholder: t('search.packages'),
|
|
108
108
|
variant: "standard"
|
|
109
109
|
}));
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
const getOptionLabel = () => {
|
|
112
112
|
if (searchRemote) {
|
|
113
|
-
return
|
|
114
|
-
var _option$package
|
|
115
|
-
return (
|
|
113
|
+
return option => {
|
|
114
|
+
var _option$package;
|
|
115
|
+
return (option === null || option === void 0 ? void 0 : (_option$package = option.package) === null || _option$package === void 0 ? void 0 : _option$package.name) ?? '';
|
|
116
116
|
};
|
|
117
117
|
} else {
|
|
118
|
-
return
|
|
118
|
+
return option => {
|
|
119
119
|
return option === null || option === void 0 ? void 0 : option.name;
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
const renderOption = (props, option) => {
|
|
124
124
|
if (searchRemote) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return /*#__PURE__*/_react
|
|
125
|
+
const item = option.package;
|
|
126
|
+
const isPrivate = option === null || option === void 0 ? void 0 : option.verdaccioPrivate;
|
|
127
|
+
const isCached = option === null || option === void 0 ? void 0 : option.verdaccioPkgCached;
|
|
128
|
+
const isRemote = !isCached && !isPrivate;
|
|
129
|
+
return /*#__PURE__*/_react.default.createElement(_SearchItem.default, _extends({}, props, {
|
|
130
130
|
description: item === null || item === void 0 ? void 0 : item.description,
|
|
131
131
|
isCached: isCached,
|
|
132
132
|
isPrivate: isPrivate,
|
|
@@ -135,18 +135,18 @@ var Search = function Search(_ref) {
|
|
|
135
135
|
version: item === null || item === void 0 ? void 0 : item.version
|
|
136
136
|
}));
|
|
137
137
|
} else {
|
|
138
|
-
return /*#__PURE__*/_react
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement(_SearchItem.default, _extends({}, props, {
|
|
139
139
|
description: option === null || option === void 0 ? void 0 : option.description,
|
|
140
140
|
name: option === null || option === void 0 ? void 0 : option.name,
|
|
141
141
|
version: option === null || option === void 0 ? void 0 : option.version
|
|
142
142
|
}));
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
|
-
return /*#__PURE__*/_react
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement(_AutoComplete.default, {
|
|
146
146
|
getOptionLabel: getOptionLabel(),
|
|
147
147
|
onCleanSuggestions: handleOnBlur,
|
|
148
148
|
onSelectItem: handleClickSearch,
|
|
149
|
-
onSuggestionsFetch: (0, _debounce
|
|
149
|
+
onSuggestionsFetch: (0, _debounce.default)(handleFetchPackages, CONSTANTS.API_DELAY),
|
|
150
150
|
placeholder: t('search.packages'),
|
|
151
151
|
renderInput: renderInput,
|
|
152
152
|
renderOption: renderOption,
|
|
@@ -155,5 +155,5 @@ var Search = function Search(_ref) {
|
|
|
155
155
|
});
|
|
156
156
|
};
|
|
157
157
|
var _default = (0, _reactRouter.withRouter)(Search);
|
|
158
|
-
exports
|
|
158
|
+
exports.default = _default;
|
|
159
159
|
//# sourceMappingURL=Search.js.map
|