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