@bigbinary/neeto-commons-frontend 2.0.123 → 2.0.125

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/react-utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ComponentType, ElementType, ReactNode } from "react";
2
2
  import { RouteProps } from "react-router-dom";
3
3
  import { Notice } from "@honeybadger-io/js/dist/server/types/core/types";
4
4
  import { History } from "history";
@@ -47,8 +47,9 @@ import { UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult
47
47
  *
48
48
  */
49
49
  export const HoneybadgerErrorBoundary: React.FC<{
50
- ErrorComponent?: React.ReactNode | React.ComponentType<any>;
50
+ ErrorComponent?: ReactNode | ComponentType | ElementType;
51
51
  filterErrors?: (error: Notice) => boolean;
52
+ children?: ReactNode;
52
53
  }>;
53
54
  /**
54
55
  *
package/react-utils.js CHANGED
@@ -67,7 +67,7 @@ var FallbackComponent = function FallbackComponent() {
67
67
  style: "h2",
68
68
  weight: "semibold"
69
69
  }, t("neetoCommons.fallbackComponent.somethingWentWrong")), /*#__PURE__*/React__default.createElement(Typography, {
70
- className: "mb-8 text-gray-600",
70
+ className: "neeto-ui-text-gray-600 mb-8",
71
71
  component: "p",
72
72
  style: "body1",
73
73
  weight: "normal"
@@ -76,14 +76,12 @@ var FallbackComponent = function FallbackComponent() {
76
76
  components: {
77
77
  reloading: /*#__PURE__*/React__default.createElement(Button, {
78
78
  style: "link",
79
- label: t("neetoCommons.fallbackComponent.reloadingButtonLabel"),
80
79
  onClick: function onClick() {
81
80
  return window.location.reload();
82
81
  }
83
82
  }),
84
83
  contactus: /*#__PURE__*/React__default.createElement(Button, {
85
84
  style: "link",
86
- label: t("neetoCommons.fallbackComponent.contactusButtonLabel"),
87
85
  onClick: function onClick() {
88
86
  var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
89
87
  (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
@@ -93,7 +91,9 @@ var FallbackComponent = function FallbackComponent() {
93
91
  }
94
92
  }))));
95
93
  };
96
- var ignorableErrorsRegex = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError)/;
94
+ var ignorableErrorsRegex = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError|window\.webkit\.messageHandlers)/;
95
+
96
+ /** @type {import("neetocommons/react-utils").HoneybadgerErrorBoundary} */
97
97
  var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
98
98
  var children = _ref.children,
99
99
  _ref$ErrorComponent = _ref.ErrorComponent,
@@ -101,7 +101,7 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
101
101
  _ref$filterErrors = _ref.filterErrors,
102
102
  filterErrors = _ref$filterErrors === void 0 ? undefined : _ref$filterErrors;
103
103
  Honeybadger.beforeNotify(function (notice) {
104
- if (ignorableErrorsRegex.test(notice.message) || notice.stack.includes("chrome-extension://")) {
104
+ if (notice && (ignorableErrorsRegex.test(notice.message) || notice.stack.includes("chrome-extension://"))) {
105
105
  return false;
106
106
  }
107
107
  return filterErrors === null || filterErrors === void 0 ? void 0 : filterErrors(notice);
@@ -116,14 +116,10 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
116
116
  breadcrumbsEnabled: true,
117
117
  projectRoot: "webpack:///./"
118
118
  });
119
- return (
120
- /*#__PURE__*/
121
- // @ts-ignore
122
- React__default.createElement(HoneybadgerErrorBoundary$1, {
123
- ErrorComponent: ErrorComponent,
124
- honeybadger: honeybadger
125
- }, children)
126
- );
119
+ return /*#__PURE__*/React__default.createElement(HoneybadgerErrorBoundary$1, {
120
+ ErrorComponent: ErrorComponent,
121
+ honeybadger: honeybadger
122
+ }, children);
127
123
  };
128
124
 
129
125
  function _objectWithoutPropertiesLoose(source, excluded) {