@highlight-run/rrweb 2.0.0-lambda.1 → 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.umd.cjs
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
(function (g, f) {
|
|
1
|
+
(function (g, f) {
|
|
2
|
+
if ("object" == typeof exports && "object" == typeof module) {
|
|
3
|
+
module.exports = f();
|
|
4
|
+
} else if ("function" == typeof define && define.amd) {
|
|
5
|
+
define("rrweb", [], f);
|
|
6
|
+
} else if ("object" == typeof exports) {
|
|
7
|
+
exports["rrweb"] = f();
|
|
8
|
+
} else {
|
|
9
|
+
g["rrweb"] = f();
|
|
10
|
+
}
|
|
11
|
+
}(this, () => {
|
|
12
|
+
var exports = {};
|
|
13
|
+
var module = { exports };
|
|
2
14
|
"use strict";
|
|
3
15
|
var __defProp = Object.defineProperty;
|
|
4
16
|
var __defProps = Object.defineProperties;
|
|
@@ -15011,8 +15023,12 @@ class Timer {
|
|
|
15011
15023
|
this.actions = this.actions.concat(actions);
|
|
15012
15024
|
}
|
|
15013
15025
|
replaceActions(actions) {
|
|
15026
|
+
const rafWasActive = this.raf === true;
|
|
15014
15027
|
this.actions.length = 0;
|
|
15015
|
-
this.actions
|
|
15028
|
+
this.actions = [...actions];
|
|
15029
|
+
if (rafWasActive) {
|
|
15030
|
+
this.raf = requestAnimationFrame(this.rafCheck.bind(this));
|
|
15031
|
+
}
|
|
15016
15032
|
}
|
|
15017
15033
|
/* End Highlight Code */
|
|
15018
15034
|
start() {
|
|
@@ -15379,28 +15395,26 @@ function createPlayerService(context, { getCastFn, applyEventsSynchronously, emi
|
|
|
15379
15395
|
}),
|
|
15380
15396
|
/* Highlight Code Start */
|
|
15381
15397
|
replaceEvents: o((ctx, machineEvent) => {
|
|
15398
|
+
if (machineEvent.type !== "REPLACE_EVENTS") return ctx;
|
|
15382
15399
|
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);
|
|
15400
|
+
const { events: newEvents } = machineEvent.payload;
|
|
15401
|
+
if (newEvents.length === 0) return ctx;
|
|
15402
|
+
curEvents.length = 0;
|
|
15403
|
+
const actions = [];
|
|
15404
|
+
const timeThreshold = timer.timeOffset + baselineTime;
|
|
15405
|
+
for (const event of newEvents) {
|
|
15406
|
+
addDelay(event, baselineTime);
|
|
15407
|
+
curEvents.push(event);
|
|
15408
|
+
if (event.timestamp >= timeThreshold) {
|
|
15409
|
+
actions.push({
|
|
15410
|
+
doAction: getCastFn(event, false),
|
|
15411
|
+
delay: event.delay
|
|
15412
|
+
});
|
|
15402
15413
|
}
|
|
15403
15414
|
}
|
|
15415
|
+
if (timer.isActive()) {
|
|
15416
|
+
timer.replaceActions(actions);
|
|
15417
|
+
}
|
|
15404
15418
|
return __spreadProps(__spreadValues({}, ctx), { events: curEvents });
|
|
15405
15419
|
}),
|
|
15406
15420
|
/* Highlight Code End */
|
|
@@ -17790,7 +17804,7 @@ exports.freezePage = freezePage;
|
|
|
17790
17804
|
exports.record = record;
|
|
17791
17805
|
exports.takeFullSnapshot = takeFullSnapshot;
|
|
17792
17806
|
exports.utils = utils;
|
|
17793
|
-
|
|
17807
|
+
if (typeof module.exports == "object" && typeof exports == "object") {
|
|
17794
17808
|
var __cp = (to, from, except, desc) => {
|
|
17795
17809
|
if ((from && typeof from === "object") || typeof from === "function") {
|
|
17796
17810
|
for (let key of Object.getOwnPropertyNames(from)) {
|