@galacean/effects-plugin-rich-text 2.1.0 → 2.1.1

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
@@ -528,7 +528,7 @@ exports.RichTextComponent = __decorate([
528
528
 
529
529
  /**
530
530
  * 插件版本号
531
- */ var version = "2.1.0";
531
+ */ var version = "2.1.1";
532
532
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
533
533
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
534
534
  if (version !== EFFECTS__namespace.version) {
package/dist/alipay.mjs CHANGED
@@ -505,7 +505,7 @@ RichTextComponent = __decorate([
505
505
 
506
506
  /**
507
507
  * 插件版本号
508
- */ var version = "2.1.0";
508
+ */ var version = "2.1.1";
509
509
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
510
510
  logger.info("Plugin rich text version: " + version + ".");
511
511
  if (version !== EFFECTS.version) {
package/dist/douyin.js CHANGED
@@ -528,7 +528,7 @@ exports.RichTextComponent = __decorate([
528
528
 
529
529
  /**
530
530
  * 插件版本号
531
- */ var version = "2.1.0";
531
+ */ var version = "2.1.1";
532
532
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
533
533
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
534
534
  if (version !== EFFECTS__namespace.version) {
package/dist/douyin.mjs CHANGED
@@ -505,7 +505,7 @@ RichTextComponent = __decorate([
505
505
 
506
506
  /**
507
507
  * 插件版本号
508
- */ var version = "2.1.0";
508
+ */ var version = "2.1.1";
509
509
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
510
510
  logger.info("Plugin rich text version: " + version + ".");
511
511
  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.0
6
+ * Version: v2.1.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -536,7 +536,7 @@ exports.RichTextComponent = __decorate([
536
536
 
537
537
  /**
538
538
  * 插件版本号
539
- */ var version = "2.1.0";
539
+ */ var version = "2.1.1";
540
540
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
541
541
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
542
542
  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.0
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 f=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 s(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=s(h);!(r=i()).done;){var o,a=r.value,f=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:f,value:l}),n+u)}}throw Error('Unexpected token: "'+t[0]+'" at position '+n+' while reading "'+t+'"')},g=function(t){var e=function(){var t=f();if((null==t?void 0:t.tokenType)==="Text")return a(),t.value},n=function(){var t=f();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=f();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},f=function(){return i[0]},l=[];return!function t(i,a){for(void 0===i&&(i=[]),void 0===a&&(a="");;){var f=e();if(f){l.push({attributes:i,text:f});continue}var s=n(),u=s.attributeName,c=s.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=s(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.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,f=this.context;f.save();var l=[],s=a.fontSize*this.textStyle.fontScale,u={richOptions:[],offsetX:[],width:0,lineHeight:s*this.singleLineHeight,offsetY:s*(this.singleLineHeight-1)/2};if(this.processedTextOptions.forEach(function(t,e){var o=t.text,a=t.isNewLine,c=t.fontSize;a&&(l.push(u),r=Math.max(r,u.width),u={richOptions:[],offsetX:[],width:0,lineHeight:s*n.singleLineHeight,offsetY:s*(n.singleLineHeight-1)/2},i+=u.lineHeight);var h=f.measureText(o).width,p=c*n.singleLineHeight*n.textStyle.fontScale;p>u.lineHeight&&(i+=p-u.lineHeight,u.lineHeight=p,u.offsetY=c*n.textStyle.fontScale*(n.singleLineHeight-1)/2),u.offsetX.push(u.width),u.width+=h*c*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}var c=this.item.transform.size;this.item.transform.size.set(c.x*r*this.SCALE_FACTOR*this.SCALE_FACTOR,c.y*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,f.clearRect(0,0,r,i),f.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",t||(f.translate(0,i),f.scale(1,-1));var h=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&&(h+=t.lineHeight-t.offsetY+l[e-1].offsetY),n.forEach(function(t,e){var n=a.fontScale,o=a.textColor,l=a.fontFamily,s=a.textWeight,u=a.fontStyle,c=t.text,p=t.fontSize,g=t.fontColor,v=void 0===g?o:g,d=t.fontFamily,x=t.fontWeight,y=t.fontStyle;f.font=(void 0===y?u:y)+" "+(void 0===x?s:x)+" "+p*n+"px "+(void 0===d?l:d),f.fillStyle="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")",f.fillText(c,r[e]+i,h)})});var p=f.getImageData(0,0,this.canvas.width,this.canvas.height);this.material.setTexture("_MainTex",e.Texture.createWithData(this.engine,{data:new Uint8Array(p.data),width:p.width,height:p.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,f.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 f=t.length-1;f>=0;f--)(i=t[f])&&(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.0";e.registerPlugin("richtext",f,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.1
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 f=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 s(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=s(h);!(r=i()).done;){var o,a=r.value,f=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:f,value:l}),n+u)}}throw Error('Unexpected token: "'+t[0]+'" at position '+n+' while reading "'+t+'"')},g=function(t){var e=function(){var t=f();if((null==t?void 0:t.tokenType)==="Text")return a(),t.value},n=function(){var t=f();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=f();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},f=function(){return i[0]},l=[];return!function t(i,a){for(void 0===i&&(i=[]),void 0===a&&(a="");;){var f=e();if(f){l.push({attributes:i,text:f});continue}var s=n(),u=s.attributeName,c=s.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=s(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.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,f=this.context;f.save();var l=[],s=a.fontSize*this.textStyle.fontScale,u={richOptions:[],offsetX:[],width:0,lineHeight:s*this.singleLineHeight,offsetY:s*(this.singleLineHeight-1)/2};if(this.processedTextOptions.forEach(function(t,e){var o=t.text,a=t.isNewLine,c=t.fontSize;a&&(l.push(u),r=Math.max(r,u.width),u={richOptions:[],offsetX:[],width:0,lineHeight:s*n.singleLineHeight,offsetY:s*(n.singleLineHeight-1)/2},i+=u.lineHeight);var h=f.measureText(o).width,p=c*n.singleLineHeight*n.textStyle.fontScale;p>u.lineHeight&&(i+=p-u.lineHeight,u.lineHeight=p,u.offsetY=c*n.textStyle.fontScale*(n.singleLineHeight-1)/2),u.offsetX.push(u.width),u.width+=h*c*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}var c=this.item.transform.size;this.item.transform.size.set(c.x*r*this.SCALE_FACTOR*this.SCALE_FACTOR,c.y*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,f.clearRect(0,0,r,i),f.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",t||(f.translate(0,i),f.scale(1,-1));var h=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&&(h+=t.lineHeight-t.offsetY+l[e-1].offsetY),n.forEach(function(t,e){var n=a.fontScale,o=a.textColor,l=a.fontFamily,s=a.textWeight,u=a.fontStyle,c=t.text,p=t.fontSize,g=t.fontColor,v=void 0===g?o:g,d=t.fontFamily,x=t.fontWeight,y=t.fontStyle;f.font=(void 0===y?u:y)+" "+(void 0===x?s:x)+" "+p*n+"px "+(void 0===d?l:d),f.fillStyle="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")",f.fillText(c,r[e]+i,h)})});var p=f.getImageData(0,0,this.canvas.width,this.canvas.height);this.material.setTexture("_MainTex",e.Texture.createWithData(this.engine,{data:new Uint8Array(p.data),width:p.width,height:p.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,f.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 f=t.length-1;f>=0;f--)(i=t[f])&&(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.1";e.registerPlugin("richtext",f,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.0
6
+ * Version: v2.1.1
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -513,7 +513,7 @@ RichTextComponent = __decorate([
513
513
 
514
514
  /**
515
515
  * 插件版本号
516
- */ var version = "2.1.0";
516
+ */ var version = "2.1.1";
517
517
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
518
518
  logger.info("Plugin rich text version: " + version + ".");
519
519
  if (version !== EFFECTS.version) {
package/dist/weapp.js CHANGED
@@ -528,7 +528,7 @@ exports.RichTextComponent = __decorate([
528
528
 
529
529
  /**
530
530
  * 插件版本号
531
- */ var version = "2.1.0";
531
+ */ var version = "2.1.1";
532
532
  EFFECTS.registerPlugin("richtext", RichTextLoader, EFFECTS.VFXItem, true);
533
533
  EFFECTS.logger.info("Plugin rich text version: " + version + ".");
534
534
  if (version !== EFFECTS__namespace.version) {
package/dist/weapp.mjs CHANGED
@@ -505,7 +505,7 @@ RichTextComponent = __decorate([
505
505
 
506
506
  /**
507
507
  * 插件版本号
508
- */ var version = "2.1.0";
508
+ */ var version = "2.1.1";
509
509
  registerPlugin("richtext", RichTextLoader, VFXItem, true);
510
510
  logger.info("Plugin rich text version: " + version + ".");
511
511
  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.0",
3
+ "version": "2.1.1",
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.0"
46
+ "@galacean/effects": "2.1.1"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "vite",