@verdaccio/ui-components 4.0.0-next-8.2 → 4.0.0-next-8.3
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 +9 -1
- package/CHANGELOG.md +2 -273
- package/build/AppTest/AppRoute.js +18 -27
- package/build/AppTest/pages/Front/Home.js +2 -8
- package/build/AppTest/pages/Front/index.js +1 -13
- package/build/AppTest/pages/Version/Version.js +15 -19
- package/build/AppTest/pages/Version/index.js +1 -13
- package/build/Theme/ResetStyles.js +10 -16
- package/build/Theme/StyleBaseline.js +6 -13
- package/build/Theme/ThemeProvider.js +25 -33
- package/build/Theme/colors.js +1 -7
- package/build/Theme/index.js +5 -44
- package/build/Theme/theme.js +26 -32
- package/build/components/ActionBar/ActionBar.js +26 -33
- package/build/components/ActionBar/ActionBarAction.js +59 -59
- package/build/components/ActionBar/index.js +1 -13
- package/build/components/Author/Author.js +17 -23
- package/build/components/Author/index.js +1 -13
- package/build/components/Author/styles.js +5 -12
- package/build/components/CopyClipboard/CopyToClipBoard.js +40 -40
- package/build/components/CopyClipboard/index.js +2 -20
- package/build/components/CopyClipboard/utils.js +1 -8
- package/build/components/Dependencies/Dependencies.js +27 -34
- package/build/components/Dependencies/DependencyBlock.js +29 -35
- package/build/components/Dependencies/index.js +1 -13
- package/build/components/Dependencies/types.js +1 -5
- package/build/components/Dependencies/utits.js +1 -7
- package/build/components/Deprecated/Deprecated.js +10 -16
- package/build/components/Deprecated/index.js +1 -13
- package/build/components/Developers/DeveloperType.js +1 -7
- package/build/components/Developers/Developers.js +29 -37
- package/build/components/Developers/Title.js +26 -29
- package/build/components/Developers/get-unique-developer-values.js +1 -7
- package/build/components/Developers/index.js +2 -20
- package/build/components/Distribution/Dist.js +29 -32
- package/build/components/Distribution/index.js +1 -13
- package/build/components/Distribution/styles.js +7 -14
- package/build/components/Engines/Engines.js +53 -54
- package/build/components/Engines/index.js +1 -13
- package/build/components/Engines/styles.js +5 -12
- package/build/components/ErrorBoundary/ErrorBoundary.js +5 -14
- package/build/components/ErrorBoundary/index.js +1 -13
- package/build/components/Forbidden/Forbidden.js +33 -35
- package/build/components/Forbidden/index.js +1 -13
- package/build/components/FundButton/FundButton.js +42 -41
- package/build/components/FundButton/index.js +1 -13
- package/build/components/HeaderInfoDialog/HeaderInfoDialog.js +39 -41
- package/build/components/HeaderInfoDialog/index.js +1 -13
- package/build/components/Heading/Heading.js +12 -17
- package/build/components/Heading/index.js +1 -13
- package/build/components/Help/Help.js +23 -31
- package/build/components/Help/index.js +1 -13
- package/build/components/Help/styles.js +3 -10
- package/build/components/Icons/DevsIcons/CommonJS.js +4 -11
- package/build/components/Icons/DevsIcons/ES6Module.js +4 -11
- package/build/components/Icons/DevsIcons/Git.js +4 -11
- package/build/components/Icons/DevsIcons/NodeJS.js +4 -11
- package/build/components/Icons/DevsIcons/TypeScript.js +4 -11
- package/build/components/Icons/DevsIcons/index.js +5 -40
- package/build/components/Icons/Earth.js +13 -19
- package/build/components/Icons/FileBinary.js +6 -12
- package/build/components/Icons/Law.js +6 -12
- package/build/components/Icons/License.js +7 -13
- package/build/components/Icons/License.js.map +1 -1
- package/build/components/Icons/Managers/Npm.js +4 -11
- package/build/components/Icons/Managers/Pnpm.js +4 -11
- package/build/components/Icons/Managers/Yarn.js +4 -11
- package/build/components/Icons/Managers/index.js +3 -26
- package/build/components/Icons/SvgIcon.js +27 -23
- package/build/components/Icons/Time.js +8 -14
- package/build/components/Icons/Version.js +6 -12
- package/build/components/Icons/index.js +8 -79
- package/build/components/Install/Install.js +32 -39
- package/build/components/Install/InstallListItem.js +47 -52
- package/build/components/Install/index.js +1 -13
- package/build/components/Keywords/KeywordListItems.js +11 -17
- package/build/components/Keywords/Keywords.js +20 -25
- package/build/components/Keywords/index.js +1 -13
- package/build/components/Label/Label.js +17 -18
- package/build/components/Label/index.js +1 -13
- package/build/components/Link/Link.js +16 -22
- package/build/components/Link/index.js +1 -13
- package/build/components/LinkExternal/LinkExternal.js +15 -19
- package/build/components/LinkExternal/index.js +1 -13
- package/build/components/Loading/Loading.js +8 -15
- package/build/components/Loading/Spinner/Spinner.js +41 -35
- package/build/components/Loading/Spinner/index.js +1 -13
- package/build/components/Loading/index.js +1 -13
- package/build/components/Loading/styles.js +15 -19
- package/build/components/LoginDialog/LoginDialog.js +72 -68
- package/build/components/LoginDialog/LoginDialogCloseButton.js +28 -31
- package/build/components/LoginDialog/LoginDialogForm.js +46 -45
- package/build/components/LoginDialog/LoginDialogFormError.js +34 -36
- package/build/components/LoginDialog/LoginDialogHeader.js +42 -42
- package/build/components/LoginDialog/index.js +1 -13
- package/build/components/Logo/Logo.js +44 -47
- package/build/components/Logo/index.js +1 -13
- package/build/components/MenuItem/MenuItem.js +7 -16
- package/build/components/MenuItem/index.js +1 -13
- package/build/components/NoItems/NoItems.js +16 -17
- package/build/components/NoItems/index.js +1 -13
- package/build/components/NotFound/NotFound.js +31 -35
- package/build/components/NotFound/index.js +1 -13
- package/build/components/Package/Package.js +105 -100
- package/build/components/Package/index.js +1 -20
- package/build/components/Package/styles.js +78 -73
- package/build/components/PackageList/PackageList.js +56 -57
- package/build/components/PackageList/index.js +1 -13
- package/build/components/Person/Person.js +22 -28
- package/build/components/Person/PersonTooltip.js +17 -21
- package/build/components/Person/index.js +1 -13
- package/build/components/Person/utils.js +6 -14
- package/build/components/RawViewer/RawViewer.js +27 -33
- package/build/components/RawViewer/index.js +1 -13
- package/build/components/Readme/Readme.js +21 -27
- package/build/components/Readme/Readme.js.map +1 -1
- package/build/components/Readme/Readme.spec.js +10 -13
- package/build/components/Readme/Readme.spec.js.map +1 -1
- package/build/components/Readme/index.js +1 -13
- package/build/components/Readme/types.js +1 -5
- package/build/components/Readme/utils.js +8 -16
- package/build/components/RegistryInfoDialog/RegistryInfoDialog.js +18 -24
- package/build/components/RegistryInfoDialog/index.js +1 -13
- package/build/components/RegistryInfoDialog/styles.js +34 -32
- package/build/components/RegistryInfoDialog/types.js +1 -5
- package/build/components/Repository/Repository.js +36 -41
- package/build/components/Repository/index.js +1 -13
- package/build/components/Search/AutoComplete/AutoComplete.js +22 -31
- package/build/components/Search/AutoComplete/index.js +1 -13
- package/build/components/Search/AutoComplete/styles.js +2 -9
- package/build/components/Search/Search.js +71 -69
- package/build/components/Search/SearchItem.js +87 -79
- package/build/components/Search/index.js +1 -13
- package/build/components/Search/styles.js +7 -14
- package/build/components/Search/utils.js +3 -9
- package/build/components/SettingsMenu/SettingsMenu.js +56 -57
- package/build/components/SettingsMenu/index.js +1 -13
- package/build/components/SideBarTitle/SideBarTitle.js +52 -51
- package/build/components/SideBarTitle/index.js +1 -13
- package/build/components/SideBarTitle/utils.js +6 -15
- package/build/components/TextField/TextField.js +22 -21
- package/build/components/TextField/index.js +1 -13
- package/build/components/UpLinks/UpLinks.js +32 -38
- package/build/components/UpLinks/UplinkLink.js +12 -18
- package/build/components/UpLinks/index.js +1 -13
- package/build/components/UpLinks/styles.js +28 -29
- package/build/components/Versions/HistoryList.js +56 -60
- package/build/components/Versions/TagList.js +29 -33
- package/build/components/Versions/Versions.js +44 -52
- package/build/components/Versions/index.js +1 -13
- package/build/components/Versions/styles.js +26 -27
- package/build/components/Versions/types.js +1 -5
- package/build/hooks/index.js +2 -20
- package/build/hooks/useLocalStorage.js +7 -12
- package/build/hooks/useOnClickOutside.js +4 -9
- package/build/index.js +63 -530
- package/build/layouts/Version/Version.js +9 -16
- package/build/layouts/Version/index.js +1 -13
- package/build/providers/AppConfigurationProvider/AppConfigurationProvider.js +24 -31
- package/build/providers/AppConfigurationProvider/index.js +1 -20
- package/build/providers/PersistenceSettingProvider/PersistenceSettingProvider.js +15 -24
- package/build/providers/PersistenceSettingProvider/index.js +1 -20
- package/build/providers/TranslatorProvider/TranslatorProvider.js +24 -30
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +19 -22
- package/build/providers/TranslatorProvider/index.js +1 -26
- package/build/providers/VersionProvider/VersionProvider.js +27 -29
- package/build/providers/VersionProvider/index.js +1 -20
- package/build/providers/index.js +3 -38
- package/build/sections/Detail/ContainerContent.js +20 -28
- package/build/sections/Detail/Detail.js +22 -30
- package/build/sections/Detail/ReadmeSection.js +8 -14
- package/build/sections/Detail/Tabs.js +20 -26
- package/build/sections/Detail/index.js +1 -13
- package/build/sections/Footer/Footer.js +73 -70
- package/build/sections/Footer/index.js +1 -13
- package/build/sections/Footer/styles.js +62 -57
- package/build/sections/Header/Header.js +34 -42
- package/build/sections/Header/HeaderGreetings.js +12 -18
- package/build/sections/Header/HeaderLeft.js +25 -29
- package/build/sections/Header/HeaderMenu.js +23 -29
- package/build/sections/Header/HeaderRight.js +41 -49
- package/build/sections/Header/HeaderSettingsDialog.js +60 -58
- package/build/sections/Header/HeaderToolTip.js +13 -17
- package/build/sections/Header/HeaderToolTipIcon.js +23 -31
- package/build/sections/Header/LanguageSwitch.js +51 -54
- package/build/sections/Header/RegistryInfoContent/RegistryInfoContent.js +75 -80
- package/build/sections/Header/RegistryInfoContent/index.js +1 -13
- package/build/sections/Header/RegistryInfoContent/styles.js +12 -16
- package/build/sections/Header/index.js +1 -13
- package/build/sections/Header/styles.js +32 -36
- package/build/sections/Home/Home.js +14 -19
- package/build/sections/Home/index.js +1 -13
- package/build/sections/SideBar/Sidebar.js +40 -47
- package/build/sections/SideBar/index.js +1 -13
- package/build/sections/index.js +2 -20
- package/build/src/Theme/index.d.ts +1 -1
- package/build/store/api.js +28 -29
- package/build/store/index.js +3 -51
- package/build/store/models/configuration.js +20 -22
- package/build/store/models/download.js +26 -27
- package/build/store/models/index.js +13 -19
- package/build/store/models/login.js +60 -63
- package/build/store/models/manifest.js +57 -58
- package/build/store/models/packages.js +29 -27
- package/build/store/models/routes.js +1 -7
- package/build/store/models/search.js +62 -61
- package/build/store/models/utils.js +1 -7
- package/build/store/storage.js +4 -11
- package/build/store/store.js +6 -13
- package/build/test/i18n-config.js +4 -11
- package/build/test/test-react-testing-library.js +32 -50
- package/build/types/index.js +1 -5
- package/build/types/packageMeta.js +1 -5
- package/build/utils/__partials__/packageMeta.js +1 -7
- package/build/utils/cli-utils.js +12 -32
- package/build/utils/index.js +8 -74
- package/build/utils/loadable.js +6 -14
- package/build/utils/routes.js +1 -7
- package/build/utils/token.js +11 -18
- package/build/utils/url.js +12 -22
- package/build/utils/utils.js +32 -46
- package/package.json +11 -9
- package/src/AppTest/AppRoute.test.tsx +5 -4
- package/src/Theme/index.ts +1 -1
- package/src/components/Author/Author.test.tsx +2 -1
- package/src/components/CopyClipboard/CopyToClipBoard.test.tsx +2 -1
- package/src/components/Dependencies/Dependencies.test.tsx +7 -0
- package/src/components/Dependencies/DependencyBlock.test.tsx +3 -2
- package/src/components/Engines/Engines.test.tsx +3 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +2 -1
- package/src/components/Forbidden/Forbidden.test.tsx +3 -2
- package/src/components/HeaderInfoDialog/HeaderInfoDialog.test.tsx +2 -1
- package/src/components/LoginDialog/LoginDialog.test.tsx +8 -7
- package/src/components/NotFound/Notfound.test.tsx +3 -2
- package/src/components/PackageList/Packagelist.test.tsx +2 -1
- package/src/components/Search/Search.test.tsx +9 -8
- package/src/components/Versions/Versions.test.tsx +8 -8
- package/src/providers/TranslatorProvider/TranslatorProvider.spec.tsx +2 -1
- package/src/providers/VersionProvider/VersionProvider.tsx +5 -2
- package/src/sections/Home/Home.test.tsx +7 -3
- package/src/sections/SideBar/Sidebar.test.tsx +8 -7
- package/src/sections/SideBar/Sidebar.tsx +1 -0
- package/src/store/api.test.ts +8 -6
- package/src/store/models/login.test.ts +24 -20
- package/src/test/test-react-testing-library.tsx +3 -5
- package/src/utils/cli-utils.test.ts +10 -9
- package/src/utils/token.test.ts +5 -3
- package/tsconfig.build.json +1 -1
- package/vitest/api/glob-sidebar.json +12520 -0
- package/vitest/api/got-sidebar.json +23346 -0
- package/vitest/api/home-packages.json +40 -0
- package/vitest/api/jquery-readme.js +3 -0
- package/vitest/api/jquery-sidebar.json +5908 -0
- package/vitest/api/search-verdaccio.json +1192 -0
- package/vitest/api/storybook-readme.js +3 -0
- package/vitest/api/storybook-sidebar.json +53782 -0
- package/vitest/api/storybook-v.json +53782 -0
- package/vitest/identity.js +29 -0
- package/vitest/react-markdown.tsx +7 -0
- package/vitest/server-handlers.ts +82 -0
- package/vitest/server.ts +6 -0
- package/vitest/setup-env.ts +33 -0
- package/vitest/setup.ts +40 -0
- package/vitest/unit/components/__mocks__/token.ts +33 -0
- package/vitest/unit/empty-string.ts +1 -0
- package/vitest/unit/empty.ts +1 -0
- package/vitest/vitestSerializer.ts +31 -0
- package/vitest.config.mjs +39 -0
- package/build/__mocks__/react-markdown.js +0 -18
- package/build/__mocks__/remark-plugin.js +0 -8
- package/build/src/__mocks__/react-markdown.d.ts +0 -4
- package/build/src/__mocks__/remark-plugin.d.ts +0 -1
- package/src/__mocks__/react-markdown.tsx +0 -8
- package/src/__mocks__/remark-plugin.ts +0 -1
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
var _reactI18next = require("react-i18next");
|
|
14
|
-
var _providers = require("../../providers");
|
|
15
|
-
var _utils = require("../../utils");
|
|
16
|
-
var _Link = _interopRequireDefault(require("../Link"));
|
|
17
|
-
var _styles2 = require("./styles");
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
function filterDeprecated(versions) {
|
|
20
|
-
const versionsIds = Object.keys(versions);
|
|
1
|
+
import Chip from '@mui/material/Chip';
|
|
2
|
+
import List from '@mui/material/List';
|
|
3
|
+
import ListItem from '@mui/material/ListItem';
|
|
4
|
+
import { useTheme } from '@mui/styles';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useConfig } from '../../providers';
|
|
8
|
+
import { Route, utils } from '../../utils';
|
|
9
|
+
import Link from '../Link';
|
|
10
|
+
import { ListItemText, Spacer } from './styles';
|
|
11
|
+
export function filterDeprecated(versions) {
|
|
12
|
+
var versionsIds = Object.keys(versions);
|
|
21
13
|
return versionsIds.reduce((prev, current) => {
|
|
22
14
|
if (!versions[current].deprecated) {
|
|
23
15
|
prev[current] = versions[current];
|
|
@@ -25,48 +17,52 @@ function filterDeprecated(versions) {
|
|
|
25
17
|
return prev;
|
|
26
18
|
}, {});
|
|
27
19
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
var VersionsHistoryList = _ref => {
|
|
21
|
+
var {
|
|
22
|
+
versions,
|
|
23
|
+
packageName,
|
|
24
|
+
time
|
|
25
|
+
} = _ref;
|
|
26
|
+
var {
|
|
34
27
|
t
|
|
35
|
-
} =
|
|
36
|
-
|
|
28
|
+
} = useTranslation();
|
|
29
|
+
var {
|
|
37
30
|
configOptions
|
|
38
|
-
} =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/
|
|
31
|
+
} = useConfig();
|
|
32
|
+
var theme = useTheme();
|
|
33
|
+
var hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
34
|
+
var listVersions = hideDeprecatedVersions ? filterDeprecated(versions) : versions;
|
|
35
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
43
36
|
dense: true
|
|
44
|
-
}, Object.keys(listVersions).reverse().map(version =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
37
|
+
}, Object.keys(listVersions).reverse().map(version => {
|
|
38
|
+
var _versions$version;
|
|
39
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
40
|
+
className: "version-item",
|
|
41
|
+
"data-testid": "version-".concat(version),
|
|
42
|
+
key: version,
|
|
43
|
+
sx: {
|
|
44
|
+
pr: 0
|
|
45
|
+
}
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
47
|
+
to: "".concat(Route.DETAIL).concat(packageName, "/v/").concat(version),
|
|
48
|
+
variant: "outline"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(ListItemText, {
|
|
50
|
+
disableTypography: false,
|
|
51
|
+
primary: version
|
|
52
|
+
})), typeof ((_versions$version = versions[version]) === null || _versions$version === void 0 ? void 0 : _versions$version.deprecated) === 'string' ? /*#__PURE__*/React.createElement(Chip, {
|
|
53
|
+
color: "warning",
|
|
54
|
+
"data-testid": "deprecated-badge",
|
|
55
|
+
label: t('versions.deprecated'),
|
|
56
|
+
size: "small",
|
|
57
|
+
sx: {
|
|
58
|
+
marginLeft: theme.spacing(1)
|
|
59
|
+
},
|
|
60
|
+
variant: "outlined"
|
|
61
|
+
}) : null, /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(ListItemText, {
|
|
62
|
+
"data-testid": "version-list-text",
|
|
63
|
+
title: utils.formatDate(time[version])
|
|
64
|
+
}, time[version] ? utils.formatDateDistance(time[version]) : t('versions.not-available')));
|
|
65
|
+
}));
|
|
70
66
|
};
|
|
71
|
-
|
|
67
|
+
export default VersionsHistoryList;
|
|
72
68
|
//# sourceMappingURL=HistoryList.js.map
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tags,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
to: `${_utils.Route.DETAIL}${packageName}/v/${tags[tag]}`,
|
|
31
|
-
variant: "outline"
|
|
32
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.ListItemText, null, tag)), /*#__PURE__*/_react.default.createElement(_styles.Spacer, null), /*#__PURE__*/_react.default.createElement(_styles.ListItemText, null, tags[tag]))));
|
|
33
|
-
var _default = exports.default = VersionsTagList;
|
|
1
|
+
import List from '@mui/material/List';
|
|
2
|
+
import ListItem from '@mui/material/ListItem';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Route } from '../../utils';
|
|
5
|
+
import Link from '../Link';
|
|
6
|
+
import { ListItemText, Spacer } from './styles';
|
|
7
|
+
var VersionsTagList = _ref => {
|
|
8
|
+
var {
|
|
9
|
+
tags,
|
|
10
|
+
packageName,
|
|
11
|
+
time
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
14
|
+
dense: true
|
|
15
|
+
}, Object.keys(tags).sort((a, b) => {
|
|
16
|
+
return time[tags[a]] < time[tags[b]] ? 1 : time[tags[a]] > time[tags[b]] ? -1 : 0;
|
|
17
|
+
}).map(tag => /*#__PURE__*/React.createElement(ListItem, {
|
|
18
|
+
className: "version-item",
|
|
19
|
+
"data-testid": "tag-".concat(tag),
|
|
20
|
+
key: tag,
|
|
21
|
+
sx: {
|
|
22
|
+
pr: 0
|
|
23
|
+
}
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
25
|
+
to: "".concat(Route.DETAIL).concat(packageName, "/v/").concat(tags[tag]),
|
|
26
|
+
variant: "outline"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(ListItemText, null, tag)), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(ListItemText, null, tags[tag]))));
|
|
28
|
+
};
|
|
29
|
+
export default VersionsTagList;
|
|
34
30
|
//# sourceMappingURL=TagList.js.map
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
var _reactI18next = require("react-i18next");
|
|
18
|
-
var _semver = _interopRequireDefault(require("semver"));
|
|
19
|
-
var _providers = require("../../providers");
|
|
20
|
-
var _HistoryList = _interopRequireDefault(require("./HistoryList"));
|
|
21
|
-
var _TagList = _interopRequireDefault(require("./TagList"));
|
|
22
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
-
const StyledText = exports.StyledText = /*#__PURE__*/(0, _base.default)(_Typography.default, process.env.NODE_ENV === "production" ? {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
import Alert from '@mui/material/Alert';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import Card from '@mui/material/Card';
|
|
5
|
+
import CardContent from '@mui/material/CardContent';
|
|
6
|
+
import TextField from '@mui/material/TextField';
|
|
7
|
+
import Typography from '@mui/material/Typography';
|
|
8
|
+
import { useTheme } from '@mui/styles';
|
|
9
|
+
import debounce from 'lodash/debounce';
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import semver from 'semver';
|
|
13
|
+
import { useConfig } from '../../providers';
|
|
14
|
+
import VersionsHistoryList from './HistoryList';
|
|
15
|
+
import VersionsTagList from './TagList';
|
|
16
|
+
export var StyledText = /*#__PURE__*/_styled(Typography, process.env.NODE_ENV === "production" ? {
|
|
26
17
|
target: "e1kn2fte0"
|
|
27
18
|
} : {
|
|
28
19
|
target: "e1kn2fte0",
|
|
@@ -31,34 +22,35 @@ const StyledText = exports.StyledText = /*#__PURE__*/(0, _base.default)(_Typogra
|
|
|
31
22
|
fontWeight: props.theme && props.theme.fontWeight.bold,
|
|
32
23
|
textTransform: 'capitalize'
|
|
33
24
|
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1ZlcnNpb25zL1ZlcnNpb25zLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQjBCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1ZlcnNpb25zL1ZlcnNpb25zLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBBbGVydCBmcm9tICdAbXVpL21hdGVyaWFsL0FsZXJ0JztcbmltcG9ydCBCb3ggZnJvbSAnQG11aS9tYXRlcmlhbC9Cb3gnO1xuaW1wb3J0IENhcmQgZnJvbSAnQG11aS9tYXR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rpc3RUYWdzfSB0aW1lPXt0aW1lfSAvPlxuICAgICAgICAgICAgPC8+XG4gICAgICAgICAgKSA6IG51bGx9XG4gICAgICAgICAgPD5cbiAgICAgICAgICAgIDxTdHlsZWRUZXh0IHZhcmlhbnQ9XCJzdWJ0aXRsZTFcIj5cbiAgICAgICAgICAgICAge3QoJ3ZlcnNpb25zLnZlcnNpb24taGlzdG9yeScpfVxuICAgICAgICAgICAgICA8c3Bhbj57YCAoJHtPYmplY3Qua2V5cyhwYWNrYWdlVmVyc2lvbnMpLmxlbmd0aH0pYH08L3NwYW4+XG4gICAgICAgICAgICA8L1N0eWxlZFRleHQ+XG4gICAgICAgICAgICA8VGV4dEZpZWxkXG4gICAgICAgICAgICAgIGhlbHBlclRleHQ9e3QoJ3ZlcnNpb25zLnNlYXJjaC5wbGFjZWhvbGRlcicpfVxuICAgICAgICAgICAgICBvbkNoYW5nZT17ZGVib3VuY2UoKGUpID0+IHtcbiAgICAgICAgICAgICAgICBmaWx0ZXJWZXJzaW9ucyhlLnRhcmdldC52YWx1ZSk7XG4gICAgICAgICAgICAgIH0sIDIwMCl9XG4gICAgICAgICAgICAgIHNpemU9XCJzbWFsbFwiXG4gICAgICAgICAgICAgIHZhcmlhbnQ9XCJzdGFuZGFyZFwiXG4gICAgICAgICAgICAgIHdpZHRoPVwiNTAlXCJcbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC8+XG4gICAgICAgICAge2hhc1ZlcnNpb25IaXN0b3J5ID8gKFxuICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAge2hpZGVEZXByZWNhdGVkVmVyc2lvbnMgPT09IHRydWUgJiYgKFxuICAgICAgICAgICAgICAgIDxBbGVydFxuICAgICAgICAgICAgICAgICAgc2V2ZXJpdHk9XCJpbmZvXCJcbiAgICAgICAgICAgICAgICAgIHN4PXt7IG1hcmdpblRvcDogdGhlbWUuc3BhY2luZygxKSwgbWFyZ2luQm90dG9tOiB0aGVtZS5zcGFjaW5nKDEpIH19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAge3QoJ3ZlcnNpb25zLmhpZGUtZGVwcmVjYXRlZCcpfVxuICAgICAgICAgICAgICAgIDwvQWxlcnQ+XG4gICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIDxWZXJzaW9uc0hpc3RvcnlMaXN0XG4gICAgICAgICAgICAgICAgcGFja2FnZU5hbWU9e3BhY2thZ2VOYW1lfVxuICAgICAgICAgICAgICAgIHRpbWU9e3RpbWV9XG4gICAgICAgICAgICAgICAgdmVyc2lvbnM9e3BhY2thZ2VWZXJzaW9uc31cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvPlxuICAgICAgICAgICkgOiBudWxsfVxuICAgICAgICA8L0JveD5cbiAgICAgIDwvQ2FyZENvbnRlbnQ+XG4gICAgPC9DYXJkPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgVmVyc2lvbnM7XG4iXX0= */");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
var Versions = _ref => {
|
|
26
|
+
var {
|
|
27
|
+
packageMeta,
|
|
28
|
+
packageName
|
|
29
|
+
} = _ref;
|
|
30
|
+
var {
|
|
39
31
|
t
|
|
40
|
-
} =
|
|
41
|
-
|
|
32
|
+
} = useTranslation();
|
|
33
|
+
var {
|
|
42
34
|
configOptions
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
} = useConfig();
|
|
36
|
+
var theme = useTheme();
|
|
37
|
+
var {
|
|
46
38
|
versions = {},
|
|
47
39
|
time = {},
|
|
48
40
|
['dist-tags']: distTags = {}
|
|
49
41
|
} = packageMeta;
|
|
50
|
-
|
|
42
|
+
var [packageVersions, setPackageVersions] = useState(versions);
|
|
51
43
|
if (!packageMeta || Object.keys(packageMeta).length === 0) {
|
|
52
44
|
return null;
|
|
53
45
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
var hideDeprecatedVersions = configOptions.hideDeprecatedVersions;
|
|
47
|
+
var hasDistTags = distTags && Object.keys(distTags).length > 0 && packageName;
|
|
48
|
+
var hasVersionHistory = packageVersions && Object.keys(packageVersions).length > 0 && packageName;
|
|
49
|
+
var filterVersions = textSearch => {
|
|
50
|
+
var filteredVersions = Object.keys(versions).reduce((acc, version) => {
|
|
59
51
|
if (textSearch !== '') {
|
|
60
52
|
if (typeof versions[version] !== 'undefined') {
|
|
61
|
-
if (
|
|
53
|
+
if (semver.satisfies(version, textSearch, {
|
|
62
54
|
includePrerelease: true,
|
|
63
55
|
loose: true
|
|
64
56
|
})) {
|
|
@@ -72,42 +64,42 @@ const Versions = ({
|
|
|
72
64
|
}, {});
|
|
73
65
|
setPackageVersions(filteredVersions);
|
|
74
66
|
};
|
|
75
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
76
68
|
sx: {
|
|
77
69
|
mb: 2
|
|
78
70
|
}
|
|
79
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(Box, {
|
|
80
72
|
"data-testid": "versions",
|
|
81
73
|
sx: {
|
|
82
74
|
m: 2
|
|
83
75
|
}
|
|
84
|
-
}, hasDistTags ? /*#__PURE__*/
|
|
76
|
+
}, hasDistTags ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledText, {
|
|
85
77
|
variant: "subtitle1"
|
|
86
|
-
}, t('versions.current-tags'), /*#__PURE__*/
|
|
78
|
+
}, t('versions.current-tags'), /*#__PURE__*/React.createElement("span", null, " (".concat(Object.keys(distTags).length, ")"))), /*#__PURE__*/React.createElement(VersionsTagList, {
|
|
87
79
|
packageName: packageName,
|
|
88
80
|
tags: distTags,
|
|
89
81
|
time: time
|
|
90
|
-
})) : null, /*#__PURE__*/
|
|
82
|
+
})) : null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledText, {
|
|
91
83
|
variant: "subtitle1"
|
|
92
|
-
}, t('versions.version-history'), /*#__PURE__*/
|
|
84
|
+
}, t('versions.version-history'), /*#__PURE__*/React.createElement("span", null, " (".concat(Object.keys(packageVersions).length, ")"))), /*#__PURE__*/React.createElement(TextField, {
|
|
93
85
|
helperText: t('versions.search.placeholder'),
|
|
94
|
-
onChange: (
|
|
86
|
+
onChange: debounce(e => {
|
|
95
87
|
filterVersions(e.target.value);
|
|
96
88
|
}, 200),
|
|
97
89
|
size: "small",
|
|
98
90
|
variant: "standard",
|
|
99
91
|
width: "50%"
|
|
100
|
-
})), hasVersionHistory ? /*#__PURE__*/
|
|
92
|
+
})), hasVersionHistory ? /*#__PURE__*/React.createElement(React.Fragment, null, hideDeprecatedVersions === true && /*#__PURE__*/React.createElement(Alert, {
|
|
101
93
|
severity: "info",
|
|
102
94
|
sx: {
|
|
103
95
|
marginTop: theme.spacing(1),
|
|
104
96
|
marginBottom: theme.spacing(1)
|
|
105
97
|
}
|
|
106
|
-
}, t('versions.hide-deprecated')), /*#__PURE__*/
|
|
98
|
+
}, t('versions.hide-deprecated')), /*#__PURE__*/React.createElement(VersionsHistoryList, {
|
|
107
99
|
packageName: packageName,
|
|
108
100
|
time: time,
|
|
109
101
|
versions: packageVersions
|
|
110
102
|
})) : null)));
|
|
111
103
|
};
|
|
112
|
-
|
|
104
|
+
export default Versions;
|
|
113
105
|
//# sourceMappingURL=Versions.js.map
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Versions.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _Versions = _interopRequireDefault(require("./Versions"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
export { default } from './Versions';
|
|
14
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Spacer = exports.ListItemText = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
|
-
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const Spacer = exports.Spacer = /*#__PURE__*/(0, _base.default)('div', process.env.NODE_ENV === "production" ? {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
import { default as MuiListItemText } from '@mui/material/ListItemText';
|
|
3
|
+
export var Spacer = /*#__PURE__*/_styled('div', process.env.NODE_ENV === "production" ? {
|
|
11
4
|
target: "e19ns5fr1"
|
|
12
5
|
} : {
|
|
13
6
|
target: "e19ns5fr1",
|
|
14
7
|
label: "Spacer"
|
|
15
|
-
})(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
})(_ref => {
|
|
9
|
+
var {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
12
|
+
return {
|
|
13
|
+
flex: '1 1 auto',
|
|
14
|
+
borderBottom: "1px dotted ".concat(theme.palette.mode == 'light' ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)', " "),
|
|
15
|
+
whiteSpace: 'nowrap',
|
|
16
|
+
height: '0.5em',
|
|
17
|
+
margin: '0 16px'
|
|
18
|
+
};
|
|
19
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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iB0aGVtZS5wYWxldHRlLndoaXRlLFxufSkpO1xuIl19 */");
|
|
20
|
+
export var ListItemText = /*#__PURE__*/_styled(MuiListItemText, process.env.NODE_ENV === "production" ? {
|
|
25
21
|
target: "e19ns5fr0"
|
|
26
22
|
} : {
|
|
27
23
|
target: "e19ns5fr0",
|
|
28
24
|
label: "ListItemText"
|
|
29
|
-
})(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
})(_ref2 => {
|
|
26
|
+
var {
|
|
27
|
+
theme
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return {
|
|
30
|
+
flex: 'none',
|
|
31
|
+
opacity: 0.6,
|
|
32
|
+
color: theme.palette.mode == 'light' ? theme.palette.black : theme.palette.white
|
|
33
|
+
};
|
|
34
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1ZlcnNpb25zL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlNEIiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvVmVyc2lvbnMvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZGVmYXVsdCBhcyBNdWlMaXN0SXRlbVRleHQgfSBmcm9tICdAbXVpL21hdGVyaWFsL0xpc3RJdGVtVGV4dCc7XG5cbmltcG9ydCB7IFRoZW1lIH0gZnJvbSAnLi4vLi4vVGhlbWUnO1xuXG5leHBvcnQgY29uc3QgU3BhY2VyID0gc3R5bGVkKCdkaXYnKTx7IHRoZW1lPzogVGhlbWUgfT4oKHsgdGhlbWUgfSkgPT4gKHtcbiAgZmxleDogJzEgMSBhdXRvJyxcbiAgYm9yZGVyQm90dG9tOiBgMXB4IGRvdHRlZCAke1xuICAgIHRoZW1lLnBhbGV0dGUubW9kZSA9PSAnbGlnaHQnID8gJ3JnYmEoMCwgMCwgMCwgMC4yKScgOiAncmdiYSgyNTUsIDI1NSwgMjU1LCAwLjIpJ1xuICB9IGAsXG4gIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICBoZWlnaHQ6ICcwLjVlbScsXG4gIG1hcmdpbjogJzAgMTZweCcsXG59KSk7XG5cbmV4cG9ydCBjb25zdCBMaXN0SXRlbVRleHQgPSBzdHlsZWQoTXVpTGlzdEl0ZW1UZXh0KTx7IHRoZW1lPzogVGhlbWUgfT4oKHsgdGhlbWUgfSkgPT4gKHtcbiAgZmxleDogJ25vbmUnLFxuICBvcGFjaXR5OiAwLjYsXG4gIGNvbG9yOiB0aGVtZS5wYWxldHRlLm1vZGUgPT0gJ2xpZ2h0JyA/IHRoZW1lLnBhbGV0dGUuYmxhY2sgOiB0aGVtZS5wYWxldHRlLndoaXRlLFxufSkpO1xuIl19 */");
|
|
36
35
|
//# sourceMappingURL=styles.js.map
|
package/build/hooks/index.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "useLocalStorage", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _useLocalStorage.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "useOnClickOutside", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _useOnClickOutside.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _useLocalStorage = _interopRequireDefault(require("./useLocalStorage"));
|
|
19
|
-
var _useOnClickOutside = _interopRequireDefault(require("./useOnClickOutside"));
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
export { default as useLocalStorage } from './useLocalStorage';
|
|
2
|
+
export { default as useOnClickOutside } from './useOnClickOutside';
|
|
21
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
3
|
/**
|
|
9
4
|
*
|
|
10
5
|
* @example
|
|
@@ -15,13 +10,13 @@ var _react = require("react");
|
|
|
15
10
|
based on https://usehooks.com/useLocalStorage/
|
|
16
11
|
@category Hooks
|
|
17
12
|
*/
|
|
18
|
-
|
|
13
|
+
var useLocalStorage = (key, initialValue) => {
|
|
19
14
|
// State to store our value
|
|
20
15
|
// Pass initial state function to useState so logic is only executed once
|
|
21
|
-
|
|
16
|
+
var [storedValue, setStoredValue] = useState(() => {
|
|
22
17
|
try {
|
|
23
18
|
// Get from local storage by key
|
|
24
|
-
|
|
19
|
+
var item = window.localStorage.getItem(key);
|
|
25
20
|
// Parse stored json or if none return initialValue
|
|
26
21
|
return item ? JSON.parse(item) : initialValue;
|
|
27
22
|
} catch (error) {
|
|
@@ -34,10 +29,10 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
34
29
|
|
|
35
30
|
// Return a wrapped version of useState's setter function that ...
|
|
36
31
|
// ... persists the new value to localStorage.
|
|
37
|
-
|
|
32
|
+
var setValue = value => {
|
|
38
33
|
try {
|
|
39
34
|
// Allow value to be a function so we have same API as useState
|
|
40
|
-
|
|
35
|
+
var valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
41
36
|
// Save state
|
|
42
37
|
setStoredValue(valueToStore);
|
|
43
38
|
// Save to local storage
|
|
@@ -49,5 +44,5 @@ const useLocalStorage = (key, initialValue) => {
|
|
|
49
44
|
};
|
|
50
45
|
return [storedValue, setValue];
|
|
51
46
|
};
|
|
52
|
-
|
|
47
|
+
export default useLocalStorage;
|
|
53
48
|
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
3
|
/**
|
|
9
4
|
*
|
|
10
5
|
* @example
|
|
@@ -12,8 +7,8 @@ var _react = require("react");
|
|
|
12
7
|
@category Hooks
|
|
13
8
|
*/
|
|
14
9
|
function useOnClickOutside(ref, handler) {
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
var listener = event => {
|
|
17
12
|
// Do nothing if clicking ref's element or descendent elements
|
|
18
13
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
19
14
|
return;
|
|
@@ -28,5 +23,5 @@ function useOnClickOutside(ref, handler) {
|
|
|
28
23
|
};
|
|
29
24
|
}, [ref, handler]);
|
|
30
25
|
}
|
|
31
|
-
|
|
26
|
+
export default useOnClickOutside;
|
|
32
27
|
//# sourceMappingURL=useOnClickOutside.js.map
|