@zzdadelu/schema-builder 1.0.0-alpha.91 → 1.0.0-alpha.93
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 +12 -36
- package/lib/main.js +12 -36
- package/package.json +1 -1
package/es/main.js
CHANGED
|
@@ -55,8 +55,8 @@ var Design = function Design(props, ref) {
|
|
|
55
55
|
};
|
|
56
56
|
var engineOnLoad = /*#__PURE__*/function () {
|
|
57
57
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(event) {
|
|
58
|
-
var _iframe3,
|
|
59
|
-
var iframeWindow,
|
|
58
|
+
var _iframe3, _SimulatorRenderer, _iframeWindow$__FR_EN;
|
|
59
|
+
var iframeWindow, iframeDocument;
|
|
60
60
|
return _regenerator().w(function (_context) {
|
|
61
61
|
while (1) switch (_context.n) {
|
|
62
62
|
case 0:
|
|
@@ -73,39 +73,11 @@ var Design = function Design(props, ref) {
|
|
|
73
73
|
}
|
|
74
74
|
return _context.a(2);
|
|
75
75
|
case 2:
|
|
76
|
+
iframeDocument = iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.document;
|
|
76
77
|
console.log('iframe init engine: start waiting...');
|
|
77
|
-
console.log('iframe init engine: start waiting...',
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
waitForMaterial = function waitForMaterial() {
|
|
81
|
-
return new Promise(function (resolve) {
|
|
82
|
-
var attempts = 0;
|
|
83
|
-
var maxAttempts = 50; // 最长等待 50 * 100ms = 5 秒
|
|
84
|
-
|
|
85
|
-
var timer = setInterval(function () {
|
|
86
|
-
var _iframeWindow$2;
|
|
87
|
-
attempts++;
|
|
88
|
-
var material = (_iframeWindow$2 = iframeWindow[0]) === null || _iframeWindow$2 === void 0 ? void 0 : _iframeWindow$2.AliFormRenderMaterial;
|
|
89
|
-
if (material) {
|
|
90
|
-
console.log('AliFormRenderMaterial is ready:', material);
|
|
91
|
-
clearInterval(timer);
|
|
92
|
-
resolve();
|
|
93
|
-
}
|
|
94
|
-
if (attempts >= maxAttempts) {
|
|
95
|
-
console.warn('AliFormRenderMaterial load timeout');
|
|
96
|
-
clearInterval(timer);
|
|
97
|
-
resolve(); // 即使加载不到,也继续,不然永远挂住
|
|
98
|
-
}
|
|
99
|
-
}, 100); // 每 100ms 检查一次
|
|
100
|
-
});
|
|
101
|
-
}; // 1) 等待 AliFormRenderMaterial
|
|
102
|
-
_context.n = 3;
|
|
103
|
-
return waitForMaterial();
|
|
104
|
-
case 3:
|
|
105
|
-
console.log('iframe init engine: start init');
|
|
106
|
-
console.log('iframe init engine: start init', (_iframeWindow$3 = iframeWindow[0]) === null || _iframeWindow$3 === void 0 ? void 0 : _iframeWindow$3.AliFormRenderMaterial);
|
|
107
|
-
|
|
108
|
-
// 2) 执行初始化
|
|
78
|
+
console.log('iframe init engine: start waiting...', iframeWindow);
|
|
79
|
+
console.log('iframe init engine: start waiting...', (iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.undefined) - SimulatorRenderer);
|
|
80
|
+
console.log('iframe init engine: start waiting...', (iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.undefined) - ((_SimulatorRenderer = SimulatorRenderer) === null || _SimulatorRenderer === void 0 ? void 0 : _SimulatorRenderer.AliFormRenderMaterial));
|
|
109
81
|
iframeWindow === null || iframeWindow === void 0 ? void 0 : (_iframeWindow$__FR_EN = iframeWindow.__FR_ENGINE__) === null || _iframeWindow$__FR_EN === void 0 ? void 0 : _iframeWindow$__FR_EN.init(_objectSpread({
|
|
110
82
|
settings: _objectSpread(_objectSpread({}, defaultSetting), settings),
|
|
111
83
|
widgets: widgets,
|
|
@@ -113,8 +85,12 @@ var Design = function Design(props, ref) {
|
|
|
113
85
|
title: 'XRender'
|
|
114
86
|
}
|
|
115
87
|
}, restProps));
|
|
116
|
-
console.log('iframe init engine: init
|
|
117
|
-
|
|
88
|
+
console.log('iframe init engine: end init');
|
|
89
|
+
console.log('iframe init engine: end waiting...');
|
|
90
|
+
console.log('iframe init engine: end waiting...', iframeWindow);
|
|
91
|
+
console.log('iframe init engine: end waiting...', iframeWindow.undefined - SimulatorRenderer);
|
|
92
|
+
console.log('iframe init engine: end waiting...', iframeWindow.undefined - SimulatorRenderer.AliFormRenderMaterial);
|
|
93
|
+
case 3:
|
|
118
94
|
return _context.a(2);
|
|
119
95
|
}
|
|
120
96
|
}, _callee);
|
package/lib/main.js
CHANGED
|
@@ -63,8 +63,8 @@ var Design = function Design(props, ref) {
|
|
|
63
63
|
};
|
|
64
64
|
var engineOnLoad = /*#__PURE__*/function () {
|
|
65
65
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(event) {
|
|
66
|
-
var _iframe3,
|
|
67
|
-
var iframeWindow,
|
|
66
|
+
var _iframe3, _SimulatorRenderer, _iframeWindow$__FR_EN;
|
|
67
|
+
var iframeWindow, iframeDocument;
|
|
68
68
|
return _regenerator().w(function (_context) {
|
|
69
69
|
while (1) switch (_context.n) {
|
|
70
70
|
case 0:
|
|
@@ -81,39 +81,11 @@ var Design = function Design(props, ref) {
|
|
|
81
81
|
}
|
|
82
82
|
return _context.a(2);
|
|
83
83
|
case 2:
|
|
84
|
+
iframeDocument = iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.document;
|
|
84
85
|
console.log('iframe init engine: start waiting...');
|
|
85
|
-
console.log('iframe init engine: start waiting...',
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
waitForMaterial = function waitForMaterial() {
|
|
89
|
-
return new Promise(function (resolve) {
|
|
90
|
-
var attempts = 0;
|
|
91
|
-
var maxAttempts = 50; // 最长等待 50 * 100ms = 5 秒
|
|
92
|
-
|
|
93
|
-
var timer = setInterval(function () {
|
|
94
|
-
var _iframeWindow$2;
|
|
95
|
-
attempts++;
|
|
96
|
-
var material = (_iframeWindow$2 = iframeWindow[0]) === null || _iframeWindow$2 === void 0 ? void 0 : _iframeWindow$2.AliFormRenderMaterial;
|
|
97
|
-
if (material) {
|
|
98
|
-
console.log('AliFormRenderMaterial is ready:', material);
|
|
99
|
-
clearInterval(timer);
|
|
100
|
-
resolve();
|
|
101
|
-
}
|
|
102
|
-
if (attempts >= maxAttempts) {
|
|
103
|
-
console.warn('AliFormRenderMaterial load timeout');
|
|
104
|
-
clearInterval(timer);
|
|
105
|
-
resolve(); // 即使加载不到,也继续,不然永远挂住
|
|
106
|
-
}
|
|
107
|
-
}, 100); // 每 100ms 检查一次
|
|
108
|
-
});
|
|
109
|
-
}; // 1) 等待 AliFormRenderMaterial
|
|
110
|
-
_context.n = 3;
|
|
111
|
-
return waitForMaterial();
|
|
112
|
-
case 3:
|
|
113
|
-
console.log('iframe init engine: start init');
|
|
114
|
-
console.log('iframe init engine: start init', (_iframeWindow$3 = iframeWindow[0]) === null || _iframeWindow$3 === void 0 ? void 0 : _iframeWindow$3.AliFormRenderMaterial);
|
|
115
|
-
|
|
116
|
-
// 2) 执行初始化
|
|
86
|
+
console.log('iframe init engine: start waiting...', iframeWindow);
|
|
87
|
+
console.log('iframe init engine: start waiting...', (iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.undefined) - SimulatorRenderer);
|
|
88
|
+
console.log('iframe init engine: start waiting...', (iframeWindow === null || iframeWindow === void 0 ? void 0 : iframeWindow.undefined) - ((_SimulatorRenderer = SimulatorRenderer) === null || _SimulatorRenderer === void 0 ? void 0 : _SimulatorRenderer.AliFormRenderMaterial));
|
|
117
89
|
iframeWindow === null || iframeWindow === void 0 ? void 0 : (_iframeWindow$__FR_EN = iframeWindow.__FR_ENGINE__) === null || _iframeWindow$__FR_EN === void 0 ? void 0 : _iframeWindow$__FR_EN.init(_objectSpread({
|
|
118
90
|
settings: _objectSpread(_objectSpread({}, defaultSetting), settings),
|
|
119
91
|
widgets: widgets,
|
|
@@ -121,8 +93,12 @@ var Design = function Design(props, ref) {
|
|
|
121
93
|
title: 'XRender'
|
|
122
94
|
}
|
|
123
95
|
}, restProps));
|
|
124
|
-
console.log('iframe init engine: init
|
|
125
|
-
|
|
96
|
+
console.log('iframe init engine: end init');
|
|
97
|
+
console.log('iframe init engine: end waiting...');
|
|
98
|
+
console.log('iframe init engine: end waiting...', iframeWindow);
|
|
99
|
+
console.log('iframe init engine: end waiting...', iframeWindow.undefined - SimulatorRenderer);
|
|
100
|
+
console.log('iframe init engine: end waiting...', iframeWindow.undefined - SimulatorRenderer.AliFormRenderMaterial);
|
|
101
|
+
case 3:
|
|
126
102
|
return _context.a(2);
|
|
127
103
|
}
|
|
128
104
|
}, _callee);
|