@bigbinary/neeto-molecules 5.3.10 → 5.3.12

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.
@@ -25,14 +25,14 @@ var axios = require('axios');
25
25
  var search = require('../search-DoXqXFel.js');
26
26
  var useBreakpoints = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints');
27
27
  var i18next = require('i18next');
28
+ var utils = require('@bigbinary/neeto-commons-frontend/v2/utils');
29
+ var axios$1 = require('@bigbinary/neeto-commons-frontend/v2/utils/axios');
30
+ var general = require('@bigbinary/neeto-commons-frontend/v2/utils/general');
28
31
  var createLucideIcon = require('../createLucideIcon-BbuuRL2u.js');
29
32
  var circleQuestionMark = require('../circle-question-mark-BijjM_4y.js');
30
33
  var chevronRight = require('../chevron-right-BVivH_B-.js');
31
34
  var user = require('../user-bZmvS8wE.js');
32
35
  var useLocalStorage = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useLocalStorage');
33
- var utils = require('@bigbinary/neeto-commons-frontend/v2/utils');
34
- var axios$1 = require('@bigbinary/neeto-commons-frontend/v2/utils/axios');
35
- var general = require('@bigbinary/neeto-commons-frontend/v2/utils/general');
36
36
  var v2_CopyToClipboardButton = require('./CopyToClipboardButton.js');
37
37
  require('../useKeyboardShortcutsPaneState-DZUnpw9v.js');
38
38
  require('zustand/shallow');
@@ -70,7 +70,7 @@ var AppIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(AppIcons);
70
70
  */
71
71
 
72
72
 
73
- const __iconNode$9 = [
73
+ const __iconNode$b = [
74
74
  [
75
75
  "path",
76
76
  {
@@ -79,7 +79,7 @@ const __iconNode$9 = [
79
79
  }
80
80
  ]
81
81
  ];
82
- const Activity = createLucideIcon.createLucideIcon("activity", __iconNode$9);
82
+ const Activity = createLucideIcon.createLucideIcon("activity", __iconNode$b);
83
83
 
84
84
  /**
85
85
  * @license lucide-react v1.24.0 - ISC
@@ -89,7 +89,7 @@ const Activity = createLucideIcon.createLucideIcon("activity", __iconNode$9);
89
89
  */
90
90
 
91
91
 
92
- const __iconNode$8 = [
92
+ const __iconNode$a = [
93
93
  ["path", { d: "M12 7v14", key: "1akyts" }],
94
94
  [
95
95
  "path",
@@ -99,7 +99,7 @@ const __iconNode$8 = [
99
99
  }
100
100
  ]
101
101
  ];
102
- const BookOpen = createLucideIcon.createLucideIcon("book-open", __iconNode$8);
102
+ const BookOpen = createLucideIcon.createLucideIcon("book-open", __iconNode$a);
103
103
 
104
104
  /**
105
105
  * @license lucide-react v1.24.0 - ISC
@@ -109,11 +109,11 @@ const BookOpen = createLucideIcon.createLucideIcon("book-open", __iconNode$8);
109
109
  */
110
110
 
111
111
 
112
- const __iconNode$7 = [
112
+ const __iconNode$9 = [
113
113
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
114
114
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
115
115
  ];
116
- const CircleCheck = createLucideIcon.createLucideIcon("circle-check", __iconNode$7);
116
+ const CircleCheck = createLucideIcon.createLucideIcon("circle-check", __iconNode$9);
117
117
 
118
118
  /**
119
119
  * @license lucide-react v1.24.0 - ISC
@@ -123,12 +123,12 @@ const CircleCheck = createLucideIcon.createLucideIcon("circle-check", __iconNode
123
123
  */
124
124
 
125
125
 
126
- const __iconNode$6 = [
126
+ const __iconNode$8 = [
127
127
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
128
128
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
129
129
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
130
130
  ];
131
- const CircleX = createLucideIcon.createLucideIcon("circle-x", __iconNode$6);
131
+ const CircleX = createLucideIcon.createLucideIcon("circle-x", __iconNode$8);
132
132
 
133
133
  /**
134
134
  * @license lucide-react v1.24.0 - ISC
@@ -138,7 +138,7 @@ const CircleX = createLucideIcon.createLucideIcon("circle-x", __iconNode$6);
138
138
  */
139
139
 
140
140
 
141
- const __iconNode$5 = [
141
+ const __iconNode$7 = [
142
142
  [
143
143
  "path",
144
144
  {
@@ -148,7 +148,7 @@ const __iconNode$5 = [
148
148
  ],
149
149
  ["path", { d: "M5 21h14", key: "11awu3" }]
150
150
  ];
151
- const Crown = createLucideIcon.createLucideIcon("crown", __iconNode$5);
151
+ const Crown = createLucideIcon.createLucideIcon("crown", __iconNode$7);
152
152
 
153
153
  /**
154
154
  * @license lucide-react v1.24.0 - ISC
@@ -158,12 +158,54 @@ const Crown = createLucideIcon.createLucideIcon("crown", __iconNode$5);
158
158
  */
159
159
 
160
160
 
161
- const __iconNode$4 = [
161
+ const __iconNode$6 = [
162
+ [
163
+ "path",
164
+ {
165
+ d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
166
+ key: "1gvzjb"
167
+ }
168
+ ],
169
+ ["path", { d: "M9 18h6", key: "x1upvd" }],
170
+ ["path", { d: "M10 22h4", key: "ceow96" }]
171
+ ];
172
+ const Lightbulb = createLucideIcon.createLucideIcon("lightbulb", __iconNode$6);
173
+
174
+ /**
175
+ * @license lucide-react v1.24.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */
180
+
181
+
182
+ const __iconNode$5 = [
162
183
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
163
184
  ["path", { d: "M21 12H9", key: "dn1m92" }],
164
185
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
165
186
  ];
166
- const LogOut = createLucideIcon.createLucideIcon("log-out", __iconNode$4);
187
+ const LogOut = createLucideIcon.createLucideIcon("log-out", __iconNode$5);
188
+
189
+ /**
190
+ * @license lucide-react v1.24.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */
195
+
196
+
197
+ const __iconNode$4 = [
198
+ [
199
+ "path",
200
+ {
201
+ d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
202
+ key: "169xi5"
203
+ }
204
+ ],
205
+ ["path", { d: "M15 5.764v15", key: "1pn4in" }],
206
+ ["path", { d: "M9 3.236v15", key: "1uimfh" }]
207
+ ];
208
+ const Map = createLucideIcon.createLucideIcon("map", __iconNode$4);
167
209
 
168
210
  /**
169
211
  * @license lucide-react v1.24.0 - ISC
@@ -563,6 +605,72 @@ var MENU_ITEM_CLASSES = "gap-2.5 px-2.5 py-2 font-medium [&>[data-slot=menu-item
563
605
  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";
564
606
  var THEME_ICON_BASE = "transition-transform duration-300 ease-out";
565
607
 
608
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
609
+ var _globalProps$user, _globalProps$user2;
610
+ 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);
611
+ return "sidebarState-".concat(user);
612
+ };
613
+ var getUserProfileInfo = function getUserProfileInfo() {
614
+ var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
615
+ return {
616
+ 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 : ""),
617
+ 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",
618
+ 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),
619
+ isAuthenticated: globalProps.authenticated
620
+ };
621
+ };
622
+ var getConsumerProfileInfo = function getConsumerProfileInfo() {
623
+ var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
624
+ return {
625
+ 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 : ""),
626
+ imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
627
+ 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),
628
+ isAuthenticated: globalProps.isConsumer
629
+ };
630
+ };
631
+ var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
632
+ return [isAuthenticated ? {
633
+ label: i18next.t("neetoMolecules.sidebar.logout"),
634
+ icon: LogOut,
635
+ onClick: function onClick() {
636
+ axios$1.resetAuthTokens();
637
+ general.removeFromLocalStorage(getSidebarStateLocalStorageKey());
638
+ isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
639
+ },
640
+ "data-testid": "profile-logout-button"
641
+ } : {
642
+ label: i18next.t("neetoMolecules.sidebar.login"),
643
+ onClick: function onClick() {
644
+ window.location.href = "/login";
645
+ },
646
+ "data-testid": "profile-login-button"
647
+ }];
648
+ };
649
+ var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
650
+ return ramda.mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
651
+ };
652
+
653
+ // Theme switcher utils.
654
+ var setDarkTheme = function setDarkTheme() {
655
+ if (!document.body) return;
656
+ document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
657
+ document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
658
+ };
659
+ var setLightTheme = function setLightTheme() {
660
+ if (!document.body) return;
661
+ document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
662
+ document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
663
+ };
664
+ var setAppTheme = function setAppTheme() {
665
+ var storedTheme = utils.getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
666
+ var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
667
+ isDarkTheme ? setDarkTheme() : setLightTheme();
668
+ };
669
+ var getRoadmapUrl = function getRoadmapUrl() {
670
+ var _globalProps;
671
+ return "https://roadmap.".concat(ramda.toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com");
672
+ };
673
+
566
674
  var _excluded$2 = ["className"];
567
675
  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; }
568
676
  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; }
@@ -609,6 +717,24 @@ var HelpItems = reactUtils.withT(function (_ref) {
609
717
  rel: "noreferrer",
610
718
  target: "_blank",
611
719
  children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
720
+ }), /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
721
+ "data-testid": "help-link-request-feature-button",
722
+ href: "".concat(getRoadmapUrl(), "/feature-requests"),
723
+ prefix: /*#__PURE__*/jsxRuntime.jsx(Lightbulb, {
724
+ size: 18
725
+ }),
726
+ rel: "noreferrer",
727
+ target: "_blank",
728
+ children: t("neetoMolecules.sidebar.helpLinks.requestFeature")
729
+ }), /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
730
+ "data-testid": "help-link-roadmap-button",
731
+ href: "".concat(getRoadmapUrl(), "/product-roadmap"),
732
+ prefix: /*#__PURE__*/jsxRuntime.jsx(Map, {
733
+ size: 18
734
+ }),
735
+ rel: "noreferrer",
736
+ target: "_blank",
737
+ children: t("neetoMolecules.sidebar.helpLinks.roadmap")
612
738
  }), /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
613
739
  "data-testid": "help-link-status-button",
614
740
  href: "https://neetostatus.com/",
@@ -1026,68 +1152,6 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1026
1152
  });
1027
1153
  };
1028
1154
 
1029
- var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
1030
- var _globalProps$user, _globalProps$user2;
1031
- 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);
1032
- return "sidebarState-".concat(user);
1033
- };
1034
- var getUserProfileInfo = function getUserProfileInfo() {
1035
- var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
1036
- return {
1037
- 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 : ""),
1038
- 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",
1039
- 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),
1040
- isAuthenticated: globalProps.authenticated
1041
- };
1042
- };
1043
- var getConsumerProfileInfo = function getConsumerProfileInfo() {
1044
- var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
1045
- return {
1046
- 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 : ""),
1047
- imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1048
- 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),
1049
- isAuthenticated: globalProps.isConsumer
1050
- };
1051
- };
1052
- var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
1053
- return [isAuthenticated ? {
1054
- label: i18next.t("neetoMolecules.sidebar.logout"),
1055
- icon: LogOut,
1056
- onClick: function onClick() {
1057
- axios$1.resetAuthTokens();
1058
- general.removeFromLocalStorage(getSidebarStateLocalStorageKey());
1059
- isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
1060
- },
1061
- "data-testid": "profile-logout-button"
1062
- } : {
1063
- label: i18next.t("neetoMolecules.sidebar.login"),
1064
- onClick: function onClick() {
1065
- window.location.href = "/login";
1066
- },
1067
- "data-testid": "profile-login-button"
1068
- }];
1069
- };
1070
- var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
1071
- return ramda.mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
1072
- };
1073
-
1074
- // Theme switcher utils.
1075
- var setDarkTheme = function setDarkTheme() {
1076
- if (!document.body) return;
1077
- document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1078
- document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
1079
- };
1080
- var setLightTheme = function setLightTheme() {
1081
- if (!document.body) return;
1082
- document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
1083
- document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1084
- };
1085
- var setAppTheme = function setAppTheme() {
1086
- var storedTheme = utils.getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
1087
- var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
1088
- isDarkTheme ? setDarkTheme() : setLightTheme();
1089
- };
1090
-
1091
1155
  var ThemeSwitcher = function ThemeSwitcher() {
1092
1156
  var _useTranslation = reactI18next.useTranslation(),
1093
1157
  t = _useTranslation.t;