@byteluck-fe/model-driven-core-all 2.5.0-alpha.4 → 2.5.0-alpha.6
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 +2 -2
- package/dist/esm/registerByteluckControls.js +2 -2
- package/dist/esm/registerCustomControls.js +13 -13
- package/dist/esm/upgradeCustomControlSchema.js +10 -10
- package/dist/index.umd.js +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assertThisInitialized(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 _classCallCheck(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 _createClass(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 _defineProperty(obj, key, value) {
|
|
27
27
|
if (key in obj) {
|
|
28
28
|
Object.defineProperty(obj, key, {
|
|
29
29
|
value: value,
|
|
@@ -36,11 +36,11 @@ function _define_property(obj, key, value) {
|
|
|
36
36
|
}
|
|
37
37
|
return obj;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
39
|
+
function _getPrototypeOf(o) {
|
|
40
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
41
41
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
42
42
|
};
|
|
43
|
-
return
|
|
43
|
+
return _getPrototypeOf(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) _setPrototypeOf(subClass, superClass);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (call && (
|
|
58
|
+
function _possibleConstructorReturn(self, call) {
|
|
59
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
60
60
|
return call;
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return _assertThisInitialized(self);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
64
|
+
function _setPrototypeOf(o, p) {
|
|
65
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
66
66
|
o.__proto__ = p;
|
|
67
67
|
return o;
|
|
68
68
|
};
|
|
69
|
-
return
|
|
69
|
+
return _setPrototypeOf(o, p);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
var _typeof = function(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 _isNativeReflectConstruct() {
|
|
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 _is_native_reflect_construct() {
|
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
var hasNativeReflectConstruct =
|
|
86
|
+
function _createSuper(Derived) {
|
|
87
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
88
88
|
return function _createSuperInternal() {
|
|
89
|
-
var Super =
|
|
89
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
90
90
|
if (hasNativeReflectConstruct) {
|
|
91
|
-
var NewTarget =
|
|
91
|
+
var NewTarget = _getPrototypeOf(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 _possibleConstructorReturn(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 = _createSuper(HackerControl);
|
|
110
110
|
function HackerControl(props) {
|
|
111
|
-
|
|
111
|
+
_classCallCheck(this, HackerControl);
|
|
112
112
|
var _this;
|
|
113
113
|
_this = _super.call(this, props);
|
|
114
|
-
|
|
114
|
+
_defineProperty(_assertThisInitialized(_this), "props", {});
|
|
115
115
|
return _this;
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
_createClass(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 = _createSuper(HackerControl);
|
|
132
132
|
function HackerControl(props) {
|
|
133
|
-
|
|
133
|
+
_classCallCheck(this, HackerControl);
|
|
134
134
|
var _this;
|
|
135
135
|
_this = _super.call(this, props);
|
|
136
|
-
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this), "props", {});
|
|
137
137
|
return _this;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
_createClass(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 = _createSuper(HackerPropertyClass);
|
|
154
154
|
function HackerPropertyClass() {
|
|
155
|
-
|
|
155
|
+
_classCallCheck(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 _asyncToGenerator(fn) {
|
|
16
16
|
return function() {
|
|
17
17
|
var self = this, args = arguments;
|
|
18
18
|
return new Promise(function(resolve, reject) {
|
|
@@ -212,7 +212,7 @@ export function loadRemoteControls(urls, globalModules) {
|
|
|
212
212
|
return _loadRemoteControls.apply(this, arguments);
|
|
213
213
|
}
|
|
214
214
|
function _loadRemoteControls() {
|
|
215
|
-
_loadRemoteControls =
|
|
215
|
+
_loadRemoteControls = _asyncToGenerator(function(urls, globalModules) {
|
|
216
216
|
return __generator(this, function(_state) {
|
|
217
217
|
switch(_state.label){
|
|
218
218
|
case 0:
|
|
@@ -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 _asyncToGenerator(fn) {
|
|
16
16
|
return function() {
|
|
17
17
|
var self = this, args = arguments;
|
|
18
18
|
return new Promise(function(resolve, reject) {
|
|
@@ -128,7 +128,7 @@ export function registerByteluckControls(url, payload) {
|
|
|
128
128
|
return _registerByteluckControls.apply(this, arguments);
|
|
129
129
|
}
|
|
130
130
|
function _registerByteluckControls() {
|
|
131
|
-
_registerByteluckControls =
|
|
131
|
+
_registerByteluckControls = _asyncToGenerator(function(url, payload) {
|
|
132
132
|
var version, byteluckControls, componentsStr, components, controls;
|
|
133
133
|
return __generator(this, function(_state) {
|
|
134
134
|
switch(_state.label){
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _arrayLikeToArray(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 _arrayWithHoles(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 _asyncToGenerator(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 _async_to_generator(fn) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function _iterableToArrayLimit(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,19 +59,19 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
59
59
|
}
|
|
60
60
|
return _arr;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _nonIterableRest() {
|
|
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 _slicedToArray(arr, i) {
|
|
66
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
69
69
|
if (!o) return;
|
|
70
|
-
if (typeof o === "string") return
|
|
70
|
+
if (typeof o === "string") return _arrayLikeToArray(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 _arrayLikeToArray(o, minLen);
|
|
75
75
|
}
|
|
76
76
|
var __generator = this && this.__generator || function(thisArg, body) {
|
|
77
77
|
var f, y, t, g, _ = {
|
|
@@ -175,7 +175,7 @@ export function registerCustomControls(componentList, components, refLibs, paylo
|
|
|
175
175
|
return _registerCustomControls.apply(this, arguments);
|
|
176
176
|
}
|
|
177
177
|
function _registerCustomControls() {
|
|
178
|
-
_registerCustomControls =
|
|
178
|
+
_registerCustomControls = _asyncToGenerator(function(componentList, components, refLibs, payload) {
|
|
179
179
|
var registered;
|
|
180
180
|
return __generator(this, function(_state) {
|
|
181
181
|
switch(_state.label){
|
|
@@ -191,7 +191,7 @@ function _registerCustomControls() {
|
|
|
191
191
|
return [
|
|
192
192
|
4,
|
|
193
193
|
Promise.all(components.map(function() {
|
|
194
|
-
var _ref =
|
|
194
|
+
var _ref = _asyncToGenerator(function(item) {
|
|
195
195
|
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
196
196
|
return __generator(this, function(_state) {
|
|
197
197
|
switch(_state.label){
|
|
@@ -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 = _slicedToArray(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 _arrayLikeToArray(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 _arrayWithHoles(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _iterableToArrayLimit(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 _iterable_to_array_limit(arr, i) {
|
|
|
30
30
|
}
|
|
31
31
|
return _arr;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function _nonIterableRest() {
|
|
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 _slicedToArray(arr, i) {
|
|
37
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
40
40
|
if (!o) return;
|
|
41
|
-
if (typeof o === "string") return
|
|
41
|
+
if (typeof o === "string") return _arrayLikeToArray(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 _arrayLikeToArray(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 = _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
|
}
|