@bigbinary/neeto-molecules 5.3.12 → 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.
Files changed (56) hide show
  1. package/dist/FloatingActionMenu.js +94 -97
  2. package/dist/FloatingActionMenu.js.map +1 -1
  3. package/dist/cjs/FloatingActionMenu.js +93 -96
  4. package/dist/cjs/FloatingActionMenu.js.map +1 -1
  5. package/dist/cjs/urls-CC4qs7hW.js +11 -0
  6. package/dist/cjs/urls-CC4qs7hW.js.map +1 -0
  7. package/dist/cjs/v2/Builder.js +17 -13
  8. package/dist/cjs/v2/Builder.js.map +1 -1
  9. package/dist/cjs/v2/Engagements.js +1 -1
  10. package/dist/cjs/v2/Engagements.js.map +1 -1
  11. package/dist/cjs/v2/FloatingActionMenu.js +69 -73
  12. package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
  13. package/dist/urls-CN1MpSwF.js +9 -0
  14. package/dist/urls-CN1MpSwF.js.map +1 -0
  15. package/dist/v2/Builder.js +17 -13
  16. package/dist/v2/Builder.js.map +1 -1
  17. package/dist/v2/Engagements.js +1 -1
  18. package/dist/v2/Engagements.js.map +1 -1
  19. package/dist/v2/FloatingActionMenu.js +70 -74
  20. package/dist/v2/FloatingActionMenu.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/translations/ar.json +3 -1
  23. package/src/translations/bg.json +3 -1
  24. package/src/translations/ca.json +3 -1
  25. package/src/translations/cs.json +3 -1
  26. package/src/translations/da.json +3 -1
  27. package/src/translations/de.json +3 -1
  28. package/src/translations/es-MX.json +3 -1
  29. package/src/translations/es.json +3 -1
  30. package/src/translations/et.json +3 -1
  31. package/src/translations/fi.json +3 -1
  32. package/src/translations/fil.json +3 -1
  33. package/src/translations/fr.json +3 -1
  34. package/src/translations/he.json +3 -1
  35. package/src/translations/hi.json +3 -1
  36. package/src/translations/hr.json +3 -1
  37. package/src/translations/hu.json +3 -1
  38. package/src/translations/id.json +3 -1
  39. package/src/translations/it.json +3 -1
  40. package/src/translations/ja.json +3 -1
  41. package/src/translations/ko.json +3 -1
  42. package/src/translations/nl.json +3 -1
  43. package/src/translations/pl.json +3 -1
  44. package/src/translations/pt-BR.json +3 -1
  45. package/src/translations/pt.json +3 -1
  46. package/src/translations/ro.json +3 -1
  47. package/src/translations/ru.json +3 -1
  48. package/src/translations/sk.json +3 -1
  49. package/src/translations/sl.json +3 -1
  50. package/src/translations/sv.json +3 -1
  51. package/src/translations/th.json +3 -1
  52. package/src/translations/tr.json +3 -1
  53. package/src/translations/uk.json +3 -1
  54. package/src/translations/vi.json +3 -1
  55. package/src/translations/zh-CN.json +3 -1
  56. package/src/translations/zh-TW.json +3 -1
@@ -9,7 +9,7 @@ import { Collapsible, CollapsibleTrigger, DropdownMenuItem, CollapsibleContent,
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/Profile';
12
- import { isEmpty, toLower, mergeDeepLeft, not } from 'ramda';
12
+ import { isEmpty, mergeDeepLeft, not } from 'ramda';
13
13
  import KeyboardShortcuts from './KeyboardShortcuts.js';
14
14
  import SubscriptionUpgradeRequestModal from './SubscriptionUpgradeRequestModal.js';
15
15
  import { withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
@@ -22,15 +22,16 @@ import { useQuery } from '@tanstack/react-query';
22
22
  import axios from 'axios';
23
23
  import { S as Search } from '../search-H0uYy0W-.js';
24
24
  import useBreakpoints from '@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints';
25
+ import { g as getNeetoUrl } from '../urls-CN1MpSwF.js';
25
26
  import { t } from 'i18next';
26
- import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
27
- import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/v2/utils/axios';
28
- import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
29
27
  import { c as createLucideIcon } from '../createLucideIcon--oLqczpc.js';
30
28
  import { C as CircleQuestionMark } from '../circle-question-mark-B807GLZf.js';
31
29
  import { C as ChevronRight } from '../chevron-right-CEsVcNLw.js';
32
30
  import { U as User } from '../user-Dhw9zdMR.js';
33
31
  import useLocalStorage from '@bigbinary/neeto-commons-frontend/v2/react-utils/useLocalStorage';
32
+ import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
33
+ import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/v2/utils/axios';
34
+ import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
34
35
  import CopyToClipboardButton from './CopyToClipboardButton.js';
35
36
  import '../useKeyboardShortcutsPaneState-BlyFMEtW.js';
36
37
  import 'zustand/shallow';
@@ -584,72 +585,6 @@ var MENU_ITEM_CLASSES = "gap-2.5 px-2.5 py-2 font-medium [&>[data-slot=menu-item
584
585
  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";
585
586
  var THEME_ICON_BASE = "transition-transform duration-300 ease-out";
586
587
 
587
- var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
588
- var _globalProps$user, _globalProps$user2;
589
- 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);
590
- return "sidebarState-".concat(user);
591
- };
592
- var getUserProfileInfo = function getUserProfileInfo() {
593
- var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
594
- return {
595
- 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 : ""),
596
- 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",
597
- 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),
598
- isAuthenticated: globalProps.authenticated
599
- };
600
- };
601
- var getConsumerProfileInfo = function getConsumerProfileInfo() {
602
- var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
603
- return {
604
- 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 : ""),
605
- imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
606
- 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),
607
- isAuthenticated: globalProps.isConsumer
608
- };
609
- };
610
- var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
611
- return [isAuthenticated ? {
612
- label: t("neetoMolecules.sidebar.logout"),
613
- icon: LogOut,
614
- onClick: function onClick() {
615
- resetAuthTokens();
616
- removeFromLocalStorage(getSidebarStateLocalStorageKey());
617
- isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
618
- },
619
- "data-testid": "profile-logout-button"
620
- } : {
621
- label: t("neetoMolecules.sidebar.login"),
622
- onClick: function onClick() {
623
- window.location.href = "/login";
624
- },
625
- "data-testid": "profile-login-button"
626
- }];
627
- };
628
- var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
629
- return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
630
- };
631
-
632
- // Theme switcher utils.
633
- var setDarkTheme = function setDarkTheme() {
634
- if (!document.body) return;
635
- document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
636
- document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
637
- };
638
- var setLightTheme = function setLightTheme() {
639
- if (!document.body) return;
640
- document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
641
- document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
642
- };
643
- var setAppTheme = function setAppTheme() {
644
- var storedTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
645
- var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
646
- isDarkTheme ? setDarkTheme() : setLightTheme();
647
- };
648
- var getRoadmapUrl = function getRoadmapUrl() {
649
- var _globalProps;
650
- return "https://roadmap.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com");
651
- };
652
-
653
588
  var _excluded$2 = ["className"];
654
589
  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; }
655
590
  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; }
@@ -664,12 +599,11 @@ var MenuItem = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
664
599
  MenuItem.displayName = "FloatingActionMenu.MenuItem";
665
600
 
666
601
  var HelpItems = withT(function (_ref) {
667
- var _globalProps;
668
602
  var t = _ref.t;
669
603
  return /*#__PURE__*/jsxs(Fragment, {
670
604
  children: [/*#__PURE__*/jsx(MenuItem, {
671
605
  "data-testid": "help-link-help-articles-button",
672
- href: "https://help.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
606
+ href: "".concat(getNeetoUrl("help"), "/"),
673
607
  prefix: /*#__PURE__*/jsx(BookOpen, {
674
608
  size: 18
675
609
  }),
@@ -698,7 +632,7 @@ var HelpItems = withT(function (_ref) {
698
632
  children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
699
633
  }), /*#__PURE__*/jsx(MenuItem, {
700
634
  "data-testid": "help-link-request-feature-button",
701
- href: "".concat(getRoadmapUrl(), "/feature-requests"),
635
+ href: "".concat(getNeetoUrl("engage"), "/feature-requests"),
702
636
  prefix: /*#__PURE__*/jsx(Lightbulb, {
703
637
  size: 18
704
638
  }),
@@ -707,7 +641,7 @@ var HelpItems = withT(function (_ref) {
707
641
  children: t("neetoMolecules.sidebar.helpLinks.requestFeature")
708
642
  }), /*#__PURE__*/jsx(MenuItem, {
709
643
  "data-testid": "help-link-roadmap-button",
710
- href: "".concat(getRoadmapUrl(), "/product-roadmap"),
644
+ href: "".concat(getNeetoUrl("engage"), "/product-roadmap"),
711
645
  prefix: /*#__PURE__*/jsx(Map, {
712
646
  size: 18
713
647
  }),
@@ -1131,6 +1065,68 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1131
1065
  });
1132
1066
  };
1133
1067
 
1068
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
1069
+ var _globalProps$user, _globalProps$user2;
1070
+ 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);
1071
+ return "sidebarState-".concat(user);
1072
+ };
1073
+ var getUserProfileInfo = function getUserProfileInfo() {
1074
+ var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
1075
+ return {
1076
+ 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 : ""),
1077
+ 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",
1078
+ 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),
1079
+ isAuthenticated: globalProps.authenticated
1080
+ };
1081
+ };
1082
+ var getConsumerProfileInfo = function getConsumerProfileInfo() {
1083
+ var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
1084
+ return {
1085
+ 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 : ""),
1086
+ imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1087
+ 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),
1088
+ isAuthenticated: globalProps.isConsumer
1089
+ };
1090
+ };
1091
+ var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
1092
+ return [isAuthenticated ? {
1093
+ label: t("neetoMolecules.sidebar.logout"),
1094
+ icon: LogOut,
1095
+ onClick: function onClick() {
1096
+ resetAuthTokens();
1097
+ removeFromLocalStorage(getSidebarStateLocalStorageKey());
1098
+ isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
1099
+ },
1100
+ "data-testid": "profile-logout-button"
1101
+ } : {
1102
+ label: t("neetoMolecules.sidebar.login"),
1103
+ onClick: function onClick() {
1104
+ window.location.href = "/login";
1105
+ },
1106
+ "data-testid": "profile-login-button"
1107
+ }];
1108
+ };
1109
+ var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
1110
+ return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
1111
+ };
1112
+
1113
+ // Theme switcher utils.
1114
+ var setDarkTheme = function setDarkTheme() {
1115
+ if (!document.body) return;
1116
+ document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1117
+ document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
1118
+ };
1119
+ var setLightTheme = function setLightTheme() {
1120
+ if (!document.body) return;
1121
+ document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
1122
+ document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1123
+ };
1124
+ var setAppTheme = function setAppTheme() {
1125
+ var storedTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
1126
+ var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
1127
+ isDarkTheme ? setDarkTheme() : setLightTheme();
1128
+ };
1129
+
1134
1130
  var ThemeSwitcher = function ThemeSwitcher() {
1135
1131
  var _useTranslation = useTranslation(),
1136
1132
  t = _useTranslation.t;