@byteluck-fe/model-driven-core-all 2.0.1 → 2.0.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 +111 -15
- package/dist/esm/registerByteluckControls.js +122 -23
- package/dist/esm/registerCustomControls.js +212 -106
- package/dist/esm/upgradeCustomControlSchema.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/registerCustomControls.d.ts +2 -2
- package/package.json +3 -3
|
@@ -27,7 +27,101 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
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() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g;
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
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;
|
|
59
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
31
125
|
var jobs = [];
|
|
32
126
|
var module = {
|
|
33
127
|
exports: {}
|
|
@@ -118,21 +212,23 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
118
212
|
return _loadRemoteControls.apply(this, arguments);
|
|
119
213
|
}
|
|
120
214
|
function _loadRemoteControls() {
|
|
121
|
-
_loadRemoteControls = _asyncToGenerator(
|
|
122
|
-
return
|
|
123
|
-
|
|
215
|
+
_loadRemoteControls = _asyncToGenerator(function(urls, globalModules) {
|
|
216
|
+
return __generator(this, function(_state) {
|
|
217
|
+
switch(_state.label){
|
|
124
218
|
case 0:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
case
|
|
132
|
-
|
|
133
|
-
|
|
219
|
+
return [
|
|
220
|
+
4,
|
|
221
|
+
Promise.all(urls.map(function(url) {
|
|
222
|
+
return loadRemoteControl(url, globalModules);
|
|
223
|
+
}))
|
|
224
|
+
];
|
|
225
|
+
case 1:
|
|
226
|
+
return [
|
|
227
|
+
2,
|
|
228
|
+
_state.sent()
|
|
229
|
+
];
|
|
134
230
|
}
|
|
135
|
-
}
|
|
136
|
-
})
|
|
231
|
+
});
|
|
232
|
+
});
|
|
137
233
|
return _loadRemoteControls.apply(this, arguments);
|
|
138
234
|
}
|
|
@@ -27,37 +27,135 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
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() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g;
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
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;
|
|
59
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
31
125
|
import { getHackerControl } from "./getHackerControl";
|
|
32
126
|
import { nativeFetch, loadRemoteControl } from "./loadRemoteScripts";
|
|
33
127
|
export function registerByteluckControls(url, payload) {
|
|
34
128
|
return _registerByteluckControls.apply(this, arguments);
|
|
35
129
|
}
|
|
36
130
|
function _registerByteluckControls() {
|
|
37
|
-
_registerByteluckControls = _asyncToGenerator(
|
|
131
|
+
_registerByteluckControls = _asyncToGenerator(function(url, payload) {
|
|
38
132
|
var version, byteluckControls, componentsStr, components, controls;
|
|
39
|
-
return
|
|
40
|
-
|
|
133
|
+
return __generator(this, function(_state) {
|
|
134
|
+
switch(_state.label){
|
|
41
135
|
case 0:
|
|
42
136
|
version = payload.version;
|
|
43
137
|
if (payload.version === "random") {
|
|
44
138
|
version = new Date().valueOf().toString();
|
|
45
139
|
}
|
|
46
140
|
byteluckControls = new Map();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
141
|
+
return [
|
|
142
|
+
4,
|
|
143
|
+
nativeFetch("".concat(url, "/component.json?v=").concat(version))
|
|
144
|
+
];
|
|
145
|
+
case 1:
|
|
146
|
+
componentsStr = _state.sent();
|
|
51
147
|
components = [];
|
|
52
|
-
if (!(componentsStr !== undefined))
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
148
|
+
if (!(componentsStr !== undefined)) return [
|
|
149
|
+
3,
|
|
150
|
+
3
|
|
151
|
+
];
|
|
56
152
|
components = JSON.parse(componentsStr);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
153
|
+
return [
|
|
154
|
+
4,
|
|
155
|
+
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version), payload.globalModules)
|
|
156
|
+
];
|
|
157
|
+
case 2:
|
|
158
|
+
controls = _state.sent();
|
|
61
159
|
components.map(function(item) {
|
|
62
160
|
var control = controls.find(function(control) {
|
|
63
161
|
if (payload.type === "runtime") {
|
|
@@ -76,13 +174,14 @@ function _registerByteluckControls() {
|
|
|
76
174
|
control: control
|
|
77
175
|
});
|
|
78
176
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
177
|
+
_state.label = 3;
|
|
178
|
+
case 3:
|
|
179
|
+
return [
|
|
180
|
+
2,
|
|
181
|
+
byteluckControls
|
|
182
|
+
];
|
|
84
183
|
}
|
|
85
|
-
}
|
|
86
|
-
})
|
|
184
|
+
});
|
|
185
|
+
});
|
|
87
186
|
return _registerByteluckControls.apply(this, arguments);
|
|
88
187
|
}
|
|
@@ -27,7 +27,101 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
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() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g);
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
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;
|
|
59
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
31
125
|
import { loadRemoteControl } from "./loadRemoteScripts";
|
|
32
126
|
import { warn } from "@byteluck-fe/model-driven-shared";
|
|
33
127
|
import { getHackerControl } from "./getHackerControl";
|
|
@@ -35,118 +129,130 @@ export function registerCustomControls(components, refLibs, payload) {
|
|
|
35
129
|
return _registerCustomControls.apply(this, arguments);
|
|
36
130
|
}
|
|
37
131
|
function _registerCustomControls() {
|
|
38
|
-
_registerCustomControls = _asyncToGenerator(
|
|
132
|
+
_registerCustomControls = _asyncToGenerator(function(components, refLibs, payload) {
|
|
39
133
|
var registered;
|
|
40
|
-
return
|
|
41
|
-
|
|
134
|
+
return __generator(this, function(_state) {
|
|
135
|
+
switch(_state.label){
|
|
42
136
|
case 0:
|
|
43
137
|
registered = new Map();
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
138
|
+
if (components.length === 0) {
|
|
139
|
+
return [
|
|
140
|
+
2,
|
|
141
|
+
registered
|
|
142
|
+
];
|
|
47
143
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
_ctx.next = 17;
|
|
73
|
-
break;
|
|
74
|
-
case 12:
|
|
75
|
-
_ctx.prev = 12;
|
|
76
|
-
_ctx.t0 = _ctx["catch"](2);
|
|
77
|
-
isLoaded = false;
|
|
78
|
-
warn("加载自定义控件异常,会影响到的控件:" + item.id, _ctx.t0);
|
|
79
|
-
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
80
|
-
case 17:
|
|
81
|
-
if (isLoaded) {
|
|
82
|
-
link = "";
|
|
83
|
-
if (payload.type === "runtime" && item.runtimecss !== undefined) {
|
|
84
|
-
reg = new RegExp(item.id + "-runtime-.*?$");
|
|
85
|
-
link = item.runtime.replace(reg, item.runtimecss);
|
|
86
|
-
} else if (payload.type === "designer" && item.designercss !== undefined) {
|
|
87
|
-
reg1 = new RegExp(item.id + "-designer-.*?$");
|
|
88
|
-
link = item.designer.replace(reg1, item.designercss);
|
|
89
|
-
}
|
|
90
|
-
if (link !== "") {
|
|
91
|
-
styleLink = document.createElement("link");
|
|
92
|
-
styleLink.href = link;
|
|
93
|
-
styleLink.rel = "stylesheet";
|
|
94
|
-
document.head.appendChild(styleLink);
|
|
144
|
+
//qiyu 2022-4-18 逐个加载自定义组件,只有异常的组件加载为hackerControl
|
|
145
|
+
return [
|
|
146
|
+
4,
|
|
147
|
+
Promise.all(components.map(function() {
|
|
148
|
+
var _ref = _asyncToGenerator(function(item) {
|
|
149
|
+
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
150
|
+
return __generator(this, function(_state) {
|
|
151
|
+
switch(_state.label){
|
|
152
|
+
case 0:
|
|
153
|
+
isLoaded = true;
|
|
154
|
+
_state.label = 1;
|
|
155
|
+
case 1:
|
|
156
|
+
_state.trys.push([
|
|
157
|
+
1,
|
|
158
|
+
3,
|
|
159
|
+
,
|
|
160
|
+
4
|
|
161
|
+
]);
|
|
162
|
+
isLoaded = true;
|
|
163
|
+
url = "";
|
|
164
|
+
if (payload.type === "runtime") {
|
|
165
|
+
url = item.runtime;
|
|
166
|
+
} else {
|
|
167
|
+
url = item.designer;
|
|
95
168
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
169
|
+
url += "?v=" + item.version;
|
|
170
|
+
return [
|
|
171
|
+
4,
|
|
172
|
+
loadRemoteControl(url, refLibs)
|
|
173
|
+
];
|
|
174
|
+
case 2:
|
|
175
|
+
control = _state.sent();
|
|
176
|
+
return [
|
|
177
|
+
3,
|
|
178
|
+
4
|
|
179
|
+
];
|
|
180
|
+
case 3:
|
|
181
|
+
e = _state.sent();
|
|
182
|
+
isLoaded = false;
|
|
183
|
+
warn("加载自定义控件异常,会影响到的控件:" + item.id, e);
|
|
184
|
+
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
185
|
+
return [
|
|
186
|
+
3,
|
|
187
|
+
4
|
|
188
|
+
];
|
|
189
|
+
case 4:
|
|
190
|
+
if (isLoaded) {
|
|
191
|
+
link = "";
|
|
192
|
+
if (payload.type === "runtime" && item.runtimecss !== undefined) {
|
|
193
|
+
reg = new RegExp(item.id + "-runtime-.*?$");
|
|
194
|
+
link = item.runtime.replace(reg, item.runtimecss);
|
|
195
|
+
} else if (payload.type === "designer" && item.designercss !== undefined) {
|
|
196
|
+
reg1 = new RegExp(item.id + "-designer-.*?$");
|
|
197
|
+
link = item.designer.replace(reg1, item.designercss);
|
|
198
|
+
}
|
|
199
|
+
if (link !== "") {
|
|
200
|
+
styleLink = document.createElement("link");
|
|
201
|
+
styleLink.href = link;
|
|
202
|
+
styleLink.rel = "stylesheet";
|
|
203
|
+
document.head.appendChild(styleLink);
|
|
204
|
+
}
|
|
100
205
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
control
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
206
|
+
if (payload.type === "runtime") {
|
|
207
|
+
if (registered.has(control.Runtime.controlType)) {
|
|
208
|
+
warn("repeat register ".concat(control.Runtime.controlType));
|
|
209
|
+
}
|
|
210
|
+
// let oldVersion //此处不能赋值
|
|
211
|
+
// component_id_version_list.every(id => {
|
|
212
|
+
// const index = String(control.Runtime.controlType).indexOf(':')
|
|
213
|
+
// if (id.startsWith(control.Runtime.controlType) && index > -1) {
|
|
214
|
+
// oldVersion = String(control.Runtime.controlType).substring(index + 1)
|
|
215
|
+
// return false
|
|
216
|
+
// } else {
|
|
217
|
+
// return true
|
|
218
|
+
// }
|
|
219
|
+
// })
|
|
220
|
+
registered.set(control.Runtime.controlType, {
|
|
221
|
+
props: item,
|
|
222
|
+
version: item.version,
|
|
223
|
+
isLoaded: isLoaded,
|
|
224
|
+
control: control
|
|
225
|
+
});
|
|
226
|
+
} else {
|
|
227
|
+
if (registered.has(control.Designer.controlType)) {
|
|
228
|
+
warn("repeat register ".concat(control.Designer.controlType));
|
|
229
|
+
}
|
|
230
|
+
registered.set(control.Designer.controlType, {
|
|
231
|
+
props: item,
|
|
232
|
+
version: item.version,
|
|
233
|
+
isLoaded: isLoaded,
|
|
234
|
+
control: control
|
|
235
|
+
});
|
|
120
236
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}));
|
|
139
|
-
return function(item) {
|
|
140
|
-
return _ref.apply(this, arguments);
|
|
141
|
-
};
|
|
142
|
-
}()));
|
|
143
|
-
case 5:
|
|
144
|
-
return _ctx.abrupt("return", registered);
|
|
145
|
-
case 6:
|
|
146
|
-
case "end":
|
|
147
|
-
return _ctx.stop();
|
|
237
|
+
return [
|
|
238
|
+
2
|
|
239
|
+
];
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
return function(item) {
|
|
244
|
+
return _ref.apply(this, arguments);
|
|
245
|
+
};
|
|
246
|
+
}()))
|
|
247
|
+
];
|
|
248
|
+
case 1:
|
|
249
|
+
_state.sent();
|
|
250
|
+
return [
|
|
251
|
+
2,
|
|
252
|
+
registered
|
|
253
|
+
];
|
|
148
254
|
}
|
|
149
|
-
}
|
|
150
|
-
})
|
|
255
|
+
});
|
|
256
|
+
});
|
|
151
257
|
return _registerCustomControls.apply(this, arguments);
|
|
152
258
|
}
|
|
@@ -49,7 +49,7 @@ export function upgradeCustomControlSchema(schema, registered, componentList, pa
|
|
|
49
49
|
if (hasControl && hasControl.control.upgrade) {
|
|
50
50
|
var oldVersion = "";
|
|
51
51
|
componentList === null || componentList === void 0 ? void 0 : componentList.map(function(comIdWithVersion) {
|
|
52
|
-
var
|
|
52
|
+
var _comIdWithVersion_split = _slicedToArray(comIdWithVersion.split(":"), 2), comid = _comIdWithVersion_split[0], version = _comIdWithVersion_split[1];
|
|
53
53
|
if (hasControl.props.id === comid) {
|
|
54
54
|
oldVersion = version !== null && version !== void 0 ? version : "";
|
|
55
55
|
}
|