@uxbertlabs/reportly 1.0.40 → 1.0.42
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/features/screenshot.d.ts +0 -4
- package/dist/features/screenshot.d.ts.map +1 -1
- package/dist/index.cjs.js +5 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -44
- package/dist/index.esm.js.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,10 +22,6 @@ declare class Screenshot {
|
|
|
22
22
|
* Wait for fonts to load
|
|
23
23
|
*/
|
|
24
24
|
private waitForFonts;
|
|
25
|
-
/**
|
|
26
|
-
* Force a reflow to ensure styles are applied
|
|
27
|
-
*/
|
|
28
|
-
private forceReflow;
|
|
29
25
|
capture(mode?: "viewport" | "fullpage"): Promise<string>;
|
|
30
26
|
private hideUXbertElements;
|
|
31
27
|
private showUXbertElements;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/features/screenshot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AAEvE,cAAM,UAAU;IACd,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,MAAM,CAAkC;gBAEpC,KAAK,CAAC,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM;IAS9G;;OAEG;IACH,OAAO,CAAC,IAAI;IAIZ;;OAEG;YACW,gBAAgB;IAmB9B;;OAEG;YACW,aAAa;IA+C3B;;OAEG;YACW,YAAY;
|
|
1
|
+
{"version":3,"file":"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 +9397,6 @@ class Screenshot {
|
|
|
9397
9397
|
}
|
|
9398
9398
|
}
|
|
9399
9399
|
}
|
|
9400
|
-
/**
|
|
9401
|
-
* Force a reflow to ensure styles are applied
|
|
9402
|
-
*/
|
|
9403
|
-
forceReflow() {
|
|
9404
|
-
// Reading offsetHeight forces a reflow
|
|
9405
|
-
document.body.offsetHeight;
|
|
9406
|
-
}
|
|
9407
9400
|
async capture(mode = "fullpage") {
|
|
9408
9401
|
const context = {
|
|
9409
9402
|
mode,
|
|
@@ -9421,8 +9414,6 @@ class Screenshot {
|
|
|
9421
9414
|
// Hide loading screen and UXbert UI elements BEFORE capturing
|
|
9422
9415
|
this.hideLoadingScreen();
|
|
9423
9416
|
this.hideUXbertElements();
|
|
9424
|
-
// Force a reflow to ensure all styles are computed
|
|
9425
|
-
this.forceReflow();
|
|
9426
9417
|
// Hook: beforeCapture - allow developers to modify DOM before capture
|
|
9427
9418
|
if (this.hooks.beforeCapture) {
|
|
9428
9419
|
await Promise.resolve(this.hooks.beforeCapture(context));
|
|
@@ -9511,6 +9502,11 @@ class Screenshot {
|
|
|
9511
9502
|
}
|
|
9512
9503
|
});
|
|
9513
9504
|
} else {
|
|
9505
|
+
document.querySelectorAll("video").forEach(video => {
|
|
9506
|
+
if (video.style.position === "fixed" || video.classList.contains("fixed")) {
|
|
9507
|
+
video.remove();
|
|
9508
|
+
}
|
|
9509
|
+
});
|
|
9514
9510
|
// Capture the full page
|
|
9515
9511
|
canvas = await html2canvas(document.body, {
|
|
9516
9512
|
useCORS: true,
|
|
@@ -9522,41 +9518,6 @@ class Screenshot {
|
|
|
9522
9518
|
// Increased timeout for slow-loading images
|
|
9523
9519
|
removeContainer: true,
|
|
9524
9520
|
scale: window.devicePixelRatio || 1,
|
|
9525
|
-
onclone: clonedDoc => {
|
|
9526
|
-
// Ensure all styles are applied in the cloned document
|
|
9527
|
-
const clonedBody = clonedDoc.body;
|
|
9528
|
-
// Force all animations to their final state
|
|
9529
|
-
const animatedElements = clonedBody.querySelectorAll("*");
|
|
9530
|
-
animatedElements.forEach(el => {
|
|
9531
|
-
const element = el;
|
|
9532
|
-
// Pause all animations at their end state
|
|
9533
|
-
element.style.animationPlayState = "paused";
|
|
9534
|
-
element.style.animationDelay = "-9999s";
|
|
9535
|
-
element.style.animationIterationCount = "1";
|
|
9536
|
-
// Disable transitions
|
|
9537
|
-
element.style.transition = "none";
|
|
9538
|
-
});
|
|
9539
|
-
// Process images in the cloned document
|
|
9540
|
-
const originalImages = document.body.querySelectorAll("img");
|
|
9541
|
-
const clonedImages = clonedBody.querySelectorAll("img");
|
|
9542
|
-
clonedImages.forEach((clonedImg, index) => {
|
|
9543
|
-
const originalImg = originalImages[index];
|
|
9544
|
-
if (originalImg) {
|
|
9545
|
-
// Copy the current src from original to ensure it loads
|
|
9546
|
-
clonedImg.src = originalImg.currentSrc || originalImg.src;
|
|
9547
|
-
// Force visibility
|
|
9548
|
-
clonedImg.style.opacity = "1";
|
|
9549
|
-
clonedImg.style.visibility = "visible";
|
|
9550
|
-
clonedImg.style.display = originalImg.style.display || "inline";
|
|
9551
|
-
if (originalImg.width) clonedImg.width = originalImg.width;
|
|
9552
|
-
if (originalImg.height) clonedImg.height = originalImg.height;
|
|
9553
|
-
// Remove lazy loading attributes that might interfere
|
|
9554
|
-
clonedImg.removeAttribute("loading");
|
|
9555
|
-
clonedImg.removeAttribute("data-src");
|
|
9556
|
-
clonedImg.removeAttribute("data-srcset");
|
|
9557
|
-
}
|
|
9558
|
-
});
|
|
9559
|
-
},
|
|
9560
9521
|
ignoreElements: element => {
|
|
9561
9522
|
// Ignore loading screen by ID
|
|
9562
9523
|
if (element.id === "uxbert-screenshot-loading") {
|