chayns-api 1.0.49 → 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 {
|
|
@@ -292,6 +292,7 @@ let DialogType = exports.DialogType = /*#__PURE__*/function (DialogType) {
|
|
|
292
292
|
DialogType["INPUT"] = "input";
|
|
293
293
|
DialogType["SELECT"] = "select";
|
|
294
294
|
DialogType["TOAST"] = "toast";
|
|
295
|
+
DialogType["SIGNATURE"] = "signature";
|
|
295
296
|
return DialogType;
|
|
296
297
|
}({});
|
|
297
298
|
let MediaType = exports.MediaType = /*#__PURE__*/function (MediaType) {
|
|
@@ -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 {
|
|
@@ -289,6 +289,7 @@ export let DialogType = /*#__PURE__*/function (DialogType) {
|
|
|
289
289
|
DialogType["INPUT"] = "input";
|
|
290
290
|
DialogType["SELECT"] = "select";
|
|
291
291
|
DialogType["TOAST"] = "toast";
|
|
292
|
+
DialogType["SIGNATURE"] = "signature";
|
|
292
293
|
return DialogType;
|
|
293
294
|
}({});
|
|
294
295
|
export let MediaType = /*#__PURE__*/function (MediaType) {
|
|
@@ -61,7 +61,10 @@ export interface BaseDialog {
|
|
|
61
61
|
config?: any;
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
export type Dialog = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule | DialogIFrame | DialogSelect | DialogDate | DialogToast | DialogFileSelect);
|
|
64
|
+
export type Dialog = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule | DialogIFrame | DialogSelect | DialogDate | DialogToast | DialogFileSelect | DialogSignature);
|
|
65
|
+
export interface DialogSignature {
|
|
66
|
+
type: DialogType.SIGNATURE;
|
|
67
|
+
}
|
|
65
68
|
export interface DialogModule {
|
|
66
69
|
type: DialogType.MODULE;
|
|
67
70
|
system: {
|
|
@@ -781,7 +784,8 @@ export declare enum DialogType {
|
|
|
781
784
|
MODULE = "module",
|
|
782
785
|
INPUT = "input",
|
|
783
786
|
SELECT = "select",
|
|
784
|
-
TOAST = "toast"
|
|
787
|
+
TOAST = "toast",
|
|
788
|
+
SIGNATURE = "signature"
|
|
785
789
|
}
|
|
786
790
|
export declare enum MediaType {
|
|
787
791
|
IMAGE = "image",
|