@verdaccio/ui-components 2.0.0-6-next.8 → 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 +12 -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 -58
- 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 +12 -15
- package/build/components/Deprecated/index.js +3 -3
- package/build/components/Developers/Developers.js +30 -45
- package/build/components/Developers/Title.js +22 -21
- 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 +28 -23
- package/build/components/Distribution/index.js +3 -3
- package/build/components/Distribution/styles.js +7 -7
- package/build/components/Distribution/utils.js +0 -1
- package/build/components/Distribution/utilts.spec.js +18 -0
- package/build/components/Engines/Engines.js +46 -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 -44
- 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 +49 -40
- package/build/components/Install/index.js +3 -3
- package/build/components/Label/Label.js +13 -18
- 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 -83
- package/build/components/LoginDialog/LoginDialogCloseButton.js +20 -19
- package/build/components/LoginDialog/LoginDialogForm.js +41 -40
- 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 +25 -26
- package/build/components/NotFound/index.js +3 -3
- package/build/components/Package/Package.js +112 -152
- 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 +57 -65
- 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 +18 -23
- 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 -51
- package/build/providers/TranslatorProvider/TranslatorProvider.spec.js +54 -0
- 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 +24 -35
- package/build/sections/Detail/Detail.js +21 -30
- 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 +55 -57
- 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 -57
- 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/ActionBar/ActionBarAction.d.ts +1 -34
- package/build/src/components/Author/styles.d.ts +1 -20
- package/build/src/components/Dependencies/Dependencies.stories.d.ts +8 -6
- package/build/src/components/Dependencies/styles.d.ts +2 -30
- package/build/src/components/Deprecated/Deprecated.d.ts +1 -11
- package/build/src/components/Developers/Developers.d.ts +1 -34
- package/build/src/components/Developers/styles.d.ts +1 -34
- package/build/src/components/Distribution/Dist.stories.d.ts +4 -1
- package/build/src/components/Distribution/styles.d.ts +3 -76
- package/build/src/components/Distribution/utils.d.ts +2 -1
- package/build/src/components/Engines/styles.d.ts +1 -21
- package/build/src/components/FundButton/FundButton.stories.d.ts +7 -5
- package/build/src/components/Help/styles.d.ts +1 -10
- package/build/src/components/Icons/Earth.d.ts +2 -2
- package/build/src/components/Icons/FileBinary.d.ts +2 -2
- package/build/src/components/Icons/Law.d.ts +2 -2
- package/build/src/components/Icons/License.d.ts +2 -2
- package/build/src/components/Icons/SvgIcon.d.ts +1 -1
- package/build/src/components/Icons/Time.d.ts +2 -2
- package/build/src/components/Icons/Version.d.ts +2 -2
- package/build/src/components/Install/Install.stories.d.ts +9 -5
- package/build/src/components/MenuItem/MenuItem.d.ts +1 -1
- package/build/src/components/NoItems/NoItems.d.ts +0 -1
- package/build/src/components/Package/styles.d.ts +3 -61
- package/build/src/components/RegistryInfoDialog/styles.d.ts +1 -11
- package/build/src/components/Repository/Repository.stories.d.ts +8 -6
- package/build/src/components/Search/AutoComplete/styles.d.ts +1 -1
- package/build/src/components/Search/Search.d.ts +1 -1
- package/build/src/components/Search/styles.d.ts +2 -16
- 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/TextField/TextField.d.ts +1 -1
- 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/TranslatorProvider/TranslatorProvider.d.ts +2 -1
- package/build/src/providers/TranslatorProvider/TranslatorProvider.spec.d.ts +1 -0
- package/build/src/providers/VersionProvider/VersionProvider.d.ts +0 -2
- package/build/src/sections/Header/LanguageSwitch.d.ts +3 -23
- package/build/src/sections/Header/RegistryInfoDialog/styles.d.ts +1 -11
- package/build/src/sections/Header/styles.d.ts +8 -166
- package/build/src/types/packageMeta.d.ts +6 -6
- package/build/store/api.js +35 -52
- package/build/store/index.js +9 -9
- package/build/store/models/configuration.js +12 -34
- package/build/store/models/download.js +22 -46
- package/build/store/models/index.js +1 -1
- package/build/store/models/login.js +55 -79
- package/build/store/models/manifest.js +52 -78
- package/build/store/models/packages.js +22 -51
- package/build/store/models/search.js +59 -87
- 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 +4 -4
- package/build/utils/url.js +9 -9
- package/build/utils/utils.js +18 -22
- package/package.json +22 -19
- package/src/Theme/ThemeProvider.tsx +0 -1
- 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/Deprecated/Deprecated.tsx +1 -1
- package/src/components/Developers/Developers.stories.tsx +1 -1
- package/src/components/Distribution/Dist.stories.tsx +46 -3
- package/src/components/Distribution/Dist.test.tsx +33 -6
- package/src/components/Distribution/Dist.tsx +13 -5
- package/src/components/Distribution/utils.ts +3 -2
- package/src/components/Distribution/utilts.spec.ts +17 -0
- 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/Package/Package.tsx +1 -1
- 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/TranslatorProvider/TranslatorProvider.spec.tsx +52 -0
- package/src/providers/TranslatorProvider/TranslatorProvider.tsx +2 -1
- package/src/providers/VersionProvider/VersionProvider.test.tsx +1 -1
- 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/types/index.d.ts +2 -0
- package/src/types/packageMeta.ts +6 -6
- package/src/utils/url.test.ts +4 -0
- package/src/utils/url.ts +1 -1
- package/tsconfig.build.json +1 -0
- package/tsconfig.json +0 -1
|
@@ -17,7 +17,7 @@ Object.keys(_react).forEach(function (key) {
|
|
|
17
17
|
if (key in exports && exports[key] === _react[key]) return;
|
|
18
18
|
Object.defineProperty(exports, key, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _react[key];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -27,32 +27,27 @@ var _reactI18next = require("react-i18next");
|
|
|
27
27
|
var _reactRedux = require("react-redux");
|
|
28
28
|
var _Theme = require("../Theme");
|
|
29
29
|
var _AppConfigurationProvider = _interopRequireDefault(require("../providers/AppConfigurationProvider"));
|
|
30
|
+
var _PersistenceSettingProvider = _interopRequireDefault(require("../providers/PersistenceSettingProvider"));
|
|
30
31
|
var _i18nConfig = _interopRequireDefault(require("./i18n-config"));
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
const renderWithStore = (ui, store) => (0, _react.render)(ui, {
|
|
34
|
+
wrapper: ({
|
|
35
|
+
children
|
|
36
|
+
}) => /*#__PURE__*/_react2.default.createElement(_reactRedux.Provider, {
|
|
37
|
+
store: store
|
|
38
|
+
}, /*#__PURE__*/_react2.default.createElement(_PersistenceSettingProvider.default, null, /*#__PURE__*/_react2.default.createElement(_AppConfigurationProvider.default, null, /*#__PURE__*/_react2.default.createElement(_styles.StyledEngineProvider, {
|
|
39
|
+
injectFirst: true
|
|
40
|
+
}, /*#__PURE__*/_react2.default.createElement(_Theme.ThemeProvider, null, /*#__PURE__*/_react2.default.createElement(_reactI18next.I18nextProvider, {
|
|
41
|
+
i18n: _i18nConfig.default
|
|
42
|
+
}, children))))))
|
|
43
|
+
});
|
|
46
44
|
exports.renderWithStore = renderWithStore;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
options[_key - 1] = arguments[_key];
|
|
50
|
-
}
|
|
51
|
-
return _react.render.apply(void 0, [/*#__PURE__*/_react2["default"].createElement(_AppConfigurationProvider["default"], null, /*#__PURE__*/_react2["default"].createElement(_styles.StyledEngineProvider, {
|
|
45
|
+
const customRender = (node, ...options) => {
|
|
46
|
+
return (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_AppConfigurationProvider.default, null, /*#__PURE__*/_react2.default.createElement(_PersistenceSettingProvider.default, null, /*#__PURE__*/_react2.default.createElement(_styles.StyledEngineProvider, {
|
|
52
47
|
injectFirst: true
|
|
53
|
-
}, /*#__PURE__*/_react2
|
|
54
|
-
i18n: _i18nConfig
|
|
55
|
-
}, node))))
|
|
48
|
+
}, /*#__PURE__*/_react2.default.createElement(_Theme.ThemeProvider, null, /*#__PURE__*/_react2.default.createElement(_reactI18next.I18nextProvider, {
|
|
49
|
+
i18n: _i18nConfig.default
|
|
50
|
+
}, node))))), ...options);
|
|
56
51
|
};
|
|
57
52
|
exports.customRender = exports.render = customRender;
|
|
58
53
|
//# sourceMappingURL=test-react-testing-library.js.map
|
package/build/utils/cli-utils.js
CHANGED
|
@@ -8,35 +8,42 @@ exports.getCLIChangePassword = getCLIChangePassword;
|
|
|
8
8
|
exports.getCLISBerryYamlRegistry = getCLISBerryYamlRegistry;
|
|
9
9
|
exports.getCLISetConfigRegistry = getCLISetConfigRegistry;
|
|
10
10
|
exports.getCLISetRegistry = getCLISetRegistry;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
};
|
|
11
|
+
const copyToClipBoardUtility = str => event => {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
const node = document.createElement('div');
|
|
14
|
+
node.innerText = str;
|
|
15
|
+
if (document.body) {
|
|
16
|
+
document.body.appendChild(node);
|
|
17
|
+
const range = document.createRange();
|
|
18
|
+
const selection = window.getSelection();
|
|
19
|
+
range.selectNodeContents(node);
|
|
20
|
+
selection.removeAllRanges();
|
|
21
|
+
selection.addRange(range);
|
|
22
|
+
document.execCommand('copy');
|
|
23
|
+
document.body.removeChild(node);
|
|
24
|
+
}
|
|
27
25
|
};
|
|
28
26
|
exports.copyToClipBoardUtility = copyToClipBoardUtility;
|
|
29
27
|
function getCLISetConfigRegistry(command, scope, registryUrl) {
|
|
30
28
|
// if there is a scope defined there needs to be a ":" separator between the scope and the registry
|
|
31
|
-
return
|
|
29
|
+
return `${command} ${scope ? `${scope}:` : ''}registry ${registryUrl}`;
|
|
32
30
|
}
|
|
33
31
|
function getCLISetRegistry(command, registryUrl) {
|
|
34
|
-
return
|
|
32
|
+
return `${command} --registry ${registryUrl}`;
|
|
35
33
|
}
|
|
36
34
|
function getCLIChangePassword(command, registryUrl) {
|
|
37
|
-
return
|
|
35
|
+
return `${command} profile set password --registry ${registryUrl}`;
|
|
38
36
|
}
|
|
39
37
|
function getCLISBerryYamlRegistry(scope, registryUrl) {
|
|
40
|
-
return !scope ?
|
|
38
|
+
return !scope ? `// .yarnrc.yml
|
|
39
|
+
npmRegistryServer: "${registryUrl}"
|
|
40
|
+
unsafeHttpWhitelist:
|
|
41
|
+
- ${new URL(registryUrl).host}` : `
|
|
42
|
+
// .yarnrc.yml
|
|
43
|
+
npmRegistryServer: "${registryUrl}"
|
|
44
|
+
npmScopes:
|
|
45
|
+
${scope.replace('@', '')}:
|
|
46
|
+
npmRegistryServer: ${registryUrl}
|
|
47
|
+
npmPublishRegistry: ${registryUrl}`;
|
|
41
48
|
}
|
|
42
49
|
//# sourceMappingURL=cli-utils.js.map
|
package/build/utils/index.js
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
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
|
Object.defineProperty(exports, "Route", {
|
|
8
7
|
enumerable: true,
|
|
9
|
-
get: function
|
|
8
|
+
get: function () {
|
|
10
9
|
return _routes.Route;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
Object.defineProperty(exports, "getCLIChangePassword", {
|
|
14
13
|
enumerable: true,
|
|
15
|
-
get: function
|
|
14
|
+
get: function () {
|
|
16
15
|
return _cliUtils.getCLIChangePassword;
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
Object.defineProperty(exports, "getCLISBerryYamlRegistry", {
|
|
20
19
|
enumerable: true,
|
|
21
|
-
get: function
|
|
20
|
+
get: function () {
|
|
22
21
|
return _cliUtils.getCLISBerryYamlRegistry;
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
Object.defineProperty(exports, "getCLISetConfigRegistry", {
|
|
26
25
|
enumerable: true,
|
|
27
|
-
get: function
|
|
26
|
+
get: function () {
|
|
28
27
|
return _cliUtils.getCLISetConfigRegistry;
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
Object.defineProperty(exports, "getCLISetRegistry", {
|
|
32
31
|
enumerable: true,
|
|
33
|
-
get: function
|
|
32
|
+
get: function () {
|
|
34
33
|
return _cliUtils.getCLISetRegistry;
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
Object.defineProperty(exports, "loadable", {
|
|
38
37
|
enumerable: true,
|
|
39
|
-
get: function
|
|
40
|
-
return _loadable
|
|
38
|
+
get: function () {
|
|
39
|
+
return _loadable.default;
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
exports.utils = exports.url = void 0;
|
|
@@ -48,7 +47,7 @@ exports.utils = _utils;
|
|
|
48
47
|
var _cliUtils = require("./cli-utils");
|
|
49
48
|
var _loadable = _interopRequireDefault(require("./loadable"));
|
|
50
49
|
var _routes = require("./routes");
|
|
51
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
52
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
53
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
50
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
+
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); }
|
|
52
|
+
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; }
|
|
54
53
|
//# sourceMappingURL=index.js.map
|
package/build/utils/loadable.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
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 _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
10
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
11
10
|
/* eslint-disable verdaccio/jsx-spread */
|
|
12
11
|
/**
|
|
13
12
|
* With the combination of a bundler, enable to code split a package.
|
|
@@ -18,13 +17,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
18
17
|
```
|
|
19
18
|
@category HOC
|
|
20
19
|
*/
|
|
21
|
-
var _default =
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement(TargetComponent, props));
|
|
27
|
-
};
|
|
20
|
+
var _default = importCallback => {
|
|
21
|
+
const TargetComponent = /*#__PURE__*/(0, _react.lazy)(importCallback);
|
|
22
|
+
return props => /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
23
|
+
fallback: null
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement(TargetComponent, props));
|
|
28
25
|
};
|
|
29
|
-
exports
|
|
26
|
+
exports.default = _default;
|
|
30
27
|
//# sourceMappingURL=loadable.js.map
|
package/build/utils/routes.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Route = void 0;
|
|
7
|
-
|
|
8
|
-
exports.Route = Route;
|
|
9
|
-
(function (Route) {
|
|
7
|
+
let Route = /*#__PURE__*/function (Route) {
|
|
10
8
|
Route["ROOT"] = "/";
|
|
11
9
|
Route["SCOPE_PACKAGE"] = "/-/web/detail/@:scope/:package";
|
|
12
10
|
Route["SCOPE_PACKAGE_VERSION"] = "/-/web/detail/@:scope/:package/v/:version";
|
|
13
11
|
Route["PACKAGE"] = "/-/web/detail/:package";
|
|
14
12
|
Route["PACKAGE_VERSION"] = "/-/web/detail/:package/v/:version";
|
|
15
|
-
|
|
13
|
+
return Route;
|
|
14
|
+
}({});
|
|
15
|
+
exports.Route = Route;
|
|
16
16
|
//# sourceMappingURL=routes.js.map
|
package/build/utils/url.js
CHANGED
|
@@ -9,29 +9,29 @@ exports.isEmail = isEmail;
|
|
|
9
9
|
exports.isURL = isURL;
|
|
10
10
|
var _isEmail = _interopRequireDefault(require("validator/lib/isEmail"));
|
|
11
11
|
var _isURL = _interopRequireDefault(require("validator/lib/isURL"));
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function isURL(url) {
|
|
14
|
-
return (0, _isURL
|
|
15
|
-
protocols: ['http', 'https', 'git+https'],
|
|
14
|
+
return (0, _isURL.default)(url || '', {
|
|
15
|
+
protocols: ['http', 'https', 'git+https', 'git'],
|
|
16
16
|
require_protocol: true,
|
|
17
17
|
require_tld: false
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function isEmail(email) {
|
|
21
|
-
return (0, _isEmail
|
|
21
|
+
return (0, _isEmail.default)(email || '');
|
|
22
22
|
}
|
|
23
23
|
function extractFileName(url) {
|
|
24
24
|
return url.substring(url.lastIndexOf('/') + 1);
|
|
25
25
|
}
|
|
26
26
|
function blobToFile(blob, fileName) {
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
-
|
|
28
|
+
const b = blob;
|
|
29
29
|
b.lastModified = Date.now();
|
|
30
30
|
b.name = fileName;
|
|
31
31
|
return b;
|
|
32
32
|
}
|
|
33
33
|
function downloadFile(fileStream, fileName) {
|
|
34
|
-
|
|
34
|
+
let file;
|
|
35
35
|
// File constructor is not supported by Edge
|
|
36
36
|
// https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility
|
|
37
37
|
// @ts-ignore. Please see: https://github.com/microsoft/TypeScript/issues/33792
|
|
@@ -46,8 +46,8 @@ function downloadFile(fileStream, fileName) {
|
|
|
46
46
|
lastModified: Date.now()
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const objectURL = URL.createObjectURL(file);
|
|
50
|
+
const fileLink = document.createElement('a');
|
|
51
51
|
fileLink.href = objectURL;
|
|
52
52
|
fileLink.download = fileName;
|
|
53
53
|
|
|
@@ -56,7 +56,7 @@ function downloadFile(fileStream, fileName) {
|
|
|
56
56
|
document.documentElement.appendChild(fileLink);
|
|
57
57
|
fileLink.click();
|
|
58
58
|
// firefox requires remove the object url
|
|
59
|
-
setTimeout(
|
|
59
|
+
setTimeout(() => {
|
|
60
60
|
URL.revokeObjectURL(objectURL);
|
|
61
61
|
document.documentElement.removeChild(fileLink);
|
|
62
62
|
}, 150);
|
package/build/utils/utils.js
CHANGED
|
@@ -17,11 +17,11 @@ var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFor
|
|
|
17
17
|
var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"));
|
|
18
18
|
var _i18next = _interopRequireDefault(require("i18next"));
|
|
19
19
|
var _isString = _interopRequireDefault(require("lodash/isString"));
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
21
|
-
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
const TIMEFORMAT = 'L LTS';
|
|
22
22
|
exports.TIMEFORMAT = TIMEFORMAT;
|
|
23
|
-
_dayjs
|
|
24
|
-
_dayjs
|
|
23
|
+
_dayjs.default.extend(_relativeTime.default);
|
|
24
|
+
_dayjs.default.extend(_localizedFormat.default);
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Formats license field for webui.
|
|
@@ -30,7 +30,7 @@ _dayjs["default"].extend(_localizedFormat["default"]);
|
|
|
30
30
|
// License should use type License defined above, but conflicts with the unit test that provide array or empty object
|
|
31
31
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
32
32
|
function formatLicense(license) {
|
|
33
|
-
if ((0, _isString
|
|
33
|
+
if ((0, _isString.default)(license)) {
|
|
34
34
|
return license;
|
|
35
35
|
}
|
|
36
36
|
if (license !== null && license !== void 0 && license.type) {
|
|
@@ -46,7 +46,7 @@ function formatLicense(license) {
|
|
|
46
46
|
// Repository should use type Repository defined above, but conflicts with the unit test that provide array or empty object
|
|
47
47
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
48
48
|
function formatRepository(repository) {
|
|
49
|
-
if ((0, _isString
|
|
49
|
+
if ((0, _isString.default)(repository)) {
|
|
50
50
|
return repository;
|
|
51
51
|
}
|
|
52
52
|
if (repository !== null && repository !== void 0 && repository.url) {
|
|
@@ -55,21 +55,20 @@ function formatRepository(repository) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
function formatDate(lastUpdate) {
|
|
58
|
-
return (0, _dayjs
|
|
58
|
+
return (0, _dayjs.default)(new Date(lastUpdate)).format(TIMEFORMAT);
|
|
59
59
|
}
|
|
60
60
|
function formatDateDistance(lastUpdate) {
|
|
61
|
-
return (0, _dayjs
|
|
61
|
+
return (0, _dayjs.default)(new Date(lastUpdate)).fromNow();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* For <LastSync /> component
|
|
66
66
|
* @param {array} uplinks
|
|
67
67
|
*/
|
|
68
|
-
function getLastUpdatedPackageTime() {
|
|
69
|
-
|
|
70
|
-
var lastUpdate = 0;
|
|
68
|
+
function getLastUpdatedPackageTime(uplinks = {}) {
|
|
69
|
+
let lastUpdate = 0;
|
|
71
70
|
Object.keys(uplinks).forEach(function computeUplink(upLinkName) {
|
|
72
|
-
|
|
71
|
+
const status = uplinks[upLinkName];
|
|
73
72
|
if (status.fetched > lastUpdate) {
|
|
74
73
|
lastUpdate = status.fetched;
|
|
75
74
|
}
|
|
@@ -82,22 +81,19 @@ function getLastUpdatedPackageTime() {
|
|
|
82
81
|
* @param {Object} time
|
|
83
82
|
* @returns {Array} last 3 releases
|
|
84
83
|
*/
|
|
85
|
-
function getRecentReleases() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
time: formatDate(time[version])
|
|
91
|
-
};
|
|
92
|
-
});
|
|
84
|
+
function getRecentReleases(time = {}) {
|
|
85
|
+
const recent = Object.keys(time).map(version => ({
|
|
86
|
+
version,
|
|
87
|
+
time: formatDate(time[version])
|
|
88
|
+
}));
|
|
93
89
|
return recent.slice(recent.length - 3, recent.length).reverse();
|
|
94
90
|
}
|
|
95
91
|
function getAuthorName(authorName) {
|
|
96
92
|
if (!authorName) {
|
|
97
|
-
return _i18next
|
|
93
|
+
return _i18next.default.t('author-unknown');
|
|
98
94
|
}
|
|
99
95
|
if (authorName.toLowerCase() === 'anonymous') {
|
|
100
|
-
return _i18next
|
|
96
|
+
return _i18next.default.t('author-anonymous');
|
|
101
97
|
}
|
|
102
98
|
return authorName;
|
|
103
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/ui-components",
|
|
3
|
-
"version": "2.0.0-6-next.
|
|
3
|
+
"version": "2.0.0-6-next.10",
|
|
4
4
|
"description": "theme ui component",
|
|
5
5
|
"author": "Juan Picado <juanpicado19@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,46 +8,46 @@
|
|
|
8
8
|
"main": "./build/index.js",
|
|
9
9
|
"types": "build/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@emotion/react": "^11.10.
|
|
12
|
-
"@emotion/styled": "^11.10.
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
15
|
-
"@mui/
|
|
11
|
+
"@emotion/react": "^11.10.6",
|
|
12
|
+
"@emotion/styled": "^11.10.6",
|
|
13
|
+
"@fontsource/material-icons": "^4.5.4",
|
|
14
|
+
"@fontsource/roboto": "^4.5.8",
|
|
15
|
+
"@mui/icons-material": "5.11.16",
|
|
16
|
+
"@mui/material": "5.12.0",
|
|
17
|
+
"@mui/styles": "5.12.0",
|
|
18
|
+
"@mui/system": "5.12.0",
|
|
16
19
|
"@rematch/core": "2.2.0",
|
|
17
20
|
"@rematch/loading": "2.1.2",
|
|
18
21
|
"@rematch/persist": "2.1.2",
|
|
19
|
-
"
|
|
22
|
+
"country-flag-icons": "1.5.5",
|
|
20
23
|
"dayjs": "1.11.7",
|
|
21
24
|
"dompurify": "2.4.5",
|
|
22
25
|
"github-markdown-css": "5.1.0",
|
|
23
26
|
"highlight.js": "11.7.0",
|
|
27
|
+
"history": "4.10.1",
|
|
24
28
|
"i18next": "20.6.1",
|
|
25
29
|
"localstorage-memory": "1.0.3",
|
|
26
30
|
"lodash": "4.17.21",
|
|
27
|
-
"marked": "4.
|
|
31
|
+
"marked": "4.3.0",
|
|
28
32
|
"normalize.css": "8.0.1",
|
|
29
33
|
"react": "18.2.0",
|
|
30
34
|
"react-dom": "18.2.0",
|
|
35
|
+
"react-hook-form": "7.41.1",
|
|
31
36
|
"react-i18next": "12.1.1",
|
|
32
37
|
"react-json-view": "1.21.3",
|
|
38
|
+
"react-markdown": "8.0.5",
|
|
33
39
|
"react-redux": "7.2.9",
|
|
34
|
-
"react-hook-form": "7.41.1",
|
|
35
40
|
"react-router": "5.3.4",
|
|
36
41
|
"react-router-dom": "5.3.4",
|
|
37
42
|
"react-virtualized": "9.22.3",
|
|
38
|
-
"country-flag-icons": "1.5.5",
|
|
39
|
-
"history": "4.10.1",
|
|
40
|
-
"react-markdown": "8.0.5",
|
|
41
|
-
"remark-gfm": "3.0.1",
|
|
42
43
|
"redux": "4.2.1",
|
|
44
|
+
"remark-gfm": "3.0.1",
|
|
43
45
|
"validator": "13.9.0"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
48
|
"@babel/core": "^7.20.7",
|
|
47
|
-
"@emotion/babel-plugin": "11.10.
|
|
49
|
+
"@emotion/babel-plugin": "11.10.6",
|
|
48
50
|
"@emotion/jest": "11.10.5",
|
|
49
|
-
"@fontsource/material-icons": "^4.5.4",
|
|
50
|
-
"@fontsource/roboto": "^4.5.8",
|
|
51
51
|
"@storybook/addon-actions": "^6.5.15",
|
|
52
52
|
"@storybook/addon-essentials": "^6.5.15",
|
|
53
53
|
"@storybook/addon-interactions": "^6.5.15",
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"@testing-library/dom": "8.19.1",
|
|
60
60
|
"@testing-library/jest-dom": "5.16.5",
|
|
61
61
|
"@testing-library/react": "13.4.0",
|
|
62
|
+
"@types/hast": "^2.0.0",
|
|
63
|
+
"@types/react-router": "^5.1.20",
|
|
64
|
+
"@types/unist": "^2.0.0",
|
|
65
|
+
"@verdaccio/types": "11.0.0-6-next.25",
|
|
62
66
|
"babel-loader": "^8.3.0",
|
|
63
67
|
"mockdate": "3.0.5",
|
|
64
68
|
"msw": "0.49.2"
|
|
@@ -74,8 +78,7 @@
|
|
|
74
78
|
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
75
79
|
"build:js": "babel src/ --out-dir build/ --copy-files --no-copy-ignored --extensions \".ts,.tsx\" --source-maps --ignore \"src/**/*.stories.tsx\" --ignore \"src/**/*.test.tsx\" --ignore \"src/**/*.test.ts\"",
|
|
76
80
|
"build": "pnpm run build:js && pnpm run build:types",
|
|
77
|
-
"
|
|
81
|
+
"start": "start-storybook -p 6006 -s ./public",
|
|
78
82
|
"build-storybook": "build-storybook"
|
|
79
|
-
}
|
|
80
|
-
"readme": "# UI Components\n\nA collection of components ready to use for building complex user interfaces.\n\n- `components`: Independent components to use to build different layouts, all components are based on [MUI (Material UI)](https://mui.com/).\n- `providers`: Providers are useful components that uses the React [`Context`](https://reactjs.org/docs/context.html), for instance, the `VersionProvider` connects the Redux store with independent components. The `AppConfigurationProvider` is able to read the\n- `store`: The Redux store powered by [`Rematch`](https://rematchjs.org), could be used with the global object `__VERDACCIO_BASENAME_UI_OPTIONS` that verdaccio uses to provide the UI configuration.\n- `theme`: The `ThemeProvider` is an abstraction of the _material-ui_ theme provider.\n- `sections`: A group of components to setup quickly sections of the application, like the sidebar, header of footer.\n- `layouts`: Are the combination of one or more sections ready to use.\n- `hooks`: A collection of useful React hooks.\n\n```bash\nnpm i -D @verdaccio/ui-components@6-next\n```\n\n## Requirements\n\nThe set of components requires libraries available in a project:\n\n- React >17\n- Material UI >5.x\n- Redux >4.x\n- Emotion >11\n- i18next >20.x\n- TypeScript is optional but recommended.\n\n### The store\n\nAll components assume there is a Redux storage, thus a `<Provider/>` wrap is the required that wrap the application.\n\n```jsx\nimport { store } from '@verdaccio/ui-components';\n\n<Provider store={store}>....APP</Provider>;\n```\n\nThe default storage is powered by Rematch and contains the required `dispatch` to fetch data from the registry.\n\n- Fetch all private packages\n\n```jsx\nimport { useDispatch, useSelector } from 'react-redux';\n\nconst packages = useSelector((state: RootState) => state.packages.response);\nuseEffect(() => {\n dispatch.packages.getPackages();\n}, [dispatch]);\n```\n\n## How to use it\n\n```jsx\nimport React from 'react';\nimport { Route, Router, Switch } from 'react-router-dom';\nimport { Provider } from 'react-redux';\nimport {\n Home,\n store,\n Loading,\n NotFound,\n Route as Routes,\n TranslatorProvider,\n VersionProvider,\n loadable,\n} from '@verdaccio/ui-components';\n\n// to enable webpack code splitting\nconst VersionPage = loadable(() => import('../pages/Version'));\n\nconst App: React.FC = () => {\n // configuration from config.yaml\n const { configOptions } = useConfig();\n const listLanguages = [{lng: 'en-US', icon: <someSVGIcon>, menuKey: 'lng.english'}];\n return (\n <Provider store={store}>\n <AppConfigurationProvider>\n <ThemeProvider>\n <TranslatorProvider i18n={i18n} listLanguages={listLanguages} onMount={() => {}}>\n <Suspense fallback={<Loading />}>\n <Router history={history}>\n <Header HeaderInfoDialog={CustomInfoDialog} />\n <Switch>\n <Route exact={true} path={Routes.ROOT}>\n <Home />\n </Route>\n <Route exact={true} path={Routes.SCOPE_PACKAGE}>\n <VersionProvider>\n <VersionPage />\n </VersionProvider>\n </Route>\n </Switch>\n </Router>\n {configOptions.showFooter && <Footer />}\n </Suspense>\n </TranslatorProvider>\n </ThemeProvider>\n </AppConfigurationProvider>\n </Provider>\n );\n};\n``\n```\n"
|
|
83
|
+
}
|
|
81
84
|
}
|
|
@@ -30,7 +30,6 @@ const ThemeProvider: React.FC<{ children: any }> = ({ children }) => {
|
|
|
30
30
|
const themeMode: ThemeMode = isDarkMode ? 'dark' : 'light';
|
|
31
31
|
|
|
32
32
|
const currentTheme = getTheme(themeMode, configOptions.primaryColor);
|
|
33
|
-
|
|
34
33
|
return (
|
|
35
34
|
<ThemeContext.Provider value={{ isDarkMode, setIsDarkMode }}>
|
|
36
35
|
<StyledEngineProvider injectFirst={true}>
|
|
@@ -1,50 +1,64 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { clone, merge } from 'lodash';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
|
|
3
5
|
import { default as ActionBar } from '.';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
title: 'ActionBar
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
7
|
+
const meta: Meta<typeof ActionBar> = {
|
|
8
|
+
title: 'Components/Sidebar/ActionBar',
|
|
9
|
+
component: ActionBar,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof ActionBar>;
|
|
14
|
+
|
|
15
|
+
const packageMeta = {
|
|
16
|
+
_uplinks: {},
|
|
17
|
+
latest: {
|
|
18
|
+
name: 'verdaccio-ui/local-storage',
|
|
19
|
+
version: '8.0.1-next.1',
|
|
20
|
+
dist: {
|
|
21
|
+
fileCount: 0,
|
|
22
|
+
unpackedSize: 0,
|
|
23
|
+
tarball: 'https://registry.verdaccio.org/storybook/-/storybook-0.2.0.tgz',
|
|
24
|
+
},
|
|
25
|
+
homepage: 'https://verdaccio.org',
|
|
26
|
+
bugs: {
|
|
27
|
+
url: 'https://github.com/verdaccio/monorepo/issues',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Primary: Story = {
|
|
33
|
+
name: 'Default',
|
|
34
|
+
render: () => <ActionBar packageMeta={packageMeta} />,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Raw: Story = {
|
|
38
|
+
name: 'Raw viewer',
|
|
39
|
+
render: () => <ActionBar packageMeta={packageMeta} showRaw={true} />,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const NoLatest: Story = {
|
|
43
|
+
name: 'No latest (empty)',
|
|
44
|
+
render: () => <ActionBar packageMeta={{}} showRaw={true} />,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const Download: Story = {
|
|
48
|
+
name: 'No show download',
|
|
49
|
+
render: () => <ActionBar packageMeta={{ ...clone(packageMeta) }} showDownloadTarball={false} />,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Home: Story = {
|
|
53
|
+
name: 'No home',
|
|
54
|
+
render: () => (
|
|
55
|
+
<ActionBar packageMeta={{ ...merge(clone(packageMeta), { latest: { homepage: null } }) }} />
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Bugs: Story = {
|
|
60
|
+
name: 'No bugs',
|
|
61
|
+
render: () => (
|
|
62
|
+
<ActionBar packageMeta={{ ...merge(clone(packageMeta), { latest: { bugs: null } }) }} />
|
|
63
|
+
),
|
|
64
|
+
};
|