@bigbinary/neeto-molecules 3.16.63 → 3.16.65
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/{Chevron-DPCAbFvk.js → Chevron-4NkORUaV.js} +5 -2
- package/dist/Chevron-4NkORUaV.js.map +1 -0
- package/dist/ConfigurePageSidebar.js +1 -1
- package/dist/FloatingActionMenu.js +65 -42
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/Sidebar.js +5 -3
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/{Chevron-BKclhyNs.js → Chevron-BKL6X7TW.js} +5 -2
- package/dist/cjs/Chevron-BKL6X7TW.js.map +1 -0
- package/dist/cjs/ConfigurePageSidebar.js +1 -1
- package/dist/cjs/FloatingActionMenu.js +65 -42
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/Sidebar.js +5 -3
- package/dist/cjs/Sidebar.js.map +1 -1
- package/package.json +1 -1
- package/types/FloatingActionMenu.d.ts +1 -0
- package/types/Sidebar.d.ts +1 -0
- package/dist/Chevron-DPCAbFvk.js.map +0 -1
- package/dist/cjs/Chevron-BKclhyNs.js.map +0 -1
|
@@ -97,6 +97,7 @@ var disableDraggingStyles = function disableDraggingStyles() {
|
|
|
97
97
|
var SubLink = function SubLink(_ref) {
|
|
98
98
|
var to = _ref.to,
|
|
99
99
|
href = _ref.href,
|
|
100
|
+
onClick = _ref.onClick,
|
|
100
101
|
label = _ref.label,
|
|
101
102
|
_ref$type = _ref.type,
|
|
102
103
|
type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
|
|
@@ -127,6 +128,7 @@ var SubLink = function SubLink(_ref) {
|
|
|
127
128
|
};
|
|
128
129
|
return /*#__PURE__*/jsxs(CheckPointNavLinks, {
|
|
129
130
|
href: href,
|
|
131
|
+
onClick: onClick,
|
|
130
132
|
to: to,
|
|
131
133
|
activeClassName: "active",
|
|
132
134
|
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
@@ -169,7 +171,8 @@ var _Items = function Items(_ref) {
|
|
|
169
171
|
href: subItem.href,
|
|
170
172
|
isActive: subItem.isActive,
|
|
171
173
|
isSectionHeader: isPresent(subItem.item),
|
|
172
|
-
to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path
|
|
174
|
+
to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path,
|
|
175
|
+
onClick: subItem.onClick
|
|
173
176
|
})), isSettingsItems && isPresent(subItem.items) && /*#__PURE__*/jsxs(Fragment$1, {
|
|
174
177
|
children: [/*#__PURE__*/jsx(_Items, {
|
|
175
178
|
isSettingsItems: isSettingsItems,
|
|
@@ -257,4 +260,4 @@ var Chevron = function Chevron(_ref) {
|
|
|
257
260
|
};
|
|
258
261
|
|
|
259
262
|
export { Chevron as C, DEFAULT_SIDEBAR_WIDTH as D, MIN_SIDEBAR_WIDTH as M, SelectedLink as S, _Items as _, CheckPointNavLinks as a, SELECTED_NAV_LINK_ROUTE_STORAGE_KEY as b, SIDEBAR_WIDTH_KEY as c, DEFAULT_HOME_PATH as d, enableDraggingStyles as e, filterByPermissions as f, getSidebarStateLocalStorageKey as g, disableDraggingStyles as h, getActiveConfigurePageLink as i, MAX_SIDEBAR_WIDTH as j };
|
|
260
|
-
//# sourceMappingURL=Chevron-
|
|
263
|
+
//# sourceMappingURL=Chevron-4NkORUaV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chevron-4NkORUaV.js","sources":["../src/components/Sidebar/Components/Links/CheckPointNavLink.jsx","../src/components/Sidebar/constants.js","../src/components/Sidebar/utils.js","../src/components/Sidebar/Components/Links/SubLink.jsx","../src/components/Sidebar/Components/Links/Items.jsx","../src/components/Sidebar/Components/Links/SelectedLink.jsx","../src/components/Sidebar/Components/Chevron.jsx"],"sourcesContent":["import { useNavigationCheckpoints } from \"neetocommons/react-utils/useRegisterNavigationCheckpoint\";\nimport { NavLink } from \"react-router-dom\";\n\nconst CheckPointNavLinks = ({\n checkpointKey,\n to,\n href,\n children,\n ...others\n}) => {\n const { [checkpointKey]: checkpoint } =\n useNavigationCheckpoints(checkpointKey);\n\n const LinkElement = href ? \"a\" : NavLink;\n const linkProps = href\n ? { href, key: href, ...others }\n : { to: checkpoint || to, key: to, ...others };\n\n return <LinkElement {...linkProps}>{children}</LinkElement>;\n};\n\nexport default CheckPointNavLinks;\n","export const SUB_LINK_TYPES = {\n SYSTEM_VIEW: \"system_view\",\n SEGMENTS: \"segments\",\n};\n\nexport const SELECTED_NAV_LINK_ROUTE_STORAGE_KEY = \"selectedNavLinkRoute\";\n\nexport const DEFAULT_HOME_PATH = \"/admin\";\n\nexport const SIDEBAR_WIDTH_KEY = \"neeto-molecules-sidebar-width\";\nexport const MIN_SIDEBAR_WIDTH = 12.5 * 16;\nexport const MAX_SIDEBAR_WIDTH = 20 * 16;\nexport const DEFAULT_SIDEBAR_WIDTH = 15 * 16;\n","import { isPresent, isNotEmpty } from \"neetocist\";\nimport { __, all, curry, equals, includes, is } from \"ramda\";\n\nexport const isSubRouteActive = (subRoute, location) => {\n const currentBrowserUrl = new URL(\n location.pathname + location.search + location.hash,\n window.location.origin\n );\n const targetUrl = new URL(subRoute, window.location.origin);\n\n const targetSearchParams = targetUrl.searchParams;\n const targetSearchKeys = Array.from(targetSearchParams.keys());\n\n return (\n all(\n key =>\n currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key),\n targetSearchKeys\n ) && equals(currentBrowserUrl.pathname, targetUrl.pathname)\n );\n};\n\nexport const getSidebarStateLocalStorageKey = () => {\n const user = globalProps.user?.email || globalProps.user?.phoneNumber;\n\n return `sidebarState-${user}`;\n};\n\nexport const filterByPermissions = curry(({ permissions }) => {\n if (permissions && isNotEmpty(permissions)) {\n return is(Array, permissions)\n ? permissions.some(includes(__, globalProps.permissions))\n : globalProps.permissions.includes(permissions);\n }\n\n return true;\n});\n\nexport const getActiveConfigurePageLink = ({ navLinks, location }) =>\n navLinks.find(link => {\n const [linkPathname] = link.to?.split(\"?\") || [];\n\n return (\n isPresent(link.isConfigureNavLink) &&\n link.isConfigureNavLink &&\n location.pathname.startsWith(linkPathname)\n );\n });\n\nexport const enableDraggingStyles = () => {\n document.body.classList.add(\"dragging-sidebar\");\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n};\n\nexport const disableDraggingStyles = () => {\n document.body.classList.remove(\"dragging-sidebar\");\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n};\n","import { hyphenate } from \"neetocist\";\nimport { Segments } from \"neetofilters\";\nimport { Typography } from \"neetoui\";\nimport { is } from \"ramda\";\n\nimport CheckPointNavLinks from \"./CheckPointNavLink\";\n\nimport { SUB_LINK_TYPES } from \"../../constants\";\nimport { isSubRouteActive } from \"../../utils\";\n\nconst SubLink = ({\n to,\n href,\n onClick,\n label,\n type = SUB_LINK_TYPES.SYSTEM_VIEW,\n count,\n isSectionHeader,\n isCountsLoading,\n \"data-cy\": dataCy,\n entity = \"\",\n columns = [],\n baseUrl,\n isActive,\n}) => {\n if (type === SUB_LINK_TYPES.SEGMENTS) {\n return <Segments {...{ baseUrl, columns, entity }} isIndependent={false} />;\n }\n\n const dataCyPrefix = dataCy || hyphenate(label);\n\n const renderCount = count => (count > 999 ? \"999+\" : count);\n\n const isSubLinkActive = () =>\n !isSectionHeader &&\n (is(Function, isActive) ? isActive() : isSubRouteActive(to, location));\n\n return (\n <CheckPointNavLinks\n {...{ href, onClick, to }}\n activeClassName=\"active\"\n className=\"neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none\"\n data-cy={`${dataCyPrefix}-sub-link`}\n isActive={isSubLinkActive}\n >\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-label`}\n style=\"body2\"\n >\n {label}\n </Typography>\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-count`}\n style=\"body2\"\n >\n {isCountsLoading ? (\n <div className=\"neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse\" />\n ) : (\n renderCount(count)\n )}\n </Typography>\n </CheckPointNavLinks>\n );\n};\n\nexport default SubLink;\n","import { Fragment } from \"react\";\n\nimport { isPresent } from \"neetocist\";\n\nimport SubLink from \"./SubLink\";\n\nimport { filterByPermissions } from \"../../utils\";\n\nconst Items = ({ items, isSettingsItems = false, isCountsLoading }) => (\n <div\n className=\"neeto-molecules-sidebar__sublink-wrapper\"\n data-cy=\"sidebar-sub-link-wrapper\"\n >\n {items.filter(filterByPermissions).map((subItem, subIndex) => (\n <Fragment key={subIndex}>\n <SubLink\n {...{ ...subItem, isCountsLoading }}\n href={subItem.href}\n isActive={subItem.isActive}\n isSectionHeader={isPresent(subItem.item)}\n to={subItem.to ?? subItem.path}\n onClick={subItem.onClick}\n />\n {isSettingsItems && isPresent(subItem.items) && (\n <>\n <Items {...{ isSettingsItems }} items={subItem.items} />\n {items.length - 1 !== subIndex && (\n <hr className=\"neeto-molecules-sidebar__separator neeto-ui-border-gray-200\" />\n )}\n </>\n )}\n </Fragment>\n ))}\n </div>\n);\n\nexport default Items;\n","import classNames from \"classnames\";\nimport { handleMetaClick } from \"neetocommons/react-utils\";\nimport { hyphenize } from \"neetocommons/utils/general\";\nimport { Home } from \"neetoicons\";\nimport { Typography, Button } from \"neetoui\";\nimport { omit } from \"ramda\";\nimport { useHistory } from \"react-router-dom\";\n\nimport Items from \"./Items\";\n\nconst SelectedLink = ({\n navLink = { label: \"\", items: [], isConfigureNavLink: false },\n handleGoBack,\n isConfigureSidebar,\n homePath,\n}) => {\n const history = useHistory();\n const { label, items, isConfigureNavLink, ...otherProps } = navLink;\n\n const handleHomeButtonClick = e => {\n e.stopPropagation();\n handleMetaClick(history, homePath, e);\n };\n\n return (\n <div\n className=\"neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable\"\n data-cy=\"configure-nav-container\"\n >\n <div\n className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-molecules-sidebar__link neeto-ui-border-b neeto-ui-border-gray-200\"\n onClick={handleGoBack}\n {...{ ...omit([\"icon\"], otherProps) }}\n >\n {isConfigureNavLink && (\n <span className=\"neeto-molecules-sidebar__link-icon flex items-center pl-3\">\n <Button\n data-cy={`${hyphenize(label)}-go-back-button`}\n data-testid={`${label}-go-home-button`}\n icon={Home}\n style=\"text\"\n onClick={handleHomeButtonClick}\n />\n <span className=\"px-1 text-xs\">/</span>\n </span>\n )}\n <Typography\n component=\"span\"\n style=\"body1\"\n className={classNames(\"neeto-molecules-sidebar__link-label\", {\n \"neeto-molecules-sidebar__configure-page-header\":\n isConfigureNavLink,\n [\"pl-4\"]: isConfigureSidebar,\n })}\n >\n {label}\n </Typography>\n </div>\n {items && <Items {...{ items }} isSettingsItems />}\n </div>\n );\n};\n\nexport default SelectedLink;\n","const Chevron = ({ style }) => (\n <svg {...{ style }} height=\"16\" viewBox=\"0 0 16 16\" width=\"16\">\n <path\n d=\"M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default Chevron;\n"],"names":["CheckPointNavLinks","_ref","checkpointKey","to","href","children","others","_objectWithoutProperties","_excluded","_useNavigationCheckpo","useNavigationCheckpoints","checkpoint","LinkElement","NavLink","linkProps","_objectSpread","key","_jsx","SUB_LINK_TYPES","SYSTEM_VIEW","SEGMENTS","SELECTED_NAV_LINK_ROUTE_STORAGE_KEY","DEFAULT_HOME_PATH","SIDEBAR_WIDTH_KEY","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","DEFAULT_SIDEBAR_WIDTH","isSubRouteActive","subRoute","location","currentBrowserUrl","URL","pathname","search","hash","window","origin","targetUrl","targetSearchParams","searchParams","targetSearchKeys","Array","from","keys","all","get","equals","getSidebarStateLocalStorageKey","_globalProps$user","_globalProps$user2","user","globalProps","email","phoneNumber","concat","filterByPermissions","curry","permissions","isNotEmpty","is","some","includes","__","getActiveConfigurePageLink","_ref2","navLinks","find","link","_link$to","_ref3","split","_ref4","_slicedToArray","linkPathname","isPresent","isConfigureNavLink","startsWith","enableDraggingStyles","document","body","classList","add","style","cursor","userSelect","disableDraggingStyles","remove","SubLink","onClick","label","_ref$type","type","count","isSectionHeader","isCountsLoading","dataCy","_ref$entity","entity","_ref$columns","columns","baseUrl","isActive","Segments","isIndependent","dataCyPrefix","hyphenate","renderCount","isSubLinkActive","Function","_jsxs","activeClassName","className","Typography","component","Items","items","_ref$isSettingsItems","isSettingsItems","filter","map","subItem","subIndex","_subItem$to","Fragment","item","path","_Fragment","_Items","length","SelectedLink","_ref$navLink","navLink","handleGoBack","isConfigureSidebar","homePath","history","useHistory","otherProps","handleHomeButtonClick","e","stopPropagation","handleMetaClick","omit","Button","hyphenize","icon","Home","classNames","_defineProperty","Chevron","height","viewBox","width","d","fill"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAMlB;AAAA,EAAA,IALJC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IACFC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;AACLC,IAAAA,MAAM,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,WAAA,CAAA,CAAA;AAET,EAAA,IAAAC,qBAAA,GACEC,wBAAwB,CAACR,aAAa,CAAC;IADhBS,UAAU,GAAAF,qBAAA,CAA1BP,aAAa,CAAA,CAAA;AAGtB,EAAA,IAAMU,WAAW,GAAGR,IAAI,GAAG,GAAG,GAAGS,OAAO,CAAA;AACxC,EAAA,IAAMC,SAAS,GAAGV,IAAI,GAAAW,eAAA,CAAA;AAChBX,IAAAA,IAAI,EAAJA,IAAI;AAAEY,IAAAA,GAAG,EAAEZ,IAAAA;GAASE,EAAAA,MAAM,IAAAS,eAAA,CAAA;IAC1BZ,EAAE,EAAEQ,UAAU,IAAIR,EAAE;AAAEa,IAAAA,GAAG,EAAEb,EAAAA;AAAE,GAAA,EAAKG,MAAM,CAAE,CAAA;EAEhD,oBAAOW,GAAA,CAACL,WAAW,EAAAG,eAAA,CAAAA,eAAA,KAAKD,SAAS,CAAA,EAAA,EAAA,EAAA;AAAAT,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAA,CAAc,CAAC,CAAA;AAC7D;;ACnBO,IAAMa,cAAc,GAAG;AAC5BC,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,QAAQ,EAAE,UAAA;AACZ,CAAC,CAAA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AAC,CAAA;AAAA,KAAA,CACV,CAAC,EACL0B,KAAK,iBAAIlG,GAAA,CAACiG,MAAK,EAAA;AAAOC,MAAAA,KAAK,EAALA,KAAK;MAAIE,eAAe,EAAA,IAAA;AAAA,KAAE,CAAC,CAAA;AAAA,GAC/C,CAAC,CAAA;AAEV;;;;;AC7DA,IAAMgC,OAAO,GAAG,SAAVA,OAAOA,CAAApJ,IAAA,EAAA;AAAA,EAAA,IAAMiF,KAAK,GAAAjF,IAAA,CAALiF,KAAK,CAAA;AAAA,EAAA,oBACtBjE,GAAA,CAAA,KAAA,EAAA;AAAWiE,IAAAA,KAAK,EAALA,KAAK;AAAIoE,IAAAA,MAAM,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAC,WAAW;AAACC,IAAAA,KAAK,EAAC,IAAI;AAAAnJ,IAAAA,QAAA,eAC5DY,GAAA,CAAA,MAAA,EAAA;AACEwI,MAAAA,CAAC,EAAC,y5BAAy5B;AAC35BC,MAAAA,IAAI,EAAC,cAAA;KACN,CAAA;AAAC,GACC,CAAC,CAAA;AAAA;;;;"}
|
|
@@ -5,7 +5,7 @@ import Button from '@bigbinary/neetoui/Button';
|
|
|
5
5
|
import { not } from 'ramda';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { useHistory } from 'react-router-dom';
|
|
8
|
-
import { S as SelectedLink, C as Chevron } from './Chevron-
|
|
8
|
+
import { S as SelectedLink, C as Chevron } from './Chevron-4NkORUaV.js';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
import '@babel/runtime/helpers/defineProperty';
|
|
11
11
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -494,6 +494,24 @@ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
|
494
494
|
var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
|
|
495
495
|
return "sidebarState-".concat(user);
|
|
496
496
|
};
|
|
497
|
+
var getUserProfileInfo = function getUserProfileInfo() {
|
|
498
|
+
var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
|
|
499
|
+
return {
|
|
500
|
+
name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
|
|
501
|
+
imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
502
|
+
email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
|
|
503
|
+
isAuthenticated: globalProps.authenticated
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
var getConsumerProfileInfo = function getConsumerProfileInfo() {
|
|
507
|
+
var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
|
|
508
|
+
return {
|
|
509
|
+
name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
|
|
510
|
+
imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
511
|
+
email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
|
|
512
|
+
isAuthenticated: globalProps.isConsumer
|
|
513
|
+
};
|
|
514
|
+
};
|
|
497
515
|
var getDefaultTopLinks = function getDefaultTopLinks(isOwner, setIsProfilePaneOpen, isAuthenticated) {
|
|
498
516
|
if (!isAuthenticated) return [];
|
|
499
517
|
var topLinks = [{
|
|
@@ -515,12 +533,15 @@ var getDefaultTopLinks = function getDefaultTopLinks(isOwner, setIsProfilePaneOp
|
|
|
515
533
|
}
|
|
516
534
|
return topLinks;
|
|
517
535
|
};
|
|
518
|
-
var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated) {
|
|
536
|
+
var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
|
|
519
537
|
return [isAuthenticated ? {
|
|
520
538
|
label: t("neetoMolecules.sidebar.logout"),
|
|
521
539
|
onClick: function onClick() {
|
|
522
540
|
resetAuthTokens();
|
|
523
541
|
removeFromLocalStorage(getSidebarStateLocalStorageKey());
|
|
542
|
+
isConsumer ?
|
|
543
|
+
// eslint-disable-next-line xss/no-location-href-assign
|
|
544
|
+
window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.origin) :
|
|
524
545
|
// eslint-disable-next-line xss/no-location-href-assign
|
|
525
546
|
window.location.href = "/logout";
|
|
526
547
|
},
|
|
@@ -534,14 +555,8 @@ var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated) {
|
|
|
534
555
|
"data-cy": "profile-login-button"
|
|
535
556
|
}];
|
|
536
557
|
};
|
|
537
|
-
var getProfileInfo = function getProfileInfo(profileInfoOverrides) {
|
|
538
|
-
|
|
539
|
-
return mergeDeepLeft(profileInfoOverrides, {
|
|
540
|
-
name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
|
|
541
|
-
imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
542
|
-
email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
|
|
543
|
-
isAuthenticated: globalProps.authenticated
|
|
544
|
-
});
|
|
558
|
+
var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
|
|
559
|
+
return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
|
|
545
560
|
};
|
|
546
561
|
|
|
547
562
|
// Theme switcher utils.
|
|
@@ -647,7 +662,8 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
647
662
|
customContent = _ref.customContent,
|
|
648
663
|
toggleModal = _ref.toggleModal,
|
|
649
664
|
isThemeSwitcherEnabled = _ref.isThemeSwitcherEnabled,
|
|
650
|
-
isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled
|
|
665
|
+
isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
|
|
666
|
+
isConsumer = _ref.isConsumer;
|
|
651
667
|
var Menu = Dropdown$1.Menu,
|
|
652
668
|
MenuItem = Dropdown$1.MenuItem,
|
|
653
669
|
Divider = Dropdown$1.Divider;
|
|
@@ -661,33 +677,35 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
661
677
|
children: isAuthenticated && /*#__PURE__*/jsx(ProfileHeader, {
|
|
662
678
|
profileInfo: profileInfo
|
|
663
679
|
})
|
|
664
|
-
}),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
680
|
+
}), !isConsumer && /*#__PURE__*/jsxs(Fragment, {
|
|
681
|
+
children: [isPresent((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan) && /*#__PURE__*/jsx(LinkSection, {
|
|
682
|
+
links: [{
|
|
683
|
+
label: /*#__PURE__*/jsx(Trans, {
|
|
684
|
+
i18nKey: "neetoMolecules.sidebar.currentPlan",
|
|
685
|
+
values: {
|
|
686
|
+
subscriptionPlan: humanize((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.subscriptionPlan)
|
|
687
|
+
}
|
|
688
|
+
}),
|
|
689
|
+
href: NEETO_AUTH_BILLING_INFO_URL,
|
|
690
|
+
"data-testid": "subscription-plan"
|
|
691
|
+
}]
|
|
692
|
+
}), showProductSwitcher && /*#__PURE__*/jsx(ProductSwitcher, {
|
|
693
|
+
toggleModal: toggleModal
|
|
694
|
+
}), isOrganizationSwitcherEnabled && /*#__PURE__*/jsx(OrganizationSwitcher, {}), isThemeSwitcherEnabled && /*#__PURE__*/jsx(ThemeSwitcher, {}), isNotEmpty(topLinks) && /*#__PURE__*/jsxs(Fragment, {
|
|
695
|
+
children: [/*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(LinkSection, {
|
|
696
|
+
links: topLinks
|
|
697
|
+
})]
|
|
698
|
+
}), isPresent(customContent) && /*#__PURE__*/jsxs(Fragment, {
|
|
699
|
+
children: [/*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(MenuItem, {
|
|
700
|
+
className: "neeto-molecules-floating-action-button__profile-wrapper-custom-content",
|
|
701
|
+
children: customContent
|
|
702
|
+
})]
|
|
703
|
+
}), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(LinkSection, {
|
|
704
|
+
links: defaultLinks
|
|
705
|
+
}), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx(LinkSection, {
|
|
706
|
+
links: helpLinks
|
|
707
|
+
}), /*#__PURE__*/jsx(Divider, {})]
|
|
708
|
+
}), /*#__PURE__*/jsx(LinkSection, {
|
|
691
709
|
links: bottomLinks
|
|
692
710
|
})]
|
|
693
711
|
});
|
|
@@ -703,7 +721,8 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
703
721
|
customContent = _ref.customContent,
|
|
704
722
|
isThemeSwitcherEnabled = _ref.isThemeSwitcherEnabled,
|
|
705
723
|
isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
|
|
706
|
-
profilePopoverProps = _ref.profilePopoverProps
|
|
724
|
+
profilePopoverProps = _ref.profilePopoverProps,
|
|
725
|
+
isConsumer = _ref.isConsumer;
|
|
707
726
|
var _useState = useState(false),
|
|
708
727
|
_useState2 = _slicedToArray(_useState, 2),
|
|
709
728
|
isModalOpen = _useState2[0],
|
|
@@ -722,7 +741,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
722
741
|
data = _useFetchNeetoApps.data,
|
|
723
742
|
refetch = _useFetchNeetoApps.refetch,
|
|
724
743
|
isStale = _useFetchNeetoApps.isStale;
|
|
725
|
-
var profileInfo = getProfileInfo(profileInfoOverrides);
|
|
744
|
+
var profileInfo = getProfileInfo(profileInfoOverrides, isConsumer);
|
|
726
745
|
useEffect(function () {
|
|
727
746
|
var Nv = {
|
|
728
747
|
onReceiveData: function onReceiveData(data) {
|
|
@@ -740,7 +759,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
740
759
|
refetch();
|
|
741
760
|
}, [isStale]);
|
|
742
761
|
var newTopLinks = globalProps.appName.toLowerCase() !== "neetoauth" ? [].concat(_toConsumableArray(getDefaultTopLinks(data === null || data === void 0 ? void 0 : data.isOwner, setIsProfilePaneOpen, profileInfo.isAuthenticated)), _toConsumableArray(topLinks)) : topLinks;
|
|
743
|
-
var newBottomLinks = [].concat(_toConsumableArray(getDefaultBottomLinks(profileInfo.isAuthenticated)), _toConsumableArray(bottomLinks));
|
|
762
|
+
var newBottomLinks = [].concat(_toConsumableArray(getDefaultBottomLinks(profileInfo.isAuthenticated, isConsumer)), _toConsumableArray(bottomLinks));
|
|
744
763
|
var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).map(function (key) {
|
|
745
764
|
return _objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]);
|
|
746
765
|
}).filter(function (_ref2) {
|
|
@@ -804,6 +823,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
804
823
|
customContent: customContent,
|
|
805
824
|
defaultLinks: defaultLinks,
|
|
806
825
|
helpLinks: helpLinks,
|
|
826
|
+
isConsumer: isConsumer,
|
|
807
827
|
isOrganizationSwitcherEnabled: isOrganizationSwitcherEnabled,
|
|
808
828
|
isThemeSwitcherEnabled: isThemeSwitcherEnabled,
|
|
809
829
|
profileInfo: profileInfo,
|
|
@@ -829,7 +849,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
829
849
|
var css = ":root{--neeto-molecules-floating-menu-z-index:99999}.neeto-molecules-floating-action-menu__container{background-color:rgb(var(--neeto-ui-white));border:1px solid rgb(var(--neeto-ui-white));border-bottom-right-radius:1.0625rem;border-left:none;border-top-right-radius:1.0625rem;bottom:16px;left:0;position:fixed;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-bottom-right-radius:1rem;border-color:rgb(var(--neeto-ui-primary-500));border-top-right-radius:1rem;display:flex;flex-direction:column;gap:.375rem;justify-content:center;padding:.25rem}.neeto-molecules-floating-action-button__help-icon{align-items:center;background-color:#fff;border-radius:6.25rem;display:flex;height:1.625rem;justify-content:center;width:1.625rem}.neeto-molecules-floating-action-button__profile-avatar{--neeto-ui-avatar-container-width:1.625rem;--neeto-ui-avatar-container-height:1.625rem;border:2px solid #fff;border-radius:6.25rem}.neeto-molecules-floating-action-button__profile-avatar>div{height:100%;width:100%}.neeto-molecules-floating-action-button__profile-avatar .neeto-ui-avatar{height:100%!important;width:100%!important}.neeto-molecules-floating-action-button__dropdown{flex-shrink:0;max-height:95vh!important;max-width:none;width:16rem;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button__dropdown ul{padding-top:0!important}.neeto-molecules-product-switcher-menu-popup__dropdown{max-height:none!important;max-width:none}.neeto-molecules-menu__notif-count{border:1px solid #fff;height:.9375rem;min-width:.9375rem;pointer-events:none;position:absolute;right:0;top:0;z-index:3}.neeto-molecules-menu-list__item-btn-count,.neeto-molecules-menu__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-accent-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);justify-content:center;padding-left:.25rem;padding-right:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.neeto-molecules-menu-list__item-btn-count{height:1.125rem;min-width:1.125rem}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;min-width:15rem}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-content{padding:0}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-menu-sublist__item-btn{font-weight:500!important;height:2.5rem}.neeto-molecules-menu-sublist__item-btn[data-btn-weight=bold]{font-weight:700!important}.neeto-molecules-menu-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-menu-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-menu-sublist__item-btn span{align-items:center;display:flex;gap:.5rem}.neeto-molecules-product-switcher-menu-popup-wrapper{height:95vh;overflow-y:auto;width:calc(100vw - 25rem)}.neeto-molecules-floating-action-button__profile-wrapper-custom-content:hover{background-color:rgb(var(--neeto-ui-white))!important}.neeto-molecules-theme-switcher-menu-popup-wrapper .neeto-ui-dropdown__popup-menu{padding-top:.25rem!important}.neeto-molecules-organization-switcher-active-button,.neeto-molecules-theme-switcher-active-button{color:rgb(var(--neeto-ui-success-600))!important}";
|
|
830
850
|
n(css,{});
|
|
831
851
|
|
|
832
|
-
var _excluded = ["profileInfoOverrides", "topLinks", "bottomLinks", "showProductSwitcher", "isThemeSwitcherEnabled", "isOrganizationSwitcherEnabled", "customContent", "profilePopoverProps"];
|
|
852
|
+
var _excluded = ["profileInfoOverrides", "topLinks", "bottomLinks", "showProductSwitcher", "isThemeSwitcherEnabled", "isOrganizationSwitcherEnabled", "customContent", "profilePopoverProps", "isConsumer"];
|
|
833
853
|
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; }
|
|
834
854
|
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; }
|
|
835
855
|
var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -849,11 +869,13 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
849
869
|
customContent = _ref.customContent,
|
|
850
870
|
_ref$profilePopoverPr = _ref.profilePopoverProps,
|
|
851
871
|
profilePopoverProps = _ref$profilePopoverPr === void 0 ? {} : _ref$profilePopoverPr,
|
|
872
|
+
_ref$isConsumer = _ref.isConsumer,
|
|
873
|
+
isConsumer = _ref$isConsumer === void 0 ? false : _ref$isConsumer,
|
|
852
874
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
853
875
|
useEffect(function () {
|
|
854
876
|
isThemeSwitcherEnabled && setAppTheme();
|
|
855
877
|
}, []);
|
|
856
|
-
var isBigBinaryEmail = globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.
|
|
878
|
+
var isBigBinaryEmail = globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 || (_globalProps$user = _globalProps$user.email) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.endsWith("@bigbinary.com");
|
|
857
879
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
858
880
|
ref: ref,
|
|
859
881
|
className: "neeto-molecules-floating-action-menu__container",
|
|
@@ -863,6 +885,7 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
863
885
|
children: /*#__PURE__*/jsx(ProfileButton, _defineProperty({
|
|
864
886
|
bottomLinks: bottomLinks,
|
|
865
887
|
customContent: customContent,
|
|
888
|
+
isConsumer: isConsumer,
|
|
866
889
|
isOrganizationSwitcherEnabled: isOrganizationSwitcherEnabled,
|
|
867
890
|
isThemeSwitcherEnabled: isThemeSwitcherEnabled,
|
|
868
891
|
profileInfoOverrides: profileInfoOverrides,
|