html2canvas-pro 2.2.0 → 2.2.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * html2canvas-pro 2.2.0 <https://yorickshan.github.io/html2canvas-pro/>
2
+ * html2canvas-pro 2.2.1 <https://yorickshan.github.io/html2canvas-pro/>
3
3
  * Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
4
4
  * Released under MIT License
5
5
  */
@@ -6301,11 +6301,13 @@
6301
6301
  valueCache = /* @__PURE__ */ new Map();
6302
6302
  parseCache.set(descriptor, valueCache);
6303
6303
  }
6304
- if (valueCache.size >= 200) {
6305
- const oldestKey = valueCache.keys().next().value;
6306
- valueCache.delete(oldestKey);
6304
+ if (!(descriptor.type === 3 && descriptor.format === "image")) {
6305
+ if (valueCache.size >= 200) {
6306
+ const oldestKey = valueCache.keys().next().value;
6307
+ valueCache.delete(oldestKey);
6308
+ }
6309
+ valueCache.set(rawValue, result);
6307
6310
  }
6308
- valueCache.set(rawValue, result);
6309
6311
  return result;
6310
6312
  };
6311
6313
  //#endregion
@@ -9904,7 +9906,10 @@
9904
9906
  this.ctx.clip();
9905
9907
  } else if (isClipPathEffect(effect)) effect.applyClip(this.ctx);
9906
9908
  else if (isBlendEffect(effect)) this.ctx.globalCompositeOperation = effect.compositeOperation;
9907
- else if (isFilterEffect(effect)) this.ctx.filter = effect.filterString;
9909
+ else if (isFilterEffect(effect)) {
9910
+ const safe = effect.filterString.replace(/drop-shadow\([^)]+\)\s*/g, "").trim();
9911
+ this.ctx.filter = safe || "none";
9912
+ }
9908
9913
  this.activeEffects.push(effect);
9909
9914
  }
9910
9915
  /**
@@ -10721,7 +10726,8 @@
10721
10726
  imageTimeout: opts.imageTimeout ?? 15e3,
10722
10727
  proxy: opts.proxy,
10723
10728
  useCORS: opts.useCORS ?? false,
10724
- customIsSameOrigin: opts.customIsSameOrigin
10729
+ customIsSameOrigin: opts.customIsSameOrigin,
10730
+ maxCacheSize: opts.maxCacheSize
10725
10731
  };
10726
10732
  const contextOptions = {
10727
10733
  logging: opts.logging ?? true,