@bigbinary/neeto-molecules 5.3.13 → 5.3.14
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/FloatingActionMenu.js +94 -97
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/FloatingActionMenu.js +93 -96
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/urls-CC4qs7hW.js +11 -0
- package/dist/cjs/urls-CC4qs7hW.js.map +1 -0
- package/dist/cjs/v2/Engagements.js +1 -1
- package/dist/cjs/v2/Engagements.js.map +1 -1
- package/dist/cjs/v2/FloatingActionMenu.js +69 -73
- package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
- package/dist/urls-CN1MpSwF.js +9 -0
- package/dist/urls-CN1MpSwF.js.map +1 -0
- package/dist/v2/Engagements.js +1 -1
- package/dist/v2/Engagements.js.map +1 -1
- package/dist/v2/FloatingActionMenu.js +70 -74
- package/dist/v2/FloatingActionMenu.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import Help from '@bigbinary/neeto-icons/Help';
|
|
|
10
10
|
import Profile from '@bigbinary/neeto-team-members-frontend/Profile';
|
|
11
11
|
import Avatar from '@bigbinary/neetoui/Avatar';
|
|
12
12
|
import Dropdown$1 from '@bigbinary/neetoui/Dropdown';
|
|
13
|
-
import { isEmpty, mergeDeepLeft,
|
|
13
|
+
import { isEmpty, mergeDeepLeft, not } from 'ramda';
|
|
14
14
|
import KeyboardShortcuts from './KeyboardShortcuts.js';
|
|
15
15
|
import SubscriptionUpgradeRequestModal from './SubscriptionUpgradeRequestModal.js';
|
|
16
16
|
import Modal$1 from '@bigbinary/neetoui/Modal';
|
|
@@ -34,21 +34,22 @@ import ChatQuestions from '@bigbinary/neeto-icons/ChatQuestions';
|
|
|
34
34
|
import Community from '@bigbinary/neeto-icons/Community';
|
|
35
35
|
import Roadmap from '@bigbinary/neeto-icons/Roadmap';
|
|
36
36
|
import Status from '@bigbinary/neeto-icons/Status';
|
|
37
|
+
import { g as getNeetoUrl } from './urls-CN1MpSwF.js';
|
|
37
38
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
38
39
|
import Right from '@bigbinary/neeto-icons/Right';
|
|
39
|
-
import { t } from 'i18next';
|
|
40
|
-
import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
|
|
41
|
-
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
|
|
42
|
-
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
43
|
-
import Logout from '@bigbinary/neeto-icons/Logout';
|
|
44
40
|
import CheckCircle from '@bigbinary/neeto-icons/CheckCircle';
|
|
45
41
|
import Tag from '@bigbinary/neetoui/Tag';
|
|
46
42
|
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
47
43
|
import CloseCircle from '@bigbinary/neeto-icons/CloseCircle';
|
|
48
44
|
import User from '@bigbinary/neeto-icons/User';
|
|
45
|
+
import { t } from 'i18next';
|
|
49
46
|
import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
|
|
50
47
|
import Moon from '@bigbinary/neeto-icons/Moon';
|
|
51
48
|
import Sun from '@bigbinary/neeto-icons/Sun';
|
|
49
|
+
import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
|
|
50
|
+
import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
|
|
51
|
+
import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
52
|
+
import Logout from '@bigbinary/neeto-icons/Logout';
|
|
52
53
|
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
53
54
|
import './useKeyboardShortcutsPaneState-Ckzn5mVZ.js';
|
|
54
55
|
import 'zustand/shallow';
|
|
@@ -366,94 +367,6 @@ var MenuButton$4 = withT(function (_ref) {
|
|
|
366
367
|
}));
|
|
367
368
|
});
|
|
368
369
|
|
|
369
|
-
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
370
|
-
var DELETE_WORKSPACE_URL = "/auth/organization/delete";
|
|
371
|
-
var ENGAGE_WIDGET_TRIGGER_ID = "neetoengage-trigger";
|
|
372
|
-
var DEFAULT_MENU_LINK_PROPS = {
|
|
373
|
-
engageProps: {
|
|
374
|
-
id: ENGAGE_WIDGET_TRIGGER_ID,
|
|
375
|
-
label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
376
|
-
"data-testid": "help-link-engage-button"
|
|
377
|
-
},
|
|
378
|
-
keyboardShortcutProps: {
|
|
379
|
-
label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
380
|
-
"data-testid": "help-link-keyboard-shortcut-button"
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
// Theme switcher
|
|
385
|
-
var APP_THEME_LOCALSTORAGE_KEY = "appTheme";
|
|
386
|
-
var THEMES = {
|
|
387
|
-
LIGHT: "neeto-ui-theme--light",
|
|
388
|
-
DARK: "neeto-ui-theme--dark"
|
|
389
|
-
};
|
|
390
|
-
var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
|
|
391
|
-
|
|
392
|
-
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
393
|
-
var _globalProps$user, _globalProps$user2;
|
|
394
|
-
var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
|
|
395
|
-
return "sidebarState-".concat(user);
|
|
396
|
-
};
|
|
397
|
-
var getUserProfileInfo = function getUserProfileInfo() {
|
|
398
|
-
var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
|
|
399
|
-
return {
|
|
400
|
-
name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
|
|
401
|
-
imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
402
|
-
email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
|
|
403
|
-
isAuthenticated: globalProps.authenticated
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
var getConsumerProfileInfo = function getConsumerProfileInfo() {
|
|
407
|
-
var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
|
|
408
|
-
return {
|
|
409
|
-
name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
|
|
410
|
-
imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
411
|
-
email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
|
|
412
|
-
isAuthenticated: globalProps.isConsumer
|
|
413
|
-
};
|
|
414
|
-
};
|
|
415
|
-
var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
|
|
416
|
-
return [isAuthenticated ? {
|
|
417
|
-
label: t("neetoMolecules.sidebar.logout"),
|
|
418
|
-
icon: Logout,
|
|
419
|
-
onClick: function onClick() {
|
|
420
|
-
resetAuthTokens();
|
|
421
|
-
removeFromLocalStorage(getSidebarStateLocalStorageKey());
|
|
422
|
-
isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
|
|
423
|
-
},
|
|
424
|
-
"data-testid": "profile-logout-button"
|
|
425
|
-
} : {
|
|
426
|
-
label: t("neetoMolecules.sidebar.login"),
|
|
427
|
-
onClick: function onClick() {
|
|
428
|
-
window.location.href = "/login";
|
|
429
|
-
},
|
|
430
|
-
"data-testid": "profile-login-button"
|
|
431
|
-
}];
|
|
432
|
-
};
|
|
433
|
-
var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
|
|
434
|
-
return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// Theme switcher utils.
|
|
438
|
-
var setDarkTheme = function setDarkTheme() {
|
|
439
|
-
if (!document.body) return;
|
|
440
|
-
document.body.classList.remove(THEMES.LIGHT);
|
|
441
|
-
document.body.classList.add(THEMES.DARK);
|
|
442
|
-
};
|
|
443
|
-
var setLightTheme = function setLightTheme() {
|
|
444
|
-
if (!document.body) return;
|
|
445
|
-
document.body.classList.remove(THEMES.DARK);
|
|
446
|
-
document.body.classList.add(THEMES.LIGHT);
|
|
447
|
-
};
|
|
448
|
-
var setAppTheme = function setAppTheme() {
|
|
449
|
-
var isDarkTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY) === THEMES.DARK;
|
|
450
|
-
isDarkTheme ? setDarkTheme() : setLightTheme();
|
|
451
|
-
};
|
|
452
|
-
var getRoadmapUrl = function getRoadmapUrl() {
|
|
453
|
-
var _globalProps;
|
|
454
|
-
return "https://roadmap.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com");
|
|
455
|
-
};
|
|
456
|
-
|
|
457
370
|
var Menu$4 = Dropdown$1.Menu,
|
|
458
371
|
MenuItem$8 = Dropdown$1.MenuItem;
|
|
459
372
|
var HelpMenu = function HelpMenu() {
|
|
@@ -477,7 +390,7 @@ var HelpMenu = function HelpMenu() {
|
|
|
477
390
|
children: [/*#__PURE__*/jsx(MenuItem$8.Button, {
|
|
478
391
|
className: "neeto-molecules-menu-sublist__item-btn",
|
|
479
392
|
"data-testid": "help-link-help-articles-button",
|
|
480
|
-
href: "
|
|
393
|
+
href: "".concat(getNeetoUrl("help"), "/"),
|
|
481
394
|
prefix: /*#__PURE__*/jsx(Book, {
|
|
482
395
|
size: 18
|
|
483
396
|
}),
|
|
@@ -509,7 +422,7 @@ var HelpMenu = function HelpMenu() {
|
|
|
509
422
|
}), /*#__PURE__*/jsx(MenuItem$8.Button, {
|
|
510
423
|
className: "neeto-molecules-menu-sublist__item-btn",
|
|
511
424
|
"data-testid": "help-link-request-feature-button",
|
|
512
|
-
href: "".concat(
|
|
425
|
+
href: "".concat(getNeetoUrl("engage"), "/feature-requests"),
|
|
513
426
|
prefix: /*#__PURE__*/jsx(Bulb, {
|
|
514
427
|
size: 18
|
|
515
428
|
}),
|
|
@@ -519,7 +432,7 @@ var HelpMenu = function HelpMenu() {
|
|
|
519
432
|
}), /*#__PURE__*/jsx(MenuItem$8.Button, {
|
|
520
433
|
className: "neeto-molecules-menu-sublist__item-btn",
|
|
521
434
|
"data-testid": "help-link-roadmap-button",
|
|
522
|
-
href: "".concat(
|
|
435
|
+
href: "".concat(getNeetoUrl("engage"), "/product-roadmap"),
|
|
523
436
|
prefix: /*#__PURE__*/jsx(Roadmap, {
|
|
524
437
|
size: 18
|
|
525
438
|
}),
|
|
@@ -784,6 +697,29 @@ var MenuButton$1 = function MenuButton(_ref) {
|
|
|
784
697
|
}));
|
|
785
698
|
};
|
|
786
699
|
|
|
700
|
+
var MY_ORGANIZATION_URL = "/auth/organization/edit";
|
|
701
|
+
var DELETE_WORKSPACE_URL = "/auth/organization/delete";
|
|
702
|
+
var ENGAGE_WIDGET_TRIGGER_ID = "neetoengage-trigger";
|
|
703
|
+
var DEFAULT_MENU_LINK_PROPS = {
|
|
704
|
+
engageProps: {
|
|
705
|
+
id: ENGAGE_WIDGET_TRIGGER_ID,
|
|
706
|
+
label: t("neetoMolecules.sidebar.helpLinks.whatsNew"),
|
|
707
|
+
"data-testid": "help-link-engage-button"
|
|
708
|
+
},
|
|
709
|
+
keyboardShortcutProps: {
|
|
710
|
+
label: t("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
|
|
711
|
+
"data-testid": "help-link-keyboard-shortcut-button"
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
// Theme switcher
|
|
716
|
+
var APP_THEME_LOCALSTORAGE_KEY = "appTheme";
|
|
717
|
+
var THEMES = {
|
|
718
|
+
LIGHT: "neeto-ui-theme--light",
|
|
719
|
+
DARK: "neeto-ui-theme--dark"
|
|
720
|
+
};
|
|
721
|
+
var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
|
|
722
|
+
|
|
787
723
|
var Menu$1 = Dropdown$1.Menu,
|
|
788
724
|
MenuItem$3 = Dropdown$1.MenuItem;
|
|
789
725
|
var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
|
|
@@ -834,6 +770,67 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
|
|
|
834
770
|
});
|
|
835
771
|
};
|
|
836
772
|
|
|
773
|
+
var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
|
|
774
|
+
var _globalProps$user, _globalProps$user2;
|
|
775
|
+
var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
|
|
776
|
+
return "sidebarState-".concat(user);
|
|
777
|
+
};
|
|
778
|
+
var getUserProfileInfo = function getUserProfileInfo() {
|
|
779
|
+
var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
|
|
780
|
+
return {
|
|
781
|
+
name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
|
|
782
|
+
imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
783
|
+
email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
|
|
784
|
+
isAuthenticated: globalProps.authenticated
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
var getConsumerProfileInfo = function getConsumerProfileInfo() {
|
|
788
|
+
var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
|
|
789
|
+
return {
|
|
790
|
+
name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
|
|
791
|
+
imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
|
|
792
|
+
email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
|
|
793
|
+
isAuthenticated: globalProps.isConsumer
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
|
|
797
|
+
return [isAuthenticated ? {
|
|
798
|
+
label: t("neetoMolecules.sidebar.logout"),
|
|
799
|
+
icon: Logout,
|
|
800
|
+
onClick: function onClick() {
|
|
801
|
+
resetAuthTokens();
|
|
802
|
+
removeFromLocalStorage(getSidebarStateLocalStorageKey());
|
|
803
|
+
isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
|
|
804
|
+
},
|
|
805
|
+
"data-testid": "profile-logout-button"
|
|
806
|
+
} : {
|
|
807
|
+
label: t("neetoMolecules.sidebar.login"),
|
|
808
|
+
onClick: function onClick() {
|
|
809
|
+
window.location.href = "/login";
|
|
810
|
+
},
|
|
811
|
+
"data-testid": "profile-login-button"
|
|
812
|
+
}];
|
|
813
|
+
};
|
|
814
|
+
var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
|
|
815
|
+
return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
// Theme switcher utils.
|
|
819
|
+
var setDarkTheme = function setDarkTheme() {
|
|
820
|
+
if (!document.body) return;
|
|
821
|
+
document.body.classList.remove(THEMES.LIGHT);
|
|
822
|
+
document.body.classList.add(THEMES.DARK);
|
|
823
|
+
};
|
|
824
|
+
var setLightTheme = function setLightTheme() {
|
|
825
|
+
if (!document.body) return;
|
|
826
|
+
document.body.classList.remove(THEMES.DARK);
|
|
827
|
+
document.body.classList.add(THEMES.LIGHT);
|
|
828
|
+
};
|
|
829
|
+
var setAppTheme = function setAppTheme() {
|
|
830
|
+
var isDarkTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY) === THEMES.DARK;
|
|
831
|
+
isDarkTheme ? setDarkTheme() : setLightTheme();
|
|
832
|
+
};
|
|
833
|
+
|
|
837
834
|
var MenuItem$2 = Dropdown$1.MenuItem;
|
|
838
835
|
var ThemeSwitcher = function ThemeSwitcher() {
|
|
839
836
|
var _useTranslation = useTranslation(),
|