@eva/plugin-renderer-graphics 1.2.7-editor.9 → 1.2.7-fix.4

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.
@@ -1,7 +1,6 @@
1
1
  window.EVA = window.EVA || {};
2
2
  window.EVA.plugin = window.EVA.plugin || {};
3
3
  window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
4
-
5
4
  var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
6
5
  'use strict';
7
6
 
@@ -15,37 +14,30 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
15
14
  if (b.hasOwnProperty(p)) d[p] = b[p];
16
15
  }
17
16
  };
18
-
19
17
  return _extendStatics(d, b);
20
18
  };
21
-
22
19
  function __extends(d, b) {
23
20
  _extendStatics(d, b);
24
-
25
21
  function __() {
26
22
  this.constructor = d;
27
23
  }
28
-
29
24
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
25
  }
31
-
32
26
  function __decorate(decorators, target, key, desc) {
33
27
  var c = arguments.length,
34
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
35
- d;
28
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
29
+ d;
36
30
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
37
31
  if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
38
32
  }
39
33
  return c > 3 && r && Object.defineProperty(target, key, r), r;
40
34
  }
41
-
42
35
  function __awaiter(thisArg, _arguments, P, generator) {
43
36
  function adopt(value) {
44
37
  return value instanceof P ? value : new P(function (resolve) {
45
38
  resolve(value);
46
39
  });
47
40
  }
48
-
49
41
  return new (P || (P = Promise))(function (resolve, reject) {
50
42
  function fulfilled(value) {
51
43
  try {
@@ -54,7 +46,6 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
54
46
  reject(e);
55
47
  }
56
48
  }
57
-
58
49
  function rejected(value) {
59
50
  try {
60
51
  step(generator["throw"](value));
@@ -62,29 +53,26 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
62
53
  reject(e);
63
54
  }
64
55
  }
65
-
66
56
  function step(result) {
67
57
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
68
58
  }
69
-
70
59
  step((generator = generator.apply(thisArg, _arguments || [])).next());
71
60
  });
72
61
  }
73
-
74
62
  function __generator(thisArg, body) {
75
63
  var _ = {
76
- label: 0,
77
- sent: function sent() {
78
- if (t[0] & 1) throw t[1];
79
- return t[1];
64
+ label: 0,
65
+ sent: function sent() {
66
+ if (t[0] & 1) throw t[1];
67
+ return t[1];
68
+ },
69
+ trys: [],
70
+ ops: []
80
71
  },
81
- trys: [],
82
- ops: []
83
- },
84
- f,
85
- y,
86
- t,
87
- g;
72
+ f,
73
+ y,
74
+ t,
75
+ g;
88
76
  return g = {
89
77
  next: verb(0),
90
78
  "throw": verb(1),
@@ -92,79 +80,60 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
92
80
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
93
81
  return this;
94
82
  }), g;
95
-
96
83
  function verb(n) {
97
84
  return function (v) {
98
85
  return step([n, v]);
99
86
  };
100
87
  }
101
-
102
88
  function step(op) {
103
89
  if (f) throw new TypeError("Generator is already executing.");
104
-
105
90
  while (_) {
106
91
  try {
107
92
  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;
108
93
  if (y = 0, t) op = [op[0] & 2, t.value];
109
-
110
94
  switch (op[0]) {
111
95
  case 0:
112
96
  case 1:
113
97
  t = op;
114
98
  break;
115
-
116
99
  case 4:
117
100
  _.label++;
118
101
  return {
119
102
  value: op[1],
120
103
  done: false
121
104
  };
122
-
123
105
  case 5:
124
106
  _.label++;
125
107
  y = op[1];
126
108
  op = [0];
127
109
  continue;
128
-
129
110
  case 7:
130
111
  op = _.ops.pop();
131
-
132
112
  _.trys.pop();
133
-
134
113
  continue;
135
-
136
114
  default:
137
115
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
138
116
  _ = 0;
139
117
  continue;
140
118
  }
141
-
142
119
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
143
120
  _.label = op[1];
144
121
  break;
145
122
  }
146
-
147
123
  if (op[0] === 6 && _.label < t[1]) {
148
124
  _.label = t[1];
149
125
  t = op;
150
126
  break;
151
127
  }
152
-
153
128
  if (t && _.label < t[2]) {
154
129
  _.label = t[2];
155
-
156
130
  _.ops.push(op);
157
-
158
131
  break;
159
132
  }
160
-
161
133
  if (t[2]) _.ops.pop();
162
-
163
134
  _.trys.pop();
164
-
165
135
  continue;
166
136
  }
167
-
168
137
  op = body.call(thisArg, _);
169
138
  } catch (e) {
170
139
  op = [6, e];
@@ -173,7 +142,6 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
173
142
  f = t = 0;
174
143
  }
175
144
  }
176
-
177
145
  if (op[0] & 5) throw op[1];
178
146
  return {
179
147
  value: op[0] ? op[1] : void 0,
@@ -181,54 +149,39 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
181
149
  };
182
150
  }
183
151
  }
184
-
185
152
  var Graphics$4 = function (_super) {
186
153
  __extends(Graphics, _super);
187
-
188
154
  function Graphics() {
189
155
  return _super !== null && _super.apply(this, arguments) || this;
190
156
  }
191
-
192
157
  return Graphics;
193
158
  }(pixi_js.Graphics);
194
-
195
159
  var GraphicsEngine = Graphics$4;
196
-
197
160
  var Graphics$2 = function (_super) {
198
161
  __extends(Graphics, _super);
199
-
200
162
  function Graphics() {
201
163
  var _this = _super !== null && _super.apply(this, arguments) || this;
202
-
203
164
  _this.graphics = null;
204
165
  return _this;
205
166
  }
206
-
207
167
  Graphics.prototype.init = function () {
208
168
  this.graphics = new GraphicsEngine();
209
169
  };
210
-
211
170
  Graphics.componentName = 'Graphics';
212
171
  return Graphics;
213
172
  }(eva_js.Component);
214
-
215
173
  var Graphics$3 = Graphics$2;
216
-
217
174
  var Graphics = function (_super) {
218
175
  __extends(Graphics, _super);
219
-
220
176
  function Graphics() {
221
177
  var _this = _super !== null && _super.apply(this, arguments) || this;
222
-
223
178
  _this.name = 'Graphics';
224
179
  return _this;
225
180
  }
226
-
227
181
  Graphics.prototype.init = function () {
228
182
  this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
229
183
  this.renderSystem.rendererManager.register(this);
230
184
  };
231
-
232
185
  Graphics.prototype.componentChanged = function (changed) {
233
186
  return __awaiter(this, void 0, void 0, function () {
234
187
  return __generator(this, function (_a) {
@@ -240,19 +193,16 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
240
193
  children: true
241
194
  });
242
195
  }
243
-
244
196
  return [2];
245
197
  });
246
198
  });
247
199
  };
248
-
249
200
  Graphics.systemName = 'Graphics';
250
201
  Graphics = __decorate([eva_js.decorators.componentObserver({
251
202
  Graphics: ['graphics']
252
203
  })], Graphics);
253
204
  return Graphics;
254
205
  }(pluginRenderer.Renderer);
255
-
256
206
  var Graphics$1 = Graphics;
257
207
  exports.Graphics = Graphics$3;
258
208
  exports.GraphicsSystem = Graphics$1;
@@ -261,5 +211,4 @@ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
261
211
  });
262
212
  return exports;
263
213
  }({}, EVA, PIXI, EVA.plugin.renderer);
264
-
265
214
  window.EVA.plugin.renderer.graphics = window.EVA.plugin.renderer.graphics || _EVA_IIFE_graphics;
@@ -0,0 +1,52 @@
1
+ import { __extends, __awaiter, __generator, __decorate } from 'tslib';
2
+ import { Component, OBSERVER_TYPE, decorators } from '@eva/eva.js/dist/miniprogram';
3
+ import { Graphics as Graphics$4 } from '@eva/renderer-adapter/dist/miniprogram';
4
+ import { RendererSystem, Renderer } from '@eva/plugin-renderer/dist/miniprogram';
5
+ var Graphics$2 = function (_super) {
6
+ __extends(Graphics, _super);
7
+ function Graphics() {
8
+ var _this = _super !== null && _super.apply(this, arguments) || this;
9
+ _this.graphics = null;
10
+ return _this;
11
+ }
12
+ Graphics.prototype.init = function () {
13
+ this.graphics = new Graphics$4();
14
+ };
15
+ Graphics.componentName = 'Graphics';
16
+ return Graphics;
17
+ }(Component);
18
+ var Graphics$3 = Graphics$2;
19
+ var Graphics = function (_super) {
20
+ __extends(Graphics, _super);
21
+ function Graphics() {
22
+ var _this = _super !== null && _super.apply(this, arguments) || this;
23
+ _this.name = 'Graphics';
24
+ return _this;
25
+ }
26
+ Graphics.prototype.init = function () {
27
+ this.renderSystem = this.game.getSystem(RendererSystem);
28
+ this.renderSystem.rendererManager.register(this);
29
+ };
30
+ Graphics.prototype.componentChanged = function (changed) {
31
+ return __awaiter(this, void 0, void 0, function () {
32
+ return __generator(this, function (_a) {
33
+ if (changed.type === OBSERVER_TYPE.ADD) {
34
+ this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
35
+ } else if (changed.type === OBSERVER_TYPE.REMOVE) {
36
+ this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
37
+ changed.component.graphics.destroy({
38
+ children: true
39
+ });
40
+ }
41
+ return [2];
42
+ });
43
+ });
44
+ };
45
+ Graphics.systemName = 'Graphics';
46
+ Graphics = __decorate([decorators.componentObserver({
47
+ Graphics: ['graphics']
48
+ })], Graphics);
49
+ return Graphics;
50
+ }(Renderer);
51
+ var Graphics$1 = Graphics;
52
+ export { Graphics$3 as Graphics, Graphics$1 as GraphicsSystem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-graphics",
3
- "version": "1.2.7-editor.9",
3
+ "version": "1.2.7-fix.4",
4
4
  "description": "@eva/plugin-renderer-graphics",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-graphics.esm.js",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/plugin-renderer": "1.2.7-editor.9",
22
- "@eva/eva.js": "1.2.7-editor.9"
21
+ "@eva/plugin-renderer": "1.2.7-fix.4",
22
+ "@eva/eva.js": "1.2.7-fix.4"
23
23
  }
24
24
  }