@designfever/web-review-kit 0.8.3 → 0.8.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/README.md +1 -1
- package/dist/react-shell.cjs +14 -0
- package/dist/react-shell.cjs.map +1 -1
- package/dist/react-shell.js +14 -0
- package/dist/react-shell.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/release-notes-0.8.4.md +23 -0
- package/package.json +1 -1
package/dist/react-shell.js
CHANGED
|
@@ -15854,6 +15854,7 @@ async function createHtml2CanvasCapture(targetDocument, targetWindow, viewport,
|
|
|
15854
15854
|
onclone: (documentClone) => {
|
|
15855
15855
|
normalizeUnsupportedCaptureStyles(documentClone);
|
|
15856
15856
|
normalizeUnsupportedCaptureColors(documentClone);
|
|
15857
|
+
normalizeZeroSizeCaptureGradients(documentClone);
|
|
15857
15858
|
},
|
|
15858
15859
|
removeContainer: true,
|
|
15859
15860
|
scale,
|
|
@@ -16053,6 +16054,19 @@ function normalizeUnsupportedCaptureColors(documentClone) {
|
|
|
16053
16054
|
}
|
|
16054
16055
|
});
|
|
16055
16056
|
}
|
|
16057
|
+
function normalizeZeroSizeCaptureGradients(documentClone) {
|
|
16058
|
+
const view = documentClone.defaultView;
|
|
16059
|
+
if (!view) return;
|
|
16060
|
+
documentClone.documentElement.querySelectorAll("*").forEach(
|
|
16061
|
+
(element) => {
|
|
16062
|
+
const backgroundImage = view.getComputedStyle(element).backgroundImage;
|
|
16063
|
+
if (!backgroundImage.includes("gradient(")) return;
|
|
16064
|
+
const bounds = element.getBoundingClientRect();
|
|
16065
|
+
if (bounds.width > 0 && bounds.height > 0) return;
|
|
16066
|
+
element.style.setProperty("background-image", "none", "important");
|
|
16067
|
+
}
|
|
16068
|
+
);
|
|
16069
|
+
}
|
|
16056
16070
|
function hasUnsupportedColorFunction(value) {
|
|
16057
16071
|
return /okl(?:ch|ab)\(|color-mix\(/i.test(value);
|
|
16058
16072
|
}
|