@bigbinary/neeto-molecules 5.3.35 → 5.4.1

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 (34) hide show
  1. package/dist/FloatingActionMenu.js +136 -7
  2. package/dist/FloatingActionMenu.js.map +1 -1
  3. package/dist/Sidebar.js +1 -1
  4. package/dist/cjs/FloatingActionMenu.js +140 -11
  5. package/dist/cjs/FloatingActionMenu.js.map +1 -1
  6. package/dist/cjs/Sidebar.js +1 -1
  7. package/dist/cjs/performanceDiagnostics-CS7NTxaH.js +93 -0
  8. package/dist/cjs/performanceDiagnostics-CS7NTxaH.js.map +1 -0
  9. package/dist/cjs/{useWhatsNewChangesCount-CLo5AJny.js → useWhatsNewChangesCount-BVkLLk7f.js} +3 -1
  10. package/dist/cjs/useWhatsNewChangesCount-BVkLLk7f.js.map +1 -0
  11. package/dist/cjs/{useWhatsNewChangesCount-BzQTamII.js → useWhatsNewChangesCount-CyOUS5U3.js} +3 -1
  12. package/dist/cjs/useWhatsNewChangesCount-CyOUS5U3.js.map +1 -0
  13. package/dist/cjs/v2/FloatingActionMenu.js +168 -25
  14. package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
  15. package/dist/cjs/v2/Sidebar.js +1 -1
  16. package/dist/performanceDiagnostics-DJcT0dfG.js +88 -0
  17. package/dist/performanceDiagnostics-DJcT0dfG.js.map +1 -0
  18. package/dist/{useWhatsNewChangesCount-BaLLrXk5.js → useWhatsNewChangesCount-C71JkNHv.js} +3 -2
  19. package/dist/useWhatsNewChangesCount-C71JkNHv.js.map +1 -0
  20. package/dist/{useWhatsNewChangesCount-DLIMw7dA.js → useWhatsNewChangesCount-CQxhUCpt.js} +3 -2
  21. package/dist/useWhatsNewChangesCount-CQxhUCpt.js.map +1 -0
  22. package/dist/v2/FloatingActionMenu.js +165 -22
  23. package/dist/v2/FloatingActionMenu.js.map +1 -1
  24. package/dist/v2/Sidebar.js +1 -1
  25. package/package.json +1 -1
  26. package/src/translations/en.json +12 -1
  27. package/dist/cjs/urls-DtjJggEY.js +0 -19
  28. package/dist/cjs/urls-DtjJggEY.js.map +0 -1
  29. package/dist/cjs/useWhatsNewChangesCount-BzQTamII.js.map +0 -1
  30. package/dist/cjs/useWhatsNewChangesCount-CLo5AJny.js.map +0 -1
  31. package/dist/urls-DC61u0b2.js +0 -16
  32. package/dist/urls-DC61u0b2.js.map +0 -1
  33. package/dist/useWhatsNewChangesCount-BaLLrXk5.js.map +0 -1
  34. package/dist/useWhatsNewChangesCount-DLIMw7dA.js.map +0 -1
@@ -11,6 +11,7 @@ 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
13
  import { isEmpty, mergeDeepLeft, not } from 'ramda';
14
+ import { hideAll } from 'tippy.js';
14
15
  import KeyboardShortcuts from './KeyboardShortcuts.js';
15
16
  import SubscriptionUpgradeRequestModal from './SubscriptionUpgradeRequestModal.js';
16
17
  import Modal$1 from '@bigbinary/neetoui/Modal';
@@ -27,11 +28,12 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
27
28
  import { useQuery } from '@tanstack/react-query';
28
29
  import axios from 'axios';
29
30
  import Crown from '@bigbinary/neeto-icons/Crown';
30
- import { g as getNeetoUrl, a as getProductBillingUrl } from './urls-DC61u0b2.js';
31
+ import { g as getNeetoUrl, i as isPerformanceDiagnosticsEnabled, a as getProductBillingUrl, r as reportSlowness } from './performanceDiagnostics-DJcT0dfG.js';
31
32
  import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
32
33
  import Book from '@bigbinary/neeto-icons/Book';
33
34
  import Bulb from '@bigbinary/neeto-icons/Bulb';
34
35
  import ChatQuestions from '@bigbinary/neeto-icons/ChatQuestions';
36
+ import Clock from '@bigbinary/neeto-icons/Clock';
35
37
  import Community from '@bigbinary/neeto-icons/Community';
36
38
  import Roadmap from '@bigbinary/neeto-icons/Roadmap';
37
39
  import Status from '@bigbinary/neeto-icons/Status';
@@ -42,7 +44,7 @@ import Tag from '@bigbinary/neetoui/Tag';
42
44
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
43
45
  import CloseCircle from '@bigbinary/neeto-icons/CloseCircle';
44
46
  import User from '@bigbinary/neeto-icons/User';
45
- import { D as DELETE_WORKSPACE_URL, A as APP_THEME_LOCALSTORAGE_KEY, T as THEMES, M as MY_ORGANIZATION_URL, N as NEETO_AUTH_BILLING_INFO_URL, u as useWhatsNewChangesCount, a as DEFAULT_MENU_LINK_PROPS } from './useWhatsNewChangesCount-BaLLrXk5.js';
47
+ import { D as DELETE_WORKSPACE_URL, A as APP_THEME_LOCALSTORAGE_KEY, T as THEMES, M as MY_ORGANIZATION_URL, N as NEETO_AUTH_BILLING_INFO_URL, S as SLOWNESS_DESCRIPTION_MAX_LENGTH, u as useWhatsNewChangesCount, a as DEFAULT_MENU_LINK_PROPS } from './useWhatsNewChangesCount-C71JkNHv.js';
46
48
  import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
47
49
  import Moon from '@bigbinary/neeto-icons/Moon';
48
50
  import Sun from '@bigbinary/neeto-icons/Sun';
@@ -52,12 +54,15 @@ import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils/axios';
52
54
  import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils/general';
53
55
  import Logout from '@bigbinary/neeto-icons/Logout';
54
56
  import CopyToClipboardButton from './CopyToClipboardButton.js';
57
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
58
+ import Button from '@bigbinary/neetoui/Button';
59
+ import Textarea from '@bigbinary/neetoui/Textarea';
60
+ import Toastr from '@bigbinary/neetoui/Toastr';
55
61
  import './useKeyboardShortcutsPaneState-Ckzn5mVZ.js';
56
62
  import 'zustand/shallow';
57
63
  import '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
58
64
  import 'zustand';
59
65
  import '@bigbinary/neeto-icons/Close';
60
- import '@bigbinary/neetoui/Button';
61
66
  import '@bigbinary/neetoui/managers';
62
67
  import '@bigbinary/neetoui/Kbd';
63
68
  import 'ua-parser-js';
@@ -370,7 +375,8 @@ var MenuButton$4 = withT(function (_ref) {
370
375
 
371
376
  var Menu$4 = Dropdown$1.Menu,
372
377
  MenuItem$8 = Dropdown$1.MenuItem;
373
- var HelpMenu = function HelpMenu() {
378
+ var HelpMenu = function HelpMenu(_ref) {
379
+ var onReportSlowness = _ref.onReportSlowness;
374
380
  var _useTranslation = useTranslation(),
375
381
  t = _useTranslation.t;
376
382
  var _useBreakpoints = useBreakpoints(),
@@ -450,6 +456,14 @@ var HelpMenu = function HelpMenu() {
450
456
  rel: "noreferrer",
451
457
  target: "_blank",
452
458
  children: t("neetoMolecules.sidebar.helpLinks.systemStatus")
459
+ }), isPerformanceDiagnosticsEnabled() && /*#__PURE__*/jsx(MenuItem$8.Button, {
460
+ className: "neeto-molecules-menu-sublist__item-btn",
461
+ "data-testid": "help-link-report-slowness-button",
462
+ prefix: /*#__PURE__*/jsx(Clock, {
463
+ size: 18
464
+ }),
465
+ onClick: onReportSlowness,
466
+ children: t("neetoMolecules.sidebar.helpLinks.reportSlowness")
453
467
  })]
454
468
  })
455
469
  });
@@ -959,7 +973,8 @@ var ProfileMenu = function ProfileMenu(_ref) {
959
973
  isOrganizationSwitcherEnabled = _ref.isOrganizationSwitcherEnabled,
960
974
  isConsumer = _ref.isConsumer,
961
975
  enableSubscriptionUpgradeRequest = _ref.enableSubscriptionUpgradeRequest,
962
- openUpgradeModal = _ref.openUpgradeModal;
976
+ openUpgradeModal = _ref.openUpgradeModal,
977
+ onReportSlowness = _ref.onReportSlowness;
963
978
  var Menu = Dropdown$1.Menu,
964
979
  MenuItem = Dropdown$1.MenuItem,
965
980
  Divider = Dropdown$1.Divider;
@@ -1020,7 +1035,9 @@ var ProfileMenu = function ProfileMenu(_ref) {
1020
1035
  links: [subscriptionPlanLink]
1021
1036
  }), showProductSwitcher && /*#__PURE__*/jsx(ProductSwitcher, {
1022
1037
  toggleModal: toggleModal
1023
- }), /*#__PURE__*/jsx(HelpMenu, {}), /*#__PURE__*/jsx(Divider, {})]
1038
+ }), /*#__PURE__*/jsx(HelpMenu, {
1039
+ onReportSlowness: onReportSlowness
1040
+ }), /*#__PURE__*/jsx(Divider, {})]
1024
1041
  }), isAuthenticated && !isConsumer && /*#__PURE__*/jsx(ProfileExpandMenu, {
1025
1042
  profileInfo: profileInfo
1026
1043
  }), /*#__PURE__*/jsx(LinkSection, {
@@ -1031,6 +1048,105 @@ var ProfileMenu = function ProfileMenu(_ref) {
1031
1048
  });
1032
1049
  };
1033
1050
 
1051
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = true, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), true), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1052
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1053
+ var ReportSlownessModal = function ReportSlownessModal(_ref) {
1054
+ var reportedAt = _ref.reportedAt,
1055
+ onClose = _ref.onClose;
1056
+ var _useTranslation = useTranslation(),
1057
+ t = _useTranslation.t;
1058
+ var _useState = useState(""),
1059
+ _useState2 = _slicedToArray(_useState, 2),
1060
+ description = _useState2[0],
1061
+ setDescription = _useState2[1];
1062
+ var _useState3 = useState(false),
1063
+ _useState4 = _slicedToArray(_useState3, 2),
1064
+ isSubmitting = _useState4[0],
1065
+ setIsSubmitting = _useState4[1];
1066
+ var handleClose = function handleClose() {
1067
+ setDescription("");
1068
+ onClose();
1069
+ };
1070
+ var handleSubmit = /*#__PURE__*/function () {
1071
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
1072
+ var report;
1073
+ return _regenerator().w(function (_context) {
1074
+ while (1) switch (_context.n) {
1075
+ case 0:
1076
+ setIsSubmitting(true);
1077
+ _context.n = 1;
1078
+ return reportSlowness({
1079
+ description: description.trim(),
1080
+ reportedAt: reportedAt
1081
+ });
1082
+ case 1:
1083
+ report = _context.v;
1084
+ setIsSubmitting(false);
1085
+ if (report) {
1086
+ _context.n = 2;
1087
+ break;
1088
+ }
1089
+ Toastr.error(t("neetoMolecules.reportSlowness.error"));
1090
+ return _context.a(2);
1091
+ case 2:
1092
+ Toastr.success(t("neetoMolecules.reportSlowness.success"), report.replay_url ? {
1093
+ buttonLabel: t("neetoMolecules.reportSlowness.viewReplay"),
1094
+ onClick: function onClick() {
1095
+ return window.open(report.replay_url, "_blank", "noopener,noreferrer");
1096
+ }
1097
+ } : {});
1098
+ handleClose();
1099
+ case 3:
1100
+ return _context.a(2);
1101
+ }
1102
+ }, _callee);
1103
+ }));
1104
+ return function handleSubmit() {
1105
+ return _ref2.apply(this, arguments);
1106
+ };
1107
+ }();
1108
+ return /*#__PURE__*/jsxs(Modal$1, {
1109
+ closeOnEsc: !isSubmitting,
1110
+ closeOnOutsideClick: !isSubmitting,
1111
+ isOpen: Boolean(reportedAt),
1112
+ onClose: handleClose,
1113
+ children: [/*#__PURE__*/jsx(Modal$1.Header, {
1114
+ children: /*#__PURE__*/jsx(Typography, {
1115
+ style: "h3",
1116
+ weight: "semibold",
1117
+ children: t("neetoMolecules.reportSlowness.title")
1118
+ })
1119
+ }), /*#__PURE__*/jsx(Modal$1.Body, {
1120
+ children: /*#__PURE__*/jsx(Textarea, {
1121
+ "data-testid": "report-slowness-description-text-input",
1122
+ label: t("neetoMolecules.reportSlowness.descriptionLabel"),
1123
+ maxLength: SLOWNESS_DESCRIPTION_MAX_LENGTH,
1124
+ value: description,
1125
+ placeholder: t("neetoMolecules.reportSlowness.descriptionPlaceholder"),
1126
+ onChange: function onChange(e) {
1127
+ return setDescription(e.target.value);
1128
+ }
1129
+ })
1130
+ }), /*#__PURE__*/jsxs(Modal$1.Footer, {
1131
+ className: "flex gap-x-2",
1132
+ children: [/*#__PURE__*/jsx(Button, {
1133
+ "data-testid": "report-slowness-cancel-button",
1134
+ disabled: isSubmitting,
1135
+ label: t("neetoMolecules.reportSlowness.cancel"),
1136
+ style: "secondary",
1137
+ onClick: handleClose
1138
+ }), /*#__PURE__*/jsx(Button, {
1139
+ "data-testid": "report-slowness-submit-button",
1140
+ disabled: isSubmitting,
1141
+ label: t("neetoMolecules.reportSlowness.submit"),
1142
+ loading: isSubmitting,
1143
+ style: "primary",
1144
+ onClick: handleSubmit
1145
+ })]
1146
+ })]
1147
+ });
1148
+ };
1149
+
1034
1150
  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; }
1035
1151
  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; }
1036
1152
  var ProfileButton = function ProfileButton(_ref) {
@@ -1057,6 +1173,10 @@ var ProfileButton = function ProfileButton(_ref) {
1057
1173
  _useState6 = _slicedToArray(_useState5, 2),
1058
1174
  isBackdropVisible = _useState6[0],
1059
1175
  setIsBackdropVisible = _useState6[1];
1176
+ var _useState7 = useState(null),
1177
+ _useState8 = _slicedToArray(_useState7, 2),
1178
+ slownessReportedAt = _useState8[0],
1179
+ setSlownessReportedAt = _useState8[1];
1060
1180
  var changesCount = useWhatsNewChangesCount();
1061
1181
  var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
1062
1182
  _KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
@@ -1139,12 +1259,21 @@ var ProfileButton = function ProfileButton(_ref) {
1139
1259
  openUpgradeModal: function openUpgradeModal() {
1140
1260
  return setIsUpgradeModalOpen(true);
1141
1261
  },
1142
- toggleModal: setIsModalOpen
1262
+ toggleModal: setIsModalOpen,
1263
+ onReportSlowness: function onReportSlowness() {
1264
+ setSlownessReportedAt(Date.now());
1265
+ hideAll();
1266
+ }
1143
1267
  })
1144
1268
  }), isPresent(changesCount) && /*#__PURE__*/jsx("span", {
1145
1269
  className: "neeto-molecules-menu__notif-count",
1146
1270
  "data-testid": "help-icon-changes-count",
1147
1271
  children: changesCount
1272
+ }), /*#__PURE__*/jsx(ReportSlownessModal, {
1273
+ reportedAt: slownessReportedAt,
1274
+ onClose: function onClose() {
1275
+ return setSlownessReportedAt(null);
1276
+ }
1148
1277
  }), /*#__PURE__*/jsx(Modal, {
1149
1278
  isOpen: isModalOpen,
1150
1279
  onClose: function onClose() {