@byteluck-fe/model-driven-engine 2.3.1-beta.2 → 2.3.1-beta.3

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.
Files changed (34) hide show
  1. package/dist/esm/common/ActionManager.js +136 -33
  2. package/dist/esm/common/DataManager.js +113 -18
  3. package/dist/esm/common/Engine.js +201 -102
  4. package/dist/esm/common/OkWorker.js +5 -5
  5. package/dist/esm/common/Store.js +10 -10
  6. package/dist/esm/common/checkerValue.js +2 -2
  7. package/dist/esm/common/proxyState.js +9 -9
  8. package/dist/esm/plugins/CalcPlugin.js +17 -17
  9. package/dist/esm/plugins/ControlsEventPlugin.js +175 -67
  10. package/dist/esm/plugins/ES6ModulePlugin.js +2 -2
  11. package/dist/esm/plugins/LifecycleEventPlugin.js +165 -61
  12. package/dist/esm/plugins/StylePlugin.js +3 -3
  13. package/dist/esm/utils/runtimeUtils.js +2 -4
  14. package/dist/index.umd.js +8 -8
  15. package/dist/types/common/ActionManager.d.ts +14 -14
  16. package/dist/types/common/DataManager.d.ts +10 -10
  17. package/dist/types/common/Engine.d.ts +180 -180
  18. package/dist/types/common/OkWorker.d.ts +13 -13
  19. package/dist/types/common/Plugin.d.ts +6 -6
  20. package/dist/types/common/Runtime.d.ts +25 -25
  21. package/dist/types/common/Store.d.ts +49 -49
  22. package/dist/types/common/checkerValue.d.ts +3 -3
  23. package/dist/types/common/index.d.ts +2 -2
  24. package/dist/types/common/proxyState.d.ts +30 -30
  25. package/dist/types/index.d.ts +3 -3
  26. package/dist/types/plugins/CalcPlugin.d.ts +121 -121
  27. package/dist/types/plugins/ControlsEventPlugin.d.ts +15 -15
  28. package/dist/types/plugins/ES6ModulePlugin.d.ts +26 -26
  29. package/dist/types/plugins/LifecycleEventPlugin.d.ts +14 -14
  30. package/dist/types/plugins/StylePlugin.d.ts +12 -12
  31. package/dist/types/plugins/index.d.ts +5 -5
  32. package/dist/types/utils/index.d.ts +1 -1
  33. package/dist/types/utils/runtimeUtils.d.ts +4 -4
  34. package/package.json +4 -4
@@ -57,7 +57,101 @@ 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
- import regeneratorRuntime from "regenerator-runtime";
60
+ var __generator = this && this.__generator || function(thisArg, body) {
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
+ };
61
155
  import { error, logerror } from "@byteluck-fe/model-driven-shared";
62
156
  export var ActionManager = /*#__PURE__*/ function() {
63
157
  "use strict";
@@ -78,44 +172,53 @@ export var ActionManager = /*#__PURE__*/ function() {
78
172
  args[_key - 2] = arguments[_key];
79
173
  }
80
174
  var _this = this;
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){
175
+ return _asyncToGenerator(function() {
176
+ var action, _action_func, result, e;
177
+ return __generator(this, function(_state) {
178
+ switch(_state.label){
85
179
  case 0:
86
180
  action = _this.actionMap.get(name);
87
- if (action) {
88
- _ctx.next = 3;
89
- break;
181
+ if (!action) {
182
+ return [
183
+ 2
184
+ ];
90
185
  }
91
- return _ctx.abrupt("return");
186
+ _state.label = 1;
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
+ ];
92
207
  case 3:
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);
208
+ e = _state.sent();
106
209
  // 执行的时候不使用throw error,而是使用console.error,避免阻塞内置代码的执行
107
- logerror("".concat(action.id, " Exception during calling action: ").concat(_ctx.t0));
108
- case 14:
109
- case "end":
110
- return _ctx.stop();
210
+ logerror("".concat(action.id, " Exception during calling action: ").concat(e));
211
+ return [
212
+ 3,
213
+ 4
214
+ ];
215
+ case 4:
216
+ return [
217
+ 2
218
+ ];
111
219
  }
112
- }, _callee, null, [
113
- [
114
- 3,
115
- 11
116
- ]
117
- ]);
118
- }))();
220
+ });
221
+ })();
119
222
  };
120
223
  _proto.addAction = function addAction(name, func) {
121
224
  if (this.actionMap.has(name)) {
@@ -32,7 +32,101 @@ function _classCallCheck(instance, Constructor) {
32
32
  throw new TypeError("Cannot call a class as a function");
33
33
  }
34
34
  }
35
- import regeneratorRuntime from "regenerator-runtime";
35
+ var __generator = this && this.__generator || function(thisArg, body) {
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
+ };
36
130
  import { JSONCopy, logerror } from "@byteluck-fe/model-driven-shared";
37
131
  export var DataManager = /*#__PURE__*/ function() {
38
132
  "use strict";
@@ -54,24 +148,25 @@ export var DataManager = /*#__PURE__*/ function() {
54
148
  };
55
149
  _proto.getRemoteData = function getRemoteData(payload) {
56
150
  var _this = this;
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();
151
+ return _asyncToGenerator(function() {
152
+ return __generator(this, function(_state) {
153
+ if (_this.executer === undefined) {
154
+ logerror("未初始化executer");
155
+ return [
156
+ 2,
157
+ []
158
+ ];
159
+ } else {
160
+ return [
161
+ 2,
162
+ _this.executer(payload)
163
+ ];
72
164
  }
73
- }, _callee);
74
- }))();
165
+ return [
166
+ 2
167
+ ];
168
+ });
169
+ })();
75
170
  };
76
171
  return DataManager;
77
172
  }();