@uxbertlabs/reportly 1.0.7 → 1.0.9
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/core/init.d.ts.map +1 -1
- package/dist/features/screenshot.d.ts +1 -1
- package/dist/features/screenshot.d.ts.map +1 -1
- package/dist/reportly.cjs.js +19 -21
- package/dist/reportly.cjs.js.map +1 -1
- package/dist/reportly.esm.js +19 -21
- package/dist/reportly.esm.js.map +1 -1
- package/dist/reportly.js +19 -21
- package/dist/reportly.js.map +1 -1
- package/dist/reportly.min.js +1 -1
- package/dist/reportly.min.js.map +1 -1
- package/package.json +1 -1
package/dist/core/init.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/core/init.ts"],"names":[],"mappings":"AAUA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAA4B,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpG,cAAM,QAAQ;IACZ,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,aAAa,CAAU;;IAe/B,IAAI,CAAC,UAAU,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,IAAI;IAwDpD,OAAO,CAAC,sBAAsB;YAUhB,iBAAiB;YAUjB,eAAe;IAyB7B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,cAAc;YASR,gBAAgB;YA2BhB,gBAAgB;
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/core/init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fullpage"): Promise<string>;
|
5
5
|
private hideUXbertElements;
|
6
6
|
private showUXbertElements;
|
7
7
|
getScreenshot(): string | null;
|
@@ -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;;IAMnC,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;;IAMnC,OAAO,CAAC,IAAI,GAAE,UAAU,GAAG,UAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgH1E,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,kBAAkB;IAY1B,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,eAAe,UAAU,CAAC"}
|
package/dist/reportly.cjs.js
CHANGED
@@ -9449,18 +9449,19 @@ class Screenshot {
|
|
9449
9449
|
constructor() {
|
9450
9450
|
this.currentScreenshot = null;
|
9451
9451
|
}
|
9452
|
-
async capture(mode =
|
9452
|
+
async capture(mode = "fullpage") {
|
9453
9453
|
try {
|
9454
9454
|
// Hide UXbert UI elements before capturing
|
9455
9455
|
this.hideUXbertElements();
|
9456
9456
|
const originalScrollY = window.scrollY;
|
9457
9457
|
let canvas;
|
9458
|
-
if (mode ===
|
9458
|
+
if (mode === "viewport") {
|
9459
9459
|
// Capture only the current viewport
|
9460
9460
|
canvas = await html2canvas(document.body, {
|
9461
|
+
// foreignObjectRendering: true,
|
9461
9462
|
useCORS: true,
|
9462
|
-
allowTaint:
|
9463
|
-
logging:
|
9463
|
+
allowTaint: true,
|
9464
|
+
logging: true,
|
9464
9465
|
width: window.innerWidth,
|
9465
9466
|
height: window.innerHeight,
|
9466
9467
|
windowWidth: window.innerWidth,
|
@@ -9469,12 +9470,12 @@ class Screenshot {
|
|
9469
9470
|
y: window.scrollY,
|
9470
9471
|
ignoreElements: (element) => {
|
9471
9472
|
// Skip cross-origin images that might cause issues
|
9472
|
-
if (element.tagName ===
|
9473
|
+
if (element.tagName === "IMG") {
|
9473
9474
|
const img = element;
|
9474
9475
|
try {
|
9475
9476
|
// Test if image is accessible
|
9476
|
-
const canvas = document.createElement(
|
9477
|
-
const ctx = canvas.getContext(
|
9477
|
+
const canvas = document.createElement("canvas");
|
9478
|
+
const ctx = canvas.getContext("2d");
|
9478
9479
|
canvas.width = 1;
|
9479
9480
|
canvas.height = 1;
|
9480
9481
|
ctx?.drawImage(img, 0, 0, 1, 1);
|
@@ -9483,7 +9484,7 @@ class Screenshot {
|
|
9483
9484
|
}
|
9484
9485
|
catch (e) {
|
9485
9486
|
// Image is tainted, skip it
|
9486
|
-
console.warn(
|
9487
|
+
console.warn("Skipping cross-origin image:", img.src);
|
9487
9488
|
return true;
|
9488
9489
|
}
|
9489
9490
|
}
|
@@ -9506,12 +9507,12 @@ class Screenshot {
|
|
9506
9507
|
height: fullPageHeight,
|
9507
9508
|
ignoreElements: (element) => {
|
9508
9509
|
// Skip cross-origin images that might cause issues
|
9509
|
-
if (element.tagName ===
|
9510
|
+
if (element.tagName === "IMG") {
|
9510
9511
|
const img = element;
|
9511
9512
|
try {
|
9512
9513
|
// Test if image is accessible
|
9513
|
-
const canvas = document.createElement(
|
9514
|
-
const ctx = canvas.getContext(
|
9514
|
+
const canvas = document.createElement("canvas");
|
9515
|
+
const ctx = canvas.getContext("2d");
|
9515
9516
|
canvas.width = 1;
|
9516
9517
|
canvas.height = 1;
|
9517
9518
|
ctx?.drawImage(img, 0, 0, 1, 1);
|
@@ -9520,7 +9521,7 @@ class Screenshot {
|
|
9520
9521
|
}
|
9521
9522
|
catch (e) {
|
9522
9523
|
// Image is tainted, skip it
|
9523
|
-
console.warn(
|
9524
|
+
console.warn("Skipping cross-origin image:", img.src);
|
9524
9525
|
return true;
|
9525
9526
|
}
|
9526
9527
|
}
|
@@ -10202,7 +10203,7 @@ class Reportly {
|
|
10202
10203
|
}
|
10203
10204
|
init(userConfig = {}) {
|
10204
10205
|
// Check if we're in a browser environment
|
10205
|
-
if (typeof window ===
|
10206
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
10206
10207
|
console.warn("Uxbert Reportly can only be initialized in a browser environment");
|
10207
10208
|
return;
|
10208
10209
|
}
|
@@ -10269,7 +10270,7 @@ class Reportly {
|
|
10269
10270
|
try {
|
10270
10271
|
this.state?.setState(STATE.CAPTURING);
|
10271
10272
|
// Get capture mode from modal
|
10272
|
-
const captureMode = this.modal?.getCaptureMode() ||
|
10273
|
+
const captureMode = this.modal?.getCaptureMode() || "viewport";
|
10273
10274
|
// Save capture mode in state
|
10274
10275
|
this.state?.setCaptureMode(captureMode);
|
10275
10276
|
// Capture screenshot
|
@@ -10289,7 +10290,7 @@ class Reportly {
|
|
10289
10290
|
this.state?.setState(STATE.ANNOTATING);
|
10290
10291
|
this.modal?.close();
|
10291
10292
|
this.button?.hide();
|
10292
|
-
const captureMode = this.state?.getCaptureMode() ||
|
10293
|
+
const captureMode = this.state?.getCaptureMode() || "viewport";
|
10293
10294
|
this.annotation?.show(captureMode);
|
10294
10295
|
this.toolbar?.show();
|
10295
10296
|
}
|
@@ -10326,16 +10327,13 @@ class Reportly {
|
|
10326
10327
|
}
|
10327
10328
|
async retakeScreenshot() {
|
10328
10329
|
try {
|
10329
|
-
// Get the current capture mode from modal before closing
|
10330
|
-
const captureMode = this.modal?.getCaptureMode() || 'viewport';
|
10331
10330
|
this.modal?.close();
|
10332
10331
|
this.state?.setState(STATE.CAPTURING);
|
10333
10332
|
// Clear previous annotations
|
10334
10333
|
this.annotation?.clear();
|
10335
|
-
// Capture new screenshot
|
10336
|
-
const screenshot = await this.screenshot.capture(
|
10334
|
+
// Capture new screenshot
|
10335
|
+
const screenshot = await this.screenshot.capture();
|
10337
10336
|
this.state?.setScreenshot(screenshot);
|
10338
|
-
this.state?.setCaptureMode(captureMode);
|
10339
10337
|
// Show modal with new screenshot
|
10340
10338
|
this.modal?.setScreenshot(screenshot);
|
10341
10339
|
this.modal?.open();
|
@@ -10352,7 +10350,7 @@ class Reportly {
|
|
10352
10350
|
// Create complete issue package
|
10353
10351
|
const completeIssue = {
|
10354
10352
|
...issueData,
|
10355
|
-
screenshot: this.state?.getScreenshot() ||
|
10353
|
+
screenshot: this.state?.getScreenshot() || "",
|
10356
10354
|
deviceInfo: this.deviceInfo.get(),
|
10357
10355
|
createdAt: new Date().toISOString(),
|
10358
10356
|
};
|