@byteluck-fe/model-driven-core-all 4.38.0-lx0 → 6.1.0-1-beta.2
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/dist/esm/loadRemoteScripts.js +6 -14
- package/dist/esm/registerByteluckControls.js +9 -16
- package/dist/esm/registerCustomControls.js +12 -22
- package/dist/index.umd.js +1 -1
- package/dist/types/registerByteluckControls.d.ts +1 -0
- package/dist/types/registerCustomControls.d.ts +1 -0
- package/package.json +6 -6
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
59
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -208,10 +204,7 @@ export function loadRemoteControl(url, globalModules) {
|
|
|
208
204
|
return loadScriptFromFetch(url, globalModules);
|
|
209
205
|
}
|
|
210
206
|
export function loadRemoteControls(urls, globalModules) {
|
|
211
|
-
return
|
|
212
|
-
}
|
|
213
|
-
function _loadRemoteControls() {
|
|
214
|
-
_loadRemoteControls = _async_to_generator(function(urls, globalModules) {
|
|
207
|
+
return _async_to_generator(function() {
|
|
215
208
|
return _ts_generator(this, function(_state) {
|
|
216
209
|
switch(_state.label){
|
|
217
210
|
case 0:
|
|
@@ -228,6 +221,5 @@ function _loadRemoteControls() {
|
|
|
228
221
|
];
|
|
229
222
|
}
|
|
230
223
|
});
|
|
231
|
-
});
|
|
232
|
-
return _loadRemoteControls.apply(this, arguments);
|
|
224
|
+
})();
|
|
233
225
|
}
|
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
59
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -124,11 +120,9 @@ function _ts_generator(thisArg, body) {
|
|
|
124
120
|
}
|
|
125
121
|
import { getHackerControl } from './getHackerControl';
|
|
126
122
|
import { nativeFetch, loadRemoteControl } from './loadRemoteScripts';
|
|
123
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
127
124
|
export function registerByteluckControls(url, payload) {
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
function _registerByteluckControls() {
|
|
131
|
-
_registerByteluckControls = _async_to_generator(function(url, payload) {
|
|
125
|
+
return _async_to_generator(function() {
|
|
132
126
|
var version, byteluckControls, componentsStr, components, controls;
|
|
133
127
|
return _ts_generator(this, function(_state) {
|
|
134
128
|
switch(_state.label){
|
|
@@ -152,7 +146,7 @@ function _registerByteluckControls() {
|
|
|
152
146
|
components = JSON.parse(componentsStr);
|
|
153
147
|
return [
|
|
154
148
|
4,
|
|
155
|
-
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version), payload.globalModules)
|
|
149
|
+
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version, "&").concat(payload.isPc === false ? 'mobile' : 'desktop'), payload.globalModules)
|
|
156
150
|
];
|
|
157
151
|
case 2:
|
|
158
152
|
controls = _state.sent();
|
|
@@ -165,7 +159,7 @@ function _registerByteluckControls() {
|
|
|
165
159
|
}
|
|
166
160
|
});
|
|
167
161
|
if (control === undefined) {
|
|
168
|
-
control = getHackerControl(item.id, payload.type, '内置组件加载错误');
|
|
162
|
+
control = getHackerControl(item.id, payload.type, getLocaleText('CMD.loadCtrlError', null, '内置组件加载错误'));
|
|
169
163
|
}
|
|
170
164
|
byteluckControls.set(item.id, {
|
|
171
165
|
props: item,
|
|
@@ -182,6 +176,5 @@ function _registerByteluckControls() {
|
|
|
182
176
|
];
|
|
183
177
|
}
|
|
184
178
|
});
|
|
185
|
-
});
|
|
186
|
-
return _registerByteluckControls.apply(this, arguments);
|
|
179
|
+
})();
|
|
187
180
|
}
|
|
@@ -74,7 +74,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
74
74
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
75
75
|
}
|
|
76
76
|
function _ts_generator(thisArg, body) {
|
|
77
|
-
var f, y, t,
|
|
77
|
+
var f, y, t, _ = {
|
|
78
78
|
label: 0,
|
|
79
79
|
sent: function() {
|
|
80
80
|
if (t[0] & 1) throw t[1];
|
|
@@ -82,12 +82,8 @@ function _ts_generator(thisArg, body) {
|
|
|
82
82
|
},
|
|
83
83
|
trys: [],
|
|
84
84
|
ops: []
|
|
85
|
-
};
|
|
86
|
-
return g = {
|
|
87
|
-
next: verb(0),
|
|
88
|
-
"throw": verb(1),
|
|
89
|
-
"return": verb(2)
|
|
90
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
85
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
86
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
91
87
|
return this;
|
|
92
88
|
}), g;
|
|
93
89
|
function verb(n) {
|
|
@@ -100,7 +96,7 @@ function _ts_generator(thisArg, body) {
|
|
|
100
96
|
}
|
|
101
97
|
function step(op) {
|
|
102
98
|
if (f) throw new TypeError("Generator is already executing.");
|
|
103
|
-
while(_)try {
|
|
99
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
104
100
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
105
101
|
if (y = 0, t) op = [
|
|
106
102
|
op[0] & 2,
|
|
@@ -172,10 +168,7 @@ import { loadRemoteControl } from './loadRemoteScripts';
|
|
|
172
168
|
import { warn } from '@byteluck-fe/model-driven-shared';
|
|
173
169
|
import { getHackerControl } from './getHackerControl';
|
|
174
170
|
export function registerCustomControls(componentList, components, refLibs, payload) {
|
|
175
|
-
return
|
|
176
|
-
}
|
|
177
|
-
function _registerCustomControls() {
|
|
178
|
-
_registerCustomControls = _async_to_generator(function(componentList, components, refLibs, payload) {
|
|
171
|
+
return _async_to_generator(function() {
|
|
179
172
|
var registered;
|
|
180
173
|
return _ts_generator(this, function(_state) {
|
|
181
174
|
switch(_state.label){
|
|
@@ -190,8 +183,8 @@ function _registerCustomControls() {
|
|
|
190
183
|
//qiyu 2022-4-18 逐个加载自定义组件,只有异常的组件加载为hackerControl
|
|
191
184
|
return [
|
|
192
185
|
4,
|
|
193
|
-
Promise.all(components.map(
|
|
194
|
-
|
|
186
|
+
Promise.all(components.map(function(item) {
|
|
187
|
+
return _async_to_generator(function() {
|
|
195
188
|
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
196
189
|
return _ts_generator(this, function(_state) {
|
|
197
190
|
switch(_state.label){
|
|
@@ -212,7 +205,7 @@ function _registerCustomControls() {
|
|
|
212
205
|
} else {
|
|
213
206
|
url = item.designer;
|
|
214
207
|
}
|
|
215
|
-
url += '?v=' + item.version;
|
|
208
|
+
url += '?v=' + item.version + '&' + (payload.isPc === false ? 'mobile' : 'desktop');
|
|
216
209
|
return [
|
|
217
210
|
4,
|
|
218
211
|
loadRemoteControl(url, refLibs)
|
|
@@ -232,6 +225,7 @@ function _registerCustomControls() {
|
|
|
232
225
|
case 3:
|
|
233
226
|
e = _state.sent();
|
|
234
227
|
isLoaded = false;
|
|
228
|
+
// @i18n-translate-ignore
|
|
235
229
|
warn('加载自定义控件异常,会影响到的控件:' + item.id, e);
|
|
236
230
|
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
237
231
|
return [
|
|
@@ -261,11 +255,8 @@ function _registerCustomControls() {
|
|
|
261
255
|
];
|
|
262
256
|
}
|
|
263
257
|
});
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
return _ref.apply(this, arguments);
|
|
267
|
-
};
|
|
268
|
-
}()))
|
|
258
|
+
})();
|
|
259
|
+
}))
|
|
269
260
|
];
|
|
270
261
|
case 1:
|
|
271
262
|
_state.sent();
|
|
@@ -291,8 +282,7 @@ function _registerCustomControls() {
|
|
|
291
282
|
];
|
|
292
283
|
}
|
|
293
284
|
});
|
|
294
|
-
});
|
|
295
|
-
return _registerCustomControls.apply(this, arguments);
|
|
285
|
+
})();
|
|
296
286
|
}
|
|
297
287
|
function pushControl(type, control, registered, isLoaded, props) {
|
|
298
288
|
if (type === 'runtime') {
|