@byteluck-fe/model-driven-engine 2.3.0 → 2.3.1-beta.2
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/common/ActionManager.js +33 -136
- package/dist/esm/common/DataManager.js +18 -113
- package/dist/esm/common/Engine.js +102 -201
- package/dist/esm/common/OkWorker.js +5 -5
- package/dist/esm/common/Store.js +10 -10
- package/dist/esm/common/checkerValue.js +2 -2
- package/dist/esm/common/proxyState.js +9 -9
- package/dist/esm/plugins/CalcPlugin.js +17 -17
- package/dist/esm/plugins/ControlsEventPlugin.js +67 -175
- package/dist/esm/plugins/ES6ModulePlugin.js +2 -2
- package/dist/esm/plugins/LifecycleEventPlugin.js +61 -165
- package/dist/esm/plugins/StylePlugin.js +3 -3
- package/dist/esm/utils/runtimeUtils.js +4 -2
- package/dist/index.umd.js +8 -8
- package/dist/types/common/Engine.d.ts +6 -6
- package/dist/types/common/Runtime.d.ts +1 -1
- package/dist/types/common/Store.d.ts +5 -5
- package/dist/types/common/proxyState.d.ts +3 -3
- package/dist/types/plugins/ControlsEventPlugin.d.ts +1 -1
- package/dist/types/plugins/ES6ModulePlugin.d.ts +4 -4
- package/dist/types/plugins/LifecycleEventPlugin.d.ts +1 -1
- package/dist/types/plugins/StylePlugin.d.ts +1 -1
- package/package.json +4 -4
|
@@ -57,101 +57,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
57
57
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
58
58
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
var f, y, t, g, _ = {
|
|
62
|
-
label: 0,
|
|
63
|
-
sent: function() {
|
|
64
|
-
if (t[0] & 1) throw t[1];
|
|
65
|
-
return t[1];
|
|
66
|
-
},
|
|
67
|
-
trys: [],
|
|
68
|
-
ops: []
|
|
69
|
-
};
|
|
70
|
-
return g = {
|
|
71
|
-
next: verb(0),
|
|
72
|
-
"throw": verb(1),
|
|
73
|
-
"return": verb(2)
|
|
74
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
75
|
-
return this;
|
|
76
|
-
}), g;
|
|
77
|
-
function verb(n) {
|
|
78
|
-
return function(v) {
|
|
79
|
-
return step([
|
|
80
|
-
n,
|
|
81
|
-
v
|
|
82
|
-
]);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function step(op) {
|
|
86
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
87
|
-
while(_)try {
|
|
88
|
-
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;
|
|
89
|
-
if (y = 0, t) op = [
|
|
90
|
-
op[0] & 2,
|
|
91
|
-
t.value
|
|
92
|
-
];
|
|
93
|
-
switch(op[0]){
|
|
94
|
-
case 0:
|
|
95
|
-
case 1:
|
|
96
|
-
t = op;
|
|
97
|
-
break;
|
|
98
|
-
case 4:
|
|
99
|
-
_.label++;
|
|
100
|
-
return {
|
|
101
|
-
value: op[1],
|
|
102
|
-
done: false
|
|
103
|
-
};
|
|
104
|
-
case 5:
|
|
105
|
-
_.label++;
|
|
106
|
-
y = op[1];
|
|
107
|
-
op = [
|
|
108
|
-
0
|
|
109
|
-
];
|
|
110
|
-
continue;
|
|
111
|
-
case 7:
|
|
112
|
-
op = _.ops.pop();
|
|
113
|
-
_.trys.pop();
|
|
114
|
-
continue;
|
|
115
|
-
default:
|
|
116
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
117
|
-
_ = 0;
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
121
|
-
_.label = op[1];
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
125
|
-
_.label = t[1];
|
|
126
|
-
t = op;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
if (t && _.label < t[2]) {
|
|
130
|
-
_.label = t[2];
|
|
131
|
-
_.ops.push(op);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
if (t[2]) _.ops.pop();
|
|
135
|
-
_.trys.pop();
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
op = body.call(thisArg, _);
|
|
139
|
-
} catch (e) {
|
|
140
|
-
op = [
|
|
141
|
-
6,
|
|
142
|
-
e
|
|
143
|
-
];
|
|
144
|
-
y = 0;
|
|
145
|
-
} finally{
|
|
146
|
-
f = t = 0;
|
|
147
|
-
}
|
|
148
|
-
if (op[0] & 5) throw op[1];
|
|
149
|
-
return {
|
|
150
|
-
value: op[0] ? op[1] : void 0,
|
|
151
|
-
done: true
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
};
|
|
60
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
155
61
|
import { error, logerror } from "@byteluck-fe/model-driven-shared";
|
|
156
62
|
export var ActionManager = /*#__PURE__*/ function() {
|
|
157
63
|
"use strict";
|
|
@@ -172,53 +78,44 @@ export var ActionManager = /*#__PURE__*/ function() {
|
|
|
172
78
|
args[_key - 2] = arguments[_key];
|
|
173
79
|
}
|
|
174
80
|
var _this = this;
|
|
175
|
-
return _asyncToGenerator(function() {
|
|
176
|
-
var action,
|
|
177
|
-
return
|
|
178
|
-
switch(
|
|
81
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
82
|
+
var action, _func, result;
|
|
83
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
84
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
179
85
|
case 0:
|
|
180
86
|
action = _this.actionMap.get(name);
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
];
|
|
87
|
+
if (action) {
|
|
88
|
+
_ctx.next = 3;
|
|
89
|
+
break;
|
|
185
90
|
}
|
|
186
|
-
|
|
187
|
-
case 1:
|
|
188
|
-
_state.trys.push([
|
|
189
|
-
1,
|
|
190
|
-
3,
|
|
191
|
-
,
|
|
192
|
-
4
|
|
193
|
-
]);
|
|
194
|
-
return [
|
|
195
|
-
4,
|
|
196
|
-
(_action_func = action.func).call.apply(_action_func, [
|
|
197
|
-
null,
|
|
198
|
-
context
|
|
199
|
-
].concat(_toConsumableArray(args)))
|
|
200
|
-
];
|
|
201
|
-
case 2:
|
|
202
|
-
result = _state.sent();
|
|
203
|
-
return [
|
|
204
|
-
2,
|
|
205
|
-
result
|
|
206
|
-
];
|
|
91
|
+
return _ctx.abrupt("return");
|
|
207
92
|
case 3:
|
|
208
|
-
|
|
93
|
+
_ctx.prev = 3;
|
|
94
|
+
;
|
|
95
|
+
_ctx.next = 7;
|
|
96
|
+
return (_func = action.func).call.apply(_func, [
|
|
97
|
+
null,
|
|
98
|
+
context
|
|
99
|
+
].concat(_toConsumableArray(args)));
|
|
100
|
+
case 7:
|
|
101
|
+
result = _ctx.sent;
|
|
102
|
+
return _ctx.abrupt("return", result);
|
|
103
|
+
case 11:
|
|
104
|
+
_ctx.prev = 11;
|
|
105
|
+
_ctx.t0 = _ctx["catch"](3);
|
|
209
106
|
// 执行的时候不使用throw error,而是使用console.error,避免阻塞内置代码的执行
|
|
210
|
-
logerror("".concat(action.id, " Exception during calling action: ").concat(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
];
|
|
215
|
-
case 4:
|
|
216
|
-
return [
|
|
217
|
-
2
|
|
218
|
-
];
|
|
107
|
+
logerror("".concat(action.id, " Exception during calling action: ").concat(_ctx.t0));
|
|
108
|
+
case 14:
|
|
109
|
+
case "end":
|
|
110
|
+
return _ctx.stop();
|
|
219
111
|
}
|
|
220
|
-
}
|
|
221
|
-
|
|
112
|
+
}, _callee, null, [
|
|
113
|
+
[
|
|
114
|
+
3,
|
|
115
|
+
11
|
|
116
|
+
]
|
|
117
|
+
]);
|
|
118
|
+
}))();
|
|
222
119
|
};
|
|
223
120
|
_proto.addAction = function addAction(name, func) {
|
|
224
121
|
if (this.actionMap.has(name)) {
|
|
@@ -32,101 +32,7 @@ function _classCallCheck(instance, Constructor) {
|
|
|
32
32
|
throw new TypeError("Cannot call a class as a function");
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
var f, y, t, g, _ = {
|
|
37
|
-
label: 0,
|
|
38
|
-
sent: function() {
|
|
39
|
-
if (t[0] & 1) throw t[1];
|
|
40
|
-
return t[1];
|
|
41
|
-
},
|
|
42
|
-
trys: [],
|
|
43
|
-
ops: []
|
|
44
|
-
};
|
|
45
|
-
return g = {
|
|
46
|
-
next: verb(0),
|
|
47
|
-
"throw": verb(1),
|
|
48
|
-
"return": verb(2)
|
|
49
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
50
|
-
return this;
|
|
51
|
-
}), g;
|
|
52
|
-
function verb(n) {
|
|
53
|
-
return function(v) {
|
|
54
|
-
return step([
|
|
55
|
-
n,
|
|
56
|
-
v
|
|
57
|
-
]);
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function step(op) {
|
|
61
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
62
|
-
while(_)try {
|
|
63
|
-
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;
|
|
64
|
-
if (y = 0, t) op = [
|
|
65
|
-
op[0] & 2,
|
|
66
|
-
t.value
|
|
67
|
-
];
|
|
68
|
-
switch(op[0]){
|
|
69
|
-
case 0:
|
|
70
|
-
case 1:
|
|
71
|
-
t = op;
|
|
72
|
-
break;
|
|
73
|
-
case 4:
|
|
74
|
-
_.label++;
|
|
75
|
-
return {
|
|
76
|
-
value: op[1],
|
|
77
|
-
done: false
|
|
78
|
-
};
|
|
79
|
-
case 5:
|
|
80
|
-
_.label++;
|
|
81
|
-
y = op[1];
|
|
82
|
-
op = [
|
|
83
|
-
0
|
|
84
|
-
];
|
|
85
|
-
continue;
|
|
86
|
-
case 7:
|
|
87
|
-
op = _.ops.pop();
|
|
88
|
-
_.trys.pop();
|
|
89
|
-
continue;
|
|
90
|
-
default:
|
|
91
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
92
|
-
_ = 0;
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
96
|
-
_.label = op[1];
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
100
|
-
_.label = t[1];
|
|
101
|
-
t = op;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
if (t && _.label < t[2]) {
|
|
105
|
-
_.label = t[2];
|
|
106
|
-
_.ops.push(op);
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
if (t[2]) _.ops.pop();
|
|
110
|
-
_.trys.pop();
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
op = body.call(thisArg, _);
|
|
114
|
-
} catch (e) {
|
|
115
|
-
op = [
|
|
116
|
-
6,
|
|
117
|
-
e
|
|
118
|
-
];
|
|
119
|
-
y = 0;
|
|
120
|
-
} finally{
|
|
121
|
-
f = t = 0;
|
|
122
|
-
}
|
|
123
|
-
if (op[0] & 5) throw op[1];
|
|
124
|
-
return {
|
|
125
|
-
value: op[0] ? op[1] : void 0,
|
|
126
|
-
done: true
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
};
|
|
35
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
130
36
|
import { JSONCopy, logerror } from "@byteluck-fe/model-driven-shared";
|
|
131
37
|
export var DataManager = /*#__PURE__*/ function() {
|
|
132
38
|
"use strict";
|
|
@@ -148,25 +54,24 @@ export var DataManager = /*#__PURE__*/ function() {
|
|
|
148
54
|
};
|
|
149
55
|
_proto.getRemoteData = function getRemoteData(payload) {
|
|
150
56
|
var _this = this;
|
|
151
|
-
return _asyncToGenerator(function() {
|
|
152
|
-
return
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
_this.executer(payload)
|
|
163
|
-
|
|
57
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
58
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
59
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
60
|
+
case 0:
|
|
61
|
+
if (!(_this.executer === undefined)) {
|
|
62
|
+
_ctx.next = 5;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
logerror("未初始化executer");
|
|
66
|
+
return _ctx.abrupt("return", []);
|
|
67
|
+
case 5:
|
|
68
|
+
return _ctx.abrupt("return", _this.executer(payload));
|
|
69
|
+
case 6:
|
|
70
|
+
case "end":
|
|
71
|
+
return _ctx.stop();
|
|
164
72
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
];
|
|
168
|
-
});
|
|
169
|
-
})();
|
|
73
|
+
}, _callee);
|
|
74
|
+
}))();
|
|
170
75
|
};
|
|
171
76
|
return DataManager;
|
|
172
77
|
}();
|