@insitue/sdk 0.1.7 → 0.1.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.
@@ -20,6 +20,17 @@ interface CaptureOnlyOptions {
20
20
  * `window.__insitu_capture__` (useful for prod validation).
21
21
  */
22
22
  onCapture?: (draft: IssueDraft, bundle: CaptureBundle) => void;
23
+ /**
24
+ * Force the pixel-perfect (`getDisplayMedia`) path for every
25
+ * capture from mount. Costs a one-time tab-share permission per
26
+ * session in exchange for screenshots that are guaranteed to
27
+ * match what the user actually saw — bypasses every html-to-image
28
+ * quirk (next/image srcset, video frames, canvas content,
29
+ * cross-origin assets). Use in dev/dogfood where capture quality
30
+ * matters more than permission UX; leave off for prod end-users
31
+ * who shouldn't see a permission dialog uninvited.
32
+ */
33
+ defaultPixelPerfect?: boolean;
23
34
  }
24
35
  declare function mountCaptureOnly(opts?: CaptureOnlyOptions): () => void;
25
36
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mountCaptureOnly
3
- } from "./chunk-3ZUAZAJB.js";
3
+ } from "./chunk-KAHON3H3.js";
4
4
  import "./chunk-AMC2RGMK.js";
5
5
  export {
6
6
  mountCaptureOnly
@@ -8,6 +8,7 @@ import {
8
8
  k,
9
9
  onDisplayMediaChange,
10
10
  retryDisplayMedia,
11
+ setCaptureSettings,
11
12
  stopDisplayMedia,
12
13
  y
13
14
  } from "./chunk-AMC2RGMK.js";
@@ -353,8 +354,8 @@ function CaptureOnlyApp(props) {
353
354
  k("span", {}, "\u{1F512} Secrets scrubbed automatically"),
354
355
  k(
355
356
  "span",
356
- { title: `@insitue/sdk@${"0.1.7"}` },
357
- `InSitue \xB7 v${"0.1.7"}`
357
+ { title: `@insitue/sdk@${"0.1.8"}` },
358
+ `InSitue \xB7 v${"0.1.8"}`
358
359
  )
359
360
  ]
360
361
  )
@@ -362,6 +363,9 @@ function CaptureOnlyApp(props) {
362
363
  }
363
364
  function mountCaptureOnly(opts = {}) {
364
365
  installRuntimeCollectors();
366
+ if (opts.defaultPixelPerfect === true) {
367
+ setCaptureSettings({ alwaysPixelPerfect: true });
368
+ }
365
369
  const host = document.createElement("div");
366
370
  host.id = "insitu-capture-root";
367
371
  host.setAttribute("data-insitu", "");
package/dist/index.d.ts CHANGED
@@ -21,6 +21,18 @@ interface InSitueCaptureProps {
21
21
  * (neither set): console + JSON download + `window.__insitu_capture__`.
22
22
  */
23
23
  onCapture?: (draft: IssueDraft, bundle: CaptureBundle) => void;
24
+ /**
25
+ * Default the user's "Always pixel-perfect screenshots" setting
26
+ * to `true` on mount — every capture uses the `getDisplayMedia`
27
+ * OS-compositor path, paying a one-time tab-share permission per
28
+ * session in exchange for screenshots that are pixel-accurate
29
+ * across any content (next/image, video, canvas, cross-origin).
30
+ *
31
+ * Recommended for dev / dogfood, where capture quality matters
32
+ * more than the permission UX. Not the default — production
33
+ * end-users shouldn't see a permission dialog they didn't ask for.
34
+ */
35
+ defaultPixelPerfect?: boolean;
24
36
  }
25
37
  /**
26
38
  * `<InSitueCapture />` — the prod capture-only path. UNLIKE
@@ -31,7 +43,7 @@ interface InSitueCaptureProps {
31
43
  * The simplest path: set `projectKey` and the SDK POSTs captures to
32
44
  * the InSitue cloud automatically.
33
45
  */
34
- declare function InSitueCapture({ projectKey, endpoint, onCapture, }: InSitueCaptureProps): null;
46
+ declare function InSitueCapture({ projectKey, endpoint, onCapture, defaultPixelPerfect, }: InSitueCaptureProps): null;
35
47
 
36
48
  /** Build-time-inlined version of `@insitue/sdk` (from package.json).
37
49
  * Exposed so the host app can self-verify which SDK build is loaded
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mountCaptureOnly
3
- } from "./chunk-3ZUAZAJB.js";
3
+ } from "./chunk-KAHON3H3.js";
4
4
  import {
5
5
  mountInSitue
6
6
  } from "./chunk-DBHURN5L.js";
@@ -27,26 +27,32 @@ function InSitue({ port }) {
27
27
  function InSitueCapture({
28
28
  projectKey,
29
29
  endpoint,
30
- onCapture
30
+ onCapture,
31
+ defaultPixelPerfect
31
32
  }) {
32
33
  useEffect(() => {
33
34
  let active = true;
34
35
  let dispose;
35
36
  void import("./capture-only.js").then((m) => {
36
37
  if (active) {
37
- dispose = m.mountCaptureOnly({ projectKey, endpoint, onCapture });
38
+ dispose = m.mountCaptureOnly({
39
+ projectKey,
40
+ endpoint,
41
+ onCapture,
42
+ defaultPixelPerfect
43
+ });
38
44
  }
39
45
  });
40
46
  return () => {
41
47
  active = false;
42
48
  dispose?.();
43
49
  };
44
- }, [projectKey, endpoint, onCapture]);
50
+ }, [projectKey, endpoint, onCapture, defaultPixelPerfect]);
45
51
  return null;
46
52
  }
47
53
 
48
54
  // src/index.ts
49
- var SDK_VERSION = "0.1.7";
55
+ var SDK_VERSION = "0.1.8";
50
56
  export {
51
57
  InSitue,
52
58
  InSitueCapture,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insitue/sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "InSitue capture SDK — drop one snippet into your deployed app; your users point at a bug, InSitue opens a verified pull request.",
5
5
  "license": "MIT",
6
6
  "type": "module",