@zzdadelu/schema-builder 1.0.0-alpha.55 → 1.0.0-alpha.56
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/es/main.js +110 -26
- package/lib/main.js +109 -25
- package/package.json +1 -1
package/es/main.js
CHANGED
|
@@ -5,60 +5,144 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
14
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
15
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
16
|
+
import React, { useEffect, useRef, useImperativeHandle, forwardRef, useState } from 'react';
|
|
11
17
|
import createIframe from './createIframe';
|
|
12
18
|
import * as defaultSetting from './settings';
|
|
13
|
-
var iframe;
|
|
14
19
|
var Design = function Design(props, ref) {
|
|
15
20
|
var widgets = props.widgets,
|
|
16
21
|
settings = props.settings,
|
|
17
22
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
18
|
-
var containerRef = useRef();
|
|
23
|
+
var containerRef = useRef(null);
|
|
24
|
+
var iframeRef = useRef(null);
|
|
25
|
+
var _useState = useState(true),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
loading = _useState2[0],
|
|
28
|
+
setLoading = _useState2[1];
|
|
29
|
+
var retryCountRef = useRef(0);
|
|
30
|
+
var MAX_RETRIES = 3;
|
|
19
31
|
useImperativeHandle(ref, function () {
|
|
20
32
|
return {
|
|
21
33
|
getValue: function getValue() {
|
|
22
|
-
var
|
|
23
|
-
return (
|
|
34
|
+
var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current$co3;
|
|
35
|
+
return (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentWindow) === null || _iframeRef$current$co === void 0 ? void 0 : (_iframeRef$current$co2 = _iframeRef$current$co.__FR_ENGINE__) === null || _iframeRef$current$co2 === void 0 ? void 0 : (_iframeRef$current$co3 = _iframeRef$current$co2.exportSchema) === null || _iframeRef$current$co3 === void 0 ? void 0 : _iframeRef$current$co3.call(_iframeRef$current$co2);
|
|
24
36
|
},
|
|
25
37
|
setValue: function setValue(schema) {
|
|
26
|
-
var
|
|
27
|
-
return (
|
|
38
|
+
var _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2, _iframeRef$current2$c3;
|
|
39
|
+
return (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentWindow) === null || _iframeRef$current2$c === void 0 ? void 0 : (_iframeRef$current2$c2 = _iframeRef$current2$c.__FR_ENGINE__) === null || _iframeRef$current2$c2 === void 0 ? void 0 : (_iframeRef$current2$c3 = _iframeRef$current2$c2.importSchema) === null || _iframeRef$current2$c3 === void 0 ? void 0 : _iframeRef$current2$c3.call(_iframeRef$current2$c2, schema);
|
|
28
40
|
}
|
|
29
41
|
};
|
|
30
42
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
var _initIframe = function initIframe() {
|
|
44
|
+
console.log('[SchemaBuilder] Initializing iframe');
|
|
45
|
+
|
|
46
|
+
// 确保容器存在
|
|
47
|
+
if (!containerRef.current) {
|
|
48
|
+
console.error('[SchemaBuilder] Container not ready');
|
|
49
|
+
setTimeout(_initIframe, 100);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 清理旧的 iframe
|
|
54
|
+
if (iframeRef.current && containerRef.current.contains(iframeRef.current)) {
|
|
55
|
+
containerRef.current.removeChild(iframeRef.current);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 创建新的 iframe
|
|
59
|
+
var iframe = createIframe();
|
|
60
|
+
iframeRef.current = iframe;
|
|
61
|
+
iframe.onload = function () {
|
|
62
|
+
console.log('[SchemaBuilder] Iframe loaded');
|
|
63
|
+
setLoading(false);
|
|
36
64
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
65
|
+
iframe.onerror = function () {
|
|
66
|
+
console.error('[SchemaBuilder] Iframe load error');
|
|
67
|
+
retryIframe();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 添加到 DOM
|
|
40
71
|
containerRef.current.appendChild(iframe);
|
|
41
72
|
};
|
|
73
|
+
var retryIframe = function retryIframe() {
|
|
74
|
+
if (retryCountRef.current < MAX_RETRIES) {
|
|
75
|
+
retryCountRef.current++;
|
|
76
|
+
console.log("[SchemaBuilder] Retrying iframe (".concat(retryCountRef.current, "/").concat(MAX_RETRIES, ")"));
|
|
77
|
+
setTimeout(_initIframe, 1000);
|
|
78
|
+
} else {
|
|
79
|
+
console.error('[SchemaBuilder] Max retries reached');
|
|
80
|
+
setLoading(false);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
42
83
|
var engineOnLoad = function engineOnLoad(event) {
|
|
43
|
-
var _iframe3, _iframe3$contentWindo, _iframe3$contentWindo2;
|
|
44
84
|
if (event.data.type !== 'engine-load') {
|
|
45
85
|
return;
|
|
46
86
|
}
|
|
47
|
-
(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
87
|
+
console.log('[SchemaBuilder] Engine load event received');
|
|
88
|
+
|
|
89
|
+
// 延迟执行以确保 iframe 完全加载
|
|
90
|
+
setTimeout(function () {
|
|
91
|
+
var _iframeRef$current3, _iframeRef$current3$c;
|
|
92
|
+
if ((_iframeRef$current3 = iframeRef.current) === null || _iframeRef$current3 === void 0 ? void 0 : (_iframeRef$current3$c = _iframeRef$current3.contentWindow) === null || _iframeRef$current3$c === void 0 ? void 0 : _iframeRef$current3$c.__FR_ENGINE__) {
|
|
93
|
+
iframeRef.current.contentWindow.__FR_ENGINE__.init(_objectSpread({
|
|
94
|
+
settings: _objectSpread(_objectSpread({}, defaultSetting), settings),
|
|
95
|
+
widgets: widgets,
|
|
96
|
+
logo: {
|
|
97
|
+
title: 'XRender'
|
|
98
|
+
}
|
|
99
|
+
}, restProps));
|
|
100
|
+
console.log('[SchemaBuilder] Engine initialized');
|
|
101
|
+
} else {
|
|
102
|
+
console.error('[SchemaBuilder] Engine not found in iframe');
|
|
103
|
+
retryIframe();
|
|
53
104
|
}
|
|
54
|
-
},
|
|
105
|
+
}, 300);
|
|
55
106
|
};
|
|
56
|
-
|
|
107
|
+
useEffect(function () {
|
|
108
|
+
// 等待容器渲染完成
|
|
109
|
+
var timer = setTimeout(function () {
|
|
110
|
+
_initIframe();
|
|
111
|
+
}, 100);
|
|
112
|
+
window.addEventListener('message', engineOnLoad);
|
|
113
|
+
return function () {
|
|
114
|
+
clearTimeout(timer);
|
|
115
|
+
window.removeEventListener('message', engineOnLoad);
|
|
116
|
+
|
|
117
|
+
// 清理 iframe
|
|
118
|
+
if (iframeRef.current && containerRef.current) {
|
|
119
|
+
try {
|
|
120
|
+
containerRef.current.removeChild(iframeRef.current);
|
|
121
|
+
} catch (e) {
|
|
122
|
+
// 忽略错误
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}, []);
|
|
127
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
style: {
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
top: '50%',
|
|
131
|
+
left: '50%',
|
|
132
|
+
transform: 'translate(-50%, -50%)',
|
|
133
|
+
padding: '20px',
|
|
134
|
+
backgroundColor: 'rgba(255, 255, 255, 0.9)',
|
|
135
|
+
borderRadius: '4px',
|
|
136
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
137
|
+
zIndex: 10
|
|
138
|
+
}
|
|
139
|
+
}, "\u6B63\u5728\u52A0\u8F7D\u8868\u5355\u8BBE\u8BA1\u5668..."), /*#__PURE__*/React.createElement("div", {
|
|
57
140
|
ref: containerRef,
|
|
58
141
|
style: {
|
|
59
142
|
width: '100%',
|
|
60
|
-
height: '100%'
|
|
143
|
+
height: '100%',
|
|
144
|
+
minHeight: '500px'
|
|
61
145
|
}
|
|
62
|
-
});
|
|
146
|
+
}));
|
|
63
147
|
};
|
|
64
148
|
export default /*#__PURE__*/forwardRef(Design);
|
package/lib/main.js
CHANGED
|
@@ -16,57 +16,141 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
18
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
25
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
20
26
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
|
-
var iframe;
|
|
22
27
|
var Design = function Design(props, ref) {
|
|
23
28
|
var widgets = props.widgets,
|
|
24
29
|
settings = props.settings,
|
|
25
30
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
-
var containerRef = (0, _react.useRef)();
|
|
31
|
+
var containerRef = (0, _react.useRef)(null);
|
|
32
|
+
var iframeRef = (0, _react.useRef)(null);
|
|
33
|
+
var _useState = (0, _react.useState)(true),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
loading = _useState2[0],
|
|
36
|
+
setLoading = _useState2[1];
|
|
37
|
+
var retryCountRef = (0, _react.useRef)(0);
|
|
38
|
+
var MAX_RETRIES = 3;
|
|
27
39
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
28
40
|
return {
|
|
29
41
|
getValue: function getValue() {
|
|
30
|
-
var
|
|
31
|
-
return (
|
|
42
|
+
var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current$co3;
|
|
43
|
+
return (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentWindow) === null || _iframeRef$current$co === void 0 ? void 0 : (_iframeRef$current$co2 = _iframeRef$current$co.__FR_ENGINE__) === null || _iframeRef$current$co2 === void 0 ? void 0 : (_iframeRef$current$co3 = _iframeRef$current$co2.exportSchema) === null || _iframeRef$current$co3 === void 0 ? void 0 : _iframeRef$current$co3.call(_iframeRef$current$co2);
|
|
32
44
|
},
|
|
33
45
|
setValue: function setValue(schema) {
|
|
34
|
-
var
|
|
35
|
-
return (
|
|
46
|
+
var _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2, _iframeRef$current2$c3;
|
|
47
|
+
return (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentWindow) === null || _iframeRef$current2$c === void 0 ? void 0 : (_iframeRef$current2$c2 = _iframeRef$current2$c.__FR_ENGINE__) === null || _iframeRef$current2$c2 === void 0 ? void 0 : (_iframeRef$current2$c3 = _iframeRef$current2$c2.importSchema) === null || _iframeRef$current2$c3 === void 0 ? void 0 : _iframeRef$current2$c3.call(_iframeRef$current2$c2, schema);
|
|
36
48
|
}
|
|
37
49
|
};
|
|
38
50
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
var _initIframe = function initIframe() {
|
|
52
|
+
console.log('[SchemaBuilder] Initializing iframe');
|
|
53
|
+
|
|
54
|
+
// 确保容器存在
|
|
55
|
+
if (!containerRef.current) {
|
|
56
|
+
console.error('[SchemaBuilder] Container not ready');
|
|
57
|
+
setTimeout(_initIframe, 100);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 清理旧的 iframe
|
|
62
|
+
if (iframeRef.current && containerRef.current.contains(iframeRef.current)) {
|
|
63
|
+
containerRef.current.removeChild(iframeRef.current);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 创建新的 iframe
|
|
67
|
+
var iframe = (0, _createIframe.default)();
|
|
68
|
+
iframeRef.current = iframe;
|
|
69
|
+
iframe.onload = function () {
|
|
70
|
+
console.log('[SchemaBuilder] Iframe loaded');
|
|
71
|
+
setLoading(false);
|
|
44
72
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
iframe.onerror = function () {
|
|
74
|
+
console.error('[SchemaBuilder] Iframe load error');
|
|
75
|
+
retryIframe();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// 添加到 DOM
|
|
48
79
|
containerRef.current.appendChild(iframe);
|
|
49
80
|
};
|
|
81
|
+
var retryIframe = function retryIframe() {
|
|
82
|
+
if (retryCountRef.current < MAX_RETRIES) {
|
|
83
|
+
retryCountRef.current++;
|
|
84
|
+
console.log("[SchemaBuilder] Retrying iframe (".concat(retryCountRef.current, "/").concat(MAX_RETRIES, ")"));
|
|
85
|
+
setTimeout(_initIframe, 1000);
|
|
86
|
+
} else {
|
|
87
|
+
console.error('[SchemaBuilder] Max retries reached');
|
|
88
|
+
setLoading(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
50
91
|
var engineOnLoad = function engineOnLoad(event) {
|
|
51
|
-
var _iframe3, _iframe3$contentWindo, _iframe3$contentWindo2;
|
|
52
92
|
if (event.data.type !== 'engine-load') {
|
|
53
93
|
return;
|
|
54
94
|
}
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
95
|
+
console.log('[SchemaBuilder] Engine load event received');
|
|
96
|
+
|
|
97
|
+
// 延迟执行以确保 iframe 完全加载
|
|
98
|
+
setTimeout(function () {
|
|
99
|
+
var _iframeRef$current3, _iframeRef$current3$c;
|
|
100
|
+
if ((_iframeRef$current3 = iframeRef.current) === null || _iframeRef$current3 === void 0 ? void 0 : (_iframeRef$current3$c = _iframeRef$current3.contentWindow) === null || _iframeRef$current3$c === void 0 ? void 0 : _iframeRef$current3$c.__FR_ENGINE__) {
|
|
101
|
+
iframeRef.current.contentWindow.__FR_ENGINE__.init(_objectSpread({
|
|
102
|
+
settings: _objectSpread(_objectSpread({}, defaultSetting), settings),
|
|
103
|
+
widgets: widgets,
|
|
104
|
+
logo: {
|
|
105
|
+
title: 'XRender'
|
|
106
|
+
}
|
|
107
|
+
}, restProps));
|
|
108
|
+
console.log('[SchemaBuilder] Engine initialized');
|
|
109
|
+
} else {
|
|
110
|
+
console.error('[SchemaBuilder] Engine not found in iframe');
|
|
111
|
+
retryIframe();
|
|
61
112
|
}
|
|
62
|
-
},
|
|
113
|
+
}, 300);
|
|
63
114
|
};
|
|
64
|
-
|
|
115
|
+
(0, _react.useEffect)(function () {
|
|
116
|
+
// 等待容器渲染完成
|
|
117
|
+
var timer = setTimeout(function () {
|
|
118
|
+
_initIframe();
|
|
119
|
+
}, 100);
|
|
120
|
+
window.addEventListener('message', engineOnLoad);
|
|
121
|
+
return function () {
|
|
122
|
+
clearTimeout(timer);
|
|
123
|
+
window.removeEventListener('message', engineOnLoad);
|
|
124
|
+
|
|
125
|
+
// 清理 iframe
|
|
126
|
+
if (iframeRef.current && containerRef.current) {
|
|
127
|
+
try {
|
|
128
|
+
containerRef.current.removeChild(iframeRef.current);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
// 忽略错误
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
style: {
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
top: '50%',
|
|
139
|
+
left: '50%',
|
|
140
|
+
transform: 'translate(-50%, -50%)',
|
|
141
|
+
padding: '20px',
|
|
142
|
+
backgroundColor: 'rgba(255, 255, 255, 0.9)',
|
|
143
|
+
borderRadius: '4px',
|
|
144
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
145
|
+
zIndex: 10
|
|
146
|
+
}
|
|
147
|
+
}, "\u6B63\u5728\u52A0\u8F7D\u8868\u5355\u8BBE\u8BA1\u5668..."), /*#__PURE__*/_react.default.createElement("div", {
|
|
65
148
|
ref: containerRef,
|
|
66
149
|
style: {
|
|
67
150
|
width: '100%',
|
|
68
|
-
height: '100%'
|
|
151
|
+
height: '100%',
|
|
152
|
+
minHeight: '500px'
|
|
69
153
|
}
|
|
70
|
-
});
|
|
154
|
+
}));
|
|
71
155
|
};
|
|
72
156
|
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(Design);
|