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.
- package/README.md +19 -19
- package/dist/html2canvas-pro.esm.js +13 -7
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +13 -7
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +3 -3
- package/dist/lib/core/render-element.js +2 -1
- package/dist/lib/css/index.js +10 -4
- package/dist/lib/render/canvas/effects-renderer.js +8 -1
- package/package.json +1 -1
package/dist/html2canvas-pro.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* html2canvas-pro 2.2.
|
|
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 (
|
|
6305
|
-
|
|
6306
|
-
|
|
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))
|
|
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,
|