@appsurify-testmap/rrweb-record 3.5.0-alpha.1 → 3.6.0-alpha.1

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.
@@ -16723,7 +16723,7 @@ class ProcessedNodeManager {
16723
16723
  destroy() {
16724
16724
  }
16725
16725
  }
16726
- const version$1 = "3.5.0-alpha.1";
16726
+ const version$1 = "3.6.0-alpha.1";
16727
16727
  let wrappedEmit;
16728
16728
  let takeFullSnapshot$1;
16729
16729
  let canvasManager;
@@ -16846,6 +16846,11 @@ function record(options = {}) {
16846
16846
  let checkoutPending = false;
16847
16847
  let checkoutDebounceTimer = null;
16848
16848
  let checkoutFreezeTimestamp = null;
16849
+ let lastScrollEmitTime = 0;
16850
+ const scrollSettleTime = (sampling.scroll || 100) * 2;
16851
+ let lastSignificantMutationTime = 0;
16852
+ const mutationGracePeriod = 500;
16853
+ let hadVisibilityCheckoutInGrace = false;
16849
16854
  const eventProcessor = (e2) => {
16850
16855
  for (const plugin3 of plugins || []) {
16851
16856
  if (plugin3.eventProcessor) {
@@ -16936,6 +16941,13 @@ function record(options = {}) {
16936
16941
  }
16937
16942
  };
16938
16943
  const wrappedMutationEmit = (m) => {
16944
+ var _a3, _b2;
16945
+ var _a2, _b;
16946
+ const totalChanges = ((_a3 = (_a2 = m.adds) == null ? void 0 : _a2.length) != null ? _a3 : 0) + ((_b2 = (_b = m.removes) == null ? void 0 : _b.length) != null ? _b2 : 0);
16947
+ if (totalChanges > 10) {
16948
+ lastSignificantMutationTime = nowTimestamp();
16949
+ hadVisibilityCheckoutInGrace = false;
16950
+ }
16939
16951
  wrappedEmit({
16940
16952
  type: EventType.IncrementalSnapshot,
16941
16953
  data: __spreadValues({
@@ -16951,12 +16963,15 @@ function record(options = {}) {
16951
16963
  }, v2)
16952
16964
  });
16953
16965
  };
16954
- const wrappedScrollEmit = (p) => wrappedEmit({
16955
- type: EventType.IncrementalSnapshot,
16956
- data: __spreadValues({
16957
- source: IncrementalSource.Scroll
16958
- }, p)
16959
- });
16966
+ const wrappedScrollEmit = (p) => {
16967
+ lastScrollEmitTime = nowTimestamp();
16968
+ wrappedEmit({
16969
+ type: EventType.IncrementalSnapshot,
16970
+ data: __spreadValues({
16971
+ source: IncrementalSource.Scroll
16972
+ }, p)
16973
+ });
16974
+ };
16960
16975
  const wrappedCanvasMutationEmit = (p) => wrappedEmit({
16961
16976
  type: EventType.IncrementalSnapshot,
16962
16977
  data: __spreadValues({
@@ -17038,9 +17053,19 @@ function record(options = {}) {
17038
17053
  mutationCb: recordVisibility ? wrappedVisibilityEmit : () => {
17039
17054
  },
17040
17055
  notifyActivity: checkoutEveryNvm != null ? (count) => {
17056
+ const now = nowTimestamp();
17057
+ const scrollRecent = now - lastScrollEmitTime < scrollSettleTime;
17058
+ const mutationRecent = now - lastSignificantMutationTime < mutationGracePeriod;
17059
+ if (scrollRecent && !mutationRecent) {
17060
+ return;
17061
+ }
17062
+ if (mutationRecent && hadVisibilityCheckoutInGrace) {
17063
+ return;
17064
+ }
17041
17065
  visibilityMutationCount += count;
17042
17066
  if (visibilityMutationCount >= checkoutEveryNvm) {
17043
17067
  visibilityMutationCount = 0;
17068
+ hadVisibilityCheckoutInGrace = true;
17044
17069
  if (checkoutDebounce) {
17045
17070
  if (!checkoutPending) {
17046
17071
  checkoutPending = true;