@byteluck-fe/model-driven-core-all 1.8.1-beta.5 → 2.0.1
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 +15 -111
- package/dist/esm/registerByteluckControls.js +23 -122
- package/dist/esm/registerCustomControls.js +106 -212
- 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 +6 -6
|
@@ -27,101 +27,7 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
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
|
-
};
|
|
30
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
125
31
|
var jobs = [];
|
|
126
32
|
var module = {
|
|
127
33
|
exports: {}
|
|
@@ -212,23 +118,21 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
212
118
|
return _loadRemoteControls.apply(this, arguments);
|
|
213
119
|
}
|
|
214
120
|
function _loadRemoteControls() {
|
|
215
|
-
_loadRemoteControls = _asyncToGenerator(function(urls, globalModules) {
|
|
216
|
-
return
|
|
217
|
-
switch(
|
|
121
|
+
_loadRemoteControls = _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(urls, globalModules) {
|
|
122
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
123
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
218
124
|
case 0:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
case
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
_state.sent()
|
|
229
|
-
];
|
|
125
|
+
_ctx.next = 2;
|
|
126
|
+
return Promise.all(urls.map(function(url) {
|
|
127
|
+
return loadRemoteControl(url, globalModules);
|
|
128
|
+
}));
|
|
129
|
+
case 2:
|
|
130
|
+
return _ctx.abrupt("return", _ctx.sent);
|
|
131
|
+
case 3:
|
|
132
|
+
case "end":
|
|
133
|
+
return _ctx.stop();
|
|
230
134
|
}
|
|
231
|
-
});
|
|
232
|
-
});
|
|
135
|
+
}, _callee);
|
|
136
|
+
}));
|
|
233
137
|
return _loadRemoteControls.apply(this, arguments);
|
|
234
138
|
}
|
|
@@ -27,135 +27,37 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
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
|
-
};
|
|
30
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
125
31
|
import { getHackerControl } from "./getHackerControl";
|
|
126
32
|
import { nativeFetch, loadRemoteControl } from "./loadRemoteScripts";
|
|
127
33
|
export function registerByteluckControls(url, payload) {
|
|
128
34
|
return _registerByteluckControls.apply(this, arguments);
|
|
129
35
|
}
|
|
130
36
|
function _registerByteluckControls() {
|
|
131
|
-
_registerByteluckControls = _asyncToGenerator(function(url, payload) {
|
|
37
|
+
_registerByteluckControls = _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(url, payload) {
|
|
132
38
|
var version, byteluckControls, componentsStr, components, controls;
|
|
133
|
-
return
|
|
134
|
-
switch(
|
|
39
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
40
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
135
41
|
case 0:
|
|
136
42
|
version = payload.version;
|
|
137
43
|
if (payload.version === "random") {
|
|
138
44
|
version = new Date().valueOf().toString();
|
|
139
45
|
}
|
|
140
46
|
byteluckControls = new Map();
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
case 1:
|
|
146
|
-
componentsStr = _state.sent();
|
|
47
|
+
_ctx.next = 5;
|
|
48
|
+
return nativeFetch("".concat(url, "/component.json?v=").concat(version));
|
|
49
|
+
case 5:
|
|
50
|
+
componentsStr = _ctx.sent;
|
|
147
51
|
components = [];
|
|
148
|
-
if (!(componentsStr !== undefined))
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
52
|
+
if (!(componentsStr !== undefined)) {
|
|
53
|
+
_ctx.next = 13;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
152
56
|
components = JSON.parse(componentsStr);
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
case 2:
|
|
158
|
-
controls = _state.sent();
|
|
57
|
+
_ctx.next = 11;
|
|
58
|
+
return loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version), payload.globalModules);
|
|
59
|
+
case 11:
|
|
60
|
+
controls = _ctx.sent;
|
|
159
61
|
components.map(function(item) {
|
|
160
62
|
var control = controls.find(function(control) {
|
|
161
63
|
if (payload.type === "runtime") {
|
|
@@ -174,14 +76,13 @@ function _registerByteluckControls() {
|
|
|
174
76
|
control: control
|
|
175
77
|
});
|
|
176
78
|
});
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
];
|
|
79
|
+
case 13:
|
|
80
|
+
return _ctx.abrupt("return", byteluckControls);
|
|
81
|
+
case 14:
|
|
82
|
+
case "end":
|
|
83
|
+
return _ctx.stop();
|
|
183
84
|
}
|
|
184
|
-
});
|
|
185
|
-
});
|
|
85
|
+
}, _callee);
|
|
86
|
+
}));
|
|
186
87
|
return _registerByteluckControls.apply(this, arguments);
|
|
187
88
|
}
|
|
@@ -27,101 +27,7 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
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
|
-
};
|
|
30
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
125
31
|
import { loadRemoteControl } from "./loadRemoteScripts";
|
|
126
32
|
import { warn } from "@byteluck-fe/model-driven-shared";
|
|
127
33
|
import { getHackerControl } from "./getHackerControl";
|
|
@@ -129,130 +35,118 @@ export function registerCustomControls(components, refLibs, payload) {
|
|
|
129
35
|
return _registerCustomControls.apply(this, arguments);
|
|
130
36
|
}
|
|
131
37
|
function _registerCustomControls() {
|
|
132
|
-
_registerCustomControls = _asyncToGenerator(function(components, refLibs, payload) {
|
|
38
|
+
_registerCustomControls = _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(components, refLibs, payload) {
|
|
133
39
|
var registered;
|
|
134
|
-
return
|
|
135
|
-
switch(
|
|
40
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
41
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
136
42
|
case 0:
|
|
137
43
|
registered = new Map();
|
|
138
|
-
if (components.length === 0) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
registered
|
|
142
|
-
];
|
|
44
|
+
if (!(components.length === 0)) {
|
|
45
|
+
_ctx.next = 3;
|
|
46
|
+
break;
|
|
143
47
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
48
|
+
return _ctx.abrupt("return", registered);
|
|
49
|
+
case 3:
|
|
50
|
+
_ctx.next = 5;
|
|
51
|
+
return Promise.all(components.map(function() {
|
|
52
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee(item) {
|
|
53
|
+
var isLoaded, control, url, link, reg, reg1, styleLink;
|
|
54
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
55
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
56
|
+
case 0:
|
|
57
|
+
isLoaded = true;
|
|
58
|
+
;
|
|
59
|
+
_ctx.prev = 2;
|
|
60
|
+
isLoaded = true;
|
|
61
|
+
url = "";
|
|
62
|
+
if (payload.type === "runtime") {
|
|
63
|
+
url = item.runtime;
|
|
64
|
+
} else {
|
|
65
|
+
url = item.designer;
|
|
66
|
+
}
|
|
67
|
+
url += "?v=" + item.version;
|
|
68
|
+
_ctx.next = 9;
|
|
69
|
+
return loadRemoteControl(url, refLibs);
|
|
70
|
+
case 9:
|
|
71
|
+
control = _ctx.sent;
|
|
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);
|
|
168
95
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
}
|
|
96
|
+
}
|
|
97
|
+
if (payload.type === "runtime") {
|
|
98
|
+
if (registered.has(control.Runtime.controlType)) {
|
|
99
|
+
warn("repeat register ".concat(control.Runtime.controlType));
|
|
205
100
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
});
|
|
101
|
+
// let oldVersion //此处不能赋值
|
|
102
|
+
// component_id_version_list.every(id => {
|
|
103
|
+
// const index = String(control.Runtime.controlType).indexOf(':')
|
|
104
|
+
// if (id.startsWith(control.Runtime.controlType) && index > -1) {
|
|
105
|
+
// oldVersion = String(control.Runtime.controlType).substring(index + 1)
|
|
106
|
+
// return false
|
|
107
|
+
// } else {
|
|
108
|
+
// return true
|
|
109
|
+
// }
|
|
110
|
+
// })
|
|
111
|
+
registered.set(control.Runtime.controlType, {
|
|
112
|
+
props: item,
|
|
113
|
+
version: item.version,
|
|
114
|
+
isLoaded: isLoaded,
|
|
115
|
+
control: control
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
if (registered.has(control.Designer.controlType)) {
|
|
119
|
+
warn("repeat register ".concat(control.Designer.controlType));
|
|
236
120
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
121
|
+
registered.set(control.Designer.controlType, {
|
|
122
|
+
props: item,
|
|
123
|
+
version: item.version,
|
|
124
|
+
isLoaded: isLoaded,
|
|
125
|
+
control: control
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
case 19:
|
|
129
|
+
case "end":
|
|
130
|
+
return _ctx.stop();
|
|
131
|
+
}
|
|
132
|
+
}, _callee, null, [
|
|
133
|
+
[
|
|
134
|
+
2,
|
|
135
|
+
12
|
|
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();
|
|
254
148
|
}
|
|
255
|
-
});
|
|
256
|
-
});
|
|
149
|
+
}, _callee);
|
|
150
|
+
}));
|
|
257
151
|
return _registerCustomControls.apply(this, arguments);
|
|
258
152
|
}
|
|
@@ -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 ref = _slicedToArray(comIdWithVersion.split(":"), 2), comid = ref[0], version = ref[1];
|
|
53
53
|
if (hasControl.props.id === comid) {
|
|
54
54
|
oldVersion = version !== null && version !== void 0 ? version : "";
|
|
55
55
|
}
|