@byteluck-fe/model-driven-core-all 2.8.1-beta.15 → 2.8.1-beta.16
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 +32 -32
- 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 +10 -10
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
|
@@ -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,12 +18,12 @@ 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
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
27
|
if (key in obj) {
|
|
28
28
|
Object.defineProperty(obj, key, {
|
|
29
29
|
value: value,
|
|
@@ -36,11 +36,11 @@ function _defineProperty(obj, key, value) {
|
|
|
36
36
|
}
|
|
37
37
|
return obj;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
39
|
+
function _get_prototype_of(o) {
|
|
40
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
41
41
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
42
42
|
};
|
|
43
|
-
return
|
|
43
|
+
return _get_prototype_of(o);
|
|
44
44
|
}
|
|
45
45
|
function _inherits(subClass, superClass) {
|
|
46
46
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -53,26 +53,26 @@ function _inherits(subClass, superClass) {
|
|
|
53
53
|
configurable: true
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
if (superClass)
|
|
56
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (call && (
|
|
58
|
+
function _possible_constructor_return(self, call) {
|
|
59
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
60
60
|
return call;
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return _assert_this_initialized(self);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
64
|
+
function _set_prototype_of(o, p) {
|
|
65
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
66
66
|
o.__proto__ = p;
|
|
67
67
|
return o;
|
|
68
68
|
};
|
|
69
|
-
return
|
|
69
|
+
return _set_prototype_of(o, p);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
function _type_of(obj) {
|
|
72
72
|
"@swc/helpers - typeof";
|
|
73
73
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
74
|
-
}
|
|
75
|
-
function
|
|
74
|
+
}
|
|
75
|
+
function _is_native_reflect_construct() {
|
|
76
76
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
77
77
|
if (Reflect.construct.sham) return false;
|
|
78
78
|
if (typeof Proxy === "function") return true;
|
|
@@ -83,17 +83,17 @@ function _isNativeReflectConstruct() {
|
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
var hasNativeReflectConstruct =
|
|
86
|
+
function _create_super(Derived) {
|
|
87
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
88
88
|
return function _createSuperInternal() {
|
|
89
|
-
var Super =
|
|
89
|
+
var Super = _get_prototype_of(Derived), result;
|
|
90
90
|
if (hasNativeReflectConstruct) {
|
|
91
|
-
var NewTarget =
|
|
91
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
92
92
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
93
93
|
} else {
|
|
94
94
|
result = Super.apply(this, arguments);
|
|
95
95
|
}
|
|
96
|
-
return
|
|
96
|
+
return _possible_constructor_return(this, result);
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
import { RuntimeControl } from "@byteluck-fe/model-driven-core";
|
|
@@ -106,15 +106,15 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
106
106
|
HackerControlClass = /*#__PURE__*/ function(RuntimeControl) {
|
|
107
107
|
"use strict";
|
|
108
108
|
_inherits(HackerControl, RuntimeControl);
|
|
109
|
-
var _super =
|
|
109
|
+
var _super = _create_super(HackerControl);
|
|
110
110
|
function HackerControl(props) {
|
|
111
|
-
|
|
111
|
+
_class_call_check(this, HackerControl);
|
|
112
112
|
var _this;
|
|
113
113
|
_this = _super.call(this, props);
|
|
114
|
-
|
|
114
|
+
_define_property(_assert_this_initialized(_this), "props", {});
|
|
115
115
|
return _this;
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
_create_class(HackerControl, null, [
|
|
118
118
|
{
|
|
119
119
|
key: "controlType",
|
|
120
120
|
get: function get() {
|
|
@@ -128,15 +128,15 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
128
128
|
HackerControlClass = /*#__PURE__*/ function(DesignerControl) {
|
|
129
129
|
"use strict";
|
|
130
130
|
_inherits(HackerControl, DesignerControl);
|
|
131
|
-
var _super =
|
|
131
|
+
var _super = _create_super(HackerControl);
|
|
132
132
|
function HackerControl(props) {
|
|
133
|
-
|
|
133
|
+
_class_call_check(this, HackerControl);
|
|
134
134
|
var _this;
|
|
135
135
|
_this = _super.call(this, props);
|
|
136
|
-
|
|
136
|
+
_define_property(_assert_this_initialized(_this), "props", {});
|
|
137
137
|
return _this;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
_create_class(HackerControl, null, [
|
|
140
140
|
{
|
|
141
141
|
key: "controlType",
|
|
142
142
|
get: function get() {
|
|
@@ -150,9 +150,9 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
150
150
|
var HackerPropertyClass = /*#__PURE__*/ function(Property) {
|
|
151
151
|
"use strict";
|
|
152
152
|
_inherits(HackerPropertyClass, Property);
|
|
153
|
-
var _super =
|
|
153
|
+
var _super = _create_super(HackerPropertyClass);
|
|
154
154
|
function HackerPropertyClass() {
|
|
155
|
-
|
|
155
|
+
_class_call_check(this, HackerPropertyClass);
|
|
156
156
|
return _super.apply(this, arguments);
|
|
157
157
|
}
|
|
158
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: {}
|
|
@@ -211,8 +211,8 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
211
211
|
return _loadRemoteControls.apply(this, arguments);
|
|
212
212
|
}
|
|
213
213
|
function _loadRemoteControls() {
|
|
214
|
-
_loadRemoteControls =
|
|
215
|
-
return
|
|
214
|
+
_loadRemoteControls = _async_to_generator(function(urls, globalModules) {
|
|
215
|
+
return _ts_generator(this, function(_state) {
|
|
216
216
|
switch(_state.label){
|
|
217
217
|
case 0:
|
|
218
218
|
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() {
|
|
@@ -83,13 +83,13 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
83
83
|
trys: [],
|
|
84
84
|
ops: []
|
|
85
85
|
};
|
|
86
|
-
return
|
|
86
|
+
return g = {
|
|
87
87
|
next: verb(0),
|
|
88
88
|
"throw": verb(1),
|
|
89
89
|
"return": verb(2)
|
|
90
90
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
91
91
|
return this;
|
|
92
|
-
}), g
|
|
92
|
+
}), g;
|
|
93
93
|
function verb(n) {
|
|
94
94
|
return function(v) {
|
|
95
95
|
return step([
|
|
@@ -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 =
|
|
178
|
+
_registerCustomControls = _async_to_generator(function(componentList, components, refLibs, payload) {
|
|
179
179
|
var registered;
|
|
180
|
-
return
|
|
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;
|
|
@@ -264,7 +264,7 @@ function _registerCustomControls() {
|
|
|
264
264
|
case 1:
|
|
265
265
|
_state.sent();
|
|
266
266
|
componentList === null || componentList === void 0 ? void 0 : componentList.map(function(comIdWithVersion) {
|
|
267
|
-
var _comIdWithVersion_split =
|
|
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,26 @@ 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
50
|
var oldVersion = "";
|
|
51
51
|
componentList === null || componentList === void 0 ? void 0 : componentList.map(function(comIdWithVersion) {
|
|
52
|
-
var _comIdWithVersion_split =
|
|
52
|
+
var _comIdWithVersion_split = _sliced_to_array(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
|
}
|