@byteluck-fe/model-driven-core-all 2.22.2-beta.8 → 2.22.3-beta.11
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 +16 -29
- package/dist/esm/loadRemoteScripts.js +6 -14
- package/dist/esm/registerByteluckControls.js +9 -17
- package/dist/esm/registerCustomControls.js +12 -22
- package/dist/index.umd.js +1 -45
- 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 +6 -6
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
|
+
```
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -73,28 +77,12 @@ function _type_of(obj) {
|
|
|
73
77
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
74
78
|
}
|
|
75
79
|
function _is_native_reflect_construct() {
|
|
76
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
77
|
-
if (Reflect.construct.sham) return false;
|
|
78
|
-
if (typeof Proxy === "function") return true;
|
|
79
80
|
try {
|
|
80
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function _create_super(Derived) {
|
|
87
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
88
|
-
return function _createSuperInternal() {
|
|
89
|
-
var Super = _get_prototype_of(Derived), result;
|
|
90
|
-
if (hasNativeReflectConstruct) {
|
|
91
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
92
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
93
|
-
} else {
|
|
94
|
-
result = Super.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
return _possible_constructor_return(this, result);
|
|
97
|
-
};
|
|
81
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
+
} catch (_) {}
|
|
83
|
+
return (_is_native_reflect_construct = function() {
|
|
84
|
+
return !!result;
|
|
85
|
+
})();
|
|
98
86
|
}
|
|
99
87
|
import { RuntimeControl } from '@byteluck-fe/model-driven-core';
|
|
100
88
|
import { DesignerControl } from '@byteluck-fe/model-driven-core';
|
|
@@ -106,12 +94,12 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
106
94
|
HackerControlClass = /*#__PURE__*/ function(RuntimeControl) {
|
|
107
95
|
"use strict";
|
|
108
96
|
_inherits(HackerControl, RuntimeControl);
|
|
109
|
-
var _super = _create_super(HackerControl);
|
|
110
97
|
function HackerControl(props) {
|
|
111
98
|
_class_call_check(this, HackerControl);
|
|
112
99
|
var _this;
|
|
113
|
-
_this =
|
|
114
|
-
|
|
100
|
+
_this = _call_super(this, HackerControl, [
|
|
101
|
+
props
|
|
102
|
+
]), _define_property(_this, "props", {});
|
|
115
103
|
return _this;
|
|
116
104
|
}
|
|
117
105
|
_create_class(HackerControl, null, [
|
|
@@ -128,12 +116,12 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
128
116
|
HackerControlClass = /*#__PURE__*/ function(DesignerControl) {
|
|
129
117
|
"use strict";
|
|
130
118
|
_inherits(HackerControl, DesignerControl);
|
|
131
|
-
var _super = _create_super(HackerControl);
|
|
132
119
|
function HackerControl(props) {
|
|
133
120
|
_class_call_check(this, HackerControl);
|
|
134
121
|
var _this;
|
|
135
|
-
_this =
|
|
136
|
-
|
|
122
|
+
_this = _call_super(this, HackerControl, [
|
|
123
|
+
props
|
|
124
|
+
]), _define_property(_this, "props", {});
|
|
137
125
|
return _this;
|
|
138
126
|
}
|
|
139
127
|
_create_class(HackerControl, null, [
|
|
@@ -150,10 +138,9 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
150
138
|
var HackerPropertyClass = /*#__PURE__*/ function(Property) {
|
|
151
139
|
"use strict";
|
|
152
140
|
_inherits(HackerPropertyClass, Property);
|
|
153
|
-
var _super = _create_super(HackerPropertyClass);
|
|
154
141
|
function HackerPropertyClass() {
|
|
155
142
|
_class_call_check(this, HackerPropertyClass);
|
|
156
|
-
return
|
|
143
|
+
return _call_super(this, HackerPropertyClass, arguments);
|
|
157
144
|
}
|
|
158
145
|
return HackerPropertyClass;
|
|
159
146
|
}(Property);
|
|
@@ -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,12 +120,9 @@ function _ts_generator(thisArg, body) {
|
|
|
124
120
|
}
|
|
125
121
|
import { getHackerControl } from './getHackerControl';
|
|
126
122
|
import { nativeFetch, loadRemoteControl } from './loadRemoteScripts';
|
|
127
|
-
import {
|
|
123
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
128
124
|
export function registerByteluckControls(url, payload) {
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
function _registerByteluckControls() {
|
|
132
|
-
_registerByteluckControls = _async_to_generator(function(url, payload) {
|
|
125
|
+
return _async_to_generator(function() {
|
|
133
126
|
var version, byteluckControls, componentsStr, components, controls;
|
|
134
127
|
return _ts_generator(this, function(_state) {
|
|
135
128
|
switch(_state.label){
|
|
@@ -153,7 +146,7 @@ function _registerByteluckControls() {
|
|
|
153
146
|
components = JSON.parse(componentsStr);
|
|
154
147
|
return [
|
|
155
148
|
4,
|
|
156
|
-
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)
|
|
157
150
|
];
|
|
158
151
|
case 2:
|
|
159
152
|
controls = _state.sent();
|
|
@@ -166,7 +159,7 @@ function _registerByteluckControls() {
|
|
|
166
159
|
}
|
|
167
160
|
});
|
|
168
161
|
if (control === undefined) {
|
|
169
|
-
control = getHackerControl(item.id, payload.type,
|
|
162
|
+
control = getHackerControl(item.id, payload.type, getLocaleText('CMD.loadCtrlError', null, '内置组件加载错误'));
|
|
170
163
|
}
|
|
171
164
|
byteluckControls.set(item.id, {
|
|
172
165
|
props: item,
|
|
@@ -183,6 +176,5 @@ function _registerByteluckControls() {
|
|
|
183
176
|
];
|
|
184
177
|
}
|
|
185
178
|
});
|
|
186
|
-
});
|
|
187
|
-
return _registerByteluckControls.apply(this, arguments);
|
|
179
|
+
})();
|
|
188
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(function() {
|
|
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') {
|