@appsurify-testmap/rrweb-all 2.1.1-alpha.1 → 2.1.1-alpha.5

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.
@@ -785,6 +785,19 @@ const interactiveEvents$1 = [
785
785
  "touchend",
786
786
  "touchcancel"
787
787
  ];
788
+ const interactiveTags = [
789
+ "a",
790
+ "button",
791
+ "input",
792
+ "select",
793
+ "textarea",
794
+ "label",
795
+ "details",
796
+ "summary",
797
+ "dialog",
798
+ "video",
799
+ "audio"
800
+ ];
788
801
  const inlineEventAttributes$1 = [
789
802
  "onclick",
790
803
  "ondblclick",
@@ -824,6 +837,25 @@ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
824
837
  EventTarget.prototype.removeEventListener = function(type, listener, options) {
825
838
  originalRemoveEventListener$1.call(this, type, listener, options);
826
839
  };
840
+ function hasEventListeners(n2) {
841
+ return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
842
+ }
843
+ function isElementInteractive(n2) {
844
+ if (n2.nodeType === Node.ELEMENT_NODE) {
845
+ const element = n2;
846
+ const tagName = element.tagName.toLowerCase();
847
+ if (interactiveTags.includes(tagName)) {
848
+ return true;
849
+ }
850
+ const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
851
+ const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
852
+ element.getAttribute("role") || ""
853
+ );
854
+ const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
855
+ return result2;
856
+ }
857
+ return false;
858
+ }
827
859
  function inspectInlineEventHandlers$1() {
828
860
  const allElements = document.querySelectorAll("*");
829
861
  allElements.forEach((el) => {
@@ -1513,6 +1545,7 @@ function serializeNodeWithId(n2, options) {
1513
1545
  }
1514
1546
  if (n2.nodeType === Node.ELEMENT_NODE) {
1515
1547
  serializedNode.isVisible = isElementVisible(n2);
1548
+ serializedNode.isInteractive = isElementInteractive(n2);
1516
1549
  }
1517
1550
  }
1518
1551
  mirror2.add(n2, serializedNode);