makethisbetter 1.28.2 → 1.28.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.
@@ -1 +1 @@
1
- {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/screenshot/capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQ7D,OAAO,KAAK,EAAoB,IAAI,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAatE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,IAAI,CAAA;IACb,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;;;;OAKG;IACH,UAAU,EAAE,YAAY,CAAA;CACzB;AA+BD,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAe9D;AAqBD,MAAM,MAAM,6BAA6B,GAAG,CAC1C,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,KACjB,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;AAErD,wBAAsB,qBAAqB,CACzC,mBAAmB,CAAC,EAAE,6BAA6B,EACnD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAsDhC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,WAAW,GAAE,UAAU,EAAO,EAC9B,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAStB;AAED,wBAAsB,iBAAiB,CACrC,WAAW,GAAE,UAAU,EAAO,EAC9B,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAItB"}
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/screenshot/capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQ7D,OAAO,KAAK,EAAoB,IAAI,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAatE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,IAAI,CAAA;IACb,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;;;;OAKG;IACH,UAAU,EAAE,YAAY,CAAA;CACzB;AA+BD,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAe9D;AAqBD,MAAM,MAAM,6BAA6B,GAAG,CAC1C,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,KACjB,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;AAErD,wBAAsB,qBAAqB,CACzC,mBAAmB,CAAC,EAAE,6BAA6B,EACnD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA4DhC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,WAAW,GAAE,UAAU,EAAO,EAC9B,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAStB;AAED,wBAAsB,iBAAiB,CACrC,WAAW,GAAE,UAAU,EAAO,EAC9B,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAItB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makethisbetter",
3
- "version": "1.28.2",
3
+ "version": "1.28.3",
4
4
  "description": "Make This Better JS Widget SDK — embed user feedback collection in any website",
5
5
  "type": "module",
6
6
  "main": "./dist/makethisbetter.cjs",
@@ -112,6 +112,12 @@ export async function captureBaseScreenshot(
112
112
  // module); a load failure rejects here and fails the capture closed to
113
113
  // null, same as any other capture error.
114
114
  const [{ toJpeg }, fontEmbedCSS] = await Promise.all([loadHtmlToImage(), warmFontEmbedCss()])
115
+ // toJpeg clones the entire DOM synchronously and blocks the main thread
116
+ // for 1-2 seconds on complex pages. Yielding here lets pending API
117
+ // responses resolve first so the clarification request fires before the
118
+ // heavy capture work rather than being queued behind it.
119
+ await new Promise<void>(r => setTimeout(r, 0))
120
+ if (signal?.aborted) return null
115
121
  // Measure only after the font warm-up settles: a cold warm-up is long
116
122
  // enough (a hundred-odd requests) for late-arriving fonts to reflow the
117
123
  // page, and a cover measured before that shift lands on the wrong pixels