@bigbinary/neeto-molecules 1.15.2 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigurePageSidebar.js +1 -1
- package/dist/FloatingActionMenu.js +124 -136
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/MadeWith.js +2 -2
- package/dist/MadeWith.js.map +1 -1
- package/dist/Sidebar.js +6 -14
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/ConfigurePageSidebar.js +1 -1
- package/dist/cjs/FloatingActionMenu.js +115 -127
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/MadeWith.js +2 -2
- package/dist/cjs/MadeWith.js.map +1 -1
- package/dist/cjs/Sidebar.js +6 -14
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/{sidebar-134ddf08.js → sidebar-b0a2e0b1.js} +2 -2
- package/dist/cjs/{sidebar-134ddf08.js.map → sidebar-b0a2e0b1.js.map} +1 -1
- package/dist/{sidebar-8e96016c.js → sidebar-50ba4b0a.js} +2 -2
- package/dist/{sidebar-8e96016c.js.map → sidebar-50ba4b0a.js.map} +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +1 -1
- package/types/FloatingActionMenu.d.ts +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { S as SelectedLink } from './sidebar-
|
|
2
|
+
import { S as SelectedLink } from './sidebar-50ba4b0a.js';
|
|
3
3
|
import './extends-093996c9.js';
|
|
4
4
|
import './defineProperty-549061a7.js';
|
|
5
5
|
import './objectWithoutProperties-a0edb288.js';
|
|
@@ -8,17 +8,17 @@ import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
|
|
|
8
8
|
import { isNotPresent, isPresent, truncate, noop } from '@bigbinary/neeto-cist';
|
|
9
9
|
import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
|
|
10
10
|
import { Profile } from '@bigbinary/neeto-team-members-frontend';
|
|
11
|
-
import { Typography, Input, Modal, Dropdown, Spinner, Avatar } from '@bigbinary/neetoui';
|
|
11
|
+
import { Typography, Input, Modal as Modal$1, Dropdown as Dropdown$1, Spinner, Avatar } from '@bigbinary/neetoui';
|
|
12
12
|
import KeyboardShortcuts from './KeyboardShortcuts.js';
|
|
13
13
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
|
-
import { n } from './inject-css-c86de496.js';
|
|
15
14
|
import classnames from 'classnames';
|
|
16
|
-
import { NeetoIcon, Search,
|
|
15
|
+
import { NeetoIcon, Search, Book, Help, Right } from '@bigbinary/neeto-icons';
|
|
17
16
|
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import { n } from './inject-css-c86de496.js';
|
|
18
18
|
import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
|
|
19
|
-
import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
|
|
20
19
|
import { toLower, omit, mergeDeepLeft } from 'ramda';
|
|
21
20
|
import { t } from 'i18next';
|
|
21
|
+
import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
|
|
22
22
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
|
|
23
23
|
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
24
24
|
import 'zustand/shallow';
|
|
@@ -28,10 +28,10 @@ import '@bigbinary/neetoui/managers';
|
|
|
28
28
|
import '@bigbinary/neeto-hotkeys';
|
|
29
29
|
import 'platform';
|
|
30
30
|
|
|
31
|
-
var css$1 = ".neeto-molecules-
|
|
31
|
+
var css$1 = ".neeto-molecules-product-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-product-switcher__wrapper{padding:32px}}@media screen and (max-width:768px){.neeto-molecules-product-switcher__wrapper{padding:16px}}.neeto-molecules-product-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-product-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}@media only screen and (max-width:640px){.neeto-molecules-product-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(100%,1fr))}}.neeto-molecules-product-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-product-switcher__header{align-items:flex-start;flex-direction:column;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-product-switcher__header h1{font-size:24px}}@media only screen and (max-width:768px){.neeto-molecules-product-switcher_modal-container .neeto-molecules-product-switcher__header-mobile{align-items:flex-start;margin-bottom:24px}}.neeto-molecules-product-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-product-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-product-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-product-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-product-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-product-switcher-link:focus,.neeto-molecules-product-switcher-link:focus-visible{outline:none}.neeto-molecules-product-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-product-switcher-link:not(.neeto-molecules-product-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-product-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-product-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-product-switcher-link__content{flex-grow:1}.neeto-molecules-product-switcher-link__content span{display:block}.neeto-molecules-product-switcher_modal{z-index:100000}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen{display:flex;flex-direction:column;height:100dvh!important;width:100vw!important}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen .neeto-ui-modal__header{flex-shrink:0}.neeto-molecules-product-switcher_modal .neeto-ui-modal__wrapper--fullscreen .neeto-ui-modal__body{flex-grow:1;min-height:0;overflow-y:auto}";
|
|
32
32
|
n(css$1,{});
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var ProductLink = function ProductLink(_ref) {
|
|
35
35
|
var name = _ref.name,
|
|
36
36
|
description = _ref.description,
|
|
37
37
|
url = _ref.url;
|
|
@@ -43,11 +43,11 @@ var AppLink = function AppLink(_ref) {
|
|
|
43
43
|
href: url,
|
|
44
44
|
rel: "noreferrer",
|
|
45
45
|
target: "_blank",
|
|
46
|
-
className: classnames("neeto-molecules-
|
|
47
|
-
"neeto-molecules-
|
|
46
|
+
className: classnames("neeto-molecules-product-switcher-link", {
|
|
47
|
+
"neeto-molecules-product-switcher-link--active": globalProps.appName.includes(name)
|
|
48
48
|
})
|
|
49
49
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
50
|
-
className: classnames("neeto-molecules-
|
|
50
|
+
className: classnames("neeto-molecules-product-switcher-link__icon-holder", {
|
|
51
51
|
"neeto-ui-bg-primary-500": !AppIcon
|
|
52
52
|
})
|
|
53
53
|
}, AppIcon ? /*#__PURE__*/React__default.createElement(AppIcon, {
|
|
@@ -56,7 +56,7 @@ var AppLink = function AppLink(_ref) {
|
|
|
56
56
|
color: "white",
|
|
57
57
|
size: 42
|
|
58
58
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
59
|
-
className: "neeto-molecules-
|
|
59
|
+
className: "neeto-molecules-product-switcher-link__content"
|
|
60
60
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
61
61
|
component: "span",
|
|
62
62
|
lineHeight: "relaxed",
|
|
@@ -68,10 +68,11 @@ var AppLink = function AppLink(_ref) {
|
|
|
68
68
|
weight: "normal"
|
|
69
69
|
}, description)));
|
|
70
70
|
};
|
|
71
|
-
var
|
|
71
|
+
var ProductLink$1 = /*#__PURE__*/React__default.memo(ProductLink);
|
|
72
72
|
|
|
73
|
-
var
|
|
74
|
-
var isMobile = _ref.isMobile
|
|
73
|
+
var Menu = function Menu(_ref) {
|
|
74
|
+
var _ref$isMobile = _ref.isMobile,
|
|
75
|
+
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
75
76
|
var _useTranslation = useTranslation(),
|
|
76
77
|
t = _useTranslation.t;
|
|
77
78
|
var _useState = useState(""),
|
|
@@ -90,140 +91,62 @@ var Body = function Body(_ref) {
|
|
|
90
91
|
var handleSearch = function handleSearch(e) {
|
|
91
92
|
return setSearchTerm(e.target.value);
|
|
92
93
|
};
|
|
93
|
-
return /*#__PURE__*/React__default.createElement(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
95
|
+
className: "neeto-molecules-product-switcher__wrapper",
|
|
96
|
+
"data-cy": "switcher-wrapper",
|
|
97
|
+
"data-testid": "switcher-wrapper",
|
|
98
|
+
key: "switcher-wrapper"
|
|
99
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
100
|
+
"data-cy": "product-switcher-body-wrapper",
|
|
101
|
+
className: classnames("neeto-molecules-product-switcher__header", {
|
|
102
|
+
"neeto-molecules-product-switcher__header-mobile": isMobile
|
|
97
103
|
})
|
|
98
104
|
}, !isMobile && /*#__PURE__*/React__default.createElement(Typography, {
|
|
99
105
|
style: "h1"
|
|
100
|
-
}, t("neetoMolecules.
|
|
101
|
-
className: "neeto-molecules-
|
|
106
|
+
}, t("neetoMolecules.productSwitcher.chooseNeetoProduct")), /*#__PURE__*/React__default.createElement("div", {
|
|
107
|
+
className: "neeto-molecules-product-switcher__search-wrapper"
|
|
102
108
|
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
103
109
|
autoFocus: true,
|
|
104
|
-
"data-cy": "
|
|
105
|
-
placeholder: t("neetoMolecules.
|
|
110
|
+
"data-cy": "product-switcher-search-input",
|
|
111
|
+
placeholder: t("neetoMolecules.productSwitcher.searchProducts"),
|
|
106
112
|
prefix: /*#__PURE__*/React__default.createElement(Search, null),
|
|
107
113
|
type: "search",
|
|
108
114
|
value: searchTerm,
|
|
109
115
|
onChange: handleSearch
|
|
110
116
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
111
|
-
className: classnames("neeto-molecules-
|
|
117
|
+
className: classnames("neeto-molecules-product-switcher__body", _defineProperty({}, "neeto-molecules-product-switcher__body-mobile", isMobile))
|
|
112
118
|
}, (filteredApps === null || filteredApps === void 0 ? void 0 : filteredApps.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
113
|
-
className: "neeto-molecules-
|
|
119
|
+
className: "neeto-molecules-product-switcher__grid"
|
|
114
120
|
}, filteredApps.map(function (app) {
|
|
115
|
-
return /*#__PURE__*/React__default.createElement(
|
|
121
|
+
return /*#__PURE__*/React__default.createElement(ProductLink$1, _extends({
|
|
116
122
|
key: app.name
|
|
117
123
|
}, app));
|
|
118
124
|
})) : /*#__PURE__*/React__default.createElement(Typography, {
|
|
119
125
|
className: "neeto-ui-text-center",
|
|
120
126
|
style: "body1"
|
|
121
|
-
}, t("neetoMolecules.
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
var AppSwitcher = function AppSwitcher(_ref) {
|
|
125
|
-
var _ref$isMobile = _ref.isMobile,
|
|
126
|
-
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
127
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
128
|
-
className: "neeto-molecules-app-switcher__wrapper",
|
|
129
|
-
"data-cy": "switcher-wrapper",
|
|
130
|
-
"data-testid": "switcher-wrapper",
|
|
131
|
-
key: "switcher-wrapper"
|
|
132
|
-
}, /*#__PURE__*/React__default.createElement(Body, {
|
|
133
|
-
isMobile: isMobile
|
|
134
|
-
}));
|
|
127
|
+
}, t("neetoMolecules.productSwitcher.noApps"))));
|
|
135
128
|
};
|
|
136
129
|
|
|
137
|
-
var
|
|
130
|
+
var Modal = withT(function (_ref) {
|
|
138
131
|
var t = _ref.t,
|
|
139
132
|
isOpen = _ref.isOpen,
|
|
140
133
|
onClose = _ref.onClose;
|
|
141
|
-
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
134
|
+
return /*#__PURE__*/React__default.createElement(Modal$1, {
|
|
142
135
|
isOpen: isOpen,
|
|
143
136
|
onClose: onClose,
|
|
144
|
-
backdropClassName: "neeto-molecules-
|
|
137
|
+
backdropClassName: "neeto-molecules-product-switcher_modal",
|
|
145
138
|
size: "fullScreen"
|
|
146
|
-
}, /*#__PURE__*/React__default.createElement(Modal.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
|
|
139
|
+
}, /*#__PURE__*/React__default.createElement(Modal$1.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
|
|
147
140
|
className: "pr-4",
|
|
148
141
|
style: "h2"
|
|
149
|
-
}, t("neetoMolecules.
|
|
150
|
-
className: "neeto-molecules-
|
|
151
|
-
"data-testid": "
|
|
152
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
142
|
+
}, t("neetoMolecules.productSwitcher.chooseNeetoProduct"))), /*#__PURE__*/React__default.createElement(Modal$1.Body, null, /*#__PURE__*/React__default.createElement("div", {
|
|
143
|
+
className: "neeto-molecules-product-switcher_modal-container",
|
|
144
|
+
"data-testid": "product-switcher-modal"
|
|
145
|
+
}, /*#__PURE__*/React__default.createElement(Menu, {
|
|
153
146
|
isMobile: true
|
|
154
147
|
}))));
|
|
155
148
|
});
|
|
156
149
|
|
|
157
|
-
var _excluded$2 = ["isLoading", "onMouseEnter"];
|
|
158
|
-
var MenuItemButton = function MenuItemButton(_ref) {
|
|
159
|
-
var isLoading = _ref.isLoading,
|
|
160
|
-
onMouseEnter = _ref.onMouseEnter,
|
|
161
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
162
|
-
var _useTranslation = useTranslation(),
|
|
163
|
-
t = _useTranslation.t;
|
|
164
|
-
var MenuItem = Dropdown.MenuItem;
|
|
165
|
-
return /*#__PURE__*/React__default.createElement(MenuItem.Button, _extends({
|
|
166
|
-
onMouseEnter: onMouseEnter,
|
|
167
|
-
className: "neeto-molecules-menu-sublist__item-btn",
|
|
168
|
-
"data-cy": "app-switcher-button",
|
|
169
|
-
"data-testid": "app-switcher-button",
|
|
170
|
-
label: t("neetoMolecules.sidebar.productSwitcher"),
|
|
171
|
-
style: "text",
|
|
172
|
-
suffix: isLoading ? /*#__PURE__*/React__default.createElement(Spinner, null) : /*#__PURE__*/React__default.createElement(Right, {
|
|
173
|
-
size: 18
|
|
174
|
-
})
|
|
175
|
-
}, otherProps), t("neetoMolecules.sidebar.productSwitcher"));
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
var AppSwitcherDropdown = function AppSwitcherDropdown() {
|
|
179
|
-
var Menu = Dropdown.Menu,
|
|
180
|
-
MenuItem = Dropdown.MenuItem;
|
|
181
|
-
var _useBreakpoints = useBreakpoints(),
|
|
182
|
-
isSize = _useBreakpoints.isSize;
|
|
183
|
-
var isMobile = isSize("mobile");
|
|
184
|
-
var _useFetchNeetoApps = useFetchNeetoApps(),
|
|
185
|
-
data = _useFetchNeetoApps.data,
|
|
186
|
-
isLoading = _useFetchNeetoApps.isLoading,
|
|
187
|
-
isStale = _useFetchNeetoApps.isStale,
|
|
188
|
-
refetchNeetoApps = _useFetchNeetoApps.refetch;
|
|
189
|
-
var onMouseEnter = function onMouseEnter() {
|
|
190
|
-
if (!isStale) return;
|
|
191
|
-
refetchNeetoApps();
|
|
192
|
-
};
|
|
193
|
-
return /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
194
|
-
className: "neeto-molecules-app-switcher-menu-popup-wrapper",
|
|
195
|
-
closeOnSelect: false,
|
|
196
|
-
customTarget: /*#__PURE__*/React__default.createElement(MenuItemButton, {
|
|
197
|
-
isLoading: isLoading,
|
|
198
|
-
onMouseEnter: onMouseEnter
|
|
199
|
-
}),
|
|
200
|
-
disabled: !data || isLoading,
|
|
201
|
-
interactiveDebounce: 30,
|
|
202
|
-
isOpen: !data ? false : undefined,
|
|
203
|
-
offset: [0, 5],
|
|
204
|
-
position: "right",
|
|
205
|
-
trigger: isMobile ? "click" : "hover",
|
|
206
|
-
zIndex: 99999,
|
|
207
|
-
dropdownProps: {
|
|
208
|
-
classNames: "neeto-molecules-app-switcher-menu-popup__dropdown"
|
|
209
|
-
}
|
|
210
|
-
}, /*#__PURE__*/React__default.createElement(Menu, null, /*#__PURE__*/React__default.createElement(MenuItem, null, /*#__PURE__*/React__default.createElement(AppSwitcher, null))));
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
var AppSwitcherMenu = function AppSwitcherMenu(_ref) {
|
|
214
|
-
var toggleModal = _ref.toggleModal;
|
|
215
|
-
var _useBreakpoints = useBreakpoints(),
|
|
216
|
-
isSize = _useBreakpoints.isSize;
|
|
217
|
-
var isMobile = isSize("mobile");
|
|
218
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isMobile ? /*#__PURE__*/React__default.createElement(MenuItemButton, {
|
|
219
|
-
"data-cy": "app-switcher-button",
|
|
220
|
-
"data-testid": "app-switcher-button",
|
|
221
|
-
onClick: function onClick() {
|
|
222
|
-
return toggleModal(true);
|
|
223
|
-
}
|
|
224
|
-
}) : /*#__PURE__*/React__default.createElement(AppSwitcherDropdown, null));
|
|
225
|
-
};
|
|
226
|
-
|
|
227
150
|
var shouldShowWhatsNew = function shouldShowWhatsNew() {
|
|
228
151
|
var _window$globalProps, _window$globalProps$u;
|
|
229
152
|
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;
|
|
@@ -267,16 +190,16 @@ var DEFAULT_MENU_LINK_PROPS = {
|
|
|
267
190
|
};
|
|
268
191
|
var NON_BUTTON_PROPS = ["isVisible"];
|
|
269
192
|
|
|
270
|
-
var _excluded$
|
|
193
|
+
var _excluded$2 = ["label", "icon", "changesCount"];
|
|
271
194
|
var LinkSection = function LinkSection(_ref) {
|
|
272
195
|
var links = _ref.links;
|
|
273
|
-
var MenuItem = Dropdown.MenuItem;
|
|
196
|
+
var MenuItem = Dropdown$1.MenuItem;
|
|
274
197
|
if (isNotPresent(links)) return null;
|
|
275
198
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, links.map(function (_ref2, idx) {
|
|
276
199
|
var label = _ref2.label,
|
|
277
200
|
Icon = _ref2.icon,
|
|
278
201
|
changesCount = _ref2.changesCount,
|
|
279
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$
|
|
202
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$2);
|
|
280
203
|
return /*#__PURE__*/React__default.createElement(MenuItem.Button, _extends({
|
|
281
204
|
className: "neeto-molecules-menu-sublist__item-btn",
|
|
282
205
|
"data-cy": "floating-action-menu-link-section",
|
|
@@ -293,6 +216,71 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
293
216
|
}));
|
|
294
217
|
};
|
|
295
218
|
|
|
219
|
+
var _excluded$1 = ["isLoading", "onMouseEnter"];
|
|
220
|
+
var MenuButton = function MenuButton(_ref) {
|
|
221
|
+
var isLoading = _ref.isLoading,
|
|
222
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
223
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
224
|
+
var _useTranslation = useTranslation(),
|
|
225
|
+
t = _useTranslation.t;
|
|
226
|
+
var MenuItem = Dropdown$1.MenuItem;
|
|
227
|
+
return /*#__PURE__*/React__default.createElement(MenuItem.Button, _extends({
|
|
228
|
+
onMouseEnter: onMouseEnter,
|
|
229
|
+
className: "neeto-molecules-menu-sublist__item-btn",
|
|
230
|
+
"data-cy": "product-switcher-button",
|
|
231
|
+
"data-testid": "product-switcher-button",
|
|
232
|
+
label: t("neetoMolecules.sidebar.productSwitcher"),
|
|
233
|
+
style: "text",
|
|
234
|
+
suffix: isLoading ? /*#__PURE__*/React__default.createElement(Spinner, null) : /*#__PURE__*/React__default.createElement(Right, {
|
|
235
|
+
size: 18
|
|
236
|
+
})
|
|
237
|
+
}, otherProps), t("neetoMolecules.sidebar.productSwitcher"));
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
var Dropdown = function Dropdown() {
|
|
241
|
+
var Menu$1 = Dropdown$1.Menu,
|
|
242
|
+
MenuItem = Dropdown$1.MenuItem;
|
|
243
|
+
var _useFetchNeetoApps = useFetchNeetoApps(),
|
|
244
|
+
data = _useFetchNeetoApps.data,
|
|
245
|
+
isLoading = _useFetchNeetoApps.isLoading,
|
|
246
|
+
isStale = _useFetchNeetoApps.isStale,
|
|
247
|
+
refetchNeetoApps = _useFetchNeetoApps.refetch;
|
|
248
|
+
var onMouseEnter = function onMouseEnter() {
|
|
249
|
+
if (!isStale) return;
|
|
250
|
+
refetchNeetoApps();
|
|
251
|
+
};
|
|
252
|
+
return /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
253
|
+
className: "neeto-molecules-product-switcher-menu-popup-wrapper",
|
|
254
|
+
closeOnSelect: false,
|
|
255
|
+
customTarget: /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
256
|
+
isLoading: isLoading,
|
|
257
|
+
onMouseEnter: onMouseEnter
|
|
258
|
+
}),
|
|
259
|
+
disabled: !data || isLoading,
|
|
260
|
+
interactiveDebounce: 30,
|
|
261
|
+
isOpen: !data ? false : undefined,
|
|
262
|
+
offset: [0, 5],
|
|
263
|
+
position: "right",
|
|
264
|
+
trigger: "all",
|
|
265
|
+
zIndex: 99999,
|
|
266
|
+
dropdownProps: {
|
|
267
|
+
classNames: "neeto-molecules-product-switcher-menu-popup__dropdown"
|
|
268
|
+
}
|
|
269
|
+
}, /*#__PURE__*/React__default.createElement(Menu$1, null, /*#__PURE__*/React__default.createElement(MenuItem, null, /*#__PURE__*/React__default.createElement(Menu, null))));
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
273
|
+
var toggleModal = _ref.toggleModal;
|
|
274
|
+
var _useBreakpoints = useBreakpoints(),
|
|
275
|
+
isSize = _useBreakpoints.isSize;
|
|
276
|
+
var isMobile = isSize("mobile");
|
|
277
|
+
return isMobile ? /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
278
|
+
onClick: function onClick() {
|
|
279
|
+
return toggleModal(true);
|
|
280
|
+
}
|
|
281
|
+
}) : /*#__PURE__*/React__default.createElement(Dropdown, null);
|
|
282
|
+
};
|
|
283
|
+
|
|
296
284
|
var ProfileHeader = function ProfileHeader(_ref) {
|
|
297
285
|
var profileInfo = _ref.profileInfo;
|
|
298
286
|
var name = profileInfo.name,
|
|
@@ -326,16 +314,16 @@ var ProfileHeader = function ProfileHeader(_ref) {
|
|
|
326
314
|
|
|
327
315
|
var ProfileMenu = function ProfileMenu(_ref) {
|
|
328
316
|
var profileInfo = _ref.profileInfo,
|
|
329
|
-
|
|
317
|
+
showProductSwitcher = _ref.showProductSwitcher,
|
|
330
318
|
helpLinks = _ref.helpLinks,
|
|
331
319
|
defaultLinks = _ref.defaultLinks,
|
|
332
320
|
topLinks = _ref.topLinks,
|
|
333
321
|
bottomLinks = _ref.bottomLinks,
|
|
334
322
|
customContent = _ref.customContent,
|
|
335
323
|
toggleModal = _ref.toggleModal;
|
|
336
|
-
var Menu = Dropdown.Menu,
|
|
337
|
-
MenuItem = Dropdown.MenuItem,
|
|
338
|
-
Divider = Dropdown.Divider;
|
|
324
|
+
var Menu = Dropdown$1.Menu,
|
|
325
|
+
MenuItem = Dropdown$1.MenuItem,
|
|
326
|
+
Divider = Dropdown$1.Divider;
|
|
339
327
|
return /*#__PURE__*/React__default.createElement(Menu, {
|
|
340
328
|
className: "pb-1"
|
|
341
329
|
}, /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
@@ -344,7 +332,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
344
332
|
"data-testid": "profile-popup"
|
|
345
333
|
}, /*#__PURE__*/React__default.createElement(ProfileHeader, {
|
|
346
334
|
profileInfo: profileInfo
|
|
347
|
-
})),
|
|
335
|
+
})), showProductSwitcher && /*#__PURE__*/React__default.createElement(ProductSwitcher, {
|
|
348
336
|
toggleModal: toggleModal
|
|
349
337
|
}), /*#__PURE__*/React__default.createElement(Divider, null), /*#__PURE__*/React__default.createElement(LinkSection, {
|
|
350
338
|
links: topLinks
|
|
@@ -406,7 +394,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
406
394
|
var ProfileButton = function ProfileButton(_ref) {
|
|
407
395
|
var helpLinkOverrides = _ref.helpLinkOverrides,
|
|
408
396
|
profileInfoOverrides = _ref.profileInfoOverrides,
|
|
409
|
-
|
|
397
|
+
showProductSwitcher = _ref.showProductSwitcher,
|
|
410
398
|
bottomLinks = _ref.bottomLinks,
|
|
411
399
|
topLinks = _ref.topLinks,
|
|
412
400
|
customContent = _ref.customContent;
|
|
@@ -470,7 +458,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
470
458
|
var hide = _ref3.hide;
|
|
471
459
|
return !hide;
|
|
472
460
|
});
|
|
473
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Profile.Pane, null), /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
461
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Profile.Pane, null), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
474
462
|
isMultiLevel: true,
|
|
475
463
|
appendTo: function appendTo() {
|
|
476
464
|
return document.body;
|
|
@@ -485,7 +473,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
485
473
|
position: "right-end",
|
|
486
474
|
strategy: "fixed",
|
|
487
475
|
theme: "light",
|
|
488
|
-
trigger: "
|
|
476
|
+
trigger: "all",
|
|
489
477
|
zIndex: 99999,
|
|
490
478
|
customTarget: /*#__PURE__*/React__default.createElement("button", {
|
|
491
479
|
className: "neeto-molecules-floating-action-button",
|
|
@@ -505,7 +493,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
505
493
|
defaultLinks: defaultLinks,
|
|
506
494
|
helpLinks: helpLinks,
|
|
507
495
|
profileInfo: profileInfo,
|
|
508
|
-
|
|
496
|
+
showProductSwitcher: showProductSwitcher,
|
|
509
497
|
bottomLinks: newBottomLinks,
|
|
510
498
|
toggleModal: setIsModalOpen,
|
|
511
499
|
topLinks: newTopLinks
|
|
@@ -513,7 +501,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
513
501
|
className: "neeto-molecules-menu__notif-count",
|
|
514
502
|
"data-cy": "help-icon-changes-count",
|
|
515
503
|
"data-testid": "help-icon-changes-count"
|
|
516
|
-
}, changesCount), /*#__PURE__*/React__default.createElement(
|
|
504
|
+
}, changesCount), /*#__PURE__*/React__default.createElement(Modal, {
|
|
517
505
|
isOpen: isModalOpen,
|
|
518
506
|
onClose: function onClose() {
|
|
519
507
|
return setIsModalOpen(false);
|
|
@@ -521,10 +509,10 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
521
509
|
}));
|
|
522
510
|
};
|
|
523
511
|
|
|
524
|
-
var css = ":root{--neeto-molecules-floating-menu-z-index:99999}.neeto-molecules-floating-action-menu__container{background-color:rgb(var(--neeto-ui-white));border-bottom-right-radius:30px;border-top-right-radius:30px;bottom:16px;left:0;position:fixed;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button{align-items:center;background-color:rgba(var(--neeto-ui-primary-500),.6);border-bottom-right-radius:30px;border-color:rgba(var(--neeto-ui-primary-500),.6);border-top-right-radius:30px;display:flex;justify-content:center;padding:4px}.neeto-molecules-floating-action-button__profile-avatar{border:2px solid #fff;border-radius:100px}.neeto-molecules-floating-action-button__profile-avatar .neeto-ui-avatar{height:100%!important;width:100%!important}.neeto-molecules-floating-action-button__dropdown{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;flex-shrink:0;max-height:none!important;max-width:none;width:256px;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button__dropdown ul{padding-top:0!important}.neeto-molecules-
|
|
512
|
+
var css = ":root{--neeto-molecules-floating-menu-z-index:99999}.neeto-molecules-floating-action-menu__container{background-color:rgb(var(--neeto-ui-white));border-bottom-right-radius:30px;border-top-right-radius:30px;bottom:16px;left:0;position:fixed;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button{align-items:center;background-color:rgba(var(--neeto-ui-primary-500),.6);border-bottom-right-radius:30px;border-color:rgba(var(--neeto-ui-primary-500),.6);border-top-right-radius:30px;display:flex;justify-content:center;padding:4px}.neeto-molecules-floating-action-button__profile-avatar{border:2px solid #fff;border-radius:100px}.neeto-molecules-floating-action-button__profile-avatar .neeto-ui-avatar{height:100%!important;width:100%!important}.neeto-molecules-floating-action-button__dropdown{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;flex-shrink:0;max-height:none!important;max-width:none;width:256px;z-index:99999;z-index:var(--neeto-molecules-floating-menu-z-index)}.neeto-molecules-floating-action-button__dropdown ul{padding-top:0!important}.neeto-molecules-product-switcher-menu-popup__dropdown{max-height:none!important;max-width:none}.neeto-molecules-menu__notif-count{position:absolute;right:3px;top:3px;z-index:1}.neeto-molecules-menu-list__item-btn-count,.neeto-molecules-menu__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:flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:15px;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:15px}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;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-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-content{padding:0}.neeto-ui-dropdown__popup .neeto-molecules-product-switcher-menu-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-menu-sublist__item-btn{font-weight:500!important;height:40px}.neeto-molecules-menu-sublist__item-btn[data-btn-weight=bold]{font-weight:700!important}.neeto-molecules-menu-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-menu-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-menu-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-product-switcher-menu-popup-wrapper{height:95vh;overflow-y:auto;width:calc(100vw - 400px)}.neeto-molecules-floating-action-button__profile-wrapper-custom-content:hover{background-color:rgb(var(--neeto-ui-white))!important}";
|
|
525
513
|
n(css,{});
|
|
526
514
|
|
|
527
|
-
var _excluded = ["profileInfoOverrides", "helpLinkOverrides", "topLinks", "bottomLinks", "
|
|
515
|
+
var _excluded = ["profileInfoOverrides", "helpLinkOverrides", "topLinks", "bottomLinks", "showProductSwitcher", "customContent"];
|
|
528
516
|
var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
529
517
|
var _ref$profileInfoOverr = _ref.profileInfoOverrides,
|
|
530
518
|
profileInfoOverrides = _ref$profileInfoOverr === void 0 ? {} : _ref$profileInfoOverr,
|
|
@@ -534,8 +522,8 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
534
522
|
topLinks = _ref$topLinks === void 0 ? [] : _ref$topLinks,
|
|
535
523
|
_ref$bottomLinks = _ref.bottomLinks,
|
|
536
524
|
bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
|
|
537
|
-
_ref$
|
|
538
|
-
|
|
525
|
+
_ref$showProductSwitc = _ref.showProductSwitcher,
|
|
526
|
+
showProductSwitcher = _ref$showProductSwitc === void 0 ? true : _ref$showProductSwitc,
|
|
539
527
|
customContent = _ref.customContent,
|
|
540
528
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
541
529
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
@@ -548,7 +536,7 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
548
536
|
customContent: customContent,
|
|
549
537
|
helpLinkOverrides: helpLinkOverrides,
|
|
550
538
|
profileInfoOverrides: profileInfoOverrides,
|
|
551
|
-
|
|
539
|
+
showProductSwitcher: showProductSwitcher,
|
|
552
540
|
topLinks: topLinks
|
|
553
541
|
}));
|
|
554
542
|
});
|
|
@@ -587,9 +575,9 @@ FloatingActionMenu.propTypes = {
|
|
|
587
575
|
*/
|
|
588
576
|
helpLinkOverrides: propTypes.exports.object,
|
|
589
577
|
/**
|
|
590
|
-
* To display the
|
|
578
|
+
* To display the product switcher menu option.
|
|
591
579
|
*/
|
|
592
|
-
|
|
580
|
+
showProductSwitcher: propTypes.exports.bool
|
|
593
581
|
};
|
|
594
582
|
|
|
595
583
|
export { FloatingActionMenu as default };
|