@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 CHANGED
@@ -30,7 +30,7 @@ This package does not own internal operator tools, private admin keys, or produc
30
30
  - [Architecture and runtime logic](docs/architecture.md): core runtime, React shell, coordinate, anchor, sitemap, and feature ownership boundaries.
31
31
  - [Figma overlay](docs/figma-overlay.md): host helper behavior and package-managed image overlay state.
32
32
  - [Grid overlay](docs/grid-overlay.md): how the shell toggles a host grid/helper overlay.
33
- - [Release notes 0.8.3](docs/release-notes-0.8.3.md): code-review bug fixes, sitemap state persistence and status filtering.
33
+ - [Release notes 0.8.4](docs/release-notes-0.8.4.md): reliable viewport capture for zero-size gradient elements.
34
34
 
35
35
  ## Quick Start
36
36
 
@@ -21047,6 +21047,7 @@ async function createHtml2CanvasCapture(targetDocument, targetWindow, viewport,
21047
21047
  onclone: (documentClone) => {
21048
21048
  normalizeUnsupportedCaptureStyles(documentClone);
21049
21049
  normalizeUnsupportedCaptureColors(documentClone);
21050
+ normalizeZeroSizeCaptureGradients(documentClone);
21050
21051
  },
21051
21052
  removeContainer: true,
21052
21053
  scale,
@@ -21246,6 +21247,19 @@ function normalizeUnsupportedCaptureColors(documentClone) {
21246
21247
  }
21247
21248
  });
21248
21249
  }
21250
+ function normalizeZeroSizeCaptureGradients(documentClone) {
21251
+ const view = documentClone.defaultView;
21252
+ if (!view) return;
21253
+ documentClone.documentElement.querySelectorAll("*").forEach(
21254
+ (element) => {
21255
+ const backgroundImage = view.getComputedStyle(element).backgroundImage;
21256
+ if (!backgroundImage.includes("gradient(")) return;
21257
+ const bounds = element.getBoundingClientRect();
21258
+ if (bounds.width > 0 && bounds.height > 0) return;
21259
+ element.style.setProperty("background-image", "none", "important");
21260
+ }
21261
+ );
21262
+ }
21249
21263
  function hasUnsupportedColorFunction(value) {
21250
21264
  return /okl(?:ch|ab)\(|color-mix\(/i.test(value);
21251
21265
  }