@bigbinary/neeto-molecules 3.15.3 → 3.15.5
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/dist/Header.js +14 -14
- package/dist/Header.js.map +1 -1
- package/dist/NavigationHeader.js +14 -5
- package/dist/NavigationHeader.js.map +1 -1
- package/dist/ShareViaLink.js +7 -7
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/cjs/Header.js +14 -14
- package/dist/cjs/Header.js.map +1 -1
- package/dist/cjs/NavigationHeader.js +14 -5
- package/dist/cjs/NavigationHeader.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +7 -7
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/package.json +1 -1
- package/types/NavigationHeader.d.ts +2 -2
package/dist/cjs/Header.js
CHANGED
|
@@ -42,7 +42,7 @@ var DROPDOWN_BUTTON_SIZES = {
|
|
|
42
42
|
large: "large"
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var css = ":root{--neeto-molecules-main-header-height:6.125rem;--neeto-molecules-main-header-with-breadcrumbs-height:10.625rem;--neeto-molecules-effective-header-height:0px}.neeto-molecules-header{align-items:flex-start;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;flex-shrink:0;gap:1rem;justify-content:space-between;padding:2.5rem 0 1.5rem;width:100%}@media screen and (max-width:1024px){.neeto-molecules-header{flex-wrap:wrap}}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:.5rem}.neeto-molecules-header .neeto-molecules-header__left{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{align-items:center;display:flex;flex-direction:row;gap:.75rem;margin-top:-.75rem;width:100%}@media screen and (max-width:1024px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.625rem}}@media screen and (max-width:768px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.5rem}}@media screen and (max-width:576px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.25rem}}.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:calc(1.375rem + 1.5vw);line-height:var(--neeto-ui-leading-tight)}@media (min-width:1200px){.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:2.5rem}}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;gap:.75rem;justify-content:flex-end}.neeto-molecules-header .neeto-molecules-header__right:empty{display:none;visibility:hidden}@media screen and (max-width:768px){.neeto-molecules-header .neeto-molecules-header__right{flex-wrap:wrap;justify-content:flex-start}}.neeto-molecules-header .neeto-molecules-header__right .neeto-ui-btn{flex-shrink:0}.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__search-input{flex-grow:0;min-width:12.6rem}.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__action-block{align-items:center;display:flex;flex-shrink:0;gap:.75rem;justify-content:flex-end}@media screen and (max-width:360px){.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__action-block{flex-shrink:1;flex-wrap:wrap;justify-content:flex-start}}.neeto-molecules-header--has-breadcrumbs .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano,.neeto-molecules-header--small{flex-shrink:0;min-height:0}.neeto-molecules-header--nano .neeto-molecules-breadcrumbs-wrap,.neeto-molecules-header--small .neeto-molecules-breadcrumbs-wrap{margin:0 0 1rem}.neeto-molecules-header--small .neeto-molecules-header__page-title{margin-top:-.25rem}.neeto-molecules-header--small .neeto-molecules-header__page-title h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.neeto-molecules-header--small .neeto-molecules-header__page-title h2{font-size:2rem}}.neeto-molecules-header--nano .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano .neeto-molecules-header__page-title h2{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){.neeto-molecules-header--nano .neeto-molecules-header__page-title h2{font-size:1.5rem}}";
|
|
45
|
+
var css = ":root{--neeto-molecules-main-header-height:6.125rem;--neeto-molecules-main-header-with-breadcrumbs-height:10.625rem;--neeto-molecules-effective-header-height:0px}.neeto-molecules-header{align-items:flex-start;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;flex-shrink:0;gap:1rem;justify-content:space-between;padding:2.5rem 0 1.5rem;width:100%}@media screen and (max-width:1024px){.neeto-molecules-header{flex-wrap:wrap}}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:.5rem}.neeto-molecules-header .neeto-molecules-header__left{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{align-items:center;display:flex;flex-direction:row;gap:.75rem;margin-top:-.75rem;width:100%}.neeto-molecules-header .neeto-molecules-header__page-title .neeto-molecule-help-popover-trigger{margin-left:.75rem;vertical-align:middle}@media screen and (max-width:1024px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.625rem}}@media screen and (max-width:768px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.5rem}}@media screen and (max-width:576px){.neeto-molecules-header .neeto-molecules-header__page-title{margin-top:-.25rem}}.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:calc(1.375rem + 1.5vw);line-height:var(--neeto-ui-leading-tight)}@media (min-width:1200px){.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:2.5rem}}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;gap:.75rem;justify-content:flex-end}.neeto-molecules-header .neeto-molecules-header__right:empty{display:none;visibility:hidden}@media screen and (max-width:768px){.neeto-molecules-header .neeto-molecules-header__right{flex-wrap:wrap;justify-content:flex-start}}.neeto-molecules-header .neeto-molecules-header__right .neeto-ui-btn{flex-shrink:0}.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__search-input{flex-grow:0;min-width:12.6rem}.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__action-block{align-items:center;display:flex;flex-shrink:0;gap:.75rem;justify-content:flex-end}@media screen and (max-width:360px){.neeto-molecules-header .neeto-molecules-header__right .neeto-molecules-header__action-block{flex-shrink:1;flex-wrap:wrap;justify-content:flex-start}}.neeto-molecules-header--has-breadcrumbs .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano,.neeto-molecules-header--small{flex-shrink:0;min-height:0}.neeto-molecules-header--nano .neeto-molecules-breadcrumbs-wrap,.neeto-molecules-header--small .neeto-molecules-breadcrumbs-wrap{margin:0 0 1rem}.neeto-molecules-header--small .neeto-molecules-header__page-title{margin-top:-.25rem}.neeto-molecules-header--small .neeto-molecules-header__page-title h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.neeto-molecules-header--small .neeto-molecules-header__page-title h2{font-size:2rem}}.neeto-molecules-header--nano .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano .neeto-molecules-header__page-title h2{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){.neeto-molecules-header--nano .neeto-molecules-header__page-title h2{font-size:1.5rem}}";
|
|
46
46
|
injectCss.n(css,{});
|
|
47
47
|
|
|
48
48
|
var _excluded = ["dropdownButtonProps"];
|
|
@@ -93,25 +93,25 @@ var Header = function Header(_ref) {
|
|
|
93
93
|
className: "neeto-molecules-header__left-data-wrap",
|
|
94
94
|
children: [neetoCist.isNotEmpty(breadcrumbs) && /*#__PURE__*/jsxRuntime.jsx(Breadcrumbs, {
|
|
95
95
|
breadcrumbs: breadcrumbs
|
|
96
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
96
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
97
97
|
className: "neeto-molecules-header__page-title",
|
|
98
|
-
children:
|
|
98
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
99
99
|
"data-cy": "main-header",
|
|
100
100
|
"data-test-id": "main-header",
|
|
101
101
|
lineHeight: "tight",
|
|
102
102
|
style: "h2",
|
|
103
103
|
weight: "semibold",
|
|
104
|
-
children: title
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
}
|
|
114
|
-
})
|
|
104
|
+
children: [title, neetoCist.isPresent(titleHelpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread({}, titleHelpPopoverProps)), renderDropdown(function (_ref2) {
|
|
105
|
+
var _ref2$dropdownButtonP = _ref2.dropdownButtonProps,
|
|
106
|
+
dropdownButtonProps = _ref2$dropdownButtonP === void 0 ? {} : _ref2$dropdownButtonP,
|
|
107
|
+
dropdownProps = _objectWithoutProperties(_ref2, _excluded);
|
|
108
|
+
return /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, _objectSpread({
|
|
109
|
+
dropdownButtonProps: _objectSpread({
|
|
110
|
+
size: DROPDOWN_BUTTON_SIZES[size]
|
|
111
|
+
}, dropdownButtonProps)
|
|
112
|
+
}, dropdownProps));
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
115
|
})]
|
|
116
116
|
})
|
|
117
117
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
package/dist/cjs/Header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../src/components/Header/constants.js","../../src/components/Header/index.jsx"],"sourcesContent":["const SIZES = { nano: \"nano\", small: \"small\", large: \"large\" };\n\nconst DROPDOWN_BUTTON_SIZES = {\n nano: \"small\",\n small: \"medium\",\n large: \"large\",\n};\n\nexport { SIZES, DROPDOWN_BUTTON_SIZES };\n","import { useLayoutEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { noop, isNotEmpty, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport Breadcrumbs from \"components/Breadcrumbs\";\nimport HelpPopover from \"components/HelpPopover\";\nimport MoreDropdown from \"components/MoreDropdown\";\nimport Search from \"components/Search\";\n\nimport { DROPDOWN_BUTTON_SIZES, SIZES } from \"./constants\";\nimport \"./header.scss\";\n\nconst Header = ({\n title,\n titleHelpPopoverProps = {},\n searchProps,\n className = \"\",\n actionBlock,\n breadcrumbs = [],\n renderDropdown = noop,\n size = \"large\",\n \"data-testid\": dataTestId = \"neeto-molecules-header\",\n}) => {\n const headerRef = useRef(null);\n\n useLayoutEffect(() => {\n const updateHeaderHeight = () => {\n if (!headerRef.current) return;\n const height = headerRef.current.offsetHeight;\n document.body.style.setProperty(\n \"--neeto-molecules-effective-header-height\",\n `${height}px`\n );\n };\n\n updateHeaderHeight();\n\n window.addEventListener(\"resize\", updateHeaderHeight);\n\n return () => window.removeEventListener(\"resize\", updateHeaderHeight);\n }, []);\n\n return (\n <div\n data-cy=\"neeto-molecules-header\"\n data-testid={dataTestId}\n ref={headerRef}\n className={classnames([\n \"neeto-molecules-header\",\n {\n \"neeto-molecules-header--has-breadcrumbs\": isNotEmpty(breadcrumbs),\n \"neeto-molecules-header--large\": size === SIZES.large,\n \"neeto-molecules-header--small\": size === SIZES.small,\n \"neeto-molecules-header--nano\": size === SIZES.nano,\n },\n className,\n ])}\n >\n <div className=\"neeto-molecules-header__left\">\n <div className=\"neeto-molecules-header__left-data-wrap\">\n {isNotEmpty(breadcrumbs) && <Breadcrumbs {...{ breadcrumbs }} />}\n <div className=\"neeto-molecules-header__page-title\">\n <Typography\n data-cy=\"main-header\"\n data-test-id=\"main-header\"\n lineHeight=\"tight\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {title}\n
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../src/components/Header/constants.js","../../src/components/Header/index.jsx"],"sourcesContent":["const SIZES = { nano: \"nano\", small: \"small\", large: \"large\" };\n\nconst DROPDOWN_BUTTON_SIZES = {\n nano: \"small\",\n small: \"medium\",\n large: \"large\",\n};\n\nexport { SIZES, DROPDOWN_BUTTON_SIZES };\n","import { useLayoutEffect, useRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { noop, isNotEmpty, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport Breadcrumbs from \"components/Breadcrumbs\";\nimport HelpPopover from \"components/HelpPopover\";\nimport MoreDropdown from \"components/MoreDropdown\";\nimport Search from \"components/Search\";\n\nimport { DROPDOWN_BUTTON_SIZES, SIZES } from \"./constants\";\nimport \"./header.scss\";\n\nconst Header = ({\n title,\n titleHelpPopoverProps = {},\n searchProps,\n className = \"\",\n actionBlock,\n breadcrumbs = [],\n renderDropdown = noop,\n size = \"large\",\n \"data-testid\": dataTestId = \"neeto-molecules-header\",\n}) => {\n const headerRef = useRef(null);\n\n useLayoutEffect(() => {\n const updateHeaderHeight = () => {\n if (!headerRef.current) return;\n const height = headerRef.current.offsetHeight;\n document.body.style.setProperty(\n \"--neeto-molecules-effective-header-height\",\n `${height}px`\n );\n };\n\n updateHeaderHeight();\n\n window.addEventListener(\"resize\", updateHeaderHeight);\n\n return () => window.removeEventListener(\"resize\", updateHeaderHeight);\n }, []);\n\n return (\n <div\n data-cy=\"neeto-molecules-header\"\n data-testid={dataTestId}\n ref={headerRef}\n className={classnames([\n \"neeto-molecules-header\",\n {\n \"neeto-molecules-header--has-breadcrumbs\": isNotEmpty(breadcrumbs),\n \"neeto-molecules-header--large\": size === SIZES.large,\n \"neeto-molecules-header--small\": size === SIZES.small,\n \"neeto-molecules-header--nano\": size === SIZES.nano,\n },\n className,\n ])}\n >\n <div className=\"neeto-molecules-header__left\">\n <div className=\"neeto-molecules-header__left-data-wrap\">\n {isNotEmpty(breadcrumbs) && <Breadcrumbs {...{ breadcrumbs }} />}\n <div className=\"neeto-molecules-header__page-title\">\n <Typography\n data-cy=\"main-header\"\n data-test-id=\"main-header\"\n lineHeight=\"tight\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {title}\n {isPresent(titleHelpPopoverProps) && (\n <HelpPopover {...titleHelpPopoverProps} />\n )}\n {renderDropdown(\n ({ dropdownButtonProps = {}, ...dropdownProps }) => (\n <MoreDropdown\n dropdownButtonProps={{\n size: DROPDOWN_BUTTON_SIZES[size],\n ...dropdownButtonProps,\n }}\n {...dropdownProps}\n />\n )\n )}\n </Typography>\n </div>\n </div>\n </div>\n <div className=\"neeto-molecules-header__right\">\n {searchProps && (\n <Search\n enableUrlSync\n className={classnames([\n \"neeto-molecules-header__search-input\",\n searchProps.className,\n ])}\n {...searchProps}\n />\n )}\n {actionBlock && (\n <div className=\"neeto-molecules-header__action-block\">\n {actionBlock}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nHeader.propTypes = {\n /**\n * To set a title in the Header section.\n */\n title: PropTypes.node,\n /**\n * To set props for the HelpPopover component in the title.\n */\n titleHelpPopoverProps: PropTypes.object,\n /**\n * To specify additional class names.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered in the right side of the Header section.\n */\n\n actionBlock: PropTypes.node,\n /**\n * To add **Search** molecule to the subheader section.\n */\n searchProps: PropTypes.object,\n /**\n * To show breadcrumbs in the Header section. `text` accepts a text string to be shown as the breadcrumb and `link` accepts relative URL path for the breadcrumb.\n */\n breadcrumbs: PropTypes.arrayOf(\n PropTypes.shape({\n text: PropTypes.string,\n link: PropTypes.string,\n })\n ),\n /**\n * A function to render the Dropdown next to the title. It provides the MoreDropdown component as argument.\n */\n renderDropdown: PropTypes.func,\n /**\n * To specify size of the Header.\n *\n * `large` - Default size. To be used in index pages.\n *\n * `small` - To be used in inner pages.\n *\n * `nano` - To be used in inner pages with menubar.\n */\n size: PropTypes.oneOf([\"nano\", \"small\", \"large\"]),\n};\n\nexport default Header;\n"],"names":["SIZES","nano","small","large","DROPDOWN_BUTTON_SIZES","Header","_ref","title","_ref$titleHelpPopover","titleHelpPopoverProps","searchProps","_ref$className","className","actionBlock","_ref$breadcrumbs","breadcrumbs","_ref$renderDropdown","renderDropdown","noop","_ref$size","size","_ref$dataTestid","dataTestId","headerRef","useRef","useLayoutEffect","updateHeaderHeight","current","height","offsetHeight","document","body","style","setProperty","concat","window","addEventListener","removeEventListener","_jsxs","ref","classnames","isNotEmpty","children","_jsx","Breadcrumbs","Typography","lineHeight","weight","isPresent","HelpPopover","_objectSpread","_ref2","_ref2$dropdownButtonP","dropdownButtonProps","dropdownProps","_objectWithoutProperties","_excluded","MoreDropdown","Search","enableUrlSync"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,KAAK,GAAG;AAAEC,EAAAA,IAAI,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,KAAK,EAAE,OAAA;AAAQ,CAAC,CAAA;AAE9D,IAAMC,qBAAqB,GAAG;AAC5BH,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,KAAK,EAAE,OAAA;AACT,CAAC;;;;;;;;ACSD,IAAME,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAUN;AAAA,EAAA,IATJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAAC,qBAAA,GAAAF,IAAA,CACLG,qBAAqB;AAArBA,IAAAA,qBAAqB,GAAAD,qBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,qBAAA;IAC1BE,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IAAAC,cAAA,GAAAL,IAAA,CACXM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IACdE,WAAW,GAAAP,IAAA,CAAXO,WAAW;IAAAC,gBAAA,GAAAR,IAAA,CACXS,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,gBAAA;IAAAE,mBAAA,GAAAV,IAAA,CAChBW,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAGE,KAAAA,CAAAA,G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AA,CAAA;AACXG,gBAAAA,mBAAmB,EAAAH,aAAA,CAAA;kBACjB9B,IAAI,EAAEhB,qBAAqB,CAACgB,IAAI,CAAA;AAAC,iBAAA,EAC9BiC,mBAAmB,CAAA;eAEpBC,EAAAA,aAAa,CAClB,CAAC,CAAA;AAAA,aAEN,CAAC,CAAA;WACS,CAAA;AAAC,SACV,CAAC,CAAA;OACH,CAAA;KACF,CAAC,eACNhB,eAAA,CAAA,KAAA,EAAA;AAAK1B,MAAAA,SAAS,EAAC,+BAA+B;AAAA8B,MAAAA,QAAA,GAC3ChC,WAAW,iBACViC,cAAA,CAACe,MAAM,EAAAR,aAAA,CAAA;QACLS,aAAa,EAAA,IAAA;QACb/C,SAAS,EAAE4B,UAAU,CAAC,CACpB,sCAAsC,EACtC9B,WAAW,CAACE,SAAS,CACtB,CAAA;AAAE,OAAA,EACCF,WAAW,CAChB,CACF,EACAG,WAAW,iBACV8B,cAAA,CAAA,KAAA,EAAA;AAAK/B,QAAAA,SAAS,EAAC,sCAAsC;AAAA8B,QAAAA,QAAA,EAClD7B,WAAAA;AAAW,OACT,CACN,CAAA;AAAA,KACE,CAAC,CAAA;AAAA,GACH,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -149,6 +149,10 @@ var NavigationLinks = function NavigationLinks(_ref) {
|
|
|
149
149
|
var css = ".standalone-publish-preview-button{border-radius:var(--neeto-ui-rounded)!important}.neeto-molecules-navigation-header .neeto-ui-text-h4{color:inherit}@media screen and (max-width:1024px){.neeto-molecules-navigation-header .neeto-ui-text-h4{font-size:.875rem;font-weight:var(--neeto-ui-font-medium)}}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link{color:rgb(var(--neeto-ui-gray-500))}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link--more{background-color:transparent!important;box-shadow:none!important;padding-bottom:0!important;padding-top:0!important}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link.active{color:rgb(var(--neeto-ui-black))}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link:hover:not(.active){color:rgb(var(--neeto-ui-gray-600))}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link.disabled{color:rgb(var(--neeto-ui-gray-300));cursor:not-allowed}.neeto-molecules-navigation-header .neeto-molecules-navigation-header__link.disabled:hover{color:rgb(var(--neeto-ui-gray-300))}";
|
|
150
150
|
injectCss.n(css,{});
|
|
151
151
|
|
|
152
|
+
var isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
153
|
+
return /^https?:\/\//.test(url);
|
|
154
|
+
};
|
|
155
|
+
|
|
152
156
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
153
157
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
154
158
|
var RightBlock = function RightBlock(_ref) {
|
|
@@ -176,9 +180,11 @@ var RightBlock = function RightBlock(_ref) {
|
|
|
176
180
|
var ViewDraftButton = _ref2.ViewDraftButton,
|
|
177
181
|
ResetDraftButton = _ref2.ResetDraftButton;
|
|
178
182
|
return !isDraftBlockHidden && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
179
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ViewDraftButton, {
|
|
183
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ViewDraftButton, _objectSpread({}, isAbsoluteUrl(previewDraftUrl) ? {
|
|
184
|
+
href: previewDraftUrl
|
|
185
|
+
} : {
|
|
180
186
|
to: previewDraftUrl
|
|
181
|
-
}), isResetDraftButtonVisible && /*#__PURE__*/jsxRuntime.jsx(ResetDraftButton, {
|
|
187
|
+
})), isResetDraftButtonVisible && /*#__PURE__*/jsxRuntime.jsx(ResetDraftButton, {
|
|
182
188
|
loading: isResetting,
|
|
183
189
|
onClick: function onClick() {
|
|
184
190
|
return onResetClick();
|
|
@@ -196,13 +202,16 @@ var RightBlock = function RightBlock(_ref) {
|
|
|
196
202
|
onClick: function onClick() {
|
|
197
203
|
return handlePublish();
|
|
198
204
|
}
|
|
199
|
-
}, publishButtonProps)), /*#__PURE__*/jsxRuntime.jsx(PublishPreviewButton, {
|
|
205
|
+
}, publishButtonProps)), /*#__PURE__*/jsxRuntime.jsx(PublishPreviewButton, _objectSpread(_objectSpread({}, isAbsoluteUrl(previewPublishedUrl) ? {
|
|
206
|
+
href: previewPublishedUrl
|
|
207
|
+
} : {
|
|
208
|
+
to: previewPublishedUrl
|
|
209
|
+
}), {}, {
|
|
200
210
|
disabled: isPublishPreviewDisabled,
|
|
201
|
-
to: previewPublishedUrl,
|
|
202
211
|
className: classnames({
|
|
203
212
|
"standalone-publish-preview-button": !isPublishButtonVisible
|
|
204
213
|
})
|
|
205
|
-
})]
|
|
214
|
+
}))]
|
|
206
215
|
});
|
|
207
216
|
};
|
|
208
217
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(headerLink => (\n <NavLink\n activeClassName=\"active\"\n className=\"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\"\n data-cy={`${joinHyphenCase(headerLink.key)}-tab`}\n key={headerLink.key}\n {...headerLink}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {headerLink.label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(headerLink => (\n <MenuItem.Button\n data-cy={`${joinHyphenCase(headerLink.key)}-more-tab`}\n isActive={headerLink.to === pathname}\n key={headerLink.key}\n to={headerLink.to}\n {...headerLink}\n >\n {headerLink.label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton to={previewDraftUrl} />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n disabled={isPublishPreviewDisabled}\n to={previewPublishedUrl}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div\n className=\"grid w-full gap-4\"\n style={{\n gridTemplateColumns: isMobile\n ? `repeat(${numberOfChildren - 1}, 1fr)`\n : `repeat(${numberOfChildren}, 1fr)`,\n }}\n >\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white ßflex-shrink-0 flex items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","headerLink","NavLink","activeClassName","concat","joinHyphenCase","key","Typography","component","lineHeight","style","weight","label","isNotEmpty","buttonStyle","buttonProps","classNames","active","Button","isActive","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","_ref2","ViewDraftButton","ResetDraftButton","_Fragment","loading","onClick","renderPublishButtons","_ref3","PublishButton","PublishPreviewButton","disabled","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,SAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE,QAAA;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,cAAA,CAACC,IAAI,EAAE,EAAA,CAAA;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,GAAAK,IAAA,CAAPL,OAAO;IACPQ,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,QAAQ,GAAAJ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AAmB;AAAAH,MAAAA,QAAA,eAE/BE,eAAA,CAAA,KAAA,EAAA;AACEC,QAAAA,SAAS,EAAC,mBAAmB;AAC7BqC,QAAAA,KAAK,EAAE;UACL4D,mBAAmB,EAAEJ,QAAQ,GAAA,SAAA,CAAA9D,MAAA,CACf+D,gBAAgB,GAAG,CAAC,EAAA,QAAA,CAAA,GAAA,SAAA,CAAA/D,MAAA,CACpB+D,gBAAgB,EAAA,QAAA,CAAA;SAC9B;QAAAjG,QAAA,EAAA,CAED0F,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB,CAAA;OACd,CAAA;AAAC,KACH,CAAC,EACLI,QAAQ,iBACPvG,cAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,6JAA0J;AAAAH,MAAAA,QAAA,EACtK2F,eAAAA;AAAe,KACb,CACN,CAAA;AAAA,GACE,CAAC,CAAA;AAEV,EAAC;AAEDF,gBAAgB,CAACY,eAAe,GAAG1G,SAAS,CAAA;AAC5C8F,gBAAgB,CAACzE,eAAe,GAAGA,eAAe,CAAA;AAClDyE,gBAAgB,CAACa,gBAAgB,GAAGpD,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/utils.js","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(headerLink => (\n <NavLink\n activeClassName=\"active\"\n className=\"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\"\n data-cy={`${joinHyphenCase(headerLink.key)}-tab`}\n key={headerLink.key}\n {...headerLink}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {headerLink.label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(headerLink => (\n <MenuItem.Button\n data-cy={`${joinHyphenCase(headerLink.key)}-more-tab`}\n isActive={headerLink.to === pathname}\n key={headerLink.key}\n to={headerLink.to}\n {...headerLink}\n >\n {headerLink.label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div\n className=\"grid w-full gap-4\"\n style={{\n gridTemplateColumns: isMobile\n ? `repeat(${numberOfChildren - 1}, 1fr)`\n : `repeat(${numberOfChildren}, 1fr)`,\n }}\n >\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white ßflex-shrink-0 flex items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","headerLink","NavLink","activeClassName","concat","joinHyphenCase","key","Typography","component","lineHeight","style","weight","label","isNotEmpty","buttonStyle","buttonProps","classNames","active","Button","isActive","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","_ref2","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","onClick","renderPublishButtons","_ref3","PublishButton","PublishPreviewButton","disabled","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,SAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE,QAAA;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,cAAA,CAACC,IAAI,EAAE,EAAA,CAAA;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,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B,GAAGrD,UAAU;;;;"}
|
package/dist/cjs/ShareViaLink.js
CHANGED
|
@@ -55,25 +55,25 @@ function _interopNamespaceDefault(e) {
|
|
|
55
55
|
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
56
56
|
|
|
57
57
|
var facebookShareLink = function facebookShareLink(_ref) {
|
|
58
|
-
var
|
|
58
|
+
var url = _ref.url;
|
|
59
59
|
return general.buildUrl("https://www.facebook.com/sharer/sharer.php", {
|
|
60
|
-
u:
|
|
60
|
+
u: url
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
var linkedInShareLink = function linkedInShareLink(_ref2) {
|
|
64
|
-
var
|
|
64
|
+
var url = _ref2.url,
|
|
65
65
|
title = _ref2.title;
|
|
66
66
|
return general.buildUrl("https://www.linkedin.com/sharing/share-offsite", {
|
|
67
67
|
mini: true,
|
|
68
|
-
text: "".concat(title, "
|
|
68
|
+
text: "".concat(title, " ").concat(url)
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
var twitterShareLink = function twitterShareLink(_ref3) {
|
|
72
|
-
var
|
|
72
|
+
var url = _ref3.url,
|
|
73
73
|
title = _ref3.title;
|
|
74
74
|
return general.buildUrl("http://twitter.com/share", {
|
|
75
75
|
text: title,
|
|
76
|
-
url:
|
|
76
|
+
url: url
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
var downloadCanvas = function downloadCanvas(canvas) {
|
|
@@ -1366,7 +1366,7 @@ var ShareBlock = function ShareBlock(_ref) {
|
|
|
1366
1366
|
"data-cy": "social-media-button-".concat(key),
|
|
1367
1367
|
"data-testid": "social-media-button-".concat(key),
|
|
1368
1368
|
href: generateShareUrl({
|
|
1369
|
-
|
|
1369
|
+
url: url,
|
|
1370
1370
|
title: postTitle
|
|
1371
1371
|
}),
|
|
1372
1372
|
rel: "noopener noreferrer",
|