@appsurify-testmap/rrweb-player 2.1.0-alpha.7 → 2.1.1-alpha.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.
@@ -9699,6 +9699,41 @@ function patch(source, name, replacement) {
9699
9699
  };
9700
9700
  }
9701
9701
  }
9702
+ function describeNode(el) {
9703
+ const tag = el.tagName.toLowerCase();
9704
+ const id = el.id ? `#${el.id}` : "";
9705
+ const classes = el.classList.length ? "." + Array.from(el.classList).join(".") : "";
9706
+ return `${tag}${id}${classes}`;
9707
+ }
9708
+ function getElementVisibility(el) {
9709
+ var _a2, _b2;
9710
+ const win = ((_a2 = el.ownerDocument) == null ? void 0 : _a2.defaultView) ?? window;
9711
+ const rect = el.getBoundingClientRect();
9712
+ const viewportWidth = win.innerWidth || win.document.documentElement.clientWidth || 0;
9713
+ const viewportHeight = win.innerHeight || win.document.documentElement.clientHeight || 0;
9714
+ const isRectVisible = rect.width > 0 && rect.height > 0 && rect.bottom > 0 && rect.right > 0 && rect.top < viewportHeight && rect.left < viewportWidth;
9715
+ const style = (_b2 = win.getComputedStyle) == null ? void 0 : _b2.call(win, el);
9716
+ const isStyleVisible2 = !!style && style.display !== "none" && style.visibility !== "hidden" && (parseFloat(style.opacity) || 0) > 0;
9717
+ const isVisible = isStyleVisible2 && isRectVisible;
9718
+ let ratio = 0;
9719
+ if (isVisible) {
9720
+ const xOverlap = Math.max(
9721
+ 0,
9722
+ Math.min(rect.right, viewportWidth) - Math.max(rect.left, 0)
9723
+ );
9724
+ const yOverlap = Math.max(
9725
+ 0,
9726
+ Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0)
9727
+ );
9728
+ const intersectionArea = xOverlap * yOverlap;
9729
+ const elementArea = rect.width * rect.height;
9730
+ ratio = elementArea > 0 ? intersectionArea / elementArea : 0;
9731
+ }
9732
+ return {
9733
+ isVisible,
9734
+ ratio
9735
+ };
9736
+ }
9702
9737
  const index = {
9703
9738
  childNodes,
9704
9739
  parentNode,
@@ -9712,7 +9747,9 @@ const index = {
9712
9747
  querySelector,
9713
9748
  querySelectorAll,
9714
9749
  mutationObserver: mutationObserverCtor,
9715
- patch
9750
+ patch,
9751
+ describeNode,
9752
+ getElementVisibility
9716
9753
  };
9717
9754
  const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
9718
9755
  let _mirror = {
@@ -9922,6 +9959,7 @@ var IncrementalSource$1 = /* @__PURE__ */ ((IncrementalSource2) => {
9922
9959
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
9923
9960
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
9924
9961
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
9962
+ IncrementalSource2[IncrementalSource2["VisibilityMutation"] = 17] = "VisibilityMutation";
9925
9963
  return IncrementalSource2;
9926
9964
  })(IncrementalSource$1 || {});
9927
9965
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
@@ -13301,6 +13339,7 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
13301
13339
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
13302
13340
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
13303
13341
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
13342
+ IncrementalSource2[IncrementalSource2["VisibilityMutation"] = 17] = "VisibilityMutation";
13304
13343
  return IncrementalSource2;
13305
13344
  })(IncrementalSource || {});
13306
13345
  function inlineCss(cssObj) {