@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
package/.babelrc
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../.babelrc",
|
|
3
3
|
"plugins": ["@emotion"],
|
|
4
|
+
"sourceMaps" : "inline",
|
|
4
5
|
"presets": [
|
|
5
|
-
[
|
|
6
|
-
"@babel/preset-env",
|
|
7
|
-
{
|
|
8
|
-
"targets": ["last 5 versions"],
|
|
9
|
-
"bugfixes": true,
|
|
10
|
-
"modules": "auto",
|
|
11
|
-
"debug": false
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
6
|
"@babel/preset-react"
|
|
15
7
|
]
|
|
16
8
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @verdaccio/ui-components
|
|
2
2
|
|
|
3
|
+
## 2.0.0-6-next.10
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7344a7fcf: feat: ui bugfixes and improvements
|
|
8
|
+
|
|
9
|
+
## 2.0.0-6-next.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0dafa982: fix: undefined field on missing count
|
|
14
|
+
|
|
3
15
|
## 2.0.0-6-next.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -3,51 +3,48 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
padding: 15,
|
|
35
|
-
flex: 1,
|
|
36
|
-
height: '100%'
|
|
37
|
-
}, "@media screen and (min-width: ".concat(theme === null || theme === void 0 ? void 0 : theme.breakPoints.container, "px)"), {
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const resetStyles = (0, _styles.makeStyles)(({
|
|
11
|
+
theme
|
|
12
|
+
}) => ({
|
|
13
|
+
'@global': {
|
|
14
|
+
// eslint-disable-next-line max-len
|
|
15
|
+
'html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video': {
|
|
16
|
+
fontFamily: '"Roboto", Helvetica Neue, Arial, sans-serif'
|
|
17
|
+
},
|
|
18
|
+
strong: {
|
|
19
|
+
fontWeight: theme === null || theme === void 0 ? void 0 : theme.fontWeight.semiBold
|
|
20
|
+
},
|
|
21
|
+
'html, body, #root': {
|
|
22
|
+
height: '100%'
|
|
23
|
+
},
|
|
24
|
+
ul: {
|
|
25
|
+
margin: 0,
|
|
26
|
+
padding: 0,
|
|
27
|
+
listStyle: 'none'
|
|
28
|
+
},
|
|
29
|
+
'.container': {
|
|
30
|
+
padding: 15,
|
|
31
|
+
flex: 1,
|
|
32
|
+
height: '100%',
|
|
33
|
+
[`@media screen and (min-width: ${theme === null || theme === void 0 ? void 0 : theme.breakPoints.container}px)`]: {
|
|
38
34
|
maxWidth: theme === null || theme === void 0 ? void 0 : theme.breakPoints.container,
|
|
39
35
|
width: '100%',
|
|
40
36
|
marginLeft: 'auto',
|
|
41
37
|
marginRight: 'auto'
|
|
42
|
-
}
|
|
38
|
+
}
|
|
43
39
|
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
const ResetStyles = ({
|
|
43
|
+
children
|
|
44
|
+
}) => {
|
|
48
45
|
resetStyles();
|
|
49
|
-
return /*#__PURE__*/_react
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
50
47
|
};
|
|
51
48
|
var _default = ResetStyles;
|
|
52
|
-
exports
|
|
49
|
+
exports.default = _default;
|
|
53
50
|
//# sourceMappingURL=ResetStyles.js.map
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
|
|
8
8
|
require("normalize.css");
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _ResetStyles = _interopRequireDefault(require("./ResetStyles"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
12
|
-
|
|
13
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_CssBaseline["default"], null), /*#__PURE__*/_react["default"].createElement(_ResetStyles["default"], null));
|
|
14
|
-
};
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const StyleBaseline = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CssBaseline.default, null), /*#__PURE__*/_react.default.createElement(_ResetStyles.default, null));
|
|
15
13
|
var _default = StyleBaseline;
|
|
16
|
-
exports
|
|
14
|
+
exports.default = _default;
|
|
17
15
|
//# sourceMappingURL=StyleBaseline.js.map
|
|
@@ -1,61 +1,51 @@
|
|
|
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.useCustomTheme = exports.ThemeProvider = void 0;
|
|
8
7
|
var _styles = require("@mui/material/styles");
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
9
|
+
var _useLocalStorage = _interopRequireDefault(require("../hooks/useLocalStorage"));
|
|
11
10
|
var _AppConfigurationProvider = require("../providers/AppConfigurationProvider");
|
|
12
11
|
var _theme = require("./theme");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
16
|
-
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
var ThemeContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const ThemeContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
23
16
|
function getDarkModeDefault(darkModeConfig) {
|
|
24
17
|
var _window$matchMedia, _window;
|
|
25
|
-
|
|
18
|
+
const prefersDarkMode = (_window$matchMedia = (_window = window).matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, '(prefers-color-scheme:dark)').matches;
|
|
26
19
|
if (typeof darkModeConfig === 'boolean') {
|
|
27
20
|
return darkModeConfig;
|
|
28
21
|
} else {
|
|
29
22
|
return prefersDarkMode;
|
|
30
23
|
}
|
|
31
24
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return /*#__PURE__*/_react["default"].createElement(ThemeContext.Provider, {
|
|
25
|
+
const ThemeProvider = ({
|
|
26
|
+
children
|
|
27
|
+
}) => {
|
|
28
|
+
const {
|
|
29
|
+
configOptions
|
|
30
|
+
} = (0, _AppConfigurationProvider.useConfig)();
|
|
31
|
+
const isDarkModeDefault = getDarkModeDefault(configOptions.darkMode);
|
|
32
|
+
const isSwitchThemeEnabled = configOptions.showThemeSwitch;
|
|
33
|
+
const [isDarkModeStorage, setIsDarkMode] = (0, _useLocalStorage.default)('darkMode', isDarkModeDefault);
|
|
34
|
+
const isDarkMode = isSwitchThemeEnabled === true ? isDarkModeStorage : isDarkModeDefault;
|
|
35
|
+
const themeMode = isDarkMode ? 'dark' : 'light';
|
|
36
|
+
const currentTheme = (0, _theme.getTheme)(themeMode, configOptions.primaryColor);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(ThemeContext.Provider, {
|
|
46
38
|
value: {
|
|
47
|
-
isDarkMode
|
|
48
|
-
setIsDarkMode
|
|
39
|
+
isDarkMode,
|
|
40
|
+
setIsDarkMode
|
|
49
41
|
}
|
|
50
|
-
}, /*#__PURE__*/_react
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.StyledEngineProvider, {
|
|
51
43
|
injectFirst: true
|
|
52
|
-
}, /*#__PURE__*/_react
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
53
45
|
theme: currentTheme
|
|
54
46
|
}, children)));
|
|
55
47
|
};
|
|
56
48
|
exports.ThemeProvider = ThemeProvider;
|
|
57
|
-
|
|
58
|
-
return (0, _react.useContext)(ThemeContext);
|
|
59
|
-
};
|
|
49
|
+
const useCustomTheme = () => (0, _react.useContext)(ThemeContext);
|
|
60
50
|
exports.useCustomTheme = useCustomTheme;
|
|
61
51
|
//# sourceMappingURL=ThemeProvider.js.map
|
package/build/Theme/colors.js
CHANGED
package/build/Theme/index.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
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, "FontWeight", {
|
|
8
7
|
enumerable: true,
|
|
9
|
-
get: function
|
|
8
|
+
get: function () {
|
|
10
9
|
return _theme.FontWeight;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
Object.defineProperty(exports, "StyleBaseline", {
|
|
14
13
|
enumerable: true,
|
|
15
|
-
get: function
|
|
16
|
-
return _StyleBaseline
|
|
14
|
+
get: function () {
|
|
15
|
+
return _StyleBaseline.default;
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
Object.defineProperty(exports, "Theme", {
|
|
20
19
|
enumerable: true,
|
|
21
|
-
get: function
|
|
20
|
+
get: function () {
|
|
22
21
|
return _theme.Theme;
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
26
25
|
enumerable: true,
|
|
27
|
-
get: function
|
|
26
|
+
get: function () {
|
|
28
27
|
return _ThemeProvider.ThemeProvider;
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
exports.colors = void 0;
|
|
32
31
|
Object.defineProperty(exports, "useCustomTheme", {
|
|
33
32
|
enumerable: true,
|
|
34
|
-
get: function
|
|
33
|
+
get: function () {
|
|
35
34
|
return _ThemeProvider.useCustomTheme;
|
|
36
35
|
}
|
|
37
36
|
});
|
|
@@ -40,7 +39,7 @@ exports.colors = _colors;
|
|
|
40
39
|
var _ThemeProvider = require("./ThemeProvider");
|
|
41
40
|
var _StyleBaseline = _interopRequireDefault(require("./StyleBaseline"));
|
|
42
41
|
var _theme = require("./theme");
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
44
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
45
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
42
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
|
+
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); }
|
|
44
|
+
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; }
|
|
46
45
|
//# sourceMappingURL=index.js.map
|
package/build/Theme/theme.js
CHANGED
|
@@ -6,13 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getTheme = exports.breakPoints = void 0;
|
|
7
7
|
var _styles = require("@mui/material/styles");
|
|
8
8
|
var _colors = require("./colors");
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
-
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); }
|
|
15
|
-
var colors = {
|
|
9
|
+
const colors = {
|
|
16
10
|
black: '#000',
|
|
17
11
|
white: '#fff',
|
|
18
12
|
red: '#d32f2f',
|
|
@@ -39,13 +33,16 @@ var colors = {
|
|
|
39
33
|
dodgerBlue: '#1ba1f2',
|
|
40
34
|
cyanBlue: '#253341'
|
|
41
35
|
};
|
|
42
|
-
|
|
43
|
-
light:
|
|
44
|
-
|
|
36
|
+
const themeModes = {
|
|
37
|
+
light: {
|
|
38
|
+
...colors
|
|
39
|
+
},
|
|
40
|
+
dark: {
|
|
41
|
+
...colors,
|
|
45
42
|
primary: '#24394e',
|
|
46
43
|
secondary: '#424242',
|
|
47
44
|
background: '#1A202C'
|
|
48
|
-
}
|
|
45
|
+
}
|
|
49
46
|
};
|
|
50
47
|
function applyPrimaryColor(mode, primaryColor) {
|
|
51
48
|
if (mode === 'light') {
|
|
@@ -53,22 +50,22 @@ function applyPrimaryColor(mode, primaryColor) {
|
|
|
53
50
|
}
|
|
54
51
|
return themeModes[mode];
|
|
55
52
|
}
|
|
56
|
-
|
|
53
|
+
const fontSize = {
|
|
57
54
|
xxl: 26,
|
|
58
55
|
xl: 24,
|
|
59
56
|
lg: 21,
|
|
60
57
|
md: 18,
|
|
61
|
-
|
|
58
|
+
default: 16,
|
|
62
59
|
sm: 14,
|
|
63
60
|
ssm: 12
|
|
64
61
|
};
|
|
65
|
-
|
|
62
|
+
const fontWeight = {
|
|
66
63
|
light: 300,
|
|
67
64
|
regular: 400,
|
|
68
65
|
semiBold: 500,
|
|
69
66
|
bold: 700
|
|
70
67
|
};
|
|
71
|
-
|
|
68
|
+
const breakPoints = {
|
|
72
69
|
xsmall: 400,
|
|
73
70
|
small: 576,
|
|
74
71
|
medium: 768,
|
|
@@ -77,20 +74,20 @@ var breakPoints = {
|
|
|
77
74
|
xlarge: 1275
|
|
78
75
|
};
|
|
79
76
|
exports.breakPoints = breakPoints;
|
|
80
|
-
|
|
81
|
-
fontSize
|
|
82
|
-
fontWeight
|
|
83
|
-
breakPoints
|
|
77
|
+
const customizedTheme = {
|
|
78
|
+
fontSize,
|
|
79
|
+
fontWeight,
|
|
80
|
+
breakPoints
|
|
84
81
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return (0, _styles.createTheme)(
|
|
82
|
+
const getTheme = (themeMode, primaryColor) => {
|
|
83
|
+
const palette = applyPrimaryColor(themeMode, primaryColor);
|
|
84
|
+
return (0, _styles.createTheme)({
|
|
88
85
|
typography: {
|
|
89
86
|
fontFamily: ['-apple-system', 'BlinkMacSystemFont', '"Helvetica Neue"', 'Arial', 'sans-serif'].join(',')
|
|
90
87
|
},
|
|
91
|
-
palette:
|
|
92
|
-
mode: themeMode
|
|
93
|
-
|
|
88
|
+
palette: {
|
|
89
|
+
mode: themeMode,
|
|
90
|
+
...palette,
|
|
94
91
|
primary: {
|
|
95
92
|
main: palette.primary
|
|
96
93
|
},
|
|
@@ -101,10 +98,11 @@ var getTheme = function getTheme(themeMode, primaryColor) {
|
|
|
101
98
|
main: palette.red
|
|
102
99
|
},
|
|
103
100
|
background: {
|
|
104
|
-
|
|
101
|
+
default: palette.background
|
|
105
102
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
103
|
+
},
|
|
104
|
+
...customizedTheme
|
|
105
|
+
});
|
|
108
106
|
};
|
|
109
107
|
exports.getTheme = getTheme;
|
|
110
108
|
//# sourceMappingURL=theme.js.map
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = _default;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
// eslint-disable
|
|
10
10
|
|
|
11
11
|
// @ts-ignore
|
|
12
|
-
function _default(
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
function _default({
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
15
16
|
}
|
|
16
17
|
// eslint-enable
|
|
17
18
|
//# sourceMappingURL=react-markdown.js.map
|
|
@@ -1,42 +1,33 @@
|
|
|
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 _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _utils = require("../../utils");
|
|
11
10
|
var _RawViewer = _interopRequireDefault(require("../RawViewer"));
|
|
12
11
|
var _ActionBarAction = _interopRequireDefault(require("./ActionBarAction"));
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
15
|
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); }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var ActionBar = function ActionBar(_ref) {
|
|
24
|
-
var showRaw = _ref.showRaw,
|
|
25
|
-
_ref$showDownloadTarb = _ref.showDownloadTarball,
|
|
26
|
-
showDownloadTarball = _ref$showDownloadTarb === void 0 ? true : _ref$showDownloadTarb,
|
|
27
|
-
packageMeta = _ref.packageMeta;
|
|
28
|
-
var _useState = (0, _react.useState)(false),
|
|
29
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
-
isRawViewerOpen = _useState2[0],
|
|
31
|
-
setIsRawViewerOpen = _useState2[1];
|
|
16
|
+
const ActionBar = ({
|
|
17
|
+
showRaw,
|
|
18
|
+
showDownloadTarball = true,
|
|
19
|
+
packageMeta
|
|
20
|
+
}) => {
|
|
21
|
+
const [isRawViewerOpen, setIsRawViewerOpen] = (0, _react.useState)(false);
|
|
32
22
|
if (!(packageMeta !== null && packageMeta !== void 0 && packageMeta.latest)) {
|
|
33
23
|
return null;
|
|
34
24
|
}
|
|
35
|
-
|
|
36
|
-
homepage
|
|
37
|
-
bugs
|
|
38
|
-
dist
|
|
39
|
-
|
|
25
|
+
const {
|
|
26
|
+
homepage,
|
|
27
|
+
bugs,
|
|
28
|
+
dist
|
|
29
|
+
} = packageMeta.latest;
|
|
30
|
+
const actions = [];
|
|
40
31
|
if (homepage && _utils.url.isURL(homepage)) {
|
|
41
32
|
actions.push({
|
|
42
33
|
type: 'VISIT_HOMEPAGE',
|
|
@@ -58,27 +49,23 @@ var ActionBar = function ActionBar(_ref) {
|
|
|
58
49
|
if (showRaw) {
|
|
59
50
|
actions.push({
|
|
60
51
|
type: 'RAW_DATA',
|
|
61
|
-
action:
|
|
62
|
-
return setIsRawViewerOpen(true);
|
|
63
|
-
}
|
|
52
|
+
action: () => setIsRawViewerOpen(true)
|
|
64
53
|
});
|
|
65
54
|
}
|
|
66
|
-
return /*#__PURE__*/_react
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
67
56
|
alignItems: "center",
|
|
68
57
|
display: "flex",
|
|
69
58
|
marginBottom: "14px"
|
|
70
|
-
}, actions.map(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, action));
|
|
74
|
-
}), isRawViewerOpen && /*#__PURE__*/_react["default"].createElement(_RawViewer["default"], {
|
|
59
|
+
}, actions.map(action => /*#__PURE__*/_react.default.createElement(_ActionBarAction.default, _extends({
|
|
60
|
+
key: action.type
|
|
61
|
+
}, action))), isRawViewerOpen && /*#__PURE__*/_react.default.createElement(_RawViewer.default, {
|
|
75
62
|
isOpen: isRawViewerOpen,
|
|
76
|
-
onClose:
|
|
63
|
+
onClose: () => {
|
|
77
64
|
setIsRawViewerOpen(false);
|
|
78
65
|
},
|
|
79
66
|
packageMeta: packageMeta
|
|
80
67
|
}));
|
|
81
68
|
};
|
|
82
69
|
var _default = ActionBar;
|
|
83
|
-
exports
|
|
70
|
+
exports.default = _default;
|
|
84
71
|
//# sourceMappingURL=ActionBar.js.map
|