@eva/plugin-renderer-graphics 1.2.2-alpha.0 → 1.2.2-mini.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.
@@ -1,8 +1,8 @@
1
- this.EVA = this.EVA || {};
2
- this.EVA.plugin = this.EVA.plugin || {};
3
- this.EVA.plugin.renderer = this.EVA.plugin.renderer || {};
1
+ window.EVA = window.EVA || {};
2
+ window.EVA.plugin = window.EVA.plugin || {};
3
+ window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
4
4
 
5
- this.EVA.plugin.renderer.graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
5
+ var _EVA_IIFE_graphics = function (exports, eva_js, pixi_js, pluginRenderer) {
6
6
  'use strict';
7
7
 
8
8
  var _extendStatics = function extendStatics(d, b) {
@@ -261,3 +261,5 @@ this.EVA.plugin.renderer.graphics = function (exports, eva_js, pixi_js, pluginRe
261
261
  });
262
262
  return exports;
263
263
  }({}, EVA, PIXI, EVA.plugin.renderer);
264
+
265
+ window.EVA.plugin.renderer.graphics = window.EVA.plugin.renderer.graphics || _EVA_IIFE_graphics;
@@ -1 +1 @@
1
- this.EVA=this.EVA||{},this.EVA.plugin=this.EVA.plugin||{},this.EVA.plugin.renderer=this.EVA.plugin.renderer||{},this.EVA.plugin.renderer.graphics=function(e,t,n,r){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function c(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n.Graphics),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.graphics=null,t}return i(t,e),t.prototype.init=function(){this.graphics=new u},t.componentName="Graphics",t}(t.Component),p=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Graphics",t}return i(n,e),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.componentChanged=function(e){return c(this,void 0,void 0,(function(){return a(this,(function(n){return e.type===t.OBSERVER_TYPE.ADD?this.containerManager.getContainer(e.gameObject.id).addChildAt(e.component.graphics,0):e.type===t.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(e.gameObject.id).removeChild(e.component.graphics),e.component.graphics.destroy({children:!0})),[2]}))}))},n.systemName="Graphics",n=function(e,t,n,r){var o,i=arguments.length,c=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,n,c):o(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}([t.decorators.componentObserver({Graphics:["graphics"]})],n)}(r.Renderer);return e.Graphics=s,e.GraphicsSystem=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,PIXI,EVA.plugin.renderer);
1
+ var _EVA_IIFE_graphics=function(e,t,n,r){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function c(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n.Graphics),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.graphics=null,t}return i(t,e),t.prototype.init=function(){this.graphics=new u},t.componentName="Graphics",t}(t.Component),p=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Graphics",t}return i(n,e),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.componentChanged=function(e){return c(this,void 0,void 0,(function(){return a(this,(function(n){return e.type===t.OBSERVER_TYPE.ADD?this.containerManager.getContainer(e.gameObject.id).addChildAt(e.component.graphics,0):e.type===t.OBSERVER_TYPE.REMOVE&&(this.containerManager.getContainer(e.gameObject.id).removeChild(e.component.graphics),e.component.graphics.destroy({children:!0})),[2]}))}))},n.systemName="Graphics",n=function(e,t,n,r){var o,i=arguments.length,c=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,n,c):o(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c}([t.decorators.componentObserver({Graphics:["graphics"]})],n)}(r.Renderer);return e.Graphics=s,e.GraphicsSystem=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,PIXI,EVA.plugin.renderer);
@@ -0,0 +1,66 @@
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
+
6
+ var Graphics$2 = function (_super) {
7
+ __extends(Graphics, _super);
8
+
9
+ function Graphics() {
10
+ var _this = _super !== null && _super.apply(this, arguments) || this;
11
+
12
+ _this.graphics = null;
13
+ return _this;
14
+ }
15
+
16
+ Graphics.prototype.init = function () {
17
+ this.graphics = new Graphics$4();
18
+ };
19
+
20
+ Graphics.componentName = 'Graphics';
21
+ return Graphics;
22
+ }(Component);
23
+
24
+ var Graphics$3 = Graphics$2;
25
+
26
+ var Graphics = function (_super) {
27
+ __extends(Graphics, _super);
28
+
29
+ function Graphics() {
30
+ var _this = _super !== null && _super.apply(this, arguments) || this;
31
+
32
+ _this.name = 'Graphics';
33
+ return _this;
34
+ }
35
+
36
+ Graphics.prototype.init = function () {
37
+ this.renderSystem = this.game.getSystem(RendererSystem);
38
+ this.renderSystem.rendererManager.register(this);
39
+ };
40
+
41
+ Graphics.prototype.componentChanged = function (changed) {
42
+ return __awaiter(this, void 0, void 0, function () {
43
+ return __generator(this, function (_a) {
44
+ if (changed.type === OBSERVER_TYPE.ADD) {
45
+ this.containerManager.getContainer(changed.gameObject.id).addChildAt(changed.component.graphics, 0);
46
+ } else if (changed.type === OBSERVER_TYPE.REMOVE) {
47
+ this.containerManager.getContainer(changed.gameObject.id).removeChild(changed.component.graphics);
48
+ changed.component.graphics.destroy({
49
+ children: true
50
+ });
51
+ }
52
+
53
+ return [2];
54
+ });
55
+ });
56
+ };
57
+
58
+ Graphics.systemName = 'Graphics';
59
+ Graphics = __decorate([decorators.componentObserver({
60
+ Graphics: ['graphics']
61
+ })], Graphics);
62
+ return Graphics;
63
+ }(Renderer);
64
+
65
+ var Graphics$1 = Graphics;
66
+ 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.2-alpha.0",
3
+ "version": "1.2.2-mini.3",
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.2-alpha.0",
22
- "@eva/eva.js": "1.2.2-alpha.0"
21
+ "@eva/plugin-renderer": "1.2.2-mini.3",
22
+ "@eva/eva.js": "1.2.2-mini.3"
23
23
  }
24
24
  }