@mahmulp/feedback-sdk 0.0.5 → 0.1.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.
package/dist/index.cjs CHANGED
@@ -184,7 +184,10 @@ var LauncherManager = class {
184
184
  __publicField(this, "state", {
185
185
  enabled: false,
186
186
  pinsVisible: true,
187
- launcherVisible: true
187
+ // Start collapsed — only the small reveal bubble is visible until the
188
+ // user clicks it. Less visual weight on the prototype out of the box;
189
+ // user opts in by clicking the bubble icon in the bottom-right.
190
+ launcherVisible: false
188
191
  });
189
192
  this.launcherEl = document.createElement("div");
190
193
  this.launcherEl.className = "launcher";
@@ -1230,8 +1233,6 @@ async function captureViewport(options = {}) {
1230
1233
  const html2canvas = await loadHtml2Canvas();
1231
1234
  if (!html2canvas) return null;
1232
1235
  const host = document.querySelector(`[${HOST_ATTR2}]`);
1233
- const previousVisibility = host?.style.visibility ?? "";
1234
- if (host) host.style.visibility = "hidden";
1235
1236
  try {
1236
1237
  const canvas = await html2canvas(document.documentElement, {
1237
1238
  backgroundColor: null,
@@ -1244,7 +1245,12 @@ async function captureViewport(options = {}) {
1244
1245
  windowHeight: window.innerHeight,
1245
1246
  logging: false,
1246
1247
  useCORS: true,
1247
- allowTaint: false
1248
+ allowTaint: false,
1249
+ ignoreElements: (el) => {
1250
+ if (host && (el === host || host.contains(el))) return true;
1251
+ if (el instanceof HTMLElement && el.hasAttribute(HOST_ATTR2)) return true;
1252
+ return false;
1253
+ }
1248
1254
  });
1249
1255
  return await canvasToBlob(canvas, opts.mimeType, opts.quality);
1250
1256
  } catch (err) {
@@ -1252,8 +1258,6 @@ async function captureViewport(options = {}) {
1252
1258
  console.warn("[feedback-sdk] screenshot capture failed:", err);
1253
1259
  }
1254
1260
  return null;
1255
- } finally {
1256
- if (host) host.style.visibility = previousVisibility;
1257
1261
  }
1258
1262
  }
1259
1263
  var html2canvasPromise = null;
@@ -1676,7 +1680,10 @@ function initFeedback(options) {
1676
1680
  const wantsLauncher = options.showLauncher !== false;
1677
1681
  const launcherState = {
1678
1682
  pinsVisible: options.pinsVisible !== false,
1679
- launcherVisible: true
1683
+ // Default to a collapsed launcher. The user reveals it by clicking the
1684
+ // small bubble button in the bottom-right corner. This keeps the SDK's
1685
+ // visual footprint near zero on first paint of the prototype.
1686
+ launcherVisible: false
1680
1687
  };
1681
1688
  overlay.setPinsVisible(launcherState.pinsVisible);
1682
1689
  function syncLauncher() {