@byteluck-fe/model-driven-core-all 2.7.0-alpha.2 → 2.7.0-alpha.21
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/getHackerControl.js +44 -31
- package/dist/esm/loadRemoteScripts.js +5 -5
- package/dist/esm/registerByteluckControls.js +5 -5
- package/dist/esm/registerCustomControls.js +19 -19
- package/dist/esm/upgradeCustomControlSchema.js +12 -11
- package/dist/index.umd.js +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assert_this_initialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
@@ -18,16 +18,29 @@ function _defineProperties(target, props) {
|
|
|
18
18
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
22
22
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
23
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
24
|
return Constructor;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
function _get_prototype_of(o) {
|
|
40
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
28
41
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
29
42
|
};
|
|
30
|
-
return
|
|
43
|
+
return _get_prototype_of(o);
|
|
31
44
|
}
|
|
32
45
|
function _inherits(subClass, superClass) {
|
|
33
46
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -40,26 +53,26 @@ function _inherits(subClass, superClass) {
|
|
|
40
53
|
configurable: true
|
|
41
54
|
}
|
|
42
55
|
});
|
|
43
|
-
if (superClass)
|
|
56
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
44
57
|
}
|
|
45
|
-
function
|
|
46
|
-
if (call && (
|
|
58
|
+
function _possible_constructor_return(self, call) {
|
|
59
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
47
60
|
return call;
|
|
48
61
|
}
|
|
49
|
-
return
|
|
62
|
+
return _assert_this_initialized(self);
|
|
50
63
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
64
|
+
function _set_prototype_of(o, p) {
|
|
65
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
53
66
|
o.__proto__ = p;
|
|
54
67
|
return o;
|
|
55
68
|
};
|
|
56
|
-
return
|
|
69
|
+
return _set_prototype_of(o, p);
|
|
57
70
|
}
|
|
58
|
-
|
|
71
|
+
function _type_of(obj) {
|
|
59
72
|
"@swc/helpers - typeof";
|
|
60
73
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
61
|
-
}
|
|
62
|
-
function
|
|
74
|
+
}
|
|
75
|
+
function _is_native_reflect_construct() {
|
|
63
76
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
64
77
|
if (Reflect.construct.sham) return false;
|
|
65
78
|
if (typeof Proxy === "function") return true;
|
|
@@ -70,17 +83,17 @@ function _isNativeReflectConstruct() {
|
|
|
70
83
|
return false;
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
|
-
function
|
|
74
|
-
var hasNativeReflectConstruct =
|
|
86
|
+
function _create_super(Derived) {
|
|
87
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
75
88
|
return function _createSuperInternal() {
|
|
76
|
-
var Super =
|
|
89
|
+
var Super = _get_prototype_of(Derived), result;
|
|
77
90
|
if (hasNativeReflectConstruct) {
|
|
78
|
-
var NewTarget =
|
|
91
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
79
92
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
80
93
|
} else {
|
|
81
94
|
result = Super.apply(this, arguments);
|
|
82
95
|
}
|
|
83
|
-
return
|
|
96
|
+
return _possible_constructor_return(this, result);
|
|
84
97
|
};
|
|
85
98
|
}
|
|
86
99
|
import { RuntimeControl } from "@byteluck-fe/model-driven-core";
|
|
@@ -93,15 +106,15 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
93
106
|
HackerControlClass = /*#__PURE__*/ function(RuntimeControl) {
|
|
94
107
|
"use strict";
|
|
95
108
|
_inherits(HackerControl, RuntimeControl);
|
|
96
|
-
var _super =
|
|
109
|
+
var _super = _create_super(HackerControl);
|
|
97
110
|
function HackerControl(props) {
|
|
98
|
-
|
|
111
|
+
_class_call_check(this, HackerControl);
|
|
99
112
|
var _this;
|
|
100
113
|
_this = _super.call(this, props);
|
|
101
|
-
_this
|
|
114
|
+
_define_property(_assert_this_initialized(_this), "props", {});
|
|
102
115
|
return _this;
|
|
103
116
|
}
|
|
104
|
-
|
|
117
|
+
_create_class(HackerControl, null, [
|
|
105
118
|
{
|
|
106
119
|
key: "controlType",
|
|
107
120
|
get: function get() {
|
|
@@ -115,15 +128,15 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
115
128
|
HackerControlClass = /*#__PURE__*/ function(DesignerControl) {
|
|
116
129
|
"use strict";
|
|
117
130
|
_inherits(HackerControl, DesignerControl);
|
|
118
|
-
var _super =
|
|
131
|
+
var _super = _create_super(HackerControl);
|
|
119
132
|
function HackerControl(props) {
|
|
120
|
-
|
|
133
|
+
_class_call_check(this, HackerControl);
|
|
121
134
|
var _this;
|
|
122
135
|
_this = _super.call(this, props);
|
|
123
|
-
_this
|
|
136
|
+
_define_property(_assert_this_initialized(_this), "props", {});
|
|
124
137
|
return _this;
|
|
125
138
|
}
|
|
126
|
-
|
|
139
|
+
_create_class(HackerControl, null, [
|
|
127
140
|
{
|
|
128
141
|
key: "controlType",
|
|
129
142
|
get: function get() {
|
|
@@ -137,9 +150,9 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
137
150
|
var HackerPropertyClass = /*#__PURE__*/ function(Property) {
|
|
138
151
|
"use strict";
|
|
139
152
|
_inherits(HackerPropertyClass, Property);
|
|
140
|
-
var _super =
|
|
153
|
+
var _super = _create_super(HackerPropertyClass);
|
|
141
154
|
function HackerPropertyClass() {
|
|
142
|
-
|
|
155
|
+
_class_call_check(this, HackerPropertyClass);
|
|
143
156
|
return _super.apply(this, arguments);
|
|
144
157
|
}
|
|
145
158
|
return HackerPropertyClass;
|
|
@@ -12,7 +12,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
12
12
|
Promise.resolve(value).then(_next, _throw);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
16
|
return function() {
|
|
17
17
|
var self = this, args = arguments;
|
|
18
18
|
return new Promise(function(resolve, reject) {
|
|
@@ -27,7 +27,7 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
function _ts_generator(thisArg, body) {
|
|
31
31
|
var f, y, t, g, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
@@ -121,7 +121,7 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
121
121
|
done: true
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
var jobs = [];
|
|
126
126
|
var module = {
|
|
127
127
|
exports: {}
|
|
@@ -212,8 +212,8 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
212
212
|
return _loadRemoteControls.apply(this, arguments);
|
|
213
213
|
}
|
|
214
214
|
function _loadRemoteControls() {
|
|
215
|
-
_loadRemoteControls =
|
|
216
|
-
return
|
|
215
|
+
_loadRemoteControls = _async_to_generator(function(urls, globalModules) {
|
|
216
|
+
return _ts_generator(this, function(_state) {
|
|
217
217
|
switch(_state.label){
|
|
218
218
|
case 0:
|
|
219
219
|
return [
|
|
@@ -12,7 +12,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
12
12
|
Promise.resolve(value).then(_next, _throw);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
16
|
return function() {
|
|
17
17
|
var self = this, args = arguments;
|
|
18
18
|
return new Promise(function(resolve, reject) {
|
|
@@ -27,7 +27,7 @@ function _asyncToGenerator(fn) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
function _ts_generator(thisArg, body) {
|
|
31
31
|
var f, y, t, g, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
@@ -121,16 +121,16 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
121
121
|
done: true
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
import { getHackerControl } from "./getHackerControl";
|
|
126
126
|
import { nativeFetch, loadRemoteControl } from "./loadRemoteScripts";
|
|
127
127
|
export function registerByteluckControls(url, payload) {
|
|
128
128
|
return _registerByteluckControls.apply(this, arguments);
|
|
129
129
|
}
|
|
130
130
|
function _registerByteluckControls() {
|
|
131
|
-
_registerByteluckControls =
|
|
131
|
+
_registerByteluckControls = _async_to_generator(function(url, payload) {
|
|
132
132
|
var version, byteluckControls, componentsStr, components, controls;
|
|
133
|
-
return
|
|
133
|
+
return _ts_generator(this, function(_state) {
|
|
134
134
|
switch(_state.label){
|
|
135
135
|
case 0:
|
|
136
136
|
version = payload.version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -20,7 +20,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
20
20
|
Promise.resolve(value).then(_next, _throw);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _async_to_generator(fn) {
|
|
24
24
|
return function() {
|
|
25
25
|
var self = this, args = arguments;
|
|
26
26
|
return new Promise(function(resolve, reject) {
|
|
@@ -35,7 +35,7 @@ function _asyncToGenerator(fn) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function _iterable_to_array_limit(arr, i) {
|
|
39
39
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
40
40
|
if (_i == null) return;
|
|
41
41
|
var _arr = [];
|
|
@@ -59,21 +59,21 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
59
59
|
}
|
|
60
60
|
return _arr;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _non_iterable_rest() {
|
|
63
63
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function _sliced_to_array(arr, i) {
|
|
66
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
69
69
|
if (!o) return;
|
|
70
|
-
if (typeof o === "string") return
|
|
70
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
71
71
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
72
72
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
73
73
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
74
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
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
77
|
var f, y, t, g, _ = {
|
|
78
78
|
label: 0,
|
|
79
79
|
sent: function() {
|
|
@@ -167,7 +167,7 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
167
167
|
done: true
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
}
|
|
170
|
+
}
|
|
171
171
|
import { loadRemoteControl } from "./loadRemoteScripts";
|
|
172
172
|
import { warn } from "@byteluck-fe/model-driven-shared";
|
|
173
173
|
import { getHackerControl } from "./getHackerControl";
|
|
@@ -175,9 +175,9 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
175
175
|
return _registerCustomControls.apply(this, arguments);
|
|
176
176
|
}
|
|
177
177
|
function _registerCustomControls() {
|
|
178
|
-
_registerCustomControls =
|
|
179
|
-
var registered;
|
|
180
|
-
return
|
|
178
|
+
_registerCustomControls = _async_to_generator(function(componentList, components, refLibs, payload) {
|
|
179
|
+
var _componentList, registered;
|
|
180
|
+
return _ts_generator(this, function(_state) {
|
|
181
181
|
switch(_state.label){
|
|
182
182
|
case 0:
|
|
183
183
|
registered = new Map();
|
|
@@ -191,9 +191,9 @@ function _registerCustomControls() {
|
|
|
191
191
|
return [
|
|
192
192
|
4,
|
|
193
193
|
Promise.all(components.map(function() {
|
|
194
|
-
var _ref =
|
|
194
|
+
var _ref = _async_to_generator(function(item) {
|
|
195
195
|
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
196
|
-
return
|
|
196
|
+
return _ts_generator(this, function(_state) {
|
|
197
197
|
switch(_state.label){
|
|
198
198
|
case 0:
|
|
199
199
|
isLoaded = true;
|
|
@@ -263,8 +263,8 @@ function _registerCustomControls() {
|
|
|
263
263
|
];
|
|
264
264
|
case 1:
|
|
265
265
|
_state.sent();
|
|
266
|
-
componentList === null ||
|
|
267
|
-
var _comIdWithVersion_split =
|
|
266
|
+
(_componentList = componentList) === null || _componentList === void 0 ? void 0 : _componentList.map(function(comIdWithVersion) {
|
|
267
|
+
var _comIdWithVersion_split = _sliced_to_array(comIdWithVersion.split(":"), 2), comid = _comIdWithVersion_split[0], version = _comIdWithVersion_split[1];
|
|
268
268
|
var hasControl = registered.has(comid);
|
|
269
269
|
if (hasControl === false) {
|
|
270
270
|
var control = getHackerControl(comid, payload.type, payload.tipMessage);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
10
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
11
|
if (_i == null) return;
|
|
12
12
|
var _arr = [];
|
|
@@ -30,26 +30,27 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
30
30
|
}
|
|
31
31
|
return _arr;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
34
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
40
|
if (!o) return;
|
|
41
|
-
if (typeof o === "string") return
|
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
42
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
43
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
46
|
}
|
|
47
47
|
export function upgradeCustomControlSchema(schema, registered, componentList, payload) {
|
|
48
48
|
var hasControl = registered.get(schema.type);
|
|
49
49
|
if (hasControl && hasControl.control.upgrade) {
|
|
50
|
+
var _componentList;
|
|
50
51
|
var oldVersion = "";
|
|
51
|
-
componentList === null ||
|
|
52
|
-
var _comIdWithVersion_split =
|
|
52
|
+
(_componentList = componentList) === null || _componentList === void 0 ? void 0 : _componentList.map(function(comIdWithVersion) {
|
|
53
|
+
var _comIdWithVersion_split = _sliced_to_array(comIdWithVersion.split(":"), 2), comid = _comIdWithVersion_split[0], version = _comIdWithVersion_split[1];
|
|
53
54
|
if (hasControl.props.id === comid) {
|
|
54
55
|
oldVersion = version !== null && version !== void 0 ? version : "";
|
|
55
56
|
}
|