@mahmulp/feedback-sdk 0.0.1 → 0.0.2

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/index.js CHANGED
@@ -234,6 +234,7 @@ var LauncherManager = class {
234
234
  /** True when an event originated from the launcher's own UI. */
235
235
  ownsNode(node) {
236
236
  if (!node) return false;
237
+ if (typeof Node === "undefined" || !(node instanceof Node)) return false;
237
238
  return this.launcherEl.contains(node) || this.revealEl.contains(node);
238
239
  }
239
240
  destroy() {
@@ -1196,13 +1197,21 @@ async function captureViewport(options = {}) {
1196
1197
  }
1197
1198
  }
1198
1199
  var html2canvasPromise = null;
1200
+ var html2canvasMissingWarned = false;
1199
1201
  async function loadHtml2Canvas() {
1200
1202
  if (html2canvasPromise) return html2canvasPromise;
1201
1203
  html2canvasPromise = (async () => {
1202
1204
  try {
1203
1205
  const mod = await import('html2canvas');
1204
1206
  return mod.default ?? mod ?? null;
1205
- } catch {
1207
+ } catch (err) {
1208
+ if (!html2canvasMissingWarned && typeof console !== "undefined") {
1209
+ html2canvasMissingWarned = true;
1210
+ console.warn(
1211
+ "[feedback-sdk] screenshot capture disabled: failed to load `html2canvas`. This shouldn't normally happen \u2014 html2canvas is a direct dependency of the SDK. Pass `captureScreenshots: false` to silence this warning if intended.",
1212
+ err
1213
+ );
1214
+ }
1206
1215
  return null;
1207
1216
  }
1208
1217
  })();