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