@bigbinary/neeto-molecules 4.1.68 → 4.1.70
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/AuditLogs.js +1 -0
- package/dist/AuditLogs.js.map +1 -1
- package/dist/cjs/AuditLogs.js +1 -0
- package/dist/cjs/AuditLogs.js.map +1 -1
- package/dist/cjs/v2/AuditLogs.js +24 -26
- package/dist/cjs/v2/AuditLogs.js.map +1 -1
- package/dist/cjs/v2/Container.js +8 -1
- package/dist/cjs/v2/Container.js.map +1 -1
- package/dist/cjs/v2/FloatingActionMenu.js +433 -536
- package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/v2/MenuBar.js +51 -37
- package/dist/cjs/v2/MenuBar.js.map +1 -1
- package/dist/cjs/v2/Search.js +9 -19
- package/dist/cjs/v2/Search.js.map +1 -1
- package/dist/cjs/v2/StickyRibbonsContainer.js +79 -37
- package/dist/cjs/v2/StickyRibbonsContainer.js.map +1 -1
- package/dist/v2/AuditLogs.js +24 -26
- package/dist/v2/AuditLogs.js.map +1 -1
- package/dist/v2/Container.js +8 -1
- package/dist/v2/Container.js.map +1 -1
- package/dist/v2/FloatingActionMenu.js +436 -539
- package/dist/v2/FloatingActionMenu.js.map +1 -1
- package/dist/v2/MenuBar.js +51 -37
- package/dist/v2/MenuBar.js.map +1 -1
- package/dist/v2/Search.js +11 -21
- package/dist/v2/Search.js.map +1 -1
- package/dist/v2/StickyRibbonsContainer.js +81 -39
- package/dist/v2/StickyRibbonsContainer.js.map +1 -1
- package/package.json +7 -7
- package/src/translations/ar.json +37 -36
- package/src/translations/bg.json +37 -36
- package/src/translations/ca.json +37 -36
- package/src/translations/cs.json +37 -36
- package/src/translations/da.json +37 -36
- package/src/translations/de.json +37 -36
- package/src/translations/en.json +34 -34
- package/src/translations/es-MX.json +37 -36
- package/src/translations/es.json +37 -36
- package/src/translations/et.json +37 -36
- package/src/translations/fi.json +37 -36
- package/src/translations/fil.json +37 -36
- package/src/translations/fr.json +37 -36
- package/src/translations/he.json +37 -36
- package/src/translations/hi.json +37 -36
- package/src/translations/hr.json +37 -36
- package/src/translations/hu.json +37 -36
- package/src/translations/id.json +37 -36
- package/src/translations/it.json +37 -36
- package/src/translations/ja.json +37 -36
- package/src/translations/ko.json +37 -36
- package/src/translations/nl.json +37 -36
- package/src/translations/pl.json +37 -36
- package/src/translations/pt-BR.json +37 -36
- package/src/translations/pt.json +37 -36
- package/src/translations/ro.json +37 -36
- package/src/translations/ru.json +37 -36
- package/src/translations/sk.json +37 -36
- package/src/translations/sl.json +37 -36
- package/src/translations/sv.json +37 -36
- package/src/translations/th.json +37 -36
- package/src/translations/tr.json +37 -36
- package/src/translations/uk.json +37 -36
- package/src/translations/vi.json +37 -36
- package/src/translations/zh-CN.json +37 -36
- package/src/translations/zh-TW.json +37 -36
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import { memo, useState, useRef, useEffect, useMemo, forwardRef
|
|
3
|
+
import { memo, useState, useRef, useEffect, useMemo, forwardRef } from 'react';
|
|
4
4
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
-
import { Typography, Spinner, Input, Dialog, Badge, Avatar } from '@bigbinary/neeto-atoms';
|
|
8
|
-
import { Collapsible, CollapsibleTrigger, CollapsibleContent,
|
|
7
|
+
import { Typography, Spinner, Input, Dialog, DropdownMenu, Badge, Avatar } from '@bigbinary/neeto-atoms';
|
|
8
|
+
import { Collapsible, CollapsibleTrigger, DropdownMenuItem, CollapsibleContent, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuSeparator, DropdownMenu as DropdownMenu$1, DropdownMenuTrigger, DropdownMenuContent } from '@bigbinary/neeto-atoms/primitives';
|
|
9
9
|
import { isNotEmpty, isNotPresent, isPresent, truncate, humanize } from '@bigbinary/neeto-cist';
|
|
10
10
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
11
11
|
import { Profile } from '@bigbinary/neeto-team-members-frontend/v2';
|
|
@@ -22,11 +22,10 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
22
22
|
import axios from 'axios';
|
|
23
23
|
import { S as Search } from '../search-DCgpNjip.js';
|
|
24
24
|
import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
|
|
25
|
+
import { t } from 'i18next';
|
|
26
|
+
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
25
27
|
import { C as CircleQuestionMark } from '../circle-question-mark-Dib48f5Z.js';
|
|
26
28
|
import { C as ChevronRight } from '../chevron-right-DcaO-Hlu.js';
|
|
27
|
-
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
28
|
-
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
29
|
-
import { t } from 'i18next';
|
|
30
29
|
import { U as User } from '../user-A843PT-q.js';
|
|
31
30
|
import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
|
|
32
31
|
import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
|
|
@@ -232,8 +231,8 @@ var SPECIAL_APP_NAMES = {
|
|
|
232
231
|
};
|
|
233
232
|
|
|
234
233
|
var _excluded$3 = ["name", "description", "url", "isHighlighted"];
|
|
235
|
-
function ownKeys$
|
|
236
|
-
function _objectSpread$
|
|
234
|
+
function ownKeys$7(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; }
|
|
235
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
237
236
|
var ProductLink = function ProductLink(_ref) {
|
|
238
237
|
var _globalProps, _globalProps2;
|
|
239
238
|
var name = _ref.name,
|
|
@@ -247,7 +246,7 @@ var ProductLink = function ProductLink(_ref) {
|
|
|
247
246
|
var safeName = name || "";
|
|
248
247
|
var appName = "Neeto".concat(safeName.charAt(0)).concat(safeName.slice(1).toLowerCase());
|
|
249
248
|
var AppIcon = specialCase ? AppIcons["Neeto".concat(specialCase)] : AppIcons[appName];
|
|
250
|
-
return /*#__PURE__*/jsxs("a", _objectSpread$
|
|
249
|
+
return /*#__PURE__*/jsxs("a", _objectSpread$7(_objectSpread$7({
|
|
251
250
|
"data-testid": "".concat(normalizedName, "-app-link"),
|
|
252
251
|
href: url,
|
|
253
252
|
rel: "noreferrer",
|
|
@@ -275,8 +274,8 @@ var ProductLink = function ProductLink(_ref) {
|
|
|
275
274
|
};
|
|
276
275
|
var ProductLink$1 = /*#__PURE__*/memo(ProductLink);
|
|
277
276
|
|
|
278
|
-
function ownKeys$
|
|
279
|
-
function _objectSpread$
|
|
277
|
+
function ownKeys$6(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; }
|
|
278
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
280
279
|
var Content = function Content(_ref) {
|
|
281
280
|
var highlightedIndex = _ref.highlightedIndex,
|
|
282
281
|
filteredApps = _ref.filteredApps,
|
|
@@ -294,7 +293,7 @@ var Content = function Content(_ref) {
|
|
|
294
293
|
return (filteredApps === null || filteredApps === void 0 ? void 0 : filteredApps.length) > 0 ? /*#__PURE__*/jsx("div", {
|
|
295
294
|
className: "grid grid-cols-[repeat(auto-fill,minmax(288px,1fr))] gap-3 max-lg:grid-cols-[repeat(auto-fill,minmax(248px,1fr))] max-sm:grid-cols-1",
|
|
296
295
|
children: filteredApps.map(function (app, index) {
|
|
297
|
-
return /*#__PURE__*/jsx(ProductLink$1, _objectSpread$
|
|
296
|
+
return /*#__PURE__*/jsx(ProductLink$1, _objectSpread$6(_objectSpread$6({}, app), {}, {
|
|
298
297
|
"data-highlighted-index": index,
|
|
299
298
|
isHighlighted: index === highlightedIndex
|
|
300
299
|
}), app.name);
|
|
@@ -317,10 +316,10 @@ var neetoAppsApi = {
|
|
|
317
316
|
fetch: fetch$1
|
|
318
317
|
};
|
|
319
318
|
|
|
320
|
-
function ownKeys$
|
|
321
|
-
function _objectSpread$
|
|
319
|
+
function ownKeys$5(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; }
|
|
320
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
322
321
|
var useFetchNeetoApps = function useFetchNeetoApps(options) {
|
|
323
|
-
return useQuery(_objectSpread$
|
|
322
|
+
return useQuery(_objectSpread$5({
|
|
324
323
|
queryKey: [QUERY_KEYS$1.NEETO_APPS_LIST],
|
|
325
324
|
queryFn: neetoAppsApi.fetch,
|
|
326
325
|
staleTime: 5 * 60 * 1000
|
|
@@ -512,141 +511,161 @@ var Modal = withT(function (_ref) {
|
|
|
512
511
|
});
|
|
513
512
|
});
|
|
514
513
|
|
|
515
|
-
var
|
|
514
|
+
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
515
|
+
var DELETE_WORKSPACE_URL = "/auth/organization/delete";
|
|
516
|
+
var ENGAGE_WIDGET_TRIGGER_ID = "neetoengage-trigger";
|
|
517
|
+
var DEFAULT_MENU_LINK_PROPS = {
|
|
518
|
+
engageProps: {
|
|
519
|
+
id: ENGAGE_WIDGET_TRIGGER_ID,
|
|
520
|
+
label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
521
|
+
"data-testid": "help-link-engage-button"
|
|
522
|
+
},
|
|
523
|
+
keyboardShortcutProps: {
|
|
524
|
+
label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
525
|
+
"data-testid": "help-link-keyboard-shortcut-button"
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// Theme switcher
|
|
530
|
+
var APP_THEME_LOCALSTORAGE_KEY = "appTheme";
|
|
531
|
+
var THEMES = {
|
|
532
|
+
LIGHT: "light",
|
|
533
|
+
DARK: "dark"
|
|
534
|
+
};
|
|
516
535
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}));
|
|
536
|
+
// Legacy neetoUI theme classes — kept until full migration is complete.
|
|
537
|
+
var LEGACY_THEMES = {
|
|
538
|
+
LIGHT: "neeto-ui-theme--light",
|
|
539
|
+
DARK: "neeto-ui-theme--dark"
|
|
540
|
+
};
|
|
541
|
+
var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
|
|
542
|
+
var MENU_ITEM_CLASSES = "gap-2.5 px-2.5 py-2 font-medium [&>[data-slot=menu-item-prefix]>svg]:!size-[18px] [&>[data-slot=menu-item-suffix]>svg]:!size-[18px]";
|
|
543
|
+
var THEME_BUTTON_BASE = "relative z-10 flex items-center justify-center gap-1 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none";
|
|
544
|
+
var THEME_ICON_BASE = "transition-transform duration-300 ease-out";
|
|
545
|
+
|
|
546
|
+
var _excluded$2 = ["className"];
|
|
547
|
+
function ownKeys$4(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; }
|
|
548
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
549
|
+
var MenuItem = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
550
|
+
var className = _ref.className,
|
|
551
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
552
|
+
return /*#__PURE__*/jsx(DropdownMenu.MenuItem, _objectSpread$4({
|
|
553
|
+
className: classnames(MENU_ITEM_CLASSES, className),
|
|
554
|
+
ref: forwardedRef
|
|
555
|
+
}, props));
|
|
538
556
|
});
|
|
539
|
-
|
|
557
|
+
MenuItem.displayName = "FloatingActionMenu.MenuItem";
|
|
540
558
|
|
|
541
559
|
var HelpItems = withT(function (_ref) {
|
|
542
560
|
var _globalProps;
|
|
543
561
|
var t = _ref.t;
|
|
544
562
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
545
|
-
children: [/*#__PURE__*/
|
|
546
|
-
className: MENU_ITEM_CLASS$1,
|
|
563
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
547
564
|
"data-testid": "help-link-help-articles-button",
|
|
548
565
|
href: "https://help.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
|
|
566
|
+
prefix: /*#__PURE__*/jsx(BookOpen, {
|
|
567
|
+
size: 18
|
|
568
|
+
}),
|
|
549
569
|
rel: "noreferrer",
|
|
550
570
|
target: "_blank",
|
|
551
|
-
children:
|
|
552
|
-
|
|
553
|
-
}), t("neetoMolecules.sidebar.helpLinks.helpArticles")]
|
|
554
|
-
}), /*#__PURE__*/jsxs("button", {
|
|
555
|
-
className: MENU_ITEM_CLASS$1,
|
|
571
|
+
children: t("neetoMolecules.sidebar.helpLinks.helpArticles")
|
|
572
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
556
573
|
"data-testid": "help-link-live-chat-button",
|
|
557
|
-
|
|
574
|
+
prefix: /*#__PURE__*/jsx(MessageCircleQuestionMark, {
|
|
575
|
+
size: 18
|
|
576
|
+
}),
|
|
558
577
|
onClick: function onClick() {
|
|
559
578
|
var _window$NeetoChat, _window$NeetoChat2;
|
|
560
579
|
(_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
|
|
561
580
|
(_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
|
|
562
581
|
},
|
|
563
|
-
children:
|
|
564
|
-
|
|
565
|
-
}), t("neetoMolecules.sidebar.helpLinks.liveChat")]
|
|
566
|
-
}), /*#__PURE__*/jsxs("a", {
|
|
567
|
-
className: MENU_ITEM_CLASS$1,
|
|
582
|
+
children: t("neetoMolecules.sidebar.helpLinks.liveChat")
|
|
583
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
568
584
|
"data-testid": "help-link-community-button",
|
|
569
585
|
href: "https://www.launchpass.com/neetohq",
|
|
586
|
+
prefix: /*#__PURE__*/jsx(Users, {
|
|
587
|
+
size: 18
|
|
588
|
+
}),
|
|
570
589
|
rel: "noreferrer",
|
|
571
590
|
target: "_blank",
|
|
572
|
-
children:
|
|
573
|
-
|
|
574
|
-
}), t("neetoMolecules.sidebar.helpLinks.askTheCommunity")]
|
|
575
|
-
}), /*#__PURE__*/jsxs("a", {
|
|
576
|
-
className: MENU_ITEM_CLASS$1,
|
|
591
|
+
children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
|
|
592
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
577
593
|
"data-testid": "help-link-status-button",
|
|
578
594
|
href: "https://neetostatus.com/",
|
|
595
|
+
prefix: /*#__PURE__*/jsx(Activity, {
|
|
596
|
+
size: 18
|
|
597
|
+
}),
|
|
579
598
|
rel: "noreferrer",
|
|
580
599
|
target: "_blank",
|
|
581
|
-
children:
|
|
582
|
-
size: 18
|
|
583
|
-
}), t("neetoMolecules.sidebar.helpLinks.systemStatus")]
|
|
600
|
+
children: t("neetoMolecules.sidebar.helpLinks.systemStatus")
|
|
584
601
|
})]
|
|
585
602
|
});
|
|
586
603
|
});
|
|
587
|
-
|
|
604
|
+
|
|
605
|
+
var MobileHelpMenu = function MobileHelpMenu() {
|
|
606
|
+
var _useTranslation = useTranslation(),
|
|
607
|
+
t = _useTranslation.t;
|
|
588
608
|
var _useState = useState(false),
|
|
589
609
|
_useState2 = _slicedToArray(_useState, 2),
|
|
590
610
|
open = _useState2[0],
|
|
591
611
|
setOpen = _useState2[1];
|
|
592
|
-
|
|
593
|
-
var _useBreakpoints = useBreakpoints(),
|
|
594
|
-
isSize = _useBreakpoints.isSize;
|
|
595
|
-
var isMobile = isSize("mobile");
|
|
596
|
-
var handleMouseEnter = useCallback(function () {
|
|
597
|
-
clearTimeout(timeoutRef.current);
|
|
598
|
-
setOpen(true);
|
|
599
|
-
}, []);
|
|
600
|
-
var handleMouseLeave = useCallback(function () {
|
|
601
|
-
timeoutRef.current = setTimeout(function () {
|
|
602
|
-
return setOpen(false);
|
|
603
|
-
}, 150);
|
|
604
|
-
}, []);
|
|
605
|
-
if (isMobile) {
|
|
606
|
-
return /*#__PURE__*/jsxs(Collapsible, {
|
|
607
|
-
open: open,
|
|
608
|
-
onOpenChange: setOpen,
|
|
609
|
-
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
610
|
-
asChild: true,
|
|
611
|
-
children: /*#__PURE__*/jsx(MenuButton$4, {})
|
|
612
|
-
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
613
|
-
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
614
|
-
children: /*#__PURE__*/jsx(HelpItems, {})
|
|
615
|
-
})]
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
return /*#__PURE__*/jsxs(Popover, {
|
|
612
|
+
return /*#__PURE__*/jsxs(Collapsible, {
|
|
619
613
|
open: open,
|
|
620
614
|
onOpenChange: setOpen,
|
|
621
|
-
children: [/*#__PURE__*/jsx(
|
|
615
|
+
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
622
616
|
asChild: true,
|
|
623
|
-
children: /*#__PURE__*/
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
617
|
+
children: /*#__PURE__*/jsxs(DropdownMenuItem, {
|
|
618
|
+
className: classnames("group", MENU_ITEM_CLASSES),
|
|
619
|
+
"data-testid": "help-menu-button",
|
|
620
|
+
onSelect: function onSelect(e) {
|
|
621
|
+
return e.preventDefault();
|
|
628
622
|
},
|
|
629
|
-
|
|
630
|
-
|
|
623
|
+
children: [/*#__PURE__*/jsx(CircleQuestionMark, {
|
|
624
|
+
className: "size-[18px] shrink-0"
|
|
625
|
+
}), /*#__PURE__*/jsx("span", {
|
|
626
|
+
className: "flex-1 truncate",
|
|
627
|
+
children: t("neetoMolecules.sidebar.help")
|
|
628
|
+
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
629
|
+
className: "ms-auto shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
630
|
+
size: 18
|
|
631
|
+
})]
|
|
631
632
|
})
|
|
632
|
-
}), /*#__PURE__*/jsx(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
633
|
+
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
634
|
+
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
635
|
+
children: /*#__PURE__*/jsx(HelpItems, {})
|
|
636
|
+
})]
|
|
637
|
+
});
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
var HelpMenu = function HelpMenu() {
|
|
641
|
+
var _useBreakpoints = useBreakpoints(),
|
|
642
|
+
isSize = _useBreakpoints.isSize;
|
|
643
|
+
var isMobile = isSize("mobile");
|
|
644
|
+
var _useTranslation = useTranslation(),
|
|
645
|
+
t = _useTranslation.t;
|
|
646
|
+
if (isMobile) return /*#__PURE__*/jsx(MobileHelpMenu, {});
|
|
647
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
648
|
+
children: [/*#__PURE__*/jsxs(DropdownMenuSubTrigger, {
|
|
649
|
+
className: MENU_ITEM_CLASSES,
|
|
650
|
+
"data-testid": "help-menu-button",
|
|
651
|
+
children: [/*#__PURE__*/jsx(CircleQuestionMark, {
|
|
652
|
+
className: "size-[18px]"
|
|
653
|
+
}), /*#__PURE__*/jsx("span", {
|
|
654
|
+
className: "flex-1",
|
|
655
|
+
children: t("neetoMolecules.sidebar.help")
|
|
656
|
+
})]
|
|
657
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
658
|
+
className: "z-[99999]",
|
|
659
|
+
collisionPadding: 16,
|
|
636
660
|
sideOffset: 8,
|
|
637
|
-
onMouseEnter: handleMouseEnter,
|
|
638
|
-
onMouseLeave: handleMouseLeave,
|
|
639
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
640
|
-
return e.preventDefault();
|
|
641
|
-
},
|
|
642
661
|
children: /*#__PURE__*/jsx(HelpItems, {})
|
|
643
662
|
})]
|
|
644
663
|
});
|
|
645
664
|
};
|
|
646
665
|
|
|
647
|
-
var _excluded$
|
|
648
|
-
function ownKeys$
|
|
649
|
-
function _objectSpread$
|
|
666
|
+
var _excluded$1 = ["label", "icon", "changesCount", "href"];
|
|
667
|
+
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; }
|
|
668
|
+
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; }
|
|
650
669
|
var LinkSection = function LinkSection(_ref) {
|
|
651
670
|
var links = _ref.links;
|
|
652
671
|
if (isNotPresent(links)) return null;
|
|
@@ -656,25 +675,21 @@ var LinkSection = function LinkSection(_ref) {
|
|
|
656
675
|
Icon = _ref2.icon,
|
|
657
676
|
changesCount = _ref2.changesCount,
|
|
658
677
|
href = _ref2.href,
|
|
659
|
-
otherProps = _objectWithoutProperties(_ref2, _excluded$
|
|
660
|
-
|
|
661
|
-
return /*#__PURE__*/jsxs(Tag, _objectSpread$7(_objectSpread$7(_objectSpread$7({
|
|
662
|
-
className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
|
|
678
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded$1);
|
|
679
|
+
return /*#__PURE__*/jsx(MenuItem, _objectSpread$3(_objectSpread$3(_objectSpread$3({
|
|
663
680
|
"data-testid": "floating-action-menu-link-section",
|
|
664
|
-
|
|
681
|
+
prefix: Icon && /*#__PURE__*/jsx(Icon, {
|
|
682
|
+
size: 18
|
|
683
|
+
}),
|
|
684
|
+
suffix: isPresent(changesCount) && /*#__PURE__*/jsx("span", {
|
|
685
|
+
className: "bg-foreground text-background flex h-[1.125rem] min-w-[1.125rem] items-center justify-center rounded-full px-1 text-[10px] select-none [--accent-foreground:var(--background)]",
|
|
686
|
+
"data-testid": "help-section-menu-changes-count",
|
|
687
|
+
children: changesCount
|
|
688
|
+
})
|
|
665
689
|
}, href ? {
|
|
666
690
|
href: href
|
|
667
691
|
} : {}), otherProps), {}, {
|
|
668
|
-
children:
|
|
669
|
-
size: 18
|
|
670
|
-
}), /*#__PURE__*/jsxs("span", {
|
|
671
|
-
className: "flex flex-grow items-center gap-2",
|
|
672
|
-
children: [label, isPresent(changesCount) && /*#__PURE__*/jsx("span", {
|
|
673
|
-
className: "bg-foreground text-background flex h-[1.125rem] min-w-[1.125rem] shrink-0 items-center justify-center rounded-full px-1 text-[10px] select-none",
|
|
674
|
-
"data-testid": "help-section-menu-changes-count",
|
|
675
|
-
children: changesCount
|
|
676
|
-
})]
|
|
677
|
-
})]
|
|
692
|
+
children: label
|
|
678
693
|
}), idx);
|
|
679
694
|
})
|
|
680
695
|
});
|
|
@@ -705,28 +720,6 @@ var useFetchLoggedInOrganizations = function useFetchLoggedInOrganizations(email
|
|
|
705
720
|
});
|
|
706
721
|
};
|
|
707
722
|
|
|
708
|
-
function ownKeys$6(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; }
|
|
709
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
710
|
-
var MenuButton$3 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
711
|
-
var _useTranslation = useTranslation(),
|
|
712
|
-
t = _useTranslation.t;
|
|
713
|
-
return /*#__PURE__*/jsxs("button", _objectSpread$6(_objectSpread$6({
|
|
714
|
-
ref: ref,
|
|
715
|
-
className: "group hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
|
|
716
|
-
"data-testid": "organization-switcher-button",
|
|
717
|
-
type: "button"
|
|
718
|
-
}, props), {}, {
|
|
719
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
720
|
-
className: "flex-grow text-start",
|
|
721
|
-
children: t("neetoMolecules.sidebar.organizationSwitcher.label")
|
|
722
|
-
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
723
|
-
className: "transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
724
|
-
size: 18
|
|
725
|
-
})]
|
|
726
|
-
}));
|
|
727
|
-
});
|
|
728
|
-
MenuButton$3.displayName = "OrganizationSwitcherMenuButton";
|
|
729
|
-
|
|
730
723
|
var isCurrentSubdomain = function isCurrentSubdomain(link) {
|
|
731
724
|
try {
|
|
732
725
|
var currentSubdomain = window.location.hostname.split(".")[0];
|
|
@@ -736,28 +729,30 @@ var isCurrentSubdomain = function isCurrentSubdomain(link) {
|
|
|
736
729
|
return false;
|
|
737
730
|
}
|
|
738
731
|
};
|
|
732
|
+
|
|
739
733
|
var OrganizationItems = withT(function (_ref) {
|
|
740
734
|
var t = _ref.t,
|
|
741
735
|
organizations = _ref.organizations,
|
|
742
736
|
authAppUrl = _ref.authAppUrl;
|
|
743
737
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
744
738
|
children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
|
|
745
|
-
|
|
739
|
+
var isCurrent = isCurrentSubdomain(organization.organizationUrl);
|
|
740
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
741
|
+
className: classnames({
|
|
742
|
+
"text-green-600": isCurrent
|
|
743
|
+
}),
|
|
746
744
|
href: organization.organizationUrl,
|
|
747
745
|
rel: "noreferrer",
|
|
748
746
|
target: "_blank",
|
|
749
|
-
|
|
750
|
-
"text-green-600": isCurrentSubdomain(organization.organizationUrl)
|
|
751
|
-
}),
|
|
752
|
-
children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsxs(Badge, {
|
|
747
|
+
suffix: isCurrent && /*#__PURE__*/jsxs(Badge, {
|
|
753
748
|
variant: "default",
|
|
754
749
|
children: [/*#__PURE__*/jsx(CircleCheck, {
|
|
755
750
|
size: 12
|
|
756
751
|
}), t("neetoMolecules.sidebar.organizationSwitcher.signedin")]
|
|
757
|
-
})
|
|
752
|
+
}),
|
|
753
|
+
children: organization.orgName
|
|
758
754
|
}, organization.userId);
|
|
759
|
-
}), /*#__PURE__*/jsx(
|
|
760
|
-
className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
|
|
755
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
761
756
|
href: authAppUrl,
|
|
762
757
|
rel: "noreferrer",
|
|
763
758
|
target: "_blank",
|
|
@@ -765,70 +760,75 @@ var OrganizationItems = withT(function (_ref) {
|
|
|
765
760
|
})]
|
|
766
761
|
});
|
|
767
762
|
});
|
|
768
|
-
|
|
769
|
-
|
|
763
|
+
|
|
764
|
+
var MobileOrganizationSwitcher = function MobileOrganizationSwitcher(_ref) {
|
|
765
|
+
var organizations = _ref.organizations,
|
|
766
|
+
authAppUrl = _ref.authAppUrl;
|
|
767
|
+
var _useTranslation = useTranslation(),
|
|
768
|
+
t = _useTranslation.t;
|
|
770
769
|
var _useState = useState(false),
|
|
771
770
|
_useState2 = _slicedToArray(_useState, 2),
|
|
772
771
|
open = _useState2[0],
|
|
773
772
|
setOpen = _useState2[1];
|
|
774
|
-
|
|
773
|
+
return /*#__PURE__*/jsxs(Collapsible, {
|
|
774
|
+
open: open,
|
|
775
|
+
onOpenChange: setOpen,
|
|
776
|
+
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
777
|
+
asChild: true,
|
|
778
|
+
children: /*#__PURE__*/jsxs(DropdownMenuItem, {
|
|
779
|
+
className: classnames("group", MENU_ITEM_CLASSES),
|
|
780
|
+
"data-testid": "organization-switcher-button",
|
|
781
|
+
onSelect: function onSelect(e) {
|
|
782
|
+
return e.preventDefault();
|
|
783
|
+
},
|
|
784
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
785
|
+
className: "flex-1 truncate",
|
|
786
|
+
children: t("neetoMolecules.sidebar.organizationSwitcher.label")
|
|
787
|
+
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
788
|
+
className: "ms-auto shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
789
|
+
size: 18
|
|
790
|
+
})]
|
|
791
|
+
})
|
|
792
|
+
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
793
|
+
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
794
|
+
children: /*#__PURE__*/jsx(OrganizationItems, {
|
|
795
|
+
authAppUrl: authAppUrl,
|
|
796
|
+
organizations: organizations
|
|
797
|
+
})
|
|
798
|
+
})]
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
var OrganizationSwitcher = function OrganizationSwitcher() {
|
|
803
|
+
var _globalProps$user;
|
|
775
804
|
var _useBreakpoints = useBreakpoints(),
|
|
776
805
|
isSize = _useBreakpoints.isSize;
|
|
777
806
|
var isMobile = isSize("mobile");
|
|
807
|
+
var _useTranslation = useTranslation(),
|
|
808
|
+
t = _useTranslation.t;
|
|
778
809
|
var _useFetchLoggedInOrga = useFetchLoggedInOrganizations(globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email),
|
|
779
810
|
_useFetchLoggedInOrga2 = _useFetchLoggedInOrga.data,
|
|
780
811
|
_useFetchLoggedInOrga3 = _useFetchLoggedInOrga2 === void 0 ? {} : _useFetchLoggedInOrga2,
|
|
781
812
|
organizations = _useFetchLoggedInOrga3.organizations,
|
|
782
813
|
authAppUrl = _useFetchLoggedInOrga3.authAppUrl;
|
|
783
|
-
var handleMouseEnter = useCallback(function () {
|
|
784
|
-
clearTimeout(timeoutRef.current);
|
|
785
|
-
setOpen(true);
|
|
786
|
-
}, []);
|
|
787
|
-
var handleMouseLeave = useCallback(function () {
|
|
788
|
-
timeoutRef.current = setTimeout(function () {
|
|
789
|
-
return setOpen(false);
|
|
790
|
-
}, 150);
|
|
791
|
-
}, []);
|
|
792
814
|
if (isMobile) {
|
|
793
|
-
return /*#__PURE__*/
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
797
|
-
asChild: true,
|
|
798
|
-
children: /*#__PURE__*/jsx(MenuButton$3, {})
|
|
799
|
-
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
800
|
-
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
801
|
-
children: /*#__PURE__*/jsx(OrganizationItems, {
|
|
802
|
-
authAppUrl: authAppUrl,
|
|
803
|
-
organizations: organizations
|
|
804
|
-
})
|
|
805
|
-
})]
|
|
815
|
+
return /*#__PURE__*/jsx(MobileOrganizationSwitcher, {
|
|
816
|
+
authAppUrl: authAppUrl,
|
|
817
|
+
organizations: organizations
|
|
806
818
|
});
|
|
807
819
|
}
|
|
808
|
-
return /*#__PURE__*/jsxs(
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return setOpen(function (prev) {
|
|
816
|
-
return !prev;
|
|
817
|
-
});
|
|
818
|
-
},
|
|
819
|
-
onMouseEnter: handleMouseEnter,
|
|
820
|
-
onMouseLeave: handleMouseLeave
|
|
820
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
821
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
822
|
+
className: MENU_ITEM_CLASSES,
|
|
823
|
+
"data-testid": "organization-switcher-button",
|
|
824
|
+
children: /*#__PURE__*/jsx("span", {
|
|
825
|
+
className: "flex-1",
|
|
826
|
+
children: t("neetoMolecules.sidebar.organizationSwitcher.label")
|
|
821
827
|
})
|
|
822
|
-
}), /*#__PURE__*/jsx(
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
side: "right",
|
|
828
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
829
|
+
className: "z-[99999]",
|
|
830
|
+
collisionPadding: 16,
|
|
826
831
|
sideOffset: 8,
|
|
827
|
-
onMouseEnter: handleMouseEnter,
|
|
828
|
-
onMouseLeave: handleMouseLeave,
|
|
829
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
830
|
-
return e.preventDefault();
|
|
831
|
-
},
|
|
832
832
|
children: /*#__PURE__*/jsx(OrganizationItems, {
|
|
833
833
|
authAppUrl: authAppUrl,
|
|
834
834
|
organizations: organizations
|
|
@@ -837,87 +837,69 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
|
|
|
837
837
|
});
|
|
838
838
|
};
|
|
839
839
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
return /*#__PURE__*/jsxs("button", _objectSpread$5(_objectSpread$5({
|
|
847
|
-
ref: ref,
|
|
848
|
-
className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
|
|
849
|
-
"data-testid": "product-switcher-button",
|
|
850
|
-
type: "button"
|
|
851
|
-
}, otherProps), {}, {
|
|
852
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
853
|
-
className: "flex-grow text-start",
|
|
840
|
+
var Dropdown = withT(function (_ref) {
|
|
841
|
+
var t = _ref.t;
|
|
842
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
843
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
844
|
+
className: MENU_ITEM_CLASSES,
|
|
845
|
+
"data-testid": "product-switcher-button",
|
|
854
846
|
children: t("neetoMolecules.sidebar.productSwitcher")
|
|
855
|
-
}), /*#__PURE__*/jsx(
|
|
856
|
-
className: "
|
|
857
|
-
size: 18
|
|
858
|
-
})]
|
|
859
|
-
}));
|
|
860
|
-
});
|
|
861
|
-
MenuButton$2.displayName = "ProductSwitcherMenuButton";
|
|
862
|
-
|
|
863
|
-
var Dropdown = function Dropdown() {
|
|
864
|
-
var _useState = useState(false),
|
|
865
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
866
|
-
open = _useState2[0],
|
|
867
|
-
setOpen = _useState2[1];
|
|
868
|
-
var timeoutRef = useRef(null);
|
|
869
|
-
var handleMouseEnter = useCallback(function () {
|
|
870
|
-
clearTimeout(timeoutRef.current);
|
|
871
|
-
setOpen(true);
|
|
872
|
-
}, []);
|
|
873
|
-
var handleMouseLeave = useCallback(function () {
|
|
874
|
-
timeoutRef.current = setTimeout(function () {
|
|
875
|
-
return setOpen(false);
|
|
876
|
-
}, 150);
|
|
877
|
-
}, []);
|
|
878
|
-
return /*#__PURE__*/jsxs(Popover, {
|
|
879
|
-
open: open,
|
|
880
|
-
onOpenChange: setOpen,
|
|
881
|
-
children: [/*#__PURE__*/jsx(PopoverAnchor, {
|
|
882
|
-
asChild: true,
|
|
883
|
-
children: /*#__PURE__*/jsx(MenuButton$2, {
|
|
884
|
-
onClick: function onClick() {
|
|
885
|
-
return setOpen(function (prev) {
|
|
886
|
-
return !prev;
|
|
887
|
-
});
|
|
888
|
-
},
|
|
889
|
-
onMouseEnter: handleMouseEnter,
|
|
890
|
-
onMouseLeave: handleMouseLeave
|
|
891
|
-
})
|
|
892
|
-
}), /*#__PURE__*/jsx(PopoverContent, {
|
|
893
|
-
align: "start",
|
|
894
|
-
className: "z-[99999] flex h-[max(36rem,min(80vh,48rem))] max-h-[var(--radix-popover-content-available-height)] w-[calc(100vw-25rem)] max-w-7xl flex-col overflow-hidden rounded-xl p-0",
|
|
847
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
848
|
+
className: "z-[99999] flex h-[max(36rem,min(80vh,48rem))] w-[calc(100vw-25rem)] max-w-7xl flex-col overflow-hidden rounded-xl p-0",
|
|
895
849
|
collisionPadding: 16,
|
|
896
|
-
side: "right",
|
|
897
850
|
sideOffset: 8,
|
|
898
|
-
onMouseEnter: handleMouseEnter,
|
|
899
|
-
onMouseLeave: handleMouseLeave,
|
|
900
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
901
|
-
return e.preventDefault();
|
|
902
|
-
},
|
|
903
851
|
children: /*#__PURE__*/jsx(Menu, {})
|
|
904
852
|
})]
|
|
905
853
|
});
|
|
906
|
-
};
|
|
854
|
+
});
|
|
907
855
|
|
|
908
856
|
var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
909
857
|
var toggleModal = _ref.toggleModal;
|
|
910
858
|
var _useBreakpoints = useBreakpoints(),
|
|
911
859
|
isSize = _useBreakpoints.isSize;
|
|
912
860
|
var isMobile = isSize("mobile");
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
861
|
+
var _useTranslation = useTranslation(),
|
|
862
|
+
t = _useTranslation.t;
|
|
863
|
+
if (isMobile) {
|
|
864
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
865
|
+
"data-testid": "product-switcher-button",
|
|
866
|
+
suffix: /*#__PURE__*/jsx(ChevronRight, {
|
|
867
|
+
className: "rtl:scale-x-[-1]",
|
|
868
|
+
size: 18
|
|
869
|
+
}),
|
|
870
|
+
onClick: function onClick() {
|
|
871
|
+
return toggleModal(true);
|
|
872
|
+
},
|
|
873
|
+
children: t("neetoMolecules.sidebar.productSwitcher")
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
return /*#__PURE__*/jsx(Dropdown, {});
|
|
918
877
|
};
|
|
919
878
|
|
|
920
|
-
var
|
|
879
|
+
var ProfileItems = withT(function (_ref) {
|
|
880
|
+
var _window$globalProps;
|
|
881
|
+
var t = _ref.t,
|
|
882
|
+
onProfileClick = _ref.onProfileClick;
|
|
883
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
884
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
885
|
+
"data-testid": "profile-my-profile-button",
|
|
886
|
+
prefix: /*#__PURE__*/jsx(User, {
|
|
887
|
+
size: 18
|
|
888
|
+
}),
|
|
889
|
+
onClick: onProfileClick,
|
|
890
|
+
children: t("neetoMolecules.sidebar.myProfile")
|
|
891
|
+
}), ((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 || (_window$globalProps = _window$globalProps.user) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.isOwner) && /*#__PURE__*/jsx(MenuItem, {
|
|
892
|
+
"data-testid": "profile-cancel-account-button",
|
|
893
|
+
href: DELETE_WORKSPACE_URL,
|
|
894
|
+
prefix: /*#__PURE__*/jsx(CircleX, {
|
|
895
|
+
size: 18
|
|
896
|
+
}),
|
|
897
|
+
rel: "noreferrer",
|
|
898
|
+
target: "_blank",
|
|
899
|
+
children: t("neetoMolecules.sidebar.cancelAccount")
|
|
900
|
+
})]
|
|
901
|
+
});
|
|
902
|
+
});
|
|
921
903
|
|
|
922
904
|
var ProfileHeader = function ProfileHeader(_ref) {
|
|
923
905
|
var profileInfo = _ref.profileInfo;
|
|
@@ -955,149 +937,68 @@ var ProfileHeader = function ProfileHeader(_ref) {
|
|
|
955
937
|
});
|
|
956
938
|
};
|
|
957
939
|
|
|
958
|
-
var
|
|
959
|
-
function ownKeys$4(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; }
|
|
960
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
961
|
-
var MenuButton$1 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
940
|
+
var MobileProfileExpandMenu = function MobileProfileExpandMenu(_ref) {
|
|
962
941
|
var profileInfo = _ref.profileInfo,
|
|
963
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
964
|
-
return /*#__PURE__*/jsxs("button", _objectSpread$4(_objectSpread$4({
|
|
965
|
-
ref: ref,
|
|
966
|
-
className: "group hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 transition-colors",
|
|
967
|
-
"data-testid": "profile-expand-menu-button",
|
|
968
|
-
type: "button"
|
|
969
|
-
}, otherProps), {}, {
|
|
970
|
-
children: [/*#__PURE__*/jsx(ProfileHeader, {
|
|
971
|
-
profileInfo: profileInfo
|
|
972
|
-
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
973
|
-
className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
974
|
-
size: 18
|
|
975
|
-
})]
|
|
976
|
-
}));
|
|
977
|
-
});
|
|
978
|
-
MenuButton$1.displayName = "ProfileExpandMenuButton";
|
|
979
|
-
|
|
980
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
981
|
-
var DELETE_WORKSPACE_URL = "/auth/organization/delete";
|
|
982
|
-
var ENGAGE_WIDGET_TRIGGER_ID = "neetoengage-trigger";
|
|
983
|
-
var DEFAULT_MENU_LINK_PROPS = {
|
|
984
|
-
engageProps: {
|
|
985
|
-
id: ENGAGE_WIDGET_TRIGGER_ID,
|
|
986
|
-
label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
987
|
-
"data-testid": "help-link-engage-button"
|
|
988
|
-
},
|
|
989
|
-
keyboardShortcutProps: {
|
|
990
|
-
label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
991
|
-
"data-testid": "help-link-keyboard-shortcut-button"
|
|
992
|
-
}
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
// Theme switcher
|
|
996
|
-
var APP_THEME_LOCALSTORAGE_KEY = "appTheme";
|
|
997
|
-
var THEMES = {
|
|
998
|
-
LIGHT: "light",
|
|
999
|
-
DARK: "dark"
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
// Legacy neetoUI theme classes — kept until full migration is complete.
|
|
1003
|
-
var LEGACY_THEMES = {
|
|
1004
|
-
LIGHT: "neeto-ui-theme--light",
|
|
1005
|
-
DARK: "neeto-ui-theme--dark"
|
|
1006
|
-
};
|
|
1007
|
-
var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
|
|
1008
|
-
|
|
1009
|
-
var ProfileItems = withT(function (_ref) {
|
|
1010
|
-
var _window$globalProps;
|
|
1011
|
-
var t = _ref.t,
|
|
1012
942
|
onProfileClick = _ref.onProfileClick;
|
|
1013
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
1014
|
-
children: [/*#__PURE__*/jsxs("button", {
|
|
1015
|
-
className: MENU_ITEM_CLASS,
|
|
1016
|
-
"data-testid": "profile-my-profile-button",
|
|
1017
|
-
type: "button",
|
|
1018
|
-
onClick: onProfileClick,
|
|
1019
|
-
children: [/*#__PURE__*/jsx(User, {
|
|
1020
|
-
size: 18
|
|
1021
|
-
}), t("neetoMolecules.sidebar.myProfile")]
|
|
1022
|
-
}), ((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 || (_window$globalProps = _window$globalProps.user) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.isOwner) && /*#__PURE__*/jsxs("a", {
|
|
1023
|
-
className: MENU_ITEM_CLASS,
|
|
1024
|
-
"data-testid": "profile-cancel-account-button",
|
|
1025
|
-
href: DELETE_WORKSPACE_URL,
|
|
1026
|
-
rel: "noreferrer",
|
|
1027
|
-
target: "_blank",
|
|
1028
|
-
children: [/*#__PURE__*/jsx(CircleX, {
|
|
1029
|
-
size: 18
|
|
1030
|
-
}), t("neetoMolecules.sidebar.cancelAccount")]
|
|
1031
|
-
})]
|
|
1032
|
-
});
|
|
1033
|
-
});
|
|
1034
|
-
var ProfileExpandMenu = function ProfileExpandMenu(_ref2) {
|
|
1035
|
-
var profileInfo = _ref2.profileInfo;
|
|
1036
943
|
var _useState = useState(false),
|
|
1037
944
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1038
945
|
open = _useState2[0],
|
|
1039
946
|
setOpen = _useState2[1];
|
|
947
|
+
return /*#__PURE__*/jsxs(Collapsible, {
|
|
948
|
+
open: open,
|
|
949
|
+
onOpenChange: setOpen,
|
|
950
|
+
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
951
|
+
asChild: true,
|
|
952
|
+
children: /*#__PURE__*/jsxs(DropdownMenuItem, {
|
|
953
|
+
className: classnames("group", MENU_ITEM_CLASSES),
|
|
954
|
+
"data-testid": "profile-expand-menu-button",
|
|
955
|
+
onSelect: function onSelect(e) {
|
|
956
|
+
return e.preventDefault();
|
|
957
|
+
},
|
|
958
|
+
children: [/*#__PURE__*/jsx(ProfileHeader, {
|
|
959
|
+
profileInfo: profileInfo
|
|
960
|
+
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
961
|
+
className: "ms-auto shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
962
|
+
size: 18
|
|
963
|
+
})]
|
|
964
|
+
})
|
|
965
|
+
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
966
|
+
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
967
|
+
children: /*#__PURE__*/jsx(ProfileItems, {
|
|
968
|
+
onProfileClick: onProfileClick
|
|
969
|
+
})
|
|
970
|
+
})]
|
|
971
|
+
});
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
|
|
975
|
+
var profileInfo = _ref.profileInfo;
|
|
1040
976
|
var _Profile$usePaneState = Profile.usePaneState(),
|
|
1041
977
|
_Profile$usePaneState2 = _slicedToArray(_Profile$usePaneState, 2),
|
|
1042
978
|
setIsProfilePaneOpen = _Profile$usePaneState2[1];
|
|
1043
|
-
var timeoutRef = useRef(null);
|
|
1044
979
|
var _useBreakpoints = useBreakpoints(),
|
|
1045
980
|
isSize = _useBreakpoints.isSize;
|
|
1046
981
|
var isMobile = isSize("mobile");
|
|
1047
|
-
var handleMouseEnter = useCallback(function () {
|
|
1048
|
-
clearTimeout(timeoutRef.current);
|
|
1049
|
-
setOpen(true);
|
|
1050
|
-
}, []);
|
|
1051
|
-
var handleMouseLeave = useCallback(function () {
|
|
1052
|
-
timeoutRef.current = setTimeout(function () {
|
|
1053
|
-
return setOpen(false);
|
|
1054
|
-
}, 150);
|
|
1055
|
-
}, []);
|
|
1056
982
|
var onProfileClick = function onProfileClick() {
|
|
1057
983
|
return setIsProfilePaneOpen(true);
|
|
1058
984
|
};
|
|
1059
985
|
if (isMobile) {
|
|
1060
|
-
return /*#__PURE__*/
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
1064
|
-
asChild: true,
|
|
1065
|
-
children: /*#__PURE__*/jsx(MenuButton$1, {
|
|
1066
|
-
profileInfo: profileInfo
|
|
1067
|
-
})
|
|
1068
|
-
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
1069
|
-
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
1070
|
-
children: /*#__PURE__*/jsx(ProfileItems, {
|
|
1071
|
-
onProfileClick: onProfileClick
|
|
1072
|
-
})
|
|
1073
|
-
})]
|
|
986
|
+
return /*#__PURE__*/jsx(MobileProfileExpandMenu, {
|
|
987
|
+
onProfileClick: onProfileClick,
|
|
988
|
+
profileInfo: profileInfo
|
|
1074
989
|
});
|
|
1075
990
|
}
|
|
1076
|
-
return /*#__PURE__*/jsxs(
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
profileInfo: profileInfo,
|
|
1083
|
-
onClick: function onClick() {
|
|
1084
|
-
return setOpen(function (prev) {
|
|
1085
|
-
return !prev;
|
|
1086
|
-
});
|
|
1087
|
-
},
|
|
1088
|
-
onMouseEnter: handleMouseEnter,
|
|
1089
|
-
onMouseLeave: handleMouseLeave
|
|
991
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
992
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
993
|
+
className: classnames("group items-center", MENU_ITEM_CLASSES),
|
|
994
|
+
"data-testid": "profile-expand-menu-button",
|
|
995
|
+
children: /*#__PURE__*/jsx(ProfileHeader, {
|
|
996
|
+
profileInfo: profileInfo
|
|
1090
997
|
})
|
|
1091
|
-
}), /*#__PURE__*/jsx(
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
side: "right",
|
|
998
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
999
|
+
className: "z-[99999]",
|
|
1000
|
+
collisionPadding: 16,
|
|
1095
1001
|
sideOffset: 8,
|
|
1096
|
-
onMouseEnter: handleMouseEnter,
|
|
1097
|
-
onMouseLeave: handleMouseLeave,
|
|
1098
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
1099
|
-
return e.preventDefault();
|
|
1100
|
-
},
|
|
1101
1002
|
children: /*#__PURE__*/jsx(ProfileItems, {
|
|
1102
1003
|
onProfileClick: onProfileClick
|
|
1103
1004
|
})
|
|
@@ -1187,72 +1088,83 @@ var ThemeSwitcher = function ThemeSwitcher() {
|
|
|
1187
1088
|
weight: "medium",
|
|
1188
1089
|
children: t("neetoMolecules.sidebar.themeSwitcher.label")
|
|
1189
1090
|
}), /*#__PURE__*/jsxs("div", {
|
|
1190
|
-
|
|
1091
|
+
"aria-label": t("neetoMolecules.sidebar.themeSwitcher.label"),
|
|
1092
|
+
className: "bg-muted relative grid grid-cols-2 rounded-lg p-0.5",
|
|
1191
1093
|
"data-testid": "theme-switcher-button",
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
className:
|
|
1196
|
-
|
|
1197
|
-
|
|
1094
|
+
role: "group",
|
|
1095
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
1096
|
+
"aria-hidden": true,
|
|
1097
|
+
className: "bg-background ring-border absolute inset-y-0.5 left-0.5 w-[calc(50%-2px)] rounded-md shadow-md ring-1 transition-transform duration-300 ease-out ring-inset",
|
|
1098
|
+
style: {
|
|
1099
|
+
transform: "translateX(".concat(isDarkThemeSelected ? "100%" : "0", ")")
|
|
1100
|
+
}
|
|
1101
|
+
}), /*#__PURE__*/jsx(DropdownMenuItem, {
|
|
1102
|
+
asChild: true,
|
|
1103
|
+
onSelect: function onSelect(e) {
|
|
1104
|
+
e.preventDefault();
|
|
1105
|
+
switchTheme(THEMES.LIGHT);
|
|
1198
1106
|
},
|
|
1199
|
-
children:
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1107
|
+
children: /*#__PURE__*/jsxs("button", {
|
|
1108
|
+
"aria-checked": !isDarkThemeSelected,
|
|
1109
|
+
"data-testid": "theme-switcher-light-button",
|
|
1110
|
+
role: "menuitemradio",
|
|
1111
|
+
type: "button",
|
|
1112
|
+
className: classnames(THEME_BUTTON_BASE, isDarkThemeSelected ? "text-muted-foreground hover:text-foreground" : "text-foreground"),
|
|
1113
|
+
children: [/*#__PURE__*/jsx(Sun, {
|
|
1114
|
+
size: 13,
|
|
1115
|
+
className: classnames(THEME_ICON_BASE, isDarkThemeSelected ? "scale-90 -rotate-45" : "rotate-0")
|
|
1116
|
+
}), t("neetoMolecules.sidebar.themeSwitcher.light")]
|
|
1117
|
+
})
|
|
1118
|
+
}), /*#__PURE__*/jsx(DropdownMenuItem, {
|
|
1119
|
+
asChild: true,
|
|
1120
|
+
onSelect: function onSelect(e) {
|
|
1121
|
+
e.preventDefault();
|
|
1122
|
+
switchTheme(THEMES.DARK);
|
|
1208
1123
|
},
|
|
1209
|
-
children:
|
|
1210
|
-
|
|
1211
|
-
|
|
1124
|
+
children: /*#__PURE__*/jsxs("button", {
|
|
1125
|
+
"aria-checked": isDarkThemeSelected,
|
|
1126
|
+
"data-testid": "theme-switcher-dark-button",
|
|
1127
|
+
role: "menuitemradio",
|
|
1128
|
+
type: "button",
|
|
1129
|
+
className: classnames(THEME_BUTTON_BASE, isDarkThemeSelected ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
1130
|
+
children: [/*#__PURE__*/jsx(Moon, {
|
|
1131
|
+
size: 13,
|
|
1132
|
+
className: classnames(THEME_ICON_BASE, isDarkThemeSelected ? "rotate-0" : "scale-90 rotate-45")
|
|
1133
|
+
}), t("neetoMolecules.sidebar.themeSwitcher.dark")]
|
|
1134
|
+
})
|
|
1212
1135
|
})]
|
|
1213
1136
|
})]
|
|
1214
1137
|
});
|
|
1215
1138
|
};
|
|
1216
1139
|
|
|
1217
|
-
|
|
1218
|
-
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; }
|
|
1219
|
-
var MenuButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
1140
|
+
var TriggerContent = withT(function (_ref) {
|
|
1220
1141
|
var _globalProps$organiza;
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
1230
|
-
className: "flex flex-grow flex-col gap-1.5",
|
|
1231
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
1232
|
-
className: "text-sm font-medium",
|
|
1142
|
+
var t = _ref.t;
|
|
1143
|
+
return /*#__PURE__*/jsxs("span", {
|
|
1144
|
+
className: "flex flex-grow flex-col gap-1.5",
|
|
1145
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1146
|
+
asChild: true,
|
|
1147
|
+
variant: "body3",
|
|
1148
|
+
weight: "medium",
|
|
1149
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1233
1150
|
children: t("neetoMolecules.sidebar.workspace")
|
|
1234
|
-
})
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
})
|
|
1242
|
-
}), /*#__PURE__*/jsx(ChevronRight, {
|
|
1243
|
-
className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
1244
|
-
size: 18
|
|
1151
|
+
})
|
|
1152
|
+
}), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsx(Typography, {
|
|
1153
|
+
asChild: true,
|
|
1154
|
+
color: "muted",
|
|
1155
|
+
variant: "caption",
|
|
1156
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1157
|
+
children: globalProps$1.organization.name
|
|
1158
|
+
})
|
|
1245
1159
|
})]
|
|
1246
|
-
})
|
|
1160
|
+
});
|
|
1247
1161
|
});
|
|
1248
|
-
MenuButton.displayName = "WorkspaceMenuButton";
|
|
1249
1162
|
|
|
1250
1163
|
var WorkspaceItems = withT(function (_ref) {
|
|
1251
1164
|
var _globalProps$organiza;
|
|
1252
1165
|
var t = _ref.t;
|
|
1253
1166
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1254
|
-
children: [/*#__PURE__*/jsx(
|
|
1255
|
-
className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
|
|
1167
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
1256
1168
|
"data-testid": "profile-organization-settings-button",
|
|
1257
1169
|
href: MY_ORGANIZATION_URL,
|
|
1258
1170
|
rel: "noreferrer",
|
|
@@ -1262,14 +1174,23 @@ var WorkspaceItems = withT(function (_ref) {
|
|
|
1262
1174
|
className: "px-2.5 py-2",
|
|
1263
1175
|
children: /*#__PURE__*/jsxs("span", {
|
|
1264
1176
|
className: "flex flex-col gap-0.5 text-start",
|
|
1265
|
-
children: [/*#__PURE__*/jsx(
|
|
1266
|
-
|
|
1267
|
-
|
|
1177
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1178
|
+
asChild: true,
|
|
1179
|
+
variant: "body3",
|
|
1180
|
+
weight: "medium",
|
|
1181
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1182
|
+
children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
|
|
1183
|
+
})
|
|
1268
1184
|
}), /*#__PURE__*/jsxs("span", {
|
|
1269
|
-
className: "
|
|
1270
|
-
children: [/*#__PURE__*/jsx(
|
|
1271
|
-
|
|
1272
|
-
|
|
1185
|
+
className: "flex items-center gap-1",
|
|
1186
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1187
|
+
asChild: true,
|
|
1188
|
+
color: "muted",
|
|
1189
|
+
variant: "caption",
|
|
1190
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1191
|
+
className: "min-w-0 truncate",
|
|
1192
|
+
children: globalProps$1.organization.subdomain
|
|
1193
|
+
})
|
|
1273
1194
|
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
1274
1195
|
className: "flex-shrink-0",
|
|
1275
1196
|
value: globalProps$1.organization.subdomain,
|
|
@@ -1280,61 +1201,49 @@ var WorkspaceItems = withT(function (_ref) {
|
|
|
1280
1201
|
})]
|
|
1281
1202
|
});
|
|
1282
1203
|
});
|
|
1283
|
-
|
|
1204
|
+
|
|
1205
|
+
var MobileWorkspaceMenu = function MobileWorkspaceMenu() {
|
|
1284
1206
|
var _useState = useState(false),
|
|
1285
1207
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1286
1208
|
open = _useState2[0],
|
|
1287
1209
|
setOpen = _useState2[1];
|
|
1288
|
-
|
|
1289
|
-
var _useBreakpoints = useBreakpoints(),
|
|
1290
|
-
isSize = _useBreakpoints.isSize;
|
|
1291
|
-
var isMobile = isSize("mobile");
|
|
1292
|
-
var handleMouseEnter = useCallback(function () {
|
|
1293
|
-
clearTimeout(timeoutRef.current);
|
|
1294
|
-
setOpen(true);
|
|
1295
|
-
}, []);
|
|
1296
|
-
var handleMouseLeave = useCallback(function () {
|
|
1297
|
-
timeoutRef.current = setTimeout(function () {
|
|
1298
|
-
return setOpen(false);
|
|
1299
|
-
}, 150);
|
|
1300
|
-
}, []);
|
|
1301
|
-
if (isMobile) {
|
|
1302
|
-
return /*#__PURE__*/jsxs(Collapsible, {
|
|
1303
|
-
open: open,
|
|
1304
|
-
onOpenChange: setOpen,
|
|
1305
|
-
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
1306
|
-
asChild: true,
|
|
1307
|
-
children: /*#__PURE__*/jsx(MenuButton, {})
|
|
1308
|
-
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
1309
|
-
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
1310
|
-
children: /*#__PURE__*/jsx(WorkspaceItems, {})
|
|
1311
|
-
})]
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
return /*#__PURE__*/jsxs(Popover, {
|
|
1210
|
+
return /*#__PURE__*/jsxs(Collapsible, {
|
|
1315
1211
|
open: open,
|
|
1316
1212
|
onOpenChange: setOpen,
|
|
1317
|
-
children: [/*#__PURE__*/jsx(
|
|
1213
|
+
children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
|
|
1318
1214
|
asChild: true,
|
|
1319
|
-
children: /*#__PURE__*/
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1215
|
+
children: /*#__PURE__*/jsxs(DropdownMenuItem, {
|
|
1216
|
+
className: classnames("group items-center", MENU_ITEM_CLASSES),
|
|
1217
|
+
"data-testid": "workspace-display",
|
|
1218
|
+
onSelect: function onSelect(e) {
|
|
1219
|
+
return e.preventDefault();
|
|
1324
1220
|
},
|
|
1325
|
-
|
|
1326
|
-
|
|
1221
|
+
children: [/*#__PURE__*/jsx(TriggerContent, {}), /*#__PURE__*/jsx(ChevronRight, {
|
|
1222
|
+
className: "ms-auto shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
|
|
1223
|
+
size: 18
|
|
1224
|
+
})]
|
|
1327
1225
|
})
|
|
1328
|
-
}), /*#__PURE__*/jsx(
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1226
|
+
}), /*#__PURE__*/jsx(CollapsibleContent, {
|
|
1227
|
+
className: "flex flex-col gap-0.5 ps-6 pt-1",
|
|
1228
|
+
children: /*#__PURE__*/jsx(WorkspaceItems, {})
|
|
1229
|
+
})]
|
|
1230
|
+
});
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
var WorkspaceMenu = function WorkspaceMenu() {
|
|
1234
|
+
var _useBreakpoints = useBreakpoints(),
|
|
1235
|
+
isSize = _useBreakpoints.isSize;
|
|
1236
|
+
var isMobile = isSize("mobile");
|
|
1237
|
+
if (isMobile) return /*#__PURE__*/jsx(MobileWorkspaceMenu, {});
|
|
1238
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
1239
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
1240
|
+
className: classnames("group items-center", MENU_ITEM_CLASSES),
|
|
1241
|
+
"data-testid": "workspace-display",
|
|
1242
|
+
children: /*#__PURE__*/jsx(TriggerContent, {})
|
|
1243
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
1244
|
+
className: "z-[99999]",
|
|
1245
|
+
collisionPadding: 16,
|
|
1332
1246
|
sideOffset: 8,
|
|
1333
|
-
onMouseEnter: handleMouseEnter,
|
|
1334
|
-
onMouseLeave: handleMouseLeave,
|
|
1335
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
1336
|
-
return e.preventDefault();
|
|
1337
|
-
},
|
|
1338
1247
|
children: /*#__PURE__*/jsx(WorkspaceItems, {})
|
|
1339
1248
|
})]
|
|
1340
1249
|
});
|
|
@@ -1377,18 +1286,24 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
1377
1286
|
href: NEETO_AUTH_BILLING_INFO_URL
|
|
1378
1287
|
};
|
|
1379
1288
|
};
|
|
1289
|
+
var isProPlan = normalizedPlan === "pro";
|
|
1380
1290
|
var subscriptionPlanLink = _objectSpread$2({
|
|
1381
|
-
label: /*#__PURE__*/jsxs(
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1291
|
+
label: /*#__PURE__*/jsxs("span", {
|
|
1292
|
+
className: "flex items-center gap-2",
|
|
1293
|
+
children: [globalProps.appName, isProPlan ? /*#__PURE__*/jsx(Badge, {
|
|
1294
|
+
label: humanize((_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.subscriptionPlan),
|
|
1295
|
+
style: {
|
|
1296
|
+
"--accent-foreground": "var(--color-amber-950)"
|
|
1297
|
+
},
|
|
1298
|
+
variant: "amber"
|
|
1299
|
+
}) : /*#__PURE__*/jsx(Badge, {
|
|
1300
|
+
icon: /*#__PURE__*/jsx(Crown, {
|
|
1301
|
+
className: "size-3"
|
|
1386
1302
|
}),
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
})
|
|
1303
|
+
label: t("neetoMolecules.sidebar.upgradePlan"),
|
|
1304
|
+
style: {
|
|
1305
|
+
"--accent-foreground": "var(--primary-foreground)"
|
|
1306
|
+
}
|
|
1392
1307
|
})]
|
|
1393
1308
|
}),
|
|
1394
1309
|
"data-testid": "subscription-plan"
|
|
@@ -1399,27 +1314,27 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
1399
1314
|
children: [/*#__PURE__*/jsx(LinkSection, {
|
|
1400
1315
|
links: defaultLinks
|
|
1401
1316
|
}), isNotEmpty(topLinks) && /*#__PURE__*/jsxs(Fragment, {
|
|
1402
|
-
children: [/*#__PURE__*/jsx(
|
|
1317
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1403
1318
|
className: "my-2"
|
|
1404
1319
|
}), /*#__PURE__*/jsx(LinkSection, {
|
|
1405
1320
|
links: topLinks
|
|
1406
1321
|
})]
|
|
1407
1322
|
}), isPresent(customContent) && /*#__PURE__*/jsxs(Fragment, {
|
|
1408
|
-
children: [/*#__PURE__*/jsx(
|
|
1323
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1409
1324
|
className: "my-2"
|
|
1410
1325
|
}), /*#__PURE__*/jsx("div", {
|
|
1411
1326
|
className: "px-3 py-1",
|
|
1412
1327
|
children: customContent
|
|
1413
1328
|
})]
|
|
1414
|
-
}), /*#__PURE__*/jsx(
|
|
1329
|
+
}), /*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1415
1330
|
className: "my-2"
|
|
1416
|
-
}), ((_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.isOwner) && /*#__PURE__*/jsx(WorkspaceMenu, {}), isOrganizationSwitcherEnabled && /*#__PURE__*/jsx(OrganizationSwitcher, {}), /*#__PURE__*/jsx(
|
|
1331
|
+
}), ((_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.isOwner) && /*#__PURE__*/jsx(WorkspaceMenu, {}), isOrganizationSwitcherEnabled && /*#__PURE__*/jsx(OrganizationSwitcher, {}), /*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1417
1332
|
className: "my-2"
|
|
1418
1333
|
}), isPresent((_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.subscriptionPlan) && /*#__PURE__*/jsx(LinkSection, {
|
|
1419
1334
|
links: [subscriptionPlanLink]
|
|
1420
1335
|
}), showProductSwitcher && /*#__PURE__*/jsx(ProductSwitcher, {
|
|
1421
1336
|
toggleModal: toggleModal
|
|
1422
|
-
}), /*#__PURE__*/jsx(HelpMenu, {}), /*#__PURE__*/jsx(
|
|
1337
|
+
}), /*#__PURE__*/jsx(HelpMenu, {}), /*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1423
1338
|
className: "my-2"
|
|
1424
1339
|
})]
|
|
1425
1340
|
}), isAuthenticated && !isConsumer && /*#__PURE__*/jsx(ProfileExpandMenu, {
|
|
@@ -1427,7 +1342,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
1427
1342
|
}), /*#__PURE__*/jsx(LinkSection, {
|
|
1428
1343
|
links: bottomLinks
|
|
1429
1344
|
}), isThemeSwitcherEnabled && /*#__PURE__*/jsxs(Fragment, {
|
|
1430
|
-
children: [/*#__PURE__*/jsx(
|
|
1345
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSeparator, {
|
|
1431
1346
|
className: "my-2"
|
|
1432
1347
|
}), /*#__PURE__*/jsx(ThemeSwitcher, {})]
|
|
1433
1348
|
})]
|
|
@@ -1437,6 +1352,7 @@ var ProfileMenu = function ProfileMenu(_ref) {
|
|
|
1437
1352
|
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; }
|
|
1438
1353
|
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; }
|
|
1439
1354
|
var ProfileButton = function ProfileButton(_ref) {
|
|
1355
|
+
var _globalProps$user;
|
|
1440
1356
|
var profileInfoOverrides = _ref.profileInfoOverrides,
|
|
1441
1357
|
showProductSwitcher = _ref.showProductSwitcher,
|
|
1442
1358
|
bottomLinks = _ref.bottomLinks,
|
|
@@ -1457,13 +1373,12 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1457
1373
|
setIsUpgradeModalOpen = _useState4[1];
|
|
1458
1374
|
var _useState5 = useState(false),
|
|
1459
1375
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1460
|
-
|
|
1461
|
-
|
|
1376
|
+
isMenuOpen = _useState6[0],
|
|
1377
|
+
setIsMenuOpen = _useState6[1];
|
|
1462
1378
|
var _useState7 = useState(null),
|
|
1463
1379
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1464
1380
|
changesCount = _useState8[0],
|
|
1465
1381
|
setChangesCount = _useState8[1];
|
|
1466
|
-
var timeoutRef = useRef(null);
|
|
1467
1382
|
var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
|
|
1468
1383
|
_KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
|
|
1469
1384
|
setIsOpen = _KeyboardShortcuts$us2[1];
|
|
@@ -1485,20 +1400,6 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1485
1400
|
};
|
|
1486
1401
|
window.Nv = window.Nv ? Object.assign(window.Nv, Nv) : Nv;
|
|
1487
1402
|
}, []);
|
|
1488
|
-
useEffect(function () {
|
|
1489
|
-
return function () {
|
|
1490
|
-
return clearTimeout(timeoutRef.current);
|
|
1491
|
-
};
|
|
1492
|
-
}, []);
|
|
1493
|
-
var handleMouseEnter = useCallback(function () {
|
|
1494
|
-
clearTimeout(timeoutRef.current);
|
|
1495
|
-
setIsPopoverOpen(true);
|
|
1496
|
-
}, []);
|
|
1497
|
-
var handleMouseLeave = useCallback(function () {
|
|
1498
|
-
timeoutRef.current = setTimeout(function () {
|
|
1499
|
-
return setIsPopoverOpen(false);
|
|
1500
|
-
}, 150);
|
|
1501
|
-
}, []);
|
|
1502
1403
|
var newBottomLinks = [].concat(_toConsumableArray(getDefaultBottomLinks(profileInfo.isAuthenticated, isConsumer)), _toConsumableArray(bottomLinks));
|
|
1503
1404
|
var defaultLinks = Object.keys(DEFAULT_MENU_LINK_PROPS).map(function (key) {
|
|
1504
1405
|
return _objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_MENU_LINK_PROPS[key]), key === "keyboardShortcutProps" && {
|
|
@@ -1517,41 +1418,37 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1517
1418
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1518
1419
|
children: [/*#__PURE__*/jsx(Profile.Pane, {
|
|
1519
1420
|
popoverProps: profilePopoverProps
|
|
1520
|
-
}),
|
|
1421
|
+
}), isMenuOpen && /*#__PURE__*/jsx("div", {
|
|
1521
1422
|
className: "pointer-events-none fixed inset-0 z-[99998] bg-black/[0.27]"
|
|
1522
|
-
}), /*#__PURE__*/jsxs(
|
|
1523
|
-
open:
|
|
1524
|
-
onOpenChange:
|
|
1525
|
-
children: [/*#__PURE__*/jsx(
|
|
1423
|
+
}), /*#__PURE__*/jsxs(DropdownMenu$1, {
|
|
1424
|
+
open: isMenuOpen,
|
|
1425
|
+
onOpenChange: setIsMenuOpen,
|
|
1426
|
+
children: [/*#__PURE__*/jsx(DropdownMenuTrigger, {
|
|
1526
1427
|
asChild: true,
|
|
1527
1428
|
children: /*#__PURE__*/jsxs("button", {
|
|
1528
1429
|
className: "bg-primary flex flex-col items-center justify-center gap-1.5 rounded-e-2xl p-1",
|
|
1529
1430
|
type: "button",
|
|
1530
|
-
onMouseEnter: handleMouseEnter,
|
|
1531
|
-
onMouseLeave: handleMouseLeave,
|
|
1532
1431
|
children: [/*#__PURE__*/jsx(Avatar, {
|
|
1533
|
-
className: "size-[1.625rem] shrink-0 rounded-full border-2
|
|
1432
|
+
className: "border-background size-[1.625rem] shrink-0 rounded-full border-2",
|
|
1534
1433
|
"data-testid": "profile-avatar",
|
|
1535
1434
|
user: {
|
|
1536
1435
|
name: profileInfo.name,
|
|
1537
1436
|
imageUrl: profileInfo.imageUrl
|
|
1538
1437
|
}
|
|
1539
1438
|
}), /*#__PURE__*/jsx("span", {
|
|
1540
|
-
className: "flex size-[1.625rem] items-center justify-center rounded-full
|
|
1439
|
+
className: "bg-background text-foreground flex size-[1.625rem] items-center justify-center rounded-full",
|
|
1541
1440
|
children: /*#__PURE__*/jsx(CircleQuestionMark, {
|
|
1542
1441
|
size: 20
|
|
1543
1442
|
})
|
|
1544
1443
|
})]
|
|
1545
1444
|
})
|
|
1546
|
-
}), /*#__PURE__*/jsx(
|
|
1445
|
+
}), /*#__PURE__*/jsx(DropdownMenuContent, {
|
|
1547
1446
|
align: "end",
|
|
1548
|
-
className: "z-[99999] max-h-[var(--radix-
|
|
1447
|
+
className: "z-[99999] max-h-[var(--radix-dropdown-menu-content-available-height)] w-64 overflow-y-auto rounded-xl p-0",
|
|
1549
1448
|
collisionPadding: 16,
|
|
1550
1449
|
side: "right",
|
|
1551
1450
|
sideOffset: 8,
|
|
1552
|
-
|
|
1553
|
-
onMouseLeave: handleMouseLeave,
|
|
1554
|
-
onOpenAutoFocus: function onOpenAutoFocus(e) {
|
|
1451
|
+
onCloseAutoFocus: function onCloseAutoFocus(e) {
|
|
1555
1452
|
return e.preventDefault();
|
|
1556
1453
|
},
|
|
1557
1454
|
children: /*#__PURE__*/jsx(ProfileMenu, {
|
|
@@ -1580,7 +1477,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1580
1477
|
onClose: function onClose() {
|
|
1581
1478
|
return setIsModalOpen(false);
|
|
1582
1479
|
}
|
|
1583
|
-
}), enableSubscriptionUpgradeRequest && /*#__PURE__*/jsx(SubscriptionUpgradeRequestModal, {
|
|
1480
|
+
}), enableSubscriptionUpgradeRequest && !((_globalProps$user = globalProps.user) !== null && _globalProps$user !== void 0 && _globalProps$user.isOwner) && /*#__PURE__*/jsx(SubscriptionUpgradeRequestModal, {
|
|
1584
1481
|
isOpen: isUpgradeModalOpen,
|
|
1585
1482
|
onClose: function onClose() {
|
|
1586
1483
|
return setIsUpgradeModalOpen(false);
|
|
@@ -1620,7 +1517,7 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1620
1517
|
var isBigBinaryEmail = globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 || (_globalProps$user = _globalProps$user.email) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.endsWith("@bigbinary.com");
|
|
1621
1518
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
1622
1519
|
ref: ref,
|
|
1623
|
-
className: "fixed start-0 bottom-4 z-[99999] rounded-e-[1.0625rem] border border-s-0
|
|
1520
|
+
className: "bg-popover border-border fixed start-0 bottom-4 z-[99999] rounded-e-[1.0625rem] border border-s-0",
|
|
1624
1521
|
"data-testid": "floating-action-menu-container"
|
|
1625
1522
|
}, otherProps), {}, {
|
|
1626
1523
|
children: /*#__PURE__*/jsx(ProfileButton, _defineProperty({
|