@appsurify-testmap/rrweb-replay 2.0.0-alpha.30 → 2.0.0-alpha.32

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.
@@ -92,6 +92,85 @@ function isNodeMetaEqual(a2, b) {
92
92
  function isElement(n2) {
93
93
  return n2.nodeType === n2.ELEMENT_NODE;
94
94
  }
95
+ const interactiveEvents$1 = [
96
+ "change",
97
+ "submit",
98
+ "dragstart",
99
+ "drop",
100
+ "pointerdown",
101
+ "pointerup",
102
+ "input",
103
+ "keydown",
104
+ "keyup",
105
+ "keypress",
106
+ "mouseenter",
107
+ "mouseleave",
108
+ "mouseup",
109
+ "mousedown",
110
+ "click",
111
+ "contextmenu",
112
+ "dblclick",
113
+ "focus",
114
+ "blur",
115
+ "touchstart",
116
+ "touchmove",
117
+ "touchend",
118
+ "touchcancel"
119
+ ];
120
+ const inlineEventAttributes$1 = [
121
+ "onclick",
122
+ "ondblclick",
123
+ "onmousedown",
124
+ "onmouseup",
125
+ "onmouseover",
126
+ "onmouseout",
127
+ "onmousemove",
128
+ "onfocus",
129
+ "onblur",
130
+ "onkeydown",
131
+ "onkeypress",
132
+ "onkeyup",
133
+ "onchange",
134
+ "oninput",
135
+ "onsubmit",
136
+ "onreset",
137
+ "onselect",
138
+ "oncontextmenu",
139
+ "ontouchstart",
140
+ "ontouchmove",
141
+ "ontouchend",
142
+ "ontouchcancel"
143
+ ];
144
+ const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
145
+ const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
146
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
147
+ originalAddEventListener$1.call(this, type, listener, options);
148
+ if (this instanceof Element) {
149
+ const eventType = type.toLowerCase();
150
+ if (interactiveEvents$1.includes(eventType)) {
151
+ interactiveElementsRegistry$1.add(this);
152
+ }
153
+ }
154
+ };
155
+ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
156
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
157
+ originalRemoveEventListener$1.call(this, type, listener, options);
158
+ };
159
+ function inspectInlineEventHandlers$1() {
160
+ const allElements = document.querySelectorAll("*");
161
+ allElements.forEach((el) => {
162
+ inlineEventAttributes$1.forEach((attr) => {
163
+ if (el.hasAttribute(attr)) {
164
+ interactiveElementsRegistry$1.add(el);
165
+ }
166
+ });
167
+ });
168
+ }
169
+ if (document.readyState === "complete" || document.readyState === "interactive") {
170
+ inspectInlineEventHandlers$1();
171
+ } else {
172
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
173
+ }
95
174
  const MEDIA_SELECTOR = /(max|min)-device-(width|height)/;
96
175
  const MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, "g");
97
176
  const mediaSelectorPlugin = {
@@ -4123,6 +4202,85 @@ let Mirror$1 = class Mirror2 {
4123
4202
  function createMirror$1() {
4124
4203
  return new Mirror$1();
4125
4204
  }
4205
+ const interactiveEvents = [
4206
+ "change",
4207
+ "submit",
4208
+ "dragstart",
4209
+ "drop",
4210
+ "pointerdown",
4211
+ "pointerup",
4212
+ "input",
4213
+ "keydown",
4214
+ "keyup",
4215
+ "keypress",
4216
+ "mouseenter",
4217
+ "mouseleave",
4218
+ "mouseup",
4219
+ "mousedown",
4220
+ "click",
4221
+ "contextmenu",
4222
+ "dblclick",
4223
+ "focus",
4224
+ "blur",
4225
+ "touchstart",
4226
+ "touchmove",
4227
+ "touchend",
4228
+ "touchcancel"
4229
+ ];
4230
+ const inlineEventAttributes = [
4231
+ "onclick",
4232
+ "ondblclick",
4233
+ "onmousedown",
4234
+ "onmouseup",
4235
+ "onmouseover",
4236
+ "onmouseout",
4237
+ "onmousemove",
4238
+ "onfocus",
4239
+ "onblur",
4240
+ "onkeydown",
4241
+ "onkeypress",
4242
+ "onkeyup",
4243
+ "onchange",
4244
+ "oninput",
4245
+ "onsubmit",
4246
+ "onreset",
4247
+ "onselect",
4248
+ "oncontextmenu",
4249
+ "ontouchstart",
4250
+ "ontouchmove",
4251
+ "ontouchend",
4252
+ "ontouchcancel"
4253
+ ];
4254
+ const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
4255
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
4256
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
4257
+ originalAddEventListener.call(this, type, listener, options);
4258
+ if (this instanceof Element) {
4259
+ const eventType = type.toLowerCase();
4260
+ if (interactiveEvents.includes(eventType)) {
4261
+ interactiveElementsRegistry.add(this);
4262
+ }
4263
+ }
4264
+ };
4265
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
4266
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
4267
+ originalRemoveEventListener.call(this, type, listener, options);
4268
+ };
4269
+ function inspectInlineEventHandlers() {
4270
+ const allElements = document.querySelectorAll("*");
4271
+ allElements.forEach((el) => {
4272
+ inlineEventAttributes.forEach((attr) => {
4273
+ if (el.hasAttribute(attr)) {
4274
+ interactiveElementsRegistry.add(el);
4275
+ }
4276
+ });
4277
+ });
4278
+ }
4279
+ if (document.readyState === "complete" || document.readyState === "interactive") {
4280
+ inspectInlineEventHandlers();
4281
+ } else {
4282
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
4283
+ }
4126
4284
  function getDefaultExportFromCjs(x2) {
4127
4285
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
4128
4286
  }