@byteluck-fe/model-driven-core-all 2.3.1-beta.2 → 2.3.1-beta.3
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 +185 -79
- package/dist/esm/upgradeCustomControlSchema.js +1 -1
- 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 +6 -6
- package/dist/types/registerCustomControls.d.ts +22 -22
- package/dist/types/upgradeCustomControlSchema.d.ts +2 -2
- package/package.json +6 -6
|
@@ -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
|
}
|
|
@@ -36,7 +36,7 @@ function _asyncToGenerator(fn) {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
function _iterableToArrayLimit(arr, i) {
|
|
39
|
-
var _i = arr == null ? null :
|
|
39
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
40
40
|
if (_i == null) return;
|
|
41
41
|
var _arr = [];
|
|
42
42
|
var _n = true;
|
|
@@ -73,7 +73,101 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
73
73
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
74
74
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
77
|
+
var f, y, t, g, _ = {
|
|
78
|
+
label: 0,
|
|
79
|
+
sent: function() {
|
|
80
|
+
if (t[0] & 1) throw t[1];
|
|
81
|
+
return t[1];
|
|
82
|
+
},
|
|
83
|
+
trys: [],
|
|
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() {
|
|
91
|
+
return this;
|
|
92
|
+
}), g);
|
|
93
|
+
function verb(n) {
|
|
94
|
+
return function(v) {
|
|
95
|
+
return step([
|
|
96
|
+
n,
|
|
97
|
+
v
|
|
98
|
+
]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function step(op) {
|
|
102
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
103
|
+
while(_)try {
|
|
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;
|
|
105
|
+
if (y = 0, t) op = [
|
|
106
|
+
op[0] & 2,
|
|
107
|
+
t.value
|
|
108
|
+
];
|
|
109
|
+
switch(op[0]){
|
|
110
|
+
case 0:
|
|
111
|
+
case 1:
|
|
112
|
+
t = op;
|
|
113
|
+
break;
|
|
114
|
+
case 4:
|
|
115
|
+
_.label++;
|
|
116
|
+
return {
|
|
117
|
+
value: op[1],
|
|
118
|
+
done: false
|
|
119
|
+
};
|
|
120
|
+
case 5:
|
|
121
|
+
_.label++;
|
|
122
|
+
y = op[1];
|
|
123
|
+
op = [
|
|
124
|
+
0
|
|
125
|
+
];
|
|
126
|
+
continue;
|
|
127
|
+
case 7:
|
|
128
|
+
op = _.ops.pop();
|
|
129
|
+
_.trys.pop();
|
|
130
|
+
continue;
|
|
131
|
+
default:
|
|
132
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
133
|
+
_ = 0;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
137
|
+
_.label = op[1];
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
141
|
+
_.label = t[1];
|
|
142
|
+
t = op;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (t && _.label < t[2]) {
|
|
146
|
+
_.label = t[2];
|
|
147
|
+
_.ops.push(op);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
if (t[2]) _.ops.pop();
|
|
151
|
+
_.trys.pop();
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
op = body.call(thisArg, _);
|
|
155
|
+
} catch (e) {
|
|
156
|
+
op = [
|
|
157
|
+
6,
|
|
158
|
+
e
|
|
159
|
+
];
|
|
160
|
+
y = 0;
|
|
161
|
+
} finally{
|
|
162
|
+
f = t = 0;
|
|
163
|
+
}
|
|
164
|
+
if (op[0] & 5) throw op[1];
|
|
165
|
+
return {
|
|
166
|
+
value: op[0] ? op[1] : void 0,
|
|
167
|
+
done: true
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
77
171
|
import { loadRemoteControl } from "./loadRemoteScripts";
|
|
78
172
|
import { warn } from "@byteluck-fe/model-driven-shared";
|
|
79
173
|
import { getHackerControl } from "./getHackerControl";
|
|
@@ -81,84 +175,96 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
81
175
|
return _registerCustomControls.apply(this, arguments);
|
|
82
176
|
}
|
|
83
177
|
function _registerCustomControls() {
|
|
84
|
-
_registerCustomControls = _asyncToGenerator(
|
|
178
|
+
_registerCustomControls = _asyncToGenerator(function(componentList, components, refLibs, payload) {
|
|
85
179
|
var registered;
|
|
86
|
-
return
|
|
87
|
-
|
|
180
|
+
return __generator(this, function(_state) {
|
|
181
|
+
switch(_state.label){
|
|
88
182
|
case 0:
|
|
89
183
|
registered = new Map();
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
184
|
+
if (componentList.length === 0) {
|
|
185
|
+
return [
|
|
186
|
+
2,
|
|
187
|
+
registered
|
|
188
|
+
];
|
|
93
189
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
_ctx.next = 17;
|
|
119
|
-
break;
|
|
120
|
-
case 12:
|
|
121
|
-
_ctx.prev = 12;
|
|
122
|
-
_ctx.t0 = _ctx["catch"](2);
|
|
123
|
-
isLoaded = false;
|
|
124
|
-
warn("加载自定义控件异常,会影响到的控件:" + item.id, _ctx.t0);
|
|
125
|
-
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
126
|
-
case 17:
|
|
127
|
-
if (isLoaded) {
|
|
128
|
-
link = "";
|
|
129
|
-
if (payload.type === "runtime" && item.runtimecss !== undefined) {
|
|
130
|
-
reg = new RegExp(item.id + "-runtime-.*?$");
|
|
131
|
-
link = item.runtime.replace(reg, item.runtimecss);
|
|
132
|
-
} else if (payload.type === "designer" && item.designercss !== undefined) {
|
|
133
|
-
reg1 = new RegExp(item.id + "-designer-.*?$");
|
|
134
|
-
link = item.designer.replace(reg1, item.designercss);
|
|
190
|
+
//qiyu 2022-4-18 逐个加载自定义组件,只有异常的组件加载为hackerControl
|
|
191
|
+
return [
|
|
192
|
+
4,
|
|
193
|
+
Promise.all(components.map(function() {
|
|
194
|
+
var _ref = _asyncToGenerator(function(item) {
|
|
195
|
+
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
196
|
+
return __generator(this, function(_state) {
|
|
197
|
+
switch(_state.label){
|
|
198
|
+
case 0:
|
|
199
|
+
isLoaded = true;
|
|
200
|
+
_state.label = 1;
|
|
201
|
+
case 1:
|
|
202
|
+
_state.trys.push([
|
|
203
|
+
1,
|
|
204
|
+
3,
|
|
205
|
+
,
|
|
206
|
+
4
|
|
207
|
+
]);
|
|
208
|
+
isLoaded = true;
|
|
209
|
+
url = "";
|
|
210
|
+
if (payload.type === "runtime") {
|
|
211
|
+
url = item.runtime;
|
|
212
|
+
} else {
|
|
213
|
+
url = item.designer;
|
|
135
214
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
215
|
+
url += "?v=" + item.version;
|
|
216
|
+
return [
|
|
217
|
+
4,
|
|
218
|
+
loadRemoteControl(url, refLibs)
|
|
219
|
+
];
|
|
220
|
+
case 2:
|
|
221
|
+
control = _state.sent();
|
|
222
|
+
return [
|
|
223
|
+
3,
|
|
224
|
+
4
|
|
225
|
+
];
|
|
226
|
+
case 3:
|
|
227
|
+
e = _state.sent();
|
|
228
|
+
isLoaded = false;
|
|
229
|
+
warn("加载自定义控件异常,会影响到的控件:" + item.id, e);
|
|
230
|
+
control = getHackerControl(item.id, payload.type, payload.tipMessage);
|
|
231
|
+
return [
|
|
232
|
+
3,
|
|
233
|
+
4
|
|
234
|
+
];
|
|
235
|
+
case 4:
|
|
236
|
+
if (isLoaded) {
|
|
237
|
+
link = "";
|
|
238
|
+
if (payload.type === "runtime" && item.runtimecss !== undefined) {
|
|
239
|
+
reg = new RegExp(item.id + "-runtime-.*?$");
|
|
240
|
+
link = item.runtime.replace(reg, item.runtimecss);
|
|
241
|
+
} else if (payload.type === "designer" && item.designercss !== undefined) {
|
|
242
|
+
reg1 = new RegExp(item.id + "-designer-.*?$");
|
|
243
|
+
link = item.designer.replace(reg1, item.designercss);
|
|
244
|
+
}
|
|
245
|
+
if (link !== "") {
|
|
246
|
+
styleLink = document.createElement("link");
|
|
247
|
+
styleLink.href = link;
|
|
248
|
+
styleLink.rel = "stylesheet";
|
|
249
|
+
document.head.appendChild(styleLink);
|
|
250
|
+
}
|
|
141
251
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return _ref.apply(this, arguments);
|
|
157
|
-
};
|
|
158
|
-
}()));
|
|
159
|
-
case 5:
|
|
252
|
+
pushControl(payload.type, control, registered, isLoaded, item);
|
|
253
|
+
return [
|
|
254
|
+
2
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
return function(item) {
|
|
260
|
+
return _ref.apply(this, arguments);
|
|
261
|
+
};
|
|
262
|
+
}()))
|
|
263
|
+
];
|
|
264
|
+
case 1:
|
|
265
|
+
_state.sent();
|
|
160
266
|
componentList === null || componentList === void 0 ? void 0 : componentList.map(function(comIdWithVersion) {
|
|
161
|
-
var
|
|
267
|
+
var _comIdWithVersion_split = _slicedToArray(comIdWithVersion.split(":"), 2), comid = _comIdWithVersion_split[0], version = _comIdWithVersion_split[1];
|
|
162
268
|
var hasControl = registered.has(comid);
|
|
163
269
|
if (hasControl === false) {
|
|
164
270
|
var control = getHackerControl(comid, payload.type, payload.tipMessage);
|
|
@@ -173,13 +279,13 @@ function _registerCustomControls() {
|
|
|
173
279
|
});
|
|
174
280
|
}
|
|
175
281
|
});
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
282
|
+
return [
|
|
283
|
+
2,
|
|
284
|
+
registered
|
|
285
|
+
];
|
|
180
286
|
}
|
|
181
|
-
}
|
|
182
|
-
})
|
|
287
|
+
});
|
|
288
|
+
});
|
|
183
289
|
return _registerCustomControls.apply(this, arguments);
|
|
184
290
|
}
|
|
185
291
|
function pushControl(type, control, registered, isLoaded, props) {
|
|
@@ -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
|
}
|