@vibecodeapp/sdk 0.4.4 → 0.4.5

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.
@@ -2,7 +2,7 @@
2
2
  * Web version of Screenshot - listens for screenshot requests from parent iframe
3
3
  *
4
4
  * On web, this component listens for postMessage requests and captures
5
- * the current page using html-to-image, then sends the result back.
5
+ * the current page using html2canvas, then sends the result back.
6
6
  */
7
7
  export declare function VibeScreenshot(): null;
8
8
  //# sourceMappingURL=Screenshot.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Screenshot.web.d.ts","sourceRoot":"","sources":["../../src/dev/Screenshot.web.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkDH,wBAAgB,cAAc,SA2B7B"}
1
+ {"version":3,"file":"Screenshot.web.d.ts","sourceRoot":"","sources":["../../src/dev/Screenshot.web.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgDH,wBAAgB,cAAc,SA2B7B"}
@@ -2,22 +2,21 @@
2
2
  * Web version of Screenshot - listens for screenshot requests from parent iframe
3
3
  *
4
4
  * On web, this component listens for postMessage requests and captures
5
- * the current page using html-to-image, then sends the result back.
5
+ * the current page using html2canvas, then sends the result back.
6
6
  */
7
7
  import { useEffect } from 'react';
8
- import { toPng } from 'html-to-image';
8
+ import html2canvas from 'html2canvas';
9
9
  async function captureScreenshot() {
10
- const scale = window.devicePixelRatio || 1;
11
- const width = document.body.scrollWidth;
12
- const height = document.body.scrollHeight;
13
- const image = await toPng(document.body, {
14
- cacheBust: true,
15
- pixelRatio: scale,
10
+ const canvas = await html2canvas(document.body, {
11
+ useCORS: true,
12
+ allowTaint: true,
13
+ backgroundColor: null,
14
+ scale: window.devicePixelRatio || 1,
16
15
  });
17
16
  return {
18
- image,
19
- width: width * scale,
20
- height: height * scale,
17
+ image: canvas.toDataURL('image/png'),
18
+ width: canvas.width,
19
+ height: canvas.height,
21
20
  };
22
21
  }
23
22
  function postScreenshotToParent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": "@vibecodeapp/sdk",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "SDK for Vibecodeapp.com - Web polyfills and Metro configuration for React Native",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "@teovilla/react-native-web-maps": "^0.9.5",
41
41
  "@stardazed/streams-text-encoding": "^1.0.2",
42
42
  "assert": "^2.1.0",
43
- "html-to-image": "^1.11.11",
43
+ "html2canvas": "^1.4.1",
44
44
  "p-limit": "^3.1.0"
45
45
  },
46
46
  "devDependencies": {