@bigbinary/neeto-molecules 4.1.45 → 4.1.47
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/ConfigureView-DD3TW3Z8.js +393 -0
- package/dist/ConfigureView-DD3TW3Z8.js.map +1 -0
- package/dist/FloatingActionMenu.js +22 -10
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/Sidebar.js +1 -2
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/ConfigureView-CIHmB-58.js +409 -0
- package/dist/cjs/ConfigureView-CIHmB-58.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +22 -10
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/Sidebar.js +1 -2
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/v2/ConfigurePageSidebar.js +55 -0
- package/dist/cjs/v2/ConfigurePageSidebar.js.map +1 -0
- package/dist/cjs/v2/Sidebar.js +648 -0
- package/dist/cjs/v2/Sidebar.js.map +1 -0
- package/dist/v2/ConfigurePageSidebar.js +53 -0
- package/dist/v2/ConfigurePageSidebar.js.map +1 -0
- package/dist/v2/Sidebar.js +627 -0
- package/dist/v2/Sidebar.js.map +1 -0
- package/package.json +14 -2
- package/types/v2/ConfigurePageSidebar.d.ts +16 -0
- package/types/v2/Sidebar.d.ts +41 -0
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
6
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
7
|
+
var useLocalStorage = require('@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage');
|
|
8
|
+
var ramda = require('ramda');
|
|
9
|
+
var reactI18next = require('react-i18next');
|
|
10
|
+
var reactRouterDom = require('react-router-dom');
|
|
11
|
+
var useKeyboardShortcutsPaneState = require('../useKeyboardShortcutsPaneState-BrgdLb9F.js');
|
|
12
|
+
var ConfigureView = require('../ConfigureView-CIHmB-58.js');
|
|
13
|
+
var classnames = require('classnames');
|
|
14
|
+
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
15
|
+
var Neeto = require('@bigbinary/neeto-icons/typeface-logos/Neeto');
|
|
16
|
+
var AppIcons = require('@bigbinary/neeto-icons/typeface-logos');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
18
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
19
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
20
|
+
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
21
|
+
require('zustand/shallow');
|
|
22
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
23
|
+
require('zustand');
|
|
24
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
25
|
+
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
26
|
+
require('@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint');
|
|
27
|
+
require('@bigbinary/neeto-filters-frontend/Segments');
|
|
28
|
+
|
|
29
|
+
function _interopNamespaceDefault(e) {
|
|
30
|
+
var n = Object.create(null);
|
|
31
|
+
if (e) {
|
|
32
|
+
Object.keys(e).forEach(function (k) {
|
|
33
|
+
if (k !== 'default') {
|
|
34
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
35
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return e[k]; }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
n.default = e;
|
|
43
|
+
return Object.freeze(n);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var AppIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(AppIcons);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @license lucide-react v1.7.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
const __iconNode$2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
57
|
+
const ChevronRight = ConfigureView.createLucideIcon("chevron-right", __iconNode$2);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @license lucide-react v1.7.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const __iconNode$1 = [
|
|
68
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
69
|
+
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
70
|
+
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
71
|
+
];
|
|
72
|
+
const Ellipsis = ConfigureView.createLucideIcon("ellipsis", __iconNode$1);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @license lucide-react v1.7.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const __iconNode = [
|
|
83
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
84
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
85
|
+
];
|
|
86
|
+
const Plus = ConfigureView.createLucideIcon("plus", __iconNode);
|
|
87
|
+
|
|
88
|
+
var Header$1 = function Header(_ref) {
|
|
89
|
+
var _ProductTypefaceLogos;
|
|
90
|
+
var customLogo = _ref.customLogo,
|
|
91
|
+
clearSettingsNav = _ref.clearSettingsNav;
|
|
92
|
+
var productName = initializers.globalProps.appName.substr(5);
|
|
93
|
+
var normalizedName = (productName || "").trim().toLowerCase();
|
|
94
|
+
var specialCase = ConfigureView.SPECIAL_APP_NAMES[normalizedName];
|
|
95
|
+
var logoName = specialCase ? "Neeto".concat(specialCase) : "Neeto".concat(neetoCist.capitalize(normalizedName));
|
|
96
|
+
var ProductTypefaceLogo = (_ProductTypefaceLogos = AppIcons__namespace[logoName]) !== null && _ProductTypefaceLogos !== void 0 ? _ProductTypefaceLogos : Neeto;
|
|
97
|
+
var LogoComponent = customLogo !== null && customLogo !== void 0 ? customLogo : ProductTypefaceLogo;
|
|
98
|
+
var isOnboarded = initializers.globalProps.user.isOnboarded !== false;
|
|
99
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
100
|
+
className: "px-4 py-3",
|
|
101
|
+
"data-testid": "sidebar-info",
|
|
102
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Link, {
|
|
103
|
+
to: ConfigureView.DEFAULT_HOME_PATH,
|
|
104
|
+
className: classnames("block w-full", {
|
|
105
|
+
"cursor-pointer": isOnboarded,
|
|
106
|
+
"pointer-events-none": !isOnboarded
|
|
107
|
+
}),
|
|
108
|
+
onClick: clearSettingsNav,
|
|
109
|
+
children: initializers.globalProps.sidebarTitle ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
110
|
+
className: "text-sidebar-foreground text-xl leading-9 font-bold",
|
|
111
|
+
children: initializers.globalProps.sidebarTitle
|
|
112
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(LogoComponent, {
|
|
113
|
+
className: "h-9 w-auto max-w-full"
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
var Header = /*#__PURE__*/React.memo(Header$1);
|
|
119
|
+
|
|
120
|
+
/* eslint-disable @bigbinary/neeto/use-neetoui-classes */
|
|
121
|
+
var AddAction = function AddAction(_ref) {
|
|
122
|
+
var actions = _ref.actions;
|
|
123
|
+
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.DropdownMenu, {
|
|
124
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuTrigger, {
|
|
125
|
+
asChild: true,
|
|
126
|
+
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
127
|
+
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-sidebar-ring absolute end-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden focus-visible:ring-2 md:opacity-0 md:group-focus-within/menu-item:opacity-100 md:group-hover/menu-item:opacity-100",
|
|
128
|
+
"data-testid": "add-dropdown-trigger",
|
|
129
|
+
onClick: function onClick(e) {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
e.stopPropagation();
|
|
132
|
+
},
|
|
133
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Plus, {})
|
|
134
|
+
})
|
|
135
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuContent, {
|
|
136
|
+
align: "end",
|
|
137
|
+
side: "bottom",
|
|
138
|
+
children: actions.map(function (action) {
|
|
139
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuItem, {
|
|
140
|
+
onSelect: function onSelect() {
|
|
141
|
+
var _action$onClick;
|
|
142
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action);
|
|
143
|
+
},
|
|
144
|
+
children: action.label
|
|
145
|
+
}, action.key);
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
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; }
|
|
152
|
+
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), true).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; }
|
|
153
|
+
var PinIcon = function PinIcon(_ref) {
|
|
154
|
+
var size = _ref.size,
|
|
155
|
+
otherProps = _ref.otherProps;
|
|
156
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$3(_objectSpread$3({
|
|
157
|
+
fill: "currentColor",
|
|
158
|
+
height: size,
|
|
159
|
+
viewBox: "0 -960 960 960",
|
|
160
|
+
width: size,
|
|
161
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
162
|
+
}, otherProps), {}, {
|
|
163
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
164
|
+
d: "m640-480 80 80v80H520v240l-40 40-40-40v-240H240v-80l80-80v-280h-40v-80h400v80h-40zm-286 80h252l-46-46v-314H400v314zm126 0"
|
|
165
|
+
})
|
|
166
|
+
}));
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
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; }
|
|
170
|
+
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), true).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; }
|
|
171
|
+
var UnpinIcon = function UnpinIcon(_ref) {
|
|
172
|
+
var size = _ref.size,
|
|
173
|
+
otherProps = _ref.otherProps;
|
|
174
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread$2(_objectSpread$2({
|
|
175
|
+
fill: "currentColor",
|
|
176
|
+
height: size,
|
|
177
|
+
viewBox: "0 -960 960 960",
|
|
178
|
+
width: size,
|
|
179
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
180
|
+
}, otherProps), {}, {
|
|
181
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
182
|
+
d: "m640-480 80 80v80H520v240l-40 40-40-40v-240H240v-80l80-80v-280h-40v-80h400v80h-40z"
|
|
183
|
+
})
|
|
184
|
+
}));
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
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; }
|
|
188
|
+
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), true).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; }
|
|
189
|
+
var MoreDropdown = function MoreDropdown(_ref) {
|
|
190
|
+
var moreNavLinks = _ref.moreNavLinks,
|
|
191
|
+
isNavLinkPinned = _ref.isNavLinkPinned,
|
|
192
|
+
handleTogglePin = _ref.handleTogglePin;
|
|
193
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
194
|
+
t = _useTranslation.t;
|
|
195
|
+
var _useState = React.useState(false),
|
|
196
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
197
|
+
isOpen = _useState2[0],
|
|
198
|
+
setIsOpen = _useState2[1];
|
|
199
|
+
var isRTL = document.documentElement.dir === "rtl";
|
|
200
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarMenuItem, {
|
|
201
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.DropdownMenu, {
|
|
202
|
+
open: isOpen,
|
|
203
|
+
onOpenChange: setIsOpen,
|
|
204
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuTrigger, {
|
|
205
|
+
asChild: true,
|
|
206
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
207
|
+
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex w-full items-center gap-2 rounded-md p-2 text-sm outline-hidden",
|
|
208
|
+
"data-testid": "more-nav-links-dropdown-button",
|
|
209
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Ellipsis, {}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
210
|
+
className: "truncate",
|
|
211
|
+
children: t("neetoMolecules.sidebar.more")
|
|
212
|
+
})]
|
|
213
|
+
})
|
|
214
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuContent, {
|
|
215
|
+
align: "start",
|
|
216
|
+
className: "z-[99999] p-0",
|
|
217
|
+
"data-testid": "more-nav-links-dropdown-menu",
|
|
218
|
+
side: isRTL ? "left" : "right",
|
|
219
|
+
children: moreNavLinks.filter(ConfigureView.filterByPermissions).map(function (navLink, index) {
|
|
220
|
+
var label = navLink.label,
|
|
221
|
+
icon = navLink.icon,
|
|
222
|
+
navLinkKey = navLink.key,
|
|
223
|
+
to = navLink.to,
|
|
224
|
+
onClick = navLink.onClick,
|
|
225
|
+
tag = navLink.tag;
|
|
226
|
+
var IconSVG = icon;
|
|
227
|
+
var isPinned = isNavLinkPinned(navLink);
|
|
228
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenuItem, {
|
|
229
|
+
"data-testid": label,
|
|
230
|
+
onSelect: function onSelect(e) {
|
|
231
|
+
return e.preventDefault();
|
|
232
|
+
},
|
|
233
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ConfigureView.CheckPointNavLinks, {
|
|
234
|
+
onClick: onClick,
|
|
235
|
+
to: to,
|
|
236
|
+
className: "flex w-full cursor-pointer items-center justify-between gap-2 px-2 py-1",
|
|
237
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
238
|
+
className: "flex min-w-0 flex-grow items-center gap-2",
|
|
239
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(IconSVG, {
|
|
240
|
+
className: "flex-shrink-0",
|
|
241
|
+
size: 20
|
|
242
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
243
|
+
className: "flex min-w-0 flex-grow items-center gap-2",
|
|
244
|
+
children: [label, tag && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, _objectSpread$1({}, tag))]
|
|
245
|
+
})]
|
|
246
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipProvider, {
|
|
247
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Tooltip, {
|
|
248
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipTrigger, {
|
|
249
|
+
asChild: true,
|
|
250
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
|
|
251
|
+
className: "flex-shrink-0",
|
|
252
|
+
"data-testid": "pin-button",
|
|
253
|
+
size: "icon-sm",
|
|
254
|
+
variant: "ghost",
|
|
255
|
+
onClick: function onClick(event) {
|
|
256
|
+
return handleTogglePin(navLink, event);
|
|
257
|
+
},
|
|
258
|
+
children: isPinned ? /*#__PURE__*/jsxRuntime.jsx(UnpinIcon, {
|
|
259
|
+
otherProps: {},
|
|
260
|
+
size: 16
|
|
261
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(PinIcon, {
|
|
262
|
+
otherProps: {},
|
|
263
|
+
size: 16
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.TooltipContent, {
|
|
267
|
+
side: "right",
|
|
268
|
+
children: isPinned ? t("neetoMolecules.sidebar.unpin") : t("neetoMolecules.sidebar.pin")
|
|
269
|
+
})]
|
|
270
|
+
})
|
|
271
|
+
})]
|
|
272
|
+
})
|
|
273
|
+
}, navLinkKey || index);
|
|
274
|
+
})
|
|
275
|
+
})]
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
var _excluded = ["label", "to", "icon", "items", "isConfigureNavLink", "isCountsLoading", "count", "component", "onClick", "addActions", "tag"];
|
|
281
|
+
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; }
|
|
282
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).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; }
|
|
283
|
+
var renderCount = function renderCount(count) {
|
|
284
|
+
return count > 999 ? "999+" : count;
|
|
285
|
+
};
|
|
286
|
+
var NavLinks = function NavLinks(_ref) {
|
|
287
|
+
var navLinks = _ref.navLinks,
|
|
288
|
+
moreNavLinks = _ref.moreNavLinks,
|
|
289
|
+
isCountsLoadingDeprecated = _ref.isCountsLoading,
|
|
290
|
+
setSelectedNavLinkRoute = _ref.setSelectedNavLinkRoute;
|
|
291
|
+
var location = reactRouterDom.useLocation();
|
|
292
|
+
var _useState = React.useState([]),
|
|
293
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
294
|
+
expandedNavLinkKeys = _useState2[0],
|
|
295
|
+
setExpandedNavLinkKeys = _useState2[1];
|
|
296
|
+
var _useLocalStorage = useLocalStorage(ConfigureView.PINNED_MORE_NAV_LINKS_KEY, []),
|
|
297
|
+
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
298
|
+
pinnedNavLinks = _useLocalStorage2[0],
|
|
299
|
+
setPinnedNavLinks = _useLocalStorage2[1];
|
|
300
|
+
var handleNavLinkClick = function handleNavLinkClick(_ref2) {
|
|
301
|
+
var event = _ref2.event,
|
|
302
|
+
isActive = _ref2.isActive,
|
|
303
|
+
navLink = _ref2.navLink;
|
|
304
|
+
var isExpandable = neetoCist.isPresent(navLink.items) || neetoCist.isPresent(navLink.component);
|
|
305
|
+
if (!isExpandable) {
|
|
306
|
+
setExpandedNavLinkKeys([]);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (navLink.isConfigureNavLink && neetoCist.isNotEmpty(navLink.items)) {
|
|
310
|
+
setSelectedNavLinkRoute(navLink.to);
|
|
311
|
+
}
|
|
312
|
+
var navLinkKey = navLink.key || navLink.to;
|
|
313
|
+
if (isActive()) {
|
|
314
|
+
var isExpanded = expandedNavLinkKeys.includes(navLinkKey);
|
|
315
|
+
setExpandedNavLinkKeys(isExpanded ? [] : [navLinkKey]);
|
|
316
|
+
navLink.resetPath !== true && event.preventDefault();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
setExpandedNavLinkKeys([navLinkKey]);
|
|
320
|
+
};
|
|
321
|
+
var handleTogglePin = function handleTogglePin(navLink, event) {
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
event.stopPropagation();
|
|
324
|
+
var navLinkKey = navLink.key || navLink.to;
|
|
325
|
+
var isPinned = pinnedNavLinks.includes(navLinkKey);
|
|
326
|
+
if (isPinned) {
|
|
327
|
+
setPinnedNavLinks(pinnedNavLinks.filter(neetoCist.isNot(navLinkKey)));
|
|
328
|
+
} else {
|
|
329
|
+
setPinnedNavLinks([].concat(_toConsumableArray(pinnedNavLinks), [navLinkKey]));
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
var isNavLinkPinned = function isNavLinkPinned(navLink) {
|
|
333
|
+
if (!navLink) return false;
|
|
334
|
+
var navLinkKey = navLink.key || navLink.to;
|
|
335
|
+
return pinnedNavLinks.includes(navLinkKey);
|
|
336
|
+
};
|
|
337
|
+
var pinnedItems = moreNavLinks ? moreNavLinks.filter(isNavLinkPinned) : [];
|
|
338
|
+
var activeMoreNavLink = moreNavLinks ? moreNavLinks.find(function (navLink) {
|
|
339
|
+
return navLink && (location.pathname + location.search).startsWith(navLink.to);
|
|
340
|
+
}) : null;
|
|
341
|
+
var additionalItems = _toConsumableArray(pinnedItems);
|
|
342
|
+
if (activeMoreNavLink && !isNavLinkPinned(activeMoreNavLink)) {
|
|
343
|
+
additionalItems.push(activeMoreNavLink);
|
|
344
|
+
}
|
|
345
|
+
var combinedNavLinks = [].concat(_toConsumableArray(navLinks), _toConsumableArray(additionalItems));
|
|
346
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarGroup, {
|
|
347
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarGroupContent, {
|
|
348
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.SidebarMenu, {
|
|
349
|
+
className: "gap-1",
|
|
350
|
+
children: [combinedNavLinks.filter(ConfigureView.filterByPermissions).map(function (navLink, index) {
|
|
351
|
+
var label = navLink.label,
|
|
352
|
+
to = navLink.to,
|
|
353
|
+
icon = navLink.icon,
|
|
354
|
+
items = navLink.items,
|
|
355
|
+
isConfigureNavLink = navLink.isConfigureNavLink,
|
|
356
|
+
_navLink$isCountsLoad = navLink.isCountsLoading,
|
|
357
|
+
isCountsLoading = _navLink$isCountsLoad === void 0 ? false : _navLink$isCountsLoad,
|
|
358
|
+
_navLink$count = navLink.count,
|
|
359
|
+
count = _navLink$count === void 0 ? null : _navLink$count,
|
|
360
|
+
Component = navLink.component,
|
|
361
|
+
_onClick = navLink.onClick,
|
|
362
|
+
_navLink$addActions = navLink.addActions,
|
|
363
|
+
addActions = _navLink$addActions === void 0 ? [] : _navLink$addActions,
|
|
364
|
+
tag = navLink.tag,
|
|
365
|
+
otherProps = _objectWithoutProperties(navLink, _excluded);
|
|
366
|
+
var IconSVG = icon;
|
|
367
|
+
var url = new URL(to, window.location.href);
|
|
368
|
+
var isActive = function isActive() {
|
|
369
|
+
return ramda.is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
|
|
370
|
+
};
|
|
371
|
+
var isExpandable = items || Component;
|
|
372
|
+
var navLinkKey = navLink.key || navLink.to;
|
|
373
|
+
var isMenuExpanded = expandedNavLinkKeys.includes(navLinkKey) && !isCountsLoadingDeprecated;
|
|
374
|
+
var handleCaretClick = function handleCaretClick(event) {
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
event.stopPropagation();
|
|
377
|
+
setExpandedNavLinkKeys(function (keys) {
|
|
378
|
+
return keys.includes(navLinkKey) ? keys.filter(neetoCist.isNot(navLinkKey)) : ramda.append(navLinkKey, keys);
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
382
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.SidebarMenuItem, {
|
|
383
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarMenuButton, {
|
|
384
|
+
asChild: true,
|
|
385
|
+
isActive: isActive(),
|
|
386
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ConfigureView.CheckPointNavLinks, _objectSpread(_objectSpread({
|
|
387
|
+
activeClassName: "active",
|
|
388
|
+
className: "font-medium",
|
|
389
|
+
"data-testid": "navlink-".concat(neetoCist.hyphenate(label)),
|
|
390
|
+
onClick: function onClick(event) {
|
|
391
|
+
handleNavLinkClick({
|
|
392
|
+
event: event,
|
|
393
|
+
isActive: isActive,
|
|
394
|
+
navLink: navLink
|
|
395
|
+
});
|
|
396
|
+
_onClick === null || _onClick === void 0 || _onClick(event);
|
|
397
|
+
}
|
|
398
|
+
}, _objectSpread({
|
|
399
|
+
isActive: isActive,
|
|
400
|
+
to: to
|
|
401
|
+
}, otherProps)), {}, {
|
|
402
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
403
|
+
className: "relative",
|
|
404
|
+
"data-testid": label,
|
|
405
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(IconSVG, {}), neetoCist.isPresent(count) && !isCountsLoading && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
406
|
+
className: "bg-destructive text-destructive-foreground absolute -end-1.5 -top-1.5 flex h-4 min-w-4 items-center justify-center rounded-full px-0.5 text-[10px]",
|
|
407
|
+
children: renderCount(count)
|
|
408
|
+
})]
|
|
409
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
410
|
+
className: "flex-grow truncate",
|
|
411
|
+
children: label
|
|
412
|
+
}), tag && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, _objectSpread({}, tag)), isExpandable && !isConfigureNavLink && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
413
|
+
className: "ms-auto shrink-0 transition-transform duration-200",
|
|
414
|
+
role: "button",
|
|
415
|
+
tabIndex: -1,
|
|
416
|
+
style: {
|
|
417
|
+
transform: isMenuExpanded ? "rotate(90deg)" : "rotate(0deg)"
|
|
418
|
+
},
|
|
419
|
+
onClick: handleCaretClick,
|
|
420
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ChevronRight, {
|
|
421
|
+
className: "rtl:rotate-180"
|
|
422
|
+
})
|
|
423
|
+
})]
|
|
424
|
+
}))
|
|
425
|
+
}), neetoCist.isNotEmpty(addActions) && /*#__PURE__*/jsxRuntime.jsx(AddAction, {
|
|
426
|
+
actions: addActions
|
|
427
|
+
})]
|
|
428
|
+
}), isExpandable && !isConfigureNavLink && isMenuExpanded && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
429
|
+
children: [items && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarMenuSub, {
|
|
430
|
+
children: items.filter(ConfigureView.filterByPermissions).map(function (subItem, subIndex) {
|
|
431
|
+
var _subItem$to;
|
|
432
|
+
return /*#__PURE__*/jsxRuntime.jsx(ConfigureView.SubLinkItem, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, subItem), {}, {
|
|
433
|
+
isCountsLoading: isCountsLoading
|
|
434
|
+
})), {}, {
|
|
435
|
+
href: subItem.href,
|
|
436
|
+
isActive: subItem.isActive,
|
|
437
|
+
isSectionHeader: neetoCist.isPresent(subItem.item),
|
|
438
|
+
to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path,
|
|
439
|
+
onClick: subItem.onClick
|
|
440
|
+
}), subIndex);
|
|
441
|
+
})
|
|
442
|
+
}), Component && /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
443
|
+
navLink: navLink
|
|
444
|
+
})]
|
|
445
|
+
})]
|
|
446
|
+
}, navLink.key || index);
|
|
447
|
+
}), neetoCist.isNotEmpty(moreNavLinks) && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
448
|
+
handleTogglePin: handleTogglePin,
|
|
449
|
+
isNavLinkPinned: isNavLinkPinned,
|
|
450
|
+
moreNavLinks: moreNavLinks
|
|
451
|
+
})]
|
|
452
|
+
})
|
|
453
|
+
})
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
var Sidebar = function Sidebar(_ref) {
|
|
458
|
+
var navLinks = _ref.navLinks,
|
|
459
|
+
_ref$moreNavLinks = _ref.moreNavLinks,
|
|
460
|
+
moreNavLinks = _ref$moreNavLinks === void 0 ? [] : _ref$moreNavLinks,
|
|
461
|
+
customLogo = _ref.customLogo,
|
|
462
|
+
_ref$isCountsLoading = _ref.isCountsLoading,
|
|
463
|
+
isCountsLoading = _ref$isCountsLoading === void 0 ? false : _ref$isCountsLoading,
|
|
464
|
+
_ref$showWorkspaceNam = _ref.showWorkspaceName,
|
|
465
|
+
showWorkspaceName = _ref$showWorkspaceNam === void 0 ? false : _ref$showWorkspaceNam,
|
|
466
|
+
_ref$isExpandable = _ref.isExpandable,
|
|
467
|
+
isExpandable = _ref$isExpandable === void 0 ? true : _ref$isExpandable;
|
|
468
|
+
var _useKeyboardShortcuts = useKeyboardShortcutsPaneState.useKeyboardShortcutsPaneState(),
|
|
469
|
+
_useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 1),
|
|
470
|
+
isKeyboardShortcutsPaneOpen = _useKeyboardShortcuts2[0];
|
|
471
|
+
var _useLocalStorage = useLocalStorage(ConfigureView.SELECTED_NAV_LINK_ROUTE_STORAGE_KEY, null),
|
|
472
|
+
_useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
|
|
473
|
+
selectedNavLinkRoute = _useLocalStorage2[0],
|
|
474
|
+
setSelectedNavLinkRoute = _useLocalStorage2[1];
|
|
475
|
+
var _useLocalStorage3 = useLocalStorage(ConfigureView.getSidebarStateLocalStorageKey(), false),
|
|
476
|
+
_useLocalStorage4 = _slicedToArray(_useLocalStorage3, 2),
|
|
477
|
+
isSidebarCollapsed = _useLocalStorage4[0],
|
|
478
|
+
setIsSidebarCollapsed = _useLocalStorage4[1];
|
|
479
|
+
var _useLocalStorage5 = useLocalStorage(ConfigureView.SIDEBAR_WIDTH_KEY, ConfigureView.DEFAULT_SIDEBAR_WIDTH),
|
|
480
|
+
_useLocalStorage6 = _slicedToArray(_useLocalStorage5, 2),
|
|
481
|
+
sidebarWidthRaw = _useLocalStorage6[0],
|
|
482
|
+
setSidebarWidth = _useLocalStorage6[1];
|
|
483
|
+
var sidebarWidth = typeof sidebarWidthRaw === "string" ? parseInt(sidebarWidthRaw, 10) || ConfigureView.DEFAULT_SIDEBAR_WIDTH : sidebarWidthRaw || ConfigureView.DEFAULT_SIDEBAR_WIDTH;
|
|
484
|
+
var isDraggingRef = React.useRef(false);
|
|
485
|
+
var hasDraggedRef = React.useRef(false);
|
|
486
|
+
var startXRef = React.useRef(null);
|
|
487
|
+
var startWidthRef = React.useRef(null);
|
|
488
|
+
var location = reactRouterDom.useLocation();
|
|
489
|
+
var history = reactRouterDom.useHistory();
|
|
490
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
491
|
+
t = _useTranslation.t;
|
|
492
|
+
var isRTL = document.documentElement.dir === "rtl";
|
|
493
|
+
var sidebarSide = isRTL ? "right" : "left";
|
|
494
|
+
React.useEffect(function () {
|
|
495
|
+
if (isKeyboardShortcutsPaneOpen) {
|
|
496
|
+
setIsSidebarCollapsed(true);
|
|
497
|
+
} else if (window.innerWidth > 768) {
|
|
498
|
+
setIsSidebarCollapsed(false);
|
|
499
|
+
}
|
|
500
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- setIsSidebarCollapsed may not be stable across renders
|
|
501
|
+
}, [isKeyboardShortcutsPaneOpen]);
|
|
502
|
+
React.useEffect(function () {
|
|
503
|
+
if (!neetoCist.isPresent(navLinks)) return;
|
|
504
|
+
var currentLink = ramda.findLast(function (_ref2) {
|
|
505
|
+
var to = _ref2.to,
|
|
506
|
+
isActive = _ref2.isActive;
|
|
507
|
+
var url = new URL(to, window.location.href);
|
|
508
|
+
return ramda.is(Function, isActive) ? isActive() : location.pathname.includes(url.pathname);
|
|
509
|
+
})(navLinks);
|
|
510
|
+
if (neetoCist.isPresent(currentLink)) {
|
|
511
|
+
setSelectedNavLinkRoute(currentLink.isConfigureNavLink ? currentLink.to : null);
|
|
512
|
+
}
|
|
513
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- mount-only: sets initial selected route from current URL
|
|
514
|
+
}, []);
|
|
515
|
+
|
|
516
|
+
// Drag-to-resize via SidebarRail: intercept mousedown to start drag,
|
|
517
|
+
// update --sidebar-width directly on DOM for instant feedback,
|
|
518
|
+
// persist to localStorage on mouseup.
|
|
519
|
+
var handleRailMouseDown = React.useCallback(function (e) {
|
|
520
|
+
if (!isExpandable) return;
|
|
521
|
+
isDraggingRef.current = true;
|
|
522
|
+
hasDraggedRef.current = false;
|
|
523
|
+
startXRef.current = e.clientX;
|
|
524
|
+
startWidthRef.current = sidebarWidth;
|
|
525
|
+
var wrapper = document.querySelector("[data-slot='sidebar-wrapper']");
|
|
526
|
+
if (wrapper) wrapper.dataset.resizing = "true";
|
|
527
|
+
document.body.style.cursor = "col-resize";
|
|
528
|
+
document.body.style.userSelect = "none";
|
|
529
|
+
e.preventDefault();
|
|
530
|
+
}, [sidebarWidth, isExpandable]);
|
|
531
|
+
|
|
532
|
+
// Prevent SidebarRail's built-in toggle when user dragged to resize
|
|
533
|
+
var handleRailClick = React.useCallback(function (e) {
|
|
534
|
+
if (!hasDraggedRef.current) return;
|
|
535
|
+
e.preventDefault();
|
|
536
|
+
e.stopPropagation();
|
|
537
|
+
hasDraggedRef.current = false;
|
|
538
|
+
}, []);
|
|
539
|
+
React.useEffect(function () {
|
|
540
|
+
if (!isExpandable) return undefined;
|
|
541
|
+
var onMouseMove = function onMouseMove(e) {
|
|
542
|
+
if (!isDraggingRef.current) return;
|
|
543
|
+
hasDraggedRef.current = true;
|
|
544
|
+
var dx = e.clientX - startXRef.current;
|
|
545
|
+
// In RTL, dragging right shrinks, dragging left expands
|
|
546
|
+
var rtl = document.documentElement.dir === "rtl";
|
|
547
|
+
var newWidth = startWidthRef.current + (rtl ? -dx : dx);
|
|
548
|
+
newWidth = Math.max(ConfigureView.MIN_SIDEBAR_WIDTH, Math.min(newWidth, ConfigureView.MAX_SIDEBAR_WIDTH));
|
|
549
|
+
var widthRem = "".concat(newWidth / 16, "rem");
|
|
550
|
+
var wrapper = document.querySelector("[data-slot='sidebar-wrapper']");
|
|
551
|
+
if (wrapper) wrapper.style.setProperty("--sidebar-width", widthRem);
|
|
552
|
+
document.documentElement.style.setProperty("--neeto-molecules-sidebar-width", widthRem);
|
|
553
|
+
};
|
|
554
|
+
var onMouseUp = function onMouseUp(e) {
|
|
555
|
+
if (!isDraggingRef.current) return;
|
|
556
|
+
var dx = e.clientX - startXRef.current;
|
|
557
|
+
var rtlUp = document.documentElement.dir === "rtl";
|
|
558
|
+
var finalWidth = startWidthRef.current + (rtlUp ? -dx : dx);
|
|
559
|
+
finalWidth = Math.round(Math.max(ConfigureView.MIN_SIDEBAR_WIDTH, Math.min(finalWidth, ConfigureView.MAX_SIDEBAR_WIDTH)));
|
|
560
|
+
setSidebarWidth(finalWidth);
|
|
561
|
+
var wrapper = document.querySelector("[data-slot='sidebar-wrapper']");
|
|
562
|
+
if (wrapper) delete wrapper.dataset.resizing;
|
|
563
|
+
isDraggingRef.current = false;
|
|
564
|
+
document.body.style.cursor = "";
|
|
565
|
+
document.body.style.userSelect = "";
|
|
566
|
+
};
|
|
567
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
568
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
569
|
+
return function () {
|
|
570
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
571
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
572
|
+
};
|
|
573
|
+
}, [isExpandable, setSidebarWidth]);
|
|
574
|
+
React.useEffect(function () {
|
|
575
|
+
document.documentElement.style.setProperty("--neeto-molecules-sidebar-width", "".concat(sidebarWidth / 16, "rem"));
|
|
576
|
+
}, [sidebarWidth]);
|
|
577
|
+
var handleGoBack = function handleGoBack(event) {
|
|
578
|
+
event.preventDefault();
|
|
579
|
+
setSelectedNavLinkRoute(null);
|
|
580
|
+
var configureNavLink = ConfigureView.getActiveConfigurePageLink({
|
|
581
|
+
navLinks: navLinks,
|
|
582
|
+
location: location
|
|
583
|
+
});
|
|
584
|
+
if (configureNavLink !== null && configureNavLink !== void 0 && configureNavLink.to) {
|
|
585
|
+
history.push(configureNavLink.to);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
var activeLink = React.useMemo(function () {
|
|
589
|
+
return navLinks.find(function (link) {
|
|
590
|
+
if (ramda.is(Function, link.isActive)) return link.isActive();
|
|
591
|
+
var url = new URL(link.to, window.location.href);
|
|
592
|
+
return location.pathname.startsWith(url.pathname);
|
|
593
|
+
});
|
|
594
|
+
}, [location.pathname, navLinks]);
|
|
595
|
+
var isSelectedNavLinkVisible = selectedNavLinkRoute && (activeLink === null || activeLink === void 0 ? void 0 : activeLink.to) === selectedNavLinkRoute && neetoCist.isNotEmpty(navLinks);
|
|
596
|
+
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.SidebarProvider, {
|
|
597
|
+
className: "!w-auto",
|
|
598
|
+
open: !isSidebarCollapsed,
|
|
599
|
+
style: {
|
|
600
|
+
"--sidebar-width": "".concat(sidebarWidth / 16, "rem")
|
|
601
|
+
},
|
|
602
|
+
onOpenChange: function onOpenChange(open) {
|
|
603
|
+
return setIsSidebarCollapsed(!open);
|
|
604
|
+
},
|
|
605
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sidebar, {
|
|
606
|
+
collapsible: "offcanvas",
|
|
607
|
+
side: sidebarSide,
|
|
608
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.SidebarHeader, {
|
|
609
|
+
className: "relative p-0",
|
|
610
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
611
|
+
customLogo: customLogo,
|
|
612
|
+
clearSettingsNav: function clearSettingsNav() {
|
|
613
|
+
return setSelectedNavLinkRoute(null);
|
|
614
|
+
}
|
|
615
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarTrigger, {
|
|
616
|
+
className: "absolute end-2 top-3"
|
|
617
|
+
}), showWorkspaceName && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
618
|
+
className: "border-sidebar-border border-b px-4 py-2",
|
|
619
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h5", {
|
|
620
|
+
className: "text-sidebar-foreground mb-1 text-sm font-semibold",
|
|
621
|
+
children: t("neetoMolecules.sidebar.myWorkspace")
|
|
622
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
623
|
+
className: "text-sidebar-foreground/70 truncate text-xs",
|
|
624
|
+
children: globalProps.organization.name
|
|
625
|
+
})]
|
|
626
|
+
})]
|
|
627
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarContent, {
|
|
628
|
+
children: isSelectedNavLinkVisible ? /*#__PURE__*/jsxRuntime.jsx(ConfigureView.ConfigureView, {
|
|
629
|
+
handleGoBack: handleGoBack,
|
|
630
|
+
navLink: activeLink
|
|
631
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(NavLinks, {
|
|
632
|
+
isCountsLoading: isCountsLoading,
|
|
633
|
+
moreNavLinks: moreNavLinks,
|
|
634
|
+
navLinks: navLinks,
|
|
635
|
+
setSelectedNavLinkRoute: setSelectedNavLinkRoute
|
|
636
|
+
})
|
|
637
|
+
}), isExpandable && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarRail, {
|
|
638
|
+
onClickCapture: handleRailClick,
|
|
639
|
+
onMouseDown: handleRailMouseDown
|
|
640
|
+
})]
|
|
641
|
+
}), isSidebarCollapsed && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.SidebarTrigger, {
|
|
642
|
+
className: "fixed start-2 top-3 z-50"
|
|
643
|
+
})]
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
module.exports = Sidebar;
|
|
648
|
+
//# sourceMappingURL=Sidebar.js.map
|