@mushi-mushi/web 1.7.6 → 1.7.7

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
@@ -3692,6 +3692,7 @@ var DEFAULT_REDACT_SELECTORS = [
3692
3692
  ];
3693
3693
  function buildPrivacySafeDocument(privacy) {
3694
3694
  const clone = document.documentElement.cloneNode(true);
3695
+ clone.querySelector("#mushi-mushi-widget")?.remove();
3695
3696
  const redactSelectors = privacy?.redactSelectors !== void 0 ? privacy.redactSelectors : DEFAULT_REDACT_SELECTORS;
3696
3697
  for (const selector of redactSelectors) {
3697
3698
  for (const el of safeQueryAll(clone, selector)) {
@@ -4781,7 +4782,7 @@ function createProactiveManager(config = {}) {
4781
4782
 
4782
4783
  // src/version.ts
4783
4784
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
4784
- var MUSHI_SDK_VERSION = "1.7.6" ;
4785
+ var MUSHI_SDK_VERSION = "1.7.7" ;
4785
4786
 
4786
4787
  // src/mushi.ts
4787
4788
  var instance = null;
@@ -4962,13 +4963,30 @@ function createInstance(config) {
4962
4963
  });
4963
4964
  let detachAutoBreadcrumbs = null;
4964
4965
  detachAutoBreadcrumbs = installAutoBreadcrumbs(breadcrumbs);
4966
+ async function takeScreenshotWithoutChrome() {
4967
+ if (!screenshotCap) return null;
4968
+ const panelWasVisible = widget.getIsOpen();
4969
+ if (panelWasVisible) widget.hidePanel();
4970
+ const host = document.getElementById("mushi-mushi-widget");
4971
+ const prevVisibility = host?.style.visibility ?? "";
4972
+ if (host) host.style.visibility = "hidden";
4973
+ await new Promise((resolve) => {
4974
+ requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
4975
+ });
4976
+ try {
4977
+ return await screenshotCap.take();
4978
+ } finally {
4979
+ if (host) host.style.visibility = prevVisibility;
4980
+ if (panelWasVisible) widget.showPanel();
4981
+ }
4982
+ }
4965
4983
  async function autoCaptureScreenshot(when) {
4966
4984
  const mode = activeConfig.capture?.screenshot;
4967
4985
  if (!screenshotCap || mode === "off" || pendingScreenshot) return;
4968
4986
  if (when === "open" && mode !== "auto") return;
4969
4987
  if (when === "submit" && mode !== "on-report" && mode !== "auto") return;
4970
4988
  log.debug("Auto-capturing screenshot", { when, mode });
4971
- pendingScreenshot = await screenshotCap.take();
4989
+ pendingScreenshot = await takeScreenshotWithoutChrome();
4972
4990
  widget.setScreenshotAttached(pendingScreenshot !== null);
4973
4991
  }
4974
4992
  widget = new MushiWidget(bootstrapConfig.widget, {
@@ -4998,7 +5016,7 @@ function createInstance(config) {
4998
5016
  onScreenshotRequest: async () => {
4999
5017
  if (!screenshotCap || activeConfig.capture?.screenshot === "off") return;
5000
5018
  log.debug("Taking screenshot");
5001
- pendingScreenshot = await screenshotCap.take();
5019
+ pendingScreenshot = await takeScreenshotWithoutChrome();
5002
5020
  widget.setScreenshotAttached(pendingScreenshot !== null);
5003
5021
  },
5004
5022
  onScreenshotRemove: () => {