@galacean/effects-plugin-dom-content 2.10.0-alpha.4 → 2.10.0-alpha.5

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects plugin for rendering HTML/CSS DOM content as texture
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 陈茉
6
- * Version: v2.10.0-alpha.4
6
+ * Version: v2.10.0-alpha.5
7
7
  */
8
8
 
9
9
  'use strict';
@@ -969,7 +969,11 @@ function _inlineImageSources() {
969
969
  ];
970
970
  }
971
971
  urlToBase64 = new Map();
972
- urls = [].concat(urlSet).slice(0, MAX_URLS);
972
+ // 注意:不要写成 [...urlSet]。SWC 在 loose + ES5 下会把 `[...set]` 编译成
973
+ // `[].concat(urlSet)`,而 concat 不会展开 Set,会把整个 Set 当成单个元素塞进数组,
974
+ // 导致下方 urls.map 拿到的 url 是 Set 对象,decodeHtmlEntities(set) 报
975
+ // "value.replace is not a function"。Array.from 是运行时调用,SWC 不会改写它。
976
+ urls = Array.from(urlSet).slice(0, MAX_URLS);
973
977
  if (urlSet.size > MAX_URLS) {
974
978
  EFFECTS.logger.warn("inlineImageSources: URL count (" + urlSet.size + ") exceeds limit (" + MAX_URLS + "), only processing first " + MAX_URLS + ".");
975
979
  }
@@ -1067,7 +1071,7 @@ function _inlineFontSources() {
1067
1071
  ];
1068
1072
  }
1069
1073
  urlToBase64 = new Map();
1070
- urls = [].concat(urlSet).slice(0, MAX_URLS);
1074
+ urls = Array.from(urlSet).slice(0, MAX_URLS);
1071
1075
  if (urlSet.size > MAX_URLS) {
1072
1076
  EFFECTS.logger.warn("inlineFontSources: URL count (" + urlSet.size + ") exceeds limit (" + MAX_URLS + "), only processing first " + MAX_URLS + ".");
1073
1077
  }
@@ -1740,7 +1744,7 @@ exports.DomContentComponent = __decorate([
1740
1744
  EFFECTS.effectsClass(DATA_TYPE)
1741
1745
  ], exports.DomContentComponent);
1742
1746
 
1743
- var version = "2.10.0-alpha.4";
1747
+ var version = "2.10.0-alpha.5";
1744
1748
  EFFECTS.registerPlugin("dom-content", DomContentLoader);
1745
1749
  EFFECTS.logger.info("Plugin dom-content version: " + version + ".");
1746
1750
  if (version !== EFFECTS__namespace.version) {