@appsurify-testmap/rrweb-all 2.0.0-alpha.30 → 2.0.0-alpha.31

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/rrweb-all.js CHANGED
@@ -5,46 +5,6 @@ var _a$1;
5
5
  var __defProp$1 = Object.defineProperty;
6
6
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
7
  var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8
- var InteractiveEvent = /* @__PURE__ */ ((InteractiveEvent2) => {
9
- InteractiveEvent2[InteractiveEvent2["Change"] = 0] = "Change";
10
- InteractiveEvent2[InteractiveEvent2["Submit"] = 1] = "Submit";
11
- InteractiveEvent2[InteractiveEvent2["DragStart"] = 2] = "DragStart";
12
- InteractiveEvent2[InteractiveEvent2["Drop"] = 3] = "Drop";
13
- InteractiveEvent2[InteractiveEvent2["PointerDown"] = 4] = "PointerDown";
14
- InteractiveEvent2[InteractiveEvent2["PointerUp"] = 5] = "PointerUp";
15
- InteractiveEvent2[InteractiveEvent2["Input"] = 6] = "Input";
16
- InteractiveEvent2[InteractiveEvent2["KeyDown"] = 7] = "KeyDown";
17
- InteractiveEvent2[InteractiveEvent2["KeyUp"] = 8] = "KeyUp";
18
- InteractiveEvent2[InteractiveEvent2["KeyPress"] = 9] = "KeyPress";
19
- InteractiveEvent2[InteractiveEvent2["MouseEnter"] = 10] = "MouseEnter";
20
- InteractiveEvent2[InteractiveEvent2["MouseLeave"] = 11] = "MouseLeave";
21
- InteractiveEvent2[InteractiveEvent2["MouseUp"] = 12] = "MouseUp";
22
- InteractiveEvent2[InteractiveEvent2["MouseDown"] = 13] = "MouseDown";
23
- InteractiveEvent2[InteractiveEvent2["Click"] = 14] = "Click";
24
- InteractiveEvent2[InteractiveEvent2["ContextMenu"] = 15] = "ContextMenu";
25
- InteractiveEvent2[InteractiveEvent2["DblClick"] = 16] = "DblClick";
26
- InteractiveEvent2[InteractiveEvent2["Focus"] = 17] = "Focus";
27
- InteractiveEvent2[InteractiveEvent2["Blur"] = 18] = "Blur";
28
- InteractiveEvent2[InteractiveEvent2["TouchStart"] = 19] = "TouchStart";
29
- InteractiveEvent2[InteractiveEvent2["TouchMove"] = 20] = "TouchMove";
30
- InteractiveEvent2[InteractiveEvent2["TouchEnd"] = 21] = "TouchEnd";
31
- InteractiveEvent2[InteractiveEvent2["TouchCancel"] = 22] = "TouchCancel";
32
- return InteractiveEvent2;
33
- })(InteractiveEvent || {});
34
- var interactiveTag = /* @__PURE__ */ ((interactiveTag2) => {
35
- interactiveTag2[interactiveTag2["Input"] = 0] = "Input";
36
- interactiveTag2[interactiveTag2["Button"] = 1] = "Button";
37
- interactiveTag2[interactiveTag2["A"] = 2] = "A";
38
- interactiveTag2[interactiveTag2["Select"] = 3] = "Select";
39
- interactiveTag2[interactiveTag2["Textarea"] = 4] = "Textarea";
40
- interactiveTag2[interactiveTag2["Label"] = 5] = "Label";
41
- interactiveTag2[interactiveTag2["Details"] = 6] = "Details";
42
- interactiveTag2[interactiveTag2["Summary"] = 7] = "Summary";
43
- interactiveTag2[interactiveTag2["Dialog"] = 8] = "Dialog";
44
- interactiveTag2[interactiveTag2["Video"] = 9] = "Video";
45
- interactiveTag2[interactiveTag2["Audio"] = 10] = "Audio";
46
- return interactiveTag2;
47
- })(interactiveTag || {});
48
8
  var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
49
9
  NodeType2[NodeType2["Document"] = 0] = "Document";
50
10
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
@@ -636,32 +596,94 @@ function isStyleVisible(n2) {
636
596
  function isRectVisible(rect) {
637
597
  return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
638
598
  }
639
- function getInteractiveEvents() {
640
- return Object.keys(InteractiveEvent).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
641
- }
642
- function getInteractiveTags() {
643
- return Object.keys(interactiveTag).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
644
- }
599
+ const interactiveEvents$1 = [
600
+ "change",
601
+ "submit",
602
+ "dragstart",
603
+ "drop",
604
+ "pointerdown",
605
+ "pointerup",
606
+ "input",
607
+ "keydown",
608
+ "keyup",
609
+ "keypress",
610
+ "mouseenter",
611
+ "mouseleave",
612
+ "mouseup",
613
+ "mousedown",
614
+ "click",
615
+ "contextmenu",
616
+ "dblclick",
617
+ "focus",
618
+ "blur",
619
+ "touchstart",
620
+ "touchmove",
621
+ "touchend",
622
+ "touchcancel"
623
+ ];
624
+ const interactiveTags = [
625
+ "a",
626
+ "button",
627
+ "input",
628
+ "select",
629
+ "textarea",
630
+ "label",
631
+ "details",
632
+ "summary",
633
+ "dialog",
634
+ "video",
635
+ "audio"
636
+ ];
637
+ const inlineEventAttributes$1 = [
638
+ "onclick",
639
+ "ondblclick",
640
+ "onmousedown",
641
+ "onmouseup",
642
+ "onmouseover",
643
+ "onmouseout",
644
+ "onmousemove",
645
+ "onfocus",
646
+ "onblur",
647
+ "onkeydown",
648
+ "onkeypress",
649
+ "onkeyup",
650
+ "onchange",
651
+ "oninput",
652
+ "onsubmit",
653
+ "onreset",
654
+ "onselect",
655
+ "oncontextmenu",
656
+ "ontouchstart",
657
+ "ontouchmove",
658
+ "ontouchend",
659
+ "ontouchcancel"
660
+ ];
661
+ const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
662
+ const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
663
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
664
+ originalAddEventListener$1.call(this, type, listener, options);
665
+ if (this instanceof Element) {
666
+ const eventType = type.toLowerCase();
667
+ console.info("Event type: ", eventType);
668
+ if (interactiveEvents$1.includes(eventType)) {
669
+ interactiveElementsRegistry$1.add(this);
670
+ }
671
+ }
672
+ };
673
+ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
674
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
675
+ originalRemoveEventListener$1.call(this, type, listener, options);
676
+ };
645
677
  function hasEventListeners(n2) {
646
- return getInteractiveEvents().some((eventType) => {
647
- let hasListener = false;
648
- const testListener = () => {
649
- hasListener = true;
650
- };
651
- n2.addEventListener(eventType, testListener);
652
- n2.dispatchEvent(new Event(eventType));
653
- n2.removeEventListener(eventType, testListener);
654
- return hasListener;
655
- });
678
+ return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
656
679
  }
657
680
  function isElementInteractive(n2) {
658
681
  var _a2;
659
- const allowedTags = getInteractiveTags();
660
682
  if (n2.nodeType === Node.ELEMENT_NODE) {
661
683
  const element = n2;
662
684
  const tagName = element.tagName.toLowerCase();
663
- if (!allowedTags.includes(tagName)) {
664
- return false;
685
+ if (interactiveTags.includes(tagName)) {
686
+ return true;
665
687
  }
666
688
  const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
667
689
  const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
@@ -673,10 +695,28 @@ function isElementInteractive(n2) {
673
695
  if (n2.nodeType === Node.TEXT_NODE) {
674
696
  const textNode = n2;
675
697
  const parentElement2 = textNode.parentElement;
676
- return parentElement2 !== null && allowedTags.includes(parentElement2.tagName.toLowerCase()) && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
698
+ if (parentElement2 !== null && interactiveTags.includes(parentElement2.tagName.toLowerCase())) {
699
+ return true;
700
+ }
701
+ return parentElement2 !== null && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
677
702
  }
678
703
  return false;
679
704
  }
705
+ function inspectInlineEventHandlers$1() {
706
+ const allElements = document.querySelectorAll("*");
707
+ allElements.forEach((el) => {
708
+ inlineEventAttributes$1.forEach((attr) => {
709
+ if (el.hasAttribute(attr)) {
710
+ interactiveElementsRegistry$1.add(el);
711
+ }
712
+ });
713
+ });
714
+ }
715
+ if (document.readyState === "complete" || document.readyState === "interactive") {
716
+ inspectInlineEventHandlers$1();
717
+ } else {
718
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
719
+ }
680
720
  let _id = 1;
681
721
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
682
722
  const IGNORED_NODE = -2;
@@ -5618,6 +5658,86 @@ let Mirror$1 = class Mirror2 {
5618
5658
  function createMirror$1() {
5619
5659
  return new Mirror$1();
5620
5660
  }
5661
+ const interactiveEvents = [
5662
+ "change",
5663
+ "submit",
5664
+ "dragstart",
5665
+ "drop",
5666
+ "pointerdown",
5667
+ "pointerup",
5668
+ "input",
5669
+ "keydown",
5670
+ "keyup",
5671
+ "keypress",
5672
+ "mouseenter",
5673
+ "mouseleave",
5674
+ "mouseup",
5675
+ "mousedown",
5676
+ "click",
5677
+ "contextmenu",
5678
+ "dblclick",
5679
+ "focus",
5680
+ "blur",
5681
+ "touchstart",
5682
+ "touchmove",
5683
+ "touchend",
5684
+ "touchcancel"
5685
+ ];
5686
+ const inlineEventAttributes = [
5687
+ "onclick",
5688
+ "ondblclick",
5689
+ "onmousedown",
5690
+ "onmouseup",
5691
+ "onmouseover",
5692
+ "onmouseout",
5693
+ "onmousemove",
5694
+ "onfocus",
5695
+ "onblur",
5696
+ "onkeydown",
5697
+ "onkeypress",
5698
+ "onkeyup",
5699
+ "onchange",
5700
+ "oninput",
5701
+ "onsubmit",
5702
+ "onreset",
5703
+ "onselect",
5704
+ "oncontextmenu",
5705
+ "ontouchstart",
5706
+ "ontouchmove",
5707
+ "ontouchend",
5708
+ "ontouchcancel"
5709
+ ];
5710
+ const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
5711
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
5712
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
5713
+ originalAddEventListener.call(this, type, listener, options);
5714
+ if (this instanceof Element) {
5715
+ const eventType = type.toLowerCase();
5716
+ console.info("Event type: ", eventType);
5717
+ if (interactiveEvents.includes(eventType)) {
5718
+ interactiveElementsRegistry.add(this);
5719
+ }
5720
+ }
5721
+ };
5722
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
5723
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
5724
+ originalRemoveEventListener.call(this, type, listener, options);
5725
+ };
5726
+ function inspectInlineEventHandlers() {
5727
+ const allElements = document.querySelectorAll("*");
5728
+ allElements.forEach((el) => {
5729
+ inlineEventAttributes.forEach((attr) => {
5730
+ if (el.hasAttribute(attr)) {
5731
+ interactiveElementsRegistry.add(el);
5732
+ }
5733
+ });
5734
+ });
5735
+ }
5736
+ if (document.readyState === "complete" || document.readyState === "interactive") {
5737
+ inspectInlineEventHandlers();
5738
+ } else {
5739
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5740
+ }
5621
5741
  function getDefaultExportFromCjs(x2) {
5622
5742
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
5623
5743
  }
@@ -11850,6 +11970,7 @@ function initMouseInteractionObserver({
11850
11970
  }) {
11851
11971
  if (sampling.mouseInteraction === false) {
11852
11972
  return () => {
11973
+ console.debug("MouseInteractionObserver: No operation needed");
11853
11974
  };
11854
11975
  }
11855
11976
  const disableMap = sampling.mouseInteraction === true || sampling.mouseInteraction === void 0 ? {} : sampling.mouseInteraction;