@eva/plugin-renderer-text 1.2.7-editor.3 → 1.2.7-editor.6
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.
|
@@ -309,6 +309,14 @@ var _EVA_IIFE_text = function (exports, pixi_js, eva_js, pluginRenderer, rendere
|
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
var ExecuteMode;
|
|
313
|
+
|
|
314
|
+
(function (ExecuteMode) {
|
|
315
|
+
ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
|
|
316
|
+
ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
|
|
317
|
+
ExecuteMode[ExecuteMode["All"] = 6] = "All";
|
|
318
|
+
})(ExecuteMode || (ExecuteMode = {}));
|
|
319
|
+
|
|
312
320
|
var Color = function () {
|
|
313
321
|
function Color() {}
|
|
314
322
|
|
|
@@ -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="IDE_PROPERTY_METADATA";function
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-text",
|
|
3
|
-
"version": "1.2.7-editor.
|
|
3
|
+
"version": "1.2.7-editor.6",
|
|
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.
|
|
22
|
-
"@eva/plugin-renderer": "1.2.7-editor.
|
|
23
|
-
"@eva/renderer-adapter": "1.2.7-editor.
|
|
24
|
-
"@eva/eva.js": "1.2.7-editor.
|
|
21
|
+
"@eva/inspector-decorator": "0.1.0-alpha.2",
|
|
22
|
+
"@eva/plugin-renderer": "1.2.7-editor.6",
|
|
23
|
+
"@eva/renderer-adapter": "1.2.7-editor.6",
|
|
24
|
+
"@eva/eva.js": "1.2.7-editor.6",
|
|
25
25
|
"pixi.js": "^4.8.7"
|
|
26
26
|
}
|
|
27
27
|
}
|