@appsurify-testmap/rrweb-record 2.1.1-alpha.1 → 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.
@@ -727,6 +727,19 @@ const interactiveEvents$1 = [
727
727
  "touchend",
728
728
  "touchcancel"
729
729
  ];
730
+ const interactiveTags = [
731
+ "a",
732
+ "button",
733
+ "input",
734
+ "select",
735
+ "textarea",
736
+ "label",
737
+ "details",
738
+ "summary",
739
+ "dialog",
740
+ "video",
741
+ "audio"
742
+ ];
730
743
  const inlineEventAttributes$1 = [
731
744
  "onclick",
732
745
  "ondblclick",
@@ -766,6 +779,25 @@ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
766
779
  EventTarget.prototype.removeEventListener = function(type, listener, options) {
767
780
  originalRemoveEventListener$1.call(this, type, listener, options);
768
781
  };
782
+ function hasEventListeners(n2) {
783
+ return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
784
+ }
785
+ function isElementInteractive(n2) {
786
+ if (n2.nodeType === Node.ELEMENT_NODE) {
787
+ const element = n2;
788
+ const tagName = element.tagName.toLowerCase();
789
+ if (interactiveTags.includes(tagName)) {
790
+ return true;
791
+ }
792
+ const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
793
+ const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
794
+ element.getAttribute("role") || ""
795
+ );
796
+ const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
797
+ return result2;
798
+ }
799
+ return false;
800
+ }
769
801
  function inspectInlineEventHandlers$1() {
770
802
  const allElements = document.querySelectorAll("*");
771
803
  allElements.forEach((el) => {
@@ -1455,6 +1487,7 @@ function serializeNodeWithId(n2, options) {
1455
1487
  }
1456
1488
  if (n2.nodeType === Node.ELEMENT_NODE) {
1457
1489
  serializedNode.isVisible = isElementVisible(n2);
1490
+ serializedNode.isInteractive = isElementInteractive(n2);
1458
1491
  }
1459
1492
  }
1460
1493
  mirror2.add(n2, serializedNode);