@appsurify-testmap/rrweb 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.
@@ -18785,7 +18785,7 @@ class ProcessedNodeManager {
18785
18785
  destroy() {
18786
18786
  }
18787
18787
  }
18788
- const version$1 = "3.5.0-alpha.1";
18788
+ const version$1 = "3.6.0-alpha.1";
18789
18789
  let wrappedEmit;
18790
18790
  let takeFullSnapshot$1;
18791
18791
  let canvasManager;
@@ -18908,6 +18908,11 @@ function record(options = {}) {
18908
18908
  let checkoutPending = false;
18909
18909
  let checkoutDebounceTimer = null;
18910
18910
  let checkoutFreezeTimestamp = null;
18911
+ let lastScrollEmitTime = 0;
18912
+ const scrollSettleTime = (sampling.scroll || 100) * 2;
18913
+ let lastSignificantMutationTime = 0;
18914
+ const mutationGracePeriod = 500;
18915
+ let hadVisibilityCheckoutInGrace = false;
18911
18916
  const eventProcessor = (e2) => {
18912
18917
  for (const plugin3 of plugins || []) {
18913
18918
  if (plugin3.eventProcessor) {
@@ -18998,6 +19003,13 @@ function record(options = {}) {
18998
19003
  }
18999
19004
  };
19000
19005
  const wrappedMutationEmit = (m) => {
19006
+ var _a3, _b2;
19007
+ var _a2, _b;
19008
+ 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);
19009
+ if (totalChanges > 10) {
19010
+ lastSignificantMutationTime = nowTimestamp();
19011
+ hadVisibilityCheckoutInGrace = false;
19012
+ }
19001
19013
  wrappedEmit({
19002
19014
  type: EventType.IncrementalSnapshot,
19003
19015
  data: __spreadValues({
@@ -19013,12 +19025,15 @@ function record(options = {}) {
19013
19025
  }, v2)
19014
19026
  });
19015
19027
  };
19016
- const wrappedScrollEmit = (p) => wrappedEmit({
19017
- type: EventType.IncrementalSnapshot,
19018
- data: __spreadValues({
19019
- source: IncrementalSource.Scroll
19020
- }, p)
19021
- });
19028
+ const wrappedScrollEmit = (p) => {
19029
+ lastScrollEmitTime = nowTimestamp();
19030
+ wrappedEmit({
19031
+ type: EventType.IncrementalSnapshot,
19032
+ data: __spreadValues({
19033
+ source: IncrementalSource.Scroll
19034
+ }, p)
19035
+ });
19036
+ };
19022
19037
  const wrappedCanvasMutationEmit = (p) => wrappedEmit({
19023
19038
  type: EventType.IncrementalSnapshot,
19024
19039
  data: __spreadValues({
@@ -19100,9 +19115,19 @@ function record(options = {}) {
19100
19115
  mutationCb: recordVisibility ? wrappedVisibilityEmit : () => {
19101
19116
  },
19102
19117
  notifyActivity: checkoutEveryNvm != null ? (count) => {
19118
+ const now = nowTimestamp();
19119
+ const scrollRecent = now - lastScrollEmitTime < scrollSettleTime;
19120
+ const mutationRecent = now - lastSignificantMutationTime < mutationGracePeriod;
19121
+ if (scrollRecent && !mutationRecent) {
19122
+ return;
19123
+ }
19124
+ if (mutationRecent && hadVisibilityCheckoutInGrace) {
19125
+ return;
19126
+ }
19103
19127
  visibilityMutationCount += count;
19104
19128
  if (visibilityMutationCount >= checkoutEveryNvm) {
19105
19129
  visibilityMutationCount = 0;
19130
+ hadVisibilityCheckoutInGrace = true;
19106
19131
  if (checkoutDebounce) {
19107
19132
  if (!checkoutPending) {
19108
19133
  checkoutPending = true;
@@ -22384,7 +22409,7 @@ class Replayer {
22384
22409
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
22385
22410
  }
22386
22411
  }
22387
- const version = "3.5.0-alpha.1";
22412
+ const version = "3.6.0-alpha.1";
22388
22413
  const { getVersion } = record;
22389
22414
  const { isRecording } = record;
22390
22415
  const { flushCustomEventQueue } = record;