@byteluck-fe/model-driven-core-all 2.23.0-beta.2 → 2.23.0-beta.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 +16 -29
- package/dist/esm/registerByteluckControls.js +3 -3
- package/dist/esm/registerCustomControls.js +2 -2
- package/dist/index.umd.js +1 -43
- package/dist/types/registerByteluckControls.d.ts +1 -0
- package/dist/types/registerCustomControls.d.ts +1 -0
- package/package.json +6 -6
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -73,28 +77,12 @@ function _type_of(obj) {
|
|
|
73
77
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
74
78
|
}
|
|
75
79
|
function _is_native_reflect_construct() {
|
|
76
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
77
|
-
if (Reflect.construct.sham) return false;
|
|
78
|
-
if (typeof Proxy === "function") return true;
|
|
79
80
|
try {
|
|
80
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function _create_super(Derived) {
|
|
87
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
88
|
-
return function _createSuperInternal() {
|
|
89
|
-
var Super = _get_prototype_of(Derived), result;
|
|
90
|
-
if (hasNativeReflectConstruct) {
|
|
91
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
92
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
93
|
-
} else {
|
|
94
|
-
result = Super.apply(this, arguments);
|
|
95
|
-
}
|
|
96
|
-
return _possible_constructor_return(this, result);
|
|
97
|
-
};
|
|
81
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
+
} catch (_) {}
|
|
83
|
+
return (_is_native_reflect_construct = function() {
|
|
84
|
+
return !!result;
|
|
85
|
+
})();
|
|
98
86
|
}
|
|
99
87
|
import { RuntimeControl } from '@byteluck-fe/model-driven-core';
|
|
100
88
|
import { DesignerControl } from '@byteluck-fe/model-driven-core';
|
|
@@ -106,12 +94,12 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
106
94
|
HackerControlClass = /*#__PURE__*/ function(RuntimeControl) {
|
|
107
95
|
"use strict";
|
|
108
96
|
_inherits(HackerControl, RuntimeControl);
|
|
109
|
-
var _super = _create_super(HackerControl);
|
|
110
97
|
function HackerControl(props) {
|
|
111
98
|
_class_call_check(this, HackerControl);
|
|
112
99
|
var _this;
|
|
113
|
-
_this =
|
|
114
|
-
|
|
100
|
+
_this = _call_super(this, HackerControl, [
|
|
101
|
+
props
|
|
102
|
+
]), _define_property(_this, "props", {});
|
|
115
103
|
return _this;
|
|
116
104
|
}
|
|
117
105
|
_create_class(HackerControl, null, [
|
|
@@ -128,12 +116,12 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
128
116
|
HackerControlClass = /*#__PURE__*/ function(DesignerControl) {
|
|
129
117
|
"use strict";
|
|
130
118
|
_inherits(HackerControl, DesignerControl);
|
|
131
|
-
var _super = _create_super(HackerControl);
|
|
132
119
|
function HackerControl(props) {
|
|
133
120
|
_class_call_check(this, HackerControl);
|
|
134
121
|
var _this;
|
|
135
|
-
_this =
|
|
136
|
-
|
|
122
|
+
_this = _call_super(this, HackerControl, [
|
|
123
|
+
props
|
|
124
|
+
]), _define_property(_this, "props", {});
|
|
137
125
|
return _this;
|
|
138
126
|
}
|
|
139
127
|
_create_class(HackerControl, null, [
|
|
@@ -150,10 +138,9 @@ export function getHackerControl(comid, type, tipMessage) {
|
|
|
150
138
|
var HackerPropertyClass = /*#__PURE__*/ function(Property) {
|
|
151
139
|
"use strict";
|
|
152
140
|
_inherits(HackerPropertyClass, Property);
|
|
153
|
-
var _super = _create_super(HackerPropertyClass);
|
|
154
141
|
function HackerPropertyClass() {
|
|
155
142
|
_class_call_check(this, HackerPropertyClass);
|
|
156
|
-
return
|
|
143
|
+
return _call_super(this, HackerPropertyClass, arguments);
|
|
157
144
|
}
|
|
158
145
|
return HackerPropertyClass;
|
|
159
146
|
}(Property);
|
|
@@ -124,7 +124,7 @@ function _ts_generator(thisArg, body) {
|
|
|
124
124
|
}
|
|
125
125
|
import { getHackerControl } from './getHackerControl';
|
|
126
126
|
import { nativeFetch, loadRemoteControl } from './loadRemoteScripts';
|
|
127
|
-
import {
|
|
127
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
128
128
|
export function registerByteluckControls(url, payload) {
|
|
129
129
|
return _registerByteluckControls.apply(this, arguments);
|
|
130
130
|
}
|
|
@@ -153,7 +153,7 @@ function _registerByteluckControls() {
|
|
|
153
153
|
components = JSON.parse(componentsStr);
|
|
154
154
|
return [
|
|
155
155
|
4,
|
|
156
|
-
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version), payload.globalModules)
|
|
156
|
+
loadRemoteControl("".concat(url, "/").concat(payload.type, ".js?v=").concat(version, "&").concat(payload.isPc === false ? 'mobile' : 'desktop'), payload.globalModules)
|
|
157
157
|
];
|
|
158
158
|
case 2:
|
|
159
159
|
controls = _state.sent();
|
|
@@ -166,7 +166,7 @@ function _registerByteluckControls() {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
if (control === undefined) {
|
|
169
|
-
control = getHackerControl(item.id, payload.type,
|
|
169
|
+
control = getHackerControl(item.id, payload.type, getLocaleText('CMD.loadCtrlError', null, '内置组件加载错误'));
|
|
170
170
|
}
|
|
171
171
|
byteluckControls.set(item.id, {
|
|
172
172
|
props: item,
|
|
@@ -190,7 +190,7 @@ function _registerCustomControls() {
|
|
|
190
190
|
//qiyu 2022-4-18 逐个加载自定义组件,只有异常的组件加载为hackerControl
|
|
191
191
|
return [
|
|
192
192
|
4,
|
|
193
|
-
Promise.all(components.map(function() {
|
|
193
|
+
Promise.all(components.map(/*#__PURE__*/ function() {
|
|
194
194
|
var _ref = _async_to_generator(function(item) {
|
|
195
195
|
var isLoaded, control, url, e, link, reg, reg1, styleLink;
|
|
196
196
|
return _ts_generator(this, function(_state) {
|
|
@@ -212,7 +212,7 @@ function _registerCustomControls() {
|
|
|
212
212
|
} else {
|
|
213
213
|
url = item.designer;
|
|
214
214
|
}
|
|
215
|
-
url += '?v=' + item.version;
|
|
215
|
+
url += '?v=' + item.version + '&' + (payload.isPc === false ? 'mobile' : 'desktop');
|
|
216
216
|
return [
|
|
217
217
|
4,
|
|
218
218
|
loadRemoteControl(url, refLibs)
|