@highlight-run/rrweb 2.0.0-lambda.2 → 2.0.0-lambda.3
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 +22 -20
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.js +22 -20
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +36 -22
- package/dist/rrweb.umd.cjs.map +2 -2
- package/dist/rrweb.umd.min.cjs +16 -4
- package/dist/rrweb.umd.min.cjs.map +3 -3
- package/package.json +5 -5
package/dist/rrweb.js
CHANGED
|
@@ -15007,8 +15007,12 @@ class Timer {
|
|
|
15007
15007
|
this.actions = this.actions.concat(actions);
|
|
15008
15008
|
}
|
|
15009
15009
|
replaceActions(actions) {
|
|
15010
|
+
const rafWasActive = this.raf === true;
|
|
15010
15011
|
this.actions.length = 0;
|
|
15011
|
-
this.actions
|
|
15012
|
+
this.actions = [...actions];
|
|
15013
|
+
if (rafWasActive) {
|
|
15014
|
+
this.raf = requestAnimationFrame(this.rafCheck.bind(this));
|
|
15015
|
+
}
|
|
15012
15016
|
}
|
|
15013
15017
|
/* End Highlight Code */
|
|
15014
15018
|
start() {
|
|
@@ -15377,28 +15381,26 @@ function createPlayerService(context, { getCastFn, applyEventsSynchronously, emi
|
|
|
15377
15381
|
}),
|
|
15378
15382
|
/* Highlight Code Start */
|
|
15379
15383
|
replaceEvents: o((ctx, machineEvent) => {
|
|
15384
|
+
if (machineEvent.type !== "REPLACE_EVENTS") return ctx;
|
|
15380
15385
|
const { events: curEvents, timer, baselineTime } = ctx;
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
delay: event.delay
|
|
15395
|
-
});
|
|
15396
|
-
}
|
|
15397
|
-
}
|
|
15398
|
-
if (timer.isActive()) {
|
|
15399
|
-
timer.replaceActions(actions);
|
|
15386
|
+
const { events: newEvents } = machineEvent.payload;
|
|
15387
|
+
if (newEvents.length === 0) return ctx;
|
|
15388
|
+
curEvents.length = 0;
|
|
15389
|
+
const actions = [];
|
|
15390
|
+
const timeThreshold = timer.timeOffset + baselineTime;
|
|
15391
|
+
for (const event of newEvents) {
|
|
15392
|
+
addDelay(event, baselineTime);
|
|
15393
|
+
curEvents.push(event);
|
|
15394
|
+
if (event.timestamp >= timeThreshold) {
|
|
15395
|
+
actions.push({
|
|
15396
|
+
doAction: getCastFn(event, false),
|
|
15397
|
+
delay: event.delay
|
|
15398
|
+
});
|
|
15400
15399
|
}
|
|
15401
15400
|
}
|
|
15401
|
+
if (timer.isActive()) {
|
|
15402
|
+
timer.replaceActions(actions);
|
|
15403
|
+
}
|
|
15402
15404
|
return { ...ctx, events: curEvents };
|
|
15403
15405
|
}),
|
|
15404
15406
|
/* Highlight Code End */
|