@bigbinary/neeto-molecules 1.0.114 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/Container.cjs.js +1 -1
- package/dist/Container.js +1 -1
- package/dist/CustomDomainDashboard.cjs.js +23 -24
- package/dist/CustomDomainDashboard.cjs.js.map +1 -1
- package/dist/CustomDomainDashboard.js +26 -27
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/EmailForm.cjs.js +110 -54
- package/dist/EmailForm.cjs.js.map +1 -1
- package/dist/EmailForm.js +111 -55
- package/dist/EmailForm.js.map +1 -1
- package/dist/Header.cjs.js +21 -23
- package/dist/Header.cjs.js.map +1 -1
- package/dist/Header.js +24 -26
- package/dist/Header.js.map +1 -1
- package/dist/MenuBar.cjs.js +1 -1
- package/dist/MenuBar.js +1 -1
- package/dist/NeetoWidget.cjs.js +52 -31
- package/dist/NeetoWidget.cjs.js.map +1 -1
- package/dist/NeetoWidget.js +54 -33
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Scrollable.cjs.js +5 -1
- package/dist/Scrollable.cjs.js.map +1 -1
- package/dist/Scrollable.js +5 -1
- package/dist/Scrollable.js.map +1 -1
- package/dist/Security.cjs.js +28 -25
- package/dist/Security.cjs.js.map +1 -1
- package/dist/Security.js +31 -28
- package/dist/Security.js.map +1 -1
- package/dist/SendToFields.cjs.js +2524 -0
- package/dist/SendToFields.cjs.js.map +1 -0
- package/dist/SendToFields.js +2517 -0
- package/dist/SendToFields.js.map +1 -0
- package/dist/ShareViaEmail.cjs.js +284 -221
- package/dist/ShareViaEmail.cjs.js.map +1 -1
- package/dist/ShareViaEmail.js +287 -224
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/Sidebar.cjs.js +251 -139
- package/dist/Sidebar.cjs.js.map +1 -1
- package/dist/Sidebar.js +254 -142
- package/dist/Sidebar.js.map +1 -1
- package/dist/SubHeader.cjs.js +1 -1
- package/dist/SubHeader.js +1 -1
- package/package.json +3 -3
- package/src/translations/en.json +16 -3
- package/types/Header.d.ts +3 -2
- package/types/NavigationHeader.d.ts +63 -41
- package/types/SendToFields.d.ts +63 -0
- package/types/Sidebar.d.ts +2 -1
package/dist/Sidebar.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { Children, isValidElement, cloneElement, forwardRef, useState, useRef, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Typography, Button, Input, Tooltip, Spinner, Avatar } from '@bigbinary/neetoui';
|
|
2
|
+
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
3
|
+
import { useFetchNeetoApps, useHotKeys, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
+
import { Typography, Button, Input, Spinner, Avatar, Tooltip } from '@bigbinary/neetoui';
|
|
5
|
+
import { toLower, all, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import {
|
|
7
|
+
import { Link, useLocation, NavLink } from 'react-router-dom';
|
|
8
|
+
import { NeetoIcon, Close, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
|
|
9
|
+
import { capitalize, truncate, isPresent, findBy, isNotPresent } from '@bigbinary/neeto-commons-frontend/pure';
|
|
9
10
|
import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
|
|
10
11
|
import { t as t$1 } from 'i18next';
|
|
11
12
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
|
|
12
13
|
import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
|
|
13
|
-
import * as
|
|
14
|
-
import { Neeto } from '@bigbinary/neeto-icons/logos';
|
|
15
|
-
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
14
|
+
import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
|
|
15
|
+
import { Neeto } from '@bigbinary/neeto-icons/typeface-logos';
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) {
|
|
18
18
|
if (Array.isArray(arr)) return arr;
|
|
@@ -34061,7 +34061,7 @@ SwitchTransition.defaultProps = {
|
|
|
34061
34061
|
|
|
34062
34062
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
34063
34063
|
|
|
34064
|
-
var css$1 = ".neeto-molecules-app-switcher__backdrop{align-items:center;background-color:rgba(27,31,35,.867);flex-direction:row;left:
|
|
34064
|
+
var css$1 = ".neeto-molecules-app-switcher__backdrop{align-items:center;background-color:rgba(27,31,35,.867);flex-direction:row;left:0;overflow:hidden;position:fixed;top:0;z-index:99998}.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher__wrapper{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;height:100vh;justify-content:flex-start;transition:all .3s;width:100vw}.neeto-molecules-app-switcher__wrapper{align-items:flex-start;animation:nuifadeIn .3s ease-in;background-color:rgb(var(--neeto-ui-white));flex-direction:column;max-width:100%;overflow-y:auto;padding:40px;position:relative}.neeto-molecules-app-switcher__wrapper--collapsed{width:100vw}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:16px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}.neeto-molecules-app-switcher__header h1{font-size:40px;line-height:var(--neeto-ui-leading-tight);margin-top:-16px}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{width:316px}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}.neeto-molecules-app-switcher-enter.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0}.neeto-molecules-app-switcher-enter-active.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher-enter-done.neeto-molecules-app-switcher__backdrop,.neeto-molecules-app-switcher-exit.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:1}.neeto-molecules-app-switcher-exit-active.neeto-molecules-app-switcher__backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0}";
|
|
34065
34065
|
n(css$1,{});
|
|
34066
34066
|
|
|
34067
34067
|
function _extends() {
|
|
@@ -34189,7 +34189,7 @@ var Body = function Body(_ref) {
|
|
|
34189
34189
|
className: "neeto-molecules-app-switcher__header",
|
|
34190
34190
|
"data-cy": "app-switcher-body-wrapper"
|
|
34191
34191
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
34192
|
-
style: "
|
|
34192
|
+
style: "h1"
|
|
34193
34193
|
}, t("neetoMolecules.appSwitcher.chooseNeetoProduct")), /*#__PURE__*/React.createElement("div", {
|
|
34194
34194
|
className: "neeto-molecules-app-switcher__search-wrapper"
|
|
34195
34195
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -34266,7 +34266,8 @@ var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handle
|
|
|
34266
34266
|
|
|
34267
34267
|
var AppSwitcher = function AppSwitcher(_ref) {
|
|
34268
34268
|
var isOpen = _ref.isOpen,
|
|
34269
|
-
onClose = _ref.onClose
|
|
34269
|
+
onClose = _ref.onClose,
|
|
34270
|
+
isSidebarCollapsed = _ref.isSidebarCollapsed;
|
|
34270
34271
|
var paneWrapper = useRef(null);
|
|
34271
34272
|
var backdropRef = useRef(null);
|
|
34272
34273
|
useOnClickOutside(paneWrapper, backdropRef, onClose);
|
|
@@ -34283,56 +34284,38 @@ var AppSwitcher = function AppSwitcher(_ref) {
|
|
|
34283
34284
|
"in": isOpen,
|
|
34284
34285
|
timeout: 300
|
|
34285
34286
|
}, /*#__PURE__*/React.createElement(Backdrop$1, {
|
|
34286
|
-
className: "neeto-molecules-app-switcher__backdrop",
|
|
34287
34287
|
key: "switcher-backdrop",
|
|
34288
|
-
ref: backdropRef
|
|
34288
|
+
ref: backdropRef,
|
|
34289
|
+
className: classnames("neeto-molecules-app-switcher__backdrop", {
|
|
34290
|
+
"neeto-molecules-app-switcher__backdrop--collapsed": isSidebarCollapsed
|
|
34291
|
+
})
|
|
34289
34292
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34290
|
-
className: "neeto-molecules-app-switcher__wrapper",
|
|
34291
34293
|
"data-cy": "switcher-wrapper",
|
|
34292
34294
|
"data-testid": "switcher-wrapper",
|
|
34293
34295
|
key: "switcher-wrapper",
|
|
34294
|
-
ref: paneWrapper
|
|
34296
|
+
ref: paneWrapper,
|
|
34297
|
+
className: classnames("neeto-molecules-app-switcher__wrapper", {
|
|
34298
|
+
"neeto-molecules-app-switcher__wrapper--collapsed": isSidebarCollapsed
|
|
34299
|
+
})
|
|
34295
34300
|
}, /*#__PURE__*/React.createElement(Body, {
|
|
34296
34301
|
onClose: onClose
|
|
34297
34302
|
})))));
|
|
34298
34303
|
};
|
|
34299
34304
|
|
|
34300
|
-
var
|
|
34301
|
-
var
|
|
34302
|
-
|
|
34303
|
-
|
|
34304
|
-
|
|
34305
|
-
|
|
34306
|
-
|
|
34307
|
-
|
|
34308
|
-
|
|
34309
|
-
|
|
34310
|
-
}
|
|
34311
|
-
className: "neeto-ui-text-center neeto-ui-text-gray-400 sidebar-featured-tooltip__description",
|
|
34312
|
-
lineHeight: "normal",
|
|
34313
|
-
style: "body3"
|
|
34314
|
-
}, description));
|
|
34315
|
-
};
|
|
34316
|
-
var FeaturedTooltip$1 = /*#__PURE__*/React.memo(FeaturedTooltip);
|
|
34317
|
-
|
|
34318
|
-
var NavIconWrapper = function NavIconWrapper(_ref) {
|
|
34319
|
-
var description = _ref.description,
|
|
34320
|
-
label = _ref.label,
|
|
34321
|
-
children = _ref.children;
|
|
34322
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
34323
|
-
className: "sidebar-featured-tooltip__content",
|
|
34324
|
-
content: /*#__PURE__*/React.createElement(FeaturedTooltip$1, {
|
|
34325
|
-
description: description,
|
|
34326
|
-
label: label
|
|
34327
|
-
}),
|
|
34328
|
-
delay: [400, 40],
|
|
34329
|
-
distance: "20rem",
|
|
34330
|
-
duration: [200, 200],
|
|
34331
|
-
position: "right"
|
|
34332
|
-
}, children);
|
|
34305
|
+
var Chevron = function Chevron(_ref) {
|
|
34306
|
+
var style = _ref.style;
|
|
34307
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
34308
|
+
height: "16",
|
|
34309
|
+
viewBox: "0 0 16 16",
|
|
34310
|
+
width: "16",
|
|
34311
|
+
style: style
|
|
34312
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
34313
|
+
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",
|
|
34314
|
+
fill: "currentColor"
|
|
34315
|
+
}));
|
|
34333
34316
|
};
|
|
34334
34317
|
|
|
34335
|
-
var css = ".neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-
|
|
34318
|
+
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}.neeto-molecules-sidebar__wrapper:hover .neeto-molecules-sidebar__toggler{opacity:1}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler-hover-area{bottom:0;left:100%;position:absolute;top:0;width:40px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__toggler{opacity:0;position:absolute;right:8px;top:8px;transition:opacity .3s ease-in-out;z-index:99999;z-index:calc(var(--neeto-molecules-sidebar-z-index) + 1)}.neeto-molecules-sidebar__toggler:focus{opacity:1}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-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-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}";
|
|
34336
34319
|
n(css,{});
|
|
34337
34320
|
|
|
34338
34321
|
var AppSwitcherButton = function AppSwitcherButton(_ref) {
|
|
@@ -34351,9 +34334,7 @@ var AppSwitcherButton = function AppSwitcherButton(_ref) {
|
|
|
34351
34334
|
var handleAppSwitcherToggle = function handleAppSwitcherToggle(event) {
|
|
34352
34335
|
if (!data) event.stopPropagation();else onAppSwitcherToggle();
|
|
34353
34336
|
};
|
|
34354
|
-
return /*#__PURE__*/React.createElement(
|
|
34355
|
-
label: t("neetoMolecules.sidebar.productSwitcher")
|
|
34356
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
34337
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
34357
34338
|
className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--app-switcher neeto-molecules-sidebar__link--button neeto-ui-flex neeto-ui-w-full neeto-ui-select-none neeto-ui-items-center neeto-ui-justify-start neeto-ui-shadow-none",
|
|
34358
34339
|
"data-cy": "app-switcher-button",
|
|
34359
34340
|
"data-testid": "app-switcher-button",
|
|
@@ -34370,7 +34351,12 @@ var AppSwitcherButton = function AppSwitcherButton(_ref) {
|
|
|
34370
34351
|
"data-testid": "app-switcher-button-loader"
|
|
34371
34352
|
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(AppSwitcher$1, {
|
|
34372
34353
|
size: 24
|
|
34373
|
-
}))
|
|
34354
|
+
})), /*#__PURE__*/React.createElement(Typography, {
|
|
34355
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
34356
|
+
component: "span",
|
|
34357
|
+
style: "body2",
|
|
34358
|
+
weight: "normal"
|
|
34359
|
+
}, t("neetoMolecules.sidebar.productSwitcher")));
|
|
34374
34360
|
};
|
|
34375
34361
|
|
|
34376
34362
|
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
@@ -34388,7 +34374,7 @@ var DEFAULT_HELP_LINK_PROPS = {
|
|
|
34388
34374
|
}
|
|
34389
34375
|
},
|
|
34390
34376
|
helpCenterProps: {
|
|
34391
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.
|
|
34377
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
34392
34378
|
icon: Book,
|
|
34393
34379
|
"data-cy": "help-link-help-center-button",
|
|
34394
34380
|
href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
|
|
@@ -34407,6 +34393,24 @@ var DEFAULT_HELP_LINK_PROPS = {
|
|
|
34407
34393
|
}
|
|
34408
34394
|
};
|
|
34409
34395
|
|
|
34396
|
+
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
34397
|
+
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
34398
|
+
var targetUrl = new URL(subRoute, window.location.origin);
|
|
34399
|
+
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
34400
|
+
return false;
|
|
34401
|
+
}
|
|
34402
|
+
var targetSearchParams = targetUrl.searchParams;
|
|
34403
|
+
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
34404
|
+
return all(function (key) {
|
|
34405
|
+
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
34406
|
+
}, targetSearchKeys);
|
|
34407
|
+
};
|
|
34408
|
+
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
34409
|
+
var _globalProps$user, _globalProps$user2;
|
|
34410
|
+
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);
|
|
34411
|
+
return "sidebarState-".concat(user);
|
|
34412
|
+
};
|
|
34413
|
+
|
|
34410
34414
|
var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
34411
34415
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
34412
34416
|
return mergeDeepLeft(profileInfoOverrides, {
|
|
@@ -34433,6 +34437,7 @@ var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
|
34433
34437
|
label: t$1("neetoMolecules.sidebar.logout"),
|
|
34434
34438
|
onClick: function onClick() {
|
|
34435
34439
|
resetAuthTokens();
|
|
34440
|
+
localStorage.removeItem(getSidebarStateLocalStorageKey());
|
|
34436
34441
|
window.location.href = "/logout";
|
|
34437
34442
|
},
|
|
34438
34443
|
"data-cy": "profile-logout-button"
|
|
@@ -34451,7 +34456,7 @@ var ProfileSection = function ProfileSection(_ref, ref) {
|
|
|
34451
34456
|
isLoading = _useFetchNeetoApps.isLoading,
|
|
34452
34457
|
isStale = _useFetchNeetoApps.isStale;
|
|
34453
34458
|
return /*#__PURE__*/React.createElement("button", {
|
|
34454
|
-
className: "neeto-molecules-
|
|
34459
|
+
className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none",
|
|
34455
34460
|
"data-cy": "profile-section",
|
|
34456
34461
|
"data-testid": "profile-section",
|
|
34457
34462
|
ref: ref,
|
|
@@ -34461,17 +34466,19 @@ var ProfileSection = function ProfileSection(_ref, ref) {
|
|
|
34461
34466
|
setHasHovered(true);
|
|
34462
34467
|
}
|
|
34463
34468
|
}
|
|
34464
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
34465
|
-
className: "neeto-molecules-sidebar__profile neeto-ui-flex neeto-ui-w-full neeto-ui-flex-shrink-0 neeto-ui-items-center"
|
|
34466
34469
|
}, isLoading && hasHovered ? /*#__PURE__*/React.createElement("span", {
|
|
34467
|
-
className: "flex h-10 w-10 items-center justify-center",
|
|
34468
34470
|
"data-testid": "profile-avatar-loader"
|
|
34469
|
-
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(Avatar, {
|
|
34470
|
-
className: "neeto-ui-flex-shrink-0",
|
|
34471
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
34472
|
+
className: "neeto-ui-flex-shrink-0 neeto-molecules-sidebar__profile-avatar",
|
|
34471
34473
|
"data-testid": "profile-avatar",
|
|
34472
|
-
size: "
|
|
34474
|
+
size: "small",
|
|
34473
34475
|
user: profileInfo
|
|
34474
|
-
})
|
|
34476
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
34477
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
34478
|
+
component: "span",
|
|
34479
|
+
style: "body2",
|
|
34480
|
+
weight: "normal"
|
|
34481
|
+
}, truncate(profileInfo.name, 18))));
|
|
34475
34482
|
};
|
|
34476
34483
|
var ProfileSection$1 = /*#__PURE__*/forwardRef(ProfileSection);
|
|
34477
34484
|
|
|
@@ -34491,7 +34498,50 @@ function _toConsumableArray(arr) {
|
|
|
34491
34498
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
34492
34499
|
}
|
|
34493
34500
|
|
|
34501
|
+
function _typeof(obj) {
|
|
34502
|
+
"@babel/helpers - typeof";
|
|
34503
|
+
|
|
34504
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
34505
|
+
return typeof obj;
|
|
34506
|
+
} : function (obj) {
|
|
34507
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
34508
|
+
}, _typeof(obj);
|
|
34509
|
+
}
|
|
34510
|
+
|
|
34511
|
+
function _toPrimitive(input, hint) {
|
|
34512
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
34513
|
+
var prim = input[Symbol.toPrimitive];
|
|
34514
|
+
if (prim !== undefined) {
|
|
34515
|
+
var res = prim.call(input, hint || "default");
|
|
34516
|
+
if (_typeof(res) !== "object") return res;
|
|
34517
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
34518
|
+
}
|
|
34519
|
+
return (hint === "string" ? String : Number)(input);
|
|
34520
|
+
}
|
|
34521
|
+
|
|
34522
|
+
function _toPropertyKey(arg) {
|
|
34523
|
+
var key = _toPrimitive(arg, "string");
|
|
34524
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
34525
|
+
}
|
|
34526
|
+
|
|
34527
|
+
function _defineProperty(obj, key, value) {
|
|
34528
|
+
key = _toPropertyKey(key);
|
|
34529
|
+
if (key in obj) {
|
|
34530
|
+
Object.defineProperty(obj, key, {
|
|
34531
|
+
value: value,
|
|
34532
|
+
enumerable: true,
|
|
34533
|
+
configurable: true,
|
|
34534
|
+
writable: true
|
|
34535
|
+
});
|
|
34536
|
+
} else {
|
|
34537
|
+
obj[key] = value;
|
|
34538
|
+
}
|
|
34539
|
+
return obj;
|
|
34540
|
+
}
|
|
34541
|
+
|
|
34494
34542
|
var _excluded$2 = ["onClick", "label", "icon"];
|
|
34543
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34544
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34495
34545
|
var LinkSection = function LinkSection(_ref) {
|
|
34496
34546
|
var links = _ref.links;
|
|
34497
34547
|
return /*#__PURE__*/React.createElement("ul", {
|
|
@@ -34502,22 +34552,20 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
34502
34552
|
_ref2$icon = _ref2.icon,
|
|
34503
34553
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
34504
34554
|
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
34505
|
-
var IconSVG = icon;
|
|
34506
34555
|
return /*#__PURE__*/React.createElement("li", {
|
|
34507
34556
|
className: "neeto-molecules-profile-sublist__item",
|
|
34508
34557
|
key: idx
|
|
34509
|
-
}, /*#__PURE__*/React.createElement(
|
|
34558
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
34559
|
+
fullWidth: true,
|
|
34560
|
+
className: "neeto-molecules-profile-sublist__item-btn",
|
|
34561
|
+
iconPosition: "left",
|
|
34562
|
+
iconSize: 18,
|
|
34563
|
+
style: "text"
|
|
34564
|
+
}, _objectSpread$2({
|
|
34565
|
+
icon: icon,
|
|
34566
|
+
label: label,
|
|
34510
34567
|
onClick: onClick
|
|
34511
|
-
}, otherProps
|
|
34512
|
-
className: "neeto-molecules-profile-sublist__item-btn"
|
|
34513
|
-
}), icon && /*#__PURE__*/React.createElement("span", {
|
|
34514
|
-
className: "neeto-molecules-profile-sublist__item-btn-icon"
|
|
34515
|
-
}, /*#__PURE__*/React.createElement(IconSVG, null)), /*#__PURE__*/React.createElement(Typography, {
|
|
34516
|
-
className: "neeto-molecules-profile-sublist__item-btn-label",
|
|
34517
|
-
component: "span",
|
|
34518
|
-
style: "body2",
|
|
34519
|
-
weight: "normal"
|
|
34520
|
-
}, label)));
|
|
34568
|
+
}, otherProps))));
|
|
34521
34569
|
}));
|
|
34522
34570
|
};
|
|
34523
34571
|
|
|
@@ -34534,7 +34582,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
34534
34582
|
"data-cy": "profile-popup",
|
|
34535
34583
|
"data-testid": "profile-popup"
|
|
34536
34584
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34537
|
-
className: classnames("neeto-ui-relative neeto-ui-flex neeto-ui-items-center neeto-ui-p-3")
|
|
34585
|
+
className: classnames("neeto-ui-relative neeto-ui-flex neeto-ui-items-center neeto-ui-p-3 neeto-ui-bg-primary-100 neeto-molecules-profile-popup__top-section")
|
|
34538
34586
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34539
34587
|
className: "top-0 left-0"
|
|
34540
34588
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
@@ -34550,7 +34598,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
34550
34598
|
title: name,
|
|
34551
34599
|
weight: "semibold"
|
|
34552
34600
|
}, truncate(name, 18)), email && /*#__PURE__*/React.createElement(Typography, {
|
|
34553
|
-
className: "neeto-ui-w-full neeto-ui-truncate neeto-ui-text-gray-
|
|
34601
|
+
className: "neeto-ui-w-full neeto-ui-truncate neeto-ui-text-gray-700",
|
|
34554
34602
|
lineHeight: "tight",
|
|
34555
34603
|
style: "body3"
|
|
34556
34604
|
}, email))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -34577,6 +34625,8 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
34577
34625
|
}),
|
|
34578
34626
|
disabled: !data,
|
|
34579
34627
|
hideOnClick: false,
|
|
34628
|
+
interactiveDebounce: 20,
|
|
34629
|
+
offset: [0, -70],
|
|
34580
34630
|
position: "right",
|
|
34581
34631
|
theme: "light"
|
|
34582
34632
|
}, /*#__PURE__*/React.createElement(ProfileSection$1, {
|
|
@@ -34584,10 +34634,14 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
34584
34634
|
}));
|
|
34585
34635
|
};
|
|
34586
34636
|
|
|
34637
|
+
// Rule can be enabled once the ticket - https://github.com/bigbinary/neeto-commons-frontend/issues/905 is closed.
|
|
34638
|
+
// eslint-disable-next-line @bigbinary/neeto/no-dumb-components-with-use-translation
|
|
34587
34639
|
var HelpSection = function HelpSection(_ref, ref) {
|
|
34588
34640
|
var changesCount = _ref.changesCount;
|
|
34641
|
+
var _useTranslation = useTranslation(),
|
|
34642
|
+
t = _useTranslation.t;
|
|
34589
34643
|
return /*#__PURE__*/React.createElement("button", {
|
|
34590
|
-
className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none",
|
|
34644
|
+
className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none",
|
|
34591
34645
|
"data-cy": "help-button",
|
|
34592
34646
|
ref: ref
|
|
34593
34647
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -34597,51 +34651,15 @@ var HelpSection = function HelpSection(_ref, ref) {
|
|
|
34597
34651
|
}), isPresent(changesCount) && /*#__PURE__*/React.createElement("span", {
|
|
34598
34652
|
className: "neeto-molecules-sidebar__notif-count",
|
|
34599
34653
|
"data-testid": "help-icon-changes-count"
|
|
34600
|
-
}, changesCount))
|
|
34654
|
+
}, changesCount)), /*#__PURE__*/React.createElement(Typography, {
|
|
34655
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
34656
|
+
component: "span",
|
|
34657
|
+
style: "body2",
|
|
34658
|
+
weight: "normal"
|
|
34659
|
+
}, t("neetoMolecules.sidebar.helpLinks.helpCenter")));
|
|
34601
34660
|
};
|
|
34602
34661
|
var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
|
|
34603
34662
|
|
|
34604
|
-
function _typeof(obj) {
|
|
34605
|
-
"@babel/helpers - typeof";
|
|
34606
|
-
|
|
34607
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
34608
|
-
return typeof obj;
|
|
34609
|
-
} : function (obj) {
|
|
34610
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
34611
|
-
}, _typeof(obj);
|
|
34612
|
-
}
|
|
34613
|
-
|
|
34614
|
-
function _toPrimitive(input, hint) {
|
|
34615
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
34616
|
-
var prim = input[Symbol.toPrimitive];
|
|
34617
|
-
if (prim !== undefined) {
|
|
34618
|
-
var res = prim.call(input, hint || "default");
|
|
34619
|
-
if (_typeof(res) !== "object") return res;
|
|
34620
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
34621
|
-
}
|
|
34622
|
-
return (hint === "string" ? String : Number)(input);
|
|
34623
|
-
}
|
|
34624
|
-
|
|
34625
|
-
function _toPropertyKey(arg) {
|
|
34626
|
-
var key = _toPrimitive(arg, "string");
|
|
34627
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
34628
|
-
}
|
|
34629
|
-
|
|
34630
|
-
function _defineProperty(obj, key, value) {
|
|
34631
|
-
key = _toPropertyKey(key);
|
|
34632
|
-
if (key in obj) {
|
|
34633
|
-
Object.defineProperty(obj, key, {
|
|
34634
|
-
value: value,
|
|
34635
|
-
enumerable: true,
|
|
34636
|
-
configurable: true,
|
|
34637
|
-
writable: true
|
|
34638
|
-
});
|
|
34639
|
-
} else {
|
|
34640
|
-
obj[key] = value;
|
|
34641
|
-
}
|
|
34642
|
-
return obj;
|
|
34643
|
-
}
|
|
34644
|
-
|
|
34645
34663
|
var _excluded$1 = ["label"];
|
|
34646
34664
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34647
34665
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -34663,13 +34681,16 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
34663
34681
|
var hide = _ref2.hide;
|
|
34664
34682
|
return !hide;
|
|
34665
34683
|
});
|
|
34666
|
-
return /*#__PURE__*/React.createElement("ul",
|
|
34684
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
34685
|
+
className: "neeto-molecules-help-sublist"
|
|
34686
|
+
}, helpLinks.map(function (_ref3, idx) {
|
|
34667
34687
|
var label = _ref3.label,
|
|
34668
34688
|
buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
|
|
34669
34689
|
return /*#__PURE__*/React.createElement("li", {
|
|
34670
34690
|
className: "neeto-molecules-help-sublist__item",
|
|
34671
34691
|
key: idx
|
|
34672
34692
|
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
34693
|
+
fullWidth: true,
|
|
34673
34694
|
className: "neeto-molecules-help-sublist__item-btn",
|
|
34674
34695
|
iconPosition: "left",
|
|
34675
34696
|
iconSize: 18,
|
|
@@ -34706,7 +34727,7 @@ var Footer = function Footer(_ref) {
|
|
|
34706
34727
|
window.Nv = window.Nv ? Object.assign(window.Nv, Nv) : Nv;
|
|
34707
34728
|
}, []);
|
|
34708
34729
|
return /*#__PURE__*/React.createElement("div", {
|
|
34709
|
-
className: "neeto-molecules-sidebar__footer"
|
|
34730
|
+
className: "neeto-molecules-sidebar__footer neeto-molecules-sidebar__no-shrinkable"
|
|
34710
34731
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
34711
34732
|
interactive: true,
|
|
34712
34733
|
className: "neeto-molecules-help-popup-wrapper",
|
|
@@ -34715,6 +34736,8 @@ var Footer = function Footer(_ref) {
|
|
|
34715
34736
|
helpLinkOverrides: helpLinkOverrides
|
|
34716
34737
|
}),
|
|
34717
34738
|
hideOnClick: false,
|
|
34739
|
+
interactiveDebounce: 20,
|
|
34740
|
+
offset: [0, -70],
|
|
34718
34741
|
position: "right",
|
|
34719
34742
|
theme: "light"
|
|
34720
34743
|
}, /*#__PURE__*/React.createElement(HelpSection$1, {
|
|
@@ -34728,12 +34751,12 @@ var Footer = function Footer(_ref) {
|
|
|
34728
34751
|
};
|
|
34729
34752
|
|
|
34730
34753
|
var Header = function Header(_ref) {
|
|
34731
|
-
var
|
|
34754
|
+
var _ProductTypefaceLogos;
|
|
34732
34755
|
var customLogo = _ref.customLogo;
|
|
34733
34756
|
var productName = globalProps.appName.substr(5);
|
|
34734
34757
|
var logoName = "Neeto".concat(capitalize(productName.toLowerCase()));
|
|
34735
|
-
var
|
|
34736
|
-
var LogoComponent = customLogo !== null && customLogo !== void 0 ? customLogo :
|
|
34758
|
+
var ProductTypefaceLogo = (_ProductTypefaceLogos = ProductTypefaceLogos[logoName]) !== null && _ProductTypefaceLogos !== void 0 ? _ProductTypefaceLogos : Neeto;
|
|
34759
|
+
var LogoComponent = customLogo !== null && customLogo !== void 0 ? customLogo : ProductTypefaceLogo;
|
|
34737
34760
|
var _useFetchNeetoApps = useFetchNeetoApps(),
|
|
34738
34761
|
data = _useFetchNeetoApps.data;
|
|
34739
34762
|
var homePath = "/";
|
|
@@ -34746,22 +34769,26 @@ var Header = function Header(_ref) {
|
|
|
34746
34769
|
}
|
|
34747
34770
|
}
|
|
34748
34771
|
return /*#__PURE__*/React.createElement("div", {
|
|
34749
|
-
className: "neeto-
|
|
34772
|
+
className: "neeto-molecules-sidebar__header neeto-molecules-sidebar__no-shrinkable",
|
|
34750
34773
|
"data-cy": "sidebar-info"
|
|
34751
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
34752
|
-
className: "neeto-molecules-sidebar__logo flex flex-shrink-0 items-center justify-center"
|
|
34753
34774
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
34775
|
+
className: "neeto-molecules-sidebar__logo neeto-ui-w-full",
|
|
34754
34776
|
to: homePath
|
|
34755
|
-
}, /*#__PURE__*/React.createElement(LogoComponent, null)))
|
|
34777
|
+
}, /*#__PURE__*/React.createElement(LogoComponent, null)));
|
|
34756
34778
|
};
|
|
34757
34779
|
var Header$1 = /*#__PURE__*/React.memo(Header);
|
|
34758
34780
|
|
|
34759
|
-
var _excluded = ["label", "to", "icon", "
|
|
34781
|
+
var _excluded = ["label", "to", "icon", "items"],
|
|
34782
|
+
_excluded2 = ["label", "to", "count", "dataCy"];
|
|
34760
34783
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34761
34784
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34762
34785
|
var Links = function Links(_ref) {
|
|
34763
34786
|
var navLinks = _ref.navLinks;
|
|
34764
34787
|
var location = useLocation();
|
|
34788
|
+
var _useState = useState(true),
|
|
34789
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34790
|
+
isActiveLinkExpanded = _useState2[0],
|
|
34791
|
+
setIsActiveLinkExpanded = _useState2[1];
|
|
34765
34792
|
var filterByPermissions = curry(function (_ref2) {
|
|
34766
34793
|
var permissions = _ref2.permissions;
|
|
34767
34794
|
if (permissions) {
|
|
@@ -34769,33 +34796,84 @@ var Links = function Links(_ref) {
|
|
|
34769
34796
|
}
|
|
34770
34797
|
return true;
|
|
34771
34798
|
});
|
|
34799
|
+
var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
|
|
34800
|
+
if (isNotPresent(items)) return;
|
|
34801
|
+
if (isActive()) {
|
|
34802
|
+
setIsActiveLinkExpanded(not);
|
|
34803
|
+
event.preventDefault();
|
|
34804
|
+
return;
|
|
34805
|
+
}
|
|
34806
|
+
setIsActiveLinkExpanded(true);
|
|
34807
|
+
};
|
|
34772
34808
|
return /*#__PURE__*/React.createElement("div", {
|
|
34773
|
-
className: "neeto-molecules-sidebar__links"
|
|
34809
|
+
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
34774
34810
|
}, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
|
|
34775
34811
|
var label = _ref3.label,
|
|
34776
34812
|
to = _ref3.to,
|
|
34777
34813
|
icon = _ref3.icon,
|
|
34778
|
-
|
|
34814
|
+
items = _ref3.items,
|
|
34779
34815
|
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
34780
34816
|
var IconSVG = icon;
|
|
34781
34817
|
var url = new URL(to, window.location.href);
|
|
34782
34818
|
var isActive = function isActive() {
|
|
34783
|
-
return location.pathname.startsWith(url.pathname);
|
|
34819
|
+
return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
34784
34820
|
};
|
|
34785
|
-
|
|
34786
|
-
|
|
34787
|
-
label: label,
|
|
34821
|
+
var isMenuExpanded = isActive() && isActiveLinkExpanded;
|
|
34822
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
34788
34823
|
key: mainIndex
|
|
34789
34824
|
}, /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
34790
34825
|
activeClassName: "active",
|
|
34791
|
-
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link"
|
|
34826
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
34827
|
+
onClick: function onClick(event) {
|
|
34828
|
+
return handleNavLinkClick(event, isActive, items);
|
|
34829
|
+
}
|
|
34792
34830
|
}, _objectSpread({
|
|
34793
34831
|
isActive: isActive,
|
|
34794
34832
|
to: to
|
|
34795
|
-
}, otherProps)), icon && /*#__PURE__*/React.createElement("
|
|
34796
|
-
className: "neeto-
|
|
34833
|
+
}, otherProps)), icon && /*#__PURE__*/React.createElement("span", {
|
|
34834
|
+
className: "neeto-molecules-sidebar__link-icon",
|
|
34797
34835
|
"data-testid": label
|
|
34798
|
-
}, /*#__PURE__*/React.createElement(IconSVG, null))
|
|
34836
|
+
}, /*#__PURE__*/React.createElement(IconSVG, null)), /*#__PURE__*/React.createElement(Typography, {
|
|
34837
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
34838
|
+
component: "span",
|
|
34839
|
+
style: "body2",
|
|
34840
|
+
weight: "normal"
|
|
34841
|
+
}, label), items && /*#__PURE__*/React.createElement("span", {
|
|
34842
|
+
className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
|
|
34843
|
+
"neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
|
|
34844
|
+
})
|
|
34845
|
+
}, /*#__PURE__*/React.createElement(Down, {
|
|
34846
|
+
size: 16
|
|
34847
|
+
}))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
|
|
34848
|
+
className: "neeto-molecules-sidebar__sublink-wrapper",
|
|
34849
|
+
"data-cy": "sidebar-sub-link-wrapper"
|
|
34850
|
+
}, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
|
|
34851
|
+
var subLabel = _ref4.label,
|
|
34852
|
+
subRoute = _ref4.to,
|
|
34853
|
+
count = _ref4.count,
|
|
34854
|
+
dataCy = _ref4.dataCy,
|
|
34855
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded2);
|
|
34856
|
+
return /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
34857
|
+
activeClassName: "active",
|
|
34858
|
+
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
34859
|
+
"data-cy": "".concat(dataCy, "-sub-link"),
|
|
34860
|
+
isActive: function isActive() {
|
|
34861
|
+
return isSubRouteActive(subRoute, location);
|
|
34862
|
+
},
|
|
34863
|
+
key: subIndex,
|
|
34864
|
+
to: subRoute
|
|
34865
|
+
}, otherProps), /*#__PURE__*/React.createElement(Typography, {
|
|
34866
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
34867
|
+
component: "span",
|
|
34868
|
+
"data-cy": "".concat(dataCy, "-sub-link-label"),
|
|
34869
|
+
style: "body2"
|
|
34870
|
+
}, subLabel), /*#__PURE__*/React.createElement(Typography, {
|
|
34871
|
+
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
34872
|
+
component: "span",
|
|
34873
|
+
"data-cy": "".concat(dataCy, "-sub-link-count"),
|
|
34874
|
+
style: "body2"
|
|
34875
|
+
}, count > 999 ? "999+" : count));
|
|
34876
|
+
})));
|
|
34799
34877
|
}));
|
|
34800
34878
|
};
|
|
34801
34879
|
|
|
@@ -34814,15 +34892,27 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
34814
34892
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34815
34893
|
isAppSwitcherOpen = _useState2[0],
|
|
34816
34894
|
setIsAppSwitcherOpen = _useState2[1];
|
|
34895
|
+
var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
|
|
34896
|
+
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
34897
|
+
isSidebarCollapsed = _useLocalStorage2[0],
|
|
34898
|
+
setIsSidebarCollapsed = _useLocalStorage2[1];
|
|
34817
34899
|
var location = useLocation();
|
|
34900
|
+
var _useTranslation = useTranslation(),
|
|
34901
|
+
t = _useTranslation.t;
|
|
34818
34902
|
useEffect(function () {
|
|
34819
34903
|
isAppSwitcherOpen && setIsAppSwitcherOpen(false);
|
|
34820
34904
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34821
34905
|
}, [location]);
|
|
34906
|
+
var productName = globalProps$1.appName.substr(5).toLowerCase();
|
|
34822
34907
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
34908
|
+
"data-testid": "sidebar-container",
|
|
34909
|
+
className: classnames("neeto-molecules-sidebar__wrapper", {
|
|
34910
|
+
"neeto-molecules-sidebar__wrapper--collapsed": isSidebarCollapsed
|
|
34911
|
+
})
|
|
34912
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34913
|
+
className: "neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden",
|
|
34823
34914
|
"data-cy": "sidebar-wrapper",
|
|
34824
|
-
"data-testid": "sidebar"
|
|
34825
|
-
className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", "neeto-molecules-sidebar--collapsed")
|
|
34915
|
+
"data-testid": "sidebar"
|
|
34826
34916
|
}, /*#__PURE__*/React.createElement(Header$1, {
|
|
34827
34917
|
customLogo: customLogo
|
|
34828
34918
|
}), /*#__PURE__*/React.createElement(Links, {
|
|
@@ -34835,7 +34925,29 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
34835
34925
|
onAppSwitcherToggle: function onAppSwitcherToggle() {
|
|
34836
34926
|
return setIsAppSwitcherOpen(not);
|
|
34837
34927
|
}
|
|
34928
|
+
})), isSidebarCollapsed && /*#__PURE__*/React.createElement("div", {
|
|
34929
|
+
className: "neeto-molecules-sidebar__toggler-hover-area"
|
|
34930
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
34931
|
+
className: "neeto-molecules-sidebar__toggler",
|
|
34932
|
+
"data-cy": "neeto-molecules-sidebar-toggler",
|
|
34933
|
+
"data-testid": "sidebar-toggleButton",
|
|
34934
|
+
style: "text",
|
|
34935
|
+
icon: function icon() {
|
|
34936
|
+
return /*#__PURE__*/React.createElement(Chevron, {
|
|
34937
|
+
style: {
|
|
34938
|
+
color: "rgb(var(--neeto-".concat(productName, "-primary))")
|
|
34939
|
+
}
|
|
34940
|
+
});
|
|
34941
|
+
},
|
|
34942
|
+
tooltipProps: {
|
|
34943
|
+
content: isSidebarCollapsed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
|
|
34944
|
+
position: "bottom"
|
|
34945
|
+
},
|
|
34946
|
+
onClick: function onClick() {
|
|
34947
|
+
setIsSidebarCollapsed(!isSidebarCollapsed);
|
|
34948
|
+
}
|
|
34838
34949
|
})), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcher, {
|
|
34950
|
+
isSidebarCollapsed: isSidebarCollapsed,
|
|
34839
34951
|
isOpen: isAppSwitcherOpen,
|
|
34840
34952
|
onClose: function onClose() {
|
|
34841
34953
|
return setIsAppSwitcherOpen(false);
|