@galacean/effects-plugin-rich-text 2.1.3 → 2.1.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.
package/dist/alipay.js CHANGED
@@ -534,7 +534,7 @@ exports.RichTextComponent = __decorate([
534
534
 
535
535
  /**
536
536
  * 插件版本号
537
- */ var version = "2.1.3";
537
+ */ var version = "2.1.4";
538
538
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
539
539
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
540
540
  if (version !== EFFECTS__namespace.version) {
package/dist/alipay.mjs CHANGED
@@ -511,7 +511,7 @@ RichTextComponent = __decorate([
511
511
 
512
512
  /**
513
513
  * 插件版本号
514
- */ var version = "2.1.3";
514
+ */ var version = "2.1.4";
515
515
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
516
516
  logger.info("Plugin rich text version: " + version + ".");
517
517
  if (version !== EFFECTS.version) {
package/dist/douyin.js CHANGED
@@ -534,7 +534,7 @@ exports.RichTextComponent = __decorate([
534
534
 
535
535
  /**
536
536
  * 插件版本号
537
- */ var version = "2.1.3";
537
+ */ var version = "2.1.4";
538
538
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
539
539
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
540
540
  if (version !== EFFECTS__namespace.version) {
package/dist/douyin.mjs CHANGED
@@ -511,7 +511,7 @@ RichTextComponent = __decorate([
511
511
 
512
512
  /**
513
513
  * 插件版本号
514
- */ var version = "2.1.3";
514
+ */ var version = "2.1.4";
515
515
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
516
516
  logger.info("Plugin rich text version: " + version + ".");
517
517
  if (version !== EFFECTS.version) {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player richtext plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.1.3
6
+ * Version: v2.1.4
7
7
  */
8
8
 
9
9
  'use strict';
@@ -542,7 +542,7 @@ exports.RichTextComponent = __decorate([
542
542
 
543
543
  /**
544
544
  * 插件版本号
545
- */ var version = "2.1.3";
545
+ */ var version = "2.1.4";
546
546
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
547
547
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
548
548
  if (version !== EFFECTS__namespace.version) {
package/dist/index.min.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * Description: Galacean Effects player richtext plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.1.3
7
- */function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.richTextPlugin={}),t.ge)}(this,function(t,e){"use strict";var n,r,i=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}(e);function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}var s=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="richtext",e}return a(e,t),e}(e.AbstractPlugin);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return l(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=r||(r={})).ContextStart="ContextStart",n.Text="Text",n.ContextEnd="ContextEnd";var u=/^<([a-z]+)(=([^>]+))?>$/,c=/^<\/([a-z]+)>$/,h=[["ContextStart",/^<[a-z]+(=[^>]+)?>/],["Text",/^[^</>=]+/],["ContextEnd",/^<\/[a-z]+>/]],p=function(t,e,n){if(void 0===e&&(e=[]),void 0===n&&(n=0),!t)return e;for(var r,i=f(h);!(r=i()).done;){var o,a=r.value,s=a[0],l=(null!=(o=a[1].exec(t))?o:[])[0];if(l){var u=l.length;return p(t.slice(u),e.concat({tokenType:s,value:l}),n+u)}}throw Error('Unexpected token: "'+t[0]+'" at position '+n+' while reading "'+t+'"')},g=function(t){var e=function(){var t=s();if((null==t?void 0:t.tokenType)==="Text")return a(),t.value},n=function(){var t=s();if((null==t?void 0:t.tokenType)==="ContextStart"){a();var e,n=t.value.match(u);if(n)return{attributeName:n[1],attributeParam:null!=(e=n[3])?e:""};throw Error("Expected a start tag marker at position "+o)}return{}},r=function(){var t=s();if((null==t?void 0:t.tokenType)==="ContextEnd"){a();var e=t.value.match(c);if(e)return{attributeName:e[1]};throw Error("Expect an end tag marker at position "+o)}return{}},i=p(t),o=0,a=function(){var t,e=i.shift();return o+=null!=(t=null==e?void 0:e.value.length)?t:0,e},s=function(){return i[0]},l=[];return!function t(i,a){for(void 0===i&&(i=[]),void 0===a&&(a="");;){var s=e();if(s){l.push({attributes:i,text:s});continue}var f=n(),u=f.attributeName,c=f.attributeParam;if(u){t(i.concat({attributeName:u,attributeParam:c}),u);continue}if(a){var h=r().attributeName;if(!h)throw Error('Expect an end tag marker "'+a+'" at position '+o+" but found no tag!");if(h!==a)throw Error('Expect an end tag marker "'+a+'" at position '+o+' but found tag "'+h+'"');return}break}}(),l};function v(t){return function(e){for(var n,r=g(e),i=f(r);!(n=i()).done;){var o=n.value;t(o.text,o.attributes.reduce(function(t,e){var n=e.attributeName,r=e.attributeParam;return n&&(t[n]=r),t},{}))}}}function d(t,e){if(void 0===e&&(e=1),(3===(t=t.replace(/^#/,"")).length||4===t.length)&&(t=t.split("").map(function(t){return t+t}).join("")),8===t.length){var n=parseInt(t.slice(6,8),16)/255;t=t.slice(0,6),e=n}var r=parseInt(t,16);return[r>>16&255,r>>8&255,255&r,e]}"function"==typeof SuppressedError&&SuppressedError;var x=0;t.RichTextComponent=function(t){function n(e){var n;return(n=t.call(this,e)||this).processedTextOptions=[],n.singleLineHeight=1.571,n.size=null,n.name="MRichText"+x++,n}a(n,t);var r=n.prototype;return r.generateTextProgram=function(t){var n=this;this.processedTextOptions=[],v(function(t,r){/^\n+$/.test(t)&&(t=t.replace(/\n/g,"\n ")),t.split("\n").forEach(function(t,i){var o={text:t,fontSize:n.textStyle.fontSize,isNewLine:!1};i>0&&(o.isNewLine=!0),"b"in r&&(o.fontWeight=e.spec.TextWeight.bold),"i"in r&&(o.fontStyle=e.spec.FontStyle.italic),"size"in r&&r.size&&(o.fontSize=parseInt(r.size,10)),"color"in r&&r.color&&(o.fontColor=function(t,e){if(void 0===e&&(e=1),"string"!=typeof t||!t)throw Error("Invalid color string");return t.startsWith("#")?d(t,e):d(function(t){if("string"!=typeof t||!t)throw Error("Invalid color name provided");if("undefined"==typeof document)throw Error("This method requires a browser environment");var e=document.createElement("canvas"),n=e.getContext("2d");if(n)try{return n.fillStyle=t,n.fillStyle}finally{e.remove()}throw Error("Failed to get 2D context for color conversion!")}(t))}(r.color)),n.processedTextOptions.push(o)})})(t)},r.updateTexture=function(t){var n=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){this.generateTextProgram(this.text);var r=0,i=0,o=this.textLayout,a=this.textStyle,s=this.context;s.save();var l=[],f=a.fontSize*this.textStyle.fontScale,u={richOptions:[],offsetX:[],width:0,lineHeight:f*this.singleLineHeight,offsetY:f*(this.singleLineHeight-1)/2};if(this.processedTextOptions.forEach(function(t,e){var o=t.text,c=t.isNewLine,h=t.fontSize;c&&(l.push(u),r=Math.max(r,u.width),u={richOptions:[],offsetX:[],width:0,lineHeight:f*n.singleLineHeight,offsetY:f*(n.singleLineHeight-1)/2},i+=u.lineHeight),s.font="10px "+(t.fontFamily||a.fontFamily);var p=s.measureText(o).width,g=h*n.singleLineHeight*n.textStyle.fontScale;g>u.lineHeight&&(i+=g-u.lineHeight,u.lineHeight=g,u.offsetY=h*n.textStyle.fontScale*(n.singleLineHeight-1)/2),u.offsetX.push(u.width),u.width+=p*h*n.SCALE_FACTOR*n.textStyle.fontScale,u.richOptions.push(t)}),l.push(u),r=Math.max(r,u.width),i+=u.lineHeight,0===r||0===i){this.isDirty=!1;return}(void 0===this.size||null===this.size)&&(this.size=this.item.transform.size.clone());var c=this.size,h=c.x,p=c.y;this.item.transform.size.set((void 0===h?1:h)*r*this.SCALE_FACTOR*this.SCALE_FACTOR,(void 0===p?1:p)*i*this.SCALE_FACTOR*this.SCALE_FACTOR),this.textLayout.width=r/a.fontScale,this.textLayout.height=i/a.fontScale,this.canvas.width=r,this.canvas.height=i,s.clearRect(0,0,r,i),s.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",t||(s.translate(0,i),s.scale(1,-1));var g=l[0].lineHeight-l[0].offsetY;if(0!==l.length){l.forEach(function(t,e){var n=t.richOptions,r=t.offsetX,i=o.getOffsetX(a,t.width);e>0&&(g+=t.lineHeight-t.offsetY+l[e-1].offsetY),n.forEach(function(t,e){var n=a.fontScale,o=a.textColor,l=a.fontFamily,f=a.textWeight,u=a.fontStyle,c=t.text,h=t.fontSize,p=t.fontColor,v=void 0===p?o:p,d=t.fontFamily,x=t.fontWeight,y=t.fontStyle;s.font=(void 0===y?u:y)+" "+(void 0===x?f:x)+" "+h*n+"px "+(void 0===d?l:d),s.fillStyle="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")",s.fillText(c,r[e]+i,g)})});var v=s.getImageData(0,0,this.canvas.width,this.canvas.height);this.material.setTexture("_MainTex",e.Texture.createWithData(this.engine,{data:new Uint8Array(v.data),width:v.width,height:v.height},{flipY:t,magFilter:e.glContext.LINEAR,minFilter:e.glContext.LINEAR,wrapS:e.glContext.CLAMP_TO_EDGE,wrapT:e.glContext.CLAMP_TO_EDGE})),this.isDirty=!1,s.restore()}}},r.updateWithOptions=function(t){this.textStyle=new e.TextStyle(t),this.textLayout=new e.TextLayout(t),this.text=t.text?t.text.toString():" "},n}(e.TextComponent),t.RichTextComponent=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([e.effectsClass(e.spec.DataType.RichTextComponent)],t.RichTextComponent);var y="2.1.3";e.registerPlugin("richtext",s,e.VFXItem,!0),e.logger.info("Plugin rich text version: "+y+"."),y!==i.version&&console.error("注意:请统一 RichText 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the RichText plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),t.generateProgram=v,t.isRichText=function(t){var e=p(t).filter(function(t){var e=t.tokenType;return"ContextStart"===e||"ContextEnd"===e}),n=e.filter(function(t){return"ContextStart"===t.tokenType}),r=e.filter(function(t){return"ContextEnd"===t.tokenType});return n.length===r.length&&!!n.length&&function t(e,n){var r=e[0],i=e.slice(1);if(void 0===n&&(n=[]),!r)return 0===n.length;if("ContextStart"===r.tokenType)return t(i,n.concat(r.value));if("ContextEnd"===r.tokenType)return n[n.length-1]===r.value&&t(i,n.slice(0,-1));throw Error("Unexpected token: "+r.tokenType)}(e.map(function(t){var e=t.tokenType,n=t.value;return{tokenType:e,value:"ContextStart"===e?n.match(u)[1]:n.match(c)[1]}}))},t.lexer=p,t.richTextParser=g,t.version=y,Object.defineProperty(t,"__esModule",{value:!0})});
6
+ * Version: v2.1.4
7
+ */function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.richTextPlugin={}),t.ge)}(this,function(t,e){"use strict";var n,r,i=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}(e);function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}var s=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="richtext",e}return a(e,t),e}(e.AbstractPlugin);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return l(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=r||(r={})).ContextStart="ContextStart",n.Text="Text",n.ContextEnd="ContextEnd";var u=/^<([a-z]+)(=([^>]+))?>$/,c=/^<\/([a-z]+)>$/,h=[["ContextStart",/^<[a-z]+(=[^>]+)?>/],["Text",/^[^</>=]+/],["ContextEnd",/^<\/[a-z]+>/]],p=function(t,e,n){if(void 0===e&&(e=[]),void 0===n&&(n=0),!t)return e;for(var r,i=f(h);!(r=i()).done;){var o,a=r.value,s=a[0],l=(null!=(o=a[1].exec(t))?o:[])[0];if(l){var u=l.length;return p(t.slice(u),e.concat({tokenType:s,value:l}),n+u)}}throw Error('Unexpected token: "'+t[0]+'" at position '+n+' while reading "'+t+'"')},g=function(t){var e=function(){var t=s();if((null==t?void 0:t.tokenType)==="Text")return a(),t.value},n=function(){var t=s();if((null==t?void 0:t.tokenType)==="ContextStart"){a();var e,n=t.value.match(u);if(n)return{attributeName:n[1],attributeParam:null!=(e=n[3])?e:""};throw Error("Expected a start tag marker at position "+o)}return{}},r=function(){var t=s();if((null==t?void 0:t.tokenType)==="ContextEnd"){a();var e=t.value.match(c);if(e)return{attributeName:e[1]};throw Error("Expect an end tag marker at position "+o)}return{}},i=p(t),o=0,a=function(){var t,e=i.shift();return o+=null!=(t=null==e?void 0:e.value.length)?t:0,e},s=function(){return i[0]},l=[];return!function t(i,a){for(void 0===i&&(i=[]),void 0===a&&(a="");;){var s=e();if(s){l.push({attributes:i,text:s});continue}var f=n(),u=f.attributeName,c=f.attributeParam;if(u){t(i.concat({attributeName:u,attributeParam:c}),u);continue}if(a){var h=r().attributeName;if(!h)throw Error('Expect an end tag marker "'+a+'" at position '+o+" but found no tag!");if(h!==a)throw Error('Expect an end tag marker "'+a+'" at position '+o+' but found tag "'+h+'"');return}break}}(),l};function v(t){return function(e){for(var n,r=g(e),i=f(r);!(n=i()).done;){var o=n.value;t(o.text,o.attributes.reduce(function(t,e){var n=e.attributeName,r=e.attributeParam;return n&&(t[n]=r),t},{}))}}}function d(t,e){if(void 0===e&&(e=1),(3===(t=t.replace(/^#/,"")).length||4===t.length)&&(t=t.split("").map(function(t){return t+t}).join("")),8===t.length){var n=parseInt(t.slice(6,8),16)/255;t=t.slice(0,6),e=n}var r=parseInt(t,16);return[r>>16&255,r>>8&255,255&r,e]}"function"==typeof SuppressedError&&SuppressedError;var x=0;t.RichTextComponent=function(t){function n(e){var n;return(n=t.call(this,e)||this).processedTextOptions=[],n.singleLineHeight=1.571,n.size=null,n.name="MRichText"+x++,n}a(n,t);var r=n.prototype;return r.generateTextProgram=function(t){var n=this;this.processedTextOptions=[],v(function(t,r){/^\n+$/.test(t)&&(t=t.replace(/\n/g,"\n ")),t.split("\n").forEach(function(t,i){var o={text:t,fontSize:n.textStyle.fontSize,isNewLine:!1};i>0&&(o.isNewLine=!0),"b"in r&&(o.fontWeight=e.spec.TextWeight.bold),"i"in r&&(o.fontStyle=e.spec.FontStyle.italic),"size"in r&&r.size&&(o.fontSize=parseInt(r.size,10)),"color"in r&&r.color&&(o.fontColor=function(t,e){if(void 0===e&&(e=1),"string"!=typeof t||!t)throw Error("Invalid color string");return t.startsWith("#")?d(t,e):d(function(t){if("string"!=typeof t||!t)throw Error("Invalid color name provided");if("undefined"==typeof document)throw Error("This method requires a browser environment");var e=document.createElement("canvas"),n=e.getContext("2d");if(n)try{return n.fillStyle=t,n.fillStyle}finally{e.remove()}throw Error("Failed to get 2D context for color conversion!")}(t))}(r.color)),n.processedTextOptions.push(o)})})(t)},r.updateTexture=function(t){var n=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){this.generateTextProgram(this.text);var r=0,i=0,o=this.textLayout,a=this.textStyle,s=this.context;s.save();var l=[],f=a.fontSize*this.textStyle.fontScale,u={richOptions:[],offsetX:[],width:0,lineHeight:f*this.singleLineHeight,offsetY:f*(this.singleLineHeight-1)/2};if(this.processedTextOptions.forEach(function(t,e){var o=t.text,c=t.isNewLine,h=t.fontSize;c&&(l.push(u),r=Math.max(r,u.width),u={richOptions:[],offsetX:[],width:0,lineHeight:f*n.singleLineHeight,offsetY:f*(n.singleLineHeight-1)/2},i+=u.lineHeight),s.font="10px "+(t.fontFamily||a.fontFamily);var p=s.measureText(o).width,g=h*n.singleLineHeight*n.textStyle.fontScale;g>u.lineHeight&&(i+=g-u.lineHeight,u.lineHeight=g,u.offsetY=h*n.textStyle.fontScale*(n.singleLineHeight-1)/2),u.offsetX.push(u.width),u.width+=p*h*n.SCALE_FACTOR*n.textStyle.fontScale,u.richOptions.push(t)}),l.push(u),r=Math.max(r,u.width),i+=u.lineHeight,0===r||0===i){this.isDirty=!1;return}(void 0===this.size||null===this.size)&&(this.size=this.item.transform.size.clone());var c=this.size,h=c.x,p=c.y;this.item.transform.size.set((void 0===h?1:h)*r*this.SCALE_FACTOR*this.SCALE_FACTOR,(void 0===p?1:p)*i*this.SCALE_FACTOR*this.SCALE_FACTOR),this.textLayout.width=r/a.fontScale,this.textLayout.height=i/a.fontScale,this.canvas.width=r,this.canvas.height=i,s.clearRect(0,0,r,i),s.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",t||(s.translate(0,i),s.scale(1,-1));var g=l[0].lineHeight-l[0].offsetY;if(0!==l.length){l.forEach(function(t,e){var n=t.richOptions,r=t.offsetX,i=o.getOffsetX(a,t.width);e>0&&(g+=t.lineHeight-t.offsetY+l[e-1].offsetY),n.forEach(function(t,e){var n=a.fontScale,o=a.textColor,l=a.fontFamily,f=a.textWeight,u=a.fontStyle,c=t.text,h=t.fontSize,p=t.fontColor,v=void 0===p?o:p,d=t.fontFamily,x=t.fontWeight,y=t.fontStyle;s.font=(void 0===y?u:y)+" "+(void 0===x?f:x)+" "+h*n+"px "+(void 0===d?l:d),s.fillStyle="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")",s.fillText(c,r[e]+i,g)})});var v=s.getImageData(0,0,this.canvas.width,this.canvas.height);this.material.setTexture("_MainTex",e.Texture.createWithData(this.engine,{data:new Uint8Array(v.data),width:v.width,height:v.height},{flipY:t,magFilter:e.glContext.LINEAR,minFilter:e.glContext.LINEAR,wrapS:e.glContext.CLAMP_TO_EDGE,wrapT:e.glContext.CLAMP_TO_EDGE})),this.isDirty=!1,s.restore()}}},r.updateWithOptions=function(t){this.textStyle=new e.TextStyle(t),this.textLayout=new e.TextLayout(t),this.text=t.text?t.text.toString():" "},n}(e.TextComponent),t.RichTextComponent=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}([e.effectsClass(e.spec.DataType.RichTextComponent)],t.RichTextComponent);var y="2.1.4";e.registerPlugin("richtext",s,e.VFXItem,!0),e.logger.info("Plugin rich text version: "+y+"."),y!==i.version&&console.error("注意:请统一 RichText 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the RichText plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),t.generateProgram=v,t.isRichText=function(t){var e=p(t).filter(function(t){var e=t.tokenType;return"ContextStart"===e||"ContextEnd"===e}),n=e.filter(function(t){return"ContextStart"===t.tokenType}),r=e.filter(function(t){return"ContextEnd"===t.tokenType});return n.length===r.length&&!!n.length&&function t(e,n){var r=e[0],i=e.slice(1);if(void 0===n&&(n=[]),!r)return 0===n.length;if("ContextStart"===r.tokenType)return t(i,n.concat(r.value));if("ContextEnd"===r.tokenType)return n[n.length-1]===r.value&&t(i,n.slice(0,-1));throw Error("Unexpected token: "+r.tokenType)}(e.map(function(t){var e=t.tokenType,n=t.value;return{tokenType:e,value:"ContextStart"===e?n.match(u)[1]:n.match(c)[1]}}))},t.lexer=p,t.richTextParser=g,t.version=y,Object.defineProperty(t,"__esModule",{value:!0})});
8
8
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player richtext plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 云垣
6
- * Version: v2.1.3
6
+ * Version: v2.1.4
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -519,7 +519,7 @@ RichTextComponent = __decorate([
519
519
 
520
520
  /**
521
521
  * 插件版本号
522
- */ var version = "2.1.3";
522
+ */ var version = "2.1.4";
523
523
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
524
524
  logger.info("Plugin rich text version: " + version + ".");
525
525
  if (version !== EFFECTS.version) {
package/dist/weapp.js CHANGED
@@ -534,7 +534,7 @@ exports.RichTextComponent = __decorate([
534
534
 
535
535
  /**
536
536
  * 插件版本号
537
- */ var version = "2.1.3";
537
+ */ var version = "2.1.4";
538
538
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
539
539
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
540
540
  if (version !== EFFECTS__namespace.version) {
package/dist/weapp.mjs CHANGED
@@ -511,7 +511,7 @@ RichTextComponent = __decorate([
511
511
 
512
512
  /**
513
513
  * 插件版本号
514
- */ var version = "2.1.3";
514
+ */ var version = "2.1.4";
515
515
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
516
516
  logger.info("Plugin rich text version: " + version + ".");
517
517
  if (version !== EFFECTS.version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-rich-text",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Galacean Effects player richtext plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "registry": "https://registry.npmjs.org"
44
44
  },
45
45
  "devDependencies": {
46
- "@galacean/effects": "2.1.3"
46
+ "@galacean/effects": "2.1.4"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "vite",