@appsurify-testmap/rrweb-all 2.0.0-alpha.23 → 2.0.0-alpha.25
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.cjs +261 -102
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +261 -102
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +260 -102
- package/dist/rrweb-all.umd.cjs.map +2 -2
- package/dist/rrweb-all.umd.min.cjs +26 -26
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-all.umd.cjs
CHANGED
|
@@ -51,6 +51,46 @@ var _a$1;
|
|
|
51
51
|
var __defProp$1 = Object.defineProperty;
|
|
52
52
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
53
53
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
54
|
+
var InteractiveEvent = /* @__PURE__ */ ((InteractiveEvent2) => {
|
|
55
|
+
InteractiveEvent2[InteractiveEvent2["Change"] = 0] = "Change";
|
|
56
|
+
InteractiveEvent2[InteractiveEvent2["Submit"] = 1] = "Submit";
|
|
57
|
+
InteractiveEvent2[InteractiveEvent2["DragStart"] = 2] = "DragStart";
|
|
58
|
+
InteractiveEvent2[InteractiveEvent2["Drop"] = 3] = "Drop";
|
|
59
|
+
InteractiveEvent2[InteractiveEvent2["PointerDown"] = 4] = "PointerDown";
|
|
60
|
+
InteractiveEvent2[InteractiveEvent2["PointerUp"] = 5] = "PointerUp";
|
|
61
|
+
InteractiveEvent2[InteractiveEvent2["Input"] = 6] = "Input";
|
|
62
|
+
InteractiveEvent2[InteractiveEvent2["KeyDown"] = 7] = "KeyDown";
|
|
63
|
+
InteractiveEvent2[InteractiveEvent2["KeyUp"] = 8] = "KeyUp";
|
|
64
|
+
InteractiveEvent2[InteractiveEvent2["KeyPress"] = 9] = "KeyPress";
|
|
65
|
+
InteractiveEvent2[InteractiveEvent2["MouseEnter"] = 10] = "MouseEnter";
|
|
66
|
+
InteractiveEvent2[InteractiveEvent2["MouseLeave"] = 11] = "MouseLeave";
|
|
67
|
+
InteractiveEvent2[InteractiveEvent2["MouseUp"] = 12] = "MouseUp";
|
|
68
|
+
InteractiveEvent2[InteractiveEvent2["MouseDown"] = 13] = "MouseDown";
|
|
69
|
+
InteractiveEvent2[InteractiveEvent2["Click"] = 14] = "Click";
|
|
70
|
+
InteractiveEvent2[InteractiveEvent2["ContextMenu"] = 15] = "ContextMenu";
|
|
71
|
+
InteractiveEvent2[InteractiveEvent2["DblClick"] = 16] = "DblClick";
|
|
72
|
+
InteractiveEvent2[InteractiveEvent2["Focus"] = 17] = "Focus";
|
|
73
|
+
InteractiveEvent2[InteractiveEvent2["Blur"] = 18] = "Blur";
|
|
74
|
+
InteractiveEvent2[InteractiveEvent2["TouchStart"] = 19] = "TouchStart";
|
|
75
|
+
InteractiveEvent2[InteractiveEvent2["TouchMove"] = 20] = "TouchMove";
|
|
76
|
+
InteractiveEvent2[InteractiveEvent2["TouchEnd"] = 21] = "TouchEnd";
|
|
77
|
+
InteractiveEvent2[InteractiveEvent2["TouchCancel"] = 22] = "TouchCancel";
|
|
78
|
+
return InteractiveEvent2;
|
|
79
|
+
})(InteractiveEvent || {});
|
|
80
|
+
var interactiveTag = /* @__PURE__ */ ((interactiveTag2) => {
|
|
81
|
+
interactiveTag2[interactiveTag2["Input"] = 0] = "Input";
|
|
82
|
+
interactiveTag2[interactiveTag2["Button"] = 1] = "Button";
|
|
83
|
+
interactiveTag2[interactiveTag2["A"] = 2] = "A";
|
|
84
|
+
interactiveTag2[interactiveTag2["Select"] = 3] = "Select";
|
|
85
|
+
interactiveTag2[interactiveTag2["Textarea"] = 4] = "Textarea";
|
|
86
|
+
interactiveTag2[interactiveTag2["Label"] = 5] = "Label";
|
|
87
|
+
interactiveTag2[interactiveTag2["Details"] = 6] = "Details";
|
|
88
|
+
interactiveTag2[interactiveTag2["Summary"] = 7] = "Summary";
|
|
89
|
+
interactiveTag2[interactiveTag2["Dialog"] = 8] = "Dialog";
|
|
90
|
+
interactiveTag2[interactiveTag2["Video"] = 9] = "Video";
|
|
91
|
+
interactiveTag2[interactiveTag2["Audio"] = 10] = "Audio";
|
|
92
|
+
return interactiveTag2;
|
|
93
|
+
})(interactiveTag || {});
|
|
54
94
|
var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
55
95
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
56
96
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
@@ -202,99 +242,6 @@ const index$1 = {
|
|
|
202
242
|
querySelectorAll: querySelectorAll$1,
|
|
203
243
|
mutationObserver: mutationObserverCtor$1
|
|
204
244
|
};
|
|
205
|
-
function getXPath(node2) {
|
|
206
|
-
if (node2.nodeType === Node.DOCUMENT_NODE) {
|
|
207
|
-
return "/";
|
|
208
|
-
}
|
|
209
|
-
if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
|
|
210
|
-
return "/html/doctype";
|
|
211
|
-
}
|
|
212
|
-
if (node2.nodeType === Node.ELEMENT_NODE) {
|
|
213
|
-
const element = node2;
|
|
214
|
-
if (element.id) {
|
|
215
|
-
return `//*[@id="${element.id}"]`;
|
|
216
|
-
}
|
|
217
|
-
if (element.tagName && element.tagName.toLowerCase() === "html") {
|
|
218
|
-
return "/html";
|
|
219
|
-
}
|
|
220
|
-
if (element === document.head) {
|
|
221
|
-
return "/html/head";
|
|
222
|
-
}
|
|
223
|
-
if (element === document.body) {
|
|
224
|
-
return "/html/body";
|
|
225
|
-
}
|
|
226
|
-
const parentNode2 = element.parentNode;
|
|
227
|
-
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
228
|
-
return "";
|
|
229
|
-
}
|
|
230
|
-
const siblings = Array.from(parentNode2.children).filter(
|
|
231
|
-
(sibling) => sibling.tagName === element.tagName
|
|
232
|
-
);
|
|
233
|
-
const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
|
|
234
|
-
return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
|
|
235
|
-
}
|
|
236
|
-
if (node2.nodeType === Node.TEXT_NODE) {
|
|
237
|
-
const parent = node2.parentNode;
|
|
238
|
-
if (!parent) {
|
|
239
|
-
return "";
|
|
240
|
-
}
|
|
241
|
-
const textSiblings = Array.from(parent.childNodes).filter(
|
|
242
|
-
(sibling) => sibling.nodeType === Node.TEXT_NODE
|
|
243
|
-
);
|
|
244
|
-
const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
|
|
245
|
-
return `${getXPath(parent)}/text()${index2}`;
|
|
246
|
-
}
|
|
247
|
-
if (node2.nodeType === Node.CDATA_SECTION_NODE) {
|
|
248
|
-
const parent = node2.parentNode;
|
|
249
|
-
if (!parent) {
|
|
250
|
-
return "";
|
|
251
|
-
}
|
|
252
|
-
const cdataSiblings = Array.from(parent.childNodes).filter(
|
|
253
|
-
(sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
|
|
254
|
-
);
|
|
255
|
-
const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
|
|
256
|
-
return `${getXPath(parent)}/text()${index2}`;
|
|
257
|
-
}
|
|
258
|
-
if (node2.nodeType === Node.COMMENT_NODE) {
|
|
259
|
-
const parent = node2.parentNode;
|
|
260
|
-
if (!parent) {
|
|
261
|
-
return "";
|
|
262
|
-
}
|
|
263
|
-
const commentSiblings = Array.from(parent.childNodes).filter(
|
|
264
|
-
(sibling) => sibling.nodeType === Node.COMMENT_NODE
|
|
265
|
-
);
|
|
266
|
-
const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
|
|
267
|
-
return `${getXPath(parent)}/comment()${index2}`;
|
|
268
|
-
}
|
|
269
|
-
return "";
|
|
270
|
-
}
|
|
271
|
-
function isElement(n2) {
|
|
272
|
-
return n2.nodeType === n2.ELEMENT_NODE;
|
|
273
|
-
}
|
|
274
|
-
function isTextVisible(n2) {
|
|
275
|
-
var _a2;
|
|
276
|
-
const parent = index$1.parentNode(n2);
|
|
277
|
-
const parentElement2 = parent && parent;
|
|
278
|
-
if (!parentElement2) {
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
281
|
-
const isParentVisible = isElementVisible(parentElement2);
|
|
282
|
-
if (!isParentVisible) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
|
|
286
|
-
return textContent2 !== "";
|
|
287
|
-
}
|
|
288
|
-
function isElementVisible(n2) {
|
|
289
|
-
return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
|
|
290
|
-
}
|
|
291
|
-
function isStyleVisible(n2) {
|
|
292
|
-
const style = window.getComputedStyle(n2);
|
|
293
|
-
return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
294
|
-
}
|
|
295
|
-
function isRectVisible(rect) {
|
|
296
|
-
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);
|
|
297
|
-
}
|
|
298
245
|
function isShadowRoot(n2) {
|
|
299
246
|
const hostEl = (
|
|
300
247
|
// anchor and textarea elements also have a `host` property
|
|
@@ -643,6 +590,140 @@ function splitCssText(cssText, style) {
|
|
|
643
590
|
function markCssSplits(cssText, style) {
|
|
644
591
|
return splitCssText(cssText, style).join("/* rr_split */");
|
|
645
592
|
}
|
|
593
|
+
function getXPath(node2) {
|
|
594
|
+
if (node2.nodeType === Node.DOCUMENT_NODE) {
|
|
595
|
+
return "/";
|
|
596
|
+
}
|
|
597
|
+
if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
|
|
598
|
+
return "/html/doctype";
|
|
599
|
+
}
|
|
600
|
+
if (node2.nodeType === Node.ELEMENT_NODE) {
|
|
601
|
+
const element = node2;
|
|
602
|
+
if (element.id) {
|
|
603
|
+
return `//*[@id="${element.id}"]`;
|
|
604
|
+
}
|
|
605
|
+
if (element.tagName && element.tagName.toLowerCase() === "html") {
|
|
606
|
+
return "/html";
|
|
607
|
+
}
|
|
608
|
+
if (element === document.head) {
|
|
609
|
+
return "/html/head";
|
|
610
|
+
}
|
|
611
|
+
if (element === document.body) {
|
|
612
|
+
return "/html/body";
|
|
613
|
+
}
|
|
614
|
+
const parentNode2 = element.parentNode;
|
|
615
|
+
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
616
|
+
return "";
|
|
617
|
+
}
|
|
618
|
+
const siblings = Array.from(parentNode2.children).filter(
|
|
619
|
+
(sibling) => sibling.tagName === element.tagName
|
|
620
|
+
);
|
|
621
|
+
const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
|
|
622
|
+
return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
|
|
623
|
+
}
|
|
624
|
+
if (node2.nodeType === Node.TEXT_NODE) {
|
|
625
|
+
const parent = node2.parentNode;
|
|
626
|
+
if (!parent) {
|
|
627
|
+
return "";
|
|
628
|
+
}
|
|
629
|
+
const textSiblings = Array.from(parent.childNodes).filter(
|
|
630
|
+
(sibling) => sibling.nodeType === Node.TEXT_NODE
|
|
631
|
+
);
|
|
632
|
+
const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
|
|
633
|
+
return `${getXPath(parent)}/text()${index2}`;
|
|
634
|
+
}
|
|
635
|
+
if (node2.nodeType === Node.CDATA_SECTION_NODE) {
|
|
636
|
+
const parent = node2.parentNode;
|
|
637
|
+
if (!parent) {
|
|
638
|
+
return "";
|
|
639
|
+
}
|
|
640
|
+
const cdataSiblings = Array.from(parent.childNodes).filter(
|
|
641
|
+
(sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
|
|
642
|
+
);
|
|
643
|
+
const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
|
|
644
|
+
return `${getXPath(parent)}/text()${index2}`;
|
|
645
|
+
}
|
|
646
|
+
if (node2.nodeType === Node.COMMENT_NODE) {
|
|
647
|
+
const parent = node2.parentNode;
|
|
648
|
+
if (!parent) {
|
|
649
|
+
return "";
|
|
650
|
+
}
|
|
651
|
+
const commentSiblings = Array.from(parent.childNodes).filter(
|
|
652
|
+
(sibling) => sibling.nodeType === Node.COMMENT_NODE
|
|
653
|
+
);
|
|
654
|
+
const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
|
|
655
|
+
return `${getXPath(parent)}/comment()${index2}`;
|
|
656
|
+
}
|
|
657
|
+
return "";
|
|
658
|
+
}
|
|
659
|
+
function isElement(n2) {
|
|
660
|
+
return n2.nodeType === n2.ELEMENT_NODE;
|
|
661
|
+
}
|
|
662
|
+
function isTextVisible(n2) {
|
|
663
|
+
var _a2;
|
|
664
|
+
const parent = index$1.parentNode(n2);
|
|
665
|
+
const parentElement2 = parent && parent;
|
|
666
|
+
if (!parentElement2) {
|
|
667
|
+
return false;
|
|
668
|
+
}
|
|
669
|
+
const isParentVisible = isElementVisible(parentElement2);
|
|
670
|
+
if (!isParentVisible) {
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
|
|
674
|
+
return textContent2 !== "";
|
|
675
|
+
}
|
|
676
|
+
function isElementVisible(n2) {
|
|
677
|
+
return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
|
|
678
|
+
}
|
|
679
|
+
function isStyleVisible(n2) {
|
|
680
|
+
const style = window.getComputedStyle(n2);
|
|
681
|
+
return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
682
|
+
}
|
|
683
|
+
function isRectVisible(rect) {
|
|
684
|
+
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);
|
|
685
|
+
}
|
|
686
|
+
function getInteractiveEvents() {
|
|
687
|
+
return Object.keys(InteractiveEvent).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
|
|
688
|
+
}
|
|
689
|
+
function getInteractiveTags() {
|
|
690
|
+
return Object.keys(interactiveTag).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
|
|
691
|
+
}
|
|
692
|
+
function hasEventListeners(n2) {
|
|
693
|
+
return getInteractiveEvents().some((eventType) => {
|
|
694
|
+
let hasListener = false;
|
|
695
|
+
const testListener = () => {
|
|
696
|
+
hasListener = true;
|
|
697
|
+
};
|
|
698
|
+
n2.addEventListener(eventType, testListener);
|
|
699
|
+
n2.dispatchEvent(new Event(eventType));
|
|
700
|
+
n2.removeEventListener(eventType, testListener);
|
|
701
|
+
return hasListener;
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
function isElementInteractive(n2) {
|
|
705
|
+
var _a2;
|
|
706
|
+
const allowedTags = getInteractiveTags();
|
|
707
|
+
if (n2.nodeType === Node.ELEMENT_NODE) {
|
|
708
|
+
const element = n2;
|
|
709
|
+
const tagName = element.tagName.toLowerCase();
|
|
710
|
+
if (!allowedTags.includes(tagName)) {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
|
|
714
|
+
const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
|
|
715
|
+
element.getAttribute("role") || ""
|
|
716
|
+
);
|
|
717
|
+
const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
|
|
718
|
+
return result2;
|
|
719
|
+
}
|
|
720
|
+
if (n2.nodeType === Node.TEXT_NODE) {
|
|
721
|
+
const textNode = n2;
|
|
722
|
+
const parentElement2 = textNode.parentElement;
|
|
723
|
+
return parentElement2 !== null && allowedTags.includes(parentElement2.tagName.toLowerCase()) && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
|
|
724
|
+
}
|
|
725
|
+
return false;
|
|
726
|
+
}
|
|
646
727
|
let _id = 1;
|
|
647
728
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
648
729
|
const IGNORED_NODE = -2;
|
|
@@ -998,11 +1079,13 @@ function serializeTextNode(n2, options) {
|
|
|
998
1079
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
999
1080
|
}
|
|
1000
1081
|
const isVisible = isTextVisible(n2);
|
|
1082
|
+
const isInteractive = isElementInteractive(n2);
|
|
1001
1083
|
return {
|
|
1002
1084
|
type: NodeType$3.Text,
|
|
1003
1085
|
textContent: textContent2 || "",
|
|
1004
1086
|
rootId,
|
|
1005
1087
|
isVisible,
|
|
1088
|
+
isInteractive,
|
|
1006
1089
|
xPath
|
|
1007
1090
|
};
|
|
1008
1091
|
}
|
|
@@ -1188,6 +1271,7 @@ function serializeElementNode(n2, options) {
|
|
|
1188
1271
|
} catch (e2) {
|
|
1189
1272
|
}
|
|
1190
1273
|
const isVisible = isElementVisible(n2);
|
|
1274
|
+
const isInteractive = isElementInteractive(n2);
|
|
1191
1275
|
return {
|
|
1192
1276
|
type: NodeType$3.Element,
|
|
1193
1277
|
tagName,
|
|
@@ -1198,6 +1282,7 @@ function serializeElementNode(n2, options) {
|
|
|
1198
1282
|
rootId,
|
|
1199
1283
|
isCustom: isCustomElement,
|
|
1200
1284
|
isVisible,
|
|
1285
|
+
isInteractive,
|
|
1201
1286
|
xPath
|
|
1202
1287
|
};
|
|
1203
1288
|
}
|
|
@@ -10980,20 +11065,20 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
|
|
|
10980
11065
|
IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
|
|
10981
11066
|
IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
|
|
10982
11067
|
IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
|
|
11068
|
+
IncrementalSource2[IncrementalSource2["VisibilityChange"] = 17] = "VisibilityChange";
|
|
10983
11069
|
return IncrementalSource2;
|
|
10984
11070
|
})(IncrementalSource || {});
|
|
10985
11071
|
var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
10986
11072
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
10987
11073
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
10988
11074
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
10989
|
-
MouseInteractions2[MouseInteractions2["
|
|
10990
|
-
MouseInteractions2[MouseInteractions2["
|
|
10991
|
-
MouseInteractions2[MouseInteractions2["
|
|
10992
|
-
MouseInteractions2[MouseInteractions2["
|
|
10993
|
-
MouseInteractions2[MouseInteractions2["
|
|
10994
|
-
MouseInteractions2[MouseInteractions2["
|
|
10995
|
-
MouseInteractions2[MouseInteractions2["
|
|
10996
|
-
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
11075
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 3] = "DblClick";
|
|
11076
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 4] = "Focus";
|
|
11077
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 5] = "Blur";
|
|
11078
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 6] = "TouchStart";
|
|
11079
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 7] = "TouchMove_Departed";
|
|
11080
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 8] = "TouchEnd";
|
|
11081
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 9] = "TouchCancel";
|
|
10997
11082
|
return MouseInteractions2;
|
|
10998
11083
|
})(MouseInteractions || {});
|
|
10999
11084
|
var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
|
|
@@ -11693,6 +11778,60 @@ function initMutationObserver(options, rootEl) {
|
|
|
11693
11778
|
});
|
|
11694
11779
|
return observer;
|
|
11695
11780
|
}
|
|
11781
|
+
function initVisibilityObserver({
|
|
11782
|
+
visibilityChangeCb,
|
|
11783
|
+
doc,
|
|
11784
|
+
mirror: mirror2,
|
|
11785
|
+
sampling
|
|
11786
|
+
}) {
|
|
11787
|
+
if (!visibilityChangeCb) {
|
|
11788
|
+
return () => {
|
|
11789
|
+
};
|
|
11790
|
+
}
|
|
11791
|
+
const observedElements = /* @__PURE__ */ new WeakMap();
|
|
11792
|
+
const debounceThreshold = typeof sampling.visibility === "number" ? sampling.visibility : 50;
|
|
11793
|
+
const throttledCb = throttle(
|
|
11794
|
+
callbackWrapper((entry) => {
|
|
11795
|
+
const target = entry.target;
|
|
11796
|
+
const id = mirror2.getId(target);
|
|
11797
|
+
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
11798
|
+
if (id !== -1) {
|
|
11799
|
+
visibilityChangeCb({
|
|
11800
|
+
id,
|
|
11801
|
+
isVisible,
|
|
11802
|
+
visibilityRatio: entry.intersectionRatio
|
|
11803
|
+
});
|
|
11804
|
+
}
|
|
11805
|
+
}),
|
|
11806
|
+
debounceThreshold,
|
|
11807
|
+
{ leading: sampling.visibility !== false, trailing: true }
|
|
11808
|
+
);
|
|
11809
|
+
const observer = new IntersectionObserver((entries) => {
|
|
11810
|
+
entries.forEach((entry) => {
|
|
11811
|
+
const target = entry.target;
|
|
11812
|
+
if (observedElements.has(target)) {
|
|
11813
|
+
throttledCb(entry);
|
|
11814
|
+
} else {
|
|
11815
|
+
observedElements.set(target, true);
|
|
11816
|
+
}
|
|
11817
|
+
});
|
|
11818
|
+
}, { root: null, threshold: [0.1, 0.9] });
|
|
11819
|
+
doc.querySelectorAll("*").forEach((el) => observer.observe(el));
|
|
11820
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
11821
|
+
mutations.forEach((mutation) => {
|
|
11822
|
+
mutation.addedNodes.forEach((node2) => {
|
|
11823
|
+
if (node2 instanceof Element) {
|
|
11824
|
+
observer.observe(node2);
|
|
11825
|
+
}
|
|
11826
|
+
});
|
|
11827
|
+
});
|
|
11828
|
+
});
|
|
11829
|
+
mutationObserver.observe(doc, { childList: true, subtree: true });
|
|
11830
|
+
return () => {
|
|
11831
|
+
observer.disconnect();
|
|
11832
|
+
mutationObserver.disconnect();
|
|
11833
|
+
};
|
|
11834
|
+
}
|
|
11696
11835
|
function initMoveObserver({
|
|
11697
11836
|
mousemoveCb,
|
|
11698
11837
|
sampling,
|
|
@@ -12506,6 +12645,7 @@ function initCustomElementObserver({
|
|
|
12506
12645
|
function mergeHooks(o2, hooks) {
|
|
12507
12646
|
const {
|
|
12508
12647
|
mutationCb,
|
|
12648
|
+
visibilityChangeCb,
|
|
12509
12649
|
mousemoveCb,
|
|
12510
12650
|
mouseInteractionCb,
|
|
12511
12651
|
scrollCb,
|
|
@@ -12525,6 +12665,12 @@ function mergeHooks(o2, hooks) {
|
|
|
12525
12665
|
}
|
|
12526
12666
|
mutationCb(...p);
|
|
12527
12667
|
};
|
|
12668
|
+
o2.visibilityChangeCb = (...p) => {
|
|
12669
|
+
if (hooks.visibilityChange) {
|
|
12670
|
+
hooks.visibilityChange(...p);
|
|
12671
|
+
}
|
|
12672
|
+
visibilityChangeCb(...p);
|
|
12673
|
+
};
|
|
12528
12674
|
o2.mousemoveCb = (...p) => {
|
|
12529
12675
|
if (hooks.mousemove) {
|
|
12530
12676
|
hooks.mousemove(...p);
|
|
@@ -12617,6 +12763,7 @@ function initObservers(o2, hooks = {}) {
|
|
|
12617
12763
|
});
|
|
12618
12764
|
const inputHandler = initInputObserver(o2);
|
|
12619
12765
|
const mediaInteractionHandler = initMediaInteractionObserver(o2);
|
|
12766
|
+
const visibleHandler = initVisibilityObserver(o2);
|
|
12620
12767
|
let styleSheetObserver = () => {
|
|
12621
12768
|
};
|
|
12622
12769
|
let adoptedStyleSheetObserver = () => {
|
|
@@ -12646,6 +12793,7 @@ function initObservers(o2, hooks = {}) {
|
|
|
12646
12793
|
return callbackWrapper(() => {
|
|
12647
12794
|
mutationBuffers.forEach((b) => b.reset());
|
|
12648
12795
|
mutationObserver == null ? void 0 : mutationObserver.disconnect();
|
|
12796
|
+
visibleHandler();
|
|
12649
12797
|
mousemoveHandler();
|
|
12650
12798
|
mouseInteractionHandler();
|
|
12651
12799
|
scrollHandler();
|
|
@@ -13730,6 +13878,7 @@ function record(options = {}) {
|
|
|
13730
13878
|
emit,
|
|
13731
13879
|
checkoutEveryNms,
|
|
13732
13880
|
checkoutEveryNth,
|
|
13881
|
+
checkoutEveryEvc,
|
|
13733
13882
|
blockClass = "rr-block",
|
|
13734
13883
|
blockSelector = null,
|
|
13735
13884
|
ignoreClass = "rr-ignore",
|
|
@@ -13858,7 +14007,8 @@ function record(options = {}) {
|
|
|
13858
14007
|
incrementalSnapshotCount++;
|
|
13859
14008
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
13860
14009
|
const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
13861
|
-
|
|
14010
|
+
const isVisibilityChanged = checkoutEveryEvc && e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.VisibilityChange;
|
|
14011
|
+
if (exceedCount || exceedTime || isVisibilityChanged) {
|
|
13862
14012
|
takeFullSnapshot$1(true);
|
|
13863
14013
|
}
|
|
13864
14014
|
}
|
|
@@ -14023,6 +14173,14 @@ function record(options = {}) {
|
|
|
14023
14173
|
return callbackWrapper(initObservers)(
|
|
14024
14174
|
{
|
|
14025
14175
|
mutationCb: wrappedMutationEmit,
|
|
14176
|
+
visibilityChangeCb: (v2) => {
|
|
14177
|
+
wrappedEmit({
|
|
14178
|
+
type: EventType.IncrementalSnapshot,
|
|
14179
|
+
data: __spreadValues({
|
|
14180
|
+
source: IncrementalSource.VisibilityChange
|
|
14181
|
+
}, v2)
|
|
14182
|
+
});
|
|
14183
|
+
},
|
|
14026
14184
|
mousemoveCb: (positions, source) => wrappedEmit({
|
|
14027
14185
|
type: EventType.IncrementalSnapshot,
|
|
14028
14186
|
data: {
|