@appsurify-testmap/rrweb-all 2.0.0-alpha.23 → 2.0.0-alpha.24
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 +262 -101
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +262 -101
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +261 -101
- package/dist/rrweb-all.umd.cjs.map +2 -2
- package/dist/rrweb-all.umd.min.cjs +28 -28
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-all.cjs
CHANGED
|
@@ -7,6 +7,46 @@ var _a$1;
|
|
|
7
7
|
var __defProp$1 = Object.defineProperty;
|
|
8
8
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
9
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
+
var InteractiveEvent = /* @__PURE__ */ ((InteractiveEvent2) => {
|
|
11
|
+
InteractiveEvent2[InteractiveEvent2["Change"] = 0] = "Change";
|
|
12
|
+
InteractiveEvent2[InteractiveEvent2["Submit"] = 1] = "Submit";
|
|
13
|
+
InteractiveEvent2[InteractiveEvent2["DragStart"] = 2] = "DragStart";
|
|
14
|
+
InteractiveEvent2[InteractiveEvent2["Drop"] = 3] = "Drop";
|
|
15
|
+
InteractiveEvent2[InteractiveEvent2["PointerDown"] = 4] = "PointerDown";
|
|
16
|
+
InteractiveEvent2[InteractiveEvent2["PointerUp"] = 5] = "PointerUp";
|
|
17
|
+
InteractiveEvent2[InteractiveEvent2["Input"] = 6] = "Input";
|
|
18
|
+
InteractiveEvent2[InteractiveEvent2["KeyDown"] = 7] = "KeyDown";
|
|
19
|
+
InteractiveEvent2[InteractiveEvent2["KeyUp"] = 8] = "KeyUp";
|
|
20
|
+
InteractiveEvent2[InteractiveEvent2["KeyPress"] = 9] = "KeyPress";
|
|
21
|
+
InteractiveEvent2[InteractiveEvent2["MouseEnter"] = 10] = "MouseEnter";
|
|
22
|
+
InteractiveEvent2[InteractiveEvent2["MouseLeave"] = 11] = "MouseLeave";
|
|
23
|
+
InteractiveEvent2[InteractiveEvent2["MouseUp"] = 12] = "MouseUp";
|
|
24
|
+
InteractiveEvent2[InteractiveEvent2["MouseDown"] = 13] = "MouseDown";
|
|
25
|
+
InteractiveEvent2[InteractiveEvent2["Click"] = 14] = "Click";
|
|
26
|
+
InteractiveEvent2[InteractiveEvent2["ContextMenu"] = 15] = "ContextMenu";
|
|
27
|
+
InteractiveEvent2[InteractiveEvent2["DblClick"] = 16] = "DblClick";
|
|
28
|
+
InteractiveEvent2[InteractiveEvent2["Focus"] = 17] = "Focus";
|
|
29
|
+
InteractiveEvent2[InteractiveEvent2["Blur"] = 18] = "Blur";
|
|
30
|
+
InteractiveEvent2[InteractiveEvent2["TouchStart"] = 19] = "TouchStart";
|
|
31
|
+
InteractiveEvent2[InteractiveEvent2["TouchMove"] = 20] = "TouchMove";
|
|
32
|
+
InteractiveEvent2[InteractiveEvent2["TouchEnd"] = 21] = "TouchEnd";
|
|
33
|
+
InteractiveEvent2[InteractiveEvent2["TouchCancel"] = 22] = "TouchCancel";
|
|
34
|
+
return InteractiveEvent2;
|
|
35
|
+
})(InteractiveEvent || {});
|
|
36
|
+
var interactiveTag = /* @__PURE__ */ ((interactiveTag2) => {
|
|
37
|
+
interactiveTag2[interactiveTag2["Input"] = 0] = "Input";
|
|
38
|
+
interactiveTag2[interactiveTag2["Button"] = 1] = "Button";
|
|
39
|
+
interactiveTag2[interactiveTag2["A"] = 2] = "A";
|
|
40
|
+
interactiveTag2[interactiveTag2["Select"] = 3] = "Select";
|
|
41
|
+
interactiveTag2[interactiveTag2["Textarea"] = 4] = "Textarea";
|
|
42
|
+
interactiveTag2[interactiveTag2["Label"] = 5] = "Label";
|
|
43
|
+
interactiveTag2[interactiveTag2["Details"] = 6] = "Details";
|
|
44
|
+
interactiveTag2[interactiveTag2["Summary"] = 7] = "Summary";
|
|
45
|
+
interactiveTag2[interactiveTag2["Dialog"] = 8] = "Dialog";
|
|
46
|
+
interactiveTag2[interactiveTag2["Video"] = 9] = "Video";
|
|
47
|
+
interactiveTag2[interactiveTag2["Audio"] = 10] = "Audio";
|
|
48
|
+
return interactiveTag2;
|
|
49
|
+
})(interactiveTag || {});
|
|
10
50
|
var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
11
51
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
12
52
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
@@ -158,99 +198,6 @@ const index$1 = {
|
|
|
158
198
|
querySelectorAll: querySelectorAll$1,
|
|
159
199
|
mutationObserver: mutationObserverCtor$1
|
|
160
200
|
};
|
|
161
|
-
function getXPath(node2) {
|
|
162
|
-
if (node2.nodeType === Node.DOCUMENT_NODE) {
|
|
163
|
-
return "/";
|
|
164
|
-
}
|
|
165
|
-
if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
|
|
166
|
-
return "/html/doctype";
|
|
167
|
-
}
|
|
168
|
-
if (node2.nodeType === Node.ELEMENT_NODE) {
|
|
169
|
-
const element = node2;
|
|
170
|
-
if (element.id) {
|
|
171
|
-
return `//*[@id="${element.id}"]`;
|
|
172
|
-
}
|
|
173
|
-
if (element.tagName && element.tagName.toLowerCase() === "html") {
|
|
174
|
-
return "/html";
|
|
175
|
-
}
|
|
176
|
-
if (element === document.head) {
|
|
177
|
-
return "/html/head";
|
|
178
|
-
}
|
|
179
|
-
if (element === document.body) {
|
|
180
|
-
return "/html/body";
|
|
181
|
-
}
|
|
182
|
-
const parentNode2 = element.parentNode;
|
|
183
|
-
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
184
|
-
return "";
|
|
185
|
-
}
|
|
186
|
-
const siblings = Array.from(parentNode2.children).filter(
|
|
187
|
-
(sibling) => sibling.tagName === element.tagName
|
|
188
|
-
);
|
|
189
|
-
const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
|
|
190
|
-
return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
|
|
191
|
-
}
|
|
192
|
-
if (node2.nodeType === Node.TEXT_NODE) {
|
|
193
|
-
const parent = node2.parentNode;
|
|
194
|
-
if (!parent) {
|
|
195
|
-
return "";
|
|
196
|
-
}
|
|
197
|
-
const textSiblings = Array.from(parent.childNodes).filter(
|
|
198
|
-
(sibling) => sibling.nodeType === Node.TEXT_NODE
|
|
199
|
-
);
|
|
200
|
-
const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
|
|
201
|
-
return `${getXPath(parent)}/text()${index2}`;
|
|
202
|
-
}
|
|
203
|
-
if (node2.nodeType === Node.CDATA_SECTION_NODE) {
|
|
204
|
-
const parent = node2.parentNode;
|
|
205
|
-
if (!parent) {
|
|
206
|
-
return "";
|
|
207
|
-
}
|
|
208
|
-
const cdataSiblings = Array.from(parent.childNodes).filter(
|
|
209
|
-
(sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
|
|
210
|
-
);
|
|
211
|
-
const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
|
|
212
|
-
return `${getXPath(parent)}/text()${index2}`;
|
|
213
|
-
}
|
|
214
|
-
if (node2.nodeType === Node.COMMENT_NODE) {
|
|
215
|
-
const parent = node2.parentNode;
|
|
216
|
-
if (!parent) {
|
|
217
|
-
return "";
|
|
218
|
-
}
|
|
219
|
-
const commentSiblings = Array.from(parent.childNodes).filter(
|
|
220
|
-
(sibling) => sibling.nodeType === Node.COMMENT_NODE
|
|
221
|
-
);
|
|
222
|
-
const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
|
|
223
|
-
return `${getXPath(parent)}/comment()${index2}`;
|
|
224
|
-
}
|
|
225
|
-
return "";
|
|
226
|
-
}
|
|
227
|
-
function isElement(n2) {
|
|
228
|
-
return n2.nodeType === n2.ELEMENT_NODE;
|
|
229
|
-
}
|
|
230
|
-
function isTextVisible(n2) {
|
|
231
|
-
var _a2;
|
|
232
|
-
const parent = index$1.parentNode(n2);
|
|
233
|
-
const parentElement2 = parent && parent;
|
|
234
|
-
if (!parentElement2) {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
const isParentVisible = isElementVisible(parentElement2);
|
|
238
|
-
if (!isParentVisible) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
|
|
242
|
-
return textContent2 !== "";
|
|
243
|
-
}
|
|
244
|
-
function isElementVisible(n2) {
|
|
245
|
-
return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
|
|
246
|
-
}
|
|
247
|
-
function isStyleVisible(n2) {
|
|
248
|
-
const style = window.getComputedStyle(n2);
|
|
249
|
-
return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
250
|
-
}
|
|
251
|
-
function isRectVisible(rect) {
|
|
252
|
-
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);
|
|
253
|
-
}
|
|
254
201
|
function isShadowRoot(n2) {
|
|
255
202
|
const hostEl = (
|
|
256
203
|
// anchor and textarea elements also have a `host` property
|
|
@@ -598,6 +545,140 @@ function splitCssText(cssText, style) {
|
|
|
598
545
|
function markCssSplits(cssText, style) {
|
|
599
546
|
return splitCssText(cssText, style).join("/* rr_split */");
|
|
600
547
|
}
|
|
548
|
+
function getXPath(node2) {
|
|
549
|
+
if (node2.nodeType === Node.DOCUMENT_NODE) {
|
|
550
|
+
return "/";
|
|
551
|
+
}
|
|
552
|
+
if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
|
|
553
|
+
return "/html/doctype";
|
|
554
|
+
}
|
|
555
|
+
if (node2.nodeType === Node.ELEMENT_NODE) {
|
|
556
|
+
const element = node2;
|
|
557
|
+
if (element.id) {
|
|
558
|
+
return `//*[@id="${element.id}"]`;
|
|
559
|
+
}
|
|
560
|
+
if (element.tagName && element.tagName.toLowerCase() === "html") {
|
|
561
|
+
return "/html";
|
|
562
|
+
}
|
|
563
|
+
if (element === document.head) {
|
|
564
|
+
return "/html/head";
|
|
565
|
+
}
|
|
566
|
+
if (element === document.body) {
|
|
567
|
+
return "/html/body";
|
|
568
|
+
}
|
|
569
|
+
const parentNode2 = element.parentNode;
|
|
570
|
+
if (!parentNode2 || !(parentNode2 instanceof Element)) {
|
|
571
|
+
return "";
|
|
572
|
+
}
|
|
573
|
+
const siblings = Array.from(parentNode2.children).filter(
|
|
574
|
+
(sibling) => sibling.tagName === element.tagName
|
|
575
|
+
);
|
|
576
|
+
const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
|
|
577
|
+
return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
|
|
578
|
+
}
|
|
579
|
+
if (node2.nodeType === Node.TEXT_NODE) {
|
|
580
|
+
const parent = node2.parentNode;
|
|
581
|
+
if (!parent) {
|
|
582
|
+
return "";
|
|
583
|
+
}
|
|
584
|
+
const textSiblings = Array.from(parent.childNodes).filter(
|
|
585
|
+
(sibling) => sibling.nodeType === Node.TEXT_NODE
|
|
586
|
+
);
|
|
587
|
+
const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
|
|
588
|
+
return `${getXPath(parent)}/text()${index2}`;
|
|
589
|
+
}
|
|
590
|
+
if (node2.nodeType === Node.CDATA_SECTION_NODE) {
|
|
591
|
+
const parent = node2.parentNode;
|
|
592
|
+
if (!parent) {
|
|
593
|
+
return "";
|
|
594
|
+
}
|
|
595
|
+
const cdataSiblings = Array.from(parent.childNodes).filter(
|
|
596
|
+
(sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
|
|
597
|
+
);
|
|
598
|
+
const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
|
|
599
|
+
return `${getXPath(parent)}/text()${index2}`;
|
|
600
|
+
}
|
|
601
|
+
if (node2.nodeType === Node.COMMENT_NODE) {
|
|
602
|
+
const parent = node2.parentNode;
|
|
603
|
+
if (!parent) {
|
|
604
|
+
return "";
|
|
605
|
+
}
|
|
606
|
+
const commentSiblings = Array.from(parent.childNodes).filter(
|
|
607
|
+
(sibling) => sibling.nodeType === Node.COMMENT_NODE
|
|
608
|
+
);
|
|
609
|
+
const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
|
|
610
|
+
return `${getXPath(parent)}/comment()${index2}`;
|
|
611
|
+
}
|
|
612
|
+
return "";
|
|
613
|
+
}
|
|
614
|
+
function isElement(n2) {
|
|
615
|
+
return n2.nodeType === n2.ELEMENT_NODE;
|
|
616
|
+
}
|
|
617
|
+
function isTextVisible(n2) {
|
|
618
|
+
var _a2;
|
|
619
|
+
const parent = index$1.parentNode(n2);
|
|
620
|
+
const parentElement2 = parent && parent;
|
|
621
|
+
if (!parentElement2) {
|
|
622
|
+
return false;
|
|
623
|
+
}
|
|
624
|
+
const isParentVisible = isElementVisible(parentElement2);
|
|
625
|
+
if (!isParentVisible) {
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
|
|
629
|
+
return textContent2 !== "";
|
|
630
|
+
}
|
|
631
|
+
function isElementVisible(n2) {
|
|
632
|
+
return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
|
|
633
|
+
}
|
|
634
|
+
function isStyleVisible(n2) {
|
|
635
|
+
const style = window.getComputedStyle(n2);
|
|
636
|
+
return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
637
|
+
}
|
|
638
|
+
function isRectVisible(rect) {
|
|
639
|
+
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);
|
|
640
|
+
}
|
|
641
|
+
function getInteractiveEvents() {
|
|
642
|
+
return Object.keys(InteractiveEvent).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
|
|
643
|
+
}
|
|
644
|
+
function getInteractiveTags() {
|
|
645
|
+
return Object.keys(interactiveTag).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
|
|
646
|
+
}
|
|
647
|
+
function hasEventListeners(n2) {
|
|
648
|
+
return getInteractiveEvents().some((eventType) => {
|
|
649
|
+
let hasListener = false;
|
|
650
|
+
const testListener = () => {
|
|
651
|
+
hasListener = true;
|
|
652
|
+
};
|
|
653
|
+
n2.addEventListener(eventType, testListener);
|
|
654
|
+
n2.dispatchEvent(new Event(eventType));
|
|
655
|
+
n2.removeEventListener(eventType, testListener);
|
|
656
|
+
return hasListener;
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
function isElementInteractive(n2) {
|
|
660
|
+
var _a2;
|
|
661
|
+
const allowedTags = getInteractiveTags();
|
|
662
|
+
if (n2.nodeType === Node.ELEMENT_NODE) {
|
|
663
|
+
const element = n2;
|
|
664
|
+
const tagName = element.tagName.toLowerCase();
|
|
665
|
+
if (!allowedTags.includes(tagName)) {
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
|
|
669
|
+
const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
|
|
670
|
+
element.getAttribute("role") || ""
|
|
671
|
+
);
|
|
672
|
+
const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
|
|
673
|
+
return result2;
|
|
674
|
+
}
|
|
675
|
+
if (n2.nodeType === Node.TEXT_NODE) {
|
|
676
|
+
const textNode = n2;
|
|
677
|
+
const parentElement2 = textNode.parentElement;
|
|
678
|
+
return parentElement2 !== null && allowedTags.includes(parentElement2.tagName.toLowerCase()) && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
|
|
679
|
+
}
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
601
682
|
let _id = 1;
|
|
602
683
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
603
684
|
const IGNORED_NODE = -2;
|
|
@@ -953,11 +1034,13 @@ function serializeTextNode(n2, options) {
|
|
|
953
1034
|
textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
|
|
954
1035
|
}
|
|
955
1036
|
const isVisible = isTextVisible(n2);
|
|
1037
|
+
const isInteractive = isElementInteractive(n2);
|
|
956
1038
|
return {
|
|
957
1039
|
type: NodeType$3.Text,
|
|
958
1040
|
textContent: textContent2 || "",
|
|
959
1041
|
rootId,
|
|
960
1042
|
isVisible,
|
|
1043
|
+
isInteractive,
|
|
961
1044
|
xPath
|
|
962
1045
|
};
|
|
963
1046
|
}
|
|
@@ -1143,6 +1226,7 @@ function serializeElementNode(n2, options) {
|
|
|
1143
1226
|
} catch (e2) {
|
|
1144
1227
|
}
|
|
1145
1228
|
const isVisible = isElementVisible(n2);
|
|
1229
|
+
const isInteractive = isElementInteractive(n2);
|
|
1146
1230
|
return {
|
|
1147
1231
|
type: NodeType$3.Element,
|
|
1148
1232
|
tagName,
|
|
@@ -1153,6 +1237,7 @@ function serializeElementNode(n2, options) {
|
|
|
1153
1237
|
rootId,
|
|
1154
1238
|
isCustom: isCustomElement,
|
|
1155
1239
|
isVisible,
|
|
1240
|
+
isInteractive,
|
|
1156
1241
|
xPath
|
|
1157
1242
|
};
|
|
1158
1243
|
}
|
|
@@ -10926,20 +11011,20 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
|
|
|
10926
11011
|
IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
|
|
10927
11012
|
IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
|
|
10928
11013
|
IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
|
|
11014
|
+
IncrementalSource2[IncrementalSource2["VisibilityChange"] = 17] = "VisibilityChange";
|
|
10929
11015
|
return IncrementalSource2;
|
|
10930
11016
|
})(IncrementalSource || {});
|
|
10931
11017
|
var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
10932
11018
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
10933
11019
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
10934
11020
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
10935
|
-
MouseInteractions2[MouseInteractions2["
|
|
10936
|
-
MouseInteractions2[MouseInteractions2["
|
|
10937
|
-
MouseInteractions2[MouseInteractions2["
|
|
10938
|
-
MouseInteractions2[MouseInteractions2["
|
|
10939
|
-
MouseInteractions2[MouseInteractions2["
|
|
10940
|
-
MouseInteractions2[MouseInteractions2["
|
|
10941
|
-
MouseInteractions2[MouseInteractions2["
|
|
10942
|
-
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
11021
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 3] = "DblClick";
|
|
11022
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 4] = "Focus";
|
|
11023
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 5] = "Blur";
|
|
11024
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 6] = "TouchStart";
|
|
11025
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 7] = "TouchMove_Departed";
|
|
11026
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 8] = "TouchEnd";
|
|
11027
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 9] = "TouchCancel";
|
|
10943
11028
|
return MouseInteractions2;
|
|
10944
11029
|
})(MouseInteractions || {});
|
|
10945
11030
|
var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
|
|
@@ -11639,6 +11724,54 @@ function initMutationObserver(options, rootEl) {
|
|
|
11639
11724
|
});
|
|
11640
11725
|
return observer;
|
|
11641
11726
|
}
|
|
11727
|
+
function initVisibilityObserver({
|
|
11728
|
+
visibilityChangeCb,
|
|
11729
|
+
doc,
|
|
11730
|
+
mirror: mirror2
|
|
11731
|
+
}) {
|
|
11732
|
+
if (!visibilityChangeCb) {
|
|
11733
|
+
return () => {
|
|
11734
|
+
};
|
|
11735
|
+
}
|
|
11736
|
+
const observedElements = /* @__PURE__ */ new WeakMap();
|
|
11737
|
+
const observer = new IntersectionObserver(
|
|
11738
|
+
(entries) => {
|
|
11739
|
+
entries.forEach((entry) => {
|
|
11740
|
+
const target = entry.target;
|
|
11741
|
+
const id = mirror2.getId(target);
|
|
11742
|
+
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
11743
|
+
if (id !== -1) {
|
|
11744
|
+
if (observedElements.has(target)) {
|
|
11745
|
+
visibilityChangeCb({
|
|
11746
|
+
id,
|
|
11747
|
+
isVisible,
|
|
11748
|
+
visibilityRatio: entry.intersectionRatio,
|
|
11749
|
+
boundingRect: entry.boundingClientRect
|
|
11750
|
+
});
|
|
11751
|
+
} else {
|
|
11752
|
+
observedElements.set(target, true);
|
|
11753
|
+
}
|
|
11754
|
+
}
|
|
11755
|
+
});
|
|
11756
|
+
},
|
|
11757
|
+
{ root: null, threshold: [0.1, 0.9] }
|
|
11758
|
+
);
|
|
11759
|
+
doc.querySelectorAll("*").forEach((el) => observer.observe(el));
|
|
11760
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
11761
|
+
mutations.forEach((mutation) => {
|
|
11762
|
+
mutation.addedNodes.forEach((node2) => {
|
|
11763
|
+
if (node2 instanceof Element) {
|
|
11764
|
+
observer.observe(node2);
|
|
11765
|
+
}
|
|
11766
|
+
});
|
|
11767
|
+
});
|
|
11768
|
+
});
|
|
11769
|
+
mutationObserver.observe(doc, { childList: true, subtree: true });
|
|
11770
|
+
return () => {
|
|
11771
|
+
observer.disconnect();
|
|
11772
|
+
mutationObserver.disconnect();
|
|
11773
|
+
};
|
|
11774
|
+
}
|
|
11642
11775
|
function initMoveObserver({
|
|
11643
11776
|
mousemoveCb,
|
|
11644
11777
|
sampling,
|
|
@@ -12454,6 +12587,7 @@ function initCustomElementObserver({
|
|
|
12454
12587
|
function mergeHooks(o2, hooks) {
|
|
12455
12588
|
const {
|
|
12456
12589
|
mutationCb,
|
|
12590
|
+
visibilityChangeCb,
|
|
12457
12591
|
mousemoveCb,
|
|
12458
12592
|
mouseInteractionCb,
|
|
12459
12593
|
scrollCb,
|
|
@@ -12473,6 +12607,12 @@ function mergeHooks(o2, hooks) {
|
|
|
12473
12607
|
}
|
|
12474
12608
|
mutationCb(...p);
|
|
12475
12609
|
};
|
|
12610
|
+
o2.visibilityChangeCb = (...p) => {
|
|
12611
|
+
if (hooks.visibilityChange) {
|
|
12612
|
+
hooks.visibilityChange(...p);
|
|
12613
|
+
}
|
|
12614
|
+
visibilityChangeCb(...p);
|
|
12615
|
+
};
|
|
12476
12616
|
o2.mousemoveCb = (...p) => {
|
|
12477
12617
|
if (hooks.mousemove) {
|
|
12478
12618
|
hooks.mousemove(...p);
|
|
@@ -12547,6 +12687,7 @@ function mergeHooks(o2, hooks) {
|
|
|
12547
12687
|
};
|
|
12548
12688
|
}
|
|
12549
12689
|
function initObservers(o2, hooks = {}) {
|
|
12690
|
+
console.info("initObservers", o2);
|
|
12550
12691
|
const currentWindow = o2.doc.defaultView;
|
|
12551
12692
|
if (!currentWindow) {
|
|
12552
12693
|
return () => {
|
|
@@ -12565,6 +12706,7 @@ function initObservers(o2, hooks = {}) {
|
|
|
12565
12706
|
});
|
|
12566
12707
|
const inputHandler = initInputObserver(o2);
|
|
12567
12708
|
const mediaInteractionHandler = initMediaInteractionObserver(o2);
|
|
12709
|
+
const visibleHandler = initVisibilityObserver(o2);
|
|
12568
12710
|
let styleSheetObserver = () => {
|
|
12569
12711
|
};
|
|
12570
12712
|
let adoptedStyleSheetObserver = () => {
|
|
@@ -12594,6 +12736,7 @@ function initObservers(o2, hooks = {}) {
|
|
|
12594
12736
|
return callbackWrapper(() => {
|
|
12595
12737
|
mutationBuffers.forEach((b) => b.reset());
|
|
12596
12738
|
mutationObserver == null ? void 0 : mutationObserver.disconnect();
|
|
12739
|
+
visibleHandler();
|
|
12597
12740
|
mousemoveHandler();
|
|
12598
12741
|
mouseInteractionHandler();
|
|
12599
12742
|
scrollHandler();
|
|
@@ -13680,6 +13823,7 @@ function record(options = {}) {
|
|
|
13680
13823
|
emit,
|
|
13681
13824
|
checkoutEveryNms,
|
|
13682
13825
|
checkoutEveryNth,
|
|
13826
|
+
checkoutEveryEvc,
|
|
13683
13827
|
blockClass = "rr-block",
|
|
13684
13828
|
blockSelector = null,
|
|
13685
13829
|
ignoreClass = "rr-ignore",
|
|
@@ -13970,6 +14114,11 @@ function record(options = {}) {
|
|
|
13970
14114
|
mirror.getId(document)
|
|
13971
14115
|
);
|
|
13972
14116
|
};
|
|
14117
|
+
const debouncedFullSnapshot = throttle(() => {
|
|
14118
|
+
if (checkoutEveryEvc) {
|
|
14119
|
+
takeFullSnapshot$1(true);
|
|
14120
|
+
}
|
|
14121
|
+
}, 100, { leading: false, trailing: true });
|
|
13973
14122
|
try {
|
|
13974
14123
|
const handlers = [];
|
|
13975
14124
|
const observe = (doc) => {
|
|
@@ -13977,6 +14126,18 @@ function record(options = {}) {
|
|
|
13977
14126
|
return callbackWrapper(initObservers)(
|
|
13978
14127
|
{
|
|
13979
14128
|
mutationCb: wrappedMutationEmit,
|
|
14129
|
+
visibilityChangeCb: (v2) => {
|
|
14130
|
+
debouncedFullSnapshot();
|
|
14131
|
+
if (sampling.visibility) {
|
|
14132
|
+
return wrappedEmit({
|
|
14133
|
+
type: EventType.IncrementalSnapshot,
|
|
14134
|
+
data: {
|
|
14135
|
+
source: IncrementalSource.VisibilityChange,
|
|
14136
|
+
...v2
|
|
14137
|
+
}
|
|
14138
|
+
});
|
|
14139
|
+
}
|
|
14140
|
+
},
|
|
13980
14141
|
mousemoveCb: (positions, source) => wrappedEmit({
|
|
13981
14142
|
type: EventType.IncrementalSnapshot,
|
|
13982
14143
|
data: {
|