@bigbinary/neeto-molecules 1.3.18 → 1.3.19-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/README.md +3 -1
- package/dist/Columns.js +125 -34
- package/dist/Columns.js.map +1 -1
- package/dist/ConfigurePageSidebar.js +284 -0
- package/dist/ConfigurePageSidebar.js.map +1 -0
- package/dist/Metadata.js +3 -1
- package/dist/Metadata.js.map +1 -1
- package/dist/Sidebar.js +242 -122
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/Columns.js +128 -32
- package/dist/cjs/Columns.js.map +1 -1
- package/dist/cjs/ConfigurePageSidebar.js +291 -0
- package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/Metadata.js +3 -1
- package/dist/cjs/Metadata.js.map +1 -1
- package/dist/cjs/Sidebar.js +239 -119
- package/dist/cjs/Sidebar.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +2 -1
- package/types/Columns.d.ts +31 -4
- package/types/ConfigurePageSidebar.d.ts +56 -0
package/dist/cjs/Sidebar.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
6
|
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
6
7
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
7
8
|
var neetoui = require('@bigbinary/neetoui');
|
|
8
9
|
var ramda = require('ramda');
|
|
9
10
|
var reactI18next = require('react-i18next');
|
|
10
11
|
var reactRouterDom = require('react-router-dom');
|
|
12
|
+
var i18next = require('i18next');
|
|
11
13
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
12
|
-
var neetoCist = require('@bigbinary/neeto-cist');
|
|
13
14
|
var AppIcons = require('@bigbinary/neeto-icons/app-icons');
|
|
14
|
-
var i18next = require('i18next');
|
|
15
15
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
16
16
|
var KeyboardShortcuts = require('@bigbinary/neeto-molecules/KeyboardShortcuts');
|
|
17
17
|
var ProductTypefaceLogos = require('@bigbinary/neeto-icons/typeface-logos');
|
|
@@ -110,6 +110,48 @@ var Chevron = function Chevron(_ref) {
|
|
|
110
110
|
}));
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
var shouldShowWhatsNew = function shouldShowWhatsNew() {
|
|
114
|
+
var _window$globalProps, _window$globalProps$u;
|
|
115
|
+
var currentUserEmail = (_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.email;
|
|
116
|
+
return window.location.hostname === "localhost" || currentUserEmail === "oliver@example.com" || (currentUserEmail === null || currentUserEmail === void 0 ? void 0 : currentUserEmail.endsWith("@bigbinary.com"));
|
|
117
|
+
};
|
|
118
|
+
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
119
|
+
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
120
|
+
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
121
|
+
var DEFAULT_HELP_LINK_PROPS = {
|
|
122
|
+
liveChatProps: {
|
|
123
|
+
label: i18next.t("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
124
|
+
icon: neetoIcons.ChatEmpty,
|
|
125
|
+
"data-cy": "help-link-live-chat-button",
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
128
|
+
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
|
|
129
|
+
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
helpCenterProps: {
|
|
133
|
+
label: i18next.t("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
134
|
+
icon: neetoIcons.Book,
|
|
135
|
+
"data-cy": "help-link-help-center-button",
|
|
136
|
+
href: "https://help.".concat(ramda.toLower(globalProps.appName), ".com/"),
|
|
137
|
+
target: "_blank"
|
|
138
|
+
},
|
|
139
|
+
changelogProps: {
|
|
140
|
+
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
141
|
+
label: i18next.t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
142
|
+
icon: neetoIcons.Gift,
|
|
143
|
+
"data-cy": "help-link-changelog-button",
|
|
144
|
+
isVisible: shouldShowWhatsNew
|
|
145
|
+
},
|
|
146
|
+
keyboardShortcutProps: {
|
|
147
|
+
label: i18next.t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
148
|
+
icon: neetoIcons.Keyboard,
|
|
149
|
+
"data-cy": "help-link-keyboard-shortcut-button"
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var NAVLINK_KEYS_TO_OMIT = ["Component", "component"];
|
|
153
|
+
var SETTINGS = "Settings";
|
|
154
|
+
|
|
113
155
|
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}}
|
|
114
156
|
|
|
115
157
|
var css$1 = ".neeto-molecules-app-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}@media screen and (max-width:768px){.neeto-molecules-app-switcher__wrapper{padding:16px}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:24px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.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}";
|
|
@@ -224,7 +266,7 @@ var AppSwitcher = function AppSwitcher() {
|
|
|
224
266
|
}, /*#__PURE__*/React__default["default"].createElement(Body, null));
|
|
225
267
|
};
|
|
226
268
|
|
|
227
|
-
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--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}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.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)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;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)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-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{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.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-app-switcher-popup-wrapper,.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-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.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}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}";
|
|
269
|
+
var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-wrapper-z-index:99997;--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}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:240px}}.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)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper--configure-page{position:relative;transition:all .15s}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar,.neeto-molecules-sidebar__wrapper--configure-page{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;position:fixed;top:0;transition:none}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar--configure-page{max-width:100%;position:static;transition:all .15s;width:100%}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:8px;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-240px;left:calc(var(--neeto-molecules-sidebar-width)*-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{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:202px;left:calc(var(--neeto-molecules-sidebar-width) - 38px);right:auto;transition:none}}.neeto-molecules-sidebar--configure-page{height:auto}.neeto-molecules-sidebar--configure-page .neeto-molecules-sidebar__toggler{display:none}.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-app-switcher-popup-wrapper,.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-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.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}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-app-switcher-popup-wrapper{width:calc(100vw - 185px)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode{padding-top:0}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__header{padding-top:24px}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__links{margin-bottom:0}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink-wrapper{margin:0!important;padding:0!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link{--neeto-ui-text-body2:16px;gap:4px;padding:12px 4px;position:sticky;top:0;z-index:1}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:15px;border-top:1px solid rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);margin-bottom:0!important;padding-bottom:8px!important;padding-top:8px!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{--neeto-ui-text-body2:13px;padding-left:40px!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink{margin-bottom:4px;padding:4px 4px 4px 30px!important;position:relative}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink:hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active{background-color:rgb(var(--neeto-ui-primary-100))!important}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active:before{background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded);content:\"\";height:100%;left:-1px;position:absolute;top:0;width:3px}";
|
|
228
270
|
n(css,{});
|
|
229
271
|
|
|
230
272
|
var AppSwitcherButton = function AppSwitcherButton() {
|
|
@@ -275,63 +317,39 @@ var AppSwitcherButton = function AppSwitcherButton() {
|
|
|
275
317
|
}, t("neetoMolecules.sidebar.productSwitcher"))));
|
|
276
318
|
};
|
|
277
319
|
|
|
278
|
-
var
|
|
279
|
-
var
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
var MY_PROFILE_URL = "/auth/profile/edit";
|
|
284
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
285
|
-
var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
|
|
286
|
-
var DEFAULT_HELP_LINK_PROPS = {
|
|
287
|
-
liveChatProps: {
|
|
288
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.liveChat"),
|
|
289
|
-
icon: neetoIcons.ChatEmpty,
|
|
290
|
-
"data-cy": "help-link-live-chat-button",
|
|
291
|
-
onClick: function onClick() {
|
|
292
|
-
var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
|
|
293
|
-
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
|
|
294
|
-
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
helpCenterProps: {
|
|
298
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.helpArticles"),
|
|
299
|
-
icon: neetoIcons.Book,
|
|
300
|
-
"data-cy": "help-link-help-center-button",
|
|
301
|
-
href: "https://help.".concat(ramda.toLower(globalProps.appName), ".com/"),
|
|
302
|
-
target: "_blank"
|
|
303
|
-
},
|
|
304
|
-
changelogProps: {
|
|
305
|
-
id: CHANGELOG_WIDGET_TRIGGER_ID,
|
|
306
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
307
|
-
icon: neetoIcons.Gift,
|
|
308
|
-
"data-cy": "help-link-changelog-button",
|
|
309
|
-
isVisible: shouldShowWhatsNew
|
|
310
|
-
},
|
|
311
|
-
keyboardShortcutProps: {
|
|
312
|
-
label: i18next.t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
313
|
-
icon: neetoIcons.Keyboard,
|
|
314
|
-
"data-cy": "help-link-keyboard-shortcut-button"
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
var isSubRouteActive = function isSubRouteActive(subRoute, location) {
|
|
319
|
-
var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
|
|
320
|
+
var isSubRouteActive = function isSubRouteActive(_ref) {
|
|
321
|
+
var subRoute = _ref.subRoute,
|
|
322
|
+
location = _ref.location,
|
|
323
|
+
isSettingsItems = _ref.isSettingsItems;
|
|
324
|
+
var currentBrowserUrl = new URL(location.pathname + location.search + location.hash, window.location.origin);
|
|
320
325
|
var targetUrl = new URL(subRoute, window.location.origin);
|
|
321
326
|
if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
|
|
322
327
|
return false;
|
|
323
328
|
}
|
|
324
329
|
var targetSearchParams = targetUrl.searchParams;
|
|
325
330
|
var targetSearchKeys = Array.from(targetSearchParams.keys());
|
|
326
|
-
|
|
331
|
+
var targetUrlWithSearch = targetUrl.pathname + targetUrl.search + targetUrl.hash;
|
|
332
|
+
var currentUrlWithSearch = currentBrowserUrl.pathname + currentBrowserUrl.search + currentBrowserUrl.hash;
|
|
333
|
+
var isLinkActive = ramda.all(function (key) {
|
|
327
334
|
return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
|
|
328
|
-
}, targetSearchKeys);
|
|
335
|
+
}, targetSearchKeys) && ramda.equals(currentBrowserUrl.hash, targetUrl.hash);
|
|
336
|
+
if (isSettingsItems) {
|
|
337
|
+
return isLinkActive && ramda.equals(currentUrlWithSearch, targetUrlWithSearch);
|
|
338
|
+
}
|
|
339
|
+
return isLinkActive;
|
|
329
340
|
};
|
|
330
341
|
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
331
342
|
var _globalProps$user, _globalProps$user2;
|
|
332
343
|
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);
|
|
333
344
|
return "sidebarState-".concat(user);
|
|
334
345
|
};
|
|
346
|
+
var filterByPermissions = ramda.curry(function (_ref2) {
|
|
347
|
+
var permissions = _ref2.permissions;
|
|
348
|
+
if (permissions) {
|
|
349
|
+
return ramda.is(Array, permissions) ? permissions.some(ramda.includes(ramda.__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
|
|
350
|
+
}
|
|
351
|
+
return true;
|
|
352
|
+
});
|
|
335
353
|
|
|
336
354
|
var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
|
|
337
355
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
@@ -490,9 +508,9 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
490
508
|
return target;
|
|
491
509
|
}
|
|
492
510
|
|
|
493
|
-
var _excluded$
|
|
494
|
-
function ownKeys$
|
|
495
|
-
function _objectSpread$
|
|
511
|
+
var _excluded$4 = ["onClick", "label", "icon"];
|
|
512
|
+
function ownKeys$3(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; }
|
|
513
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
496
514
|
var LinkSection = function LinkSection(_ref) {
|
|
497
515
|
var links = _ref.links;
|
|
498
516
|
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
@@ -502,7 +520,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
502
520
|
label = _ref2.label,
|
|
503
521
|
_ref2$icon = _ref2.icon,
|
|
504
522
|
icon = _ref2$icon === void 0 ? null : _ref2$icon,
|
|
505
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$
|
|
523
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$4);
|
|
506
524
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
507
525
|
className: "neeto-molecules-profile-sublist__item",
|
|
508
526
|
key: idx
|
|
@@ -512,7 +530,7 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
512
530
|
iconPosition: "left",
|
|
513
531
|
iconSize: 18,
|
|
514
532
|
style: "text"
|
|
515
|
-
}, _objectSpread$
|
|
533
|
+
}, _objectSpread$3({
|
|
516
534
|
icon: icon,
|
|
517
535
|
label: label,
|
|
518
536
|
onClick: onClick
|
|
@@ -615,9 +633,9 @@ var HelpSection = function HelpSection(_ref, ref) {
|
|
|
615
633
|
};
|
|
616
634
|
var HelpSection$1 = /*#__PURE__*/React.forwardRef(HelpSection);
|
|
617
635
|
|
|
618
|
-
var _excluded$
|
|
619
|
-
function ownKeys$
|
|
620
|
-
function _objectSpread$
|
|
636
|
+
var _excluded$3 = ["label"];
|
|
637
|
+
function ownKeys$2(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; }
|
|
638
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
621
639
|
var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
622
640
|
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
623
641
|
changesCount = _ref.changesCount;
|
|
@@ -628,7 +646,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
628
646
|
var _DEFAULT_HELP_LINK_PR, _DEFAULT_HELP_LINK_PR2, _DEFAULT_HELP_LINK_PR3;
|
|
629
647
|
return (_DEFAULT_HELP_LINK_PR = (_DEFAULT_HELP_LINK_PR2 = (_DEFAULT_HELP_LINK_PR3 = DEFAULT_HELP_LINK_PROPS[key]).isVisible) === null || _DEFAULT_HELP_LINK_PR2 === void 0 ? void 0 : _DEFAULT_HELP_LINK_PR2.call(_DEFAULT_HELP_LINK_PR3)) !== null && _DEFAULT_HELP_LINK_PR !== void 0 ? _DEFAULT_HELP_LINK_PR : true;
|
|
630
648
|
}).map(function (key) {
|
|
631
|
-
return _objectSpread$
|
|
649
|
+
return _objectSpread$2(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
|
|
632
650
|
onClick: function onClick() {
|
|
633
651
|
return setIsOpen(true);
|
|
634
652
|
}
|
|
@@ -643,7 +661,7 @@ var HelpSectionMenu = function HelpSectionMenu(_ref) {
|
|
|
643
661
|
className: "neeto-molecules-help-sublist"
|
|
644
662
|
}, helpLinks.map(function (_ref3, idx) {
|
|
645
663
|
var label = _ref3.label,
|
|
646
|
-
buttonProps = _objectWithoutProperties(_ref3, _excluded$
|
|
664
|
+
buttonProps = _objectWithoutProperties(_ref3, _excluded$3);
|
|
647
665
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
648
666
|
className: "neeto-molecules-help-sublist__item",
|
|
649
667
|
key: idx
|
|
@@ -735,26 +753,74 @@ var Header = function Header(_ref) {
|
|
|
735
753
|
};
|
|
736
754
|
var Header$1 = /*#__PURE__*/React__default["default"].memo(Header);
|
|
737
755
|
|
|
738
|
-
var _excluded = ["label", "to", "
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
756
|
+
var _excluded$2 = ["label", "to", "count", "dataCy", "items"];
|
|
757
|
+
var Items = function Items(_ref) {
|
|
758
|
+
var items = _ref.items,
|
|
759
|
+
_ref$level = _ref.level,
|
|
760
|
+
level = _ref$level === void 0 ? 0 : _ref$level,
|
|
761
|
+
_ref$isSettingsItems = _ref.isSettingsItems,
|
|
762
|
+
isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems;
|
|
763
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
764
|
+
className: "neeto-molecules-sidebar__sublink-wrapper ml-".concat(level * 2),
|
|
765
|
+
"data-cy": "sidebar-sub-link-wrapper"
|
|
766
|
+
}, items.filter(filterByPermissions).map(function (_ref2, index) {
|
|
767
|
+
var label = _ref2.label,
|
|
768
|
+
to = _ref2.to,
|
|
769
|
+
count = _ref2.count,
|
|
770
|
+
dataCy = _ref2.dataCy,
|
|
771
|
+
subItems = _ref2.items,
|
|
772
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
773
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
774
|
+
key: index
|
|
775
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.NavLink, _extends({
|
|
776
|
+
to: to,
|
|
777
|
+
activeClassName: "active",
|
|
778
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-select-none neeto-molecules-sidebar__sublink",
|
|
779
|
+
"data-cy": "".concat(dataCy, "-sub-link"),
|
|
780
|
+
key: index,
|
|
781
|
+
isActive: function isActive() {
|
|
782
|
+
return isSubRouteActive({
|
|
783
|
+
subRoute: to,
|
|
784
|
+
location: location,
|
|
785
|
+
isSettingsItems: isSettingsItems
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}, ramda.omit(NAVLINK_KEYS_TO_OMIT, otherProps)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
789
|
+
className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
|
|
790
|
+
component: "span",
|
|
791
|
+
"data-cy": "".concat(dataCy, "-sub-link-label"),
|
|
792
|
+
style: "body2"
|
|
793
|
+
}, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
794
|
+
className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
|
|
795
|
+
component: "span",
|
|
796
|
+
"data-cy": "".concat(dataCy, "-sub-link-count"),
|
|
797
|
+
style: "body2"
|
|
798
|
+
}, count > 999 ? "999+" : count)), neetoCist.isPresent(subItems) && /*#__PURE__*/React__default["default"].createElement(Items, {
|
|
799
|
+
isSettingsItems: isSettingsItems,
|
|
800
|
+
items: subItems,
|
|
801
|
+
level: ramda.inc(level)
|
|
802
|
+
}));
|
|
803
|
+
}));
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
var _excluded$1 = ["label", "to", "icon", "items"];
|
|
807
|
+
function ownKeys$1(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; }
|
|
808
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
742
809
|
var Links = function Links(_ref) {
|
|
743
|
-
var navLinks = _ref.navLinks
|
|
744
|
-
|
|
810
|
+
var navLinks = _ref.navLinks,
|
|
811
|
+
setSelectedNavLink = _ref.setSelectedNavLink;
|
|
745
812
|
var _useState = React.useState(true),
|
|
746
813
|
_useState2 = _slicedToArray(_useState, 2),
|
|
747
814
|
isActiveLinkExpanded = _useState2[0],
|
|
748
815
|
setIsActiveLinkExpanded = _useState2[1];
|
|
749
|
-
var
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
});
|
|
756
|
-
var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
|
|
816
|
+
var location = reactRouterDom.useLocation();
|
|
817
|
+
var handleNavLinkClick = function handleNavLinkClick(_ref2) {
|
|
818
|
+
var event = _ref2.event,
|
|
819
|
+
isActive = _ref2.isActive,
|
|
820
|
+
items = _ref2.items,
|
|
821
|
+
navLink = _ref2.navLink;
|
|
757
822
|
if (neetoCist.isNotPresent(items)) return;
|
|
823
|
+
ramda.equals(navLink.label, SETTINGS) && setSelectedNavLink(navLink);
|
|
758
824
|
if (isActive()) {
|
|
759
825
|
setIsActiveLinkExpanded(ramda.not);
|
|
760
826
|
event.preventDefault();
|
|
@@ -764,12 +830,12 @@ var Links = function Links(_ref) {
|
|
|
764
830
|
};
|
|
765
831
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
766
832
|
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
|
|
767
|
-
}, navLinks.filter(filterByPermissions).map(function (
|
|
768
|
-
var label =
|
|
769
|
-
to =
|
|
770
|
-
icon =
|
|
771
|
-
items =
|
|
772
|
-
otherProps = _objectWithoutProperties(
|
|
833
|
+
}, navLinks.filter(filterByPermissions).map(function (navLink, index) {
|
|
834
|
+
var label = navLink.label,
|
|
835
|
+
to = navLink.to,
|
|
836
|
+
icon = navLink.icon,
|
|
837
|
+
items = navLink.items,
|
|
838
|
+
otherProps = _objectWithoutProperties(navLink, _excluded$1);
|
|
773
839
|
var IconSVG = icon;
|
|
774
840
|
var url = new URL(to, window.location.href);
|
|
775
841
|
var isActive = function isActive() {
|
|
@@ -777,14 +843,19 @@ var Links = function Links(_ref) {
|
|
|
777
843
|
};
|
|
778
844
|
var isMenuExpanded = isActive() && isActiveLinkExpanded;
|
|
779
845
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
780
|
-
key:
|
|
846
|
+
key: index
|
|
781
847
|
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.NavLink, _extends({
|
|
782
848
|
activeClassName: "active",
|
|
783
849
|
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
|
|
784
850
|
onClick: function onClick(event) {
|
|
785
|
-
return handleNavLinkClick(
|
|
851
|
+
return handleNavLinkClick({
|
|
852
|
+
event: event,
|
|
853
|
+
isActive: isActive,
|
|
854
|
+
items: items,
|
|
855
|
+
navLink: navLink
|
|
856
|
+
});
|
|
786
857
|
}
|
|
787
|
-
}, _objectSpread({
|
|
858
|
+
}, _objectSpread$1({
|
|
788
859
|
isActive: isActive,
|
|
789
860
|
to: to
|
|
790
861
|
}, otherProps)), icon && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
@@ -795,42 +866,70 @@ var Links = function Links(_ref) {
|
|
|
795
866
|
component: "span",
|
|
796
867
|
style: "body2",
|
|
797
868
|
weight: "normal"
|
|
798
|
-
}, label), items && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
869
|
+
}, label), items && neetoCist.notEquals(label, SETTINGS) && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
799
870
|
className: classnames__default["default"]("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
|
|
800
871
|
"neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
|
|
801
872
|
})
|
|
802
873
|
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Down, {
|
|
803
874
|
size: 16
|
|
804
|
-
}))), items && isMenuExpanded && /*#__PURE__*/React__default["default"].createElement(
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
})
|
|
875
|
+
}))), items && neetoCist.notEquals(label, SETTINGS) && isMenuExpanded && /*#__PURE__*/React__default["default"].createElement(Items, {
|
|
876
|
+
items: items
|
|
877
|
+
}));
|
|
878
|
+
}));
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
var _excluded = ["label", "to", "items"];
|
|
882
|
+
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; }
|
|
883
|
+
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; }
|
|
884
|
+
var SelectedLink = function SelectedLink(_ref) {
|
|
885
|
+
var navLink = _ref.navLink,
|
|
886
|
+
_ref$setSelectedNavLi = _ref.setSelectedNavLink,
|
|
887
|
+
setSelectedNavLink = _ref$setSelectedNavLi === void 0 ? neetoCist.noop : _ref$setSelectedNavLi,
|
|
888
|
+
_ref$isConfigurePage = _ref.isConfigurePage,
|
|
889
|
+
isConfigurePage = _ref$isConfigurePage === void 0 ? false : _ref$isConfigurePage;
|
|
890
|
+
var location = reactRouterDom.useLocation();
|
|
891
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
892
|
+
t = _useTranslation.t;
|
|
893
|
+
var label = navLink.label,
|
|
894
|
+
to = navLink.to,
|
|
895
|
+
items = navLink.items,
|
|
896
|
+
otherProps = _objectWithoutProperties(navLink, _excluded);
|
|
897
|
+
var HeaderComponent = neetoCist.isPresent(to) ? reactRouterDom.NavLink : "div";
|
|
898
|
+
var url = new URL(to, window.location.href);
|
|
899
|
+
var isActive = function isActive() {
|
|
900
|
+
return ramda.is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
901
|
+
};
|
|
902
|
+
var handleGoBack = function handleGoBack(event) {
|
|
903
|
+
event.preventDefault();
|
|
904
|
+
setSelectedNavLink({});
|
|
905
|
+
};
|
|
906
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
907
|
+
className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable"
|
|
908
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderComponent, _extends({
|
|
909
|
+
activeClassName: "active",
|
|
910
|
+
className: classnames__default["default"]("neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link", {
|
|
911
|
+
active: isConfigurePage
|
|
912
|
+
})
|
|
913
|
+
}, _objectSpread({
|
|
914
|
+
isActive: isActive,
|
|
915
|
+
to: to
|
|
916
|
+
}, otherProps)), ramda.not(isConfigurePage) && /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
|
|
917
|
+
content: t("neetoMolecules.sidebar.goBack"),
|
|
918
|
+
position: "top"
|
|
919
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
920
|
+
className: "neeto-molecules-sidebar__link-icon",
|
|
921
|
+
"data-testid": "".concat(label, "-go-back-button"),
|
|
922
|
+
onClick: handleGoBack
|
|
923
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Left, null))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
924
|
+
component: "span",
|
|
925
|
+
style: "body2",
|
|
926
|
+
weight: "normal",
|
|
927
|
+
className: classnames__default["default"]("neeto-molecules-sidebar__link-label", {
|
|
928
|
+
"ml-7": isConfigurePage
|
|
929
|
+
})
|
|
930
|
+
}, label)), items && /*#__PURE__*/React__default["default"].createElement(Items, {
|
|
931
|
+
items: items,
|
|
932
|
+
isSettingsItems: ramda.not(isConfigurePage)
|
|
834
933
|
}));
|
|
835
934
|
};
|
|
836
935
|
|
|
@@ -849,10 +948,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
849
948
|
_useState2 = _slicedToArray(_useState, 2),
|
|
850
949
|
isAppSwitcherOpen = _useState2[0],
|
|
851
950
|
setIsAppSwitcherOpen = _useState2[1];
|
|
852
|
-
var _useState3 = React.useState(
|
|
951
|
+
var _useState3 = React.useState({}),
|
|
853
952
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
854
|
-
|
|
855
|
-
|
|
953
|
+
selectedNavLink = _useState4[0],
|
|
954
|
+
setSelectedNavLink = _useState4[1];
|
|
955
|
+
var _useState5 = React.useState(false),
|
|
956
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
957
|
+
isSidebarPaneOpen = _useState6[0],
|
|
958
|
+
setIsSidebarPaneOpen = _useState6[1];
|
|
856
959
|
var _useLocalStorage = reactUtils.useLocalStorage(getSidebarStateLocalStorageKey(), false),
|
|
857
960
|
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
858
961
|
isSidebarCollapsed = _useLocalStorage2[0],
|
|
@@ -880,6 +983,17 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
880
983
|
};
|
|
881
984
|
}, []);
|
|
882
985
|
var productName = initializers.globalProps.appName.substr(5).toLowerCase();
|
|
986
|
+
React.useEffect(function () {
|
|
987
|
+
var currentLink = navLinks.find(function (_ref2) {
|
|
988
|
+
var to = _ref2.to,
|
|
989
|
+
isActive = _ref2.isActive;
|
|
990
|
+
var url = new URL(to, window.location.href);
|
|
991
|
+
return ramda.is(Function, isActive) ? isActive() : location.pathname.startsWith(url.pathname);
|
|
992
|
+
});
|
|
993
|
+
if (neetoCist.isPresent(currentLink) && ramda.equals(currentLink.label, SETTINGS)) {
|
|
994
|
+
setSelectedNavLink(currentLink);
|
|
995
|
+
}
|
|
996
|
+
}, []);
|
|
883
997
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
884
998
|
"data-testid": "sidebar-container",
|
|
885
999
|
className: classnames__default["default"]("neeto-molecules-sidebar__wrapper", {
|
|
@@ -891,14 +1005,20 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
891
1005
|
setIsSidebarPaneOpen(false);
|
|
892
1006
|
}
|
|
893
1007
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
894
|
-
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",
|
|
895
1008
|
"data-cy": "sidebar-wrapper",
|
|
896
|
-
"data-testid": "sidebar"
|
|
1009
|
+
"data-testid": "sidebar",
|
|
1010
|
+
className: classnames__default["default"]("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", {
|
|
1011
|
+
"neeto-molecules-sidebar--focus-mode": neetoCist.isPresent(selectedNavLink)
|
|
1012
|
+
})
|
|
897
1013
|
}, /*#__PURE__*/React__default["default"].createElement(Header$1, {
|
|
898
1014
|
customLogo: customLogo
|
|
899
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
|
900
|
-
|
|
901
|
-
|
|
1015
|
+
}), neetoCist.isPresent(selectedNavLink) ? /*#__PURE__*/React__default["default"].createElement(SelectedLink, {
|
|
1016
|
+
setSelectedNavLink: setSelectedNavLink,
|
|
1017
|
+
navLink: selectedNavLink
|
|
1018
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Links, {
|
|
1019
|
+
navLinks: navLinks,
|
|
1020
|
+
setSelectedNavLink: setSelectedNavLink
|
|
1021
|
+
}), neetoCist.isNotPresent(selectedNavLink) && /*#__PURE__*/React__default["default"].createElement(Footer, {
|
|
902
1022
|
extraTopLinks: extraTopLinks,
|
|
903
1023
|
helpLinkOverrides: helpLinkOverrides,
|
|
904
1024
|
profileInfoOverrides: profileInfoOverrides,
|