@appsurify-testmap/rrweb-all 2.0.0-alpha.24 → 2.0.0-alpha.30
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 +37 -39
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +37 -39
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +36 -38
- 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.cjs
CHANGED
|
@@ -11727,35 +11727,41 @@ function initMutationObserver(options, rootEl) {
|
|
|
11727
11727
|
function initVisibilityObserver({
|
|
11728
11728
|
visibilityChangeCb,
|
|
11729
11729
|
doc,
|
|
11730
|
-
mirror: mirror2
|
|
11730
|
+
mirror: mirror2,
|
|
11731
|
+
sampling
|
|
11731
11732
|
}) {
|
|
11732
11733
|
if (!visibilityChangeCb) {
|
|
11733
11734
|
return () => {
|
|
11734
11735
|
};
|
|
11735
11736
|
}
|
|
11736
11737
|
const observedElements = /* @__PURE__ */ new WeakMap();
|
|
11737
|
-
const
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
}
|
|
11754
|
-
}
|
|
11755
|
-
});
|
|
11756
|
-
},
|
|
11757
|
-
{ root: null, threshold: [0.1, 0.9] }
|
|
11738
|
+
const debounceThreshold = typeof sampling.visibility === "number" ? sampling.visibility : 50;
|
|
11739
|
+
const throttledCb = throttle(
|
|
11740
|
+
callbackWrapper((entry) => {
|
|
11741
|
+
const target = entry.target;
|
|
11742
|
+
const id = mirror2.getId(target);
|
|
11743
|
+
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
11744
|
+
if (id !== -1) {
|
|
11745
|
+
visibilityChangeCb({
|
|
11746
|
+
id,
|
|
11747
|
+
isVisible,
|
|
11748
|
+
visibilityRatio: entry.intersectionRatio
|
|
11749
|
+
});
|
|
11750
|
+
}
|
|
11751
|
+
}),
|
|
11752
|
+
debounceThreshold,
|
|
11753
|
+
{ leading: sampling.visibility !== false, trailing: true }
|
|
11758
11754
|
);
|
|
11755
|
+
const observer = new IntersectionObserver((entries) => {
|
|
11756
|
+
entries.forEach((entry) => {
|
|
11757
|
+
const target = entry.target;
|
|
11758
|
+
if (observedElements.has(target)) {
|
|
11759
|
+
throttledCb(entry);
|
|
11760
|
+
} else {
|
|
11761
|
+
observedElements.set(target, true);
|
|
11762
|
+
}
|
|
11763
|
+
});
|
|
11764
|
+
}, { root: null, threshold: [0.1, 0.9] });
|
|
11759
11765
|
doc.querySelectorAll("*").forEach((el) => observer.observe(el));
|
|
11760
11766
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
11761
11767
|
mutations.forEach((mutation) => {
|
|
@@ -12687,7 +12693,6 @@ function mergeHooks(o2, hooks) {
|
|
|
12687
12693
|
};
|
|
12688
12694
|
}
|
|
12689
12695
|
function initObservers(o2, hooks = {}) {
|
|
12690
|
-
console.info("initObservers", o2);
|
|
12691
12696
|
const currentWindow = o2.doc.defaultView;
|
|
12692
12697
|
if (!currentWindow) {
|
|
12693
12698
|
return () => {
|
|
@@ -13952,7 +13957,8 @@ function record(options = {}) {
|
|
|
13952
13957
|
incrementalSnapshotCount++;
|
|
13953
13958
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
13954
13959
|
const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
13955
|
-
|
|
13960
|
+
const isVisibilityChanged = checkoutEveryEvc && e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.VisibilityChange;
|
|
13961
|
+
if (exceedCount || exceedTime || isVisibilityChanged) {
|
|
13956
13962
|
takeFullSnapshot$1(true);
|
|
13957
13963
|
}
|
|
13958
13964
|
}
|
|
@@ -14114,11 +14120,6 @@ function record(options = {}) {
|
|
|
14114
14120
|
mirror.getId(document)
|
|
14115
14121
|
);
|
|
14116
14122
|
};
|
|
14117
|
-
const debouncedFullSnapshot = throttle(() => {
|
|
14118
|
-
if (checkoutEveryEvc) {
|
|
14119
|
-
takeFullSnapshot$1(true);
|
|
14120
|
-
}
|
|
14121
|
-
}, 100, { leading: false, trailing: true });
|
|
14122
14123
|
try {
|
|
14123
14124
|
const handlers = [];
|
|
14124
14125
|
const observe = (doc) => {
|
|
@@ -14127,16 +14128,13 @@ function record(options = {}) {
|
|
|
14127
14128
|
{
|
|
14128
14129
|
mutationCb: wrappedMutationEmit,
|
|
14129
14130
|
visibilityChangeCb: (v2) => {
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
}
|
|
14138
|
-
});
|
|
14139
|
-
}
|
|
14131
|
+
wrappedEmit({
|
|
14132
|
+
type: EventType.IncrementalSnapshot,
|
|
14133
|
+
data: {
|
|
14134
|
+
source: IncrementalSource.VisibilityChange,
|
|
14135
|
+
...v2
|
|
14136
|
+
}
|
|
14137
|
+
});
|
|
14140
14138
|
},
|
|
14141
14139
|
mousemoveCb: (positions, source) => wrappedEmit({
|
|
14142
14140
|
type: EventType.IncrementalSnapshot,
|