@appsurify-testmap/rrweb-replay 2.0.0-alpha.25 → 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.
@@ -92,6 +92,86 @@ 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
+ console.info("Event type: ", eventType);
151
+ if (interactiveEvents$1.includes(eventType)) {
152
+ interactiveElementsRegistry$1.add(this);
153
+ }
154
+ }
155
+ };
156
+ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
157
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
158
+ originalRemoveEventListener$1.call(this, type, listener, options);
159
+ };
160
+ function inspectInlineEventHandlers$1() {
161
+ const allElements = document.querySelectorAll("*");
162
+ allElements.forEach((el) => {
163
+ inlineEventAttributes$1.forEach((attr) => {
164
+ if (el.hasAttribute(attr)) {
165
+ interactiveElementsRegistry$1.add(el);
166
+ }
167
+ });
168
+ });
169
+ }
170
+ if (document.readyState === "complete" || document.readyState === "interactive") {
171
+ inspectInlineEventHandlers$1();
172
+ } else {
173
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
174
+ }
95
175
  const MEDIA_SELECTOR = /(max|min)-device-(width|height)/;
96
176
  const MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, "g");
97
177
  const mediaSelectorPlugin = {
@@ -4123,6 +4203,86 @@ let Mirror$1 = class Mirror2 {
4123
4203
  function createMirror$1() {
4124
4204
  return new Mirror$1();
4125
4205
  }
4206
+ const interactiveEvents = [
4207
+ "change",
4208
+ "submit",
4209
+ "dragstart",
4210
+ "drop",
4211
+ "pointerdown",
4212
+ "pointerup",
4213
+ "input",
4214
+ "keydown",
4215
+ "keyup",
4216
+ "keypress",
4217
+ "mouseenter",
4218
+ "mouseleave",
4219
+ "mouseup",
4220
+ "mousedown",
4221
+ "click",
4222
+ "contextmenu",
4223
+ "dblclick",
4224
+ "focus",
4225
+ "blur",
4226
+ "touchstart",
4227
+ "touchmove",
4228
+ "touchend",
4229
+ "touchcancel"
4230
+ ];
4231
+ const inlineEventAttributes = [
4232
+ "onclick",
4233
+ "ondblclick",
4234
+ "onmousedown",
4235
+ "onmouseup",
4236
+ "onmouseover",
4237
+ "onmouseout",
4238
+ "onmousemove",
4239
+ "onfocus",
4240
+ "onblur",
4241
+ "onkeydown",
4242
+ "onkeypress",
4243
+ "onkeyup",
4244
+ "onchange",
4245
+ "oninput",
4246
+ "onsubmit",
4247
+ "onreset",
4248
+ "onselect",
4249
+ "oncontextmenu",
4250
+ "ontouchstart",
4251
+ "ontouchmove",
4252
+ "ontouchend",
4253
+ "ontouchcancel"
4254
+ ];
4255
+ const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
4256
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
4257
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
4258
+ originalAddEventListener.call(this, type, listener, options);
4259
+ if (this instanceof Element) {
4260
+ const eventType = type.toLowerCase();
4261
+ console.info("Event type: ", eventType);
4262
+ if (interactiveEvents.includes(eventType)) {
4263
+ interactiveElementsRegistry.add(this);
4264
+ }
4265
+ }
4266
+ };
4267
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
4268
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
4269
+ originalRemoveEventListener.call(this, type, listener, options);
4270
+ };
4271
+ function inspectInlineEventHandlers() {
4272
+ const allElements = document.querySelectorAll("*");
4273
+ allElements.forEach((el) => {
4274
+ inlineEventAttributes.forEach((attr) => {
4275
+ if (el.hasAttribute(attr)) {
4276
+ interactiveElementsRegistry.add(el);
4277
+ }
4278
+ });
4279
+ });
4280
+ }
4281
+ if (document.readyState === "complete" || document.readyState === "interactive") {
4282
+ inspectInlineEventHandlers();
4283
+ } else {
4284
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
4285
+ }
4126
4286
  function getDefaultExportFromCjs(x2) {
4127
4287
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
4128
4288
  }