@eva/plugin-renderer-text 1.2.7-editor.10 → 1.2.7-editor.11

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.
@@ -317,23 +317,21 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
317
317
  ExecuteMode[ExecuteMode["All"] = 6] = "All";
318
318
  })(ExecuteMode || (ExecuteMode = {}));
319
319
 
320
- var Color = function () {
321
- function Color() {}
322
-
323
- Color.getProperties = function () {
324
- return 'color';
325
- };
326
-
327
- return Color;
328
- }();
329
-
330
320
  var Style = function () {
331
321
  function Style() {}
332
322
 
333
323
  __decorate([Field({
334
- type: 'selector',
335
- isArray: false,
336
- options: ['center', 'left', 'right'],
324
+ type: 'select',
325
+ options: [{
326
+ key: 'center',
327
+ value: 'center'
328
+ }, {
329
+ key: 'left',
330
+ value: 'left'
331
+ }, {
332
+ key: 'right',
333
+ value: 'right'
334
+ }],
337
335
  default: 'left'
338
336
  }), __metadata("design:type", String)], Style.prototype, "align", void 0);
339
337
 
@@ -353,9 +351,8 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
353
351
  default: 0
354
352
  }), __metadata("design:type", Number)], Style.prototype, "dropShadowBlur", void 0);
355
353
 
356
- __decorate([Field(function () {
357
- return Color;
358
- }, {
354
+ __decorate([Field({
355
+ type: 'color',
359
356
  default: '#000000'
360
357
  }), __metadata("design:type", Object)], Style.prototype, "dropShadowColor", void 0);
361
358
 
@@ -363,23 +360,22 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
363
360
  default: 5
364
361
  }), __metadata("design:type", Number)], Style.prototype, "dropShadowDistance", void 0);
365
362
 
366
- __decorate([Field(function () {
367
- return [Color];
368
- }, {
369
- default: ['#000000']
363
+ __decorate([Field({
364
+ type: 'color',
365
+ default: ['#000000'],
366
+ isArray: true
370
367
  }), __metadata("design:type", Object)], Style.prototype, "fill", void 0);
371
368
 
372
369
  __decorate([Field({
373
- type: 'selector',
374
- options: {
375
- vertical: 1,
376
- horizontal: 0
377
- },
378
- default: 1,
379
- filter: function filter(val) {
380
- return Number(val);
381
- },
382
- isArray: false
370
+ type: 'select',
371
+ options: [{
372
+ key: 1,
373
+ value: 'vertical'
374
+ }, {
375
+ key: 0,
376
+ value: 'horizontal'
377
+ }],
378
+ default: 1
383
379
  }), __metadata("design:type", Number)], Style.prototype, "fillGradientType", void 0);
384
380
 
385
381
  __decorate([Field(function () {
@@ -404,20 +400,74 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
404
400
  }), __metadata("design:type", Object)], Style.prototype, "fontSize", void 0);
405
401
 
406
402
  __decorate([Field({
407
- type: 'selector',
408
- options: ['normal', 'italic', 'oblique'],
403
+ type: 'select',
404
+ options: [{
405
+ key: 'normal',
406
+ value: 'normal'
407
+ }, {
408
+ key: 'italic',
409
+ value: 'italic'
410
+ }, {
411
+ key: 'oblique',
412
+ value: 'oblique'
413
+ }],
409
414
  default: 'normal'
410
415
  }), __metadata("design:type", String)], Style.prototype, "fontStyle", void 0);
411
416
 
412
417
  __decorate([Field({
413
- type: 'selector',
414
- options: ['normal', 'small-caps'],
418
+ type: 'select',
419
+ options: [{
420
+ key: 'normal',
421
+ value: 'normal'
422
+ }, {
423
+ key: 'small-caps',
424
+ value: 'small-caps'
425
+ }],
415
426
  default: 'normal'
416
427
  }), __metadata("design:type", String)], Style.prototype, "fontVariant", void 0);
417
428
 
418
429
  __decorate([Field({
419
- type: 'selector',
420
- options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
430
+ type: 'select',
431
+ options: [{
432
+ key: 'normal',
433
+ value: 'normal'
434
+ }, {
435
+ key: 'bold',
436
+ value: 'bold'
437
+ }, {
438
+ key: 'bolder',
439
+ value: 'bolder'
440
+ }, {
441
+ key: 'lighter',
442
+ value: 'lighter'
443
+ }, {
444
+ key: '100',
445
+ value: '100'
446
+ }, {
447
+ key: '200',
448
+ value: '200'
449
+ }, {
450
+ key: '300',
451
+ value: '300'
452
+ }, {
453
+ key: '400',
454
+ value: '400'
455
+ }, {
456
+ key: '500',
457
+ value: '500'
458
+ }, {
459
+ key: '600',
460
+ value: '600'
461
+ }, {
462
+ key: '700',
463
+ value: '700'
464
+ }, {
465
+ key: '800',
466
+ value: '800'
467
+ }, {
468
+ key: '900',
469
+ value: '900'
470
+ }],
421
471
  default: 'normal'
422
472
  }), __metadata("design:type", String)], Style.prototype, "fontWeight", void 0);
423
473
 
@@ -430,8 +480,17 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
430
480
  }), __metadata("design:type", Number)], Style.prototype, "lineHeight", void 0);
431
481
 
432
482
  __decorate([Field({
433
- type: 'selector',
434
- options: ['miter', 'round', 'bevel'],
483
+ type: 'select',
484
+ options: [{
485
+ key: 'miter',
486
+ value: 'miter'
487
+ }, {
488
+ key: 'round',
489
+ value: 'round'
490
+ }, {
491
+ key: 'bevel',
492
+ value: 'bevel'
493
+ }],
435
494
  default: 'miter'
436
495
  }), __metadata("design:type", String)], Style.prototype, "lineJoin", void 0);
437
496
 
@@ -443,9 +502,8 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
443
502
  default: 0
444
503
  }), __metadata("design:type", Number)], Style.prototype, "padding", void 0);
445
504
 
446
- __decorate([Field(function () {
447
- return Color;
448
- }, {
505
+ __decorate([Field({
506
+ type: 'color',
449
507
  default: '#000000'
450
508
  }), __metadata("design:type", Object)], Style.prototype, "stroke", void 0);
451
509
 
@@ -462,8 +520,17 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
462
520
 
463
521
  __decorate([Field({
464
522
  default: 'pre',
465
- type: 'selector',
466
- options: ['normal', 'pre', 'pre-line']
523
+ type: 'select',
524
+ options: [{
525
+ key: 'normal',
526
+ value: 'normal'
527
+ }, {
528
+ key: 'pre',
529
+ value: 'pre'
530
+ }, {
531
+ key: 'pre-line',
532
+ value: 'pre-line'
533
+ }]
467
534
  }), __metadata("design:type", String)], Style.prototype, "whiteSpace", void 0);
468
535
 
469
536
  __decorate([Field(), __metadata("design:type", Boolean)], Style.prototype, "wordWrap", void 0);
@@ -511,20 +578,7 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
511
578
 
512
579
  Text.componentName = 'Text';
513
580
 
514
- __decorate([Field({
515
- type: 'textarea',
516
- filter: function filter(text) {
517
- if (typeof text !== 'string') {
518
- return '';
519
- }
520
-
521
- if (text.length > 100) {
522
- return text.slice(0, 100);
523
- }
524
-
525
- return text;
526
- }
527
- }), __metadata("design:type", String)], Text.prototype, "text", void 0);
581
+ __decorate([Field(), __metadata("design:type", String)], Text.prototype, "text", void 0);
528
582
 
529
583
  __decorate([Field(), __metadata("design:type", Style)], Text.prototype, "style", void 0);
530
584
 
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends.apply(this,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_text=function(t,e,n,o,r){"use strict";var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},a.apply(this,arguments)};function s(t,e,n,o){var r,i=arguments.length,p=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(p=(i<3?r(p):i>3?r(e,n,p):r(e,n))||p);return i>3&&p&&Object.defineProperty(e,n,p),p}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,o){return new(n||(n=Promise))((function(r,i){function p(t){try{s(o.next(t))}catch(t){i(t)}}function a(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(p,a)}s((o=o.apply(t,e||[])).next())}))}function c(t,e){var n,o,r,i,p={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(;p;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return p.label++,{value:i[1],done:!1};case 5:p.label++,o=i[1],i=[0];continue;case 7:i=p.ops.pop(),p.trys.pop();continue;default:if(!(r=p.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){p=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){p.label=i[1];break}if(6===i[0]&&p.label<r[1]){p.label=r[1],r=i;break}if(r&&p.label<r[2]){p.label=r[2],p.ops.push(i);break}r[2]&&p.ops.pop(),p.trys.pop();continue}i=e.call(t,p)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var d=function(t){function e(){var e=this.constructor,n=t.call(this,"Symbol keys are not supported yet!")||this;return Object.setPrototypeOf(n,e.prototype),n}return p(e,t),e}(Error);!function(t){function e(){var e=this.constructor,n=t.call(this,"getProperties is not a function!")||this;return Object.setPrototypeOf(n,e.prototype),n}p(e,t)}(Error);var y,f="IDE_PROPERTY_METADATA";function g(t,e,n,o){var r=Reflect.getMetadata("design:type",t,e),i=r===Array,p=function(t){return t===String?"string":t===Number?"number":t===Boolean?"boolean":"unknown"}(r);if("unknown"!==p&&(r=p),o){var s=o();Array.isArray(s)?(i=!0,r=s[0]):r=s}var u=Reflect.getMetadata(f,t.constructor)||{};u[e]=a({type:r,isArray:i},n),Reflect.defineMetadata(f,u,t.constructor)}function h(t,e){return function(n,o){if("symbol"==typeof o)throw new d;var r=function(t,e){return"function"==typeof t?{returnTypeFunc:t,options:e||{}}:{options:t||{}}}(t,e);g(n,o,r.options,r.returnTypeFunc)}}!function(t){t[t.Edit=2]="Edit",t[t.Game=4]="Game",t[t.All=6]="All"}(y||(y={}));var m=function(){function t(){}return t.getProperties=function(){return"color"},t}(),v=function(){function t(){}return s([h({type:"selector",isArray:!1,options:["center","left","right"],default:"left"}),u("design:type",String)],t.prototype,"align",void 0),s([h(),u("design:type",Boolean)],t.prototype,"breakWords",void 0),s([h(),u("design:type",Boolean)],t.prototype,"dropShadow",void 0),s([h({default:1}),u("design:type",Number)],t.prototype,"dropShadowAlpha",void 0),s([h({default:Math.PI/6}),u("design:type",Number)],t.prototype,"dropShadowAngle",void 0),s([h({default:0}),u("design:type",Number)],t.prototype,"dropShadowBlur",void 0),s([h((function(){return m}),{default:"#000000"}),u("design:type",Object)],t.prototype,"dropShadowColor",void 0),s([h({default:5}),u("design:type",Number)],t.prototype,"dropShadowDistance",void 0),s([h((function(){return[m]}),{default:["#000000"]}),u("design:type",Object)],t.prototype,"fill",void 0),s([h({type:"selector",options:{vertical:1,horizontal:0},default:1,filter:function(t){return Number(t)},isArray:!1}),u("design:type",Number)],t.prototype,"fillGradientType",void 0),s([h((function(){return Number}),{step:.1,min:0,max:1}),u("design:type",Array)],t.prototype,"fillGradientStops",void 0),s([h((function(){return String}),{default:"Arial"}),u("design:type",Object)],t.prototype,"fontFamily",void 0),s([h((function(){return Number}),{min:5,default:26}),u("design:type",Object)],t.prototype,"fontSize",void 0),s([h({type:"selector",options:["normal","italic","oblique"],default:"normal"}),u("design:type",String)],t.prototype,"fontStyle",void 0),s([h({type:"selector",options:["normal","small-caps"],default:"normal"}),u("design:type",String)],t.prototype,"fontVariant",void 0),s([h({type:"selector",options:["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],default:"normal"}),u("design:type",String)],t.prototype,"fontWeight",void 0),s([h({default:0}),u("design:type",Number)],t.prototype,"letterSpacing",void 0),s([h({default:0}),u("design:type",Number)],t.prototype,"lineHeight",void 0),s([h({type:"selector",options:["miter","round","bevel"],default:"miter"}),u("design:type",String)],t.prototype,"lineJoin",void 0),s([h({default:10}),u("design:type",Number)],t.prototype,"miterLimit",void 0),s([h({default:0}),u("design:type",Number)],t.prototype,"padding",void 0),s([h((function(){return m}),{default:"#000000"}),u("design:type",Object)],t.prototype,"stroke",void 0),s([h({default:0,min:0}),u("design:type",Number)],t.prototype,"strokeThickness",void 0),s([h({default:"alphabetic"}),u("design:type",String)],t.prototype,"textBaseline",void 0),s([h(),u("design:type",Boolean)],t.prototype,"trim",void 0),s([h({default:"pre",type:"selector",options:["normal","pre","pre-line"]}),u("design:type",String)],t.prototype,"whiteSpace",void 0),s([h(),u("design:type",Boolean)],t.prototype,"wordWrap",void 0),s([h({default:100}),u("design:type",Number)],t.prototype,"wordWrapWidth",void 0),s([h(),u("design:type",Number)],t.prototype,"leading",void 0),t}(),b=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.text="",e.style={},e}return p(n,t),n.prototype.init=function(t){var n=new e.TextStyle({fontSize:20}),o={};for(var r in n)0===r.indexOf("_")&&(o[r.substring(1)]=n[r]);this.style=o,t&&(this.text=t.text,_extends(this.style,t.style))},n.componentName="Text",s([h({type:"textarea",filter:function(t){return"string"!=typeof t?"":t.length>100?t.slice(0,100):t}}),u("design:type",String)],n.prototype,"text",void 0),s([h(),u("design:type",v)],n.prototype,"style",void 0),n}(n.Component),x=b,w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Text",e.texts={},e}return p(e,t),e.prototype.init=function(){this.renderSystem=this.game.getSystem(o.RendererSystem),this.renderSystem.rendererManager.register(this)},e.prototype.componentChanged=function(t){return l(this,void 0,void 0,(function(){var e,o;return c(this,(function(i){return"Text"!==t.componentName||(t.type===n.OBSERVER_TYPE.ADD?(e=t.component,o=new r.Text(e.text,e.style),this.containerManager.getContainer(t.gameObject.id).addChildAt(o,0),this.texts[t.gameObject.id]={text:o,component:t.component},this.setSize(t)):t.type===n.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(t.gameObject.id).removeChild(this.texts[t.gameObject.id].text),this.texts[t.gameObject.id].text.destroy({children:!0}),delete this.texts[t.gameObject.id]):(this.change(t),this.setSize(t))),[2]}))}))},e.prototype.change=function(t){var e=this.texts[t.gameObject.id],n=e.text,o=e.component;"text"===t.prop.prop[0]?n.text=o.text:"style"===t.prop.prop[0]&&_extends(n.style,t.component.style)},e.prototype.setSize=function(t){var e=t.gameObject.transform;e&&(e.size.width=this.texts[t.gameObject.id].text.width,e.size.height=this.texts[t.gameObject.id].text.height)},e.systemName="Text",e=s([n.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],e)}(o.Renderer),O=w;return t.Text=x,t.TextSystem=O,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,EVA,EVA.plugin.renderer,EVA.rendererAdapter);window.EVA.plugin.renderer.text=window.EVA.plugin.renderer.text||_EVA_IIFE_text;
1
+ function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends.apply(this,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_text=function(e,t,n,o,r){"use strict";var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var p=function(){return p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},p.apply(this,arguments)};function l(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var p=e.length-1;p>=0;p--)(r=e[p])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function p(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,p)}l((o=o.apply(e,t||[])).next())}))}function y(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:p(0),throw:p(1),return:p(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function p(i){return function(p){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,p])}}}var d=function(e){function t(){var t=this.constructor,n=e.call(this,"Symbol keys are not supported yet!")||this;return Object.setPrototypeOf(n,t.prototype),n}return a(t,e),t}(Error);!function(e){function t(){var t=this.constructor,n=e.call(this,"getProperties is not a function!")||this;return Object.setPrototypeOf(n,t.prototype),n}a(t,e)}(Error);var c,f="IDE_PROPERTY_METADATA";function v(e,t,n,o){var r=Reflect.getMetadata("design:type",e,t),i=r===Array,a=function(e){return e===String?"string":e===Number?"number":e===Boolean?"boolean":"unknown"}(r);if("unknown"!==a&&(r=a),o){var l=o();Array.isArray(l)?(i=!0,r=l[0]):r=l}var u=Reflect.getMetadata(f,e.constructor)||{};u[t]=p({type:r,isArray:i},n),Reflect.defineMetadata(f,u,e.constructor)}function g(e,t){return function(n,o){if("symbol"==typeof o)throw new d;var r=function(e,t){return"function"==typeof e?{returnTypeFunc:e,options:t||{}}:{options:e||{}}}(e,t);v(n,o,r.options,r.returnTypeFunc)}}!function(e){e[e.Edit=2]="Edit",e[e.Game=4]="Game",e[e.All=6]="All"}(c||(c={}));var h=function(){function e(){}return l([g({type:"select",options:[{key:"center",value:"center"},{key:"left",value:"left"},{key:"right",value:"right"}],default:"left"}),u("design:type",String)],e.prototype,"align",void 0),l([g(),u("design:type",Boolean)],e.prototype,"breakWords",void 0),l([g(),u("design:type",Boolean)],e.prototype,"dropShadow",void 0),l([g({default:1}),u("design:type",Number)],e.prototype,"dropShadowAlpha",void 0),l([g({default:Math.PI/6}),u("design:type",Number)],e.prototype,"dropShadowAngle",void 0),l([g({default:0}),u("design:type",Number)],e.prototype,"dropShadowBlur",void 0),l([g({type:"color",default:"#000000"}),u("design:type",Object)],e.prototype,"dropShadowColor",void 0),l([g({default:5}),u("design:type",Number)],e.prototype,"dropShadowDistance",void 0),l([g({type:"color",default:["#000000"],isArray:!0}),u("design:type",Object)],e.prototype,"fill",void 0),l([g({type:"select",options:[{key:1,value:"vertical"},{key:0,value:"horizontal"}],default:1}),u("design:type",Number)],e.prototype,"fillGradientType",void 0),l([g((function(){return Number}),{step:.1,min:0,max:1}),u("design:type",Array)],e.prototype,"fillGradientStops",void 0),l([g((function(){return String}),{default:"Arial"}),u("design:type",Object)],e.prototype,"fontFamily",void 0),l([g((function(){return Number}),{min:5,default:26}),u("design:type",Object)],e.prototype,"fontSize",void 0),l([g({type:"select",options:[{key:"normal",value:"normal"},{key:"italic",value:"italic"},{key:"oblique",value:"oblique"}],default:"normal"}),u("design:type",String)],e.prototype,"fontStyle",void 0),l([g({type:"select",options:[{key:"normal",value:"normal"},{key:"small-caps",value:"small-caps"}],default:"normal"}),u("design:type",String)],e.prototype,"fontVariant",void 0),l([g({type:"select",options:[{key:"normal",value:"normal"},{key:"bold",value:"bold"},{key:"bolder",value:"bolder"},{key:"lighter",value:"lighter"},{key:"100",value:"100"},{key:"200",value:"200"},{key:"300",value:"300"},{key:"400",value:"400"},{key:"500",value:"500"},{key:"600",value:"600"},{key:"700",value:"700"},{key:"800",value:"800"},{key:"900",value:"900"}],default:"normal"}),u("design:type",String)],e.prototype,"fontWeight",void 0),l([g({default:0}),u("design:type",Number)],e.prototype,"letterSpacing",void 0),l([g({default:0}),u("design:type",Number)],e.prototype,"lineHeight",void 0),l([g({type:"select",options:[{key:"miter",value:"miter"},{key:"round",value:"round"},{key:"bevel",value:"bevel"}],default:"miter"}),u("design:type",String)],e.prototype,"lineJoin",void 0),l([g({default:10}),u("design:type",Number)],e.prototype,"miterLimit",void 0),l([g({default:0}),u("design:type",Number)],e.prototype,"padding",void 0),l([g({type:"color",default:"#000000"}),u("design:type",Object)],e.prototype,"stroke",void 0),l([g({default:0,min:0}),u("design:type",Number)],e.prototype,"strokeThickness",void 0),l([g({default:"alphabetic"}),u("design:type",String)],e.prototype,"textBaseline",void 0),l([g(),u("design:type",Boolean)],e.prototype,"trim",void 0),l([g({default:"pre",type:"select",options:[{key:"normal",value:"normal"},{key:"pre",value:"pre"},{key:"pre-line",value:"pre-line"}]}),u("design:type",String)],e.prototype,"whiteSpace",void 0),l([g(),u("design:type",Boolean)],e.prototype,"wordWrap",void 0),l([g({default:100}),u("design:type",Number)],e.prototype,"wordWrapWidth",void 0),l([g(),u("design:type",Number)],e.prototype,"leading",void 0),e}(),m=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.text="",t.style={},t}return a(n,e),n.prototype.init=function(e){var n=new t.TextStyle({fontSize:20}),o={};for(var r in n)0===r.indexOf("_")&&(o[r.substring(1)]=n[r]);this.style=o,e&&(this.text=e.text,_extends(this.style,e.style))},n.componentName="Text",l([g(),u("design:type",String)],n.prototype,"text",void 0),l([g(),u("design:type",h)],n.prototype,"style",void 0),n}(n.Component),b=m,w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Text",t.texts={},t}return a(t,e),t.prototype.init=function(){this.renderSystem=this.game.getSystem(o.RendererSystem),this.renderSystem.rendererManager.register(this)},t.prototype.componentChanged=function(e){return s(this,void 0,void 0,(function(){var t,o;return y(this,(function(i){return"Text"!==e.componentName||(e.type===n.OBSERVER_TYPE.ADD?(t=e.component,o=new r.Text(t.text,t.style),this.containerManager.getContainer(e.gameObject.id).addChildAt(o,0),this.texts[e.gameObject.id]={text:o,component:e.component},this.setSize(e)):e.type===n.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(e.gameObject.id).removeChild(this.texts[e.gameObject.id].text),this.texts[e.gameObject.id].text.destroy({children:!0}),delete this.texts[e.gameObject.id]):(this.change(e),this.setSize(e))),[2]}))}))},t.prototype.change=function(e){var t=this.texts[e.gameObject.id],n=t.text,o=t.component;"text"===e.prop.prop[0]?n.text=o.text:"style"===e.prop.prop[0]&&_extends(n.style,e.component.style)},t.prototype.setSize=function(e){var t=e.gameObject.transform;t&&(t.size.width=this.texts[e.gameObject.id].text.width,t.size.height=this.texts[e.gameObject.id].text.height)},t.systemName="Text",t=l([n.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],t)}(o.Renderer),x=w;return e.Text=b,e.TextSystem=x,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,EVA,EVA.plugin.renderer,EVA.rendererAdapter);window.EVA.plugin.renderer.text=window.EVA.plugin.renderer.text||_EVA_IIFE_text;
@@ -85,22 +85,17 @@ function __generator(thisArg, body) {
85
85
  }
86
86
  }
87
87
 
88
- var Color = (function () {
89
- function Color() {
90
- }
91
- Color.getProperties = function () {
92
- return 'color';
93
- };
94
- return Color;
95
- }());
96
88
  var Style = (function () {
97
89
  function Style() {
98
90
  }
99
91
  __decorate([
100
92
  inspectorDecorator.Field({
101
- type: 'selector',
102
- isArray: false,
103
- options: ['center', 'left', 'right'],
93
+ type: 'select',
94
+ options: [
95
+ { key: 'center', value: 'center' },
96
+ { key: 'left', value: 'left' },
97
+ { key: 'right', value: 'right' },
98
+ ],
104
99
  default: 'left',
105
100
  }),
106
101
  __metadata("design:type", String)
@@ -126,7 +121,7 @@ var Style = (function () {
126
121
  __metadata("design:type", Number)
127
122
  ], Style.prototype, "dropShadowBlur", void 0);
128
123
  __decorate([
129
- inspectorDecorator.Field(function () { return Color; }, { default: '#000000' }),
124
+ inspectorDecorator.Field({ type: 'color', default: '#000000' }),
130
125
  __metadata("design:type", Object)
131
126
  ], Style.prototype, "dropShadowColor", void 0);
132
127
  __decorate([
@@ -134,16 +129,17 @@ var Style = (function () {
134
129
  __metadata("design:type", Number)
135
130
  ], Style.prototype, "dropShadowDistance", void 0);
136
131
  __decorate([
137
- inspectorDecorator.Field(function () { return [Color]; }, { default: ['#000000'] }),
132
+ inspectorDecorator.Field({ type: 'color', default: ['#000000'], isArray: true }),
138
133
  __metadata("design:type", Object)
139
134
  ], Style.prototype, "fill", void 0);
140
135
  __decorate([
141
136
  inspectorDecorator.Field({
142
- type: 'selector',
143
- options: { vertical: 1, horizontal: 0 },
137
+ type: 'select',
138
+ options: [
139
+ { key: 1, value: 'vertical' },
140
+ { key: 0, value: 'horizontal' },
141
+ ],
144
142
  default: 1,
145
- filter: function (val) { return Number(val); },
146
- isArray: false,
147
143
  }),
148
144
  __metadata("design:type", Number)
149
145
  ], Style.prototype, "fillGradientType", void 0);
@@ -160,17 +156,46 @@ var Style = (function () {
160
156
  __metadata("design:type", Object)
161
157
  ], Style.prototype, "fontSize", void 0);
162
158
  __decorate([
163
- inspectorDecorator.Field({ type: 'selector', options: ['normal', 'italic', 'oblique'], default: 'normal' }),
159
+ inspectorDecorator.Field({
160
+ type: 'select',
161
+ options: [
162
+ { key: 'normal', value: 'normal' },
163
+ { key: 'italic', value: 'italic' },
164
+ { key: 'oblique', value: 'oblique' },
165
+ ],
166
+ default: 'normal',
167
+ }),
164
168
  __metadata("design:type", String)
165
169
  ], Style.prototype, "fontStyle", void 0);
166
170
  __decorate([
167
- inspectorDecorator.Field({ type: 'selector', options: ['normal', 'small-caps'], default: 'normal' }),
171
+ inspectorDecorator.Field({
172
+ type: 'select',
173
+ options: [
174
+ { key: 'normal', value: 'normal' },
175
+ { key: 'small-caps', value: 'small-caps' },
176
+ ],
177
+ default: 'normal',
178
+ }),
168
179
  __metadata("design:type", String)
169
180
  ], Style.prototype, "fontVariant", void 0);
170
181
  __decorate([
171
182
  inspectorDecorator.Field({
172
- type: 'selector',
173
- options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
183
+ type: 'select',
184
+ options: [
185
+ { key: 'normal', value: 'normal' },
186
+ { key: 'bold', value: 'bold' },
187
+ { key: 'bolder', value: 'bolder' },
188
+ { key: 'lighter', value: 'lighter' },
189
+ { key: '100', value: '100' },
190
+ { key: '200', value: '200' },
191
+ { key: '300', value: '300' },
192
+ { key: '400', value: '400' },
193
+ { key: '500', value: '500' },
194
+ { key: '600', value: '600' },
195
+ { key: '700', value: '700' },
196
+ { key: '800', value: '800' },
197
+ { key: '900', value: '900' },
198
+ ],
174
199
  default: 'normal',
175
200
  }),
176
201
  __metadata("design:type", String)
@@ -184,7 +209,15 @@ var Style = (function () {
184
209
  __metadata("design:type", Number)
185
210
  ], Style.prototype, "lineHeight", void 0);
186
211
  __decorate([
187
- inspectorDecorator.Field({ type: 'selector', options: ['miter', 'round', 'bevel'], default: 'miter' }),
212
+ inspectorDecorator.Field({
213
+ type: 'select',
214
+ options: [
215
+ { key: 'miter', value: 'miter' },
216
+ { key: 'round', value: 'round' },
217
+ { key: 'bevel', value: 'bevel' },
218
+ ],
219
+ default: 'miter',
220
+ }),
188
221
  __metadata("design:type", String)
189
222
  ], Style.prototype, "lineJoin", void 0);
190
223
  __decorate([
@@ -196,7 +229,7 @@ var Style = (function () {
196
229
  __metadata("design:type", Number)
197
230
  ], Style.prototype, "padding", void 0);
198
231
  __decorate([
199
- inspectorDecorator.Field(function () { return Color; }, { default: '#000000' }),
232
+ inspectorDecorator.Field({ type: 'color', default: '#000000' }),
200
233
  __metadata("design:type", Object)
201
234
  ], Style.prototype, "stroke", void 0);
202
235
  __decorate([
@@ -212,7 +245,15 @@ var Style = (function () {
212
245
  __metadata("design:type", Boolean)
213
246
  ], Style.prototype, "trim", void 0);
214
247
  __decorate([
215
- inspectorDecorator.Field({ default: 'pre', type: 'selector', options: ['normal', 'pre', 'pre-line'] }),
248
+ inspectorDecorator.Field({
249
+ default: 'pre',
250
+ type: 'select',
251
+ options: [
252
+ { key: 'normal', value: 'normal' },
253
+ { key: 'pre', value: 'pre' },
254
+ { key: 'pre-line', value: 'pre-line' },
255
+ ],
256
+ }),
216
257
  __metadata("design:type", String)
217
258
  ], Style.prototype, "whiteSpace", void 0);
218
259
  __decorate([
@@ -255,18 +296,7 @@ var Text$2 = (function (_super) {
255
296
  };
256
297
  Text.componentName = 'Text';
257
298
  __decorate([
258
- inspectorDecorator.Field({
259
- type: 'textarea',
260
- filter: function (text) {
261
- if (typeof text !== 'string') {
262
- return '';
263
- }
264
- if (text.length > 100) {
265
- return text.slice(0, 100);
266
- }
267
- return text;
268
- },
269
- }),
299
+ inspectorDecorator.Field(),
270
300
  __metadata("design:type", String)
271
301
  ], Text.prototype, "text", void 0);
272
302
  __decorate([
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("pixi.js"),t=require("@eva/eva.js"),o=require("@eva/inspector-decorator"),r=require("@eva/plugin-renderer"),n=require("@eva/renderer-adapter"),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},i(e,t)};function p(e,t){function o(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function d(e,t,o,r){var n,i=arguments.length,p=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,r);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(p=(i<3?n(p):i>3?n(t,o,p):n(t,o))||p);return i>3&&p&&Object.defineProperty(t,o,p),p}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function a(e,t){var o,r,n,i,p={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:d(0),throw:d(1),return:d(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function d(i){return function(d){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;p;)try{if(o=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return p.label++,{value:i[1],done:!1};case 5:p.label++,r=i[1],i=[0];continue;case 7:i=p.ops.pop(),p.trys.pop();continue;default:if(!(n=p.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){p=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){p.label=i[1];break}if(6===i[0]&&p.label<n[1]){p.label=n[1],n=i;break}if(n&&p.label<n[2]){p.label=n[2],p.ops.push(i);break}n[2]&&p.ops.pop(),p.trys.pop();continue}i=t.call(e,p)}catch(e){i=[6,e],r=0}finally{o=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,d])}}}var s=function(){function e(){}return e.getProperties=function(){return"color"},e}(),u=function(){function e(){}return d([o.Field({type:"selector",isArray:!1,options:["center","left","right"],default:"left"}),l("design:type",String)],e.prototype,"align",void 0),d([o.Field(),l("design:type",Boolean)],e.prototype,"breakWords",void 0),d([o.Field(),l("design:type",Boolean)],e.prototype,"dropShadow",void 0),d([o.Field({default:1}),l("design:type",Number)],e.prototype,"dropShadowAlpha",void 0),d([o.Field({default:Math.PI/6}),l("design:type",Number)],e.prototype,"dropShadowAngle",void 0),d([o.Field({default:0}),l("design:type",Number)],e.prototype,"dropShadowBlur",void 0),d([o.Field((function(){return s}),{default:"#000000"}),l("design:type",Object)],e.prototype,"dropShadowColor",void 0),d([o.Field({default:5}),l("design:type",Number)],e.prototype,"dropShadowDistance",void 0),d([o.Field((function(){return[s]}),{default:["#000000"]}),l("design:type",Object)],e.prototype,"fill",void 0),d([o.Field({type:"selector",options:{vertical:1,horizontal:0},default:1,filter:function(e){return Number(e)},isArray:!1}),l("design:type",Number)],e.prototype,"fillGradientType",void 0),d([o.Field((function(){return Number}),{step:.1,min:0,max:1}),l("design:type",Array)],e.prototype,"fillGradientStops",void 0),d([o.Field((function(){return String}),{default:"Arial"}),l("design:type",Object)],e.prototype,"fontFamily",void 0),d([o.Field((function(){return Number}),{min:5,default:26}),l("design:type",Object)],e.prototype,"fontSize",void 0),d([o.Field({type:"selector",options:["normal","italic","oblique"],default:"normal"}),l("design:type",String)],e.prototype,"fontStyle",void 0),d([o.Field({type:"selector",options:["normal","small-caps"],default:"normal"}),l("design:type",String)],e.prototype,"fontVariant",void 0),d([o.Field({type:"selector",options:["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],default:"normal"}),l("design:type",String)],e.prototype,"fontWeight",void 0),d([o.Field({default:0}),l("design:type",Number)],e.prototype,"letterSpacing",void 0),d([o.Field({default:0}),l("design:type",Number)],e.prototype,"lineHeight",void 0),d([o.Field({type:"selector",options:["miter","round","bevel"],default:"miter"}),l("design:type",String)],e.prototype,"lineJoin",void 0),d([o.Field({default:10}),l("design:type",Number)],e.prototype,"miterLimit",void 0),d([o.Field({default:0}),l("design:type",Number)],e.prototype,"padding",void 0),d([o.Field((function(){return s}),{default:"#000000"}),l("design:type",Object)],e.prototype,"stroke",void 0),d([o.Field({default:0,min:0}),l("design:type",Number)],e.prototype,"strokeThickness",void 0),d([o.Field({default:"alphabetic"}),l("design:type",String)],e.prototype,"textBaseline",void 0),d([o.Field(),l("design:type",Boolean)],e.prototype,"trim",void 0),d([o.Field({default:"pre",type:"selector",options:["normal","pre","pre-line"]}),l("design:type",String)],e.prototype,"whiteSpace",void 0),d([o.Field(),l("design:type",Boolean)],e.prototype,"wordWrap",void 0),d([o.Field({default:100}),l("design:type",Number)],e.prototype,"wordWrapWidth",void 0),d([o.Field(),l("design:type",Number)],e.prototype,"leading",void 0),e}(),c=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.text="",e.style={},e}return p(r,t),r.prototype.init=function(t){var o=new e.TextStyle({fontSize:20}),r={};for(var n in o)0===n.indexOf("_")&&(r[n.substring(1)]=o[n]);this.style=r,t&&(this.text=t.text,Object.assign(this.style,t.style))},r.componentName="Text",d([o.Field({type:"textarea",filter:function(e){return"string"!=typeof e?"":e.length>100?e.slice(0,100):e}}),l("design:type",String)],r.prototype,"text",void 0),d([o.Field(),l("design:type",u)],r.prototype,"style",void 0),r}(t.Component),y=c,f=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Text",t.texts={},t}return p(o,e),o.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},o.prototype.componentChanged=function(e){return o=this,r=void 0,p=function(){var o,r;return a(this,(function(i){return"Text"!==e.componentName||(e.type===t.OBSERVER_TYPE.ADD?(o=e.component,r=new n.Text(o.text,o.style),this.containerManager.getContainer(e.gameObject.id).addChildAt(r,0),this.texts[e.gameObject.id]={text:r,component:e.component},this.setSize(e)):e.type===t.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(e.gameObject.id).removeChild(this.texts[e.gameObject.id].text),this.texts[e.gameObject.id].text.destroy({children:!0}),delete this.texts[e.gameObject.id]):(this.change(e),this.setSize(e))),[2]}))},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{l(p.next(e))}catch(e){t(e)}}function d(e){try{l(p.throw(e))}catch(e){t(e)}}function l(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(n,d)}l((p=p.apply(o,r||[])).next())}));var o,r,i,p},o.prototype.change=function(e){var t=this.texts[e.gameObject.id],o=t.text,r=t.component;"text"===e.prop.prop[0]?o.text=r.text:"style"===e.prop.prop[0]&&Object.assign(o.style,e.component.style)},o.prototype.setSize=function(e){var t=e.gameObject.transform;t&&(t.size.width=this.texts[e.gameObject.id].text.width,t.size.height=this.texts[e.gameObject.id].text.height)},o.systemName="Text",o=d([t.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],o)}(r.Renderer);exports.Text=y,exports.TextSystem=f;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("pixi.js"),t=require("@eva/eva.js"),o=require("@eva/inspector-decorator"),i=require("@eva/plugin-renderer"),r=require("@eva/renderer-adapter"),n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},n(e,t)};function l(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}function p(e,t,o,i){var r,n=arguments.length,l=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,i);else for(var p=e.length-1;p>=0;p--)(r=e[p])&&(l=(n<3?r(l):n>3?r(t,o,l):r(t,o))||l);return n>3&&l&&Object.defineProperty(t,o,l),l}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t){var o,i,r,n,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:p(0),throw:p(1),return:p(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function p(n){return function(p){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,i&&(r=2&n[0]?i.return:n[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,n[1])).done)return r;switch(i=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,i=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],i=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,p])}}}var s=function(){function e(){}return p([o.Field({type:"select",options:[{key:"center",value:"center"},{key:"left",value:"left"},{key:"right",value:"right"}],default:"left"}),a("design:type",String)],e.prototype,"align",void 0),p([o.Field(),a("design:type",Boolean)],e.prototype,"breakWords",void 0),p([o.Field(),a("design:type",Boolean)],e.prototype,"dropShadow",void 0),p([o.Field({default:1}),a("design:type",Number)],e.prototype,"dropShadowAlpha",void 0),p([o.Field({default:Math.PI/6}),a("design:type",Number)],e.prototype,"dropShadowAngle",void 0),p([o.Field({default:0}),a("design:type",Number)],e.prototype,"dropShadowBlur",void 0),p([o.Field({type:"color",default:"#000000"}),a("design:type",Object)],e.prototype,"dropShadowColor",void 0),p([o.Field({default:5}),a("design:type",Number)],e.prototype,"dropShadowDistance",void 0),p([o.Field({type:"color",default:["#000000"],isArray:!0}),a("design:type",Object)],e.prototype,"fill",void 0),p([o.Field({type:"select",options:[{key:1,value:"vertical"},{key:0,value:"horizontal"}],default:1}),a("design:type",Number)],e.prototype,"fillGradientType",void 0),p([o.Field((function(){return Number}),{step:.1,min:0,max:1}),a("design:type",Array)],e.prototype,"fillGradientStops",void 0),p([o.Field((function(){return String}),{default:"Arial"}),a("design:type",Object)],e.prototype,"fontFamily",void 0),p([o.Field((function(){return Number}),{min:5,default:26}),a("design:type",Object)],e.prototype,"fontSize",void 0),p([o.Field({type:"select",options:[{key:"normal",value:"normal"},{key:"italic",value:"italic"},{key:"oblique",value:"oblique"}],default:"normal"}),a("design:type",String)],e.prototype,"fontStyle",void 0),p([o.Field({type:"select",options:[{key:"normal",value:"normal"},{key:"small-caps",value:"small-caps"}],default:"normal"}),a("design:type",String)],e.prototype,"fontVariant",void 0),p([o.Field({type:"select",options:[{key:"normal",value:"normal"},{key:"bold",value:"bold"},{key:"bolder",value:"bolder"},{key:"lighter",value:"lighter"},{key:"100",value:"100"},{key:"200",value:"200"},{key:"300",value:"300"},{key:"400",value:"400"},{key:"500",value:"500"},{key:"600",value:"600"},{key:"700",value:"700"},{key:"800",value:"800"},{key:"900",value:"900"}],default:"normal"}),a("design:type",String)],e.prototype,"fontWeight",void 0),p([o.Field({default:0}),a("design:type",Number)],e.prototype,"letterSpacing",void 0),p([o.Field({default:0}),a("design:type",Number)],e.prototype,"lineHeight",void 0),p([o.Field({type:"select",options:[{key:"miter",value:"miter"},{key:"round",value:"round"},{key:"bevel",value:"bevel"}],default:"miter"}),a("design:type",String)],e.prototype,"lineJoin",void 0),p([o.Field({default:10}),a("design:type",Number)],e.prototype,"miterLimit",void 0),p([o.Field({default:0}),a("design:type",Number)],e.prototype,"padding",void 0),p([o.Field({type:"color",default:"#000000"}),a("design:type",Object)],e.prototype,"stroke",void 0),p([o.Field({default:0,min:0}),a("design:type",Number)],e.prototype,"strokeThickness",void 0),p([o.Field({default:"alphabetic"}),a("design:type",String)],e.prototype,"textBaseline",void 0),p([o.Field(),a("design:type",Boolean)],e.prototype,"trim",void 0),p([o.Field({default:"pre",type:"select",options:[{key:"normal",value:"normal"},{key:"pre",value:"pre"},{key:"pre-line",value:"pre-line"}]}),a("design:type",String)],e.prototype,"whiteSpace",void 0),p([o.Field(),a("design:type",Boolean)],e.prototype,"wordWrap",void 0),p([o.Field({default:100}),a("design:type",Number)],e.prototype,"wordWrapWidth",void 0),p([o.Field(),a("design:type",Number)],e.prototype,"leading",void 0),e}(),u=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.text="",e.style={},e}return l(i,t),i.prototype.init=function(t){var o=new e.TextStyle({fontSize:20}),i={};for(var r in o)0===r.indexOf("_")&&(i[r.substring(1)]=o[r]);this.style=i,t&&(this.text=t.text,Object.assign(this.style,t.style))},i.componentName="Text",p([o.Field(),a("design:type",String)],i.prototype,"text",void 0),p([o.Field(),a("design:type",s)],i.prototype,"style",void 0),i}(t.Component),y=u,c=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Text",t.texts={},t}return l(o,e),o.prototype.init=function(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)},o.prototype.componentChanged=function(e){return o=this,i=void 0,l=function(){var o,i;return d(this,(function(n){return"Text"!==e.componentName||(e.type===t.OBSERVER_TYPE.ADD?(o=e.component,i=new r.Text(o.text,o.style),this.containerManager.getContainer(e.gameObject.id).addChildAt(i,0),this.texts[e.gameObject.id]={text:i,component:e.component},this.setSize(e)):e.type===t.OBSERVER_TYPE.REMOVE?(this.containerManager.getContainer(e.gameObject.id).removeChild(this.texts[e.gameObject.id].text),this.texts[e.gameObject.id].text.destroy({children:!0}),delete this.texts[e.gameObject.id]):(this.change(e),this.setSize(e))),[2]}))},new((n=void 0)||(n=Promise))((function(e,t){function r(e){try{a(l.next(e))}catch(e){t(e)}}function p(e){try{a(l.throw(e))}catch(e){t(e)}}function a(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(r,p)}a((l=l.apply(o,i||[])).next())}));var o,i,n,l},o.prototype.change=function(e){var t=this.texts[e.gameObject.id],o=t.text,i=t.component;"text"===e.prop.prop[0]?o.text=i.text:"style"===e.prop.prop[0]&&Object.assign(o.style,e.component.style)},o.prototype.setSize=function(e){var t=e.gameObject.transform;t&&(t.size.width=this.texts[e.gameObject.id].text.width,t.size.height=this.texts[e.gameObject.id].text.height)},o.systemName="Text",o=p([t.decorators.componentObserver({Text:["text",{prop:["style"],deep:!0}]})],o)}(i.Renderer);exports.Text=y,exports.TextSystem=c;
@@ -81,22 +81,17 @@ function __generator(thisArg, body) {
81
81
  }
82
82
  }
83
83
 
84
- var Color = (function () {
85
- function Color() {
86
- }
87
- Color.getProperties = function () {
88
- return 'color';
89
- };
90
- return Color;
91
- }());
92
84
  var Style = (function () {
93
85
  function Style() {
94
86
  }
95
87
  __decorate([
96
88
  Field({
97
- type: 'selector',
98
- isArray: false,
99
- options: ['center', 'left', 'right'],
89
+ type: 'select',
90
+ options: [
91
+ { key: 'center', value: 'center' },
92
+ { key: 'left', value: 'left' },
93
+ { key: 'right', value: 'right' },
94
+ ],
100
95
  default: 'left',
101
96
  }),
102
97
  __metadata("design:type", String)
@@ -122,7 +117,7 @@ var Style = (function () {
122
117
  __metadata("design:type", Number)
123
118
  ], Style.prototype, "dropShadowBlur", void 0);
124
119
  __decorate([
125
- Field(function () { return Color; }, { default: '#000000' }),
120
+ Field({ type: 'color', default: '#000000' }),
126
121
  __metadata("design:type", Object)
127
122
  ], Style.prototype, "dropShadowColor", void 0);
128
123
  __decorate([
@@ -130,16 +125,17 @@ var Style = (function () {
130
125
  __metadata("design:type", Number)
131
126
  ], Style.prototype, "dropShadowDistance", void 0);
132
127
  __decorate([
133
- Field(function () { return [Color]; }, { default: ['#000000'] }),
128
+ Field({ type: 'color', default: ['#000000'], isArray: true }),
134
129
  __metadata("design:type", Object)
135
130
  ], Style.prototype, "fill", void 0);
136
131
  __decorate([
137
132
  Field({
138
- type: 'selector',
139
- options: { vertical: 1, horizontal: 0 },
133
+ type: 'select',
134
+ options: [
135
+ { key: 1, value: 'vertical' },
136
+ { key: 0, value: 'horizontal' },
137
+ ],
140
138
  default: 1,
141
- filter: function (val) { return Number(val); },
142
- isArray: false,
143
139
  }),
144
140
  __metadata("design:type", Number)
145
141
  ], Style.prototype, "fillGradientType", void 0);
@@ -156,17 +152,46 @@ var Style = (function () {
156
152
  __metadata("design:type", Object)
157
153
  ], Style.prototype, "fontSize", void 0);
158
154
  __decorate([
159
- Field({ type: 'selector', options: ['normal', 'italic', 'oblique'], default: 'normal' }),
155
+ Field({
156
+ type: 'select',
157
+ options: [
158
+ { key: 'normal', value: 'normal' },
159
+ { key: 'italic', value: 'italic' },
160
+ { key: 'oblique', value: 'oblique' },
161
+ ],
162
+ default: 'normal',
163
+ }),
160
164
  __metadata("design:type", String)
161
165
  ], Style.prototype, "fontStyle", void 0);
162
166
  __decorate([
163
- Field({ type: 'selector', options: ['normal', 'small-caps'], default: 'normal' }),
167
+ Field({
168
+ type: 'select',
169
+ options: [
170
+ { key: 'normal', value: 'normal' },
171
+ { key: 'small-caps', value: 'small-caps' },
172
+ ],
173
+ default: 'normal',
174
+ }),
164
175
  __metadata("design:type", String)
165
176
  ], Style.prototype, "fontVariant", void 0);
166
177
  __decorate([
167
178
  Field({
168
- type: 'selector',
169
- options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
179
+ type: 'select',
180
+ options: [
181
+ { key: 'normal', value: 'normal' },
182
+ { key: 'bold', value: 'bold' },
183
+ { key: 'bolder', value: 'bolder' },
184
+ { key: 'lighter', value: 'lighter' },
185
+ { key: '100', value: '100' },
186
+ { key: '200', value: '200' },
187
+ { key: '300', value: '300' },
188
+ { key: '400', value: '400' },
189
+ { key: '500', value: '500' },
190
+ { key: '600', value: '600' },
191
+ { key: '700', value: '700' },
192
+ { key: '800', value: '800' },
193
+ { key: '900', value: '900' },
194
+ ],
170
195
  default: 'normal',
171
196
  }),
172
197
  __metadata("design:type", String)
@@ -180,7 +205,15 @@ var Style = (function () {
180
205
  __metadata("design:type", Number)
181
206
  ], Style.prototype, "lineHeight", void 0);
182
207
  __decorate([
183
- Field({ type: 'selector', options: ['miter', 'round', 'bevel'], default: 'miter' }),
208
+ Field({
209
+ type: 'select',
210
+ options: [
211
+ { key: 'miter', value: 'miter' },
212
+ { key: 'round', value: 'round' },
213
+ { key: 'bevel', value: 'bevel' },
214
+ ],
215
+ default: 'miter',
216
+ }),
184
217
  __metadata("design:type", String)
185
218
  ], Style.prototype, "lineJoin", void 0);
186
219
  __decorate([
@@ -192,7 +225,7 @@ var Style = (function () {
192
225
  __metadata("design:type", Number)
193
226
  ], Style.prototype, "padding", void 0);
194
227
  __decorate([
195
- Field(function () { return Color; }, { default: '#000000' }),
228
+ Field({ type: 'color', default: '#000000' }),
196
229
  __metadata("design:type", Object)
197
230
  ], Style.prototype, "stroke", void 0);
198
231
  __decorate([
@@ -208,7 +241,15 @@ var Style = (function () {
208
241
  __metadata("design:type", Boolean)
209
242
  ], Style.prototype, "trim", void 0);
210
243
  __decorate([
211
- Field({ default: 'pre', type: 'selector', options: ['normal', 'pre', 'pre-line'] }),
244
+ Field({
245
+ default: 'pre',
246
+ type: 'select',
247
+ options: [
248
+ { key: 'normal', value: 'normal' },
249
+ { key: 'pre', value: 'pre' },
250
+ { key: 'pre-line', value: 'pre-line' },
251
+ ],
252
+ }),
212
253
  __metadata("design:type", String)
213
254
  ], Style.prototype, "whiteSpace", void 0);
214
255
  __decorate([
@@ -251,18 +292,7 @@ var Text$2 = (function (_super) {
251
292
  };
252
293
  Text.componentName = 'Text';
253
294
  __decorate([
254
- Field({
255
- type: 'textarea',
256
- filter: function (text) {
257
- if (typeof text !== 'string') {
258
- return '';
259
- }
260
- if (text.length > 100) {
261
- return text.slice(0, 100);
262
- }
263
- return text;
264
- },
265
- }),
295
+ Field(),
266
296
  __metadata("design:type", String)
267
297
  ], Text.prototype, "text", void 0);
268
298
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-text",
3
- "version": "1.2.7-editor.10",
3
+ "version": "1.2.7-editor.11",
4
4
  "description": "@eva/plugin-renderer-text",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-text.esm.js",
@@ -18,10 +18,10 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/inspector-decorator": "0.1.0-alpha.2",
22
- "@eva/plugin-renderer": "1.2.7-editor.10",
23
- "@eva/renderer-adapter": "1.2.7-editor.10",
24
- "@eva/eva.js": "1.2.7-editor.10",
21
+ "@eva/inspector-decorator": "0.1.0-alpha.3",
22
+ "@eva/plugin-renderer": "1.2.7-editor.11",
23
+ "@eva/renderer-adapter": "1.2.7-editor.11",
24
+ "@eva/eva.js": "1.2.7-editor.11",
25
25
  "pixi.js": "^4.8.7"
26
26
  }
27
27
  }