chayns-api 1.0.50 → 1.0.51
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.
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.withCompatMode = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
+
var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -27,9 +28,9 @@ const withCompatMode = Component => {
|
|
|
27
28
|
const {
|
|
28
29
|
innerRef
|
|
29
30
|
} = this.props;
|
|
30
|
-
const component = /*#__PURE__*/_react.default.createElement(Component, _extends({}, this.props, {
|
|
31
|
+
const component = /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, null, /*#__PURE__*/_react.default.createElement(Component, _extends({}, this.props, {
|
|
31
32
|
ref: innerRef
|
|
32
|
-
}));
|
|
33
|
+
})));
|
|
33
34
|
if (typeof ((_ReactDOMClient = ReactDOMClient) === null || _ReactDOMClient === void 0 ? void 0 : _ReactDOMClient.createRoot) === 'function') {
|
|
34
35
|
this.root = ReactDOMClient.createRoot(this.ref.current);
|
|
35
36
|
this.root.render(component);
|
|
@@ -41,9 +42,9 @@ const withCompatMode = Component => {
|
|
|
41
42
|
const {
|
|
42
43
|
innerRef
|
|
43
44
|
} = this.props;
|
|
44
|
-
const component = /*#__PURE__*/_react.default.createElement(Component, _extends({}, this.props, {
|
|
45
|
+
const component = /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, null, /*#__PURE__*/_react.default.createElement(Component, _extends({}, this.props, {
|
|
45
46
|
ref: innerRef
|
|
46
|
-
}));
|
|
47
|
+
})));
|
|
47
48
|
if (this.root) {
|
|
48
49
|
this.root.render(component);
|
|
49
50
|
} else {
|
|
@@ -3,6 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
|
|
4
4
|
import React, { PureComponent } from 'react';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
6
7
|
let ReactDOMClient;
|
|
7
8
|
try {
|
|
8
9
|
ReactDOMClient = require('react-dom/client');
|
|
@@ -20,9 +21,9 @@ export const withCompatMode = Component => {
|
|
|
20
21
|
const {
|
|
21
22
|
innerRef
|
|
22
23
|
} = this.props;
|
|
23
|
-
const component = /*#__PURE__*/React.createElement(Component, _extends({}, this.props, {
|
|
24
|
+
const component = /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Component, _extends({}, this.props, {
|
|
24
25
|
ref: innerRef
|
|
25
|
-
}));
|
|
26
|
+
})));
|
|
26
27
|
if (typeof ((_ReactDOMClient = ReactDOMClient) === null || _ReactDOMClient === void 0 ? void 0 : _ReactDOMClient.createRoot) === 'function') {
|
|
27
28
|
this.root = ReactDOMClient.createRoot(this.ref.current);
|
|
28
29
|
this.root.render(component);
|
|
@@ -34,9 +35,9 @@ export const withCompatMode = Component => {
|
|
|
34
35
|
const {
|
|
35
36
|
innerRef
|
|
36
37
|
} = this.props;
|
|
37
|
-
const component = /*#__PURE__*/React.createElement(Component, _extends({}, this.props, {
|
|
38
|
+
const component = /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Component, _extends({}, this.props, {
|
|
38
39
|
ref: innerRef
|
|
39
|
-
}));
|
|
40
|
+
})));
|
|
40
41
|
if (this.root) {
|
|
41
42
|
this.root.render(component);
|
|
42
43
|
} else {
|