@checkflow/sdk 1.1.2 → 1.1.3

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/vue.mjs CHANGED
@@ -21,7 +21,7 @@ function useCheckflow() {
21
21
  },
22
22
  screenshot: async () => {
23
23
  if (typeof window === "undefined") return null;
24
- const { captureScreenshot } = await import("./screenshot-CUMBPE2T.mjs");
24
+ const { captureScreenshot } = await import("./screenshot-HXKGZNCZ.mjs");
25
25
  return captureScreenshot();
26
26
  },
27
27
  highlight: async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkflow/sdk",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Lightweight bug reporter & feedback SDK for Checkflow — with screenshot capture, element highlighting, and framework integrations",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1,83 +0,0 @@
1
- // src/screenshot.ts
2
- var screenshotData = null;
3
- async function captureScreenshot() {
4
- try {
5
- if (typeof window.html2canvas === "function") {
6
- const canvas2 = await window.html2canvas(document.body, {
7
- useCORS: true,
8
- allowTaint: true,
9
- scale: Math.min(window.devicePixelRatio, 2),
10
- logging: false,
11
- width: window.innerWidth,
12
- height: window.innerHeight,
13
- x: window.scrollX,
14
- y: window.scrollY
15
- });
16
- screenshotData = canvas2.toDataURL("image/png", 0.8);
17
- return screenshotData;
18
- }
19
- const canvas = document.createElement("canvas");
20
- const ctx = canvas.getContext("2d");
21
- if (!ctx) return null;
22
- canvas.width = window.innerWidth;
23
- canvas.height = window.innerHeight;
24
- ctx.fillStyle = "#ffffff";
25
- ctx.fillRect(0, 0, canvas.width, canvas.height);
26
- ctx.fillStyle = "#333333";
27
- ctx.font = "14px system-ui";
28
- ctx.fillText(`Page: ${window.location.href}`, 10, 30);
29
- ctx.fillText(`Viewport: ${window.innerWidth}x${window.innerHeight}`, 10, 50);
30
- ctx.fillText(`Screenshot captured at ${(/* @__PURE__ */ new Date()).toISOString()}`, 10, 70);
31
- const svgData = `
32
- <svg xmlns="http://www.w3.org/2000/svg" width="${window.innerWidth}" height="${window.innerHeight}">
33
- <foreignObject width="100%" height="100%">
34
- <div xmlns="http://www.w3.org/1999/xhtml">
35
- ${document.documentElement.outerHTML}
36
- </div>
37
- </foreignObject>
38
- </svg>`;
39
- try {
40
- const blob = new Blob([svgData], { type: "image/svg+xml;charset=utf-8" });
41
- const url = URL.createObjectURL(blob);
42
- const img = new Image();
43
- await new Promise((resolve, reject) => {
44
- img.onload = () => resolve();
45
- img.onerror = () => reject();
46
- img.src = url;
47
- });
48
- ctx.drawImage(img, 0, 0);
49
- URL.revokeObjectURL(url);
50
- } catch {
51
- }
52
- screenshotData = canvas.toDataURL("image/png", 0.8);
53
- return screenshotData;
54
- } catch {
55
- return null;
56
- }
57
- }
58
- function getLastScreenshot() {
59
- return screenshotData;
60
- }
61
- function clearScreenshot() {
62
- screenshotData = null;
63
- }
64
- function loadHtml2Canvas() {
65
- return new Promise((resolve, reject) => {
66
- if (typeof window.html2canvas === "function") {
67
- resolve();
68
- return;
69
- }
70
- const script = document.createElement("script");
71
- script.src = "https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js";
72
- script.onload = () => resolve();
73
- script.onerror = () => reject(new Error("Failed to load html2canvas"));
74
- document.head.appendChild(script);
75
- });
76
- }
77
-
78
- export {
79
- captureScreenshot,
80
- getLastScreenshot,
81
- clearScreenshot,
82
- loadHtml2Canvas
83
- };
@@ -1,12 +0,0 @@
1
- import {
2
- captureScreenshot,
3
- clearScreenshot,
4
- getLastScreenshot,
5
- loadHtml2Canvas
6
- } from "./chunk-CQ56DMFR.mjs";
7
- export {
8
- captureScreenshot,
9
- clearScreenshot,
10
- getLastScreenshot,
11
- loadHtml2Canvas
12
- };