linear-grab 0.14.0 → 0.14.1

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.
@@ -3164,7 +3164,12 @@ async function Dr(e) {
3164
3164
  }
3165
3165
  t.push(n);
3166
3166
  }
3167
- await Er(t.slice(-8));
3167
+ let n = /* @__PURE__ */ new Set(), r = [];
3168
+ for (let e = t.length - 1; e >= 0; e--) {
3169
+ let i = t[e], a = i.source?.filePath ? `${i.source.filePath}:${i.source.lineNumber ?? ""}` : `id:${i.grabbedAt}`;
3170
+ n.has(a) || (n.add(a), r.unshift(i));
3171
+ }
3172
+ await Er(r.slice(-8));
3168
3173
  }
3169
3174
  async function Or(e) {
3170
3175
  await Er((await Tr() ?? []).filter((t) => t.grabbedAt !== e));
@@ -27385,11 +27390,11 @@ async function jA(e, t) {
27385
27390
  } finally {
27386
27391
  URL.revokeObjectURL(s);
27387
27392
  }
27388
- let l = Math.min(window.devicePixelRatio || 1, 1.5), u = document.createElement("canvas");
27389
- u.width = Math.round(r * l), u.height = Math.round(i * l);
27390
- let d = u.getContext("2d");
27391
- if (!d) throw Error("Canvas 2d unavailable");
27392
- return d.drawImage(c, 0, 0, u.width, u.height), u;
27393
+ let l = 8192, u = Math.min(window.devicePixelRatio || 1, 1.5, l / r, l / i), d = document.createElement("canvas");
27394
+ d.width = Math.max(1, Math.round(r * u)), d.height = Math.max(1, Math.round(i * u));
27395
+ let f = d.getContext("2d");
27396
+ if (!f) throw Error("Canvas 2d unavailable");
27397
+ return f.drawImage(c, 0, 0, d.width, d.height), d;
27393
27398
  }
27394
27399
  //#endregion
27395
27400
  //#region src/lib/elementShot.ts
@@ -41747,7 +41752,7 @@ function eQ() {
41747
41752
  o(null), m(!0), window.dispatchEvent(new CustomEvent(SZ));
41748
41753
  try {
41749
41754
  let e = await MZ();
41750
- e && await Dr([e]);
41755
+ e ? await Dr([e]) : o("Region capture failed — try a smaller area (huge scrollers exceed canvas limits), or it was cancelled.");
41751
41756
  } finally {
41752
41757
  m(!1);
41753
41758
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-grab",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "description": "Point at any React element in your dev app, draft a Linear issue with AI, delegate it to the Cursor agent, and track it live — in any browser.",
6
6
  "exports": {