@bigbinary/neeto-molecules 5.9.10-beta1 → 5.9.10
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/MadeWith.js +2 -2
- package/dist/cjs/MadeWith.js +3 -3
- package/dist/cjs/lock-f3r8WHga.js +20 -0
- package/dist/cjs/lock-f3r8WHga.js.map +1 -0
- package/dist/cjs/useWhatsNewChangesCount-CAxjl3n7.js +599 -0
- package/dist/cjs/useWhatsNewChangesCount-CAxjl3n7.js.map +1 -0
- package/dist/cjs/v2/ErrorPage.js +3 -16
- package/dist/cjs/v2/ErrorPage.js.map +1 -1
- package/dist/cjs/v2/FloatingActionMenu.js +69 -358
- package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/v2/MadeWith.js +3 -3
- package/dist/cjs/v2/ShareViaLink.js +1 -0
- package/dist/cjs/v2/ShareViaLink.js.map +1 -1
- package/dist/cjs/v2/Sidebar.js +129 -8
- package/dist/cjs/v2/Sidebar.js.map +1 -1
- package/dist/lock-BFUDkBSb.js +18 -0
- package/dist/lock-BFUDkBSb.js.map +1 -0
- package/dist/useWhatsNewChangesCount-Do5jWaPy.js +562 -0
- package/dist/useWhatsNewChangesCount-Do5jWaPy.js.map +1 -0
- package/dist/v2/ErrorPage.js +2 -15
- package/dist/v2/ErrorPage.js.map +1 -1
- package/dist/v2/FloatingActionMenu.js +73 -343
- package/dist/v2/FloatingActionMenu.js.map +1 -1
- package/dist/v2/MadeWith.js +2 -2
- package/dist/v2/ShareViaLink.js +1 -0
- package/dist/v2/ShareViaLink.js.map +1 -1
- package/dist/v2/Sidebar.js +131 -10
- package/dist/v2/Sidebar.js.map +1 -1
- package/package.json +2 -2
- package/src/translations/en.json +4 -0
- package/types/v2/Sidebar.d.ts +2 -0
- package/dist/cjs/useWhatsNewChangesCount-BVkLLk7f.js +0 -121
- package/dist/cjs/useWhatsNewChangesCount-BVkLLk7f.js.map +0 -1
- package/dist/useWhatsNewChangesCount-CQxhUCpt.js +0 -106
- package/dist/useWhatsNewChangesCount-CQxhUCpt.js.map +0 -1
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useState, useEffect } from 'react';
|
|
4
4
|
import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/v2/initializers';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
|
-
import {
|
|
7
|
+
import { DropdownMenu, Badge, Avatar, Typography, Dialog, Textarea, Button, Toastr } from '@bigbinary/neeto-atoms';
|
|
8
8
|
import { Collapsible, CollapsibleTrigger, DropdownMenuItem, CollapsibleContent, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuSeparator, DropdownMenu as DropdownMenu$1, DropdownMenuTrigger, DropdownMenuContent } from '@bigbinary/neeto-atoms/primitives';
|
|
9
|
-
import {
|
|
10
|
-
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
9
|
+
import { isNotPresent, isPresent, truncate, humanize, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
11
10
|
import Profile from '@bigbinary/neeto-team-members-frontend/v2/Profile';
|
|
12
|
-
import {
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import { M as MENU_ITEM_CLASSES, P as Panel, D as DELETE_WORKSPACE_URL, A as APP_THEME_LOCALSTORAGE_KEY, T as THEMES, L as LEGACY_THEMES, b as THEME_ICON_BASE, c as THEME_BUTTON_BASE, d as MY_ORGANIZATION_URL, B as BILLING_URL, N as NEETO_AUTH_BILLING_INFO_URL, S as SLOWNESS_DESCRIPTION_MAX_LENGTH, u as useWhatsNewChangesCount, a as useProductSwitcherHotkey, e as DEFAULT_MENU_LINK_PROPS, H as HOTKEY_PRIORITY } from '../useWhatsNewChangesCount-Do5jWaPy.js';
|
|
13
13
|
import KeyboardShortcuts from './KeyboardShortcuts.js';
|
|
14
14
|
import SubscriptionUpgradeRequestModal from './SubscriptionUpgradeRequestModal.js';
|
|
15
|
-
import { withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
16
|
-
import classnames from 'classnames';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import Neeto from '@bigbinary/neeto-icons/typeface-logos/Neeto';
|
|
19
|
-
import * as AppIcons from '@bigbinary/neeto-icons/typeface-logos';
|
|
20
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
21
|
-
import { useQuery } from '@tanstack/react-query';
|
|
22
|
-
import axios from 'axios';
|
|
23
|
-
import { S as Search } from '../search-H0uYy0W-.js';
|
|
24
15
|
import { g as getNeetoUrl, i as isPerformanceDiagnosticsEnabled, a as getProductBillingUrl, r as reportSlowness } from '../performanceDiagnostics-DJcT0dfG.js';
|
|
25
16
|
import useBreakpoints from '@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints';
|
|
26
|
-
import {
|
|
17
|
+
import { withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
18
|
+
import classnames from 'classnames';
|
|
19
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
27
20
|
import { c as createLucideIcon } from '../createLucideIcon--oLqczpc.js';
|
|
28
21
|
import { C as CircleQuestionMark } from '../circle-question-mark-B807GLZf.js';
|
|
29
22
|
import { C as ChevronRight } from '../chevron-right-CEsVcNLw.js';
|
|
23
|
+
import { useQuery } from '@tanstack/react-query';
|
|
24
|
+
import axios from 'axios';
|
|
30
25
|
import { U as User } from '../user-Dhw9zdMR.js';
|
|
31
26
|
import useLocalStorage from '@bigbinary/neeto-commons-frontend/v2/react-utils/useLocalStorage';
|
|
32
27
|
import { t } from 'i18next';
|
|
33
28
|
import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
34
29
|
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/v2/utils/axios';
|
|
35
30
|
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
|
|
31
|
+
import { mergeDeepLeft } from 'ramda';
|
|
36
32
|
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
37
33
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
34
|
+
import '@bigbinary/neeto-hotkeys';
|
|
35
|
+
import '@bigbinary/neeto-icons/logos/Neeto';
|
|
36
|
+
import '@bigbinary/neeto-icons/logos';
|
|
37
|
+
import '../lock-BFUDkBSb.js';
|
|
38
|
+
import '../search-H0uYy0W-.js';
|
|
39
|
+
import '../x-DcQBAC3X.js';
|
|
38
40
|
import '../useKeyboardShortcutsPaneState-BlyFMEtW.js';
|
|
39
41
|
import 'zustand/shallow';
|
|
40
42
|
import '@bigbinary/neeto-commons-frontend/v2/react-utils/withImmutableActions';
|
|
41
43
|
import 'zustand';
|
|
42
44
|
import 'ua-parser-js';
|
|
43
|
-
import '../x-DcQBAC3X.js';
|
|
44
45
|
import '../check-BjsXqoAv.js';
|
|
45
46
|
import '../copy-Dj71cP65.js';
|
|
46
47
|
|
|
@@ -280,294 +281,6 @@ const __iconNode = [
|
|
|
280
281
|
];
|
|
281
282
|
const Users = createLucideIcon("users", __iconNode);
|
|
282
283
|
|
|
283
|
-
var QUERY_KEYS$1 = {
|
|
284
|
-
NEETO_APPS_LIST: "neeto-apps-list"
|
|
285
|
-
};
|
|
286
|
-
var SPECIAL_APP_NAMES = {
|
|
287
|
-
bugwatch: "BugWatch"
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
var _excluded$3 = ["name", "description", "url", "isHighlighted"];
|
|
291
|
-
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; }
|
|
292
|
-
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; }
|
|
293
|
-
var ProductLink = function ProductLink(_ref) {
|
|
294
|
-
var _globalProps, _globalProps2;
|
|
295
|
-
var name = _ref.name,
|
|
296
|
-
description = _ref.description,
|
|
297
|
-
url = _ref.url,
|
|
298
|
-
_ref$isHighlighted = _ref.isHighlighted,
|
|
299
|
-
isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
|
|
300
|
-
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
301
|
-
var normalizedName = (name || "").toLowerCase();
|
|
302
|
-
var specialCase = SPECIAL_APP_NAMES[normalizedName];
|
|
303
|
-
var safeName = name || "";
|
|
304
|
-
var appName = "Neeto".concat(safeName.charAt(0)).concat(safeName.slice(1).toLowerCase());
|
|
305
|
-
var AppIcon = specialCase ? AppIcons["Neeto".concat(specialCase)] : AppIcons[appName];
|
|
306
|
-
return /*#__PURE__*/jsxs("a", _objectSpread$7(_objectSpread$7({
|
|
307
|
-
"data-testid": "".concat(normalizedName, "-app-link"),
|
|
308
|
-
href: url,
|
|
309
|
-
rel: "noreferrer",
|
|
310
|
-
target: "_blank",
|
|
311
|
-
className: classnames("bg-background focus-visible:bg-accent flex w-full max-w-full cursor-pointer flex-col gap-4 rounded-lg border p-2.5 no-underline transition-all outline-none max-md:gap-2 max-md:p-2", {
|
|
312
|
-
"border-primary bg-primary/5": (_globalProps = globalProps) === null || _globalProps === void 0 || (_globalProps = _globalProps.appName) === null || _globalProps === void 0 ? void 0 : _globalProps.includes(name),
|
|
313
|
-
"nv-product-link-highlighted bg-accent": isHighlighted,
|
|
314
|
-
"border-border hover:border-primary": !((_globalProps2 = globalProps) !== null && _globalProps2 !== void 0 && (_globalProps2 = _globalProps2.appName) !== null && _globalProps2 !== void 0 && _globalProps2.includes(name))
|
|
315
|
-
})
|
|
316
|
-
}, props), {}, {
|
|
317
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
318
|
-
className: "shrink-0 grow [&>svg]:h-9 [&>svg]:w-auto max-md:[&>svg]:h-6",
|
|
319
|
-
children: AppIcon ? /*#__PURE__*/jsx(AppIcon, {}) : /*#__PURE__*/jsx(Neeto, {
|
|
320
|
-
className: "h-6 w-auto max-md:h-5"
|
|
321
|
-
})
|
|
322
|
-
}), /*#__PURE__*/jsx("div", {
|
|
323
|
-
className: "shrink-0",
|
|
324
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
325
|
-
color: "muted",
|
|
326
|
-
variant: "caption",
|
|
327
|
-
children: description
|
|
328
|
-
})
|
|
329
|
-
})]
|
|
330
|
-
}));
|
|
331
|
-
};
|
|
332
|
-
var ProductLink$1 = /*#__PURE__*/memo(ProductLink);
|
|
333
|
-
|
|
334
|
-
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; }
|
|
335
|
-
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; }
|
|
336
|
-
var Content = function Content(_ref) {
|
|
337
|
-
var highlightedIndex = _ref.highlightedIndex,
|
|
338
|
-
filteredApps = _ref.filteredApps,
|
|
339
|
-
isLoading = _ref.isLoading;
|
|
340
|
-
var _useTranslation = useTranslation(),
|
|
341
|
-
t = _useTranslation.t;
|
|
342
|
-
if (isLoading) {
|
|
343
|
-
return /*#__PURE__*/jsx("div", {
|
|
344
|
-
className: "flex h-full items-center justify-center",
|
|
345
|
-
children: /*#__PURE__*/jsx(Spinner, {
|
|
346
|
-
"data-testid": "neeto-ui-spinner"
|
|
347
|
-
})
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
return (filteredApps === null || filteredApps === void 0 ? void 0 : filteredApps.length) > 0 ? /*#__PURE__*/jsx("div", {
|
|
351
|
-
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",
|
|
352
|
-
children: filteredApps.map(function (app, index) {
|
|
353
|
-
return /*#__PURE__*/jsx(ProductLink$1, _objectSpread$6(_objectSpread$6({}, app), {}, {
|
|
354
|
-
"data-highlighted-index": index,
|
|
355
|
-
isHighlighted: index === highlightedIndex
|
|
356
|
-
}), app.name);
|
|
357
|
-
})
|
|
358
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
359
|
-
className: "flex h-full items-center justify-center",
|
|
360
|
-
"data-testid": "no-apps-found-title",
|
|
361
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
362
|
-
color: "muted",
|
|
363
|
-
variant: "body2",
|
|
364
|
-
children: t("neetoMolecules.productSwitcher.noApps")
|
|
365
|
-
})
|
|
366
|
-
});
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
var fetch$1 = function fetch() {
|
|
370
|
-
return axios.get("/api/v1/neeto_apps");
|
|
371
|
-
};
|
|
372
|
-
var neetoAppsApi = {
|
|
373
|
-
fetch: fetch$1
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
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; }
|
|
377
|
-
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; }
|
|
378
|
-
var useFetchNeetoApps = function useFetchNeetoApps(options) {
|
|
379
|
-
return useQuery(_objectSpread$5({
|
|
380
|
-
queryKey: [QUERY_KEYS$1.NEETO_APPS_LIST],
|
|
381
|
-
queryFn: neetoAppsApi.fetch,
|
|
382
|
-
staleTime: 5 * 60 * 1000
|
|
383
|
-
}, options));
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
var useProductSwitcherNavigation = function useProductSwitcherNavigation() {
|
|
387
|
-
var filteredApps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
388
|
-
var _useState = useState(0),
|
|
389
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
390
|
-
highlightedIndex = _useState2[0],
|
|
391
|
-
setHighlightedIndex = _useState2[1];
|
|
392
|
-
var scrollContainerRef = useRef(null);
|
|
393
|
-
useEffect(function () {
|
|
394
|
-
return setHighlightedIndex(0);
|
|
395
|
-
}, [filteredApps]);
|
|
396
|
-
useEffect(function () {
|
|
397
|
-
if (!scrollContainerRef.current || isEmpty(filteredApps)) return;
|
|
398
|
-
var container = scrollContainerRef.current;
|
|
399
|
-
var highlightedElement = container.querySelector("[data-highlighted-index=\"".concat(highlightedIndex, "\"]"));
|
|
400
|
-
if (!highlightedElement) return;
|
|
401
|
-
var containerRect = container.getBoundingClientRect();
|
|
402
|
-
var elRect = highlightedElement.getBoundingClientRect();
|
|
403
|
-
if (elRect.top < containerRect.top) {
|
|
404
|
-
container.scrollTop += elRect.top - containerRect.top;
|
|
405
|
-
} else if (elRect.bottom > containerRect.bottom) {
|
|
406
|
-
container.scrollTop += elRect.bottom - containerRect.bottom;
|
|
407
|
-
}
|
|
408
|
-
}, [highlightedIndex, filteredApps]);
|
|
409
|
-
var getColumnsPerRow = function getColumnsPerRow() {
|
|
410
|
-
var width = window.innerWidth;
|
|
411
|
-
if (width < 768) return 1;
|
|
412
|
-
if (width < 1024) return 2;
|
|
413
|
-
if (width < 1536) return 3;
|
|
414
|
-
return 4;
|
|
415
|
-
};
|
|
416
|
-
var handleOpenHighlightedApp = function handleOpenHighlightedApp() {
|
|
417
|
-
var app = filteredApps[highlightedIndex];
|
|
418
|
-
if (!(app !== null && app !== void 0 && app.url)) return;
|
|
419
|
-
window.open(app.url, "_blank", "noopener,noreferrer");
|
|
420
|
-
};
|
|
421
|
-
var navigationHandlers = {
|
|
422
|
-
left: function left(prev) {
|
|
423
|
-
return prev === 0 ? filteredApps.length - 1 : prev - 1;
|
|
424
|
-
},
|
|
425
|
-
right: function right(prev) {
|
|
426
|
-
return prev === filteredApps.length - 1 ? 0 : prev + 1;
|
|
427
|
-
},
|
|
428
|
-
up: function up(prev) {
|
|
429
|
-
var columnsPerRow = getColumnsPerRow();
|
|
430
|
-
var newIndex = prev - columnsPerRow;
|
|
431
|
-
if (newIndex >= 0) return newIndex;
|
|
432
|
-
var currentCol = prev % columnsPerRow;
|
|
433
|
-
var lastIndex = filteredApps.length - 1;
|
|
434
|
-
return lastIndex - (lastIndex - currentCol) % columnsPerRow;
|
|
435
|
-
},
|
|
436
|
-
down: function down(prev) {
|
|
437
|
-
var columnsPerRow = getColumnsPerRow();
|
|
438
|
-
var newIndex = prev + columnsPerRow;
|
|
439
|
-
if (newIndex < filteredApps.length) return newIndex;
|
|
440
|
-
return prev % columnsPerRow;
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
var keyActions = {
|
|
444
|
-
Enter: handleOpenHighlightedApp,
|
|
445
|
-
ArrowLeft: function ArrowLeft() {
|
|
446
|
-
return setHighlightedIndex(navigationHandlers["left"]);
|
|
447
|
-
},
|
|
448
|
-
ArrowRight: function ArrowRight() {
|
|
449
|
-
return setHighlightedIndex(navigationHandlers["right"]);
|
|
450
|
-
},
|
|
451
|
-
ArrowUp: function ArrowUp() {
|
|
452
|
-
return setHighlightedIndex(navigationHandlers["up"]);
|
|
453
|
-
},
|
|
454
|
-
ArrowDown: function ArrowDown() {
|
|
455
|
-
return setHighlightedIndex(navigationHandlers["down"]);
|
|
456
|
-
},
|
|
457
|
-
Tab: function Tab(e) {
|
|
458
|
-
return setHighlightedIndex(navigationHandlers[e.shiftKey ? "left" : "right"]);
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
462
|
-
var action = keyActions[e.key];
|
|
463
|
-
if (!action) return;
|
|
464
|
-
e.preventDefault();
|
|
465
|
-
e.stopPropagation();
|
|
466
|
-
if (isNotEmpty(filteredApps)) action(e);
|
|
467
|
-
};
|
|
468
|
-
return {
|
|
469
|
-
highlightedIndex: highlightedIndex,
|
|
470
|
-
handleKeyDown: handleKeyDown,
|
|
471
|
-
scrollContainerRef: scrollContainerRef
|
|
472
|
-
};
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
var Menu = function Menu(_ref) {
|
|
476
|
-
var _ref$isMobile = _ref.isMobile,
|
|
477
|
-
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
478
|
-
var _useTranslation = useTranslation(),
|
|
479
|
-
t = _useTranslation.t;
|
|
480
|
-
var _useState = useState(""),
|
|
481
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
482
|
-
searchTerm = _useState2[0],
|
|
483
|
-
setSearchTerm = _useState2[1];
|
|
484
|
-
var _useFetchNeetoApps = useFetchNeetoApps(),
|
|
485
|
-
data = _useFetchNeetoApps.data,
|
|
486
|
-
isLoading = _useFetchNeetoApps.isLoading;
|
|
487
|
-
var substring = searchTerm.replace(/ /g, "").toLowerCase();
|
|
488
|
-
var filteredApps = useMemo(function () {
|
|
489
|
-
var _data$neetoApps;
|
|
490
|
-
if (!data) return [];
|
|
491
|
-
return data === null || data === void 0 || (_data$neetoApps = data.neetoApps) === null || _data$neetoApps === void 0 ? void 0 : _data$neetoApps.filter(function (_ref2) {
|
|
492
|
-
var name = _ref2.name;
|
|
493
|
-
var nameLower = name.toLowerCase();
|
|
494
|
-
var searchTermLower = substring.toLowerCase();
|
|
495
|
-
var isNeetoPrefixMatch = searchTermLower.length <= 4 && "neeto".startsWith(searchTermLower);
|
|
496
|
-
if (isNeetoPrefixMatch) return true;
|
|
497
|
-
var productName = searchTermLower.startsWith("neeto") ? searchTermLower.replace("neeto", "") : searchTermLower;
|
|
498
|
-
return nameLower.includes(productName);
|
|
499
|
-
});
|
|
500
|
-
}, [data, substring]);
|
|
501
|
-
var _useProductSwitcherNa = useProductSwitcherNavigation(filteredApps),
|
|
502
|
-
highlightedIndex = _useProductSwitcherNa.highlightedIndex,
|
|
503
|
-
handleKeyDown = _useProductSwitcherNa.handleKeyDown,
|
|
504
|
-
scrollContainerRef = _useProductSwitcherNa.scrollContainerRef;
|
|
505
|
-
return /*#__PURE__*/jsxs("div", {
|
|
506
|
-
className: "flex h-full w-full max-w-full flex-col items-start p-6 transition-all max-md:p-1",
|
|
507
|
-
"data-testid": "switcher-wrapper",
|
|
508
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
509
|
-
"data-testid": "product-switcher-body-wrapper",
|
|
510
|
-
className: classnames("mb-6 flex w-full shrink-0 items-center justify-between gap-8 pt-1 max-md:flex-col max-md:items-start max-md:gap-3", {
|
|
511
|
-
"max-md:mb-4": isMobile
|
|
512
|
-
}),
|
|
513
|
-
children: [!isMobile && /*#__PURE__*/jsx("h1", {
|
|
514
|
-
className: "text-2xl font-bold max-sm:text-xl",
|
|
515
|
-
children: t("neetoMolecules.productSwitcher.chooseNeetoProduct")
|
|
516
|
-
}), /*#__PURE__*/jsx("div", {
|
|
517
|
-
className: "flex-grow lg:w-[296px] lg:flex-grow-0",
|
|
518
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
519
|
-
className: "relative",
|
|
520
|
-
children: [/*#__PURE__*/jsx(Search, {
|
|
521
|
-
className: "text-muted-foreground absolute start-3 top-1/2 size-4 -translate-y-1/2"
|
|
522
|
-
}), /*#__PURE__*/jsx(Input, {
|
|
523
|
-
autoFocus: true,
|
|
524
|
-
className: "h-10 ps-9",
|
|
525
|
-
"data-testid": "product-switcher-search-input",
|
|
526
|
-
placeholder: t("neetoMolecules.productSwitcher.searchProducts"),
|
|
527
|
-
type: "search",
|
|
528
|
-
value: searchTerm,
|
|
529
|
-
onChange: function onChange(e) {
|
|
530
|
-
return setSearchTerm(e.target.value);
|
|
531
|
-
},
|
|
532
|
-
onKeyDown: handleKeyDown
|
|
533
|
-
})]
|
|
534
|
-
})
|
|
535
|
-
})]
|
|
536
|
-
}), /*#__PURE__*/jsx("div", {
|
|
537
|
-
className: "flex min-h-0 w-full flex-1 flex-col gap-3 overflow-y-auto text-sm",
|
|
538
|
-
ref: scrollContainerRef,
|
|
539
|
-
children: /*#__PURE__*/jsx(Content, {
|
|
540
|
-
filteredApps: filteredApps,
|
|
541
|
-
highlightedIndex: highlightedIndex,
|
|
542
|
-
isLoading: isLoading
|
|
543
|
-
})
|
|
544
|
-
})]
|
|
545
|
-
}, "switcher-wrapper");
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
var Modal = withT(function (_ref) {
|
|
549
|
-
var t = _ref.t,
|
|
550
|
-
isOpen = _ref.isOpen,
|
|
551
|
-
onClose = _ref.onClose;
|
|
552
|
-
return /*#__PURE__*/jsxs(Dialog, {
|
|
553
|
-
isOpen: isOpen,
|
|
554
|
-
onClose: onClose,
|
|
555
|
-
"aria-describedby": undefined,
|
|
556
|
-
className: "grid-rows-[1fr] sm:max-w-4xl",
|
|
557
|
-
size: "fullScreen",
|
|
558
|
-
children: [/*#__PURE__*/jsx(Dialog.Title, {
|
|
559
|
-
className: "sr-only",
|
|
560
|
-
children: t("neetoMolecules.productSwitcher.title")
|
|
561
|
-
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
562
|
-
className: "min-h-0 overflow-y-auto",
|
|
563
|
-
children: /*#__PURE__*/jsx("div", {
|
|
564
|
-
"data-testid": "product-switcher-modal",
|
|
565
|
-
children: /*#__PURE__*/jsx(Menu, {})
|
|
566
|
-
})
|
|
567
|
-
})]
|
|
568
|
-
});
|
|
569
|
-
});
|
|
570
|
-
|
|
571
284
|
var _excluded$2 = ["className"];
|
|
572
285
|
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; }
|
|
573
286
|
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; }
|
|
@@ -895,22 +608,6 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
|
|
|
895
608
|
});
|
|
896
609
|
};
|
|
897
610
|
|
|
898
|
-
var Dropdown = withT(function (_ref) {
|
|
899
|
-
var t = _ref.t;
|
|
900
|
-
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
901
|
-
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
902
|
-
className: MENU_ITEM_CLASSES,
|
|
903
|
-
"data-testid": "product-switcher-button",
|
|
904
|
-
children: t("neetoMolecules.sidebar.productSwitcher")
|
|
905
|
-
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
906
|
-
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",
|
|
907
|
-
collisionPadding: 16,
|
|
908
|
-
sideOffset: 8,
|
|
909
|
-
children: /*#__PURE__*/jsx(Menu, {})
|
|
910
|
-
})]
|
|
911
|
-
});
|
|
912
|
-
});
|
|
913
|
-
|
|
914
611
|
var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
915
612
|
var toggleModal = _ref.toggleModal;
|
|
916
613
|
var _useBreakpoints = useBreakpoints(),
|
|
@@ -920,7 +617,7 @@ var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
|
920
617
|
t = _useTranslation.t;
|
|
921
618
|
if (isMobile) {
|
|
922
619
|
return /*#__PURE__*/jsx(MenuItem, {
|
|
923
|
-
"data-testid": "product-switcher-button",
|
|
620
|
+
"data-testid": "fam-product-switcher-button",
|
|
924
621
|
suffix: /*#__PURE__*/jsx(ChevronRight, {
|
|
925
622
|
className: "rtl:scale-x-[-1]",
|
|
926
623
|
size: 18
|
|
@@ -931,7 +628,24 @@ var ProductSwitcher = function ProductSwitcher(_ref) {
|
|
|
931
628
|
children: t("neetoMolecules.sidebar.productSwitcher")
|
|
932
629
|
});
|
|
933
630
|
}
|
|
934
|
-
return /*#__PURE__*/
|
|
631
|
+
return /*#__PURE__*/jsxs(DropdownMenuSub, {
|
|
632
|
+
children: [/*#__PURE__*/jsx(DropdownMenuSubTrigger, {
|
|
633
|
+
className: MENU_ITEM_CLASSES,
|
|
634
|
+
"data-testid": "fam-product-switcher-button",
|
|
635
|
+
children: /*#__PURE__*/jsx("span", {
|
|
636
|
+
className: "flex-1",
|
|
637
|
+
children: t("neetoMolecules.sidebar.productSwitcher")
|
|
638
|
+
})
|
|
639
|
+
}), /*#__PURE__*/jsx(DropdownMenuSubContent, {
|
|
640
|
+
className: "z-[99999] h-[min(88vh,41rem)] w-[min(30rem,calc(100vw-1.5rem))] overflow-hidden rounded-xl p-0",
|
|
641
|
+
collisionPadding: 16,
|
|
642
|
+
sideOffset: 8,
|
|
643
|
+
children: /*#__PURE__*/jsx(Panel, {
|
|
644
|
+
autoFocusSearch: false,
|
|
645
|
+
onNavigate: function onNavigate() {}
|
|
646
|
+
})
|
|
647
|
+
})]
|
|
648
|
+
});
|
|
935
649
|
};
|
|
936
650
|
|
|
937
651
|
var ProfileItems = withT(function (_ref) {
|
|
@@ -1318,16 +1032,16 @@ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
1318
1032
|
var ProfileMenu = function ProfileMenu(_ref) {
|
|
1319
1033
|
var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
|
|
1320
1034
|
var profileInfo = _ref.profileInfo,
|
|
1321
|
-
showProductSwitcher = _ref.showProductSwitcher,
|
|
1322
1035
|
defaultLinks = _ref.defaultLinks,
|
|
1323
1036
|
topLinks = _ref.topLinks,
|
|
1324
1037
|
bottomLinks = _ref.bottomLinks,
|
|
1325
1038
|
customContent = _ref.customContent,
|
|
1326
|
-
toggleModal = _ref.toggleModal,
|
|
1327
1039
|
isThemeSwitcherEnabled = _ref.isThemeSwitcherEnabled,
|
|
1328
1040
|
isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
|
|
1329
1041
|
isConsumer = _ref.isConsumer,
|
|
1330
1042
|
enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest,
|
|
1043
|
+
showProductSwitcher = _ref.showProductSwitcher,
|
|
1044
|
+
toggleModal = _ref.toggleModal,
|
|
1331
1045
|
openUpgradeModal = _ref.openUpgradeModal,
|
|
1332
1046
|
onReportSlowness = _ref.onReportSlowness;
|
|
1333
1047
|
var isAuthenticated = profileInfo.isAuthenticated;
|
|
@@ -1520,7 +1234,6 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
1520
1234
|
var ProfileButton = function ProfileButton(_ref) {
|
|
1521
1235
|
var _globalProps$user;
|
|
1522
1236
|
var profileInfoOverrides = _ref.profileInfoOverrides,
|
|
1523
|
-
showProductSwitcher = _ref.showProductSwitcher,
|
|
1524
1237
|
bottomLinks = _ref.bottomLinks,
|
|
1525
1238
|
topLinks = _ref.topLinks,
|
|
1526
1239
|
customContent = _ref.customContent,
|
|
@@ -1528,32 +1241,35 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1528
1241
|
isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
|
|
1529
1242
|
profilePopoverProps = _ref.profilePopoverProps,
|
|
1530
1243
|
isConsumer = _ref.isConsumer,
|
|
1531
|
-
enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest
|
|
1244
|
+
enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest,
|
|
1245
|
+
showProductSwitcher = _ref.showProductSwitcher;
|
|
1532
1246
|
var _useState = useState(false),
|
|
1533
1247
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1534
|
-
|
|
1535
|
-
|
|
1248
|
+
isUpgradeModalOpen = _useState2[0],
|
|
1249
|
+
setIsUpgradeModalOpen = _useState2[1];
|
|
1536
1250
|
var _useState3 = useState(false),
|
|
1537
1251
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1538
|
-
|
|
1539
|
-
|
|
1252
|
+
isMenuOpen = _useState4[0],
|
|
1253
|
+
setIsMenuOpen = _useState4[1];
|
|
1540
1254
|
var _useState5 = useState(false),
|
|
1541
1255
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1542
|
-
|
|
1543
|
-
|
|
1256
|
+
isSwitcherModalOpen = _useState6[0],
|
|
1257
|
+
setIsSwitcherModalOpen = _useState6[1];
|
|
1544
1258
|
var _useState7 = useState(null),
|
|
1545
1259
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1546
1260
|
slownessReportedAt = _useState8[0],
|
|
1547
1261
|
setSlownessReportedAt = _useState8[1];
|
|
1548
1262
|
var changesCount = useWhatsNewChangesCount();
|
|
1263
|
+
var _useTranslation = useTranslation(),
|
|
1264
|
+
t = _useTranslation.t;
|
|
1549
1265
|
var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
|
|
1550
1266
|
_KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
|
|
1551
1267
|
setIsOpen = _KeyboardShortcuts$us2[1];
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1268
|
+
|
|
1269
|
+
// ctrl/⌘+u opens the switcher as a full-screen modal (works even when the
|
|
1270
|
+
// profile menu is closed); the registry guard keeps it from firing when the
|
|
1271
|
+
// sidebar switcher is also mounted. Only active when the FAM switcher is on.
|
|
1272
|
+
useProductSwitcherHotkey(setIsSwitcherModalOpen, HOTKEY_PRIORITY.FLOATING_ACTION_MENU, showProductSwitcher);
|
|
1557
1273
|
var profileInfo = getProfileInfo(profileInfoOverrides, isConsumer);
|
|
1558
1274
|
var newBottomLinks = [].concat(_toConsumableArray(getDefaultBottomLinks(profileInfo.isAuthenticated, isConsumer)), _toConsumableArray(bottomLinks));
|
|
1559
1275
|
var defaultLinks = Object.keys(DEFAULT_MENU_LINK_PROPS).map(function (key) {
|
|
@@ -1620,7 +1336,7 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1620
1336
|
openUpgradeModal: function openUpgradeModal() {
|
|
1621
1337
|
return setIsUpgradeModalOpen(true);
|
|
1622
1338
|
},
|
|
1623
|
-
toggleModal:
|
|
1339
|
+
toggleModal: setIsSwitcherModalOpen,
|
|
1624
1340
|
onReportSlowness: function onReportSlowness() {
|
|
1625
1341
|
return setSlownessReportedAt(Date.now());
|
|
1626
1342
|
}
|
|
@@ -1635,11 +1351,25 @@ var ProfileButton = function ProfileButton(_ref) {
|
|
|
1635
1351
|
onClose: function onClose() {
|
|
1636
1352
|
return setSlownessReportedAt(null);
|
|
1637
1353
|
}
|
|
1638
|
-
}), /*#__PURE__*/
|
|
1639
|
-
|
|
1354
|
+
}), showProductSwitcher && /*#__PURE__*/jsxs(Dialog, {
|
|
1355
|
+
"aria-describedby": undefined,
|
|
1356
|
+
className: "grid-rows-[1fr] p-0",
|
|
1357
|
+
isOpen: isSwitcherModalOpen,
|
|
1358
|
+
size: "fullScreen",
|
|
1640
1359
|
onClose: function onClose() {
|
|
1641
|
-
return
|
|
1642
|
-
}
|
|
1360
|
+
return setIsSwitcherModalOpen(false);
|
|
1361
|
+
},
|
|
1362
|
+
children: [/*#__PURE__*/jsx(Dialog.Title, {
|
|
1363
|
+
className: "sr-only",
|
|
1364
|
+
children: t("neetoMolecules.productSwitcher.title")
|
|
1365
|
+
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
1366
|
+
className: "min-h-0 overflow-hidden p-0",
|
|
1367
|
+
children: /*#__PURE__*/jsx(Panel, {
|
|
1368
|
+
onNavigate: function onNavigate() {
|
|
1369
|
+
return setIsSwitcherModalOpen(false);
|
|
1370
|
+
}
|
|
1371
|
+
})
|
|
1372
|
+
})]
|
|
1643
1373
|
}), enableSubscriptionUpgradeRequest && !((_globalProps$user = globalProps.user) !== null && _globalProps$user !== void 0 && _globalProps$user.isOwner) && /*#__PURE__*/jsx(SubscriptionUpgradeRequestModal, {
|
|
1644
1374
|
isOpen: isUpgradeModalOpen,
|
|
1645
1375
|
onClose: function onClose() {
|
|
@@ -1661,7 +1391,7 @@ var FloatingActionMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1661
1391
|
_ref$bottomLinks = _ref.bottomLinks,
|
|
1662
1392
|
bottomLinks = _ref$bottomLinks === void 0 ? [] : _ref$bottomLinks,
|
|
1663
1393
|
_ref$showProductSwitc = _ref.showProductSwitcher,
|
|
1664
|
-
showProductSwitcher = _ref$showProductSwitc === void 0 ?
|
|
1394
|
+
showProductSwitcher = _ref$showProductSwitc === void 0 ? false : _ref$showProductSwitc,
|
|
1665
1395
|
_ref$isThemeSwitcherE = _ref.isThemeSwitcherEnabled,
|
|
1666
1396
|
isThemeSwitcherEnabled = _ref$isThemeSwitcherE === void 0 ? false : _ref$isThemeSwitcherE,
|
|
1667
1397
|
_ref$isOrganizationSw = _ref.isOrganizationSwitcherEnabled,
|