@bigbinary/neeto-molecules 1.0.67 → 1.0.69-beta
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/BrowserSupport.cjs.js +7 -3
- package/dist/BrowserSupport.cjs.js.map +1 -1
- package/dist/BrowserSupport.js +7 -3
- package/dist/BrowserSupport.js.map +1 -1
- package/dist/Container.cjs.js +1 -1
- package/dist/Container.js +1 -1
- package/dist/CustomDomainDashboard.cjs.js +11 -24
- package/dist/CustomDomainDashboard.cjs.js.map +1 -1
- package/dist/CustomDomainDashboard.js +12 -25
- package/dist/CustomDomainDashboard.js.map +1 -1
- package/dist/Header.cjs.js +10 -23
- package/dist/Header.cjs.js.map +1 -1
- package/dist/Header.js +12 -25
- package/dist/Header.js.map +1 -1
- package/dist/MenuBar.cjs.js +1 -1
- package/dist/MenuBar.js +1 -1
- package/dist/Sidebar.cjs.js +159 -98
- package/dist/Sidebar.cjs.js.map +1 -1
- package/dist/Sidebar.js +163 -102
- package/dist/Sidebar.js.map +1 -1
- package/package.json +2 -2
- package/src/translations/en.json +6 -2
- package/types/Sidebar.d.ts +1 -4
package/dist/Sidebar.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useEffect, Children, isValidElement, cloneElement, forwardRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Typography, Button, Input, Tooltip, Avatar } from '@bigbinary/neetoui';
|
|
2
|
+
import { NeetoIcon, Close, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down, SidebarOpen, SidebarClose } from '@bigbinary/neeto-icons';
|
|
3
|
+
import { Typography, Button, Input, Avatar, Tooltip } from '@bigbinary/neetoui';
|
|
4
|
+
import { toLower, mergeDeepLeft, all, curry, is, includes, __, not } from 'ramda';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import {
|
|
6
|
+
import { Link, useLocation, NavLink } from 'react-router-dom';
|
|
7
|
+
import { capitalize, truncate, _findBy } from '@bigbinary/neeto-commons-frontend/pure';
|
|
8
8
|
import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
|
|
9
9
|
import { t as t$1 } from 'i18next';
|
|
10
10
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
|
|
11
11
|
import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
|
|
12
|
-
import * as ProductLogos from '@bigbinary/neeto-icons/logos';
|
|
13
|
-
import { Neeto } from '@bigbinary/neeto-icons/logos';
|
|
12
|
+
import * as ProductLogos from '@bigbinary/neeto-icons/typeface-logos';
|
|
13
|
+
import { Neeto } from '@bigbinary/neeto-icons/typeface-logos';
|
|
14
14
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
15
15
|
|
|
16
16
|
function _arrayWithHoles(arr) {
|
|
@@ -31485,7 +31485,7 @@ SwitchTransition.defaultProps = {
|
|
|
31485
31485
|
|
|
31486
31486
|
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}}
|
|
31487
31487
|
|
|
31488
|
-
var css$1 = ".neeto-molecules-app-switcher__backdrop{align-items:center;background-color:rgba(27,31,35,.867);flex-direction:row;left:
|
|
31488
|
+
var css$1 = ".neeto-molecules-app-switcher__backdrop{align-items:center;background-color:rgba(27,31,35,.867);flex-direction:row;left:240px;overflow:hidden;position:fixed;top:0;width:100vw;z-index:99996}.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}.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:72px;position:relative;width:calc(100% - 240px)}.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__close-btn{position:absolute;right:24px;top:24px}.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}";
|
|
31489
31489
|
n(css$1,{});
|
|
31490
31490
|
|
|
31491
31491
|
function _extends() {
|
|
@@ -31714,51 +31714,14 @@ var AppSwitcher = function AppSwitcher(_ref) {
|
|
|
31714
31714
|
})))));
|
|
31715
31715
|
};
|
|
31716
31716
|
|
|
31717
|
-
var css = ".neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-
|
|
31717
|
+
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-z-index:99998}.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{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{left:calc(100% + 4px);position:absolute;top:32px;z-index:99996;z-index:calc(var(--neeto-molecules-sidebar-z-index) - 2)}.neeto-molecules-sidebar__header{margin-bottom:40px;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:8px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link:not(:first-child){margin-top:10px}.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-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;min-width:0;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.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--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;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}.neeto-molecules-sidebar__footer .neeto-molecules-sidebar__profile-name{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.neeto-molecules-sidebar__footer .neeto-molecules-sidebar__profile:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));text-decoration:none}.neeto-molecules-sidebar__footer .neeto-molecules-sidebar__profile:focus,.neeto-molecules-sidebar__footer .neeto-molecules-sidebar__profile:focus-visible,.neeto-molecules-sidebar__footer .neeto-molecules-sidebar__profile[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none;text-decoration:none}.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:var(--neeto-ui-shadow-xs)!important}.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-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}.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}";
|
|
31718
31718
|
n(css,{});
|
|
31719
31719
|
|
|
31720
|
-
var FeaturedTooltip = function FeaturedTooltip(_ref) {
|
|
31721
|
-
var label = _ref.label,
|
|
31722
|
-
description = _ref.description;
|
|
31723
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
31724
|
-
className: "neeto-ui-flex neeto-ui-flex-col sidebar-featured-tooltip"
|
|
31725
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
31726
|
-
className: "neeto-ui-text-center sidebar-featured-tooltip__title",
|
|
31727
|
-
lineHeight: "tight",
|
|
31728
|
-
style: "h5",
|
|
31729
|
-
weight: "semibold"
|
|
31730
|
-
}, label), description && /*#__PURE__*/React.createElement(Typography, {
|
|
31731
|
-
className: "neeto-ui-text-center neeto-ui-text-gray-400 sidebar-featured-tooltip__description",
|
|
31732
|
-
lineHeight: "normal",
|
|
31733
|
-
style: "body3"
|
|
31734
|
-
}, description));
|
|
31735
|
-
};
|
|
31736
|
-
var FeaturedTooltip$1 = /*#__PURE__*/React.memo(FeaturedTooltip);
|
|
31737
|
-
|
|
31738
|
-
var NavIconWrapper = function NavIconWrapper(_ref) {
|
|
31739
|
-
var description = _ref.description,
|
|
31740
|
-
label = _ref.label,
|
|
31741
|
-
children = _ref.children;
|
|
31742
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
31743
|
-
className: "sidebar-featured-tooltip__content",
|
|
31744
|
-
content: /*#__PURE__*/React.createElement(FeaturedTooltip$1, {
|
|
31745
|
-
description: description,
|
|
31746
|
-
label: label
|
|
31747
|
-
}),
|
|
31748
|
-
delay: [400, 40],
|
|
31749
|
-
distance: "20rem",
|
|
31750
|
-
duration: [200, 200],
|
|
31751
|
-
position: "right"
|
|
31752
|
-
}, children);
|
|
31753
|
-
};
|
|
31754
|
-
|
|
31755
31720
|
var AppSwitcherButton = function AppSwitcherButton(_ref) {
|
|
31756
31721
|
var onAppSwitcherToggle = _ref.onAppSwitcherToggle;
|
|
31757
31722
|
var _useTranslation = useTranslation(),
|
|
31758
31723
|
t = _useTranslation.t;
|
|
31759
|
-
return /*#__PURE__*/React.createElement(
|
|
31760
|
-
label: t("neetoMolecules.sidebar.productSwitcher")
|
|
31761
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
31724
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
31762
31725
|
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",
|
|
31763
31726
|
"data-cy": "app-switcher-button",
|
|
31764
31727
|
onClick: onAppSwitcherToggle
|
|
@@ -31766,7 +31729,12 @@ var AppSwitcherButton = function AppSwitcherButton(_ref) {
|
|
|
31766
31729
|
className: "neeto-molecules-sidebar__link-icon neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center"
|
|
31767
31730
|
}, /*#__PURE__*/React.createElement(AppSwitcher$1, {
|
|
31768
31731
|
size: 24
|
|
31769
|
-
}))
|
|
31732
|
+
})), /*#__PURE__*/React.createElement(Typography, {
|
|
31733
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
31734
|
+
component: "span",
|
|
31735
|
+
style: "body2",
|
|
31736
|
+
weight: "normal"
|
|
31737
|
+
}, t("neetoMolecules.sidebar.productSwitcher")));
|
|
31770
31738
|
};
|
|
31771
31739
|
|
|
31772
31740
|
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
@@ -31784,7 +31752,7 @@ var DEFAULT_HELP_LINK_PROPS = {
|
|
|
31784
31752
|
}
|
|
31785
31753
|
},
|
|
31786
31754
|
helpCenterProps: {
|
|
31787
|
-
label: t$1("neetoMolecules.sidebar.helpLinks.
|
|
31755
|
+
label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
31788
31756
|
icon: Book,
|
|
31789
31757
|
"data-cy": "help-link-help-center-button",
|
|
31790
31758
|
href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
|
|
@@ -31837,24 +31805,26 @@ var getProfileInfo = function getProfileInfo(profileInfoOverrides) {
|
|
|
31837
31805
|
};
|
|
31838
31806
|
|
|
31839
31807
|
var HelpSection = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31840
|
-
|
|
31808
|
+
_ref.changesCount;
|
|
31809
|
+
var _useTranslation = useTranslation(),
|
|
31810
|
+
t = _useTranslation.t;
|
|
31811
|
+
var showChangesCount = false;
|
|
31841
31812
|
return /*#__PURE__*/React.createElement("button", {
|
|
31842
|
-
className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none",
|
|
31813
|
+
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",
|
|
31843
31814
|
"data-cy": "help-button",
|
|
31844
31815
|
ref: ref
|
|
31845
31816
|
}, /*#__PURE__*/React.createElement("span", {
|
|
31846
31817
|
className: "neeto-molecules-sidebar__link-icon neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center"
|
|
31847
31818
|
}, /*#__PURE__*/React.createElement(Help, {
|
|
31848
31819
|
size: 24
|
|
31849
|
-
}),
|
|
31850
|
-
className: "neeto-molecules-
|
|
31851
|
-
|
|
31852
|
-
|
|
31820
|
+
}), showChangesCount ), /*#__PURE__*/React.createElement(Typography, {
|
|
31821
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
31822
|
+
component: "span",
|
|
31823
|
+
style: "body2",
|
|
31824
|
+
weight: "normal"
|
|
31825
|
+
}, t("neetoMolecules.sidebar.helpLinks.helpCenter")));
|
|
31853
31826
|
});
|
|
31854
31827
|
HelpSection.displayName = "HelpSection";
|
|
31855
|
-
HelpSection.propTypes = {
|
|
31856
|
-
changesCount: propTypes.exports.number
|
|
31857
|
-
};
|
|
31858
31828
|
|
|
31859
31829
|
function _typeof(obj) {
|
|
31860
31830
|
"@babel/helpers - typeof";
|
|
@@ -31901,51 +31871,58 @@ var _excluded$2 = ["label"];
|
|
|
31901
31871
|
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; }
|
|
31902
31872
|
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; }
|
|
31903
31873
|
var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
31904
|
-
var helpLinkOverrides = _ref.helpLinkOverrides
|
|
31874
|
+
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
31875
|
+
changesCount = _ref.changesCount;
|
|
31905
31876
|
var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
|
|
31906
31877
|
_KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
|
|
31907
31878
|
setIsOpen = _KeyboardShortcuts$us2[1];
|
|
31879
|
+
var showChangesCount = false;
|
|
31908
31880
|
var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).map(function (key) {
|
|
31909
|
-
return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
31881
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
31910
31882
|
onClick: function onClick() {
|
|
31911
31883
|
return setIsOpen(true);
|
|
31912
31884
|
}
|
|
31885
|
+
}), key === "changelogProps" && changesCount && {
|
|
31886
|
+
changesCount: changesCount
|
|
31913
31887
|
});
|
|
31914
31888
|
}).filter(function (_ref2) {
|
|
31915
31889
|
var hide = _ref2.hide;
|
|
31916
31890
|
return !hide;
|
|
31917
31891
|
});
|
|
31918
|
-
return /*#__PURE__*/React.createElement("ul",
|
|
31892
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
31893
|
+
className: "neeto-molecules-help-sublist"
|
|
31894
|
+
}, helpLinks.map(function (_ref3, idx) {
|
|
31919
31895
|
var label = _ref3.label,
|
|
31920
31896
|
buttonProps = _objectWithoutProperties(_ref3, _excluded$2);
|
|
31921
31897
|
return /*#__PURE__*/React.createElement("li", {
|
|
31922
31898
|
className: "neeto-molecules-help-sublist__item",
|
|
31923
31899
|
key: idx
|
|
31924
31900
|
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
31901
|
+
fullWidth: true,
|
|
31925
31902
|
className: "neeto-molecules-help-sublist__item-btn",
|
|
31926
31903
|
iconPosition: "left",
|
|
31927
31904
|
iconSize: 18,
|
|
31928
31905
|
style: "text"
|
|
31929
|
-
}, buttonProps), label,
|
|
31930
|
-
className: "neeto-molecules-help-sublist__item-btn-count",
|
|
31931
|
-
"data-testid": "help-section-menu-changes-count"
|
|
31932
|
-
}, buttonProps.changesCount)));
|
|
31906
|
+
}, buttonProps), label, showChangesCount ));
|
|
31933
31907
|
}));
|
|
31934
31908
|
};
|
|
31935
31909
|
|
|
31936
31910
|
var ProfileSection = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31937
31911
|
var profileInfo = _ref.profileInfo;
|
|
31938
31912
|
return /*#__PURE__*/React.createElement("button", {
|
|
31939
|
-
className: "neeto-molecules-sidebar__profile-
|
|
31913
|
+
className: "neeto-molecules-sidebar__profile neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
31940
31914
|
"data-cy": "profile-section",
|
|
31941
31915
|
ref: ref
|
|
31942
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
31943
|
-
className: "neeto-molecules-sidebar__profile neeto-ui-flex neeto-ui-w-full neeto-ui-flex-shrink-0 neeto-ui-items-center"
|
|
31944
31916
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
31945
|
-
className: "neeto-ui-flex-shrink-0",
|
|
31946
|
-
size: "
|
|
31917
|
+
className: "neeto-ui-flex-shrink-0 neeto-molecules-sidebar__profile-avatar",
|
|
31918
|
+
size: "small",
|
|
31947
31919
|
user: profileInfo
|
|
31948
|
-
})
|
|
31920
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
31921
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
31922
|
+
component: "span",
|
|
31923
|
+
style: "body2",
|
|
31924
|
+
weight: "normal"
|
|
31925
|
+
}, truncate(profileInfo.name, 18)));
|
|
31949
31926
|
});
|
|
31950
31927
|
ProfileSection.displayName = "ProfileSection";
|
|
31951
31928
|
|
|
@@ -31976,22 +31953,19 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
31976
31953
|
_ref2$icon = _ref2.icon,
|
|
31977
31954
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
31978
31955
|
otherProps = _objectWithoutProperties(_ref2, _excluded$1);
|
|
31979
|
-
var IconSVG = icon;
|
|
31980
31956
|
return /*#__PURE__*/React.createElement("li", {
|
|
31981
31957
|
className: "neeto-molecules-profile-sublist__item",
|
|
31982
31958
|
key: idx
|
|
31983
|
-
}, /*#__PURE__*/React.createElement(
|
|
31959
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
31960
|
+
fullWidth: true,
|
|
31961
|
+
className: "neeto-molecules-profile-sublist__item-btn",
|
|
31962
|
+
icon: icon,
|
|
31963
|
+
iconPosition: "left",
|
|
31964
|
+
iconSize: 18,
|
|
31965
|
+
label: label,
|
|
31966
|
+
style: "text",
|
|
31984
31967
|
onClick: onClick
|
|
31985
|
-
}, otherProps
|
|
31986
|
-
className: "neeto-molecules-profile-sublist__item-btn"
|
|
31987
|
-
}), icon && /*#__PURE__*/React.createElement("span", {
|
|
31988
|
-
className: "neeto-molecules-profile-sublist__item-btn-icon"
|
|
31989
|
-
}, /*#__PURE__*/React.createElement(IconSVG, null)), /*#__PURE__*/React.createElement(Typography, {
|
|
31990
|
-
className: "neeto-molecules-profile-sublist__item-btn-label",
|
|
31991
|
-
component: "span",
|
|
31992
|
-
style: "body2",
|
|
31993
|
-
weight: "normal"
|
|
31994
|
-
}, label)));
|
|
31968
|
+
}, otherProps)));
|
|
31995
31969
|
}));
|
|
31996
31970
|
};
|
|
31997
31971
|
|
|
@@ -32035,7 +32009,6 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
32035
32009
|
};
|
|
32036
32010
|
|
|
32037
32011
|
var Footer = function Footer(_ref) {
|
|
32038
|
-
var _helpLinkOverrides$ch;
|
|
32039
32012
|
var extraTopLinks = _ref.extraTopLinks,
|
|
32040
32013
|
helpLinkOverrides = _ref.helpLinkOverrides,
|
|
32041
32014
|
profileInfoOverrides = _ref.profileInfoOverrides,
|
|
@@ -32043,16 +32016,35 @@ var Footer = function Footer(_ref) {
|
|
|
32043
32016
|
showAppSwitcher = _ref$showAppSwitcher === void 0 ? false : _ref$showAppSwitcher,
|
|
32044
32017
|
onAppSwitcherToggle = _ref.onAppSwitcherToggle;
|
|
32045
32018
|
var profileInfo = getProfileInfo(profileInfoOverrides);
|
|
32046
|
-
var
|
|
32019
|
+
var _useState = useState(null),
|
|
32020
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32021
|
+
changesCount = _useState2[0],
|
|
32022
|
+
setChangesCount = _useState2[1];
|
|
32023
|
+
useEffect(function () {
|
|
32024
|
+
var Nv = {
|
|
32025
|
+
onReceiveData: function onReceiveData(data) {
|
|
32026
|
+
if (data.unreadCount) {
|
|
32027
|
+
setChangesCount(data.unreadCount);
|
|
32028
|
+
}
|
|
32029
|
+
},
|
|
32030
|
+
onShow: function onShow() {
|
|
32031
|
+
setChangesCount(null);
|
|
32032
|
+
}
|
|
32033
|
+
};
|
|
32034
|
+
window.Nv = window.Nv ? Object.assign(window.Nv, Nv) : Nv;
|
|
32035
|
+
}, []);
|
|
32047
32036
|
return /*#__PURE__*/React.createElement("div", {
|
|
32048
|
-
className: "neeto-molecules-sidebar__footer"
|
|
32037
|
+
className: "neeto-molecules-sidebar__footer neeto-molecules-sidebar__no-shrinkable"
|
|
32049
32038
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
32050
32039
|
interactive: true,
|
|
32051
32040
|
className: "neeto-molecules-help-popup-wrapper",
|
|
32052
32041
|
content: /*#__PURE__*/React.createElement(HelpSectionMenu, {
|
|
32042
|
+
changesCount: changesCount,
|
|
32053
32043
|
helpLinkOverrides: helpLinkOverrides
|
|
32054
32044
|
}),
|
|
32055
32045
|
hideOnClick: false,
|
|
32046
|
+
interactiveDebounce: 30,
|
|
32047
|
+
offset: 0,
|
|
32056
32048
|
position: "right",
|
|
32057
32049
|
theme: "light"
|
|
32058
32050
|
}, /*#__PURE__*/React.createElement(HelpSection, {
|
|
@@ -32063,6 +32055,8 @@ var Footer = function Footer(_ref) {
|
|
|
32063
32055
|
interactive: true,
|
|
32064
32056
|
className: "neeto-molecules-profile-popup-wrapper",
|
|
32065
32057
|
hideOnClick: false,
|
|
32058
|
+
interactiveDebounce: 30,
|
|
32059
|
+
offset: 0,
|
|
32066
32060
|
position: "right",
|
|
32067
32061
|
theme: "light",
|
|
32068
32062
|
content: /*#__PURE__*/React.createElement(ProfileMenu, {
|
|
@@ -32082,17 +32076,30 @@ var Header = function Header() {
|
|
|
32082
32076
|
name: globalProps.appName.split("neeto")[1]
|
|
32083
32077
|
}, globalProps.neetoApps)) === null || _findBy2 === void 0 ? void 0 : _findBy2.url) !== null && _findBy$url !== void 0 ? _findBy$url : window.location.origin);
|
|
32084
32078
|
return /*#__PURE__*/React.createElement("div", {
|
|
32085
|
-
className: "neeto-
|
|
32079
|
+
className: "neeto-molecules-sidebar__header neeto-molecules-sidebar__no-shrinkable",
|
|
32086
32080
|
"data-cy": "sidebar-info"
|
|
32087
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
32088
|
-
className: "neeto-molecules-sidebar__logo flex flex-shrink-0 items-center justify-center"
|
|
32089
32081
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
32082
|
+
className: "neeto-molecules-sidebar__logo neeto-ui-w-full",
|
|
32090
32083
|
to: homeUrl.pathname
|
|
32091
|
-
}, ProductLogo ? /*#__PURE__*/React.createElement(ProductLogo, null) : /*#__PURE__*/React.createElement(Neeto, null)))
|
|
32084
|
+
}, ProductLogo ? /*#__PURE__*/React.createElement(ProductLogo, null) : /*#__PURE__*/React.createElement(Neeto, null)));
|
|
32092
32085
|
};
|
|
32093
32086
|
var Header$1 = /*#__PURE__*/React.memo(Header);
|
|
32094
32087
|
|
|
32095
|
-
var
|
|
32088
|
+
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
32089
|
+
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
32090
|
+
var targetUrl = new URL(subRoute, window.location.origin);
|
|
32091
|
+
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
32092
|
+
return false;
|
|
32093
|
+
}
|
|
32094
|
+
var targetSearchParams = targetUrl.searchParams;
|
|
32095
|
+
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
32096
|
+
return all(function (key) {
|
|
32097
|
+
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
32098
|
+
}, targetSearchKeys);
|
|
32099
|
+
};
|
|
32100
|
+
|
|
32101
|
+
var _excluded = ["label", "to", "icon", "items"],
|
|
32102
|
+
_excluded2 = ["label", "to", "count"];
|
|
32096
32103
|
var Links = function Links(_ref) {
|
|
32097
32104
|
var navLinks = _ref.navLinks;
|
|
32098
32105
|
var location = useLocation();
|
|
@@ -32104,31 +32111,64 @@ var Links = function Links(_ref) {
|
|
|
32104
32111
|
return true;
|
|
32105
32112
|
});
|
|
32106
32113
|
return /*#__PURE__*/React.createElement("div", {
|
|
32107
|
-
className: "neeto-molecules-sidebar__links"
|
|
32114
|
+
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
32108
32115
|
}, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
|
|
32109
32116
|
var label = _ref3.label,
|
|
32110
32117
|
to = _ref3.to,
|
|
32111
32118
|
icon = _ref3.icon,
|
|
32112
|
-
|
|
32119
|
+
items = _ref3.items,
|
|
32113
32120
|
otherProps = _objectWithoutProperties(_ref3, _excluded);
|
|
32114
32121
|
var IconSVG = icon;
|
|
32115
32122
|
var url = new URL(to, window.location.href);
|
|
32116
32123
|
var isActive = function isActive() {
|
|
32117
32124
|
return location.pathname.startsWith(url.pathname);
|
|
32118
32125
|
};
|
|
32119
|
-
return /*#__PURE__*/React.createElement(
|
|
32120
|
-
|
|
32121
|
-
key: mainIndex,
|
|
32122
|
-
label: label
|
|
32126
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
32127
|
+
key: mainIndex
|
|
32123
32128
|
}, /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
32124
32129
|
activeClassName: "active",
|
|
32125
32130
|
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
32126
32131
|
isActive: isActive,
|
|
32127
32132
|
to: to
|
|
32128
|
-
}, otherProps), icon && /*#__PURE__*/React.createElement("
|
|
32129
|
-
className: "neeto-
|
|
32133
|
+
}, otherProps), icon && /*#__PURE__*/React.createElement("span", {
|
|
32134
|
+
className: "neeto-molecules-sidebar__link-icon",
|
|
32130
32135
|
"data-testid": label
|
|
32131
|
-
}, /*#__PURE__*/React.createElement(IconSVG, null))
|
|
32136
|
+
}, /*#__PURE__*/React.createElement(IconSVG, null)), /*#__PURE__*/React.createElement(Typography, {
|
|
32137
|
+
className: "neeto-molecules-sidebar__link-label",
|
|
32138
|
+
component: "span",
|
|
32139
|
+
style: "body2",
|
|
32140
|
+
weight: "normal"
|
|
32141
|
+
}, label), items && /*#__PURE__*/React.createElement("span", {
|
|
32142
|
+
className: classnames("neeto-molecules-sidebar__link-icon", {
|
|
32143
|
+
"neeto-molecules-sidebar__link-icon--rotate": isActive()
|
|
32144
|
+
})
|
|
32145
|
+
}, /*#__PURE__*/React.createElement(Down, {
|
|
32146
|
+
size: 16
|
|
32147
|
+
}))), items && isActive() && /*#__PURE__*/React.createElement("div", {
|
|
32148
|
+
className: "neeto-molecules-sidebar__sublink-wrapper"
|
|
32149
|
+
}, items.map(function (_ref4, subIndex) {
|
|
32150
|
+
var subLabel = _ref4.label,
|
|
32151
|
+
subRoute = _ref4.to,
|
|
32152
|
+
count = _ref4.count,
|
|
32153
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded2);
|
|
32154
|
+
return /*#__PURE__*/React.createElement(NavLink, _extends({
|
|
32155
|
+
activeClassName: "active",
|
|
32156
|
+
className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
|
|
32157
|
+
isActive: function isActive() {
|
|
32158
|
+
return isSubRouteActive(subRoute, location);
|
|
32159
|
+
},
|
|
32160
|
+
key: subIndex,
|
|
32161
|
+
to: subRoute
|
|
32162
|
+
}, otherProps), /*#__PURE__*/React.createElement(Typography, {
|
|
32163
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
32164
|
+
component: "span",
|
|
32165
|
+
style: "body2"
|
|
32166
|
+
}, subLabel), /*#__PURE__*/React.createElement(Typography, {
|
|
32167
|
+
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
32168
|
+
component: "span",
|
|
32169
|
+
style: "body2"
|
|
32170
|
+
}, count));
|
|
32171
|
+
})));
|
|
32132
32172
|
}));
|
|
32133
32173
|
};
|
|
32134
32174
|
|
|
@@ -32146,15 +32186,25 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
32146
32186
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32147
32187
|
isAppSwitcherOpen = _useState2[0],
|
|
32148
32188
|
setIsAppSwitcherOpen = _useState2[1];
|
|
32189
|
+
var _useState3 = useState(false),
|
|
32190
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32191
|
+
isSidebarCollapsed = _useState4[0],
|
|
32192
|
+
setIsSidebarCollapsed = _useState4[1];
|
|
32149
32193
|
var location = useLocation();
|
|
32194
|
+
var _useTranslation = useTranslation(),
|
|
32195
|
+
t = _useTranslation.t;
|
|
32150
32196
|
useEffect(function () {
|
|
32151
32197
|
isAppSwitcherOpen && setIsAppSwitcherOpen(false);
|
|
32152
32198
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32153
32199
|
}, [location]);
|
|
32154
32200
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
32201
|
+
className: classnames("neeto-molecules-sidebar__wrapper", {
|
|
32202
|
+
"neeto-molecules-sidebar__wrapper--collapsed": isSidebarCollapsed
|
|
32203
|
+
})
|
|
32204
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32205
|
+
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",
|
|
32155
32206
|
"data-cy": "sidebar-wrapper",
|
|
32156
|
-
"data-testid": "sidebar"
|
|
32157
|
-
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")
|
|
32207
|
+
"data-testid": "sidebar"
|
|
32158
32208
|
}, /*#__PURE__*/React.createElement(Header$1, null), /*#__PURE__*/React.createElement(Links, {
|
|
32159
32209
|
navLinks: navLinks
|
|
32160
32210
|
}), /*#__PURE__*/React.createElement(Footer, {
|
|
@@ -32165,6 +32215,17 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
32165
32215
|
onAppSwitcherToggle: function onAppSwitcherToggle() {
|
|
32166
32216
|
return setIsAppSwitcherOpen(not);
|
|
32167
32217
|
}
|
|
32218
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
32219
|
+
className: "neeto-molecules-sidebar__toggler",
|
|
32220
|
+
icon: isSidebarCollapsed ? SidebarOpen : SidebarClose,
|
|
32221
|
+
style: "text",
|
|
32222
|
+
tooltipProps: {
|
|
32223
|
+
content: isSidebarCollapsed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
|
|
32224
|
+
position: "bottom"
|
|
32225
|
+
},
|
|
32226
|
+
onClick: function onClick() {
|
|
32227
|
+
return setIsSidebarCollapsed(!isSidebarCollapsed);
|
|
32228
|
+
}
|
|
32168
32229
|
})), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcher, {
|
|
32169
32230
|
isOpen: isAppSwitcherOpen,
|
|
32170
32231
|
onClose: function onClose() {
|