@uxbertlabs/reportly 1.0.24 → 1.0.26
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.map +1 -1
- package/dist/index.cjs.js +26 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +26 -38
- package/dist/index.esm.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/features/screenshot.ts"],"names":[],"mappings":"AAGA,cAAM,UAAU;IACd,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,YAAY,CAAe;;IAMnC;;OAEG;IACH,OAAO,CAAC,IAAI;IAIZ;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;YACW,YAAY;IAc1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAKb,OAAO,CAAC,IAAI,GAAE,UAAU,GAAG,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/features/screenshot.ts"],"names":[],"mappings":"AAGA,cAAM,UAAU;IACd,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,YAAY,CAAe;;IAMnC;;OAEG;IACH,OAAO,CAAC,IAAI;IAIZ;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;YACW,YAAY;IAc1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAKb,OAAO,CAAC,IAAI,GAAE,UAAU,GAAG,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAqL1E,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,iBAAiB;IA6DzB,OAAO,CAAC,iBAAiB;IAOzB;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,eAAe,UAAU,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -9333,10 +9333,10 @@ class Screenshot {
|
|
|
9333
9333
|
return Promise.resolve();
|
|
9334
9334
|
}
|
|
9335
9335
|
return new Promise(resolve => {
|
|
9336
|
-
img.addEventListener(
|
|
9336
|
+
img.addEventListener("load", () => resolve(), {
|
|
9337
9337
|
once: true
|
|
9338
9338
|
});
|
|
9339
|
-
img.addEventListener(
|
|
9339
|
+
img.addEventListener("error", () => resolve(), {
|
|
9340
9340
|
once: true
|
|
9341
9341
|
});
|
|
9342
9342
|
// Timeout after 3 seconds for slow images
|
|
@@ -9349,13 +9349,13 @@ class Screenshot {
|
|
|
9349
9349
|
* Wait for fonts to load
|
|
9350
9350
|
*/
|
|
9351
9351
|
async waitForFonts() {
|
|
9352
|
-
if (
|
|
9352
|
+
if ("fonts" in document) {
|
|
9353
9353
|
try {
|
|
9354
9354
|
await Promise.race([document.fonts.ready, this.wait(1000) // Timeout after 1 second
|
|
9355
9355
|
]);
|
|
9356
9356
|
} catch (e) {
|
|
9357
9357
|
// Font loading failed, continue anyway
|
|
9358
|
-
console.warn(
|
|
9358
|
+
console.warn("Font loading check failed:", e);
|
|
9359
9359
|
}
|
|
9360
9360
|
}
|
|
9361
9361
|
}
|
|
@@ -9377,7 +9377,6 @@ class Screenshot {
|
|
|
9377
9377
|
this.hideUXbertElements();
|
|
9378
9378
|
// Force a reflow to ensure all styles are computed
|
|
9379
9379
|
this.forceReflow();
|
|
9380
|
-
const originalScrollY = window.scrollY;
|
|
9381
9380
|
let canvas;
|
|
9382
9381
|
if (mode === "viewport") {
|
|
9383
9382
|
// Capture only the current viewport
|
|
@@ -9400,30 +9399,30 @@ class Screenshot {
|
|
|
9400
9399
|
// Ensure all styles are applied in the cloned document
|
|
9401
9400
|
const clonedBody = clonedDoc.body;
|
|
9402
9401
|
// Force all animations to their final state
|
|
9403
|
-
const animatedElements = clonedBody.querySelectorAll(
|
|
9402
|
+
const animatedElements = clonedBody.querySelectorAll("*");
|
|
9404
9403
|
animatedElements.forEach(el => {
|
|
9405
9404
|
const element = el;
|
|
9406
9405
|
// Pause all animations
|
|
9407
|
-
element.style.animationPlayState =
|
|
9408
|
-
element.style.animationDelay =
|
|
9409
|
-
element.style.animationIterationCount =
|
|
9406
|
+
element.style.animationPlayState = "paused";
|
|
9407
|
+
element.style.animationDelay = "-9999s";
|
|
9408
|
+
element.style.animationIterationCount = "1";
|
|
9410
9409
|
// Disable transitions
|
|
9411
|
-
element.style.transition =
|
|
9410
|
+
element.style.transition = "none";
|
|
9412
9411
|
});
|
|
9413
9412
|
// Ensure lazy-loaded images are visible
|
|
9414
|
-
const images = clonedBody.querySelectorAll(
|
|
9413
|
+
const images = clonedBody.querySelectorAll("img");
|
|
9415
9414
|
images.forEach(img => {
|
|
9416
|
-
img.style.opacity =
|
|
9417
|
-
img.style.visibility =
|
|
9415
|
+
img.style.opacity = "1";
|
|
9416
|
+
img.style.visibility = "visible";
|
|
9418
9417
|
});
|
|
9419
9418
|
},
|
|
9420
9419
|
ignoreElements: element => {
|
|
9421
9420
|
// Ignore loading screen by ID
|
|
9422
|
-
if (element.id ===
|
|
9421
|
+
if (element.id === "uxbert-screenshot-loading") {
|
|
9423
9422
|
return true;
|
|
9424
9423
|
}
|
|
9425
9424
|
// Ignore Uxbert elements
|
|
9426
|
-
if (element.getAttribute(
|
|
9425
|
+
if (element.getAttribute("data-uxbert-reportly") !== null || element.className?.toString().includes("uxbert-") || element.id?.includes("uxbert-")) {
|
|
9427
9426
|
return true;
|
|
9428
9427
|
}
|
|
9429
9428
|
// Skip cross-origin images that might cause issues
|
|
@@ -9447,22 +9446,13 @@ class Screenshot {
|
|
|
9447
9446
|
}
|
|
9448
9447
|
});
|
|
9449
9448
|
} else {
|
|
9450
|
-
// Scroll to top to capture full page
|
|
9451
|
-
window.scrollTo(0, 0);
|
|
9452
9449
|
// Wait a bit for scroll to settle
|
|
9453
|
-
await this.wait(
|
|
9454
|
-
// Get full page dimensions
|
|
9455
|
-
const fullPageHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
9456
|
-
const fullPageWidth = Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);
|
|
9450
|
+
await this.wait(1000);
|
|
9457
9451
|
// Capture the full page
|
|
9458
9452
|
canvas = await html2canvas(document.body, {
|
|
9459
9453
|
useCORS: true,
|
|
9460
9454
|
allowTaint: false,
|
|
9461
9455
|
logging: false,
|
|
9462
|
-
width: fullPageWidth,
|
|
9463
|
-
height: fullPageHeight,
|
|
9464
|
-
windowWidth: fullPageWidth,
|
|
9465
|
-
windowHeight: fullPageHeight,
|
|
9466
9456
|
// Improved rendering options
|
|
9467
9457
|
backgroundColor: null,
|
|
9468
9458
|
imageTimeout: 5000,
|
|
@@ -9472,30 +9462,30 @@ class Screenshot {
|
|
|
9472
9462
|
// Ensure all styles are applied in the cloned document
|
|
9473
9463
|
const clonedBody = clonedDoc.body;
|
|
9474
9464
|
// Force all animations to their final state
|
|
9475
|
-
const animatedElements = clonedBody.querySelectorAll(
|
|
9465
|
+
const animatedElements = clonedBody.querySelectorAll("*");
|
|
9476
9466
|
animatedElements.forEach(el => {
|
|
9477
9467
|
const element = el;
|
|
9478
9468
|
// Pause all animations at their end state
|
|
9479
|
-
element.style.animationPlayState =
|
|
9480
|
-
element.style.animationDelay =
|
|
9481
|
-
element.style.animationIterationCount =
|
|
9469
|
+
element.style.animationPlayState = "paused";
|
|
9470
|
+
element.style.animationDelay = "-9999s";
|
|
9471
|
+
element.style.animationIterationCount = "1";
|
|
9482
9472
|
// Disable transitions
|
|
9483
|
-
element.style.transition =
|
|
9473
|
+
element.style.transition = "none";
|
|
9484
9474
|
});
|
|
9485
9475
|
// Ensure lazy-loaded images are visible
|
|
9486
|
-
const images = clonedBody.querySelectorAll(
|
|
9476
|
+
const images = clonedBody.querySelectorAll("img");
|
|
9487
9477
|
images.forEach(img => {
|
|
9488
|
-
img.style.opacity =
|
|
9489
|
-
img.style.visibility =
|
|
9478
|
+
img.style.opacity = "1";
|
|
9479
|
+
img.style.visibility = "visible";
|
|
9490
9480
|
});
|
|
9491
9481
|
},
|
|
9492
9482
|
ignoreElements: element => {
|
|
9493
9483
|
// Ignore loading screen by ID
|
|
9494
|
-
if (element.id ===
|
|
9484
|
+
if (element.id === "uxbert-screenshot-loading") {
|
|
9495
9485
|
return true;
|
|
9496
9486
|
}
|
|
9497
9487
|
// Ignore Uxbert elements
|
|
9498
|
-
if (element.getAttribute(
|
|
9488
|
+
if (element.getAttribute("data-uxbert-reportly") !== null || element.className?.toString().includes("uxbert-") || element.id?.includes("uxbert-")) {
|
|
9499
9489
|
return true;
|
|
9500
9490
|
}
|
|
9501
9491
|
// Skip cross-origin images that might cause issues
|
|
@@ -9518,8 +9508,6 @@ class Screenshot {
|
|
|
9518
9508
|
return false;
|
|
9519
9509
|
}
|
|
9520
9510
|
});
|
|
9521
|
-
// Restore scroll position
|
|
9522
|
-
window.scrollTo(0, originalScrollY);
|
|
9523
9511
|
}
|
|
9524
9512
|
// Show UXbert UI elements again
|
|
9525
9513
|
this.showUXbertElements();
|
|
@@ -9570,7 +9558,7 @@ class Screenshot {
|
|
|
9570
9558
|
flex-direction: column;
|
|
9571
9559
|
align-items: center;
|
|
9572
9560
|
justify-content: center;
|
|
9573
|
-
z-index:
|
|
9561
|
+
z-index: 2147483645;
|
|
9574
9562
|
backdrop-filter: blur(4px);
|
|
9575
9563
|
`;
|
|
9576
9564
|
const spinner = document.createElement("div");
|