@byteluck-fe/model-driven-core-all 4.54.0-lx2 → 4.69.0-lx0
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/README.md +11 -11
- package/dist/esm/getHackerControl.js +1 -1
- package/dist/esm/loadRemoteScripts.js +16 -16
- package/dist/esm/registerByteluckControls.js +18 -17
- package/dist/esm/registerCustomControls.js +24 -20
- package/dist/index.umd.js +1 -1
- package/dist/types/getHackerControl.d.ts +23 -23
- package/dist/types/index.d.ts +9 -9
- package/dist/types/loadRemoteScripts.d.ts +7 -7
- package/dist/types/registerByteluckControls.d.ts +7 -6
- package/dist/types/registerCustomControls.d.ts +23 -22
- package/dist/types/upgradeCustomControlSchema.d.ts +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# `runtime-all`
|
|
2
|
-
|
|
3
|
-
> TODO: description
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
const runtimeAll = require('runtime-all');
|
|
9
|
-
|
|
10
|
-
// TODO: DEMONSTRATE API
|
|
11
|
-
```
|
|
1
|
+
# `runtime-all`
|
|
2
|
+
|
|
3
|
+
> TODO: description
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
const runtimeAll = require('runtime-all');
|
|
9
|
+
|
|
10
|
+
// TODO: DEMONSTRATE API
|
|
11
|
+
```
|
|
@@ -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, g, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,17 +36,13 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
}
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
47
|
-
value: function() {
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
39
|
+
};
|
|
40
|
+
return g = {
|
|
41
|
+
next: verb(0),
|
|
42
|
+
"throw": verb(1),
|
|
43
|
+
"return": verb(2)
|
|
44
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
|
+
return this;
|
|
50
46
|
}), g;
|
|
51
47
|
function verb(n) {
|
|
52
48
|
return function(v) {
|
|
@@ -58,7 +54,7 @@ function _ts_generator(thisArg, body) {
|
|
|
58
54
|
}
|
|
59
55
|
function step(op) {
|
|
60
56
|
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
-
while(
|
|
57
|
+
while(_)try {
|
|
62
58
|
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;
|
|
63
59
|
if (y = 0, t) op = [
|
|
64
60
|
op[0] & 2,
|
|
@@ -154,7 +150,7 @@ export function loadScriptFromTag(url, globalModules) {
|
|
|
154
150
|
var resetHackWindow = hackWindow(globalModules);
|
|
155
151
|
script.src = url;
|
|
156
152
|
script.type = 'text/javascript';
|
|
157
|
-
var loadEnd = function
|
|
153
|
+
var loadEnd = function() {
|
|
158
154
|
document.head.removeChild(script);
|
|
159
155
|
var index = jobs.findIndex(function(j) {
|
|
160
156
|
return j === p;
|
|
@@ -212,7 +208,10 @@ export function loadRemoteControl(url, globalModules) {
|
|
|
212
208
|
return loadScriptFromFetch(url, globalModules);
|
|
213
209
|
}
|
|
214
210
|
export function loadRemoteControls(urls, globalModules) {
|
|
215
|
-
return
|
|
211
|
+
return _loadRemoteControls.apply(this, arguments);
|
|
212
|
+
}
|
|
213
|
+
function _loadRemoteControls() {
|
|
214
|
+
_loadRemoteControls = _async_to_generator(function(urls, globalModules) {
|
|
216
215
|
return _ts_generator(this, function(_state) {
|
|
217
216
|
switch(_state.label){
|
|
218
217
|
case 0:
|
|
@@ -229,5 +228,6 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
229
228
|
];
|
|
230
229
|
}
|
|
231
230
|
});
|
|
232
|
-
})
|
|
231
|
+
});
|
|
232
|
+
return _loadRemoteControls.apply(this, arguments);
|
|
233
233
|
}
|
|
@@ -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, g, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,17 +36,13 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
|
-
}
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
47
|
-
value: function() {
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
39
|
+
};
|
|
40
|
+
return g = {
|
|
41
|
+
next: verb(0),
|
|
42
|
+
"throw": verb(1),
|
|
43
|
+
"return": verb(2)
|
|
44
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
|
+
return this;
|
|
50
46
|
}), g;
|
|
51
47
|
function verb(n) {
|
|
52
48
|
return function(v) {
|
|
@@ -58,7 +54,7 @@ function _ts_generator(thisArg, body) {
|
|
|
58
54
|
}
|
|
59
55
|
function step(op) {
|
|
60
56
|
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
-
while(
|
|
57
|
+
while(_)try {
|
|
62
58
|
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;
|
|
63
59
|
if (y = 0, t) op = [
|
|
64
60
|
op[0] & 2,
|
|
@@ -128,8 +124,12 @@ function _ts_generator(thisArg, body) {
|
|
|
128
124
|
}
|
|
129
125
|
import { getHackerControl } from './getHackerControl';
|
|
130
126
|
import { nativeFetch, loadRemoteControl } from './loadRemoteScripts';
|
|
127
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
131
128
|
export function registerByteluckControls(url, payload) {
|
|
132
|
-
return
|
|
129
|
+
return _registerByteluckControls.apply(this, arguments);
|
|
130
|
+
}
|
|
131
|
+
function _registerByteluckControls() {
|
|
132
|
+
_registerByteluckControls = _async_to_generator(function(url, payload) {
|
|
133
133
|
var version, byteluckControls, componentsStr, components, controls;
|
|
134
134
|
return _ts_generator(this, function(_state) {
|
|
135
135
|
switch(_state.label){
|
|
@@ -153,7 +153,7 @@ export function registerByteluckControls(url, payload) {
|
|
|
153
153
|
components = JSON.parse(componentsStr);
|
|
154
154
|
return [
|
|
155
155
|
4,
|
|
156
|
-
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version), payload.globalModules)
|
|
156
|
+
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version, "&").concat(payload.isPc === false ? 'mobile' : 'desktop'), payload.globalModules)
|
|
157
157
|
];
|
|
158
158
|
case 2:
|
|
159
159
|
controls = _state.sent();
|
|
@@ -166,7 +166,7 @@ export function registerByteluckControls(url, payload) {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
if (control === undefined) {
|
|
169
|
-
control = getHackerControl(item.id, payload.type, '内置组件加载错误');
|
|
169
|
+
control = getHackerControl(item.id, payload.type, getLocaleText('CMD.loadCtrlError', null, '内置组件加载错误'));
|
|
170
170
|
}
|
|
171
171
|
byteluckControls.set(item.id, {
|
|
172
172
|
props: item,
|
|
@@ -183,5 +183,6 @@ export function registerByteluckControls(url, payload) {
|
|
|
183
183
|
];
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
})
|
|
186
|
+
});
|
|
187
|
+
return _registerByteluckControls.apply(this, arguments);
|
|
187
188
|
}
|
|
@@ -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, g, _ = {
|
|
78
78
|
label: 0,
|
|
79
79
|
sent: function() {
|
|
80
80
|
if (t[0] & 1) throw t[1];
|
|
@@ -82,17 +82,13 @@ function _ts_generator(thisArg, body) {
|
|
|
82
82
|
},
|
|
83
83
|
trys: [],
|
|
84
84
|
ops: []
|
|
85
|
-
}
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
93
|
-
value: function() {
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
85
|
+
};
|
|
86
|
+
return g = {
|
|
87
|
+
next: verb(0),
|
|
88
|
+
"throw": verb(1),
|
|
89
|
+
"return": verb(2)
|
|
90
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
91
|
+
return this;
|
|
96
92
|
}), g;
|
|
97
93
|
function verb(n) {
|
|
98
94
|
return function(v) {
|
|
@@ -104,7 +100,7 @@ function _ts_generator(thisArg, body) {
|
|
|
104
100
|
}
|
|
105
101
|
function step(op) {
|
|
106
102
|
if (f) throw new TypeError("Generator is already executing.");
|
|
107
|
-
while(
|
|
103
|
+
while(_)try {
|
|
108
104
|
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;
|
|
109
105
|
if (y = 0, t) op = [
|
|
110
106
|
op[0] & 2,
|
|
@@ -176,7 +172,10 @@ import { loadRemoteControl } from './loadRemoteScripts';
|
|
|
176
172
|
import { warn } from '@byteluck-fe/model-driven-shared';
|
|
177
173
|
import { getHackerControl } from './getHackerControl';
|
|
178
174
|
export function registerCustomControls(componentList, components, refLibs, payload) {
|
|
179
|
-
return
|
|
175
|
+
return _registerCustomControls.apply(this, arguments);
|
|
176
|
+
}
|
|
177
|
+
function _registerCustomControls() {
|
|
178
|
+
_registerCustomControls = _async_to_generator(function(componentList, components, refLibs, payload) {
|
|
180
179
|
var registered;
|
|
181
180
|
return _ts_generator(this, function(_state) {
|
|
182
181
|
switch(_state.label){
|
|
@@ -191,8 +190,8 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
191
190
|
//qiyu 2022-4-18 逐个加载自定义组件,只有异常的组件加载为hackerControl
|
|
192
191
|
return [
|
|
193
192
|
4,
|
|
194
|
-
Promise.all(components.map(function(
|
|
195
|
-
|
|
193
|
+
Promise.all(components.map(/*#__PURE__*/ function() {
|
|
194
|
+
var _ref = _async_to_generator(function(item) {
|
|
196
195
|
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
197
196
|
return _ts_generator(this, function(_state) {
|
|
198
197
|
switch(_state.label){
|
|
@@ -213,7 +212,7 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
213
212
|
} else {
|
|
214
213
|
url = item.designer;
|
|
215
214
|
}
|
|
216
|
-
url += '?v=' + item.version;
|
|
215
|
+
url += '?v=' + item.version + '&' + (payload.isPc === false ? 'mobile' : 'desktop');
|
|
217
216
|
return [
|
|
218
217
|
4,
|
|
219
218
|
loadRemoteControl(url, refLibs)
|
|
@@ -233,6 +232,7 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
233
232
|
case 3:
|
|
234
233
|
e = _state.sent();
|
|
235
234
|
isLoaded = false;
|
|
235
|
+
// @i18n-translate-ignore
|
|
236
236
|
warn('加载自定义控件异常,会影响到的控件:' + item.id, e);
|
|
237
237
|
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
238
238
|
return [
|
|
@@ -262,8 +262,11 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
262
262
|
];
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
|
-
})
|
|
266
|
-
|
|
265
|
+
});
|
|
266
|
+
return function(item) {
|
|
267
|
+
return _ref.apply(this, arguments);
|
|
268
|
+
};
|
|
269
|
+
}()))
|
|
267
270
|
];
|
|
268
271
|
case 1:
|
|
269
272
|
_state.sent();
|
|
@@ -289,7 +292,8 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
289
292
|
];
|
|
290
293
|
}
|
|
291
294
|
});
|
|
292
|
-
})
|
|
295
|
+
});
|
|
296
|
+
return _registerCustomControls.apply(this, arguments);
|
|
293
297
|
}
|
|
294
298
|
function pushControl(type, control, registered, isLoaded, props) {
|
|
295
299
|
if (type === 'runtime') {
|