@blaze-cms/plugin-admin-core-ui 0.128.0-admin-updates.1 → 0.128.0-alpha.0
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/CHANGELOG.md +1 -24
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/components/Language/Language.js.map +1 -1
- package/lib/components/Header/components/Language/index.js.map +1 -1
- package/lib/components/Header/components/Logo/Logo.js.map +1 -1
- package/lib/components/Header/components/Logo/index.js.map +1 -1
- package/lib/components/Header/components/Menu/Menu.js.map +1 -1
- package/lib/components/Header/components/Menu/index.js.map +1 -1
- package/lib/components/Header/components/index.js.map +1 -1
- package/lib/components/Header/index.js.map +1 -1
- package/lib/components/Layout/Layout.js +4 -5
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/components/Grid/Grid.js +1 -3
- package/lib/components/Layout/components/Grid/Grid.js.map +1 -1
- package/lib/components/Layout/components/Grid/index.js.map +1 -1
- package/lib/components/Layout/components/index.js.map +1 -1
- package/lib/components/SideBar/SideBar.js +5 -1
- package/lib/components/SideBar/SideBar.js.map +1 -1
- package/lib/components/SideBar/components/SideBlock.js.map +1 -1
- package/lib/components/SideBar/components/SideBlockItem.js.map +1 -1
- package/lib/components/SideBar/components/index.js.map +1 -1
- package/lib/components/SideBar/index.js.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/constants.js +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/containers/Home/Home.js +1 -1
- package/lib/containers/Home/Home.js.map +1 -1
- package/lib/containers/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/get-menu-items-resolver.js.map +1 -1
- package/lib/utils/menu-handler.js.map +1 -1
- package/lib-es/components/Header/Header.js +3 -3
- package/lib-es/components/Header/Header.js.map +1 -1
- package/lib-es/components/Header/components/Language/Language.js.map +1 -1
- package/lib-es/components/Header/components/Logo/Logo.js.map +1 -1
- package/lib-es/components/Header/components/Menu/Menu.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +4 -5
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/components/Layout/components/Grid/Grid.js +1 -3
- package/lib-es/components/Layout/components/Grid/Grid.js.map +1 -1
- package/lib-es/components/SideBar/SideBar.js +5 -1
- package/lib-es/components/SideBar/SideBar.js.map +1 -1
- package/lib-es/components/SideBar/components/SideBlock.js.map +1 -1
- package/lib-es/components/SideBar/components/SideBlockItem.js.map +1 -1
- package/lib-es/constants.js +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/containers/Home/Home.js +1 -1
- package/lib-es/containers/Home/Home.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/get-menu-items-resolver.js.map +1 -1
- package/lib-es/utils/menu-handler.js.map +1 -1
- package/package.json +8 -8
- package/src/components/Header/Header.js +7 -9
- package/src/components/Layout/Layout.js +7 -11
- package/src/components/Layout/components/Grid/Grid.js +1 -1
- package/src/components/SideBar/SideBar.js +3 -2
- package/src/constants.js +1 -1
- package/src/containers/Home/Home.js +1 -1
- package/lib/components/Layout/Background.js +0 -26
- package/lib/components/Layout/Background.js.map +0 -1
- package/lib-es/components/Layout/Background.js +0 -16
- package/lib-es/components/Layout/Background.js.map +0 -1
- package/src/components/Layout/Background.js +0 -16
- package/src/components/Layout/bg.svg +0 -22
|
@@ -3,17 +3,16 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Query } from '@apollo/client/react/components';
|
|
4
4
|
import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
5
5
|
import { Login } from '@blaze-cms/plugin-auth-ui';
|
|
6
|
+
import Header from '../Header';
|
|
6
7
|
import { Grid } from './components';
|
|
7
|
-
import Background from './Background';
|
|
8
8
|
import '@blaze-cms/admin-ui-styles/main.scss';
|
|
9
|
-
import Header from '../Header';
|
|
10
9
|
const Layout = ({
|
|
11
10
|
children
|
|
12
11
|
}) => {
|
|
13
12
|
const [isOpenMenu, setOpenMenu] = useState(true);
|
|
14
13
|
const onMenuClick = () => setOpenMenu(!isOpenMenu);
|
|
15
14
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: "site-container grid--site-container"
|
|
15
|
+
className: "site-container grid grid--site-container"
|
|
17
16
|
}, /*#__PURE__*/React.createElement(Query, {
|
|
18
17
|
query: getQuery('GET_USER_AUTH_DATA'),
|
|
19
18
|
errorPolicy: "all"
|
|
@@ -30,11 +29,11 @@ const Layout = ({
|
|
|
30
29
|
isLoggedIn: isLoggedIn,
|
|
31
30
|
onMenuClick: onMenuClick,
|
|
32
31
|
isOpenMenu: isOpenMenu
|
|
33
|
-
}), isLoggedIn ? /*#__PURE__*/React.createElement(
|
|
32
|
+
}), isLoggedIn ? /*#__PURE__*/React.createElement(Grid, {
|
|
34
33
|
isOpenMenu: isOpenMenu,
|
|
35
34
|
onMenuClick: onMenuClick,
|
|
36
35
|
userData: userData
|
|
37
|
-
}, children)
|
|
36
|
+
}, children) : /*#__PURE__*/React.createElement(Login, null));
|
|
38
37
|
}));
|
|
39
38
|
};
|
|
40
39
|
Layout.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["React","useState","PropTypes","Query","getQuery","Login","
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["React","useState","PropTypes","Query","getQuery","Login","Header","Grid","Layout","children","isOpenMenu","setOpenMenu","onMenuClick","createElement","className","query","errorPolicy","data","session","isLoggedIn","userData","Fragment","propTypes","oneOfType","arrayOf","node","isRequired"],"sources":["../../../src/components/Layout/Layout.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Query } from '@apollo/client/react/components';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { Login } from '@blaze-cms/plugin-auth-ui';\nimport Header from '../Header';\nimport { Grid } from './components';\n\nimport '@blaze-cms/admin-ui-styles/main.scss';\n\nconst Layout = ({ children }) => {\n const [isOpenMenu, setOpenMenu] = useState(true);\n const onMenuClick = () => setOpenMenu(!isOpenMenu);\n return (\n <div className=\"site-container grid grid--site-container\">\n <Query query={getQuery('GET_USER_AUTH_DATA')} errorPolicy=\"all\">\n {({ data = {} }) => {\n const { session: { isLoggedIn, userData = {} } = {} } = data;\n\n return (\n <>\n <Header isLoggedIn={isLoggedIn} onMenuClick={onMenuClick} isOpenMenu={isOpenMenu} />\n {isLoggedIn ? (\n <Grid isOpenMenu={isOpenMenu} onMenuClick={onMenuClick} userData={userData}>\n {children}\n </Grid>\n ) : (\n <Login />\n )}\n </>\n );\n }}\n </Query>\n </div>\n );\n};\n\nLayout.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nexport default Layout;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,KAAK,QAAQ,iCAAiC;AACvD,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,KAAK,QAAQ,2BAA2B;AACjD,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,IAAI,QAAQ,cAAc;AAEnC,OAAO,sCAAsC;AAE7C,MAAMC,MAAM,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC/B,MAAM,CAACC,UAAU,EAAEC,WAAW,CAAC,GAAGV,QAAQ,CAAC,IAAI,CAAC;EAChD,MAAMW,WAAW,GAAGA,CAAA,KAAMD,WAAW,CAAC,CAACD,UAAU,CAAC;EAClD,oBACEV,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAA0C,gBACvDd,KAAA,CAAAa,aAAA,CAACV,KAAK;IAACY,KAAK,EAAEX,QAAQ,CAAC,oBAAoB,CAAE;IAACY,WAAW,EAAC;EAAK,GAC5D,CAAC;IAAEC,IAAI,GAAG,CAAC;EAAE,CAAC,KAAK;IAClB,MAAM;MAAEC,OAAO,EAAE;QAAEC,UAAU;QAAEC,QAAQ,GAAG,CAAC;MAAE,CAAC,GAAG,CAAC;IAAE,CAAC,GAAGH,IAAI;IAE5D,oBACEjB,KAAA,CAAAa,aAAA,CAAAb,KAAA,CAAAqB,QAAA,qBACErB,KAAA,CAAAa,aAAA,CAACP,MAAM;MAACa,UAAU,EAAEA,UAAW;MAACP,WAAW,EAAEA,WAAY;MAACF,UAAU,EAAEA;IAAW,EAAG,EACnFS,UAAU,gBACTnB,KAAA,CAAAa,aAAA,CAACN,IAAI;MAACG,UAAU,EAAEA,UAAW;MAACE,WAAW,EAAEA,WAAY;MAACQ,QAAQ,EAAEA;IAAS,GACxEX,QAAQ,CACJ,gBAEPT,KAAA,CAAAa,aAAA,CAACR,KAAK,OACP,CACA;EAEP,CAAC,CACK,CACJ;AAEV,CAAC;AAEDG,MAAM,CAACc,SAAS,GAAG;EACjBb,QAAQ,EAAEP,SAAS,CAACqB,SAAS,CAAC,CAACrB,SAAS,CAACsB,OAAO,CAACtB,SAAS,CAACuB,IAAI,CAAC,EAAEvB,SAAS,CAACuB,IAAI,CAAC,CAAC,CAACC;AACrF,CAAC;AAED,eAAelB,MAAM"}
|
|
@@ -52,9 +52,7 @@ const Grid = ({
|
|
|
52
52
|
menuItems: menuItems,
|
|
53
53
|
onMenuClick: onMenuClick,
|
|
54
54
|
userData: userData
|
|
55
|
-
}),
|
|
56
|
-
className: "grid--main-content-wrapper"
|
|
57
|
-
}, children))) : 'loading';
|
|
55
|
+
}), children)) : 'loading';
|
|
58
56
|
};
|
|
59
57
|
Grid.propTypes = {
|
|
60
58
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","names":["React","useState","useEffect","PropTypes","useApolloClient","getQuery","MainContextProvider","SideBar","Grid","children","isOpenMenu","onMenuClick","userData","menuItems","setMenuItems","client","data","getMenuItems","query","parsedMenuItems","map","key","header","items","item","isDisplayedPrompt","updateItems","propTypes","oneOfType","arrayOf","node","isRequired","bool","func","object","defaultProps"],"sources":["../../../../../src/components/Layout/components/Grid/Grid.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery, MainContextProvider } from '@blaze-cms/admin-ui-utils';\nimport SideBar from '../../../SideBar';\n\nconst Grid = ({ children, isOpenMenu, onMenuClick, userData }) => {\n const [menuItems, setMenuItems] = useState(null);\n const client = useApolloClient();\n\n useEffect(\n () => {\n (async () => {\n const {\n data: { getMenuItems }\n } = await client.query({ query: getQuery('GET_MENU_ITEMS') });\n\n const parsedMenuItems = getMenuItems.map(([key, { header, items }]) => [\n key,\n {\n header,\n items: items.map(item => ({ ...item, isDisplayedPrompt: true }))\n }\n ]);\n\n if (!menuItems) {\n setMenuItems(parsedMenuItems);\n }\n })();\n },\n [client, menuItems]\n );\n\n const updateItems = items => {\n setMenuItems(items);\n };\n\n return menuItems ? (\n <MainContextProvider value={{ menuItems, setMenuItems: items => updateItems(items) }}>\n <div className=\"main-content grid grid--main-content\">\n <SideBar\n isOpenMenu={isOpenMenu}\n menuItems={menuItems}\n onMenuClick={onMenuClick}\n userData={userData}\n />\n
|
|
1
|
+
{"version":3,"file":"Grid.js","names":["React","useState","useEffect","PropTypes","useApolloClient","getQuery","MainContextProvider","SideBar","Grid","children","isOpenMenu","onMenuClick","userData","menuItems","setMenuItems","client","data","getMenuItems","query","parsedMenuItems","map","key","header","items","item","_objectSpread","isDisplayedPrompt","updateItems","createElement","value","className","propTypes","oneOfType","arrayOf","node","isRequired","bool","func","object","defaultProps"],"sources":["../../../../../src/components/Layout/components/Grid/Grid.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery, MainContextProvider } from '@blaze-cms/admin-ui-utils';\nimport SideBar from '../../../SideBar';\n\nconst Grid = ({ children, isOpenMenu, onMenuClick, userData }) => {\n const [menuItems, setMenuItems] = useState(null);\n const client = useApolloClient();\n\n useEffect(\n () => {\n (async () => {\n const {\n data: { getMenuItems }\n } = await client.query({ query: getQuery('GET_MENU_ITEMS') });\n\n const parsedMenuItems = getMenuItems.map(([key, { header, items }]) => [\n key,\n {\n header,\n items: items.map(item => ({ ...item, isDisplayedPrompt: true }))\n }\n ]);\n\n if (!menuItems) {\n setMenuItems(parsedMenuItems);\n }\n })();\n },\n [client, menuItems]\n );\n\n const updateItems = items => {\n setMenuItems(items);\n };\n\n return menuItems ? (\n <MainContextProvider value={{ menuItems, setMenuItems: items => updateItems(items) }}>\n <div className=\"main-content grid grid--main-content\">\n <SideBar\n isOpenMenu={isOpenMenu}\n menuItems={menuItems}\n onMenuClick={onMenuClick}\n userData={userData}\n />\n {children}\n </div>\n </MainContextProvider>\n ) : (\n 'loading'\n );\n};\n\nGrid.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n isOpenMenu: PropTypes.bool.isRequired,\n onMenuClick: PropTypes.func.isRequired,\n userData: PropTypes.object\n};\n\nGrid.defaultProps = {\n userData: {}\n};\n\nexport default Grid;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,QAAQ,EAAEC,mBAAmB,QAAQ,2BAA2B;AACzE,OAAOC,OAAO,MAAM,kBAAkB;AAEtC,MAAMC,IAAI,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EAChE,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGb,QAAQ,CAAC,IAAI,CAAC;EAChD,MAAMc,MAAM,GAAGX,eAAe,EAAE;EAEhCF,SAAS,CACP,MAAM;IACJ,CAAC,YAAY;MACX,MAAM;QACJc,I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IAAI,CAAC,CAAC,CAACC,UAAU;EAC7FzB,UAAU,EAAEP,SAAS,CAACiC,IAAI,CAACD,UAAU;EACrCxB,WAAW,EAAER,SAAS,CAACkC,IAAI,CAACF,UAAU;EACtCvB,QAAQ,EAAET,SAAS,CAACmC;AACtB,CAAC;AAED9B,IAAI,CAAC+B,YAAY,GAAG;EAClB3B,QAAQ,EAAE,CAAC;AACb,CAAC;AAED,eAAeJ,IAAI"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
3
4
|
import classnames from 'classnames';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import { useApolloClient } from '@apollo/client';
|
|
@@ -35,7 +36,10 @@ const SideBar = ({
|
|
|
35
36
|
onClick: onMenuClick
|
|
36
37
|
}, /*#__PURE__*/React.createElement("i", {
|
|
37
38
|
className: "material-icons"
|
|
38
|
-
}, "keyboard_arrow_left")), /*#__PURE__*/React.createElement(
|
|
39
|
+
}, "keyboard_arrow_left")), /*#__PURE__*/React.createElement(Link, {
|
|
40
|
+
to: "/",
|
|
41
|
+
className: "side-nav__block-home"
|
|
42
|
+
}, "Dashboard"), /*#__PURE__*/React.createElement("div", {
|
|
39
43
|
className: sideNavWrapperClassname,
|
|
40
44
|
"data-testid": "sidenav",
|
|
41
45
|
id: "side-nav__wrapper"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBar.js","names":["React","classnames","PropTypes","useApolloClient","Avatar","handleLogout","SideBlock","SideBar","menuItems","isOpenMenu","onMenuClick","userData","client","firstname","lastname","username","sideNavClassname","sideNavWrapperClassname","length","map","data","header","window","location","href","propTypes","array","isRequired","bool","func","object"],"sources":["../../../src/components/SideBar/SideBar.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport Avatar from '@blaze-react/avatar';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { SideBlock } from './components';\n\nconst SideBar = ({ menuItems, isOpenMenu, onMenuClick, userData }) => {\n const client = useApolloClient();\n\n const { firstname, lastname } = userData;\n const username = `${firstname} ${lastname}`;\n\n const sideNavClassname = classnames('side-nav', {\n 'side-nav--open': isOpenMenu,\n 'side-nav--close': !isOpenMenu\n });\n\n const sideNavWrapperClassname = classnames('side-nav__wrapper', {\n 'side-nav__wrapper--close': !isOpenMenu\n });\n\n return (\n <div data-testid=\"sidebar\" className={sideNavClassname}>\n <div\n role=\"button\"\n className=\"side-nav__button open\"\n id=\"side-nav-button\"\n onClick={onMenuClick}>\n <i className=\"material-icons\">keyboard_arrow_left</i>\n </div>\n
|
|
1
|
+
{"version":3,"file":"SideBar.js","names":["React","Link","classnames","PropTypes","useApolloClient","Avatar","handleLogout","SideBlock","SideBar","menuItems","isOpenMenu","onMenuClick","userData","client","firstname","lastname","username","sideNavClassname","sideNavWrapperClassname","createElement","className","role","id","onClick","to","length","map","data","_extends","key","header","window","location","href","propTypes","array","isRequired","bool","func","object"],"sources":["../../../src/components/SideBar/SideBar.js"],"sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport Avatar from '@blaze-react/avatar';\nimport { handleLogout } from '@blaze-cms/core-auth-ui';\nimport { SideBlock } from './components';\n\nconst SideBar = ({ menuItems, isOpenMenu, onMenuClick, userData }) => {\n const client = useApolloClient();\n\n const { firstname, lastname } = userData;\n const username = `${firstname} ${lastname}`;\n\n const sideNavClassname = classnames('side-nav', {\n 'side-nav--open': isOpenMenu,\n 'side-nav--close': !isOpenMenu\n });\n\n const sideNavWrapperClassname = classnames('side-nav__wrapper', {\n 'side-nav__wrapper--close': !isOpenMenu\n });\n\n return (\n <div data-testid=\"sidebar\" className={sideNavClassname}>\n <div\n role=\"button\"\n className=\"side-nav__button open\"\n id=\"side-nav-button\"\n onClick={onMenuClick}>\n <i className=\"material-icons\">keyboard_arrow_left</i>\n </div>\n <Link to=\"/\" className=\"side-nav__block-home\">\n Dashboard\n </Link>\n <div className={sideNavWrapperClassname} data-testid=\"sidenav\" id=\"side-nav__wrapper\">\n {menuItems.length\n ? menuItems.map(([, data]) => <SideBlock key={data.header} {...data} />)\n : 'Not available content types'}\n </div>\n <div className=\"side-nav__user\">\n <div className=\"side-nav__user--info\">\n <Avatar username={username} />\n <span className=\"user-name\">{username}</span>\n </div>\n <div className=\"side-nav__user--button\">\n <span\n id=\"logout-button\"\n role=\"button\"\n onClick={async () => {\n await handleLogout(client);\n window.location.href = '/';\n }}\n className=\"material-icons\">\n power_settings_new\n </span>\n </div>\n <span className=\"side-nav__user--toggle\">Log off</span>\n </div>\n </div>\n );\n};\n\nSideBar.propTypes = {\n menuItems: PropTypes.array.isRequired,\n isOpenMenu: PropTypes.bool.isRequired,\n onMenuClick: PropTypes.func.isRequired,\n userData: PropTypes.object.isRequired\n};\n\nexport default SideBar;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,SAAS,QAAQ,cAAc;AAExC,MAAMC,OAAO,GAAGA,CAAC;EAAEC,SAAS;EAAEC,UAAU;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAK;EACpE,MAAMC,MAAM,GAAGT,eAAe,EAAE;EAEhC,MAAM;IAAEU,SAAS;IAAEC;EAAS,CAAC,GAAGH,QAAQ;EACxC,MAAMI,QAAQ,GAAI,GAAEF,SAAU,IAAGC,QAAS,EAAC;EAE3C,MAAME,gBAAgB,GAAGf,UAAU,CAAC,UAAU,E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,EAAC;EAAwB,gBACrCpB,KAAA,CAAAmB,aAAA;IACEG,EAAE,EAAC,eAAe;IAClBD,IAAI,EAAC,QAAQ;IACbE,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB,MAAMjB,YAAY,CAACO,MAAM,CAAC;MAC1BkB,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAG,GAAG;IAC5B,CAAE;IACFb,SAAS,EAAC;EAAgB,GAAC,oBAE7B,CAAO,CACH,eACNpB,KAAA,CAAAmB,aAAA;IAAMC,SAAS,EAAC;EAAwB,GAAC,SAAO,CAAO,CACnD,CACF;AAEV,CAAC;AAEDZ,OAAO,CAAC0B,SAAS,GAAG;EAClBzB,SAAS,EAAEN,SAAS,CAACgC,KAAK,CAACC,UAAU;EACrC1B,UAAU,EAAEP,SAAS,CAACkC,IAAI,CAACD,UAAU;EACrCzB,WAAW,EAAER,SAAS,CAACmC,IAAI,CAACF,UAAU;EACtCxB,QAAQ,EAAET,SAAS,CAACoC,MAAM,CAACH;AAC7B,CAAC;AAED,eAAe5B,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBlock.js","names":["React","useState","PropTypes","SideBlockItem","ACTIVE_LABEL","DEFAULT_LABEL","DOWN_ICON","SideBlock","header","items","text","icon","setLabelStatus","clonedItems","firstItems","splice","handleLabelClick","arrowType","map","length","propTypes","string","isRequired","arrayOf","shape","uri","name"],"sources":["../../../../src/components/SideBar/components/SideBlock.js"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport SideBlockItem from './SideBlockItem';\nimport { ACTIVE_LABEL, DEFAULT_LABEL, DOWN_ICON } from '../../../constants';\n\nconst SideBlock = ({ header, items }) => {\n const [{ text, icon }, setLabelStatus] = useState(DEFAULT_LABEL);\n\n const clonedItems = [...items];\n const firstItems = clonedItems.splice(0, 10);\n\n const handleLabelClick = () =>\n icon === DOWN_ICON ? setLabelStatus(ACTIVE_LABEL) : setLabelStatus(DEFAULT_LABEL);\n\n const arrowType = `keyboard_arrow_${icon}`;\n\n return (\n <div className=\"side-nav__block\">\n <div className=\"side-nav__block-heading\">{header}</div>\n <ul className=\"side-nav__list\">\n {firstItems.map(SideBlockItem)}\n {!!clonedItems.length && (\n <>\n <input type=\"checkbox\" className=\"sub-menu-checkbox\" id=\"dropdown\" />\n <div className=\"side-nav__list-dropdown\">{clonedItems.map(SideBlockItem)}</div>\n <li className=\"side-nav__list-item\">\n <label title=\"See more\" htmlFor=\"dropdown\" onClick={handleLabelClick}>\n {text} <i className=\"material-icons\">{arrowType}</i>\n </label>\n </li>\n </>\n )}\n </ul>\n </div>\n );\n};\n\nSideBlock.propTypes = {\n header: PropTypes.string.isRequired,\n items: PropTypes.arrayOf(\n PropTypes.shape({\n uri: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired\n })\n ).isRequired\n};\n\nexport default SideBlock;\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,YAAY,EAAEC,aAAa,EAAEC,SAAS,QAAQ,oBAAoB;AAE3E,MAAMC,SAAS,
|
|
1
|
+
{"version":3,"file":"SideBlock.js","names":["React","useState","PropTypes","SideBlockItem","ACTIVE_LABEL","DEFAULT_LABEL","DOWN_ICON","SideBlock","header","items","text","icon","setLabelStatus","clonedItems","firstItems","splice","handleLabelClick","arrowType","createElement","className","map","length","Fragment","type","id","title","htmlFor","onClick","propTypes","string","isRequired","arrayOf","shape","uri","name"],"sources":["../../../../src/components/SideBar/components/SideBlock.js"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport SideBlockItem from './SideBlockItem';\nimport { ACTIVE_LABEL, DEFAULT_LABEL, DOWN_ICON } from '../../../constants';\n\nconst SideBlock = ({ header, items }) => {\n const [{ text, icon }, setLabelStatus] = useState(DEFAULT_LABEL);\n\n const clonedItems = [...items];\n const firstItems = clonedItems.splice(0, 10);\n\n const handleLabelClick = () =>\n icon === DOWN_ICON ? setLabelStatus(ACTIVE_LABEL) : setLabelStatus(DEFAULT_LABEL);\n\n const arrowType = `keyboard_arrow_${icon}`;\n\n return (\n <div className=\"side-nav__block\">\n <div className=\"side-nav__block-heading\">{header}</div>\n <ul className=\"side-nav__list\">\n {firstItems.map(SideBlockItem)}\n {!!clonedItems.length && (\n <>\n <input type=\"checkbox\" className=\"sub-menu-checkbox\" id=\"dropdown\" />\n <div className=\"side-nav__list-dropdown\">{clonedItems.map(SideBlockItem)}</div>\n <li className=\"side-nav__list-item\">\n <label title=\"See more\" htmlFor=\"dropdown\" onClick={handleLabelClick}>\n {text} <i className=\"material-icons\">{arrowType}</i>\n </label>\n </li>\n </>\n )}\n </ul>\n </div>\n );\n};\n\nSideBlock.propTypes = {\n header: PropTypes.string.isRequired,\n items: PropTypes.arrayOf(\n PropTypes.shape({\n uri: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired\n })\n ).isRequired\n};\n\nexport default SideBlock;\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,YAAY,EAAEC,aAAa,EAAEC,SAAS,QAAQ,oBAAoB;AAE3E,MAAMC,SAAS,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAM,CAAC,KAAK;EACvC,MAAM,CAAC;IAAEC,IAAI;IAAEC;EAAK,CAAC,EAAEC,cAAc,CAAC,GAAGX,QAAQ,CAACI,aAAa,CAAC;EAEhE,MAAMQ,WAAW,GAAG,CAAC,GAAGJ,KAAK,CAAC;EAC9B,MAAMK,UAAU,GAAGD,WAAW,CAACE,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;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ACC,UAAU;IAChCI,IAAI,EAAEhC,SAAS,CAAC2B,MAAM,CAACC;EACzB,CAAC,CAAC,CACH,CAACA;AACJ,CAAC;AAED,eAAevB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideBlockItem.js","names":["React","PropTypes","Link","SideBlockItem","uri","name","propTypes","string","isRequired"],"sources":["../../../../src/components/SideBar/components/SideBlockItem.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nconst SideBlockItem = ({ uri, name }) => (\n <li key={name} className=\"side-nav__list-item\">\n <Link to={uri} className=\"side-nav__list-link\">\n {name}\n </Link>\n </li>\n);\n\nSideBlockItem.propTypes = {\n uri: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired\n};\n\nexport default SideBlockItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,IAAI,QAAQ,kBAAkB;AAEvC,MAAMC,aAAa,
|
|
1
|
+
{"version":3,"file":"SideBlockItem.js","names":["React","PropTypes","Link","SideBlockItem","uri","name","createElement","key","className","to","propTypes","string","isRequired"],"sources":["../../../../src/components/SideBar/components/SideBlockItem.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nconst SideBlockItem = ({ uri, name }) => (\n <li key={name} className=\"side-nav__list-item\">\n <Link to={uri} className=\"side-nav__list-link\">\n {name}\n </Link>\n </li>\n);\n\nSideBlockItem.propTypes = {\n uri: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired\n};\n\nexport default SideBlockItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,IAAI,QAAQ,kBAAkB;AAEvC,MAAMC,aAAa,GAAGA,CAAC;EAAEC,GAAG;EAAEC;AAAK,CAAC,kBAClCL,KAAA,CAAAM,aAAA;EAAIC,GAAG,EAAEF,IAAK;EAACG,SAAS,EAAC;AAAqB,gBAC5CR,KAAA,CAAAM,aAAA,CAACJ,IAAI;EAACO,EAAE,EAAEL,GAAI;EAACI,SAAS,EAAC;AAAqB,GAC3CH,IAAI,CACA,CAEV;AAEDF,aAAa,CAACO,SAAS,GAAG;EACxBN,GAAG,EAAEH,SAAS,CAACU,MAAM,CAACC,UAAU;EAChCP,IAAI,EAAEJ,SAAS,CAACU,MAAM,CAACC;AACzB,CAAC;AAED,eAAeT,aAAa"}
|
package/lib-es/constants.js
CHANGED
package/lib-es/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","LOGO_PROPS","src","DEFAULT_LABEL","text","icon","ACTIVE_LABEL","DOWN_ICON"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'admin-core-ui';\nconst LOGO_PROPS = { src: 'https://images.thisisblaze.com/logo-
|
|
1
|
+
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","LOGO_PROPS","src","DEFAULT_LABEL","text","icon","ACTIVE_LABEL","DOWN_ICON"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'admin-core-ui';\nconst LOGO_PROPS = { src: 'https://images.thisisblaze.com/logo-85-30.png' };\n\nconst DEFAULT_LABEL = {\n text: 'See more',\n icon: 'down'\n};\n\nconst ACTIVE_LABEL = {\n text: 'See less',\n icon: 'up'\n};\n\nconst DOWN_ICON = 'down';\n\nexport { PLUGIN_NAME, LOGO_PROPS, ACTIVE_LABEL, DEFAULT_LABEL, DOWN_ICON };\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,eAAe;AACnC,MAAMC,UAAU,GAAG;EAAEC,GAAG,EAAE;AAAgD,CAAC;AAE3E,MAAMC,aAAa,GAAG;EACpBC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,YAAY,GAAG;EACnBF,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE;AACR,CAAC;AAED,MAAME,SAAS,GAAG,MAAM;AAExB,SAASP,WAAW,EAAEC,UAAU,EAAEK,YAAY,EAAEH,aAAa,EAAEI,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Home.js","names":["React","Home","displayName"],"sources":["../../../src/containers/Home/Home.js"],"sourcesContent":["import React from 'react';\n\nconst Home = () => <div
|
|
1
|
+
{"version":3,"file":"Home.js","names":["React","Home","createElement","displayName"],"sources":["../../../src/containers/Home/Home.js"],"sourcesContent":["import React from 'react';\n\nconst Home = () => <div>Home</div>;\n\nHome.displayName = 'Home';\n\nexport default Home;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,IAAI,GAAGA,CAAA,kBAAMD,KAAA,CAAAE,aAAA,cAAK,MAAI,CAAM;AAElCD,IAAI,CAACE,WAAW,GAAG,MAAM;AAEzB,eAAeF,IAAI"}
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","Layout","pkg","PLUGIN_NAME","getMenuItemsResolver","Home","lazy","load","app","home","path","exact","key","component","addRoute","addQueryResolver","setLayout","events","once","addSection","header","order","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { Layout } from './components';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\nimport getMenuItemsResolver from './utils/get-menu-items-resolver';\n\nconst Home = React.lazy(() => import(/* webpackChunkName: 'Home' */ './containers'));\n\nasync function load(app) {\n const home = {\n path: '/',\n exact: true,\n key: 'home',\n component: Home\n };\n app.addRoute(home);\n\n app.addQueryResolver('getMenuItems', getMenuItemsResolver(app));\n\n app.setLayout(Layout);\n\n app.events.once('load:menu-section', addSection => {\n addSection('plugins', { header: 'plugins', order: 200 });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n\nexport default load;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,cAAc;AACrC,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,WAAW,QAAQ,aAAa;AACzC,OAAOC,oBAAoB,MAAM,iCAAiC;AAElE,MAAMC,IAAI,GAAGL,KAAK,CAACM,IAAI,CAAC,MAAM,MAAM,EAAC,8BAA+B,cAAc,CAAC,CAAC;AAEpF,eAAeC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","Layout","pkg","PLUGIN_NAME","getMenuItemsResolver","Home","lazy","load","app","home","path","exact","key","component","addRoute","addQueryResolver","setLayout","events","once","addSection","header","order","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { Layout } from './components';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\nimport getMenuItemsResolver from './utils/get-menu-items-resolver';\n\nconst Home = React.lazy(() => import(/* webpackChunkName: 'Home' */ './containers'));\n\nasync function load(app) {\n const home = {\n path: '/',\n exact: true,\n key: 'home',\n component: Home\n };\n app.addRoute(home);\n\n app.addQueryResolver('getMenuItems', getMenuItemsResolver(app));\n\n app.setLayout(Layout);\n\n app.events.once('load:menu-section', addSection => {\n addSection('plugins', { header: 'plugins', order: 200 });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n\nexport default load;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,cAAc;AACrC,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,WAAW,QAAQ,aAAa;AACzC,OAAOC,oBAAoB,MAAM,iCAAiC;AAElE,MAAMC,IAAI,GAAGL,KAAK,CAACM,IAAI,CAAC,MAAM,MAAM,EAAC,8BAA+B,cAAc,CAAC,CAAC;AAEpF,eAAeC,IAAIA,CAACC,GAAG,EAAE;EACvB,MAAMC,IAAI,GAAG;IACXC,IAAI,EAAE,GAAG;IACTC,KAAK,EAAE,IAAI;IACXC,GAAG,EAAE,MAAM;IACXC,SAAS,EAAER;EACb,CAAC;EACDG,GAAG,CAACM,QAAQ,CAACL,IAAI,CAAC;EAElBD,GAAG,CAACO,gBAAgB,CAAC,cAAc,EAAEX,oBAAoB,CAACI,GAAG,CAAC,CAAC;EAE/DA,GAAG,CAACQ,SAAS,CAACf,MAAM,CAAC;EAErBO,GAAG,CAACS,MAAM,CAACC,IAAI,CAAC,mBAAmB,EAAEC,UAAU,IAAI;IACjDA,UAAU,CAAC,SAAS,EAAE;MAAEC,MAAM,EAAE,SAAS;MAAEC,KAAK,EAAE;IAAI,CAAC,CAAC;EAC1D,CAAC,CAAC;EAEF,OAAO;IACLC,IAAI,EAAEnB,WAAW;IACjBoB,OAAO,EAAErB,GAAG,CAACqB;EACf,CAAC;AACH;AAEAhB,IAAI,CAACiB,UAAU,GAAGrB,WAAW;AAE7B,eAAeI,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-menu-items-resolver.js","names":["menuHandler","getMenuItemsResolver","app","addItem","addSection","getAll","events","emitAsync"],"sources":["../../src/utils/get-menu-items-resolver.js"],"sourcesContent":["import menuHandler from './menu-handler';\n\nexport default function getMenuItemsResolver(app) {\n return async () => {\n const { addItem, addSection, getAll } = menuHandler();\n await app.events.emitAsync('load:menu-section', addSection);\n await app.events.emitAsync('load:menu-items', addItem);\n return getAll();\n };\n}\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,gBAAgB;AAExC,eAAe,SAASC,
|
|
1
|
+
{"version":3,"file":"get-menu-items-resolver.js","names":["menuHandler","getMenuItemsResolver","app","addItem","addSection","getAll","events","emitAsync"],"sources":["../../src/utils/get-menu-items-resolver.js"],"sourcesContent":["import menuHandler from './menu-handler';\n\nexport default function getMenuItemsResolver(app) {\n return async () => {\n const { addItem, addSection, getAll } = menuHandler();\n await app.events.emitAsync('load:menu-section', addSection);\n await app.events.emitAsync('load:menu-items', addItem);\n return getAll();\n };\n}\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,gBAAgB;AAExC,eAAe,SAASC,oBAAoBA,CAACC,GAAG,EAAE;EAChD,OAAO,YAAY;IACjB,MAAM;MAAEC,OAAO;MAAEC,UAAU;MAAEC;IAAO,CAAC,GAAGL,WAAW,EAAE;IACrD,MAAME,GAAG,CAACI,MAAM,CAACC,SAAS,CAAC,mBAAmB,EAAEH,UAAU,CAAC;IAC3D,MAAMF,GAAG,CAACI,MAAM,CAACC,SAAS,CAAC,iBAAiB,EAAEJ,OAAO,CAAC;IACtD,OAAOE,MAAM,EAAE;EACjB,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-handler.js","names":["menuHandler","menuSections","Map","getSection","key","get","getAll","Array","from","entries","sort","order","order1","order2","addSection","header","validateSection","section","items","set","addItem","item","sectionKey","validateItem","push","has","Error","some","_","_order"],"sources":["../../src/utils/menu-handler.js"],"sourcesContent":["export default function menuHandler() {\n const menuSections = new Map();\n\n function getSection(key) {\n return menuSections.get(key);\n }\n\n function getAll() {\n return Array.from(menuSections.entries()).sort(\n ([, { order: order1 }], [, { order: order2 }]) => (order1 > order2 ? 1 : -1)\n );\n }\n\n function addSection(key, { header, order }) {\n validateSection(key, order);\n const section = {\n header,\n order,\n items: []\n };\n menuSections.set(key, section);\n }\n\n function addItem(item, sectionKey) {\n validateItem(sectionKey);\n const section = menuSections.get(sectionKey);\n section.items.push(item);\n }\n\n function validateItem(key) {\n if (!menuSections.has(key)) throw new Error(`Section ${key} doesn\\'t exist`);\n }\n\n function validateSection(key, order) {\n if (!key) throw new Error('Section requires a key');\n if (menuSections.has(key)) throw new Error(`Section with ${key} has been already added`);\n if (Array.from(menuSections.entries()).some(([_, { order: _order }]) => _order === order)) {\n throw new Error('Section with this order has already been added');\n }\n }\n\n return {\n addSection,\n addItem,\n getSection,\n getAll\n };\n}\n"],"mappings":"AAAA,eAAe,SAASA,
|
|
1
|
+
{"version":3,"file":"menu-handler.js","names":["menuHandler","menuSections","Map","getSection","key","get","getAll","Array","from","entries","sort","order","order1","order2","addSection","header","validateSection","section","items","set","addItem","item","sectionKey","validateItem","push","has","Error","some","_","_order"],"sources":["../../src/utils/menu-handler.js"],"sourcesContent":["export default function menuHandler() {\n const menuSections = new Map();\n\n function getSection(key) {\n return menuSections.get(key);\n }\n\n function getAll() {\n return Array.from(menuSections.entries()).sort(\n ([, { order: order1 }], [, { order: order2 }]) => (order1 > order2 ? 1 : -1)\n );\n }\n\n function addSection(key, { header, order }) {\n validateSection(key, order);\n const section = {\n header,\n order,\n items: []\n };\n menuSections.set(key, section);\n }\n\n function addItem(item, sectionKey) {\n validateItem(sectionKey);\n const section = menuSections.get(sectionKey);\n section.items.push(item);\n }\n\n function validateItem(key) {\n if (!menuSections.has(key)) throw new Error(`Section ${key} doesn\\'t exist`);\n }\n\n function validateSection(key, order) {\n if (!key) throw new Error('Section requires a key');\n if (menuSections.has(key)) throw new Error(`Section with ${key} has been already added`);\n if (Array.from(menuSections.entries()).some(([_, { order: _order }]) => _order === order)) {\n throw new Error('Section with this order has already been added');\n }\n }\n\n return {\n addSection,\n addItem,\n getSection,\n getAll\n };\n}\n"],"mappings":"AAAA,eAAe,SAASA,WAAWA,CAAA,EAAG;EACpC,MAAMC,YAAY,GAAG,IAAIC,GAAG,EAAE;EAE9B,SAASC,UAAUA,CAACC,GAAG,EAAE;IACvB,OAAOH,YAAY,CAACI,GAAG,CAACD,GAAG,CAAC;EAC9B;EAEA,SAASE,MAAMA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAACP,YAAY,CAACQ,OAAO,EAAE,CAAC,CAACC,IAAI,CAC5C,CAAC,GAAG;MAAEC,KAAK,EAAEC;IAAO,CAAC,CAAC,EAAE,GAAG;MAAED,KAAK,EAAEE;IAAO,CAAC,CAAC,KAAMD,MAAM,GAAGC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAE,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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-admin-core-ui",
|
|
3
|
-
"version": "0.128.0-
|
|
3
|
+
"version": "0.128.0-alpha.0",
|
|
4
4
|
"description": "Blaze plugin admin core ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-styles": "0.128.0-
|
|
31
|
-
"@blaze-cms/admin-ui-utils": "0.128.0-
|
|
32
|
-
"@blaze-cms/core-ui": "0.128.0-
|
|
33
|
-
"@blaze-cms/plugin-search-ui": "0.128.0-
|
|
34
|
-
"@blaze-cms/setup-ui": "0.128.0-
|
|
30
|
+
"@blaze-cms/admin-ui-styles": "0.128.0-alpha.0",
|
|
31
|
+
"@blaze-cms/admin-ui-utils": "0.128.0-alpha.0",
|
|
32
|
+
"@blaze-cms/core-ui": "0.128.0-alpha.0",
|
|
33
|
+
"@blaze-cms/plugin-search-ui": "0.128.0-alpha.0",
|
|
34
|
+
"@blaze-cms/setup-ui": "0.128.0-alpha.0",
|
|
35
35
|
"@blaze-react/avatar": "0.5.19",
|
|
36
36
|
"@blaze-react/button": "0.5.19",
|
|
37
37
|
"@blaze-react/input": "0.5.30",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"react-router-dom": "^5.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@blaze-cms/plugin-auth-ui": "0.128.0-
|
|
50
|
+
"@blaze-cms/plugin-auth-ui": "0.128.0-alpha.0",
|
|
51
51
|
"waait": "1.0.5"
|
|
52
52
|
},
|
|
53
53
|
"eslintIgnore": [
|
|
54
54
|
"lib/*",
|
|
55
55
|
"lib-es/*"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "a9b5b67a3521c59b311b09996c49fb1a65c2ca04"
|
|
58
58
|
}
|
|
@@ -5,17 +5,15 @@ import { Menu, Logo } from './components';
|
|
|
5
5
|
import { LOGO_PROPS } from '../../constants';
|
|
6
6
|
|
|
7
7
|
const Header = ({ isLoggedIn, isOpenMenu, onMenuClick }) => (
|
|
8
|
-
|
|
8
|
+
<header className="header">
|
|
9
9
|
{isLoggedIn && (
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
<Logo {...LOGO_PROPS} />
|
|
15
|
-
<SearchAdmin />
|
|
16
|
-
</header>
|
|
10
|
+
<div className="header__menu">
|
|
11
|
+
<Menu isOpenMenu={isOpenMenu} onMenuClick={onMenuClick} id="menu-button" />
|
|
12
|
+
</div>
|
|
17
13
|
)}
|
|
18
|
-
|
|
14
|
+
<Logo {...LOGO_PROPS} />
|
|
15
|
+
{isLoggedIn && <SearchAdmin />}
|
|
16
|
+
</header>
|
|
19
17
|
);
|
|
20
18
|
|
|
21
19
|
Header.propTypes = {
|
|
@@ -3,16 +3,16 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Query } from '@apollo/client/react/components';
|
|
4
4
|
import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
5
5
|
import { Login } from '@blaze-cms/plugin-auth-ui';
|
|
6
|
+
import Header from '../Header';
|
|
6
7
|
import { Grid } from './components';
|
|
7
|
-
|
|
8
|
+
|
|
8
9
|
import '@blaze-cms/admin-ui-styles/main.scss';
|
|
9
|
-
import Header from '../Header';
|
|
10
10
|
|
|
11
11
|
const Layout = ({ children }) => {
|
|
12
12
|
const [isOpenMenu, setOpenMenu] = useState(true);
|
|
13
13
|
const onMenuClick = () => setOpenMenu(!isOpenMenu);
|
|
14
14
|
return (
|
|
15
|
-
<div className="site-container grid--site-container">
|
|
15
|
+
<div className="site-container grid grid--site-container">
|
|
16
16
|
<Query query={getQuery('GET_USER_AUTH_DATA')} errorPolicy="all">
|
|
17
17
|
{({ data = {} }) => {
|
|
18
18
|
const { session: { isLoggedIn, userData = {} } = {} } = data;
|
|
@@ -21,15 +21,11 @@ const Layout = ({ children }) => {
|
|
|
21
21
|
<>
|
|
22
22
|
<Header isLoggedIn={isLoggedIn} onMenuClick={onMenuClick} isOpenMenu={isOpenMenu} />
|
|
23
23
|
{isLoggedIn ? (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</Grid>
|
|
28
|
-
</>
|
|
24
|
+
<Grid isOpenMenu={isOpenMenu} onMenuClick={onMenuClick} userData={userData}>
|
|
25
|
+
{children}
|
|
26
|
+
</Grid>
|
|
29
27
|
) : (
|
|
30
|
-
<
|
|
31
|
-
<Login />
|
|
32
|
-
</Background>
|
|
28
|
+
<Login />
|
|
33
29
|
)}
|
|
34
30
|
</>
|
|
35
31
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
2
3
|
import classnames from 'classnames';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { useApolloClient } from '@apollo/client';
|
|
@@ -30,9 +31,9 @@ const SideBar = ({ menuItems, isOpenMenu, onMenuClick, userData }) => {
|
|
|
30
31
|
onClick={onMenuClick}>
|
|
31
32
|
<i className="material-icons">keyboard_arrow_left</i>
|
|
32
33
|
</div>
|
|
33
|
-
|
|
34
|
+
<Link to="/" className="side-nav__block-home">
|
|
34
35
|
Dashboard
|
|
35
|
-
</Link>
|
|
36
|
+
</Link>
|
|
36
37
|
<div className={sideNavWrapperClassname} data-testid="sidenav" id="side-nav__wrapper">
|
|
37
38
|
{menuItems.length
|
|
38
39
|
? menuItems.map(([, data]) => <SideBlock key={data.header} {...data} />)
|
package/src/constants.js
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
// import Svg from './bg.svg';
|
|
12
|
-
|
|
13
|
-
var Background = function Background(_ref) {
|
|
14
|
-
var children = _ref.children;
|
|
15
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
16
|
-
className: "bg-blue-900 h-full w-full relative"
|
|
17
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
|
-
className: "login-container"
|
|
19
|
-
}, children));
|
|
20
|
-
};
|
|
21
|
-
Background.propTypes = {
|
|
22
|
-
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
23
|
-
};
|
|
24
|
-
var _default = Background;
|
|
25
|
-
exports["default"] = _default;
|
|
26
|
-
//# sourceMappingURL=Background.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Background.js","names":["Background","children","propTypes","PropTypes","oneOfType","arrayOf","node","isRequired"],"sources":["../../../src/components/Layout/Background.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import Svg from './bg.svg';\n\nconst Background = ({ children }) => (\n <div className=\"bg-blue-900 h-full w-full relative\">\n {/* <Svg /> */}\n <div className=\"login-container\">{children}</div>\n </div>\n);\n\nBackground.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nexport default Background;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAU;EAAA,IAAMC,QAAQ,QAARA,QAAQ;EAAA,oBAC5B;IAAK,SAAS,EAAC;EAAoC,gBAEjD;IAAK,SAAS,EAAC;EAAiB,GAAEA,QAAQ,CAAO,CAC7C;AAAA,CACP;AAEDD,UAAU,CAACE,SAAS,GAAG;EACrBD,QAAQ,EAAEE,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,OAAO,CAACF,qBAAS,CAACG,IAAI,CAAC,EAAEH,qBAAS,CAACG,IAAI,CAAC,CAAC,CAACC;AACrF,CAAC;AAAC,eAEaP,UAAU;AAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
// import Svg from './bg.svg';
|
|
4
|
-
|
|
5
|
-
const Background = ({
|
|
6
|
-
children
|
|
7
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
8
|
-
className: "bg-blue-900 h-full w-full relative"
|
|
9
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
className: "login-container"
|
|
11
|
-
}, children));
|
|
12
|
-
Background.propTypes = {
|
|
13
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
14
|
-
};
|
|
15
|
-
export default Background;
|
|
16
|
-
//# sourceMappingURL=Background.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Background.js","names":["React","PropTypes","Background","children","propTypes","oneOfType","arrayOf","node","isRequired"],"sources":["../../../src/components/Layout/Background.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import Svg from './bg.svg';\n\nconst Background = ({ children }) => (\n <div className=\"bg-blue-900 h-full w-full relative\">\n {/* <Svg /> */}\n <div className=\"login-container\">{children}</div>\n </div>\n);\n\nBackground.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired\n};\n\nexport default Background;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC;;AAEA,MAAMC,UAAU,GAAG,CAAC;EAAEC;AAAS,CAAC,kBAC9B;EAAK,SAAS,EAAC;AAAoC,gBAEjD;EAAK,SAAS,EAAC;AAAiB,GAAEA,QAAQ,CAAO,CAEpD;AAEDD,UAAU,CAACE,SAAS,GAAG;EACrBD,QAAQ,EAAEF,SAAS,CAACI,SAAS,CAAC,CAACJ,SAAS,CAACK,OAAO,CAACL,SAAS,CAACM,IAAI,CAAC,EAAEN,SAAS,CAACM,IAAI,CAAC,CAAC,CAACC;AACrF,CAAC;AAED,eAAeN,UAAU"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
// import Svg from './bg.svg';
|
|
4
|
-
|
|
5
|
-
const Background = ({ children }) => (
|
|
6
|
-
<div className="bg-blue-900 h-full w-full relative">
|
|
7
|
-
{/* <Svg /> */}
|
|
8
|
-
<div className="login-container">{children}</div>
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
Background.propTypes = {
|
|
13
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default Background;
|