canicode 0.8.7 → 0.8.8

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/cli/index.js CHANGED
@@ -28,7 +28,7 @@ __export(visual_compare_exports, {
28
28
  });
29
29
  async function fetchFigmaScreenshot(fileKey, nodeId, token, outputPath) {
30
30
  const res = await fetch(
31
- `https://api.figma.com/v1/images/${fileKey}?ids=${nodeId}&format=png&scale=2`,
31
+ `https://api.figma.com/v1/images/${fileKey}?ids=${nodeId}&format=png&scale=1`,
32
32
  { headers: { "X-Figma-Token": token } }
33
33
  );
34
34
  if (!res.ok) throw new Error(`Figma Images API: ${res.status} ${res.statusText}`);
@@ -50,7 +50,12 @@ async function renderCodeScreenshot(codePath, outputPath, viewport) {
50
50
  timeout: 3e4
51
51
  });
52
52
  await page.waitForTimeout(1e3);
53
- await page.screenshot({ path: outputPath, fullPage: true });
53
+ const root = page.locator("body > *:first-child");
54
+ if (await root.count() > 0) {
55
+ await root.screenshot({ path: outputPath });
56
+ } else {
57
+ await page.screenshot({ path: outputPath });
58
+ }
54
59
  await browser.close();
55
60
  }
56
61
  function resizePng(png, targetWidth, targetHeight) {
@@ -1119,7 +1124,7 @@ async function loadFromApi(fileKey, nodeId, token) {
1119
1124
  }
1120
1125
 
1121
1126
  // package.json
1122
- var version = "0.8.7";
1127
+ var version = "0.8.8";
1123
1128
  var AnalysisNodeTypeSchema = z.enum([
1124
1129
  "DOCUMENT",
1125
1130
  "CANVAS",