@bigbinary/neeto-molecules 1.15.36 → 1.15.38

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.
@@ -0,0 +1,187 @@
1
+ import { _ as _extends } from './extends-093996c9.js';
2
+ import { _ as _defineProperty } from './defineProperty-549061a7.js';
3
+ import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
4
+ import React__default from 'react';
5
+ import classnames from 'classnames';
6
+ import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
7
+ import { Left } from '@bigbinary/neeto-icons';
8
+ import { Typography } from '@bigbinary/neetoui';
9
+ import { curry, is, includes, __, all, equals, omit } from 'ramda';
10
+ import { isNotEmpty, hyphenate, isPresent } from '@bigbinary/neeto-cist';
11
+ import { Segments } from '@bigbinary/neeto-filters-frontend';
12
+ import { useNavigationCheckpoints } from '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
13
+ import { NavLink } from 'react-router-dom';
14
+ import { n } from './inject-css-c86de496.js';
15
+
16
+ var _excluded$1 = ["checkpointKey", "to", "children"];
17
+ var CheckPointNavLinks = function CheckPointNavLinks(_ref) {
18
+ var checkpointKey = _ref.checkpointKey,
19
+ to = _ref.to,
20
+ children = _ref.children,
21
+ others = _objectWithoutProperties(_ref, _excluded$1);
22
+ var _useNavigationCheckpo = useNavigationCheckpoints(checkpointKey),
23
+ checkpoint = _useNavigationCheckpo[checkpointKey];
24
+ return /*#__PURE__*/React__default.createElement(NavLink, _extends({
25
+ to: checkpoint || to
26
+ }, others, {
27
+ key: to
28
+ }), children);
29
+ };
30
+
31
+ var SUB_LINK_TYPES = {
32
+ SYSTEM_VIEW: "system_view",
33
+ SEGMENTS: "segments"
34
+ };
35
+
36
+ var isSubRouteActive = function isSubRouteActive(subRoute, location) {
37
+ var currentBrowserUrl = new URL(location.pathname + location.search + location.hash, window.location.origin);
38
+ var targetUrl = new URL(subRoute, window.location.origin);
39
+ var targetSearchParams = targetUrl.searchParams;
40
+ var targetSearchKeys = Array.from(targetSearchParams.keys());
41
+ return all(function (key) {
42
+ return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
43
+ }, targetSearchKeys) && equals(currentBrowserUrl.pathname, targetUrl.pathname);
44
+ };
45
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
46
+ var _globalProps$user, _globalProps$user2;
47
+ 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);
48
+ return "sidebarState-".concat(user);
49
+ };
50
+ var filterByPermissions = curry(function (_ref) {
51
+ var permissions = _ref.permissions;
52
+ if (permissions && isNotEmpty(permissions)) {
53
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
54
+ }
55
+ return true;
56
+ });
57
+
58
+ var SubLink = function SubLink(_ref) {
59
+ var to = _ref.to,
60
+ label = _ref.label,
61
+ _ref$type = _ref.type,
62
+ type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
63
+ count = _ref.count,
64
+ isSectionHeader = _ref.isSectionHeader,
65
+ isCountsLoading = _ref.isCountsLoading,
66
+ dataCy = _ref["data-cy"],
67
+ _ref$entity = _ref.entity,
68
+ entity = _ref$entity === void 0 ? "" : _ref$entity,
69
+ _ref$columns = _ref.columns,
70
+ columns = _ref$columns === void 0 ? [] : _ref$columns;
71
+ if (type === SUB_LINK_TYPES.SEGMENTS) {
72
+ return /*#__PURE__*/React__default.createElement(Segments, {
73
+ columns: columns,
74
+ entity: entity,
75
+ isIndependent: false
76
+ });
77
+ }
78
+ var dataCyPrefix = dataCy || hyphenate(label);
79
+ var renderCount = function renderCount(count) {
80
+ return count > 999 ? "999+" : count;
81
+ };
82
+ return /*#__PURE__*/React__default.createElement(CheckPointNavLinks, {
83
+ to: to,
84
+ activeClassName: "active",
85
+ className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
86
+ "data-cy": "".concat(dataCyPrefix, "-sub-link"),
87
+ isActive: function isActive() {
88
+ return !isSectionHeader && isSubRouteActive(to, location);
89
+ }
90
+ }, /*#__PURE__*/React__default.createElement(Typography, {
91
+ className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
92
+ component: "span",
93
+ "data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
94
+ style: "body2"
95
+ }, label), /*#__PURE__*/React__default.createElement(Typography, {
96
+ className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
97
+ component: "span",
98
+ "data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
99
+ style: "body2"
100
+ }, isCountsLoading ? /*#__PURE__*/React__default.createElement("div", {
101
+ className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
102
+ }) : renderCount(count)));
103
+ };
104
+
105
+ 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; }
106
+ 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; }
107
+ var Items = function Items(_ref) {
108
+ var items = _ref.items,
109
+ _ref$isSettingsItems = _ref.isSettingsItems,
110
+ isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems,
111
+ isCountsLoading = _ref.isCountsLoading;
112
+ return /*#__PURE__*/React__default.createElement("div", {
113
+ className: "neeto-molecules-sidebar__sublink-wrapper",
114
+ "data-cy": "sidebar-sub-link-wrapper"
115
+ }, items.filter(filterByPermissions).map(function (subItem, subIndex) {
116
+ var _subItem$to;
117
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
118
+ key: subIndex
119
+ }, /*#__PURE__*/React__default.createElement(SubLink, _extends({}, _objectSpread$1(_objectSpread$1({}, subItem), {}, {
120
+ isCountsLoading: isCountsLoading
121
+ }), {
122
+ isSectionHeader: isPresent(subItem.item),
123
+ to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path
124
+ })), isSettingsItems && isPresent(subItem.items) && /*#__PURE__*/React__default.createElement(Items, {
125
+ isSettingsItems: isSettingsItems,
126
+ items: subItem.items
127
+ }));
128
+ }));
129
+ };
130
+
131
+ var _excluded = ["label", "items", "isConfigureNavLink"];
132
+ 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; }
133
+ 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; }
134
+ var SelectedLink = function SelectedLink(_ref) {
135
+ var _ref$navLink = _ref.navLink,
136
+ navLink = _ref$navLink === void 0 ? {
137
+ label: "",
138
+ items: [],
139
+ isConfigureNavLink: false
140
+ } : _ref$navLink,
141
+ handleGoBack = _ref.handleGoBack,
142
+ isConfigureSidebar = _ref.isConfigureSidebar;
143
+ var label = navLink.label,
144
+ items = navLink.items,
145
+ isConfigureNavLink = navLink.isConfigureNavLink,
146
+ otherProps = _objectWithoutProperties(navLink, _excluded);
147
+ return /*#__PURE__*/React__default.createElement("div", {
148
+ className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable",
149
+ "data-cy": "configure-nav-container"
150
+ }, /*#__PURE__*/React__default.createElement("div", _extends({
151
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-bg-white neeto-ui-no-underline neeto-molecules-sidebar__link",
152
+ onClick: handleGoBack
153
+ }, _objectSpread({}, omit(["icon"], otherProps))), isConfigureNavLink && /*#__PURE__*/React__default.createElement("span", {
154
+ className: "neeto-molecules-sidebar__link-icon",
155
+ "data-cy": "".concat(hyphenize(label), "-go-back-button"),
156
+ "data-testid": "".concat(label, "-go-back-button")
157
+ }, /*#__PURE__*/React__default.createElement(Left, null)), /*#__PURE__*/React__default.createElement(Typography, {
158
+ component: "span",
159
+ style: "body2",
160
+ weight: "normal",
161
+ className: classnames("neeto-molecules-sidebar__link-label", _defineProperty({
162
+ "neeto-molecules-sidebar__configure-page-header": isConfigureNavLink
163
+ }, "pl-6", isConfigureSidebar))
164
+ }, label)), items && /*#__PURE__*/React__default.createElement(Items, {
165
+ items: items,
166
+ isSettingsItems: true
167
+ }));
168
+ };
169
+
170
+ 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__configure-page .neeto-molecules-sidebar__toggler{right:20px}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper__configure-page .neeto-molecules-sidebar__toggler{right:auto}}.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-header{font-weight:var(--neeto-ui-font-medium)!important}.neeto-molecules-sidebar__configure-page{border-right:1px solid rgb(var(--neeto-ui-gray-200))}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__link span{font-weight:var(--neeto-ui-font-medium)}.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-help-popup-wrapper,.neeto-molecules-product-switcher-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-product-switcher-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-product-switcher-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:15px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:15px}.neeto-molecules-product-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-product-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-segments-header{padding-left:58px}.neeto-molecules-sidebar-segment{margin-bottom:0!important;padding:4px 24px 4px 58px}.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{height:calc(100vh - 160px);margin-bottom:0;overflow:auto}.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;cursor:pointer;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{cursor:pointer;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}";
171
+ n(css,{});
172
+
173
+ var Chevron = function Chevron(_ref) {
174
+ var style = _ref.style;
175
+ return /*#__PURE__*/React__default.createElement("svg", {
176
+ style: style,
177
+ height: "16",
178
+ viewBox: "0 0 16 16",
179
+ width: "16"
180
+ }, /*#__PURE__*/React__default.createElement("path", {
181
+ d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
182
+ fill: "currentColor"
183
+ }));
184
+ };
185
+
186
+ export { Chevron as C, Items as I, SelectedLink as S, CheckPointNavLinks as a, filterByPermissions as f, getSidebarStateLocalStorageKey as g };
187
+ //# sourceMappingURL=Chevron-37c7ce08.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chevron-37c7ce08.js","sources":["../src/components/Sidebar/Components/Links/CheckPointNavLink.jsx","../src/components/Sidebar/constants.js","../src/components/Sidebar/utils.js","../src/components/Sidebar/Components/Links/SubLink.jsx","../src/components/Sidebar/Components/Links/Items.jsx","../src/components/Sidebar/Components/Links/SelectedLink.jsx","../src/components/Sidebar/Components/Chevron.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { useNavigationCheckpoints } from \"neetocommons/react-utils/useRegisterNavigationCheckpoint\";\nimport { NavLink } from \"react-router-dom\";\n\nconst CheckPointNavLinks = ({ checkpointKey, to, children, ...others }) => {\n const { [checkpointKey]: checkpoint } =\n useNavigationCheckpoints(checkpointKey);\n\n return (\n <NavLink to={checkpoint || to} {...others} key={to}>\n {children}\n </NavLink>\n );\n};\n\nexport default CheckPointNavLinks;\n","export const SUB_LINK_TYPES = {\n SYSTEM_VIEW: \"system_view\",\n SEGMENTS: \"segments\",\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { __, all, curry, equals, includes, is } from \"ramda\";\n\nexport const isSubRouteActive = (subRoute, location) => {\n const currentBrowserUrl = new URL(\n location.pathname + location.search + location.hash,\n window.location.origin\n );\n const targetUrl = new URL(subRoute, window.location.origin);\n\n const targetSearchParams = targetUrl.searchParams;\n const targetSearchKeys = Array.from(targetSearchParams.keys());\n\n return (\n all(\n key =>\n currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key),\n targetSearchKeys\n ) && equals(currentBrowserUrl.pathname, targetUrl.pathname)\n );\n};\n\nexport const getSidebarStateLocalStorageKey = () => {\n const user = globalProps.user?.email || globalProps.user?.phoneNumber;\n\n return `sidebarState-${user}`;\n};\n\nexport const filterByPermissions = curry(({ permissions }) => {\n if (permissions && isNotEmpty(permissions)) {\n return is(Array, permissions)\n ? permissions.some(includes(__, globalProps.permissions))\n : globalProps.permissions.includes(permissions);\n }\n\n return true;\n});\n","import React from \"react\";\n\nimport { hyphenate } from \"neetocist\";\nimport { Segments } from \"neetofilters\";\nimport { Typography } from \"neetoui\";\n\nimport CheckPointNavLinks from \"./CheckPointNavLink\";\n\nimport { SUB_LINK_TYPES } from \"../../constants\";\nimport { isSubRouteActive } from \"../../utils\";\n\nconst SubLink = ({\n to,\n label,\n type = SUB_LINK_TYPES.SYSTEM_VIEW,\n count,\n isSectionHeader,\n isCountsLoading,\n \"data-cy\": dataCy,\n entity = \"\",\n columns = [],\n}) => {\n if (type === SUB_LINK_TYPES.SEGMENTS) {\n return <Segments {...{ columns, entity }} isIndependent={false} />;\n }\n\n const dataCyPrefix = dataCy || hyphenate(label);\n\n const renderCount = count => (count > 999 ? \"999+\" : count);\n\n return (\n <CheckPointNavLinks\n {...{ to }}\n activeClassName=\"active\"\n className=\"neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none\"\n data-cy={`${dataCyPrefix}-sub-link`}\n isActive={() => !isSectionHeader && isSubRouteActive(to, location)}\n >\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-label`}\n style=\"body2\"\n >\n {label}\n </Typography>\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-count`}\n style=\"body2\"\n >\n {isCountsLoading ? (\n <div className=\"neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse\" />\n ) : (\n renderCount(count)\n )}\n </Typography>\n </CheckPointNavLinks>\n );\n};\n\nexport default SubLink;\n","import React from \"react\";\n\nimport { isPresent } from \"neetocist\";\n\nimport SubLink from \"./SubLink\";\n\nimport { filterByPermissions } from \"../../utils\";\n\nconst Items = ({ items, isSettingsItems = false, isCountsLoading }) => (\n <div\n className=\"neeto-molecules-sidebar__sublink-wrapper\"\n data-cy=\"sidebar-sub-link-wrapper\"\n >\n {items.filter(filterByPermissions).map((subItem, subIndex) => (\n <React.Fragment key={subIndex}>\n <SubLink\n {...{ ...subItem, isCountsLoading }}\n isSectionHeader={isPresent(subItem.item)}\n to={subItem.to ?? subItem.path}\n />\n {isSettingsItems && isPresent(subItem.items) && (\n <Items {...{ isSettingsItems }} items={subItem.items} />\n )}\n </React.Fragment>\n ))}\n </div>\n);\n\nexport default Items;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { hyphenize } from \"neetocommons/utils/general\";\nimport { Left } from \"neetoicons\";\nimport { Typography } from \"neetoui\";\nimport { omit } from \"ramda\";\n\nimport Items from \"./Items\";\n\nconst SelectedLink = ({\n navLink = { label: \"\", items: [], isConfigureNavLink: false },\n handleGoBack,\n isConfigureSidebar,\n}) => {\n const { label, items, isConfigureNavLink, ...otherProps } = navLink;\n\n return (\n <div\n className=\"neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable\"\n data-cy=\"configure-nav-container\"\n >\n <div\n className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-bg-white neeto-ui-no-underline neeto-molecules-sidebar__link\"\n onClick={handleGoBack}\n {...{ ...omit([\"icon\"], otherProps) }}\n >\n {isConfigureNavLink && (\n <span\n className=\"neeto-molecules-sidebar__link-icon\"\n data-cy={`${hyphenize(label)}-go-back-button`}\n data-testid={`${label}-go-back-button`}\n >\n <Left />\n </span>\n )}\n <Typography\n component=\"span\"\n style=\"body2\"\n weight=\"normal\"\n className={classNames(\"neeto-molecules-sidebar__link-label\", {\n \"neeto-molecules-sidebar__configure-page-header\":\n isConfigureNavLink,\n [\"pl-6\"]: isConfigureSidebar,\n })}\n >\n {label}\n </Typography>\n </div>\n {items && <Items {...{ items }} isSettingsItems />}\n </div>\n );\n};\n\nexport default SelectedLink;\n","import React from \"react\";\n\nconst Chevron = ({ style }) => (\n <svg {...{ style }} height=\"16\" viewBox=\"0 0 16 16\" width=\"16\">\n <path\n d=\"M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default Chevron;\n"],"names":["CheckPointNavLinks","_ref","checkpointKey","to","children","others","_objectWithoutProperties","_excluded","_useNavigationCheckpo","useNavigationCheckpoints","checkpoint","React","createElement","NavLink","_extends","key","SUB_LINK_TYPES","SYSTEM_VIEW","SEGMENTS","isSubRouteActive","subRoute","location","currentBrowserUrl","URL","pathname","search","hash","window","origin","targetUrl","targetSearchParams","searchParams","targetSearchKeys","Array","from","keys","all","get","equals","getSidebarStateLocalStorageKey","_globalProps$user","_globalProps$user2","user","globalProps","email","phoneNumber","concat","filterByPermissions","curry","permissions","isNotEmpty","is","some","includes","__","SubLink","label","_ref$type","type","count","isSectionHeader","isCountsLoading","dataCy","_ref$entity","entity","_ref$columns","columns","Segments","isIndependent","dataCyPrefix","hyphenate","renderCount","activeClassName","className","isActive","Typography","component","style","Items","items","_ref$isSettingsItems","isSettingsItems","filter","map","subItem","subIndex","_subItem$to","Fragment","_objectSpread","isPresent","item","path","SelectedLink","_ref$navLink","navLink","isConfigureNavLink","handleGoBack","isConfigureSidebar","otherProps","onClick","omit","hyphenize","Left","weight","classNames","_defineProperty","Chevron","height","viewBox","width","d","fill"],"mappings":";;;;;;;;;;;;;;;;AAKA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAAmD;AAAA,EAAA,IAA7CC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAEC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AAAKC,IAAAA,MAAM,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,WAAA,CAAA,CAAA;AAClE,EAAA,IAAAC,qBAAA,GACEC,wBAAwB,CAACP,aAAa,CAAC;IADhBQ,UAAU,GAAAF,qBAAA,CAA1BN,aAAa,CAAA,CAAA;AAGtB,EAAA,oBACES,cAAA,CAAAC,aAAA,CAACC,OAAO,EAAAC,QAAA,CAAA;IAACX,EAAE,EAAEO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,GAAE,CAC9C,CAAC,CAAA;AAEV;;;;;AClDA,IAAMyB,OAAO,GAAG,SAAVA,OAAOA,CAAAzG,IAAA,EAAA;AAAA,EAAA,IAAM4E,KAAK,GAAA5E,IAAA,CAAL4E,KAAK,CAAA;EAAA,oBACtBlE,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAWiE,IAAAA,KAAK,EAALA,KAAK;AAAI8B,IAAAA,MAAM,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAC,WAAW;AAACC,IAAAA,KAAK,EAAC,IAAA;GACxDlG,eAAAA,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEkG,IAAAA,CAAC,EAAC,y5BAAy5B;AAC35BC,IAAAA,IAAI,EAAC,cAAA;AAAc,GACpB,CACE,CAAC,CAAA;AAAA;;;;"}
@@ -1,35 +1,96 @@
1
- import React__default from 'react';
2
- import { S as SelectedLink } from './sidebar-18c59fcb.js';
1
+ import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
2
+ import React__default, { useState, useEffect } from 'react';
3
+ import classnames from 'classnames';
4
+ import { Button } from '@bigbinary/neetoui';
5
+ import { not } from 'ramda';
6
+ import { useTranslation } from 'react-i18next';
7
+ import { useHistory } from 'react-router-dom';
8
+ import { S as SelectedLink, C as Chevron } from './Chevron-37c7ce08.js';
3
9
  import './extends-093996c9.js';
4
10
  import './defineProperty-549061a7.js';
5
11
  import './objectWithoutProperties-a0edb288.js';
6
- import 'classnames';
7
12
  import '@bigbinary/neeto-commons-frontend/utils/general';
8
13
  import '@bigbinary/neeto-icons';
9
- import '@bigbinary/neetoui';
10
- import 'ramda';
11
14
  import '@bigbinary/neeto-cist';
12
15
  import '@bigbinary/neeto-filters-frontend';
13
16
  import '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
14
- import 'react-router-dom';
15
17
  import './inject-css-c86de496.js';
16
18
 
17
19
  var ConfigurePageSidebar = function ConfigurePageSidebar(_ref) {
18
20
  var label = _ref.label,
19
- items = _ref.navLinks;
21
+ items = _ref.navLinks,
22
+ configurePageRoute = _ref.configurePageRoute;
23
+ var history = useHistory();
24
+ var productName = globalProps.appName.substr(5).toLowerCase();
25
+ var _useState = useState(false),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ isSidebarPaneOpen = _useState2[0],
28
+ setIsSidebarPaneOpen = _useState2[1];
29
+ var _useState3 = useState(false),
30
+ _useState4 = _slicedToArray(_useState3, 2),
31
+ isSidebarCollapsed = _useState4[0],
32
+ setIsSidebarCollapsed = _useState4[1];
33
+ var _useTranslation = useTranslation(),
34
+ t = _useTranslation.t;
35
+ var isLargerScreen = function isLargerScreen() {
36
+ return window.innerWidth > 768;
37
+ };
38
+ var isSidebarClosed = isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen);
39
+ useEffect(function () {
40
+ var handleResize = function handleResize() {
41
+ if (isLargerScreen()) return;
42
+ setIsSidebarPaneOpen(false);
43
+ setIsSidebarCollapsed(true);
44
+ };
45
+ window.addEventListener("resize", handleResize);
46
+ return function () {
47
+ return window.removeEventListener("resize", handleResize);
48
+ };
49
+ }, []);
50
+ var handleConfigureLinkClick = function handleConfigureLinkClick() {
51
+ history.push(configurePageRoute);
52
+ };
20
53
  return /*#__PURE__*/React__default.createElement("div", {
21
- className: "neeto-molecules-sidebar__wrapper neeto-molecules-sidebar__wrapper__configure-page",
22
- "data-testid": "configure-page-sidebar-container"
54
+ "data-testid": "configure-page-sidebar-container",
55
+ className: classnames("neeto-molecules-sidebar__wrapper neeto-molecules-sidebar__wrapper__configure-page", {
56
+ "neeto-molecules-sidebar__wrapper--collapsed": isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen)
57
+ })
23
58
  }, /*#__PURE__*/React__default.createElement("div", {
59
+ className: "neeto-molecules-sidebar__backdrop",
60
+ onClick: function onClick() {
61
+ setIsSidebarPaneOpen(false);
62
+ }
63
+ }), /*#__PURE__*/React__default.createElement("div", {
24
64
  className: "neeto-molecules-sidebar neeto-molecules-sidebar__configure-page 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--focus-mode",
25
65
  "data-testid": "configure-page-sidebar"
26
66
  }, /*#__PURE__*/React__default.createElement(SelectedLink, {
27
67
  isConfigureSidebar: true,
68
+ handleGoBack: handleConfigureLinkClick,
28
69
  navLink: {
29
70
  label: label,
30
71
  items: items
31
72
  }
32
- })));
73
+ })), /*#__PURE__*/React__default.createElement(Button, {
74
+ className: "neeto-molecules-sidebar__toggler",
75
+ "data-cy": "configure-page-neeto-molecules-sidebar-toggler",
76
+ "data-testid": "configure-page-sidebar-toggleButton",
77
+ style: isLargerScreen() ? "text" : "secondary",
78
+ icon: function icon() {
79
+ return /*#__PURE__*/React__default.createElement(Chevron, {
80
+ style: {
81
+ color: "rgb(var(--neeto-".concat(productName, "-primary))")
82
+ }
83
+ });
84
+ },
85
+ tooltipProps: {
86
+ content: isSidebarClosed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
87
+ position: "bottom"
88
+ },
89
+ onClick: function onClick() {
90
+ setIsSidebarCollapsed(!isSidebarCollapsed);
91
+ setIsSidebarPaneOpen(not);
92
+ }
93
+ }));
33
94
  };
34
95
 
35
96
  export { ConfigurePageSidebar as default };
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurePageSidebar.js","sources":["../src/components/ConfigurePageSidebar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport SelectedLink from \"components/Sidebar/Components/Links/SelectedLink\";\nimport \"components/Sidebar/sidebar.scss\";\n\nconst ConfigurePageSidebar = ({ label, navLinks: items }) => (\n <div\n className=\"neeto-molecules-sidebar__wrapper neeto-molecules-sidebar__wrapper__configure-page\"\n data-testid=\"configure-page-sidebar-container\"\n >\n <div\n className=\"neeto-molecules-sidebar neeto-molecules-sidebar__configure-page 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--focus-mode\"\n data-testid=\"configure-page-sidebar\"\n >\n <SelectedLink isConfigureSidebar navLink={{ label, items }} />\n </div>\n </div>\n);\n\nConfigurePageSidebar.propTypes = {\n /**\n * To specify the label to be shown on top of the sidebar.\n */\n label: PropTypes.string,\n /**\n * To specify the configure nav links to be shown in the sidebar.\n */\n navLinks: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n to: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, to: PropTypes.string })\n ),\n })\n ),\n};\n\nexport default ConfigurePageSidebar;\n"],"names":["ConfigurePageSidebar","_ref","label","items","navLinks","React","createElement","className","SelectedLink","isConfigureSidebar","navLink"],"mappings":";;;;;;;;;;;;;;;;AAOA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAYC,KAAK,GAAAF,IAAA,CAAfG,QAAQ,CAAA;EAAA,oBAC7CC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,mFAAmF;IAC7F,aAAY,EAAA,kCAAA;GAEZF,eAAAA,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,gNAAgN;IAC1N,aAAY,EAAA,wBAAA;AAAwB,GAAA,eAEpCF,cAAA,CAAAC,aAAA,CAACE,YAAY,EAAA;IAACC,kBAAkB,EAAA,IAAA;AAACC,IAAAA,OAAO,EAAE;AAAER,MAAAA,KAAK,EAALA,KAAK;AAAEC,MAAAA,KAAK,EAALA,KAAAA;AAAM,KAAA;GAAI,CAC1D,CACF,CAAC,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"ConfigurePageSidebar.js","sources":["../src/components/ConfigurePageSidebar.jsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { not } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport SelectedLink from \"components/Sidebar/Components/Links/SelectedLink\";\nimport \"components/Sidebar/sidebar.scss\";\n\nimport Chevron from \"./Sidebar/Components/Chevron\";\n\nconst ConfigurePageSidebar = ({\n label,\n navLinks: items,\n configurePageRoute,\n}) => {\n const history = useHistory();\n const productName = globalProps.appName.substr(5).toLowerCase();\n const [isSidebarPaneOpen, setIsSidebarPaneOpen] = useState(false);\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);\n\n const { t } = useTranslation();\n\n const isLargerScreen = () => window.innerWidth > 768;\n const isSidebarClosed = isLargerScreen()\n ? isSidebarCollapsed\n : not(isSidebarPaneOpen);\n\n useEffect(() => {\n const handleResize = () => {\n if (isLargerScreen()) return;\n setIsSidebarPaneOpen(false);\n setIsSidebarCollapsed(true);\n };\n window.addEventListener(\"resize\", handleResize);\n\n return () => window.removeEventListener(\"resize\", handleResize);\n }, []);\n\n const handleConfigureLinkClick = () => {\n history.push(configurePageRoute);\n };\n\n return (\n <div\n data-testid=\"configure-page-sidebar-container\"\n className={classnames(\n \"neeto-molecules-sidebar__wrapper neeto-molecules-sidebar__wrapper__configure-page\",\n {\n \"neeto-molecules-sidebar__wrapper--collapsed\": isLargerScreen()\n ? isSidebarCollapsed\n : not(isSidebarPaneOpen),\n }\n )}\n >\n <div\n className=\"neeto-molecules-sidebar__backdrop\"\n onClick={() => {\n setIsSidebarPaneOpen(false);\n }}\n />\n <div\n className=\"neeto-molecules-sidebar neeto-molecules-sidebar__configure-page 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--focus-mode\"\n data-testid=\"configure-page-sidebar\"\n >\n <SelectedLink\n isConfigureSidebar\n handleGoBack={handleConfigureLinkClick}\n navLink={{ label, items }}\n />\n </div>\n <Button\n className=\"neeto-molecules-sidebar__toggler\"\n data-cy=\"configure-page-neeto-molecules-sidebar-toggler\"\n data-testid=\"configure-page-sidebar-toggleButton\"\n style={isLargerScreen() ? \"text\" : \"secondary\"}\n icon={() => (\n <Chevron\n style={{ color: `rgb(var(--neeto-${productName}-primary))` }}\n />\n )}\n tooltipProps={{\n content: isSidebarClosed\n ? t(\"neetoMolecules.sidebar.showMenu\")\n : t(\"neetoMolecules.sidebar.hideMenu\"),\n position: \"bottom\",\n }}\n onClick={() => {\n setIsSidebarCollapsed(!isSidebarCollapsed);\n setIsSidebarPaneOpen(not);\n }}\n />\n </div>\n );\n};\n\nConfigurePageSidebar.propTypes = {\n /**\n * The route to the landing page of the configure screen.\n * When the user clicks on the 'configure' text, they will be taken to the specified route.\n */\n configurePageRoute: PropTypes.string,\n /**\n * To specify the label to be shown on top of the sidebar.\n */\n label: PropTypes.string,\n /**\n * To specify the configure nav links to be shown in the sidebar.\n */\n navLinks: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n to: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, to: PropTypes.string })\n ),\n })\n ),\n};\n\nexport default ConfigurePageSidebar;\n"],"names":["ConfigurePageSidebar","_ref","label","items","navLinks","configurePageRoute","history","useHistory","productName","globalProps","appName","substr","toLowerCase","_useState","useState","_useState2","_slicedToArray","isSidebarPaneOpen","setIsSidebarPaneOpen","_useState3","_useState4","isSidebarCollapsed","setIsSidebarCollapsed","_useTranslation","useTranslation","t","isLargerScreen","window","innerWidth","isSidebarClosed","not","useEffect","handleResize","addEventListener","removeEventListener","handleConfigureLinkClick","push","React","createElement","className","classnames","onClick","SelectedLink","isConfigureSidebar","handleGoBack","navLink","Button","style","icon","Chevron","color","concat","tooltipProps","content","position"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,oBAAoB,GAAG,SAAvB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kC,cAAA,CAAAC,aAAA,CAACQ,MAAM,EAAA;AACLP,IAAAA,SAAS,EAAC,kCAAkC;AAC5C,IAAA,SAAA,EAAQ,gDAAgD;AACxD,IAAA,aAAA,EAAY,qCAAqC;AACjDQ,IAAAA,KAAK,EAAErB,cAAc,EAAE,GAAG,MAAM,GAAG,WAAY;IAC/CsB,IAAI,EAAE,SAAAA,IAAA,GAAA;AAAA,MAAA,oBACJX,cAAA,CAAAC,aAAA,CAACW,OAAO,EAAA;AACNF,QAAAA,KAAK,EAAE;UAAEG,KAAK,EAAA,kBAAA,CAAAC,MAAA,CAAqB3C,WAAW,EAAA,YAAA,CAAA;AAAa,SAAA;AAAE,OAC9D,CAAC,CAAA;KACF;AACF4C,IAAAA,YAAY,EAAE;MACZC,OAAO,EAAExB,eAAe,GACpBJ,CAAC,CAAC,iCAAiC,CAAC,GACpCA,CAAC,CAAC,iCAAiC,CAAC;AACxC6B,MAAAA,QAAQ,EAAE,QAAA;KACV;IACFb,OAAO,EAAE,SAAAA,OAAAA,GAAM;MACbnB,qBAAqB,CAAC,CAACD,kBAAkB,CAAC,CAAA;MAC1CH,oBAAoB,CAACY,GAAG,CAAC,CAAA;AAC3B,KAAA;AAAE,GACH,CACE,CAAC,CAAA;AAEV;;;;"}
@@ -3,23 +3,23 @@ import { _ as _defineProperty } from './defineProperty-549061a7.js';
3
3
  import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
4
4
  import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
5
5
  import React__default, { useState, useEffect } from 'react';
6
+ import { Tooltip, Typography, Checkbox, Input, Modal, Spinner, Button } from '@bigbinary/neetoui';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { n } from './inject-css-c86de496.js';
6
9
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
7
- import { Modal, Typography, Spinner, Tooltip, Checkbox, Button, Input } from '@bigbinary/neetoui';
8
10
  import { not } from 'ramda';
9
- import { useTranslation } from 'react-i18next';
10
11
  import CopyToClipboardButton from './CopyToClipboardButton.js';
11
- import { n } from './inject-css-c86de496.js';
12
12
  import 'classnames';
13
13
  import '@bigbinary/neeto-commons-frontend/utils/general';
14
14
  import '@bigbinary/neeto-icons';
15
15
 
16
+ var css = ".neeto-molecules-share-timestamp-input .neeto-ui-input__wrapper{position:relative}.neeto-molecules-share-timestamp-input .neeto-ui-input__wrapper:not(:last-child):after{content:\":\";font-weight:bolder;position:absolute;right:-8px;top:4px}";
17
+ n(css,{});
18
+
16
19
  var ONE_SECOND = 1;
17
20
  var ONE_MINUTE = 60 * ONE_SECOND;
18
21
  var ONE_HOUR = 60 * ONE_MINUTE;
19
22
 
20
- var css = ".neeto-molecules-share-timestamp-input .neeto-ui-input__wrapper{position:relative}.neeto-molecules-share-timestamp-input .neeto-ui-input__wrapper:not(:last-child):after{content:\":\";font-weight:bolder;position:absolute;right:-8px;top:4px}";
21
- n(css,{});
22
-
23
23
  var getTimeValues = function getTimeValues(playbackTimeInSec) {
24
24
  var hour = Math.floor(playbackTimeInSec / ONE_HOUR);
25
25
  playbackTimeInSec = playbackTimeInSec % ONE_HOUR;
@@ -48,36 +48,28 @@ var shouldRenderHoursInput = function shouldRenderHoursInput(duration) {
48
48
  return hours > 0;
49
49
  };
50
50
 
51
- var _excluded = ["recordingUrl", "totalDuration", "currentTimestamp", "buttonProps", "isLoading"];
52
- 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; }
53
- 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; }
54
- var ShareRecording = function ShareRecording(_ref) {
51
+ 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; }
52
+ 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; }
53
+ var ShareModalBody = function ShareModalBody(_ref) {
55
54
  var recordingUrl = _ref.recordingUrl,
56
55
  totalDuration = _ref.totalDuration,
57
- currentTimestamp = _ref.currentTimestamp,
58
- _ref$buttonProps = _ref.buttonProps,
59
- buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
60
- _ref$isLoading = _ref.isLoading,
61
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
62
- otherProps = _objectWithoutProperties(_ref, _excluded);
56
+ getCurrentTimestamp = _ref.getCurrentTimestamp,
57
+ isOpen = _ref.isOpen;
63
58
  var _useTranslation = useTranslation(),
64
59
  t = _useTranslation.t;
65
- var _useState = useState(false),
60
+ var currentTimestamp = getCurrentTimestamp();
61
+ var _useState = useState(""),
66
62
  _useState2 = _slicedToArray(_useState, 2),
67
- isOpen = _useState2[0],
68
- setIsOpen = _useState2[1];
69
- var _useState3 = useState(""),
63
+ shareLink = _useState2[0],
64
+ setShareLink = _useState2[1];
65
+ var _useState3 = useState(currentTimestamp),
70
66
  _useState4 = _slicedToArray(_useState3, 2),
71
- shareLink = _useState4[0],
72
- setShareLink = _useState4[1];
73
- var _useState5 = useState(0),
67
+ currentPlaybackTime = _useState4[0],
68
+ setCurrentPlaybackTime = _useState4[1];
69
+ var _useState5 = useState(currentTimestamp > 0),
74
70
  _useState6 = _slicedToArray(_useState5, 2),
75
- currentPlaybackTime = _useState6[0],
76
- setCurrentPlaybackTime = _useState6[1];
77
- var _useState7 = useState(currentTimestamp > 0),
78
- _useState8 = _slicedToArray(_useState7, 2),
79
- isPlaybackTimeCheckboxChecked = _useState8[0],
80
- setIsPlaybackTimeCheckboxChecked = _useState8[1];
71
+ isPlaybackTimeCheckboxChecked = _useState6[0],
72
+ setIsPlaybackTimeCheckboxChecked = _useState6[1];
81
73
  var _getTimeValues = getTimeValues(currentPlaybackTime),
82
74
  hour = _getTimeValues.hour,
83
75
  minute = _getTimeValues.minute,
@@ -88,11 +80,6 @@ var ShareRecording = function ShareRecording(_ref) {
88
80
  var intendedTimeInSec = currentPlaybackTime + valueInSec - offset;
89
81
  setCurrentPlaybackTime(Math.min(intendedTimeInSec, totalDuration));
90
82
  };
91
- var handleClick = function handleClick() {
92
- var _buttonProps$onClick;
93
- setIsOpen(true);
94
- buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$onClick = buttonProps.onClick) === null || _buttonProps$onClick === void 0 ? void 0 : _buttonProps$onClick.call(buttonProps);
95
- };
96
83
  var renderTimeInput = function renderTimeInput(_ref3) {
97
84
  var value = _ref3.value,
98
85
  onChange = _ref3.onChange,
@@ -114,26 +101,12 @@ var ShareRecording = function ShareRecording(_ref) {
114
101
  setCurrentPlaybackTime(currentTimestamp > 0 ? currentTimestamp : 0);
115
102
  }, [isOpen]);
116
103
  useEffect(function () {
117
- var playbackUrl = buildUrl(recordingUrl, _objectSpread({}, isPlaybackTimeCheckboxChecked && currentPlaybackTime > 0 && {
118
- t: currentPlaybackTime
104
+ var playbackUrl = buildUrl(recordingUrl, _objectSpread$1({}, isPlaybackTimeCheckboxChecked && currentPlaybackTime > 0 && {
105
+ time: currentPlaybackTime
119
106
  }));
120
107
  setShareLink(playbackUrl);
121
108
  }, [recordingUrl, isPlaybackTimeCheckboxChecked, currentPlaybackTime]);
122
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Modal, _extends({}, _objectSpread({
123
- isOpen: isOpen
124
- }, otherProps), {
125
- "data-cy": "share-modal",
126
- size: "large",
127
- onClose: function onClose() {
128
- return setIsOpen(false);
129
- }
130
- }), /*#__PURE__*/React__default.createElement(Modal.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
131
- style: "h2"
132
- }, t("neetoMolecules.shareRecording.title"))), /*#__PURE__*/React__default.createElement(Modal.Body, {
133
- className: "flex flex-col space-y-2"
134
- }, isLoading ? /*#__PURE__*/React__default.createElement(Spinner, {
135
- className: "mx-auto"
136
- }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
109
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
137
110
  className: "neeto-ui-bg-gray-100 neeto-ui-rounded-lg mb-3 flex items-center justify-between p-2"
138
111
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
139
112
  content: shareLink
@@ -185,7 +158,52 @@ var ShareRecording = function ShareRecording(_ref) {
185
158
  offset: second * ONE_SECOND
186
159
  });
187
160
  }
188
- })))))), /*#__PURE__*/React__default.createElement(Button, _extends({
161
+ }))));
162
+ };
163
+
164
+ var _excluded = ["recordingUrl", "totalDuration", "getCurrentTimestamp", "buttonProps", "isLoading"];
165
+ 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; }
166
+ 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; }
167
+ var ShareRecording = function ShareRecording(_ref) {
168
+ var recordingUrl = _ref.recordingUrl,
169
+ totalDuration = _ref.totalDuration,
170
+ getCurrentTimestamp = _ref.getCurrentTimestamp,
171
+ _ref$buttonProps = _ref.buttonProps,
172
+ buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
173
+ _ref$isLoading = _ref.isLoading,
174
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
175
+ otherProps = _objectWithoutProperties(_ref, _excluded);
176
+ var _useTranslation = useTranslation(),
177
+ t = _useTranslation.t;
178
+ var _useState = useState(false),
179
+ _useState2 = _slicedToArray(_useState, 2),
180
+ isOpen = _useState2[0],
181
+ setIsOpen = _useState2[1];
182
+ var handleClick = function handleClick() {
183
+ var _buttonProps$onClick;
184
+ setIsOpen(true);
185
+ buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$onClick = buttonProps.onClick) === null || _buttonProps$onClick === void 0 ? void 0 : _buttonProps$onClick.call(buttonProps);
186
+ };
187
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Modal, _extends({}, _objectSpread({
188
+ isOpen: isOpen
189
+ }, otherProps), {
190
+ "data-cy": "share-modal",
191
+ size: "large",
192
+ onClose: function onClose() {
193
+ return setIsOpen(false);
194
+ }
195
+ }), /*#__PURE__*/React__default.createElement(Modal.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
196
+ style: "h2"
197
+ }, t("neetoMolecules.shareRecording.title"))), /*#__PURE__*/React__default.createElement(Modal.Body, {
198
+ className: "flex flex-col space-y-2"
199
+ }, isLoading ? /*#__PURE__*/React__default.createElement(Spinner, {
200
+ className: "mx-auto"
201
+ }) : /*#__PURE__*/React__default.createElement(ShareModalBody, {
202
+ getCurrentTimestamp: getCurrentTimestamp,
203
+ isOpen: isOpen,
204
+ recordingUrl: recordingUrl,
205
+ totalDuration: totalDuration
206
+ }))), /*#__PURE__*/React__default.createElement(Button, _extends({
189
207
  "data-cy": "share-button",
190
208
  label: t("neetoMolecules.common.actions.share"),
191
209
  style: "secondary"