@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.
package/dist/rrweb.cjs CHANGED
@@ -18258,7 +18258,7 @@ class ProcessedNodeManager {
18258
18258
  destroy() {
18259
18259
  }
18260
18260
  }
18261
- const version$1 = "3.5.0-alpha.1";
18261
+ const version$1 = "3.6.0-alpha.1";
18262
18262
  let wrappedEmit;
18263
18263
  let takeFullSnapshot$1;
18264
18264
  let canvasManager;
@@ -18381,6 +18381,11 @@ function record(options = {}) {
18381
18381
  let checkoutPending = false;
18382
18382
  let checkoutDebounceTimer = null;
18383
18383
  let checkoutFreezeTimestamp = null;
18384
+ let lastScrollEmitTime = 0;
18385
+ const scrollSettleTime = (sampling.scroll || 100) * 2;
18386
+ let lastSignificantMutationTime = 0;
18387
+ const mutationGracePeriod = 500;
18388
+ let hadVisibilityCheckoutInGrace = false;
18384
18389
  const eventProcessor = (e2) => {
18385
18390
  for (const plugin3 of plugins || []) {
18386
18391
  if (plugin3.eventProcessor) {
@@ -18471,6 +18476,12 @@ function record(options = {}) {
18471
18476
  }
18472
18477
  };
18473
18478
  const wrappedMutationEmit = (m) => {
18479
+ var _a2, _b;
18480
+ const totalChanges = (((_a2 = m.adds) == null ? void 0 : _a2.length) ?? 0) + (((_b = m.removes) == null ? void 0 : _b.length) ?? 0);
18481
+ if (totalChanges > 10) {
18482
+ lastSignificantMutationTime = nowTimestamp();
18483
+ hadVisibilityCheckoutInGrace = false;
18484
+ }
18474
18485
  wrappedEmit({
18475
18486
  type: EventType.IncrementalSnapshot,
18476
18487
  data: {
@@ -18488,13 +18499,16 @@ function record(options = {}) {
18488
18499
  }
18489
18500
  });
18490
18501
  };
18491
- const wrappedScrollEmit = (p) => wrappedEmit({
18492
- type: EventType.IncrementalSnapshot,
18493
- data: {
18494
- source: IncrementalSource.Scroll,
18495
- ...p
18496
- }
18497
- });
18502
+ const wrappedScrollEmit = (p) => {
18503
+ lastScrollEmitTime = nowTimestamp();
18504
+ wrappedEmit({
18505
+ type: EventType.IncrementalSnapshot,
18506
+ data: {
18507
+ source: IncrementalSource.Scroll,
18508
+ ...p
18509
+ }
18510
+ });
18511
+ };
18498
18512
  const wrappedCanvasMutationEmit = (p) => wrappedEmit({
18499
18513
  type: EventType.IncrementalSnapshot,
18500
18514
  data: {
@@ -18578,9 +18592,19 @@ function record(options = {}) {
18578
18592
  mutationCb: recordVisibility ? wrappedVisibilityEmit : () => {
18579
18593
  },
18580
18594
  notifyActivity: checkoutEveryNvm != null ? (count) => {
18595
+ const now = nowTimestamp();
18596
+ const scrollRecent = now - lastScrollEmitTime < scrollSettleTime;
18597
+ const mutationRecent = now - lastSignificantMutationTime < mutationGracePeriod;
18598
+ if (scrollRecent && !mutationRecent) {
18599
+ return;
18600
+ }
18601
+ if (mutationRecent && hadVisibilityCheckoutInGrace) {
18602
+ return;
18603
+ }
18581
18604
  visibilityMutationCount += count;
18582
18605
  if (visibilityMutationCount >= checkoutEveryNvm) {
18583
18606
  visibilityMutationCount = 0;
18607
+ hadVisibilityCheckoutInGrace = true;
18584
18608
  if (checkoutDebounce) {
18585
18609
  if (!checkoutPending) {
18586
18610
  checkoutPending = true;
@@ -21837,7 +21861,7 @@ class Replayer {
21837
21861
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
21838
21862
  }
21839
21863
  }
21840
- const version = "3.5.0-alpha.1";
21864
+ const version = "3.6.0-alpha.1";
21841
21865
  const { getVersion } = record;
21842
21866
  const { isRecording } = record;
21843
21867
  const { flushCustomEventQueue } = record;