@webiny/app-admin-rmwc 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd
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/index.d.ts +2 -2
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/modules/Brand/index.d.ts +2 -2
- package/modules/Brand/index.js +4 -2
- package/modules/Brand/index.js.map +1 -1
- package/modules/Dashboard/Welcome.d.ts +2 -2
- package/modules/Dashboard/Welcome.js +3 -1
- package/modules/Dashboard/Welcome.js.map +1 -1
- package/modules/Dashboard/index.d.ts +2 -2
- package/modules/Dashboard/index.js +3 -1
- package/modules/Dashboard/index.js.map +1 -1
- package/modules/Layout.d.ts +2 -2
- package/modules/Layout.js +3 -5
- package/modules/Layout.js.map +1 -1
- package/modules/Navigation/Hamburger.d.ts +2 -2
- package/modules/Navigation/Hamburger.js +3 -1
- package/modules/Navigation/Hamburger.js.map +1 -1
- package/modules/Navigation/Styled.d.ts +0 -2
- package/modules/Navigation/Styled.js +3 -1
- package/modules/Navigation/Styled.js.map +1 -1
- package/modules/Navigation/index.d.ts +2 -2
- package/modules/Navigation/index.js +3 -1
- package/modules/Navigation/index.js.map +1 -1
- package/modules/Navigation/renderers/MenuElementRenderer.d.ts +1 -1
- package/modules/Navigation/renderers/MenuElementRenderer.js +3 -1
- package/modules/Navigation/renderers/MenuElementRenderer.js.map +1 -1
- package/modules/Navigation/renderers/MenuGroupRenderer.d.ts +1 -1
- package/modules/Navigation/renderers/MenuGroupRenderer.js +3 -1
- package/modules/Navigation/renderers/MenuGroupRenderer.js.map +1 -1
- package/modules/Navigation/renderers/MenuLinkRenderer.d.ts +1 -1
- package/modules/Navigation/renderers/MenuLinkRenderer.js +3 -1
- package/modules/Navigation/renderers/MenuLinkRenderer.js.map +1 -1
- package/modules/Navigation/renderers/MenuSectionItemRenderer.d.ts +1 -1
- package/modules/Navigation/renderers/MenuSectionItemRenderer.js +3 -1
- package/modules/Navigation/renderers/MenuSectionItemRenderer.js.map +1 -1
- package/modules/Navigation/renderers/MenuSectionRenderer.d.ts +1 -1
- package/modules/Navigation/renderers/MenuSectionRenderer.js +3 -1
- package/modules/Navigation/renderers/MenuSectionRenderer.js.map +1 -1
- package/modules/NotFound/index.d.ts +2 -2
- package/modules/NotFound/index.js +3 -1
- package/modules/NotFound/index.js.map +1 -1
- package/modules/Overlays/Dialog.d.ts +2 -2
- package/modules/Overlays/Dialog.js +29 -48
- package/modules/Overlays/Dialog.js.map +1 -1
- package/modules/Overlays/OmniSearch/Dialog.d.ts +0 -2
- package/modules/Overlays/OmniSearch/Dialog.js +3 -1
- package/modules/Overlays/OmniSearch/Dialog.js.map +1 -1
- package/modules/Overlays/OmniSearch.js +35 -16
- package/modules/Overlays/OmniSearch.js.map +1 -1
- package/modules/Overlays/Snackbar.d.ts +2 -2
- package/modules/Overlays/Snackbar.js +6 -4
- package/modules/Overlays/Snackbar.js.map +1 -1
- package/modules/Overlays/index.d.ts +2 -2
- package/modules/Overlays/index.js +5 -7
- package/modules/Overlays/index.js.map +1 -1
- package/modules/Search/index.d.ts +2 -2
- package/modules/Search/index.js +3 -2
- package/modules/Search/index.js.map +1 -1
- package/modules/UserMenu/index.d.ts +2 -2
- package/modules/UserMenu/index.js +23 -6
- package/modules/UserMenu/index.js.map +1 -1
- package/package.json +18 -18
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const RMWC:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RMWC: () => JSX.Element;
|
package/index.js
CHANGED
|
@@ -11,11 +11,12 @@ var _provider = require("@rmwc/provider");
|
|
|
11
11
|
var _Layout = require("./modules/Layout");
|
|
12
12
|
var _Navigation = require("./modules/Navigation");
|
|
13
13
|
var _Brand = require("./modules/Brand");
|
|
14
|
-
var _Search = require("./modules/Search");
|
|
15
14
|
var _UserMenu = require("./modules/UserMenu");
|
|
16
15
|
var _Overlays = require("./modules/Overlays");
|
|
17
16
|
var _NotFound = require("./modules/NotFound");
|
|
18
17
|
var _Dashboard = require("./modules/Dashboard");
|
|
18
|
+
// import { Search } from "~/modules/Search"; Removed in 5.37.0, it will be refactored later
|
|
19
|
+
|
|
19
20
|
var RMWCProviderPlugin = (0, _appAdmin.createProviderPlugin)(function (Component) {
|
|
20
21
|
return function RMWCThemeProvider(_ref) {
|
|
21
22
|
var children = _ref.children;
|
|
@@ -25,6 +26,8 @@ var RMWCProviderPlugin = (0, _appAdmin.createProviderPlugin)(function (Component
|
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
var RMWC = function RMWC() {
|
|
28
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(RMWCProviderPlugin, null), /*#__PURE__*/_react.default.createElement(_Layout.Layout, null), /*#__PURE__*/_react.default.createElement(_Dashboard.Dashboard, null), /*#__PURE__*/_react.default.createElement(_NotFound.NotFound, null), /*#__PURE__*/_react.default.createElement(_Brand.Brand, null), /*#__PURE__*/_react.default.createElement(_Navigation.Navigation, null), /*#__PURE__*/_react.default.createElement(
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(RMWCProviderPlugin, null), /*#__PURE__*/_react.default.createElement(_Layout.Layout, null), /*#__PURE__*/_react.default.createElement(_Dashboard.Dashboard, null), /*#__PURE__*/_react.default.createElement(_NotFound.NotFound, null), /*#__PURE__*/_react.default.createElement(_Brand.Brand, null), /*#__PURE__*/_react.default.createElement(_Navigation.Navigation, null), /*#__PURE__*/_react.default.createElement(_UserMenu.UserMenu, null), /*#__PURE__*/_react.default.createElement(_Overlays.Overlays, null));
|
|
29
30
|
};
|
|
30
|
-
exports.RMWC = RMWC;
|
|
31
|
+
exports.RMWC = RMWC;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RMWCProviderPlugin","createProviderPlugin","Component","RMWCThemeProvider","children","RMWC"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { createProviderPlugin } from \"@webiny/app-admin\";\nimport { RMWCProvider } from \"@rmwc/provider\";\n\nimport { Layout } from \"./modules/Layout\";\nimport { Navigation } from \"./modules/Navigation\";\nimport { Brand } from \"./modules/Brand\";\
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_appAdmin","_provider","_Layout","_Navigation","_Brand","_UserMenu","_Overlays","_NotFound","_Dashboard","RMWCProviderPlugin","createProviderPlugin","Component","RMWCThemeProvider","_ref","children","default","createElement","RMWCProvider","ripple","RMWC","Fragment","Layout","Dashboard","NotFound","Brand","Navigation","UserMenu","Overlays","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { createProviderPlugin } from \"@webiny/app-admin\";\nimport { RMWCProvider } from \"@rmwc/provider\";\n\nimport { Layout } from \"./modules/Layout\";\nimport { Navigation } from \"./modules/Navigation\";\nimport { Brand } from \"./modules/Brand\";\n// import { Search } from \"~/modules/Search\"; Removed in 5.37.0, it will be refactored later\nimport { UserMenu } from \"~/modules/UserMenu\";\nimport { Overlays } from \"./modules/Overlays\";\nimport { NotFound } from \"./modules/NotFound\";\nimport { Dashboard } from \"./modules/Dashboard\";\n\nconst RMWCProviderPlugin = createProviderPlugin(Component => {\n return function RMWCThemeProvider({ children }) {\n return (\n <RMWCProvider ripple={false}>\n <Component>{children}</Component>\n </RMWCProvider>\n );\n };\n});\n\nexport const RMWC = () => {\n return (\n <Fragment>\n <RMWCProviderPlugin />\n <Layout />\n <Dashboard />\n <NotFound />\n <Brand />\n <Navigation />\n {/*<Search />*/}\n <UserMenu />\n <Overlays />\n </Fragment>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,S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,CAAAkB,OAAA,CAAAC,aAAA,CAACX,SAAA,CAAAqB,QAAQ,MAAE,CAAC,eACZ7B,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAACV,SAAA,CAAAqB,QAAQ,MAAE,CACL,CAAC;AAEnB,CAAC;AAACC,OAAA,CAAAT,IAAA,GAAAA,IAAA"}
|
package/modules/Brand/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Brand:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Brand: () => JSX.Element;
|
package/modules/Brand/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Brand = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _appAdmin = require("@webiny/app-admin");
|
|
10
|
-
var _reactRouter = require("@webiny/react-router
|
|
10
|
+
var _reactRouter = require("@webiny/react-router");
|
|
11
11
|
var _webinyLogo = require("./webiny-logo.svg");
|
|
12
12
|
var _Navigation = require("../Navigation");
|
|
13
13
|
var BrandImpl = function BrandImpl() {
|
|
@@ -54,4 +54,6 @@ var Brand = function Brand() {
|
|
|
54
54
|
logo: /*#__PURE__*/_react.default.createElement(WebinyLogo, null)
|
|
55
55
|
}));
|
|
56
56
|
};
|
|
57
|
-
exports.Brand = Brand;
|
|
57
|
+
exports.Brand = Brand;
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BrandImpl","BrandRenderer","useTags","location","useNavigation","setVisible","inApp","includes","String","onClick","useCallback","WebinyLogo","isLoginScreen","isAppBar","isInstaller","color","width","height","paddingLeft","Brand"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment, useCallback } from \"react\";\nimport {\n Compose,\n BrandRenderer,\n HigherOrderComponent,\n useTags,\n Logo,\n AddLogo\n} from \"@webiny/app-admin\";\nimport { Link } from \"@webiny/react-router
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_appAdmin","_reactRouter","_webinyLogo","_Navigation","BrandImpl","BrandRenderer","_useTags","useTags","location","_useNavigation","useNavigation","setVisible","inApp","includes","String","onClick","useCallback","default","createElement","Logo","Link","to","WebinyLogo","_useTags2","isLoginScreen","isAppBar","isInstaller","color","ReactComponent","style","width","height","paddingLeft","Brand","Fragment","Compose","component","with","AddLogo","logo","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment, useCallback } from \"react\";\nimport {\n Compose,\n BrandRenderer,\n HigherOrderComponent,\n useTags,\n Logo,\n AddLogo\n} from \"@webiny/app-admin\";\nimport { Link } from \"@webiny/react-router\";\nimport { ReactComponent as LogoIcon } from \"./webiny-logo.svg\";\nimport { useNavigation } from \"../Navigation\";\n\nconst BrandImpl: HigherOrderComponent = () => {\n return function BrandRenderer() {\n const { location } = useTags();\n const { setVisible } = useNavigation();\n const inApp = [\"appBar\", \"navigation\"].includes(String(location));\n\n const onClick = useCallback(() => {\n location === \"navigation\" ? setVisible(false) : null;\n }, []);\n\n if (!inApp) {\n return <Logo />;\n }\n\n return (\n <Link to={\"/\"} onClick={onClick}>\n <Logo />\n </Link>\n );\n };\n};\n\nconst WebinyLogo = () => {\n const { location } = useTags();\n const isLoginScreen = location === \"loginScreen\";\n const isAppBar = location === \"appBar\";\n const isInstaller = location === \"installer\";\n const inApp = !isInstaller && !isLoginScreen;\n\n const color = isAppBar ? \"white\" : \"var(--mdc-theme-primary)\";\n\n return (\n <LogoIcon\n style={{\n width: !inApp ? 125 : 100,\n height: !inApp ? \"auto\" : 30,\n paddingLeft: !inApp ? 0 : 20,\n color\n }}\n />\n );\n};\n\nexport const Brand = () => {\n return (\n <Fragment>\n <Compose component={BrandRenderer} with={BrandImpl} />\n <AddLogo logo={<WebinyLogo />} />\n </Fragment>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAC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AAMiB,QAAQ,GAAGjB,QAAQ,KAAK,QAAQ;EACtC,IAAMkB,WAAW,GAAGlB,QAAQ,KAAK,WAAW;EAC5C,IAAMI,KAAK,GAAG,CAACc,WAAW,IAAI,CAACF,aAAa;EAE5C,IAAMG,KAAK,GAAGF,QAAQ,GAAG,OAAO,GAAG,0BAA0B;EAE7D,oBACI5B,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAChB,WAAA,CAAA0B,cAAQ;IACLC,KAAK,EAAE;MACHC,KAAK,EAAE,CAAClB,KAAK,GAAG,GAAG,GAAG,GAAG;MACzBmB,MAAM,EAAE,CAACnB,KAAK,GAAG,MAAM,GAAG,EAAE;MAC5BoB,WAAW,EAAE,CAACpB,KAAK,GAAG,CAAC,GAAG,EAAE;MAC5Be,KAAK,EAALA;IACJ;EAAE,CACL,CAAC;AAEV,CAAC;AAEM,IAAMM,KAAK,GAAG,SAARA,KAAKA,CAAA,EAAS;EACvB,oBACIpC,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAACrB,MAAA,CAAAqC,QAAQ,qBACLrC,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAClB,SAAA,CAAAmC,OAAO;IAACC,SAAS,EAAE/B,uBAAc;IAACgC,IAAI,EAAEjC;EAAU,CAAE,CAAC,eACtDP,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAClB,SAAA,CAAAsC,OAAO;IAACC,IAAI,eAAE1C,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAACI,UAAU,MAAE;EAAE,CAAE,CAC1B,CAAC;AAEnB,CAAC;AAACkB,OAAA,CAAAP,KAAA,GAAAA,KAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const Welcome:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Welcome: () => JSX.Element | null;
|
|
3
3
|
export default Welcome;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["linkStyle","css","textDecoration","color","imageStyle","width","height","marginBottom","communityStyle","textAlign","widgetTitleStyle","fontWeight","paddingTop","paddingBottom","widgetDescriptionStyle","paddingLeft","paddingRight","iconTextStyle","pFormContentStyle","pGetStartedStyle","footerContainerStyle","display","padding","widgetButtonStyle","footerTextStyle","backgroundColor","margin","footerLinkTextStyle","ContentTheme","styled","Widget","WelcomeScreenWidgetsWrapper","elevation","Welcome","useSecurity","identity","getPermission","widgets","plugins","byType","filter","pl","permission","canSeeAnyWidget","length","displayName","map","name","widget","title","description","cta","marginLeft","visibility"],"sources":["Welcome.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport { Link } from \"@webiny/react-router\";\nimport {\n SimpleForm,\n SimpleFormHeader,\n SimpleFormContent,\n SimpleFormFooter\n} from \"@webiny/app-admin/components/SimpleForm\";\nimport { useSecurity } from \"@webiny/app-security/hooks/useSecurity\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\n// Icons\nimport { ReactComponent as YouTubeIcon } from \"./icons/youtube.svg\";\nimport { ReactComponent as GithubIcon } from \"./icons/github.svg\";\nimport { ReactComponent as SlackIcon } from \"./icons/slack.svg\";\nimport { ReactComponent as TwitterIcon } from \"./icons/twitter.svg\";\nimport { ReactComponent as TextbookIcon } from \"./icons/textbook.svg\";\nimport { ReactComponent as LaptopIcon } from \"./icons/laptop.svg\";\nimport { AdminWelcomeScreenWidgetPlugin } from \"@webiny/app-plugin-admin-welcome-screen/types\";\n\nconst linkStyle = css({\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"none\"\n },\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst imageStyle = css({\n width: \"30px\",\n height: \"30px\",\n marginBottom: \"5px\"\n});\n\nconst communityStyle = css({\n textAlign: \"left\"\n});\n\nconst widgetTitleStyle = css({\n fontWeight: 600,\n paddingTop: \"1rem\",\n paddingBottom: \"1rem\",\n textAlign: \"center\"\n});\n\nconst widgetDescriptionStyle = css({\n textAlign: \"center\",\n paddingLeft: \"20px\",\n paddingRight: \"20px\"\n});\n\nconst iconTextStyle = css({\n textAlign: \"center\"\n});\n\nconst pFormContentStyle = css({\n fontWeight: 600\n});\n\nconst pGetStartedStyle = css({\n paddingLeft: \"1.5rem\",\n paddingTop: \"1.5rem\"\n});\n\nconst footerContainerStyle = css({\n display: \"flex\",\n padding: \"1rem\"\n});\n\nconst widgetButtonStyle = css`\n text-align: center;\n margin-top: auto;\n`;\n\nconst footerTextStyle = css({\n backgroundColor: \"var(--mdc-theme-on-background)\",\n margin: \"1rem\"\n});\n\nconst footerLinkTextStyle = css({\n fontWeight: 600,\n paddingLeft: \"1rem\"\n});\n\nconst ContentTheme = styled(\"div\")({\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst Widget = styled.div`\n margin-left: 1.5rem;\n margin-right: 1.5rem;\n margin-bottom: 2rem;\n flex: 1 1 21%;\n max-width: 25%;\n min-height: 250px;\n`;\n\nconst WelcomeScreenWidgetsWrapper = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n @media (max-width: 479px) {\n flex-direction: column;\n }\n`;\n\nconst elevation = css`\n padding: 10px;\n height: calc(100% - 20px);\n display: flex;\n flex-direction: column;\n`;\n\nconst Welcome: React.FC = () => {\n const { identity, getPermission } = useSecurity();\n\n if (!identity) {\n return null;\n }\n\n const widgets = plugins\n .byType<AdminWelcomeScreenWidgetPlugin>(\"admin-welcome-screen-widget\")\n .filter(pl => {\n if (pl.permission) {\n return getPermission(pl.permission);\n }\n return true;\n });\n\n const canSeeAnyWidget = widgets.length > 0;\n\n return (\n <SimpleForm>\n <SimpleFormHeader title={`Hi ${identity.displayName}!`} />\n <SimpleFormContent>\n <ContentTheme>\n <Cell span={12}>\n <Typography use={\"headline6\"}>\n {canSeeAnyWidget && (\n <p className={pGetStartedStyle}>\n To get started - pick one of the actions below:\n </p>\n )}\n {!canSeeAnyWidget && (\n <p className={pGetStartedStyle}>\n Please contact the administrator for permissions to access\n Webiny apps.\n </p>\n )}\n <br />\n </Typography>\n </Cell>\n <WelcomeScreenWidgetsWrapper>\n {widgets.map(pl => {\n return (\n <Widget key={pl.name} data-testid={pl.name}>\n <Elevation z={2} className={elevation}>\n <Typography use={\"headline6\"}>\n <p className={widgetTitleStyle}>{pl.widget.title}</p>\n </Typography>\n <Typography use={\"body1\"}>\n <p className={widgetDescriptionStyle}>\n {pl.widget.description}\n </p>\n </Typography>\n <div className={widgetButtonStyle}>{pl.widget.cta}</div>\n </Elevation>\n </Widget>\n );\n })}\n </WelcomeScreenWidgetsWrapper>\n </ContentTheme>\n </SimpleFormContent>\n <SimpleFormFooter>\n <Grid>\n <Cell span={8}>\n <Typography use={\"headline6\"} className={communityStyle}>\n <p className={pFormContentStyle}>Learn more about Webiny:</p>\n </Typography>\n </Cell>\n <Cell span={4} style={{ marginLeft: \"1rem\" }}>\n <Typography use={\"headline6\"} className={communityStyle}>\n <p className={pFormContentStyle}>Join our community:</p>\n </Typography>\n </Cell>\n <Cell span={8}>\n <Typography use={\"body1\"} className={communityStyle}>\n <p>\n Explore the Webiny documentation, learn about the architecture and\n check out code examples and guides:\n </p>\n </Typography>\n </Cell>\n <Cell span={4} style={{ marginLeft: \"1rem\" }}>\n <Typography use={\"body1\"} className={communityStyle}>\n <p>Get to know Webiny team members, discuss new ideas and get help:</p>\n </Typography>\n </Cell>\n <Cell\n span={4}\n className={footerTextStyle}\n style={{ margin: \"1rem 1rem 1rem 0rem\" }}\n >\n <Link\n to=\"https://www.webiny.com/docs\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <Typography use={\"headline5\"}>\n <div className={footerContainerStyle}>\n <TextbookIcon className={imageStyle} />\n <p className={footerLinkTextStyle}>Documentation</p>\n </div>\n </Typography>\n </Link>\n </Cell>\n <Cell\n span={4}\n className={footerTextStyle}\n style={{ margin: \"1rem 1rem 1rem 9px\", visibility: \"hidden\" }}\n >\n <Link\n to=\"https://github.com/webiny/webiny-examples\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <Typography use={\"headline5\"}>\n <span className={footerContainerStyle}>\n <LaptopIcon className={imageStyle} />\n <p className={footerLinkTextStyle}>Code examples</p>\n </span>\n </Typography>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://github.com/webiny/webiny-js\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <GithubIcon className={imageStyle} />\n <p>Github</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://www.webiny.com/slack/\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <SlackIcon className={imageStyle} />\n <p>Slack</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://youtube.com/webiny\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <YouTubeIcon className={imageStyle} />\n <p>YouTube</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://twitter.com/WebinyCMS\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <TwitterIcon className={imageStyle} />\n <p>Twitter</p>\n </Link>\n </Cell>\n </Grid>\n </SimpleFormFooter>\n </SimpleForm>\n );\n};\n\nexport default Welcome;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AANA;;AASA,IAAMA,SAAS,gBAAG,IAAAC,YAAG,EAAC;EAClBC,cAAc,EAAE,MAAM;EACtB,SAAS,EAAE;IACPA,cAAc,EAAE;EACpB,CAAC;EACDC,K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AAE;EAAsB,gBAE3B,6BAAC,sBAAU;IAAC,SAAS,EAAEI;EAAW,EAAG,eACrC,wCAAG,QAAM,CAAI,CACV,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE,CAAE;IAAC,SAAS,EAAEa,aAAc;IAAC,KAAK,EAAC;EAAQ,gBACnD,6BAAC,iBAAI;IACD,EAAE,EAAC,+BAA+B;IAClC,SAAS,EAAEjB,SAAU;IACrB,MAAM,EAAE,QAAS;IACjB,GAAG,EAAE;EAAsB,gBAE3B,6BAAC,qBAAS;IAAC,SAAS,EAAEI;EAAW,EAAG,eACpC,wCAAG,OAAK,CAAI,CACT,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE,CAAE;IAAC,SAAS,EAAEa,aAAc;IAAC,KAAK,EAAC;EAAQ,gBACnD,6BAAC,iBAAI;IACD,EAAE,EAAC,4BAA4B;IAC/B,SAAS,EAAEjB,SAAU;IACrB,MAAM,EAAE,QAAS;IACjB,GAAG,EAAE;EAAsB,gBAE3B,6BAAC,uBAAW;IAAC,SAAS,EAAEI;EAAW,EAAG,eACtC,wCAAG,SAAO,CAAI,CACX,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE,CAAE;IAAC,SAAS,EAAEa,aAAc;IAAC,KAAK,EAAC;EAAQ,gBACnD,6BAAC,iBAAI;IACD,EAAE,EAAC,+BAA+B;IAClC,SAAS,EAAEjB,SAAU;IACrB,MAAM,EAAE,QAAS;IACjB,GAAG,EAAE;EAAsB,gBAE3B,6BAAC,uBAAW;IAAC,SAAS,EAAEI;EAAW,EAAG,eACtC,wCAAG,SAAO,CAAI,CACX,CACJ,CACJ,CACQ,CACV;AAErB,CAAC;AAAC,eAEa6B,OAAO;AAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_emotion","_styled","_reactRouter","_SimpleForm","_useSecurity2","_plugins","_Typography","_Grid","_Elevation","_youtube","_github","_slack","_twitter","_textbook","_laptop","linkStyle","css","textDecoration","color","imageStyle","width","height","marginBottom","communityStyle","textAlign","widgetTitleStyle","fontWeight","paddingTop","paddingBottom","widgetDescriptionStyle","paddingLeft","paddingRight","iconTextStyle","pFormContentStyle","pGetStartedStyle","footerContainerStyle","display","padding","widgetButtonStyle","footerTextStyle","backgroundColor","margin","footerLinkTextStyle","ContentTheme","styled","target","label","Widget","WelcomeScreenWidgetsWrapper","elevation","Welcome","_useSecurity","useSecurity","identity","getPermission","widgets","plugins","byType","filter","pl","permission","canSeeAnyWidget","length","default","createElement","SimpleForm","SimpleFormHeader","title","concat","displayName","SimpleFormContent","Cell","span","Typography","use","className","map","key","name","Elevation","z","widget","description","cta","SimpleFormFooter","Grid","style","marginLeft","Link","to","rel","ReactComponent","visibility","align","_default","exports"],"sources":["Welcome.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport { Link } from \"@webiny/react-router\";\nimport {\n SimpleForm,\n SimpleFormHeader,\n SimpleFormContent,\n SimpleFormFooter\n} from \"@webiny/app-admin/components/SimpleForm\";\nimport { useSecurity } from \"@webiny/app-security/hooks/useSecurity\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\n// Icons\nimport { ReactComponent as YouTubeIcon } from \"./icons/youtube.svg\";\nimport { ReactComponent as GithubIcon } from \"./icons/github.svg\";\nimport { ReactComponent as SlackIcon } from \"./icons/slack.svg\";\nimport { ReactComponent as TwitterIcon } from \"./icons/twitter.svg\";\nimport { ReactComponent as TextbookIcon } from \"./icons/textbook.svg\";\nimport { ReactComponent as LaptopIcon } from \"./icons/laptop.svg\";\nimport { AdminWelcomeScreenWidgetPlugin } from \"@webiny/app-plugin-admin-welcome-screen/types\";\n\nconst linkStyle = css({\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"none\"\n },\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst imageStyle = css({\n width: \"30px\",\n height: \"30px\",\n marginBottom: \"5px\"\n});\n\nconst communityStyle = css({\n textAlign: \"left\"\n});\n\nconst widgetTitleStyle = css({\n fontWeight: 600,\n paddingTop: \"1rem\",\n paddingBottom: \"1rem\",\n textAlign: \"center\"\n});\n\nconst widgetDescriptionStyle = css({\n textAlign: \"center\",\n paddingLeft: \"20px\",\n paddingRight: \"20px\"\n});\n\nconst iconTextStyle = css({\n textAlign: \"center\"\n});\n\nconst pFormContentStyle = css({\n fontWeight: 600\n});\n\nconst pGetStartedStyle = css({\n paddingLeft: \"1.5rem\",\n paddingTop: \"1.5rem\"\n});\n\nconst footerContainerStyle = css({\n display: \"flex\",\n padding: \"1rem\"\n});\n\nconst widgetButtonStyle = css`\n text-align: center;\n margin-top: auto;\n`;\n\nconst footerTextStyle = css({\n backgroundColor: \"var(--mdc-theme-on-background)\",\n margin: \"1rem\"\n});\n\nconst footerLinkTextStyle = css({\n fontWeight: 600,\n paddingLeft: \"1rem\"\n});\n\nconst ContentTheme = styled(\"div\")({\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst Widget = styled.div`\n margin-left: 1.5rem;\n margin-right: 1.5rem;\n margin-bottom: 2rem;\n flex: 1 1 21%;\n max-width: 25%;\n min-height: 250px;\n`;\n\nconst WelcomeScreenWidgetsWrapper = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n @media (max-width: 479px) {\n flex-direction: column;\n }\n`;\n\nconst elevation = css`\n padding: 10px;\n height: calc(100% - 20px);\n display: flex;\n flex-direction: column;\n`;\n\nconst Welcome = () => {\n const { identity, getPermission } = useSecurity();\n\n if (!identity) {\n return null;\n }\n\n const widgets = plugins\n .byType<AdminWelcomeScreenWidgetPlugin>(\"admin-welcome-screen-widget\")\n .filter(pl => {\n if (pl.permission) {\n return getPermission(pl.permission);\n }\n return true;\n });\n\n const canSeeAnyWidget = widgets.length > 0;\n\n return (\n <SimpleForm>\n <SimpleFormHeader title={`Hi ${identity.displayName}!`} />\n <SimpleFormContent>\n <ContentTheme>\n <Cell span={12}>\n <Typography use={\"headline6\"}>\n {canSeeAnyWidget && (\n <p className={pGetStartedStyle}>\n To get started - pick one of the actions below:\n </p>\n )}\n {!canSeeAnyWidget && (\n <p className={pGetStartedStyle}>\n Please contact the administrator for permissions to access\n Webiny apps.\n </p>\n )}\n <br />\n </Typography>\n </Cell>\n <WelcomeScreenWidgetsWrapper>\n {widgets.map(pl => {\n return (\n <Widget key={pl.name} data-testid={pl.name}>\n <Elevation z={2} className={elevation}>\n <Typography use={\"headline6\"}>\n <p className={widgetTitleStyle}>{pl.widget.title}</p>\n </Typography>\n <Typography use={\"body1\"}>\n <p className={widgetDescriptionStyle}>\n {pl.widget.description}\n </p>\n </Typography>\n <div className={widgetButtonStyle}>{pl.widget.cta}</div>\n </Elevation>\n </Widget>\n );\n })}\n </WelcomeScreenWidgetsWrapper>\n </ContentTheme>\n </SimpleFormContent>\n <SimpleFormFooter>\n <Grid>\n <Cell span={8}>\n <Typography use={\"headline6\"} className={communityStyle}>\n <p className={pFormContentStyle}>Learn more about Webiny:</p>\n </Typography>\n </Cell>\n <Cell span={4} style={{ marginLeft: \"1rem\" }}>\n <Typography use={\"headline6\"} className={communityStyle}>\n <p className={pFormContentStyle}>Join our community:</p>\n </Typography>\n </Cell>\n <Cell span={8}>\n <Typography use={\"body1\"} className={communityStyle}>\n <p>\n Explore the Webiny documentation, learn about the architecture and\n check out code examples and guides:\n </p>\n </Typography>\n </Cell>\n <Cell span={4} style={{ marginLeft: \"1rem\" }}>\n <Typography use={\"body1\"} className={communityStyle}>\n <p>Get to know Webiny team members, discuss new ideas and get help:</p>\n </Typography>\n </Cell>\n <Cell\n span={4}\n className={footerTextStyle}\n style={{ margin: \"1rem 1rem 1rem 0rem\" }}\n >\n <Link\n to=\"https://www.webiny.com/docs\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <Typography use={\"headline5\"}>\n <div className={footerContainerStyle}>\n <TextbookIcon className={imageStyle} />\n <p className={footerLinkTextStyle}>Documentation</p>\n </div>\n </Typography>\n </Link>\n </Cell>\n <Cell\n span={4}\n className={footerTextStyle}\n style={{ margin: \"1rem 1rem 1rem 9px\", visibility: \"hidden\" }}\n >\n <Link\n to=\"https://github.com/webiny/webiny-examples\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <Typography use={\"headline5\"}>\n <span className={footerContainerStyle}>\n <LaptopIcon className={imageStyle} />\n <p className={footerLinkTextStyle}>Code examples</p>\n </span>\n </Typography>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://github.com/webiny/webiny-js\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <GithubIcon className={imageStyle} />\n <p>Github</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://www.webiny.com/slack/\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <SlackIcon className={imageStyle} />\n <p>Slack</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://youtube.com/webiny\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <YouTubeIcon className={imageStyle} />\n <p>YouTube</p>\n </Link>\n </Cell>\n <Cell span={1} className={iconTextStyle} align=\"middle\">\n <Link\n to=\"https://twitter.com/WebinyCMS\"\n className={linkStyle}\n target={\"_blank\"}\n rel={\"noopener noreferrer\"}\n >\n <TwitterIcon className={imageStyle} />\n <p>Twitter</p>\n </Link>\n </Cell>\n </Grid>\n </SimpleFormFooter>\n </SimpleForm>\n );\n};\n\nexport default Welcome;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAC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,aAAA,CAAC9D,YAAA,CAAAsF,IAAI;IACDC,EAAE,EAAC,4BAA4B;IAC/Bd,SAAS,EAAE5D,SAAU;IACrB8B,MAAM,EAAE,QAAS;IACjB6C,GAAG,EAAE;EAAsB,gBAE3B7F,MAAA,CAAAkE,OAAA,CAAAC,aAAA,CAACvD,QAAA,CAAAkF,cAAW;IAAChB,SAAS,EAAExD;EAAW,CAAE,CAAC,eACtCtB,MAAA,CAAAkE,OAAA,CAAAC,aAAA,YAAG,SAAU,CACX,CACJ,CAAC,eACPnE,MAAA,CAAAkE,OAAA,CAAAC,aAAA,CAACzD,KAAA,CAAAgE,IAAI;IAACC,IAAI,EAAE,CAAE;IAACG,SAAS,EAAE3C,aAAc;IAAC6D,KAAK,EAAC;EAAQ,gBACnDhG,MAAA,CAAAkE,OAAA,CAAAC,aAAA,CAAC9D,YAAA,CAAAsF,IAAI;IACDC,EAAE,EAAC,+BAA+B;IAClCd,SAAS,EAAE5D,SAAU;IACrB8B,MAAM,EAAE,QAAS;IACjB6C,GAAG,EAAE;EAAsB,gBAE3B7F,MAAA,CAAAkE,OAAA,CAAAC,aAAA,CAACpD,QAAA,CAAA+E,cAAW;IAAChB,SAAS,EAAExD;EAAW,CAAE,CAAC,eACtCtB,MAAA,CAAAkE,OAAA,CAAAC,aAAA,YAAG,SAAU,CACX,CACJ,CACJ,CACQ,CACV,CAAC;AAErB,CAAC;AAAC,IAAA8B,QAAA,GAEa5C,OAAO;AAAA6C,OAAA,CAAAhC,OAAA,GAAA+B,QAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Dashboard:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Dashboard: () => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DashboardRendererHOC","DashboardRenderer","Dashboard","DashboardRendererSpec"],"sources":["index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n CenteredView,\n Compose,\n DashboardRenderer as DashboardRendererSpec\n} from \"@webiny/app-admin\";\nimport Welcome from \"./Welcome\";\n\nconst DashboardRendererHOC = ()
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_appAdmin","_Welcome","_interopRequireDefault","DashboardRendererHOC","DashboardRenderer","createElement","CenteredView","maxWidth","default","Dashboard","Compose","component","DashboardRendererSpec","with","exports"],"sources":["index.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {\n CenteredView,\n Compose,\n DashboardRenderer as DashboardRendererSpec\n} from \"@webiny/app-admin\";\nimport Welcome from \"./Welcome\";\n\nconst DashboardRendererHOC = () => {\n return function DashboardRenderer() {\n return (\n <CenteredView maxWidth={1300}>\n <Welcome />\n </CenteredView>\n );\n };\n};\n\nexport const Dashboard = () => {\n return <Compose component={DashboardRendererSpec} with={DashboardRendererHOC} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAMI,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAA,EAAS;EAC/B,OAAO,SAASC,iBAAiBA,CAAA,EAAG;IAChC,oBACIP,KAAA,CAAAQ,aAAA,CAACL,SAAA,CAAAM,YAAY;MAACC,QAAQ,EAAE;IAAK,gBACzBV,KAAA,CAAAQ,aAAA,CAACJ,QAAA,CAAAO,OAAO,MAAE,CACA,CAAC;EAEvB,CAAC;AACL,CAAC;AAEM,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EAC3B,oBAAOZ,KAAA,CAAAQ,aAAA,CAACL,SAAA,CAAAU,OAAO;IAACC,SAAS,EAAEC,2BAAsB;IAACC,IAAI,EAAEV;EAAqB,CAAE,CAAC;AACpF,CAAC;AAACW,OAAA,CAAAL,SAAA,GAAAA,SAAA"}
|
package/modules/Layout.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Layout:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Layout: () => JSX.Element;
|
package/modules/Layout.js
CHANGED
|
@@ -44,13 +44,11 @@ var RMWCLayout = function RMWCLayout() {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
var Layout = function Layout() {
|
|
47
|
-
/**
|
|
48
|
-
* TODO @ts-refactor @pavel
|
|
49
|
-
*/
|
|
50
|
-
// @ts-ignore
|
|
51
47
|
return /*#__PURE__*/_react.default.createElement(_appAdmin.Compose, {
|
|
52
48
|
component: _appAdmin.LayoutRenderer,
|
|
53
49
|
with: RMWCLayout
|
|
54
50
|
});
|
|
55
51
|
};
|
|
56
|
-
exports.Layout = Layout;
|
|
52
|
+
exports.Layout = Layout;
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=Layout.js.map
|
package/modules/Layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RMWCLayout","title","children","location","width","paddingTop","Layout","LayoutRenderer"],"sources":["Layout.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport Helmet from \"react-helmet\";\nimport {\n
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactHelmet","_interopRequireDefault","_appAdmin","_TopAppBar","RMWCLayout","_ref","title","children","default","createElement","Fragment","Tags","tags","location","TopAppBarPrimary","fixed","TopAppBarSection","style","width","alignStart","Brand","Search","alignEnd","LocaleSelector","UserMenu","paddingTop","Navigation","Layout","Compose","component","LayoutRenderer","with","exports"],"sources":["Layout.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport Helmet from \"react-helmet\";\nimport {\n Brand,\n Compose,\n LayoutProps,\n LayoutRenderer,\n LocaleSelector,\n Navigation,\n Search,\n Tags,\n UserMenu\n} from \"@webiny/app-admin\";\nimport { TopAppBarPrimary, TopAppBarSection } from \"@webiny/ui/TopAppBar\";\n\nconst RMWCLayout = () => {\n return function RMWCLayout({ title, children }: LayoutProps) {\n return (\n <Fragment>\n {title ? <Helmet title={title} /> : null}\n <Tags tags={{ location: \"appBar\" }}>\n <TopAppBarPrimary fixed>\n <TopAppBarSection style={{ width: \"25%\" }} alignStart>\n <Brand />\n </TopAppBarSection>\n <TopAppBarSection style={{ width: \"50%\" }}>\n <Search />\n </TopAppBarSection>\n <TopAppBarSection style={{ width: \"25%\" }} alignEnd>\n <LocaleSelector />\n <UserMenu />\n </TopAppBarSection>\n </TopAppBarPrimary>\n </Tags>\n <div style={{ paddingTop: 67 }}>{children}</div>\n <Navigation />\n </Fragment>\n );\n };\n};\n\nexport const Layout = () => {\n return <Compose component={LayoutRenderer} with={RMWCLayout} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAWA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAMK,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;EACrB,OAAO,SAASA,UAAUA,CAAAC,IAAA,EAAmC;IAAA,IAAhCC,KAAK,GAAAD,IAAA,CAALC,KAAK;MAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACxC,oBACIV,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACZ,MAAA,CAAAa,QAAQ,QACJJ,KAAK,gBAAGT,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACT,YAAA,CAAAQ,OAAM;MAACF,KAAK,EAAEA;IAAM,CAAE,CAAC,GAAG,IAAI,eACxCT,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACP,SAAA,CAAAS,IAAI;MAACC,IAAI,EAAE;QAAEC,QAAQ,EAAE;MAAS;IAAE,gBAC/BhB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACN,UAAA,CAAAW,gBAAgB;MAACC,KAAK;IAAA,gBACnBlB,MAAA,CAAAW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
-
declare const Hamburger:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Hamburger: () => JSX.Element | null;
|
|
3
3
|
export default Hamburger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Hamburger","useTags","location","useNavigation","visible","setVisible","color","undefined"],"sources":["Hamburger.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { ReactComponent as MenuIcon } from \"./icons/hamburger.svg\";\nimport { useNavigation } from \"./index\";\nimport { useTags } from \"@webiny/app-admin\";\n\nconst Hamburger
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Button","_hamburger","_index","_appAdmin","Hamburger","_useTags","useTags","location","_useNavigation","useNavigation","visible","setVisible","default","createElement","IconButton","icon","ReactComponent","style","color","undefined","onClick","_default","exports"],"sources":["Hamburger.tsx"],"sourcesContent":["import React from \"react\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { ReactComponent as MenuIcon } from \"./icons/hamburger.svg\";\nimport { useNavigation } from \"./index\";\nimport { useTags } from \"@webiny/app-admin\";\n\nconst Hamburger = () => {\n const { location } = useTags();\n const { visible, setVisible } = useNavigation();\n\n if (location === \"installer\") {\n return null;\n }\n\n return (\n <IconButton\n icon={<MenuIcon style={{ color: location === \"navigation\" ? undefined : \"white\" }} />}\n onClick={() => setVisible(!visible)}\n data-testid={location === \"navigation\" ? undefined : \"apps-menu\"}\n />\n );\n};\n\nexport default Hamburger;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EACpB,IAAAC,QAAA,GAAqB,IAAAC,iBAAO,EAAC,CAAC;IAAtBC,QAAQ,GAAAF,QAAA,CAARE,QAAQ;EAChB,IAAAC,cAAA,GAAgC,IAAAC,oBAAa,EAAC,CAAC;IAAvCC,OAAO,GAAAF,cAAA,CAAPE,OAAO;IAAEC,UAAU,GAAAH,cAAA,CAAVG,UAAU;EAE3B,IAAIJ,QAAQ,KAAK,WAAW,EAAE;IAC1B,OAAO,IAAI;EACf;EAEA,oBACIV,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,OAAA,CAAAc,UAAU;IACPC,IAAI,eAAElB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACZ,UAAA,CAAAe,cAAQ;MAACC,KAAK,EAAE;QAAEC,KAAK,EAAEX,QAAQ,KAAK,YAAY,GAAGY,SAAS,GAAG;MAAQ;IAAE,CAAE,CAAE;IACtFC,OAAO,EAAE,SAAAA,QAAA;MAAA,OAAMT,UAAU,CAAC,CAACD,OAAO,CAAC;IAAA,CAAC;IACpC,eAAaH,QAAQ,KAAK,YAAY,GAAGY,SAAS,GAAG;EAAY,CACpE,CAAC;AAEV,CAAC;AAAC,IAAAE,QAAA,GAEajB,SAAS;AAAAkB,OAAA,CAAAV,OAAA,GAAAS,QAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
/// <reference types="web" />
|
|
4
2
|
export declare const MenuHeader: import("@emotion/styled").StyledComponent<{
|
|
5
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
4
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuHeader","styled","display","alignItems","padding","backgroundColor","borderBottom","navHeader","css","minHeight","navContent","logoStyle","paddingLeft","color","MenuFooter","borderTop","a","textDecoration","subFooter","margin"],"sources":["Styled.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\n\nexport const MenuHeader = styled(\"div\")({\n display: \"flex\",\n alignItems: \"center\",\n padding: 5,\n backgroundColor: \"var(--mdc-theme-surface)\",\n borderBottom: \"1px solid var(--mdc-theme-on-background)\"\n});\n\nexport const navHeader = css({\n padding: 0,\n \"&.mdc-drawer__header\": {\n padding: \"0 !important\",\n minHeight: 0\n }\n});\n\nexport const navContent = css({\n padding: \"0 !important\"\n});\n\nexport const logoStyle = css({\n \"&.mdc-top-app-bar__title\": {\n paddingLeft: 15,\n \".webiny-logo\": {\n color: \"var(--mdc-theme-primary)\"\n }\n }\n});\n\nexport const MenuFooter = styled(\"div\")({\n borderTop: \"1px solid var(--mdc-theme-on-background)\",\n a: {\n color: \"var(--mdc-theme-text-on-primary)\",\n textDecoration: \"none\"\n }\n});\n\nexport const subFooter = css({\n \".mdc-drawer &.mdc-list-item\": {\n borderTop: \"1px solid var(--mdc-theme-on-background)\",\n padding: \"10px 16px\",\n margin: 0\n }\n});\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_styled","_interopRequireDefault","require","_emotion","MenuHeader","styled","target","label","display","alignItems","padding","backgroundColor","borderBottom","exports","navHeader","css","minHeight","navContent","logoStyle","paddingLeft","color","MenuFooter","borderTop","a","textDecoration","subFooter","margin"],"sources":["Styled.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\n\nexport const MenuHeader = styled(\"div\")({\n display: \"flex\",\n alignItems: \"center\",\n padding: 5,\n backgroundColor: \"var(--mdc-theme-surface)\",\n borderBottom: \"1px solid var(--mdc-theme-on-background)\"\n});\n\nexport const navHeader = css({\n padding: 0,\n \"&.mdc-drawer__header\": {\n padding: \"0 !important\",\n minHeight: 0\n }\n});\n\nexport const navContent = css({\n padding: \"0 !important\"\n});\n\nexport const logoStyle = css({\n \"&.mdc-top-app-bar__title\": {\n paddingLeft: 15,\n \".webiny-logo\": {\n color: \"var(--mdc-theme-primary)\"\n }\n }\n});\n\nexport const MenuFooter = styled(\"div\")({\n borderTop: \"1px solid var(--mdc-theme-on-background)\",\n a: {\n color: \"var(--mdc-theme-text-on-primary)\",\n textDecoration: \"none\"\n }\n});\n\nexport const subFooter = css({\n \".mdc-drawer &.mdc-list-item\": {\n borderTop: \"1px solid var(--mdc-theme-on-background)\",\n padding: \"10px 16px\",\n margin: 0\n }\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,IAAME,UAAU,oBAAGC,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAE;EACpCC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,CAAC;EACVC,eAAe,EAAE,0BAA0B;EAC3CC,YAAY,EAAE;AAClB,CAAC,CAAC;AAACC,OAAA,CAAAT,UAAA,GAAAA,UAAA;AAEI,IAAMU,SAAS,gBAAG,IAAAC,YAAG,EAAC;EACzBL,OAAO,EAAE,CAAC;EACV,sBAAsB,EAAE;IACpBA,OAAO,EAAE,cAAc;IACvBM,SAAS,EAAE;EACf;AACJ,CAAC,qBAAC;AAACH,OAAA,CAAAC,SAAA,GAAAA,SAAA;AAEI,IAAMG,UAAU,gBAAG,IAAAF,YAAG,EAAC;EAC1BL,OAAO,EAAE;AACb,CAAC,sBAAC;AAACG,OAAA,CAAAI,UAAA,GAAAA,UAAA;AAEI,IAAMC,SAAS,gBAAG,IAAAH,YAAG,EAAC;EACzB,0BAA0B,EAAE;IACxBI,WAAW,EAAE,EAAE;IACf,cAAc,EAAE;MACZC,KAAK,EAAE;IACX;EACJ;AACJ,CAAC,qBAAC;AAACP,OAAA,CAAAK,SAAA,GAAAA,SAAA;AAEI,IAAMG,UAAU,oBAAGhB,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAE;EACpCe,SAAS,EAAE,0CAA0C;EACrDC,CAAC,EAAE;IACCH,KAAK,EAAE,kCAAkC;IACzCI,cAAc,EAAE;EACpB;AACJ,CAAC,CAAC;AAACX,OAAA,CAAAQ,UAAA,GAAAA,UAAA;AAEI,IAAMI,SAAS,gBAAG,IAAAV,YAAG,EAAC;EACzB,6BAA6B,EAAE;IAC3BO,SAAS,EAAE,0CAA0C;IACrDZ,OAAO,EAAE,WAAW;IACpBgB,MAAM,EAAE;EACZ;AACJ,CAAC,qBAAC;AAACb,OAAA,CAAAY,SAAA,GAAAA,SAAA"}
|
|
@@ -5,6 +5,6 @@ interface NavigationContext {
|
|
|
5
5
|
}
|
|
6
6
|
declare const NavigationContext: React.Context<NavigationContext>;
|
|
7
7
|
export declare function useNavigation(): NavigationContext;
|
|
8
|
-
export declare const NavigationImpl: () =>
|
|
9
|
-
export declare const Navigation:
|
|
8
|
+
export declare const NavigationImpl: () => () => JSX.Element;
|
|
9
|
+
export declare const Navigation: () => JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -140,4 +140,6 @@ var Navigation = function Navigation() {
|
|
|
140
140
|
with: [_MenuGroupRenderer.MenuGroupRenderer, _MenuSectionItemRenderer.MenuSectionItemRenderer, _MenuSectionRenderer.MenuSectionRenderer, _MenuLinkRenderer.MenuLinkRenderer, _MenuElementRenderer.MenuElementRenderer]
|
|
141
141
|
}));
|
|
142
142
|
};
|
|
143
|
-
exports.Navigation = Navigation;
|
|
143
|
+
exports.Navigation = Navigation;
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AutoWidthDrawer","styled","Drawer","NavigationContext","React","createContext","visible","setVisible","displayName","useNavigation","useContext","BrandImpl","Brand","BrandWithHamburger","NavigationProvider","Component","props","useState","context","useMemo","NavigationImpl","Navigation","useAdminNavigation","menuItems","hideDrawer","useCallback","mainMenu","filter","m","tags","includes","footerMenu","wbyVersion","appConfig","getKey","process","env","REACT_APP_WEBINY_VERSION","navHeader","navContent","subFooter","menuSorter","a","b","pin","label","localeCompare","SortedMenuItems","MenuItems","sort","NavigationSpec","BrandSpec","MenuItemRenderer","MenuGroupRenderer","MenuSectionItemRenderer","MenuSectionRenderer","MenuLinkRenderer","MenuElementRenderer"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useContext, useMemo, useState } from \"react\";\nimport styled from \"@emotion/styled\";\nimport { Drawer, DrawerContent, DrawerHeader } from \"@webiny/ui/Drawer\";\nimport {\n Compose,\n Provider,\n NavigationRenderer as NavigationSpec,\n MenuItems,\n MenuItemRenderer,\n Brand as BrandSpec,\n useNavigation as useAdminNavigation,\n MenuData,\n MenuItemsProps,\n HigherOrderComponent\n} from \"@webiny/app-admin\";\nimport Hamburger from \"./Hamburger\";\nimport { MenuGroupRenderer } from \"./renderers/MenuGroupRenderer\";\nimport { MenuSectionItemRenderer } from \"./renderers/MenuSectionItemRenderer\";\nimport { MenuSectionRenderer } from \"./renderers/MenuSectionRenderer\";\nimport { MenuLinkRenderer } from \"./renderers/MenuLinkRenderer\";\nimport { MenuElementRenderer } from \"./renderers/MenuElementRenderer\";\nimport { List, ListItem } from \"@webiny/ui/List\";\nimport { MenuFooter, subFooter, MenuHeader, navHeader, navContent } from \"./Styled\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst AutoWidthDrawer = styled(Drawer)`\n width: auto;\n`;\n\ninterface NavigationContext {\n visible: boolean;\n setVisible(visible: boolean): void;\n}\n\nconst NavigationContext = React.createContext<NavigationContext>({\n visible: false,\n setVisible: () => {\n return void 0;\n }\n});\nNavigationContext.displayName = \"NavigationContext\";\n\nexport function useNavigation(): NavigationContext {\n return useContext(NavigationContext);\n}\n\nconst BrandImpl: HigherOrderComponent = Brand => {\n return function BrandWithHamburger() {\n return (\n <Fragment>\n <Hamburger />\n <Brand />\n </Fragment>\n );\n };\n};\n\nconst NavigationProvider = (Component: React.FC): React.FC => {\n return function NavigationProvider(props) {\n const [visible, setVisible] = useState(false);\n\n const context = useMemo(() => ({ visible, setVisible }), [visible]);\n\n return (\n <NavigationContext.Provider value={context}>\n <Component {...props} />\n </NavigationContext.Provider>\n );\n };\n};\n\nexport const NavigationImpl = (): React.FC => {\n return function Navigation() {\n const { menuItems } = useAdminNavigation();\n const { visible, setVisible } = useNavigation();\n\n const hideDrawer = useCallback(() => {\n setVisible(false);\n }, []);\n\n const mainMenu = useMemo(\n () => menuItems.filter(m => !(m.tags || []).includes(\"footer\")),\n [menuItems]\n );\n\n const footerMenu = useMemo(\n () => menuItems.filter(m => (m.tags || []).includes(\"footer\")),\n [menuItems]\n );\n\n const wbyVersion = appConfig.getKey(\"WEBINY_VERSION\", process.env.REACT_APP_WEBINY_VERSION);\n\n return (\n <AutoWidthDrawer modal open={visible} onClose={hideDrawer}>\n <DrawerHeader className={navHeader}>\n <MenuHeader>\n <BrandSpec />\n </MenuHeader>\n </DrawerHeader>\n <DrawerContent className={navContent}>\n <MenuItems menuItems={mainMenu} />\n </DrawerContent>\n <MenuFooter>\n <List nonInteractive>\n <MenuItems menuItems={footerMenu} />\n <ListItem ripple={false} className={subFooter}>\n <Typography use={\"body2\"}>Webiny v{wbyVersion}</Typography>\n </ListItem>\n </List>\n </MenuFooter>\n </AutoWidthDrawer>\n );\n };\n};\n\nconst menuSorter = (a: MenuData, b: MenuData): number => {\n if (a.pin === b.pin) {\n return (a.label || \"\").localeCompare(b.label || \"\");\n }\n\n if (a.pin) {\n return a.pin === \"first\" ? -1 : 1;\n }\n\n if (b.pin) {\n return b.pin === \"first\" ? 1 : -1;\n }\n\n return (a.label || \"\").localeCompare(b.label || \"\");\n};\n\nconst SortedMenuItems: HigherOrderComponent<MenuItemsProps> = MenuItems => {\n return function SortedMenuItems({ menuItems }) {\n return <MenuItems menuItems={[...menuItems].sort(menuSorter)} />;\n };\n};\n\nexport const Navigation: React.FC = () => {\n return (\n <Fragment>\n <Provider hoc={NavigationProvider} />\n <Compose component={NavigationSpec} with={NavigationImpl} />\n <Compose component={MenuItems} with={SortedMenuItems} />\n <Compose component={BrandSpec} with={BrandImpl} />\n <Compose\n component={MenuItemRenderer}\n with={[\n MenuGroupRenderer,\n MenuSectionItemRenderer,\n MenuSectionRenderer,\n MenuLinkRenderer,\n MenuElementRenderer\n ]}\n />\n </Fragment>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,eAAe,oBAAGC,eAAM,EAACC,cAAM;EAAA;EAAA;AAAA,iBAEpC;AAOD,IAAMC,iBAAiB,gBAAGC,cAAK,CAACC,aAAa,CAAoB;EAC7DC,OAAO,EAAE,KAAK;EACdC,UAAU,EAAE,sBAAM;IACd,OAAO,KAAK,CAAC;EACjB;AACJ,CAAC,CAAC;AACFJ,iBAAiB,CAACK,WAAW,GAAG,mBAAmB;AAE5C,SAASC,aAAa,GAAsB;EAC/C,OAAO,IAAAC,iBAAU,EAACP,iBAAiB,CAAC;AACxC;AAEA,IAAMQ,SAA+B,GAAG,SAAlCA,SAA+B,CAAGC,KAAK,EAAI;EAC7C,OAAO,SAASC,kBAAkB,GAAG;IACjC,oBACI,6BAAC,eAAQ,qBACL,6BAAC,kBAAS,OAAG,eACb,6BAAC,KAAK,OAAG,CACF;EAEnB,CAAC;AACL,CAAC;AAED,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkB,CAAIC,SAAmB,EAAe;EAC1D,OAAO,SAASD,kBAAkB,CAACE,KAAK,EAAE;IACtC,gBAA8B,IAAAC,eAAQ,EAAC,KAAK,CAAC;MAAA;MAAtCX,OAAO;MAAEC,UAAU;IAE1B,IAAMW,OAAO,GAAG,IAAAC,cAAO,EAAC;MAAA,OAAO;QAAEb,OAAO,EAAPA,OAAO;QAAEC,UAAU,EAAVA;MAAW,CAAC;IAAA,CAAC,EAAE,CAACD,OAAO,CAAC,CAAC;IAEnE,oBACI,6BAAC,iBAAiB,CAAC,QAAQ;MAAC,KAAK,EAAEY;IAAQ,gBACvC,6BAAC,SAAS,EAAKF,KAAK,CAAI,CACC;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;IAAC,GAAG,EAAEP;EAAmB,EAAG,eACrC,6BAAC,iBAAO;IAAC,SAAS,EAAEoC,4BAAe;IAAC,IAAI,EAAE9B;EAAe,EAAG,eAC5D,6BAAC,iBAAO;IAAC,SAAS,EAAE4B,mBAAU;IAAC,IAAI,EAAED;EAAgB,EAAG,eACxD,6BAAC,iBAAO;IAAC,SAAS,EAAEI,eAAU;IAAC,IAAI,EAAExC;EAAU,EAAG,eAClD,6BAAC,iBAAO;IACJ,SAAS,EAAEyC,0BAAiB;IAC5B,IAAI,EAAE,CACFC,oCAAiB,EACjBC,gDAAuB,EACvBC,wCAAmB,EACnBC,kCAAgB,EAChBC,wCAAmB;EACrB,EACJ,CACK;AAEnB,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_styled","_interopRequireDefault","_Drawer","_appAdmin","_Hamburger","_MenuGroupRenderer","_MenuSectionItemRenderer","_MenuSectionRenderer","_MenuLinkRenderer","_MenuElementRenderer","_List","_Styled","_config","_Typography","AutoWidthDrawer","styled","Drawer","label","target","NavigationContext","React","createContext","visible","setVisible","displayName","useNavigation","useContext","BrandImpl","Brand","BrandWithHamburger","default","createElement","Fragment","NavigationProvider","Component","props","_useState","useState","_useState2","_slicedToArray2","context","useMemo","Provider","value","NavigationImpl","Navigation","_useAdminNavigation","useAdminNavigation","menuItems","_useNavigation","hideDrawer","useCallback","mainMenu","filter","m","tags","includes","footerMenu","wbyVersion","appConfig","getKey","process","env","REACT_APP_WEBINY_VERSION","modal","open","onClose","DrawerHeader","className","navHeader","MenuHeader","DrawerContent","navContent","MenuItems","MenuFooter","List","nonInteractive","ListItem","ripple","subFooter","Typography","use","exports","menuSorter","a","b","pin","localeCompare","SortedMenuItems","_ref","_toConsumableArray2","sort","hoc","Compose","component","NavigationSpec","with","BrandSpec","MenuItemRenderer","MenuGroupRenderer","MenuSectionItemRenderer","MenuSectionRenderer","MenuLinkRenderer","MenuElementRenderer"],"sources":["index.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useContext, useMemo, useState } from \"react\";\nimport styled from \"@emotion/styled\";\nimport { Drawer, DrawerContent, DrawerHeader } from \"@webiny/ui/Drawer\";\nimport {\n Compose,\n Provider,\n NavigationRenderer as NavigationSpec,\n MenuItems,\n MenuItemRenderer,\n Brand as BrandSpec,\n useNavigation as useAdminNavigation,\n MenuData,\n MenuItemsProps,\n HigherOrderComponent\n} from \"@webiny/app-admin\";\nimport Hamburger from \"./Hamburger\";\nimport { MenuGroupRenderer } from \"./renderers/MenuGroupRenderer\";\nimport { MenuSectionItemRenderer } from \"./renderers/MenuSectionItemRenderer\";\nimport { MenuSectionRenderer } from \"./renderers/MenuSectionRenderer\";\nimport { MenuLinkRenderer } from \"./renderers/MenuLinkRenderer\";\nimport { MenuElementRenderer } from \"./renderers/MenuElementRenderer\";\nimport { List, ListItem } from \"@webiny/ui/List\";\nimport { MenuFooter, subFooter, MenuHeader, navHeader, navContent } from \"./Styled\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst AutoWidthDrawer = styled(Drawer)`\n width: auto;\n`;\n\ninterface NavigationContext {\n visible: boolean;\n setVisible(visible: boolean): void;\n}\n\nconst NavigationContext = React.createContext<NavigationContext>({\n visible: false,\n setVisible: () => {\n return void 0;\n }\n});\nNavigationContext.displayName = \"NavigationContext\";\n\nexport function useNavigation(): NavigationContext {\n return useContext(NavigationContext);\n}\n\nconst BrandImpl: HigherOrderComponent = Brand => {\n return function BrandWithHamburger() {\n return (\n <Fragment>\n <Hamburger />\n <Brand />\n </Fragment>\n );\n };\n};\n\ninterface NavigationProviderProps {\n children?: React.ReactNode;\n}\n\nconst NavigationProvider = (Component: React.ComponentType) => {\n return function NavigationProvider(props: NavigationProviderProps) {\n const [visible, setVisible] = useState(false);\n\n const context = useMemo(() => ({ visible, setVisible }), [visible]);\n\n return (\n <NavigationContext.Provider value={context}>\n <Component {...props} />\n </NavigationContext.Provider>\n );\n };\n};\n\nexport const NavigationImpl = () => {\n return function Navigation() {\n const { menuItems } = useAdminNavigation();\n const { visible, setVisible } = useNavigation();\n\n const hideDrawer = useCallback(() => {\n setVisible(false);\n }, []);\n\n const mainMenu = useMemo(\n () => menuItems.filter(m => !(m.tags || []).includes(\"footer\")),\n [menuItems]\n );\n\n const footerMenu = useMemo(\n () => menuItems.filter(m => (m.tags || []).includes(\"footer\")),\n [menuItems]\n );\n\n const wbyVersion = appConfig.getKey(\"WEBINY_VERSION\", process.env.REACT_APP_WEBINY_VERSION);\n\n return (\n <AutoWidthDrawer modal open={visible} onClose={hideDrawer}>\n <DrawerHeader className={navHeader}>\n <MenuHeader>\n <BrandSpec />\n </MenuHeader>\n </DrawerHeader>\n <DrawerContent className={navContent}>\n <MenuItems menuItems={mainMenu} />\n </DrawerContent>\n <MenuFooter>\n <List nonInteractive>\n <MenuItems menuItems={footerMenu} />\n <ListItem ripple={false} className={subFooter}>\n <Typography use={\"body2\"}>Webiny v{wbyVersion}</Typography>\n </ListItem>\n </List>\n </MenuFooter>\n </AutoWidthDrawer>\n );\n };\n};\n\nconst menuSorter = (a: MenuData, b: MenuData): number => {\n if (a.pin === b.pin) {\n return (a.label || \"\").localeCompare(b.label || \"\");\n }\n\n if (a.pin) {\n return a.pin === \"first\" ? -1 : 1;\n }\n\n if (b.pin) {\n return b.pin === \"first\" ? 1 : -1;\n }\n\n return (a.label || \"\").localeCompare(b.label || \"\");\n};\n\nconst SortedMenuItems: HigherOrderComponent<MenuItemsProps> = MenuItems => {\n return function SortedMenuItems({ menuItems }) {\n return <MenuItems menuItems={[...menuItems].sort(menuSorter)} />;\n };\n};\n\nexport const Navigation = () => {\n return (\n <Fragment>\n <Provider hoc={NavigationProvider} />\n <Compose component={NavigationSpec} with={NavigationImpl} />\n <Compose component={MenuItems} with={SortedMenuItems} />\n <Compose component={BrandSpec} with={BrandImpl} />\n <Compose\n component={MenuItemRenderer}\n with={[\n MenuGroupRenderer,\n MenuSectionItemRenderer,\n M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export declare const MenuElementRenderer: (PrevMenuItem: React.ComponentType) => () => JSX.Element;
|
|
@@ -17,4 +17,6 @@ var MenuElementRenderer = function MenuElementRenderer(PrevMenuItem) {
|
|
|
17
17
|
return menuItem.element;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
exports.MenuElementRenderer = MenuElementRenderer;
|
|
20
|
+
exports.MenuElementRenderer = MenuElementRenderer;
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=MenuElementRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuElementRenderer","PrevMenuItem","MenuComponent","useMenuItem","menuItem","element"],"sources":["MenuElementRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { useMenuItem } from \"@webiny/app-admin\";\n\nexport const MenuElementRenderer = (PrevMenuItem: React.
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_appAdmin","MenuElementRenderer","PrevMenuItem","MenuComponent","_useMenuItem","useMenuItem","menuItem","element","default","createElement","exports"],"sources":["MenuElementRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { useMenuItem } from \"@webiny/app-admin\";\n\nexport const MenuElementRenderer = (PrevMenuItem: React.ComponentType) => {\n return function MenuComponent() {\n const { menuItem } = useMenuItem();\n if (!menuItem || !menuItem.element) {\n return <PrevMenuItem />;\n }\n\n return menuItem.element;\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEO,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,YAAiC,EAAK;EACtE,OAAO,SAASC,aAAaA,CAAA,EAAG;IAC5B,IAAAC,YAAA,GAAqB,IAAAC,qBAAW,EAAC,CAAC;MAA1BC,QAAQ,GAAAF,YAAA,CAARE,QAAQ;IAChB,IAAI,CAACA,QAAQ,IAAI,CAACA,QAAQ,CAACC,OAAO,EAAE;MAChC,oBAAOV,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACP,YAAY,MAAE,CAAC;IAC3B;IAEA,OAAOI,QAAQ,CAACC,OAAO;EAC3B,CAAC;AACL,CAAC;AAACG,OAAA,CAAAT,mBAAA,GAAAA,mBAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const MenuGroupRenderer: (PrevMenuItem: React.
|
|
2
|
+
export declare const MenuGroupRenderer: (PrevMenuItem: React.ComponentType) => () => JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","menuTitle","css","borderBottom","padding","margin","height","width","fontWeight","boxSizing","menuTitleActive","backgroundColor","LOCAL_STORAGE_KEY","loadState","localStorage","get","split","filter","Boolean","storeState","state","set","join","getState","id","includes","MenuGroupRenderer","PrevMenuItem","MenuGroup","useNavigation","setVisible","useMenuItem","menuItem","depth","shouldRender","children","useState","name","isExpanded","setExpanded","hideMenu","useCallback","toggleElement","splice","indexOf","push","length","withLink","content","path","testId","onClick","item","classNames","icon","label"],"sources":["MenuGroupRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useState } from \"react\";\nimport { default as localStorage } from \"store\";\nimport { css } from \"emotion\";\nimport { Transition } from \"react-transition-group\";\nimport classNames from \"classnames\";\nimport { Link } from \"@webiny/react-router\";\nimport { useMenuItem, MenuItems } from \"@webiny/app-admin\";\nimport { List, ListItem, ListItemGraphic, ListItemMeta } from \"@webiny/ui/List\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { useNavigation } from \"../index\";\nimport { ReactComponent as UpIcon } from \"../icons/round-keyboard_arrow_up-24px.svg\";\nimport { ReactComponent as DownIcon } from \"../icons/round-keyboard_arrow_down-24px.svg\";\n\nconst defaultStyle = {\n transform: \"translateY(-20px)\",\n opacity: 0,\n transitionProperty: \"transform, opacity\",\n transitionTimingFunction: \"cubic-bezier(0, 0, .2, 1)\",\n transitionDuration: \"100ms\",\n willChange: \"opacity, transform\"\n};\n\nconst transitionStyles: Record<string, any> = {\n entering: {\n transform: \"translateY(-20px)\",\n opacity: 0\n },\n entered: {\n transform: \"translateY(0px)\",\n opacity: 1\n }\n};\n\nconst menuTitle = css({\n \".mdc-drawer &.mdc-list\": {\n borderBottom: \"1px solid var(--mdc-theme-on-background)\",\n padding: 0,\n \".mdc-list-item\": {\n margin: 0,\n padding: \"0 15px\",\n height: \"48px\",\n width: \"100%\",\n fontWeight: 600,\n boxSizing: \"border-box\"\n }\n }\n});\n\nconst menuTitleActive = css({\n backgroundColor: \"var(--mdc-theme-background)\"\n});\n\nconst LOCAL_STORAGE_KEY = \"webiny_navigation_groups\";\n\nfunction loadState(): string[] {\n return (localStorage.get(LOCAL_STORAGE_KEY) || \"\").split(\",\").filter(Boolean);\n}\n\nfunction storeState(state: string[]) {\n localStorage.set(LOCAL_STORAGE_KEY, state.join(\",\"));\n}\n\nfunction getState(id: string | null): boolean {\n if (!id) {\n return false;\n }\n const state = loadState();\n return state.includes(id);\n}\n\nexport const MenuGroupRenderer = (PrevMenuItem: React.FC): React.FC => {\n return function MenuGroup() {\n const { setVisible } = useNavigation();\n const { menuItem, depth } = useMenuItem();\n const shouldRender = depth === 0 && menuItem && menuItem.children;\n const [isExpanded, setExpanded] = useState<boolean>(\n getState(menuItem ? menuItem.name : null)\n );\n\n const hideMenu = useCallback(() => setVisible(false), []);\n\n const toggleElement = useCallback(() => {\n if (!menuItem) {\n return;\n }\n const state = loadState();\n if (isExpanded && state.includes(menuItem.name)) {\n state.splice(state.indexOf(menuItem.name), 1);\n }\n\n if (!isExpanded && !state.includes(menuItem.name)) {\n state.push(menuItem.name);\n }\n\n setExpanded(!isExpanded);\n storeState(state);\n }, [isExpanded, setExpanded]);\n\n if (!shouldRender) {\n return <PrevMenuItem />;\n }\n\n if (!menuItem || !menuItem.children.length) {\n return null;\n }\n\n const withLink = (content: React.ReactNode): React.ReactElement => {\n return (\n <Link\n to={menuItem.path || \"\"}\n data-testid={menuItem.testId}\n onClick={menuItem.onClick || hideMenu}\n >\n {content}\n </Link>\n );\n };\n\n const item = (\n <List className={classNames(menuTitle, { [menuTitleActive]: isExpanded })}>\n <ListItem data-testid={menuItem.testId} onClick={toggleElement}>\n {menuItem.icon && (\n <ListItemGraphic>\n <IconButton icon={menuItem.icon} />\n </ListItemGraphic>\n )}\n\n {menuItem.label}\n\n {menuItem.children.length ? (\n <ListItemMeta>\n <IconButton icon={isExpanded ? <UpIcon /> : <DownIcon />} />\n </ListItemMeta>\n ) : null}\n </ListItem>\n </List>\n );\n\n return (\n <Fragment>\n {menuItem.path ? withLink(item) : item}\n {menuItem.children ? (\n <Transition in={isExpanded} timeout={100} appear unmountOnExit>\n {state => (\n <div style={{ ...defaultStyle, ...transitionStyles[state] }}>\n <MenuItems menuItems={menuItem.children} />\n </div>\n )}\n </Transition>\n ) : null}\n </Fragment>\n );\n };\n};\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,YAAY,GAAG;EACjBC,SAAS,EAAE,mBAAmB;EAC9BC,OAAO,EAAE,CAAC;EACVC,kBAAkB,EAAE,oBAAoB;EACxCC,wBAAwB,EAAE,2BAA2B;EACrDC,kBAAkB,EAAE,OAAO;EAC3BC,UAAU,EAAE;AAChB,CAAC;AAED,IAAMC,gBAAqC,GAAG;EAC1CC,QAAQ,EAAE;IACNP,SAAS,EAAE,mBAAmB;IAC9BC,OAAO,EAAE;EACb,CAAC;EACDO,OAAO,EAAE;IACLR,SAAS,EAAE,iBAAiB;IAC5BC,OAAO,EAAE;EACb;AACJ,CAAC;AAED,IAAMQ,SAAS,gBAAG,IAAAC,YAAG,EAAC;EAClB,wBAAwB,EAAE;IACtBC,YAAY,EAAE,0CAA0C;IACxDC,OAAO,EAAE,CAAC;IACV,gBAAgB,EAAE;MACdC,MAAM,EAAE,CA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AAS,oCAAKS,eAAe,EAAG4B,UAAU;IAAI,gBACtE,6BAAC,cAAQ;MAAC,eAAaN,QAAQ,CAACkB,MAAO;MAAC,OAAO,EAAER;IAAc,GAC1DV,QAAQ,CAACsB,IAAI,iBACV,6BAAC,qBAAe,qBACZ,6BAAC,kBAAU;MAAC,IAAI,EAAEtB,QAAQ,CAACsB;IAAK,EAAG,CAE1C,EAEAtB,QAAQ,CAACuB,KAAK,EAEdvB,QAAQ,CAACG,QAAQ,CAACW,MAAM,gBACrB,6BAAC,kBAAY,qBACT,6BAAC,kBAAU;MAAC,IAAI,EAAER,UAAU,gBAAG,6BAAC,0CAAM,OAAG,gBAAG,6BAAC,4CAAQ;IAAI,EAAG,CACjD,GACf,IAAI,CACD,CAElB;IAED,oBACI,6BAAC,eAAQ,QACJN,QAAQ,CAACiB,IAAI,GAAGF,QAAQ,CAACK,IAAI,CAAC,GAAGA,IAAI,EACrCpB,QAAQ,CAACG,QAAQ,gBACd,6BAAC,gCAAU;MAAC,EAAE,EAAEG,UAAW;MAAC,OAAO,EAAE,GAAI;MAAC,MAAM;MAAC,aAAa;IAAA,GACzD,UAAAlB,KAAK;MAAA,oBACF;QAAK,KAAK,8DAAO7B,YAAY,GAAKO,gBAAgB,CAACsB,KAAK,CAAC;MAAG,gBACxD,6BAAC,mBAAS;QAAC,SAAS,EAAEY,QAAQ,CAACG;MAAS,EAAG,CACzC;IAAA,CACT,CACQ,GACb,IAAI,CACD;EAEnB,CAAC;AACL,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_store","_interopRequireDefault","_emotion","_reactTransitionGroup","_classnames","_reactRouter","_appAdmin","_List","_Button","_index","_roundKeyboard_arrow_up24px","_roundKeyboard_arrow_down24px","defaultStyle","transform","opacity","transitionProperty","transitionTimingFunction","transitionDuration","willChange","transitionStyles","entering","entered","menuTitle","css","borderBottom","padding","margin","height","width","fontWeight","boxSizing","menuTitleActive","backgroundColor","LOCAL_STORAGE_KEY","loadState","localStorage","get","split","filter","Boolean","storeState","state","set","join","getState","id","includes","MenuGroupRenderer","PrevMenuItem","MenuGroup","_useNavigation","useNavigation","setVisible","_useMenuItem","useMenuItem","menuItem","depth","shouldRender","children","_useState","useState","name","_useState2","_slicedToArray2","default","isExpanded","setExpanded","hideMenu","useCallback","toggleElement","splice","indexOf","push","createElement","length","withLink","content","Link","to","path","testId","onClick","item","List","className","classNames","_defineProperty2","ListItem","icon","ListItemGraphic","IconButton","label","ListItemMeta","ReactComponent","Fragment","Transition","in","timeout","appear","unmountOnExit","style","_objectSpread2","MenuItems","menuItems","exports"],"sources":["MenuGroupRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useState } from \"react\";\nimport { default as localStorage } from \"store\";\nimport { css } from \"emotion\";\nimport { Transition } from \"react-transition-group\";\nimport classNames from \"classnames\";\nimport { Link } from \"@webiny/react-router\";\nimport { useMenuItem, MenuItems } from \"@webiny/app-admin\";\nimport { List, ListItem, ListItemGraphic, ListItemMeta } from \"@webiny/ui/List\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { useNavigation } from \"../index\";\nimport { ReactComponent as UpIcon } from \"../icons/round-keyboard_arrow_up-24px.svg\";\nimport { ReactComponent as DownIcon } from \"../icons/round-keyboard_arrow_down-24px.svg\";\n\nconst defaultStyle = {\n transform: \"translateY(-20px)\",\n opacity: 0,\n transitionProperty: \"transform, opacity\",\n transitionTimingFunction: \"cubic-bezier(0, 0, .2, 1)\",\n transitionDuration: \"100ms\",\n willChange: \"opacity, transform\"\n};\n\nconst transitionStyles: Record<string, any> = {\n entering: {\n transform: \"translateY(-20px)\",\n opacity: 0\n },\n entered: {\n transform: \"translateY(0px)\",\n opacity: 1\n }\n};\n\nconst menuTitle = css({\n \".mdc-drawer &.mdc-list\": {\n borderBottom: \"1px solid var(--mdc-theme-on-background)\",\n padding: 0,\n \".mdc-list-item\": {\n margin: 0,\n padding: \"0 15px\",\n height: \"48px\",\n width: \"100%\",\n fontWeight: 600,\n boxSizing: \"border-box\"\n }\n }\n});\n\nconst menuTitleActive = css({\n backgroundColor: \"var(--mdc-theme-background)\"\n});\n\nconst LOCAL_STORAGE_KEY = \"webiny_navigation_groups\";\n\nfunction loadState(): string[] {\n return (localStorage.get(LOCAL_STORAGE_KEY) || \"\").split(\",\").filter(Boolean);\n}\n\nfunction storeState(state: string[]) {\n localStorage.set(LOCAL_STORAGE_KEY, state.join(\",\"));\n}\n\nfunction getState(id: string | null): boolean {\n if (!id) {\n return false;\n }\n const state = loadState();\n return state.includes(id);\n}\n\nexport const MenuGroupRenderer = (PrevMenuItem: React.ComponentType) => {\n return function MenuGroup() {\n const { setVisible } = useNavigation();\n const { menuItem, depth } = useMenuItem();\n const shouldRender = depth === 0 && menuItem && menuItem.children;\n const [isExpanded, setExpanded] = useState<boolean>(\n getState(menuItem ? menuItem.name : null)\n );\n\n const hideMenu = useCallback(() => setVisible(false), []);\n\n const toggleElement = useCallback(() => {\n if (!menuItem) {\n return;\n }\n const state = loadState();\n if (isExpanded && state.includes(menuItem.name)) {\n state.splice(state.indexOf(menuItem.name), 1);\n }\n\n if (!isExpanded && !state.includes(menuItem.name)) {\n state.push(menuItem.name);\n }\n\n setExpanded(!isExpanded);\n storeState(state);\n }, [isExpanded, setExpanded]);\n\n if (!shouldRender) {\n return <PrevMenuItem />;\n }\n\n if (!menuItem || !menuItem.children.length) {\n return null;\n }\n\n const withLink = (content: React.ReactNode): React.ReactElement => {\n return (\n <Link\n to={menuItem.path || \"\"}\n data-testid={menuItem.testId}\n onClick={menuItem.onClick || hideMenu}\n >\n {content}\n </Link>\n );\n };\n\n const item = (\n <List className={classNames(menuTitle, { [menuTitleActive]: isExpanded })}>\n <ListItem data-testid={menuItem.testId} onClick={toggleElement}>\n {menuItem.icon && (\n <ListItemGraphic>\n <IconButton icon={menuItem.icon} />\n </ListItemGraphic>\n )}\n\n {menuItem.label}\n\n {menuItem.children.length ? (\n <ListItemMeta>\n <IconButton icon={isExpanded ? <UpIcon /> : <DownIcon />} />\n </ListItemMeta>\n ) : null}\n </ListItem>\n </List>\n );\n\n return (\n <Fragment>\n {menuItem.path ? withLink(item) : item}\n {menuItem.children ? (\n <Transition in={isExpanded} timeout={100} appear unmountOnExit>\n {state => (\n <div style={{ ...defaultStyle, ...transitionStyles[state] }}>\n <MenuItems menuItems={menuItem.children} />\n </div>\n )}\n </Transition>\n ) : null}\n </Fragment>\n );\n };\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,2BAAA,GAAAX,OAAA;AACA,IAAAY,6BAAA,GAAAZ,OAAA;AAEA,IAAMa,YAAY,GAAG;EACjBC,SAAS,EAAE,mBAAmB;EAC9BC,OAAO,EAAE,CAAC;EACVC,kBAAkB,EAAE,oBAAoB;EACxCC,wBAAwB,EAAE,2BAA2B;EACrDC,kBAAkB,EAAE,OAAO;EAC3BC,UAAU,EAAE;AAChB,CAAC;AAED,IAAMC,gBAAqC,GAAG;EAC1CC,QAAQ,EAAE;IACNP,SAAS,EAAE,mBAAmB;IAC9BC,OAAO,EAAE;EACb,CAAC;EACDO,OAAO,EAAE;IACLR,SAAS,EAAE,iBAAiB;IAC5BC,OAAO,EAAE;EACb;AACJ,CAAC;AAED,IAAMQ,SAAS,gBAAG,IAAAC,YAAG,EAAC;EAClB,wBAAwB,EAAE;IACtBC,YAAY,EAAE,0CAA0C;IACxDC,OAAO,EAAE,CAAC;IACV,gBAAg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AC,GACf,IACE,CACR,CACT;IAED,oBACIhG,MAAA,CAAAmE,OAAA,CAAAS,aAAA,CAAC5E,MAAA,CAAAiG,QAAQ,QACJvC,QAAQ,CAACwB,IAAI,GAAGJ,QAAQ,CAACO,IAAI,CAAC,GAAGA,IAAI,EACrC3B,QAAQ,CAACG,QAAQ,gBACd7D,MAAA,CAAAmE,OAAA,CAAAS,aAAA,CAACtE,qBAAA,CAAA4F,UAAU;MAACC,EAAE,EAAE/B,UAAW;MAACgC,OAAO,EAAE,GAAI;MAACC,MAAM;MAACC,aAAa;IAAA,GACzD,UAAA1D,KAAK;MAAA,oBACF5C,MAAA,CAAAmE,OAAA,CAAAS,aAAA;QAAK2B,KAAK,MAAAC,cAAA,CAAArC,OAAA,MAAAqC,cAAA,CAAArC,OAAA,MAAOpD,YAAY,GAAKO,gBAAgB,CAACsB,KAAK,CAAC;MAAG,gBACxD5C,MAAA,CAAAmE,OAAA,CAAAS,aAAA,CAACnE,SAAA,CAAAgG,SAAS;QAACC,SAAS,EAAEhD,QAAQ,CAACG;MAAS,CAAE,CACzC,CAAC;IAAA,CAEF,CAAC,GACb,IACE,CAAC;EAEnB,CAAC;AACL,CAAC;AAAC8C,OAAA,CAAAzD,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const MenuLinkRenderer: (PrevMenuItem: React.
|
|
2
|
+
export declare const MenuLinkRenderer: (PrevMenuItem: React.ComponentType) => () => JSX.Element;
|
|
@@ -50,4 +50,6 @@ var MenuLinkRenderer = function MenuLinkRenderer(PrevMenuItem) {
|
|
|
50
50
|
return menuItem.path ? withLink(item) : item;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
exports.MenuLinkRenderer = MenuLinkRenderer;
|
|
53
|
+
exports.MenuLinkRenderer = MenuLinkRenderer;
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=MenuLinkRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["listItemStyle","css","MenuLinkRenderer","PrevMenuItem","MenuLink","useNavigation","setVisible","useMenuItem","menuItem","depth","hideMenu","useCallback","shouldRender","tags","includes","console","log","withLink","content","path","target","testId","onClick","item","icon","label"],"sources":["MenuLinkRenderer.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { css } from \"emotion\";\nimport { Link } from \"@webiny/react-router\";\nimport { ListItem, ListItemGraphic } from \"@webiny/ui/List\";\nimport { useMenuItem } from \"@webiny/app-admin\";\nimport { Icon } from \"@webiny/ui/Icon\";\nimport { useNavigation } from \"../index\";\n\nconst listItemStyle = css`\n font-weight: 400 !important;\n\n .mdc-list &.mdc-list-item:hover {\n cursor: pointer;\n background-color: var(--mdc-theme-background);\n }\n`;\n\nexport const MenuLinkRenderer = (PrevMenuItem: React.
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_emotion","_reactRouter","_List","_appAdmin","_Icon","_index","listItemStyle","css","MenuLinkRenderer","PrevMenuItem","MenuLink","_useNavigation","useNavigation","setVisible","_useMenuItem","useMenuItem","menuItem","depth","hideMenu","useCallback","shouldRender","tags","includes","default","createElement","console","log","withLink","content","Link","to","path","target","testId","onClick","item","ListItem","ripple","className","icon","ListItemGraphic","Icon","label","exports"],"sources":["MenuLinkRenderer.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { css } from \"emotion\";\nimport { Link } from \"@webiny/react-router\";\nimport { ListItem, ListItemGraphic } from \"@webiny/ui/List\";\nimport { useMenuItem } from \"@webiny/app-admin\";\nimport { Icon } from \"@webiny/ui/Icon\";\nimport { useNavigation } from \"../index\";\n\nconst listItemStyle = css`\n font-weight: 400 !important;\n\n .mdc-list &.mdc-list-item:hover {\n cursor: pointer;\n background-color: var(--mdc-theme-background);\n }\n`;\n\nexport const MenuLinkRenderer = (PrevMenuItem: React.ComponentType) => {\n return function MenuLink() {\n const { setVisible } = useNavigation();\n const { menuItem, depth } = useMenuItem();\n\n const hideMenu = useCallback(() => setVisible(false), []);\n const shouldRender =\n depth === 0 && (menuItem ? menuItem.tags || [] : []).includes(\"footer\");\n\n if (!shouldRender) {\n return <PrevMenuItem />;\n } else if (!menuItem) {\n // TODO @ts-refactor check if to return component or null @pavel\n console.log(\n \"MenuLinkRenderer returning PrevMenuItem because missing menuItem variable.\"\n );\n return <PrevMenuItem />;\n }\n\n const withLink = (content: React.ReactNode): React.ReactElement => {\n return (\n <Link\n to={menuItem.path || \"\"}\n target={menuItem.target}\n data-testid={menuItem.testId}\n onClick={menuItem.onClick || hideMenu}\n >\n {content}\n </Link>\n );\n };\n\n const item = (\n <ListItem\n data-testid={menuItem.testId}\n ripple={false}\n className={listItemStyle}\n onClick={menuItem.onClick || hideMenu}\n >\n {menuItem.icon ? (\n <ListItemGraphic>\n <Icon icon={menuItem.icon} />\n </ListItemGraphic>\n ) : null}\n {menuItem.label}\n </ListItem>\n );\n\n return menuItem.path ? withLink(item) : item;\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAMO,aAAa,oBAAGC,YAAG,iJAOxB;AAEM,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,YAAiC,EAAK;EACnE,OAAO,SAASC,QAAQA,CAAA,EAAG;IACvB,IAAAC,cAAA,GAAuB,IAAAC,oBAAa,EAAC,CAAC;MAA9BC,UAAU,GAAAF,cAAA,CAAVE,UAAU;IAClB,IAAAC,YAAA,GAA4B,IAAAC,qBAAW,EAAC,CAAC;MAAjCC,QAAQ,GAAAF,YAAA,CAARE,QAAQ;MAAEC,KAAK,GAAAH,YAAA,CAALG,KAA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